@descope/web-components-ui 1.0.98 → 1.0.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +90 -47
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/0.js +1 -0
- package/dist/umd/878.js +1 -1
- package/dist/umd/890.js +1 -0
- package/dist/umd/boolean-fields-descope-checkbox-index-js.js +1 -1
- package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +1 -1
- package/dist/umd/descope-button-index-js.js +1 -1
- package/dist/umd/descope-combo-box-index-js.js +1 -1
- package/dist/umd/descope-container-index-js.js +1 -1
- package/dist/umd/descope-date-picker-index-js.js +1 -1
- package/dist/umd/descope-divider-index-js.js +1 -1
- package/dist/umd/descope-email-field-index-js.js +1 -1
- package/dist/umd/descope-image-index-js.js +1 -1
- package/dist/umd/descope-link-index-js.js +1 -1
- package/dist/umd/descope-loader-linear-index-js.js +1 -1
- package/dist/umd/descope-loader-radial-index-js.js +1 -1
- package/dist/umd/descope-logo-index-js.js +1 -1
- package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -1
- package/dist/umd/descope-number-field-index-js.js +1 -1
- package/dist/umd/descope-passcode-index-js.js +1 -1
- package/dist/umd/descope-password-field-index-js.js +1 -1
- package/dist/umd/descope-phone-field-index-js.js +1 -1
- package/dist/umd/descope-text-area-index-js.js +1 -1
- package/dist/umd/descope-text-field-index-js.js +1 -1
- package/dist/umd/descope-text-index-js.js +1 -1
- package/dist/umd/index.js +1 -1
- package/package.json +1 -1
- package/src/baseClasses/createBaseInputClass.js +1 -2
- package/src/components/descope-link/Link.js +1 -2
- package/src/components/descope-passcode/Passcode.js +6 -3
- package/src/components/descope-password-field/PasswordField.js +21 -5
- package/src/components/descope-password-field/passwordDraggableMixin.js +33 -0
- package/src/mixins/createStyleMixin/index.js +4 -7
- package/src/mixins/draggableMixin.js +6 -4
- package/src/mixins/index.js +0 -1
- package/src/mixins/inputValidationMixin.js +5 -1
- package/src/mixins/proxyInputMixin.js +1 -1
- package/src/theme/components/passcode.js +4 -3
- package/src/theme/components/passwordField.js +11 -1
- package/dist/umd/387.js +0 -1
- package/dist/umd/988.js +0 -1
- package/src/mixins/readOnlyMixin.js +0 -18
@@ -67,7 +67,7 @@ export const inputValidationMixin = (superclass) => class InputValidationMixinCl
|
|
67
67
|
}
|
68
68
|
|
69
69
|
#setValidity() {
|
70
|
-
const validity = this.getValidity()
|
70
|
+
const validity = this.isReadOnly ? {} : this.getValidity()
|
71
71
|
this.#internals.setValidity(validity, this.getErrorMessage(validity), this.validationTarget)
|
72
72
|
}
|
73
73
|
|
@@ -108,6 +108,10 @@ export const inputValidationMixin = (superclass) => class InputValidationMixinCl
|
|
108
108
|
return this.hasAttribute('required') && this.getAttribute('required') !== 'false'
|
109
109
|
}
|
110
110
|
|
111
|
+
get isReadOnly() {
|
112
|
+
return this.hasAttribute('readonly') && this.getAttribute('readonly') !== 'false'
|
113
|
+
}
|
114
|
+
|
111
115
|
get pattern() {
|
112
116
|
return this.getAttribute('pattern')
|
113
117
|
}
|
@@ -109,7 +109,7 @@ export const proxyInputMixin = (superclass) =>
|
|
109
109
|
this.#dispatchChange()
|
110
110
|
})
|
111
111
|
|
112
|
-
this.addEventListener('blur', () => {
|
112
|
+
this.#inputElement.addEventListener('blur', () => {
|
113
113
|
if (!this.checkValidity()) {
|
114
114
|
this.setAttribute('invalid', 'true')
|
115
115
|
this.#handleErrorMessage()
|
@@ -8,12 +8,13 @@ const globalRefs = getThemeRefs(globals);
|
|
8
8
|
const passcode = {
|
9
9
|
[vars.backgroundColor]: globalRefs.colors.surface.light,
|
10
10
|
[vars.outlineWidth]: '2px',
|
11
|
-
[vars.outlineColor]:
|
11
|
+
[vars.outlineColor]: 'transparent',
|
12
12
|
[vars.padding]: '0',
|
13
13
|
[vars.textAlign]: 'center',
|
14
14
|
[vars.borderColor]: 'transparent',
|
15
15
|
[vars.digitsGap]: '4px',
|
16
|
-
[vars.
|
16
|
+
[vars.focusedDigitFieldBorderColor]: globalRefs.colors.primary.main,
|
17
|
+
[vars.color]: globalRefs.colors.surface.contrast,
|
17
18
|
|
18
19
|
_hideCursor: {
|
19
20
|
[vars.caretColor]: 'transparent',
|
@@ -34,7 +35,7 @@ const passcode = {
|
|
34
35
|
_invalid: {
|
35
36
|
[vars.borderColor]: globalRefs.colors.error.main,
|
36
37
|
[vars.color]: globalRefs.colors.error.main,
|
37
|
-
[vars.
|
38
|
+
[vars.focusedDigitFieldBorderColor]: globalRefs.colors.error.light,
|
38
39
|
},
|
39
40
|
}
|
40
41
|
|
@@ -11,6 +11,11 @@ const passwordField = {
|
|
11
11
|
[vars.wrapperBorderWidth]: '1px',
|
12
12
|
[vars.wrapperBorderColor]: 'transparent',
|
13
13
|
[vars.wrapperBorderRadius]: globalRefs.radius.sm,
|
14
|
+
[vars.backgroundColor]: globalRefs.colors.surface.light,
|
15
|
+
|
16
|
+
[vars.outlineWidth]: '2px',
|
17
|
+
[vars.outlineStyle]: 'solid',
|
18
|
+
[vars.outlineColor]: 'transparent',
|
14
19
|
|
15
20
|
[vars.labelTextColor]: globalRefs.colors.surface.contrast,
|
16
21
|
[vars.inputTextColor]: globalRefs.colors.surface.contrast,
|
@@ -52,11 +57,16 @@ const passwordField = {
|
|
52
57
|
[vars.width]: '100%'
|
53
58
|
},
|
54
59
|
|
60
|
+
_focused: {
|
61
|
+
[vars.outlineColor]: globalRefs.colors.surface.main
|
62
|
+
},
|
63
|
+
|
55
64
|
_invalid: {
|
56
65
|
[vars.labelTextColor]: globalRefs.colors.error.main,
|
57
66
|
[vars.inputTextColor]: globalRefs.colors.error.main,
|
58
67
|
[vars.placeholderTextColor]: globalRefs.colors.error.light,
|
59
|
-
[vars.wrapperBorderColor]: globalRefs.colors.error.main
|
68
|
+
[vars.wrapperBorderColor]: globalRefs.colors.error.main,
|
69
|
+
[vars.outlineColor]: globalRefs.colors.error.main,
|
60
70
|
},
|
61
71
|
};
|
62
72
|
|
package/dist/umd/387.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[387],{3387:(t,e,r)=>{r.d(e,{Z:()=>h,f:()=>n});var o=r(4988),p=r(2061);const n=(0,r(4567).iY)("password-field"),{host:a,inputWrapper:l,inputElement:i,inputElementPlaceholder:d,revealButton:s,revealButtonIcon:c,label:u,requiredIndicator:f}={host:()=>":host",inputWrapper:{selector:"::part(input-field)"},inputElement:{selector:"> input"},inputElementPlaceholder:{selector:"> input:placeholder-shown"},revealButton:{selector:"vaadin-password-field-button"},revealButtonIcon:{selector:()=>"::part(reveal-button)::before"},label:{selector:"> label"},requiredIndicator:{selector:"::part(required-indicator)::after"}},h=(0,p.qC)((0,o.yk)({mappings:{wrapperBorderStyle:{...l,property:"border-style"},wrapperBorderWidth:{...l,property:"border-width"},wrapperBorderColor:{...l,property:"border-color"},wrapperBorderRadius:{...l,property:"border-radius"},labelTextColor:[{...u,property:"color"},{...f,property:"color"}],inputTextColor:[{...i,property:"color"},{...c,property:"color"}],placeholderTextColor:{...d,property:"color"},fontSize:[{},a],height:l,padding:l,pointerCursor:[{...s,property:"cursor"},{...u,property:"cursor"},{...f,property:"cursor"}]}}),o.e4,o.dj,o.Ae)((0,o.DM)({slots:["suffix"],wrappedEleName:"vaadin-password-field",style:"\n\t\t\t:host {\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\t\t\tvaadin-password-field {\n\t\t\t\twidth: 100%;\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t\tvaadin-password-field > input {\n\t\t\t\tmin-height: 0;\n\t\t\t}\n\t\t\tvaadin-password-field::part(input-field) {\n\t\t\t\tbackground: transparent;\n\t\t\t}\n\t\t\tvaadin-password-field::part(input-field)::after {\n\t\t\t\topacity: 0;\n\t\t\t}\t\n\t\t\tvaadin-password-field::before {\n\t\t\t\theight: initial;\n\t\t\t}\n\t\t",excludeAttrsSync:["tabindex"],componentName:n}))}}]);
|
package/dist/umd/988.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[988],{693:(t,e,s)=>{s.d(e,{s:()=>o});var i=s(2061),n=s(357);const r=t=>class extends t{init(){super.init?.(),this.baseElement.addEventListener("mouseover",(t=>{this.setAttribute("hover","true"),t.target.addEventListener("mouseleave",(()=>this.removeAttribute("hover")),{once:!0})}))}};var a=s(8084);const o=({componentName:t,baseSelector:e=""})=>{class s extends HTMLElement{static get componentName(){return t}#t;#e=!0;get baseSelector(){return e}get baseElement(){return this.#t??=this.baseSelector?this.rootElement.querySelector(this.baseSelector):this,this.#t||console.warn("missing base element for component",this.localName),this.#t}get rootElement(){return this.shadowRoot||this}connectedCallback(){super.connectedCallback?.(),this.rootElement.isConnected&&this.#e&&(this.#e=!1,this.init?.())}}return(0,i.qC)(n.A,r,a.Q)(s)}},5279:(t,e,s)=>{s.d(e,{gh:()=>i,k4:()=>n,qM:()=>a,qg:()=>r});const i="descope",n=3,r="host",a="@"},4567:(t,e,s)=>{s.d(e,{Db:()=>d,FX:()=>r,P$:()=>a,Tk:()=>c,iY:()=>h,oP:()=>u,tg:()=>l});var i=s(2061),n=s(5279);const r=(t,e,{excludeAttrs:s=[],includeAttrs:i=[]})=>{const n=Array.from(t.attributes).filter((t=>!s.includes(t.name)&&(!i.length||i.includes(t.name)))).map((t=>t.name));e(n),new MutationObserver((t=>{for(const n of t)"attributes"!==n.type||s.includes(n.attributeName)||i.length&&!i.includes(n.attributeName)||e([n.attributeName])})).observe(t,{attributes:!0})},a=(t,e)=>{e({addedNodes:Array.from(t.children),removedNodes:[]}),new MutationObserver((t=>{for(const s of t)"childList"===s.type&&e(s)})).observe(t,{childList:!0})},o=(t,e,s={})=>i=>{i.forEach((i=>{const n=s[i]||i,r=t.getAttribute(i);null!==r?e.getAttribute(n)!==r&&e.setAttribute(n,r):e.removeAttribute(n)}))},l=(t,e,s)=>{r(t,o(t,e),s),r(e,o(e,t),s)},h=t=>(0,i.E3)(n.gh,t),c=(...t)=>`--${(0,i.E3)(...t)}`,u=(t,e,s={})=>{r(t,o(t,e,s.mapAttrs),s)},d=(t,e,s=[])=>{if(!s.length)return;const i=s.reduce(((e,s)=>Object.assign(e,{[s]:{get:()=>t[s],set(e){t[s]=e}}})),{});Object.defineProperties(e,i)}},2061:(t,e,s)=>{s.d(e,{E3:()=>n,GL:()=>i,mf:()=>a,qC:()=>r});const i=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_.]+/g,"-").toLowerCase(),n=(...t)=>i(t.filter((t=>!!t)).join("-")),r=(...t)=>e=>t.reduceRight(((t,e)=>e(t)),e),a=t=>"function"==typeof t},7878:(t,e,s)=>{function i(t,e={}){const s=new Event(t,e);this[`on${t}`]?.(s),this.dispatchEvent(s)}s.d(e,{C:()=>i})},357:(t,e,s)=>{s.d(e,{A:()=>i});const i=t=>class extends t{#s(){const e=this.localName;if(!t.componentName)throw Error('component name is not defined on super class, make sure you have a static get for "componentName"');if(e!==t.componentName)throw Error(`component name mismatch, expected "${t.componentName}", current "${e}"`)}init(){super.init?.(),this.#s()}}},4988:(t,e,s)=>{s.d(e,{li:()=>M,Ae:()=>A.A,DM:()=>p,yk:()=>c,e4:()=>u,mE:()=>T,wX:()=>E,QT:()=>C.Q,Iw:()=>S,dj:()=>f,P4:()=>L});var i=s(5279),n=s(2061),r=s(4567),a=s(5561);const o=(t,...e)=>`var(${t}${e.length?` , ${o(...e)}`:""})`;class l{constructor(){this.styleMap=new Map}add(t,e,s){this.styleMap.has(t)||this.styleMap.set(t,[]),this.styleMap.set(t,[...this.styleMap.get(t),{property:e,value:s}])}toString(){return Array.from(this.styleMap.entries()).reduce(((t,[e,s])=>t+`${e} { \n${s.map((({property:t,value:e})=>`${t}: ${e}`)).join(";\n")} \n}\n\n`),"")}}const h=(t,e)=>Object.keys(e).reduce(((e,s)=>Object.assign(e,{[s]:(0,r.Tk)(t,s)})),{}),c=({mappings:t={}})=>e=>class extends e{static get cssVarList(){return{...e.cssVarList,...h(e.componentName,{...t})}}#i;#n;#r;#a;#o;#l;#h;#c;constructor({getRootElement:e,componentNameSuffix:s="",themeSection:r=i.qg,baseSelector:a}={}){super(),this.#a=s,this.#o=r,this.#l=e?.(this)||this.shadowRoot,this.#h=a??this.baseSelector,this.#c=Object.keys(t).map((t=>(0,n.E3)("st",s,t)))}get componentTheme(){return a.componentsThemeManager.currentTheme?.[e.componentName]||""}#u(){this.#n.innerHTML=this.componentTheme[this.#o]}#d(){this.#n=document.createElement("style"),this.#n.id="style-mixin-theme",this.#l.prepend(this.#n),this.#r=a.componentsThemeManager.onCurrentThemeChange(this.#u.bind(this)),this.#u()}#m(){this.#i=document.createElement("style"),this.#i.id="style-mixin-overrides";const t=(s=e.componentName,n=i.k4,Array(n).fill(`.${s}`).join(""));var s,n;this.#i.innerText=`:host(${t}) {}`,this.#l.append(this.#i)}#p(t,s){const i=this.#i?.sheet?.cssRules[0].style;if(!i)return;const n=(0,r.Tk)(e.componentName,t.replace(new RegExp("^st-"),""));s?i?.setProperty(n,s):i?.removeProperty(n)}#g(t=[]){for(const e of t)this.#c.includes(e)&&this.#p(e,this.getAttribute(e));this.#i.innerHTML=this.#i?.sheet?.cssRules[0].cssText}#E(){const s=document.createElement("style");s.id="style-mixin-mappings",s.innerHTML=((t,e,s)=>{const i=new l;return Object.keys(s).forEach((a=>{const l=((t,e)=>{const s={selector:"",property:(0,n.GL)(t)};return e&&Object.keys(e).length?Array.isArray(e)?e.map((t=>Object.assign({},s,t))):[Object.assign({},s,e)]:[s]})(a,s[a]),h=(0,r.Tk)(t,a);l.forEach((({selector:t,property:s})=>{i.add(((t="",e="")=>(0,n.mf)(e)?e(t):`${t}${/^[A-Za-z]/.test(e)?` ${e}`:e}`)(e,t),(0,n.mf)(s)?s():s,o(h))}))})),i.toString()})((0,n.E3)(e.componentName,this.#a),this.#h,t),this.#l.prepend(s)}#b(t){(this.#l.classList||this.#l.host.classList).add(t)}init(){super.init?.(),this.shadowRoot.isConnected&&(this.#b(e.componentName),this.#E(),this.#d(),this.#m(),(0,r.FX)(this,this.#g.bind(this),{}))}disconnectedCallback(){super.disconnectedCallback?.(),this.#r?.()}},u=t=>class extends t{#v=null;static get observedAttributes(){return[...t.observedAttributes||[],"draggable"]}constructor(){super(),this.#v=document.createElement("style"),this.#v.innerText="* { cursor: inherit!important }"}#y(t){t?this.shadowRoot.appendChild(this.#v):this.#v.remove()}get#f(){return this.hasAttribute("draggable")&&"false"!==this.getAttribute("draggable")}init(){this.addEventListener("mousedown",(t=>{if(this.#f){this.baseElement.setAttribute("tabindex","-1");const e=()=>{this.baseElement.removeAttribute("tabindex"),t.target.removeEventListener("mouseup",e),t.target.removeEventListener("dragend",e)};t.target.addEventListener("mouseup",e,{once:!0}),t.target.addEventListener("dragend",e,{once:!0})}})),super.init?.()}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),"draggable"===t&&this.#y("true"===s)}};var d=s(693),m=s(7878);const p=({componentName:t,wrappedEleName:e,slots:s=[],style:i,excludeAttrsSync:a=[],includeAttrsSync:o=[],includeForwardProps:l=[]})=>{class h extends((0,d.s)({componentName:t,baseSelector:e})){#A=m.C.bind(this,"blur");#S=m.C.bind(this,"focus");constructor(){super().attachShadow({mode:"open",delegatesFocus:!0}).innerHTML=`\n\t\t\t<style id="create-proxy">${(0,n.mf)(i)?i():i}</style>\n\t\t\t<${e}>\n\t\t\t<slot></slot>\n\t\t\t${s.map((t=>`<slot name="${t}" slot="${t}"></slot>`)).join("")}\n\t\t\t</${e}>\n\t\t`}init(){super.init?.(),this.baseElement.addEventListener("blur",(t=>{this.#A()})),this.baseElement.addEventListener("focus",(t=>{this.#S()})),(0,r.Db)(this.baseElement,this,l),(0,r.tg)(this.baseElement,this,{excludeAttrs:a,includeAttrs:o})}}return h},g=["required","pattern"],E=t=>class extends t{static get observedAttributes(){return[...t.observedAttributes||[],...g]}static get formAssociated(){return!0}#M;constructor(){super(),this.#M=this.attachInternals()}get defaultErrorMsgValueMissing(){return"Please fill out this field."}get defaultErrorMsgPatternMismatch(){return"Please match the requested format."}get defaultErrorMsgTooShort(){return`Minimum length is ${this.getAttribute("minlength")}.`}get defaultErrorMsgTooLong(){return`Maximum length is ${this.getAttribute("maxlength")}. `}getErrorMessage(t){switch(!0){case t.valueMissing:return this.getAttribute("data-errormessage-value-missing")||this.defaultErrorMsgValueMissing;case t.patternMismatch||t.typeMismatch:return this.getAttribute("data-errormessage-pattern-mismatch")||this.defaultErrorMsgPatternMismatch;case t.tooShort:return this.getAttribute("data-errormessage-pattern-mismatch-too-short")||this.defaultErrorMsgTooShort;case t.tooLong:return this.getAttribute("data-errormessage-pattern-mismatch-too-long")||this.defaultErrorMsgTooLong;case t.customError:return this.validationMessage;default:return""}}#C(){const t=this.getValidity();this.#M.setValidity(t,this.getErrorMessage(t),this.validationTarget)}get validationMessage(){return this.#M.validationMessage}getValidity(){console.warn("getValidity","is not implemented")}checkValidity(){return this.#M.validity.valid}reportValidity(){return this.#M.reportValidity()}get validity(){return this.#M.validity}get validationTarget(){return this.inputElement}setCustomValidity(t){t?this.#M.setValidity({customError:!0},t,this.validationTarget):(this.#M.setValidity({}),this.#C())}get isRequired(){return this.hasAttribute("required")&&"false"!==this.getAttribute("required")}get pattern(){return this.getAttribute("pattern")}get form(){return this.#M.form}attributeChangedCallback(t,e,s){super.attributeChangedCallback?.(t,e,s),g.includes(t)&&this.#C()}init(){super.init?.(),this.addEventListener("change",this.#C),this.addEventListener("invalid",(t=>t.stopPropagation())),this.addEventListener("input",this.#C),setTimeout((()=>this.#C()))}},b=["invalid","required"],v=(t,e,s)=>{Object.defineProperty(t,s,{set:function(t){return e[s]=t},get:function(){return e[s]},configurable:!0})},y=t=>{if(!t)return;let e=t;for(let t=0;t<10;t++)if(e=e.assignedElements()[0],"slot"!==e.localName)return e},f=t=>class extends(E(t)){static get observedAttributes(){return[...t.observedAttributes||[],...b]}#L;#T=m.C.bind(this,"change");constructor(){super(),this.#L=super.inputElement}warnIfInputElementIsMissing(){clearTimeout(this.inputElementTimerId),this.inputElementTimerId=setTimeout((()=>{!this.#L&&console.warn(this.localName,"no input was found")}),0)}get inputElement(){this.warnIfInputElementIsMissing();const t=this.baseElement.shadowRoot?.querySelector('slot[name="input"]'),e=this.baseElement.shadowRoot?.querySelector('slot[name="textarea"]');return this.#L??=y(t)||y(e),this.#L}set inputElement(t){this.#L=t}getValidity(){return this.inputElement?.validity||{}}handleInternalInputErrorMessage(){this.inputElement.checkValidity()||this.inputElement.setCustomValidity(this.validationMessage)}#x(){this.handleInternalInputErrorMessage(),this.setAttribute("error-message",this.validationMessage)}init(){super.init?.(),this.inputElement.addEventListener("input",(t=>{this.inputElement.checkValidity()||(this.inputElement.setCustomValidity(""),this.setCustomValidity(""),this.baseElement.__onInput(t),this.#x())})),this.baseElement.addEventListener("change",(()=>{this.#T()})),this.addEventListener("blur",(()=>{this.checkValidity()||(this.setAttribute("invalid","true"),this.#x())})),this.addEventListener("invalid",(()=>{this.checkValidity()||this.setAttribute("invalid","true"),this.#x()})),this.handleInternalInputErrorMessage(),v(this,this.inputElement,"value"),v(this,this.inputElement,"selectionStart"),this.setSelectionRange=this.inputElement.setSelectionRange?.bind(this.inputElement)}};var A=s(357);const S=({name:t,selector:e,mappings:s={},forward:{attributes:a=[],include:o=!0}={}})=>l=>{const u=t||(t=>t.replace(/[^\w\s]/gi,""))(e),d=c({mappings:s})(l);return class extends d{static get cssVarList(){return{...d.cssVarList,[u]:h((0,n.E3)(l.componentName,"_"+u),s)}}#N;constructor(){const t=t=>{const s=t.shadowRoot.querySelector(t.baseSelector),i=e?s.shadowRoot.querySelector(e):s;return i.shadowRoot||i};var s;super({getRootElement:t,componentNameSuffix:"_"+u,themeSection:i.qM+u,baseSelector:":host"}),this.#N=(s=t(this)).host||s}#w(){this.#N.onmouseenter=t=>{t.target.setAttribute("hover","true")},this.#N.onmouseleave=t=>{t.target.removeAttribute("hover")}}init(){super.init?.(),(0,r.oP)(this,this.#N,{[o?"includeAttrs":"excludeAttrs"]:a}),this.#w()}}},M=t=>class extends t{#T=m.C.bind(this,"change");init(){super.init?.(),this.prevValue=this.value,this.addEventListener("change",(t=>{t.stopPropagation()})),this.addEventListener("blur",(()=>{this.value!==this.prevValue&&(this.#T(),this.prevValue=this.value)}))}};var C=s(8084);const L=t=>class extends t{get isReadOnly(){return this.hasAttribute("readonly")&&"false"!==this.getAttribute("readonly")}init(){["focus","blur"].forEach((t=>{this.addEventListener(t,(t=>{this.isReadOnly&&(t.stopImmediatePropagation(),t.preventDefault())}),!0)})),super.init?.()}},T=t=>class extends t{init(){this.#k(),super.init?.()}#k(){["blur","focus","focusin","focusout"].forEach((t=>{this.addEventListener(t,(t=>{t.isTrusted&&t.target===this&&t.stopImmediatePropagation()}))}))}handleFocusEventsDispatching(t){let e;t?.forEach((t=>{t?.addEventListener("focusout",(t=>{t.stopImmediatePropagation(),e=setTimeout((()=>{e=null,m.C.call(this,"blur"),m.C.call(this,"focusout",{bubbles:!0})}))}));const s=t=>{t.stopImmediatePropagation(),clearTimeout(e),e||(m.C.call(this,"focus"),m.C.call(this,"focusin",{bubbles:!0}))};t?.addEventListener("focusin",s),t?.addEventListener("focus",s)}))}handleInputEventDispatching(){let t=this.value;this.addEventListener("input",(e=>{t===this.value?e.stopImmediatePropagation():t=this.value}))}}},8084:(t,e,s)=>{s.d(e,{Q:()=>n});var i=s(4567);const n=t=>class extends t{init(){super.init?.(),(0,i.FX)(this,(t=>t.forEach((t=>{const e=this.getAttribute(t);""===e?this.setAttribute(t,"true"):"false"===e&&this.removeAttribute(t)}))),{})}}}}]);
|
@@ -1,18 +0,0 @@
|
|
1
|
-
export const readOnlyMixin = (superclass) => class ReadOnlyMixinClass extends superclass {
|
2
|
-
get isReadOnly() {
|
3
|
-
return this.hasAttribute('readonly') && this.getAttribute('readonly') !== 'false'
|
4
|
-
}
|
5
|
-
|
6
|
-
init() {
|
7
|
-
['focus', 'blur'].forEach(event => {
|
8
|
-
this.addEventListener(event, (e) => {
|
9
|
-
if (this.isReadOnly) {
|
10
|
-
e.stopImmediatePropagation()
|
11
|
-
e.preventDefault()
|
12
|
-
}
|
13
|
-
}, true)
|
14
|
-
})
|
15
|
-
|
16
|
-
super.init?.()
|
17
|
-
}
|
18
|
-
}
|