@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
|
@@ -16,7 +16,7 @@ var patchBrowser = () => {
|
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(async (options) => {
|
|
18
18
|
await globalScripts();
|
|
19
|
-
return bootstrapLazy([["sula-avatar_18",[[1,"sula-button",{"text":[1025],"icon":[1025],"leftIcon":[1025,"left-icon"],"rightIcon":[1025,"right-icon"],"appearance":[1025],"type":[1025],"size":[1025],"status":[1025],"loading":[1028],"buttonDisabled":[1028,"button-disabled"],"fullWidth":[1028,"full-width"]}],[1,"sula-chip",{"text":[1025],"appearance":[1025],"disabled":[1028],"items":[1040],"isFocused":[32],"showItems":[32]},[[4,"click","handleDocumentClick"]]],[1,"sula-dropdown",{"label":[1025],"disabled":[1028],"items":[1040],"value":[1040],"selectedItem":[32],"showItems":[32],"isFocused":[32]},[[4,"click","handleDocumentClick"]],{"value":["handleValueChange"]}],[1,"sula-avatar",{"size":[1],"imageUrl":[1,"image-url"],"text":[1],"icon":[1]}],[1,"sula-badge",{"status":[1025],"size":[1025],"type":[1025],"text":[1025],"icon":[1025],"hasSlotContent":[32]}],[1,"sula-checkbox",{"type":[1025],"label":[1025],"subTitle":[1025,"sub-title"],"disabled":[1028],"checked":[1028],"isFocus":[32]}],[1,"sula-progress-bar",{"appearance":[1025],"state":[1025],"topLabel":[1025,"top-label"],"bottomLabel":[1025,"bottom-label"],"progress":[1026],"showProgress":[1028,"show-progress"]},null,{"progress":["validateProgress"]}],[1,"sula-search-bar",{"value":[1025],"searchBarStyle":[1025,"search-bar-style"],"placeholder":[1025],"leftIcon":[1025,"left-icon"],"rightIcon":[1025,"right-icon"],"isFocused":[32],"textValue":[32]}],[1,"sula-tag",{"label":[1025],"icon":[1025],"iconStatus":[1025,"icon-status"],"size":[1025],"appearance":[1025],"fontWeight":[1025,"font-weight"]}],[1,"sula-textfield",{"value":[1025],"type":[1],"status":[1025],"label":[1],"placeholder":[1],"disabled":[1028],"helpText":[1,"help-text"],"maxLength":[2,"max-length"],"icon":[1],"inputIsOpen":[32],"textValue":[32],"showPassword":[32],"inputIsFocused":[32]},[[4,"click","handleClick"]],{"value":["watchValueHandler"]}],[1,"sula-tiles",{"type":[1],"size":[1],"ellipsis":[4],"icon":[1],"text":[1],"subText":[1,"sub-text"],"disabled":[4]}],[1,"sula-timeline-list",{"sulaTimelineList":[1040,"sula-timeline-list"]}],[1,"sula-radio-button",{"checked":[1028],"label":[1025],"disabled":[1028],"radioIsFocus":[32]}],[1,"sula-switch",{"type":[1025],"active":[1028],"disabled":[1028],"label":[1025],"subTitle":[1025,"sub-title"],"isFocus":[32]}],[1,"sula-textarea",{"value":[1025],"status":[1025],"label":[1],"placeholder":[1],"disabled":[1028],"helpText":[1,"help-text"],"maxLength":[2,"max-length"],"rows":[2],"isActive":[32],"textValue":[32],"textareaIsFocused":[32],"labelPadding":[32]},[[4,"click","handleClick"]],{"value":["watchValueHandler"]}],[1,"sula-loader",{"size":[1],"animationInstance":[32]}],[1,"sula-menu-select-list",{"items":[1040],"fullWidth":[4,"full-width"]}],[0,"sula-icon",{"icon":[1],"customClass":[1,"custom-class"]}]]]], options);
|
|
19
|
+
return bootstrapLazy([["sula-avatar_18",[[1,"sula-button",{"text":[1025],"icon":[1025],"leftIcon":[1025,"left-icon"],"rightIcon":[1025,"right-icon"],"appearance":[1025],"type":[1025],"size":[1025],"status":[1025],"loading":[1028],"buttonDisabled":[1028,"button-disabled"],"fullWidth":[1028,"full-width"]}],[1,"sula-chip",{"text":[1025],"appearance":[1025],"disabled":[1028],"items":[1040],"isFocused":[32],"showItems":[32]},[[4,"click","handleDocumentClick"]]],[1,"sula-dropdown",{"label":[1025],"disabled":[1028],"items":[1040],"value":[1040],"selectedItem":[32],"showItems":[32],"isFocused":[32]},[[4,"click","handleDocumentClick"]],{"value":["handleValueChange"]}],[1,"sula-avatar",{"size":[1],"imageUrl":[1,"image-url"],"text":[1],"icon":[1]}],[1,"sula-badge",{"status":[1025],"size":[1025],"type":[1025],"text":[1025],"icon":[1025],"hasSlotContent":[32]}],[1,"sula-checkbox",{"type":[1025],"label":[1025],"subTitle":[1025,"sub-title"],"disabled":[1028],"checked":[1028],"isFocus":[32]}],[1,"sula-progress-bar",{"appearance":[1025],"state":[1025],"topLabel":[1025,"top-label"],"bottomLabel":[1025,"bottom-label"],"progress":[1026],"showProgress":[1028,"show-progress"]},null,{"progress":["validateProgress"]}],[1,"sula-search-bar",{"value":[1025],"searchBarStyle":[1025,"search-bar-style"],"placeholder":[1025],"leftIcon":[1025,"left-icon"],"rightIcon":[1025,"right-icon"],"isFocused":[32],"textValue":[32]}],[1,"sula-tag",{"label":[1025],"icon":[1025],"iconStatus":[1025,"icon-status"],"size":[1025],"appearance":[1025],"fontWeight":[1025,"font-weight"]}],[1,"sula-textfield",{"value":[1025],"type":[1],"status":[1025],"label":[1],"placeholder":[1],"disabled":[1028],"helpText":[1,"help-text"],"maxLength":[2,"max-length"],"icon":[1],"maskPattern":[1,"mask-pattern"],"inputIsOpen":[32],"textValue":[32],"showPassword":[32],"inputIsFocused":[32]},[[4,"click","handleClick"]],{"value":["watchValueHandler"]}],[1,"sula-tiles",{"type":[1],"size":[1],"ellipsis":[4],"icon":[1],"text":[1],"subText":[1,"sub-text"],"disabled":[4]}],[1,"sula-timeline-list",{"sulaTimelineList":[1040,"sula-timeline-list"]}],[1,"sula-radio-button",{"checked":[1028],"label":[1025],"disabled":[1028],"radioIsFocus":[32]}],[1,"sula-switch",{"type":[1025],"active":[1028],"disabled":[1028],"label":[1025],"subTitle":[1025,"sub-title"],"isFocus":[32]}],[1,"sula-textarea",{"value":[1025],"status":[1025],"label":[1],"placeholder":[1],"disabled":[1028],"helpText":[1,"help-text"],"maxLength":[2,"max-length"],"rows":[2],"isActive":[32],"textValue":[32],"textareaIsFocused":[32],"labelPadding":[32]},[[4,"click","handleClick"]],{"value":["watchValueHandler"]}],[1,"sula-loader",{"size":[1],"animationInstance":[32]}],[1,"sula-menu-select-list",{"items":[1040],"fullWidth":[4,"full-width"]}],[0,"sula-icon",{"icon":[1],"customClass":[1,"custom-class"]}]]]], options);
|
|
20
20
|
});
|
|
21
21
|
//# sourceMappingURL=webcomponents.js.map
|
|
22
22
|
|
|
@@ -41,6 +41,12 @@ export declare class SulaTextfield {
|
|
|
41
41
|
* Event emitted when input value changes.
|
|
42
42
|
*/
|
|
43
43
|
valueChanged: EventEmitter<string>;
|
|
44
|
+
/**
|
|
45
|
+
* The textfield mask pattern
|
|
46
|
+
* The mask pattern should follow the VMasker pattern format
|
|
47
|
+
* More info: https://github.com/vanilla-masker/vanilla-masker?tab=readme-ov-file#custom-pattern
|
|
48
|
+
*/
|
|
49
|
+
maskPattern?: string;
|
|
44
50
|
/**
|
|
45
51
|
* Event emitted when input is focused.
|
|
46
52
|
*/
|
|
@@ -69,6 +75,7 @@ export declare class SulaTextfield {
|
|
|
69
75
|
handleBlur: () => void;
|
|
70
76
|
handleInputFocus: () => void;
|
|
71
77
|
handleIconClick: (event: MouseEvent) => void;
|
|
78
|
+
handleInputMask(): void;
|
|
72
79
|
handlePasswordIconClicked(): void;
|
|
73
80
|
getInputIcon(): string;
|
|
74
81
|
render(): any;
|
|
@@ -41,6 +41,14 @@ declare const _default: {
|
|
|
41
41
|
required: boolean;
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
|
+
maskPattern: {
|
|
45
|
+
control: string;
|
|
46
|
+
defaultValue: string;
|
|
47
|
+
description: string;
|
|
48
|
+
type: {
|
|
49
|
+
required: boolean;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
44
52
|
placeholder: {
|
|
45
53
|
control: string;
|
|
46
54
|
defaultValue: string;
|
|
@@ -104,6 +112,7 @@ declare const _default: {
|
|
|
104
112
|
};
|
|
105
113
|
export default _default;
|
|
106
114
|
export declare const Default: any;
|
|
115
|
+
export declare const WithMask: any;
|
|
107
116
|
export declare const WithValue: any;
|
|
108
117
|
export declare const WithHelpText: any;
|
|
109
118
|
export declare const WithMaxLength: any;
|
|
@@ -413,6 +413,10 @@ export namespace Components {
|
|
|
413
413
|
* The textfield label
|
|
414
414
|
*/
|
|
415
415
|
"label": string;
|
|
416
|
+
/**
|
|
417
|
+
* The textfield mask pattern The mask pattern should follow the VMasker pattern format More info: https://github.com/vanilla-masker/vanilla-masker?tab=readme-ov-file#custom-pattern
|
|
418
|
+
*/
|
|
419
|
+
"maskPattern"?: string;
|
|
416
420
|
/**
|
|
417
421
|
* The textfield max length
|
|
418
422
|
*/
|
|
@@ -1281,6 +1285,10 @@ declare namespace LocalJSX {
|
|
|
1281
1285
|
* The textfield label
|
|
1282
1286
|
*/
|
|
1283
1287
|
"label"?: string;
|
|
1288
|
+
/**
|
|
1289
|
+
* The textfield mask pattern The mask pattern should follow the VMasker pattern format More info: https://github.com/vanilla-masker/vanilla-masker?tab=readme-ov-file#custom-pattern
|
|
1290
|
+
*/
|
|
1291
|
+
"maskPattern"?: string;
|
|
1284
1292
|
/**
|
|
1285
1293
|
* The textfield max length
|
|
1286
1294
|
*/
|
|
@@ -21721,6 +21721,193 @@ var SulaTextfieldStatus;
|
|
|
21721
21721
|
e["Error"] = "error";
|
|
21722
21722
|
})(SulaTextfieldStatus || (SulaTextfieldStatus = {}));
|
|
21723
21723
|
|
|
21724
|
+
var vanillaMasker$1 = {
|
|
21725
|
+
exports: {}
|
|
21726
|
+
};
|
|
21727
|
+
|
|
21728
|
+
var vanillaMasker = vanillaMasker$1.exports;
|
|
21729
|
+
|
|
21730
|
+
var hasRequiredVanillaMasker;
|
|
21731
|
+
|
|
21732
|
+
function requireVanillaMasker() {
|
|
21733
|
+
if (hasRequiredVanillaMasker) return vanillaMasker$1.exports;
|
|
21734
|
+
hasRequiredVanillaMasker = 1;
|
|
21735
|
+
(function(e, t) {
|
|
21736
|
+
(function(t, o) {
|
|
21737
|
+
{
|
|
21738
|
+
e.exports = o();
|
|
21739
|
+
}
|
|
21740
|
+
})(vanillaMasker, (function() {
|
|
21741
|
+
var e = "9", t = "A", o = "S", r = [ 9, 16, 17, 18, 36, 37, 38, 39, 40, 91, 92, 93 ], isAllowedKeyCode = function(e) {
|
|
21742
|
+
for (var t = 0, o = r.length; t < o; t++) {
|
|
21743
|
+
if (e == r[t]) {
|
|
21744
|
+
return false;
|
|
21745
|
+
}
|
|
21746
|
+
}
|
|
21747
|
+
return true;
|
|
21748
|
+
}, mergeMoneyOptions = function(e) {
|
|
21749
|
+
e = e || {};
|
|
21750
|
+
e = {
|
|
21751
|
+
delimiter: e.delimiter || ".",
|
|
21752
|
+
lastOutput: e.lastOutput,
|
|
21753
|
+
precision: e.hasOwnProperty("precision") ? e.precision : 2,
|
|
21754
|
+
separator: e.separator || ",",
|
|
21755
|
+
showSignal: e.showSignal,
|
|
21756
|
+
suffixUnit: e.suffixUnit && " " + e.suffixUnit.replace(/[\s]/g, "") || "",
|
|
21757
|
+
unit: e.unit && e.unit.replace(/[\s]/g, "") + " " || "",
|
|
21758
|
+
zeroCents: e.zeroCents
|
|
21759
|
+
};
|
|
21760
|
+
e.moneyPrecision = e.zeroCents ? 0 : e.precision;
|
|
21761
|
+
return e;
|
|
21762
|
+
},
|
|
21763
|
+
// Fill wildcards past index in output with placeholder
|
|
21764
|
+
addPlaceholdersToOutput = function(r, n, a) {
|
|
21765
|
+
for (;n < r.length; n++) {
|
|
21766
|
+
if (r[n] === e || r[n] === t || r[n] === o) {
|
|
21767
|
+
r[n] = a;
|
|
21768
|
+
}
|
|
21769
|
+
}
|
|
21770
|
+
return r;
|
|
21771
|
+
};
|
|
21772
|
+
var VanillaMasker = function(e) {
|
|
21773
|
+
this.elements = e;
|
|
21774
|
+
};
|
|
21775
|
+
VanillaMasker.prototype.unbindElementToMask = function() {
|
|
21776
|
+
for (var e = 0, t = this.elements.length; e < t; e++) {
|
|
21777
|
+
this.elements[e].lastOutput = "";
|
|
21778
|
+
this.elements[e].onkeyup = false;
|
|
21779
|
+
this.elements[e].onkeydown = false;
|
|
21780
|
+
if (this.elements[e].value.length) {
|
|
21781
|
+
this.elements[e].value = this.elements[e].value.replace(/\D/g, "");
|
|
21782
|
+
}
|
|
21783
|
+
}
|
|
21784
|
+
};
|
|
21785
|
+
VanillaMasker.prototype.bindElementToMask = function(e) {
|
|
21786
|
+
var t = this, onType = function(o) {
|
|
21787
|
+
o = o || window.event;
|
|
21788
|
+
var r = o.target || o.srcElement;
|
|
21789
|
+
if (isAllowedKeyCode(o.keyCode)) {
|
|
21790
|
+
setTimeout((function() {
|
|
21791
|
+
t.opts.lastOutput = r.lastOutput;
|
|
21792
|
+
r.value = VMasker[e](r.value, t.opts);
|
|
21793
|
+
r.lastOutput = r.value;
|
|
21794
|
+
if (r.setSelectionRange && t.opts.suffixUnit) {
|
|
21795
|
+
r.setSelectionRange(r.value.length, r.value.length - t.opts.suffixUnit.length);
|
|
21796
|
+
}
|
|
21797
|
+
}), 0);
|
|
21798
|
+
}
|
|
21799
|
+
};
|
|
21800
|
+
for (var o = 0, r = this.elements.length; o < r; o++) {
|
|
21801
|
+
this.elements[o].lastOutput = "";
|
|
21802
|
+
this.elements[o].onkeyup = onType;
|
|
21803
|
+
if (this.elements[o].value.length) {
|
|
21804
|
+
this.elements[o].value = VMasker[e](this.elements[o].value, this.opts);
|
|
21805
|
+
}
|
|
21806
|
+
}
|
|
21807
|
+
};
|
|
21808
|
+
VanillaMasker.prototype.maskMoney = function(e) {
|
|
21809
|
+
this.opts = mergeMoneyOptions(e);
|
|
21810
|
+
this.bindElementToMask("toMoney");
|
|
21811
|
+
};
|
|
21812
|
+
VanillaMasker.prototype.maskNumber = function() {
|
|
21813
|
+
this.opts = {};
|
|
21814
|
+
this.bindElementToMask("toNumber");
|
|
21815
|
+
};
|
|
21816
|
+
VanillaMasker.prototype.maskAlphaNum = function() {
|
|
21817
|
+
this.opts = {};
|
|
21818
|
+
this.bindElementToMask("toAlphaNumeric");
|
|
21819
|
+
};
|
|
21820
|
+
VanillaMasker.prototype.maskPattern = function(e) {
|
|
21821
|
+
this.opts = {
|
|
21822
|
+
pattern: e
|
|
21823
|
+
};
|
|
21824
|
+
this.bindElementToMask("toPattern");
|
|
21825
|
+
};
|
|
21826
|
+
VanillaMasker.prototype.unMask = function() {
|
|
21827
|
+
this.unbindElementToMask();
|
|
21828
|
+
};
|
|
21829
|
+
var VMasker = function(e) {
|
|
21830
|
+
if (!e) {
|
|
21831
|
+
throw new Error("VanillaMasker: There is no element to bind.");
|
|
21832
|
+
}
|
|
21833
|
+
var t = "length" in e ? e.length ? e : [] : [ e ];
|
|
21834
|
+
return new VanillaMasker(t);
|
|
21835
|
+
};
|
|
21836
|
+
VMasker.toMoney = function(e, t) {
|
|
21837
|
+
t = mergeMoneyOptions(t);
|
|
21838
|
+
if (t.zeroCents) {
|
|
21839
|
+
t.lastOutput = t.lastOutput || "";
|
|
21840
|
+
var o = "(" + t.separator + "[0]{0," + t.precision + "})", r = new RegExp(o, "g"), n = e.toString().replace(/[\D]/g, "").length || 0, a = t.lastOutput.toString().replace(/[\D]/g, "").length || 0;
|
|
21841
|
+
e = e.toString().replace(r, "");
|
|
21842
|
+
if (n < a) {
|
|
21843
|
+
e = e.slice(0, e.length - 1);
|
|
21844
|
+
}
|
|
21845
|
+
}
|
|
21846
|
+
var i = e.toString().replace(/[\D]/g, ""), c = new RegExp("^(0|\\" + t.delimiter + ")"), s = new RegExp("(\\" + t.separator + ")$"), l = i.substr(0, i.length - t.moneyPrecision), f = l.substr(0, l.length % 3), p = new Array(t.precision + 1).join("0");
|
|
21847
|
+
l = l.substr(l.length % 3, l.length);
|
|
21848
|
+
for (var u = 0, d = l.length; u < d; u++) {
|
|
21849
|
+
if (u % 3 === 0) {
|
|
21850
|
+
f += t.delimiter;
|
|
21851
|
+
}
|
|
21852
|
+
f += l[u];
|
|
21853
|
+
}
|
|
21854
|
+
f = f.replace(c, "");
|
|
21855
|
+
f = f.length ? f : "0";
|
|
21856
|
+
var b = "";
|
|
21857
|
+
if (t.showSignal === true) {
|
|
21858
|
+
b = e < 0 || e.startsWith && e.startsWith("-") ? "-" : "";
|
|
21859
|
+
}
|
|
21860
|
+
if (!t.zeroCents) {
|
|
21861
|
+
var m = i.length - t.precision, g = i.substr(m, t.precision), y = g.length, x = t.precision > y ? t.precision : y;
|
|
21862
|
+
p = (p + g).slice(-x);
|
|
21863
|
+
}
|
|
21864
|
+
var k = t.unit + b + f + t.separator + p;
|
|
21865
|
+
return k.replace(s, "") + t.suffixUnit;
|
|
21866
|
+
};
|
|
21867
|
+
VMasker.toPattern = function(r, n) {
|
|
21868
|
+
var a = typeof n === "object" ? n.pattern : n, i = a.replace(/\W/g, ""), c = a.split(""), s = r.toString().replace(/\W/g, ""), l = s.replace(/\W/g, ""), f = 0, p, u = c.length, d = typeof n === "object" ? n.placeholder : undefined;
|
|
21869
|
+
for (p = 0; p < u; p++) {
|
|
21870
|
+
// Reached the end of input
|
|
21871
|
+
if (f >= s.length) {
|
|
21872
|
+
if (i.length == l.length) {
|
|
21873
|
+
return c.join("");
|
|
21874
|
+
} else if (d !== undefined && i.length > l.length) {
|
|
21875
|
+
return addPlaceholdersToOutput(c, p, d).join("");
|
|
21876
|
+
} else {
|
|
21877
|
+
break;
|
|
21878
|
+
}
|
|
21879
|
+
}
|
|
21880
|
+
// Remaining chars in input
|
|
21881
|
+
else {
|
|
21882
|
+
if (c[p] === e && s[f].match(/[0-9]/) || c[p] === t && s[f].match(/[a-zA-Z]/) || c[p] === o && s[f].match(/[0-9a-zA-Z]/)) {
|
|
21883
|
+
c[p] = s[f++];
|
|
21884
|
+
} else if (c[p] === e || c[p] === t || c[p] === o) {
|
|
21885
|
+
if (d !== undefined) {
|
|
21886
|
+
return addPlaceholdersToOutput(c, p, d).join("");
|
|
21887
|
+
} else {
|
|
21888
|
+
return c.slice(0, p).join("");
|
|
21889
|
+
}
|
|
21890
|
+
}
|
|
21891
|
+
}
|
|
21892
|
+
}
|
|
21893
|
+
return c.join("").substr(0, p);
|
|
21894
|
+
};
|
|
21895
|
+
VMasker.toNumber = function(e) {
|
|
21896
|
+
return e.toString().replace(/(?!^-)[^0-9]/g, "");
|
|
21897
|
+
};
|
|
21898
|
+
VMasker.toAlphaNumeric = function(e) {
|
|
21899
|
+
return e.toString().replace(/[^a-z0-9 ]+/i, "");
|
|
21900
|
+
};
|
|
21901
|
+
return VMasker;
|
|
21902
|
+
}));
|
|
21903
|
+
})(vanillaMasker$1);
|
|
21904
|
+
return vanillaMasker$1.exports;
|
|
21905
|
+
}
|
|
21906
|
+
|
|
21907
|
+
var vanillaMaskerExports = requireVanillaMasker();
|
|
21908
|
+
|
|
21909
|
+
var VMasker = getDefaultExportFromCjs(vanillaMaskerExports);
|
|
21910
|
+
|
|
21724
21911
|
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}';
|
|
21725
21912
|
|
|
21726
21913
|
const SulaTextfield = class {
|
|
@@ -21743,6 +21930,9 @@ const SulaTextfield = class {
|
|
|
21743
21930
|
this.toggleOptions(true);
|
|
21744
21931
|
};
|
|
21745
21932
|
this.handleInputChanges = e => {
|
|
21933
|
+
if (this.maskPattern && this.inputElement) {
|
|
21934
|
+
this.handleInputMask();
|
|
21935
|
+
}
|
|
21746
21936
|
const t = e.target.value;
|
|
21747
21937
|
this.textValue = t;
|
|
21748
21938
|
this.value = t;
|
|
@@ -21806,6 +21996,9 @@ const SulaTextfield = class {
|
|
|
21806
21996
|
if (this.textValue && this.textValue.trim().length > 0) {
|
|
21807
21997
|
this.changeElementsStyle();
|
|
21808
21998
|
}
|
|
21999
|
+
if (this.maskPattern && this.inputElement) {
|
|
22000
|
+
this.handleInputMask();
|
|
22001
|
+
}
|
|
21809
22002
|
}
|
|
21810
22003
|
toggleOptions(e) {
|
|
21811
22004
|
if (this.inputIsOpen && this.textValue && this.textValue.length > 0 || this.disabled) return;
|
|
@@ -21821,6 +22014,9 @@ const SulaTextfield = class {
|
|
|
21821
22014
|
this.labelElement.classList.add("from-up");
|
|
21822
22015
|
}
|
|
21823
22016
|
}
|
|
22017
|
+
handleInputMask() {
|
|
22018
|
+
VMasker(this.inputElement).maskPattern(this.maskPattern);
|
|
22019
|
+
}
|
|
21824
22020
|
handlePasswordIconClicked() {
|
|
21825
22021
|
const e = this.inputElement.selectionStart;
|
|
21826
22022
|
const t = this.inputElement.value;
|
|
@@ -21840,12 +22036,12 @@ const SulaTextfield = class {
|
|
|
21840
22036
|
}
|
|
21841
22037
|
render() {
|
|
21842
22038
|
return h$1(Host, {
|
|
21843
|
-
key: "
|
|
22039
|
+
key: "2287b38b1441da7fcab2caa4dd495bc593a4e268",
|
|
21844
22040
|
ref: e => this.node = e
|
|
21845
22041
|
}, h$1("div", {
|
|
21846
|
-
key: "
|
|
22042
|
+
key: "1e9538652f7a57c1f8a99760028a45726d4cf1b8"
|
|
21847
22043
|
}, h$1("div", {
|
|
21848
|
-
key: "
|
|
22044
|
+
key: "48b038746bbe3ba11ea374c7cc5e28cae65d5d30",
|
|
21849
22045
|
id: "button-container",
|
|
21850
22046
|
class: {
|
|
21851
22047
|
"flex items-center border rounded-sm px-16 outline-none h-[72px] caret-brand-primary": true,
|
|
@@ -21859,17 +22055,17 @@ const SulaTextfield = class {
|
|
|
21859
22055
|
onFocus: this.handleFocus,
|
|
21860
22056
|
onClick: this.handleInputClick
|
|
21861
22057
|
}, !this.disabled && h$1("div", {
|
|
21862
|
-
key: "
|
|
22058
|
+
key: "9c4a9e1e7017593db75a77585c1392125b1a98b9",
|
|
21863
22059
|
class: {
|
|
21864
22060
|
"hidden flex-col w-full": true,
|
|
21865
22061
|
"pr-12": !!this.icon
|
|
21866
22062
|
},
|
|
21867
22063
|
ref: e => this.inputContainer = e
|
|
21868
22064
|
}, h$1("label", {
|
|
21869
|
-
key: "
|
|
22065
|
+
key: "d07846ebd85fff94f477f59b512304e00102bb58",
|
|
21870
22066
|
class: "font-bold text-sm text-text-primary from-down"
|
|
21871
22067
|
}, this.label), h$1("input", {
|
|
21872
|
-
key: "
|
|
22068
|
+
key: "92955b96950cae398681755cec9fcbf0a8327695",
|
|
21873
22069
|
type: this.type,
|
|
21874
22070
|
ref: e => this.inputElement = e,
|
|
21875
22071
|
placeholder: this.placeholder,
|
|
@@ -21878,7 +22074,7 @@ const SulaTextfield = class {
|
|
|
21878
22074
|
onFocus: this.handleInputFocus,
|
|
21879
22075
|
value: this.textValue
|
|
21880
22076
|
})), h$1("div", {
|
|
21881
|
-
key: "
|
|
22077
|
+
key: "cadc6f4d64f3e85dee539b9bf270a839709c1bfa",
|
|
21882
22078
|
id: "textfield-label",
|
|
21883
22079
|
class: {
|
|
21884
22080
|
"text-base flex items-center": true,
|
|
@@ -21887,25 +22083,25 @@ const SulaTextfield = class {
|
|
|
21887
22083
|
},
|
|
21888
22084
|
ref: e => this.labelElement = e
|
|
21889
22085
|
}, this.label), (!!this.icon || this.type === SulaTextfieldType.Password) && h$1("div", {
|
|
21890
|
-
key: "
|
|
22086
|
+
key: "5f0fee95a1d89743084c86f9b9bdec69b3976da5",
|
|
21891
22087
|
class: "flex items-center justify-center",
|
|
21892
22088
|
onClick: this.handleIconClick
|
|
21893
22089
|
}, h$1("sula-icon", {
|
|
21894
|
-
key: "
|
|
22090
|
+
key: "a41969ee7b207c6fdcaf43c0345e927a19b58d1c",
|
|
21895
22091
|
icon: this.getInputIcon(),
|
|
21896
22092
|
customClass: `text-2xl ${this.disabled ? "text-icon-disabled" : "text-icon-primary"}`
|
|
21897
22093
|
}))), (this.helpText || this.maxLength) && !this.disabled && h$1("div", {
|
|
21898
|
-
key: "
|
|
22094
|
+
key: "14e36d4ee992aeb3ab3341f030fc05231c803e3d",
|
|
21899
22095
|
class: "flex justify-between items-center px-16 mt-4 text-sm"
|
|
21900
22096
|
}, this.helpText && h$1("div", {
|
|
21901
|
-
key: "
|
|
22097
|
+
key: "e4286e8635c5b6f8fc3032359567cbdba2479748",
|
|
21902
22098
|
id: "textfield-help-text",
|
|
21903
22099
|
class: {
|
|
21904
22100
|
"text-text-primary": this.status === SulaTextfieldStatus.Default,
|
|
21905
22101
|
"text-feedback-error": this.status === SulaTextfieldStatus.Error
|
|
21906
22102
|
}
|
|
21907
22103
|
}, this.helpText), this.maxLength && h$1("div", {
|
|
21908
|
-
key: "
|
|
22104
|
+
key: "d2813e234f057e952f85ded243510a4a12a43654",
|
|
21909
22105
|
id: "max-length-container",
|
|
21910
22106
|
class: {
|
|
21911
22107
|
"text-text-primary": this.status === SulaTextfieldStatus.Default,
|
|
@@ -22194,4 +22390,4 @@ SulaTimelineList.style = sulaTimelineListCss;
|
|
|
22194
22390
|
|
|
22195
22391
|
export { SulaAvatar as sula_avatar, SulaBadge as sula_badge, SulaButton as sula_button, SulaCheckbox as sula_checkbox, SulaChip as sula_chip, SulaDropdown as sula_dropdown, SulaIcon as sula_icon, SulaLoader as sula_loader, SulaMenuSelectList as sula_menu_select_list, SulaProgressBar as sula_progress_bar, SulaRadioButton as sula_radio_button, SulaSearchBar as sula_search_bar, SulaSwitch as sula_switch, SulaTag as sula_tag, SulaTextarea as sula_textarea, SulaTextfield as sula_textfield, SulaTiles as sula_tiles, SulaTimelineList as sula_timeline_list };
|
|
22196
22392
|
//# sourceMappingURL=sula-avatar.sula-badge.sula-button.sula-checkbox.sula-chip.sula-dropdown.sula-icon.sula-loader.sula-menu-select-list.sula-progress-bar.sula-radio-button.sula-search-bar.sula-switch.sula-tag.sula-textarea.sula-textfield.sula-tiles.sula-timeline-list.entry.esm.js.map
|
|
22197
|
-
//# sourceMappingURL=p-
|
|
22393
|
+
//# sourceMappingURL=p-bc1f174c.entry.js.map
|