diff --git a/CHANGELOG.md b/CHANGELOG.md index 26c6df09dcd..570b9449988 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Fixed a bug where element selection modals were only showing the first 100 elements. ([#14790](https://github.com/craftcms/cms/issues/14790)) - Fixed a PHP error that could occur on the Dashboard if any Quick Post widgets hadn’t been saved since before Craft 1.2. ([#14794](https://github.com/craftcms/cms/issues/14794)) +- Fixed a bug where double-clicking on an inline Matrix block tab would cause it to expand/collapse. ([#14791](https://github.com/craftcms/cms/issues/14791)) ## 5.0.4 - 2024-04-10 diff --git a/src/web/assets/matrix/dist/MatrixInput.js b/src/web/assets/matrix/dist/MatrixInput.js index c8fc3834374..867d4c1b867 100644 --- a/src/web/assets/matrix/dist/MatrixInput.js +++ b/src/web/assets/matrix/dist/MatrixInput.js @@ -1,3 +1,3 @@ /*! For license information please see MatrixInput.js.LICENSE.txt */ -!function(){"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0,a=function(){};return{s:a,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,l=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){l=!0,o=t},f:function(){try{s||null==r.return||r.return()}finally{if(l)throw o}}}}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var l=a.call(o,"catchLoc"),d=a.call(o,"finallyLoc");if(l&&d){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;A(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:O(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},n}function a(t,e,n,r,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function o(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function s(t){a(o,r,i,s,l,"next",t)}function l(t){a(o,r,i,s,l,"throw",t)}s(void 0)}))}}jQuery,function(t){Craft.MatrixInput=Garnish.Base.extend({id:null,entryTypes:null,entryTypesByHandle:null,inputNamePrefix:null,inputIdPrefix:null,showingAddEntryMenu:!1,addEntryBtnGroupWidth:null,addEntryBtnContainerWidth:null,$container:null,$form:null,$entriesContainer:null,$addEntryBtnContainer:null,$addEntryBtn:null,$addEntryMenuBtn:null,$statusMessage:null,entrySort:null,entrySelect:null,elementEditor:null,addingEntry:!1,init:function(e,r,a,s){var l=this;this.id=e,this.entryTypes=r,this.inputNamePrefix=a,this.inputIdPrefix=Craft.formatInputId(this.inputNamePrefix),"number"==typeof s&&(s={maxEntries:s}),this.setSettings(s,Craft.MatrixInput.defaults),this.$container=t("#"+this.id),this.$form=this.$container.closest("form"),this.$entriesContainer=this.$container.children(".blocks"),this.$addEntryBtnContainer=this.$container.children(".buttons"),this.$addEntryBtn=this.$addEntryBtnContainer.children(".btn:not(.menubtn)"),this.$addEntryMenuBtn=this.$addEntryBtnContainer.children(".menubtn"),this.$statusMessage=this.$container.find("[data-status-message]"),this.$container.data("matrix",this),this.entryTypesByHandle={};for(var d=0;d .actions > .move",axis:"y",filter:function(){return l.entrySort.$targetItem.hasClass("sel")?l.entrySelect.getSelectedItems():l.entrySort.$targetItem},collapseDraggees:!0,magnetStrength:4,helperLagBase:1.5,helperOpacity:.9,onDragStop:function(){l.trigger("entrySortDragStop")},onSortChange:function(){l.entrySelect.resetItemOrder()}}),this.entrySelect=new Garnish.Select(this.$entriesContainer,u,{multi:!0,vertical:!0,handle:"> .actions > .checkbox, > .titlebar",filter:function(e){return!t(e).closest(".tab-label").length},checkboxMode:!0});for(var f=0;f .actions .action-btn"),i=r.data("trigger")||new Garnish.DisclosureMenu(r);this.$actionMenu=i.$container,this.actionDisclosure=i,i.on("show",(function(){n.$container.addClass("active"),n.$container.prev(".matrixblock").length?n.$actionMenu.find("button[data-action=moveUp]:first").parent().removeClass("hidden"):n.$actionMenu.find("button[data-action=moveUp]:first").parent().addClass("hidden"),n.$container.next(".matrixblock").length?n.$actionMenu.find("button[data-action=moveDown]:first").parent().removeClass("hidden"):n.$actionMenu.find("button[data-action=moveDown]:first").parent().addClass("hidden")})),i.on("hide",(function(){n.$container.removeClass("active")})),this.$actionMenuOptions=this.$actionMenu.find("button[data-action]"),this.addListener(this.$actionMenuOptions,"activate",this.handleActionClick),Garnish.hasAttr(this.$container,"data-collapsed")&&this.collapse(),this._handleTitleBarClick=function(t){t.preventDefault(),this.toggle()},this.addListener(this.$titlebar,"doubletap",this._handleTitleBarClick),this.visibleLayoutElements=this.$container.data("visible-layout-elements"),this.formObserver=new Craft.FormObserver(this.$container,(function(t){n.updateFieldLayout(t)}))},toggle:function(){this.collapsed?this.expand():this.collapse(!0)},collapse:function(e){var n=this;if(!this.collapsed){this.$container.addClass("collapsed");for(var r="",i=this.$fieldsContainer.children().children(),a=0;a| ":"")+s)}this.$previewContainer.html(r),this.$fieldsContainer.velocity("stop"),this.$container.velocity("stop"),e&&!Garnish.prefersReducedMotion()?(this.$fieldsContainer.velocity("fadeOut",{duration:"fast"}),this.$container.velocity({height:34},"fast")):(this.$previewContainer.show(),this.$fieldsContainer.hide(),this.$container.css({height:34})),this.$tabContainer.hide(),setTimeout((function(){n.$actionMenu.find("button[data-action=collapse]:first").parent().addClass("hidden"),n.$actionMenu.find("button[data-action=expand]:first").parent().removeClass("hidden")}),200),this.isNew?this.$collapsedInput?this.$collapsedInput.val("1"):this.$collapsedInput=t('').appendTo(this.$container):Craft.MatrixInput.rememberCollapsedEntryId(this.id),this.collapsed=!0}},_inputPreviewText:function(e){if(e.is("select,multiselect")){for(var n=[],r=e.find("option:selected"),i=0;i1&&this.matrix.entrySelect.isSelected(this.$container),r=t(e);switch(r.data("action")){case"collapse":n?this.matrix.collapseSelectedEntries():this.collapse(!0);break;case"expand":n?this.matrix.expandSelectedEntries():this.expand();break;case"disable":n?this.matrix.disableSelectedEntries():this.disable();break;case"enable":n?this.matrix.enableSelectedEntries():(this.enable(),this.expand());break;case"moveUp":this.moveUp();break;case"moveDown":this.moveDown();break;case"add":var i=r.data("type");this.matrix.addEntry(i,this.$container);break;case"delete":n?confirm(Craft.t("app","Are you sure you want to delete the selected entries?"))&&this.matrix.deleteSelectedEntries():this.selfDestruct()}this.actionDisclosure.hide()},selfDestruct:function(){var e=this;t("[name]",this.$container).removeAttr("name"),this.$container.velocity(this.matrix.getHiddenEntryCss(this.$container),"fast",(function(){e.$container.remove(),e.matrix.updateAddEntryBtn(),e.matrix.trigger("entryDeleted",{$entry:e.$container})}))},updateFieldLayout:function(e){var n=this;return new Promise((function(i,a){var o=n.matrix.elementEditor,s=n.$container.data("base-input-name");if(null!=o&&o.submittingForm)a("Form already being submitted.");else{n.cancelToken&&(n.ignoreFailedRequest=!0,n.cancelToken.cancel());var l=function(t){return Craft.namespaceInputName(t,s)},d=r(r(r(r(r(r(r({},l("visibleLayoutElements"),n.visibleLayoutElements),l("elementType"),"craft\\elements\\Entry"),l("ownerId"),n.matrix.settings.ownerId),l("fieldId"),n.matrix.settings.fieldId),l("sortOrder"),n.$container.index()+1),l("typeId"),n.$container.data("type-id")),l("elementUid"),n.$container.data("uid")),c=n.$fieldsContainer.children("[data-layout-tab]:not(.hidden)").data("id");c&&(d[l("selectedTab")]=c),e+="&".concat(t.param(d)),n.cancelToken=axios.CancelToken.source(),Craft.sendActionRequest("POST","elements/update-field-layout",{cancelToken:n.cancelToken.token,headers:{"content-type":"application/x-www-form-urlencoded","X-Craft-Namespace":s},data:e}).then((function(t){n._afterUpdateFieldLayout(e,c,s,t),i()})).catch((function(t){n.ignoreFailedRequest||a(t),n.ignoreFailedRequest=!1})).finally((function(){n.cancelToken=null}))}}))},_afterUpdateFieldLayout:function(n,r,a,s){var l=this;return o(i().mark((function n(){var o,d,c,u,h,f,p,y,m,v,g,b,$,C,E,x,w;return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:d=l.$fieldsContainer.children("[data-layout-tab]:not(.hidden)").data("id"),c=t(),u={},h=e(s.data.missingElements);try{for(h.s();!(f=h.n()).done;){p=f.value,(y=l.$fieldsContainer.children('[data-layout-tab="'.concat(p.uid,'"]'))).length||(y=t("
",{id:Craft.namespaceId(p.id,a),class:"flex-fields","data-id":p.id,"data-layout-tab":p.uid}),p.id!==r&&y.addClass("hidden"),y.appendTo(l.$fieldsContainer)),c=c.add(y),m=e(p.elements);try{for(m.s();!(v=m.n()).done;)!1!==(g=v.value).html?(u[p.uid]||(u[p.uid]=[]),u[p.uid].push(g.uid),"string"==typeof g.html&&(b=y.children('[data-layout-element="'.concat(g.uid,'"]')),$=t(g.html),b.length?b.replaceWith($):$.appendTo(y),Craft.initUiElements($))):(C=y.children('[data-layout-element="'.concat(g.uid,'"]'))).length&&Garnish.hasAttr(C,"data-layout-element-placeholder")||(E=t("
",{class:"hidden","data-layout-element":g.uid,"data-layout-element-placeholder":""}),C.length?C.replaceWith(E):E.appendTo(y))}catch(t){m.e(t)}finally{m.f()}}}catch(t){h.e(t)}finally{h.f()}return(x=l.$fieldsContainer.children("[data-layout-tab]").not(c).not('[data-layout-tab=""]')).length&&x.remove(),c.filter(":not(.hidden)").length||c.first().removeClass("hidden"),l.visibleLayoutElements=u,l.tabManager&&(l.tabManager.destroy(),l.tabManager=null,l.$tabContainer.html("")),l.hasTabs=!!s.data.tabs,l.hasTabs&&(l.$tabContainer.append(s.data.tabs),l.tabManager=Craft.MatrixInput.initTabs(l.$tabContainer),r&&d&&r!==d&&((w=l.tabManager.$tabs.filter('[data-id="'.concat(d,'"]'))).length?l.tabManager.selectTab(w):l.tabManager.selectTab(l.tabManager.$tabs.first()))),n.next=15,Craft.appendHeadHtml(s.data.headHtml);case 15:return n.next=17,Craft.appendBodyHtml(s.data.bodyHtml);case 17:null===(o=l.matrix.elementEditor)||void 0===o||o.handleDismissibleTips();case 18:case"end":return n.stop()}}),n)})))()}})}(jQuery)}(); +!function(){"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0,a=function(){};return{s:a,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,l=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){l=!0,o=t},f:function(){try{s||null==r.return||r.return()}finally{if(l)throw o}}}}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var l=a.call(o,"catchLoc"),d=a.call(o,"finallyLoc");if(l&&d){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;A(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:O(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},n}function a(t,e,n,r,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function o(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function s(t){a(o,r,i,s,l,"next",t)}function l(t){a(o,r,i,s,l,"throw",t)}s(void 0)}))}}jQuery,function(t){Craft.MatrixInput=Garnish.Base.extend({id:null,entryTypes:null,entryTypesByHandle:null,inputNamePrefix:null,inputIdPrefix:null,showingAddEntryMenu:!1,addEntryBtnGroupWidth:null,addEntryBtnContainerWidth:null,$container:null,$form:null,$entriesContainer:null,$addEntryBtnContainer:null,$addEntryBtn:null,$addEntryMenuBtn:null,$statusMessage:null,entrySort:null,entrySelect:null,elementEditor:null,addingEntry:!1,init:function(e,r,a,s){var l=this;this.id=e,this.entryTypes=r,this.inputNamePrefix=a,this.inputIdPrefix=Craft.formatInputId(this.inputNamePrefix),"number"==typeof s&&(s={maxEntries:s}),this.setSettings(s,Craft.MatrixInput.defaults),this.$container=t("#"+this.id),this.$form=this.$container.closest("form"),this.$entriesContainer=this.$container.children(".blocks"),this.$addEntryBtnContainer=this.$container.children(".buttons"),this.$addEntryBtn=this.$addEntryBtnContainer.children(".btn:not(.menubtn)"),this.$addEntryMenuBtn=this.$addEntryBtnContainer.children(".menubtn"),this.$statusMessage=this.$container.find("[data-status-message]"),this.$container.data("matrix",this),this.entryTypesByHandle={};for(var d=0;d .actions > .move",axis:"y",filter:function(){return l.entrySort.$targetItem.hasClass("sel")?l.entrySelect.getSelectedItems():l.entrySort.$targetItem},collapseDraggees:!0,magnetStrength:4,helperLagBase:1.5,helperOpacity:.9,onDragStop:function(){l.trigger("entrySortDragStop")},onSortChange:function(){l.entrySelect.resetItemOrder()}}),this.entrySelect=new Garnish.Select(this.$entriesContainer,u,{multi:!0,vertical:!0,handle:"> .actions > .checkbox, > .titlebar",filter:function(e){return!t(e).closest(".tab-label").length},checkboxMode:!0});for(var f=0;f .actions .action-btn"),a=i.data("trigger")||new Garnish.DisclosureMenu(i);this.$actionMenu=a.$container,this.actionDisclosure=a,a.on("show",(function(){r.$container.addClass("active"),r.$container.prev(".matrixblock").length?r.$actionMenu.find("button[data-action=moveUp]:first").parent().removeClass("hidden"):r.$actionMenu.find("button[data-action=moveUp]:first").parent().addClass("hidden"),r.$container.next(".matrixblock").length?r.$actionMenu.find("button[data-action=moveDown]:first").parent().removeClass("hidden"):r.$actionMenu.find("button[data-action=moveDown]:first").parent().addClass("hidden")})),a.on("hide",(function(){r.$container.removeClass("active")})),this.$actionMenuOptions=this.$actionMenu.find("button[data-action]"),this.addListener(this.$actionMenuOptions,"activate",this.handleActionClick),Garnish.hasAttr(this.$container,"data-collapsed")&&this.collapse(),this._handleTitleBarClick=function(e){t(e.target).closest(".tab-label").length||(e.preventDefault(),this.toggle())},this.addListener(this.$titlebar,"doubletap",this._handleTitleBarClick),this.visibleLayoutElements=this.$container.data("visible-layout-elements"),this.formObserver=new Craft.FormObserver(this.$container,(function(t){r.updateFieldLayout(t)}))},toggle:function(){this.collapsed?this.expand():this.collapse(!0)},collapse:function(e){var n=this;if(!this.collapsed){this.$container.addClass("collapsed");for(var r="",i=this.$fieldsContainer.children().children(),a=0;a| ":"")+s)}this.$previewContainer.html(r),this.$fieldsContainer.velocity("stop"),this.$container.velocity("stop"),e&&!Garnish.prefersReducedMotion()?(this.$fieldsContainer.velocity("fadeOut",{duration:"fast"}),this.$container.velocity({height:34},"fast")):(this.$previewContainer.show(),this.$fieldsContainer.hide(),this.$container.css({height:34})),this.$tabContainer.hide(),setTimeout((function(){n.$actionMenu.find("button[data-action=collapse]:first").parent().addClass("hidden"),n.$actionMenu.find("button[data-action=expand]:first").parent().removeClass("hidden")}),200),this.isNew?this.$collapsedInput?this.$collapsedInput.val("1"):this.$collapsedInput=t('').appendTo(this.$container):Craft.MatrixInput.rememberCollapsedEntryId(this.id),this.collapsed=!0}},_inputPreviewText:function(e){if(e.is("select,multiselect")){for(var n=[],r=e.find("option:selected"),i=0;i1&&this.matrix.entrySelect.isSelected(this.$container),r=t(e);switch(r.data("action")){case"collapse":n?this.matrix.collapseSelectedEntries():this.collapse(!0);break;case"expand":n?this.matrix.expandSelectedEntries():this.expand();break;case"disable":n?this.matrix.disableSelectedEntries():this.disable();break;case"enable":n?this.matrix.enableSelectedEntries():(this.enable(),this.expand());break;case"moveUp":this.moveUp();break;case"moveDown":this.moveDown();break;case"add":var i=r.data("type");this.matrix.addEntry(i,this.$container);break;case"delete":n?confirm(Craft.t("app","Are you sure you want to delete the selected entries?"))&&this.matrix.deleteSelectedEntries():this.selfDestruct()}this.actionDisclosure.hide()},selfDestruct:function(){var e=this;t("[name]",this.$container).removeAttr("name"),this.$container.velocity(this.matrix.getHiddenEntryCss(this.$container),"fast",(function(){e.$container.remove(),e.matrix.updateAddEntryBtn(),e.matrix.trigger("entryDeleted",{$entry:e.$container})}))},updateFieldLayout:function(e){var n=this;return new Promise((function(i,a){var o=n.matrix.elementEditor,s=n.$container.data("base-input-name");if(null!=o&&o.submittingForm)a("Form already being submitted.");else{n.cancelToken&&(n.ignoreFailedRequest=!0,n.cancelToken.cancel());var l=function(t){return Craft.namespaceInputName(t,s)},d=r(r(r(r(r(r(r({},l("visibleLayoutElements"),n.visibleLayoutElements),l("elementType"),"craft\\elements\\Entry"),l("ownerId"),n.matrix.settings.ownerId),l("fieldId"),n.matrix.settings.fieldId),l("sortOrder"),n.$container.index()+1),l("typeId"),n.$container.data("type-id")),l("elementUid"),n.$container.data("uid")),c=n.$fieldsContainer.children("[data-layout-tab]:not(.hidden)").data("id");c&&(d[l("selectedTab")]=c),e+="&".concat(t.param(d)),n.cancelToken=axios.CancelToken.source(),Craft.sendActionRequest("POST","elements/update-field-layout",{cancelToken:n.cancelToken.token,headers:{"content-type":"application/x-www-form-urlencoded","X-Craft-Namespace":s},data:e}).then((function(t){n._afterUpdateFieldLayout(e,c,s,t),i()})).catch((function(t){n.ignoreFailedRequest||a(t),n.ignoreFailedRequest=!1})).finally((function(){n.cancelToken=null}))}}))},_afterUpdateFieldLayout:function(n,r,a,s){var l=this;return o(i().mark((function n(){var o,d,c,u,h,f,p,y,m,v,g,b,$,C,E,x,w;return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:d=l.$fieldsContainer.children("[data-layout-tab]:not(.hidden)").data("id"),c=t(),u={},h=e(s.data.missingElements);try{for(h.s();!(f=h.n()).done;){p=f.value,(y=l.$fieldsContainer.children('[data-layout-tab="'.concat(p.uid,'"]'))).length||(y=t("
",{id:Craft.namespaceId(p.id,a),class:"flex-fields","data-id":p.id,"data-layout-tab":p.uid}),p.id!==r&&y.addClass("hidden"),y.appendTo(l.$fieldsContainer)),c=c.add(y),m=e(p.elements);try{for(m.s();!(v=m.n()).done;)!1!==(g=v.value).html?(u[p.uid]||(u[p.uid]=[]),u[p.uid].push(g.uid),"string"==typeof g.html&&(b=y.children('[data-layout-element="'.concat(g.uid,'"]')),$=t(g.html),b.length?b.replaceWith($):$.appendTo(y),Craft.initUiElements($))):(C=y.children('[data-layout-element="'.concat(g.uid,'"]'))).length&&Garnish.hasAttr(C,"data-layout-element-placeholder")||(E=t("
",{class:"hidden","data-layout-element":g.uid,"data-layout-element-placeholder":""}),C.length?C.replaceWith(E):E.appendTo(y))}catch(t){m.e(t)}finally{m.f()}}}catch(t){h.e(t)}finally{h.f()}return(x=l.$fieldsContainer.children("[data-layout-tab]").not(c).not('[data-layout-tab=""]')).length&&x.remove(),c.filter(":not(.hidden)").length||c.first().removeClass("hidden"),l.visibleLayoutElements=u,l.tabManager&&(l.tabManager.destroy(),l.tabManager=null,l.$tabContainer.html("")),l.hasTabs=!!s.data.tabs,l.hasTabs&&(l.$tabContainer.append(s.data.tabs),l.tabManager=Craft.MatrixInput.initTabs(l.$tabContainer),r&&d&&r!==d&&((w=l.tabManager.$tabs.filter('[data-id="'.concat(d,'"]'))).length?l.tabManager.selectTab(w):l.tabManager.selectTab(l.tabManager.$tabs.first()))),n.next=15,Craft.appendHeadHtml(s.data.headHtml);case 15:return n.next=17,Craft.appendBodyHtml(s.data.bodyHtml);case 17:null===(o=l.matrix.elementEditor)||void 0===o||o.handleDismissibleTips();case 18:case"end":return n.stop()}}),n)})))()}})}(jQuery)}(); //# sourceMappingURL=MatrixInput.js.map \ No newline at end of file diff --git a/src/web/assets/matrix/dist/MatrixInput.js.map b/src/web/assets/matrix/dist/MatrixInput.js.map index eca7dcbe820..df559f9c6dc 100644 --- a/src/web/assets/matrix/dist/MatrixInput.js.map +++ b/src/web/assets/matrix/dist/MatrixInput.js.map @@ -1 +1 @@ -{"version":3,"file":"MatrixInput.js","mappings":";opDACAA,EAAA,kBAAAC,CAAA,MAAAC,EAAAD,EAAA,GAAAE,EAAAC,OAAAC,UAAAC,EAAAH,EAAAI,eAAAC,EAAAJ,OAAAK,gBAAA,SAAAP,EAAAD,EAAA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":["webpack:///./MatrixInput.js","webpack:///external var \"jQuery\""],"sourcesContent":["import $ from 'jquery';\n\n(function ($) {\n /** global: Craft */\n /** global: Garnish */\n /**\n * Matrix input class\n */\n Craft.MatrixInput = Garnish.Base.extend(\n {\n id: null,\n entryTypes: null,\n entryTypesByHandle: null,\n inputNamePrefix: null,\n inputIdPrefix: null,\n\n showingAddEntryMenu: false,\n addEntryBtnGroupWidth: null,\n addEntryBtnContainerWidth: null,\n\n $container: null,\n $form: null,\n $entriesContainer: null,\n $addEntryBtnContainer: null,\n $addEntryBtn: null,\n $addEntryMenuBtn: null,\n $statusMessage: null,\n\n entrySort: null,\n entrySelect: null,\n\n /**\n * @type {Craft.ElementEditor|null}\n */\n elementEditor: null,\n\n addingEntry: false,\n\n init: function (id, entryTypes, inputNamePrefix, settings) {\n this.id = id;\n this.entryTypes = entryTypes;\n this.inputNamePrefix = inputNamePrefix;\n this.inputIdPrefix = Craft.formatInputId(this.inputNamePrefix);\n\n // see if settings was actually set to the maxEntries value\n if (typeof settings === 'number') {\n settings = {maxEntries: settings};\n }\n this.setSettings(settings, Craft.MatrixInput.defaults);\n\n this.$container = $('#' + this.id);\n this.$form = this.$container.closest('form');\n this.$entriesContainer = this.$container.children('.blocks');\n this.$addEntryBtnContainer = this.$container.children('.buttons');\n this.$addEntryBtn =\n this.$addEntryBtnContainer.children('.btn:not(.menubtn)');\n this.$addEntryMenuBtn = this.$addEntryBtnContainer.children('.menubtn');\n this.$statusMessage = this.$container.find('[data-status-message]');\n\n this.$container.data('matrix', this);\n\n this.entryTypesByHandle = {};\n\n for (let i = 0; i < this.entryTypes.length; i++) {\n const entryType = this.entryTypes[i];\n this.entryTypesByHandle[entryType.handle] = entryType;\n }\n\n const $entries = this.$entriesContainer.children('.matrixblock');\n const collapsedEntries = Craft.MatrixInput.getCollapsedEntryIds();\n\n this.entrySort = new Garnish.DragSort($entries, {\n handle: '> .actions > .move',\n axis: 'y',\n filter: () => {\n // Only return all the selected items if the target item is selected\n if (this.entrySort.$targetItem.hasClass('sel')) {\n return this.entrySelect.getSelectedItems();\n } else {\n return this.entrySort.$targetItem;\n }\n },\n collapseDraggees: true,\n magnetStrength: 4,\n helperLagBase: 1.5,\n helperOpacity: 0.9,\n onDragStop: () => {\n this.trigger('entrySortDragStop');\n },\n onSortChange: () => {\n this.entrySelect.resetItemOrder();\n },\n });\n\n this.entrySelect = new Garnish.Select(\n this.$entriesContainer,\n $entries,\n {\n multi: true,\n vertical: true,\n handle: '> .actions > .checkbox, > .titlebar',\n filter: (target) => {\n return !$(target).closest('.tab-label').length;\n },\n checkboxMode: true,\n }\n );\n\n for (let i = 0; i < $entries.length; i++) {\n const $entry = $($entries[i]);\n const entry = new Entry(this, $entry);\n\n if (entry.id && $.inArray('' + entry.id, collapsedEntries) !== -1) {\n entry.collapse();\n }\n }\n\n this.addListener(this.$addEntryBtn, 'activate', async function () {\n this.$addEntryBtn.addClass('loading');\n try {\n await this.addEntry(this.$addEntryBtn.data('type'));\n } finally {\n this.$addEntryBtn.removeClass('loading');\n }\n });\n\n if (this.$addEntryMenuBtn.length) {\n this.$addEntryMenuBtn\n .disclosureMenu()\n .data('disclosureMenu')\n .$container.find('button')\n .on('activate', async (ev) => {\n this.$addEntryMenuBtn.addClass('loading');\n try {\n await this.addEntry($(ev.currentTarget).data('type'));\n } finally {\n this.$addEntryMenuBtn.removeClass('loading');\n }\n });\n }\n\n this.updateAddEntryBtn();\n\n setTimeout(() => {\n this.elementEditor = this.$container\n .closest('form')\n .data('elementEditor');\n\n if (this.elementEditor) {\n this.elementEditor.on('update', () => {\n this.settings.ownerId = this.elementEditor.getDraftElementId(\n this.settings.ownerId\n );\n });\n }\n\n this.trigger('afterInit');\n }, 100);\n },\n\n canAddMoreEntries: function () {\n return (\n !this.maxEntries ||\n this.$entriesContainer.children().length < this.maxEntries\n );\n },\n\n updateAddEntryBtn: function () {\n if (this.canAddMoreEntries()) {\n this.$addEntryBtn.removeClass('disabled').removeAttr('aria-disabled');\n this.$addEntryMenuBtn.removeClass('disabled');\n\n for (let i = 0; i < this.entrySelect.$items.length; i++) {\n const entry = this.entrySelect.$items.eq(i).data('entry');\n\n if (entry) {\n entry.$actionMenu\n .find('button[data-action=add]')\n .parent()\n .removeClass('disabled');\n entry.$actionMenu\n .find('button[data-action=add]')\n .removeAttr('aria-disabled');\n }\n }\n } else {\n this.$addEntryBtn.addClass('disabled').attr('aria-disabled', 'true');\n this.$addEntryMenuBtn.addClass('disabled');\n\n for (let i = 0; i < this.entrySelect.$items.length; i++) {\n const entry = this.entrySelect.$items.eq(i).data('entry');\n\n if (entry) {\n entry.$actionMenu\n .find('button[data-action=add]')\n .parent()\n .addClass('disabled');\n entry.$actionMenu\n .find('button[data-action=add]')\n .attr('aria-disabled', 'true');\n }\n }\n }\n },\n\n updateStatusMessage: function () {\n this.$statusMessage.empty();\n let message;\n\n if (!this.canAddMoreEntries()) {\n message = Craft.t(\n 'app',\n 'Entry could not be added. Maximum number of entries reached.'\n );\n }\n\n setTimeout(() => {\n this.$statusMessage.text(message);\n }, 250);\n },\n\n async addEntry(type, $insertBefore, autofocus) {\n if (this.addingEntry) {\n // only one new entry at a time\n return;\n }\n\n if (!this.canAddMoreEntries()) {\n this.updateStatusMessage();\n return;\n }\n\n this.addingEntry = true;\n\n if (this.elementEditor) {\n // First ensure we're working with drafts for all elements leading up\n // to this field’s element\n await this.elementEditor.setFormValue(\n this.settings.baseInputName,\n '*'\n );\n }\n\n const {data} = await Craft.sendActionRequest(\n 'POST',\n 'matrix/create-entry',\n {\n data: {\n fieldId: this.settings.fieldId,\n entryTypeId: this.entryTypesByHandle[type].id,\n ownerId: this.settings.ownerId,\n ownerElementType: this.settings.ownerElementType,\n siteId: this.settings.siteId,\n namespace: this.settings.namespace,\n },\n }\n );\n\n const $entry = $(data.blockHtml);\n\n // Pause the element editor\n this.elementEditor?.pause();\n\n if ($insertBefore) {\n $entry.insertBefore($insertBefore);\n } else {\n $entry.appendTo(this.$entriesContainer);\n }\n\n this.trigger('entryAdded', {\n $entry: $entry,\n });\n\n // Animate the entry into position\n $entry.css(this.getHiddenEntryCss($entry)).velocity(\n {\n opacity: 1,\n 'margin-bottom': 10,\n },\n 'fast',\n async () => {\n $entry.css('margin-bottom', '');\n Craft.initUiElements($entry.children('.fields'));\n await Craft.appendHeadHtml(data.headHtml);\n await Craft.appendBodyHtml(data.bodyHtml);\n new Entry(this, $entry);\n this.entrySort.addItems($entry);\n this.entrySelect.addItems($entry);\n this.updateAddEntryBtn();\n\n Garnish.requestAnimationFrame(() => {\n if (typeof autofocus === 'undefined' || autofocus) {\n // Scroll to the entry\n Garnish.scrollContainerToElement($entry);\n // Focus on the first focusable element\n $entry.find('.flex-fields :focusable').first().trigger('focus');\n }\n\n // Resume the element editor\n this.elementEditor?.resume();\n });\n }\n );\n\n this.addingEntry = false;\n },\n\n getEntryTypeByHandle: function (handle) {\n for (let i = 0; i < this.entryTypes.length; i++) {\n if (this.entryTypes[i].handle === handle) {\n return this.entryTypes[i];\n }\n }\n },\n\n collapseSelectedEntries: function () {\n this.callOnSelectedEntries('collapse');\n },\n\n expandSelectedEntries: function () {\n this.callOnSelectedEntries('expand');\n },\n\n disableSelectedEntries: function () {\n this.callOnSelectedEntries('disable');\n },\n\n enableSelectedEntries: function () {\n this.callOnSelectedEntries('enable');\n },\n\n deleteSelectedEntries: function () {\n this.callOnSelectedEntries('selfDestruct');\n },\n\n callOnSelectedEntries: function (fn) {\n for (let i = 0; i < this.entrySelect.$selectedItems.length; i++) {\n this.entrySelect.$selectedItems.eq(i).data('entry')[fn]();\n }\n },\n\n getHiddenEntryCss: function ($entry) {\n return {\n opacity: 0,\n marginBottom: -$entry.outerHeight(),\n };\n },\n\n get maxEntries() {\n return this.settings.maxEntries;\n },\n },\n {\n defaults: {\n fieldId: null,\n maxEntries: null,\n namespace: null,\n baseInputName: null,\n ownerElementType: null,\n ownerId: null,\n siteId: null,\n staticEntries: false,\n },\n\n collapsedEntryStorageKey:\n 'Craft-' + Craft.systemUid + '.MatrixInput.collapsedEntries',\n\n getCollapsedEntryIds: function () {\n if (\n typeof localStorage[Craft.MatrixInput.collapsedEntryStorageKey] ===\n 'string'\n ) {\n return Craft.filterArray(\n localStorage[Craft.MatrixInput.collapsedEntryStorageKey].split(',')\n );\n } else {\n return [];\n }\n },\n\n setCollapsedEntryIds: function (ids) {\n localStorage[Craft.MatrixInput.collapsedEntryStorageKey] =\n ids.join(',');\n },\n\n rememberCollapsedEntryId: function (id) {\n if (typeof Storage !== 'undefined') {\n const collapsedEntries = Craft.MatrixInput.getCollapsedEntryIds();\n\n if ($.inArray('' + id, collapsedEntries) === -1) {\n collapsedEntries.push(id);\n Craft.MatrixInput.setCollapsedEntryIds(collapsedEntries);\n }\n }\n },\n\n forgetCollapsedEntryId: function (id) {\n if (typeof Storage !== 'undefined') {\n const collapsedEntries = Craft.MatrixInput.getCollapsedEntryIds();\n const collapsedEntriesIndex = $.inArray('' + id, collapsedEntries);\n\n if (collapsedEntriesIndex !== -1) {\n collapsedEntries.splice(collapsedEntriesIndex, 1);\n Craft.MatrixInput.setCollapsedEntryIds(collapsedEntries);\n }\n }\n },\n\n initTabs(container) {\n const $tabs = $(container).children('.pane-tabs');\n if (!$tabs.length) {\n return;\n }\n\n // init tab manager\n let tabManager = new Craft.Tabs($tabs);\n\n // prevent items in the disclosure menu from changing the URL\n let disclosureMenu = tabManager.$menuBtn.data('trigger');\n $(disclosureMenu.$container)\n .find('li, a')\n .on('click', function (ev) {\n ev.preventDefault();\n });\n\n tabManager.on('selectTab', (ev) => {\n const href = ev.$tab.attr('href');\n\n // Show its content area\n if (href && href.charAt(0) === '#') {\n $(href).removeClass('hidden');\n }\n\n // Trigger a resize event to update any UI components that are listening for it\n Garnish.$win.trigger('resize');\n\n // Fixes Redactor fixed toolbars on previously hidden panes\n Garnish.$doc.trigger('scroll');\n });\n\n tabManager.on('deselectTab', (ev) => {\n const href = ev.$tab.attr('href');\n if (href && href.charAt(0) === '#') {\n // Hide its content area\n $(ev.$tab.attr('href')).addClass('hidden');\n }\n });\n\n return tabManager;\n },\n }\n );\n\n const Entry = Garnish.Base.extend({\n /**\n * @type {Craft.MatrixInput}\n */\n matrix: null,\n $container: null,\n $titlebar: null,\n $tabContainer: null,\n $fieldsContainer: null,\n $previewContainer: null,\n $actionMenu: null,\n $collapsedInput: null,\n\n tabManager: null,\n actionDisclosure: null,\n formObserver: null,\n visibleLayoutElements: null,\n cancelToken: null,\n ignoreFailedRequest: false,\n\n isNew: null,\n id: null,\n\n collapsed: false,\n\n init: function (matrix, $container) {\n this.matrix = matrix;\n this.$container = $container;\n this.$titlebar = $container.children('.titlebar');\n this.$tabContainer = this.$titlebar.children('.matrixblock-tabs');\n this.$previewContainer = this.$titlebar.children('.preview');\n this.$fieldsContainer = $container.children('.fields');\n\n this.$container.data('entry', this);\n\n this.id = this.$container.data('id');\n this.isNew =\n !this.id ||\n (typeof this.id === 'string' && this.id.substring(0, 3) === 'new');\n\n if (this.$tabContainer.length) {\n this.tabManager = Craft.MatrixInput.initTabs(this.$tabContainer);\n }\n\n const $actionMenuBtn = this.$container.find('> .actions .action-btn');\n const actionDisclosure =\n $actionMenuBtn.data('trigger') ||\n new Garnish.DisclosureMenu($actionMenuBtn);\n\n this.$actionMenu = actionDisclosure.$container;\n this.actionDisclosure = actionDisclosure;\n\n actionDisclosure.on('show', () => {\n this.$container.addClass('active');\n if (this.$container.prev('.matrixblock').length) {\n this.$actionMenu\n .find('button[data-action=moveUp]:first')\n .parent()\n .removeClass('hidden');\n } else {\n this.$actionMenu\n .find('button[data-action=moveUp]:first')\n .parent()\n .addClass('hidden');\n }\n if (this.$container.next('.matrixblock').length) {\n this.$actionMenu\n .find('button[data-action=moveDown]:first')\n .parent()\n .removeClass('hidden');\n } else {\n this.$actionMenu\n .find('button[data-action=moveDown]:first')\n .parent()\n .addClass('hidden');\n }\n });\n\n actionDisclosure.on('hide', () => {\n this.$container.removeClass('active');\n });\n\n this.$actionMenuOptions = this.$actionMenu.find('button[data-action]');\n\n this.addListener(\n this.$actionMenuOptions,\n 'activate',\n this.handleActionClick\n );\n\n // Was this entry already collapsed?\n if (Garnish.hasAttr(this.$container, 'data-collapsed')) {\n this.collapse();\n }\n\n this._handleTitleBarClick = function (ev) {\n ev.preventDefault();\n this.toggle();\n };\n\n this.addListener(this.$titlebar, 'doubletap', this._handleTitleBarClick);\n\n this.visibleLayoutElements = this.$container.data(\n 'visible-layout-elements'\n );\n this.formObserver = new Craft.FormObserver(this.$container, (data) => {\n this.updateFieldLayout(data);\n });\n },\n\n toggle: function () {\n if (this.collapsed) {\n this.expand();\n } else {\n this.collapse(true);\n }\n },\n\n collapse: function (animate) {\n if (this.collapsed) {\n return;\n }\n\n this.$container.addClass('collapsed');\n\n let previewHtml = '';\n const $fields = this.$fieldsContainer.children().children();\n\n for (let i = 0; i < $fields.length; i++) {\n const $field = $($fields[i]);\n const $inputs = $field\n .children('.input')\n .find('select,input[type!=\"hidden\"],textarea,.label');\n let inputPreviewText = '';\n\n for (let j = 0; j < $inputs.length; j++) {\n const $input = $($inputs[j]);\n let value;\n\n if ($input.hasClass('label')) {\n const $maybeLightswitchContainer = $input.parent().parent();\n\n if (\n $maybeLightswitchContainer.hasClass('lightswitch') &&\n (($maybeLightswitchContainer.hasClass('on') &&\n $input.hasClass('off')) ||\n (!$maybeLightswitchContainer.hasClass('on') &&\n $input.hasClass('on')))\n ) {\n continue;\n }\n\n value = $input.text();\n } else {\n value = Craft.getText(this._inputPreviewText($input));\n }\n\n if (Array.isArray(value)) {\n value = value.join(', ');\n }\n\n if (value) {\n value = Craft.escapeHtml(value).trim();\n\n if (value) {\n if (inputPreviewText) {\n inputPreviewText += ', ';\n }\n\n inputPreviewText += value;\n }\n }\n }\n\n if (inputPreviewText) {\n previewHtml +=\n (previewHtml ? ' | ' : '') + inputPreviewText;\n }\n }\n\n this.$previewContainer.html(previewHtml);\n\n this.$fieldsContainer.velocity('stop');\n this.$container.velocity('stop');\n\n if (animate && !Garnish.prefersReducedMotion()) {\n this.$fieldsContainer.velocity('fadeOut', {duration: 'fast'});\n this.$container.velocity({height: 34}, 'fast');\n } else {\n this.$previewContainer.show();\n this.$fieldsContainer.hide();\n this.$container.css({height: 34});\n }\n\n this.$tabContainer.hide();\n\n setTimeout(() => {\n this.$actionMenu\n .find('button[data-action=collapse]:first')\n .parent()\n .addClass('hidden');\n this.$actionMenu\n .find('button[data-action=expand]:first')\n .parent()\n .removeClass('hidden');\n }, 200);\n\n // Remember that?\n if (!this.isNew) {\n Craft.MatrixInput.rememberCollapsedEntryId(this.id);\n } else {\n if (!this.$collapsedInput) {\n this.$collapsedInput = $(\n ''\n ).appendTo(this.$container);\n } else {\n this.$collapsedInput.val('1');\n }\n }\n\n this.collapsed = true;\n },\n\n _inputPreviewText: function ($input) {\n if ($input.is('select,multiselect')) {\n const labels = [];\n const $options = $input.find('option:selected');\n for (let k = 0; k < $options.length; k++) {\n labels.push($options.eq(k).text());\n }\n return labels;\n }\n\n if (\n $input.is('input[type=\"checkbox\"]:checked,input[type=\"radio\"]:checked')\n ) {\n const id = $input.attr('id');\n const $label = $(`label[for=\"${id}\"]`);\n if ($label.length) {\n return $label.text();\n }\n }\n\n return Garnish.getInputPostVal($input);\n },\n\n expand: function () {\n if (!this.collapsed) {\n return;\n }\n\n this.$container.removeClass('collapsed');\n\n this.$fieldsContainer.velocity('stop');\n this.$container.velocity('stop');\n\n const collapsedContainerHeight = this.$container.height();\n this.$container.height('auto');\n this.$fieldsContainer.show();\n const expandedContainerHeight = this.$container.height();\n const displayValue = this.$fieldsContainer.css('display') || 'block';\n this.$container.height(collapsedContainerHeight);\n this.$fieldsContainer\n .hide()\n .velocity('fadeIn', {duration: 'fast', display: displayValue});\n\n const animationDuration = Garnish.prefersReducedMotion() ? 0 : 'fast';\n this.$container.velocity(\n {height: expandedContainerHeight},\n animationDuration,\n () => {\n this.$previewContainer.html('');\n this.$container.height('auto');\n this.$container.trigger('scroll');\n this.$tabContainer.show();\n }\n );\n\n setTimeout(() => {\n this.$actionMenu\n .find('button[data-action=collapse]:first')\n .parent()\n .removeClass('hidden');\n this.$actionMenu\n .find('button[data-action=expand]:first')\n .parent()\n .addClass('hidden');\n }, 200);\n\n // Remember that?\n if (!this.isNew && typeof Storage !== 'undefined') {\n const collapsedEntries = Craft.MatrixInput.getCollapsedEntryIds();\n const collapsedEntriesIndex = $.inArray('' + this.id, collapsedEntries);\n\n if (collapsedEntriesIndex !== -1) {\n collapsedEntries.splice(collapsedEntriesIndex, 1);\n Craft.MatrixInput.setCollapsedEntryIds(collapsedEntries);\n }\n }\n\n if (!this.isNew) {\n Craft.MatrixInput.forgetCollapsedEntryId(this.id);\n } else if (this.$collapsedInput) {\n this.$collapsedInput.val('');\n }\n\n this.collapsed = false;\n },\n\n disable: function () {\n this.$container.children('input[name$=\"[enabled]\"]:first').val('');\n this.$container.addClass('disabled-entry');\n\n setTimeout(() => {\n this.$actionMenu\n .find('button[data-action=disable]:first')\n .parent()\n .addClass('hidden');\n this.$actionMenu\n .find('button[data-action=enable]:first')\n .parent()\n .removeClass('hidden');\n }, 200);\n\n this.collapse(true);\n },\n\n enable: function () {\n this.$container.children('input[name$=\"[enabled]\"]:first').val('1');\n this.$container.removeClass('disabled-entry');\n\n setTimeout(() => {\n this.$actionMenu\n .find('button[data-action=disable]:first')\n .parent()\n .removeClass('hidden');\n this.$actionMenu\n .find('button[data-action=enable]:first')\n .parent()\n .addClass('hidden');\n }, 200);\n },\n\n moveUp: function () {\n this.matrix.trigger('beforeMoveEntryUp', {\n entry: this,\n });\n let $prev = this.$container.prev('.matrixblock');\n if ($prev.length) {\n this.$container.insertBefore($prev);\n this.matrix.entrySelect.resetItemOrder();\n }\n this.matrix.trigger('moveEntryUp', {\n entry: this,\n });\n },\n\n moveDown: function () {\n this.matrix.trigger('beforeMoveEntryDown', {\n entry: this,\n });\n let $next = this.$container.next('.matrixblock');\n if ($next.length) {\n this.$container.insertAfter($next);\n this.matrix.entrySelect.resetItemOrder();\n }\n this.matrix.trigger('moveEntryDown', {\n entry: this,\n });\n },\n\n handleActionClick: function (event) {\n event.preventDefault();\n this.onActionSelect(event.target);\n },\n\n onActionSelect: function (option) {\n const batchAction =\n this.matrix.entrySelect.totalSelected > 1 &&\n this.matrix.entrySelect.isSelected(this.$container),\n $option = $(option);\n\n switch ($option.data('action')) {\n case 'collapse': {\n if (batchAction) {\n this.matrix.collapseSelectedEntries();\n } else {\n this.collapse(true);\n }\n\n break;\n }\n\n case 'expand': {\n if (batchAction) {\n this.matrix.expandSelectedEntries();\n } else {\n this.expand();\n }\n\n break;\n }\n\n case 'disable': {\n if (batchAction) {\n this.matrix.disableSelectedEntries();\n } else {\n this.disable();\n }\n\n break;\n }\n\n case 'enable': {\n if (batchAction) {\n this.matrix.enableSelectedEntries();\n } else {\n this.enable();\n this.expand();\n }\n\n break;\n }\n\n case 'moveUp': {\n this.moveUp();\n break;\n }\n\n case 'moveDown': {\n this.moveDown();\n break;\n }\n\n case 'add': {\n const type = $option.data('type');\n this.matrix.addEntry(type, this.$container);\n break;\n }\n\n case 'delete': {\n if (batchAction) {\n if (\n confirm(\n Craft.t(\n 'app',\n 'Are you sure you want to delete the selected entries?'\n )\n )\n ) {\n this.matrix.deleteSelectedEntries();\n }\n } else {\n this.selfDestruct();\n }\n\n break;\n }\n }\n\n this.actionDisclosure.hide();\n },\n\n selfDestruct: function () {\n // Remove any inputs from the form data\n $('[name]', this.$container).removeAttr('name');\n\n this.$container.velocity(\n this.matrix.getHiddenEntryCss(this.$container),\n 'fast',\n () => {\n this.$container.remove();\n this.matrix.updateAddEntryBtn();\n\n this.matrix.trigger('entryDeleted', {\n $entry: this.$container,\n });\n }\n );\n },\n\n updateFieldLayout(data) {\n return new Promise((resolve, reject) => {\n const elementEditor = this.matrix.elementEditor;\n const baseInputName = this.$container.data('base-input-name');\n\n // Ignore if we're already submitting the main form\n if (elementEditor?.submittingForm) {\n reject('Form already being submitted.');\n return;\n }\n\n if (this.cancelToken) {\n this.ignoreFailedRequest = true;\n this.cancelToken.cancel();\n }\n\n const param = (n) => Craft.namespaceInputName(n, baseInputName);\n const extraData = {\n [param('visibleLayoutElements')]: this.visibleLayoutElements,\n [param('elementType')]: 'craft\\\\elements\\\\Entry',\n [param('ownerId')]: this.matrix.settings.ownerId,\n [param('fieldId')]: this.matrix.settings.fieldId,\n [param('sortOrder')]: this.$container.index() + 1,\n [param('typeId')]: this.$container.data('type-id'),\n [param('elementUid')]: this.$container.data('uid'),\n };\n\n const selectedTabId = this.$fieldsContainer\n .children('[data-layout-tab]:not(.hidden)')\n .data('id');\n if (selectedTabId) {\n extraData[param('selectedTab')] = selectedTabId;\n }\n\n data += `&${$.param(extraData)}`;\n\n this.cancelToken = axios.CancelToken.source();\n\n Craft.sendActionRequest('POST', 'elements/update-field-layout', {\n cancelToken: this.cancelToken.token,\n headers: {\n 'content-type': 'application/x-www-form-urlencoded',\n 'X-Craft-Namespace': baseInputName,\n },\n data,\n })\n .then((response) => {\n this._afterUpdateFieldLayout(\n data,\n selectedTabId,\n baseInputName,\n response\n );\n resolve();\n })\n .catch((e) => {\n if (!this.ignoreFailedRequest) {\n reject(e);\n }\n this.ignoreFailedRequest = false;\n })\n .finally(() => {\n this.cancelToken = null;\n });\n });\n },\n\n async _afterUpdateFieldLayout(\n data,\n selectedTabId,\n baseInputName,\n response\n ) {\n // capture the new selected tab ID, in case it just changed\n const newSelectedTabId = this.$fieldsContainer\n .children('[data-layout-tab]:not(.hidden)')\n .data('id');\n\n // Update the visible elements\n let $allTabContainers = $();\n const visibleLayoutElements = {};\n let changedElements = false;\n\n for (const tabInfo of response.data.missingElements) {\n let $tabContainer = this.$fieldsContainer.children(\n `[data-layout-tab=\"${tabInfo.uid}\"]`\n );\n\n if (!$tabContainer.length) {\n $tabContainer = $('
', {\n id: Craft.namespaceId(tabInfo.id, baseInputName),\n class: 'flex-fields',\n 'data-id': tabInfo.id,\n 'data-layout-tab': tabInfo.uid,\n });\n if (tabInfo.id !== selectedTabId) {\n $tabContainer.addClass('hidden');\n }\n $tabContainer.appendTo(this.$fieldsContainer);\n }\n\n $allTabContainers = $allTabContainers.add($tabContainer);\n\n for (const elementInfo of tabInfo.elements) {\n if (elementInfo.html !== false) {\n if (!visibleLayoutElements[tabInfo.uid]) {\n visibleLayoutElements[tabInfo.uid] = [];\n }\n visibleLayoutElements[tabInfo.uid].push(elementInfo.uid);\n\n if (typeof elementInfo.html === 'string') {\n const $oldElement = $tabContainer.children(\n `[data-layout-element=\"${elementInfo.uid}\"]`\n );\n const $newElement = $(elementInfo.html);\n if ($oldElement.length) {\n $oldElement.replaceWith($newElement);\n } else {\n $newElement.appendTo($tabContainer);\n }\n Craft.initUiElements($newElement);\n changedElements = true;\n }\n } else {\n const $oldElement = $tabContainer.children(\n `[data-layout-element=\"${elementInfo.uid}\"]`\n );\n if (\n !$oldElement.length ||\n !Garnish.hasAttr($oldElement, 'data-layout-element-placeholder')\n ) {\n const $placeholder = $('
', {\n class: 'hidden',\n 'data-layout-element': elementInfo.uid,\n 'data-layout-element-placeholder': '',\n });\n\n if ($oldElement.length) {\n $oldElement.replaceWith($placeholder);\n } else {\n $placeholder.appendTo($tabContainer);\n }\n\n changedElements = true;\n }\n }\n }\n }\n\n // Remove any unused tab content containers\n // (`[data-layout-tab=\"\"]` == unconditional containers, so ignore those)\n const $unusedTabContainers = this.$fieldsContainer\n .children('[data-layout-tab]')\n .not($allTabContainers)\n .not('[data-layout-tab=\"\"]');\n if ($unusedTabContainers.length) {\n $unusedTabContainers.remove();\n changedElements = true;\n }\n\n // Make the first tab visible if no others are\n if (!$allTabContainers.filter(':not(.hidden)').length) {\n $allTabContainers.first().removeClass('hidden');\n }\n\n this.visibleLayoutElements = visibleLayoutElements;\n\n // Update the tabs\n if (this.tabManager) {\n this.tabManager.destroy();\n this.tabManager = null;\n this.$tabContainer.html('');\n }\n\n this.hasTabs = !!response.data.tabs;\n\n if (this.hasTabs) {\n this.$tabContainer.append(response.data.tabs);\n this.tabManager = Craft.MatrixInput.initTabs(this.$tabContainer);\n\n // was a new tab selected after the request was kicked off?\n if (\n selectedTabId &&\n newSelectedTabId &&\n selectedTabId !== newSelectedTabId\n ) {\n const $newSelectedTab = this.tabManager.$tabs.filter(\n `[data-id=\"${newSelectedTabId}\"]`\n );\n if ($newSelectedTab.length) {\n // if the new tab is visible - switch to it\n this.tabManager.selectTab($newSelectedTab);\n } else {\n // if the new tab is not visible (e.g. hidden by a condition)\n // switch to the first tab\n this.tabManager.selectTab(this.tabManager.$tabs.first());\n }\n }\n }\n\n await Craft.appendHeadHtml(response.data.headHtml);\n await Craft.appendBodyHtml(response.data.bodyHtml);\n\n // re-grab dismissible tips, re-attach listener, hide on re-load\n this.matrix.elementEditor?.handleDismissibleTips();\n },\n });\n})(jQuery);\n","var __WEBPACK_NAMESPACE_OBJECT__ = jQuery;"],"names":["_regeneratorRuntime","e","t","r","Object","prototype","n","hasOwnProperty","o","defineProperty","value","i","Symbol","a","iterator","c","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","wrap","Generator","create","Context","makeInvokeMethod","tryCatch","type","arg","call","h","l","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","p","d","getPrototypeOf","v","values","g","defineIteratorMethods","forEach","_invoke","AsyncIterator","invoke","_typeof","resolve","__await","then","callInvokeWithMethodAndArg","Error","done","method","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","return","TypeError","resultName","next","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","isNaN","length","displayName","isGeneratorFunction","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","keys","reverse","pop","prev","charAt","slice","stop","rval","handle","complete","finish","catch","delegateYield","asyncGeneratorStep","gen","reject","_next","_throw","key","info","error","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","jQuery","$","Craft","MatrixInput","Garnish","Base","extend","id","entryTypes","entryTypesByHandle","inputNamePrefix","inputIdPrefix","showingAddEntryMenu","addEntryBtnGroupWidth","addEntryBtnContainerWidth","$container","$form","$entriesContainer","$addEntryBtnContainer","$addEntryBtn","$addEntryMenuBtn","$statusMessage","entrySort","entrySelect","elementEditor","addingEntry","init","settings","_this","this","formatInputId","maxEntries","setSettings","defaults","closest","children","find","data","entryType","$entries","collapsedEntries","getCollapsedEntryIds","DragSort","axis","filter","$targetItem","hasClass","getSelectedItems","collapseDraggees","magnetStrength","helperLagBase","helperOpacity","onDragStop","trigger","onSortChange","resetItemOrder","Select","multi","vertical","target","checkboxMode","$entry","entry","Entry","inArray","collapse","addListener","_callee","_context","addClass","addEntry","removeClass","disclosureMenu","on","_ref2","_callee2","ev","_context2","currentTarget","_x","updateAddEntryBtn","setTimeout","ownerId","getDraftElementId","canAddMoreEntries","removeAttr","$items","eq","$actionMenu","parent","attr","updateStatusMessage","message","_this2","empty","text","$insertBefore","autofocus","_this3","_callee4","_this3$elementEditor","_yield$Craft$sendActi","_context4","setFormValue","baseInputName","sendActionRequest","fieldId","entryTypeId","ownerElementType","siteId","namespace","blockHtml","pause","insertBefore","appendTo","css","getHiddenEntryCss","velocity","opacity","_callee3","_context3","initUiElements","appendHeadHtml","headHtml","appendBodyHtml","bodyHtml","addItems","requestAnimationFrame","_this3$elementEditor2","scrollContainerToElement","first","resume","getEntryTypeByHandle","collapseSelectedEntries","callOnSelectedEntries","expandSelectedEntries","disableSelectedEntries","enableSelectedEntries","deleteSelectedEntries","$selectedItems","marginBottom","outerHeight","staticEntries","collapsedEntryStorageKey","systemUid","localStorage","filterArray","split","setCollapsedEntryIds","ids","join","rememberCollapsedEntryId","Storage","forgetCollapsedEntryId","collapsedEntriesIndex","splice","initTabs","container","$tabs","tabManager","Tabs","$menuBtn","preventDefault","href","$tab","$win","$doc","matrix","$titlebar","$tabContainer","$fieldsContainer","$previewContainer","$collapsedInput","actionDisclosure","formObserver","visibleLayoutElements","cancelToken","ignoreFailedRequest","isNew","collapsed","_this4","substring","$actionMenuBtn","DisclosureMenu","$actionMenuOptions","handleActionClick","hasAttr","_handleTitleBarClick","toggle","FormObserver","updateFieldLayout","expand","animate","_this5","previewHtml","$fields","$inputs","inputPreviewText","j","$input","$maybeLightswitchContainer","getText","_inputPreviewText","Array","isArray","escapeHtml","trim","html","prefersReducedMotion","duration","height","show","hide","val","is","labels","$options","k","$label","concat","getInputPostVal","_this6","collapsedContainerHeight","expandedContainerHeight","displayValue","display","animationDuration","disable","_this7","enable","_this8","moveUp","$prev","moveDown","$next","insertAfter","event","onActionSelect","option","batchAction","totalSelected","isSelected","$option","confirm","selfDestruct","_this9","remove","_this10","submittingForm","cancel","param","namespaceInputName","extraData","_defineProperty","index","selectedTabId","axios","CancelToken","source","token","headers","response","_afterUpdateFieldLayout","finally","_this11","_callee5","_this11$matrix$elemen","newSelectedTabId","$allTabContainers","_iterator","_step","tabInfo","_iterator2","_step2","elementInfo","$oldElement","$newElement","_$oldElement","$placeholder","$unusedTabContainers","$newSelectedTab","_context5","_createForOfIteratorHelper","missingElements","uid","namespaceId","class","add","elements","replaceWith","not","destroy","hasTabs","tabs","append","selectTab","handleDismissibleTips"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"MatrixInput.js","mappings":";opDACAA,EAAA,kBAAAC,CAAA,MAAAC,EAAAD,EAAA,GAAAE,EAAAC,OAAAC,UAAAC,EAAAH,EAAAI,eAAAC,EAAAJ,OAAAK,gBAAA,SAAAP,EAAAD,EAAAE,GAAAD,EAAAD,GAAAE,EAAAO,KAAA,EAAAC,EAAA,mBAAAC,OAAAA,OAAA,GAAAC,EAAAF,EAAAG,UAAA,aAAAC,EAAAJ,EAAAK,eAAA,kBAAAC,EAAAN,EAAAO,aAAA,yBAAAC,EAAAjB,EAAAD,EAAAE,GAAA,OAAAC,OAAAK,eAAAP,EAAAD,EAAA,CAAAS,MAAAP,EAAAiB,YAAA,EAAAC,cAAA,EAAAC,UAAA,IAAApB,EAAAD,EAAA,KAAAkB,EAAA,aAAAjB,GAAAiB,EAAA,SAAAjB,EAAAD,EAAAE,GAAA,O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GACJsB,IAAI,yBACkB1U,QACvB+T,EAAqBjC,SAKlBsB,EAAkBhO,OAAO,iBAAiBpF,QAC7CoT,EAAkB1I,QAAQ3D,YAAY,UAGxCiM,EAAKzF,sBAAwBA,EAGzByF,EAAKzG,aACPyG,EAAKzG,WAAWoI,UAChB3B,EAAKzG,WAAa,KAClByG,EAAK/F,cAAcsC,KAAK,KAG1ByD,EAAK4B,UAAY/B,EAAShO,KAAKgQ,KAE3B7B,EAAK4B,UACP5B,EAAK/F,cAAc6H,OAAOjC,EAAShO,KAAKgQ,MACxC7B,EAAKzG,WAAa7J,MAAMC,YAAYyJ,SAAS4G,EAAK/F,eAIhDsF,GACAY,GACAZ,IAAkBY,KAEZa,EAAkBhB,EAAKzG,WAAWD,MAAMlH,OAAO,aAAD+K,OACrCgD,EAAgB,QAEXnT,OAElBgT,EAAKzG,WAAWwI,UAAUf,GAI1BhB,EAAKzG,WAAWwI,UAAU/B,EAAKzG,WAAWD,MAAM5B,WAGrDuJ,EAAA9U,KAAA,GAEKuD,MAAMwH,eAAe2I,EAAShO,KAAKsF,UAAS,eAAA8J,EAAA9U,KAAA,GAC5CuD,MAAM0H,eAAeyI,EAAShO,KAAKwF,UAAS,QAGzB,QAAzB6I,EAAAF,EAAKjG,OAAO/I,qBAAa,IAAAkP,GAAzBA,EAA2B8B,wBAAwB,yBAAAf,EAAAhT,OAAA,GAAAgS,EAAA,IApInDjR,EAqIF,GAEH,CA1nCD,CA0nCGQ","sources":["webpack:///./MatrixInput.js","webpack:///external var \"jQuery\""],"sourcesContent":["import $ from 'jquery';\n\n(function ($) {\n /** global: Craft */\n /** global: Garnish */\n /**\n * Matrix input class\n */\n Craft.MatrixInput = Garnish.Base.extend(\n {\n id: null,\n entryTypes: null,\n entryTypesByHandle: null,\n inputNamePrefix: null,\n inputIdPrefix: null,\n\n showingAddEntryMenu: false,\n addEntryBtnGroupWidth: null,\n addEntryBtnContainerWidth: null,\n\n $container: null,\n $form: null,\n $entriesContainer: null,\n $addEntryBtnContainer: null,\n $addEntryBtn: null,\n $addEntryMenuBtn: null,\n $statusMessage: null,\n\n entrySort: null,\n entrySelect: null,\n\n /**\n * @type {Craft.ElementEditor|null}\n */\n elementEditor: null,\n\n addingEntry: false,\n\n init: function (id, entryTypes, inputNamePrefix, settings) {\n this.id = id;\n this.entryTypes = entryTypes;\n this.inputNamePrefix = inputNamePrefix;\n this.inputIdPrefix = Craft.formatInputId(this.inputNamePrefix);\n\n // see if settings was actually set to the maxEntries value\n if (typeof settings === 'number') {\n settings = {maxEntries: settings};\n }\n this.setSettings(settings, Craft.MatrixInput.defaults);\n\n this.$container = $('#' + this.id);\n this.$form = this.$container.closest('form');\n this.$entriesContainer = this.$container.children('.blocks');\n this.$addEntryBtnContainer = this.$container.children('.buttons');\n this.$addEntryBtn =\n this.$addEntryBtnContainer.children('.btn:not(.menubtn)');\n this.$addEntryMenuBtn = this.$addEntryBtnContainer.children('.menubtn');\n this.$statusMessage = this.$container.find('[data-status-message]');\n\n this.$container.data('matrix', this);\n\n this.entryTypesByHandle = {};\n\n for (let i = 0; i < this.entryTypes.length; i++) {\n const entryType = this.entryTypes[i];\n this.entryTypesByHandle[entryType.handle] = entryType;\n }\n\n const $entries = this.$entriesContainer.children('.matrixblock');\n const collapsedEntries = Craft.MatrixInput.getCollapsedEntryIds();\n\n this.entrySort = new Garnish.DragSort($entries, {\n handle: '> .actions > .move',\n axis: 'y',\n filter: () => {\n // Only return all the selected items if the target item is selected\n if (this.entrySort.$targetItem.hasClass('sel')) {\n return this.entrySelect.getSelectedItems();\n } else {\n return this.entrySort.$targetItem;\n }\n },\n collapseDraggees: true,\n magnetStrength: 4,\n helperLagBase: 1.5,\n helperOpacity: 0.9,\n onDragStop: () => {\n this.trigger('entrySortDragStop');\n },\n onSortChange: () => {\n this.entrySelect.resetItemOrder();\n },\n });\n\n this.entrySelect = new Garnish.Select(\n this.$entriesContainer,\n $entries,\n {\n multi: true,\n vertical: true,\n handle: '> .actions > .checkbox, > .titlebar',\n filter: (target) => {\n return !$(target).closest('.tab-label').length;\n },\n checkboxMode: true,\n }\n );\n\n for (let i = 0; i < $entries.length; i++) {\n const $entry = $($entries[i]);\n const entry = new Entry(this, $entry);\n\n if (entry.id && $.inArray('' + entry.id, collapsedEntries) !== -1) {\n entry.collapse();\n }\n }\n\n this.addListener(this.$addEntryBtn, 'activate', async function () {\n this.$addEntryBtn.addClass('loading');\n try {\n await this.addEntry(this.$addEntryBtn.data('type'));\n } finally {\n this.$addEntryBtn.removeClass('loading');\n }\n });\n\n if (this.$addEntryMenuBtn.length) {\n this.$addEntryMenuBtn\n .disclosureMenu()\n .data('disclosureMenu')\n .$container.find('button')\n .on('activate', async (ev) => {\n this.$addEntryMenuBtn.addClass('loading');\n try {\n await this.addEntry($(ev.currentTarget).data('type'));\n } finally {\n this.$addEntryMenuBtn.removeClass('loading');\n }\n });\n }\n\n this.updateAddEntryBtn();\n\n setTimeout(() => {\n this.elementEditor = this.$container\n .closest('form')\n .data('elementEditor');\n\n if (this.elementEditor) {\n this.elementEditor.on('update', () => {\n this.settings.ownerId = this.elementEditor.getDraftElementId(\n this.settings.ownerId\n );\n });\n }\n\n this.trigger('afterInit');\n }, 100);\n },\n\n canAddMoreEntries: function () {\n return (\n !this.maxEntries ||\n this.$entriesContainer.children().length < this.maxEntries\n );\n },\n\n updateAddEntryBtn: function () {\n if (this.canAddMoreEntries()) {\n this.$addEntryBtn.removeClass('disabled').removeAttr('aria-disabled');\n this.$addEntryMenuBtn.removeClass('disabled');\n\n for (let i = 0; i < this.entrySelect.$items.length; i++) {\n const entry = this.entrySelect.$items.eq(i).data('entry');\n\n if (entry) {\n entry.$actionMenu\n .find('button[data-action=add]')\n .parent()\n .removeClass('disabled');\n entry.$actionMenu\n .find('button[data-action=add]')\n .removeAttr('aria-disabled');\n }\n }\n } else {\n this.$addEntryBtn.addClass('disabled').attr('aria-disabled', 'true');\n this.$addEntryMenuBtn.addClass('disabled');\n\n for (let i = 0; i < this.entrySelect.$items.length; i++) {\n const entry = this.entrySelect.$items.eq(i).data('entry');\n\n if (entry) {\n entry.$actionMenu\n .find('button[data-action=add]')\n .parent()\n .addClass('disabled');\n entry.$actionMenu\n .find('button[data-action=add]')\n .attr('aria-disabled', 'true');\n }\n }\n }\n },\n\n updateStatusMessage: function () {\n this.$statusMessage.empty();\n let message;\n\n if (!this.canAddMoreEntries()) {\n message = Craft.t(\n 'app',\n 'Entry could not be added. Maximum number of entries reached.'\n );\n }\n\n setTimeout(() => {\n this.$statusMessage.text(message);\n }, 250);\n },\n\n async addEntry(type, $insertBefore, autofocus) {\n if (this.addingEntry) {\n // only one new entry at a time\n return;\n }\n\n if (!this.canAddMoreEntries()) {\n this.updateStatusMessage();\n return;\n }\n\n this.addingEntry = true;\n\n if (this.elementEditor) {\n // First ensure we're working with drafts for all elements leading up\n // to this field’s element\n await this.elementEditor.setFormValue(\n this.settings.baseInputName,\n '*'\n );\n }\n\n const {data} = await Craft.sendActionRequest(\n 'POST',\n 'matrix/create-entry',\n {\n data: {\n fieldId: this.settings.fieldId,\n entryTypeId: this.entryTypesByHandle[type].id,\n ownerId: this.settings.ownerId,\n ownerElementType: this.settings.ownerElementType,\n siteId: this.settings.siteId,\n namespace: this.settings.namespace,\n },\n }\n );\n\n const $entry = $(data.blockHtml);\n\n // Pause the element editor\n this.elementEditor?.pause();\n\n if ($insertBefore) {\n $entry.insertBefore($insertBefore);\n } else {\n $entry.appendTo(this.$entriesContainer);\n }\n\n this.trigger('entryAdded', {\n $entry: $entry,\n });\n\n // Animate the entry into position\n $entry.css(this.getHiddenEntryCss($entry)).velocity(\n {\n opacity: 1,\n 'margin-bottom': 10,\n },\n 'fast',\n async () => {\n $entry.css('margin-bottom', '');\n Craft.initUiElements($entry.children('.fields'));\n await Craft.appendHeadHtml(data.headHtml);\n await Craft.appendBodyHtml(data.bodyHtml);\n new Entry(this, $entry);\n this.entrySort.addItems($entry);\n this.entrySelect.addItems($entry);\n this.updateAddEntryBtn();\n\n Garnish.requestAnimationFrame(() => {\n if (typeof autofocus === 'undefined' || autofocus) {\n // Scroll to the entry\n Garnish.scrollContainerToElement($entry);\n // Focus on the first focusable element\n $entry.find('.flex-fields :focusable').first().trigger('focus');\n }\n\n // Resume the element editor\n this.elementEditor?.resume();\n });\n }\n );\n\n this.addingEntry = false;\n },\n\n getEntryTypeByHandle: function (handle) {\n for (let i = 0; i < this.entryTypes.length; i++) {\n if (this.entryTypes[i].handle === handle) {\n return this.entryTypes[i];\n }\n }\n },\n\n collapseSelectedEntries: function () {\n this.callOnSelectedEntries('collapse');\n },\n\n expandSelectedEntries: function () {\n this.callOnSelectedEntries('expand');\n },\n\n disableSelectedEntries: function () {\n this.callOnSelectedEntries('disable');\n },\n\n enableSelectedEntries: function () {\n this.callOnSelectedEntries('enable');\n },\n\n deleteSelectedEntries: function () {\n this.callOnSelectedEntries('selfDestruct');\n },\n\n callOnSelectedEntries: function (fn) {\n for (let i = 0; i < this.entrySelect.$selectedItems.length; i++) {\n this.entrySelect.$selectedItems.eq(i).data('entry')[fn]();\n }\n },\n\n getHiddenEntryCss: function ($entry) {\n return {\n opacity: 0,\n marginBottom: -$entry.outerHeight(),\n };\n },\n\n get maxEntries() {\n return this.settings.maxEntries;\n },\n },\n {\n defaults: {\n fieldId: null,\n maxEntries: null,\n namespace: null,\n baseInputName: null,\n ownerElementType: null,\n ownerId: null,\n siteId: null,\n staticEntries: false,\n },\n\n collapsedEntryStorageKey:\n 'Craft-' + Craft.systemUid + '.MatrixInput.collapsedEntries',\n\n getCollapsedEntryIds: function () {\n if (\n typeof localStorage[Craft.MatrixInput.collapsedEntryStorageKey] ===\n 'string'\n ) {\n return Craft.filterArray(\n localStorage[Craft.MatrixInput.collapsedEntryStorageKey].split(',')\n );\n } else {\n return [];\n }\n },\n\n setCollapsedEntryIds: function (ids) {\n localStorage[Craft.MatrixInput.collapsedEntryStorageKey] =\n ids.join(',');\n },\n\n rememberCollapsedEntryId: function (id) {\n if (typeof Storage !== 'undefined') {\n const collapsedEntries = Craft.MatrixInput.getCollapsedEntryIds();\n\n if ($.inArray('' + id, collapsedEntries) === -1) {\n collapsedEntries.push(id);\n Craft.MatrixInput.setCollapsedEntryIds(collapsedEntries);\n }\n }\n },\n\n forgetCollapsedEntryId: function (id) {\n if (typeof Storage !== 'undefined') {\n const collapsedEntries = Craft.MatrixInput.getCollapsedEntryIds();\n const collapsedEntriesIndex = $.inArray('' + id, collapsedEntries);\n\n if (collapsedEntriesIndex !== -1) {\n collapsedEntries.splice(collapsedEntriesIndex, 1);\n Craft.MatrixInput.setCollapsedEntryIds(collapsedEntries);\n }\n }\n },\n\n initTabs(container) {\n const $tabs = $(container).children('.pane-tabs');\n if (!$tabs.length) {\n return;\n }\n\n // init tab manager\n let tabManager = new Craft.Tabs($tabs);\n\n // prevent items in the disclosure menu from changing the URL\n let disclosureMenu = tabManager.$menuBtn.data('trigger');\n $(disclosureMenu.$container)\n .find('li, a')\n .on('click', function (ev) {\n ev.preventDefault();\n });\n\n tabManager.on('selectTab', (ev) => {\n const href = ev.$tab.attr('href');\n\n // Show its content area\n if (href && href.charAt(0) === '#') {\n $(href).removeClass('hidden');\n }\n\n // Trigger a resize event to update any UI components that are listening for it\n Garnish.$win.trigger('resize');\n\n // Fixes Redactor fixed toolbars on previously hidden panes\n Garnish.$doc.trigger('scroll');\n });\n\n tabManager.on('deselectTab', (ev) => {\n const href = ev.$tab.attr('href');\n if (href && href.charAt(0) === '#') {\n // Hide its content area\n $(ev.$tab.attr('href')).addClass('hidden');\n }\n });\n\n return tabManager;\n },\n }\n );\n\n const Entry = Garnish.Base.extend({\n /**\n * @type {Craft.MatrixInput}\n */\n matrix: null,\n $container: null,\n $titlebar: null,\n $tabContainer: null,\n $fieldsContainer: null,\n $previewContainer: null,\n $actionMenu: null,\n $collapsedInput: null,\n\n tabManager: null,\n actionDisclosure: null,\n formObserver: null,\n visibleLayoutElements: null,\n cancelToken: null,\n ignoreFailedRequest: false,\n\n isNew: null,\n id: null,\n\n collapsed: false,\n\n init: function (matrix, $container) {\n this.matrix = matrix;\n this.$container = $container;\n this.$titlebar = $container.children('.titlebar');\n this.$tabContainer = this.$titlebar.children('.matrixblock-tabs');\n this.$previewContainer = this.$titlebar.children('.preview');\n this.$fieldsContainer = $container.children('.fields');\n\n this.$container.data('entry', this);\n\n this.id = this.$container.data('id');\n this.isNew =\n !this.id ||\n (typeof this.id === 'string' && this.id.substring(0, 3) === 'new');\n\n if (this.$tabContainer.length) {\n this.tabManager = Craft.MatrixInput.initTabs(this.$tabContainer);\n }\n\n const $actionMenuBtn = this.$container.find('> .actions .action-btn');\n const actionDisclosure =\n $actionMenuBtn.data('trigger') ||\n new Garnish.DisclosureMenu($actionMenuBtn);\n\n this.$actionMenu = actionDisclosure.$container;\n this.actionDisclosure = actionDisclosure;\n\n actionDisclosure.on('show', () => {\n this.$container.addClass('active');\n if (this.$container.prev('.matrixblock').length) {\n this.$actionMenu\n .find('button[data-action=moveUp]:first')\n .parent()\n .removeClass('hidden');\n } else {\n this.$actionMenu\n .find('button[data-action=moveUp]:first')\n .parent()\n .addClass('hidden');\n }\n if (this.$container.next('.matrixblock').length) {\n this.$actionMenu\n .find('button[data-action=moveDown]:first')\n .parent()\n .removeClass('hidden');\n } else {\n this.$actionMenu\n .find('button[data-action=moveDown]:first')\n .parent()\n .addClass('hidden');\n }\n });\n\n actionDisclosure.on('hide', () => {\n this.$container.removeClass('active');\n });\n\n this.$actionMenuOptions = this.$actionMenu.find('button[data-action]');\n\n this.addListener(\n this.$actionMenuOptions,\n 'activate',\n this.handleActionClick\n );\n\n // Was this entry already collapsed?\n if (Garnish.hasAttr(this.$container, 'data-collapsed')) {\n this.collapse();\n }\n\n this._handleTitleBarClick = function (ev) {\n // don't expand/collapse the matrix \"block\" if double tapping the tabs\n if (!$(ev.target).closest('.tab-label').length) {\n ev.preventDefault();\n this.toggle();\n }\n };\n\n this.addListener(this.$titlebar, 'doubletap', this._handleTitleBarClick);\n\n this.visibleLayoutElements = this.$container.data(\n 'visible-layout-elements'\n );\n this.formObserver = new Craft.FormObserver(this.$container, (data) => {\n this.updateFieldLayout(data);\n });\n },\n\n toggle: function () {\n if (this.collapsed) {\n this.expand();\n } else {\n this.collapse(true);\n }\n },\n\n collapse: function (animate) {\n if (this.collapsed) {\n return;\n }\n\n this.$container.addClass('collapsed');\n\n let previewHtml = '';\n const $fields = this.$fieldsContainer.children().children();\n\n for (let i = 0; i < $fields.length; i++) {\n const $field = $($fields[i]);\n const $inputs = $field\n .children('.input')\n .find('select,input[type!=\"hidden\"],textarea,.label');\n let inputPreviewText = '';\n\n for (let j = 0; j < $inputs.length; j++) {\n const $input = $($inputs[j]);\n let value;\n\n if ($input.hasClass('label')) {\n const $maybeLightswitchContainer = $input.parent().parent();\n\n if (\n $maybeLightswitchContainer.hasClass('lightswitch') &&\n (($maybeLightswitchContainer.hasClass('on') &&\n $input.hasClass('off')) ||\n (!$maybeLightswitchContainer.hasClass('on') &&\n $input.hasClass('on')))\n ) {\n continue;\n }\n\n value = $input.text();\n } else {\n value = Craft.getText(this._inputPreviewText($input));\n }\n\n if (Array.isArray(value)) {\n value = value.join(', ');\n }\n\n if (value) {\n value = Craft.escapeHtml(value).trim();\n\n if (value) {\n if (inputPreviewText) {\n inputPreviewText += ', ';\n }\n\n inputPreviewText += value;\n }\n }\n }\n\n if (inputPreviewText) {\n previewHtml +=\n (previewHtml ? ' | ' : '') + inputPreviewText;\n }\n }\n\n this.$previewContainer.html(previewHtml);\n\n this.$fieldsContainer.velocity('stop');\n this.$container.velocity('stop');\n\n if (animate && !Garnish.prefersReducedMotion()) {\n this.$fieldsContainer.velocity('fadeOut', {duration: 'fast'});\n this.$container.velocity({height: 34}, 'fast');\n } else {\n this.$previewContainer.show();\n this.$fieldsContainer.hide();\n this.$container.css({height: 34});\n }\n\n this.$tabContainer.hide();\n\n setTimeout(() => {\n this.$actionMenu\n .find('button[data-action=collapse]:first')\n .parent()\n .addClass('hidden');\n this.$actionMenu\n .find('button[data-action=expand]:first')\n .parent()\n .removeClass('hidden');\n }, 200);\n\n // Remember that?\n if (!this.isNew) {\n Craft.MatrixInput.rememberCollapsedEntryId(this.id);\n } else {\n if (!this.$collapsedInput) {\n this.$collapsedInput = $(\n ''\n ).appendTo(this.$container);\n } else {\n this.$collapsedInput.val('1');\n }\n }\n\n this.collapsed = true;\n },\n\n _inputPreviewText: function ($input) {\n if ($input.is('select,multiselect')) {\n const labels = [];\n const $options = $input.find('option:selected');\n for (let k = 0; k < $options.length; k++) {\n labels.push($options.eq(k).text());\n }\n return labels;\n }\n\n if (\n $input.is('input[type=\"checkbox\"]:checked,input[type=\"radio\"]:checked')\n ) {\n const id = $input.attr('id');\n const $label = $(`label[for=\"${id}\"]`);\n if ($label.length) {\n return $label.text();\n }\n }\n\n return Garnish.getInputPostVal($input);\n },\n\n expand: function () {\n if (!this.collapsed) {\n return;\n }\n\n this.$container.removeClass('collapsed');\n\n this.$fieldsContainer.velocity('stop');\n this.$container.velocity('stop');\n\n const collapsedContainerHeight = this.$container.height();\n this.$container.height('auto');\n this.$fieldsContainer.show();\n const expandedContainerHeight = this.$container.height();\n const displayValue = this.$fieldsContainer.css('display') || 'block';\n this.$container.height(collapsedContainerHeight);\n this.$fieldsContainer\n .hide()\n .velocity('fadeIn', {duration: 'fast', display: displayValue});\n\n const animationDuration = Garnish.prefersReducedMotion() ? 0 : 'fast';\n this.$container.velocity(\n {height: expandedContainerHeight},\n animationDuration,\n () => {\n this.$previewContainer.html('');\n this.$container.height('auto');\n this.$container.trigger('scroll');\n this.$tabContainer.show();\n }\n );\n\n setTimeout(() => {\n this.$actionMenu\n .find('button[data-action=collapse]:first')\n .parent()\n .removeClass('hidden');\n this.$actionMenu\n .find('button[data-action=expand]:first')\n .parent()\n .addClass('hidden');\n }, 200);\n\n // Remember that?\n if (!this.isNew && typeof Storage !== 'undefined') {\n const collapsedEntries = Craft.MatrixInput.getCollapsedEntryIds();\n const collapsedEntriesIndex = $.inArray('' + this.id, collapsedEntries);\n\n if (collapsedEntriesIndex !== -1) {\n collapsedEntries.splice(collapsedEntriesIndex, 1);\n Craft.MatrixInput.setCollapsedEntryIds(collapsedEntries);\n }\n }\n\n if (!this.isNew) {\n Craft.MatrixInput.forgetCollapsedEntryId(this.id);\n } else if (this.$collapsedInput) {\n this.$collapsedInput.val('');\n }\n\n this.collapsed = false;\n },\n\n disable: function () {\n this.$container.children('input[name$=\"[enabled]\"]:first').val('');\n this.$container.addClass('disabled-entry');\n\n setTimeout(() => {\n this.$actionMenu\n .find('button[data-action=disable]:first')\n .parent()\n .addClass('hidden');\n this.$actionMenu\n .find('button[data-action=enable]:first')\n .parent()\n .removeClass('hidden');\n }, 200);\n\n this.collapse(true);\n },\n\n enable: function () {\n this.$container.children('input[name$=\"[enabled]\"]:first').val('1');\n this.$container.removeClass('disabled-entry');\n\n setTimeout(() => {\n this.$actionMenu\n .find('button[data-action=disable]:first')\n .parent()\n .removeClass('hidden');\n this.$actionMenu\n .find('button[data-action=enable]:first')\n .parent()\n .addClass('hidden');\n }, 200);\n },\n\n moveUp: function () {\n this.matrix.trigger('beforeMoveEntryUp', {\n entry: this,\n });\n let $prev = this.$container.prev('.matrixblock');\n if ($prev.length) {\n this.$container.insertBefore($prev);\n this.matrix.entrySelect.resetItemOrder();\n }\n this.matrix.trigger('moveEntryUp', {\n entry: this,\n });\n },\n\n moveDown: function () {\n this.matrix.trigger('beforeMoveEntryDown', {\n entry: this,\n });\n let $next = this.$container.next('.matrixblock');\n if ($next.length) {\n this.$container.insertAfter($next);\n this.matrix.entrySelect.resetItemOrder();\n }\n this.matrix.trigger('moveEntryDown', {\n entry: this,\n });\n },\n\n handleActionClick: function (event) {\n event.preventDefault();\n this.onActionSelect(event.target);\n },\n\n onActionSelect: function (option) {\n const batchAction =\n this.matrix.entrySelect.totalSelected > 1 &&\n this.matrix.entrySelect.isSelected(this.$container),\n $option = $(option);\n\n switch ($option.data('action')) {\n case 'collapse': {\n if (batchAction) {\n this.matrix.collapseSelectedEntries();\n } else {\n this.collapse(true);\n }\n\n break;\n }\n\n case 'expand': {\n if (batchAction) {\n this.matrix.expandSelectedEntries();\n } else {\n this.expand();\n }\n\n break;\n }\n\n case 'disable': {\n if (batchAction) {\n this.matrix.disableSelectedEntries();\n } else {\n this.disable();\n }\n\n break;\n }\n\n case 'enable': {\n if (batchAction) {\n this.matrix.enableSelectedEntries();\n } else {\n this.enable();\n this.expand();\n }\n\n break;\n }\n\n case 'moveUp': {\n this.moveUp();\n break;\n }\n\n case 'moveDown': {\n this.moveDown();\n break;\n }\n\n case 'add': {\n const type = $option.data('type');\n this.matrix.addEntry(type, this.$container);\n break;\n }\n\n case 'delete': {\n if (batchAction) {\n if (\n confirm(\n Craft.t(\n 'app',\n 'Are you sure you want to delete the selected entries?'\n )\n )\n ) {\n this.matrix.deleteSelectedEntries();\n }\n } else {\n this.selfDestruct();\n }\n\n break;\n }\n }\n\n this.actionDisclosure.hide();\n },\n\n selfDestruct: function () {\n // Remove any inputs from the form data\n $('[name]', this.$container).removeAttr('name');\n\n this.$container.velocity(\n this.matrix.getHiddenEntryCss(this.$container),\n 'fast',\n () => {\n this.$container.remove();\n this.matrix.updateAddEntryBtn();\n\n this.matrix.trigger('entryDeleted', {\n $entry: this.$container,\n });\n }\n );\n },\n\n updateFieldLayout(data) {\n return new Promise((resolve, reject) => {\n const elementEditor = this.matrix.elementEditor;\n const baseInputName = this.$container.data('base-input-name');\n\n // Ignore if we're already submitting the main form\n if (elementEditor?.submittingForm) {\n reject('Form already being submitted.');\n return;\n }\n\n if (this.cancelToken) {\n this.ignoreFailedRequest = true;\n this.cancelToken.cancel();\n }\n\n const param = (n) => Craft.namespaceInputName(n, baseInputName);\n const extraData = {\n [param('visibleLayoutElements')]: this.visibleLayoutElements,\n [param('elementType')]: 'craft\\\\elements\\\\Entry',\n [param('ownerId')]: this.matrix.settings.ownerId,\n [param('fieldId')]: this.matrix.settings.fieldId,\n [param('sortOrder')]: this.$container.index() + 1,\n [param('typeId')]: this.$container.data('type-id'),\n [param('elementUid')]: this.$container.data('uid'),\n };\n\n const selectedTabId = this.$fieldsContainer\n .children('[data-layout-tab]:not(.hidden)')\n .data('id');\n if (selectedTabId) {\n extraData[param('selectedTab')] = selectedTabId;\n }\n\n data += `&${$.param(extraData)}`;\n\n this.cancelToken = axios.CancelToken.source();\n\n Craft.sendActionRequest('POST', 'elements/update-field-layout', {\n cancelToken: this.cancelToken.token,\n headers: {\n 'content-type': 'application/x-www-form-urlencoded',\n 'X-Craft-Namespace': baseInputName,\n },\n data,\n })\n .then((response) => {\n this._afterUpdateFieldLayout(\n data,\n selectedTabId,\n baseInputName,\n response\n );\n resolve();\n })\n .catch((e) => {\n if (!this.ignoreFailedRequest) {\n reject(e);\n }\n this.ignoreFailedRequest = false;\n })\n .finally(() => {\n this.cancelToken = null;\n });\n });\n },\n\n async _afterUpdateFieldLayout(\n data,\n selectedTabId,\n baseInputName,\n response\n ) {\n // capture the new selected tab ID, in case it just changed\n const newSelectedTabId = this.$fieldsContainer\n .children('[data-layout-tab]:not(.hidden)')\n .data('id');\n\n // Update the visible elements\n let $allTabContainers = $();\n const visibleLayoutElements = {};\n let changedElements = false;\n\n for (const tabInfo of response.data.missingElements) {\n let $tabContainer = this.$fieldsContainer.children(\n `[data-layout-tab=\"${tabInfo.uid}\"]`\n );\n\n if (!$tabContainer.length) {\n $tabContainer = $('
', {\n id: Craft.namespaceId(tabInfo.id, baseInputName),\n class: 'flex-fields',\n 'data-id': tabInfo.id,\n 'data-layout-tab': tabInfo.uid,\n });\n if (tabInfo.id !== selectedTabId) {\n $tabContainer.addClass('hidden');\n }\n $tabContainer.appendTo(this.$fieldsContainer);\n }\n\n $allTabContainers = $allTabContainers.add($tabContainer);\n\n for (const elementInfo of tabInfo.elements) {\n if (elementInfo.html !== false) {\n if (!visibleLayoutElements[tabInfo.uid]) {\n visibleLayoutElements[tabInfo.uid] = [];\n }\n visibleLayoutElements[tabInfo.uid].push(elementInfo.uid);\n\n if (typeof elementInfo.html === 'string') {\n const $oldElement = $tabContainer.children(\n `[data-layout-element=\"${elementInfo.uid}\"]`\n );\n const $newElement = $(elementInfo.html);\n if ($oldElement.length) {\n $oldElement.replaceWith($newElement);\n } else {\n $newElement.appendTo($tabContainer);\n }\n Craft.initUiElements($newElement);\n changedElements = true;\n }\n } else {\n const $oldElement = $tabContainer.children(\n `[data-layout-element=\"${elementInfo.uid}\"]`\n );\n if (\n !$oldElement.length ||\n !Garnish.hasAttr($oldElement, 'data-layout-element-placeholder')\n ) {\n const $placeholder = $('
', {\n class: 'hidden',\n 'data-layout-element': elementInfo.uid,\n 'data-layout-element-placeholder': '',\n });\n\n if ($oldElement.length) {\n $oldElement.replaceWith($placeholder);\n } else {\n $placeholder.appendTo($tabContainer);\n }\n\n changedElements = true;\n }\n }\n }\n }\n\n // Remove any unused tab content containers\n // (`[data-layout-tab=\"\"]` == unconditional containers, so ignore those)\n const $unusedTabContainers = this.$fieldsContainer\n .children('[data-layout-tab]')\n .not($allTabContainers)\n .not('[data-layout-tab=\"\"]');\n if ($unusedTabContainers.length) {\n $unusedTabContainers.remove();\n changedElements = true;\n }\n\n // Make the first tab visible if no others are\n if (!$allTabContainers.filter(':not(.hidden)').length) {\n $allTabContainers.first().removeClass('hidden');\n }\n\n this.visibleLayoutElements = visibleLayoutElements;\n\n // Update the tabs\n if (this.tabManager) {\n this.tabManager.destroy();\n this.tabManager = null;\n this.$tabContainer.html('');\n }\n\n this.hasTabs = !!response.data.tabs;\n\n if (this.hasTabs) {\n this.$tabContainer.append(response.data.tabs);\n this.tabManager = Craft.MatrixInput.initTabs(this.$tabContainer);\n\n // was a new tab selected after the request was kicked off?\n if (\n selectedTabId &&\n newSelectedTabId &&\n selectedTabId !== newSelectedTabId\n ) {\n const $newSelectedTab = this.tabManager.$tabs.filter(\n `[data-id=\"${newSelectedTabId}\"]`\n );\n if ($newSelectedTab.length) {\n // if the new tab is visible - switch to it\n this.tabManager.selectTab($newSelectedTab);\n } else {\n // if the new tab is not visible (e.g. hidden by a condition)\n // switch to the first tab\n this.tabManager.selectTab(this.tabManager.$tabs.first());\n }\n }\n }\n\n await Craft.appendHeadHtml(response.data.headHtml);\n await Craft.appendBodyHtml(response.data.bodyHtml);\n\n // re-grab dismissible tips, re-attach listener, hide on re-load\n this.matrix.elementEditor?.handleDismissibleTips();\n },\n });\n})(jQuery);\n","var __WEBPACK_NAMESPACE_OBJECT__ = jQuery;"],"names":["_regeneratorRuntime","e","t","r","Object","prototype","n","hasOwnProperty","o","defineProperty","value","i","Symbol","a","iterator","c","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","wrap","Generator","create","Context","makeInvokeMethod","tryCatch","type","arg","call","h","l","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","p","d","getPrototypeOf","v","values","g","defineIteratorMethods","forEach","_invoke","AsyncIterator","invoke","_typeof","resolve","__await","then","callInvokeWithMethodAndArg","Error","done","method","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","return","TypeError","resultName","next","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","isNaN","length","displayName","isGeneratorFunction","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","keys","reverse","pop","prev","charAt","slice","stop","rval","handle","complete","finish","catch","delegateYield","asyncGeneratorStep","gen","reject","_next","_throw","key","info","error","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","jQuery","$","Craft","MatrixInput","Garnish","Base","extend","id","entryTypes","entryTypesByHandle","inputNamePrefix","inputIdPrefix","showingAddEntryMenu","addEntryBtnGroupWidth","addEntryBtnContainerWidth","$container","$form","$entriesContainer","$addEntryBtnContainer","$addEntryBtn","$addEntryMenuBtn","$statusMessage","entrySort","entrySelect","elementEditor","addingEntry","init","settings","_this","this","formatInputId","maxEntries","setSettings","defaults","closest","children","find","data","entryType","$entries","collapsedEntries","getCollapsedEntryIds","DragSort","axis","filter","$targetItem","hasClass","getSelectedItems","collapseDraggees","magnetStrength","helperLagBase","helperOpacity","onDragStop","trigger","onSortChange","resetItemOrder","Select","multi","vertical","target","checkboxMode","$entry","entry","Entry","inArray","collapse","addListener","_callee","_context","addClass","addEntry","removeClass","disclosureMenu","on","_ref2","_callee2","ev","_context2","currentTarget","_x","updateAddEntryBtn","setTimeout","ownerId","getDraftElementId","canAddMoreEntries","removeAttr","$items","eq","$actionMenu","parent","attr","updateStatusMessage","message","_this2","empty","text","$insertBefore","autofocus","_this3","_callee4","_this3$elementEditor","_yield$Craft$sendActi","_context4","setFormValue","baseInputName","sendActionRequest","fieldId","entryTypeId","ownerElementType","siteId","namespace","blockHtml","pause","insertBefore","appendTo","css","getHiddenEntryCss","velocity","opacity","_callee3","_context3","initUiElements","appendHeadHtml","headHtml","appendBodyHtml","bodyHtml","addItems","requestAnimationFrame","_this3$elementEditor2","scrollContainerToElement","first","resume","getEntryTypeByHandle","collapseSelectedEntries","callOnSelectedEntries","expandSelectedEntries","disableSelectedEntries","enableSelectedEntries","deleteSelectedEntries","$selectedItems","marginBottom","outerHeight","staticEntries","collapsedEntryStorageKey","systemUid","localStorage","filterArray","split","setCollapsedEntryIds","ids","join","rememberCollapsedEntryId","Storage","forgetCollapsedEntryId","collapsedEntriesIndex","splice","initTabs","container","$tabs","tabManager","Tabs","$menuBtn","preventDefault","href","$tab","$win","$doc","matrix","$titlebar","$tabContainer","$fieldsContainer","$previewContainer","$collapsedInput","actionDisclosure","formObserver","visibleLayoutElements","cancelToken","ignoreFailedRequest","isNew","collapsed","_this4","substring","$actionMenuBtn","DisclosureMenu","$actionMenuOptions","handleActionClick","hasAttr","_handleTitleBarClick","toggle","FormObserver","updateFieldLayout","expand","animate","_this5","previewHtml","$fields","$inputs","inputPreviewText","j","$input","$maybeLightswitchContainer","getText","_inputPreviewText","Array","isArray","escapeHtml","trim","html","prefersReducedMotion","duration","height","show","hide","val","is","labels","$options","k","$label","concat","getInputPostVal","_this6","collapsedContainerHeight","expandedContainerHeight","displayValue","display","animationDuration","disable","_this7","enable","_this8","moveUp","$prev","moveDown","$next","insertAfter","event","onActionSelect","option","batchAction","totalSelected","isSelected","$option","confirm","selfDestruct","_this9","remove","_this10","submittingForm","cancel","param","namespaceInputName","extraData","_defineProperty","index","selectedTabId","axios","CancelToken","source","token","headers","response","_afterUpdateFieldLayout","finally","_this11","_callee5","_this11$matrix$elemen","newSelectedTabId","$allTabContainers","_iterator","_step","tabInfo","_iterator2","_step2","elementInfo","$oldElement","$newElement","_$oldElement","$placeholder","$unusedTabContainers","$newSelectedTab","_context5","_createForOfIteratorHelper","missingElements","uid","namespaceId","class","add","elements","replaceWith","not","destroy","hasTabs","tabs","append","selectTab","handleDismissibleTips"],"sourceRoot":""} \ No newline at end of file diff --git a/src/web/assets/matrix/src/MatrixInput.js b/src/web/assets/matrix/src/MatrixInput.js index 5a412a929f4..b39bf761336 100644 --- a/src/web/assets/matrix/src/MatrixInput.js +++ b/src/web/assets/matrix/src/MatrixInput.js @@ -547,8 +547,11 @@ import $ from 'jquery'; } this._handleTitleBarClick = function (ev) { - ev.preventDefault(); - this.toggle(); + // don't expand/collapse the matrix "block" if double tapping the tabs + if (!$(ev.target).closest('.tab-label').length) { + ev.preventDefault(); + this.toggle(); + } }; this.addListener(this.$titlebar, 'doubletap', this._handleTitleBarClick);