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.js
CHANGED
|
@@ -5429,11 +5429,16 @@ const tmpTargetElement=typeof pAddress==='string'?window.jQuery(pAddress):window
|
|
|
5429
5429
|
* Check if an element has a class.
|
|
5430
5430
|
*
|
|
5431
5431
|
* @param {string|HTMLElement} pAddress - The address of the element (a CSS selector), or the element itself.
|
|
5432
|
-
* @param {string} pClass - The class to
|
|
5432
|
+
* @param {string} pClass - The class to toggle.
|
|
5433
5433
|
*
|
|
5434
5434
|
* @return {boolean} - Whether the element has the class. If multiple elements are matched, returns true if any have the class.
|
|
5435
5435
|
*/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
|
|
5436
|
-
const tmpTargetElement=typeof pAddress==='string'?window.jQuery(pAddress):window.jQuery(pAddress);return tmpTargetElement.hasClass(pClass);}else if(this.inBrowser&&this.hasDocument){const tmpTargetElementSet=typeof pAddress==='string'?window.document.querySelectorAll(pAddress):[pAddress];for(let 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;}}
|
|
5436
|
+
const tmpTargetElement=typeof pAddress==='string'?window.jQuery(pAddress):window.jQuery(pAddress);return tmpTargetElement.hasClass(pClass);}else if(this.inBrowser&&this.hasDocument){const tmpTargetElementSet=typeof pAddress==='string'?window.document.querySelectorAll(pAddress):[pAddress];for(let 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
|
+
* Toggle a class on or off an element
|
|
5438
|
+
*
|
|
5439
|
+
* @param {string|HTMLElement} pAddress - The address of the element (a CSS selector), or the element itself.
|
|
5440
|
+
* @param {string} pClass - The class to check for.
|
|
5441
|
+
*/toggleClass(pAddress,pClass){if(this.hasClass(pAddress,pClass)){this.removeClass(pAddress,pClass);}else{this.addClass(pAddress,pClass);}}}module.exports=PictContentAssignment;},{"fable":68}],196:[function(require,module,exports){const libFableServiceBase=require('fable').ServiceProviderBase;class PictDataProvider extends libFableServiceBase{constructor(pFable,pOptions,pServiceHash){super(pFable,pOptions,pServiceHash);/** @type {import('fable') & import('./Pict')} */this.fable;this.serviceType='PictDataProvider';}/**
|
|
5437
5442
|
* @param {string} pAddress - The address of the data to retrieve
|
|
5438
5443
|
* @param {object} [pData] - (optional) The record to provide to the address resolver
|
|
5439
5444
|
*/getDataByAddress(pAddress,pData){let tmpData=typeof pData==='undefined'?{}:pData;const tmpAddressSpace={Fable:this.fable,Pict:this.fable,AppData:this.fable.AppData,Bundle:this.fable.Bundle,Record:tmpData};return this.fable.manifest.getValueByHash(tmpAddressSpace,pAddress);}}module.exports=PictDataProvider;},{"fable":68}],197:[function(require,module,exports){const libFableServiceBase=require('fable').ServiceProviderBase;class PictMeadowEntityProvider extends libFableServiceBase{constructor(pFable,pOptions,pServiceHash){var _this$fable$RestClien;super(pFable,pOptions,pServiceHash);/** @type {any} */this.options;/** @type {import('./Pict') & { settings: any } & { newAnticipate: any }} */this.fable;/** @type {any} */this.log;this.serviceType='PictMeadowProvider';if(this.fable.settings.PictDefaultURLPrefix){this.options.urlPrefix=this.fable.settings.PictDefaultURLPrefix;}else if(!this.options.urlPrefix){this.options.urlPrefix='/1.0/';}if(!this.options.downloadBatchSize){if(typeof this.fable.settings.PictDefaultDownloadBatchSize==='number'){this.options.downloadBatchSize=this.fable.settings.PictDefaultDownloadBatchSize;}else{this.options.downloadBatchSize=100;}}//@ts-ignore - FIXME - remove once we have fable types
|