componenteshospitais 3.0.9 → 3.1.1
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/cjs/index.js +104 -92
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +104 -92
- package/dist/esm/index.js.map +1 -1
- package/dist/types/components/InputField.d.ts +0 -1
- package/package.json +3 -1
- package/src/components/InputField.tsx +99 -84
package/dist/cjs/index.js
CHANGED
|
@@ -126,48 +126,22 @@ var Button = function (_a) {
|
|
|
126
126
|
return (React.createElement("div", { className: "".concat(empresaClass) }, type === 'submit' ? (React.createElement("input", { type: "submit", className: styles$5.inputSubmit, style: { width: largura ? "".concat(largura) : '', borderRadius: borderRadius ? "".concat(borderRadius, "px") : '' }, value: texto, disabled: disabled })) : (React.createElement("button", { type: "button", className: styles$5.inputSubmit, onClick: onClick, style: { width: largura ? "".concat(largura) : '', borderRadius: borderRadius ? "".concat(borderRadius, "px") : '' }, dangerouslySetInnerHTML: { __html: texto }, disabled: disabled }))));
|
|
127
127
|
};
|
|
128
128
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
var __assign = function() {
|
|
147
|
-
__assign = Object.assign || function __assign(t) {
|
|
148
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
149
|
-
s = arguments[i];
|
|
150
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
151
|
-
}
|
|
152
|
-
return t;
|
|
153
|
-
};
|
|
154
|
-
return __assign.apply(this, arguments);
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
function __spreadArray(to, from, pack) {
|
|
158
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
159
|
-
if (ar || !(i in from)) {
|
|
160
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
161
|
-
ar[i] = from[i];
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
168
|
-
var e = new Error(message);
|
|
169
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
170
|
-
};
|
|
129
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
130
|
+
|
|
131
|
+
function unwrapExports (x) {
|
|
132
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function createCommonjsModule(fn, module) {
|
|
136
|
+
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
var reactTextMask = createCommonjsModule(function (module, exports) {
|
|
140
|
+
!function(e,t){module.exports=t(React);}(commonjsGlobal,function(e){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t);}Object.defineProperty(t,"__esModule",{value:!0}),t.conformToMask=void 0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);}return e},l=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n);}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),f=r(3);Object.defineProperty(t,"conformToMask",{enumerable:!0,get:function(){return n(f).default}});var c=r(11),p=n(c),d=r(9),h=n(d),v=r(5),y=n(v),m=r(2),b=function(e){function t(){var e;i(this,t);for(var r=arguments.length,n=Array(r),o=0;o<r;o++)n[o]=arguments[o];var u=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(n)));return u.setRef=u.setRef.bind(u),u.onBlur=u.onBlur.bind(u),u.onChange=u.onChange.bind(u),u}return u(t,e),l(t,[{key:"setRef",value:function(e){this.inputElement=e;}},{key:"initTextMask",value:function(){var e=this.props,t=this.props.value;this.textMaskInputElement=(0, y.default)(s({inputElement:this.inputElement},e)),this.textMaskInputElement.update(t);}},{key:"componentDidMount",value:function(){this.initTextMask();}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.value,n=t.pipe,o=t.mask,i=t.guide,a=t.placeholderChar,u=t.showMask,s={guide:i,placeholderChar:a,showMask:u},l="function"==typeof n&&"function"==typeof e.pipe?n.toString()!==e.pipe.toString():(0, m.isNil)(n)&&!(0, m.isNil)(e.pipe)||!(0, m.isNil)(n)&&(0, m.isNil)(e.pipe),f=o.toString()!==e.mask.toString(),c=Object.keys(s).some(function(t){return s[t]!==e[t]})||f||l,p=r!==this.inputElement.value;(p||c)&&this.initTextMask();}},{key:"render",value:function e(){var t=this.props,e=t.render,r=o(t,["render"]);return delete r.mask,delete r.guide,delete r.pipe,delete r.placeholderChar,delete r.keepCharPositions,delete r.value,delete r.onBlur,delete r.onChange,delete r.showMask,e(this.setRef,s({onBlur:this.onBlur,onChange:this.onChange,defaultValue:this.props.value},r))}},{key:"onChange",value:function(e){this.textMaskInputElement.update(),"function"==typeof this.props.onChange&&this.props.onChange(e);}},{key:"onBlur",value:function(e){"function"==typeof this.props.onBlur&&this.props.onBlur(e);}}]),t}(p.default.PureComponent);t.default=b,b.propTypes={mask:h.default.oneOfType([h.default.array,h.default.func,h.default.bool,h.default.shape({mask:h.default.oneOfType([h.default.array,h.default.func]),pipe:h.default.func})]).isRequired,guide:h.default.bool,value:h.default.oneOfType([h.default.string,h.default.number]),pipe:h.default.func,placeholderChar:h.default.string,keepCharPositions:h.default.bool,showMask:h.default.bool},b.defaultProps={render:function(e,t){return p.default.createElement("input",s({ref:e},t))}};},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.placeholderChar="_",t.strFunction="function";},function(e,t,r){function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.placeholderChar;if(!o(e))throw new Error("Text-mask:convertMaskToPlaceholder; The mask property must be an array.");if(e.indexOf(t)!==-1)throw new Error("Placeholder character must not be used as part of the mask. Please specify a character that is not present in your mask as your placeholder character.\n\n"+("The placeholder character that was received is: "+JSON.stringify(t)+"\n\n")+("The mask that was received is: "+JSON.stringify(e)));return e.map(function(e){return e instanceof RegExp?t:e}).join("")}function o(e){return Array.isArray&&Array.isArray(e)||e instanceof Array}function i(e){return "string"==typeof e||e instanceof String}function a(e){return "number"==typeof e&&void 0===e.length&&!isNaN(e)}function u(e){return "undefined"==typeof e||null===e}function s(e){for(var t=[],r=void 0;r=e.indexOf(c),r!==-1;)t.push(r),e.splice(r,1);return {maskWithoutCaretTraps:e,indexes:t}}Object.defineProperty(t,"__esModule",{value:!0}),t.convertMaskToPlaceholder=n,t.isArray=o,t.isString=i,t.isNumber=a,t.isNil=u,t.processCaretTraps=s;var l=r(1),f=[],c="[]";},function(e,t,r){function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!(0, i.isArray)(t)){if(("undefined"==typeof t?"undefined":o(t))!==a.strFunction)throw new Error("Text-mask:conformToMask; The mask property must be an array.");t=t(e,r),t=(0, i.processCaretTraps)(t).maskWithoutCaretTraps;}var n=r.guide,l=void 0===n||n,f=r.previousConformedValue,c=void 0===f?s:f,p=r.placeholderChar,d=void 0===p?a.placeholderChar:p,h=r.placeholder,v=void 0===h?(0, i.convertMaskToPlaceholder)(t,d):h,y=r.currentCaretPosition,m=r.keepCharPositions,b=l===!1&&void 0!==c,g=e.length,k=c.length,C=v.length,O=t.length,T=g-k,P=T>0,x=y+(P?-T:0),w=x+Math.abs(T);if(m===!0&&!P){for(var S=s,_=x;_<w;_++)v[_]===d&&(S+=d);e=e.slice(0,x)+S+e.slice(x,g);}for(var M=e.split(s).map(function(e,t){return {char:e,isNew:t>=x&&t<w}}),j=g-1;j>=0;j--){var E=M[j].char;if(E!==d){var R=j>=x&&k===O;E===v[R?j-T:j]&&M.splice(j,1);}}var V=s,N=!1;e:for(var A=0;A<C;A++){var B=v[A];if(B===d){if(M.length>0)for(;M.length>0;){var I=M.shift(),F=I.char,q=I.isNew;if(F===d&&b!==!0){V+=d;continue e}if(t[A].test(F)){if(m===!0&&q!==!1&&c!==s&&l!==!1&&P){for(var D=M.length,L=null,W=0;W<D;W++){var J=M[W];if(J.char!==d&&J.isNew===!1)break;if(J.char===d){L=W;break}}null!==L?(V+=F,M.splice(L,1)):A--;}else V+=F;continue e}N=!0;}b===!1&&(V+=v.substr(A,C));break}V+=B;}if(b&&P===!1){for(var U=null,H=0;H<V.length;H++)v[H]===d&&(U=H);V=null!==U?V.substr(0,U+1):s;}return {conformedValue:V,meta:{someCharsRejected:N}}}Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=n;var i=r(2),a=r(1),u=[],s="";},function(e,t){function r(e){var t=e.previousConformedValue,r=void 0===t?o:t,i=e.previousPlaceholder,a=void 0===i?o:i,u=e.currentCaretPosition,s=void 0===u?0:u,l=e.conformedValue,f=e.rawValue,c=e.placeholderChar,p=e.placeholder,d=e.indexesOfPipedChars,h=void 0===d?n:d,v=e.caretTrapIndexes,y=void 0===v?n:v;if(0===s||!f.length)return 0;var m=f.length,b=r.length,g=p.length,k=l.length,C=m-b,O=C>0,T=0===b,P=C>1&&!O&&!T;if(P)return s;var x=O&&(r===l||l===p),w=0,S=void 0,_=void 0;if(x)w=s-C;else {var M=l.toLowerCase(),j=f.toLowerCase(),E=j.substr(0,s).split(o),R=E.filter(function(e){return M.indexOf(e)!==-1});_=R[R.length-1];var V=a.substr(0,R.length).split(o).filter(function(e){return e!==c}).length,N=p.substr(0,R.length).split(o).filter(function(e){return e!==c}).length,A=N!==V,B=void 0!==a[R.length-1]&&void 0!==p[R.length-2]&&a[R.length-1]!==c&&a[R.length-1]!==p[R.length-1]&&a[R.length-1]===p[R.length-2];!O&&(A||B)&&V>0&&p.indexOf(_)>-1&&void 0!==f[s]&&(S=!0,_=f[s]);for(var I=h.map(function(e){return M[e]}),F=I.filter(function(e){return e===_}).length,q=R.filter(function(e){return e===_}).length,D=p.substr(0,p.indexOf(c)).split(o).filter(function(e,t){return e===_&&f[t]!==e}).length,L=D+q+F+(S?1:0),W=0,J=0;J<k;J++){var U=M[J];if(w=J+1,U===_&&W++,W>=L)break}}if(O){for(var H=w,Y=w;Y<=g;Y++)if(p[Y]===c&&(H=Y),p[Y]===c||y.indexOf(Y)!==-1||Y===g)return H}else if(S){for(var z=w-1;z>=0;z--)if(l[z]===_||y.indexOf(z)!==-1||0===z)return z}else for(var G=w;G>=0;G--)if(p[G-1]===c||y.indexOf(G)!==-1||0===G)return G}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var n=[],o="";},function(e,t,r){function n(e){return e&&e.__esModule?e:{default:e}}function o(e){var t={previousConformedValue:void 0,previousPlaceholder:void 0};return {state:t,update:function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,o=n.inputElement,l=n.mask,c=n.guide,y=n.pipe,b=n.placeholderChar,g=void 0===b?h.placeholderChar:b,k=n.keepCharPositions,C=void 0!==k&&k,O=n.showMask,T=void 0!==O&&O;if("undefined"==typeof r&&(r=o.value),r!==t.previousConformedValue){("undefined"==typeof l?"undefined":s(l))===m&&void 0!==l.pipe&&void 0!==l.mask&&(y=l.pipe,l=l.mask);var P=void 0,x=void 0;if(l instanceof Array&&(P=(0, d.convertMaskToPlaceholder)(l,g)),l!==!1){var w=a(r),S=o.selectionEnd,_=t.previousConformedValue,M=t.previousPlaceholder,j=void 0;if(("undefined"==typeof l?"undefined":s(l))===h.strFunction){if(x=l(w,{currentCaretPosition:S,previousConformedValue:_,placeholderChar:g}),x===!1)return;var E=(0, d.processCaretTraps)(x),R=E.maskWithoutCaretTraps,V=E.indexes;x=R,j=V,P=(0, d.convertMaskToPlaceholder)(x,g);}else x=l;var N={previousConformedValue:_,guide:c,placeholderChar:g,pipe:y,placeholder:P,currentCaretPosition:S,keepCharPositions:C},A=(0, p.default)(w,x,N),B=A.conformedValue,I=("undefined"==typeof y?"undefined":s(y))===h.strFunction,F={};I&&(F=y(B,u({rawValue:w},N)),F===!1?F={value:_,rejected:!0}:(0, d.isString)(F)&&(F={value:F}));var q=I?F.value:B,D=(0, f.default)({previousConformedValue:_,previousPlaceholder:M,conformedValue:q,placeholder:P,rawValue:w,currentCaretPosition:S,placeholderChar:g,indexesOfPipedChars:F.indexesOfPipedChars,caretTrapIndexes:j}),L=q===P&&0===D,W=T?P:v,J=L?W:q;t.previousConformedValue=J,t.previousPlaceholder=P,o.value!==J&&(o.value=J,i(o,D));}}}}}function i(e,t){document.activeElement===e&&(b?g(function(){return e.setSelectionRange(t,t,y)},0):e.setSelectionRange(t,t,y));}function a(e){if((0, d.isString)(e))return e;if((0, d.isNumber)(e))return String(e);if(void 0===e||null===e)return v;throw new Error("The 'value' provided to Text Mask needs to be a string or a number. The value received was:\n\n "+JSON.stringify(e))}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);}return e},s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=o;var l=r(4),f=n(l),c=r(3),p=n(c),d=r(2),h=r(1),v="",y="none",m="object",b="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),g="undefined"!=typeof requestAnimationFrame?requestAnimationFrame:setTimeout;},function(e,t){function r(e){return function(){return e}}var n=function(){};n.thatReturns=r,n.thatReturnsFalse=r(!1),n.thatReturnsTrue=r(!0),n.thatReturnsNull=r(null),n.thatReturnsThis=function(){return this},n.thatReturnsArgument=function(e){return e},e.exports=n;},function(e,t,r){function n(e,t,r,n,i,a,u,s){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else {var f=[r,n,i,a,u,s],c=0;l=new Error(t.replace(/%s/g,function(){return f[c++]})),l.name="Invariant Violation";}throw l.framesToPop=1,l}}e.exports=n;},function(e,t,r){var n=r(6),o=r(7),i=r(10);e.exports=function(){function e(e,t,r,n,a,u){u!==i&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return r.checkPropTypes=n,r.PropTypes=r,r};},function(e,t,r){e.exports=r(8)();},function(e,t){var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=r;},function(t,r){t.exports=e;}])});
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
var MaskedInput = unwrapExports(reactTextMask);
|
|
144
|
+
reactTextMask.reactTextMask;
|
|
171
145
|
|
|
172
146
|
var DefaultContext = {
|
|
173
147
|
color: undefined,
|
|
@@ -240,69 +214,75 @@ function FaDownload (props) {
|
|
|
240
214
|
}
|
|
241
215
|
|
|
242
216
|
var InputField = function (_a) {
|
|
243
|
-
var type = _a.type, id = _a.id,
|
|
217
|
+
var type = _a.type, id = _a.id, placeholder = _a.placeholder, onChange = _a.onChange, value = _a.value, label = _a.label, largura = _a.largura, readonly = _a.readonly, disabled = _a.disabled, required = _a.required, checked = _a.checked, maxLength = _a.maxLength, maskType = _a.maskType, onKeyPress = _a.onKeyPress, onBlur = _a.onBlur, corFundo = _a.corFundo, corLabel = _a.corLabel, borderRadius = _a.borderRadius, colorIcon = _a.colorIcon, border = _a.border;
|
|
244
218
|
var _b = React.useState(false), isPasswordVisible = _b[0], setIsPasswordVisible = _b[1];
|
|
245
219
|
var togglePasswordVisibility = function () {
|
|
246
220
|
setIsPasswordVisible(!isPasswordVisible);
|
|
247
221
|
};
|
|
248
222
|
var appliedMaxLength = maxLength !== undefined ? maxLength : 524288;
|
|
249
|
-
// Helper function to apply masks
|
|
250
|
-
var applyMask = function (maskType, value) {
|
|
251
|
-
switch (maskType) {
|
|
252
|
-
case 'cpf':
|
|
253
|
-
return value
|
|
254
|
-
.replace(/\D/g, '') // Remove all non-digits
|
|
255
|
-
.replace(/(\d{3})(\d)/, '$1.$2') // Add dots and hyphen
|
|
256
|
-
.replace(/(\d{3})(\d)/, '$1.$2')
|
|
257
|
-
.replace(/(\d{3})(\d{1,2})$/, '$1-$2')
|
|
258
|
-
.slice(0, 14); // Limit length
|
|
259
|
-
case 'phone':
|
|
260
|
-
return value
|
|
261
|
-
.replace(/\D/g, '')
|
|
262
|
-
.replace(/(\d{2})(\d)/, '($1) $2') // Add parentheses and space
|
|
263
|
-
.replace(/(\d{5})(\d)/, '$1-$2') // Add hyphen
|
|
264
|
-
.slice(0, 15); // Limit length
|
|
265
|
-
case 'telefone':
|
|
266
|
-
return value
|
|
267
|
-
.replace(/\D/g, '')
|
|
268
|
-
.replace(/(\d{2})(\d)/, '($1) $2') // Add parentheses and space
|
|
269
|
-
.replace(/(\d{4})(\d)/, '$1-$2') // Add hyphen
|
|
270
|
-
.slice(0, 14); // Limit length
|
|
271
|
-
case 'cep':
|
|
272
|
-
return value
|
|
273
|
-
.replace(/\D/g, '')
|
|
274
|
-
.replace(/(\d{5})(\d)/, '$1-$2') // Add hyphen
|
|
275
|
-
.slice(0, 9); // Limit length
|
|
276
|
-
case 'date':
|
|
277
|
-
return value
|
|
278
|
-
.replace(/\D/g, '')
|
|
279
|
-
.replace(/(\d{2})(\d)/, '$1/$2')
|
|
280
|
-
.replace(/(\d{2})(\d)/, '$1/$2')
|
|
281
|
-
.slice(0, 10); // Limit length
|
|
282
|
-
case 'time':
|
|
283
|
-
return value
|
|
284
|
-
.replace(/\D/g, '')
|
|
285
|
-
.replace(/(\d{2})(\d)/, '$1:$2')
|
|
286
|
-
.slice(0, 5); // Limit length
|
|
287
|
-
default:
|
|
288
|
-
return value; // No mask applied
|
|
289
|
-
}
|
|
290
|
-
};
|
|
291
223
|
var handleChange = function (e) {
|
|
292
|
-
|
|
224
|
+
if (type === 'number' && e.target.value.length > appliedMaxLength) {
|
|
225
|
+
e.target.value = e.target.value.slice(0, appliedMaxLength);
|
|
226
|
+
}
|
|
293
227
|
if (onChange) {
|
|
294
|
-
onChange(
|
|
228
|
+
onChange(e);
|
|
295
229
|
}
|
|
296
230
|
};
|
|
231
|
+
var mask = maskType === 'cpf'
|
|
232
|
+
? [/\d/, /\d/, /\d/, '.', /\d/, /\d/, /\d/, '.', /\d/, /\d/, /\d/, '-', /\d/, /\d/]
|
|
233
|
+
: maskType === 'phone'
|
|
234
|
+
? ['(', /[1-9]/, /\d/, ')', ' ', /\d/, /\d/, /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/]
|
|
235
|
+
: maskType === 'time'
|
|
236
|
+
? [/\d/, /\d/, ':', /\d/, /\d/]
|
|
237
|
+
: maskType === 'date'
|
|
238
|
+
? [/\d/, /\d/, '/', /\d/, /\d/, '/', /\d/, /\d/, /\d/, /\d/]
|
|
239
|
+
: maskType === 'cep'
|
|
240
|
+
? [/\d/, /\d/, /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/]
|
|
241
|
+
: maskType === 'telefone'
|
|
242
|
+
? ['(', /\d/, /\d/, ')', ' ', /\d/, /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/]
|
|
243
|
+
: [];
|
|
297
244
|
return (React.createElement(React.Fragment, null,
|
|
298
245
|
label && React.createElement("label", { htmlFor: id, style: { color: corLabel ? corLabel : '' } }, label),
|
|
299
246
|
React.createElement("div", { className: styles$5.inputWrapper },
|
|
300
|
-
React.createElement(
|
|
247
|
+
maskType ? (React.createElement(MaskedInput, { mask: mask, value: value, onChange: handleChange, disabled: disabled, id: id, name: id, placeholder: placeholder, className: styles$5.inputPadrao, style: {
|
|
301
248
|
width: largura ? "".concat(largura) : '',
|
|
302
|
-
backgroundColor: disabled ? '#e5e5e5' : (corFundo ? corFundo : ''),
|
|
303
|
-
borderRadius: borderRadius ? "".concat(borderRadius, "px") : '',
|
|
304
|
-
border: border ? border : ''
|
|
305
|
-
}, readOnly: readonly,
|
|
249
|
+
backgroundColor: (disabled ? '#e5e5e5' : (corFundo ? corFundo : '')),
|
|
250
|
+
borderRadius: (borderRadius ? "".concat(borderRadius, "px") : ''),
|
|
251
|
+
border: (border ? border : '')
|
|
252
|
+
}, readOnly: readonly, required: required, checked: checked, onKeyPress: onKeyPress })
|
|
253
|
+
// <InputMask
|
|
254
|
+
// mask={mask}
|
|
255
|
+
// value={value}
|
|
256
|
+
// onChange={handleChange}
|
|
257
|
+
// disabled={disabled}
|
|
258
|
+
// >
|
|
259
|
+
// {(inputProps: any) => (
|
|
260
|
+
// <input
|
|
261
|
+
// {...inputProps}
|
|
262
|
+
// type={type === 'password' && isPasswordVisible ? 'text' : type}
|
|
263
|
+
// id={id}
|
|
264
|
+
// name={id}
|
|
265
|
+
// placeholder={placeholder}
|
|
266
|
+
// className={styles.inputPadrao}
|
|
267
|
+
// style={{
|
|
268
|
+
// width: largura ? `${largura}` : '',
|
|
269
|
+
// backgroundColor: (disabled ? '#e5e5e5' : (corFundo ? corFundo : '')),
|
|
270
|
+
// borderRadius: (borderRadius ? `${borderRadius}px` : ''),
|
|
271
|
+
// border: (border ? border : '')
|
|
272
|
+
// }}
|
|
273
|
+
// readOnly={readonly}
|
|
274
|
+
// required={required}
|
|
275
|
+
// checked={checked}
|
|
276
|
+
// onKeyPress={onKeyPress}
|
|
277
|
+
// />
|
|
278
|
+
// )}
|
|
279
|
+
// </InputMask>
|
|
280
|
+
) : (React.createElement("input", { type: type === 'password' && isPasswordVisible ? 'text' : type, id: id, name: id, value: value, placeholder: placeholder, onChange: handleChange, className: styles$5.inputPadrao, style: {
|
|
281
|
+
width: largura ? "".concat(largura) : '',
|
|
282
|
+
backgroundColor: (disabled ? '#e5e5e5' : (corFundo ? corFundo : '')),
|
|
283
|
+
borderRadius: (borderRadius ? "".concat(borderRadius, "px") : ''),
|
|
284
|
+
border: (border ? border : '')
|
|
285
|
+
}, readOnly: readonly, disabled: disabled, required: required, checked: checked, maxLength: type === 'text' ? appliedMaxLength : undefined, onKeyPress: onKeyPress, onBlur: onBlur })),
|
|
306
286
|
type === 'password' && (React.createElement("div", { className: styles$5.passwordToggleIcon, onClick: togglePasswordVisibility }, isPasswordVisible ? React.createElement(FaEyeSlash, { style: { color: colorIcon ? colorIcon : '' } }) : React.createElement(FaEye, { style: { color: colorIcon ? colorIcon : '' } }))))));
|
|
307
287
|
};
|
|
308
288
|
|
|
@@ -448,6 +428,38 @@ var Busca = function (_a) {
|
|
|
448
428
|
} }, filteredOptions.map(function (option, index) { return (React.createElement("li", { key: index, onClick: function () { return handleOptionClick(option); }, style: { padding: '5px', cursor: 'pointer' } }, option.description)); })))));
|
|
449
429
|
};
|
|
450
430
|
|
|
431
|
+
/******************************************************************************
|
|
432
|
+
Copyright (c) Microsoft Corporation.
|
|
433
|
+
|
|
434
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
435
|
+
purpose with or without fee is hereby granted.
|
|
436
|
+
|
|
437
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
438
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
439
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
440
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
441
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
442
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
443
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
444
|
+
***************************************************************************** */
|
|
445
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
function __spreadArray(to, from, pack) {
|
|
449
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
450
|
+
if (ar || !(i in from)) {
|
|
451
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
452
|
+
ar[i] = from[i];
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
459
|
+
var e = new Error(message);
|
|
460
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
461
|
+
};
|
|
462
|
+
|
|
451
463
|
var css_248z$1 = ".checkboxGroup-module_checkboxGroup__JFRoY{border:1px solid #ccc;border-radius:.5rem;box-sizing:border-box;display:grid;font-style:italic;gap:.5rem;grid-auto-rows:auto;grid-template-columns:repeat(auto-fill,minmax(275px,1fr));padding:.8rem 0 .8rem 1rem;width:100%}.checkboxGroup-module_title__238QG{margin-bottom:10px}.checkboxGroup-module_checkboxLabel__tIciT{align-items:center;cursor:pointer;display:flex;font-style:italic}.checkboxGroup-module_checkboxLabel__tIciT input[type=checkbox]{cursor:pointer;margin-right:.5rem}.checkboxGroup-module_checkboxLabel__tIciT input[type=checkbox]:focus{outline:none}";
|
|
452
464
|
var styles$1 = {"checkboxGroup":"checkboxGroup-module_checkboxGroup__JFRoY","title":"checkboxGroup-module_title__238QG","checkboxLabel":"checkboxGroup-module_checkboxLabel__tIciT"};
|
|
453
465
|
styleInject(css_248z$1);
|