PageSourceSearch

https://happydog.pl/theme/49593b36093dfbdcf7d8ad5e1b91f643/js/empl…mployee-form-validation.plugin.ts.400609.js

js happydog.pl collected 2026-09-28 12:06:52 UTC 9,034 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[55486],{156:t=>{var e=function(t){var e;return!!t&&"object"==typeof t&&"[object RegExp]"!==(e=Object.prototype.toString.call(t))&&"[object Date]"!==e&&t.$$typeof!==i},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function s(t,e){return!1!==e.clone&&e.isMergeableObject(t)?l(Array.isArray(t)?[]:{},t,e):t}function r(t,e,i){return t.concat(e).map(function(t){return s(t,i)})}function n(t){return Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[])}function a(t,e){try{return e in t}catch(t){return!1}}function l(t,i,o){(o=o||{}).arrayMerge=o.arrayMerge||r,o.isMergeableObject=o.isMergeableObject||e,o.cloneUnlessOtherwiseSpecified=s;var h,u,d=Array.isArray(i);return d!==Array.isArray(t)?s(i,o):d?o.arrayMerge(t,i,o):(u={},(h=o).isMergeableObject(t)&&n(t).forEach(function(e){u[e]=s(t[e],h)}),n(i).forEach(function(e){(!a(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(a(t,e)&&h.isMergeableObject(i[e])?u[e]=(function(t,e){if(!e.customMerge)return l;var i=e.customMerge(t);return"function"==typeof i?i:l})(e,h)(t[e],i[e],h):u[e]=s(i[e],h))}),u)}l.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,i){return l(t,i,e)},{})},t.exports=l},59:(t,e,i)=>{i.d(e,{A:()=>s});class s{static debounce(t,e){let i,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){for(var r=arguments.length,n=Array(r),a=0;a<r;a++)n[a]=arguments[a];s&&!i&&setTimeout(t.bind(t,...n),0),clearTimeout(i),i=setTimeout(t.bind(t,...n),e)}}}},707:(t,e,i)=>{i.d(e,{A:()=>s});class s{static ucFirst(t){return t.charAt(0).toUpperCase()+t.slice(1)}static lcFirst(t){return t.charAt(0).toLowerCase()+t.slice(1)}static toDashCase(t){return t.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(t,e){let i=s.toUpperCamelCase(t,e);return s.lcFirst(i)}static toUpperCamelCase(t,e){return e?t.split(e).map(t=>s.ucFirst(t.toLowerCase())).join(""):s.ucFirst(t.toLowerCase())}static parsePrimitive(t){try{return/^\d+(.|,)\d+$/.test(t)&&(t=t.replace(",",".")),JSON.parse(t)}catch(e){return t.toString()}}}},737:(t,e,i)=>{i.d(e,{A:()=>l});var s=i(156),r=i.n(s),n=i(707);class a{constructor(t=document){this._el=t,t.$emitter=this,this._listeners=[]}publish(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=new CustomEvent(t,{detail:e,cancelable:i});return this.el.dispatchEvent(s),s}subscribe(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=this,r=t.split("."),n=i.scope?e.bind(i.scope):e;if(i.once&&!0===i.once){let e=n;n=function(i){s.unsubscribe(t),e(i)}}return this.el.addEventListener(r[0],n),this.listeners.push({splitEventName:r,opts:i,cb:n}),!0}unsubscribe(t){let e=t.split(".");return this.listeners=this.listeners.reduce((t,i)=>([...i.splitEventName].sort().toString()===e.sort().toString()?this.el.removeEventListener(i.splitEventName[0],i.cb):t.push(i),t),[]),!0}reset(){return this.listeners.forEach(t=>{this.el.removeEventListener(t.splitEventName[0],t.cb)}),this.listeners=[],!0}get el(){return this._el}set el(t){this._el=t}get listeners(){return this._listeners}set listeners(t){this._listeners=t}}class l{constructor(t,e={},i=!1){if(!(t instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${i}".`);return}this.el=t,this.$emitter=new a(this.el),this._pluginName=this._getPluginName(i),this.options=this._mergeOptions(e),this._initialized=!1,this._registerInstance(),this._init()}init(){console.warn(`The "init" method for the plugin "${this._pluginName}" is not defined. The plugin will not be initialized.`)}update(){}_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(t){let e=[this.constructor.options,this.options,t];return e.push(this._getConfigFromDataAttribute()),e.push(this._getOptionsFromDataAttribute()),r().all(e.filter(t=>t instanceof Object&&!(t instanceof Array)).map(t=>t||{}))}_getConfigFromDataAttribute(){let t={};if("function"!=typeof this.el.getAttribute)return t;let e=n.A.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${e}-config`);return i?window.PluginConfigManager.get(this._pluginName,i):t}_getOptionsFromDataAttribute(){let t={};if("function"!=typeof this.el.getAttribute)return t;let e=n.A.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${e}-options`);if(i)try{return JSON.parse(i)}catch(t){console.error(`The data attribute "data-${e}-options" could not be parsed to json: ${t.message}`)}return t}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(t){return t||(t=this.constructor.name),t}}}
1,486:(t,e,i)=>{i.r(e),i.d(e,{default:()=>a});var s=i(737),r=i(59);class n extends s.A{static #t=this.options={stylingEnabled:!0,styleCls:"was-validated",hintCls:"invalid-feedback",debounceTime:"150",eventName:"ValidateEqual",equalAttr:"data-form-validation-equal",lengthAttr:"data-form-validation-length",lengthTextAttr:"data-form-validation-length-text",requiredAttr:"data-form-validation-required"};init(){if(!1===this._isFormElement())throw Error("Element is not of type <form>");this.options.stylingEnabled&&this._setNoValidate(),this._registerEvents()}_isFormElement(){return"form"===this.el.tagName.toLowerCase()}_setNoValidate(){this.el.setAttribute("novalidate","")}_registerEvents(){this.options.stylingEnabled&&this.el.addEventListener("submit",this._onFormSubmit.bind(this)),this._registerValidationListener(this.options.equalAttr,this._onValidateEqualTrigger.bind(this),["change"]),this._registerValidationListener(this.options.equalAttr,r.A.debounce(this._onValidateEqual.bind(this),this.options.debounceTime),[this.options.eventName]),this._registerValidationListener(this.options.lengthAttr,this._onValidateLength.bind(this),["change"]),this._registerValidationListener(this.options.requiredAttr,this._onValidateRequired.bind(this),["change"])}_registerValidationListener(t,e,i){let s=this.el.querySelectorAll(`[${t}]`);s&&s.forEach(t=>{i.forEach(i=>{t.removeEventListener(i,e),t.addEventListener(i,e)})})}_onFormSubmit(t){let e=this.el.checkValidity();!1===e&&(t.preventDefault(),t.stopPropagation()),this.el.classList.add(this.options.styleCls),this.$emitter.publish("beforeSubmit",{validity:e})}_onValidateEqualTrigger(t){let e=t.target.getAttribute(this.options.equalAttr),i=this.el.querySelectorAll(`[${this.options.equalAttr}='${e}']`);i[1].value.trim().length>0&&i.forEach(e=>{e.dispatchEvent(new CustomEvent(this.options.eventName,{target:t.target}))}),this.$emitter.publish("onValidateEqualTrigger")}_onValidateEqual(t){let e=t.target.getAttribute(this.options.equalAttr),i=this.el.querySelectorAll(`[${this.options.equalAttr}='${e}']`),s=!0;[...i].reduce((t,e)=>(t.value.trim()!==e.value.trim()&&(s=!1),e)),i.forEach(t=>{s?this._setFieldToValid(t,this.options.equalAttr):this._setFieldToInvalid(t,this.options.equalAttr)}),this.$emitter.publish("onValidateEqual")}_onValidateLength(t){let e=t.target,i=e.value.trim(),s=t.target.getAttribute(this.options.lengthAttr),r=e.nextElementSibling;i.length<s?(this._setFieldToInvalid(e,this.options.lengthAttr),r&&r.hasAttribute(this.options.lengthTextAttr)&&r.classList.add(this.options.hintCls)):(this._setFieldToValid(e,this.options.lengthAttr),r&&r.hasAttribute(this.options.lengthTextAttr)&&r.classList.remove(this.options.hintCls)),this.$emitter.publish("onValidateLength")}_onValidateRequired(t){let e=t.target;""===e.value.trim()?this._setFieldToInvalid(e,this.options.requiredAttr):this._setFieldToValid(e,this.options.requiredAttr),this.$emitter.publish("onValidateRequired")}_setFieldToInvalid(t,e){this._showInvalidMessage(t,e),t.setAttribute("invalid",!0),this.$emitter.publish("setFieldToInvalid")}_showInvalidMessage(t,e){let i=t.parentElement;i&&this.options.stylingEnabled&&i.classList.add(this.options.styleCls);let s=t.getAttribute(`${e}-message`);s&&(i.querySelector(".js-validation-message")||t.insertAdjacentHTML("afterEnd",`<div class="invalid-feedback js-validation-message" data-type="${e}">${s}</div>`),t.setCustomValidity(s)),this.$emitter.publish("showInvalidMessage")}_setFieldToValid(t,e){this._hideInvalidMessage(t,e),t.removeAttribute("invalid"),t.setCustomValidity(""),this.$emitter.publish("setFieldToValid")}_hideInvalidMessage(t,e){let i=t.parentElement;if(i&&this.options.stylingEnabled&&i.classList.remove(this.options.styleCls),i){let t=i.querySelector(`.js-validation-message[data-type=${e}]`);t&&t.remove()}this.$emitter.publish("hideInvalidMessage")}}class a extends n{init(){super.init(),this._validateHandler()}_validateHandler(){let t=this.el.querySelector("input.is-invalid");t&&t.focus()}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.