@equisoft/design-elements-react 10.4.2-snapshot.20260929152240 → 10.4.2-snapshot.20261005130729
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/bundle.js +2 -2
- package/dist/bundle.js.LICENSE.txt +1 -1
- package/package.json +9 -9
package/dist/bundle.js
CHANGED
|
@@ -2075,7 +2075,7 @@
|
|
|
2075
2075
|
color: ${({theme:e})=>e.component["legend-disabled-text-color"]};
|
|
2076
2076
|
}
|
|
2077
2077
|
}
|
|
2078
|
-
`,sy=(0,h().forwardRef)((e,t)=>{var{id:r,children:n,orientation:a="vertical",legend:i,disabled:l}=e,s=iy(e,["id","children","orientation","legend","disabled"]);const c=as(r),d=i||{},{text:u}=d,p=iy(d,["text"]);return(0,o().jsxs)(ly,Object.assign({"data-testid":"fieldset",id:c,$orientation:a,"data-orientation":a,"aria-disabled":l,disabled:l,ref:t},s,{children:[i&&(0,o().jsx)(ay,Object.assign({},p,{id:`${c}-legend`,children:u})),n]}))});function cy(e){const{anchorOffset:t=0,focusOffset:r=0}=e.ownerDocument.getSelection()||{};return[Math.min(t,r),Math.max(t,r)]}sy.displayName="Fieldset";class dy{constructor(e){this.element=e,this.maxLength=1/0}get value(){return this.element.innerText.replace(/\n\n$/,"\n")}set value(e){this.element.innerHTML=e.replace(/\n$/,"\n\n")}get selectionStart(){return cy(this.element)[0]}get selectionEnd(){return cy(this.element)[1]}setSelectionRange(e,t){!function(e,[t,r]){const n=e.ownerDocument,o=n.createRange();o.setStart(e.firstChild||e,Math.min(t,e.textContent?.length??0)),o.setEnd(e.lastChild||e,Math.min(r,e.textContent?.length??0));const a=n.getSelection();a&&(a.removeAllRanges(),a.addRange(o))}(this.element,[e??0,t??0])}select(){this.setSelectionRange(0,this.value.length)}}const uy=e=>e.isContentEditable?function(e){const t=new dy(e);return new Proxy(e,{get(e,r){if(r in t)return t[r];const n=e[r];return"function"==typeof n?n.bind(e):n},set:(e,r,n,o)=>Reflect.set(r in t?t:e,r,n,o)})}(e):e.querySelector("input,textarea")||e,py={mask:/^.*$/,preprocessors:[],postprocessors:[],plugins:[],overwriteMode:"shift"};class my{constructor(){this.now=null,this.past=[],this.future=[]}undo(){const e=this.past.pop();e&&this.now&&(this.future.push(this.now),this.updateElement(e,"historyUndo"))}redo(){const e=this.future.pop();e&&this.now&&(this.past.push(this.now),this.updateElement(e,"historyRedo"))}updateHistory(e){if(!this.now)return void(this.now=e);const t=this.now.value!==e.value,r=this.now.selection.some((t,r)=>t!==e.selection[r]);(t||r)&&(t&&(this.past.push(this.now),this.future=[]),this.now=e)}updateElement(e,t){this.now=e,this.updateElementState(e,{inputType:t,data:null})}}function hy(e,...t){return t.every(({value:t,selection:r})=>t===e.value&&r[0]===e.selection[0]&&r[1]===e.selection[1])}function fy({value:e,selection:t},r,n){const[o,a]=t;return{value:e,selection:"replace"===("function"==typeof n?n({value:e,selection:t}):n)?[o,Math.max(o+r.length,a)]:[o,a]}}function gy(e){return"string"==typeof e}function by(e,t,r,n){let o="";for(let a=t.length;a<e.length;a++){const t=e[a]||"",i=n?.value[a]===t;if(!gy(t)||t===r&&!i)return o;o+=t}return o}function vy(e,t){return Array.isArray(t)?e.length===t.length&&Array.from(e).every((e,r)=>{const n=t[r]||"";return gy(n)?e===n:e.match(n)}):t.test(e)}function yy(e,t,r=null){if(vy(e.value,t))return e;const{value:n,selection:o}=Array.isArray(t)?function(e,t,r){let n=null,o=null;const a=Array.from(e.value).reduce((a,i,l)=>{const s=by(t,a,i,r),c=`${a}${s}`,d=t[c.length]||"";return null===n&&l>=e.selection[0]&&(n=c.length),null===o&&l>=e.selection[1]&&(o=c.length),gy(d)?`${c}${d}`:i.match(d)?`${c}${i}`:s.startsWith(i)?c:a},""),i=by(t,a,"",r);return{value:vy(`${a}${i}`,t)?`${a}${i}`:a,selection:[n??a.length,o??a.length]}}(e,t,r):function({value:e,selection:t},r){const[n,o]=t;let a=n,i=o;const l=Array.from(e).reduce((e,t,l)=>{const s=`${e}${t}`;return n===l&&(a=e.length),o===l&&(i=e.length),s.match(r)?s:e},"");return{value:l,selection:[Math.min(a,l.length),Math.min(i,l.length)]}}(e,t);return{selection:o,value:Array.isArray(t)?n.slice(0,t.length):n}}function _y(e,t){if(!Array.isArray(t))return e;const[r,n]=e.selection,o=[],a=Array.from(e.value).reduce((e,a,i)=>{const l=t[i]||"";return i===r&&o.push(e.length),i===n&&o.push(e.length),gy(l)&&l===a?e:`${e}${a}`},"");return o.length<2&&o.push(...Array.from({length:2-o.length}).fill(a.length)),{value:a,selection:[o[0],o[1]]}}class xy{constructor(e,t){this.maskOptions=t,this.unmaskInitialState={value:"",selection:[0,0]},this.value="",this.selection=[0,0];const r=this.getMaskExpression(e),{value:n,selection:o}=yy(e,r);this.unmaskInitialState=_y({value:n,selection:o},r),this.value=n,this.selection=o}addCharacters(e){const{value:t,selection:r,maskOptions:n}=this,o={value:t,selection:r},{selection:[a,i]}=fy(o,e,n.overwriteMode),l=this.getMaskExpression({value:`${t.slice(0,a)}${e}${t.slice(i)}`,selection:[a+e.length,a+e.length]}),[s,c]=fy(this.unmaskInitialState,e,n.overwriteMode).selection,d=`${this.unmaskInitialState.value.slice(0,s)}${e}`,u=d.length,p=yy({value:`${d}${this.unmaskInitialState.value.slice(c)}`,selection:[u,u]},l,o),m=t.slice(0,a),h=yy({value:d,selection:[u,u]},l,o);if(h.value===m||h.value.length<m.length&&_y(h,l).value===this.unmaskInitialState.value.slice(0,s)||hy(this,p))throw new Error("Invalid mask value");this.value=p.value,this.selection=p.selection}deleteCharacters(){const[e,t]=this.selection;if(e===t||!t)return;const{value:r}=this,n=this.getMaskExpression({value:`${r.slice(0,e)}${r.slice(t)}`,selection:[e,e]}),o={value:r},[a,i]=this.unmaskInitialState.selection,l=yy({value:`${this.unmaskInitialState.value.slice(0,a)}${this.unmaskInitialState.value.slice(i)}`,selection:[a,a]},n,o);this.value=l.value,this.selection=l.selection}getMaskExpression(e){const{mask:t}=this.maskOptions;return"function"==typeof t?t(e):t}}class ky{constructor(e){this.element=e,this.listeners=[]}listen(e,t,r){const n=t;this.element.addEventListener(e,n,r),this.listeners.push(()=>this.element.removeEventListener(e,n,r))}destroy(){this.listeners.forEach(e=>e())}}function wy(e,t,r){return e.ctrlKey===!!(1&t)&&e.altKey===!!(2&t)&&e.shiftKey===!!(4&t)&&e.metaKey===!!(8&t)&&e.keyCode===r}const My=/\s+$/g,Sy=/^\s+/g,Ey=/\s/;function Cy(e=[]){return(t,...r)=>e.reduce((e,t)=>({...e,...t(e,...r)}),t)}function Oy(e,t){const r={...py,...t},n=Cy(r.preprocessors),o=Cy(r.postprocessors),a="string"==typeof e?{value:e,selection:[0,0]}:e,{elementState:i}=n({elementState:a,data:""},"validation"),l=new xy(i,r),{value:s,selection:c}=o(l,a);return"string"==typeof e?s:{value:s,selection:c}}const $y=[function(){let e="",t=0,r=null,n=!1;return o=>{const a=new ky(o);return a.listen("beforeinput",a=>{const{value:i,selectionStart:l,selectionEnd:s}=o,c="insertText"===r?.inputType&&" "===r.data&&!i.slice(0,Number(s)).endsWith(" ");"insertText"===a.inputType&&". "===a.data&&("deleteContentBackward"===r?.inputType&&n?(o.value=e,o.setSelectionRange(t,t)):c&&o.setSelectionRange(l,l)),n=c,r=a,e=i,t=Number((c?t:s)===i.length?s:l)}),()=>a.destroy()}}(),e=>{const t=new ky(e);let r,n=!1,o=e.value;return t.listen("keydown",({key:e})=>{n="Unidentified"===e}),t.listen("beforeinput",t=>{r=t,o=e.value}),t.listen("input",t=>{n&&r.defaultPrevented&&"deleteContentBackward"===r.inputType&&"deleteContentBackward"===t.inputType&&(e.value=o)},{capture:!0}),()=>t.destroy()}];class zy extends my{constructor(e,t){super(),this.element=e,this.maskitoOptions=t,this.isTextArea="TEXTAREA"===this.element.nodeName,this.eventListener=new ky(this.element),this.options={...py,...this.maskitoOptions},this.preprocessor=Cy(this.options.preprocessors),this.postprocessor=Cy(this.options.postprocessors),this.teardowns=this.options.plugins.concat($y).map(e=>e(this.element,this.options)),this.upcomingElementState=null,this.updateHistory(this.elementState),this.eventListener.listen("keydown",e=>function(e){return wy(e,1,89)||wy(e,5,90)||wy(e,12,90)}(e)?(e.preventDefault(),this.redo()):function(e){return wy(e,1,90)||wy(e,8,90)}(e)?(e.preventDefault(),this.undo()):void 0),this.eventListener.listen("beforeinput",e=>{const t=e.inputType.includes("Forward");switch(this.updateHistory(this.elementState),e.inputType){case"deleteByCut":case"deleteContentBackward":case"deleteContentForward":return this.delete(function({value:e,selection:t},r){const[n,o]=t;return n!==o?[n,o]:(r?[n,o+1]:[n-1,o]).map(t=>Math.min(Math.max(t,0),e.length))}(this.elementState,t),e);case"deleteHardLineBackward":case"deleteHardLineForward":case"deleteSoftLineBackward":case"deleteSoftLineForward":return this.delete(function({value:e,selection:t},r){const[n,o]=t;if(n!==o)return[n,o];const a=r?e.slice(n).indexOf("\n")+1||e.length:e.slice(0,o).lastIndexOf("\n")+1;return[r?n:a,r?a:o]}(this.elementState,t),e);case"deleteWordBackward":case"deleteWordForward":return this.delete(function({value:e,selection:t},r){const[n,o]=t;if(n!==o)return[n,o];if(r){const t=e.slice(n),[r]=t.match(Sy)||[""],o=t.trimStart().search(Ey);return[n,-1===o?e.length:n+r.length+o]}const a=e.slice(0,o),[i]=a.match(My)||[""],l=a.trimEnd().split("").reverse().findIndex(e=>Ey.exec(e));return[-1===l?0:o-i.length-l,o]}(this.elementState,t),e);case"historyRedo":return e.preventDefault(),this.redo();case"historyUndo":return e.preventDefault(),this.undo();case"insertCompositionText":case"insertReplacementText":return;case"insertLineBreak":case"insertParagraph":return this.handleEnter(e);default:return this.insert(e.data??e.dataTransfer?.getData("text/plain")??"",e)}}),this.eventListener.listen("input",()=>{this.upcomingElementState&&!hy(this.upcomingElementState,this.elementState)&&this.updateElementState(this.upcomingElementState),this.upcomingElementState=null},{capture:!0}),this.eventListener.listen("input",({inputType:e})=>{"insertCompositionText"!==e&&(this.ensureValueFitsMask(),this.updateHistory(this.elementState))}),this.eventListener.listen("compositionend",()=>{this.ensureValueFitsMask(),this.updateHistory(this.elementState)})}destroy(){this.eventListener.destroy(),this.teardowns.forEach(e=>e?.())}delete(e,t){const r=t?.inputType.includes("Forward"),n={value:this.elementState.value,selection:e},{elementState:o}=this.preprocessor({elementState:n,data:""},r?"deleteForward":"deleteBackward"),a=new xy(o,this.options);a.deleteCharacters();const i=this.postprocessor(a,n);if(function(e,...t){return t.every(({value:t})=>t===e.value)}(n,o,a,i)){const[e,n]=o.selection;return t?.preventDefault(),this.updateSelectionRange(r?[n,n]:[e,e])}this.upcomingElementState=i}insert(e,t){const{options:r,maxLength:n,elementState:o}=this,[a,i]=o.selection,{elementState:l,data:s=e}=this.preprocessor({data:e,elementState:o},"insert"),c=new xy(l,r);try{c.addCharacters(s)}catch{return t?.preventDefault()}this.upcomingElementState=this.clampState(this.postprocessor(c,o)),o.value.length>=n&&a===i&&("replace"!==r.overwriteMode||hy(this.upcomingElementState,o)?this.upcomingElementState=null:this.dispatchInputEvent({inputType:"insertText",data:e}))}updateElementState({value:e,selection:t},r){const n=this.elementState.value;this.updateValue(e),this.updateSelectionRange(t),r&&n!==e&&this.dispatchInputEvent(r)}get elementState(){const{value:e,selectionStart:t,selectionEnd:r}=this.element;return{value:e,selection:[t??0,r??0]}}get maxLength(){const{maxLength:e}=this.element;return-1===e?1/0:e}updateSelectionRange([e,t]){const{element:r}=this;!r.matches(":focus")||r.selectionStart===e&&r.selectionEnd===t||r.setSelectionRange(e,t)}updateValue(e){(this.element.value!==e||this.element.isContentEditable)&&(this.element.value=e)}ensureValueFitsMask(){this.updateElementState(Oy(this.elementState,this.options),{inputType:"insertText",data:null})}dispatchInputEvent(e={inputType:"insertText",data:null}){this.element.dispatchEvent(new InputEvent("input",{...e,bubbles:!0,cancelable:!1}))}handleEnter(e){(this.isTextArea||this.element.isContentEditable)&&this.insert("\n",e)}clampState({value:e,selection:t}){const[r,n]=t,o=this.maxLength;return{value:e.slice(0,o),selection:[Math.min(r,o),Math.min(n,o)]}}}const Dy="undefined"==typeof window?h().useEffect:h().useLayoutEffect,jy=mo("TextInput",["control","leftAdornment","rightAdornment"]);const Ry=v().input`
|
|
2078
|
+
`,sy=(0,h().forwardRef)((e,t)=>{var{id:r,children:n,orientation:a="vertical",legend:i,disabled:l}=e,s=iy(e,["id","children","orientation","legend","disabled"]);const c=as(r),d=i||{},{text:u}=d,p=iy(d,["text"]);return(0,o().jsxs)(ly,Object.assign({"data-testid":"fieldset",id:c,$orientation:a,"data-orientation":a,"aria-disabled":l,disabled:l,ref:t},s,{children:[i&&(0,o().jsx)(ay,Object.assign({},p,{id:`${c}-legend`,children:u})),n]}))});function cy(e){const{anchorOffset:t=0,focusOffset:r=0}=e.ownerDocument.getSelection()||{};return[Math.min(t,r),Math.max(t,r)]}sy.displayName="Fieldset";class dy{constructor(e){this.element=e,this.maxLength=1/0}get value(){return this.element.innerText.replace(/\n\n$/,"\n")}set value(e){this.element.innerHTML=e.replace(/\n$/,"\n\n")}get selectionStart(){return cy(this.element)[0]}get selectionEnd(){return cy(this.element)[1]}setSelectionRange(e,t){!function(e,[t,r]){const n=e.ownerDocument,o=n.createRange();o.setStart(e.firstChild||e,Math.min(t,e.textContent?.length??0)),o.setEnd(e.lastChild||e,Math.min(r,e.textContent?.length??0));const a=n.getSelection();a&&(a.removeAllRanges(),a.addRange(o))}(this.element,[e??0,t??0])}select(){this.setSelectionRange(0,this.value.length)}}const uy=e=>e.isContentEditable?function(e){const t=new dy(e);return new Proxy(e,{get(e,r){if(r in t)return t[r];const n=e[r];return"function"==typeof n?n.bind(e):n},set:(e,r,n,o)=>Reflect.set(r in t?t:e,r,n,o)})}(e):e.querySelector("input,textarea")||e,py={mask:/^.*$/,preprocessors:[],postprocessors:[],plugins:[],overwriteMode:"shift"};class my{constructor(){this.now=null,this.past=[],this.future=[]}undo(){const e=this.past.pop();e&&this.now&&(this.future.push(this.now),this.updateElement(e,"historyUndo"))}redo(){const e=this.future.pop();e&&this.now&&(this.past.push(this.now),this.updateElement(e,"historyRedo"))}updateHistory(e){if(!this.now)return void(this.now=e);const t=this.now.value!==e.value,r=this.now.selection.some((t,r)=>t!==e.selection[r]);(t||r)&&(t&&(this.past.push(this.now),this.future=[]),this.now=e)}updateElement(e,t){this.now=e,this.updateElementState(e,{inputType:t,data:null})}}function hy(e,...t){return t.every(({value:t,selection:r})=>t===e.value&&r[0]===e.selection[0]&&r[1]===e.selection[1])}function fy({value:e,selection:t},r,n){const[o,a]=t;return{value:e,selection:"replace"===("function"==typeof n?n({value:e,selection:t}):n)?[o,Math.max(o+r.length,a)]:[o,a]}}function gy(e){return"string"==typeof e}function by(e,t,r,n){let o="";for(let a=t.length;a<e.length;a++){const t=e[a]||"",i=n?.value[a]===t;if(!gy(t)||t===r&&!i)return o;o+=t}return o}function vy(e,t){return Array.isArray(t)?e.length===t.length&&Array.from(e).every((e,r)=>{const n=t[r]||"";return gy(n)?e===n:e.match(n)}):t.test(e)}function yy(e,t,r=null){if(vy(e.value,t))return e;const{value:n,selection:o}=Array.isArray(t)?function(e,t,r){let n=null,o=null;const a=Array.from(e.value).reduce((a,i,l)=>{const s=by(t,a,i,r),c=`${a}${s}`,d=t[c.length]||"";return null===n&&l>=e.selection[0]&&(n=c.length),null===o&&l>=e.selection[1]&&(o=c.length),gy(d)?`${c}${d}`:i.match(d)?`${c}${i}`:s.startsWith(i)?c:a},""),i=by(t,a,"",r);return{value:vy(`${a}${i}`,t)?`${a}${i}`:a,selection:[n??a.length,o??a.length]}}(e,t,r):function({value:e,selection:t},r){const[n,o]=t;let a=n,i=o;const l=Array.from(e).reduce((e,t,l)=>{const s=`${e}${t}`;return n===l&&(a=e.length),o===l&&(i=e.length),s.match(r)?s:e},"");return{value:l,selection:[Math.min(a,l.length),Math.min(i,l.length)]}}(e,t);return{selection:o,value:Array.isArray(t)?n.slice(0,t.length):n}}function _y(e,t){if(!Array.isArray(t))return e;const[r,n]=e.selection,o=[],a=Array.from(e.value).reduce((e,a,i)=>{const l=t[i]||"";return i===r&&o.push(e.length),i===n&&o.push(e.length),gy(l)&&l===a?e:`${e}${a}`},"");return o.length<2&&o.push(...Array.from({length:2-o.length}).fill(a.length)),{value:a,selection:[o[0],o[1]]}}class xy{constructor(e,t){this.maskOptions=t,this.unmaskInitialState={value:"",selection:[0,0]},this.value="",this.selection=[0,0];const r=this.getMaskExpression(e),{value:n,selection:o}=yy(e,r);this.unmaskInitialState=_y({value:n,selection:o},r),this.value=n,this.selection=o}addCharacters(e){const{value:t,selection:r,maskOptions:n}=this,o={value:t,selection:r},{selection:[a,i]}=fy(o,e,n.overwriteMode),l=this.getMaskExpression({value:`${t.slice(0,a)}${e}${t.slice(i)}`,selection:[a+e.length,a+e.length]}),[s,c]=fy(this.unmaskInitialState,e,n.overwriteMode).selection,d=`${this.unmaskInitialState.value.slice(0,s)}${e}`,u=d.length,p=yy({value:`${d}${this.unmaskInitialState.value.slice(c)}`,selection:[u,u]},l,o),m=t.slice(0,a),h=yy({value:d,selection:[u,u]},l,o);if(h.value===m||h.value.length<m.length&&_y(h,l).value===this.unmaskInitialState.value.slice(0,s)||hy(this,p))throw new Error("Invalid mask value");this.value=p.value,this.selection=p.selection}deleteCharacters(){const[e,t]=this.selection;if(e===t||!t)return;const{value:r}=this,n=this.getMaskExpression({value:`${r.slice(0,e)}${r.slice(t)}`,selection:[e,e]}),o={value:r},[a,i]=this.unmaskInitialState.selection,l=yy({value:`${this.unmaskInitialState.value.slice(0,a)}${this.unmaskInitialState.value.slice(i)}`,selection:[a,a]},n,o);this.value=l.value,this.selection=l.selection}getMaskExpression(e){const{mask:t}=this.maskOptions;return"function"==typeof t?t(e):t}}class ky{constructor(e){this.element=e,this.listeners=[]}listen(e,t,r){const n=t;this.element.addEventListener(e,n,r),this.listeners.push(()=>this.element.removeEventListener(e,n,r))}destroy(){this.listeners.forEach(e=>e())}}function wy(e,t,r){return e.ctrlKey===!!(1&t)&&e.altKey===!!(2&t)&&e.shiftKey===!!(4&t)&&e.metaKey===!!(8&t)&&e.keyCode===r}const My=/\s+$/g,Sy=/^\s+/g,Ey=/\s/;function Cy(e=[]){return(t,...r)=>e.reduce((e,t)=>({...e,...t(e,...r)}),t)}function Oy(e,t){const r={...py,...t},n=Cy(r.preprocessors),o=Cy(r.postprocessors),a="string"==typeof e?{value:e,selection:[0,0]}:e,{elementState:i}=n({elementState:a,data:""},"validation"),l=new xy(i,r),{value:s,selection:c}=o(l,a);return"string"==typeof e?s:{value:s,selection:c}}const $y=[function(){let e="",t=0,r=null,n=!1;return o=>{const a=new ky(o);return a.listen("beforeinput",a=>{const{value:i,selectionStart:l,selectionEnd:s}=o,c="insertText"===r?.inputType&&" "===r.data&&!i.slice(0,Number(s)).endsWith(" ");"insertText"===a.inputType&&". "===a.data&&("deleteContentBackward"===r?.inputType&&n?(o.value=e,o.setSelectionRange(t,t)):c&&o.setSelectionRange(l,l)),n=c,r=a,e=i,t=Number((c?t:s)===i.length?s:l)}),()=>a.destroy()}}(),e=>{const t=new ky(e);let r=!1,n=null,o=e.value;return t.listen("keydown",({key:e})=>{r="Unidentified"===e}),t.listen("beforeinput",t=>{n=t,o=e.value}),t.listen("input",t=>{r&&n?.defaultPrevented&&"deleteContentBackward"===n.inputType&&"deleteContentBackward"===t.inputType&&(e.value=o,n=null)},{capture:!0}),()=>t.destroy()}];class zy extends my{constructor(e,t){super(),this.element=e,this.maskitoOptions=t,this.isTextArea="TEXTAREA"===this.element.nodeName,this.eventListener=new ky(this.element),this.options={...py,...this.maskitoOptions},this.preprocessor=Cy(this.options.preprocessors),this.postprocessor=Cy(this.options.postprocessors),this.teardowns=this.options.plugins.concat($y).map(e=>e(this.element,this.options)),this.upcomingElementState=null,this.updateHistory(this.elementState),this.eventListener.listen("keydown",e=>function(e){return wy(e,1,89)||wy(e,5,90)||wy(e,12,90)}(e)?(e.preventDefault(),this.redo()):function(e){return wy(e,1,90)||wy(e,8,90)}(e)?(e.preventDefault(),this.undo()):void 0),this.eventListener.listen("beforeinput",e=>{const t=e.inputType.includes("Forward");switch(this.updateHistory(this.elementState),e.inputType){case"deleteByCut":case"deleteContentBackward":case"deleteContentForward":return this.delete(function({value:e,selection:t},r){const[n,o]=t;return n!==o?[n,o]:(r?[n,o+1]:[n-1,o]).map(t=>Math.min(Math.max(t,0),e.length))}(this.elementState,t),e);case"deleteHardLineBackward":case"deleteHardLineForward":case"deleteSoftLineBackward":case"deleteSoftLineForward":return this.delete(function({value:e,selection:t},r){const[n,o]=t;if(n!==o)return[n,o];const a=r?e.slice(n).indexOf("\n")+1||e.length:e.slice(0,o).lastIndexOf("\n")+1;return[r?n:a,r?a:o]}(this.elementState,t),e);case"deleteWordBackward":case"deleteWordForward":return this.delete(function({value:e,selection:t},r){const[n,o]=t;if(n!==o)return[n,o];if(r){const t=e.slice(n),[r]=t.match(Sy)||[""],o=t.trimStart().search(Ey);return[n,-1===o?e.length:n+r.length+o]}const a=e.slice(0,o),[i]=a.match(My)||[""],l=a.trimEnd().split("").reverse().findIndex(e=>Ey.exec(e));return[-1===l?0:o-i.length-l,o]}(this.elementState,t),e);case"historyRedo":return e.preventDefault(),this.redo();case"historyUndo":return e.preventDefault(),this.undo();case"insertCompositionText":case"insertReplacementText":return;case"insertLineBreak":case"insertParagraph":return this.handleEnter(e);default:return this.insert(e.data??e.dataTransfer?.getData("text/plain")??"",e)}}),this.eventListener.listen("input",()=>{this.upcomingElementState&&!hy(this.upcomingElementState,this.elementState)&&this.updateElementState(this.upcomingElementState),this.upcomingElementState=null},{capture:!0}),this.eventListener.listen("input",({inputType:e})=>{"insertCompositionText"!==e&&(this.ensureValueFitsMask(),this.updateHistory(this.elementState))}),this.eventListener.listen("compositionend",()=>{this.ensureValueFitsMask(),this.updateHistory(this.elementState)})}destroy(){this.eventListener.destroy(),this.teardowns.forEach(e=>e?.())}delete(e,t){const r=t?.inputType.includes("Forward"),n={value:this.elementState.value,selection:e},{elementState:o}=this.preprocessor({elementState:n,data:""},r?"deleteForward":"deleteBackward"),a=new xy(o,this.options);a.deleteCharacters();const i=this.postprocessor(a,n);if(function(e,...t){return t.every(({value:t})=>t===e.value)}(n,o,a,i)){const[e,n]=o.selection;return t?.preventDefault(),this.updateSelectionRange(r?[n,n]:[e,e])}this.upcomingElementState=i}insert(e,t){const{options:r,maxLength:n,elementState:o}=this,[a,i]=o.selection,{elementState:l,data:s=e}=this.preprocessor({data:e,elementState:o},"insert"),c=new xy(l,r);try{c.addCharacters(s)}catch{return t?.preventDefault()}this.upcomingElementState=this.clampState(this.postprocessor(c,o)),o.value.length>=n&&a===i&&("replace"!==r.overwriteMode||hy(this.upcomingElementState,o)?this.upcomingElementState=null:this.dispatchInputEvent({inputType:"insertText",data:e}))}updateElementState({value:e,selection:t},r){const n=this.elementState.value;this.updateValue(e),this.updateSelectionRange(t),r&&n!==e&&this.dispatchInputEvent(r)}get elementState(){const{value:e,selectionStart:t,selectionEnd:r}=this.element;return{value:e,selection:[t??0,r??0]}}get maxLength(){const{maxLength:e}=this.element;return-1===e?1/0:e}updateSelectionRange([e,t]){const{element:r}=this;!r.matches(":focus")||r.selectionStart===e&&r.selectionEnd===t||r.setSelectionRange(e,t)}updateValue(e){(this.element.value!==e||this.element.isContentEditable)&&(this.element.value=e)}ensureValueFitsMask(){this.updateElementState(Oy(this.elementState,this.options),{inputType:"insertText",data:null})}dispatchInputEvent(e={inputType:"insertText",data:null}){this.element.dispatchEvent(new InputEvent("input",{...e,bubbles:!0,cancelable:!1}))}handleEnter(e){(this.isTextArea||this.element.isContentEditable)&&this.insert("\n",e)}clampState({value:e,selection:t}){const[r,n]=t,o=this.maxLength;return{value:e.slice(0,o),selection:[Math.min(r,o),Math.min(n,o)]}}}const Dy="undefined"==typeof window?h().useEffect:h().useLayoutEffect,jy=mo("TextInput",["control","leftAdornment","rightAdornment"]);const Ry=v().input`
|
|
2079
2079
|
${({theme:e,isMobile:t})=>hb({theme:e,isMobile:t,isFocusable:!1})};
|
|
2080
2080
|
|
|
2081
2081
|
border: 0;
|
|
@@ -2137,7 +2137,7 @@
|
|
|
2137
2137
|
border-color: transparent;
|
|
2138
2138
|
}
|
|
2139
2139
|
`};
|
|
2140
|
-
`,Ay=(0,h().forwardRef)((e,t)=>{var{ariaDescribedBy:r,autoComplete:n,className:a,defaultValue:i,disabled:l,hint:s,id:c,inputMode:d,label:u,leftAdornment:p,tooltip:m,toggletip:f,name:g,noMargin:b,pattern:v,placeholder:y,readOnly:_,required:x,requiredLabelType:k,rightAdornment:w,type:M,valid:S,validationErrorMessage:E,value:C,onBlur:O,onChange:z,onFocus:D,onInvalid:j,onKeyUp:R,onKeyDown:F,onMouseUp:N,onPaste:P}=e,T=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["ariaDescribedBy","autoComplete","className","defaultValue","disabled","hint","id","inputMode","label","leftAdornment","tooltip","toggletip","name","noMargin","pattern","placeholder","readOnly","required","requiredLabelType","rightAdornment","type","valid","validationErrorMessage","value","onBlur","onChange","onFocus","onInvalid","onKeyUp","onKeyDown","onMouseUp","onPaste"]);const{isMobile:A}=$(),{t:L}=I("text-input"),[{validity:V},H]=(0,h().useState)({validity:null==S||S}),q=as(c),U=Pn(T),B=(0,h().useRef)(null),W=qs([{id:r},{id:`${q}_invalid`,include:!V},{id:`${q}_hint`,include:!!s}]),Y=(0,h().useCallback)(e=>{void 0===S&&(x&&""===e.currentTarget.value?H({validity:!0}):H({validity:e.currentTarget.checkValidity()})),null==O||O(e)},[O,S,x]),G=(0,h().useCallback)(e=>{void 0===S&&H({validity:!1}),null==j||j(e)},[j,S]),K=(0,h().useCallback)(e=>{null==z||z(e)},[z]),Q=(0,h().useCallback)(e=>{null==D||D(e)},[D]);(0,h().useImperativeHandle)(t,()=>B.current);const X=()=>{var e;null===(e=B.current)||void 0===e||e.focus()};return(0,h().useEffect)(()=>{void 0!==S&&H({validity:S})},[S]),(0,o().jsx)(Yd,{className:a,noMargin:b,fieldId:q,label:u,required:x,requiredLabelType:k,tooltip:m,toggletip:f,valid:V,validationErrorMessage:E||L("validationErrorMessage"),hint:s,"data-testid":"field-container",children:(0,o().jsxs)(Ty,{className:jy.control,$disabled:l,$valid:V,$readOnly:_,children:[p&&(0,o().jsx)(Ny,{className:jy.leftAdornment,onClick:X,$isMobile:A,children:p}),(0,o().jsx)(Ry,Object.assign({"aria-describedby":W||void 0,"aria-invalid":!V||void 0,autoComplete:n,"data-testid":"text-input",isMobile:A,defaultValue:i,disabled:l,id:q,inputMode:d,name:g,ref:B,onBlur:Y,onChange:K,onFocus:Q,onMouseUp:N,onKeyUp:R,onKeyDown:F,onInvalid:G,onPaste:P,pattern:v,placeholder:y,readOnly:_,required:x,type:M||"text",value:C},U)),w&&(0,o().jsx)(Py,{className:jy.rightAdornment,onClick:X,$isMobile:A,children:w})]})})});function Ly(e){return"mask"in e&&"pattern"in e}function Iy(e,t){return Oy(e,t)}function Vy(e,t,r){const n=function(e,...t){return t.reduce((e,t)=>e>t?e:t,e)}(t??e,e);return function(e,...t){return t.reduce((e,t)=>e<t?e:t,e)}(r??n,n)}Ay.displayName="TextInput";const Hy={day:31,month:12,year:9999},qy=new Date("0001-01-01T00:00"),Uy=new Date("9999-12-31T23:59:59.999"),By=e=>({day:e.match(/d/g)?.length??0,month:e.match(/m/g)?.length??0,year:e.match(/y/g)?.length??0});function Wy(e){return{day:String(e.getDate()).padStart(2,"0"),month:String(e.getMonth()+1).padStart(2,"0"),year:String(e.getFullYear()).padStart(4,"0"),hours:String(e.getHours()).padStart(2,"0"),minutes:String(e.getMinutes()).padStart(2,"0"),seconds:String(e.getSeconds()).padStart(2,"0"),milliseconds:String(e.getMilliseconds()).padStart(3,"0")}}const Yy=["day","month","year"];function Gy(e,t){return!(e.length<t.length)&&e.split(/\D/).every(e=>!/^0+$/.exec(e))}function Ky(e,t,r){const n=t.replaceAll(/\W/g,"").length;return e.replace(r,"").match(new RegExp(String.raw`(\D*\d[^\d\s]*){1,${n}}`,"g"))||[]}function Qy(e,t){const r=t.replaceAll(/[^dmy]/g,""),n=e.replaceAll(/\D+/g,""),o={day:n.slice(r.indexOf("d"),r.lastIndexOf("d")+1),month:n.slice(r.indexOf("m"),r.lastIndexOf("m")+1),year:n.slice(r.indexOf("y"),r.lastIndexOf("y")+1)};return Object.fromEntries(Object.entries(o).filter(([e,t])=>Boolean(t)).sort(([e],[r])=>t.toLowerCase().indexOf(e.slice(0,1))>t.toLowerCase().indexOf(r.slice(0,1))?1:-1))}function Xy(e,t){const r=2===e.year?.length?`20${e.year}`:e.year,n=new Date(Number(r??"0"),Number(e.month??"1")-1,Number(e.day??"1"),Number(t?.hours??"0"),Number(t?.minutes??"0"),Number(t?.seconds??"0"),Number(t?.milliseconds??"0"));return n.setFullYear(Number(r??"0")),n}function Zy({day:e,month:t,year:r,hours:n,minutes:o,seconds:a,milliseconds:i},{dateMode:l,dateTimeSeparator:s=", ",timeMode:c}){const d=l.match(/y/g)?.length??0;return`${l}${c?`${s}${c}`:""}`.replaceAll(/d+/g,e??"").replaceAll(/m+/g,t??"").replaceAll(/y+/g,r?.slice(-d)??"").replaceAll(/H+/g,n??"").replaceAll("MSS",i??"").replaceAll(/M+/g,o??"").replaceAll(/S+/g,a??"").replaceAll(/^\D+/g,"").replaceAll(/\D+$/g,"")}function Jy({dateString:e,dateModeTemplate:t,dateSeparator:r,offset:n,selection:[o,a]}){const i=Qy(e,t),l=Object.entries(i),s=(c=t,[...Yy].sort((e,t)=>c.indexOf(e[0])>c.indexOf(t[0])?1:-1));var c;const d={};for(let e=0;e<l.length;e++){const[i,c]=l[e],u=Zy(d,{dateMode:t}),p=Hy[i],m=u.length&&r.length,h=n+u.length+m+By(t)[i],f=h>=o&&h===a;if(f&&Number(c)>Number(p)){const t=s[s.indexOf(i)+1];if(!t||"year"===t)return{validatedDateString:"",updatedSelection:[o,a]};d[i]=`0${c.slice(0,-1)}`,l[e+1]=[t,`${c.slice(-1)}${(l[e+1]?.[1]??"").slice(1)}`];continue}if(f&&Number(c)<1)return{validatedDateString:"",updatedSelection:[o,a]};d[i]=c}const u=Zy(d,{dateMode:t}),p=u.length-e.length;return{validatedDateString:u,updatedSelection:[o+p,a+p]}}const e_=/[\\^$.*+?()[\]{}|]/g,t_=new RegExp(e_.source);const r_=/^0+$/;function n_(e,t,r=0){const n=e.padEnd(t.length,"0");if(Number(n)<=Number(t))return{validatedSegmentValue:e,prefixedZeroesCount:r};if(n.endsWith("0"))return n_(`0${e.slice(0,t.length-1)}`,t,r+1);const o=e.slice(0,t.length-1);return r_.exec(o)?{validatedSegmentValue:"",prefixedZeroesCount:r}:n_(`${o}0`,t,r)}function o_(e){return e.replaceAll(/[0-9]/g,e=>String.fromCharCode(e.charCodeAt(0)-65248))}function a_({dateModeTemplate:e,dateSeparator:t,splitFn:r,uniteFn:n}){return({value:o,selection:a})=>{const[i,l]=a,{dateStrings:s,restPart:c=""}=r(o),d=[];let u=0;s.forEach(t=>{const r=Qy(t,e),n=Object.entries(r).reduce((e,[t,r])=>{const{validatedSegmentValue:n,prefixedZeroesCount:o}=n_(r,`${Hy[t]}`);return u+=o,{...e,[t]:n}},{});d.push(Zy(n,{dateMode:e}))});const p=`${n(d,o)}${s[s.length-1]?.endsWith(t)?t:""}${c}`;return u&&p.slice(l+u,l+u+t.length)===t&&(u+=t.length),{selection:[i+u,l+u],value:p}}}function i_(e,t){const r=By(t);return Object.fromEntries(Object.entries(e).map(([e,t])=>{const n=r[e];return[e,t.length===n&&/^0+$/.exec(t)?"1".padStart(n,"0"):t]}))}function l_({dateModeTemplate:e,min:t,max:r,dateSeparator:n,rangeSeparator:o=""}){return({value:a,selection:i})=>{const l=o&&a.endsWith(o),s=Ky(a,e,o);let c="";for(const a of s){c+=c?o:"";const i=Qy(a,e);Gy(a,e)?c+=Zy(Wy(Vy(Xy({year:"1972",...i}),t,r)),{dateMode:e}):c+=`${Zy(i_(i,e),{dateMode:e})}${a.endsWith(n)?n:""}`}return{selection:i,value:`${c}${l?o:""}`}}}function s_({dateModeTemplate:e,dateSeparator:t,rangeSeparator:r="",dateTimeSeparator:n=", "}){return({elementState:o,data:a})=>{const i=e.split(t),l=a.includes(n),s=a.slice(0,l?a.indexOf(n):1/0).split(/\D/).filter(Boolean);if(!s.length||s.length%i.length!==0)return{elementState:o,data:a};const c=s.reduce((e,r,n)=>{const o=i[n%i.length]??"",a=Math.trunc(n/i.length),l=n%i.length===i.length-1;return e[a]||(e[a]=""),e[a]+=l?r:`${r.padStart(o.length,"0")}${t}`,e},[]);return{elementState:o,data:l?`${c[0]}${a.slice(a.indexOf(n))}`:c.join(r)}}}const c_=/\d/,d_=/\D/;function u_({dateModeTemplate:e,dateSeparator:t,rangeSeparator:r=""}){return({elementState:n,data:o})=>{const{value:a,selection:i}=n;if(o===t)return{elementState:n,data:i[0]===a.length?o:""};if(!o.replaceAll(/\D/g,""))return{elementState:n,data:o};const l=o.replaceAll(new RegExp(String.raw`[^\d${d=t,d&&t_.test(d)?d.replaceAll(e_,String.raw`\$&`):d}${r}]`,"g"),""),[s,c]=function(e,[t,r]){if(t!==r||t<=0||!c_.test(e.charAt(t-1)))return[t,r];let n=t;for(;n<e.length&&d_.test(e.charAt(n));)n++;return[n,n]}(a,i);var d;let u=c+o.length;const p=`${a.slice(0,s)}${l}${a.slice(u)}`,m=Ky(p,e,r);let h="";const f=Boolean(r)&&p.includes(r);for(const o of m){const{validatedDateString:a,updatedSelection:i}=Jy({dateString:o,dateModeTemplate:e,dateSeparator:t,offset:h.length,selection:[s,u]});if(o&&!a)return{elementState:n,data:""};u=i[1],h+=f&&!h?`${a}${r}`:a}const g=h.slice(s,u);return{elementState:{selection:[s,c],value:`${h.slice(0,s)}${g.split(t).map(e=>"0".repeat(e.length)).join(t)}${h.slice(u)}`},data:g}}}function p_(e=""){return({elementState:t},r)=>{const{value:n,selection:o}=t;if(!n||((t,[r,n])=>n>=t.length-e.length)(n,o))return{elementState:t};const[a,i]=o,l=n.slice(a,i).replaceAll(/\d/g,"0"),s=`${n.slice(0,a)}${l}${n.slice(i)}`;return l.replaceAll(/\D/g,"")?"validation"===r||"insert"===r&&a===i?{elementState:{selection:o,value:s}}:{elementState:{selection:"deleteBackward"===r||"insert"===r?[a,a]:[i,i],value:s}}:{elementState:t}}}function m_({locale:e="",mode:t,separator:r,min:n=qy,max:o=Uy}){const a=e?function(e){const t=new Date(1970,0,2),r=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(t),n=r.find(e=>"literal"===e.type)?.value??".",o={day:"dd",month:"mm",year:"yyyy"};return{mode:r.filter(e=>"year"===e.type||"month"===e.type||"day"===e.type).map(e=>o[e.type]).join("/"),separator:n}}(e):null;return{locale:e,mode:t??a?.mode??"dd/mm/yyyy",separator:r??a?.separator??".",min:n,max:o}}const h_=Intl.DateTimeFormat("en-US",{month:"2-digit",day:"2-digit",year:"numeric"});function f_(e){function t(t){return"string"==typeof e[t]}return e=>{function r(r){const{key:n}=r,{selectionStart:o,selectionEnd:a,value:i}=e;if(null!==o&&null!==a&&o===a)if("Backspace"===n){let n=o-1;if(n<0||!t(n))return;for(;n>0&&t(n-1);)n-=1;if(0===n)return;i.slice(o).split("").some((e,r)=>!t(o+r))?e.setSelectionRange(n,n):(r.preventDefault(),e.setRangeText("",n-1,o,"end"),e.dispatchEvent(new Event("input",{bubbles:!0})))}else if("Delete"===n){let r=o;if(r>=i.length||!t(r))return;for(;r<i.length-1&&t(r+1);)r+=1;r<i.length-1&&e.setSelectionRange(r+1,r+1)}}return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})}}function g_(e){const t=function(e){var t,r;return null!==(r=null===(t=e.match(/[^a-z^A-Z]/))||void 0===t?void 0:t[0])&&void 0!==r?r:"-"}(e),r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{mode:e.toLocaleLowerCase().replace(new RegExp(r,"g"),"/"),separator:t}}function b_(e){return Array.isArray(e)?[f_(e)]:[]}function v_(...e){return[...e]}function y_(e,...t){const r=[...t];var n;return Array.isArray(e)&&r.push((n=e,(e,t)=>{const{value:r,selection:o}=e;let a=o[1],i=r;if(!(o[1]>t.selection[0])||a!==r.length||o[0]!==o[1])return e;for(;a<n.length&&"string"==typeof n[a];)i=i.slice(0,a)+n[a]+i.slice(a),a+=1;return{value:i,selection:[a,a]}})),r}function __(e){return e||[]}function x_(e,t){return[...__(e),...__(t)]}new Date(1970,0,1,1,45,30,123),new Date(1970,0,1,13,45,30,123);const k_="()- /.",w_=v().div`
|
|
2140
|
+
`,Ay=(0,h().forwardRef)((e,t)=>{var{ariaDescribedBy:r,autoComplete:n,className:a,defaultValue:i,disabled:l,hint:s,id:c,inputMode:d,label:u,leftAdornment:p,tooltip:m,toggletip:f,name:g,noMargin:b,pattern:v,placeholder:y,readOnly:_,required:x,requiredLabelType:k,rightAdornment:w,type:M,valid:S,validationErrorMessage:E,value:C,onBlur:O,onChange:z,onFocus:D,onInvalid:j,onKeyUp:R,onKeyDown:F,onMouseUp:N,onPaste:P}=e,T=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["ariaDescribedBy","autoComplete","className","defaultValue","disabled","hint","id","inputMode","label","leftAdornment","tooltip","toggletip","name","noMargin","pattern","placeholder","readOnly","required","requiredLabelType","rightAdornment","type","valid","validationErrorMessage","value","onBlur","onChange","onFocus","onInvalid","onKeyUp","onKeyDown","onMouseUp","onPaste"]);const{isMobile:A}=$(),{t:L}=I("text-input"),[{validity:V},H]=(0,h().useState)({validity:null==S||S}),q=as(c),U=Pn(T),B=(0,h().useRef)(null),W=qs([{id:r},{id:`${q}_invalid`,include:!V},{id:`${q}_hint`,include:!!s}]),Y=(0,h().useCallback)(e=>{void 0===S&&(x&&""===e.currentTarget.value?H({validity:!0}):H({validity:e.currentTarget.checkValidity()})),null==O||O(e)},[O,S,x]),G=(0,h().useCallback)(e=>{void 0===S&&H({validity:!1}),null==j||j(e)},[j,S]),K=(0,h().useCallback)(e=>{null==z||z(e)},[z]),Q=(0,h().useCallback)(e=>{null==D||D(e)},[D]);(0,h().useImperativeHandle)(t,()=>B.current);const X=()=>{var e;null===(e=B.current)||void 0===e||e.focus()};return(0,h().useEffect)(()=>{void 0!==S&&H({validity:S})},[S]),(0,o().jsx)(Yd,{className:a,noMargin:b,fieldId:q,label:u,required:x,requiredLabelType:k,tooltip:m,toggletip:f,valid:V,validationErrorMessage:E||L("validationErrorMessage"),hint:s,"data-testid":"field-container",children:(0,o().jsxs)(Ty,{className:jy.control,$disabled:l,$valid:V,$readOnly:_,children:[p&&(0,o().jsx)(Ny,{className:jy.leftAdornment,onClick:X,$isMobile:A,children:p}),(0,o().jsx)(Ry,Object.assign({"aria-describedby":W||void 0,"aria-invalid":!V||void 0,autoComplete:n,"data-testid":"text-input",isMobile:A,defaultValue:i,disabled:l,id:q,inputMode:d,name:g,ref:B,onBlur:Y,onChange:K,onFocus:Q,onMouseUp:N,onKeyUp:R,onKeyDown:F,onInvalid:G,onPaste:P,pattern:v,placeholder:y,readOnly:_,required:x,type:M||"text",value:C},U)),w&&(0,o().jsx)(Py,{className:jy.rightAdornment,onClick:X,$isMobile:A,children:w})]})})});function Ly(e){return"mask"in e&&"pattern"in e}function Iy(e,t){return Oy(e,t)}function Vy(e,t,r){const n=function(e,...t){return t.reduce((e,t)=>e>t?e:t,e)}(t??e,e);return function(e,...t){return t.reduce((e,t)=>e<t?e:t,e)}(r??n,n)}Ay.displayName="TextInput";const Hy={day:31,month:12,year:9999},qy=new Date("0001-01-01T00:00"),Uy=new Date("9999-12-31T23:59:59.999"),By=e=>({day:e.match(/d/g)?.length??0,month:e.match(/m/g)?.length??0,year:e.match(/y/g)?.length??0});function Wy(e){return{day:String(e.getDate()).padStart(2,"0"),month:String(e.getMonth()+1).padStart(2,"0"),year:String(e.getFullYear()).padStart(4,"0"),hours:String(e.getHours()).padStart(2,"0"),minutes:String(e.getMinutes()).padStart(2,"0"),seconds:String(e.getSeconds()).padStart(2,"0"),milliseconds:String(e.getMilliseconds()).padStart(3,"0")}}const Yy=["day","month","year"];function Gy(e,t){return!(e.length<t.length)&&e.split(/\D/).every(e=>!/^0+$/.exec(e))}function Ky(e,t,r){const n=t.replaceAll(/\W/g,"").length;return e.replace(r,"").match(new RegExp(String.raw`(\D*\d[^\d\s]*){1,${n}}`,"g"))||[]}function Qy(e,t){const r=t.replaceAll(/[^dmy]/g,""),n=e.replaceAll(/\D+/g,""),o={day:n.slice(r.indexOf("d"),r.lastIndexOf("d")+1),month:n.slice(r.indexOf("m"),r.lastIndexOf("m")+1),year:n.slice(r.indexOf("y"),r.lastIndexOf("y")+1)};return Object.fromEntries(Object.entries(o).filter(([e,t])=>Boolean(t)).sort(([e],[r])=>t.toLowerCase().indexOf(e.slice(0,1))>t.toLowerCase().indexOf(r.slice(0,1))?1:-1))}function Xy(e,t){const r=2===e.year?.length?`20${e.year}`:e.year,n=new Date(Number(r??"0"),Number(e.month??"1")-1,Number(e.day??"1"),Number(t?.hours??"0"),Number(t?.minutes??"0"),Number(t?.seconds??"0"),Number(t?.milliseconds??"0"));return n.setFullYear(Number(r??"0")),n}function Zy({day:e,month:t,year:r,hours:n,minutes:o,seconds:a,milliseconds:i},{dateMode:l,dateTimeSeparator:s=", ",timeMode:c,timeSeparators:d=[]}){const u=l.match(/y/g)?.length??0;return`${l.replaceAll(/d+/g,e??"").replaceAll(/m+/g,t??"").replaceAll(/y+/g,r?.slice(-u)??"")}${c?`${s}${function(e,{mode:t,separators:r}){return function({mode:e,separators:t}){let r=0;return e.replaceAll(/[:.]/g,e=>t[r++]??e)}({mode:t,separators:r}).replaceAll(/H+/g,e.hours??"").replaceAll("MSS",e.milliseconds??"").replaceAll(/M+/g,e.minutes??"").replaceAll(/S+/g,e.seconds??"").replace(/^\D*/,"").replace(/\D*$/,"")}({hours:n,minutes:o,seconds:a,milliseconds:i},{mode:c,separators:d})}`:""}`.replaceAll(/^\D+/g,"").replaceAll(/\D+$/g,"")}function Jy({dateString:e,dateModeTemplate:t,dateSeparator:r,offset:n,selection:[o,a]}){const i=Qy(e,t),l=Object.entries(i),s=(c=t,[...Yy].sort((e,t)=>c.indexOf(e[0])>c.indexOf(t[0])?1:-1));var c;const d={};for(let e=0;e<l.length;e++){const[i,c]=l[e],u=Zy(d,{dateMode:t}),p=Hy[i],m=u.length&&r.length,h=n+u.length+m+By(t)[i],f=h>=o&&h===a;if(f&&Number(c)>Number(p)){const t=s[s.indexOf(i)+1];if(!t||"year"===t)return{validatedDateString:"",updatedSelection:[o,a]};d[i]=`0${c.slice(0,-1)}`,l[e+1]=[t,`${c.slice(-1)}${(l[e+1]?.[1]??"").slice(1)}`];continue}if(f&&Number(c)<1)return{validatedDateString:"",updatedSelection:[o,a]};d[i]=c}const u=Zy(d,{dateMode:t}),p=u.length-e.length;return{validatedDateString:u,updatedSelection:[o+p,a+p]}}const e_=/[\\^$.*+?()[\]{}|]/g,t_=new RegExp(e_.source);const r_=/^0+$/;function n_(e,t,r=0){const n=e.padEnd(t.length,"0");if(Number(n)<=Number(t))return{validatedSegmentValue:e,prefixedZeroesCount:r};if(n.endsWith("0"))return n_(`0${e.slice(0,t.length-1)}`,t,r+1);const o=e.slice(0,t.length-1);return r_.exec(o)?{validatedSegmentValue:"",prefixedZeroesCount:r}:n_(`${o}0`,t,r)}function o_(e){return e.replaceAll(/[0-9]/g,e=>String.fromCharCode(e.charCodeAt(0)-65248))}function a_({dateModeTemplate:e,dateSeparator:t,splitFn:r,uniteFn:n}){return({value:o,selection:a})=>{const[i,l]=a,{dateStrings:s,restPart:c=""}=r(o),d=[];let u=0;s.forEach(t=>{const r=Qy(t,e),n=Object.entries(r).reduce((e,[t,r])=>{const{validatedSegmentValue:n,prefixedZeroesCount:o}=n_(r,`${Hy[t]}`);return u+=o,{...e,[t]:n}},{});d.push(Zy(n,{dateMode:e}))});const p=`${n(d,o)}${s[s.length-1]?.endsWith(t)?t:""}${c}`;return u&&p.slice(l+u,l+u+t.length)===t&&(u+=t.length),{selection:[i+u,l+u],value:p}}}function i_(e,t){const r=By(t);return Object.fromEntries(Object.entries(e).map(([e,t])=>{const n=r[e];return[e,t.length===n&&/^0+$/.exec(t)?"1".padStart(n,"0"):t]}))}function l_({dateModeTemplate:e,min:t,max:r,dateSeparator:n,rangeSeparator:o=""}){return({value:a,selection:i})=>{const l=o&&a.endsWith(o),s=Ky(a,e,o);let c="";for(const a of s){c+=c?o:"";const i=Qy(a,e);Gy(a,e)?c+=Zy(Wy(Vy(Xy({year:"1972",...i}),t,r)),{dateMode:e}):c+=`${Zy(i_(i,e),{dateMode:e})}${a.endsWith(n)?n:""}`}return{selection:i,value:`${c}${l?o:""}`}}}function s_({dateModeTemplate:e,dateSeparator:t,rangeSeparator:r="",dateTimeSeparator:n=", "}){return({elementState:o,data:a})=>{const i=e.split(t),l=a.includes(n),s=a.slice(0,l?a.indexOf(n):1/0).split(/\D/).filter(Boolean);if(!s.length||s.length%i.length!==0)return{elementState:o,data:a};const c=s.reduce((e,r,n)=>{const o=i[n%i.length]??"",a=Math.trunc(n/i.length),l=n%i.length===i.length-1;return e[a]||(e[a]=""),e[a]+=l?r:`${r.padStart(o.length,"0")}${t}`,e},[]);return{elementState:o,data:l?`${c[0]}${a.slice(a.indexOf(n))}`:c.join(r)}}}const c_=/\d/,d_=/\D/;function u_({dateModeTemplate:e,dateSeparator:t,rangeSeparator:r=""}){return({elementState:n,data:o})=>{const{value:a,selection:i}=n;if(o===t){if(i[0]!==a.length)return{elementState:n,data:""};const l=Ky(a,e,r),s=l[l.length-1]??"",c=function({dateString:e,dateModeTemplate:t,dateSeparator:r}){const n=e.split(r),o=n.length-1,a=n[o]??"",i=t.split(r)[o];return i&&!i.includes("y")&&/^[1-9]$/.test(a)?`${e.slice(0,-a.length)}${a.padStart(i.length,"0")}`:e}({dateString:s,dateModeTemplate:e,dateSeparator:t}),d=c.length-s.length;return{elementState:d?{value:`${a.slice(0,-s.length)}${c}`,selection:[i[0]+d,i[1]+d]}:n,data:o}}if(!o.replaceAll(/\D/g,""))return{elementState:n,data:o};const l=o.replaceAll(new RegExp(String.raw`[^\d${d=t,d&&t_.test(d)?d.replaceAll(e_,String.raw`\$&`):d}${r}]`,"g"),""),[s,c]=function(e,[t,r]){if(t!==r||t<=0||!c_.test(e.charAt(t-1)))return[t,r];let n=t;for(;n<e.length&&d_.test(e.charAt(n));)n++;return[n,n]}(a,i);var d;let u=c+o.length;const p=`${a.slice(0,s)}${l}${a.slice(u)}`,m=Ky(p,e,r);let h="";const f=Boolean(r)&&p.includes(r);for(const o of m){const{validatedDateString:a,updatedSelection:i}=Jy({dateString:o,dateModeTemplate:e,dateSeparator:t,offset:h.length,selection:[s,u]});if(o&&!a)return{elementState:n,data:""};u=i[1],h+=f&&!h?`${a}${r}`:a}const g=h.slice(s,u);return{elementState:{selection:[s,c],value:`${h.slice(0,s)}${g.split(t).map(e=>"0".repeat(e.length)).join(t)}${h.slice(u)}`},data:g}}}function p_(e=""){return({elementState:t},r)=>{const{value:n,selection:o}=t;if(!n||((t,[r,n])=>n>=t.length-e.length)(n,o))return{elementState:t};const[a,i]=o,l=n.slice(a,i).replaceAll(/\d/g,"0"),s=`${n.slice(0,a)}${l}${n.slice(i)}`;return l.replaceAll(/\D/g,"")?"validation"===r||"insert"===r&&a===i?{elementState:{selection:o,value:s}}:{elementState:{selection:"deleteBackward"===r||"insert"===r?[a,a]:[i,i],value:s}}:{elementState:t}}}function m_({locale:e="",mode:t,separator:r,min:n=qy,max:o=Uy}){const a=e?function(e){const t=new Date(1970,0,2),r=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(t),n=r.find(e=>"literal"===e.type)?.value??".",o={day:"dd",month:"mm",year:"yyyy"};return{mode:r.filter(e=>"year"===e.type||"month"===e.type||"day"===e.type).map(e=>o[e.type]).join("/"),separator:n}}(e):null;return{locale:e,mode:t??a?.mode??"dd/mm/yyyy",separator:r??a?.separator??".",min:n,max:o}}const h_=Intl.DateTimeFormat("en-US",{month:"2-digit",day:"2-digit",year:"numeric"});function f_(e){function t(t){return"string"==typeof e[t]}return e=>{function r(r){const{key:n}=r,{selectionStart:o,selectionEnd:a,value:i}=e;if(null!==o&&null!==a&&o===a)if("Backspace"===n){let n=o-1;if(n<0||!t(n))return;for(;n>0&&t(n-1);)n-=1;if(0===n)return;i.slice(o).split("").some((e,r)=>!t(o+r))?e.setSelectionRange(n,n):(r.preventDefault(),e.setRangeText("",n-1,o,"end"),e.dispatchEvent(new Event("input",{bubbles:!0})))}else if("Delete"===n){let r=o;if(r>=i.length||!t(r))return;for(;r<i.length-1&&t(r+1);)r+=1;r<i.length-1&&e.setSelectionRange(r+1,r+1)}}return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})}}function g_(e){const t=function(e){var t,r;return null!==(r=null===(t=e.match(/[^a-z^A-Z]/))||void 0===t?void 0:t[0])&&void 0!==r?r:"-"}(e),r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{mode:e.toLocaleLowerCase().replace(new RegExp(r,"g"),"/"),separator:t}}function b_(e){return Array.isArray(e)?[f_(e)]:[]}function v_(...e){return[...e]}function y_(e,...t){const r=[...t];var n;return Array.isArray(e)&&r.push((n=e,(e,t)=>{const{value:r,selection:o}=e;let a=o[1],i=r;if(!(o[1]>t.selection[0])||a!==r.length||o[0]!==o[1])return e;for(;a<n.length&&"string"==typeof n[a];)i=i.slice(0,a)+n[a]+i.slice(a),a+=1;return{value:i,selection:[a,a]}})),r}function __(e){return e||[]}function x_(e,t){return[...__(e),...__(t)]}new Date(1970,0,1,1,45,30,123),new Date(1970,0,1,13,45,30,123);const k_="()- /.",w_=v().div`
|
|
2141
2141
|
background: ${({theme:e})=>e.component["masked-input-background-color"]};
|
|
2142
2142
|
bottom: 0;
|
|
2143
2143
|
color: ${({theme:e})=>e.component["masked-input-mask-text-color"]};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equisoft/design-elements-react",
|
|
3
|
-
"version": "10.4.2-snapshot.
|
|
3
|
+
"version": "10.4.2-snapshot.20261005130729",
|
|
4
4
|
"description": "React implementation of the Equisoft design system.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"main": "dist/bundle.js",
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
"@floating-ui/react": "0.27.20",
|
|
33
33
|
"@floating-ui/react-dom": "2.1.9",
|
|
34
34
|
"@floating-ui/utils": "0.2.12",
|
|
35
|
-
"@maskito/core": "5.
|
|
36
|
-
"@maskito/kit": "5.
|
|
37
|
-
"@maskito/react": "5.
|
|
35
|
+
"@maskito/core": "5.6.0",
|
|
36
|
+
"@maskito/kit": "5.6.0",
|
|
37
|
+
"@maskito/react": "5.6.0",
|
|
38
38
|
"@mui/base": "5.0.0-beta.70",
|
|
39
39
|
"@tanstack/react-table": "8.21.3",
|
|
40
40
|
"date-fns": "4.4.0",
|
|
41
|
-
"lucide-react": "1.
|
|
41
|
+
"lucide-react": "1.48.0",
|
|
42
42
|
"prop-types": "15.8.1",
|
|
43
43
|
"react-datepicker": "9.1.0",
|
|
44
44
|
"react-is": "18.3.1",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
"@types/react-dom": "18.3.7",
|
|
75
75
|
"@types/react-modal": "3.16.3",
|
|
76
76
|
"@types/styled-components": "5.1.36",
|
|
77
|
-
"@typescript-eslint/eslint-plugin": "8.70.
|
|
78
|
-
"@typescript-eslint/parser": "8.70.
|
|
77
|
+
"@typescript-eslint/eslint-plugin": "8.70.1",
|
|
78
|
+
"@typescript-eslint/parser": "8.70.1",
|
|
79
79
|
"cross-env": "10.1.0",
|
|
80
80
|
"css-loader": "7.1.5",
|
|
81
81
|
"eslint": "8.57.1",
|
|
@@ -96,12 +96,12 @@
|
|
|
96
96
|
"react-docgen-typescript-plugin": "1.0.8",
|
|
97
97
|
"react-dom": "18.3.1",
|
|
98
98
|
"react-router-dom": "6.30.6",
|
|
99
|
-
"sass": "1.
|
|
99
|
+
"sass": "1.105.0",
|
|
100
100
|
"sass-loader": "17.0.1",
|
|
101
101
|
"style-loader": "4.0.0",
|
|
102
102
|
"styled-components": "5.3.11",
|
|
103
103
|
"stylelint": "17.15.0",
|
|
104
|
-
"ts-jest": "29.4.
|
|
104
|
+
"ts-jest": "29.4.14",
|
|
105
105
|
"ts-loader": "9.6.2",
|
|
106
106
|
"ts-mockito": "2.6.1",
|
|
107
107
|
"typescript": "6.0.3",
|