@dropi/ui 0.1.16 → 0.1.18
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/assets/lottie-files/failure.json +1 -0
- package/assets/lottie-files/question.json +1 -0
- package/assets/lottie-files/success.json +1 -0
- package/assets/lottie-files/warning.json +1 -0
- package/dist/cjs/dropi-accordion.cjs.entry.js +53 -0
- package/dist/cjs/dropi-badge.cjs.entry.js +1 -1
- package/dist/cjs/dropi-button.cjs.entry.js +2 -2
- package/dist/cjs/dropi-checkbox.cjs.entry.js +3 -3
- package/dist/cjs/dropi-empty-state.cjs.entry.js +35 -0
- package/dist/cjs/dropi-icon.cjs.entry.js +3 -3
- package/dist/cjs/dropi-input.cjs.entry.js +2 -2
- package/dist/cjs/dropi-modal.cjs.entry.js +113 -0
- package/dist/cjs/dropi-paginator.cjs.entry.js +89 -0
- package/dist/cjs/dropi-radio-button.cjs.entry.js +2 -2
- package/dist/cjs/dropi-select.cjs.entry.js +2 -2
- package/dist/cjs/dropi-skeleton.cjs.entry.js +47 -0
- package/dist/cjs/dropi-switch.cjs.entry.js +2 -2
- package/dist/cjs/dropi-tabs.cjs.entry.js +49 -0
- package/dist/cjs/dropi-tag.cjs.entry.js +2 -2
- package/dist/cjs/dropi-text-area.cjs.entry.js +3 -3
- package/dist/cjs/dropi-toast.cjs.entry.js +55 -0
- package/dist/cjs/dropi-tooltip.cjs.entry.js +42 -0
- package/dist/cjs/dropi-ui.cjs.js +2 -2
- package/dist/cjs/{index-CuGLZVqo.js → index-B6R6Ojma.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +8 -0
- package/dist/collection/components/dropi-accordion/dropi-accordion.css +21 -0
- package/dist/collection/components/dropi-accordion/dropi-accordion.js +170 -0
- package/dist/collection/components/dropi-button/dropi-button.css +7 -1
- package/dist/collection/components/dropi-checkbox/dropi-checkbox.js +2 -2
- package/dist/collection/components/dropi-empty-state/dropi-empty-state.css +58 -0
- package/dist/collection/components/dropi-empty-state/dropi-empty-state.js +195 -0
- package/dist/collection/components/dropi-icon/dropi-icon.css +2 -0
- package/dist/collection/components/dropi-icon/dropi-icon.js +1 -1
- package/dist/collection/components/dropi-input/dropi-input.css +2 -0
- package/dist/collection/components/dropi-modal/dropi-modal.css +124 -0
- package/dist/collection/components/dropi-modal/dropi-modal.js +406 -0
- package/dist/collection/components/dropi-paginator/dropi-paginator.css +100 -0
- package/dist/collection/components/dropi-paginator/dropi-paginator.js +241 -0
- package/dist/collection/components/dropi-radio-button/dropi-radio-button.js +1 -1
- package/dist/collection/components/dropi-select/dropi-select.js +1 -1
- package/dist/collection/components/dropi-skeleton/dropi-skeleton.css +27 -0
- package/dist/collection/components/dropi-skeleton/dropi-skeleton.js +162 -0
- package/dist/collection/components/dropi-switch/dropi-switch.js +1 -1
- package/dist/collection/components/dropi-tabs/dropi-tabs.css +42 -0
- package/dist/collection/components/dropi-tabs/dropi-tabs.js +159 -0
- package/dist/collection/components/dropi-tag/dropi-tag.js +1 -1
- package/dist/collection/components/dropi-text-area/dropi-text-area.js +2 -2
- package/dist/collection/components/dropi-toast/dropi-toast.css +63 -0
- package/dist/collection/components/dropi-toast/dropi-toast.js +164 -0
- package/dist/collection/components/dropi-tooltip/dropi-tooltip.css +67 -0
- package/dist/collection/components/dropi-tooltip/dropi-tooltip.js +147 -0
- package/dist/components/dropi-accordion.d.ts +11 -0
- package/dist/components/dropi-accordion.js +1 -0
- package/dist/components/dropi-button.js +1 -1
- package/dist/components/dropi-checkbox.js +1 -1
- package/dist/components/dropi-empty-state.d.ts +11 -0
- package/dist/components/dropi-empty-state.js +1 -0
- package/dist/components/dropi-icon.js +1 -1
- package/dist/components/dropi-input.js +1 -1
- package/dist/components/dropi-modal.d.ts +11 -0
- package/dist/components/dropi-modal.js +1 -0
- package/dist/components/dropi-paginator.d.ts +11 -0
- package/dist/components/dropi-paginator.js +1 -0
- package/dist/components/dropi-radio-button.js +1 -1
- package/dist/components/dropi-select.js +1 -1
- package/dist/components/dropi-skeleton.d.ts +11 -0
- package/dist/components/dropi-skeleton.js +1 -0
- package/dist/components/dropi-switch.js +1 -1
- package/dist/components/dropi-tabs.d.ts +11 -0
- package/dist/components/dropi-tabs.js +1 -0
- package/dist/components/dropi-tag.js +1 -1
- package/dist/components/dropi-text-area.js +1 -1
- package/dist/components/dropi-toast.d.ts +11 -0
- package/dist/components/dropi-toast.js +1 -0
- package/dist/components/dropi-tooltip.d.ts +11 -0
- package/dist/components/dropi-tooltip.js +1 -0
- package/dist/components/index.js +1 -1
- package/dist/components/{p-MNma8N1x.js → p-ChOXWKmI.js} +1 -1
- package/dist/components/p-NCyvfOs2.js +1 -0
- package/dist/dropi-ui/dropi-ui.css +1 -1
- package/dist/dropi-ui/dropi-ui.esm.js +1 -1
- package/dist/dropi-ui/p-082b7039.entry.js +1 -0
- package/dist/dropi-ui/p-09c38a49.entry.js +1 -0
- package/dist/dropi-ui/p-1739d20c.entry.js +1 -0
- package/dist/dropi-ui/{p-dd089a60.entry.js → p-26dbae0d.entry.js} +1 -1
- package/dist/dropi-ui/p-42179ae4.entry.js +1 -0
- package/dist/dropi-ui/p-4d582d58.entry.js +1 -0
- package/dist/dropi-ui/p-6031ac9d.entry.js +1 -0
- package/dist/dropi-ui/{p-bda1427f.entry.js → p-63e969da.entry.js} +1 -1
- package/dist/dropi-ui/p-65fa8558.entry.js +1 -0
- package/dist/dropi-ui/{p-52291024.entry.js → p-6d15d32f.entry.js} +1 -1
- package/dist/dropi-ui/{p-0faaab2b.entry.js → p-79466fec.entry.js} +1 -1
- package/dist/dropi-ui/p-Twbb5MNM.js +2 -0
- package/dist/dropi-ui/p-a5650d8f.entry.js +1 -0
- package/dist/dropi-ui/p-b0d3442e.entry.js +1 -0
- package/dist/dropi-ui/{p-f785011f.entry.js → p-e44242e2.entry.js} +1 -1
- package/dist/dropi-ui/{p-a46a05a6.entry.js → p-eb7f9a57.entry.js} +1 -1
- package/dist/dropi-ui/{p-a1944f3d.entry.js → p-ecda6e19.entry.js} +1 -1
- package/dist/dropi-ui/{p-9c7076d3.entry.js → p-f0e1e0f6.entry.js} +1 -1
- package/dist/dropi-ui/p-f283f41d.entry.js +1 -0
- package/dist/esm/dropi-accordion.entry.js +51 -0
- package/dist/esm/dropi-badge.entry.js +1 -1
- package/dist/esm/dropi-button.entry.js +2 -2
- package/dist/esm/dropi-checkbox.entry.js +3 -3
- package/dist/esm/dropi-empty-state.entry.js +33 -0
- package/dist/esm/dropi-icon.entry.js +3 -3
- package/dist/esm/dropi-input.entry.js +2 -2
- package/dist/esm/dropi-modal.entry.js +111 -0
- package/dist/esm/dropi-paginator.entry.js +87 -0
- package/dist/esm/dropi-radio-button.entry.js +2 -2
- package/dist/esm/dropi-select.entry.js +2 -2
- package/dist/esm/dropi-skeleton.entry.js +45 -0
- package/dist/esm/dropi-switch.entry.js +2 -2
- package/dist/esm/dropi-tabs.entry.js +47 -0
- package/dist/esm/dropi-tag.entry.js +2 -2
- package/dist/esm/dropi-text-area.entry.js +3 -3
- package/dist/esm/dropi-toast.entry.js +53 -0
- package/dist/esm/dropi-tooltip.entry.js +40 -0
- package/dist/esm/dropi-ui.js +3 -3
- package/dist/esm/{index-DFz-gwFP.js → index-Twbb5MNM.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/dropi-accordion/dropi-accordion.d.ts +29 -0
- package/dist/types/components/dropi-empty-state/dropi-empty-state.d.ts +24 -0
- package/dist/types/components/dropi-modal/dropi-modal.d.ts +37 -0
- package/dist/types/components/dropi-paginator/dropi-paginator.d.ts +32 -0
- package/dist/types/components/dropi-skeleton/dropi-skeleton.d.ts +19 -0
- package/dist/types/components/dropi-tabs/dropi-tabs.d.ts +38 -0
- package/dist/types/components/dropi-toast/dropi-toast.d.ts +38 -0
- package/dist/types/components/dropi-tooltip/dropi-tooltip.d.ts +25 -0
- package/dist/types/components.d.ts +832 -0
- package/package.json +1 -1
- package/readme.md +189 -2
- package/scripts/setup.js +48 -19
- package/dist/dropi-ui/p-21abf91a.entry.js +0 -1
- package/dist/dropi-ui/p-6f0aa619.entry.js +0 -1
- package/dist/dropi-ui/p-DFz-gwFP.js +0 -2
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* @component dropi-paginator
|
|
4
|
+
* Pagination control with page numbers, prev/next buttons and items-per-page selector.
|
|
5
|
+
*/
|
|
6
|
+
export class DropiPaginator {
|
|
7
|
+
/** Total number of items */
|
|
8
|
+
total = 0;
|
|
9
|
+
/** Items per page */
|
|
10
|
+
pageSize = 10;
|
|
11
|
+
/** Current page (1-based) */
|
|
12
|
+
page = 1;
|
|
13
|
+
/** Max page buttons to show at once */
|
|
14
|
+
maxPages = 5;
|
|
15
|
+
/** Whether to show the items-per-page selector */
|
|
16
|
+
showPageSizeSelector = false;
|
|
17
|
+
/** Options for items per page */
|
|
18
|
+
pageSizeOptions = [10, 25, 50, 100];
|
|
19
|
+
/** Emitted when page changes. e.detail = { page, pageSize } */
|
|
20
|
+
dropiPageChange;
|
|
21
|
+
parsedOptions = [10, 25, 50, 100];
|
|
22
|
+
optionsChanged(val) {
|
|
23
|
+
this.parsedOptions = typeof val === 'string' ? JSON.parse(val) : val;
|
|
24
|
+
}
|
|
25
|
+
componentWillLoad() {
|
|
26
|
+
this.optionsChanged(this.pageSizeOptions);
|
|
27
|
+
}
|
|
28
|
+
get totalPages() {
|
|
29
|
+
return Math.max(1, Math.ceil(this.total / this.pageSize));
|
|
30
|
+
}
|
|
31
|
+
get pageNumbers() {
|
|
32
|
+
const total = this.totalPages;
|
|
33
|
+
const cur = this.page;
|
|
34
|
+
const max = this.maxPages;
|
|
35
|
+
if (total <= max)
|
|
36
|
+
return Array.from({ length: total }, (_, i) => i + 1);
|
|
37
|
+
const half = Math.floor(max / 2);
|
|
38
|
+
let start = Math.max(1, cur - half);
|
|
39
|
+
let end = Math.min(total, start + max - 1);
|
|
40
|
+
if (end - start < max - 1)
|
|
41
|
+
start = Math.max(1, end - max + 1);
|
|
42
|
+
const pages = [];
|
|
43
|
+
if (start > 1) {
|
|
44
|
+
pages.push(1);
|
|
45
|
+
if (start > 2)
|
|
46
|
+
pages.push('...');
|
|
47
|
+
}
|
|
48
|
+
for (let i = start; i <= end; i++)
|
|
49
|
+
pages.push(i);
|
|
50
|
+
if (end < total) {
|
|
51
|
+
if (end < total - 1)
|
|
52
|
+
pages.push('...');
|
|
53
|
+
pages.push(total);
|
|
54
|
+
}
|
|
55
|
+
return pages;
|
|
56
|
+
}
|
|
57
|
+
goTo(p) {
|
|
58
|
+
if (p < 1 || p > this.totalPages || p === this.page)
|
|
59
|
+
return;
|
|
60
|
+
this.page = p;
|
|
61
|
+
this.dropiPageChange.emit({ page: this.page, pageSize: this.pageSize });
|
|
62
|
+
}
|
|
63
|
+
onPageSizeChange(e) {
|
|
64
|
+
this.pageSize = Number(e.target.value);
|
|
65
|
+
this.page = 1;
|
|
66
|
+
this.dropiPageChange.emit({ page: this.page, pageSize: this.pageSize });
|
|
67
|
+
}
|
|
68
|
+
render() {
|
|
69
|
+
const pages = this.pageNumbers;
|
|
70
|
+
const isFirst = this.page <= 1;
|
|
71
|
+
const isLast = this.page >= this.totalPages;
|
|
72
|
+
return (h("div", { key: '3fbb545d6ff0b345da7698e51bfdee51a13de49e', class: "paginator" }, this.showPageSizeSelector && (h("div", { key: '7ae643988a60f2016dce24b53bb9f5ac13414cf0', class: "paginator-size" }, h("span", { key: 'fee6db32b0d13e6c455174f1c57fb35401e65c10', class: "paginator-size-label" }, "Por p\u00E1gina:"), h("select", { key: '0e37733de81c70ac274c8e89af65f0f94115ecb5', class: "paginator-size-select", onChange: (e) => this.onPageSizeChange(e) }, this.parsedOptions.map(opt => (h("option", { value: opt, selected: opt === this.pageSize }, opt)))))), h("div", { key: 'fb70589d0fd3d8072190099fe187359439707dc1', class: "paginator-pages" }, h("button", { key: '6348dda14005ed8dcd3e96d788715bbd5a9d432e', class: { 'paginator-btn': true, 'paginator-btn--arrow': true }, disabled: isFirst, onClick: () => this.goTo(this.page - 1), "aria-label": "Anterior" }, h("dropi-icon", { key: '2b2c17304b3c246a660b71f5ab5feedfb93ba044', name: "Dropdown-left", width: "16px", height: "16px", color: isFirst ? 'Gray-Gray-300' : 'Gray-Gray-600' })), pages.map((p, i) => p === '...'
|
|
73
|
+
? h("span", { class: "paginator-ellipsis", key: `e${i}` }, "\u2026")
|
|
74
|
+
: h("button", { key: p, class: { 'paginator-btn': true, 'paginator-btn--active': p === this.page }, onClick: () => this.goTo(p), "aria-current": p === this.page ? 'page' : undefined }, p)), h("button", { key: 'fea38306411fd4a73f35231ff632d8846301dd5f', class: { 'paginator-btn': true, 'paginator-btn--arrow': true }, disabled: isLast, onClick: () => this.goTo(this.page + 1), "aria-label": "Siguiente" }, h("dropi-icon", { key: 'f7ed587cb578ef0b9872f290cdc17eebe2f9efeb', name: "Dropdown-Right", width: "16px", height: "16px", color: isLast ? 'Gray-Gray-300' : 'Gray-Gray-600' })))));
|
|
75
|
+
}
|
|
76
|
+
static get is() { return "dropi-paginator"; }
|
|
77
|
+
static get encapsulation() { return "shadow"; }
|
|
78
|
+
static get originalStyleUrls() {
|
|
79
|
+
return {
|
|
80
|
+
"$": ["dropi-paginator.css"]
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
static get styleUrls() {
|
|
84
|
+
return {
|
|
85
|
+
"$": ["dropi-paginator.css"]
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
static get properties() {
|
|
89
|
+
return {
|
|
90
|
+
"total": {
|
|
91
|
+
"type": "number",
|
|
92
|
+
"mutable": false,
|
|
93
|
+
"complexType": {
|
|
94
|
+
"original": "number",
|
|
95
|
+
"resolved": "number",
|
|
96
|
+
"references": {}
|
|
97
|
+
},
|
|
98
|
+
"required": false,
|
|
99
|
+
"optional": false,
|
|
100
|
+
"docs": {
|
|
101
|
+
"tags": [],
|
|
102
|
+
"text": "Total number of items"
|
|
103
|
+
},
|
|
104
|
+
"getter": false,
|
|
105
|
+
"setter": false,
|
|
106
|
+
"reflect": false,
|
|
107
|
+
"attribute": "total",
|
|
108
|
+
"defaultValue": "0"
|
|
109
|
+
},
|
|
110
|
+
"pageSize": {
|
|
111
|
+
"type": "number",
|
|
112
|
+
"mutable": true,
|
|
113
|
+
"complexType": {
|
|
114
|
+
"original": "number",
|
|
115
|
+
"resolved": "number",
|
|
116
|
+
"references": {}
|
|
117
|
+
},
|
|
118
|
+
"required": false,
|
|
119
|
+
"optional": false,
|
|
120
|
+
"docs": {
|
|
121
|
+
"tags": [],
|
|
122
|
+
"text": "Items per page"
|
|
123
|
+
},
|
|
124
|
+
"getter": false,
|
|
125
|
+
"setter": false,
|
|
126
|
+
"reflect": false,
|
|
127
|
+
"attribute": "page-size",
|
|
128
|
+
"defaultValue": "10"
|
|
129
|
+
},
|
|
130
|
+
"page": {
|
|
131
|
+
"type": "number",
|
|
132
|
+
"mutable": true,
|
|
133
|
+
"complexType": {
|
|
134
|
+
"original": "number",
|
|
135
|
+
"resolved": "number",
|
|
136
|
+
"references": {}
|
|
137
|
+
},
|
|
138
|
+
"required": false,
|
|
139
|
+
"optional": false,
|
|
140
|
+
"docs": {
|
|
141
|
+
"tags": [],
|
|
142
|
+
"text": "Current page (1-based)"
|
|
143
|
+
},
|
|
144
|
+
"getter": false,
|
|
145
|
+
"setter": false,
|
|
146
|
+
"reflect": true,
|
|
147
|
+
"attribute": "page",
|
|
148
|
+
"defaultValue": "1"
|
|
149
|
+
},
|
|
150
|
+
"maxPages": {
|
|
151
|
+
"type": "number",
|
|
152
|
+
"mutable": false,
|
|
153
|
+
"complexType": {
|
|
154
|
+
"original": "number",
|
|
155
|
+
"resolved": "number",
|
|
156
|
+
"references": {}
|
|
157
|
+
},
|
|
158
|
+
"required": false,
|
|
159
|
+
"optional": false,
|
|
160
|
+
"docs": {
|
|
161
|
+
"tags": [],
|
|
162
|
+
"text": "Max page buttons to show at once"
|
|
163
|
+
},
|
|
164
|
+
"getter": false,
|
|
165
|
+
"setter": false,
|
|
166
|
+
"reflect": false,
|
|
167
|
+
"attribute": "max-pages",
|
|
168
|
+
"defaultValue": "5"
|
|
169
|
+
},
|
|
170
|
+
"showPageSizeSelector": {
|
|
171
|
+
"type": "boolean",
|
|
172
|
+
"mutable": false,
|
|
173
|
+
"complexType": {
|
|
174
|
+
"original": "boolean",
|
|
175
|
+
"resolved": "boolean",
|
|
176
|
+
"references": {}
|
|
177
|
+
},
|
|
178
|
+
"required": false,
|
|
179
|
+
"optional": false,
|
|
180
|
+
"docs": {
|
|
181
|
+
"tags": [],
|
|
182
|
+
"text": "Whether to show the items-per-page selector"
|
|
183
|
+
},
|
|
184
|
+
"getter": false,
|
|
185
|
+
"setter": false,
|
|
186
|
+
"reflect": false,
|
|
187
|
+
"attribute": "show-page-size-selector",
|
|
188
|
+
"defaultValue": "false"
|
|
189
|
+
},
|
|
190
|
+
"pageSizeOptions": {
|
|
191
|
+
"type": "string",
|
|
192
|
+
"mutable": false,
|
|
193
|
+
"complexType": {
|
|
194
|
+
"original": "number[] | string",
|
|
195
|
+
"resolved": "number[] | string",
|
|
196
|
+
"references": {}
|
|
197
|
+
},
|
|
198
|
+
"required": false,
|
|
199
|
+
"optional": false,
|
|
200
|
+
"docs": {
|
|
201
|
+
"tags": [],
|
|
202
|
+
"text": "Options for items per page"
|
|
203
|
+
},
|
|
204
|
+
"getter": false,
|
|
205
|
+
"setter": false,
|
|
206
|
+
"reflect": false,
|
|
207
|
+
"attribute": "page-size-options",
|
|
208
|
+
"defaultValue": "[10, 25, 50, 100]"
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
static get states() {
|
|
213
|
+
return {
|
|
214
|
+
"parsedOptions": {}
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
static get events() {
|
|
218
|
+
return [{
|
|
219
|
+
"method": "dropiPageChange",
|
|
220
|
+
"name": "dropiPageChange",
|
|
221
|
+
"bubbles": true,
|
|
222
|
+
"cancelable": true,
|
|
223
|
+
"composed": true,
|
|
224
|
+
"docs": {
|
|
225
|
+
"tags": [],
|
|
226
|
+
"text": "Emitted when page changes. e.detail = { page, pageSize }"
|
|
227
|
+
},
|
|
228
|
+
"complexType": {
|
|
229
|
+
"original": "{ page: number; pageSize: number }",
|
|
230
|
+
"resolved": "{ page: number; pageSize: number; }",
|
|
231
|
+
"references": {}
|
|
232
|
+
}
|
|
233
|
+
}];
|
|
234
|
+
}
|
|
235
|
+
static get watchers() {
|
|
236
|
+
return [{
|
|
237
|
+
"propName": "pageSizeOptions",
|
|
238
|
+
"methodName": "optionsChanged"
|
|
239
|
+
}];
|
|
240
|
+
}
|
|
241
|
+
}
|
|
@@ -28,7 +28,7 @@ export class DropiRadioButton {
|
|
|
28
28
|
this.dropiChange.emit(e);
|
|
29
29
|
}
|
|
30
30
|
render() {
|
|
31
|
-
return (h("div", { key: '
|
|
31
|
+
return (h("div", { key: 'fd1153aa79130eeb865c0289b7e323bdf2459a8c', class: "dropi-radio-button" }, h("label", { key: 'b4fbe10ac36213905779f0976e2e80b549323a52', htmlFor: this.inputId }, h("input", { key: '8f9b74ed53912bdff637b879a50faf4d83b7d62b', id: this.inputId, type: "radio", name: this.name, checked: this.checked, onChange: (e) => this.handleChange(e) }), this.label)));
|
|
32
32
|
}
|
|
33
33
|
static get is() { return "dropi-radio-button"; }
|
|
34
34
|
static get encapsulation() { return "shadow"; }
|
|
@@ -315,7 +315,7 @@ export class DropiSelect {
|
|
|
315
315
|
]), !this.isGrouped && this.filteredOptions.map(opt => this.renderOption(opt)), this.filteredOptions.length === 0 && (h("li", { class: "no-results" }, "Sin resultados"))));
|
|
316
316
|
}
|
|
317
317
|
render() {
|
|
318
|
-
return (h("div", { key: '
|
|
318
|
+
return (h("div", { key: '0062ad3d0ca25d9126dff2f8130c9159a6b356f6', class: "custom-select" }, !this.dropdownType && this.label && (h("label", { key: 'ad5db5fa4fe19ee2200ab65fd1f3fcdf65bd851f', class: { 'disabled-label': this.disabled } }, this.label, this.showObligatory && !this.disabled && h("span", { key: '27e474c585d345168d01e156acf8fdaa9c70dbfc', class: "asterisk" }, " *"))), h("div", { key: '2cc4da6a0109022a7bdb21b4b7410cf1ea2a6c01', class: "dropdown-container" }, this.dropdownType && this.label && (h("div", { key: 'c60838f5ce7a250bb36164a989b68c93973aa661', class: "left-label" }, this.label)), this.renderTrigger()), this.helperText && !this.invalid && (h("div", { key: 'a30c3cb4f8abf4b820c1e1d73005547398c8ff12', class: "select-helper" }, h("span", { key: '239dffdcdc8bceca6c21b0160a78078acf96eb09' }, this.helperText))), this.invalid && this.errorText && (h("div", { key: '76fced13295c9dff83389920caf128430c2fd35c', class: "select-helper-error" }, h("dropi-icon", { key: 'f1c5798ee5f504387ba80a4ddeca817a6416b770', name: "Warning-circle", width: "12px", height: "12px", color: "Error-Error-500" }), h("span", { key: '84a93d1b293b2abe0027316c6fd9824410f20efd' }, this.errorText))), this.renderDropdown()));
|
|
319
319
|
}
|
|
320
320
|
static get is() { return "dropi-select"; }
|
|
321
321
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
*, *::before, *::after { box-sizing: border-box; }
|
|
6
|
+
|
|
7
|
+
.skeleton-lines {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
gap: 8px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.skeleton {
|
|
14
|
+
background: linear-gradient(
|
|
15
|
+
90deg,
|
|
16
|
+
var(--Gray-Gray-100, #e6eaf2) 25%,
|
|
17
|
+
var(--Gray-Gray-50, #f7f8fa) 50%,
|
|
18
|
+
var(--Gray-Gray-100, #e6eaf2) 75%
|
|
19
|
+
);
|
|
20
|
+
background-size: 200% 100%;
|
|
21
|
+
animation: shimmer 1.6s ease-in-out infinite;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@keyframes shimmer {
|
|
25
|
+
0% { background-position: 200% 0; }
|
|
26
|
+
100% { background-position: -200% 0; }
|
|
27
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* @component dropi-skeleton
|
|
4
|
+
* Loading placeholder with shimmer animation.
|
|
5
|
+
*/
|
|
6
|
+
export class DropiSkeleton {
|
|
7
|
+
/** Shape variant: 'text' | 'circle' | 'rect' */
|
|
8
|
+
variant = 'text';
|
|
9
|
+
/** Width (CSS value, e.g. "100%", "200px") */
|
|
10
|
+
width = '100%';
|
|
11
|
+
/** Height (CSS value, e.g. "16px", "48px") */
|
|
12
|
+
height = '16px';
|
|
13
|
+
/** Border radius override */
|
|
14
|
+
borderRadius = '';
|
|
15
|
+
/** Number of lines to repeat (text variant only) */
|
|
16
|
+
lines = 1;
|
|
17
|
+
getRadius() {
|
|
18
|
+
if (this.borderRadius)
|
|
19
|
+
return this.borderRadius;
|
|
20
|
+
if (this.variant === 'circle')
|
|
21
|
+
return '50%';
|
|
22
|
+
if (this.variant === 'text')
|
|
23
|
+
return '4px';
|
|
24
|
+
return 'var(--Border-1, 4px)';
|
|
25
|
+
}
|
|
26
|
+
render() {
|
|
27
|
+
if (this.variant === 'text' && this.lines > 1) {
|
|
28
|
+
return (h("div", { class: "skeleton-lines" }, Array.from({ length: this.lines }).map((_, i) => (h("div", { class: "skeleton", style: {
|
|
29
|
+
width: i === this.lines - 1 ? '70%' : this.width,
|
|
30
|
+
height: this.height,
|
|
31
|
+
borderRadius: this.getRadius(),
|
|
32
|
+
} })))));
|
|
33
|
+
}
|
|
34
|
+
return (h("div", { class: "skeleton", style: {
|
|
35
|
+
width: this.width,
|
|
36
|
+
height: this.height,
|
|
37
|
+
borderRadius: this.getRadius(),
|
|
38
|
+
} }));
|
|
39
|
+
}
|
|
40
|
+
static get is() { return "dropi-skeleton"; }
|
|
41
|
+
static get encapsulation() { return "shadow"; }
|
|
42
|
+
static get originalStyleUrls() {
|
|
43
|
+
return {
|
|
44
|
+
"$": ["dropi-skeleton.css"]
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
static get styleUrls() {
|
|
48
|
+
return {
|
|
49
|
+
"$": ["dropi-skeleton.css"]
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
static get properties() {
|
|
53
|
+
return {
|
|
54
|
+
"variant": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"mutable": false,
|
|
57
|
+
"complexType": {
|
|
58
|
+
"original": "SkeletonVariant",
|
|
59
|
+
"resolved": "\"circle\" | \"rect\" | \"text\"",
|
|
60
|
+
"references": {
|
|
61
|
+
"SkeletonVariant": {
|
|
62
|
+
"location": "local",
|
|
63
|
+
"path": "/Users/mac-ti/Documents/dropi/dropi-ui/src/components/dropi-skeleton/dropi-skeleton.tsx",
|
|
64
|
+
"id": "src/components/dropi-skeleton/dropi-skeleton.tsx::SkeletonVariant"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"required": false,
|
|
69
|
+
"optional": false,
|
|
70
|
+
"docs": {
|
|
71
|
+
"tags": [],
|
|
72
|
+
"text": "Shape variant: 'text' | 'circle' | 'rect'"
|
|
73
|
+
},
|
|
74
|
+
"getter": false,
|
|
75
|
+
"setter": false,
|
|
76
|
+
"reflect": false,
|
|
77
|
+
"attribute": "variant",
|
|
78
|
+
"defaultValue": "'text'"
|
|
79
|
+
},
|
|
80
|
+
"width": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"mutable": false,
|
|
83
|
+
"complexType": {
|
|
84
|
+
"original": "string",
|
|
85
|
+
"resolved": "string",
|
|
86
|
+
"references": {}
|
|
87
|
+
},
|
|
88
|
+
"required": false,
|
|
89
|
+
"optional": false,
|
|
90
|
+
"docs": {
|
|
91
|
+
"tags": [],
|
|
92
|
+
"text": "Width (CSS value, e.g. \"100%\", \"200px\")"
|
|
93
|
+
},
|
|
94
|
+
"getter": false,
|
|
95
|
+
"setter": false,
|
|
96
|
+
"reflect": false,
|
|
97
|
+
"attribute": "width",
|
|
98
|
+
"defaultValue": "'100%'"
|
|
99
|
+
},
|
|
100
|
+
"height": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"mutable": false,
|
|
103
|
+
"complexType": {
|
|
104
|
+
"original": "string",
|
|
105
|
+
"resolved": "string",
|
|
106
|
+
"references": {}
|
|
107
|
+
},
|
|
108
|
+
"required": false,
|
|
109
|
+
"optional": false,
|
|
110
|
+
"docs": {
|
|
111
|
+
"tags": [],
|
|
112
|
+
"text": "Height (CSS value, e.g. \"16px\", \"48px\")"
|
|
113
|
+
},
|
|
114
|
+
"getter": false,
|
|
115
|
+
"setter": false,
|
|
116
|
+
"reflect": false,
|
|
117
|
+
"attribute": "height",
|
|
118
|
+
"defaultValue": "'16px'"
|
|
119
|
+
},
|
|
120
|
+
"borderRadius": {
|
|
121
|
+
"type": "string",
|
|
122
|
+
"mutable": false,
|
|
123
|
+
"complexType": {
|
|
124
|
+
"original": "string",
|
|
125
|
+
"resolved": "string",
|
|
126
|
+
"references": {}
|
|
127
|
+
},
|
|
128
|
+
"required": false,
|
|
129
|
+
"optional": false,
|
|
130
|
+
"docs": {
|
|
131
|
+
"tags": [],
|
|
132
|
+
"text": "Border radius override"
|
|
133
|
+
},
|
|
134
|
+
"getter": false,
|
|
135
|
+
"setter": false,
|
|
136
|
+
"reflect": false,
|
|
137
|
+
"attribute": "border-radius",
|
|
138
|
+
"defaultValue": "''"
|
|
139
|
+
},
|
|
140
|
+
"lines": {
|
|
141
|
+
"type": "number",
|
|
142
|
+
"mutable": false,
|
|
143
|
+
"complexType": {
|
|
144
|
+
"original": "number",
|
|
145
|
+
"resolved": "number",
|
|
146
|
+
"references": {}
|
|
147
|
+
},
|
|
148
|
+
"required": false,
|
|
149
|
+
"optional": false,
|
|
150
|
+
"docs": {
|
|
151
|
+
"tags": [],
|
|
152
|
+
"text": "Number of lines to repeat (text variant only)"
|
|
153
|
+
},
|
|
154
|
+
"getter": false,
|
|
155
|
+
"setter": false,
|
|
156
|
+
"reflect": false,
|
|
157
|
+
"attribute": "lines",
|
|
158
|
+
"defaultValue": "1"
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
}
|
|
@@ -16,7 +16,7 @@ export class DropiSwitch {
|
|
|
16
16
|
this.dropiChange.emit(this.isChecked);
|
|
17
17
|
}
|
|
18
18
|
render() {
|
|
19
|
-
return (h("label", { key: '
|
|
19
|
+
return (h("label", { key: '790db7283a976472fd3f8de502f73ece29134878', class: "toggle-switch" }, h("input", { key: '7199dcfb1a4f81eb30d7510966d56fd0111d648f', type: "checkbox", checked: this.isChecked, disabled: this.disabled, onChange: (e) => this.onToggleChange(e) }), h("span", { key: '2c62e927e77e58993ab44f2b4fafefcea556b71e', class: "slider" })));
|
|
20
20
|
}
|
|
21
21
|
static get is() { return "dropi-switch"; }
|
|
22
22
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
:host { display: block; width: 100%; }
|
|
2
|
+
*, *::before, *::after { box-sizing: border-box; }
|
|
3
|
+
|
|
4
|
+
.tabs-container {
|
|
5
|
+
display: flex; flex-wrap: nowrap; overflow-x: auto; width: 100%; height: 52px;
|
|
6
|
+
scrollbar-width: none;
|
|
7
|
+
}
|
|
8
|
+
.tabs-container::-webkit-scrollbar { width: 0; height: 0; }
|
|
9
|
+
|
|
10
|
+
.tab-item {
|
|
11
|
+
padding: var(--Size-4,16px) var(--Size-5,20px);
|
|
12
|
+
background: var(--Neutral-White,#fff);
|
|
13
|
+
border-bottom: 2px solid var(--Gray-Gray-100,#e6eaf2);
|
|
14
|
+
cursor: pointer; display: flex; gap: 16px; align-items: center;
|
|
15
|
+
white-space: nowrap; flex-shrink: 0;
|
|
16
|
+
transition: border-color 0.15s ease; user-select: none;
|
|
17
|
+
}
|
|
18
|
+
.tab-item:hover:not(.tab-item--disabled):not(.tab-item--active) { border-color: var(--Gray-Gray-300,#a3abbf); }
|
|
19
|
+
.tab-item--active { border-bottom: 2px solid var(--Primary-Primary-500,#f49a3d); }
|
|
20
|
+
.tab-item--disabled { background: rgba(223,228,237,0.22); cursor: not-allowed; opacity: 0.7; pointer-events: none; }
|
|
21
|
+
|
|
22
|
+
.tab-label-row { display: flex; align-items: center; gap: 8px; }
|
|
23
|
+
.tab-label { font-size: var(--font-size-m,14px); font-weight: var(--font-weight-bold,700); color: var(--Gray-Gray-400,#858ea6); line-height: 20px; }
|
|
24
|
+
.tab-item--active .tab-label { color: var(--Gray-Gray-600,#475066); }
|
|
25
|
+
.tab-item--disabled .tab-label { font-weight: 300; color: var(--Gray-Gray-300,#a3abbf); }
|
|
26
|
+
|
|
27
|
+
.tab-counter {
|
|
28
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
29
|
+
min-width: 20px; height: 20px; padding: 0 6px; border-radius: 20px;
|
|
30
|
+
font-size: var(--font-size-xs,10px); font-weight: var(--font-weight-medium,500);
|
|
31
|
+
background: var(--Gray-Gray-100,#e6eaf2); color: var(--Gray-Gray-500,#69738c);
|
|
32
|
+
}
|
|
33
|
+
.tab-counter--active { background: var(--Primary-Primary-100,#fde8d0); color: var(--Primary-Primary-500,#f49a3d); }
|
|
34
|
+
|
|
35
|
+
.tab-status-dot {
|
|
36
|
+
display: inline-block;
|
|
37
|
+
width: 6px;
|
|
38
|
+
height: 6px;
|
|
39
|
+
border-radius: 50%;
|
|
40
|
+
background-color: var(--Primary-Primary-500, #f49a3d);
|
|
41
|
+
flex-shrink: 0;
|
|
42
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* @component dropi-tabs
|
|
4
|
+
* Horizontal tab navigation with optional counter badges and completed state icons.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* <dropi-tabs
|
|
8
|
+
* tabs='[{"id":1,"label":"Activos"},{"id":2,"label":"Histórico","counter":5}]'
|
|
9
|
+
* active-tab="1"
|
|
10
|
+
* />
|
|
11
|
+
*/
|
|
12
|
+
export class DropiTabs {
|
|
13
|
+
/** Array of TabItem or JSON string */
|
|
14
|
+
tabs = [];
|
|
15
|
+
/** Id of the active tab */
|
|
16
|
+
activeTab = 0;
|
|
17
|
+
/** Whether to show a check/pending icon per tab */
|
|
18
|
+
showIcon = false;
|
|
19
|
+
/** Emitted on tab click. e.detail = TabItem */
|
|
20
|
+
dropiTabChange;
|
|
21
|
+
parsedTabs = [];
|
|
22
|
+
tabsChanged(val) {
|
|
23
|
+
this.parsedTabs = typeof val === 'string' ? JSON.parse(val) : (val ?? []);
|
|
24
|
+
}
|
|
25
|
+
componentWillLoad() {
|
|
26
|
+
this.tabsChanged(this.tabs);
|
|
27
|
+
}
|
|
28
|
+
handleClick(tab) {
|
|
29
|
+
if (tab.disabled)
|
|
30
|
+
return;
|
|
31
|
+
this.activeTab = tab.id;
|
|
32
|
+
this.dropiTabChange.emit(tab);
|
|
33
|
+
}
|
|
34
|
+
render() {
|
|
35
|
+
return (h("div", { key: '5b28faac5789a5e29aa68fe2892854cdebccda75', class: "tabs-container", role: "tablist" }, this.parsedTabs.map(tab => {
|
|
36
|
+
const isActive = tab.id === this.activeTab;
|
|
37
|
+
return (h("div", { role: "tab", "aria-selected": String(isActive), class: { 'tab-item': true, 'tab-item--active': isActive && !tab.disabled, 'tab-item--disabled': !!tab.disabled }, onClick: () => this.handleClick(tab) }, h("span", { class: "tab-label-row" }, h("span", { class: "tab-label" }, tab.label), tab.counter !== undefined && tab.counter !== null && (h("span", { class: { 'tab-counter': true, 'tab-counter--active': isActive } }, tab.counter))), this.showIcon && (tab.completed
|
|
38
|
+
? h("dropi-icon", { name: "Check-circle", width: "12px", height: "12px", color: "Success-Success-500" })
|
|
39
|
+
: h("span", { class: "tab-status-dot" }))));
|
|
40
|
+
})));
|
|
41
|
+
}
|
|
42
|
+
static get is() { return "dropi-tabs"; }
|
|
43
|
+
static get encapsulation() { return "shadow"; }
|
|
44
|
+
static get originalStyleUrls() {
|
|
45
|
+
return {
|
|
46
|
+
"$": ["dropi-tabs.css"]
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
static get styleUrls() {
|
|
50
|
+
return {
|
|
51
|
+
"$": ["dropi-tabs.css"]
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
static get properties() {
|
|
55
|
+
return {
|
|
56
|
+
"tabs": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"mutable": false,
|
|
59
|
+
"complexType": {
|
|
60
|
+
"original": "TabItem[] | string",
|
|
61
|
+
"resolved": "TabItem[] | string",
|
|
62
|
+
"references": {
|
|
63
|
+
"TabItem": {
|
|
64
|
+
"location": "local",
|
|
65
|
+
"path": "/Users/mac-ti/Documents/dropi/dropi-ui/src/components/dropi-tabs/dropi-tabs.tsx",
|
|
66
|
+
"id": "src/components/dropi-tabs/dropi-tabs.tsx::TabItem"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"required": false,
|
|
71
|
+
"optional": false,
|
|
72
|
+
"docs": {
|
|
73
|
+
"tags": [],
|
|
74
|
+
"text": "Array of TabItem or JSON string"
|
|
75
|
+
},
|
|
76
|
+
"getter": false,
|
|
77
|
+
"setter": false,
|
|
78
|
+
"reflect": false,
|
|
79
|
+
"attribute": "tabs",
|
|
80
|
+
"defaultValue": "[]"
|
|
81
|
+
},
|
|
82
|
+
"activeTab": {
|
|
83
|
+
"type": "any",
|
|
84
|
+
"mutable": true,
|
|
85
|
+
"complexType": {
|
|
86
|
+
"original": "string | number",
|
|
87
|
+
"resolved": "number | string",
|
|
88
|
+
"references": {}
|
|
89
|
+
},
|
|
90
|
+
"required": false,
|
|
91
|
+
"optional": false,
|
|
92
|
+
"docs": {
|
|
93
|
+
"tags": [],
|
|
94
|
+
"text": "Id of the active tab"
|
|
95
|
+
},
|
|
96
|
+
"getter": false,
|
|
97
|
+
"setter": false,
|
|
98
|
+
"reflect": true,
|
|
99
|
+
"attribute": "active-tab",
|
|
100
|
+
"defaultValue": "0"
|
|
101
|
+
},
|
|
102
|
+
"showIcon": {
|
|
103
|
+
"type": "boolean",
|
|
104
|
+
"mutable": false,
|
|
105
|
+
"complexType": {
|
|
106
|
+
"original": "boolean",
|
|
107
|
+
"resolved": "boolean",
|
|
108
|
+
"references": {}
|
|
109
|
+
},
|
|
110
|
+
"required": false,
|
|
111
|
+
"optional": false,
|
|
112
|
+
"docs": {
|
|
113
|
+
"tags": [],
|
|
114
|
+
"text": "Whether to show a check/pending icon per tab"
|
|
115
|
+
},
|
|
116
|
+
"getter": false,
|
|
117
|
+
"setter": false,
|
|
118
|
+
"reflect": false,
|
|
119
|
+
"attribute": "show-icon",
|
|
120
|
+
"defaultValue": "false"
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
static get states() {
|
|
125
|
+
return {
|
|
126
|
+
"parsedTabs": {}
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
static get events() {
|
|
130
|
+
return [{
|
|
131
|
+
"method": "dropiTabChange",
|
|
132
|
+
"name": "dropiTabChange",
|
|
133
|
+
"bubbles": true,
|
|
134
|
+
"cancelable": true,
|
|
135
|
+
"composed": true,
|
|
136
|
+
"docs": {
|
|
137
|
+
"tags": [],
|
|
138
|
+
"text": "Emitted on tab click. e.detail = TabItem"
|
|
139
|
+
},
|
|
140
|
+
"complexType": {
|
|
141
|
+
"original": "TabItem",
|
|
142
|
+
"resolved": "TabItem",
|
|
143
|
+
"references": {
|
|
144
|
+
"TabItem": {
|
|
145
|
+
"location": "local",
|
|
146
|
+
"path": "/Users/mac-ti/Documents/dropi/dropi-ui/src/components/dropi-tabs/dropi-tabs.tsx",
|
|
147
|
+
"id": "src/components/dropi-tabs/dropi-tabs.tsx::TabItem"
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}];
|
|
152
|
+
}
|
|
153
|
+
static get watchers() {
|
|
154
|
+
return [{
|
|
155
|
+
"propName": "tabs",
|
|
156
|
+
"methodName": "tabsChanged"
|
|
157
|
+
}];
|
|
158
|
+
}
|
|
159
|
+
}
|