pict 1.0.310 → 1.0.311
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 +7 -2
- package/dist/pict.compatible.js.map +1 -1
- package/dist/pict.compatible.min.js +1 -1
- package/dist/pict.compatible.min.js.map +1 -1
- package/dist/pict.js +7 -2
- package/dist/pict.js.map +1 -1
- package/dist/pict.min.js +1 -1
- package/dist/pict.min.js.map +1 -1
- package/package.json +1 -1
- package/source/Pict-Content-Assignment.js +19 -1
- package/test/Pict_contentassignment_tests.js +10 -0
- package/types/source/Pict-Content-Assignment.d.ts +8 -1
- package/types/source/Pict-Content-Assignment.d.ts.map +1 -1
package/dist/pict.compatible.js
CHANGED
|
@@ -5430,11 +5430,16 @@ var tmpTargetElement=typeof pAddress==='string'?window.jQuery(pAddress):window.j
|
|
|
5430
5430
|
* Check if an element has a class.
|
|
5431
5431
|
*
|
|
5432
5432
|
* @param {string|HTMLElement} pAddress - The address of the element (a CSS selector), or the element itself.
|
|
5433
|
-
* @param {string} pClass - The class to
|
|
5433
|
+
* @param {string} pClass - The class to toggle.
|
|
5434
5434
|
*
|
|
5435
5435
|
* @return {boolean} - Whether the element has the class. If multiple elements are matched, returns true if any have the class.
|
|
5436
5436
|
*/},{key:"hasClass",value:function hasClass(pAddress,pClass){if(this.customReadClassFunction){return this.customReadClassFunction(pAddress,pClass);}if(this.hasJquery){//FIXME: this is silly, but it makes the type system happy - it picks a different overload for each case
|
|
5437
|
-
var tmpTargetElement=typeof pAddress==='string'?window.jQuery(pAddress):window.jQuery(pAddress);return tmpTargetElement.hasClass(pClass);}else if(this.inBrowser&&this.hasDocument){var tmpTargetElementSet=typeof pAddress==='string'?window.document.querySelectorAll(pAddress):[pAddress];for(var i=0;i<tmpTargetElementSet.length;i++){if(tmpTargetElementSet[i].classList.contains(pClass)){return true;}}return false;}else{this.log.trace("PICT Content HASCLASS for [".concat(pAddress,"] CLASS [").concat(pClass,"]:"));return false;}}
|
|
5437
|
+
var tmpTargetElement=typeof pAddress==='string'?window.jQuery(pAddress):window.jQuery(pAddress);return tmpTargetElement.hasClass(pClass);}else if(this.inBrowser&&this.hasDocument){var tmpTargetElementSet=typeof pAddress==='string'?window.document.querySelectorAll(pAddress):[pAddress];for(var i=0;i<tmpTargetElementSet.length;i++){if(tmpTargetElementSet[i].classList.contains(pClass)){return true;}}return false;}else{this.log.trace("PICT Content HASCLASS for [".concat(pAddress,"] CLASS [").concat(pClass,"]:"));return false;}}/**
|
|
5438
|
+
* Toggle a class on or off an element
|
|
5439
|
+
*
|
|
5440
|
+
* @param {string|HTMLElement} pAddress - The address of the element (a CSS selector), or the element itself.
|
|
5441
|
+
* @param {string} pClass - The class to check for.
|
|
5442
|
+
*/},{key:"toggleClass",value:function toggleClass(pAddress,pClass){if(this.hasClass(pAddress,pClass)){this.removeClass(pAddress,pClass);}else{this.addClass(pAddress,pClass);}}}]);}(libFableServiceBase);module.exports=PictContentAssignment;},{"fable":68}],196:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictDataProvider=/*#__PURE__*/function(_libFableServiceBase21){function PictDataProvider(pFable,pOptions,pServiceHash){var _this77;_classCallCheck2(this,PictDataProvider);_this77=_callSuper(this,PictDataProvider,[pFable,pOptions,pServiceHash]);/** @type {import('fable') & import('./Pict')} */_this77.fable;_this77.serviceType='PictDataProvider';return _this77;}/**
|
|
5438
5443
|
* @param {string} pAddress - The address of the data to retrieve
|
|
5439
5444
|
* @param {object} [pData] - (optional) The record to provide to the address resolver
|
|
5440
5445
|
*/_inherits(PictDataProvider,_libFableServiceBase21);return _createClass2(PictDataProvider,[{key:"getDataByAddress",value:function getDataByAddress(pAddress,pData){var tmpData=typeof pData==='undefined'?{}:pData;var tmpAddressSpace={Fable:this.fable,Pict:this.fable,AppData:this.fable.AppData,Bundle:this.fable.Bundle,Record:tmpData};return this.fable.manifest.getValueByHash(tmpAddressSpace,pAddress);}}]);}(libFableServiceBase);module.exports=PictDataProvider;},{"fable":68}],197:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictMeadowEntityProvider=/*#__PURE__*/function(_libFableServiceBase22){function PictMeadowEntityProvider(pFable,pOptions,pServiceHash){var _this78$fable$RestCli;var _this78;_classCallCheck2(this,PictMeadowEntityProvider);_this78=_callSuper(this,PictMeadowEntityProvider,[pFable,pOptions,pServiceHash]);/** @type {any} */_this78.options;/** @type {import('./Pict') & { settings: any } & { newAnticipate: any }} */_this78.fable;/** @type {any} */_this78.log;_this78.serviceType='PictMeadowProvider';if(_this78.fable.settings.PictDefaultURLPrefix){_this78.options.urlPrefix=_this78.fable.settings.PictDefaultURLPrefix;}else if(!_this78.options.urlPrefix){_this78.options.urlPrefix='/1.0/';}if(!_this78.options.downloadBatchSize){if(typeof _this78.fable.settings.PictDefaultDownloadBatchSize==='number'){_this78.options.downloadBatchSize=_this78.fable.settings.PictDefaultDownloadBatchSize;}else{_this78.options.downloadBatchSize=100;}}//@ts-ignore - FIXME - remove once we have fable types
|