From 89bcd24207178758fb3c316a68edfcc0a52d8e4c Mon Sep 17 00:00:00 2001 From: Aaron Carlino Date: Mon, 12 Dec 2022 10:23:36 +1300 Subject: [PATCH] Replace master/slave references --- client/dist/js/bundle.js | 2 +- client/dist/js/bundle.js.map | 2 +- client/src/components/display_logic.js | 72 +++++++++---------- src/Criteria.php | 60 ++++++++-------- src/Criterion.php | 33 ++++++--- src/Extensions/DisplayLogic.php | 34 ++++----- .../SilverStripe/Forms/CheckboxSetField.ss | 6 +- .../DisplayLogic/Forms/Wrapper_holder.ss | 4 +- tests/php/ConditionalsTest.php | 16 ++--- 9 files changed, 122 insertions(+), 107 deletions(-) diff --git a/client/dist/js/bundle.js b/client/dist/js/bundle.js index 57afdcf..14c65ec 100644 --- a/client/dist/js/bundle.js +++ b/client/dist/js/bundle.js @@ -1 +1 @@ -!function(t){function e(n){if(i[n])return i[n].exports;var a=i[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var i={};e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=1)}([function(t,e,i){"use strict";var n=function(){function t(t,e){var i=[],n=!0,a=!1,s=void 0;try{for(var o,r=t[Symbol.iterator]();!(n=(o=r.next()).done)&&(i.push(o.value),!e||i.length!==e);n=!0);}catch(t){a=!0,s=t}finally{try{!n&&r.return&&r.return()}finally{if(a)throw s}}return i}return function(e,i){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=i(2),s=function(t){return t&&t.__esModule?t:{default:t}}(a);s.default.noConflict(),window.ss=window.ss||{},s.default.entwine("ss",function(t){var e={toggle:{show:function(t){var e=t[0];e.style.display="",e.classList.remove("display-logic-hidden")},hide:function(t){t[0].style.display="none"}},slide:{show:function(t){t.slideDown()},hide:function(t){t.slideUp()}},fade:{show:function(t){t.fadeIn()},hide:function(t){t.fadeOut()}},perform:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"toggle";e?this[i].show(t):this[i].hide(t)}};t("div.display-logic, div.display-logic-master").entwine({escapeSelector:function(t){return t.replace(/(\[)/g,"_").replace(/(\])/g,"")},findHolder:function(t){return this.closest("form").find(this.escapeSelector("#"+this.nameToHolder(t)))},getFormField:function(){var t=this.getFieldName();return t&&(t=this.escapeSelector(t)),this.find("[name="+t+"]").length?this.find("[name="+t+"]"):this.find("#"+this.getFormID()+"_"+t)},getFieldName:function(){return this.attr("id")?this.attr("id").replace(new RegExp("^"+this.getFormID()+"_"),"").replace(/_Holder$/,""):null},nameToHolder:function(t){var e=this.escapeSelector(t);return e=e.replace(/[^a-zA-Z0-9\-_:.]+/g,"_").replace(/_+/g,"_"),this.getFormID()+"_"+e+"_Holder"},getFormID:function(){return this.closest("form").attr("id")},getFieldValue:function(){return this.getFormField().val()},evaluateEqualTo:function(t){return this.getFieldValue()===t},evaluateNotEqualTo:function(t){return this.getFieldValue()!==t},evaluateGreaterThan:function(t){var e=parseFloat(t);return parseFloat(this.getFieldValue())>e},evaluateLessThan:function(t){var e=parseFloat(t);return parseFloat(this.getFieldValue())parseFloat(i[0])&&e1&&r.addClass("checkboxset")}),i.length&&e&&this.show()},getLogic:function(){return t.trim(this.data("display-logic-eval"))},parseLogic:function(){var t=this.getLogic();return new Function("return "+t).bind(this)()},getMasters:function(){var t=this.getFormField().data("display-logic-masters");return t?t.split(","):[]},getAnimationTargets:function(){return[this.findHolder(this.getFieldName())]}}),t("div.checkboxset").entwine({evaluateHasCheckedOption:function(e){var i=!1;return this.find(":checkbox").filter(":checked").each(function(){i=i||t(this).val()===e||t(this).getLabel().text()===e}),i},evaluateHasCheckedAtLeast:function(t){return this.find(":checked").length>=t},evaluateHasCheckedLessThan:function(t){return this.find(":checked").length<=t}}),t("input[type=checkbox]").entwine({getLabel:function(){return this.closest("form").find("label[for="+this.getHolder().escapeSelector(this.attr("id"))+"]")}}),t("div.display-logic.display-logic-display").entwine({testLogic:function(){var t=this;this.getAnimationTargets().forEach(function(i){e.perform(i,t.parseLogic(),t.data("display-logic-animation"))})}}),t("div.display-logic.display-logic-hide").entwine({testLogic:function(){var t=this;this.getAnimationTargets().forEach(function(i){e.perform(i,!t.parseLogic(),t.data("display-logic-animation"))})}}),t('div.display-logic-master input[type="text"], div.display-logic-master input[type="email"], div.display-logic-master input[type="numeric"]').entwine({onmatch:function(){this.closest(".display-logic-master").notify()},onkeyup:function(){this.closest(".display-logic-master").notify()},onchange:function(){this.closest(".display-logic-master").notify()}}),t("div.display-logic-master select").entwine({onmatch:function(){this.closest(".display-logic-master").notify()},onchange:function(){this.closest(".display-logic-master").notify()}}),t("div.display-logic-master :checkbox, div.display-logic-master :radio").entwine({onmatch:function(){this.closest(".display-logic-master").notify()},onclick:function(){this.closest(".display-logic-master").notify()}}),t("div.display-logic.optionset, div.display-logic-master.optionset").entwine({getFieldValue:function(){return this.find(":checked").val()},getAnimationTargets:function(){return this._super().concat(this.findHolder(this.getFieldName()).find(".optionset"))}}),t("div.display-logic-master").entwine({Listeners:null,notify:function(){t.each(this.getListeners(),function(){t(this).testLogic()})},getListeners:function(){var e=this._super();if(e)return e;var i=this,a=[];return this.closest("form").find(".display-logic").each(function(){var e=this,s=t(this).getMasters();s&&s.length&&Object.entries(s).forEach(function(s){var o=n(s,2),r=o[1];i.nameToHolder(r)===i.attr("id")&&a.push(t(e)[0])})}),this.setListeners(a),this.getListeners()}}),t("div.display-logic.displaylogicwrapper.display-logic-display,\n div.display-logic.displaylogicwrapper.display-logic-hide").entwine({getFormField:function(){return this},getFieldName:function(){return""},getAnimationTargets:function(){return[this]}}),t("div.field *").entwine({getHolder:function(){return this.parents(".field")}})})},function(t,e,i){"use strict";i(0)},function(t,e){t.exports=jQuery}]); \ No newline at end of file +!function(t){function e(n){if(i[n])return i[n].exports;var a=i[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var i={};e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=1)}([function(t,e,i){"use strict";var n=function(){function t(t,e){var i=[],n=!0,a=!1,s=void 0;try{for(var o,r=t[Symbol.iterator]();!(n=(o=r.next()).done)&&(i.push(o.value),!e||i.length!==e);n=!0);}catch(t){a=!0,s=t}finally{try{!n&&r.return&&r.return()}finally{if(a)throw s}}return i}return function(e,i){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=i(2),s=function(t){return t&&t.__esModule?t:{default:t}}(a);s.default.noConflict(),window.ss=window.ss||{},s.default.entwine("ss",function(t){var e={toggle:{show:function(t){var e=t[0];e.style.display="",e.classList.remove("display-logic-hidden")},hide:function(t){t[0].style.display="none"}},slide:{show:function(t){t.slideDown()},hide:function(t){t.slideUp()}},fade:{show:function(t){t.fadeIn()},hide:function(t){t.fadeOut()}},perform:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"toggle";e?this[i].show(t):this[i].hide(t)}};t("div.display-logic, div.display-logic-dispatcher").entwine({escapeSelector:function(t){return t.replace(/(\[)/g,"_").replace(/(\])/g,"")},findHolder:function(t){return this.closest("form").find(this.escapeSelector("#"+this.nameToHolder(t)))},getFormField:function(){var t=this.getFieldName();return t&&(t=this.escapeSelector(t)),this.find("[name="+t+"]").length?this.find("[name="+t+"]"):this.find("#"+this.getFormID()+"_"+t)},getFieldName:function(){return this.attr("id")?this.attr("id").replace(new RegExp("^"+this.getFormID()+"_"),"").replace(/_Holder$/,""):null},nameToHolder:function(t){var e=this.escapeSelector(t);return e=e.replace(/[^a-zA-Z0-9\-_:.]+/g,"_").replace(/_+/g,"_"),this.getFormID()+"_"+e+"_Holder"},getFormID:function(){return this.closest("form").attr("id")},getFieldValue:function(){return this.getFormField().val()},evaluateEqualTo:function(t){return this.getFieldValue()===t},evaluateNotEqualTo:function(t){return this.getFieldValue()!==t},evaluateGreaterThan:function(t){var e=parseFloat(t);return parseFloat(this.getFieldValue())>e},evaluateLessThan:function(t){var e=parseFloat(t);return parseFloat(this.getFieldValue())parseFloat(i[0])&&e1&&r.addClass("checkboxset")}),i.length&&e&&this.show()},getLogic:function(){return t.trim(this.data("display-logic-eval"))},parseLogic:function(){var t=this.getLogic();return new Function("return "+t).bind(this)()},getDispatchers:function(){var t=this.getFormField().data("display-logic-dispatchers");return t?t.split(","):[]},getAnimationTargets:function(){return[this.findHolder(this.getFieldName())]}}),t("div.checkboxset").entwine({evaluateHasCheckedOption:function(e){var i=!1;return this.find(":checkbox").filter(":checked").each(function(){i=i||t(this).val()===e||t(this).getLabel().text()===e}),i},evaluateHasCheckedAtLeast:function(t){return this.find(":checked").length>=t},evaluateHasCheckedLessThan:function(t){return this.find(":checked").length<=t}}),t("input[type=checkbox]").entwine({getLabel:function(){return this.closest("form").find("label[for="+this.getHolder().escapeSelector(this.attr("id"))+"]")}}),t("div.display-logic.display-logic-display").entwine({testLogic:function(){var t=this;this.getAnimationTargets().forEach(function(i){e.perform(i,t.parseLogic(),t.data("display-logic-animation"))})}}),t("div.display-logic.display-logic-hide").entwine({testLogic:function(){var t=this;this.getAnimationTargets().forEach(function(i){e.perform(i,!t.parseLogic(),t.data("display-logic-animation"))})}}),t('div.display-logic-dispatcher input[type="text"], div.display-logic-dispatcher input[type="email"], div.display-logic-dispatcher input[type="numeric"]').entwine({onmatch:function(){this.closest(".display-logic-dispatcher").notify()},onkeyup:function(){this.closest(".display-logic-dispatcher").notify()},onchange:function(){this.closest(".display-logic-dispatcher").notify()}}),t("div.display-logic-dispatcher select").entwine({onmatch:function(){this.closest(".display-logic-dispatcher").notify()},onchange:function(){this.closest(".display-logic-dispatcher").notify()}}),t("div.display-logic-dispatcher :checkbox, div.display-logic-dispatcher :radio").entwine({onmatch:function(){this.closest(".display-logic-dispatcher").notify()},onclick:function(){this.closest(".display-logic-dispatcher").notify()}}),t("div.display-logic.optionset, div.display-logic-dispatcher.optionset").entwine({getFieldValue:function(){return this.find(":checked").val()},getAnimationTargets:function(){return this._super().concat(this.findHolder(this.getFieldName()).find(".optionset"))}}),t("div.display-logic-dispatcher").entwine({Listeners:null,notify:function(){t.each(this.getListeners(),function(){t(this).testLogic()})},getListeners:function(){var e=this._super();if(e)return e;var i=this,a=[];return this.closest("form").find(".display-logic").each(function(){var e=this,s=t(this).getDispatchers();s&&s.length&&Object.entries(s).forEach(function(s){var o=n(s,2),r=o[1];i.nameToHolder(r)===i.attr("id")&&a.push(t(e)[0])})}),this.setListeners(a),this.getListeners()}}),t("div.display-logic.displaylogicwrapper.display-logic-display,\n div.display-logic.displaylogicwrapper.display-logic-hide").entwine({getFormField:function(){return this},getFieldName:function(){return""},getAnimationTargets:function(){return[this]}}),t("div.field *").entwine({getHolder:function(){return this.parents(".field")}})})},function(t,e,i){"use strict";i(0)},function(t,e){t.exports=jQuery}]); diff --git a/client/dist/js/bundle.js.map b/client/dist/js/bundle.js.map index ef97981..d5ec6b4 100644 --- a/client/dist/js/bundle.js.map +++ b/client/dist/js/bundle.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap 4eec3cbac2caa1241ce1","webpack:///./client/src/components/display_logic.js","webpack:///./client/src/bundles/bundle.js","webpack:///external \"jQuery\""],"names":["noConflict","window","ss","entwine","$","animation","toggle","show","el","hide","slide","slideDown","slideUp","fade","fadeIn","fadeOut","perform","result","method","escapeSelector","selector","replace","findHolder","name","closest","find","nameToHolder","getFormField","getFieldName","length","getFormID","fieldID","attr","RegExp","holderName","getFieldValue","val","evaluateEqualTo","evaluateNotEqualTo","evaluateGreaterThan","num","parseFloat","evaluateLessThan","evaluateContains","match","evaluateStartsWith","evaluateEndsWith","evaluateEmpty","trim","evaluateNotEmpty","evaluateBetween","minmax","v","parts","split","evaluateChecked","is","evaluateNotChecked","onmatch","allReadonly","masters","field","data","getMasters","m","master","addClass","getLogic","parseLogic","js","Function","bind","getAnimationTargets","evaluateHasCheckedOption","found","filter","each","getLabel","text","evaluateHasCheckedAtLeast","evaluateHasCheckedLessThan","getHolder","testLogic","console","log","forEach","t","notify","onkeyup","onchange","onclick","_super","concat","Listeners","getListeners","l","self","listeners","hasOwnProperty","push","setListeners","parents","require"],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;AChEA;;;;;;AAGA,iBAAEA,UAAF;;AAEAC,OAAOC,EAAP,GAAYD,OAAOC,EAAP,IAAa,EAAzB;;AAGA,iBAAEC,OAAF,CAAU,IAAV,EAAgB,UAACC,CAAD,EAAO;AACrB,MAAMC,YAAY;AAChBC,YAAQ;AACNC,UADM,gBACDC,EADC,EACG;AACPA,WAAGD,IAAH;AACD,OAHK;AAINE,UAJM,gBAIDD,EAJC,EAIG;AACPA,WAAGC,IAAH;AACD;AANK,KADQ;AAShBC,WAAO;AACLH,UADK,gBACAC,EADA,EACI;AACPA,WAAGG,SAAH;AACD,OAHI;AAILF,UAJK,gBAIAD,EAJA,EAII;AACPA,WAAGI,OAAH;AACD;AANI,KAT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AlB,MAAkCgC,KAAKhE,IAAL,CAAU,IAAV,CAAtC,EAAuD;AACrDiE,sBAAUE,IAAV,CAAe/F,EAAE,IAAF,EAAQ,CAAR,CAAf;AACA;AACD;AACF;AACF,OATD;AAUA,WAAKgG,YAAL,CAAkBH,SAAlB;;AAEA,aAAO,KAAKH,YAAL,EAAP;AACD;AA9BmC,GAAtC;;AAiCA1F,mIAEED,OAFF,CAEU;AACRwB,gBADQ,0BACO;AACb,aAAO,IAAP;AACD,KAHO;AAKRC,gBALQ,0BAKO;AACb,aAAO,EAAP;AACD,KAPO;AASR4C,uBATQ,iCASc;AACpB,aAAO,CAAC,IAAD,CAAP;AACD;AAXO,GAFV;;AAgBApE,IAAE,aAAF,EAAiBD,OAAjB,CAAyB;AACvB8E,aADuB,uBACX;AACV,aAAO,KAAKoB,OAAL,CAAa,QAAb,CAAP;AACD;AAHsB,GAAzB;AAKD,CAnWD,E;;;;;;;;;ACRA,mBAAAC,CAAQ,CAAR,E;;;;;;ACAA,wB","file":"js/bundle.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 4eec3cbac2caa1241ce1","import $ from 'jquery';\n\n\n$.noConflict();\n\nwindow.ss = window.ss || {};\n\n\n$.entwine('ss', ($) => {\n const animation = {\n toggle: {\n show(el) {\n el.show();\n },\n hide(el) {\n el.hide();\n }\n },\n slide: {\n show(el) {\n el.slideDown();\n },\n hide(el) {\n el.slideUp();\n }\n },\n fade: {\n show(el) {\n el.fadeIn();\n },\n hide(el) {\n el.fadeOut();\n }\n },\n\n perform(el, result, method) {\n if (typeof method === 'undefined') method = 'toggle';\n if (result) {\n this[method].show(el);\n } else {\n this[method].hide(el);\n }\n }\n };\n\n\n $('div.display-logic, div.display-logic-master').entwine({\n\n escapeSelector(selector) {\n return selector.replace(/(\\[)/g, '_').replace(/(\\])/g, '');\n },\n\n findHolder(name) {\n return this.closest('form').find(\n this.escapeSelector(`#${this.nameToHolder(name)}`)\n );\n },\n\n getFormField() {\n let name = this.getFieldName();\n if (name) {\n name = this.escapeSelector(name);\n }\n\n if (this.find(`[name=${name}]`).length) {\n return this.find(`[name=${name}]`);\n }\n\n return this.find(`#${this.getFormID()}_${name}`);\n },\n\n getFieldName() {\n const fieldID = this.attr('id');\n\n if (fieldID) {\n return this.attr('id')\n .replace(new RegExp(`^${this.getFormID()}_`), '')\n .replace(/_Holder$/, '');\n }\n return null;\n },\n\n nameToHolder(name) {\n let holderName = this.escapeSelector(name);\n\n // SS 3.2+, Convert::raw2htmlid() logic\n holderName = holderName.replace(/[^a-zA-Z0-9\\-_:.]+/g, '_').replace(/_+/g, '_');\n\n // Hack!\n // Remove this when OptionsetField_holder.ss uses $HolderID\n // as its div ID instead of $ID\n // if (this.closest('form').find(`ul.optionset li input[name=${holderName}]:first`).length) {\n // return holderName;\n // }\n return `${this.getFormID()}_${holderName}_Holder`;\n },\n\n getFormID() {\n return this.closest('form').attr('id');\n },\n\n getFieldValue() {\n return this.getFormField().val();\n },\n\n evaluateEqualTo(val) {\n return this.getFieldValue() === val;\n },\n\n evaluateNotEqualTo(val) {\n return this.getFieldValue() !== val;\n },\n\n evaluateGreaterThan(val) {\n const num = parseFloat(val);\n return parseFloat(this.getFieldValue()) > num;\n },\n\n evaluateLessThan(val) {\n const num = parseFloat(val);\n return parseFloat(this.getFieldValue()) < num;\n },\n\n evaluateContains(val) {\n return this.getFieldValue().match(val) !== null;\n },\n\n evaluateStartsWith(val) {\n return this.getFieldValue().match(new RegExp(`^${val}`)) !== null;\n },\n\n evaluateEndsWith(val) {\n return this.getFieldValue().match(new RegExp(`${val}$`)) !== null;\n },\n\n evaluateEmpty() {\n return $.trim(this.getFieldValue()).length === 0;\n },\n\n evaluateNotEmpty() {\n return !this.evaluateEmpty();\n },\n\n evaluateBetween(minmax) {\n const v = parseFloat(this.getFieldValue());\n const parts = minmax.split('-');\n if (parts.length === 2) {\n return v > parseFloat(parts[0]) && v < parseFloat(parts[1]);\n }\n return false;\n },\n\n evaluateChecked() {\n return this.getFormField().is(':checked');\n },\n\n evaluateNotChecked() {\n return !this.getFormField().is(':checked');\n },\n\n onmatch() {\n let allReadonly = true;\n let masters = [];\n const field = this.getFormField();\n\n if (field.data('display-logic-eval') && field.data('display-logic-masters')) {\n this.data('display-logic-eval', field.data('display-logic-eval'))\n .data('display-logic-masters', field.data('display-logic-masters'))\n .data('display-logic-animation', field.data('display-logic-animation'));\n }\n\n masters = this.getMasters();\n\n for (const m in masters) {\n const holderName = this.nameToHolder(this.escapeSelector(masters[m]));\n const master = this.closest('form').find(this.escapeSelector(`#${holderName}`));\n if (!master.is('.readonly')) allReadonly = false;\n\n master.addClass('display-logic-master');\n if (master.find('input[type=radio]').length) {\n master.addClass('optionset');\n }\n if (master.find('input[type=checkbox]').length > 1) {\n master.addClass('checkboxset');\n }\n }\n\n // If all the masters are readonly fields, the field has no way of displaying.\n if (masters.length && allReadonly) {\n this.show();\n }\n },\n\n getLogic() {\n return $.trim(this.data('display-logic-eval'));\n },\n\n parseLogic() {\n const js = this.getLogic();\n return new Function(`return ${js}`).bind(this)();\n },\n\n getMasters() {\n const masters = this.getFormField().data('display-logic-masters');\n return (masters) ? masters.split(',') : [];\n },\n\n getAnimationTargets() {\n return [this.findHolder(this.getFieldName())];\n }\n\n });\n\n $('div.checkboxset').entwine({\n\n evaluateHasCheckedOption(val) {\n let found = false;\n this.find(':checkbox').filter(':checked').each(function () {\n found = (found || ($(this).val() === val || $(this).getLabel().text() === val));\n });\n\n return found;\n },\n\n evaluateHasCheckedAtLeast(num) {\n return this.find(':checked').length >= num;\n },\n\n evaluateHasCheckedLessThan(num) {\n return this.find(':checked').length <= num;\n }\n\n });\n\n $('input[type=checkbox]').entwine({\n getLabel() {\n return this.closest('form').find(`label[for=${this.getHolder().escapeSelector(this.attr('id'))}]`);\n }\n });\n\n\n $('div.display-logic.display-logic-display').entwine({\n testLogic() {\n console.log(this, 'tests logic');\n this.getAnimationTargets().forEach(t => {\n animation.perform(t, this.parseLogic(), this.data('display-logic-animation'));\n })\n\n }\n });\n\n\n $('div.display-logic.display-logic-hide').entwine({\n testLogic() {\n this.getAnimationTargets().forEach(t => {\n animation.perform(t, !this.parseLogic(), this.data('display-logic-animation'));\n })\n\n }\n });\n\n\n $('div.display-logic-master input[type=\"text\"], ' +\n 'div.display-logic-master input[type=\"email\"], ' +\n 'div.display-logic-master input[type=\"numeric\"]').entwine({\n onmatch() {\n this.closest('.display-logic-master').notify();\n },\n\n onkeyup() {\n this.closest('.display-logic-master').notify();\n },\n\n onchange() {\n this.closest('.display-logic-master').notify();\n }\n });\n\n\n $('div.display-logic-master select').entwine({\n onmatch() {\n this.closest('.display-logic-master').notify();\n },\n\n onchange() {\n this.closest('.display-logic-master').notify();\n }\n });\n\n $('div.display-logic-master :checkbox, div.display-logic-master :radio').entwine({\n onmatch() {\n this.closest('.display-logic-master').notify();\n },\n\n onclick() {\n this.closest('.display-logic-master').notify();\n }\n });\n\n $('div.display-logic.optionset, div.display-logic-master.optionset').entwine({\n getFieldValue() {\n return this.find(':checked').val();\n },\n getAnimationTargets() {\n return this._super().concat(this.findHolder(this.getFieldName()).find('.optionset'));\n }\n\n });\n\n $('div.display-logic-master').entwine({\n Listeners: null,\n\n notify() {\n $.each(this.getListeners(), function () {\n console.log('test logic for ', this);\n $(this).testLogic();\n });\n },\n\n getListeners() {\n const l = this._super();\n if (l) {\n return l;\n }\n const self = this;\n const listeners = [];\n this.closest('form').find('.display-logic').each(function () {\n const masters = $(this).getMasters();\n for (const m in masters) {\n if (!masters.hasOwnProperty(m)) continue;\n if (self.nameToHolder(masters[m]) === self.attr('id')) {\n listeners.push($(this)[0]);\n break;\n }\n }\n });\n this.setListeners(listeners);\n\n return this.getListeners();\n }\n });\n\n $(`div.display-logic.displaylogicwrapper.display-logic-display,\n div.display-logic.displaylogicwrapper.display-logic-hide`\n ).entwine({\n getFormField() {\n return this;\n },\n\n getFieldName() {\n return '';\n },\n\n getAnimationTargets() {\n return [this];\n }\n });\n\n $('div.field *').entwine({\n getHolder() {\n return this.parents('.field');\n }\n });\n});\n\n\n\n// WEBPACK FOOTER //\n// ./client/src/components/display_logic.js","require('../components/display_logic.js');\n\n\n\n// WEBPACK FOOTER //\n// ./client/src/bundles/bundle.js","module.exports = jQuery;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"jQuery\"\n// module id = 2\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap 4eec3cbac2caa1241ce1","webpack:///./client/src/components/display_logic.js","webpack:///./client/src/bundles/bundle.js","webpack:///external \"jQuery\""],"names":["noConflict","window","ss","entwine","$","animation","toggle","show","el","hide","slide","slideDown","slideUp","fade","fadeIn","fadeOut","perform","result","method","escapeSelector","selector","replace","findHolder","name","closest","find","nameToHolder","getFormField","getFieldName","length","getFormID","fieldID","attr","RegExp","holderName","getFieldValue","val","evaluateEqualTo","evaluateNotEqualTo","evaluateGreaterThan","num","parseFloat","evaluateLessThan","evaluateContains","match","evaluateStartsWith","evaluateEndsWith","evaluateEmpty","trim","evaluateNotEmpty","evaluateBetween","minmax","v","parts","split","evaluateChecked","is","evaluateNotChecked","onmatch","allReadonly","dispatchers","field","data","getDispatchers","m","dispatcher","addClass","getLogic","parseLogic","js","Function","bind","getAnimationTargets","evaluateHasCheckedOption","found","filter","each","getLabel","text","evaluateHasCheckedAtLeast","evaluateHasCheckedLessThan","getHolder","testLogic","console","log","forEach","t","notify","onkeyup","onchange","onclick","_super","concat","Listeners","getListeners","l","self","listeners","hasOwnProperty","push","setListeners","parents","require"],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;AChEA;;;;;;AAGA,iBAAEA,U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AACA,UAAII,CAAJ,EAAO;AACL,eAAOA,CAAP;AACD;AACD,UAAMC,OAAO,IAAb;AACA,UAAMC,YAAY,EAAlB;AACA,WAAKzE,OAAL,CAAa,MAAb,EAAqBC,IAArB,CAA0B,gBAA1B,EAA4CmD,IAA5C,CAAiD,YAAY;AAC3D,YAAMhB,UAAUxD,EAAE,IAAF,EAAQ2D,UAAR,EAAhB;AACA,aAAK,IAAMC,CAAX,IAAgBJ,OAAhB,EAAyB;AACvB,cAAI,CAACA,QAAQsC,cAAR,CAAuBlC,CAAvB,CAAL,EAAgC;AAChC,cAAIgC,KAAKtE,YAAL,CAAkBkC,QAAQI,CAAR,CAAlB,MAAkCgC,KAAKhE,IAAL,CAAU,IAAV,CAAtC,EAAuD;AACrDiE,sBAAUE,IAAV,CAAe/F,EAAE,IAAF,EAAQ,CAAR,CAAf;AACA;AACD;AACF;AACF,OATD;AAUA,WAAKgG,YAAL,CAAkBH,SAAlB;;AAEA,aAAO,KAAKH,YAAL,EAAP;AACD;AA9BmC,GAAtC;;AAiCA1F,mIAEED,OAFF,CAEU;AACRwB,gBADQ,0BACO;AACb,aAAO,IAAP;AACD,KAHO;AAKRC,gBALQ,0BAKO;AACb,aAAO,EAAP;AACD,KAPO;AASR4C,uBATQ,iCASc;AACpB,aAAO,CAAC,IAAD,CAAP;AACD;AAXO,GAFV;;AAgBApE,IAAE,aAAF,EAAiBD,OAAjB,CAAyB;AACvB8E,aADuB,uBACX;AACV,aAAO,KAAKoB,OAAL,CAAa,QAAb,CAAP;AACD;AAHsB,GAAzB;AAKD,CAnWD,E;;;;;;;;;ACRA,mBAAAC,CAAQ,CAAR,E;;;;;;ACAA,wB","file":"js/bundle.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 4eec3cbac2caa1241ce1","import $ from 'jquery';\n\n\n$.noConflict();\n\nwindow.ss = window.ss || {};\n\n\n$.entwine('ss', ($) => {\n const animation = {\n toggle: {\n show(el) {\n el.show();\n },\n hide(el) {\n el.hide();\n }\n },\n slide: {\n show(el) {\n el.slideDown();\n },\n hide(el) {\n el.slideUp();\n }\n },\n fade: {\n show(el) {\n el.fadeIn();\n },\n hide(el) {\n el.fadeOut();\n }\n },\n\n perform(el, result, method) {\n if (typeof method === 'undefined') method = 'toggle';\n if (result) {\n this[method].show(el);\n } else {\n this[method].hide(el);\n }\n }\n };\n\n\n $('div.display-logic, div.display-logic-dispatcher').entwine({\n\n escapeSelector(selector) {\n return selector.replace(/(\\[)/g, '_').replace(/(\\])/g, '');\n },\n\n findHolder(name) {\n return this.closest('form').find(\n this.escapeSelector(`#${this.nameToHolder(name)}`)\n );\n },\n\n getFormField() {\n let name = this.getFieldName();\n if (name) {\n name = this.escapeSelector(name);\n }\n\n if (this.find(`[name=${name}]`).length) {\n return this.find(`[name=${name}]`);\n }\n\n return this.find(`#${this.getFormID()}_${name}`);\n },\n\n getFieldName() {\n const fieldID = this.attr('id');\n\n if (fieldID) {\n return this.attr('id')\n .replace(new RegExp(`^${this.getFormID()}_`), '')\n .replace(/_Holder$/, '');\n }\n return null;\n },\n\n nameToHolder(name) {\n let holderName = this.escapeSelector(name);\n\n // SS 3.2+, Convert::raw2htmlid() logic\n holderName = holderName.replace(/[^a-zA-Z0-9\\-_:.]+/g, '_').replace(/_+/g, '_');\n\n // Hack!\n // Remove this when OptionsetField_holder.ss uses $HolderID\n // as its div ID instead of $ID\n // if (this.closest('form').find(`ul.optionset li input[name=${holderName}]:first`).length) {\n // return holderName;\n // }\n return `${this.getFormID()}_${holderName}_Holder`;\n },\n\n getFormID() {\n return this.closest('form').attr('id');\n },\n\n getFieldValue() {\n return this.getFormField().val();\n },\n\n evaluateEqualTo(val) {\n return this.getFieldValue() === val;\n },\n\n evaluateNotEqualTo(val) {\n return this.getFieldValue() !== val;\n },\n\n evaluateGreaterThan(val) {\n const num = parseFloat(val);\n return parseFloat(this.getFieldValue()) > num;\n },\n\n evaluateLessThan(val) {\n const num = parseFloat(val);\n return parseFloat(this.getFieldValue()) < num;\n },\n\n evaluateContains(val) {\n return this.getFieldValue().match(val) !== null;\n },\n\n evaluateStartsWith(val) {\n return this.getFieldValue().match(new RegExp(`^${val}`)) !== null;\n },\n\n evaluateEndsWith(val) {\n return this.getFieldValue().match(new RegExp(`${val}$`)) !== null;\n },\n\n evaluateEmpty() {\n return $.trim(this.getFieldValue()).length === 0;\n },\n\n evaluateNotEmpty() {\n return !this.evaluateEmpty();\n },\n\n evaluateBetween(minmax) {\n const v = parseFloat(this.getFieldValue());\n const parts = minmax.split('-');\n if (parts.length === 2) {\n return v > parseFloat(parts[0]) && v < parseFloat(parts[1]);\n }\n return false;\n },\n\n evaluateChecked() {\n return this.getFormField().is(':checked');\n },\n\n evaluateNotChecked() {\n return !this.getFormField().is(':checked');\n },\n\n onmatch() {\n let allReadonly = true;\n let dispatchers = [];\n const field = this.getFormField();\n\n if (field.data('display-logic-eval') && field.data('display-logic-dispatchers')) {\n this.data('display-logic-eval', field.data('display-logic-eval'))\n .data('display-logic-dispatchers', field.data('display-logic-dispatchers'))\n .data('display-logic-animation', field.data('display-logic-animation'));\n }\n\n dispatchers = this.getDispatchers();\n\n for (const m in dispatchers) {\n const holderName = this.nameToHolder(this.escapeSelector(dispatchers[m]));\n const dispatcher = this.closest('form').find(this.escapeSelector(`#${holderName}`));\n if (!dispatcher.is('.readonly')) allReadonly = false;\n\n dispatcher.addClass('display-logic-dispatcher');\n if (dispatcher.find('input[type=radio]').length) {\n dispatcher.addClass('optionset');\n }\n if (dispatcher.find('input[type=checkbox]').length > 1) {\n dispatcher.addClass('checkboxset');\n }\n }\n\n // If all the dispatchers are readonly fields, the field has no way of displaying.\n if (dispatchers.length && allReadonly) {\n this.show();\n }\n },\n\n getLogic() {\n return $.trim(this.data('display-logic-eval'));\n },\n\n parseLogic() {\n const js = this.getLogic();\n return new Function(`return ${js}`).bind(this)();\n },\n\n getDispatchers() {\n const dispatchers = this.getFormField().data('display-logic-dispatchers');\n return (dispatchers) ? dispatchers.split(',') : [];\n },\n\n getAnimationTargets() {\n return [this.findHolder(this.getFieldName())];\n }\n\n });\n\n $('div.checkboxset').entwine({\n\n evaluateHasCheckedOption(val) {\n let found = false;\n this.find(':checkbox').filter(':checked').each(function () {\n found = (found || ($(this).val() === val || $(this).getLabel().text() === val));\n });\n\n return found;\n },\n\n evaluateHasCheckedAtLeast(num) {\n return this.find(':checked').length >= num;\n },\n\n evaluateHasCheckedLessThan(num) {\n return this.find(':checked').length <= num;\n }\n\n });\n\n $('input[type=checkbox]').entwine({\n getLabel() {\n return this.closest('form').find(`label[for=${this.getHolder().escapeSelector(this.attr('id'))}]`);\n }\n });\n\n\n $('div.display-logic.display-logic-display').entwine({\n testLogic() {\n console.log(this, 'tests logic');\n this.getAnimationTargets().forEach(t => {\n animation.perform(t, this.parseLogic(), this.data('display-logic-animation'));\n })\n\n }\n });\n\n\n $('div.display-logic.display-logic-hide').entwine({\n testLogic() {\n this.getAnimationTargets().forEach(t => {\n animation.perform(t, !this.parseLogic(), this.data('display-logic-animation'));\n })\n\n }\n });\n\n\n $('div.display-logic-dispatcher input[type=\"text\"], ' +\n 'div.display-logic-dispatcher input[type=\"email\"], ' +\n 'div.display-logic-dispatcher input[type=\"numeric\"]').entwine({\n onmatch() {\n this.closest('.display-logic-dispatcher').notify();\n },\n\n onkeyup() {\n this.closest('.display-logic-dispatcher').notify();\n },\n\n onchange() {\n this.closest('.display-logic-dispatcher').notify();\n }\n });\n\n\n $('div.display-logic-dispatcher select').entwine({\n onmatch() {\n this.closest('.display-logic-dispatcher').notify();\n },\n\n onchange() {\n this.closest('.display-logic-dispatcher').notify();\n }\n });\n\n $('div.display-logic-dispatcher :checkbox, div.display-logic-dispatcher :radio').entwine({\n onmatch() {\n this.closest('.display-logic-dispatcher').notify();\n },\n\n onclick() {\n this.closest('.display-logic-dispatcher').notify();\n }\n });\n\n $('div.display-logic.optionset, div.display-logic-dispatcher.optionset').entwine({\n getFieldValue() {\n return this.find(':checked').val();\n },\n getAnimationTargets() {\n return this._super().concat(this.findHolder(this.getFieldName()).find('.optionset'));\n }\n\n });\n\n $('div.display-logic-dispatcher').entwine({\n Listeners: null,\n\n notify() {\n $.each(this.getListeners(), function () {\n console.log('test logic for ', this);\n $(this).testLogic();\n });\n },\n\n getListeners() {\n const l = this._super();\n if (l) {\n return l;\n }\n const self = this;\n const listeners = [];\n this.closest('form').find('.display-logic').each(function () {\n const dispatchers = $(this).getDispatchers();\n for (const m in dispatchers) {\n if (!dispatchers.hasOwnProperty(m)) continue;\n if (self.nameToHolder(dispatchers[m]) === self.attr('id')) {\n listeners.push($(this)[0]);\n break;\n }\n }\n });\n this.setListeners(listeners);\n\n return this.getListeners();\n }\n });\n\n $(`div.display-logic.displaylogicwrapper.display-logic-display,\n div.display-logic.displaylogicwrapper.display-logic-hide`\n ).entwine({\n getFormField() {\n return this;\n },\n\n getFieldName() {\n return '';\n },\n\n getAnimationTargets() {\n return [this];\n }\n });\n\n $('div.field *').entwine({\n getHolder() {\n return this.parents('.field');\n }\n });\n});\n\n\n\n// WEBPACK FOOTER //\n// ./client/src/components/display_logic.js","require('../components/display_logic.js');\n\n\n\n// WEBPACK FOOTER //\n// ./client/src/bundles/bundle.js","module.exports = jQuery;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"jQuery\"\n// module id = 2\n// module chunks = 0"],"sourceRoot":""} diff --git a/client/src/components/display_logic.js b/client/src/components/display_logic.js index 6ad84ba..76ce2c9 100644 --- a/client/src/components/display_logic.js +++ b/client/src/components/display_logic.js @@ -47,7 +47,7 @@ jQuery.entwine('ss', ($) => { }; - $('div.display-logic, div.display-logic-master').entwine({ + $('div.display-logic, div.display-logic-dispatcher').entwine({ escapeSelector(selector) { return selector.replace(/(\[)/g, '_').replace(/(\])/g, ''); @@ -163,35 +163,35 @@ jQuery.entwine('ss', ($) => { onmatch() { let allReadonly = true; - let masters = []; + let dispatchers = []; const field = this.getFormField(); - if (field.data('display-logic-eval') && field.data('display-logic-masters')) { + if (field.data('display-logic-eval') && field.data('display-logic-dispatchers')) { this.data('display-logic-eval', field.data('display-logic-eval')) - .data('display-logic-masters', field.data('display-logic-masters')) + .data('display-logic-dispatchers', field.data('display-logic-dispatchers')) .data('display-logic-animation', field.data('display-logic-animation')); } - masters = this.getMasters(); - if (masters && masters.length) { - Object.entries(masters).forEach(entry => { + dispatchers = this.getDispatchers(); + if (dispatchers && dispatchers.length) { + Object.entries(dispatchers).forEach(entry => { const [, selector] = entry; const holderName = this.nameToHolder(this.escapeSelector(selector)); - const master = this.closest('form').find(this.escapeSelector(`#${holderName}`)); - if (!master.is('.readonly')) allReadonly = false; + const dispatcher = this.closest('form').find(this.escapeSelector(`#${holderName}`)); + if (!dispatcher.is('.readonly')) allReadonly = false; - master.addClass('display-logic-master'); - if (master.find('input[type=radio]').length) { - master.addClass('optionset'); + dispatcher.addClass('display-logic-dispatcher'); + if (dispatcher.find('input[type=radio]').length) { + dispatcher.addClass('optionset'); } - if (master.find('input[type=checkbox]').length > 1) { - master.addClass('checkboxset'); + if (dispatcher.find('input[type=checkbox]').length > 1) { + dispatcher.addClass('checkboxset'); } }); } - // If all the masters are readonly fields, the field has no way of displaying. - if (masters.length && allReadonly) { + // If all the dispatchers are readonly fields, the field has no way of displaying. + if (dispatchers.length && allReadonly) { this.show(); } }, @@ -206,9 +206,9 @@ jQuery.entwine('ss', ($) => { return new Function(`return ${js}`).bind(this)(); }, - getMasters() { - const masters = this.getFormField().data('display-logic-masters'); - return (masters) ? masters.split(',') : []; + getDispatchers() { + const dispatchers = this.getFormField().data('display-logic-dispatchers'); + return (dispatchers) ? dispatchers.split(',') : []; }, getAnimationTargets() { @@ -263,44 +263,44 @@ jQuery.entwine('ss', ($) => { }); - $('div.display-logic-master input[type="text"], ' + - 'div.display-logic-master input[type="email"], ' + - 'div.display-logic-master input[type="numeric"]').entwine({ + $('div.display-logic-dispatcher input[type="text"], ' + + 'div.display-logic-dispatcher input[type="email"], ' + + 'div.display-logic-dispatcher input[type="numeric"]').entwine({ onmatch() { - this.closest('.display-logic-master').notify(); + this.closest('.display-logic-dispatcher').notify(); }, onkeyup() { - this.closest('.display-logic-master').notify(); + this.closest('.display-logic-dispatcher').notify(); }, onchange() { - this.closest('.display-logic-master').notify(); + this.closest('.display-logic-dispatcher').notify(); } }); - $('div.display-logic-master select').entwine({ + $('div.display-logic-dispatcher select').entwine({ onmatch() { - this.closest('.display-logic-master').notify(); + this.closest('.display-logic-dispatcher').notify(); }, onchange() { - this.closest('.display-logic-master').notify(); + this.closest('.display-logic-dispatcher').notify(); } }); - $('div.display-logic-master :checkbox, div.display-logic-master :radio').entwine({ + $('div.display-logic-dispatcher :checkbox, div.display-logic-dispatcher :radio').entwine({ onmatch() { - this.closest('.display-logic-master').notify(); + this.closest('.display-logic-dispatcher').notify(); }, onclick() { - this.closest('.display-logic-master').notify(); + this.closest('.display-logic-dispatcher').notify(); } }); - $('div.display-logic.optionset, div.display-logic-master.optionset').entwine({ + $('div.display-logic.optionset, div.display-logic-dispatcher.optionset').entwine({ getFieldValue() { return this.find(':checked').val(); }, @@ -310,7 +310,7 @@ jQuery.entwine('ss', ($) => { }); - $('div.display-logic-master').entwine({ + $('div.display-logic-dispatcher').entwine({ Listeners: null, notify() { @@ -327,9 +327,9 @@ jQuery.entwine('ss', ($) => { const self = this; const listeners = []; this.closest('form').find('.display-logic').each(function () { - const masters = $(this).getMasters(); - if (masters && masters.length) { - Object.entries(masters).forEach(entry => { + const dispatchers = $(this).getDispatchers(); + if (dispatchers && dispatchers.length) { + Object.entries(dispatchers).forEach(entry => { const [, selector] = entry; if (self.nameToHolder(selector) === self.attr('id')) { listeners.push($(this)[0]); diff --git a/src/Criteria.php b/src/Criteria.php index ee9ecd8..cb29c76 100644 --- a/src/Criteria.php +++ b/src/Criteria.php @@ -35,13 +35,13 @@ class Criteria * The name of the form field that depends on the criteria * @var string */ - protected $master = null; + protected $dispatcher = null; /** - * The form field that responds to the state of {@link $master} + * The form field that responds to the state of {@link $dispatcher} * @var FormField */ - protected $slave = null; + protected $responder = null; /** * A parent {@link Criteria}, for grouping @@ -80,14 +80,14 @@ public static function set_default_animation($animation) /** * Constructor - * @param FormField $slave The form field that responds to changes of another form field - * @param [type] $master The name of the form field to respond to + * @param FormField $responder The form field that responds to changes of another form field + * @param [type] $dispatcher The name of the form field to respond to * @param [type] $parent The parent {@link Criteria} */ - public function __construct(FormField $slave, $master, $parent = null) + public function __construct(FormField $responder, $dispatcher, $parent = null) { - $this->slave = $slave; - $this->master = $master; + $this->responder = $responder; + $this->dispatcher = $dispatcher; $this->parent = $parent; return $this; } @@ -108,7 +108,7 @@ public function __call($method, $args) $operator = ucwords($method); } - $this->addCriterion(Criterion::create($this->master, $operator, $val, $this)); + $this->addCriterion(Criterion::create($this->dispatcher, $operator, $val, $this)); return $this; } if (method_exists($this, $method)) { @@ -128,22 +128,22 @@ public function __call($method, $args) */ public function isBetween($min, $max) { - $this->addCriterion(Criterion::create($this->master, "Between", "{$min}-{$max}", $this)); + $this->addCriterion(Criterion::create($this->dispatcher, "Between", "{$min}-{$max}", $this)); return $this; } /** * Adds a new criterion, and makes this set use conjuctive logic - * @param string $master The master form field + * @param string $dispatcher The dispatcher form field * @return Criteria */ - public function andIf($master = null) + public function andIf($dispatcher = null) { if ($this->logicalOperator === self::LOGIC_OR) { user_error("Criteria: Cannot declare a logical operator more than once. (Specified andIf() after calling orIf()). Use a nested DisplayLogicCriteriaSet to combine conjunctive and disjuctive logic.", E_USER_ERROR); } - if ($master) { - $this->master = $master; + if ($dispatcher) { + $this->dispatcher = $dispatcher; } $this->logicalOperator = self::LOGIC_AND; return $this; @@ -151,16 +151,16 @@ public function andIf($master = null) /** * Adds a new criterion, and makes this set use disjunctive logic - * @param string $master The master form field + * @param string $dispatcher The dispatcher form field * @return Criteria */ - public function orIf($master = null) + public function orIf($dispatcher = null) { if ($this->logicalOperator === self::LOGIC_AND) { user_error("Criteria: Cannot declare a logical operator more than once. (Specified orIf() after calling andIf()). Use a nested DisplayLogicCriteriaSet to combine conjunctive and disjuctive logic.", E_USER_ERROR); } - if ($master) { - $this->master = $master; + if ($dispatcher) { + $this->dispatcher = $dispatcher; } $this->logicalOperator = self::LOGIC_OR; return $this; @@ -194,24 +194,24 @@ public function getLogicalOperator() } /** - * Accessor for the master field + * Accessor for the dispatcher field * @return string */ - public function getMaster() + public function getDispatcher() { - return $this->master; + return $this->dispatcher; } /** * @return $this */ - public function setMaster($fieldName) + public function setDispatcher($fieldName) { - $this->master = $fieldName; + $this->dispatcher = $fieldName; $criteria = $this->getCriteria(); if ($criteria) { foreach ($criteria as $criterion) { - $criterion->setMaster($fieldName); + $criterion->setDispatcher($fieldName); } } return $this; @@ -223,7 +223,7 @@ public function setMaster($fieldName) */ public function group() { - return Criteria::create($this->slave, $this->master, $this); + return Criteria::create($this->responder, $this->dispatcher, $this); } /** @@ -263,7 +263,7 @@ public function end() $this->parent->addCriterion($this); return $this->parent->end(); } - return $this->slave; + return $this->responder; } /** @@ -299,17 +299,17 @@ public function toScript() } /** - * Gets a list of all the master fields in this criteria set + * Gets a list of all the dispatcher fields in this criteria set * @return string */ - public function getMasterList() + public function getDispatcherList() { $list = []; foreach ($this->getCriteria() as $c) { if ($c instanceof Criteria) { - $list = array_merge($list, $c->getMasterList()); + $list = array_merge($list, $c->getDispatcherList()); } else { - $list[] = $c->getMaster(); + $list[] = $c->getDispatcher(); } } return $list; diff --git a/src/Criterion.php b/src/Criterion.php index c898918..845c80e 100644 --- a/src/Criterion.php +++ b/src/Criterion.php @@ -13,6 +13,7 @@ use SilverStripe\Core\Injector\Injectable; use SilverStripe\Core\Extensible; use SilverStripe\Core\Config\Configurable; +use SilverStripe\Dev\Deprecation; class Criterion { @@ -27,7 +28,7 @@ class Criterion * The name of the form field that is controlling the display * @var string */ - protected $master = null; + protected $dispatcher = null; /** * The comparison function to use, e.g. "EqualTo" @@ -49,34 +50,48 @@ class Criterion /** * Constructor - * @param string $master The name of the master field + * @param string $dispatcher The name of the dispatcher field * @param string $operator The name of the comparison function * @param string $value The value to compare to * @param Criteria $set The parent criteria set */ - public function __construct($master, $operator, $value, Criteria $set) + public function __construct($dispatcher, $operator, $value, Criteria $set) { - $this->master = $master; + $this->dispatcher = $dispatcher; $this->operator = $operator; $this->value = $value; $this->set = $set; } /** - * Accessor for the master field + * Accessor for the dispatcher field * @return string */ - public function getMaster() + public function getDispatcher() { - return $this->master; + return $this->dispatcher; } /** * @return $this */ + public function setDispatcher($fieldName) + { + $this->dispatcher = $fieldName; + return $this; + } + + public function getMaster() + { + Deprecation::('2.0.6', __FUNCTION__ . ' is deprecated. Please use getDispatcher() instead.'); + return $this->dispatcher; + } + public function setMaster($fieldName) { - $this->master = $fieldName; + Deprecation::('2.0.6', __FUNCTION__ . ' is deprecated. Please use setDispatcher($fieldName) instead.'); + $this->dispatcher = $fieldName; + return $this; } @@ -88,7 +103,7 @@ public function toScript() { return sprintf( "this.findHolder('%s').evaluate%s('%s')", - $this->master, + $this->dispatcher, $this->operator, addslashes($this->value ?? '') ); diff --git a/src/Extensions/DisplayLogic.php b/src/Extensions/DisplayLogic.php index 16f350d..ffdb196 100644 --- a/src/Extensions/DisplayLogic.php +++ b/src/Extensions/DisplayLogic.php @@ -34,10 +34,10 @@ public function setDisplayLogicCriteria(Criteria $criteria) /** * If the criteria evaluate true, the field should display - * @param string $master The name of the master field + * @param string $dispatcher The name of the dispatcher field * @return Criteria */ - public function displayIf($master) + public function displayIf($dispatcher) { $class ="display-logic display-logic-hidden display-logic-display"; $this->owner->addExtraClass($class); @@ -46,16 +46,16 @@ public function displayIf($master) $this->owner->addHolderClass($class); } - return $this->setDisplayLogicCriteria(Criteria::create($this->owner, $master)); + return $this->setDisplayLogicCriteria(Criteria::create($this->owner, $dispatcher)); } /** * If the criteria evaluate true, the field should hide. * The field will be hidden with CSS on page load, before the script loads. - * @param string $master The name of the master field + * @param string $dispatcher The name of the dispatcher field * @return Criteria */ - public function hideIf($master) + public function hideIf($dispatcher) { $class = "display-logic display-logic-hide"; $this->owner->addExtraClass($class); @@ -63,29 +63,29 @@ public function hideIf($master) if ($this->owner->hasMethod('addHolderClass')) { $this->owner->addHolderClass($class); } - return $this->setDisplayLogicCriteria(Criteria::create($this->owner, $master)); + return $this->setDisplayLogicCriteria(Criteria::create($this->owner, $dispatcher)); } /** * If the criteria evaluate true, the field should hide. * The field will displayed before the script loads. - * @param string $master The name of the master field + * @param string $dispatcher The name of the dispatcher field * @return Criteria */ - public function displayUnless($master) + public function displayUnless($dispatcher) { - return $this->owner->hideIf($master); + return $this->owner->hideIf($dispatcher); } /** * If the criteria evaluate true, the field should display. * The field will be hidden with CSS on page load, before the script loads. - * @param string $master The name of the master field + * @param string $dispatcher The name of the dispatcher field * @return Criteria */ - public function hideUnless($master) + public function hideUnless($dispatcher) { - return $this->owner->displayIf($master); + return $this->owner->displayIf($dispatcher); } @@ -96,14 +96,14 @@ public function getDisplayLogicCriteria() } /** - * A comma-separated list of the master form fields that control the display of this field + * A comma-separated list of the dispatcher form fields that control the display of this field * * @return string */ - public function DisplayLogicMasters() + public function DisplayLogicDispatchers() { if ($criteria = $this->getDisplayLogicCriteria()) { - return implode(",", array_unique($criteria->getMasterList())); + return implode(",", array_unique($criteria->getDispatcherList())); } } @@ -131,14 +131,14 @@ public function DisplayLogic() Requirements::css('unclecheese/display-logic: client/dist/styles/bundle.css'); return $criteria->toScript(); } - + return false; } public function onBeforeRender($field) { if ($logic = $field->DisplayLogic()) { - $field->setAttribute('data-display-logic-masters', $field->DisplayLogicMasters()); + $field->setAttribute('data-display-logic-dispatchers', $field->DisplayLogicDispatchers()); $field->setAttribute('data-display-logic-eval', $logic); $field->setAttribute('data-display-logic-animation', $field->DisplayLogicAnimation()); } diff --git a/templates/SilverStripe/Forms/CheckboxSetField.ss b/templates/SilverStripe/Forms/CheckboxSetField.ss index 6f4179e..14c1a41 100644 --- a/templates/SilverStripe/Forms/CheckboxSetField.ss +++ b/templates/SilverStripe/Forms/CheckboxSetField.ss @@ -1,12 +1,12 @@ -
    name="$Name" data-display-logic-masters="$DisplayLogicMasters" data-display-logic-eval="$DisplayLogic"<% end_if %>> +
      name="$Name" data-display-logic-dispatchers="$DisplayLogicDispatchers" data-display-logic-eval="$DisplayLogic"<% end_if %>> <% if $Options.Count %> <% loop $Options %>
    • checked="checked"<% end_if %><% if $isDisabled %> disabled="disabled"<% end_if %> /> -
    • + <% end_loop %> <% else %>
    • No options available
    • <% end_if %> -
    \ No newline at end of file +
