@sula-tech/webcomponents 0.7.6 → 0.9.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/{index-Bbryl0vg.js → index-LR6yFDX7.js} +16 -2
- package/dist/cjs/index-LR6yFDX7.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{sula-avatar_18.cjs.entry.js → sula-avatar_19.cjs.entry.js} +612 -45
- package/dist/cjs/sula-avatar_19.cjs.entry.js.map +1 -0
- package/dist/cjs/webcomponents.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/sula-button/sula-button.css +1 -1
- package/dist/collection/components/sula-chip/sula-chip.css +1 -1
- package/dist/collection/components/sula-dropdown/sula-dropdown.css +1 -1
- package/dist/collection/components/sula-dropdown/sula-dropdown.js +74 -9
- package/dist/collection/components/sula-dropdown/sula-dropdown.js.map +1 -1
- package/dist/collection/components/sula-dropdown/sula-dropdown.stories.js +53 -0
- package/dist/collection/components/sula-dropdown/sula-dropdown.stories.js.map +1 -1
- package/dist/collection/components/sula-icon/sula-icon.css +1 -1
- package/dist/collection/components/sula-icon/sula-icon.js +1 -1
- package/dist/collection/components/sula-loader/sula-loader.css +1 -1
- package/dist/collection/components/sula-loader/sula-loader.js +1 -1
- package/dist/collection/components/sula-menu-select-list/sula-menu-select-list.css +1 -1
- package/dist/collection/components/sula-menu-select-list/sula-menu-select-list.js +33 -2
- package/dist/collection/components/sula-menu-select-list/sula-menu-select-list.js.map +1 -1
- package/dist/collection/components/sula-modal/model/sula-modal.model.js +16 -0
- package/dist/collection/components/sula-modal/model/sula-modal.model.js.map +1 -0
- package/dist/collection/components/sula-modal/sula-modal.css +1 -0
- package/dist/collection/components/sula-modal/sula-modal.js +558 -0
- package/dist/collection/components/sula-modal/sula-modal.js.map +1 -0
- package/dist/collection/components/sula-modal/sula-modal.stories.js +193 -0
- package/dist/collection/components/sula-modal/sula-modal.stories.js.map +1 -0
- package/dist/collection/components/sula-progress-bar/sula-progress-bar.js +2 -2
- package/dist/collection/components/sula-radio-button/sula-radio-button.js +2 -2
- package/dist/collection/components/sula-search-bar/sula-search-bar.js +2 -2
- package/dist/collection/components/sula-switch/sula-switch.js +4 -4
- package/dist/collection/components/sula-tag/sula-tag.js +3 -3
- package/dist/collection/components/sula-textarea/sula-textarea.js +6 -6
- 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/collection/components/sula-tiles/sula-tiles.js +1 -1
- package/dist/collection/components/sula-timeline-list/sula-timeline-list.js +1 -1
- package/dist/components/index.js +19 -0
- package/dist/components/index.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-BhxK9El6.js +231 -0
- package/dist/components/p-BhxK9El6.js.map +1 -0
- package/dist/components/{p-DoGc7jLn.js → p-CyIObO0v.js} +5 -8
- package/dist/components/p-CyIObO0v.js.map +1 -0
- package/dist/components/{p-BNtk_d_S.js → p-DvWN7hVP.js} +14 -6
- package/dist/components/p-DvWN7hVP.js.map +1 -0
- package/dist/components/{p-BrY8WoEl.js → p-ff6chV3i.js} +4 -4
- package/dist/components/{p-BrY8WoEl.js.map → p-ff6chV3i.js.map} +1 -1
- package/dist/components/sula-avatar.js +1 -1
- package/dist/components/sula-badge.js +1 -1
- package/dist/components/sula-button.js +1 -226
- package/dist/components/sula-button.js.map +1 -1
- package/dist/components/sula-checkbox.js +1 -1
- package/dist/components/sula-chip.js +3 -3
- package/dist/components/sula-chip.js.map +1 -1
- package/dist/components/sula-dropdown.js +60 -14
- package/dist/components/sula-dropdown.js.map +1 -1
- package/dist/components/sula-icon.js +1 -1
- package/dist/components/sula-loader.js +1 -1
- package/dist/components/sula-menu-select-list.js +1 -1
- package/dist/components/sula-modal.d.ts +11 -0
- package/dist/components/sula-modal.js +332 -0
- package/dist/components/sula-modal.js.map +1 -0
- package/dist/components/sula-progress-bar.js +3 -3
- package/dist/components/sula-radio-button.js +2 -2
- package/dist/components/sula-search-bar.js +3 -3
- package/dist/components/sula-switch.js +4 -4
- package/dist/components/sula-tag.js +4 -4
- package/dist/components/sula-textarea.js +6 -6
- package/dist/components/sula-textfield.js +249 -3
- package/dist/components/sula-textfield.js.map +1 -1
- package/dist/components/sula-tiles.js +2 -2
- package/dist/components/sula-timeline-list.js +2 -2
- package/dist/esm/{index-or7qTZgT.js → index-CrFclBiX.js} +16 -2
- package/dist/esm/index-CrFclBiX.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{sula-avatar_18.entry.js → sula-avatar_19.entry.js} +612 -46
- package/dist/esm/sula-avatar_19.entry.js.map +1 -0
- package/dist/esm/webcomponents.js +3 -3
- package/dist/types/components/sula-dropdown/sula-dropdown.d.ts +11 -0
- package/dist/types/components/sula-dropdown/sula-dropdown.stories.d.ts +10 -0
- package/dist/types/components/sula-menu-select-list/sula-menu-select-list.d.ts +4 -0
- package/dist/types/components/sula-modal/model/sula-modal.model.d.ts +13 -0
- package/dist/types/components/sula-modal/sula-modal.d.ts +94 -0
- package/dist/types/components/sula-modal/sula-modal.stories.d.ts +83 -0
- 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 +178 -0
- package/dist/webcomponents/{p-or7qTZgT.js → p-CrFclBiX.js} +28 -16
- package/dist/webcomponents/p-CrFclBiX.js.map +1 -0
- package/dist/webcomponents/{p-af46ad3b.entry.js → p-e4fa59d5.entry.js} +854 -285
- package/dist/webcomponents/p-e4fa59d5.entry.js.map +1 -0
- package/dist/webcomponents/webcomponents.esm.js +42 -20
- package/package.json +4 -4
- package/dist/cjs/index-Bbryl0vg.js.map +0 -1
- package/dist/cjs/sula-avatar_18.cjs.entry.js.map +0 -1
- package/dist/components/p-BNtk_d_S.js.map +0 -1
- package/dist/components/p-DoGc7jLn.js.map +0 -1
- package/dist/esm/index-or7qTZgT.js.map +0 -1
- package/dist/esm/sula-avatar_18.entry.js.map +0 -1
- package/dist/webcomponents/p-af46ad3b.entry.js.map +0 -1
- package/dist/webcomponents/p-or7qTZgT.js.map +0 -1
|
@@ -138,32 +138,32 @@ const SulaTextarea$1 = /*@__PURE__*/ proxyCustomElement(class SulaTextarea exten
|
|
|
138
138
|
}
|
|
139
139
|
render() {
|
|
140
140
|
const containerHeight = this.rows * 24 + 48;
|
|
141
|
-
return (h(Host, { key: '
|
|
141
|
+
return (h(Host, { key: '2fcc7b99d23820764799bcf3eed0a7605c9d2f72', ref: node => (this.node = node) }, h("div", { key: '5b6fecfaef896755b1862cf8468fb31297169885' }, h("div", { key: 'ed641bb610135c66bd663bfa284f0d81e7e1738d', id: "textarea-container", class: {
|
|
142
142
|
'relative border rounded-sm px-16 py-12 outline-none caret-brand-primary': true,
|
|
143
143
|
'textarea-focus': this.textareaIsFocused && !this.disabled && this.status === SulaTextareaStatus.Default,
|
|
144
144
|
'textarea-error': this.status === SulaTextareaStatus.Error && !this.disabled,
|
|
145
145
|
'bg-states-bg-disabled border-line-general cursor-not-allowed': this.disabled,
|
|
146
146
|
'bg-surface-body border-line-input cursor-text': !this.disabled,
|
|
147
|
-
}, style: { height: `${containerHeight}px` }, tabIndex: 0, onFocus: this.handleFocus, onClick: this.handleTextareaClick }, h("label", { key: '
|
|
147
|
+
}, style: { height: `${containerHeight}px` }, tabIndex: 0, onFocus: this.handleFocus, onClick: this.handleTextareaClick }, h("label", { key: '69ad1cd86d7395ecdeb7a6aeac02273370a10fef', class: {
|
|
148
148
|
'text-base top-16 left-12 absolute transition-all duration-200 ease-in-out pointer-events-none z-10 w-[85%]': true,
|
|
149
149
|
'text-text-primary': !this.disabled && (this.isActive || this.status === SulaTextareaStatus.Default),
|
|
150
150
|
'text-text-disabled': this.disabled,
|
|
151
151
|
'bg-surface-body': !this.disabled && this.isActive,
|
|
152
|
-
}, ref: node => (this.labelElement = node) }, this.label), h("label", { key: '
|
|
152
|
+
}, ref: node => (this.labelElement = node) }, this.label), h("label", { key: '0352260db567f497becd5f8f347cf206aecb595b', class: {
|
|
153
153
|
'absolute font-bold transition-all duration-200 ease-in-out pointer-events-none z-10 active-label hidden from-down': true,
|
|
154
154
|
'text-sm top-12 left-16': this.isActive,
|
|
155
155
|
'text-text-primary': !this.disabled && (this.isActive || this.status === SulaTextareaStatus.Default),
|
|
156
156
|
'text-text-disabled': this.disabled,
|
|
157
157
|
'bg-surface-body': !this.disabled && this.isActive,
|
|
158
|
-
}, ref: node => (this.activeLabelElement = node) }, this.label), h("textarea", { key: '
|
|
158
|
+
}, ref: node => (this.activeLabelElement = node) }, this.label), h("textarea", { key: 'edeacd0e14078081c1d5986e60852b8ed5b6a6a6', ref: node => (this.textareaElement = node), placeholder: this.isActive ? this.placeholder : '', rows: this.rows, maxLength: this.maxLength, disabled: this.disabled, class: {
|
|
159
159
|
'w-full h-full outline-none text-base bg-transparent border-none resize-none': true,
|
|
160
160
|
'text-text-primary': !this.disabled,
|
|
161
161
|
'text-text-disabled cursor-not-allowed overflow-hidden': this.disabled,
|
|
162
|
-
}, style: { paddingTop: this.isActive ? `${this.labelPadding}px` : '0' }, onInput: this.handleTextareaChanges, onFocus: this.handleTextareaFocus, onBlur: this.handleBlur, value: this.textValue })), (this.helpText || this.maxLength) && (h("div", { key: '
|
|
162
|
+
}, style: { paddingTop: this.isActive ? `${this.labelPadding}px` : '0' }, onInput: this.handleTextareaChanges, onFocus: this.handleTextareaFocus, onBlur: this.handleBlur, value: this.textValue })), (this.helpText || this.maxLength) && (h("div", { key: 'f1036cde3cf5bbd60fba5938fc2054d12d110624', class: "flex justify-between items-center px-16 mt-4 text-sm" }, this.helpText && (h("div", { key: 'db55a3ae78e63964a9d26a8cd44a71874a500004', id: "textarea-help-text", class: {
|
|
163
163
|
'text-text-primary': this.status === SulaTextareaStatus.Default && !this.disabled,
|
|
164
164
|
'text-feedback-error': this.status === SulaTextareaStatus.Error && !this.disabled,
|
|
165
165
|
'text-text-disabled': this.disabled,
|
|
166
|
-
} }, this.helpText)), this.maxLength && (h("div", { key: '
|
|
166
|
+
} }, this.helpText)), this.maxLength && (h("div", { key: '4e73a6934d1b959c86fa2c9f4cfb5dadaf20e943', id: "max-length-container", class: {
|
|
167
167
|
'text-text-primary': this.status === SulaTextareaStatus.Default && !this.disabled,
|
|
168
168
|
'text-feedback-error': this.status === SulaTextareaStatus.Error && !this.disabled,
|
|
169
169
|
'text-text-disabled': this.disabled,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index.js';
|
|
2
|
-
import {
|
|
2
|
+
import { g as getDefaultExportFromCjs } from './p-B85MJLTf.js';
|
|
3
|
+
import { d as defineCustomElement$2 } from './p-ff6chV3i.js';
|
|
3
4
|
|
|
4
5
|
var SulaTextfieldType;
|
|
5
6
|
(function (SulaTextfieldType) {
|
|
@@ -12,6 +13,241 @@ var SulaTextfieldStatus;
|
|
|
12
13
|
SulaTextfieldStatus["Error"] = "error";
|
|
13
14
|
})(SulaTextfieldStatus || (SulaTextfieldStatus = {}));
|
|
14
15
|
|
|
16
|
+
var vanillaMasker$1 = {exports: {}};
|
|
17
|
+
|
|
18
|
+
var vanillaMasker = vanillaMasker$1.exports;
|
|
19
|
+
|
|
20
|
+
var hasRequiredVanillaMasker;
|
|
21
|
+
|
|
22
|
+
function requireVanillaMasker () {
|
|
23
|
+
if (hasRequiredVanillaMasker) return vanillaMasker$1.exports;
|
|
24
|
+
hasRequiredVanillaMasker = 1;
|
|
25
|
+
(function (module, exports) {
|
|
26
|
+
(function(root, factory) {
|
|
27
|
+
{
|
|
28
|
+
module.exports = factory();
|
|
29
|
+
}
|
|
30
|
+
}(vanillaMasker, function() {
|
|
31
|
+
var DIGIT = "9",
|
|
32
|
+
ALPHA = "A",
|
|
33
|
+
ALPHANUM = "S",
|
|
34
|
+
BY_PASS_KEYS = [9, 16, 17, 18, 36, 37, 38, 39, 40, 91, 92, 93],
|
|
35
|
+
isAllowedKeyCode = function(keyCode) {
|
|
36
|
+
for (var i = 0, len = BY_PASS_KEYS.length; i < len; i++) {
|
|
37
|
+
if (keyCode == BY_PASS_KEYS[i]) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return true;
|
|
42
|
+
},
|
|
43
|
+
mergeMoneyOptions = function(opts) {
|
|
44
|
+
opts = opts || {};
|
|
45
|
+
opts = {
|
|
46
|
+
delimiter: opts.delimiter || ".",
|
|
47
|
+
lastOutput: opts.lastOutput,
|
|
48
|
+
precision: opts.hasOwnProperty("precision") ? opts.precision : 2,
|
|
49
|
+
separator: opts.separator || ",",
|
|
50
|
+
showSignal: opts.showSignal,
|
|
51
|
+
suffixUnit: opts.suffixUnit && (" " + opts.suffixUnit.replace(/[\s]/g,'')) || "",
|
|
52
|
+
unit: opts.unit && (opts.unit.replace(/[\s]/g,'') + " ") || "",
|
|
53
|
+
zeroCents: opts.zeroCents
|
|
54
|
+
};
|
|
55
|
+
opts.moneyPrecision = opts.zeroCents ? 0 : opts.precision;
|
|
56
|
+
return opts;
|
|
57
|
+
},
|
|
58
|
+
// Fill wildcards past index in output with placeholder
|
|
59
|
+
addPlaceholdersToOutput = function(output, index, placeholder) {
|
|
60
|
+
for (; index < output.length; index++) {
|
|
61
|
+
if(output[index] === DIGIT || output[index] === ALPHA || output[index] === ALPHANUM) {
|
|
62
|
+
output[index] = placeholder;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return output;
|
|
66
|
+
}
|
|
67
|
+
;
|
|
68
|
+
|
|
69
|
+
var VanillaMasker = function(elements) {
|
|
70
|
+
this.elements = elements;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
VanillaMasker.prototype.unbindElementToMask = function() {
|
|
74
|
+
for (var i = 0, len = this.elements.length; i < len; i++) {
|
|
75
|
+
this.elements[i].lastOutput = "";
|
|
76
|
+
this.elements[i].onkeyup = false;
|
|
77
|
+
this.elements[i].onkeydown = false;
|
|
78
|
+
|
|
79
|
+
if (this.elements[i].value.length) {
|
|
80
|
+
this.elements[i].value = this.elements[i].value.replace(/\D/g, '');
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
VanillaMasker.prototype.bindElementToMask = function(maskFunction) {
|
|
86
|
+
var that = this,
|
|
87
|
+
onType = function(e) {
|
|
88
|
+
e = e || window.event;
|
|
89
|
+
var source = e.target || e.srcElement;
|
|
90
|
+
|
|
91
|
+
if (isAllowedKeyCode(e.keyCode)) {
|
|
92
|
+
setTimeout(function() {
|
|
93
|
+
that.opts.lastOutput = source.lastOutput;
|
|
94
|
+
source.value = VMasker[maskFunction](source.value, that.opts);
|
|
95
|
+
source.lastOutput = source.value;
|
|
96
|
+
if (source.setSelectionRange && that.opts.suffixUnit) {
|
|
97
|
+
source.setSelectionRange(source.value.length, (source.value.length - that.opts.suffixUnit.length));
|
|
98
|
+
}
|
|
99
|
+
}, 0);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
;
|
|
103
|
+
for (var i = 0, len = this.elements.length; i < len; i++) {
|
|
104
|
+
this.elements[i].lastOutput = "";
|
|
105
|
+
this.elements[i].onkeyup = onType;
|
|
106
|
+
if (this.elements[i].value.length) {
|
|
107
|
+
this.elements[i].value = VMasker[maskFunction](this.elements[i].value, this.opts);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
VanillaMasker.prototype.maskMoney = function(opts) {
|
|
113
|
+
this.opts = mergeMoneyOptions(opts);
|
|
114
|
+
this.bindElementToMask("toMoney");
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
VanillaMasker.prototype.maskNumber = function() {
|
|
118
|
+
this.opts = {};
|
|
119
|
+
this.bindElementToMask("toNumber");
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
VanillaMasker.prototype.maskAlphaNum = function() {
|
|
123
|
+
this.opts = {};
|
|
124
|
+
this.bindElementToMask("toAlphaNumeric");
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
VanillaMasker.prototype.maskPattern = function(pattern) {
|
|
128
|
+
this.opts = {pattern: pattern};
|
|
129
|
+
this.bindElementToMask("toPattern");
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
VanillaMasker.prototype.unMask = function() {
|
|
133
|
+
this.unbindElementToMask();
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
var VMasker = function(el) {
|
|
137
|
+
if (!el) {
|
|
138
|
+
throw new Error("VanillaMasker: There is no element to bind.");
|
|
139
|
+
}
|
|
140
|
+
var elements = ("length" in el) ? (el.length ? el : []) : [el];
|
|
141
|
+
return new VanillaMasker(elements);
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
VMasker.toMoney = function(value, opts) {
|
|
145
|
+
opts = mergeMoneyOptions(opts);
|
|
146
|
+
if (opts.zeroCents) {
|
|
147
|
+
opts.lastOutput = opts.lastOutput || "";
|
|
148
|
+
var zeroMatcher = ("("+ opts.separator +"[0]{0,"+ opts.precision +"})"),
|
|
149
|
+
zeroRegExp = new RegExp(zeroMatcher, "g"),
|
|
150
|
+
digitsLength = value.toString().replace(/[\D]/g, "").length || 0,
|
|
151
|
+
lastDigitLength = opts.lastOutput.toString().replace(/[\D]/g, "").length || 0
|
|
152
|
+
;
|
|
153
|
+
value = value.toString().replace(zeroRegExp, "");
|
|
154
|
+
if (digitsLength < lastDigitLength) {
|
|
155
|
+
value = value.slice(0, value.length - 1);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
var number = value.toString().replace(/[\D]/g, ""),
|
|
159
|
+
clearDelimiter = new RegExp("^(0|\\"+ opts.delimiter +")"),
|
|
160
|
+
clearSeparator = new RegExp("(\\"+ opts.separator +")$"),
|
|
161
|
+
money = number.substr(0, number.length - opts.moneyPrecision),
|
|
162
|
+
masked = money.substr(0, money.length % 3),
|
|
163
|
+
cents = new Array(opts.precision + 1).join("0")
|
|
164
|
+
;
|
|
165
|
+
money = money.substr(money.length % 3, money.length);
|
|
166
|
+
for (var i = 0, len = money.length; i < len; i++) {
|
|
167
|
+
if (i % 3 === 0) {
|
|
168
|
+
masked += opts.delimiter;
|
|
169
|
+
}
|
|
170
|
+
masked += money[i];
|
|
171
|
+
}
|
|
172
|
+
masked = masked.replace(clearDelimiter, "");
|
|
173
|
+
masked = masked.length ? masked : "0";
|
|
174
|
+
var signal = "";
|
|
175
|
+
if(opts.showSignal === true) {
|
|
176
|
+
signal = value < 0 || (value.startsWith && value.startsWith('-')) ? "-" : "";
|
|
177
|
+
}
|
|
178
|
+
if (!opts.zeroCents) {
|
|
179
|
+
var beginCents = number.length - opts.precision,
|
|
180
|
+
centsValue = number.substr(beginCents, opts.precision),
|
|
181
|
+
centsLength = centsValue.length,
|
|
182
|
+
centsSliced = (opts.precision > centsLength) ? opts.precision : centsLength
|
|
183
|
+
;
|
|
184
|
+
cents = (cents + centsValue).slice(-centsSliced);
|
|
185
|
+
}
|
|
186
|
+
var output = opts.unit + signal + masked + opts.separator + cents;
|
|
187
|
+
return output.replace(clearSeparator, "") + opts.suffixUnit;
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
VMasker.toPattern = function(value, opts) {
|
|
191
|
+
var pattern = (typeof opts === 'object' ? opts.pattern : opts),
|
|
192
|
+
patternChars = pattern.replace(/\W/g, ''),
|
|
193
|
+
output = pattern.split(""),
|
|
194
|
+
values = value.toString().replace(/\W/g, ""),
|
|
195
|
+
charsValues = values.replace(/\W/g, ''),
|
|
196
|
+
index = 0,
|
|
197
|
+
i,
|
|
198
|
+
outputLength = output.length,
|
|
199
|
+
placeholder = (typeof opts === 'object' ? opts.placeholder : undefined)
|
|
200
|
+
;
|
|
201
|
+
|
|
202
|
+
for (i = 0; i < outputLength; i++) {
|
|
203
|
+
// Reached the end of input
|
|
204
|
+
if (index >= values.length) {
|
|
205
|
+
if (patternChars.length == charsValues.length) {
|
|
206
|
+
return output.join("");
|
|
207
|
+
}
|
|
208
|
+
else if ((placeholder !== undefined) && (patternChars.length > charsValues.length)) {
|
|
209
|
+
return addPlaceholdersToOutput(output, i, placeholder).join("");
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
break;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
// Remaining chars in input
|
|
216
|
+
else {
|
|
217
|
+
if ((output[i] === DIGIT && values[index].match(/[0-9]/)) ||
|
|
218
|
+
(output[i] === ALPHA && values[index].match(/[a-zA-Z]/)) ||
|
|
219
|
+
(output[i] === ALPHANUM && values[index].match(/[0-9a-zA-Z]/))) {
|
|
220
|
+
output[i] = values[index++];
|
|
221
|
+
} else if (output[i] === DIGIT || output[i] === ALPHA || output[i] === ALPHANUM) {
|
|
222
|
+
if(placeholder !== undefined){
|
|
223
|
+
return addPlaceholdersToOutput(output, i, placeholder).join("");
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
return output.slice(0, i).join("");
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return output.join("").substr(0, i);
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
VMasker.toNumber = function(value) {
|
|
235
|
+
return value.toString().replace(/(?!^-)[^0-9]/g, "");
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
VMasker.toAlphaNumeric = function(value) {
|
|
239
|
+
return value.toString().replace(/[^a-z0-9 ]+/i, "");
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
return VMasker;
|
|
243
|
+
}));
|
|
244
|
+
} (vanillaMasker$1));
|
|
245
|
+
return vanillaMasker$1.exports;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
var vanillaMaskerExports = requireVanillaMasker();
|
|
249
|
+
var VMasker = /*@__PURE__*/getDefaultExportFromCjs(vanillaMaskerExports);
|
|
250
|
+
|
|
15
251
|
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}";
|
|
16
252
|
|
|
17
253
|
const SulaTextfield$1 = /*@__PURE__*/ proxyCustomElement(class SulaTextfield extends H {
|
|
@@ -38,6 +274,9 @@ const SulaTextfield$1 = /*@__PURE__*/ proxyCustomElement(class SulaTextfield ext
|
|
|
38
274
|
this.toggleOptions(true);
|
|
39
275
|
};
|
|
40
276
|
this.handleInputChanges = (event) => {
|
|
277
|
+
if (this.maskPattern && this.inputElement) {
|
|
278
|
+
this.handleInputMask();
|
|
279
|
+
}
|
|
41
280
|
const newValue = event.target.value;
|
|
42
281
|
this.textValue = newValue;
|
|
43
282
|
this.value = newValue;
|
|
@@ -104,6 +343,9 @@ const SulaTextfield$1 = /*@__PURE__*/ proxyCustomElement(class SulaTextfield ext
|
|
|
104
343
|
if (this.textValue && this.textValue.trim().length > 0) {
|
|
105
344
|
this.changeElementsStyle();
|
|
106
345
|
}
|
|
346
|
+
if (this.maskPattern && this.inputElement) {
|
|
347
|
+
this.handleInputMask();
|
|
348
|
+
}
|
|
107
349
|
}
|
|
108
350
|
toggleOptions(inputIsOpen) {
|
|
109
351
|
if ((this.inputIsOpen && this.textValue && this.textValue.length > 0) || this.disabled)
|
|
@@ -121,6 +363,9 @@ const SulaTextfield$1 = /*@__PURE__*/ proxyCustomElement(class SulaTextfield ext
|
|
|
121
363
|
this.labelElement.classList.add('from-up');
|
|
122
364
|
}
|
|
123
365
|
}
|
|
366
|
+
handleInputMask() {
|
|
367
|
+
VMasker(this.inputElement).maskPattern(this.maskPattern);
|
|
368
|
+
}
|
|
124
369
|
handlePasswordIconClicked() {
|
|
125
370
|
const cursorPosition = this.inputElement.selectionStart;
|
|
126
371
|
const inputValue = this.inputElement.value;
|
|
@@ -139,14 +384,14 @@ const SulaTextfield$1 = /*@__PURE__*/ proxyCustomElement(class SulaTextfield ext
|
|
|
139
384
|
return this.icon;
|
|
140
385
|
}
|
|
141
386
|
render() {
|
|
142
|
-
return (h(Host, { key: '
|
|
387
|
+
return (h(Host, { key: '7f3d6752bea3a556fa77a52513eabe0655d9234d', ref: node => (this.node = node) }, h("div", { key: 'cd9cbc06a0244161c06e770d87834ddd7311ada3' }, h("div", { key: 'b66f4f6f2a5cfdcbc212264d500d219b4deb335e', id: "button-container", class: {
|
|
143
388
|
'flex items-center border rounded-sm px-16 outline-none h-[72px] caret-brand-primary': true,
|
|
144
389
|
'flex-row justify-between': !!this.icon || this.type === SulaTextfieldType.Password,
|
|
145
390
|
'button-focus': this.inputIsFocused && !this.disabled && this.status === SulaTextfieldStatus.Default,
|
|
146
391
|
'button-error': this.status === SulaTextfieldStatus.Error && !this.disabled,
|
|
147
392
|
'bg-states-bg-disabled border-line-general cursor-not-allowed': this.disabled,
|
|
148
393
|
'bg-surface-body border-line-input cursor-pointer': !this.disabled,
|
|
149
|
-
}, tabIndex: 0, onFocus: this.handleFocus, onClick: this.handleInputClick }, !this.disabled && (h("div", { key: '
|
|
394
|
+
}, tabIndex: 0, onFocus: this.handleFocus, onClick: this.handleInputClick }, !this.disabled && (h("div", { key: '79eabd37134b96bbb5a315ca73d81d0c8be01ce4', class: { 'hidden flex-col w-full': true, 'pr-12': !!this.icon }, ref: node => (this.inputContainer = node) }, h("label", { key: 'd24af603a0e365d1482daea31b75fa8e86fd5e8a', class: "font-bold text-sm text-text-primary from-down" }, this.label), h("input", { key: 'aea523483b4a39f31b0d2c9506001d69c397da70', 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("div", { key: '2e3d9fbe37ba1dc5aceea8e8ce7e6152f740a955', 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("div", { key: 'd6f5aacd486e093d64307117d8c6b0bfea460f49', class: "flex items-center justify-center", onClick: this.handleIconClick }, h("sula-icon", { key: 'cfc400df76f2c487a09b641c101543a3e2895bd1', icon: this.getInputIcon(), customClass: `text-2xl ${this.disabled ? 'text-icon-disabled' : 'text-icon-primary'}` })))), (this.helpText || this.maxLength) && !this.disabled && (h("div", { key: '8d450abc836ba702aeda16f4f6c1d379373ee698', class: "flex justify-between items-center px-16 mt-4 text-sm" }, this.helpText && (h("div", { key: 'e0d25ac6878865510a0afc793d81b07d8a016bb5', id: "textfield-help-text", class: { 'text-text-primary': this.status === SulaTextfieldStatus.Default, 'text-feedback-error': this.status === SulaTextfieldStatus.Error } }, this.helpText)), this.maxLength && (h("div", { key: '6384a6d5468b03bef0ddf2e0345438efe1b5fd32', 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)))))));
|
|
150
395
|
}
|
|
151
396
|
static get watchers() { return {
|
|
152
397
|
"value": ["watchValueHandler"]
|
|
@@ -162,6 +407,7 @@ const SulaTextfield$1 = /*@__PURE__*/ proxyCustomElement(class SulaTextfield ext
|
|
|
162
407
|
"helpText": [1, "help-text"],
|
|
163
408
|
"maxLength": [2, "max-length"],
|
|
164
409
|
"icon": [1],
|
|
410
|
+
"maskPattern": [1, "mask-pattern"],
|
|
165
411
|
"inputIsOpen": [32],
|
|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,EAAE,WAAW,EAAE,CAAY,SAAA,EAAA,IAAI,CAAC,QAAQ,GAAG,oBAAoB,GAAG,mBAAmB,CAAE,CAAA,EAAA,CAAI,CAC3H,CACP,CACG,EAEL,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,SAAS,KAAK,CAAC,IAAI,CAAC,QAAQ,KAClD,CAAK,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,sDAAsD,EAAA,EAC9D,IAAI,CAAC,QAAQ,KACZ,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACE,EAAE,EAAC,qBAAqB,EACxB,KAAK,EAAE,EAAE,mBAAmB,EAAE,IAAI,CAAC,MAAM,KAAK,mBAAmB,CAAC,OAAO,EAAE,qBAAqB,EAAE,IAAI,CAAC,MAAM,KAAK,mBAAmB,CAAC,KAAK,EAAE,EAAA,EAE5I,IAAI,CAAC,QAAQ,CACV,CACP,EACA,IAAI,CAAC,SAAS,KACb,CACE,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EAAE,EAAC,sBAAsB,EACzB,KAAK,EAAE,EAAE,mBAAmB,EAAE,IAAI,CAAC,MAAM,KAAK,mBAAmB,CAAC,OAAO,EAAE,qBAAqB,EAAE,IAAI,CAAC,MAAM,KAAK,mBAAmB,CAAC,KAAK,EAAE,EAAA,EAE5I,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,OAAG,IAAI,CAAC,SAAS,CACxD,CACP,CACG,CACP,CACG,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SulaTextfield","__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/sula-textfield/model/sula-textfield.model.ts","src/components/sula-textfield/sula-textfield.scss?tag=sula-textfield&encapsulation=shadow","src/components/sula-textfield/sula-textfield.tsx"],"sourcesContent":["export enum SulaTextfieldType {\n Text = 'text',\n Password = 'password',\n}\n\nexport enum SulaTextfieldStatus {\n Default = 'default',\n Error = 'error',\n}\n",":host {\n display: block;\n}\n\n.button-focus {\n outline: 2px solid var(--color-feedback-informational) !important;\n outline-offset: 2px !important;\n}\n\n.button-error {\n outline: 2px solid var(--color-feedback-error) !important;\n outline-offset: 2px !important;\n}\n\n.from-down {\n animation: from-down 0.2s ease-in-out;\n}\n\n.from-up {\n animation: from-up 0.2s ease-in-out;\n}\n\n@keyframes from-down {\n from {\n transform: translateY(75%);\n opacity: 0;\n }\n to {\n transform: translateY(0);\n opacity: 1;\n }\n}\n\n@keyframes from-up {\n from {\n transform: translateY(-75%);\n opacity: 0;\n }\n to {\n transform: translateY(0);\n opacity: 1;\n }\n}\n","import { Component, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { SulaTextfieldStatus, SulaTextfieldType } from './model/sula-textfield.model';\n\n@Component({\n tag: 'sula-textfield',\n styleUrl: 'sula-textfield.scss',\n shadow: true,\n})\nexport class SulaTextfield {\n /**\n * Value for the input.\n */\n @Prop({ mutable: true })\n value?: string;\n\n /**\n * The textfield type\n */\n @Prop() type: SulaTextfieldType = SulaTextfieldType.Text;\n\n /**\n * The textfield status\n */\n @Prop({ mutable: true }) status: SulaTextfieldStatus = SulaTextfieldStatus.Default;\n\n /**\n * The textfield label\n */\n @Prop() label: string;\n\n /**\n * The textfield placeholder\n */\n @Prop() placeholder: string;\n\n /**\n * The textfield is disabled\n */\n @Prop({ mutable: true }) disabled: boolean;\n\n /**\n * The help text for textfield\n */\n @Prop() helpText?: string;\n\n /**\n * The textfield max length\n */\n @Prop() maxLength?: number;\n\n /**\n * The textfield icon\n */\n @Prop() icon?: string;\n\n /**\n * Event emitted when input value changes.\n */\n @Event()\n valueChanged: EventEmitter<string>;\n\n /**\n * Event emitted when input is focused.\n */\n @Event()\n focusedOn: EventEmitter<void>;\n\n /**\n * Event emitted when input is focused out.\n */\n @Event()\n focusedOut: EventEmitter<void>;\n\n @State()\n inputIsOpen = false;\n\n @State()\n textValue: string = '';\n\n @State()\n showPassword = false;\n\n @State()\n inputIsFocused = false;\n\n @Watch('value')\n watchValueHandler(newValue: string) {\n this.textValue = newValue;\n\n if (this.inputElement && this.inputElement.value !== newValue) {\n const cursorPosition = this.inputElement.selectionStart;\n this.inputElement.value = newValue || '';\n\n if (this.inputIsFocused && cursorPosition !== null) {\n const newPosition = Math.min(cursorPosition, (newValue || '').length);\n this.inputElement.setSelectionRange(newPosition, newPosition);\n }\n }\n\n if (newValue && newValue.trim().length > 0) {\n this.inputIsOpen = true;\n this.changeElementsStyle();\n } else if (!this.inputIsFocused) {\n this.inputIsOpen = false;\n this.changeElementsStyle();\n }\n }\n\n inputContainer: HTMLDivElement;\n inputElement: HTMLInputElement;\n labelElement: HTMLDivElement;\n\n node?: HTMLElement;\n\n @Listen('click', { target: 'document' })\n handleClick(event: Event) {\n if (!this.node || !this.inputIsFocused) return;\n\n const clickInside = this.node.contains(event.target as Node);\n\n if (!clickInside) {\n this.toggleOptions(false);\n this.focusedOut.emit();\n this.inputIsFocused = false;\n }\n }\n\n componentWillLoad() {\n if (this.value && this.value.trim().length > 0) {\n this.textValue = this.value;\n this.inputIsOpen = true;\n }\n }\n\n componentDidLoad() {\n if (this.textValue && this.textValue.trim().length > 0) {\n this.changeElementsStyle();\n }\n }\n\n handleInputClick = () => {\n this.toggleOptions(true);\n };\n\n toggleOptions(inputIsOpen: boolean) {\n if ((this.inputIsOpen && this.textValue && this.textValue.length > 0) || this.disabled) return;\n\n this.inputIsOpen = inputIsOpen;\n this.changeElementsStyle();\n this.inputElement.focus();\n }\n\n changeElementsStyle() {\n if (!this.inputContainer || !this.labelElement) return;\n\n this.inputContainer.style.display = this.inputIsOpen ? 'flex' : 'none';\n this.labelElement.style.display = this.inputIsOpen ? 'none' : 'block';\n if (!this.inputIsOpen) {\n this.labelElement.classList.add('from-up');\n }\n }\n\n handleInputChanges = (event: InputEvent) => {\n const newValue = (event.target as HTMLInputElement).value;\n this.textValue = newValue;\n this.value = newValue;\n\n this.valueChanged.emit(newValue);\n };\n\n handleFocus = () => {\n if (this.disabled) return;\n this.toggleOptions(true);\n this.inputElement.focus();\n };\n\n handleBlur = () => {\n this.toggleOptions(false);\n\n this.focusedOut.emit();\n this.inputIsFocused = false;\n };\n\n handleInputFocus = () => {\n this.focusedOn.emit();\n this.inputIsFocused = true;\n };\n\n handleIconClick = (event: MouseEvent) => {\n if (this.type === SulaTextfieldType.Password) {\n event.stopPropagation();\n this.handlePasswordIconClicked();\n }\n };\n\n handlePasswordIconClicked() {\n const cursorPosition = this.inputElement.selectionStart;\n const inputValue = this.inputElement.value;\n const inputType = this.showPassword ? SulaTextfieldType.Password : SulaTextfieldType.Text;\n\n this.inputElement.setAttribute('type', inputType);\n this.showPassword = !this.showPassword;\n\n setTimeout(() => {\n this.inputElement.value = inputValue;\n\n this.inputElement.setSelectionRange(cursorPosition, cursorPosition);\n }, 0);\n }\n\n getInputIcon() {\n if (this.type === SulaTextfieldType.Password) {\n return this.showPassword ? 'ph ph-eye' : 'ph ph-eye-slash';\n }\n\n return this.icon;\n }\n\n render() {\n return (\n <Host ref={node => (this.node = node)}>\n <div>\n <div\n id=\"button-container\"\n class={{\n 'flex items-center border rounded-sm px-16 outline-none h-[72px] caret-brand-primary': true,\n 'flex-row justify-between': !!this.icon || this.type === SulaTextfieldType.Password,\n 'button-focus': this.inputIsFocused && !this.disabled && this.status === SulaTextfieldStatus.Default,\n 'button-error': this.status === SulaTextfieldStatus.Error && !this.disabled,\n 'bg-states-bg-disabled border-line-general cursor-not-allowed': this.disabled,\n 'bg-surface-body border-line-input cursor-pointer': !this.disabled,\n }}\n tabIndex={0}\n onFocus={this.handleFocus}\n onClick={this.handleInputClick}\n >\n {!this.disabled && (\n <div class={{ 'hidden flex-col w-full': true, 'pr-12': !!this.icon }} ref={node => (this.inputContainer = node)}>\n <label class=\"font-bold text-sm text-text-primary from-down\">{this.label}</label>\n <input\n type={this.type}\n ref={node => (this.inputElement = node)}\n placeholder={this.placeholder}\n class=\"outline-none text-base text-text-primary bg-transparent\"\n onInput={this.handleInputChanges}\n onFocus={this.handleInputFocus}\n value={this.textValue}\n />\n </div>\n )}\n\n <div\n id=\"textfield-label\"\n class={{ 'text-base flex items-center': true, 'text-text-primary': !this.disabled, 'text-text-disabled': this.disabled }}\n ref={node => (this.labelElement = node)}\n >\n {this.label}\n </div>\n\n {(!!this.icon || this.type === SulaTextfieldType.Password) && (\n <div class=\"flex items-center justify-center\" onClick={this.handleIconClick}>\n <sula-icon icon={this.getInputIcon()} customClass={`text-2xl ${this.disabled ? 'text-icon-disabled' : 'text-icon-primary'}`} />\n </div>\n )}\n </div>\n\n {(this.helpText || this.maxLength) && !this.disabled && (\n <div class=\"flex justify-between items-center px-16 mt-4 text-sm\">\n {this.helpText && (\n <div\n id=\"textfield-help-text\"\n class={{ 'text-text-primary': this.status === SulaTextfieldStatus.Default, 'text-feedback-error': this.status === SulaTextfieldStatus.Error }}\n >\n {this.helpText}\n </div>\n )}\n {this.maxLength && (\n <div\n id=\"max-length-container\"\n class={{ 'text-text-primary': this.status === SulaTextfieldStatus.Default, 'text-feedback-error': this.status === SulaTextfieldStatus.Error }}\n >\n {this.textValue ? this.textValue.length : 0}/{this.maxLength}\n </div>\n )}\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"sula-textfield.js","mappings":";;;;AAAA,IAAY,iBAGX;AAHD,CAAA,UAAY,iBAAiB,EAAA;AAC3B,IAAA,iBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,iBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACvB,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,GAG5B,EAAA,CAAA,CAAA;AAED,IAAY,mBAGX;AAHD,CAAA,UAAY,mBAAmB,EAAA;AAC7B,IAAA,mBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,mBAA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AAG,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,OAAG,IAAI,CAAC,SAAS,CACxD,CACP,CACG,CACP,CACG,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["this","SulaTextfield","__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/sula-textfield/model/sula-textfield.model.ts","node_modules/.pnpm/vanilla-masker@1.2.0/node_modules/vanilla-masker/lib/vanilla-masker.js","src/components/sula-textfield/sula-textfield.scss?tag=sula-textfield&encapsulation=shadow","src/components/sula-textfield/sula-textfield.tsx"],"sourcesContent":["export enum SulaTextfieldType {\n Text = 'text',\n Password = 'password',\n}\n\nexport enum SulaTextfieldStatus {\n Default = 'default',\n Error = 'error',\n}\n","(function(root, factory) {\n if (typeof define === 'function' && define.amd) {\n define(factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.VMasker = factory();\n }\n}(this, function() {\n var DIGIT = \"9\",\n ALPHA = \"A\",\n ALPHANUM = \"S\",\n BY_PASS_KEYS = [9, 16, 17, 18, 36, 37, 38, 39, 40, 91, 92, 93],\n isAllowedKeyCode = function(keyCode) {\n for (var i = 0, len = BY_PASS_KEYS.length; i < len; i++) {\n if (keyCode == BY_PASS_KEYS[i]) {\n return false;\n }\n }\n return true;\n },\n mergeMoneyOptions = function(opts) {\n opts = opts || {};\n opts = {\n delimiter: opts.delimiter || \".\",\n lastOutput: opts.lastOutput,\n precision: opts.hasOwnProperty(\"precision\") ? opts.precision : 2,\n separator: opts.separator || \",\",\n showSignal: opts.showSignal,\n suffixUnit: opts.suffixUnit && (\" \" + opts.suffixUnit.replace(/[\\s]/g,'')) || \"\",\n unit: opts.unit && (opts.unit.replace(/[\\s]/g,'') + \" \") || \"\",\n zeroCents: opts.zeroCents\n };\n opts.moneyPrecision = opts.zeroCents ? 0 : opts.precision;\n return opts;\n },\n // Fill wildcards past index in output with placeholder\n addPlaceholdersToOutput = function(output, index, placeholder) {\n for (; index < output.length; index++) {\n if(output[index] === DIGIT || output[index] === ALPHA || output[index] === ALPHANUM) {\n output[index] = placeholder;\n }\n }\n return output;\n }\n ;\n\n var VanillaMasker = function(elements) {\n this.elements = elements;\n };\n\n VanillaMasker.prototype.unbindElementToMask = function() {\n for (var i = 0, len = this.elements.length; i < len; i++) {\n this.elements[i].lastOutput = \"\";\n this.elements[i].onkeyup = false;\n this.elements[i].onkeydown = false;\n\n if (this.elements[i].value.length) {\n this.elements[i].value = this.elements[i].value.replace(/\\D/g, '');\n }\n }\n };\n\n VanillaMasker.prototype.bindElementToMask = function(maskFunction) {\n var that = this,\n onType = function(e) {\n e = e || window.event;\n var source = e.target || e.srcElement;\n\n if (isAllowedKeyCode(e.keyCode)) {\n setTimeout(function() {\n that.opts.lastOutput = source.lastOutput;\n source.value = VMasker[maskFunction](source.value, that.opts);\n source.lastOutput = source.value;\n if (source.setSelectionRange && that.opts.suffixUnit) {\n source.setSelectionRange(source.value.length, (source.value.length - that.opts.suffixUnit.length));\n }\n }, 0);\n }\n }\n ;\n for (var i = 0, len = this.elements.length; i < len; i++) {\n this.elements[i].lastOutput = \"\";\n this.elements[i].onkeyup = onType;\n if (this.elements[i].value.length) {\n this.elements[i].value = VMasker[maskFunction](this.elements[i].value, this.opts);\n }\n }\n };\n\n VanillaMasker.prototype.maskMoney = function(opts) {\n this.opts = mergeMoneyOptions(opts);\n this.bindElementToMask(\"toMoney\");\n };\n\n VanillaMasker.prototype.maskNumber = function() {\n this.opts = {};\n this.bindElementToMask(\"toNumber\");\n };\n \n VanillaMasker.prototype.maskAlphaNum = function() {\n this.opts = {};\n this.bindElementToMask(\"toAlphaNumeric\");\n };\n\n VanillaMasker.prototype.maskPattern = function(pattern) {\n this.opts = {pattern: pattern};\n this.bindElementToMask(\"toPattern\");\n };\n\n VanillaMasker.prototype.unMask = function() {\n this.unbindElementToMask();\n };\n\n var VMasker = function(el) {\n if (!el) {\n throw new Error(\"VanillaMasker: There is no element to bind.\");\n }\n var elements = (\"length\" in el) ? (el.length ? el : []) : [el];\n return new VanillaMasker(elements);\n };\n\n VMasker.toMoney = function(value, opts) {\n opts = mergeMoneyOptions(opts);\n if (opts.zeroCents) {\n opts.lastOutput = opts.lastOutput || \"\";\n var zeroMatcher = (\"(\"+ opts.separator +\"[0]{0,\"+ opts.precision +\"})\"),\n zeroRegExp = new RegExp(zeroMatcher, \"g\"),\n digitsLength = value.toString().replace(/[\\D]/g, \"\").length || 0,\n lastDigitLength = opts.lastOutput.toString().replace(/[\\D]/g, \"\").length || 0\n ;\n value = value.toString().replace(zeroRegExp, \"\");\n if (digitsLength < lastDigitLength) {\n value = value.slice(0, value.length - 1);\n }\n }\n var number = value.toString().replace(/[\\D]/g, \"\"),\n clearDelimiter = new RegExp(\"^(0|\\\\\"+ opts.delimiter +\")\"),\n clearSeparator = new RegExp(\"(\\\\\"+ opts.separator +\")$\"),\n money = number.substr(0, number.length - opts.moneyPrecision),\n masked = money.substr(0, money.length % 3),\n cents = new Array(opts.precision + 1).join(\"0\")\n ;\n money = money.substr(money.length % 3, money.length);\n for (var i = 0, len = money.length; i < len; i++) {\n if (i % 3 === 0) {\n masked += opts.delimiter;\n }\n masked += money[i];\n }\n masked = masked.replace(clearDelimiter, \"\");\n masked = masked.length ? masked : \"0\";\n var signal = \"\";\n if(opts.showSignal === true) {\n signal = value < 0 || (value.startsWith && value.startsWith('-')) ? \"-\" : \"\";\n }\n if (!opts.zeroCents) {\n var beginCents = number.length - opts.precision,\n centsValue = number.substr(beginCents, opts.precision),\n centsLength = centsValue.length,\n centsSliced = (opts.precision > centsLength) ? opts.precision : centsLength\n ;\n cents = (cents + centsValue).slice(-centsSliced);\n }\n var output = opts.unit + signal + masked + opts.separator + cents;\n return output.replace(clearSeparator, \"\") + opts.suffixUnit;\n };\n\n VMasker.toPattern = function(value, opts) {\n var pattern = (typeof opts === 'object' ? opts.pattern : opts),\n patternChars = pattern.replace(/\\W/g, ''),\n output = pattern.split(\"\"),\n values = value.toString().replace(/\\W/g, \"\"),\n charsValues = values.replace(/\\W/g, ''),\n index = 0,\n i,\n outputLength = output.length,\n placeholder = (typeof opts === 'object' ? opts.placeholder : undefined)\n ;\n \n for (i = 0; i < outputLength; i++) {\n // Reached the end of input\n if (index >= values.length) {\n if (patternChars.length == charsValues.length) {\n return output.join(\"\");\n }\n else if ((placeholder !== undefined) && (patternChars.length > charsValues.length)) {\n return addPlaceholdersToOutput(output, i, placeholder).join(\"\");\n }\n else {\n break;\n }\n }\n // Remaining chars in input\n else{\n if ((output[i] === DIGIT && values[index].match(/[0-9]/)) ||\n (output[i] === ALPHA && values[index].match(/[a-zA-Z]/)) ||\n (output[i] === ALPHANUM && values[index].match(/[0-9a-zA-Z]/))) {\n output[i] = values[index++];\n } else if (output[i] === DIGIT || output[i] === ALPHA || output[i] === ALPHANUM) {\n if(placeholder !== undefined){\n return addPlaceholdersToOutput(output, i, placeholder).join(\"\");\n }\n else{\n return output.slice(0, i).join(\"\");\n }\n }\n }\n }\n return output.join(\"\").substr(0, i);\n };\n\n VMasker.toNumber = function(value) {\n return value.toString().replace(/(?!^-)[^0-9]/g, \"\");\n };\n \n VMasker.toAlphaNumeric = function(value) {\n return value.toString().replace(/[^a-z0-9 ]+/i, \"\");\n };\n\n return VMasker;\n}));\n",":host {\n display: block;\n}\n\n.button-focus {\n outline: 2px solid var(--color-feedback-informational) !important;\n outline-offset: 2px !important;\n}\n\n.button-error {\n outline: 2px solid var(--color-feedback-error) !important;\n outline-offset: 2px !important;\n}\n\n.from-down {\n animation: from-down 0.2s ease-in-out;\n}\n\n.from-up {\n animation: from-up 0.2s ease-in-out;\n}\n\n@keyframes from-down {\n from {\n transform: translateY(75%);\n opacity: 0;\n }\n to {\n transform: translateY(0);\n opacity: 1;\n }\n}\n\n@keyframes from-up {\n from {\n transform: translateY(-75%);\n opacity: 0;\n }\n to {\n transform: translateY(0);\n opacity: 1;\n }\n}\n","import { Component, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { SulaTextfieldStatus, SulaTextfieldType } from './model/sula-textfield.model';\nimport VMasker from 'vanilla-masker';\n\n@Component({\n tag: 'sula-textfield',\n styleUrl: 'sula-textfield.scss',\n shadow: true,\n})\nexport class SulaTextfield {\n /**\n * Value for the input.\n */\n @Prop({ mutable: true })\n value?: string;\n\n /**\n * The textfield type\n */\n @Prop() type: SulaTextfieldType = SulaTextfieldType.Text;\n\n /**\n * The textfield status\n */\n @Prop({ mutable: true }) status: SulaTextfieldStatus = SulaTextfieldStatus.Default;\n\n /**\n * The textfield label\n */\n @Prop() label: string;\n\n /**\n * The textfield placeholder\n */\n @Prop() placeholder: string;\n\n /**\n * The textfield is disabled\n */\n @Prop({ mutable: true }) disabled: boolean;\n\n /**\n * The help text for textfield\n */\n @Prop() helpText?: string;\n\n /**\n * The textfield max length\n */\n @Prop() maxLength?: number;\n\n /**\n * The textfield icon\n */\n @Prop() icon?: string;\n\n /**\n * Event emitted when input value changes.\n */\n @Event()\n valueChanged: EventEmitter<string>;\n\n /**\n * The textfield mask pattern\n * The mask pattern should follow the VMasker pattern format\n * More info: https://github.com/vanilla-masker/vanilla-masker?tab=readme-ov-file#custom-pattern\n */\n @Prop()\n maskPattern?: string;\n\n /**\n * Event emitted when input is focused.\n */\n @Event()\n focusedOn: EventEmitter<void>;\n\n /**\n * Event emitted when input is focused out.\n */\n @Event()\n focusedOut: EventEmitter<void>;\n\n @State()\n inputIsOpen = false;\n\n @State()\n textValue: string = '';\n\n @State()\n showPassword = false;\n\n @State()\n inputIsFocused = false;\n\n @Watch('value')\n watchValueHandler(newValue: string) {\n this.textValue = newValue;\n\n if (this.inputElement && this.inputElement.value !== newValue) {\n const cursorPosition = this.inputElement.selectionStart;\n this.inputElement.value = newValue || '';\n\n if (this.inputIsFocused && cursorPosition !== null) {\n const newPosition = Math.min(cursorPosition, (newValue || '').length);\n this.inputElement.setSelectionRange(newPosition, newPosition);\n }\n }\n\n if (newValue && newValue.trim().length > 0) {\n this.inputIsOpen = true;\n this.changeElementsStyle();\n } else if (!this.inputIsFocused) {\n this.inputIsOpen = false;\n this.changeElementsStyle();\n }\n }\n\n inputContainer: HTMLDivElement;\n inputElement: HTMLInputElement;\n labelElement: HTMLDivElement;\n\n node?: HTMLElement;\n\n @Listen('click', { target: 'document' })\n handleClick(event: Event) {\n if (!this.node || !this.inputIsFocused) return;\n\n const clickInside = this.node.contains(event.target as Node);\n\n if (!clickInside) {\n this.toggleOptions(false);\n this.focusedOut.emit();\n this.inputIsFocused = false;\n }\n }\n\n componentWillLoad() {\n if (this.value && this.value.trim().length > 0) {\n this.textValue = this.value;\n this.inputIsOpen = true;\n }\n }\n\n componentDidLoad() {\n if (this.textValue && this.textValue.trim().length > 0) {\n this.changeElementsStyle();\n }\n\n if (this.maskPattern && this.inputElement) {\n this.handleInputMask();\n }\n }\n\n handleInputClick = () => {\n this.toggleOptions(true);\n };\n\n toggleOptions(inputIsOpen: boolean) {\n if ((this.inputIsOpen && this.textValue && this.textValue.length > 0) || this.disabled) return;\n\n this.inputIsOpen = inputIsOpen;\n this.changeElementsStyle();\n this.inputElement.focus();\n }\n\n changeElementsStyle() {\n if (!this.inputContainer || !this.labelElement) return;\n\n this.inputContainer.style.display = this.inputIsOpen ? 'flex' : 'none';\n this.labelElement.style.display = this.inputIsOpen ? 'none' : 'block';\n if (!this.inputIsOpen) {\n this.labelElement.classList.add('from-up');\n }\n }\n\n handleInputChanges = (event: InputEvent) => {\n if (this.maskPattern && this.inputElement) {\n this.handleInputMask();\n }\n const newValue = (event.target as HTMLInputElement).value;\n this.textValue = newValue;\n this.value = newValue;\n\n this.valueChanged.emit(newValue);\n };\n\n handleFocus = () => {\n if (this.disabled) return;\n this.toggleOptions(true);\n this.inputElement.focus();\n };\n\n handleBlur = () => {\n this.toggleOptions(false);\n\n this.focusedOut.emit();\n this.inputIsFocused = false;\n };\n\n handleInputFocus = () => {\n this.focusedOn.emit();\n this.inputIsFocused = true;\n };\n\n handleIconClick = (event: MouseEvent) => {\n if (this.type === SulaTextfieldType.Password) {\n event.stopPropagation();\n this.handlePasswordIconClicked();\n }\n };\n\n handleInputMask() {\n VMasker(this.inputElement).maskPattern(this.maskPattern);\n }\n\n handlePasswordIconClicked() {\n const cursorPosition = this.inputElement.selectionStart;\n const inputValue = this.inputElement.value;\n const inputType = this.showPassword ? SulaTextfieldType.Password : SulaTextfieldType.Text;\n\n this.inputElement.setAttribute('type', inputType);\n this.showPassword = !this.showPassword;\n\n setTimeout(() => {\n this.inputElement.value = inputValue;\n\n this.inputElement.setSelectionRange(cursorPosition, cursorPosition);\n }, 0);\n }\n\n getInputIcon() {\n if (this.type === SulaTextfieldType.Password) {\n return this.showPassword ? 'ph ph-eye' : 'ph ph-eye-slash';\n }\n\n return this.icon;\n }\n\n render() {\n return (\n <Host ref={node => (this.node = node)}>\n <div>\n <div\n id=\"button-container\"\n class={{\n 'flex items-center border rounded-sm px-16 outline-none h-[72px] caret-brand-primary': true,\n 'flex-row justify-between': !!this.icon || this.type === SulaTextfieldType.Password,\n 'button-focus': this.inputIsFocused && !this.disabled && this.status === SulaTextfieldStatus.Default,\n 'button-error': this.status === SulaTextfieldStatus.Error && !this.disabled,\n 'bg-states-bg-disabled border-line-general cursor-not-allowed': this.disabled,\n 'bg-surface-body border-line-input cursor-pointer': !this.disabled,\n }}\n tabIndex={0}\n onFocus={this.handleFocus}\n onClick={this.handleInputClick}\n >\n {!this.disabled && (\n <div class={{ 'hidden flex-col w-full': true, 'pr-12': !!this.icon }} ref={node => (this.inputContainer = node)}>\n <label class=\"font-bold text-sm text-text-primary from-down\">{this.label}</label>\n <input\n type={this.type}\n ref={node => (this.inputElement = node)}\n placeholder={this.placeholder}\n class=\"outline-none text-base text-text-primary bg-transparent\"\n onInput={this.handleInputChanges}\n onFocus={this.handleInputFocus}\n value={this.textValue}\n />\n </div>\n )}\n\n <div\n id=\"textfield-label\"\n class={{ 'text-base flex items-center': true, 'text-text-primary': !this.disabled, 'text-text-disabled': this.disabled }}\n ref={node => (this.labelElement = node)}\n >\n {this.label}\n </div>\n\n {(!!this.icon || this.type === SulaTextfieldType.Password) && (\n <div class=\"flex items-center justify-center\" onClick={this.handleIconClick}>\n <sula-icon icon={this.getInputIcon()} customClass={`text-2xl ${this.disabled ? 'text-icon-disabled' : 'text-icon-primary'}`} />\n </div>\n )}\n </div>\n\n {(this.helpText || this.maxLength) && !this.disabled && (\n <div class=\"flex justify-between items-center px-16 mt-4 text-sm\">\n {this.helpText && (\n <div\n id=\"textfield-help-text\"\n class={{ 'text-text-primary': this.status === SulaTextfieldStatus.Default, 'text-feedback-error': this.status === SulaTextfieldStatus.Error }}\n >\n {this.helpText}\n </div>\n )}\n {this.maxLength && (\n <div\n id=\"max-length-container\"\n class={{ 'text-text-primary': this.status === SulaTextfieldStatus.Default, 'text-feedback-error': this.status === SulaTextfieldStatus.Error }}\n >\n {this.textValue ? this.textValue.length : 0}/{this.maxLength}\n </div>\n )}\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index.js';
|
|
2
|
-
import { d as defineCustomElement$2 } from './p-
|
|
2
|
+
import { d as defineCustomElement$2 } from './p-ff6chV3i.js';
|
|
3
3
|
|
|
4
4
|
var SulaTilesType;
|
|
5
5
|
(function (SulaTilesType) {
|
|
@@ -139,7 +139,7 @@ const SulaTiles$1 = /*@__PURE__*/ proxyCustomElement(class SulaTiles extends H {
|
|
|
139
139
|
return (h("div", { class: this.getTextContainerClasses() }, h("span", { class: this.getTextClasses(true), title: this.ellipsis ? this.text : undefined }, this.text), this.hasSubText && (h("span", { class: this.getTextClasses(false), title: this.ellipsis ? this.subText : undefined }, this.subText))));
|
|
140
140
|
}
|
|
141
141
|
render() {
|
|
142
|
-
return (h(Host, { key: '
|
|
142
|
+
return (h(Host, { key: '32ee3b19743f75052428014a010545e4a6c9098b' }, h("div", { key: '09384829c191d1ec6518e0ccbc3ac4c290e1e798', class: this.getContainerClasses(), tabIndex: this.getTabIndex(this.isSquare), onClick: this.handleClick }, this.renderIcon(), this.renderText())));
|
|
143
143
|
}
|
|
144
144
|
static get style() { return sulaTilesCss; }
|
|
145
145
|
}, [1, "sula-tiles", {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index.js';
|
|
2
|
-
import { d as defineCustomElement$2 } from './p-
|
|
2
|
+
import { d as defineCustomElement$2 } from './p-ff6chV3i.js';
|
|
3
3
|
|
|
4
4
|
var SulaTimelineListItemIconStatus;
|
|
5
5
|
(function (SulaTimelineListItemIconStatus) {
|
|
@@ -51,7 +51,7 @@ const SulaTimelineList$1 = /*@__PURE__*/ proxyCustomElement(class SulaTimelineLi
|
|
|
51
51
|
return iconByStatus[status];
|
|
52
52
|
}
|
|
53
53
|
render() {
|
|
54
|
-
return (h(Host, { key: '
|
|
54
|
+
return (h(Host, { key: '61a3d229e04aa2935ef1d03fca3aa519aa21d13b' }, h("div", { key: 'cd8c1483e94ea8f8cf2e0c51e400528f83fcf9f5', class: "flex flex-col bg-surface-on-body px-24 py-32 w-fit rounded-md" }, this.sulaTimelineList.map((item, index) => {
|
|
55
55
|
const isLastItem = index === this.sulaTimelineList.length - 1;
|
|
56
56
|
return (h("div", { class: {
|
|
57
57
|
'relative timeline-item': true,
|
|
@@ -784,10 +784,17 @@ var insertBefore = (parent, newNode, reference) => {
|
|
|
784
784
|
};
|
|
785
785
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
786
786
|
const hostElm = hostRef.$hostElement$;
|
|
787
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
787
788
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
788
789
|
const isHostElement = isHost(renderFnResults);
|
|
789
790
|
const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
|
|
790
791
|
hostTagName = hostElm.tagName;
|
|
792
|
+
if (cmpMeta.$attrsToReflect$) {
|
|
793
|
+
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
794
|
+
cmpMeta.$attrsToReflect$.map(
|
|
795
|
+
([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]
|
|
796
|
+
);
|
|
797
|
+
}
|
|
791
798
|
if (isInitialLoad && rootVnode.$attrs$) {
|
|
792
799
|
for (const key of Object.keys(rootVnode.$attrs$)) {
|
|
793
800
|
if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
|
|
@@ -1143,8 +1150,12 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1143
1150
|
/* @__PURE__ */ new Set([
|
|
1144
1151
|
...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
|
|
1145
1152
|
...members.filter(([_, m]) => m[0] & 15 /* HasAttribute */).map(([propName, m]) => {
|
|
1153
|
+
var _a2;
|
|
1146
1154
|
const attrName = m[1] || propName;
|
|
1147
1155
|
attrNameToPropName.set(attrName, propName);
|
|
1156
|
+
if (m[0] & 512 /* ReflectAttr */) {
|
|
1157
|
+
(_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
|
|
1158
|
+
}
|
|
1148
1159
|
return attrName;
|
|
1149
1160
|
})
|
|
1150
1161
|
])
|
|
@@ -1334,6 +1345,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1334
1345
|
{
|
|
1335
1346
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
1336
1347
|
}
|
|
1348
|
+
{
|
|
1349
|
+
cmpMeta.$attrsToReflect$ = [];
|
|
1350
|
+
}
|
|
1337
1351
|
{
|
|
1338
1352
|
cmpMeta.$watchers$ = (_a2 = compactMeta[4]) != null ? _a2 : {};
|
|
1339
1353
|
}
|
|
@@ -1469,6 +1483,6 @@ var hostListenerOpts = (flags) => supportsListenerOptions ? {
|
|
|
1469
1483
|
var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
1470
1484
|
|
|
1471
1485
|
export { Host as H, getElement as a, bootstrapLazy as b, createEvent as c, globalScripts as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
|
1472
|
-
//# sourceMappingURL=index-
|
|
1486
|
+
//# sourceMappingURL=index-CrFclBiX.js.map
|
|
1473
1487
|
|
|
1474
|
-
//# sourceMappingURL=index-
|
|
1488
|
+
//# sourceMappingURL=index-CrFclBiX.js.map
|