pict 1.0.192 → 1.0.194
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/pict.compatible.js +126 -89
- package/dist/pict.compatible.min.js +1 -1
- package/dist/pict.compatible.min.js.map +1 -1
- package/dist/pict.js +126 -89
- package/dist/pict.min.js +1 -1
- package/dist/pict.min.js.map +1 -1
- package/package.json +2 -2
package/dist/pict.compatible.js
CHANGED
|
@@ -4168,18 +4168,24 @@ if(!(pTemplateHash in this.templates)){this.checkDefaultTemplateHash(pTemplateHa
|
|
|
4168
4168
|
* @param {string} pTemplateHash - The hash contents of the template (what's between the template start and stop tags)
|
|
4169
4169
|
* @param {object} pRecord - The json object to be used as the Record for the template render
|
|
4170
4170
|
* @param {array} pContextArray - An array of context objects accessible from the template; safe to leave empty
|
|
4171
|
+
*
|
|
4172
|
+
* @return {string} The rendered template
|
|
4171
4173
|
*/_inherits(PictTemplateProvider,_libFableServiceBase22);return _createClass2(PictTemplateProvider,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){return'';}/**
|
|
4172
|
-
*
|
|
4174
|
+
* Render a template expression, deliver a string with the resulting content to a callback function.
|
|
4175
|
+
*
|
|
4173
4176
|
* @param {string} pTemplateHash - The hash contents of the template (what's between the template start and stop tags)
|
|
4174
4177
|
* @param {object} pRecord - The json object to be used as the Record for the template render
|
|
4175
4178
|
* @param {array} pContextArray - An array of context objects accessible from the template; safe to leave empty
|
|
4176
|
-
* @param {
|
|
4177
|
-
*
|
|
4179
|
+
* @param {(error: Error?, content: String?) => void} fCallback - callback function invoked with the rendered template, or an error
|
|
4180
|
+
*
|
|
4181
|
+
* @return {void}
|
|
4178
4182
|
*/},{key:"renderAsync",value:function renderAsync(pTemplateHash,pRecord,fCallback,pContextArray){return fCallback(null,this.render(pTemplateHash,pRecord,pContextArray));}/**
|
|
4179
4183
|
* Provide a match criteria for a template expression. Anything between these two values is returned as the template hash.
|
|
4180
4184
|
*
|
|
4181
4185
|
* @param {string} pMatchStart - The string pattern to start a match in the template trie
|
|
4182
4186
|
* @param {string} pMatchEnd - The string pattern to stop a match in the trie acyclic graph
|
|
4187
|
+
*
|
|
4188
|
+
* @return {void}
|
|
4183
4189
|
*/},{key:"addPattern",value:function addPattern(pMatchStart,pMatchEnd){return this.pict.MetaTemplate.addPatternBoth(pMatchStart,pMatchEnd,this.render,this.renderAsync,this);}/**
|
|
4184
4190
|
* Read a value from a nested object using a dot notation string.
|
|
4185
4191
|
*
|
|
@@ -4187,13 +4193,13 @@ if(!(pTemplateHash in this.templates)){this.checkDefaultTemplateHash(pTemplateHa
|
|
|
4187
4193
|
* @param {object} pRecord - The record to resolve
|
|
4188
4194
|
* @param {Array<any>} pContextArray - The context array to resolve (optional)
|
|
4189
4195
|
*
|
|
4190
|
-
* @
|
|
4196
|
+
* @return {any} The value at the given address, or undefined
|
|
4191
4197
|
*/},{key:"resolveStateFromAddress",value:function resolveStateFromAddress(pAddress,pRecord,pContextArray){var tmpContextArray=Array.isArray(pContextArray)?pContextArray:[this.pict];return this.pict.manifest.getValueByHash({Pict:this.pict,AppData:this.pict.AppData,Bundle:this.pict.Bundle,Context:tmpContextArray,Record:pRecord},pAddress);}}]);}(libFableServiceBase);module.exports=PictTemplateProvider;module.exports.template_hash='Default';},{"fable":58}],168:[function(require,module,exports){/**
|
|
4192
4198
|
* @author <steven@velozo.com>
|
|
4193
|
-
*/var libFable=require('fable');var PictTemplateProvider=require('./Pict-Template-Provider.js');var PictContentAssignment=require('./Pict-Content-Assignment.js');var PictDataProvider=require('./Pict-DataProvider.js');var PictCSS=require('./Pict-CSS.js');var PictMeadowEntityProvider=require('./Pict-Meadow-EntityProvider.js');/**
|
|
4199
|
+
*/var libFable=require('fable');var PictTemplateProvider=require('./Pict-Template-Provider.js');var PictContentAssignment=require('./Pict-Content-Assignment.js');var PictDataProvider=require('./Pict-DataProvider.js');var PictCSS=require('./Pict-CSS.js');var PictMeadowEntityProvider=require('./Pict-Meadow-EntityProvider.js');var PictTemplate=require('./Pict-Template.js');/**
|
|
4194
4200
|
* Pict management object.
|
|
4195
4201
|
*/var Pict=/*#__PURE__*/function(_libFable){/**
|
|
4196
|
-
* @param {Object} pSettings - The settings for the Pict instance.
|
|
4202
|
+
* @param {Object<String, any>} pSettings - The settings for the Pict instance.
|
|
4197
4203
|
*/function Pict(pSettings){var _this72;_classCallCheck2(this,Pict);_this72=_callSuper(this,Pict,[pSettings]);_this72.isBrowser=new Function("try {return (this===window);} catch(pError) {return false;}");/**
|
|
4198
4204
|
* The templateProvider provides a basic key->template mapping with default fallback capabilities
|
|
4199
4205
|
*
|
|
@@ -4223,33 +4229,52 @@ if(_this72.settings.Manifests){_this72.loadManifestSet(_this72.settings.Manifest
|
|
|
4223
4229
|
_this72.providers=_this72.servicesMap.PictProvider;_this72.views=_this72.servicesMap.PictView;return _this72;}/**
|
|
4224
4230
|
* Load manifests in as Hashed services
|
|
4225
4231
|
*
|
|
4226
|
-
* @param {Object} pManifestSet - The manifest set to load.
|
|
4227
|
-
*/_inherits(Pict,_libFable);return _createClass2(Pict,[{key:"loadManifestSet",value:function loadManifestSet(pManifestSet){if(_typeof(pManifestSet)!='object'){this.log.warn("PICT [".concat(this.UUID,"] could not load Manifest Set; pManifestSet was not an object."));return
|
|
4232
|
+
* @param {Object<String, String>} pManifestSet - The manifest set to load.
|
|
4233
|
+
*/_inherits(Pict,_libFable);return _createClass2(Pict,[{key:"loadManifestSet",value:function loadManifestSet(pManifestSet){if(_typeof(pManifestSet)!='object'){this.log.warn("PICT [".concat(this.UUID,"] could not load Manifest Set; pManifestSet was not an object."));return;}var tmpManifestKeys=Object.keys(pManifestSet);if(tmpManifestKeys.length>0){for(var i=0;i<tmpManifestKeys.length;i++){// Load each manifest
|
|
4228
4234
|
var tmpManifestKey=tmpManifestKeys[i];this.instantiateServiceProvider('Manifest',pManifestSet[tmpManifestKey],tmpManifestKey);}}}/**
|
|
4229
4235
|
* Add a template expression to the template engine from the PictTemplate service.
|
|
4230
4236
|
*
|
|
4231
|
-
* @param {
|
|
4232
|
-
|
|
4237
|
+
* @param {typeof PictTemplate} pTemplatePrototype - The prototype class for the template expression
|
|
4238
|
+
*
|
|
4239
|
+
* @return {PictTemplate} the service instance, or null if the prototype was invalid
|
|
4240
|
+
*/},{key:"addTemplate",value:function addTemplate(pTemplatePrototype){if(typeof pTemplatePrototype!='function'){this.log.warn("PICT [".concat(this.UUID,"] could not add Template; pTemplatePrototype was not a class it was ").concat(_typeof(pTemplatePrototype),"."));return null;}var tmpTemplateHash=pTemplatePrototype.template_hash;if(this.LogNoisiness>1){this.log.info("PICT-ControlFlow addTemplate [".concat(tmpTemplateHash,"]"));}return this.instantiateServiceProviderFromPrototype('PictTemplate',{},tmpTemplateHash,pTemplatePrototype);}/**
|
|
4233
4241
|
* Just passing an options will construct one for us.
|
|
4234
4242
|
* Passing a hash will set the hash.
|
|
4235
4243
|
* Passing a prototype will use that!
|
|
4236
4244
|
*
|
|
4237
4245
|
* @param {String} pViewHash - The hash of the view.
|
|
4238
|
-
* @param {Object} pOptions - The options for the view.
|
|
4239
|
-
* @param {
|
|
4246
|
+
* @param {Object<String, any>} [pOptions] - The options for the view.
|
|
4247
|
+
* @param {any} [pViewPrototype] - The prototype for the view.
|
|
4248
|
+
*
|
|
4249
|
+
* FIXME: refer to PictView here once it has a type definition
|
|
4250
|
+
*
|
|
4251
|
+
* @return {any} The view instance.
|
|
4240
4252
|
*/},{key:"addView",value:function addView(pViewHash,pOptions,pViewPrototype){var tmpOptions=_typeof(pOptions)=='object'?pOptions:{};var tmpViewHash=typeof pViewHash=='string'?pViewHash:this.fable.getUUID();if(this.LogControlFlow){if(this.LogNoisiness>1){this.log.info("PICT-ControlFlow addView [".concat(tmpViewHash,"]:"),{Options:tmpOptions});}else{this.log.info("PICT-ControlFlow addView [".concat(tmpViewHash,"]"));}}if(typeof pViewPrototype!='undefined'){// If the prototype has a default_configuration, it will be merged with options.
|
|
4241
|
-
if('default_configuration'in pViewPrototype){tmpOptions=this.fable.Utility.extend({},JSON.parse(JSON.stringify(pViewPrototype.default_configuration)),tmpOptions);}return this.instantiateServiceProviderFromPrototype('PictView',tmpOptions,tmpViewHash,pViewPrototype);}else{return this.instantiateServiceProvider('PictView',tmpOptions,tmpViewHash);}}
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4253
|
+
if('default_configuration'in pViewPrototype){tmpOptions=this.fable.Utility.extend({},JSON.parse(JSON.stringify(pViewPrototype.default_configuration)),tmpOptions);}return this.instantiateServiceProviderFromPrototype('PictView',tmpOptions,tmpViewHash,pViewPrototype);}else{return this.instantiateServiceProvider('PictView',tmpOptions,tmpViewHash);}}/**
|
|
4254
|
+
* Just passing an options will construct one for us.
|
|
4255
|
+
* Passing a hash will set the hash.
|
|
4256
|
+
* Passing a prototype will use that!
|
|
4257
|
+
*
|
|
4258
|
+
* @param {String} pProviderHash - The hash of the provider.
|
|
4259
|
+
* @param {Object<String, any>} [pOptions] - The options for the provider.
|
|
4260
|
+
* @param {any} [pProviderPrototype] - The prototype for the provider.
|
|
4261
|
+
*
|
|
4262
|
+
* FIXME: refer to PictProvider here once it has a type definition
|
|
4263
|
+
*
|
|
4264
|
+
* @return {any} The provider instance.
|
|
4265
|
+
*/},{key:"addProvider",value:function addProvider(pProviderHash,pOptions,pProviderPrototype){var tmpOptions=_typeof(pOptions)=='object'?pOptions:{};var tmpProviderHash=typeof pProviderHash=='string'?pProviderHash:this.fable.getUUID();if(this.LogControlFlow){if(this.LogNoisiness>1){this.log.info("PICT-ControlFlow addProvider [".concat(tmpProviderHash,"]:"),{Options:tmpOptions});}else{this.log.info("PICT-ControlFlow addProvider [".concat(tmpProviderHash,"]"));}}if(typeof pProviderPrototype!='undefined'){// If the prototype has a default_configuration, it will be merged with options.
|
|
4245
4266
|
if('default_configuration'in pProviderPrototype){tmpOptions=this.fable.Utility.extend({},pProviderPrototype.default_configuration,tmpOptions);}return this.instantiateServiceProviderFromPrototype('PictProvider',tmpOptions,tmpProviderHash,pProviderPrototype);}else{return this.instantiateServiceProvider('PictProvider',tmpOptions,tmpProviderHash);}}/**
|
|
4246
4267
|
* Just passing an options will construct one for us.
|
|
4247
4268
|
* Passing a hash will set the hash.
|
|
4248
4269
|
* Passing a prototype will use that!
|
|
4249
4270
|
*
|
|
4250
4271
|
* @param {String} pApplicationHash - The hash of the application.
|
|
4251
|
-
* @param {Object} pOptions - The options for the application.
|
|
4252
|
-
* @param {
|
|
4272
|
+
* @param {Object} [pOptions] - The options for the application.
|
|
4273
|
+
* @param {any} [pApplicationPrototype] - The prototype for the application.
|
|
4274
|
+
*
|
|
4275
|
+
* FIXME: refer to PictApplication here once it has a type definition
|
|
4276
|
+
*
|
|
4277
|
+
* @return {any} The application instance.
|
|
4253
4278
|
*/},{key:"addApplication",value:function addApplication(pApplicationHash,pOptions,pApplicationPrototype){var tmpOptions=_typeof(pOptions)=='object'?pOptions:{};var tmpApplicationHash=typeof pApplicationHash=='string'?pApplicationHash:this.fable.getUUID();if(this.LogControlFlow){if(this.LogNoisiness>1){this.log.info("PICT-ControlFlow addApplication [".concat(tmpApplicationHash,"]:"),{Options:tmpOptions});}else{this.log.info("PICT-ControlFlow addApplication [".concat(tmpApplicationHash,"]"));}}if(typeof pApplicationPrototype!='undefined'){// If the prototype has a default_configuration, it will be merged with options.
|
|
4254
4279
|
if('default_configuration'in pApplicationPrototype){tmpOptions=this.fable.Utility.extend({},pApplicationPrototype.default_configuration,tmpOptions);}return this.instantiateServiceProviderFromPrototype('PictApplication',tmpOptions,tmpApplicationHash,pApplicationPrototype);}else{return this.instantiateServiceProvider('PictApplication',tmpOptions,tmpApplicationHash);}}/**
|
|
4255
4280
|
* Attach the default template engine renderers.
|
|
@@ -4273,49 +4298,57 @@ this.addTemplate(require("./templates/logic/Pict-Template-TemplateIf.js"));// {~
|
|
|
4273
4298
|
// {~TIfAbs:Template:AddressOfData:AppData.Some.Address.IDBook^OPERATOR^Absolute_Value~}
|
|
4274
4299
|
this.addTemplate(require("./templates/logic/Pict-Template-TemplateIfAbsolute.js"));// {~NotEmpty:AppData.Some.Address^Absolute Value~}
|
|
4275
4300
|
this.addTemplate(require("./templates/logic/Pict-Template-NotEmpty.js"));// Data Manipulation Templates
|
|
4276
|
-
this.addTemplate(require("./templates/data/Pict-Template-PascalCaseIdentifier.js"));this.addTemplate(require("./templates/data/Pict-Template-DateFormat.js"));this.addTemplate(require("./templates/data/Pict-Template-DateYMD.js"));this.addTemplate(require("./templates/data/Pict-Template-Digits.js"));this.addTemplate(require("./templates/data/Pict-Template-Dollars.js"));this.addTemplate(require("./templates/data/Pict-Template-Join.js"));this.addTemplate(require("./templates/data/Pict-Template-JoinUnique.js"));// Data Generation Templates
|
|
4301
|
+
this.addTemplate(require("./templates/data/Pict-Template-DataJson.js"));this.addTemplate(require("./templates/data/Pict-Template-PascalCaseIdentifier.js"));this.addTemplate(require("./templates/data/Pict-Template-DateFormat.js"));this.addTemplate(require("./templates/data/Pict-Template-DateYMD.js"));this.addTemplate(require("./templates/data/Pict-Template-Digits.js"));this.addTemplate(require("./templates/data/Pict-Template-Dollars.js"));this.addTemplate(require("./templates/data/Pict-Template-Join.js"));this.addTemplate(require("./templates/data/Pict-Template-JoinUnique.js"));// Data Generation Templates
|
|
4277
4302
|
this.addTemplate(require("./templates/data-generation/Pict-Template-RandomNumber.js"));this.addTemplate(require("./templates/data-generation/Pict-Template-RandomNumberString.js"));// Debugging Templates
|
|
4278
4303
|
this.addTemplate(require("./templates/debugging/Pict-Template-Breakpoint.js"));this.addTemplate(require("./templates/debugging/Pict-Template-LogStatement.js"));this.addTemplate(require("./templates/debugging/Pict-Template-LogValue.js"));this.addTemplate(require("./templates/debugging/Pict-Template-LogValueTree.js"));this.addTemplate(require("./templates/debugging/Pict-Template-DataValueTree.js"));this._DefaultPictTemplatesInitialized=true;}}/**
|
|
4279
4304
|
* Read a value from a nested object using a dot notation string.
|
|
4280
4305
|
*
|
|
4281
4306
|
* @param {string} pAddress - The address to resolve
|
|
4282
|
-
* @param {
|
|
4283
|
-
* @param {Array<any>} pContextArray - The context array to resolve
|
|
4307
|
+
* @param {any} pRecord - The record to resolve
|
|
4308
|
+
* @param {Array<any>} [pContextArray] - The context array to resolve
|
|
4284
4309
|
*
|
|
4285
|
-
* @
|
|
4310
|
+
* @return {any} The value at the given address, or undefined
|
|
4286
4311
|
*/},{key:"resolveStateFromAddress",value:function resolveStateFromAddress(pAddress,pRecord,pContextArray){var tmpContextArray=Array.isArray(pContextArray)?pContextArray:[this];return this.manifest.getValueByHash({Pict:this,AppData:this.AppData,Bundle:this.Bundle,Context:tmpContextArray,Record:pRecord},pAddress);}/**
|
|
4287
4312
|
* Parse a template.
|
|
4288
4313
|
*
|
|
4289
4314
|
* @param {String} pTemplateString - The template string to parse
|
|
4290
4315
|
* @param {Object} pData - The data to use in the template
|
|
4291
|
-
* @param {Function} fCallback - The callback to call when the template is parsed
|
|
4292
|
-
* @param {Array<any>} pContextArray - The context array to use in the template
|
|
4316
|
+
* @param {Function} [fCallback] - The callback to call when the template is parsed
|
|
4317
|
+
* @param {Array<any>} [pContextArray] - The context array to use in the template
|
|
4318
|
+
*
|
|
4319
|
+
* @return {String?} The parsed template string, or undefined if a callback was provided
|
|
4293
4320
|
*/},{key:"parseTemplate",value:function parseTemplate(pTemplateString,pData,fCallback,pContextArray){var _this73=this;var tmpData=_typeof(pData)==='object'?pData:{};var tmpContextArray=Array.isArray(pContextArray)?pContextArray:[this];var tmpParseUUID;if(this.LogControlFlow){tmpParseUUID=this.fable.getUUID();this.log.info("PICT-ControlFlow parseTemplate ".concat(tmpParseUUID," [").concat(pTemplateString.substring(0,50).replace('\n','\\n'),"...").concat(pTemplateString.length,"] (fCallback: ").concat(_typeof(fCallback),") with data size [").concat(JSON.stringify(tmpData).length,"]"));if(this.LogNoisiness>1){this.log.info("PICT-ControlFlow parseTemplate ".concat(tmpParseUUID," template:\n").concat(pTemplateString));}if(this.LogControlFlowWatchAddressList.length>0){for(var i=0;i<this.LogControlFlowWatchAddressList.length;i++){this.log.info("PICT-ControlFlow parseTemplate ".concat(tmpParseUUID," Watch Value: [").concat(this.LogControlFlowWatchAddressList[i],"]=>[").concat(this.resolveStateFromAddress(this.LogControlFlowWatchAddressList[i],tmpData),"]"));}}}if(typeof fCallback==='function'){this.MetaTemplate.parseString(pTemplateString,tmpData,function(pError,pParsedTemplate){if(_this73.LogControlFlow&&_this73.LogNoisiness>1){_this73.log.info("PICT-ControlFlow parseTemplate ".concat(tmpParseUUID," Template Async Return Value:\n").concat(pParsedTemplate));}return fCallback(pError,pParsedTemplate);},tmpContextArray);}else{var tmpResult=this.MetaTemplate.parseString(pTemplateString,tmpData,null,tmpContextArray);if(this.LogControlFlow&&this.LogNoisiness>1){this.log.info("PICT-ControlFlow parseTemplate ".concat(tmpParseUUID," Template Return Value:\n").concat(tmpResult));}return tmpResult;}}/**
|
|
4294
4321
|
* Parse a template by hash.
|
|
4295
4322
|
*
|
|
4296
4323
|
* @param {String} pTemplateHash - The hash of the template to parse
|
|
4297
4324
|
* @param {Object} pData - The data to use in the template
|
|
4298
|
-
* @param {Function} fCallback - The callback to call when the template is parsed
|
|
4299
|
-
* @param {Array<any>} pContextArray - The context array to use in the template
|
|
4325
|
+
* @param {Function} [fCallback] - The callback to call when the template is parsed
|
|
4326
|
+
* @param {Array<any>} [pContextArray] - The context array to use in the template
|
|
4327
|
+
*
|
|
4328
|
+
* @return {String?} The parsed template string, or undefined if a callback was provided
|
|
4300
4329
|
*/},{key:"parseTemplateByHash",value:function parseTemplateByHash(pTemplateHash,pData,fCallback,pContextArray){var tmpTemplateString=this.TemplateProvider.getTemplate(pTemplateHash);// TODO: Unsure if returning empty is always the right behavior -- if it isn't we will use config to set the behavior
|
|
4301
4330
|
if(!tmpTemplateString){tmpTemplateString='';}return this.parseTemplate(tmpTemplateString,pData,fCallback,pContextArray);}/**
|
|
4302
4331
|
* Parse a template set.
|
|
4303
4332
|
*
|
|
4304
4333
|
* @param {String} pTemplateString - The template string to parse
|
|
4305
|
-
* @param {Array
|
|
4306
|
-
* @param {Function} fCallback - The callback to call when the template is parsed
|
|
4307
|
-
* @param {Array<any>} pContextArray - The context array to use in the template
|
|
4334
|
+
* @param {Array<any>|Object} pDataSet - The data set to use in the template
|
|
4335
|
+
* @param {Function} [fCallback] - The callback to call when the template set is parsed
|
|
4336
|
+
* @param {Array<any>} [pContextArray] - The context array to use in the template
|
|
4337
|
+
*
|
|
4338
|
+
* @return {String?} The parsed template string, or undefined if a callback was provided
|
|
4308
4339
|
*/},{key:"parseTemplateSet",value:function parseTemplateSet(pTemplateString,pDataSet,fCallback,pContextArray){var _this74=this;// TODO: This will need streaming -- for now janky old string append does the trick
|
|
4309
4340
|
var tmpValue='';if(typeof fCallback=='function'){if(Array.isArray(pDataSet)||_typeof(pDataSet)=='object'){this.Utility.eachLimit(pDataSet,1,function(pRecord,fRecordTemplateCallback){return _this74.parseTemplate(pTemplateString,pRecord,function(pError,pTemplateResult){tmpValue+=pTemplateResult;return fRecordTemplateCallback();});},function(pError){return fCallback(pError,tmpValue);});}else{return fCallback(Error('Pict: Template Set: pDataSet is not an array or object.'),'');}}else{if(Array.isArray(pDataSet)||_typeof(pDataSet)=='object'){if(Array.isArray(pDataSet)){for(var i=0;i<pDataSet.length;i++){tmpValue+=this.parseTemplate(pTemplateString,pDataSet[i],null,pContextArray);}}else{var tmpKeys=Object.keys(pDataSet);for(var _i49=0;_i49<tmpKeys.length;_i49++){tmpValue+=this.parseTemplate(pTemplateString,pDataSet[tmpKeys[_i49]],null,pContextArray);}}return tmpValue;}else{return'';}}}/**
|
|
4310
4341
|
* Parse a template set by hash.
|
|
4311
4342
|
*
|
|
4312
4343
|
* @param {String} pTemplateHash - The hash of the template to parse
|
|
4313
|
-
* @param {Array
|
|
4314
|
-
* @param {Function} fCallback - The callback to call when the template is parsed
|
|
4315
|
-
* @param {Array<any>} pContextArray - The context array to use in the template
|
|
4344
|
+
* @param {Array<any>|Object} pDataSet - The data set to use in the template
|
|
4345
|
+
* @param {Function} [fCallback] - The callback to call when the template is parsed
|
|
4346
|
+
* @param {Array<any>} [pContextArray] - The context array to use in the template
|
|
4347
|
+
*
|
|
4348
|
+
* @return {String?} The parsed template string, or undefined if a callback was provided
|
|
4316
4349
|
*/},{key:"parseTemplateSetByHash",value:function parseTemplateSetByHash(pTemplateHash,pDataSet,fCallback,pContextArray){var tmpTemplateString=this.TemplateProvider.getTemplate(pTemplateHash);// TODO: Unsure if returning empty is always the right behavior -- if it isn't we will use config to set the behavior
|
|
4317
|
-
if(!tmpTemplateString){tmpTemplateString='';}return this.parseTemplateSet(tmpTemplateString,pDataSet,fCallback,pContextArray);}}]);}(libFable);;module.exports=Pict;module.exports.PictApplicationClass=require('pict-application');module.exports.PictViewClass=require('pict-view');module.exports.PictProviderClass=require('pict-provider');module.exports.EnvironmentLog=require('./environments/Pict-Environment-Log.js');module.exports.EnvironmentObject=require('./environments/Pict-Environment-Object.js');// This is to help understand the type of enivironement we're executing in
|
|
4318
|
-
module.exports.isBrowser=new Function("try {return (this===window);} catch(pError) {return false;}");module.exports.safeOnDocumentReady=require("./Pict-Browser-SafeOnDocumentReady.js");module.exports.safeLoadPictApplication=require("./Pict-Browser-SafeLoad.js");},{"./Pict-Browser-SafeLoad.js":160,"./Pict-Browser-SafeOnDocumentReady.js":161,"./Pict-CSS.js":162,"./Pict-Content-Assignment.js":163,"./Pict-DataProvider.js":164,"./Pict-Meadow-EntityProvider.js":165,"./Pict-Template-Provider.js":166,"./Pict-Template.js":167,"./environments/Pict-Environment-Log.js":169,"./environments/Pict-Environment-Object.js":170,"./templates/Pict-Template-Data.js":171,"./templates/Pict-Template-Entity.js":172,"./templates/Pict-Template-Template.js":173,"./templates/Pict-Template-TemplateFromMap.js":174,"./templates/Pict-Template-TemplateSet.js":175,"./templates/Pict-Template-TemplateSetFromMap.js":176,"./templates/Pict-Template-TemplateValueSet.js":177,"./templates/data-generation/Pict-Template-RandomNumber.js":178,"./templates/data-generation/Pict-Template-RandomNumberString.js":179,"./templates/data/Pict-Template-
|
|
4350
|
+
if(!tmpTemplateString){tmpTemplateString='';}return this.parseTemplateSet(tmpTemplateString,pDataSet,fCallback,pContextArray);}}]);}(libFable);;module.exports=Pict;module.exports.PictApplicationClass=require('pict-application');module.exports.PictViewClass=require('pict-view');module.exports.PictProviderClass=require('pict-provider');module.exports.PictTemplateClass=PictTemplate;module.exports.EnvironmentLog=require('./environments/Pict-Environment-Log.js');module.exports.EnvironmentObject=require('./environments/Pict-Environment-Object.js');// This is to help understand the type of enivironement we're executing in
|
|
4351
|
+
module.exports.isBrowser=new Function("try {return (this===window);} catch(pError) {return false;}");module.exports.safeOnDocumentReady=require("./Pict-Browser-SafeOnDocumentReady.js");module.exports.safeLoadPictApplication=require("./Pict-Browser-SafeLoad.js");},{"./Pict-Browser-SafeLoad.js":160,"./Pict-Browser-SafeOnDocumentReady.js":161,"./Pict-CSS.js":162,"./Pict-Content-Assignment.js":163,"./Pict-DataProvider.js":164,"./Pict-Meadow-EntityProvider.js":165,"./Pict-Template-Provider.js":166,"./Pict-Template.js":167,"./environments/Pict-Environment-Log.js":169,"./environments/Pict-Environment-Object.js":170,"./templates/Pict-Template-Data.js":171,"./templates/Pict-Template-Entity.js":172,"./templates/Pict-Template-Template.js":173,"./templates/Pict-Template-TemplateFromMap.js":174,"./templates/Pict-Template-TemplateSet.js":175,"./templates/Pict-Template-TemplateSetFromMap.js":176,"./templates/Pict-Template-TemplateValueSet.js":177,"./templates/data-generation/Pict-Template-RandomNumber.js":178,"./templates/data-generation/Pict-Template-RandomNumberString.js":179,"./templates/data/Pict-Template-DataJson.js":180,"./templates/data/Pict-Template-DateFormat.js":181,"./templates/data/Pict-Template-DateYMD.js":182,"./templates/data/Pict-Template-Digits.js":183,"./templates/data/Pict-Template-Dollars.js":184,"./templates/data/Pict-Template-Join.js":185,"./templates/data/Pict-Template-JoinUnique.js":186,"./templates/data/Pict-Template-PascalCaseIdentifier.js":187,"./templates/debugging/Pict-Template-Breakpoint.js":188,"./templates/debugging/Pict-Template-DataValueTree.js":189,"./templates/debugging/Pict-Template-LogStatement.js":190,"./templates/debugging/Pict-Template-LogValue.js":191,"./templates/debugging/Pict-Template-LogValueTree.js":192,"./templates/logic/Pict-Template-NotEmpty.js":193,"./templates/logic/Pict-Template-TemplateIf.js":195,"./templates/logic/Pict-Template-TemplateIfAbsolute.js":196,"fable":58,"pict-application":114,"pict-provider":115,"pict-view":116}],169:[function(require,module,exports){/**
|
|
4319
4352
|
* Pict browser shim loader
|
|
4320
4353
|
* @author <steven@velozo.com>
|
|
4321
4354
|
*
|
|
@@ -4417,90 +4450,94 @@ return this.contentMap[pAddress];}this.pict.log.warn("Mock read from Address ".c
|
|
|
4417
4450
|
* @param {Object} pFable - The Fable Framework instance
|
|
4418
4451
|
* @param {Object} pOptions - The options for the service
|
|
4419
4452
|
* @param {String} pServiceHash - The hash of the service
|
|
4420
|
-
*/function PictTemplateProviderData(pFable,pOptions,pServiceHash){var _this75;_classCallCheck2(this,PictTemplateProviderData);_this75=_callSuper(this,PictTemplateProviderData,[pFable,pOptions,pServiceHash]);_this75.addPattern('{~Data:','~}');_this75.addPattern('{~D:','~}');return _this75;}_inherits(PictTemplateProviderData,_libPictTemplate);return _createClass2(PictTemplateProviderData,[{key:"render",value:function render(
|
|
4453
|
+
*/function PictTemplateProviderData(pFable,pOptions,pServiceHash){var _this75;_classCallCheck2(this,PictTemplateProviderData);_this75=_callSuper(this,PictTemplateProviderData,[pFable,pOptions,pServiceHash]);_this75.addPattern('{~Data:','~}');_this75.addPattern('{~D:','~}');return _this75;}_inherits(PictTemplateProviderData,_libPictTemplate);return _createClass2(PictTemplateProviderData,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpRecord=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fDataRender]::[".concat(tmpHash,"] with tmpData:"),tmpRecord);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fDataRender]::[".concat(tmpHash,"]"));}var tmpValue='';if(tmpHash!=null){tmpValue=this.resolveStateFromAddress(tmpHash,tmpRecord,pContextArray);}if(tmpValue==null||tmpValue=='undefined'||typeof tmpValue=='undefined'){return'';}return tmpValue;}}]);}(libPictTemplate);module.exports=PictTemplateProviderData;},{"../Pict-Template.js":167}],172:[function(require,module,exports){var libPictTemplate=require('../Pict-Template.js');var PictTemplateProviderEntity=/*#__PURE__*/function(_libPictTemplate2){/**
|
|
4421
4454
|
* @param {Object} pFable - The Fable Framework instance
|
|
4422
4455
|
* @param {Object} pOptions - The options for the service
|
|
4423
4456
|
* @param {String} pServiceHash - The hash of the service
|
|
4424
4457
|
*/function PictTemplateProviderEntity(pFable,pOptions,pServiceHash){var _this76;_classCallCheck2(this,PictTemplateProviderEntity);_this76=_callSuper(this,PictTemplateProviderEntity,[pFable,pOptions,pServiceHash]);_this76.addPattern('{~E:','~}');_this76.addPattern('{~Entity:','~}');return _this76;}_inherits(PictTemplateProviderEntity,_libPictTemplate2);return _createClass2(PictTemplateProviderEntity,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){// TODO: Better messaging
|
|
4425
|
-
this.log.error("Pict: Entity Render [".concat(pTemplateHash,"]: Render called in a non-asynchronous fashion. This should not happen."));return'';}},{key:"renderAsync",value:function renderAsync(pTemplateHash,pRecord,fCallback,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};var tmpCallback=typeof fCallback==='function'?fCallback:function(){return'';};if(this.LogNoisiness>4){this.log.trace("PICT Template [fEntityRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.LogNoisiness>0){this.log.trace("PICT Template [fEntityRender]::[".concat(tmpHash,"]"));}var tmpEntity=false;var tmpEntityID=false;var tmpEntityTemplate=false;// This expression requires 2 parts -- a third is optional, and, if present, is the template to render to.
|
|
4458
|
+
this.log.error("Pict: Entity Render [".concat(pTemplateHash,"]: Render called in a non-asynchronous fashion. This should not happen."));return'';}},{key:"renderAsync",value:function renderAsync(pTemplateHash,pRecord,fCallback,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};var tmpCallback=typeof fCallback==='function'?fCallback:function(){return'';};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fEntityRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fEntityRender]::[".concat(tmpHash,"]"));}var tmpEntity=false;var tmpEntityID=false;var tmpEntityTemplate=false;// This expression requires 2 parts -- a third is optional, and, if present, is the template to render to.
|
|
4426
4459
|
var tmpAddressParts=tmpHash.split('^');if(tmpAddressParts.length<2){this.log.warn("Pict: Entity Render: Entity or entity ID not resolved for [".concat(tmpHash,"]"));return tmpCallback(Error("Pict: Entity Render: Entity or entity ID not resolved for [".concat(tmpHash,"]")),'');}tmpEntity=tmpAddressParts[0].trim();tmpEntityID=tmpAddressParts[1].trim();tmpEntityTemplate=tmpAddressParts[2].trim();if(!isNaN(tmpEntityID)){try{tmpEntityID=parseInt(tmpEntityID);}catch(_unused){this.log.warn("Pict: Entity Render: Could not parse entity ID.");tmpEntityID=0;}}else{// This is an address, so we need to get the value at the address
|
|
4427
4460
|
tmpEntityID=this.resolveStateFromAddress(tmpEntityID,tmpData,pContextArray);}// No Entity or EntityID
|
|
4428
|
-
if(!tmpEntity||!tmpEntityID){this.log.warn("Pict: Entity Render: Entity or entity ID not resolved for [".concat(tmpHash,"] Entity: ").concat(tmpEntity," ID: ").concat(tmpEntityID));return tmpCallback(Error("Pict: Entity Render: Entity or entity ID not resolved for [".concat(tmpHash,"] Entity: ").concat(tmpEntity," ID: ").concat(tmpEntityID)),'');}if(this.LogNoisiness>3){this.log.trace("Pict: Entity Render: Entity [".concat(tmpEntity,"] with ID [").concat(tmpEntityID,"] as template [").concat(tmpEntityTemplate,"] from [").concat(tmpHash,"]"));}// Now try to get the entity
|
|
4461
|
+
if(!tmpEntity||!tmpEntityID){this.log.warn("Pict: Entity Render: Entity or entity ID not resolved for [".concat(tmpHash,"] Entity: ").concat(tmpEntity," ID: ").concat(tmpEntityID));return tmpCallback(Error("Pict: Entity Render: Entity or entity ID not resolved for [".concat(tmpHash,"] Entity: ").concat(tmpEntity," ID: ").concat(tmpEntityID)),'');}if(this.pict.LogNoisiness>3){this.log.trace("Pict: Entity Render: Entity [".concat(tmpEntity,"] with ID [").concat(tmpEntityID,"] as template [").concat(tmpEntityTemplate,"] from [").concat(tmpHash,"]"));}// Now try to get the entity
|
|
4429
4462
|
this.pict.EntityProvider.getEntity(tmpEntity,tmpEntityID,function(pError,pRecord){if(pError){this.log.error("Pict: Entity Render: Error getting entity [".concat(tmpEntity,"] with ID [").concat(tmpEntityID,"] for [").concat(tmpHash,"]: ").concat(pError),pError);return tmpCallback(pError,'');}// Now render the template
|
|
4430
4463
|
if(tmpEntityTemplate){return this.pict.parseTemplateByHash(tmpEntityTemplate,pRecord,tmpCallback,pContextArray);}else{return tmpCallback(null,'');}}.bind(this));}}]);}(libPictTemplate);module.exports=PictTemplateProviderEntity;},{"../Pict-Template.js":167}],173:[function(require,module,exports){var libPictTemplate=require('../Pict-Template.js');var PictTemplateProviderTemplate=/*#__PURE__*/function(_libPictTemplate3){/**
|
|
4431
4464
|
* @param {Object} pFable - The Fable Framework instance
|
|
4432
4465
|
* @param {Object} pOptions - The options for the service
|
|
4433
4466
|
* @param {String} pServiceHash - The hash of the service
|
|
4434
|
-
*/function PictTemplateProviderTemplate(pFable,pOptions,pServiceHash){var _this77;_classCallCheck2(this,PictTemplateProviderTemplate);_this77=_callSuper(this,PictTemplateProviderTemplate,[pFable,pOptions,pServiceHash]);_this77.addPattern('{~Template:','~}');_this77.addPattern('{~T:','~}');return _this77;}_inherits(PictTemplateProviderTemplate,_libPictTemplate3);return _createClass2(PictTemplateProviderTemplate,[{key:"render",value:function render(
|
|
4467
|
+
*/function PictTemplateProviderTemplate(pFable,pOptions,pServiceHash){var _this77;_classCallCheck2(this,PictTemplateProviderTemplate);_this77=_callSuper(this,PictTemplateProviderTemplate,[pFable,pOptions,pServiceHash]);_this77.addPattern('{~Template:','~}');_this77.addPattern('{~T:','~}');return _this77;}_inherits(PictTemplateProviderTemplate,_libPictTemplate3);return _createClass2(PictTemplateProviderTemplate,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateRender]::[".concat(tmpHash,"]"));}var tmpTemplateHash=false;var tmpAddressOfData=false;// This is just a simple 2 part hash (the entity and the ID)
|
|
4435
4468
|
var tmpHashTemplateSeparator=tmpHash.indexOf(':');tmpTemplateHash=tmpHash.substring(0,tmpHashTemplateSeparator);if(tmpHashTemplateSeparator>-1){tmpAddressOfData=tmpHash.substring(tmpHashTemplateSeparator+1);}else{tmpTemplateHash=tmpHash;}// No template hash
|
|
4436
4469
|
if(!tmpTemplateHash){this.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]");}if(!tmpAddressOfData){// No address was provided, just render the template with what this template has.
|
|
4437
|
-
return this.pict.parseTemplateByHash(tmpTemplateHash,
|
|
4470
|
+
return this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,null,pContextArray);}else{return this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray),null,pContextArray);}}},{key:"renderAsync",value:function renderAsync(pTemplateHash,pRecord,fCallback,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};var tmpCallback=typeof fCallback==='function'?fCallback:function(){return'';};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateRenderAsync]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateRenderAsync]::[".concat(tmpHash,"]"));}var tmpTemplateHash=false;var tmpAddressOfData=false;// This is just a simple 2 part hash (the entity and the ID)
|
|
4438
4471
|
var tmpHashTemplateSeparator=tmpHash.indexOf(':');tmpTemplateHash=tmpHash.substring(0,tmpHashTemplateSeparator);if(tmpHashTemplateSeparator>-1){tmpAddressOfData=tmpHash.substring(tmpHashTemplateSeparator+1);}else{tmpTemplateHash=tmpHash;}// No template hash
|
|
4439
4472
|
if(!tmpTemplateHash){this.log.warn("Pict: Template Render Async: TemplateHash not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render Async: TemplateHash not resolved for [".concat(tmpHash,"]");}if(!tmpAddressOfData){// No address was provided, just render the template with what this template has.
|
|
4440
4473
|
// The async portion of this is a mind bender because of how entry can happen dynamically from templates
|
|
4441
|
-
return this.pict.parseTemplateByHash(tmpTemplateHash,
|
|
4474
|
+
return this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}else{return this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray),function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}}}]);}(libPictTemplate);module.exports=PictTemplateProviderTemplate;},{"../Pict-Template.js":167}],174:[function(require,module,exports){var libPictTemplate=require('../Pict-Template.js');var PictTemplateProviderTemplateFromMap=/*#__PURE__*/function(_libPictTemplate4){/**
|
|
4442
4475
|
* @param {Object} pFable - The Fable Framework instance
|
|
4443
4476
|
* @param {Object} pOptions - The options for the service
|
|
4444
4477
|
* @param {String} pServiceHash - The hash of the service
|
|
4445
|
-
*/function PictTemplateProviderTemplateFromMap(pFable,pOptions,pServiceHash){var _this78;_classCallCheck2(this,PictTemplateProviderTemplateFromMap);_this78=_callSuper(this,PictTemplateProviderTemplateFromMap,[pFable,pOptions,pServiceHash]);_this78.addPattern('{~TFM:','~}');_this78.addPattern('{~TemplateFromMap:','~}');return _this78;}_inherits(PictTemplateProviderTemplateFromMap,_libPictTemplate4);return _createClass2(PictTemplateProviderTemplateFromMap,[{key:"render",value:function render(
|
|
4446
|
-
var tmpTemplateHashPart=tmpHash.split(':');if(tmpTemplateHashPart.length<3){this.log.trace("PICT TemplateFromMap [fTemplateFromMapRenderAsync]::[".concat(tmpHash,"] failed because there were not three stanzas in the expression [").concat(
|
|
4478
|
+
*/function PictTemplateProviderTemplateFromMap(pFable,pOptions,pServiceHash){var _this78;_classCallCheck2(this,PictTemplateProviderTemplateFromMap);_this78=_callSuper(this,PictTemplateProviderTemplateFromMap,[pFable,pOptions,pServiceHash]);_this78.addPattern('{~TFM:','~}');_this78.addPattern('{~TemplateFromMap:','~}');return _this78;}_inherits(PictTemplateProviderTemplateFromMap,_libPictTemplate4);return _createClass2(PictTemplateProviderTemplateFromMap,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT TemplateFromMap [fTemplateFromMapRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT TemplateFromMap [fTemplateFromMapRender]::[".concat(tmpHash,"]"));}var tmpTemplateFromMapHash=false;var tmpAddressOfMap=false;var tmpAddressOfKey=false;// This is a 3 part hash with the map address and the key address both
|
|
4479
|
+
var tmpTemplateHashPart=tmpHash.split(':');if(tmpTemplateHashPart.length<3){this.log.trace("PICT TemplateFromMap [fTemplateFromMapRenderAsync]::[".concat(tmpHash,"] failed because there were not three stanzas in the expression [").concat(pTemplateHash,"]"));return'';}tmpTemplateFromMapHash=tmpTemplateHashPart[0];tmpAddressOfMap=tmpTemplateHashPart[1];tmpAddressOfKey=tmpTemplateHashPart[2];// No TemplateFromMap hash
|
|
4447
4480
|
if(!tmpTemplateFromMapHash){this.log.warn("Pict: TemplateFromMap Render: TemplateFromMapHash not resolved for [".concat(tmpHash,"]"));return'';}// Now resolve the data
|
|
4448
4481
|
var tmpMap=this.resolveStateFromAddress(tmpAddressOfMap,tmpData,pContextArray);var tmpKey=this.resolveStateFromAddress(tmpAddressOfKey,tmpData,pContextArray);if(!tmpMap){this.log.warn("Pict: TemplateFromMap Render: Map not resolved for [".concat(tmpHash,"]"));return'';}tmpData=tmpMap[tmpKey];if(!tmpData){// No address was provided, just render the TemplateFromMap with what this TemplateFromMap has.
|
|
4449
|
-
return this.pict.parseTemplateByHash(tmpTemplateFromMapHash,
|
|
4450
|
-
var tmpTemplateHashPart=tmpHash.split(':');if(tmpTemplateHashPart.length<3){this.log.trace("PICT TemplateFromMap [fTemplateFromMapRenderAsync]::[".concat(tmpHash,"] failed because there were not three stanzas in the expression [").concat(
|
|
4482
|
+
return this.pict.parseTemplateByHash(tmpTemplateFromMapHash,pRecord,null,pContextArray);}else{return this.pict.parseTemplateByHash(tmpTemplateFromMapHash,tmpData,null,pContextArray);}}},{key:"renderAsync",value:function renderAsync(pTemplateHash,pRecord,fCallback,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};var tmpCallback=typeof fCallback==='function'?fCallback:function(){return'';};if(this.pict.LogNoisiness>4){this.log.trace("PICT TemplateFromMap [fTemplateFromMapRenderAsync]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT TemplateFromMap [fTemplateFromMapRenderAsync]::[".concat(tmpHash,"]"));}var tmpTemplateFromMapHash=false;var tmpAddressOfMap=false;var tmpAddressOfKey=false;// This is a 3 part hash with the map address and the key address both
|
|
4483
|
+
var tmpTemplateHashPart=tmpHash.split(':');if(tmpTemplateHashPart.length<3){this.log.trace("PICT TemplateFromMap [fTemplateFromMapRenderAsync]::[".concat(tmpHash,"] failed because there were not three stanzas in the expression [").concat(pTemplateHash,"]"));return fCallback(null,'');}tmpTemplateFromMapHash=tmpTemplateHashPart[0];tmpAddressOfMap=tmpTemplateHashPart[1];tmpAddressOfKey=tmpTemplateHashPart[2];// No TemplateFromMap hash
|
|
4451
4484
|
if(!tmpTemplateFromMapHash){this.log.warn("Pict: TemplateFromMap Render Async: TemplateFromMapHash not resolved for [".concat(tmpHash,"]"));return fCallback(null,'');}// Now resolve the data
|
|
4452
4485
|
var tmpMap=this.resolveStateFromAddress(tmpAddressOfMap,tmpData,pContextArray);var tmpKey=this.resolveStateFromAddress(tmpAddressOfKey,tmpData,pContextArray);if(!tmpMap){this.log.warn("Pict: TemplateFromMap Render: Map not resolved for [".concat(tmpHash,"]"));return fCallback(null,'');}tmpData=tmpMap[tmpKey];if(!tmpData){// No address was provided, just render the TemplateFromMap with what this TemplateFromMap has.
|
|
4453
4486
|
// The async portion of this is a mind bender because of how entry can happen dynamically from TemplateFromMaps
|
|
4454
|
-
return this.pict.parseTemplateByHash(tmpTemplateFromMapHash,
|
|
4487
|
+
return this.pict.parseTemplateByHash(tmpTemplateFromMapHash,pRecord,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}else{return this.pict.parseTemplateByHash(tmpTemplateFromMapHash,tmpData,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}}}]);}(libPictTemplate);module.exports=PictTemplateProviderTemplateFromMap;},{"../Pict-Template.js":167}],175:[function(require,module,exports){var libPictTemplate=require('../Pict-Template.js');var PictTemplateProviderTemplateSet=/*#__PURE__*/function(_libPictTemplate5){/**
|
|
4455
4488
|
* @param {Object} pFable - The Fable Framework instance
|
|
4456
4489
|
* @param {Object} pOptions - The options for the service
|
|
4457
4490
|
* @param {String} pServiceHash - The hash of the service
|
|
4458
|
-
*/function PictTemplateProviderTemplateSet(pFable,pOptions,pServiceHash){var _this79;_classCallCheck2(this,PictTemplateProviderTemplateSet);_this79=_callSuper(this,PictTemplateProviderTemplateSet,[pFable,pOptions,pServiceHash]);_this79.addPattern('{~TemplateSet:','~}');_this79.addPattern('{~TS:','~}');return _this79;}_inherits(PictTemplateProviderTemplateSet,_libPictTemplate5);return _createClass2(PictTemplateProviderTemplateSet,[{key:"render",value:function render(
|
|
4491
|
+
*/function PictTemplateProviderTemplateSet(pFable,pOptions,pServiceHash){var _this79;_classCallCheck2(this,PictTemplateProviderTemplateSet);_this79=_callSuper(this,PictTemplateProviderTemplateSet,[pFable,pOptions,pServiceHash]);_this79.addPattern('{~TemplateSet:','~}');_this79.addPattern('{~TS:','~}');return _this79;}_inherits(PictTemplateProviderTemplateSet,_libPictTemplate5);return _createClass2(PictTemplateProviderTemplateSet,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateSetRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateSetRender]::[".concat(tmpHash,"]"));}var tmpTemplateHash=false;var tmpAddressOfData=false;// This is just a simple 2 part hash (the entity and the ID)
|
|
4459
4492
|
var tmpHashTemplateSeparator=tmpHash.indexOf(':');tmpTemplateHash=tmpHash.substring(0,tmpHashTemplateSeparator);if(tmpHashTemplateSeparator>-1){tmpAddressOfData=tmpHash.substring(tmpHashTemplateSeparator+1);}else{tmpTemplateHash=tmpHash;}// No template hash
|
|
4460
4493
|
if(!tmpTemplateHash){this.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]");}if(!tmpAddressOfData){// No address was provided, just render the template with what this template has.
|
|
4461
|
-
return this.pict.parseTemplateSetByHash(tmpTemplateHash,
|
|
4462
|
-
var tmpTemplateHashPart=tmpHash.split(':');if(tmpTemplateHashPart.length<2){this.log.trace("PICT TemplateFromMap [fTemplateRenderAsync]::[".concat(tmpHash,"] failed because there were not three stanzas in the expression [").concat(
|
|
4494
|
+
return this.pict.parseTemplateSetByHash(tmpTemplateHash,pRecord,null,pContextArray);}else{return this.pict.parseTemplateSetByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray),null,pContextArray);}}},{key:"renderAsync",value:function renderAsync(pTemplateHash,pRecord,fCallback,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};var tmpCallback=typeof fCallback==='function'?fCallback:function(){return'';};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateSetRenderAsync]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateSetRenderAsync]::[".concat(tmpHash,"]"));}var tmpTemplateFromMapHash=false;var tmpAddressOfData=false;// This is a 3 part hash with the map address and the key address both
|
|
4495
|
+
var tmpTemplateHashPart=tmpHash.split(':');if(tmpTemplateHashPart.length<2){this.log.trace("PICT TemplateFromMap [fTemplateRenderAsync]::[".concat(tmpHash,"] failed because there were not three stanzas in the expression [").concat(pTemplateHash,"]"));return fCallback(null,'');}tmpTemplateFromMapHash=tmpTemplateHashPart[0];tmpAddressOfData=tmpTemplateHashPart[1];// No TemplateFromMap hash
|
|
4463
4496
|
if(!tmpTemplateFromMapHash){this.log.warn("Pict: TemplateFromMap Render Async: TemplateFromMapHash not resolved for [".concat(tmpHash,"]"));return fCallback(null,'');}// Now resolve the data
|
|
4464
4497
|
tmpData=this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray);if(!tmpData){// No address was provided, just render the template with what this template has.
|
|
4465
4498
|
// The async portion of this is a mind bender because of how entry can happen dynamically from templates
|
|
4466
|
-
return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,
|
|
4499
|
+
return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}else{return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,tmpData,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}}}]);}(libPictTemplate);module.exports=PictTemplateProviderTemplateSet;},{"../Pict-Template.js":167}],176:[function(require,module,exports){var libPictTemplate=require('../Pict-Template.js');var PictTemplateProviderTemplateSetFromMap=/*#__PURE__*/function(_libPictTemplate6){/**
|
|
4467
4500
|
* @param {Object} pFable - The Fable Framework instance
|
|
4468
4501
|
* @param {Object} pOptions - The options for the service
|
|
4469
4502
|
* @param {String} pServiceHash - The hash of the service
|
|
4470
|
-
*/function PictTemplateProviderTemplateSetFromMap(pFable,pOptions,pServiceHash){var _this80;_classCallCheck2(this,PictTemplateProviderTemplateSetFromMap);_this80=_callSuper(this,PictTemplateProviderTemplateSetFromMap,[pFable,pOptions,pServiceHash]);_this80.addPattern('{~TSFM:','~}');_this80.addPattern('{~TemplateSetFromMap:','~}');return _this80;}_inherits(PictTemplateProviderTemplateSetFromMap,_libPictTemplate6);return _createClass2(PictTemplateProviderTemplateSetFromMap,[{key:"render",value:function render(
|
|
4471
|
-
var tmpTemplateHashPart=tmpHash.split(':');if(tmpTemplateHashPart.length<3){this.log.trace("PICT TemplateFromMap [fTemplateFromMapRenderAsync]::[".concat(tmpHash,"] failed because there were not three stanzas in the expression [").concat(
|
|
4503
|
+
*/function PictTemplateProviderTemplateSetFromMap(pFable,pOptions,pServiceHash){var _this80;_classCallCheck2(this,PictTemplateProviderTemplateSetFromMap);_this80=_callSuper(this,PictTemplateProviderTemplateSetFromMap,[pFable,pOptions,pServiceHash]);_this80.addPattern('{~TSFM:','~}');_this80.addPattern('{~TemplateSetFromMap:','~}');return _this80;}_inherits(PictTemplateProviderTemplateSetFromMap,_libPictTemplate6);return _createClass2(PictTemplateProviderTemplateSetFromMap,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT TemplateFromMap [fTemplateFromMapSetRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT TemplateFromMap [fTemplateFromMapSetRender]::[".concat(tmpHash,"]"));}var tmpTemplateFromMapHash=false;var tmpAddressOfMap=false;var tmpAddressOfKey=false;// This is a 3 part hash with the map address and the key address both
|
|
4504
|
+
var tmpTemplateHashPart=tmpHash.split(':');if(tmpTemplateHashPart.length<3){this.log.trace("PICT TemplateFromMap [fTemplateFromMapRenderAsync]::[".concat(tmpHash,"] failed because there were not three stanzas in the expression [").concat(pTemplateHash,"]"));return'';}tmpTemplateFromMapHash=tmpTemplateHashPart[0];tmpAddressOfMap=tmpTemplateHashPart[1];tmpAddressOfKey=tmpTemplateHashPart[2];// No TemplateFromMap hash
|
|
4472
4505
|
if(!tmpTemplateFromMapHash){this.log.warn("Pict: TemplateFromMap Render Async: TemplateFromMapHash not resolved for [".concat(tmpHash,"]"));return'';}// Now resolve the data
|
|
4473
4506
|
var tmpMap=this.resolveStateFromAddress(tmpAddressOfMap,tmpData,pContextArray);var tmpKey=this.resolveStateFromAddress(tmpAddressOfKey,tmpData,pContextArray);if(!tmpMap){this.log.warn("Pict: TemplateFromMap Render: Map not resolved for [".concat(tmpHash,"]"));return'';}tmpData=tmpMap[tmpKey];if(!tmpData){// No address was provided, just render the TemplateFromMap with what this TemplateFromMap has.
|
|
4474
|
-
return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,
|
|
4475
|
-
var tmpTemplateHashPart=tmpHash.split(':');if(tmpTemplateHashPart.length<3){this.log.trace("PICT TemplateFromMap [fTemplateFromMapRenderAsync]::[".concat(tmpHash,"] failed because there were not three stanzas in the expression [").concat(
|
|
4507
|
+
return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,null,pContextArray);}else{return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,tmpData,null,pContextArray);}}},{key:"renderAsync",value:function renderAsync(pTemplateHash,pRecord,fCallback,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};var tmpCallback=typeof fCallback==='function'?fCallback:function(){return'';};if(this.pict.LogNoisiness>4){this.log.trace("PICT TemplateFromMap [fTemplateFromMapSetRenderAsync]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT TemplateFromMap [fTemplateFromMapSetRenderAsync]::[".concat(tmpHash,"]"));}var tmpTemplateFromMapHash=false;var tmpAddressOfMap=false;var tmpAddressOfKey=false;// This is a 3 part hash with the map address and the key address both
|
|
4508
|
+
var tmpTemplateHashPart=tmpHash.split(':');if(tmpTemplateHashPart.length<3){this.log.trace("PICT TemplateFromMap [fTemplateFromMapRenderAsync]::[".concat(tmpHash,"] failed because there were not three stanzas in the expression [").concat(pTemplateHash,"]"));return fCallback(null,'');}tmpTemplateFromMapHash=tmpTemplateHashPart[0];tmpAddressOfMap=tmpTemplateHashPart[1];tmpAddressOfKey=tmpTemplateHashPart[2];// No TemplateFromMap hash
|
|
4476
4509
|
if(!tmpTemplateFromMapHash){this.log.warn("Pict: TemplateFromMapSet Render Async: TemplateFromMapHash not resolved for [".concat(tmpHash,"]"));return fCallback(null,'');}// Now resolve the data
|
|
4477
4510
|
var tmpMap=this.resolveStateFromAddress(tmpAddressOfMap,tmpData,pContextArray);var tmpKey=this.resolveStateFromAddress(tmpAddressOfKey,tmpData,pContextArray);if(!tmpMap){this.log.warn("Pict: TemplateFromMapSet Render: Map not resolved for [".concat(tmpHash,"]"));return fCallback(null,'');}tmpData=tmpMap[tmpKey];if(!tmpData){// No address was provided, just render the TemplateFromMap with what this TemplateFromMap has.
|
|
4478
4511
|
// The async portion of this is a mind bender because of how entry can happen dynamically from TemplateFromMaps
|
|
4479
|
-
return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,
|
|
4512
|
+
return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}else{return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,tmpData,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}}}]);}(libPictTemplate);module.exports=PictTemplateProviderTemplateSetFromMap;},{"../Pict-Template.js":167}],177:[function(require,module,exports){var libPictTemplate=require('../Pict-Template.js');var PictTemplateProviderTemplateValueSet=/*#__PURE__*/function(_libPictTemplate7){/**
|
|
4480
4513
|
* @param {Object} pFable - The Fable Framework instance
|
|
4481
4514
|
* @param {Object} pOptions - The options for the service
|
|
4482
4515
|
* @param {String} pServiceHash - The hash of the service
|
|
4483
|
-
*/function PictTemplateProviderTemplateValueSet(pFable,pOptions,pServiceHash){var _this81;_classCallCheck2(this,PictTemplateProviderTemplateValueSet);_this81=_callSuper(this,PictTemplateProviderTemplateValueSet,[pFable,pOptions,pServiceHash]);_this81.addPattern('{~TemplateValueSet:','~}');_this81.addPattern('{~TVS:','~}');return _this81;}_inherits(PictTemplateProviderTemplateValueSet,_libPictTemplate7);return _createClass2(PictTemplateProviderTemplateValueSet,[{key:"render",value:function render(
|
|
4516
|
+
*/function PictTemplateProviderTemplateValueSet(pFable,pOptions,pServiceHash){var _this81;_classCallCheck2(this,PictTemplateProviderTemplateValueSet);_this81=_callSuper(this,PictTemplateProviderTemplateValueSet,[pFable,pOptions,pServiceHash]);_this81.addPattern('{~TemplateValueSet:','~}');_this81.addPattern('{~TVS:','~}');return _this81;}_inherits(PictTemplateProviderTemplateValueSet,_libPictTemplate7);return _createClass2(PictTemplateProviderTemplateValueSet,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateValueSetRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateValueSetRender]::[".concat(tmpHash,"]"));}var tmpTemplateHash=false;var tmpAddressOfData=false;// This is just a simple 2 part hash (the entity and the ID)
|
|
4484
4517
|
var tmpHashTemplateSeparator=tmpHash.indexOf(':');tmpTemplateHash=tmpHash.substring(0,tmpHashTemplateSeparator);if(tmpHashTemplateSeparator>-1){tmpAddressOfData=tmpHash.substring(tmpHashTemplateSeparator+1);}else{tmpTemplateHash=tmpHash;}// No template hash
|
|
4485
|
-
if(!tmpTemplateHash){this.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]");}tmpData=this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray);var tmpDataValueSet=[];if(Array.isArray(tmpData)){for(var i=0;i<tmpData.length;i++){tmpDataValueSet.push({Value:tmpData[i]});}}else if(_typeof(tmpData)==='object'){var tmpValueKeys=Object.keys(tmpData);for(var _i50=0;_i50<tmpValueKeys.length;_i50++){tmpDataValueSet.push({Value:tmpData[tmpValueKeys[_i50]]});}}else{tmpDataValueSet.push({Value:tmpData});}tmpData=tmpDataValueSet;if(!tmpData){// No address was provided, just render the template with what this template has.
|
|
4486
|
-
return this.pict.parseTemplateSetByHash(tmpTemplateHash,
|
|
4487
|
-
var tmpTemplateHashPart=tmpHash.split(':');if(tmpTemplateHashPart.length<2){this.log.trace("PICT TemplateFromMap [fTemplateRenderAsync]::[".concat(tmpHash,"] failed because there were not three stanzas in the expression [").concat(
|
|
4518
|
+
if(!tmpTemplateHash){this.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]");}tmpData=this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray);var tmpDataValueSet=[];if(Array.isArray(tmpData)){for(var i=0;i<tmpData.length;i++){tmpDataValueSet.push({Value:tmpData[i],Key:i});}}else if(_typeof(tmpData)==='object'){var tmpValueKeys=Object.keys(tmpData);for(var _i50=0;_i50<tmpValueKeys.length;_i50++){tmpDataValueSet.push({Value:tmpData[tmpValueKeys[_i50]],Key:tmpValueKeys[_i50]});}}else{tmpDataValueSet.push({Value:tmpData});}tmpData=tmpDataValueSet;if(!tmpData){// No address was provided, just render the template with what this template has.
|
|
4519
|
+
return this.pict.parseTemplateSetByHash(tmpTemplateHash,pRecord,null,pContextArray);}else{return this.pict.parseTemplateSetByHash(tmpTemplateHash,tmpData,null,pContextArray);}}},{key:"renderAsync",value:function renderAsync(pTemplateHash,pRecord,fCallback,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};var tmpCallback=typeof fCallback==='function'?fCallback:function(){return'';};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateValueSetRenderAsync]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateValueSetRenderAsync]::[".concat(tmpHash,"]"));}var tmpTemplateFromMapHash=false;var tmpAddressOfData=false;// This is a 3 part hash with the map address and the key address both
|
|
4520
|
+
var tmpTemplateHashPart=tmpHash.split(':');if(tmpTemplateHashPart.length<2){this.log.trace("PICT TemplateFromMap [fTemplateRenderAsync]::[".concat(tmpHash,"] failed because there were not three stanzas in the expression [").concat(pTemplateHash,"]"));return fCallback(null,'');}tmpTemplateFromMapHash=tmpTemplateHashPart[0];tmpAddressOfData=tmpTemplateHashPart[1];// No TemplateFromMap hash
|
|
4488
4521
|
if(!tmpTemplateFromMapHash){this.log.warn("Pict: TemplateFromMap Render Async: TemplateFromMapHash not resolved for [".concat(tmpHash,"]"));return fCallback(null,'');}// Now resolve the data
|
|
4489
4522
|
tmpData=this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray);var tmpDataValueSet=[];if(Array.isArray(tmpData)){for(var i=0;i<tmpData.length;i++){tmpDataValueSet.push({Value:tmpData[i]});}}else if(_typeof(tmpData)==='object'){var tmpValueKeys=Object.keys(tmpData);for(var _i51=0;_i51<tmpValueKeys.length;_i51++){tmpDataValueSet.push({Value:tmpData[tmpValueKeys[_i51]]});}}else{tmpDataValueSet.push({Value:tmpData});}tmpData=tmpDataValueSet;if(!tmpData){// No address was provided, just render the template with what this template has.
|
|
4490
4523
|
// The async portion of this is a mind bender because of how entry can happen dynamically from templates
|
|
4491
|
-
return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,
|
|
4524
|
+
return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}else{return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,tmpData,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}}}]);}(libPictTemplate);module.exports=PictTemplateProviderTemplateValueSet;},{"../Pict-Template.js":167}],178:[function(require,module,exports){var libPictTemplate=require('../../Pict-Template.js');var PictTemplateProviderRandomNumber=/*#__PURE__*/function(_libPictTemplate8){/**
|
|
4525
|
+
* @param {Object} pFable - The Fable Framework instance
|
|
4526
|
+
* @param {Object} pOptions - The options for the service
|
|
4527
|
+
* @param {String} pServiceHash - The hash of the service
|
|
4528
|
+
*/function PictTemplateProviderRandomNumber(pFable,pOptions,pServiceHash){var _this82;_classCallCheck2(this,PictTemplateProviderRandomNumber);_this82=_callSuper(this,PictTemplateProviderRandomNumber,[pFable,pOptions,pServiceHash]);_this82.addPattern('{~RandomNumber:','~}');_this82.addPattern('{~RN:','~}');return _this82;}_inherits(PictTemplateProviderRandomNumber,_libPictTemplate8);return _createClass2(PictTemplateProviderRandomNumber,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fRandomNumber]::[".concat(tmpHash,"]"));}var tmpMinimumNumber=0;var tmpMaxNumber=9999999;if(tmpHash.length>0){var tmpHashParts=tmpHash.split(',');if(tmpHashParts.length>0){try{tmpMinimumNumber=parseInt(tmpHashParts[0]);}catch(_unused2){tmpMinimumNumber=0;}}if(tmpHashParts.length>1){try{tmpMaxNumber=parseInt(tmpHashParts[1]);}catch(_unused3){tmpMaxNumber=9999999;}}}return this.fable.DataGeneration.randomIntegerBetween(tmpMinimumNumber,tmpMaxNumber);}}]);}(libPictTemplate);module.exports=PictTemplateProviderRandomNumber;},{"../../Pict-Template.js":167}],179:[function(require,module,exports){var libPictTemplate=require('../../Pict-Template.js');var PictTemplateProviderRandomNumberString=/*#__PURE__*/function(_libPictTemplate9){/**
|
|
4492
4529
|
* @param {Object} pFable - The Fable Framework instance
|
|
4493
4530
|
* @param {Object} pOptions - The options for the service
|
|
4494
4531
|
* @param {String} pServiceHash - The hash of the service
|
|
4495
|
-
*/function
|
|
4532
|
+
*/function PictTemplateProviderRandomNumberString(pFable,pOptions,pServiceHash){var _this83;_classCallCheck2(this,PictTemplateProviderRandomNumberString);_this83=_callSuper(this,PictTemplateProviderRandomNumberString,[pFable,pOptions,pServiceHash]);_this83.addPattern('{~RandomNumberString:','~}');_this83.addPattern('{~RNS:','~}');return _this83;}_inherits(PictTemplateProviderRandomNumberString,_libPictTemplate9);return _createClass2(PictTemplateProviderRandomNumberString,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fRandomNumberString]::[".concat(tmpHash,"]"));}var tmpStringLength=4;var tmpMaxNumber=9999;if(tmpHash.length>0){var tmpHashParts=tmpHash.split(',');if(tmpHashParts.length>0){try{tmpStringLength=parseInt(tmpHashParts[0]);}catch(_unused4){tmpStringLength=4;}}if(tmpHashParts.length>1){try{tmpMaxNumber=parseInt(tmpHashParts[1]);}catch(_unused5){tmpMaxNumber=9999;}}}return this.fable.DataGeneration.randomNumericString(tmpStringLength,tmpMaxNumber);}}]);}(libPictTemplate);module.exports=PictTemplateProviderRandomNumberString;},{"../../Pict-Template.js":167}],180:[function(require,module,exports){var libPictTemplate=require('../../Pict-Template.js');var PictTemplateProviderDollars=/*#__PURE__*/function(_libPictTemplate10){/**
|
|
4496
4533
|
* @param {Object} pFable - The Fable Framework instance
|
|
4497
4534
|
* @param {Object} pOptions - The options for the service
|
|
4498
4535
|
* @param {String} pServiceHash - The hash of the service
|
|
4499
|
-
*/function
|
|
4536
|
+
*/function PictTemplateProviderDollars(pFable,pOptions,pServiceHash){var _this84;_classCallCheck2(this,PictTemplateProviderDollars);_this84=_callSuper(this,PictTemplateProviderDollars,[pFable,pOptions,pServiceHash]);_this84.addPattern('{~DataJson:','~}');_this84.addPattern('{~DJ:','~}');return _this84;}_inherits(PictTemplateProviderDollars,_libPictTemplate10);return _createClass2(PictTemplateProviderDollars,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fDataJson]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fDataJson]::[".concat(tmpHash,"]"));}var tmpDataToStringify=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray);if(!tmpDataToStringify){tmpDataToStringify=pRecord;}return JSON.stringify(tmpDataToStringify);}}]);}(libPictTemplate);module.exports=PictTemplateProviderDollars;},{"../../Pict-Template.js":167}],181:[function(require,module,exports){var libPictTemplate=require('../../Pict-Template.js');var PictTemplateProviderDateFormat=/*#__PURE__*/function(_libPictTemplate11){/**
|
|
4500
4537
|
* @param {Object} pFable - The Fable Framework instance
|
|
4501
4538
|
* @param {Object} pOptions - The options for the service
|
|
4502
4539
|
* @param {String} pServiceHash - The hash of the service
|
|
4503
|
-
*/function PictTemplateProviderDateFormat(pFable,pOptions,pServiceHash){var
|
|
4540
|
+
*/function PictTemplateProviderDateFormat(pFable,pOptions,pServiceHash){var _this85;_classCallCheck2(this,PictTemplateProviderDateFormat);_this85=_callSuper(this,PictTemplateProviderDateFormat,[pFable,pOptions,pServiceHash]);_this85.addPattern('{~DateFormat:','~}');return _this85;}_inherits(PictTemplateProviderDateFormat,_libPictTemplate11);return _createClass2(PictTemplateProviderDateFormat,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};var tmpDateValueSet=tmpHash.split('^');if(tmpDateValueSet.length<2){this.log.error("PICT Template [fDateFormat]::[".concat(tmpHash,"] did not have a valid format string and date."));return'';}var tmpDateValue=this.resolveStateFromAddress(tmpDateValueSet[0],tmpData,pContextArray);if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fDateFormat]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fDateFormat]::[".concat(tmpHash,"]"));}// TODO: Modularize this
|
|
4504
4541
|
var tmpDayJS=this.fable.Dates.dayJS.utc(tmpDateValue);try{// Try to cast the day to be a specific timezone if one is set for the app
|
|
4505
4542
|
if(this.options.Timezone){tmpDayJS=tmpDayJS.tz(this.options.Timezone);}else{try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.log.error("Error guessing dayJS guess() function; dates may be formatted to GMT by default. (".concat(pError.message||pError,")"));}}}catch(_unused6){//this.log.error(`Error casting date passed timezone using tz .. casting to the browser guess which is [${this.fable.Dates.dayJS.tz.guess()}].`);
|
|
4506
4543
|
// Day.js will try to guess the user's timezone for us
|
|
@@ -4510,100 +4547,100 @@ try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.
|
|
|
4510
4547
|
```javascript
|
|
4511
4548
|
|
|
4512
4549
|
```
|
|
4513
|
-
*/},{"../../Pict-Template.js":167}],
|
|
4550
|
+
*/},{"../../Pict-Template.js":167}],182:[function(require,module,exports){var libPictTemplate=require('../../Pict-Template.js');var PictTemplateProviderDateYMD=/*#__PURE__*/function(_libPictTemplate12){/**
|
|
4514
4551
|
* @param {Object} pFable - The Fable Framework instance
|
|
4515
4552
|
* @param {Object} pOptions - The options for the service
|
|
4516
4553
|
* @param {String} pServiceHash - The hash of the service
|
|
4517
|
-
*/function PictTemplateProviderDateYMD(pFable,pOptions,pServiceHash){var
|
|
4554
|
+
*/function PictTemplateProviderDateYMD(pFable,pOptions,pServiceHash){var _this86;_classCallCheck2(this,PictTemplateProviderDateYMD);_this86=_callSuper(this,PictTemplateProviderDateYMD,[pFable,pOptions,pServiceHash]);_this86.addPattern('{~DateYMD:','~}');return _this86;}_inherits(PictTemplateProviderDateYMD,_libPictTemplate12);return _createClass2(PictTemplateProviderDateYMD,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};var tmpDateValue=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray);if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fDateFormat]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fDateFormat]::[".concat(tmpHash,"]"));}// TODO: Modularize this
|
|
4518
4555
|
var tmpDayJS=this.fable.Dates.dayJS.utc(tmpDateValue);try{// Try to cast the day to be a specific timezone if one is set for the app
|
|
4519
4556
|
if(this.options.Timezone){tmpDayJS=tmpDayJS.tz(this.options.Timezone);}else{try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.log.error("Error guessing dayJS guess() function; dates may be formatted to GMT by default. (".concat(pError.message||pError,")"));}}}catch(_unused7){//this.log.error(`Error casting timezone using tz .. casting to the browser guess which is [${this.fable.Dates.dayJS.tz.guess()}].`);
|
|
4520
4557
|
// Day.js will try to guess the user's timezone for us
|
|
4521
|
-
try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.log.error("Error guessing dayJS guess() function; dates may be formatted to GMT by default. (".concat(pError.message||pError,")"));}}return tmpDayJS.format('YYYY-MM-DD');}}]);}(libPictTemplate);module.exports=PictTemplateProviderDateYMD;},{"../../Pict-Template.js":167}],
|
|
4558
|
+
try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.log.error("Error guessing dayJS guess() function; dates may be formatted to GMT by default. (".concat(pError.message||pError,")"));}}return tmpDayJS.format('YYYY-MM-DD');}}]);}(libPictTemplate);module.exports=PictTemplateProviderDateYMD;},{"../../Pict-Template.js":167}],183:[function(require,module,exports){var libPictTemplate=require('../../Pict-Template.js');var PictTemplateProviderDigits=/*#__PURE__*/function(_libPictTemplate13){/**
|
|
4522
4559
|
* @param {Object} pFable - The Fable Framework instance
|
|
4523
4560
|
* @param {Object} pOptions - The options for the service
|
|
4524
4561
|
* @param {String} pServiceHash - The hash of the service
|
|
4525
|
-
*/function PictTemplateProviderDigits(pFable,pOptions,pServiceHash){var
|
|
4562
|
+
*/function PictTemplateProviderDigits(pFable,pOptions,pServiceHash){var _this87;_classCallCheck2(this,PictTemplateProviderDigits);_this87=_callSuper(this,PictTemplateProviderDigits,[pFable,pOptions,pServiceHash]);_this87.addPattern('{~Digits:','~}');return _this87;}_inherits(PictTemplateProviderDigits,_libPictTemplate13);return _createClass2(PictTemplateProviderDigits,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fDigits]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fDigits]::[".concat(tmpHash,"]"));}var tmpColumnData=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray);return this.fable.DataFormat.formatterAddCommasToNumber(this.fable.DataFormat.formatterRoundNumber(tmpColumnData,2));}}]);}(libPictTemplate);module.exports=PictTemplateProviderDigits;},{"../../Pict-Template.js":167}],184:[function(require,module,exports){var libPictTemplate=require('../../Pict-Template.js');var PictTemplateProviderDollars=/*#__PURE__*/function(_libPictTemplate14){/**
|
|
4526
4563
|
* @param {Object} pFable - The Fable Framework instance
|
|
4527
4564
|
* @param {Object} pOptions - The options for the service
|
|
4528
4565
|
* @param {String} pServiceHash - The hash of the service
|
|
4529
|
-
*/function PictTemplateProviderDollars(pFable,pOptions,pServiceHash){var
|
|
4566
|
+
*/function PictTemplateProviderDollars(pFable,pOptions,pServiceHash){var _this88;_classCallCheck2(this,PictTemplateProviderDollars);_this88=_callSuper(this,PictTemplateProviderDollars,[pFable,pOptions,pServiceHash]);_this88.addPattern('{~Dollars:','~}');return _this88;}_inherits(PictTemplateProviderDollars,_libPictTemplate14);return _createClass2(PictTemplateProviderDollars,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fDollars]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fDollars]::[".concat(tmpHash,"]"));}var tmpColumnData=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray);return this.fable.DataFormat.formatterDollars(tmpColumnData);}}]);}(libPictTemplate);module.exports=PictTemplateProviderDollars;},{"../../Pict-Template.js":167}],185:[function(require,module,exports){var libPictTemplate=require('../../Pict-Template.js');var PictTemplateProviderJoin=/*#__PURE__*/function(_libPictTemplate15){/**
|
|
4530
4567
|
* @param {Object} pFable - The Fable Framework instance
|
|
4531
4568
|
* @param {Object} pOptions - The options for the service
|
|
4532
4569
|
* @param {String} pServiceHash - The hash of the service
|
|
4533
|
-
*/function PictTemplateProviderJoin(pFable,pOptions,pServiceHash){var
|
|
4534
|
-
var tmpSeparator=tmpDataAddresses.shift();var tmpValueList=[];for(var i=0;i<tmpDataAddresses.length;i++){var tmpValueSet=this.resolveStateFromAddress(tmpDataAddresses[i],tmpData,pContextArray);if(tmpValueSet&&Array.isArray(tmpValueSet)){for(var j=0;j<tmpValueSet.length;j++){tmpValueList.push(tmpValueSet[j]);}}else if(tmpValueSet){tmpValueList.push(tmpValueSet);}}return tmpValueList.join(tmpSeparator);}}]);}(libPictTemplate);module.exports=PictTemplateProviderJoin;},{"../../Pict-Template.js":167}],
|
|
4570
|
+
*/function PictTemplateProviderJoin(pFable,pOptions,pServiceHash){var _this89;_classCallCheck2(this,PictTemplateProviderJoin);_this89=_callSuper(this,PictTemplateProviderJoin,[pFable,pOptions,pServiceHash]);_this89.addPattern('{~Join:','~}');_this89.addPattern('{~J:','~}');return _this89;}_inherits(PictTemplateProviderJoin,_libPictTemplate15);return _createClass2(PictTemplateProviderJoin,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash;var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Join [fDataRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Join [fDataRender]::[".concat(tmpHash,"]"));}var tmpDataAddresses=tmpHash.split('^');if(tmpDataAddresses.length<2){return'';}// Get the separator string
|
|
4571
|
+
var tmpSeparator=tmpDataAddresses.shift();var tmpValueList=[];for(var i=0;i<tmpDataAddresses.length;i++){var tmpValueSet=this.resolveStateFromAddress(tmpDataAddresses[i],tmpData,pContextArray);if(tmpValueSet&&Array.isArray(tmpValueSet)){for(var j=0;j<tmpValueSet.length;j++){tmpValueList.push(tmpValueSet[j]);}}else if(tmpValueSet){tmpValueList.push(tmpValueSet);}}return tmpValueList.join(tmpSeparator);}}]);}(libPictTemplate);module.exports=PictTemplateProviderJoin;},{"../../Pict-Template.js":167}],186:[function(require,module,exports){var libPictTemplate=require('../../Pict-Template.js');var PictTemplateProviderJoinUnique=/*#__PURE__*/function(_libPictTemplate16){/**
|
|
4535
4572
|
* @param {Object} pFable - The Fable Framework instance
|
|
4536
4573
|
* @param {Object} pOptions - The options for the service
|
|
4537
4574
|
* @param {String} pServiceHash - The hash of the service
|
|
4538
|
-
*/function PictTemplateProviderJoinUnique(pFable,pOptions,pServiceHash){var
|
|
4539
|
-
var tmpSeparator=tmpDataAddresses.shift();var tmpValueList=[];var tmpValueMap={};for(var i=0;i<tmpDataAddresses.length;i++){var tmpValueSet=this.resolveStateFromAddress(tmpDataAddresses[i],tmpData,pContextArray);if(tmpValueSet&&Array.isArray(tmpValueSet)){for(var j=0;j<tmpValueSet.length;j++){if(!(tmpValueSet[j]in tmpValueMap)){tmpValueMap[tmpValueSet[j]]=true;tmpValueList.push(tmpValueSet[j]);}}}else if(tmpValueSet){if(!(tmpValueSet in tmpValueMap)){tmpValueMap[tmpValueSet]=true;tmpValueList.push(tmpValueSet);}}}return tmpValueList.join(tmpSeparator);}}]);}(libPictTemplate);module.exports=PictTemplateProviderJoinUnique;},{"../../Pict-Template.js":167}],
|
|
4575
|
+
*/function PictTemplateProviderJoinUnique(pFable,pOptions,pServiceHash){var _this90;_classCallCheck2(this,PictTemplateProviderJoinUnique);_this90=_callSuper(this,PictTemplateProviderJoinUnique,[pFable,pOptions,pServiceHash]);_this90.addPattern('{~JoinUnique:','~}');_this90.addPattern('{~JU:','~}');return _this90;}_inherits(PictTemplateProviderJoinUnique,_libPictTemplate16);return _createClass2(PictTemplateProviderJoinUnique,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash;var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Join Unique [fDataRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Join Unique [fDataRender]::[".concat(tmpHash,"]"));}var tmpDataAddresses=tmpHash.split('^');if(tmpDataAddresses.length<2){return'';}// Get the separator string
|
|
4576
|
+
var tmpSeparator=tmpDataAddresses.shift();var tmpValueList=[];var tmpValueMap={};for(var i=0;i<tmpDataAddresses.length;i++){var tmpValueSet=this.resolveStateFromAddress(tmpDataAddresses[i],tmpData,pContextArray);if(tmpValueSet&&Array.isArray(tmpValueSet)){for(var j=0;j<tmpValueSet.length;j++){if(!(tmpValueSet[j]in tmpValueMap)){tmpValueMap[tmpValueSet[j]]=true;tmpValueList.push(tmpValueSet[j]);}}}else if(tmpValueSet){if(!(tmpValueSet in tmpValueMap)){tmpValueMap[tmpValueSet]=true;tmpValueList.push(tmpValueSet);}}}return tmpValueList.join(tmpSeparator);}}]);}(libPictTemplate);module.exports=PictTemplateProviderJoinUnique;},{"../../Pict-Template.js":167}],187:[function(require,module,exports){var libPictTemplate=require('../../Pict-Template.js');var PictTemplateProviderPascalCaseIdentifier=/*#__PURE__*/function(_libPictTemplate17){/**
|
|
4540
4577
|
* @param {Object} pFable - The Fable Framework instance
|
|
4541
4578
|
* @param {Object} pOptions - The options for the service
|
|
4542
4579
|
* @param {String} pServiceHash - The hash of the service
|
|
4543
|
-
*/function PictTemplateProviderPascalCaseIdentifier(pFable,pOptions,pServiceHash){var
|
|
4580
|
+
*/function PictTemplateProviderPascalCaseIdentifier(pFable,pOptions,pServiceHash){var _this91;_classCallCheck2(this,PictTemplateProviderPascalCaseIdentifier);_this91=_callSuper(this,PictTemplateProviderPascalCaseIdentifier,[pFable,pOptions,pServiceHash]);_this91.addPattern('{~PascalCaseIdentifier:','~}');return _this91;}_inherits(PictTemplateProviderPascalCaseIdentifier,_libPictTemplate17);return _createClass2(PictTemplateProviderPascalCaseIdentifier,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fPascalCaseIdentifier]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fPascalCaseIdentifier]::[".concat(tmpHash,"]"));}var tmpValue=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray);if(tmpValue==null||tmpValue=='undefined'||typeof tmpValue=='undefined'){return'';}return this.pict.DataFormat.cleanNonAlphaCharacters(this.pict.DataFormat.capitalizeEachWord(tmpValue));}}]);}(libPictTemplate);module.exports=PictTemplateProviderPascalCaseIdentifier;/*
|
|
4544
4581
|
# DEAR DEAD CODE DIARY:
|
|
4545
4582
|
|
|
4546
4583
|
```javascript
|
|
4547
4584
|
|
|
4548
4585
|
```
|
|
4549
|
-
*/},{"../../Pict-Template.js":167}],
|
|
4586
|
+
*/},{"../../Pict-Template.js":167}],188:[function(require,module,exports){var libPictTemplate=require('../../Pict-Template.js');var PictTemplateProviderBreakpoint=/*#__PURE__*/function(_libPictTemplate18){/**
|
|
4550
4587
|
* @param {Object} pFable - The Fable Framework instance
|
|
4551
4588
|
* @param {Object} pOptions - The options for the service
|
|
4552
4589
|
* @param {String} pServiceHash - The hash of the service
|
|
4553
|
-
*/function PictTemplateProviderBreakpoint(pFable,pOptions,pServiceHash){var
|
|
4590
|
+
*/function PictTemplateProviderBreakpoint(pFable,pOptions,pServiceHash){var _this92;_classCallCheck2(this,PictTemplateProviderBreakpoint);_this92=_callSuper(this,PictTemplateProviderBreakpoint,[pFable,pOptions,pServiceHash]);_this92.addPattern('{~Breakpoint','~}');return _this92;}_inherits(PictTemplateProviderBreakpoint,_libPictTemplate18);return _createClass2(PictTemplateProviderBreakpoint,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpError=new Error("PICT Template Breakpoint: ".concat(tmpHash));this.log.trace("PICT Template Breakpoint: ".concat(tmpHash),tmpError.stack);//throw tmpError;
|
|
4554
4591
|
debugger;// eslint-disable-line no-debugger
|
|
4555
|
-
return'';}}]);}(libPictTemplate);module.exports=PictTemplateProviderBreakpoint;},{"../../Pict-Template.js":167}],
|
|
4592
|
+
return'';}}]);}(libPictTemplate);module.exports=PictTemplateProviderBreakpoint;},{"../../Pict-Template.js":167}],189:[function(require,module,exports){var libPictTemplate=require('../../Pict-Template.js');var PictTemplateProviderDataValueTree=/*#__PURE__*/function(_libPictTemplate19){/**
|
|
4556
4593
|
* @param {Object} pFable - The Fable Framework instance
|
|
4557
4594
|
* @param {Object} pOptions - The options for the service
|
|
4558
4595
|
* @param {String} pServiceHash - The hash of the service
|
|
4559
|
-
*/function PictTemplateProviderDataValueTree(pFable,pOptions,pServiceHash){var
|
|
4596
|
+
*/function PictTemplateProviderDataValueTree(pFable,pOptions,pServiceHash){var _this93;_classCallCheck2(this,PictTemplateProviderDataValueTree);_this93=_callSuper(this,PictTemplateProviderDataValueTree,[pFable,pOptions,pServiceHash]);_this93.addPattern('{~DataTree:','~}');_this93.addPattern('{~DT:','~}');return _this93;}_inherits(PictTemplateProviderDataValueTree,_libPictTemplate19);return _createClass2(PictTemplateProviderDataValueTree,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpData=_typeof(pRecord)==='object'?pRecord:{};tmpData.TemplateHash=pTemplateHash.trim();tmpData.ValueTreeParameters=tmpData.TemplateHash.split('^');if(tmpData.ValueTreeParameters.length<1){return'';}tmpData.ResolvedValue=this.resolveStateFromAddress(tmpData.ValueTreeParameters[0],tmpData,pContextArray);tmpData.ResolvedValueType=_typeof(tmpData.ResolvedValue);try{tmpData.TreeMaxDepth=tmpData.ValueTreeParameters.length<2?1:parseInt(tmpData.ValueTreeParameters[1]);}catch(_unused8){tmpData.TreeMaxDepth=1;}var tmpPictObjectWrapTemplate=this.pict.TemplateProvider.getTemplate('PICT-Object-Wrap');if(!tmpPictObjectWrapTemplate){// This template is here because it is a default template. Users can override this template by providing their own as PICT-Object-Wrap
|
|
4560
4597
|
tmpPictObjectWrapTemplate="<div class=\"PICT PICTObjectSet\">{~D:Record.ObjectValueTree~}</div>";}if(tmpData.ResolvedValueType=='object'){tmpData.ObjectValueTree=this.dataValueTreeObjectSet(tmpData.ResolvedValue,tmpData.ResolvedValue,0,tmpData.TreeMaxDepth,pContextArray);}else{this.log.trace("PICT Template Log Value Tree: [".concat(tmpData.TemplateHash,"] resolved data is not an object."),tmpData.ResolvedValue);tmpData.ObjectValueTree=tmpData.ResolveValue;}return this.pict.parseTemplate(tmpPictObjectWrapTemplate,tmpData,null,pContextArray);}},{key:"dataValueTreeObjectSet",value:function dataValueTreeObjectSet(pObject,pRootObject,pCurrentDepth,pMaxDepth,pContextArray){var tmpTemplateResult='';if(_typeof(pObject)!=='object'){return tmpTemplateResult;}var tmpObjectValueKeys=Object.keys(pObject);var tmpPictObjectBranchTemplate=this.pict.TemplateProvider.getTemplate('PICT-Object-Branch');if(!tmpPictObjectBranchTemplate){// This template is here because it is a default template. Users can override this template by providing their own as PICT-Object-Branch
|
|
4561
|
-
tmpPictObjectBranchTemplate="\n<div class=\"PICTObjectBranchDepth_{~D:Record.CurrentDepth~}\"><div class=\"PICTObjectBranch\">{~D:Record.BranchKey~}</div><div class=\"PICTObjectBranchValue\">{~D:Record.BranchValue~}</div></div>\n";}for(var i=0;i<tmpObjectValueKeys.length;i++){var tmpBranchType=_typeof(pObject[tmpObjectValueKeys[i]]);var tmpBranchValue='';switch(tmpBranchType){case'object':if(pCurrentDepth+1>pMaxDepth){tmpBranchValue='...';}else{tmpBranchValue=this.dataValueTreeObjectSet(pObject[tmpObjectValueKeys[i]],pRootObject,pCurrentDepth+1,pMaxDepth,pContextArray);}break;default:tmpBranchValue=pObject[tmpObjectValueKeys[i]];break;}var tmpDataValue={AppData:this.AppData,Bundle:this.Bundle,RootContainer:pRootObject,Container:pObject,BranchEntryCount:tmpObjectValueKeys.length,BranchIndex:i,BranchKey:tmpObjectValueKeys[i],BranchValue:tmpBranchValue,BranchDataType:tmpBranchType,CurrentDepth:pCurrentDepth,MaxDepth:pMaxDepth};tmpTemplateResult+=this.pict.parseTemplate(tmpPictObjectBranchTemplate,tmpDataValue,null,pContextArray);}return tmpTemplateResult;}}]);}(libPictTemplate);module.exports=PictTemplateProviderDataValueTree;},{"../../Pict-Template.js":167}],
|
|
4598
|
+
tmpPictObjectBranchTemplate="\n<div class=\"PICTObjectBranchDepth_{~D:Record.CurrentDepth~}\"><div class=\"PICTObjectBranch\">{~D:Record.BranchKey~}</div><div class=\"PICTObjectBranchValue\">{~D:Record.BranchValue~}</div></div>\n";}for(var i=0;i<tmpObjectValueKeys.length;i++){var tmpBranchType=_typeof(pObject[tmpObjectValueKeys[i]]);var tmpBranchValue='';switch(tmpBranchType){case'object':if(pCurrentDepth+1>pMaxDepth){tmpBranchValue='...';}else{tmpBranchValue=this.dataValueTreeObjectSet(pObject[tmpObjectValueKeys[i]],pRootObject,pCurrentDepth+1,pMaxDepth,pContextArray);}break;default:tmpBranchValue=pObject[tmpObjectValueKeys[i]];break;}var tmpDataValue={AppData:this.AppData,Bundle:this.Bundle,RootContainer:pRootObject,Container:pObject,BranchEntryCount:tmpObjectValueKeys.length,BranchIndex:i,BranchKey:tmpObjectValueKeys[i],BranchValue:tmpBranchValue,BranchDataType:tmpBranchType,CurrentDepth:pCurrentDepth,MaxDepth:pMaxDepth};tmpTemplateResult+=this.pict.parseTemplate(tmpPictObjectBranchTemplate,tmpDataValue,null,pContextArray);}return tmpTemplateResult;}}]);}(libPictTemplate);module.exports=PictTemplateProviderDataValueTree;},{"../../Pict-Template.js":167}],190:[function(require,module,exports){var libPictTemplate=require('../../Pict-Template.js');var PictTemplateProviderLogStatement=/*#__PURE__*/function(_libPictTemplate20){/**
|
|
4562
4599
|
* @param {Object} pFable - The Fable Framework instance
|
|
4563
4600
|
* @param {Object} pOptions - The options for the service
|
|
4564
4601
|
* @param {String} pServiceHash - The hash of the service
|
|
4565
|
-
*/function PictTemplateProviderLogStatement(pFable,pOptions,pServiceHash){var
|
|
4602
|
+
*/function PictTemplateProviderLogStatement(pFable,pOptions,pServiceHash){var _this94;_classCallCheck2(this,PictTemplateProviderLogStatement);_this94=_callSuper(this,PictTemplateProviderLogStatement,[pFable,pOptions,pServiceHash]);_this94.addPattern('{~LogStatement:','~}');_this94.addPattern('{~LS:','~}');return _this94;}_inherits(PictTemplateProviderLogStatement,_libPictTemplate20);return _createClass2(PictTemplateProviderLogStatement,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();this.log.trace("PICT Template Log Message: ".concat(tmpHash));return'';}}]);}(libPictTemplate);module.exports=PictTemplateProviderLogStatement;},{"../../Pict-Template.js":167}],191:[function(require,module,exports){var libPictTemplate=require('../../Pict-Template.js');var PictTemplateProviderLogValue=/*#__PURE__*/function(_libPictTemplate21){/**
|
|
4566
4603
|
* @param {Object} pFable - The Fable Framework instance
|
|
4567
4604
|
* @param {Object} pOptions - The options for the service
|
|
4568
4605
|
* @param {String} pServiceHash - The hash of the service
|
|
4569
|
-
*/function PictTemplateProviderLogValue(pFable,pOptions,pServiceHash){var
|
|
4606
|
+
*/function PictTemplateProviderLogValue(pFable,pOptions,pServiceHash){var _this95;_classCallCheck2(this,PictTemplateProviderLogValue);_this95=_callSuper(this,PictTemplateProviderLogValue,[pFable,pOptions,pServiceHash]);_this95.addPattern('{~LogValue:','~}');_this95.addPattern('{~LV:','~}');return _this95;}_inherits(PictTemplateProviderLogValue,_libPictTemplate21);return _createClass2(PictTemplateProviderLogValue,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};var tmpValue=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray);var tmpValueType=_typeof(tmpValue);if(tmpValue==null||tmpValueType=='undefined'){this.log.trace("PICT Template Log Value: [".concat(tmpHash,"] is ").concat(tmpValueType,"."));}else if(tmpValueType=='object'){this.log.trace("PICT Template Log Value: [".concat(tmpHash,"] is an object."),tmpValue);}else{this.log.trace("PICT Template Log Value: [".concat(tmpHash,"] is a ").concat(tmpValueType," = [").concat(tmpValue,"]"));}return'';}}]);}(libPictTemplate);module.exports=PictTemplateProviderLogValue;},{"../../Pict-Template.js":167}],192:[function(require,module,exports){var libPictTemplate=require('../../Pict-Template.js');var PictTemplateProviderLogValueTree=/*#__PURE__*/function(_libPictTemplate22){/**
|
|
4570
4607
|
* @param {Object} pFable - The Fable Framework instance
|
|
4571
4608
|
* @param {Object} pOptions - The options for the service
|
|
4572
4609
|
* @param {String} pServiceHash - The hash of the service
|
|
4573
|
-
*/function PictTemplateProviderLogValueTree(pFable,pOptions,pServiceHash){var
|
|
4610
|
+
*/function PictTemplateProviderLogValueTree(pFable,pOptions,pServiceHash){var _this96;_classCallCheck2(this,PictTemplateProviderLogValueTree);_this96=_callSuper(this,PictTemplateProviderLogValueTree,[pFable,pOptions,pServiceHash]);_defineProperty2(_this96,"logValueTreeObjectSet",function(pObject,pBaseAddress,pRootObject,pCurrentDepth,pMaxDepth){var tmpTemplateResult='';if(_typeof(pObject)!=='object'){return tmpTemplateResult;}var tmpObjectValueKeys=Object.keys(pObject);for(var i=0;i<tmpObjectValueKeys.length;i++){var tmpBranchType=_typeof(pObject[tmpObjectValueKeys[i]]);var tmpBranchValue='';switch(tmpBranchType){case'object':tmpBranchValue='...';break;default:tmpBranchValue=pObject[tmpObjectValueKeys[i]];break;}_this96.log.trace("[".concat(pBaseAddress,".").concat(tmpObjectValueKeys[i],"] (").concat(tmpBranchType,"): ").concat(tmpBranchValue));if(pCurrentDepth+1>pMaxDepth){return'';}else if(tmpBranchType=='object'){tmpBranchValue=_this96.logValueTreeObjectSet(pObject[tmpObjectValueKeys[i]],"".concat(pBaseAddress,".").concat(tmpObjectValueKeys[i]),pRootObject,pCurrentDepth+1,pMaxDepth);}}return'';});_this96.addPattern('{~LogValueTree:','~}');_this96.addPattern('{~LVT:','~}');return _this96;}_inherits(PictTemplateProviderLogValueTree,_libPictTemplate22);return _createClass2(PictTemplateProviderLogValueTree,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpData=_typeof(pRecord)==='object'?pRecord:{};tmpData.TemplateHash=pTemplateHash.trim();tmpData.ValueTreeParameters=tmpData.TemplateHash.split('^');if(tmpData.ValueTreeParameters.length<1){return'';}tmpData.ResolvedValue=this.resolveStateFromAddress(tmpData.ValueTreeParameters[0],tmpData,pContextArray);tmpData.ResolvedValueType=_typeof(tmpData.ResolvedValue);try{tmpData.TreeMaxDepth=tmpData.ValueTreeParameters.length<2?1:parseInt(tmpData.ValueTreeParameters[1]);}catch(_unused9){tmpData.TreeMaxDepth=1;}if(tmpData.ResolvedValueType=='object'){this.logValueTreeObjectSet(tmpData.ResolvedValue,tmpData.ValueTreeParameters[0],tmpData.ResolvedValue,0,tmpData.TreeMaxDepth);}else{this.log.trace("PICT Template Log Value Tree: [".concat(tmpData.TemplateHash,"] resolved data is not an object."),tmpData.ResolvedValue);}return'';}}]);}(libPictTemplate);module.exports=PictTemplateProviderLogValueTree;},{"../../Pict-Template.js":167}],193:[function(require,module,exports){var libPictTemplate=require('../../Pict-Template.js');var PictTemplateProviderNotEmpty=/*#__PURE__*/function(_libPictTemplate23){/**
|
|
4574
4611
|
* @param {Object} pFable - The Fable Framework instance
|
|
4575
4612
|
* @param {Object} pOptions - The options for the service
|
|
4576
4613
|
* @param {String} pServiceHash - The hash of the service
|
|
4577
|
-
*/function PictTemplateProviderNotEmpty(pFable,pOptions,pServiceHash){var
|
|
4578
|
-
if(this.resolveStateFromAddress(tmpHashParts[0],tmpData,pContextArray)){return tmpHashParts[1];}else{return'';}}}]);}(libPictTemplate);module.exports=PictTemplateProviderNotEmpty;},{"../../Pict-Template.js":167}],
|
|
4614
|
+
*/function PictTemplateProviderNotEmpty(pFable,pOptions,pServiceHash){var _this97;_classCallCheck2(this,PictTemplateProviderNotEmpty);_this97=_callSuper(this,PictTemplateProviderNotEmpty,[pFable,pOptions,pServiceHash]);_this97.addPattern('{~NotEmpty:','~}');_this97.addPattern('{~NE:','~}');return _this97;}_inherits(PictTemplateProviderNotEmpty,_libPictTemplate23);return _createClass2(PictTemplateProviderNotEmpty,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fNotEmptyRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>2){this.log.trace("PICT Template [fNotEmptyRender]::[".concat(tmpHash,"]"));}var tmpHashParts=tmpHash.split('^');// For now just check truthiness. Not sure if this is grand.
|
|
4615
|
+
if(this.resolveStateFromAddress(tmpHashParts[0],tmpData,pContextArray)){return tmpHashParts[1];}else{return'';}}}]);}(libPictTemplate);module.exports=PictTemplateProviderNotEmpty;},{"../../Pict-Template.js":167}],194:[function(require,module,exports){var libPictTemplate=require('../../Pict-Template.js');var PictTemplateProviderTemplateIfBase=/*#__PURE__*/function(_libPictTemplate24){/**
|
|
4579
4616
|
* @param {Object} pFable - The Fable Framework instance
|
|
4580
4617
|
* @param {Object} pOptions - The options for the service
|
|
4581
4618
|
* @param {String} pServiceHash - The hash of the service
|
|
4582
|
-
*/function PictTemplateProviderTemplateIfBase(pFable,pOptions,pServiceHash){_classCallCheck2(this,PictTemplateProviderTemplateIfBase);return _callSuper(this,PictTemplateProviderTemplateIfBase,[pFable,pOptions,pServiceHash]);}_inherits(PictTemplateProviderTemplateIfBase,
|
|
4619
|
+
*/function PictTemplateProviderTemplateIfBase(pFable,pOptions,pServiceHash){_classCallCheck2(this,PictTemplateProviderTemplateIfBase);return _callSuper(this,PictTemplateProviderTemplateIfBase,[pFable,pOptions,pServiceHash]);}_inherits(PictTemplateProviderTemplateIfBase,_libPictTemplate24);return _createClass2(PictTemplateProviderTemplateIfBase,[{key:"compareValues",value:function compareValues(pValueLeft,pOperator,pValueRight){switch(pOperator){case'TRUE':return pValueLeft===true;case'FALSE':return pValueLeft===false;case'LNGT':case'LENGTH_GREATER_THAN':switch(_typeof(pValueLeft)){case'string':return pValueLeft.length>pValueRight;case'object':return pValueLeft.length>pValueRight;default:return false;}case'LNLT':case'LENGTH_LESS_THAN':switch(_typeof(pValueLeft)){case'string':return pValueLeft.length<pValueRight;case'object':return pValueLeft.length<pValueRight;default:return false;}case'!=':return pValueLeft!=pValueRight;case'<':return pValueLeft<pValueRight;case'>':return pValueLeft>pValueRight;case'<=':return pValueLeft<=pValueRight;case'>=':return pValueLeft>=pValueRight;case'===':return pValueLeft===pValueRight;case'==':return pValueLeft==pValueRight;default:return false;}}}]);}(libPictTemplate);module.exports=PictTemplateProviderTemplateIfBase;},{"../../Pict-Template.js":167}],195:[function(require,module,exports){var libPictTemplateIf=require('./Pict-Template-TemplateIf-Base.js');var PictTemplateProviderTemplateIf=/*#__PURE__*/function(_libPictTemplateIf){/**
|
|
4583
4620
|
* @param {Object} pFable - The Fable Framework instance
|
|
4584
4621
|
* @param {Object} pOptions - The options for the service
|
|
4585
4622
|
* @param {String} pServiceHash - The hash of the service
|
|
4586
|
-
*/function PictTemplateProviderTemplateIf(pFable,pOptions,pServiceHash){var
|
|
4623
|
+
*/function PictTemplateProviderTemplateIf(pFable,pOptions,pServiceHash){var _this98;_classCallCheck2(this,PictTemplateProviderTemplateIf);_this98=_callSuper(this,PictTemplateProviderTemplateIf,[pFable,pOptions,pServiceHash]);_this98.addPattern('{~TemplateIf:','~}');_this98.addPattern('{~TIf:','~}');return _this98;}_inherits(PictTemplateProviderTemplateIf,_libPictTemplateIf);return _createClass2(PictTemplateProviderTemplateIf,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateIfAbsoluteValueRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateIfAbsoluteValueRender]::[".concat(tmpHash,"]"));}var tmpTemplateHash=false;var tmpAddressOfData=false;var tmpComparisonOperation=false;var tmpHashParts=tmpHash.split(':');if(tmpHashParts.length<3){this.log.warn("Pict: Template If Absolute Value Render: TemplateHash not complete for [".concat(tmpHash,"]"));return"Pict: Template If Absolute Value Render: TemplateHash not complete for [".concat(tmpHash,"]");}tmpTemplateHash=tmpHashParts[0];tmpAddressOfData=tmpHashParts[1];tmpComparisonOperation=tmpHashParts[2];// No template hash
|
|
4587
4624
|
if(!tmpTemplateHash){this.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]");}// No comparison operation
|
|
4588
4625
|
if(!tmpComparisonOperation){this.log.warn("Pict: Template Render: Comparison Operation not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render: Comparison Operation not resolved for [".concat(tmpHash,"]");}// Now try to break the comparison into three parts...
|
|
4589
4626
|
var tmpComparisonParts=tmpComparisonOperation.split('^');if(tmpComparisonParts.length<3){this.log.warn("Pict: Template Render: Comparison Operation not complete (three parts expected) for [".concat(tmpHash,"]"));return"Pict: Template Render: Comparison Operation not complete (three parts expected) for [".concat(tmpHash,"]");}// Now look up the data at the comparison location
|
|
4590
4627
|
try{var tmpComparisonResult=this.compareValues(this.resolveStateFromAddress(tmpComparisonParts[0],tmpData,pContextArray),tmpComparisonParts[1],this.resolveStateFromAddress(tmpComparisonParts[2],tmpData,pContextArray));if(!tmpComparisonResult){return'';}else{if(!tmpAddressOfData){// No address was provided, just render the template with what this template has.
|
|
4591
|
-
return this.pict.parseTemplateByHash(tmpTemplateHash,
|
|
4628
|
+
return this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,null,pContextArray);}else{return this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray),null,pContextArray);}}}catch(pError){this.log.error("Pict: Template Render: Error looking up comparison data for [".concat(tmpHash,"]: ").concat(pError),pError);return"Pict: Template Render: Error looking up comparison data for [".concat(tmpHash,"]: ").concat(pError);}}},{key:"renderAsync",value:function renderAsync(pTemplateHash,pRecord,fCallback,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};var tmpCallback=typeof fCallback==='function'?fCallback:function(){return'';};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateIfAbsoluteValueRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateIfAbsoluteValueRender]::[".concat(tmpHash,"]"));}var tmpTemplateHash=false;var tmpAddressOfData=false;var tmpComparisonOperation=false;var tmpHashParts=tmpHash.split(':');if(tmpHashParts.length<3){this.log.warn("Pict: Template If Absolute Value Render: TemplateHash not complete for [".concat(tmpHash,"]"));return tmpCallback(new Error("Pict: Template If Absolute Value Render: TemplateHash not complete for [".concat(tmpHash,"]")));}tmpTemplateHash=tmpHashParts[0];tmpAddressOfData=tmpHashParts[1];tmpComparisonOperation=tmpHashParts[2];// No template hash
|
|
4592
4629
|
if(!tmpTemplateHash){this.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]"));return tmpCallback(new Error("Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]")));}// No comparison operation
|
|
4593
4630
|
if(!tmpComparisonOperation){this.log.warn("Pict: Template Render: Comparison Operation not resolved for [".concat(tmpHash,"]"));return tmpCallback(new Error("Pict: Template Render: Comparison Operation not resolved for [".concat(tmpHash,"]")));}// Now try to break the comparison into three parts...
|
|
4594
4631
|
var tmpComparisonParts=tmpComparisonOperation.split('^');if(tmpComparisonParts.length<3){this.log.warn("Pict: Template Render: Comparison Operation not complete (three parts expected) for [".concat(tmpHash,"]"));return tmpCallback(new Error("Pict: Template Render: Comparison Operation not complete (three parts expected) for [".concat(tmpHash,"]")));}// Now look up the data at the comparison location
|
|
4595
4632
|
try{// This is the only thing that's different from the absolute value function above. Collapse these.
|
|
4596
|
-
var tmpComparisonResult=this.compareValues(this.resolveStateFromAddress(tmpComparisonParts[0],tmpData,pContextArray),tmpComparisonParts[1],this.resolveStateFromAddress(tmpComparisonParts[2],tmpData,pContextArray));if(!tmpComparisonResult){return tmpCallback(null,'');}else{if(!tmpAddressOfData){return this.pict.parseTemplateByHash(tmpTemplateHash,
|
|
4633
|
+
var tmpComparisonResult=this.compareValues(this.resolveStateFromAddress(tmpComparisonParts[0],tmpData,pContextArray),tmpComparisonParts[1],this.resolveStateFromAddress(tmpComparisonParts[2],tmpData,pContextArray));if(!tmpComparisonResult){return tmpCallback(null,'');}else{if(!tmpAddressOfData){return this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}else{return this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray),function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}}}catch(pError){this.log.error("Pict: Template Render: Error looking up comparison data for [".concat(tmpHash,"]: ").concat(pError),pError);return tmpCallback(pError,'');}}}]);}(libPictTemplateIf);module.exports=PictTemplateProviderTemplateIf;},{"./Pict-Template-TemplateIf-Base.js":194}],196:[function(require,module,exports){var libPictTemplateIf=require('./Pict-Template-TemplateIf-Base.js');var PictTemplateProviderTemplateIfAbsolute=/*#__PURE__*/function(_libPictTemplateIf2){/**
|
|
4597
4634
|
* @param {Object} pFable - The Fable Framework instance
|
|
4598
4635
|
* @param {Object} pOptions - The options for the service
|
|
4599
4636
|
* @param {String} pServiceHash - The hash of the service
|
|
4600
|
-
*/function PictTemplateProviderTemplateIfAbsolute(pFable,pOptions,pServiceHash){var
|
|
4637
|
+
*/function PictTemplateProviderTemplateIfAbsolute(pFable,pOptions,pServiceHash){var _this99;_classCallCheck2(this,PictTemplateProviderTemplateIfAbsolute);_this99=_callSuper(this,PictTemplateProviderTemplateIfAbsolute,[pFable,pOptions,pServiceHash]);_this99.addPattern('{~TemplateIfAbsolute:','~}');_this99.addPattern('{~TIfAbs:','~}');return _this99;}_inherits(PictTemplateProviderTemplateIfAbsolute,_libPictTemplateIf2);return _createClass2(PictTemplateProviderTemplateIfAbsolute,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateIfAbsoluteValueRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateIfAbsoluteValueRender]::[".concat(tmpHash,"]"));}var tmpTemplateHash=false;var tmpAddressOfData=false;var tmpComparisonOperation=false;var tmpHashParts=tmpHash.split(':');if(tmpHashParts.length<3){this.log.warn("Pict: Template If Absolute Value Render: TemplateHash not complete for [".concat(tmpHash,"]"));return"Pict: Template If Absolute Value Render: TemplateHash not complete for [".concat(tmpHash,"]");}tmpTemplateHash=tmpHashParts[0];tmpAddressOfData=tmpHashParts[1];tmpComparisonOperation=tmpHashParts[2];// No template hash
|
|
4601
4638
|
if(!tmpTemplateHash){this.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]");}// No comparison operation
|
|
4602
4639
|
if(!tmpComparisonOperation){this.log.warn("Pict: Template Render: Comparison Operation not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render: Comparison Operation not resolved for [".concat(tmpHash,"]");}// Now try to break the comparison into three parts...
|
|
4603
4640
|
var tmpComparisonParts=tmpComparisonOperation.split('^');if(tmpComparisonParts.length<3){this.log.warn("Pict: Template Render: Comparison Operation not complete (three parts expected) for [".concat(tmpHash,"]"));return"Pict: Template Render: Comparison Operation not complete (three parts expected) for [".concat(tmpHash,"]");}// Now look up the data at the comparison location
|
|
4604
4641
|
try{var tmpComparisonResult=this.compareValues(this.resolveStateFromAddress(tmpComparisonParts[0],tmpData,pContextArray),tmpComparisonParts[1],tmpComparisonParts[2]);if(!tmpComparisonResult){return'';}else{if(!tmpAddressOfData){// No address was provided, just render the template with what this template has.
|
|
4605
|
-
return this.pict.parseTemplateByHash(tmpTemplateHash,
|
|
4642
|
+
return this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,null,pContextArray);}else{return this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray),null,pContextArray);}}}catch(pError){this.log.error("Pict: Template Render: Error looking up comparison data for [".concat(tmpHash,"]: ").concat(pError),pError);return"Pict: Template Render: Error looking up comparison data for [".concat(tmpHash,"]: ").concat(pError);}}},{key:"renderAsync",value:function renderAsync(pTemplateHash,pRecord,fCallback,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};var tmpCallback=typeof fCallback==='function'?fCallback:function(){return'';};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateIfAbsoluteValueRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateIfAbsoluteValueRender]::[".concat(tmpHash,"]"));}var tmpTemplateHash=false;var tmpAddressOfData=false;var tmpComparisonOperation=false;var tmpHashParts=tmpHash.split(':');if(tmpHashParts.length<3){this.log.warn("Pict: Template If Absolute Value Render: TemplateHash not complete for [".concat(tmpHash,"]"));return tmpCallback(new Error("Pict: Template If Absolute Value Render: TemplateHash not complete for [".concat(tmpHash,"]")));}tmpTemplateHash=tmpHashParts[0];tmpAddressOfData=tmpHashParts[1];tmpComparisonOperation=tmpHashParts[2];// No template hash
|
|
4606
4643
|
if(!tmpTemplateHash){this.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]"));return tmpCallback(new Error("Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]")));}// No comparison operation
|
|
4607
4644
|
if(!tmpComparisonOperation){this.log.warn("Pict: Template Render: Comparison Operation not resolved for [".concat(tmpHash,"]"));return tmpCallback(new Error("Pict: Template Render: Comparison Operation not resolved for [".concat(tmpHash,"]")));}// Now try to break the comparison into three parts...
|
|
4608
4645
|
var tmpComparisonParts=tmpComparisonOperation.split('^');if(tmpComparisonParts.length<3){this.log.warn("Pict: Template Render: Comparison Operation not complete (three parts expected) for [".concat(tmpHash,"]"));return tmpCallback(new Error("Pict: Template Render: Comparison Operation not complete (three parts expected) for [".concat(tmpHash,"]")));}// Now look up the data at the comparison location
|
|
4609
|
-
try{var tmpComparisonResult=this.compareValues(this.resolveStateFromAddress(tmpComparisonParts[0],tmpData,pContextArray),tmpComparisonParts[1],tmpComparisonParts[2]);if(!tmpComparisonResult){return tmpCallback(null,'');}else{if(!tmpAddressOfData){return this.pict.parseTemplateByHash(tmpTemplateHash,
|
|
4646
|
+
try{var tmpComparisonResult=this.compareValues(this.resolveStateFromAddress(tmpComparisonParts[0],tmpData,pContextArray),tmpComparisonParts[1],tmpComparisonParts[2]);if(!tmpComparisonResult){return tmpCallback(null,'');}else{if(!tmpAddressOfData){return this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}else{return this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray),function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}}}catch(pError){this.log.error("Pict: Template Render: Error looking up comparison data for [".concat(tmpHash,"]: ").concat(pError),pError);return tmpCallback(pError,'');}}}]);}(libPictTemplateIf);module.exports=PictTemplateProviderTemplateIfAbsolute;},{"./Pict-Template-TemplateIf-Base.js":194}]},{},[168])(168);});
|