diff --git a/templates/UncleCheese/DisplayLogic/Forms/Wrapper_holder.ss b/templates/UncleCheese/DisplayLogic/Forms/Wrapper_holder.ss index 153c61c..69c9bbd 100644 --- a/templates/UncleCheese/DisplayLogic/Forms/Wrapper_holder.ss +++ b/templates/UncleCheese/DisplayLogic/Forms/Wrapper_holder.ss @@ -1,5 +1,5 @@ -
+
<% loop $FieldList %> $FieldHolder <% end_loop %> -
\ No newline at end of file +
diff --git a/tests/php/ConditionalsTest.php b/tests/php/ConditionalsTest.php index 71b68ec..2e406ca 100644 --- a/tests/php/ConditionalsTest.php +++ b/tests/php/ConditionalsTest.php @@ -19,7 +19,7 @@ public function testIsEqual() $output = $form->forTemplate(); $contains = 'data-display-logic-eval="(this.findHolder('Field1').evaluateEqualTo('100'))"'; $this->assertContains($contains, $output); - $this->assertContains('data-display-logic-masters="Field1"', $output); + $this->assertContains('data-display-logic-dispatchers="Field1"', $output); } @@ -32,7 +32,7 @@ public function testIsNotEqualTo() $output = $form->forTemplate(); $contains = 'data-display-logic-eval="(this.findHolder('Field1').evaluateNotEqualTo('100'))"'; $this->assertContains($contains, $output); - $this->assertContains('data-display-logic-masters="Field1"', $output); + $this->assertContains('data-display-logic-dispatchers="Field1"', $output); } public function testIsGreaterThan() @@ -45,10 +45,10 @@ public function testIsGreaterThan() $output = $form->forTemplate(); $this->assertContains('data-display-logic-eval="(this.findHolder('Field1').evaluateGreaterThan('100'))"', $output); $this->assertContains('data-display-logic-eval="(this.findHolder('Field1').evaluateGreaterThan('200'))"', $output); - $this->assertContains('data-display-logic-masters="Field1"', $output); + $this->assertContains('data-display-logic-dispatchers="Field1"', $output); - $this->assertEquals(2, substr_count($output, 'data-display-logic-masters="')); - $this->assertEquals(2, substr_count($output, 'data-display-logic-masters="Field1"')); + $this->assertEquals(2, substr_count($output, 'data-display-logic-dispatchers="')); + $this->assertEquals(2, substr_count($output, 'data-display-logic-dispatchers="Field1"')); } @@ -60,7 +60,7 @@ public function testIsLessThan() ); $output = $form->forTemplate(); $this->assertContains('data-display-logic-eval="(this.findHolder('Field1').evaluateLessThan('50'))', $output); - $this->assertContains('data-display-logic-masters="Field1"', $output); + $this->assertContains('data-display-logic-dispatchers="Field1"', $output); } public function testAggregatedRules() @@ -74,7 +74,7 @@ public function testAggregatedRules() $output = $form->forTemplate(); $this->assertContains('(this.findHolder('Field1').evaluateLessThan('50') ' . '&& this.findHolder('Field2').evaluateGreaterThan('80'))', $output); - $this->assertContains('data-display-logic-masters="Field1,Field2"', $output); + $this->assertContains('data-display-logic-dispatchers="Field1,Field2"', $output); } -} \ No newline at end of file +}