@dropi/ui 0.1.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/LICENSE +21 -0
- package/dist/cjs/dropi-badge.cjs.entry.js +37 -0
- package/dist/cjs/dropi-button.cjs.entry.js +81 -0
- package/dist/cjs/dropi-checkbox.cjs.entry.js +36 -0
- package/dist/cjs/dropi-icon.cjs.entry.js +50 -0
- package/dist/cjs/dropi-input.cjs.entry.js +210 -0
- package/dist/cjs/dropi-radio-button.cjs.entry.js +47 -0
- package/dist/cjs/dropi-select.cjs.entry.js +335 -0
- package/dist/cjs/dropi-switch.cjs.entry.js +30 -0
- package/dist/cjs/dropi-tag.cjs.entry.js +68 -0
- package/dist/cjs/dropi-text-area.cjs.entry.js +103 -0
- package/dist/cjs/dropi-ui.cjs.js +24 -0
- package/dist/cjs/index-CuGLZVqo.js +1743 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +12 -0
- package/dist/collection/assets/icons/symbol/svg/sprite.css.svg +1 -0
- package/dist/collection/collection-manifest.json +22 -0
- package/dist/collection/components/dropi-badge/dropi-badge.css +41 -0
- package/dist/collection/components/dropi-badge/dropi-badge.js +72 -0
- package/dist/collection/components/dropi-button/dropi-button.css +169 -0
- package/dist/collection/components/dropi-button/dropi-button.js +277 -0
- package/dist/collection/components/dropi-checkbox/dropi-checkbox.css +47 -0
- package/dist/collection/components/dropi-checkbox/dropi-checkbox.js +103 -0
- package/dist/collection/components/dropi-icon/dropi-icon.css +19 -0
- package/dist/collection/components/dropi-icon/dropi-icon.js +142 -0
- package/dist/collection/components/dropi-input/dropi-input.css +168 -0
- package/dist/collection/components/dropi-input/dropi-input.js +735 -0
- package/dist/collection/components/dropi-radio-button/dropi-radio-button.css +59 -0
- package/dist/collection/components/dropi-radio-button/dropi-radio-button.js +181 -0
- package/dist/collection/components/dropi-select/dropi-select.css +364 -0
- package/dist/collection/components/dropi-select/dropi-select.js +932 -0
- package/dist/collection/components/dropi-select/select.types.js +1 -0
- package/dist/collection/components/dropi-switch/dropi-switch.css +57 -0
- package/dist/collection/components/dropi-switch/dropi-switch.js +96 -0
- package/dist/collection/components/dropi-tag/dropi-tag.css +40 -0
- package/dist/collection/components/dropi-tag/dropi-tag.js +190 -0
- package/dist/collection/components/dropi-text-area/dropi-text-area.css +97 -0
- package/dist/collection/components/dropi-text-area/dropi-text-area.js +457 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/utils.js +3 -0
- package/dist/collection/utils/utils.unit.test.js +16 -0
- package/dist/components/dropi-badge.d.ts +11 -0
- package/dist/components/dropi-badge.js +1 -0
- package/dist/components/dropi-button.d.ts +11 -0
- package/dist/components/dropi-button.js +1 -0
- package/dist/components/dropi-checkbox.d.ts +11 -0
- package/dist/components/dropi-checkbox.js +1 -0
- package/dist/components/dropi-icon.d.ts +11 -0
- package/dist/components/dropi-icon.js +1 -0
- package/dist/components/dropi-input.d.ts +11 -0
- package/dist/components/dropi-input.js +1 -0
- package/dist/components/dropi-radio-button.d.ts +11 -0
- package/dist/components/dropi-radio-button.js +1 -0
- package/dist/components/dropi-select.d.ts +11 -0
- package/dist/components/dropi-select.js +1 -0
- package/dist/components/dropi-switch.d.ts +11 -0
- package/dist/components/dropi-switch.js +1 -0
- package/dist/components/dropi-tag.d.ts +11 -0
- package/dist/components/dropi-tag.js +1 -0
- package/dist/components/dropi-text-area.d.ts +11 -0
- package/dist/components/dropi-text-area.js +1 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +1 -0
- package/dist/components/p-MNma8N1x.js +1 -0
- package/dist/dropi-ui/dropi-ui.css +1 -0
- package/dist/dropi-ui/dropi-ui.esm.js +1 -0
- package/dist/dropi-ui/index.esm.js +0 -0
- package/dist/dropi-ui/p-1a28b8f5.entry.js +1 -0
- package/dist/dropi-ui/p-21abf91a.entry.js +1 -0
- package/dist/dropi-ui/p-52291024.entry.js +1 -0
- package/dist/dropi-ui/p-54502c46.entry.js +1 -0
- package/dist/dropi-ui/p-6f0aa619.entry.js +1 -0
- package/dist/dropi-ui/p-9c7076d3.entry.js +1 -0
- package/dist/dropi-ui/p-DFz-gwFP.js +2 -0
- package/dist/dropi-ui/p-a1944f3d.entry.js +1 -0
- package/dist/dropi-ui/p-c7b9cbda.entry.js +1 -0
- package/dist/dropi-ui/p-dd089a60.entry.js +1 -0
- package/dist/dropi-ui/p-f785011f.entry.js +1 -0
- package/dist/esm/dropi-badge.entry.js +35 -0
- package/dist/esm/dropi-button.entry.js +79 -0
- package/dist/esm/dropi-checkbox.entry.js +34 -0
- package/dist/esm/dropi-icon.entry.js +48 -0
- package/dist/esm/dropi-input.entry.js +208 -0
- package/dist/esm/dropi-radio-button.entry.js +45 -0
- package/dist/esm/dropi-select.entry.js +333 -0
- package/dist/esm/dropi-switch.entry.js +28 -0
- package/dist/esm/dropi-tag.entry.js +66 -0
- package/dist/esm/dropi-text-area.entry.js +101 -0
- package/dist/esm/dropi-ui.js +20 -0
- package/dist/esm/index-DFz-gwFP.js +1734 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +10 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/components/dropi-badge/dropi-badge.d.ts +12 -0
- package/dist/types/components/dropi-button/dropi-button.d.ts +35 -0
- package/dist/types/components/dropi-checkbox/dropi-checkbox.d.ts +16 -0
- package/dist/types/components/dropi-icon/dropi-icon.d.ts +25 -0
- package/dist/types/components/dropi-input/dropi-input.d.ts +92 -0
- package/dist/types/components/dropi-radio-button/dropi-radio-button.d.ts +25 -0
- package/dist/types/components/dropi-select/dropi-select.d.ts +103 -0
- package/dist/types/components/dropi-select/select.types.d.ts +23 -0
- package/dist/types/components/dropi-switch/dropi-switch.d.ts +15 -0
- package/dist/types/components/dropi-tag/dropi-tag.d.ts +25 -0
- package/dist/types/components/dropi-text-area/dropi-text-area.d.ts +53 -0
- package/dist/types/components.d.ts +1549 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/stencil-public-runtime.d.ts +1860 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/dist/types/utils/utils.unit.test.d.ts +1 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +50 -0
- package/readme.md +89 -0
|
@@ -0,0 +1,735 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* @component dropi-input
|
|
4
|
+
* Text input with floating label, validation states, password toggle,
|
|
5
|
+
* number/letter restrictions, thousand separator, and native form association.
|
|
6
|
+
*
|
|
7
|
+
* ## Form usage (native HTML form)
|
|
8
|
+
* ```html
|
|
9
|
+
* <form>
|
|
10
|
+
* <dropi-input name="email" label="Email" required></dropi-input>
|
|
11
|
+
* </form>
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* ## Controlled usage (React / Vue / Angular)
|
|
15
|
+
* Pass `value` and listen to `dropiInput` to update.
|
|
16
|
+
*/
|
|
17
|
+
export class DropiInput {
|
|
18
|
+
internals;
|
|
19
|
+
// ── Identification ──────────────────────────────────────────
|
|
20
|
+
/** Input id. Defaults to label value. */
|
|
21
|
+
inputId = '';
|
|
22
|
+
/** Name attribute for native form submission */
|
|
23
|
+
name = '';
|
|
24
|
+
// ── Content ─────────────────────────────────────────────────
|
|
25
|
+
/** Floating or fixed label text */
|
|
26
|
+
label = '';
|
|
27
|
+
/** Placeholder text (visible in fixedLabel mode or on focus) */
|
|
28
|
+
placeholder = ' ';
|
|
29
|
+
/** Current value (controlled) */
|
|
30
|
+
value = '';
|
|
31
|
+
/** Max character length */
|
|
32
|
+
maxlength;
|
|
33
|
+
// ── Behavior ────────────────────────────────────────────────
|
|
34
|
+
/** Disable the input */
|
|
35
|
+
disabled = false;
|
|
36
|
+
/** Mark as required (shows asterisk when showAsterisk is true) */
|
|
37
|
+
required = false;
|
|
38
|
+
/** Show the required asterisk on the label */
|
|
39
|
+
showAsterisk = true;
|
|
40
|
+
/** Show label above the input (fixed), instead of floating inside */
|
|
41
|
+
fixedLabel = false;
|
|
42
|
+
/** Keyboard input mode hint */
|
|
43
|
+
inputMode = 'text';
|
|
44
|
+
// ── Input type modifiers ────────────────────────────────────
|
|
45
|
+
/** Show password visibility toggle (renders as password field) */
|
|
46
|
+
passwordInput = false;
|
|
47
|
+
/** Apply thousand separator formatting (e.g. 1,000,000) */
|
|
48
|
+
moneyFormat = false;
|
|
49
|
+
/** Apply thousand separator without currency symbol */
|
|
50
|
+
thousandSeparator = false;
|
|
51
|
+
/** Only allow numeric characters */
|
|
52
|
+
onlyNumbers = false;
|
|
53
|
+
/** Allow decimal point when onlyNumbers is true */
|
|
54
|
+
allowDecimals = false;
|
|
55
|
+
/** Only allow letter characters */
|
|
56
|
+
onlyLetters = false;
|
|
57
|
+
// ── Icon ────────────────────────────────────────────────────
|
|
58
|
+
/** Icon name shown inside the input (only visible when value is not empty) */
|
|
59
|
+
icon = '';
|
|
60
|
+
/** Color token for the icon */
|
|
61
|
+
iconColor = 'Gray-Gray-400';
|
|
62
|
+
// ── Validation ──────────────────────────────────────────────
|
|
63
|
+
/** Mark the field as invalid (consumer-controlled) */
|
|
64
|
+
invalid = false;
|
|
65
|
+
/** Helper / error text shown below the field */
|
|
66
|
+
helperText = '';
|
|
67
|
+
/** Only show helperText when the field is invalid */
|
|
68
|
+
showHelperOnlyOnError = false;
|
|
69
|
+
// ── Internal state ──────────────────────────────────────────
|
|
70
|
+
showPassword = false;
|
|
71
|
+
touched = false;
|
|
72
|
+
// ── Events ──────────────────────────────────────────────────
|
|
73
|
+
/** Emitted on every keystroke with the current value */
|
|
74
|
+
dropiInput;
|
|
75
|
+
/** Emitted on blur with the final value */
|
|
76
|
+
dropiChange;
|
|
77
|
+
/** Emitted on focus */
|
|
78
|
+
dropiFocus;
|
|
79
|
+
/** Emitted on blur */
|
|
80
|
+
dropiBlur;
|
|
81
|
+
valueChanged(val) {
|
|
82
|
+
this.internals.setFormValue(val);
|
|
83
|
+
}
|
|
84
|
+
disabledChanged(val) {
|
|
85
|
+
this.internals.setValidity(val ? { customError: true } : {}, val ? 'Field is disabled' : '');
|
|
86
|
+
}
|
|
87
|
+
componentWillLoad() {
|
|
88
|
+
this.internals.setFormValue(this.value ?? '');
|
|
89
|
+
}
|
|
90
|
+
// ── Handlers ────────────────────────────────────────────────
|
|
91
|
+
handleInput(e) {
|
|
92
|
+
let val = e.target.value;
|
|
93
|
+
if (this.onlyNumbers)
|
|
94
|
+
val = this.filterNumbers(val);
|
|
95
|
+
if (this.onlyLetters)
|
|
96
|
+
val = this.filterLetters(val);
|
|
97
|
+
if (this.moneyFormat || this.thousandSeparator)
|
|
98
|
+
val = this.formatThousands(val, this.moneyFormat);
|
|
99
|
+
this.value = val;
|
|
100
|
+
this.internals.setFormValue(val);
|
|
101
|
+
this.dropiInput.emit(val);
|
|
102
|
+
}
|
|
103
|
+
handleKeyDown(e) {
|
|
104
|
+
if (this.onlyNumbers && !this.isAllowedNumberKey(e)) {
|
|
105
|
+
e.preventDefault();
|
|
106
|
+
}
|
|
107
|
+
if (this.onlyLetters && !this.isAllowedLetterKey(e)) {
|
|
108
|
+
e.preventDefault();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
handleFocus() {
|
|
112
|
+
this.dropiFocus.emit();
|
|
113
|
+
}
|
|
114
|
+
handleBlur() {
|
|
115
|
+
this.touched = true;
|
|
116
|
+
this.dropiChange.emit(this.value);
|
|
117
|
+
this.dropiBlur.emit();
|
|
118
|
+
}
|
|
119
|
+
togglePassword() {
|
|
120
|
+
if (this.disabled)
|
|
121
|
+
return;
|
|
122
|
+
this.showPassword = !this.showPassword;
|
|
123
|
+
}
|
|
124
|
+
// ── Helpers ─────────────────────────────────────────────────
|
|
125
|
+
filterNumbers(val) {
|
|
126
|
+
const pattern = this.allowDecimals ? /[^0-9.]/g : /[^0-9]/g;
|
|
127
|
+
return val.replace(pattern, '');
|
|
128
|
+
}
|
|
129
|
+
filterLetters(val) {
|
|
130
|
+
return val.replace(/[^a-zA-ZáéíóúÁÉÍÓÚñÑüÜ\s]/g, '');
|
|
131
|
+
}
|
|
132
|
+
isAllowedNumberKey(e) {
|
|
133
|
+
const allowed = ['Backspace', 'Delete', 'ArrowLeft', 'ArrowRight', 'Tab', 'Enter', 'Home', 'End'];
|
|
134
|
+
if (allowed.includes(e.key))
|
|
135
|
+
return true;
|
|
136
|
+
if (e.ctrlKey || e.metaKey)
|
|
137
|
+
return true; // copy/paste/select-all
|
|
138
|
+
if (/^[0-9]$/.test(e.key))
|
|
139
|
+
return true;
|
|
140
|
+
if (this.allowDecimals && e.key === '.')
|
|
141
|
+
return true;
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
isAllowedLetterKey(e) {
|
|
145
|
+
const allowed = ['Backspace', 'Delete', 'ArrowLeft', 'ArrowRight', 'Tab', 'Enter', 'Home', 'End', ' '];
|
|
146
|
+
if (allowed.includes(e.key))
|
|
147
|
+
return true;
|
|
148
|
+
if (e.ctrlKey || e.metaKey)
|
|
149
|
+
return true;
|
|
150
|
+
return /^[a-zA-ZáéíóúÁÉÍÓÚñÑüÜ]$/.test(e.key);
|
|
151
|
+
}
|
|
152
|
+
formatThousands(val, withCurrency) {
|
|
153
|
+
const raw = val.replace(/[^0-9.]/g, '');
|
|
154
|
+
const [integer, decimal] = raw.split('.');
|
|
155
|
+
const formatted = integer.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
156
|
+
const result = decimal !== undefined ? `${formatted}.${decimal}` : formatted;
|
|
157
|
+
return withCurrency ? `$${result}` : result;
|
|
158
|
+
}
|
|
159
|
+
// ── Computed ─────────────────────────────────────────────────
|
|
160
|
+
get resolvedId() {
|
|
161
|
+
return this.inputId || this.label;
|
|
162
|
+
}
|
|
163
|
+
get inputType() {
|
|
164
|
+
if (this.passwordInput)
|
|
165
|
+
return this.showPassword ? 'text' : 'password';
|
|
166
|
+
return 'text';
|
|
167
|
+
}
|
|
168
|
+
get showHelper() {
|
|
169
|
+
if (!this.helperText)
|
|
170
|
+
return false;
|
|
171
|
+
if (this.showHelperOnlyOnError)
|
|
172
|
+
return this.invalid && this.touched;
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
get isInvalid() {
|
|
176
|
+
return this.invalid && this.touched;
|
|
177
|
+
}
|
|
178
|
+
// ── Render ───────────────────────────────────────────────────
|
|
179
|
+
render() {
|
|
180
|
+
const showAsterisk = this.required && this.showAsterisk && !this.disabled;
|
|
181
|
+
const showIconInline = !!this.icon && !!this.value;
|
|
182
|
+
return (h("div", { key: '4ea9c2118e6452345a2a92eedc807e6d94019784', class: { 'fixed-label-container': this.fixedLabel } }, this.fixedLabel && (h("div", { key: 'b8c1269e9d583becd9614f6f3c28f6a2b536f18f', class: "input-label Body-S-Regular" }, this.label, showAsterisk && h("span", { key: '945665772caab1a1c95f1a054dea1b8dd88287a3', class: "asterisk" }, " *"))), h("div", { key: 'f550584dde83c907429255d9a98b8a59ff322cbb', class: "form-group" }, h("div", { key: '6cc46f5822e62d59bb211e7d9eb7909ab2b833c9', class: "input-container" }, showIconInline && (h("dropi-icon", { key: 'c860e808ae7cd805aa9c430d52743f7eab0aaeba', class: "icon-input", name: this.icon, color: this.iconColor, width: "20px", height: "20px" })), this.passwordInput && (h("dropi-icon", { key: 'ba571d4d14ec2a911a8b0bd4cdc7a8481aebe746', class: "icon-input-password", name: this.showPassword ? 'Eye' : 'Eye-crossed', width: "20px", height: "20px", color: "Gray-Gray-500", onClick: () => this.togglePassword() })), h("input", { key: 'aad18a94d94c9600236bac7c23e38b1c1c41f06a', id: this.resolvedId, class: {
|
|
183
|
+
'form-control': true,
|
|
184
|
+
'form-control-valid': !this.isInvalid && this.touched && !!this.value,
|
|
185
|
+
'form-control-invalid': this.isInvalid,
|
|
186
|
+
'padding-icon': showIconInline,
|
|
187
|
+
'text-password': this.passwordInput && !this.showPassword,
|
|
188
|
+
'fixed-label-input': this.fixedLabel,
|
|
189
|
+
}, type: this.inputType, value: this.value, placeholder: this.fixedLabel ? this.placeholder : ' ', disabled: this.disabled, required: this.required, maxLength: this.maxlength, inputMode: this.inputMode, "data-cy": undefined, onInput: (e) => this.handleInput(e), onKeyDown: (e) => this.handleKeyDown(e), onFocus: () => this.handleFocus(), onBlur: () => this.handleBlur() }), !this.fixedLabel && (h("label", { key: '8ba7ea50525aa8990662d45829ba732094c41f80', class: "Body-S-Regular label-bottom", htmlFor: this.resolvedId }, this.label, showAsterisk && h("span", { key: '3916d3de6392da62b8086920cd2fce3b96238416', class: "asterisk" }, " *"))), this.showHelper && (h("div", { key: '83e17f7d0cdb503b86fd035775e1cb45d9f41709', class: "form-control-helper" }, this.isInvalid && (h("dropi-icon", { key: '4e034348270853f8a3aafbbbb938a5974076aebd', name: "Warning-circle", width: "12px", height: "12px", color: "Error-Error-500" })), h("span", { key: '7832f200ccc6f6273d65012b9e642c313399a277', class: {
|
|
190
|
+
'disabled-helper': this.disabled,
|
|
191
|
+
'invalid-color': this.isInvalid,
|
|
192
|
+
} }, this.helperText)))))));
|
|
193
|
+
}
|
|
194
|
+
static get is() { return "dropi-input"; }
|
|
195
|
+
static get encapsulation() { return "shadow"; }
|
|
196
|
+
static get formAssociated() { return true; }
|
|
197
|
+
static get originalStyleUrls() {
|
|
198
|
+
return {
|
|
199
|
+
"$": ["dropi-input.css"]
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
static get styleUrls() {
|
|
203
|
+
return {
|
|
204
|
+
"$": ["dropi-input.css"]
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
static get properties() {
|
|
208
|
+
return {
|
|
209
|
+
"inputId": {
|
|
210
|
+
"type": "string",
|
|
211
|
+
"mutable": false,
|
|
212
|
+
"complexType": {
|
|
213
|
+
"original": "string",
|
|
214
|
+
"resolved": "string",
|
|
215
|
+
"references": {}
|
|
216
|
+
},
|
|
217
|
+
"required": false,
|
|
218
|
+
"optional": false,
|
|
219
|
+
"docs": {
|
|
220
|
+
"tags": [],
|
|
221
|
+
"text": "Input id. Defaults to label value."
|
|
222
|
+
},
|
|
223
|
+
"getter": false,
|
|
224
|
+
"setter": false,
|
|
225
|
+
"reflect": false,
|
|
226
|
+
"attribute": "input-id",
|
|
227
|
+
"defaultValue": "''"
|
|
228
|
+
},
|
|
229
|
+
"name": {
|
|
230
|
+
"type": "string",
|
|
231
|
+
"mutable": false,
|
|
232
|
+
"complexType": {
|
|
233
|
+
"original": "string",
|
|
234
|
+
"resolved": "string",
|
|
235
|
+
"references": {}
|
|
236
|
+
},
|
|
237
|
+
"required": false,
|
|
238
|
+
"optional": false,
|
|
239
|
+
"docs": {
|
|
240
|
+
"tags": [],
|
|
241
|
+
"text": "Name attribute for native form submission"
|
|
242
|
+
},
|
|
243
|
+
"getter": false,
|
|
244
|
+
"setter": false,
|
|
245
|
+
"reflect": false,
|
|
246
|
+
"attribute": "name",
|
|
247
|
+
"defaultValue": "''"
|
|
248
|
+
},
|
|
249
|
+
"label": {
|
|
250
|
+
"type": "string",
|
|
251
|
+
"mutable": false,
|
|
252
|
+
"complexType": {
|
|
253
|
+
"original": "string",
|
|
254
|
+
"resolved": "string",
|
|
255
|
+
"references": {}
|
|
256
|
+
},
|
|
257
|
+
"required": false,
|
|
258
|
+
"optional": false,
|
|
259
|
+
"docs": {
|
|
260
|
+
"tags": [],
|
|
261
|
+
"text": "Floating or fixed label text"
|
|
262
|
+
},
|
|
263
|
+
"getter": false,
|
|
264
|
+
"setter": false,
|
|
265
|
+
"reflect": false,
|
|
266
|
+
"attribute": "label",
|
|
267
|
+
"defaultValue": "''"
|
|
268
|
+
},
|
|
269
|
+
"placeholder": {
|
|
270
|
+
"type": "string",
|
|
271
|
+
"mutable": false,
|
|
272
|
+
"complexType": {
|
|
273
|
+
"original": "string",
|
|
274
|
+
"resolved": "string",
|
|
275
|
+
"references": {}
|
|
276
|
+
},
|
|
277
|
+
"required": false,
|
|
278
|
+
"optional": false,
|
|
279
|
+
"docs": {
|
|
280
|
+
"tags": [],
|
|
281
|
+
"text": "Placeholder text (visible in fixedLabel mode or on focus)"
|
|
282
|
+
},
|
|
283
|
+
"getter": false,
|
|
284
|
+
"setter": false,
|
|
285
|
+
"reflect": false,
|
|
286
|
+
"attribute": "placeholder",
|
|
287
|
+
"defaultValue": "' '"
|
|
288
|
+
},
|
|
289
|
+
"value": {
|
|
290
|
+
"type": "string",
|
|
291
|
+
"mutable": true,
|
|
292
|
+
"complexType": {
|
|
293
|
+
"original": "string",
|
|
294
|
+
"resolved": "string",
|
|
295
|
+
"references": {}
|
|
296
|
+
},
|
|
297
|
+
"required": false,
|
|
298
|
+
"optional": false,
|
|
299
|
+
"docs": {
|
|
300
|
+
"tags": [],
|
|
301
|
+
"text": "Current value (controlled)"
|
|
302
|
+
},
|
|
303
|
+
"getter": false,
|
|
304
|
+
"setter": false,
|
|
305
|
+
"reflect": false,
|
|
306
|
+
"attribute": "value",
|
|
307
|
+
"defaultValue": "''"
|
|
308
|
+
},
|
|
309
|
+
"maxlength": {
|
|
310
|
+
"type": "number",
|
|
311
|
+
"mutable": false,
|
|
312
|
+
"complexType": {
|
|
313
|
+
"original": "number",
|
|
314
|
+
"resolved": "number",
|
|
315
|
+
"references": {}
|
|
316
|
+
},
|
|
317
|
+
"required": false,
|
|
318
|
+
"optional": false,
|
|
319
|
+
"docs": {
|
|
320
|
+
"tags": [],
|
|
321
|
+
"text": "Max character length"
|
|
322
|
+
},
|
|
323
|
+
"getter": false,
|
|
324
|
+
"setter": false,
|
|
325
|
+
"reflect": false,
|
|
326
|
+
"attribute": "maxlength"
|
|
327
|
+
},
|
|
328
|
+
"disabled": {
|
|
329
|
+
"type": "boolean",
|
|
330
|
+
"mutable": false,
|
|
331
|
+
"complexType": {
|
|
332
|
+
"original": "boolean",
|
|
333
|
+
"resolved": "boolean",
|
|
334
|
+
"references": {}
|
|
335
|
+
},
|
|
336
|
+
"required": false,
|
|
337
|
+
"optional": false,
|
|
338
|
+
"docs": {
|
|
339
|
+
"tags": [],
|
|
340
|
+
"text": "Disable the input"
|
|
341
|
+
},
|
|
342
|
+
"getter": false,
|
|
343
|
+
"setter": false,
|
|
344
|
+
"reflect": true,
|
|
345
|
+
"attribute": "disabled",
|
|
346
|
+
"defaultValue": "false"
|
|
347
|
+
},
|
|
348
|
+
"required": {
|
|
349
|
+
"type": "boolean",
|
|
350
|
+
"mutable": false,
|
|
351
|
+
"complexType": {
|
|
352
|
+
"original": "boolean",
|
|
353
|
+
"resolved": "boolean",
|
|
354
|
+
"references": {}
|
|
355
|
+
},
|
|
356
|
+
"required": false,
|
|
357
|
+
"optional": false,
|
|
358
|
+
"docs": {
|
|
359
|
+
"tags": [],
|
|
360
|
+
"text": "Mark as required (shows asterisk when showAsterisk is true)"
|
|
361
|
+
},
|
|
362
|
+
"getter": false,
|
|
363
|
+
"setter": false,
|
|
364
|
+
"reflect": true,
|
|
365
|
+
"attribute": "required",
|
|
366
|
+
"defaultValue": "false"
|
|
367
|
+
},
|
|
368
|
+
"showAsterisk": {
|
|
369
|
+
"type": "boolean",
|
|
370
|
+
"mutable": false,
|
|
371
|
+
"complexType": {
|
|
372
|
+
"original": "boolean",
|
|
373
|
+
"resolved": "boolean",
|
|
374
|
+
"references": {}
|
|
375
|
+
},
|
|
376
|
+
"required": false,
|
|
377
|
+
"optional": false,
|
|
378
|
+
"docs": {
|
|
379
|
+
"tags": [],
|
|
380
|
+
"text": "Show the required asterisk on the label"
|
|
381
|
+
},
|
|
382
|
+
"getter": false,
|
|
383
|
+
"setter": false,
|
|
384
|
+
"reflect": false,
|
|
385
|
+
"attribute": "show-asterisk",
|
|
386
|
+
"defaultValue": "true"
|
|
387
|
+
},
|
|
388
|
+
"fixedLabel": {
|
|
389
|
+
"type": "boolean",
|
|
390
|
+
"mutable": false,
|
|
391
|
+
"complexType": {
|
|
392
|
+
"original": "boolean",
|
|
393
|
+
"resolved": "boolean",
|
|
394
|
+
"references": {}
|
|
395
|
+
},
|
|
396
|
+
"required": false,
|
|
397
|
+
"optional": false,
|
|
398
|
+
"docs": {
|
|
399
|
+
"tags": [],
|
|
400
|
+
"text": "Show label above the input (fixed), instead of floating inside"
|
|
401
|
+
},
|
|
402
|
+
"getter": false,
|
|
403
|
+
"setter": false,
|
|
404
|
+
"reflect": false,
|
|
405
|
+
"attribute": "fixed-label",
|
|
406
|
+
"defaultValue": "false"
|
|
407
|
+
},
|
|
408
|
+
"inputMode": {
|
|
409
|
+
"type": "string",
|
|
410
|
+
"mutable": false,
|
|
411
|
+
"complexType": {
|
|
412
|
+
"original": "InputMode",
|
|
413
|
+
"resolved": "\"decimal\" | \"email\" | \"numeric\" | \"search\" | \"tel\" | \"text\" | \"url\"",
|
|
414
|
+
"references": {
|
|
415
|
+
"InputMode": {
|
|
416
|
+
"location": "local",
|
|
417
|
+
"path": "/Users/mac-ti/Documents/dropi/dropi-ui/src/components/dropi-input/dropi-input.tsx",
|
|
418
|
+
"id": "src/components/dropi-input/dropi-input.tsx::InputMode"
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
"required": false,
|
|
423
|
+
"optional": false,
|
|
424
|
+
"docs": {
|
|
425
|
+
"tags": [],
|
|
426
|
+
"text": "Keyboard input mode hint"
|
|
427
|
+
},
|
|
428
|
+
"getter": false,
|
|
429
|
+
"setter": false,
|
|
430
|
+
"reflect": false,
|
|
431
|
+
"attribute": "input-mode",
|
|
432
|
+
"defaultValue": "'text'"
|
|
433
|
+
},
|
|
434
|
+
"passwordInput": {
|
|
435
|
+
"type": "boolean",
|
|
436
|
+
"mutable": false,
|
|
437
|
+
"complexType": {
|
|
438
|
+
"original": "boolean",
|
|
439
|
+
"resolved": "boolean",
|
|
440
|
+
"references": {}
|
|
441
|
+
},
|
|
442
|
+
"required": false,
|
|
443
|
+
"optional": false,
|
|
444
|
+
"docs": {
|
|
445
|
+
"tags": [],
|
|
446
|
+
"text": "Show password visibility toggle (renders as password field)"
|
|
447
|
+
},
|
|
448
|
+
"getter": false,
|
|
449
|
+
"setter": false,
|
|
450
|
+
"reflect": false,
|
|
451
|
+
"attribute": "password-input",
|
|
452
|
+
"defaultValue": "false"
|
|
453
|
+
},
|
|
454
|
+
"moneyFormat": {
|
|
455
|
+
"type": "boolean",
|
|
456
|
+
"mutable": false,
|
|
457
|
+
"complexType": {
|
|
458
|
+
"original": "boolean",
|
|
459
|
+
"resolved": "boolean",
|
|
460
|
+
"references": {}
|
|
461
|
+
},
|
|
462
|
+
"required": false,
|
|
463
|
+
"optional": false,
|
|
464
|
+
"docs": {
|
|
465
|
+
"tags": [],
|
|
466
|
+
"text": "Apply thousand separator formatting (e.g. 1,000,000)"
|
|
467
|
+
},
|
|
468
|
+
"getter": false,
|
|
469
|
+
"setter": false,
|
|
470
|
+
"reflect": false,
|
|
471
|
+
"attribute": "money-format",
|
|
472
|
+
"defaultValue": "false"
|
|
473
|
+
},
|
|
474
|
+
"thousandSeparator": {
|
|
475
|
+
"type": "boolean",
|
|
476
|
+
"mutable": false,
|
|
477
|
+
"complexType": {
|
|
478
|
+
"original": "boolean",
|
|
479
|
+
"resolved": "boolean",
|
|
480
|
+
"references": {}
|
|
481
|
+
},
|
|
482
|
+
"required": false,
|
|
483
|
+
"optional": false,
|
|
484
|
+
"docs": {
|
|
485
|
+
"tags": [],
|
|
486
|
+
"text": "Apply thousand separator without currency symbol"
|
|
487
|
+
},
|
|
488
|
+
"getter": false,
|
|
489
|
+
"setter": false,
|
|
490
|
+
"reflect": false,
|
|
491
|
+
"attribute": "thousand-separator",
|
|
492
|
+
"defaultValue": "false"
|
|
493
|
+
},
|
|
494
|
+
"onlyNumbers": {
|
|
495
|
+
"type": "boolean",
|
|
496
|
+
"mutable": false,
|
|
497
|
+
"complexType": {
|
|
498
|
+
"original": "boolean",
|
|
499
|
+
"resolved": "boolean",
|
|
500
|
+
"references": {}
|
|
501
|
+
},
|
|
502
|
+
"required": false,
|
|
503
|
+
"optional": false,
|
|
504
|
+
"docs": {
|
|
505
|
+
"tags": [],
|
|
506
|
+
"text": "Only allow numeric characters"
|
|
507
|
+
},
|
|
508
|
+
"getter": false,
|
|
509
|
+
"setter": false,
|
|
510
|
+
"reflect": false,
|
|
511
|
+
"attribute": "only-numbers",
|
|
512
|
+
"defaultValue": "false"
|
|
513
|
+
},
|
|
514
|
+
"allowDecimals": {
|
|
515
|
+
"type": "boolean",
|
|
516
|
+
"mutable": false,
|
|
517
|
+
"complexType": {
|
|
518
|
+
"original": "boolean",
|
|
519
|
+
"resolved": "boolean",
|
|
520
|
+
"references": {}
|
|
521
|
+
},
|
|
522
|
+
"required": false,
|
|
523
|
+
"optional": false,
|
|
524
|
+
"docs": {
|
|
525
|
+
"tags": [],
|
|
526
|
+
"text": "Allow decimal point when onlyNumbers is true"
|
|
527
|
+
},
|
|
528
|
+
"getter": false,
|
|
529
|
+
"setter": false,
|
|
530
|
+
"reflect": false,
|
|
531
|
+
"attribute": "allow-decimals",
|
|
532
|
+
"defaultValue": "false"
|
|
533
|
+
},
|
|
534
|
+
"onlyLetters": {
|
|
535
|
+
"type": "boolean",
|
|
536
|
+
"mutable": false,
|
|
537
|
+
"complexType": {
|
|
538
|
+
"original": "boolean",
|
|
539
|
+
"resolved": "boolean",
|
|
540
|
+
"references": {}
|
|
541
|
+
},
|
|
542
|
+
"required": false,
|
|
543
|
+
"optional": false,
|
|
544
|
+
"docs": {
|
|
545
|
+
"tags": [],
|
|
546
|
+
"text": "Only allow letter characters"
|
|
547
|
+
},
|
|
548
|
+
"getter": false,
|
|
549
|
+
"setter": false,
|
|
550
|
+
"reflect": false,
|
|
551
|
+
"attribute": "only-letters",
|
|
552
|
+
"defaultValue": "false"
|
|
553
|
+
},
|
|
554
|
+
"icon": {
|
|
555
|
+
"type": "string",
|
|
556
|
+
"mutable": false,
|
|
557
|
+
"complexType": {
|
|
558
|
+
"original": "string",
|
|
559
|
+
"resolved": "string",
|
|
560
|
+
"references": {}
|
|
561
|
+
},
|
|
562
|
+
"required": false,
|
|
563
|
+
"optional": false,
|
|
564
|
+
"docs": {
|
|
565
|
+
"tags": [],
|
|
566
|
+
"text": "Icon name shown inside the input (only visible when value is not empty)"
|
|
567
|
+
},
|
|
568
|
+
"getter": false,
|
|
569
|
+
"setter": false,
|
|
570
|
+
"reflect": false,
|
|
571
|
+
"attribute": "icon",
|
|
572
|
+
"defaultValue": "''"
|
|
573
|
+
},
|
|
574
|
+
"iconColor": {
|
|
575
|
+
"type": "string",
|
|
576
|
+
"mutable": false,
|
|
577
|
+
"complexType": {
|
|
578
|
+
"original": "string",
|
|
579
|
+
"resolved": "string",
|
|
580
|
+
"references": {}
|
|
581
|
+
},
|
|
582
|
+
"required": false,
|
|
583
|
+
"optional": false,
|
|
584
|
+
"docs": {
|
|
585
|
+
"tags": [],
|
|
586
|
+
"text": "Color token for the icon"
|
|
587
|
+
},
|
|
588
|
+
"getter": false,
|
|
589
|
+
"setter": false,
|
|
590
|
+
"reflect": false,
|
|
591
|
+
"attribute": "icon-color",
|
|
592
|
+
"defaultValue": "'Gray-Gray-400'"
|
|
593
|
+
},
|
|
594
|
+
"invalid": {
|
|
595
|
+
"type": "boolean",
|
|
596
|
+
"mutable": false,
|
|
597
|
+
"complexType": {
|
|
598
|
+
"original": "boolean",
|
|
599
|
+
"resolved": "boolean",
|
|
600
|
+
"references": {}
|
|
601
|
+
},
|
|
602
|
+
"required": false,
|
|
603
|
+
"optional": false,
|
|
604
|
+
"docs": {
|
|
605
|
+
"tags": [],
|
|
606
|
+
"text": "Mark the field as invalid (consumer-controlled)"
|
|
607
|
+
},
|
|
608
|
+
"getter": false,
|
|
609
|
+
"setter": false,
|
|
610
|
+
"reflect": false,
|
|
611
|
+
"attribute": "invalid",
|
|
612
|
+
"defaultValue": "false"
|
|
613
|
+
},
|
|
614
|
+
"helperText": {
|
|
615
|
+
"type": "string",
|
|
616
|
+
"mutable": false,
|
|
617
|
+
"complexType": {
|
|
618
|
+
"original": "string",
|
|
619
|
+
"resolved": "string",
|
|
620
|
+
"references": {}
|
|
621
|
+
},
|
|
622
|
+
"required": false,
|
|
623
|
+
"optional": false,
|
|
624
|
+
"docs": {
|
|
625
|
+
"tags": [],
|
|
626
|
+
"text": "Helper / error text shown below the field"
|
|
627
|
+
},
|
|
628
|
+
"getter": false,
|
|
629
|
+
"setter": false,
|
|
630
|
+
"reflect": false,
|
|
631
|
+
"attribute": "helper-text",
|
|
632
|
+
"defaultValue": "''"
|
|
633
|
+
},
|
|
634
|
+
"showHelperOnlyOnError": {
|
|
635
|
+
"type": "boolean",
|
|
636
|
+
"mutable": false,
|
|
637
|
+
"complexType": {
|
|
638
|
+
"original": "boolean",
|
|
639
|
+
"resolved": "boolean",
|
|
640
|
+
"references": {}
|
|
641
|
+
},
|
|
642
|
+
"required": false,
|
|
643
|
+
"optional": false,
|
|
644
|
+
"docs": {
|
|
645
|
+
"tags": [],
|
|
646
|
+
"text": "Only show helperText when the field is invalid"
|
|
647
|
+
},
|
|
648
|
+
"getter": false,
|
|
649
|
+
"setter": false,
|
|
650
|
+
"reflect": false,
|
|
651
|
+
"attribute": "show-helper-only-on-error",
|
|
652
|
+
"defaultValue": "false"
|
|
653
|
+
}
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
static get states() {
|
|
657
|
+
return {
|
|
658
|
+
"showPassword": {},
|
|
659
|
+
"touched": {}
|
|
660
|
+
};
|
|
661
|
+
}
|
|
662
|
+
static get events() {
|
|
663
|
+
return [{
|
|
664
|
+
"method": "dropiInput",
|
|
665
|
+
"name": "dropiInput",
|
|
666
|
+
"bubbles": true,
|
|
667
|
+
"cancelable": true,
|
|
668
|
+
"composed": true,
|
|
669
|
+
"docs": {
|
|
670
|
+
"tags": [],
|
|
671
|
+
"text": "Emitted on every keystroke with the current value"
|
|
672
|
+
},
|
|
673
|
+
"complexType": {
|
|
674
|
+
"original": "string",
|
|
675
|
+
"resolved": "string",
|
|
676
|
+
"references": {}
|
|
677
|
+
}
|
|
678
|
+
}, {
|
|
679
|
+
"method": "dropiChange",
|
|
680
|
+
"name": "dropiChange",
|
|
681
|
+
"bubbles": true,
|
|
682
|
+
"cancelable": true,
|
|
683
|
+
"composed": true,
|
|
684
|
+
"docs": {
|
|
685
|
+
"tags": [],
|
|
686
|
+
"text": "Emitted on blur with the final value"
|
|
687
|
+
},
|
|
688
|
+
"complexType": {
|
|
689
|
+
"original": "string",
|
|
690
|
+
"resolved": "string",
|
|
691
|
+
"references": {}
|
|
692
|
+
}
|
|
693
|
+
}, {
|
|
694
|
+
"method": "dropiFocus",
|
|
695
|
+
"name": "dropiFocus",
|
|
696
|
+
"bubbles": true,
|
|
697
|
+
"cancelable": true,
|
|
698
|
+
"composed": true,
|
|
699
|
+
"docs": {
|
|
700
|
+
"tags": [],
|
|
701
|
+
"text": "Emitted on focus"
|
|
702
|
+
},
|
|
703
|
+
"complexType": {
|
|
704
|
+
"original": "void",
|
|
705
|
+
"resolved": "void",
|
|
706
|
+
"references": {}
|
|
707
|
+
}
|
|
708
|
+
}, {
|
|
709
|
+
"method": "dropiBlur",
|
|
710
|
+
"name": "dropiBlur",
|
|
711
|
+
"bubbles": true,
|
|
712
|
+
"cancelable": true,
|
|
713
|
+
"composed": true,
|
|
714
|
+
"docs": {
|
|
715
|
+
"tags": [],
|
|
716
|
+
"text": "Emitted on blur"
|
|
717
|
+
},
|
|
718
|
+
"complexType": {
|
|
719
|
+
"original": "void",
|
|
720
|
+
"resolved": "void",
|
|
721
|
+
"references": {}
|
|
722
|
+
}
|
|
723
|
+
}];
|
|
724
|
+
}
|
|
725
|
+
static get watchers() {
|
|
726
|
+
return [{
|
|
727
|
+
"propName": "value",
|
|
728
|
+
"methodName": "valueChanged"
|
|
729
|
+
}, {
|
|
730
|
+
"propName": "disabled",
|
|
731
|
+
"methodName": "disabledChanged"
|
|
732
|
+
}];
|
|
733
|
+
}
|
|
734
|
+
static get attachInternalsMemberName() { return "internals"; }
|
|
735
|
+
}
|