@sula-tech/webcomponents 0.7.6 → 0.8.0
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/loader.cjs.js +1 -1
- package/dist/cjs/sula-avatar_18.cjs.entry.js +246 -2
- package/dist/cjs/sula-avatar_18.cjs.entry.js.map +1 -1
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/components/sula-textfield/sula-textfield.js +31 -2
- package/dist/collection/components/sula-textfield/sula-textfield.js.map +1 -1
- package/dist/collection/components/sula-textfield/sula-textfield.stories.js +22 -0
- package/dist/collection/components/sula-textfield/sula-textfield.stories.js.map +1 -1
- package/dist/components/p-B85MJLTf.js +8 -0
- package/dist/components/p-B85MJLTf.js.map +1 -0
- package/dist/components/{p-DoGc7jLn.js → p-DrUsgtsv.js} +3 -6
- package/dist/components/p-DrUsgtsv.js.map +1 -0
- package/dist/components/sula-button.js +1 -1
- package/dist/components/sula-loader.js +1 -1
- package/dist/components/sula-textfield.js +248 -2
- package/dist/components/sula-textfield.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sula-avatar_18.entry.js +246 -2
- package/dist/esm/sula-avatar_18.entry.js.map +1 -1
- package/dist/esm/webcomponents.js +1 -1
- package/dist/types/components/sula-textfield/sula-textfield.d.ts +7 -0
- package/dist/types/components/sula-textfield/sula-textfield.stories.d.ts +9 -0
- package/dist/types/components.d.ts +8 -0
- package/dist/webcomponents/{p-af46ad3b.entry.js → p-bc1f174c.entry.js} +209 -13
- package/dist/webcomponents/p-bc1f174c.entry.js.map +1 -0
- package/dist/webcomponents/webcomponents.esm.js +2 -1
- package/package.json +3 -2
- package/dist/components/p-DoGc7jLn.js.map +0 -1
- package/dist/webcomponents/p-af46ad3b.entry.js.map +0 -1
|
@@ -28308,6 +28308,241 @@ var SulaTextfieldStatus;
|
|
|
28308
28308
|
SulaTextfieldStatus["Error"] = "error";
|
|
28309
28309
|
})(SulaTextfieldStatus || (SulaTextfieldStatus = {}));
|
|
28310
28310
|
|
|
28311
|
+
var vanillaMasker$1 = {exports: {}};
|
|
28312
|
+
|
|
28313
|
+
var vanillaMasker = vanillaMasker$1.exports;
|
|
28314
|
+
|
|
28315
|
+
var hasRequiredVanillaMasker;
|
|
28316
|
+
|
|
28317
|
+
function requireVanillaMasker () {
|
|
28318
|
+
if (hasRequiredVanillaMasker) return vanillaMasker$1.exports;
|
|
28319
|
+
hasRequiredVanillaMasker = 1;
|
|
28320
|
+
(function (module, exports) {
|
|
28321
|
+
(function(root, factory) {
|
|
28322
|
+
{
|
|
28323
|
+
module.exports = factory();
|
|
28324
|
+
}
|
|
28325
|
+
}(vanillaMasker, function() {
|
|
28326
|
+
var DIGIT = "9",
|
|
28327
|
+
ALPHA = "A",
|
|
28328
|
+
ALPHANUM = "S",
|
|
28329
|
+
BY_PASS_KEYS = [9, 16, 17, 18, 36, 37, 38, 39, 40, 91, 92, 93],
|
|
28330
|
+
isAllowedKeyCode = function(keyCode) {
|
|
28331
|
+
for (var i = 0, len = BY_PASS_KEYS.length; i < len; i++) {
|
|
28332
|
+
if (keyCode == BY_PASS_KEYS[i]) {
|
|
28333
|
+
return false;
|
|
28334
|
+
}
|
|
28335
|
+
}
|
|
28336
|
+
return true;
|
|
28337
|
+
},
|
|
28338
|
+
mergeMoneyOptions = function(opts) {
|
|
28339
|
+
opts = opts || {};
|
|
28340
|
+
opts = {
|
|
28341
|
+
delimiter: opts.delimiter || ".",
|
|
28342
|
+
lastOutput: opts.lastOutput,
|
|
28343
|
+
precision: opts.hasOwnProperty("precision") ? opts.precision : 2,
|
|
28344
|
+
separator: opts.separator || ",",
|
|
28345
|
+
showSignal: opts.showSignal,
|
|
28346
|
+
suffixUnit: opts.suffixUnit && (" " + opts.suffixUnit.replace(/[\s]/g,'')) || "",
|
|
28347
|
+
unit: opts.unit && (opts.unit.replace(/[\s]/g,'') + " ") || "",
|
|
28348
|
+
zeroCents: opts.zeroCents
|
|
28349
|
+
};
|
|
28350
|
+
opts.moneyPrecision = opts.zeroCents ? 0 : opts.precision;
|
|
28351
|
+
return opts;
|
|
28352
|
+
},
|
|
28353
|
+
// Fill wildcards past index in output with placeholder
|
|
28354
|
+
addPlaceholdersToOutput = function(output, index, placeholder) {
|
|
28355
|
+
for (; index < output.length; index++) {
|
|
28356
|
+
if(output[index] === DIGIT || output[index] === ALPHA || output[index] === ALPHANUM) {
|
|
28357
|
+
output[index] = placeholder;
|
|
28358
|
+
}
|
|
28359
|
+
}
|
|
28360
|
+
return output;
|
|
28361
|
+
}
|
|
28362
|
+
;
|
|
28363
|
+
|
|
28364
|
+
var VanillaMasker = function(elements) {
|
|
28365
|
+
this.elements = elements;
|
|
28366
|
+
};
|
|
28367
|
+
|
|
28368
|
+
VanillaMasker.prototype.unbindElementToMask = function() {
|
|
28369
|
+
for (var i = 0, len = this.elements.length; i < len; i++) {
|
|
28370
|
+
this.elements[i].lastOutput = "";
|
|
28371
|
+
this.elements[i].onkeyup = false;
|
|
28372
|
+
this.elements[i].onkeydown = false;
|
|
28373
|
+
|
|
28374
|
+
if (this.elements[i].value.length) {
|
|
28375
|
+
this.elements[i].value = this.elements[i].value.replace(/\D/g, '');
|
|
28376
|
+
}
|
|
28377
|
+
}
|
|
28378
|
+
};
|
|
28379
|
+
|
|
28380
|
+
VanillaMasker.prototype.bindElementToMask = function(maskFunction) {
|
|
28381
|
+
var that = this,
|
|
28382
|
+
onType = function(e) {
|
|
28383
|
+
e = e || window.event;
|
|
28384
|
+
var source = e.target || e.srcElement;
|
|
28385
|
+
|
|
28386
|
+
if (isAllowedKeyCode(e.keyCode)) {
|
|
28387
|
+
setTimeout(function() {
|
|
28388
|
+
that.opts.lastOutput = source.lastOutput;
|
|
28389
|
+
source.value = VMasker[maskFunction](source.value, that.opts);
|
|
28390
|
+
source.lastOutput = source.value;
|
|
28391
|
+
if (source.setSelectionRange && that.opts.suffixUnit) {
|
|
28392
|
+
source.setSelectionRange(source.value.length, (source.value.length - that.opts.suffixUnit.length));
|
|
28393
|
+
}
|
|
28394
|
+
}, 0);
|
|
28395
|
+
}
|
|
28396
|
+
}
|
|
28397
|
+
;
|
|
28398
|
+
for (var i = 0, len = this.elements.length; i < len; i++) {
|
|
28399
|
+
this.elements[i].lastOutput = "";
|
|
28400
|
+
this.elements[i].onkeyup = onType;
|
|
28401
|
+
if (this.elements[i].value.length) {
|
|
28402
|
+
this.elements[i].value = VMasker[maskFunction](this.elements[i].value, this.opts);
|
|
28403
|
+
}
|
|
28404
|
+
}
|
|
28405
|
+
};
|
|
28406
|
+
|
|
28407
|
+
VanillaMasker.prototype.maskMoney = function(opts) {
|
|
28408
|
+
this.opts = mergeMoneyOptions(opts);
|
|
28409
|
+
this.bindElementToMask("toMoney");
|
|
28410
|
+
};
|
|
28411
|
+
|
|
28412
|
+
VanillaMasker.prototype.maskNumber = function() {
|
|
28413
|
+
this.opts = {};
|
|
28414
|
+
this.bindElementToMask("toNumber");
|
|
28415
|
+
};
|
|
28416
|
+
|
|
28417
|
+
VanillaMasker.prototype.maskAlphaNum = function() {
|
|
28418
|
+
this.opts = {};
|
|
28419
|
+
this.bindElementToMask("toAlphaNumeric");
|
|
28420
|
+
};
|
|
28421
|
+
|
|
28422
|
+
VanillaMasker.prototype.maskPattern = function(pattern) {
|
|
28423
|
+
this.opts = {pattern: pattern};
|
|
28424
|
+
this.bindElementToMask("toPattern");
|
|
28425
|
+
};
|
|
28426
|
+
|
|
28427
|
+
VanillaMasker.prototype.unMask = function() {
|
|
28428
|
+
this.unbindElementToMask();
|
|
28429
|
+
};
|
|
28430
|
+
|
|
28431
|
+
var VMasker = function(el) {
|
|
28432
|
+
if (!el) {
|
|
28433
|
+
throw new Error("VanillaMasker: There is no element to bind.");
|
|
28434
|
+
}
|
|
28435
|
+
var elements = ("length" in el) ? (el.length ? el : []) : [el];
|
|
28436
|
+
return new VanillaMasker(elements);
|
|
28437
|
+
};
|
|
28438
|
+
|
|
28439
|
+
VMasker.toMoney = function(value, opts) {
|
|
28440
|
+
opts = mergeMoneyOptions(opts);
|
|
28441
|
+
if (opts.zeroCents) {
|
|
28442
|
+
opts.lastOutput = opts.lastOutput || "";
|
|
28443
|
+
var zeroMatcher = ("("+ opts.separator +"[0]{0,"+ opts.precision +"})"),
|
|
28444
|
+
zeroRegExp = new RegExp(zeroMatcher, "g"),
|
|
28445
|
+
digitsLength = value.toString().replace(/[\D]/g, "").length || 0,
|
|
28446
|
+
lastDigitLength = opts.lastOutput.toString().replace(/[\D]/g, "").length || 0
|
|
28447
|
+
;
|
|
28448
|
+
value = value.toString().replace(zeroRegExp, "");
|
|
28449
|
+
if (digitsLength < lastDigitLength) {
|
|
28450
|
+
value = value.slice(0, value.length - 1);
|
|
28451
|
+
}
|
|
28452
|
+
}
|
|
28453
|
+
var number = value.toString().replace(/[\D]/g, ""),
|
|
28454
|
+
clearDelimiter = new RegExp("^(0|\\"+ opts.delimiter +")"),
|
|
28455
|
+
clearSeparator = new RegExp("(\\"+ opts.separator +")$"),
|
|
28456
|
+
money = number.substr(0, number.length - opts.moneyPrecision),
|
|
28457
|
+
masked = money.substr(0, money.length % 3),
|
|
28458
|
+
cents = new Array(opts.precision + 1).join("0")
|
|
28459
|
+
;
|
|
28460
|
+
money = money.substr(money.length % 3, money.length);
|
|
28461
|
+
for (var i = 0, len = money.length; i < len; i++) {
|
|
28462
|
+
if (i % 3 === 0) {
|
|
28463
|
+
masked += opts.delimiter;
|
|
28464
|
+
}
|
|
28465
|
+
masked += money[i];
|
|
28466
|
+
}
|
|
28467
|
+
masked = masked.replace(clearDelimiter, "");
|
|
28468
|
+
masked = masked.length ? masked : "0";
|
|
28469
|
+
var signal = "";
|
|
28470
|
+
if(opts.showSignal === true) {
|
|
28471
|
+
signal = value < 0 || (value.startsWith && value.startsWith('-')) ? "-" : "";
|
|
28472
|
+
}
|
|
28473
|
+
if (!opts.zeroCents) {
|
|
28474
|
+
var beginCents = number.length - opts.precision,
|
|
28475
|
+
centsValue = number.substr(beginCents, opts.precision),
|
|
28476
|
+
centsLength = centsValue.length,
|
|
28477
|
+
centsSliced = (opts.precision > centsLength) ? opts.precision : centsLength
|
|
28478
|
+
;
|
|
28479
|
+
cents = (cents + centsValue).slice(-centsSliced);
|
|
28480
|
+
}
|
|
28481
|
+
var output = opts.unit + signal + masked + opts.separator + cents;
|
|
28482
|
+
return output.replace(clearSeparator, "") + opts.suffixUnit;
|
|
28483
|
+
};
|
|
28484
|
+
|
|
28485
|
+
VMasker.toPattern = function(value, opts) {
|
|
28486
|
+
var pattern = (typeof opts === 'object' ? opts.pattern : opts),
|
|
28487
|
+
patternChars = pattern.replace(/\W/g, ''),
|
|
28488
|
+
output = pattern.split(""),
|
|
28489
|
+
values = value.toString().replace(/\W/g, ""),
|
|
28490
|
+
charsValues = values.replace(/\W/g, ''),
|
|
28491
|
+
index = 0,
|
|
28492
|
+
i,
|
|
28493
|
+
outputLength = output.length,
|
|
28494
|
+
placeholder = (typeof opts === 'object' ? opts.placeholder : undefined)
|
|
28495
|
+
;
|
|
28496
|
+
|
|
28497
|
+
for (i = 0; i < outputLength; i++) {
|
|
28498
|
+
// Reached the end of input
|
|
28499
|
+
if (index >= values.length) {
|
|
28500
|
+
if (patternChars.length == charsValues.length) {
|
|
28501
|
+
return output.join("");
|
|
28502
|
+
}
|
|
28503
|
+
else if ((placeholder !== undefined) && (patternChars.length > charsValues.length)) {
|
|
28504
|
+
return addPlaceholdersToOutput(output, i, placeholder).join("");
|
|
28505
|
+
}
|
|
28506
|
+
else {
|
|
28507
|
+
break;
|
|
28508
|
+
}
|
|
28509
|
+
}
|
|
28510
|
+
// Remaining chars in input
|
|
28511
|
+
else {
|
|
28512
|
+
if ((output[i] === DIGIT && values[index].match(/[0-9]/)) ||
|
|
28513
|
+
(output[i] === ALPHA && values[index].match(/[a-zA-Z]/)) ||
|
|
28514
|
+
(output[i] === ALPHANUM && values[index].match(/[0-9a-zA-Z]/))) {
|
|
28515
|
+
output[i] = values[index++];
|
|
28516
|
+
} else if (output[i] === DIGIT || output[i] === ALPHA || output[i] === ALPHANUM) {
|
|
28517
|
+
if(placeholder !== undefined){
|
|
28518
|
+
return addPlaceholdersToOutput(output, i, placeholder).join("");
|
|
28519
|
+
}
|
|
28520
|
+
else {
|
|
28521
|
+
return output.slice(0, i).join("");
|
|
28522
|
+
}
|
|
28523
|
+
}
|
|
28524
|
+
}
|
|
28525
|
+
}
|
|
28526
|
+
return output.join("").substr(0, i);
|
|
28527
|
+
};
|
|
28528
|
+
|
|
28529
|
+
VMasker.toNumber = function(value) {
|
|
28530
|
+
return value.toString().replace(/(?!^-)[^0-9]/g, "");
|
|
28531
|
+
};
|
|
28532
|
+
|
|
28533
|
+
VMasker.toAlphaNumeric = function(value) {
|
|
28534
|
+
return value.toString().replace(/[^a-z0-9 ]+/i, "");
|
|
28535
|
+
};
|
|
28536
|
+
|
|
28537
|
+
return VMasker;
|
|
28538
|
+
}));
|
|
28539
|
+
} (vanillaMasker$1));
|
|
28540
|
+
return vanillaMasker$1.exports;
|
|
28541
|
+
}
|
|
28542
|
+
|
|
28543
|
+
var vanillaMaskerExports = requireVanillaMasker();
|
|
28544
|
+
var VMasker = /*@__PURE__*/getDefaultExportFromCjs(vanillaMaskerExports);
|
|
28545
|
+
|
|
28311
28546
|
const sulaTextfieldCss = "*,:after,:before{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.outline{outline-style:solid}:host{display:block}.button-focus{outline:2px solid var(--color-feedback-informational)!important;outline-offset:2px!important}.button-error{outline:2px solid var(--color-feedback-error)!important;outline-offset:2px!important}.from-down{animation:from-down .2s ease-in-out}.from-up{animation:from-up .2s ease-in-out}@keyframes from-down{0%{opacity:0;transform:translateY(75%)}to{opacity:1;transform:translateY(0)}}@keyframes from-up{0%{opacity:0;transform:translateY(-75%)}to{opacity:1;transform:translateY(0)}}:root{--color-green-50:#f1f9f4;--color-green-100:#e6f4ed;--color-green-200:#cae7d8;--color-green-300:#a0d4b8;--color-green-400:#68bb8e;--color-green-500:#04843f;--color-green-600:#037236;--color-green-700:#03632f;--color-green-800:#035428;--color-green-900:#024521;--color-green-950:#02361a;--color-red-50:#fef6f6;--color-red-100:#fde8e8;--color-red-200:#fad1d1;--color-red-300:#f7abab;--color-red-400:#f17474;--color-red-500:#c80505;--color-red-600:#b30404;--color-red-700:#9f0404;--color-red-800:#860303;--color-red-900:#6d0303;--color-red-950:#500202;--color-yellow-50:#fdf4e7;--color-yellow-100:#fcedd9;--color-yellow-200:#fae0bd;--color-yellow-300:#f6c788;--color-yellow-400:#f3b159;--color-yellow-500:#ef9928;--color-yellow-600:#e49226;--color-yellow-700:#d17e10;--color-yellow-800:#b46d0e;--color-yellow-900:#93590b;--color-yellow-950:#683f08;--color-orange-50:#fef4f1;--color-orange-100:#fde8e2;--color-orange-200:#fbd2c6;--color-orange-300:#f8b4a0;--color-orange-400:#f58e70;--color-orange-500:#f05223;--color-orange-600:#ea4210;--color-orange-700:#d23b0e;--color-orange-800:#b5330c;--color-orange-900:#942a0a;--color-orange-950:#691e07;--color-blue-50:#ecf0f9;--color-blue-100:#dde3f4;--color-blue-200:#b2c2e5;--color-blue-300:#7994d2;--color-blue-400:#4066bf;--color-blue-500:#001e64;--color-blue-600:#001c5c;--color-blue-700:#00174c;--color-blue-800:#00123d;--color-blue-900:#000f33;--color-blue-950:#000d2b;--color-ambar-50:#fff6eb;--color-ambar-100:#ffefdc;--color-ambar-200:#fedfb9;--color-ambar-300:#fdca8b;--color-ambar-400:#fdb359;--color-ambar-500:#fc9c26;--color-ambar-600:#ec8403;--color-ambar-700:#d87803;--color-ambar-800:#ba6803;--color-ambar-900:#975402;--color-ambar-950:#6a3b01;--color-gray-50:#fff;--color-gray-100:#f4f4f4;--color-gray-200:#e6e6e6;--color-gray-300:#c3c3c3;--color-gray-400:#b9b9b9;--color-gray-500:#949494;--color-gray-600:#737373;--color-gray-700:#5c5c5c;--color-gray-800:#323232;--color-gray-900:#292929;--color-gray-950:#141414;--color-white-opacity-50:#ffffff0d;--color-white-opacity-100:#ffffff1a;--color-white-opacity-200:#ffffff26;--color-white-opacity-300:#ffffff45;--color-white-opacity-400:#ffffff5c;--color-white-opacity-500:#ffffff80;--color-white-opacity-600:#ffffff8c;--color-white-opacity-700:#ffffffa3;--color-white-opacity-800:#ffffffba;--color-white-opacity-900:#fffc;--color-white-opacity-950:#ffffffe8;--color-ciano-50:#f1f6fe;--color-ciano-100:#dfeafc;--color-ciano-200:#c3d9f9;--color-ciano-300:#90b9f4;--color-ciano-400:#5d98ee;--color-ciano-500:#1769e0;--color-ciano-600:#155fcb;--color-ciano-700:#1355b4;--color-ciano-800:#104899;--color-ciano-900:#0d3b7d;--color-ciano-950:#0a2e61;--color-extra-color-blue-light:#e7f0f4;--color-extra-color-blue-dark:#162931;--color-black-opacity-50:#14141405;--color-black-opacity-100:#1414141a;--color-black-opacity-200:#14141426;--color-black-opacity-300:#14141445;--color-black-opacity-400:#1414145c;--color-black-opacity-500:#14141480;--color-black-opacity-600:#1414148c;--color-black-opacity-700:#141414a3;--color-black-opacity-800:#141414ba;--color-black-opacity-900:#141414cc;--color-black-opacity-950:#141414e8;--color-feedback-success:#04843f;--color-feedback-error:#c80505;--color-feedback-informational:#1355b4;--color-feedback-alert:#ef9928;--color-brand-primary:#f05223;--color-brand-secondary:#001c5c;--color-brand-tertiary-1:#1769e0;--color-brand-tertiary-2:#fc9c26;--color-surface-body:#fff;--color-surface-on-body:#f4f4f4;--color-surface-on-body-blue:#e7f0f4;--color-surface-on-body-brand:#fff6eb;--color-surface-on-body-feedback-success:#e6f4ed;--color-surface-on-body-feedback-error:#fde8e8;--color-surface-on-body-feedback-alert:#fdf4e7;--color-surface-on-body-feedback-info:#dfeafc;--color-text-brand:#f05223;--color-text-primary:#323232;--color-text-secondary:#5c5c5c;--color-text-disabled:#949494;--color-text-link:#1355b4;--color-states-empty-bg-hover:#1414141a;--color-states-empty-bg-pressed:#14141426;--color-states-bg-disabled:#14141405;--color-states-bg-focus:#1355b4;--color-states-primary-hover:#ea4210;--color-states-primary-pressed:#d23b0e;--color-states-danger-hover:#b30404;--color-states-danger-pressed:#9f0404;--color-states-negative-hover:#e6e6e6;--color-states-negative-pressed:#c3c3c3;--color-icon-primary:#5c5c5c;--color-icon-secondary:#fff;--color-icon-tertiary:#b30404;--color-icon-disabled:#b9b9b9;--color-neutral-neutral-1:#fff;--color-neutral-neutral-2:#f4f4f4;--color-neutral-neutral-3:#b9b9b9;--color-neutral-neutral-4:#949494;--color-neutral-neutral-5:#737373;--color-neutral-neutral-6:#5c5c5c;--color-neutral-neutral-7:#323232;--color-neutral-neutral-8:#292929;--color-negative-negative-1:#fff;--color-negative-negative-2:#323232;--color-opacity-body:#fffc;--color-opacity-on-body:#14141405;--color-opacity-overlay:#1414148c;--color-opacity-on-overlay:#ffffff1a;--color-line-input:#949494;--color-line-general-strong:#c3c3c3;--color-line-general:#e6e6e6}.static{position:static}.mt-4{margin-top:.25rem}.flex{display:flex}.hidden{display:none}.h-\\[72px\\]{height:72px}.w-full{width:100%}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.rounded-sm{border-radius:.75rem}.border{border-width:1px}.border-line-general{border-color:var(--color-line-general)}.border-line-input{border-color:var(--color-line-input)}.bg-states-bg-disabled{background-color:var(--color-states-bg-disabled)}.bg-surface-body{background-color:var(--color-surface-body)}.bg-transparent{background-color:transparent}.px-16{padding-left:1rem;padding-right:1rem}.pr-12{padding-right:.75rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-bold{font-weight:700}.text-feedback-error{color:var(--color-feedback-error)}.text-icon-disabled{color:var(--color-icon-disabled)}.text-icon-primary{color:var(--color-icon-primary)}.text-text-disabled{color:var(--color-text-disabled)}.text-text-primary{color:var(--color-text-primary)}.caret-brand-primary{caret-color:var(--color-brand-primary)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}";
|
|
28312
28547
|
|
|
28313
28548
|
const SulaTextfield = class {
|
|
@@ -28332,6 +28567,9 @@ const SulaTextfield = class {
|
|
|
28332
28567
|
this.toggleOptions(true);
|
|
28333
28568
|
};
|
|
28334
28569
|
this.handleInputChanges = (event) => {
|
|
28570
|
+
if (this.maskPattern && this.inputElement) {
|
|
28571
|
+
this.handleInputMask();
|
|
28572
|
+
}
|
|
28335
28573
|
const newValue = event.target.value;
|
|
28336
28574
|
this.textValue = newValue;
|
|
28337
28575
|
this.value = newValue;
|
|
@@ -28398,6 +28636,9 @@ const SulaTextfield = class {
|
|
|
28398
28636
|
if (this.textValue && this.textValue.trim().length > 0) {
|
|
28399
28637
|
this.changeElementsStyle();
|
|
28400
28638
|
}
|
|
28639
|
+
if (this.maskPattern && this.inputElement) {
|
|
28640
|
+
this.handleInputMask();
|
|
28641
|
+
}
|
|
28401
28642
|
}
|
|
28402
28643
|
toggleOptions(inputIsOpen) {
|
|
28403
28644
|
if ((this.inputIsOpen && this.textValue && this.textValue.length > 0) || this.disabled)
|
|
@@ -28415,6 +28656,9 @@ const SulaTextfield = class {
|
|
|
28415
28656
|
this.labelElement.classList.add('from-up');
|
|
28416
28657
|
}
|
|
28417
28658
|
}
|
|
28659
|
+
handleInputMask() {
|
|
28660
|
+
VMasker(this.inputElement).maskPattern(this.maskPattern);
|
|
28661
|
+
}
|
|
28418
28662
|
handlePasswordIconClicked() {
|
|
28419
28663
|
const cursorPosition = this.inputElement.selectionStart;
|
|
28420
28664
|
const inputValue = this.inputElement.value;
|
|
@@ -28433,14 +28677,14 @@ const SulaTextfield = class {
|
|
|
28433
28677
|
return this.icon;
|
|
28434
28678
|
}
|
|
28435
28679
|
render() {
|
|
28436
|
-
return (h$1(Host, { key: '
|
|
28680
|
+
return (h$1(Host, { key: '2287b38b1441da7fcab2caa4dd495bc593a4e268', ref: node => (this.node = node) }, h$1("div", { key: '1e9538652f7a57c1f8a99760028a45726d4cf1b8' }, h$1("div", { key: '48b038746bbe3ba11ea374c7cc5e28cae65d5d30', id: "button-container", class: {
|
|
28437
28681
|
'flex items-center border rounded-sm px-16 outline-none h-[72px] caret-brand-primary': true,
|
|
28438
28682
|
'flex-row justify-between': !!this.icon || this.type === SulaTextfieldType.Password,
|
|
28439
28683
|
'button-focus': this.inputIsFocused && !this.disabled && this.status === SulaTextfieldStatus.Default,
|
|
28440
28684
|
'button-error': this.status === SulaTextfieldStatus.Error && !this.disabled,
|
|
28441
28685
|
'bg-states-bg-disabled border-line-general cursor-not-allowed': this.disabled,
|
|
28442
28686
|
'bg-surface-body border-line-input cursor-pointer': !this.disabled,
|
|
28443
|
-
}, tabIndex: 0, onFocus: this.handleFocus, onClick: this.handleInputClick }, !this.disabled && (h$1("div", { key: '
|
|
28687
|
+
}, tabIndex: 0, onFocus: this.handleFocus, onClick: this.handleInputClick }, !this.disabled && (h$1("div", { key: '9c4a9e1e7017593db75a77585c1392125b1a98b9', class: { 'hidden flex-col w-full': true, 'pr-12': !!this.icon }, ref: node => (this.inputContainer = node) }, h$1("label", { key: 'd07846ebd85fff94f477f59b512304e00102bb58', class: "font-bold text-sm text-text-primary from-down" }, this.label), h$1("input", { key: '92955b96950cae398681755cec9fcbf0a8327695', type: this.type, ref: node => (this.inputElement = node), placeholder: this.placeholder, class: "outline-none text-base text-text-primary bg-transparent", onInput: this.handleInputChanges, onFocus: this.handleInputFocus, value: this.textValue }))), h$1("div", { key: 'cadc6f4d64f3e85dee539b9bf270a839709c1bfa', id: "textfield-label", class: { 'text-base flex items-center': true, 'text-text-primary': !this.disabled, 'text-text-disabled': this.disabled }, ref: node => (this.labelElement = node) }, this.label), (!!this.icon || this.type === SulaTextfieldType.Password) && (h$1("div", { key: '5f0fee95a1d89743084c86f9b9bdec69b3976da5', class: "flex items-center justify-center", onClick: this.handleIconClick }, h$1("sula-icon", { key: 'a41969ee7b207c6fdcaf43c0345e927a19b58d1c', icon: this.getInputIcon(), customClass: `text-2xl ${this.disabled ? 'text-icon-disabled' : 'text-icon-primary'}` })))), (this.helpText || this.maxLength) && !this.disabled && (h$1("div", { key: '14e36d4ee992aeb3ab3341f030fc05231c803e3d', class: "flex justify-between items-center px-16 mt-4 text-sm" }, this.helpText && (h$1("div", { key: 'e4286e8635c5b6f8fc3032359567cbdba2479748', id: "textfield-help-text", class: { 'text-text-primary': this.status === SulaTextfieldStatus.Default, 'text-feedback-error': this.status === SulaTextfieldStatus.Error } }, this.helpText)), this.maxLength && (h$1("div", { key: 'd2813e234f057e952f85ded243510a4a12a43654', id: "max-length-container", class: { 'text-text-primary': this.status === SulaTextfieldStatus.Default, 'text-feedback-error': this.status === SulaTextfieldStatus.Error } }, this.textValue ? this.textValue.length : 0, "/", this.maxLength)))))));
|
|
28444
28688
|
}
|
|
28445
28689
|
static get watchers() { return {
|
|
28446
28690
|
"value": ["watchValueHandler"]
|