From 513a5f1774f3d9bebb3251a03a99ebc136df160a Mon Sep 17 00:00:00 2001 From: Tony Air Date: Wed, 13 May 2020 23:05:34 +0700 Subject: [PATCH] UI: Form validation improvements --- dist/js/app.js | 2 +- dist/js/app.js.map | 2 +- package.json | 2 +- src/js/_components/_ui.form.basics.js | 6 +- src/js/_components/_ui.form.validate.field.js | 206 ++++++++---------- src/js/_components/_ui.form.validate.js | 18 +- src/js/_components/_ui.header-footer.js | 8 +- 7 files changed, 116 insertions(+), 128 deletions(-) diff --git a/dist/js/app.js b/dist/js/app.js index f9afef9..dac9660 100644 --- a/dist/js/app.js +++ b/dist/js/app.js @@ -1,3 +1,3 @@ /*! For license information please see app.js.LICENSE.txt */ -!function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/mnt/data/srv/dist/repositories/webpack-bootstrap-ui-kit/dist",n(n.s="./src/js/app.js")}({"./node_modules/@a2nt/meta-lightbox/src/js/meta-lightbox.js":function(t,e){function n(t){return(n="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(t,e,i){var o={effect:"fade",theme:"default",keyboardNav:!0,clickOverlayToClose:!0,onInit:function(){},beforeShowLightbox:function(){},afterShowLightbox:function(t){},beforeHideLightbox:function(){},afterHideLightbox:function(){},onPrev:function(t){},onNext:function(t){},errorMessage:"The requested content cannot be loaded. Please try again later."};function r(e,n){this.options=t.extend({},o,n),this._defaults=o,this._name="metaLightbox",this.init()}r.prototype={init:function(){var e=this,n=t("html");this.ajaxLoaded=!1,i.MetaLightbox=this,n.hasClass("meta-lightbox-notouch")||n.addClass("meta-lightbox-notouch"),"ontouchstart"in i&&n.removeClass("meta-lightbox-notouch"),t(i).on("click",'[data-toggle="lightbox"],[data-lightbox-gallery]',(function(t){return t.preventDefault(),t.stopPropagation(),e.showLightbox(this),!1})),this.options.keyboardNav&&t("body").off("keyup").on("keyup",(function(n){var i=n.keyCode?n.keyCode:n.which;27===i&&e.destructLightbox(),37===i&&t(".meta-lightbox-prev").trigger("click"),39===i&&t(".meta-lightbox-next").trigger("click")})),this.options.onInit.call(this)},showLightbox:function(e){this.el=e,this.$el=t(this.el);var n,i,o,r,s=this;this.options.beforeShowLightbox.call(this),(n=this.constructLightbox())&&(i=n.find(".meta-lightbox-content"))&&(o=this.$el,t("body").addClass("meta-lightbox-body-effect-".concat(this.options.effect)),this.processContent(i,o),this.$el.data("lightbox-gallery")&&(1===(r=t('[data-lightbox-gallery="'.concat(this.$el.data("lightbox-gallery"),'"]'))).length?t(".meta-lightbox-nav").hide():t(".meta-lightbox-nav").show(),t(".meta-lightbox-prev").off("click").on("click",(function(e){e.preventDefault();var n=r.index(o);o=r.eq(n-1),t(o).length||(o=r.last()),s.processContent(i,o),s.options.onPrev.call(this,[o])})),t(".meta-lightbox-next").off("click").on("click",(function(e){e.preventDefault();var n=r.index(o);o=r.eq(n+1),t(o).length||(o=r.first()),s.processContent(i,o),s.options.onNext.call(this,[o])}))),setTimeout((function(){n.addClass("meta-lightbox-open"),s.options.afterShowLightbox.call(this,[n])}),1))},processContent:function(o,r){var s,a,l,c,u,d,h=this;href=r.attr("href"),href||(href=r.data("href")),o.html("").addClass("meta-lightbox-loading"),this.isHidpi()&&r.data("lightbox-hidpi")&&(href=r.data("lightbox-hidpi")),null!=href.match(/\.(jpeg|jpg|gif|png)$/i)?((s=t("",{src:href})).on("load",(function(){var n=t('
'),i=t(".meta-lightbox-content"),r=t('');r.append(s),n.append(r),n.css({"line-height":"".concat(i.height(),"px"),height:"".concat(i.height(),"px")}),t(e).resize((function(){n.css({"line-height":"".concat(i.height(),"px"),height:"".concat(i.height(),"px")})})),"undefined"!==typeof r.zoom&&r.zoom(),o.html(n).removeClass("meta-lightbox-loading"),h.contentLoaded()})),s.on("error",(function(){var e=t('

'.concat(h.options.errorMessage,"

"));o.html(e).removeClass("meta-lightbox-loading"),h.contentLoaded()})),r.data("title")?h.setTitle(r.data("title")):r.attr("title")?h.setTitle(r.attr("title")):t(".meta-lightbox-title-wrap").html(""),"function"===typeof ga&&ga("send","event","meta","Image Click",href)):(a=href.match(/(youtube|youtube-nocookie|youtu|vimeo)\.(com|be)\/(watch\?v=([\w-]+)|([\w-]+))/))?(l="",c="meta-lightbox-video","youtube"==a[1]&&(l="https://www.youtube.com/embed/".concat(a[4]),c="meta-lightbox-youtube"),"youtu"==a[1]&&(l="https://www.youtube.com/embed/".concat(a[3]),c="meta-lightbox-youtube"),"youtube-nocookie"==a[1]&&(l="https://www.youtube-nocookie.com/embed/".concat(a[4]),c="nivo-lightbox-youtube"),"vimeo"==a[1]&&(l="https://player.vimeo.com/video/".concat(a[3]),c="meta-lightbox-vimeo"),l&&(u=t("