@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,1549 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/**
|
|
4
|
+
* This is an autogenerated file created by the Stencil compiler.
|
|
5
|
+
* It contains typing information for all components that exist in this project.
|
|
6
|
+
*/
|
|
7
|
+
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
|
+
import { BadgeState } from "./components/dropi-badge/dropi-badge";
|
|
9
|
+
import { ButtonSeverity, ButtonSize, ButtonState, ButtonType } from "./components/dropi-button/dropi-button";
|
|
10
|
+
import { InputMode } from "./components/dropi-input/dropi-input";
|
|
11
|
+
import { Event } from "./stencil-public-runtime";
|
|
12
|
+
import { SelectOption, SelectOptionGroup } from "./components/dropi-select/select.types";
|
|
13
|
+
import { TagState, TagType } from "./components/dropi-tag/dropi-tag";
|
|
14
|
+
import { ResizeMode } from "./components/dropi-text-area/dropi-text-area";
|
|
15
|
+
export { BadgeState } from "./components/dropi-badge/dropi-badge";
|
|
16
|
+
export { ButtonSeverity, ButtonSize, ButtonState, ButtonType } from "./components/dropi-button/dropi-button";
|
|
17
|
+
export { InputMode } from "./components/dropi-input/dropi-input";
|
|
18
|
+
export { Event } from "./stencil-public-runtime";
|
|
19
|
+
export { SelectOption, SelectOptionGroup } from "./components/dropi-select/select.types";
|
|
20
|
+
export { TagState, TagType } from "./components/dropi-tag/dropi-tag";
|
|
21
|
+
export { ResizeMode } from "./components/dropi-text-area/dropi-text-area";
|
|
22
|
+
export namespace Components {
|
|
23
|
+
/**
|
|
24
|
+
* @component dropi-badge
|
|
25
|
+
* Status badge for user/account states.
|
|
26
|
+
*/
|
|
27
|
+
interface DropiBadge {
|
|
28
|
+
/**
|
|
29
|
+
* Badge state: pending | active | canceled | frozen
|
|
30
|
+
* @default 'pending'
|
|
31
|
+
*/
|
|
32
|
+
"state": BadgeState;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @component dropi-button
|
|
36
|
+
* Primary action button with multiple types, severities, sizes and states.
|
|
37
|
+
* Supports pre/post icons and a loading spinner.
|
|
38
|
+
*/
|
|
39
|
+
interface DropiButton {
|
|
40
|
+
/**
|
|
41
|
+
* Icon name to show after the text
|
|
42
|
+
* @default ''
|
|
43
|
+
*/
|
|
44
|
+
"postIcon": string;
|
|
45
|
+
/**
|
|
46
|
+
* Icon name to show before the text
|
|
47
|
+
* @default ''
|
|
48
|
+
*/
|
|
49
|
+
"preIcon": string;
|
|
50
|
+
/**
|
|
51
|
+
* Primary (filled) | Secondary (outlined) | Tertiary (ghost)
|
|
52
|
+
* @default 'primary'
|
|
53
|
+
*/
|
|
54
|
+
"severity": ButtonSeverity;
|
|
55
|
+
/**
|
|
56
|
+
* Button size
|
|
57
|
+
* @default 'normal'
|
|
58
|
+
*/
|
|
59
|
+
"size": ButtonSize;
|
|
60
|
+
/**
|
|
61
|
+
* Button state
|
|
62
|
+
* @default 'default'
|
|
63
|
+
*/
|
|
64
|
+
"state": ButtonState;
|
|
65
|
+
/**
|
|
66
|
+
* Button label
|
|
67
|
+
* @default ''
|
|
68
|
+
*/
|
|
69
|
+
"text": string;
|
|
70
|
+
/**
|
|
71
|
+
* Visual color palette
|
|
72
|
+
* @default 'default'
|
|
73
|
+
*/
|
|
74
|
+
"type": ButtonType;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* @component dropi-checkbox
|
|
78
|
+
* A styled checkbox that emits change events.
|
|
79
|
+
* Supports form association via native `<input type="checkbox">` internals.
|
|
80
|
+
*/
|
|
81
|
+
interface DropiCheckbox {
|
|
82
|
+
/**
|
|
83
|
+
* Whether the checkbox is checked
|
|
84
|
+
* @default false
|
|
85
|
+
*/
|
|
86
|
+
"checked": boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Whether the checkbox is disabled
|
|
89
|
+
* @default false
|
|
90
|
+
*/
|
|
91
|
+
"disabled": boolean;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* @component dropi-icon
|
|
95
|
+
* Renders an SVG icon from the Dropi sprite sheet.
|
|
96
|
+
* The sprite must be available at `assets/icons/sprite.svg`.
|
|
97
|
+
*/
|
|
98
|
+
interface DropiIcon {
|
|
99
|
+
/**
|
|
100
|
+
* Color of the icon. Accepts: - Hex color: `#ff0000` - CSS variable name without `--`: `Primary-Primary-500` - `currentColor` to inherit
|
|
101
|
+
* @default 'currentColor'
|
|
102
|
+
*/
|
|
103
|
+
"color": string;
|
|
104
|
+
/**
|
|
105
|
+
* Height of the icon (CSS value)
|
|
106
|
+
* @default '24px'
|
|
107
|
+
*/
|
|
108
|
+
"height": string;
|
|
109
|
+
/**
|
|
110
|
+
* Icon name matching the id in the SVG sprite
|
|
111
|
+
* @default ''
|
|
112
|
+
*/
|
|
113
|
+
"name": string;
|
|
114
|
+
/**
|
|
115
|
+
* Width of the icon (CSS value)
|
|
116
|
+
* @default '24px'
|
|
117
|
+
*/
|
|
118
|
+
"width": string;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* @component dropi-input
|
|
122
|
+
* Text input with floating label, validation states, password toggle,
|
|
123
|
+
* number/letter restrictions, thousand separator, and native form association.
|
|
124
|
+
* ## Form usage (native HTML form)
|
|
125
|
+
* ```html
|
|
126
|
+
* <form>
|
|
127
|
+
* <dropi-input name="email" label="Email" required></dropi-input>
|
|
128
|
+
* </form>
|
|
129
|
+
* ```
|
|
130
|
+
* ## Controlled usage (React / Vue / Angular)
|
|
131
|
+
* Pass `value` and listen to `dropiInput` to update.
|
|
132
|
+
*/
|
|
133
|
+
interface DropiInput {
|
|
134
|
+
/**
|
|
135
|
+
* Allow decimal point when onlyNumbers is true
|
|
136
|
+
* @default false
|
|
137
|
+
*/
|
|
138
|
+
"allowDecimals": boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Disable the input
|
|
141
|
+
* @default false
|
|
142
|
+
*/
|
|
143
|
+
"disabled": boolean;
|
|
144
|
+
/**
|
|
145
|
+
* Show label above the input (fixed), instead of floating inside
|
|
146
|
+
* @default false
|
|
147
|
+
*/
|
|
148
|
+
"fixedLabel": boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Helper / error text shown below the field
|
|
151
|
+
* @default ''
|
|
152
|
+
*/
|
|
153
|
+
"helperText": string;
|
|
154
|
+
/**
|
|
155
|
+
* Icon name shown inside the input (only visible when value is not empty)
|
|
156
|
+
* @default ''
|
|
157
|
+
*/
|
|
158
|
+
"icon": string;
|
|
159
|
+
/**
|
|
160
|
+
* Color token for the icon
|
|
161
|
+
* @default 'Gray-Gray-400'
|
|
162
|
+
*/
|
|
163
|
+
"iconColor": string;
|
|
164
|
+
/**
|
|
165
|
+
* Input id. Defaults to label value.
|
|
166
|
+
* @default ''
|
|
167
|
+
*/
|
|
168
|
+
"inputId": string;
|
|
169
|
+
/**
|
|
170
|
+
* Keyboard input mode hint
|
|
171
|
+
* @default 'text'
|
|
172
|
+
*/
|
|
173
|
+
"inputMode": InputMode;
|
|
174
|
+
/**
|
|
175
|
+
* Mark the field as invalid (consumer-controlled)
|
|
176
|
+
* @default false
|
|
177
|
+
*/
|
|
178
|
+
"invalid": boolean;
|
|
179
|
+
/**
|
|
180
|
+
* Floating or fixed label text
|
|
181
|
+
* @default ''
|
|
182
|
+
*/
|
|
183
|
+
"label": string;
|
|
184
|
+
/**
|
|
185
|
+
* Max character length
|
|
186
|
+
*/
|
|
187
|
+
"maxlength": number;
|
|
188
|
+
/**
|
|
189
|
+
* Apply thousand separator formatting (e.g. 1,000,000)
|
|
190
|
+
* @default false
|
|
191
|
+
*/
|
|
192
|
+
"moneyFormat": boolean;
|
|
193
|
+
/**
|
|
194
|
+
* Name attribute for native form submission
|
|
195
|
+
* @default ''
|
|
196
|
+
*/
|
|
197
|
+
"name": string;
|
|
198
|
+
/**
|
|
199
|
+
* Only allow letter characters
|
|
200
|
+
* @default false
|
|
201
|
+
*/
|
|
202
|
+
"onlyLetters": boolean;
|
|
203
|
+
/**
|
|
204
|
+
* Only allow numeric characters
|
|
205
|
+
* @default false
|
|
206
|
+
*/
|
|
207
|
+
"onlyNumbers": boolean;
|
|
208
|
+
/**
|
|
209
|
+
* Show password visibility toggle (renders as password field)
|
|
210
|
+
* @default false
|
|
211
|
+
*/
|
|
212
|
+
"passwordInput": boolean;
|
|
213
|
+
/**
|
|
214
|
+
* Placeholder text (visible in fixedLabel mode or on focus)
|
|
215
|
+
* @default ' '
|
|
216
|
+
*/
|
|
217
|
+
"placeholder": string;
|
|
218
|
+
/**
|
|
219
|
+
* Mark as required (shows asterisk when showAsterisk is true)
|
|
220
|
+
* @default false
|
|
221
|
+
*/
|
|
222
|
+
"required": boolean;
|
|
223
|
+
/**
|
|
224
|
+
* Show the required asterisk on the label
|
|
225
|
+
* @default true
|
|
226
|
+
*/
|
|
227
|
+
"showAsterisk": boolean;
|
|
228
|
+
/**
|
|
229
|
+
* Only show helperText when the field is invalid
|
|
230
|
+
* @default false
|
|
231
|
+
*/
|
|
232
|
+
"showHelperOnlyOnError": boolean;
|
|
233
|
+
/**
|
|
234
|
+
* Apply thousand separator without currency symbol
|
|
235
|
+
* @default false
|
|
236
|
+
*/
|
|
237
|
+
"thousandSeparator": boolean;
|
|
238
|
+
/**
|
|
239
|
+
* Current value (controlled)
|
|
240
|
+
* @default ''
|
|
241
|
+
*/
|
|
242
|
+
"value": string;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* @component dropi-radio-button
|
|
246
|
+
* Styled radio button with label.
|
|
247
|
+
*/
|
|
248
|
+
interface DropiRadioButton {
|
|
249
|
+
/**
|
|
250
|
+
* Whether this radio is selected
|
|
251
|
+
* @default false
|
|
252
|
+
*/
|
|
253
|
+
"checked": boolean;
|
|
254
|
+
/**
|
|
255
|
+
* Input id
|
|
256
|
+
* @default 'radioButton'
|
|
257
|
+
*/
|
|
258
|
+
"inputId": string;
|
|
259
|
+
/**
|
|
260
|
+
* Label text displayed next to the radio
|
|
261
|
+
* @default ''
|
|
262
|
+
*/
|
|
263
|
+
"label": string;
|
|
264
|
+
/**
|
|
265
|
+
* Input name (for grouping radio buttons)
|
|
266
|
+
* @default 'radio'
|
|
267
|
+
*/
|
|
268
|
+
"name": string;
|
|
269
|
+
/**
|
|
270
|
+
* Set to true to programmatically reset this radio to unchecked. Useful when the parent needs to clear a group.
|
|
271
|
+
* @default false
|
|
272
|
+
*/
|
|
273
|
+
"resetTrigger": boolean;
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* @component dropi-select
|
|
277
|
+
* Feature-rich select with support for:
|
|
278
|
+
* - Single / multi select
|
|
279
|
+
* - Grouped options
|
|
280
|
+
* - Search / filter
|
|
281
|
+
* - Country flags
|
|
282
|
+
* - Radio-style options with images
|
|
283
|
+
* - Inline (dropdownType) or bordered trigger
|
|
284
|
+
* - Native form association
|
|
285
|
+
* ## Usage
|
|
286
|
+
* Options must be set via JS property (not HTML attribute) for object arrays:
|
|
287
|
+
* ```js
|
|
288
|
+
* document.querySelector('dropi-select').options = [
|
|
289
|
+
* { id: 1, label: 'Option A' },
|
|
290
|
+
* { id: 2, label: 'Option B' },
|
|
291
|
+
* ];
|
|
292
|
+
* ```
|
|
293
|
+
*/
|
|
294
|
+
interface DropiSelect {
|
|
295
|
+
/**
|
|
296
|
+
* Clear the current selection
|
|
297
|
+
*/
|
|
298
|
+
"clearSelection": () => Promise<void>;
|
|
299
|
+
/**
|
|
300
|
+
* Pre-select an option by id
|
|
301
|
+
* @default ''
|
|
302
|
+
*/
|
|
303
|
+
"defaultSelectedId": string | number;
|
|
304
|
+
/**
|
|
305
|
+
* @default false
|
|
306
|
+
*/
|
|
307
|
+
"disabled": boolean;
|
|
308
|
+
/**
|
|
309
|
+
* Renders trigger without border (inline/dropdown style)
|
|
310
|
+
* @default false
|
|
311
|
+
*/
|
|
312
|
+
"dropdownType": boolean;
|
|
313
|
+
/**
|
|
314
|
+
* @default ''
|
|
315
|
+
*/
|
|
316
|
+
"errorText": string;
|
|
317
|
+
/**
|
|
318
|
+
* @default ''
|
|
319
|
+
*/
|
|
320
|
+
"helperText": string;
|
|
321
|
+
/**
|
|
322
|
+
* @default false
|
|
323
|
+
*/
|
|
324
|
+
"invalid": boolean;
|
|
325
|
+
/**
|
|
326
|
+
* @default ''
|
|
327
|
+
*/
|
|
328
|
+
"label": string;
|
|
329
|
+
/**
|
|
330
|
+
* Allows selecting multiple options
|
|
331
|
+
* @default false
|
|
332
|
+
*/
|
|
333
|
+
"multiSelect": boolean;
|
|
334
|
+
/**
|
|
335
|
+
* @default ''
|
|
336
|
+
*/
|
|
337
|
+
"name": string;
|
|
338
|
+
/**
|
|
339
|
+
* Array of SelectOption or SelectOptionGroup
|
|
340
|
+
* @default []
|
|
341
|
+
*/
|
|
342
|
+
"options": SelectOption[] | SelectOptionGroup[];
|
|
343
|
+
/**
|
|
344
|
+
* Placeholder inside the search field
|
|
345
|
+
* @default 'Buscar'
|
|
346
|
+
*/
|
|
347
|
+
"placeHolderSearch": string;
|
|
348
|
+
/**
|
|
349
|
+
* @default 'Seleccionar'
|
|
350
|
+
*/
|
|
351
|
+
"placeholder": string;
|
|
352
|
+
/**
|
|
353
|
+
* Icon name shown before the trigger label
|
|
354
|
+
* @default ''
|
|
355
|
+
*/
|
|
356
|
+
"preIcon": string;
|
|
357
|
+
/**
|
|
358
|
+
* Renders options as radio buttons with optional image
|
|
359
|
+
* @default false
|
|
360
|
+
*/
|
|
361
|
+
"radioOptions": boolean;
|
|
362
|
+
/**
|
|
363
|
+
* Reset multi-select state and show a placeholder label
|
|
364
|
+
*/
|
|
365
|
+
"resetMultiSelect": (_placeholder?: string) => Promise<void>;
|
|
366
|
+
/**
|
|
367
|
+
* Enables text search inside the dropdown
|
|
368
|
+
* @default false
|
|
369
|
+
*/
|
|
370
|
+
"searchEnabled": boolean;
|
|
371
|
+
/**
|
|
372
|
+
* Select an option by its id
|
|
373
|
+
*/
|
|
374
|
+
"setById": (id: string | number) => Promise<void>;
|
|
375
|
+
/**
|
|
376
|
+
* Select an option by its label
|
|
377
|
+
*/
|
|
378
|
+
"setByLabel": (label: string) => Promise<void>;
|
|
379
|
+
/**
|
|
380
|
+
* Show country flags next to option labels
|
|
381
|
+
* @default false
|
|
382
|
+
*/
|
|
383
|
+
"showCountryFlags": boolean;
|
|
384
|
+
/**
|
|
385
|
+
* @default false
|
|
386
|
+
*/
|
|
387
|
+
"showObligatory": boolean;
|
|
388
|
+
/**
|
|
389
|
+
* Controlled selected option (single select)
|
|
390
|
+
* @default null
|
|
391
|
+
*/
|
|
392
|
+
"value": SelectOption | null;
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* @component dropi-switch
|
|
396
|
+
* Toggle switch component. Emits dropiChange on toggle.
|
|
397
|
+
*/
|
|
398
|
+
interface DropiSwitch {
|
|
399
|
+
/**
|
|
400
|
+
* Whether the switch is disabled
|
|
401
|
+
* @default false
|
|
402
|
+
*/
|
|
403
|
+
"disabled": boolean;
|
|
404
|
+
/**
|
|
405
|
+
* Whether the switch is on
|
|
406
|
+
* @default false
|
|
407
|
+
*/
|
|
408
|
+
"isChecked": boolean;
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* @component dropi-tag
|
|
412
|
+
* Colored tag/chip for statuses, categories, and labels.
|
|
413
|
+
*/
|
|
414
|
+
interface DropiTag {
|
|
415
|
+
/**
|
|
416
|
+
* Icon name from the sprite
|
|
417
|
+
* @default ''
|
|
418
|
+
*/
|
|
419
|
+
"icon": string;
|
|
420
|
+
/**
|
|
421
|
+
* Whether to show the icon
|
|
422
|
+
* @default false
|
|
423
|
+
*/
|
|
424
|
+
"showIcon": boolean;
|
|
425
|
+
/**
|
|
426
|
+
* Color state of the tag
|
|
427
|
+
* @default 'default'
|
|
428
|
+
*/
|
|
429
|
+
"state": TagState;
|
|
430
|
+
/**
|
|
431
|
+
* Label text
|
|
432
|
+
* @default ''
|
|
433
|
+
*/
|
|
434
|
+
"text": string;
|
|
435
|
+
/**
|
|
436
|
+
* primary (filled) | secondary (soft)
|
|
437
|
+
* @default 'primary'
|
|
438
|
+
*/
|
|
439
|
+
"type": TagType;
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* @component dropi-text-area
|
|
443
|
+
* Multi-line text area with label, char counter, validation states,
|
|
444
|
+
* helper text, and native form association.
|
|
445
|
+
*/
|
|
446
|
+
interface DropiTextArea {
|
|
447
|
+
/**
|
|
448
|
+
* Disable the textarea
|
|
449
|
+
* @default false
|
|
450
|
+
*/
|
|
451
|
+
"disabled": boolean;
|
|
452
|
+
/**
|
|
453
|
+
* Helper / error text below the field
|
|
454
|
+
* @default ''
|
|
455
|
+
*/
|
|
456
|
+
"helperText": string;
|
|
457
|
+
/**
|
|
458
|
+
* Input id. Defaults to label.
|
|
459
|
+
* @default ''
|
|
460
|
+
*/
|
|
461
|
+
"inputId": string;
|
|
462
|
+
/**
|
|
463
|
+
* Mark the field as invalid (consumer-controlled)
|
|
464
|
+
* @default false
|
|
465
|
+
*/
|
|
466
|
+
"invalid": boolean;
|
|
467
|
+
/**
|
|
468
|
+
* Label shown above the textarea
|
|
469
|
+
* @default ''
|
|
470
|
+
*/
|
|
471
|
+
"label": string;
|
|
472
|
+
/**
|
|
473
|
+
* Max character length
|
|
474
|
+
*/
|
|
475
|
+
"maxlength": number;
|
|
476
|
+
/**
|
|
477
|
+
* Min character length
|
|
478
|
+
* @default 0
|
|
479
|
+
*/
|
|
480
|
+
"minlength": number;
|
|
481
|
+
/**
|
|
482
|
+
* Name for native form submission
|
|
483
|
+
* @default ''
|
|
484
|
+
*/
|
|
485
|
+
"name": string;
|
|
486
|
+
/**
|
|
487
|
+
* Placeholder text
|
|
488
|
+
* @default ''
|
|
489
|
+
*/
|
|
490
|
+
"placeholder": string;
|
|
491
|
+
/**
|
|
492
|
+
* Mark as required
|
|
493
|
+
* @default false
|
|
494
|
+
*/
|
|
495
|
+
"required": boolean;
|
|
496
|
+
/**
|
|
497
|
+
* Resize behavior
|
|
498
|
+
* @default 'vertical'
|
|
499
|
+
*/
|
|
500
|
+
"resize": ResizeMode;
|
|
501
|
+
/**
|
|
502
|
+
* Number of visible rows
|
|
503
|
+
* @default 4
|
|
504
|
+
*/
|
|
505
|
+
"rows": number;
|
|
506
|
+
/**
|
|
507
|
+
* Show the required asterisk
|
|
508
|
+
* @default false
|
|
509
|
+
*/
|
|
510
|
+
"showAsterisk": boolean;
|
|
511
|
+
/**
|
|
512
|
+
* Current value (controlled)
|
|
513
|
+
* @default ''
|
|
514
|
+
*/
|
|
515
|
+
"value": string;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
export interface DropiButtonCustomEvent<T> extends CustomEvent<T> {
|
|
519
|
+
detail: T;
|
|
520
|
+
target: HTMLDropiButtonElement;
|
|
521
|
+
}
|
|
522
|
+
export interface DropiCheckboxCustomEvent<T> extends CustomEvent<T> {
|
|
523
|
+
detail: T;
|
|
524
|
+
target: HTMLDropiCheckboxElement;
|
|
525
|
+
}
|
|
526
|
+
export interface DropiInputCustomEvent<T> extends CustomEvent<T> {
|
|
527
|
+
detail: T;
|
|
528
|
+
target: HTMLDropiInputElement;
|
|
529
|
+
}
|
|
530
|
+
export interface DropiRadioButtonCustomEvent<T> extends CustomEvent<T> {
|
|
531
|
+
detail: T;
|
|
532
|
+
target: HTMLDropiRadioButtonElement;
|
|
533
|
+
}
|
|
534
|
+
export interface DropiSelectCustomEvent<T> extends CustomEvent<T> {
|
|
535
|
+
detail: T;
|
|
536
|
+
target: HTMLDropiSelectElement;
|
|
537
|
+
}
|
|
538
|
+
export interface DropiSwitchCustomEvent<T> extends CustomEvent<T> {
|
|
539
|
+
detail: T;
|
|
540
|
+
target: HTMLDropiSwitchElement;
|
|
541
|
+
}
|
|
542
|
+
export interface DropiTextAreaCustomEvent<T> extends CustomEvent<T> {
|
|
543
|
+
detail: T;
|
|
544
|
+
target: HTMLDropiTextAreaElement;
|
|
545
|
+
}
|
|
546
|
+
declare global {
|
|
547
|
+
/**
|
|
548
|
+
* @component dropi-badge
|
|
549
|
+
* Status badge for user/account states.
|
|
550
|
+
*/
|
|
551
|
+
interface HTMLDropiBadgeElement extends Components.DropiBadge, HTMLStencilElement {
|
|
552
|
+
}
|
|
553
|
+
var HTMLDropiBadgeElement: {
|
|
554
|
+
prototype: HTMLDropiBadgeElement;
|
|
555
|
+
new (): HTMLDropiBadgeElement;
|
|
556
|
+
};
|
|
557
|
+
interface HTMLDropiButtonElementEventMap {
|
|
558
|
+
"dropiClick": MouseEvent;
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* @component dropi-button
|
|
562
|
+
* Primary action button with multiple types, severities, sizes and states.
|
|
563
|
+
* Supports pre/post icons and a loading spinner.
|
|
564
|
+
*/
|
|
565
|
+
interface HTMLDropiButtonElement extends Components.DropiButton, HTMLStencilElement {
|
|
566
|
+
addEventListener<K extends keyof HTMLDropiButtonElementEventMap>(type: K, listener: (this: HTMLDropiButtonElement, ev: DropiButtonCustomEvent<HTMLDropiButtonElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
567
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
568
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
569
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
570
|
+
removeEventListener<K extends keyof HTMLDropiButtonElementEventMap>(type: K, listener: (this: HTMLDropiButtonElement, ev: DropiButtonCustomEvent<HTMLDropiButtonElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
571
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
572
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
573
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
574
|
+
}
|
|
575
|
+
var HTMLDropiButtonElement: {
|
|
576
|
+
prototype: HTMLDropiButtonElement;
|
|
577
|
+
new (): HTMLDropiButtonElement;
|
|
578
|
+
};
|
|
579
|
+
interface HTMLDropiCheckboxElementEventMap {
|
|
580
|
+
"dropiChange": boolean;
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* @component dropi-checkbox
|
|
584
|
+
* A styled checkbox that emits change events.
|
|
585
|
+
* Supports form association via native `<input type="checkbox">` internals.
|
|
586
|
+
*/
|
|
587
|
+
interface HTMLDropiCheckboxElement extends Components.DropiCheckbox, HTMLStencilElement {
|
|
588
|
+
addEventListener<K extends keyof HTMLDropiCheckboxElementEventMap>(type: K, listener: (this: HTMLDropiCheckboxElement, ev: DropiCheckboxCustomEvent<HTMLDropiCheckboxElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
589
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
590
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
591
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
592
|
+
removeEventListener<K extends keyof HTMLDropiCheckboxElementEventMap>(type: K, listener: (this: HTMLDropiCheckboxElement, ev: DropiCheckboxCustomEvent<HTMLDropiCheckboxElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
593
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
594
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
595
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
596
|
+
}
|
|
597
|
+
var HTMLDropiCheckboxElement: {
|
|
598
|
+
prototype: HTMLDropiCheckboxElement;
|
|
599
|
+
new (): HTMLDropiCheckboxElement;
|
|
600
|
+
};
|
|
601
|
+
/**
|
|
602
|
+
* @component dropi-icon
|
|
603
|
+
* Renders an SVG icon from the Dropi sprite sheet.
|
|
604
|
+
* The sprite must be available at `assets/icons/sprite.svg`.
|
|
605
|
+
*/
|
|
606
|
+
interface HTMLDropiIconElement extends Components.DropiIcon, HTMLStencilElement {
|
|
607
|
+
}
|
|
608
|
+
var HTMLDropiIconElement: {
|
|
609
|
+
prototype: HTMLDropiIconElement;
|
|
610
|
+
new (): HTMLDropiIconElement;
|
|
611
|
+
};
|
|
612
|
+
interface HTMLDropiInputElementEventMap {
|
|
613
|
+
"dropiInput": string;
|
|
614
|
+
"dropiChange": string;
|
|
615
|
+
"dropiFocus": void;
|
|
616
|
+
"dropiBlur": void;
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* @component dropi-input
|
|
620
|
+
* Text input with floating label, validation states, password toggle,
|
|
621
|
+
* number/letter restrictions, thousand separator, and native form association.
|
|
622
|
+
* ## Form usage (native HTML form)
|
|
623
|
+
* ```html
|
|
624
|
+
* <form>
|
|
625
|
+
* <dropi-input name="email" label="Email" required></dropi-input>
|
|
626
|
+
* </form>
|
|
627
|
+
* ```
|
|
628
|
+
* ## Controlled usage (React / Vue / Angular)
|
|
629
|
+
* Pass `value` and listen to `dropiInput` to update.
|
|
630
|
+
*/
|
|
631
|
+
interface HTMLDropiInputElement extends Components.DropiInput, HTMLStencilElement {
|
|
632
|
+
addEventListener<K extends keyof HTMLDropiInputElementEventMap>(type: K, listener: (this: HTMLDropiInputElement, ev: DropiInputCustomEvent<HTMLDropiInputElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
633
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
634
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
635
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
636
|
+
removeEventListener<K extends keyof HTMLDropiInputElementEventMap>(type: K, listener: (this: HTMLDropiInputElement, ev: DropiInputCustomEvent<HTMLDropiInputElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
637
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
638
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
639
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
640
|
+
}
|
|
641
|
+
var HTMLDropiInputElement: {
|
|
642
|
+
prototype: HTMLDropiInputElement;
|
|
643
|
+
new (): HTMLDropiInputElement;
|
|
644
|
+
};
|
|
645
|
+
interface HTMLDropiRadioButtonElementEventMap {
|
|
646
|
+
"dropiChange": Event;
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* @component dropi-radio-button
|
|
650
|
+
* Styled radio button with label.
|
|
651
|
+
*/
|
|
652
|
+
interface HTMLDropiRadioButtonElement extends Components.DropiRadioButton, HTMLStencilElement {
|
|
653
|
+
addEventListener<K extends keyof HTMLDropiRadioButtonElementEventMap>(type: K, listener: (this: HTMLDropiRadioButtonElement, ev: DropiRadioButtonCustomEvent<HTMLDropiRadioButtonElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
654
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
655
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
656
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
657
|
+
removeEventListener<K extends keyof HTMLDropiRadioButtonElementEventMap>(type: K, listener: (this: HTMLDropiRadioButtonElement, ev: DropiRadioButtonCustomEvent<HTMLDropiRadioButtonElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
658
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
659
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
660
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
661
|
+
}
|
|
662
|
+
var HTMLDropiRadioButtonElement: {
|
|
663
|
+
prototype: HTMLDropiRadioButtonElement;
|
|
664
|
+
new (): HTMLDropiRadioButtonElement;
|
|
665
|
+
};
|
|
666
|
+
interface HTMLDropiSelectElementEventMap {
|
|
667
|
+
"dropiChange": SelectOption | SelectOption[];
|
|
668
|
+
"dropiClear": void;
|
|
669
|
+
"dropiSearch": string;
|
|
670
|
+
"dropiScrollEnd": void;
|
|
671
|
+
"dropiKeyEnter": KeyboardEvent;
|
|
672
|
+
}
|
|
673
|
+
/**
|
|
674
|
+
* @component dropi-select
|
|
675
|
+
* Feature-rich select with support for:
|
|
676
|
+
* - Single / multi select
|
|
677
|
+
* - Grouped options
|
|
678
|
+
* - Search / filter
|
|
679
|
+
* - Country flags
|
|
680
|
+
* - Radio-style options with images
|
|
681
|
+
* - Inline (dropdownType) or bordered trigger
|
|
682
|
+
* - Native form association
|
|
683
|
+
* ## Usage
|
|
684
|
+
* Options must be set via JS property (not HTML attribute) for object arrays:
|
|
685
|
+
* ```js
|
|
686
|
+
* document.querySelector('dropi-select').options = [
|
|
687
|
+
* { id: 1, label: 'Option A' },
|
|
688
|
+
* { id: 2, label: 'Option B' },
|
|
689
|
+
* ];
|
|
690
|
+
* ```
|
|
691
|
+
*/
|
|
692
|
+
interface HTMLDropiSelectElement extends Components.DropiSelect, HTMLStencilElement {
|
|
693
|
+
addEventListener<K extends keyof HTMLDropiSelectElementEventMap>(type: K, listener: (this: HTMLDropiSelectElement, ev: DropiSelectCustomEvent<HTMLDropiSelectElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
694
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
695
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
696
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
697
|
+
removeEventListener<K extends keyof HTMLDropiSelectElementEventMap>(type: K, listener: (this: HTMLDropiSelectElement, ev: DropiSelectCustomEvent<HTMLDropiSelectElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
698
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
699
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
700
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
701
|
+
}
|
|
702
|
+
var HTMLDropiSelectElement: {
|
|
703
|
+
prototype: HTMLDropiSelectElement;
|
|
704
|
+
new (): HTMLDropiSelectElement;
|
|
705
|
+
};
|
|
706
|
+
interface HTMLDropiSwitchElementEventMap {
|
|
707
|
+
"dropiChange": boolean;
|
|
708
|
+
}
|
|
709
|
+
/**
|
|
710
|
+
* @component dropi-switch
|
|
711
|
+
* Toggle switch component. Emits dropiChange on toggle.
|
|
712
|
+
*/
|
|
713
|
+
interface HTMLDropiSwitchElement extends Components.DropiSwitch, HTMLStencilElement {
|
|
714
|
+
addEventListener<K extends keyof HTMLDropiSwitchElementEventMap>(type: K, listener: (this: HTMLDropiSwitchElement, ev: DropiSwitchCustomEvent<HTMLDropiSwitchElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
715
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
716
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
717
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
718
|
+
removeEventListener<K extends keyof HTMLDropiSwitchElementEventMap>(type: K, listener: (this: HTMLDropiSwitchElement, ev: DropiSwitchCustomEvent<HTMLDropiSwitchElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
719
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
720
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
721
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
722
|
+
}
|
|
723
|
+
var HTMLDropiSwitchElement: {
|
|
724
|
+
prototype: HTMLDropiSwitchElement;
|
|
725
|
+
new (): HTMLDropiSwitchElement;
|
|
726
|
+
};
|
|
727
|
+
/**
|
|
728
|
+
* @component dropi-tag
|
|
729
|
+
* Colored tag/chip for statuses, categories, and labels.
|
|
730
|
+
*/
|
|
731
|
+
interface HTMLDropiTagElement extends Components.DropiTag, HTMLStencilElement {
|
|
732
|
+
}
|
|
733
|
+
var HTMLDropiTagElement: {
|
|
734
|
+
prototype: HTMLDropiTagElement;
|
|
735
|
+
new (): HTMLDropiTagElement;
|
|
736
|
+
};
|
|
737
|
+
interface HTMLDropiTextAreaElementEventMap {
|
|
738
|
+
"dropiInput": string;
|
|
739
|
+
"dropiChange": string;
|
|
740
|
+
"dropiFocus": void;
|
|
741
|
+
"dropiBlur": void;
|
|
742
|
+
}
|
|
743
|
+
/**
|
|
744
|
+
* @component dropi-text-area
|
|
745
|
+
* Multi-line text area with label, char counter, validation states,
|
|
746
|
+
* helper text, and native form association.
|
|
747
|
+
*/
|
|
748
|
+
interface HTMLDropiTextAreaElement extends Components.DropiTextArea, HTMLStencilElement {
|
|
749
|
+
addEventListener<K extends keyof HTMLDropiTextAreaElementEventMap>(type: K, listener: (this: HTMLDropiTextAreaElement, ev: DropiTextAreaCustomEvent<HTMLDropiTextAreaElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
750
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
751
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
752
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
753
|
+
removeEventListener<K extends keyof HTMLDropiTextAreaElementEventMap>(type: K, listener: (this: HTMLDropiTextAreaElement, ev: DropiTextAreaCustomEvent<HTMLDropiTextAreaElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
754
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
755
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
756
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
757
|
+
}
|
|
758
|
+
var HTMLDropiTextAreaElement: {
|
|
759
|
+
prototype: HTMLDropiTextAreaElement;
|
|
760
|
+
new (): HTMLDropiTextAreaElement;
|
|
761
|
+
};
|
|
762
|
+
interface HTMLElementTagNameMap {
|
|
763
|
+
"dropi-badge": HTMLDropiBadgeElement;
|
|
764
|
+
"dropi-button": HTMLDropiButtonElement;
|
|
765
|
+
"dropi-checkbox": HTMLDropiCheckboxElement;
|
|
766
|
+
"dropi-icon": HTMLDropiIconElement;
|
|
767
|
+
"dropi-input": HTMLDropiInputElement;
|
|
768
|
+
"dropi-radio-button": HTMLDropiRadioButtonElement;
|
|
769
|
+
"dropi-select": HTMLDropiSelectElement;
|
|
770
|
+
"dropi-switch": HTMLDropiSwitchElement;
|
|
771
|
+
"dropi-tag": HTMLDropiTagElement;
|
|
772
|
+
"dropi-text-area": HTMLDropiTextAreaElement;
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
declare namespace LocalJSX {
|
|
776
|
+
/**
|
|
777
|
+
* @component dropi-badge
|
|
778
|
+
* Status badge for user/account states.
|
|
779
|
+
*/
|
|
780
|
+
interface DropiBadge {
|
|
781
|
+
/**
|
|
782
|
+
* Badge state: pending | active | canceled | frozen
|
|
783
|
+
* @default 'pending'
|
|
784
|
+
*/
|
|
785
|
+
"state"?: BadgeState;
|
|
786
|
+
}
|
|
787
|
+
/**
|
|
788
|
+
* @component dropi-button
|
|
789
|
+
* Primary action button with multiple types, severities, sizes and states.
|
|
790
|
+
* Supports pre/post icons and a loading spinner.
|
|
791
|
+
*/
|
|
792
|
+
interface DropiButton {
|
|
793
|
+
/**
|
|
794
|
+
* Emitted on click (not emitted when disabled or loading)
|
|
795
|
+
*/
|
|
796
|
+
"onDropiClick"?: (event: DropiButtonCustomEvent<MouseEvent>) => void;
|
|
797
|
+
/**
|
|
798
|
+
* Icon name to show after the text
|
|
799
|
+
* @default ''
|
|
800
|
+
*/
|
|
801
|
+
"postIcon"?: string;
|
|
802
|
+
/**
|
|
803
|
+
* Icon name to show before the text
|
|
804
|
+
* @default ''
|
|
805
|
+
*/
|
|
806
|
+
"preIcon"?: string;
|
|
807
|
+
/**
|
|
808
|
+
* Primary (filled) | Secondary (outlined) | Tertiary (ghost)
|
|
809
|
+
* @default 'primary'
|
|
810
|
+
*/
|
|
811
|
+
"severity"?: ButtonSeverity;
|
|
812
|
+
/**
|
|
813
|
+
* Button size
|
|
814
|
+
* @default 'normal'
|
|
815
|
+
*/
|
|
816
|
+
"size"?: ButtonSize;
|
|
817
|
+
/**
|
|
818
|
+
* Button state
|
|
819
|
+
* @default 'default'
|
|
820
|
+
*/
|
|
821
|
+
"state"?: ButtonState;
|
|
822
|
+
/**
|
|
823
|
+
* Button label
|
|
824
|
+
* @default ''
|
|
825
|
+
*/
|
|
826
|
+
"text"?: string;
|
|
827
|
+
/**
|
|
828
|
+
* Visual color palette
|
|
829
|
+
* @default 'default'
|
|
830
|
+
*/
|
|
831
|
+
"type"?: ButtonType;
|
|
832
|
+
}
|
|
833
|
+
/**
|
|
834
|
+
* @component dropi-checkbox
|
|
835
|
+
* A styled checkbox that emits change events.
|
|
836
|
+
* Supports form association via native `<input type="checkbox">` internals.
|
|
837
|
+
*/
|
|
838
|
+
interface DropiCheckbox {
|
|
839
|
+
/**
|
|
840
|
+
* Whether the checkbox is checked
|
|
841
|
+
* @default false
|
|
842
|
+
*/
|
|
843
|
+
"checked"?: boolean;
|
|
844
|
+
/**
|
|
845
|
+
* Whether the checkbox is disabled
|
|
846
|
+
* @default false
|
|
847
|
+
*/
|
|
848
|
+
"disabled"?: boolean;
|
|
849
|
+
/**
|
|
850
|
+
* The `id` of a `<form>` element to associate this element with.
|
|
851
|
+
*/
|
|
852
|
+
"form"?: string;
|
|
853
|
+
/**
|
|
854
|
+
* The name of the element, used when submitting an HTML form.
|
|
855
|
+
*/
|
|
856
|
+
"name"?: string;
|
|
857
|
+
/**
|
|
858
|
+
* Emitted when the checked state changes
|
|
859
|
+
*/
|
|
860
|
+
"onDropiChange"?: (event: DropiCheckboxCustomEvent<boolean>) => void;
|
|
861
|
+
}
|
|
862
|
+
/**
|
|
863
|
+
* @component dropi-icon
|
|
864
|
+
* Renders an SVG icon from the Dropi sprite sheet.
|
|
865
|
+
* The sprite must be available at `assets/icons/sprite.svg`.
|
|
866
|
+
*/
|
|
867
|
+
interface DropiIcon {
|
|
868
|
+
/**
|
|
869
|
+
* Color of the icon. Accepts: - Hex color: `#ff0000` - CSS variable name without `--`: `Primary-Primary-500` - `currentColor` to inherit
|
|
870
|
+
* @default 'currentColor'
|
|
871
|
+
*/
|
|
872
|
+
"color"?: string;
|
|
873
|
+
/**
|
|
874
|
+
* Height of the icon (CSS value)
|
|
875
|
+
* @default '24px'
|
|
876
|
+
*/
|
|
877
|
+
"height"?: string;
|
|
878
|
+
/**
|
|
879
|
+
* Icon name matching the id in the SVG sprite
|
|
880
|
+
* @default ''
|
|
881
|
+
*/
|
|
882
|
+
"name"?: string;
|
|
883
|
+
/**
|
|
884
|
+
* Width of the icon (CSS value)
|
|
885
|
+
* @default '24px'
|
|
886
|
+
*/
|
|
887
|
+
"width"?: string;
|
|
888
|
+
}
|
|
889
|
+
/**
|
|
890
|
+
* @component dropi-input
|
|
891
|
+
* Text input with floating label, validation states, password toggle,
|
|
892
|
+
* number/letter restrictions, thousand separator, and native form association.
|
|
893
|
+
* ## Form usage (native HTML form)
|
|
894
|
+
* ```html
|
|
895
|
+
* <form>
|
|
896
|
+
* <dropi-input name="email" label="Email" required></dropi-input>
|
|
897
|
+
* </form>
|
|
898
|
+
* ```
|
|
899
|
+
* ## Controlled usage (React / Vue / Angular)
|
|
900
|
+
* Pass `value` and listen to `dropiInput` to update.
|
|
901
|
+
*/
|
|
902
|
+
interface DropiInput {
|
|
903
|
+
/**
|
|
904
|
+
* Allow decimal point when onlyNumbers is true
|
|
905
|
+
* @default false
|
|
906
|
+
*/
|
|
907
|
+
"allowDecimals"?: boolean;
|
|
908
|
+
/**
|
|
909
|
+
* Disable the input
|
|
910
|
+
* @default false
|
|
911
|
+
*/
|
|
912
|
+
"disabled"?: boolean;
|
|
913
|
+
/**
|
|
914
|
+
* Show label above the input (fixed), instead of floating inside
|
|
915
|
+
* @default false
|
|
916
|
+
*/
|
|
917
|
+
"fixedLabel"?: boolean;
|
|
918
|
+
/**
|
|
919
|
+
* The `id` of a `<form>` element to associate this element with.
|
|
920
|
+
*/
|
|
921
|
+
"form"?: string;
|
|
922
|
+
/**
|
|
923
|
+
* Helper / error text shown below the field
|
|
924
|
+
* @default ''
|
|
925
|
+
*/
|
|
926
|
+
"helperText"?: string;
|
|
927
|
+
/**
|
|
928
|
+
* Icon name shown inside the input (only visible when value is not empty)
|
|
929
|
+
* @default ''
|
|
930
|
+
*/
|
|
931
|
+
"icon"?: string;
|
|
932
|
+
/**
|
|
933
|
+
* Color token for the icon
|
|
934
|
+
* @default 'Gray-Gray-400'
|
|
935
|
+
*/
|
|
936
|
+
"iconColor"?: string;
|
|
937
|
+
/**
|
|
938
|
+
* Input id. Defaults to label value.
|
|
939
|
+
* @default ''
|
|
940
|
+
*/
|
|
941
|
+
"inputId"?: string;
|
|
942
|
+
/**
|
|
943
|
+
* Keyboard input mode hint
|
|
944
|
+
* @default 'text'
|
|
945
|
+
*/
|
|
946
|
+
"inputMode"?: InputMode;
|
|
947
|
+
/**
|
|
948
|
+
* Mark the field as invalid (consumer-controlled)
|
|
949
|
+
* @default false
|
|
950
|
+
*/
|
|
951
|
+
"invalid"?: boolean;
|
|
952
|
+
/**
|
|
953
|
+
* Floating or fixed label text
|
|
954
|
+
* @default ''
|
|
955
|
+
*/
|
|
956
|
+
"label"?: string;
|
|
957
|
+
/**
|
|
958
|
+
* Max character length
|
|
959
|
+
*/
|
|
960
|
+
"maxlength"?: number;
|
|
961
|
+
/**
|
|
962
|
+
* Apply thousand separator formatting (e.g. 1,000,000)
|
|
963
|
+
* @default false
|
|
964
|
+
*/
|
|
965
|
+
"moneyFormat"?: boolean;
|
|
966
|
+
/**
|
|
967
|
+
* Name attribute for native form submission
|
|
968
|
+
* @default ''
|
|
969
|
+
*/
|
|
970
|
+
"name"?: string;
|
|
971
|
+
/**
|
|
972
|
+
* Emitted on blur
|
|
973
|
+
*/
|
|
974
|
+
"onDropiBlur"?: (event: DropiInputCustomEvent<void>) => void;
|
|
975
|
+
/**
|
|
976
|
+
* Emitted on blur with the final value
|
|
977
|
+
*/
|
|
978
|
+
"onDropiChange"?: (event: DropiInputCustomEvent<string>) => void;
|
|
979
|
+
/**
|
|
980
|
+
* Emitted on focus
|
|
981
|
+
*/
|
|
982
|
+
"onDropiFocus"?: (event: DropiInputCustomEvent<void>) => void;
|
|
983
|
+
/**
|
|
984
|
+
* Emitted on every keystroke with the current value
|
|
985
|
+
*/
|
|
986
|
+
"onDropiInput"?: (event: DropiInputCustomEvent<string>) => void;
|
|
987
|
+
/**
|
|
988
|
+
* Only allow letter characters
|
|
989
|
+
* @default false
|
|
990
|
+
*/
|
|
991
|
+
"onlyLetters"?: boolean;
|
|
992
|
+
/**
|
|
993
|
+
* Only allow numeric characters
|
|
994
|
+
* @default false
|
|
995
|
+
*/
|
|
996
|
+
"onlyNumbers"?: boolean;
|
|
997
|
+
/**
|
|
998
|
+
* Show password visibility toggle (renders as password field)
|
|
999
|
+
* @default false
|
|
1000
|
+
*/
|
|
1001
|
+
"passwordInput"?: boolean;
|
|
1002
|
+
/**
|
|
1003
|
+
* Placeholder text (visible in fixedLabel mode or on focus)
|
|
1004
|
+
* @default ' '
|
|
1005
|
+
*/
|
|
1006
|
+
"placeholder"?: string;
|
|
1007
|
+
/**
|
|
1008
|
+
* Mark as required (shows asterisk when showAsterisk is true)
|
|
1009
|
+
* @default false
|
|
1010
|
+
*/
|
|
1011
|
+
"required"?: boolean;
|
|
1012
|
+
/**
|
|
1013
|
+
* Show the required asterisk on the label
|
|
1014
|
+
* @default true
|
|
1015
|
+
*/
|
|
1016
|
+
"showAsterisk"?: boolean;
|
|
1017
|
+
/**
|
|
1018
|
+
* Only show helperText when the field is invalid
|
|
1019
|
+
* @default false
|
|
1020
|
+
*/
|
|
1021
|
+
"showHelperOnlyOnError"?: boolean;
|
|
1022
|
+
/**
|
|
1023
|
+
* Apply thousand separator without currency symbol
|
|
1024
|
+
* @default false
|
|
1025
|
+
*/
|
|
1026
|
+
"thousandSeparator"?: boolean;
|
|
1027
|
+
/**
|
|
1028
|
+
* Current value (controlled)
|
|
1029
|
+
* @default ''
|
|
1030
|
+
*/
|
|
1031
|
+
"value"?: string;
|
|
1032
|
+
}
|
|
1033
|
+
/**
|
|
1034
|
+
* @component dropi-radio-button
|
|
1035
|
+
* Styled radio button with label.
|
|
1036
|
+
*/
|
|
1037
|
+
interface DropiRadioButton {
|
|
1038
|
+
/**
|
|
1039
|
+
* Whether this radio is selected
|
|
1040
|
+
* @default false
|
|
1041
|
+
*/
|
|
1042
|
+
"checked"?: boolean;
|
|
1043
|
+
/**
|
|
1044
|
+
* If `true`, the user cannot interact with the element.
|
|
1045
|
+
*/
|
|
1046
|
+
"disabled"?: boolean;
|
|
1047
|
+
/**
|
|
1048
|
+
* The `id` of a `<form>` element to associate this element with.
|
|
1049
|
+
*/
|
|
1050
|
+
"form"?: string;
|
|
1051
|
+
/**
|
|
1052
|
+
* Input id
|
|
1053
|
+
* @default 'radioButton'
|
|
1054
|
+
*/
|
|
1055
|
+
"inputId"?: string;
|
|
1056
|
+
/**
|
|
1057
|
+
* Label text displayed next to the radio
|
|
1058
|
+
* @default ''
|
|
1059
|
+
*/
|
|
1060
|
+
"label"?: string;
|
|
1061
|
+
/**
|
|
1062
|
+
* Input name (for grouping radio buttons)
|
|
1063
|
+
* @default 'radio'
|
|
1064
|
+
*/
|
|
1065
|
+
"name"?: string;
|
|
1066
|
+
/**
|
|
1067
|
+
* Emitted when the radio is selected
|
|
1068
|
+
*/
|
|
1069
|
+
"onDropiChange"?: (event: DropiRadioButtonCustomEvent<Event>) => void;
|
|
1070
|
+
/**
|
|
1071
|
+
* Set to true to programmatically reset this radio to unchecked. Useful when the parent needs to clear a group.
|
|
1072
|
+
* @default false
|
|
1073
|
+
*/
|
|
1074
|
+
"resetTrigger"?: boolean;
|
|
1075
|
+
}
|
|
1076
|
+
/**
|
|
1077
|
+
* @component dropi-select
|
|
1078
|
+
* Feature-rich select with support for:
|
|
1079
|
+
* - Single / multi select
|
|
1080
|
+
* - Grouped options
|
|
1081
|
+
* - Search / filter
|
|
1082
|
+
* - Country flags
|
|
1083
|
+
* - Radio-style options with images
|
|
1084
|
+
* - Inline (dropdownType) or bordered trigger
|
|
1085
|
+
* - Native form association
|
|
1086
|
+
* ## Usage
|
|
1087
|
+
* Options must be set via JS property (not HTML attribute) for object arrays:
|
|
1088
|
+
* ```js
|
|
1089
|
+
* document.querySelector('dropi-select').options = [
|
|
1090
|
+
* { id: 1, label: 'Option A' },
|
|
1091
|
+
* { id: 2, label: 'Option B' },
|
|
1092
|
+
* ];
|
|
1093
|
+
* ```
|
|
1094
|
+
*/
|
|
1095
|
+
interface DropiSelect {
|
|
1096
|
+
/**
|
|
1097
|
+
* Pre-select an option by id
|
|
1098
|
+
* @default ''
|
|
1099
|
+
*/
|
|
1100
|
+
"defaultSelectedId"?: string | number;
|
|
1101
|
+
/**
|
|
1102
|
+
* @default false
|
|
1103
|
+
*/
|
|
1104
|
+
"disabled"?: boolean;
|
|
1105
|
+
/**
|
|
1106
|
+
* Renders trigger without border (inline/dropdown style)
|
|
1107
|
+
* @default false
|
|
1108
|
+
*/
|
|
1109
|
+
"dropdownType"?: boolean;
|
|
1110
|
+
/**
|
|
1111
|
+
* @default ''
|
|
1112
|
+
*/
|
|
1113
|
+
"errorText"?: string;
|
|
1114
|
+
/**
|
|
1115
|
+
* The `id` of a `<form>` element to associate this element with.
|
|
1116
|
+
*/
|
|
1117
|
+
"form"?: string;
|
|
1118
|
+
/**
|
|
1119
|
+
* @default ''
|
|
1120
|
+
*/
|
|
1121
|
+
"helperText"?: string;
|
|
1122
|
+
/**
|
|
1123
|
+
* @default false
|
|
1124
|
+
*/
|
|
1125
|
+
"invalid"?: boolean;
|
|
1126
|
+
/**
|
|
1127
|
+
* @default ''
|
|
1128
|
+
*/
|
|
1129
|
+
"label"?: string;
|
|
1130
|
+
/**
|
|
1131
|
+
* Allows selecting multiple options
|
|
1132
|
+
* @default false
|
|
1133
|
+
*/
|
|
1134
|
+
"multiSelect"?: boolean;
|
|
1135
|
+
/**
|
|
1136
|
+
* @default ''
|
|
1137
|
+
*/
|
|
1138
|
+
"name"?: string;
|
|
1139
|
+
/**
|
|
1140
|
+
* Emitted when an option is selected (single) or selection changes (multi)
|
|
1141
|
+
*/
|
|
1142
|
+
"onDropiChange"?: (event: DropiSelectCustomEvent<SelectOption | SelectOption[]>) => void;
|
|
1143
|
+
/**
|
|
1144
|
+
* Emitted when the selection is cleared
|
|
1145
|
+
*/
|
|
1146
|
+
"onDropiClear"?: (event: DropiSelectCustomEvent<void>) => void;
|
|
1147
|
+
/**
|
|
1148
|
+
* Emitted on Enter key inside search
|
|
1149
|
+
*/
|
|
1150
|
+
"onDropiKeyEnter"?: (event: DropiSelectCustomEvent<KeyboardEvent>) => void;
|
|
1151
|
+
/**
|
|
1152
|
+
* Emitted when the list is scrolled to the end
|
|
1153
|
+
*/
|
|
1154
|
+
"onDropiScrollEnd"?: (event: DropiSelectCustomEvent<void>) => void;
|
|
1155
|
+
/**
|
|
1156
|
+
* Emitted on search input
|
|
1157
|
+
*/
|
|
1158
|
+
"onDropiSearch"?: (event: DropiSelectCustomEvent<string>) => void;
|
|
1159
|
+
/**
|
|
1160
|
+
* Array of SelectOption or SelectOptionGroup
|
|
1161
|
+
* @default []
|
|
1162
|
+
*/
|
|
1163
|
+
"options"?: SelectOption[] | SelectOptionGroup[];
|
|
1164
|
+
/**
|
|
1165
|
+
* Placeholder inside the search field
|
|
1166
|
+
* @default 'Buscar'
|
|
1167
|
+
*/
|
|
1168
|
+
"placeHolderSearch"?: string;
|
|
1169
|
+
/**
|
|
1170
|
+
* @default 'Seleccionar'
|
|
1171
|
+
*/
|
|
1172
|
+
"placeholder"?: string;
|
|
1173
|
+
/**
|
|
1174
|
+
* Icon name shown before the trigger label
|
|
1175
|
+
* @default ''
|
|
1176
|
+
*/
|
|
1177
|
+
"preIcon"?: string;
|
|
1178
|
+
/**
|
|
1179
|
+
* Renders options as radio buttons with optional image
|
|
1180
|
+
* @default false
|
|
1181
|
+
*/
|
|
1182
|
+
"radioOptions"?: boolean;
|
|
1183
|
+
/**
|
|
1184
|
+
* Enables text search inside the dropdown
|
|
1185
|
+
* @default false
|
|
1186
|
+
*/
|
|
1187
|
+
"searchEnabled"?: boolean;
|
|
1188
|
+
/**
|
|
1189
|
+
* Show country flags next to option labels
|
|
1190
|
+
* @default false
|
|
1191
|
+
*/
|
|
1192
|
+
"showCountryFlags"?: boolean;
|
|
1193
|
+
/**
|
|
1194
|
+
* @default false
|
|
1195
|
+
*/
|
|
1196
|
+
"showObligatory"?: boolean;
|
|
1197
|
+
/**
|
|
1198
|
+
* Controlled selected option (single select)
|
|
1199
|
+
* @default null
|
|
1200
|
+
*/
|
|
1201
|
+
"value"?: SelectOption | null;
|
|
1202
|
+
}
|
|
1203
|
+
/**
|
|
1204
|
+
* @component dropi-switch
|
|
1205
|
+
* Toggle switch component. Emits dropiChange on toggle.
|
|
1206
|
+
*/
|
|
1207
|
+
interface DropiSwitch {
|
|
1208
|
+
/**
|
|
1209
|
+
* Whether the switch is disabled
|
|
1210
|
+
* @default false
|
|
1211
|
+
*/
|
|
1212
|
+
"disabled"?: boolean;
|
|
1213
|
+
/**
|
|
1214
|
+
* The `id` of a `<form>` element to associate this element with.
|
|
1215
|
+
*/
|
|
1216
|
+
"form"?: string;
|
|
1217
|
+
/**
|
|
1218
|
+
* Whether the switch is on
|
|
1219
|
+
* @default false
|
|
1220
|
+
*/
|
|
1221
|
+
"isChecked"?: boolean;
|
|
1222
|
+
/**
|
|
1223
|
+
* The name of the element, used when submitting an HTML form.
|
|
1224
|
+
*/
|
|
1225
|
+
"name"?: string;
|
|
1226
|
+
/**
|
|
1227
|
+
* Emitted when the toggle state changes
|
|
1228
|
+
*/
|
|
1229
|
+
"onDropiChange"?: (event: DropiSwitchCustomEvent<boolean>) => void;
|
|
1230
|
+
}
|
|
1231
|
+
/**
|
|
1232
|
+
* @component dropi-tag
|
|
1233
|
+
* Colored tag/chip for statuses, categories, and labels.
|
|
1234
|
+
*/
|
|
1235
|
+
interface DropiTag {
|
|
1236
|
+
/**
|
|
1237
|
+
* Icon name from the sprite
|
|
1238
|
+
* @default ''
|
|
1239
|
+
*/
|
|
1240
|
+
"icon"?: string;
|
|
1241
|
+
/**
|
|
1242
|
+
* Whether to show the icon
|
|
1243
|
+
* @default false
|
|
1244
|
+
*/
|
|
1245
|
+
"showIcon"?: boolean;
|
|
1246
|
+
/**
|
|
1247
|
+
* Color state of the tag
|
|
1248
|
+
* @default 'default'
|
|
1249
|
+
*/
|
|
1250
|
+
"state"?: TagState;
|
|
1251
|
+
/**
|
|
1252
|
+
* Label text
|
|
1253
|
+
* @default ''
|
|
1254
|
+
*/
|
|
1255
|
+
"text"?: string;
|
|
1256
|
+
/**
|
|
1257
|
+
* primary (filled) | secondary (soft)
|
|
1258
|
+
* @default 'primary'
|
|
1259
|
+
*/
|
|
1260
|
+
"type"?: TagType;
|
|
1261
|
+
}
|
|
1262
|
+
/**
|
|
1263
|
+
* @component dropi-text-area
|
|
1264
|
+
* Multi-line text area with label, char counter, validation states,
|
|
1265
|
+
* helper text, and native form association.
|
|
1266
|
+
*/
|
|
1267
|
+
interface DropiTextArea {
|
|
1268
|
+
/**
|
|
1269
|
+
* Disable the textarea
|
|
1270
|
+
* @default false
|
|
1271
|
+
*/
|
|
1272
|
+
"disabled"?: boolean;
|
|
1273
|
+
/**
|
|
1274
|
+
* The `id` of a `<form>` element to associate this element with.
|
|
1275
|
+
*/
|
|
1276
|
+
"form"?: string;
|
|
1277
|
+
/**
|
|
1278
|
+
* Helper / error text below the field
|
|
1279
|
+
* @default ''
|
|
1280
|
+
*/
|
|
1281
|
+
"helperText"?: string;
|
|
1282
|
+
/**
|
|
1283
|
+
* Input id. Defaults to label.
|
|
1284
|
+
* @default ''
|
|
1285
|
+
*/
|
|
1286
|
+
"inputId"?: string;
|
|
1287
|
+
/**
|
|
1288
|
+
* Mark the field as invalid (consumer-controlled)
|
|
1289
|
+
* @default false
|
|
1290
|
+
*/
|
|
1291
|
+
"invalid"?: boolean;
|
|
1292
|
+
/**
|
|
1293
|
+
* Label shown above the textarea
|
|
1294
|
+
* @default ''
|
|
1295
|
+
*/
|
|
1296
|
+
"label"?: string;
|
|
1297
|
+
/**
|
|
1298
|
+
* Max character length
|
|
1299
|
+
*/
|
|
1300
|
+
"maxlength"?: number;
|
|
1301
|
+
/**
|
|
1302
|
+
* Min character length
|
|
1303
|
+
* @default 0
|
|
1304
|
+
*/
|
|
1305
|
+
"minlength"?: number;
|
|
1306
|
+
/**
|
|
1307
|
+
* Name for native form submission
|
|
1308
|
+
* @default ''
|
|
1309
|
+
*/
|
|
1310
|
+
"name"?: string;
|
|
1311
|
+
"onDropiBlur"?: (event: DropiTextAreaCustomEvent<void>) => void;
|
|
1312
|
+
/**
|
|
1313
|
+
* Emitted on blur
|
|
1314
|
+
*/
|
|
1315
|
+
"onDropiChange"?: (event: DropiTextAreaCustomEvent<string>) => void;
|
|
1316
|
+
"onDropiFocus"?: (event: DropiTextAreaCustomEvent<void>) => void;
|
|
1317
|
+
/**
|
|
1318
|
+
* Emitted on every keystroke
|
|
1319
|
+
*/
|
|
1320
|
+
"onDropiInput"?: (event: DropiTextAreaCustomEvent<string>) => void;
|
|
1321
|
+
/**
|
|
1322
|
+
* Placeholder text
|
|
1323
|
+
* @default ''
|
|
1324
|
+
*/
|
|
1325
|
+
"placeholder"?: string;
|
|
1326
|
+
/**
|
|
1327
|
+
* Mark as required
|
|
1328
|
+
* @default false
|
|
1329
|
+
*/
|
|
1330
|
+
"required"?: boolean;
|
|
1331
|
+
/**
|
|
1332
|
+
* Resize behavior
|
|
1333
|
+
* @default 'vertical'
|
|
1334
|
+
*/
|
|
1335
|
+
"resize"?: ResizeMode;
|
|
1336
|
+
/**
|
|
1337
|
+
* Number of visible rows
|
|
1338
|
+
* @default 4
|
|
1339
|
+
*/
|
|
1340
|
+
"rows"?: number;
|
|
1341
|
+
/**
|
|
1342
|
+
* Show the required asterisk
|
|
1343
|
+
* @default false
|
|
1344
|
+
*/
|
|
1345
|
+
"showAsterisk"?: boolean;
|
|
1346
|
+
/**
|
|
1347
|
+
* Current value (controlled)
|
|
1348
|
+
* @default ''
|
|
1349
|
+
*/
|
|
1350
|
+
"value"?: string;
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
interface DropiBadgeAttributes {
|
|
1354
|
+
"state": BadgeState;
|
|
1355
|
+
}
|
|
1356
|
+
interface DropiButtonAttributes {
|
|
1357
|
+
"type": ButtonType;
|
|
1358
|
+
"severity": ButtonSeverity;
|
|
1359
|
+
"size": ButtonSize;
|
|
1360
|
+
"state": ButtonState;
|
|
1361
|
+
"preIcon": string;
|
|
1362
|
+
"postIcon": string;
|
|
1363
|
+
"text": string;
|
|
1364
|
+
}
|
|
1365
|
+
interface DropiCheckboxAttributes {
|
|
1366
|
+
"checked": boolean;
|
|
1367
|
+
"disabled": boolean;
|
|
1368
|
+
}
|
|
1369
|
+
interface DropiIconAttributes {
|
|
1370
|
+
"name": string;
|
|
1371
|
+
"width": string;
|
|
1372
|
+
"height": string;
|
|
1373
|
+
"color": string;
|
|
1374
|
+
}
|
|
1375
|
+
interface DropiInputAttributes {
|
|
1376
|
+
"inputId": string;
|
|
1377
|
+
"name": string;
|
|
1378
|
+
"label": string;
|
|
1379
|
+
"placeholder": string;
|
|
1380
|
+
"value": string;
|
|
1381
|
+
"maxlength": number;
|
|
1382
|
+
"disabled": boolean;
|
|
1383
|
+
"required": boolean;
|
|
1384
|
+
"showAsterisk": boolean;
|
|
1385
|
+
"fixedLabel": boolean;
|
|
1386
|
+
"inputMode": InputMode;
|
|
1387
|
+
"passwordInput": boolean;
|
|
1388
|
+
"moneyFormat": boolean;
|
|
1389
|
+
"thousandSeparator": boolean;
|
|
1390
|
+
"onlyNumbers": boolean;
|
|
1391
|
+
"allowDecimals": boolean;
|
|
1392
|
+
"onlyLetters": boolean;
|
|
1393
|
+
"icon": string;
|
|
1394
|
+
"iconColor": string;
|
|
1395
|
+
"invalid": boolean;
|
|
1396
|
+
"helperText": string;
|
|
1397
|
+
"showHelperOnlyOnError": boolean;
|
|
1398
|
+
}
|
|
1399
|
+
interface DropiRadioButtonAttributes {
|
|
1400
|
+
"label": string;
|
|
1401
|
+
"name": string;
|
|
1402
|
+
"inputId": string;
|
|
1403
|
+
"checked": boolean;
|
|
1404
|
+
"resetTrigger": boolean;
|
|
1405
|
+
}
|
|
1406
|
+
interface DropiSelectAttributes {
|
|
1407
|
+
"label": string;
|
|
1408
|
+
"placeholder": string;
|
|
1409
|
+
"name": string;
|
|
1410
|
+
"disabled": boolean;
|
|
1411
|
+
"invalid": boolean;
|
|
1412
|
+
"errorText": string;
|
|
1413
|
+
"helperText": string;
|
|
1414
|
+
"showObligatory": boolean;
|
|
1415
|
+
"searchEnabled": boolean;
|
|
1416
|
+
"multiSelect": boolean;
|
|
1417
|
+
"dropdownType": boolean;
|
|
1418
|
+
"showCountryFlags": boolean;
|
|
1419
|
+
"radioOptions": boolean;
|
|
1420
|
+
"placeHolderSearch": string;
|
|
1421
|
+
"preIcon": string;
|
|
1422
|
+
"defaultSelectedId": string;
|
|
1423
|
+
}
|
|
1424
|
+
interface DropiSwitchAttributes {
|
|
1425
|
+
"isChecked": boolean;
|
|
1426
|
+
"disabled": boolean;
|
|
1427
|
+
}
|
|
1428
|
+
interface DropiTagAttributes {
|
|
1429
|
+
"type": TagType;
|
|
1430
|
+
"state": TagState;
|
|
1431
|
+
"showIcon": boolean;
|
|
1432
|
+
"icon": string;
|
|
1433
|
+
"text": string;
|
|
1434
|
+
}
|
|
1435
|
+
interface DropiTextAreaAttributes {
|
|
1436
|
+
"inputId": string;
|
|
1437
|
+
"name": string;
|
|
1438
|
+
"label": string;
|
|
1439
|
+
"placeholder": string;
|
|
1440
|
+
"value": string;
|
|
1441
|
+
"maxlength": number;
|
|
1442
|
+
"minlength": number;
|
|
1443
|
+
"rows": number;
|
|
1444
|
+
"resize": ResizeMode;
|
|
1445
|
+
"disabled": boolean;
|
|
1446
|
+
"required": boolean;
|
|
1447
|
+
"showAsterisk": boolean;
|
|
1448
|
+
"helperText": string;
|
|
1449
|
+
"invalid": boolean;
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
interface IntrinsicElements {
|
|
1453
|
+
"dropi-badge": Omit<DropiBadge, keyof DropiBadgeAttributes> & { [K in keyof DropiBadge & keyof DropiBadgeAttributes]?: DropiBadge[K] } & { [K in keyof DropiBadge & keyof DropiBadgeAttributes as `attr:${K}`]?: DropiBadgeAttributes[K] } & { [K in keyof DropiBadge & keyof DropiBadgeAttributes as `prop:${K}`]?: DropiBadge[K] };
|
|
1454
|
+
"dropi-button": Omit<DropiButton, keyof DropiButtonAttributes> & { [K in keyof DropiButton & keyof DropiButtonAttributes]?: DropiButton[K] } & { [K in keyof DropiButton & keyof DropiButtonAttributes as `attr:${K}`]?: DropiButtonAttributes[K] } & { [K in keyof DropiButton & keyof DropiButtonAttributes as `prop:${K}`]?: DropiButton[K] };
|
|
1455
|
+
"dropi-checkbox": Omit<DropiCheckbox, keyof DropiCheckboxAttributes> & { [K in keyof DropiCheckbox & keyof DropiCheckboxAttributes]?: DropiCheckbox[K] } & { [K in keyof DropiCheckbox & keyof DropiCheckboxAttributes as `attr:${K}`]?: DropiCheckboxAttributes[K] } & { [K in keyof DropiCheckbox & keyof DropiCheckboxAttributes as `prop:${K}`]?: DropiCheckbox[K] };
|
|
1456
|
+
"dropi-icon": Omit<DropiIcon, keyof DropiIconAttributes> & { [K in keyof DropiIcon & keyof DropiIconAttributes]?: DropiIcon[K] } & { [K in keyof DropiIcon & keyof DropiIconAttributes as `attr:${K}`]?: DropiIconAttributes[K] } & { [K in keyof DropiIcon & keyof DropiIconAttributes as `prop:${K}`]?: DropiIcon[K] };
|
|
1457
|
+
"dropi-input": Omit<DropiInput, keyof DropiInputAttributes> & { [K in keyof DropiInput & keyof DropiInputAttributes]?: DropiInput[K] } & { [K in keyof DropiInput & keyof DropiInputAttributes as `attr:${K}`]?: DropiInputAttributes[K] } & { [K in keyof DropiInput & keyof DropiInputAttributes as `prop:${K}`]?: DropiInput[K] };
|
|
1458
|
+
"dropi-radio-button": Omit<DropiRadioButton, keyof DropiRadioButtonAttributes> & { [K in keyof DropiRadioButton & keyof DropiRadioButtonAttributes]?: DropiRadioButton[K] } & { [K in keyof DropiRadioButton & keyof DropiRadioButtonAttributes as `attr:${K}`]?: DropiRadioButtonAttributes[K] } & { [K in keyof DropiRadioButton & keyof DropiRadioButtonAttributes as `prop:${K}`]?: DropiRadioButton[K] };
|
|
1459
|
+
"dropi-select": Omit<DropiSelect, keyof DropiSelectAttributes> & { [K in keyof DropiSelect & keyof DropiSelectAttributes]?: DropiSelect[K] } & { [K in keyof DropiSelect & keyof DropiSelectAttributes as `attr:${K}`]?: DropiSelectAttributes[K] } & { [K in keyof DropiSelect & keyof DropiSelectAttributes as `prop:${K}`]?: DropiSelect[K] };
|
|
1460
|
+
"dropi-switch": Omit<DropiSwitch, keyof DropiSwitchAttributes> & { [K in keyof DropiSwitch & keyof DropiSwitchAttributes]?: DropiSwitch[K] } & { [K in keyof DropiSwitch & keyof DropiSwitchAttributes as `attr:${K}`]?: DropiSwitchAttributes[K] } & { [K in keyof DropiSwitch & keyof DropiSwitchAttributes as `prop:${K}`]?: DropiSwitch[K] };
|
|
1461
|
+
"dropi-tag": Omit<DropiTag, keyof DropiTagAttributes> & { [K in keyof DropiTag & keyof DropiTagAttributes]?: DropiTag[K] } & { [K in keyof DropiTag & keyof DropiTagAttributes as `attr:${K}`]?: DropiTagAttributes[K] } & { [K in keyof DropiTag & keyof DropiTagAttributes as `prop:${K}`]?: DropiTag[K] };
|
|
1462
|
+
"dropi-text-area": Omit<DropiTextArea, keyof DropiTextAreaAttributes> & { [K in keyof DropiTextArea & keyof DropiTextAreaAttributes]?: DropiTextArea[K] } & { [K in keyof DropiTextArea & keyof DropiTextAreaAttributes as `attr:${K}`]?: DropiTextAreaAttributes[K] } & { [K in keyof DropiTextArea & keyof DropiTextAreaAttributes as `prop:${K}`]?: DropiTextArea[K] };
|
|
1463
|
+
}
|
|
1464
|
+
}
|
|
1465
|
+
export { LocalJSX as JSX };
|
|
1466
|
+
declare module "@stencil/core" {
|
|
1467
|
+
export namespace JSX {
|
|
1468
|
+
interface IntrinsicElements {
|
|
1469
|
+
/**
|
|
1470
|
+
* @component dropi-badge
|
|
1471
|
+
* Status badge for user/account states.
|
|
1472
|
+
*/
|
|
1473
|
+
"dropi-badge": LocalJSX.IntrinsicElements["dropi-badge"] & JSXBase.HTMLAttributes<HTMLDropiBadgeElement>;
|
|
1474
|
+
/**
|
|
1475
|
+
* @component dropi-button
|
|
1476
|
+
* Primary action button with multiple types, severities, sizes and states.
|
|
1477
|
+
* Supports pre/post icons and a loading spinner.
|
|
1478
|
+
*/
|
|
1479
|
+
"dropi-button": LocalJSX.IntrinsicElements["dropi-button"] & JSXBase.HTMLAttributes<HTMLDropiButtonElement>;
|
|
1480
|
+
/**
|
|
1481
|
+
* @component dropi-checkbox
|
|
1482
|
+
* A styled checkbox that emits change events.
|
|
1483
|
+
* Supports form association via native `<input type="checkbox">` internals.
|
|
1484
|
+
*/
|
|
1485
|
+
"dropi-checkbox": LocalJSX.IntrinsicElements["dropi-checkbox"] & JSXBase.HTMLAttributes<HTMLDropiCheckboxElement>;
|
|
1486
|
+
/**
|
|
1487
|
+
* @component dropi-icon
|
|
1488
|
+
* Renders an SVG icon from the Dropi sprite sheet.
|
|
1489
|
+
* The sprite must be available at `assets/icons/sprite.svg`.
|
|
1490
|
+
*/
|
|
1491
|
+
"dropi-icon": LocalJSX.IntrinsicElements["dropi-icon"] & JSXBase.HTMLAttributes<HTMLDropiIconElement>;
|
|
1492
|
+
/**
|
|
1493
|
+
* @component dropi-input
|
|
1494
|
+
* Text input with floating label, validation states, password toggle,
|
|
1495
|
+
* number/letter restrictions, thousand separator, and native form association.
|
|
1496
|
+
* ## Form usage (native HTML form)
|
|
1497
|
+
* ```html
|
|
1498
|
+
* <form>
|
|
1499
|
+
* <dropi-input name="email" label="Email" required></dropi-input>
|
|
1500
|
+
* </form>
|
|
1501
|
+
* ```
|
|
1502
|
+
* ## Controlled usage (React / Vue / Angular)
|
|
1503
|
+
* Pass `value` and listen to `dropiInput` to update.
|
|
1504
|
+
*/
|
|
1505
|
+
"dropi-input": LocalJSX.IntrinsicElements["dropi-input"] & JSXBase.HTMLAttributes<HTMLDropiInputElement>;
|
|
1506
|
+
/**
|
|
1507
|
+
* @component dropi-radio-button
|
|
1508
|
+
* Styled radio button with label.
|
|
1509
|
+
*/
|
|
1510
|
+
"dropi-radio-button": LocalJSX.IntrinsicElements["dropi-radio-button"] & JSXBase.HTMLAttributes<HTMLDropiRadioButtonElement>;
|
|
1511
|
+
/**
|
|
1512
|
+
* @component dropi-select
|
|
1513
|
+
* Feature-rich select with support for:
|
|
1514
|
+
* - Single / multi select
|
|
1515
|
+
* - Grouped options
|
|
1516
|
+
* - Search / filter
|
|
1517
|
+
* - Country flags
|
|
1518
|
+
* - Radio-style options with images
|
|
1519
|
+
* - Inline (dropdownType) or bordered trigger
|
|
1520
|
+
* - Native form association
|
|
1521
|
+
* ## Usage
|
|
1522
|
+
* Options must be set via JS property (not HTML attribute) for object arrays:
|
|
1523
|
+
* ```js
|
|
1524
|
+
* document.querySelector('dropi-select').options = [
|
|
1525
|
+
* { id: 1, label: 'Option A' },
|
|
1526
|
+
* { id: 2, label: 'Option B' },
|
|
1527
|
+
* ];
|
|
1528
|
+
* ```
|
|
1529
|
+
*/
|
|
1530
|
+
"dropi-select": LocalJSX.IntrinsicElements["dropi-select"] & JSXBase.HTMLAttributes<HTMLDropiSelectElement>;
|
|
1531
|
+
/**
|
|
1532
|
+
* @component dropi-switch
|
|
1533
|
+
* Toggle switch component. Emits dropiChange on toggle.
|
|
1534
|
+
*/
|
|
1535
|
+
"dropi-switch": LocalJSX.IntrinsicElements["dropi-switch"] & JSXBase.HTMLAttributes<HTMLDropiSwitchElement>;
|
|
1536
|
+
/**
|
|
1537
|
+
* @component dropi-tag
|
|
1538
|
+
* Colored tag/chip for statuses, categories, and labels.
|
|
1539
|
+
*/
|
|
1540
|
+
"dropi-tag": LocalJSX.IntrinsicElements["dropi-tag"] & JSXBase.HTMLAttributes<HTMLDropiTagElement>;
|
|
1541
|
+
/**
|
|
1542
|
+
* @component dropi-text-area
|
|
1543
|
+
* Multi-line text area with label, char counter, validation states,
|
|
1544
|
+
* helper text, and native form association.
|
|
1545
|
+
*/
|
|
1546
|
+
"dropi-text-area": LocalJSX.IntrinsicElements["dropi-text-area"] & JSXBase.HTMLAttributes<HTMLDropiTextAreaElement>;
|
|
1547
|
+
}
|
|
1548
|
+
}
|
|
1549
|
+
}
|