bibhamrokhanpin/wp-content/__plugins/advanced-custom-fields-pro/assets/build/js/acf-input.min.js

1 line
95 KiB
JavaScript
Raw Normal View History

2024-04-10 12:01:06 +00:00
!function(e,i){var a=[];acf.Field=acf.Model.extend({type:"",eventScope:".acf-field",wait:"ready",setup:function(t){this.$el=t,this.inherit(t),this.inherit(this.$control())},val:function(t){return t!==i?this.setValue(t):this.prop("disabled")?null:this.getValue()},getValue:function(){return this.$input().val()},setValue:function(t){return acf.val(this.$input(),t)},__:function(t){return acf._e(this.type,t)},$control:function(){return!1},$input:function(){return this.$("[name]:first")},$inputWrap:function(){return this.$(".acf-input:first")},$labelWrap:function(){return this.$(".acf-label:first")},getInputName:function(){return this.$input().attr("name")||""},parent:function(){var t=this.parents();return!!t.length&&t[0]},parents:function(){var t=this.$el.parents(".acf-field");return acf.getFields(t)},show:function(t,e){t=acf.show(this.$el,t);return t&&(this.prop("hidden",!1),acf.doAction("show_field",this,e)),t},hide:function(t,e){t=acf.hide(this.$el,t);return t&&(this.prop("hidden",!0),acf.doAction("hide_field",this,e)),t},enable:function(t,e){t=acf.enable(this.$el,t);return t&&(this.prop("disabled",!1),acf.doAction("enable_field",this,e)),t},disable:function(t,e){t=acf.disable(this.$el,t);return t&&(this.prop("disabled",!0),acf.doAction("disable_field",this,e)),t},showEnable:function(t,e){return this.enable.apply(this,arguments),this.show.apply(this,arguments)},hideDisable:function(t,e){return this.disable.apply(this,arguments),this.hide.apply(this,arguments)},showNotice:function(t){"object"!=typeof t&&(t={text:t}),this.notice&&this.notice.remove(),t.target=this.$inputWrap(),this.notice=acf.newNotice(t)},removeNotice:function(t){this.notice&&(this.notice.away(t||0),this.notice=!1)},showError:function(t){this.$el.addClass("acf-error"),t!==i&&this.showNotice({text:t,type:"error",dismiss:!1}),acf.doAction("invalid_field",this),this.$el.one("focus change","input, select, textarea",e.proxy(this.removeError,this))},removeError:function(){this.$el.removeClass("acf-error"),this.removeNotice(250),acf.doAction("valid_field",this)},trigger:function(t,e,i){return"invalidField"==t&&(i=!0),acf.Model.prototype.trigger.apply(this,[t,e,i])}}),acf.newField=function(t){var e=t.data("type"),e=n(e),t=new(acf.models[e]||acf.Field)(t);return acf.doAction("new_field",t),t};var n=function(t){return acf.strPascalCase(t||"")+"Field"};acf.registerFieldType=function(t){var e=t.prototype.type,i=n(e);acf.models[i]=t,a.push(e)},acf.getFieldType=function(t){t=n(t);return acf.models[t]||!1},acf.getFieldTypes=function(i){i=acf.parseArgs(i,{category:""});var n=[];return a.map(function(t){var e=acf.getFieldType(t),t=e.prototype;i.category&&t.category!==i.category||n.push(e)}),n}}(jQuery),function(n){acf.findFields=function(t){var e=".acf-field",i=!1;return(t=!(t=acf.parseArgs(t,{key:"",name:"",type:"",is:"",parent:!1,sibling:!1,limit:!1,visible:!1,suppressFilters:!1})).suppressFilters?acf.applyFilters("find_fields_args",t):t).key&&(e+='[data-key="'+t.key+'"]'),t.type&&(e+='[data-type="'+t.type+'"]'),t.name&&(e+='[data-name="'+t.name+'"]'),t.is&&(e+=t.is),t.visible&&(e+=":visible"),i=t.parent?t.parent.find(e):t.sibling?t.sibling.siblings(e):n(e),t.suppressFilters||(i=i.not(".acf-clone .acf-field"),i=acf.applyFilters("find_fields",i)),i=t.limit?i.slice(0,t.limit):i},acf.findField=function(t,e){return acf.findFields({key:t,limit:1,parent:e,suppressFilters:!0})},acf.getField=function(t){return(t=!(t instanceof jQuery)?acf.findField(t):t).data("acf")||acf.newField(t)},acf.getFields=function(t){t instanceof jQuery||(t=acf.findFields(t));var e=[];return t.each(function(){var t=acf.getField(n(this));e.push(t)}),e},acf.findClosestField=function(t){return t.closest(".acf-field")},acf.getClosestField=function(t){t=acf.findClosestField(t);return this.getField(t)};var e=function(t){var a=t+"_field",s=t+"Field";acf.addAction(a,function(e){var i=acf.arrayArgs(arguments),n=i.slice(1);["type","name","key"].map(function(t){t="/"+t+"="+e.get(t);i=[a+t,e].concat(n),acf.doAction.apply(null,i)}),-1<o.indexOf(t)&&e.trigger(s,n)})},o=["remove","unmount","remount","sortstart","sorts