mirror of
https://github.com/mediacms-io/mediacms.git
synced 2024-11-29 11:44:00 +01:00
1 line
26 KiB
JavaScript
1 line
26 KiB
JavaScript
|
!function(){"use strict";var t={8911:function(t,e,n){var r=n(2667),o=(n(7441),n(5101),n(6394),n(3080),n(4669),n(5466)),i=n(3074),s=n.n(i),a=n(8204),l=n(4426),u=n(4830),c=n(1397),p=n(2701),f=n(5261),h=n(7448),d=n(7207),y=n(2836);function m(t){return(m="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)}function g(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function b(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function v(t,e,n){return e&&b(t.prototype,e),n&&b(t,n),t}function O(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&S(t,e)}function S(t,e){return(S=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function k(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=C(t);if(e){var o=C(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return P(this,n)}}function P(t,e){return!e||"object"!==m(e)&&"function"!=typeof e?E(t):e}function E(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function C(t){return(C=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}n(6912),n(3562);var _=function(t){O(n,t);var e=k(n);function n(t){var r;return g(this,n),(r=e.call(this,t)).onSelectOption=r.onSelectOption.bind(E(r)),r}return v(n,[{key:"onSelectOption",value:function(){this.props.onSelect(this.props.id)}},{key:"render",value:function(){return o.createElement("div",{className:"media-filter-option"},o.createElement("button",{className:this.props.selected?"active":"",onClick:this.onSelectOption},this.props.label))}}]),n}(o.PureComponent),w=function(t){O(n,t);var e=k(n);function n(t){var r;return g(this,n),(r=e.call(this,t)).state={selected:r.props.default},r.onSelectOption=r.onSelectOption.bind(E(r)),r}return v(n,[{key:"onSelectOption",value:function(t){this.setState({selected:t},(function(){"function"==typeof this.props.onSelect&&this.props.onSelect(this.state.selected)}))}},{key:"renderOptions",value:function(t){for(var e=[],n=0;n<this.props.items.length;)this.props.hideOptionOnSelect?this.props.items[n].id!==t&&e.push(o.createElement(_,{key:this.props.items[n].id,id:this.props.items[n].id,label:this.props.items[n].label,selected:this.props.items[n].id===t,onSelect:this.onSelectOption})):e.push(o.createElement(_,{key:this.props.items[n].id,id:this.props.items[n].id,label:this.props.items[n].label,selected:this.props.items[n].id===t,onSelect:this.onSelectOption})),n+=1;return e}},{key:"render",value:function(){return o.createElement("div",{className:"media-filter-option-list"},this.renderOptions(this.state.selected))}}]),n}(o.PureComponent),T=function(t){O(n,t);var e=k(n);function n(t){var r;return g(this,n),(r=e.call(this,t)).state={value:r.props.default,visiblePopup:!1},r.triggerButtonDomElem=null,r.onSelectOption=r.onSelectOption.bind(E(r)),r.onPopupsDisplayChange=r.onPopupsDisplayChange.bind(E(r)),r.popup=new d.Z(o.createElement("button",{className:"popup-trigger","aria-label":"Filter"},o.createElement("span",{className:"filter-button-label"},o.createElement("span",{className:"filter-button-label-text"},r.props.label),o.createElement(h.Z,{type:"arrow_drop_down"}))),o.createElement("div",{className:"main-options"},o.createElement(y.W8,null,o.createElement(w,{items:r.props.options,default:r.state.value,onSelect:r.onSelectOption,hideOptionOnSelect:r.props.hideOptionOnSelect}))),r.onPopu
|