@dropi/ui 0.1.18 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/dropi-accordion.cjs.entry.js +1 -1
- package/dist/cjs/dropi-alert.cjs.entry.js +58 -0
- package/dist/cjs/dropi-avatars.cjs.entry.js +31 -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-card-section.cjs.entry.js +38 -0
- package/dist/cjs/dropi-checkbox-selection-list.cjs.entry.js +71 -0
- package/dist/cjs/dropi-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/dropi-chips.cjs.entry.js +30 -0
- package/dist/cjs/dropi-dropdown.cjs.entry.js +58 -0
- package/dist/cjs/dropi-empty-state.cjs.entry.js +1 -1
- package/dist/cjs/dropi-favorite-button.cjs.entry.js +27 -0
- package/dist/cjs/dropi-icon.cjs.entry.js +1 -1
- package/dist/cjs/dropi-image-miniature.cjs.entry.js +44 -0
- package/dist/cjs/dropi-image-overlay.cjs.entry.js +62 -0
- package/dist/cjs/dropi-input.cjs.entry.js +5 -5
- package/dist/cjs/dropi-logo.cjs.entry.js +27 -0
- package/dist/cjs/dropi-lottie-loader.cjs.entry.js +27 -0
- package/dist/cjs/dropi-otp-send-code.cjs.entry.js +92 -0
- package/dist/cjs/dropi-paginator.cjs.entry.js +5 -3
- package/dist/cjs/dropi-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/dropi-radio-selection-list.cjs.entry.js +56 -0
- package/dist/cjs/dropi-read-more.cjs.entry.js +36 -0
- package/dist/cjs/dropi-search.cjs.entry.js +110 -0
- package/dist/cjs/dropi-select.cjs.entry.js +1 -1
- package/dist/cjs/dropi-simple-stepper.cjs.entry.js +51 -0
- package/dist/cjs/dropi-steps.cjs.entry.js +50 -0
- package/dist/cjs/dropi-switch.cjs.entry.js +1 -1
- package/dist/cjs/dropi-tabs.cjs.entry.js +1 -1
- package/dist/cjs/dropi-tag.cjs.entry.js +1 -1
- package/dist/cjs/dropi-text-area.cjs.entry.js +3 -3
- package/dist/cjs/dropi-time-line.cjs.entry.js +34 -0
- package/dist/cjs/dropi-toast.cjs.entry.js +1 -1
- package/dist/cjs/dropi-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/dropi-ui.cjs.js +1 -1
- package/dist/cjs/dropi-vertical-steps.cjs.entry.js +55 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +19 -0
- package/dist/collection/components/dropi-accordion/dropi-accordion.js +1 -1
- package/dist/collection/components/dropi-alert/dropi-alert.css +123 -0
- package/dist/collection/components/dropi-alert/dropi-alert.js +305 -0
- package/dist/collection/components/dropi-avatars/dropi-avatars.css +55 -0
- package/dist/collection/components/dropi-avatars/dropi-avatars.js +126 -0
- package/dist/collection/components/dropi-badge/dropi-badge.js +1 -1
- package/dist/collection/components/dropi-button/dropi-button.js +2 -2
- package/dist/collection/components/dropi-card-section/dropi-card-section.css +42 -0
- package/dist/collection/components/dropi-card-section/dropi-card-section.js +178 -0
- package/dist/collection/components/dropi-checkbox/dropi-checkbox.js +2 -2
- package/dist/collection/components/dropi-checkbox-selection-list/dropi-checkbox-selection-list.css +44 -0
- package/dist/collection/components/dropi-checkbox-selection-list/dropi-checkbox-selection-list.js +245 -0
- package/dist/collection/components/dropi-chips/dropi-chips.css +66 -0
- package/dist/collection/components/dropi-chips/dropi-chips.js +169 -0
- package/dist/collection/components/dropi-dropdown/dropi-dropdown.css +51 -0
- package/dist/collection/components/dropi-dropdown/dropi-dropdown.js +184 -0
- package/dist/collection/components/dropi-empty-state/dropi-empty-state.js +1 -1
- package/dist/collection/components/dropi-favorite-button/dropi-favorite-button.css +24 -0
- package/dist/collection/components/dropi-favorite-button/dropi-favorite-button.js +78 -0
- package/dist/collection/components/dropi-icon/dropi-icon.js +1 -1
- package/dist/collection/components/dropi-image-miniature/dropi-image-miniature.css +45 -0
- package/dist/collection/components/dropi-image-miniature/dropi-image-miniature.js +150 -0
- package/dist/collection/components/dropi-image-overlay/dropi-image-overlay.css +82 -0
- package/dist/collection/components/dropi-image-overlay/dropi-image-overlay.js +155 -0
- package/dist/collection/components/dropi-input/dropi-input.css +11 -0
- package/dist/collection/components/dropi-input/dropi-input.js +4 -4
- package/dist/collection/components/dropi-logo/dropi-logo.css +26 -0
- package/dist/collection/components/dropi-logo/dropi-logo.js +96 -0
- package/dist/collection/components/dropi-lottie-loader/dropi-lottie-loader.css +50 -0
- package/dist/collection/components/dropi-lottie-loader/dropi-lottie-loader.js +116 -0
- package/dist/collection/components/dropi-otp-send-code/dropi-otp-send-code.css +60 -0
- package/dist/collection/components/dropi-otp-send-code/dropi-otp-send-code.js +221 -0
- package/dist/collection/components/dropi-paginator/dropi-paginator.css +15 -12
- package/dist/collection/components/dropi-paginator/dropi-paginator.js +24 -2
- package/dist/collection/components/dropi-radio-button/dropi-radio-button.js +1 -1
- package/dist/collection/components/dropi-radio-selection-list/dropi-radio-selection-list.css +64 -0
- package/dist/collection/components/dropi-radio-selection-list/dropi-radio-selection-list.js +209 -0
- package/dist/collection/components/dropi-read-more/dropi-read-more.css +28 -0
- package/dist/collection/components/dropi-read-more/dropi-read-more.js +110 -0
- package/dist/collection/components/dropi-search/dropi-search.css +112 -0
- package/dist/collection/components/dropi-search/dropi-search.js +392 -0
- package/dist/collection/components/dropi-select/dropi-select.js +1 -1
- package/dist/collection/components/dropi-simple-stepper/dropi-simple-stepper.css +94 -0
- package/dist/collection/components/dropi-simple-stepper/dropi-simple-stepper.js +172 -0
- package/dist/collection/components/dropi-steps/dropi-steps.css +95 -0
- package/dist/collection/components/dropi-steps/dropi-steps.js +145 -0
- package/dist/collection/components/dropi-switch/dropi-switch.js +1 -1
- package/dist/collection/components/dropi-tabs/dropi-tabs.js +1 -1
- package/dist/collection/components/dropi-tag/dropi-tag.js +1 -1
- package/dist/collection/components/dropi-text-area/dropi-text-area.css +0 -1
- package/dist/collection/components/dropi-text-area/dropi-text-area.js +2 -2
- package/dist/collection/components/dropi-time-line/dropi-time-line.css +108 -0
- package/dist/collection/components/dropi-time-line/dropi-time-line.js +69 -0
- package/dist/collection/components/dropi-toast/dropi-toast.js +1 -1
- package/dist/collection/components/dropi-tooltip/dropi-tooltip.js +1 -1
- package/dist/collection/components/dropi-vertical-steps/dropi-vertical-steps.css +95 -0
- package/dist/collection/components/dropi-vertical-steps/dropi-vertical-steps.js +167 -0
- package/dist/components/dropi-accordion.js +1 -1
- package/dist/components/dropi-alert.d.ts +11 -0
- package/dist/components/dropi-alert.js +1 -0
- package/dist/components/dropi-avatars.d.ts +11 -0
- package/dist/components/dropi-avatars.js +1 -0
- package/dist/components/dropi-badge.js +1 -1
- package/dist/components/dropi-button.js +1 -1
- package/dist/components/dropi-card-section.d.ts +11 -0
- package/dist/components/dropi-card-section.js +1 -0
- package/dist/components/dropi-checkbox-selection-list.d.ts +11 -0
- package/dist/components/dropi-checkbox-selection-list.js +1 -0
- package/dist/components/dropi-checkbox.js +1 -1
- package/dist/components/dropi-chips.d.ts +11 -0
- package/dist/components/dropi-chips.js +1 -0
- package/dist/components/dropi-dropdown.d.ts +11 -0
- package/dist/components/dropi-dropdown.js +1 -0
- package/dist/components/dropi-empty-state.js +1 -1
- package/dist/components/dropi-favorite-button.d.ts +11 -0
- package/dist/components/dropi-favorite-button.js +1 -0
- package/dist/components/dropi-icon.js +1 -1
- package/dist/components/dropi-image-miniature.d.ts +11 -0
- package/dist/components/dropi-image-miniature.js +1 -0
- package/dist/components/dropi-image-overlay.d.ts +11 -0
- package/dist/components/dropi-image-overlay.js +1 -0
- package/dist/components/dropi-input.js +1 -1
- package/dist/components/dropi-logo.d.ts +11 -0
- package/dist/components/dropi-logo.js +1 -0
- package/dist/components/dropi-lottie-loader.d.ts +11 -0
- package/dist/components/dropi-lottie-loader.js +1 -0
- package/dist/components/dropi-modal.js +1 -1
- package/dist/components/dropi-otp-send-code.d.ts +11 -0
- package/dist/components/dropi-otp-send-code.js +1 -0
- package/dist/components/dropi-paginator.js +1 -1
- package/dist/components/dropi-radio-button.js +1 -1
- package/dist/components/dropi-radio-selection-list.d.ts +11 -0
- package/dist/components/dropi-radio-selection-list.js +1 -0
- package/dist/components/dropi-read-more.d.ts +11 -0
- package/dist/components/dropi-read-more.js +1 -0
- package/dist/components/dropi-search.d.ts +11 -0
- package/dist/components/dropi-search.js +1 -0
- package/dist/components/dropi-select.js +1 -1
- package/dist/components/dropi-simple-stepper.d.ts +11 -0
- package/dist/components/dropi-simple-stepper.js +1 -0
- package/dist/components/dropi-steps.d.ts +11 -0
- package/dist/components/dropi-steps.js +1 -0
- package/dist/components/dropi-switch.js +1 -1
- package/dist/components/dropi-tabs.js +1 -1
- package/dist/components/dropi-tag.js +1 -1
- package/dist/components/dropi-text-area.js +1 -1
- package/dist/components/dropi-time-line.d.ts +11 -0
- package/dist/components/dropi-time-line.js +1 -0
- package/dist/components/dropi-toast.js +1 -1
- package/dist/components/dropi-tooltip.js +1 -1
- package/dist/components/dropi-vertical-steps.d.ts +11 -0
- package/dist/components/dropi-vertical-steps.js +1 -0
- package/dist/components/{p-ChOXWKmI.js → p-CPs3fHRc.js} +1 -1
- package/dist/components/p-DKXrREI4.js +1 -0
- package/dist/components/p-Ds74ZOlC.js +1 -0
- package/dist/components/{p-NCyvfOs2.js → p-WZTFyFH2.js} +1 -1
- package/dist/dropi-ui/dropi-ui.esm.js +1 -1
- package/dist/dropi-ui/p-061e1ad4.entry.js +1 -0
- package/dist/dropi-ui/{p-ecda6e19.entry.js → p-0c13dded.entry.js} +1 -1
- package/dist/dropi-ui/{p-79466fec.entry.js → p-121c8a09.entry.js} +1 -1
- package/dist/dropi-ui/p-291a1416.entry.js +1 -0
- package/dist/dropi-ui/p-2cee44f9.entry.js +1 -0
- package/dist/dropi-ui/{p-6031ac9d.entry.js → p-30fdd316.entry.js} +1 -1
- package/dist/dropi-ui/p-3537ee5a.entry.js +1 -0
- package/dist/dropi-ui/{p-26dbae0d.entry.js → p-3d859657.entry.js} +1 -1
- package/dist/dropi-ui/p-433d161d.entry.js +1 -0
- package/dist/dropi-ui/p-4bdfad16.entry.js +1 -0
- package/dist/dropi-ui/p-4ea7d3a7.entry.js +1 -0
- package/dist/dropi-ui/{p-09c38a49.entry.js → p-51c8ef68.entry.js} +1 -1
- package/dist/dropi-ui/{p-6d15d32f.entry.js → p-54780c90.entry.js} +1 -1
- package/dist/dropi-ui/{p-63e969da.entry.js → p-66deb85e.entry.js} +1 -1
- package/dist/dropi-ui/p-68f81080.entry.js +1 -0
- package/dist/dropi-ui/p-724a2aea.entry.js +1 -0
- package/dist/dropi-ui/p-74c37688.entry.js +1 -0
- package/dist/dropi-ui/p-7cec1cea.entry.js +1 -0
- package/dist/dropi-ui/{p-f0e1e0f6.entry.js → p-7daa2677.entry.js} +1 -1
- package/dist/dropi-ui/p-8906a68d.entry.js +1 -0
- package/dist/dropi-ui/{p-1739d20c.entry.js → p-a4204ece.entry.js} +1 -1
- package/dist/dropi-ui/p-a9116dbe.entry.js +1 -0
- package/dist/dropi-ui/p-b36b819f.entry.js +1 -0
- package/dist/dropi-ui/p-c10cbb8d.entry.js +1 -0
- package/dist/dropi-ui/{p-42179ae4.entry.js → p-c2316d4d.entry.js} +1 -1
- package/dist/dropi-ui/{p-e44242e2.entry.js → p-cb5fd7a9.entry.js} +1 -1
- package/dist/dropi-ui/p-d1e1b716.entry.js +1 -0
- package/dist/dropi-ui/p-d5ecc394.entry.js +1 -0
- package/dist/dropi-ui/p-db6c9828.entry.js +1 -0
- package/dist/dropi-ui/{p-4d582d58.entry.js → p-e721127d.entry.js} +1 -1
- package/dist/dropi-ui/p-e8557da0.entry.js +1 -0
- package/dist/dropi-ui/p-ebfd4665.entry.js +1 -0
- package/dist/dropi-ui/p-f3cef35a.entry.js +1 -0
- package/dist/dropi-ui/p-f6a69c4e.entry.js +1 -0
- package/dist/dropi-ui/{p-65fa8558.entry.js → p-ff45e7c8.entry.js} +1 -1
- package/dist/esm/dropi-accordion.entry.js +1 -1
- package/dist/esm/dropi-alert.entry.js +56 -0
- package/dist/esm/dropi-avatars.entry.js +29 -0
- package/dist/esm/dropi-badge.entry.js +1 -1
- package/dist/esm/dropi-button.entry.js +2 -2
- package/dist/esm/dropi-card-section.entry.js +36 -0
- package/dist/esm/dropi-checkbox-selection-list.entry.js +69 -0
- package/dist/esm/dropi-checkbox.entry.js +2 -2
- package/dist/esm/dropi-chips.entry.js +28 -0
- package/dist/esm/dropi-dropdown.entry.js +56 -0
- package/dist/esm/dropi-empty-state.entry.js +1 -1
- package/dist/esm/dropi-favorite-button.entry.js +25 -0
- package/dist/esm/dropi-icon.entry.js +1 -1
- package/dist/esm/dropi-image-miniature.entry.js +42 -0
- package/dist/esm/dropi-image-overlay.entry.js +60 -0
- package/dist/esm/dropi-input.entry.js +5 -5
- package/dist/esm/dropi-logo.entry.js +25 -0
- package/dist/esm/dropi-lottie-loader.entry.js +25 -0
- package/dist/esm/dropi-otp-send-code.entry.js +90 -0
- package/dist/esm/dropi-paginator.entry.js +5 -3
- package/dist/esm/dropi-radio-button.entry.js +1 -1
- package/dist/esm/dropi-radio-selection-list.entry.js +54 -0
- package/dist/esm/dropi-read-more.entry.js +34 -0
- package/dist/esm/dropi-search.entry.js +108 -0
- package/dist/esm/dropi-select.entry.js +1 -1
- package/dist/esm/dropi-simple-stepper.entry.js +49 -0
- package/dist/esm/dropi-steps.entry.js +48 -0
- package/dist/esm/dropi-switch.entry.js +1 -1
- package/dist/esm/dropi-tabs.entry.js +1 -1
- package/dist/esm/dropi-tag.entry.js +1 -1
- package/dist/esm/dropi-text-area.entry.js +3 -3
- package/dist/esm/dropi-time-line.entry.js +32 -0
- package/dist/esm/dropi-toast.entry.js +1 -1
- package/dist/esm/dropi-tooltip.entry.js +1 -1
- package/dist/esm/dropi-ui.js +1 -1
- package/dist/esm/dropi-vertical-steps.entry.js +53 -0
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/dropi-alert/dropi-alert.d.ts +35 -0
- package/dist/types/components/dropi-avatars/dropi-avatars.d.ts +17 -0
- package/dist/types/components/dropi-card-section/dropi-card-section.d.ts +22 -0
- package/dist/types/components/dropi-checkbox-selection-list/dropi-checkbox-selection-list.d.ts +37 -0
- package/dist/types/components/dropi-chips/dropi-chips.d.ts +23 -0
- package/dist/types/components/dropi-dropdown/dropi-dropdown.d.ts +28 -0
- package/dist/types/components/dropi-favorite-button/dropi-favorite-button.d.ts +14 -0
- package/dist/types/components/dropi-image-miniature/dropi-image-miniature.d.ts +23 -0
- package/dist/types/components/dropi-image-overlay/dropi-image-overlay.d.ts +26 -0
- package/dist/types/components/dropi-logo/dropi-logo.d.ts +14 -0
- package/dist/types/components/dropi-lottie-loader/dropi-lottie-loader.d.ts +15 -0
- package/dist/types/components/dropi-otp-send-code/dropi-otp-send-code.d.ts +33 -0
- package/dist/types/components/dropi-paginator/dropi-paginator.d.ts +2 -0
- package/dist/types/components/dropi-radio-selection-list/dropi-radio-selection-list.d.ts +34 -0
- package/dist/types/components/dropi-read-more/dropi-read-more.d.ts +17 -0
- package/dist/types/components/dropi-search/dropi-search.d.ts +51 -0
- package/dist/types/components/dropi-simple-stepper/dropi-simple-stepper.d.ts +20 -0
- package/dist/types/components/dropi-steps/dropi-steps.d.ts +21 -0
- package/dist/types/components/dropi-time-line/dropi-time-line.d.ts +18 -0
- package/dist/types/components/dropi-vertical-steps/dropi-vertical-steps.d.ts +24 -0
- package/dist/types/components.d.ts +1830 -3
- package/package.json +1 -1
- package/dist/dropi-ui/p-082b7039.entry.js +0 -1
- package/dist/dropi-ui/p-eb7f9a57.entry.js +0 -1
- package/dist/dropi-ui/p-f283f41d.entry.js +0 -1
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* @component dropi-radio-selection-list
|
|
4
|
+
* List of radio button options with optional search filter.
|
|
5
|
+
*/
|
|
6
|
+
export class DropiRadioSelectionList {
|
|
7
|
+
/** Options array or JSON string */
|
|
8
|
+
options = [];
|
|
9
|
+
/** Selected option id */
|
|
10
|
+
selectedOption = '';
|
|
11
|
+
/** Show search box */
|
|
12
|
+
showFilter = false;
|
|
13
|
+
/** Search placeholder */
|
|
14
|
+
filterPlaceholder = 'Buscar...';
|
|
15
|
+
/** Show description below name */
|
|
16
|
+
typeLayout = 'default';
|
|
17
|
+
filterText = '';
|
|
18
|
+
parsedOptions = [];
|
|
19
|
+
/** Emitted on selection change. e.detail = selected option id */
|
|
20
|
+
dropiChange;
|
|
21
|
+
/** Emitted on search. e.detail = search text */
|
|
22
|
+
dropiSearch;
|
|
23
|
+
optionsChanged(val) {
|
|
24
|
+
this.parsedOptions = typeof val === 'string' ? JSON.parse(val) : (val || []);
|
|
25
|
+
}
|
|
26
|
+
componentWillLoad() { this.optionsChanged(this.options); }
|
|
27
|
+
get filtered() {
|
|
28
|
+
if (!this.filterText)
|
|
29
|
+
return this.parsedOptions;
|
|
30
|
+
const q = this.filterText.toLowerCase();
|
|
31
|
+
return this.parsedOptions.filter(o => o.name?.toLowerCase().includes(q));
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
return (h("div", { key: '211875c5fad7a56c67628e888d6d2d497d0c8e8b', class: "rsl" }, this.showFilter && (h("div", { key: '324adac3e9c8f3a9e93d7da82144395bdb619345', class: "rsl__search" }, h("dropi-icon", { key: 'fb6dd199750ffb508f75404faa4a3014350aa52a', name: "Search", width: "16px", height: "16px", color: "Gray-Gray-400" }), h("input", { key: 'f2121473bdfe6b98441f12f2751a9d954468110b', class: "rsl__search-input", type: "text", placeholder: this.filterPlaceholder, value: this.filterText, onInput: (e) => {
|
|
35
|
+
this.filterText = e.target.value;
|
|
36
|
+
this.dropiSearch.emit(this.filterText);
|
|
37
|
+
} }))), h("div", { key: '6ad89bc1840bc512bb7c78839186092d7fc73d3b', class: "rsl__list" }, this.filtered.map(opt => {
|
|
38
|
+
const isSelected = opt.id === this.selectedOption;
|
|
39
|
+
return (h("div", { class: { 'rsl__item': true, 'rsl__item--selected': isSelected }, key: opt.id, onClick: () => { this.selectedOption = opt.id; this.dropiChange.emit(opt.id); } }, h("div", { class: { 'rsl__radio': true, 'rsl__radio--checked': isSelected } }, isSelected && h("div", { class: "rsl__radio-dot" })), h("div", { class: "rsl__content" }, h("span", { class: "rsl__name" }, opt.name), this.typeLayout === 'description' && opt.description && (h("span", { class: "rsl__desc" }, opt.description)))));
|
|
40
|
+
}))));
|
|
41
|
+
}
|
|
42
|
+
static get is() { return "dropi-radio-selection-list"; }
|
|
43
|
+
static get encapsulation() { return "shadow"; }
|
|
44
|
+
static get originalStyleUrls() {
|
|
45
|
+
return {
|
|
46
|
+
"$": ["dropi-radio-selection-list.css"]
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
static get styleUrls() {
|
|
50
|
+
return {
|
|
51
|
+
"$": ["dropi-radio-selection-list.css"]
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
static get properties() {
|
|
55
|
+
return {
|
|
56
|
+
"options": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"mutable": false,
|
|
59
|
+
"complexType": {
|
|
60
|
+
"original": "RadioOption[] | string",
|
|
61
|
+
"resolved": "RadioOption[] | string",
|
|
62
|
+
"references": {
|
|
63
|
+
"RadioOption": {
|
|
64
|
+
"location": "local",
|
|
65
|
+
"path": "/Users/mac-ti/Documents/dropi/dropi-ui/src/components/dropi-radio-selection-list/dropi-radio-selection-list.tsx",
|
|
66
|
+
"id": "src/components/dropi-radio-selection-list/dropi-radio-selection-list.tsx::RadioOption"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"required": false,
|
|
71
|
+
"optional": false,
|
|
72
|
+
"docs": {
|
|
73
|
+
"tags": [],
|
|
74
|
+
"text": "Options array or JSON string"
|
|
75
|
+
},
|
|
76
|
+
"getter": false,
|
|
77
|
+
"setter": false,
|
|
78
|
+
"reflect": false,
|
|
79
|
+
"attribute": "options",
|
|
80
|
+
"defaultValue": "[]"
|
|
81
|
+
},
|
|
82
|
+
"selectedOption": {
|
|
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": "Selected option id"
|
|
95
|
+
},
|
|
96
|
+
"getter": false,
|
|
97
|
+
"setter": false,
|
|
98
|
+
"reflect": false,
|
|
99
|
+
"attribute": "selected-option",
|
|
100
|
+
"defaultValue": "''"
|
|
101
|
+
},
|
|
102
|
+
"showFilter": {
|
|
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": "Show search box"
|
|
115
|
+
},
|
|
116
|
+
"getter": false,
|
|
117
|
+
"setter": false,
|
|
118
|
+
"reflect": false,
|
|
119
|
+
"attribute": "show-filter",
|
|
120
|
+
"defaultValue": "false"
|
|
121
|
+
},
|
|
122
|
+
"filterPlaceholder": {
|
|
123
|
+
"type": "string",
|
|
124
|
+
"mutable": false,
|
|
125
|
+
"complexType": {
|
|
126
|
+
"original": "string",
|
|
127
|
+
"resolved": "string",
|
|
128
|
+
"references": {}
|
|
129
|
+
},
|
|
130
|
+
"required": false,
|
|
131
|
+
"optional": false,
|
|
132
|
+
"docs": {
|
|
133
|
+
"tags": [],
|
|
134
|
+
"text": "Search placeholder"
|
|
135
|
+
},
|
|
136
|
+
"getter": false,
|
|
137
|
+
"setter": false,
|
|
138
|
+
"reflect": false,
|
|
139
|
+
"attribute": "filter-placeholder",
|
|
140
|
+
"defaultValue": "'Buscar...'"
|
|
141
|
+
},
|
|
142
|
+
"typeLayout": {
|
|
143
|
+
"type": "string",
|
|
144
|
+
"mutable": false,
|
|
145
|
+
"complexType": {
|
|
146
|
+
"original": "'description' | 'default'",
|
|
147
|
+
"resolved": "\"default\" | \"description\"",
|
|
148
|
+
"references": {}
|
|
149
|
+
},
|
|
150
|
+
"required": false,
|
|
151
|
+
"optional": false,
|
|
152
|
+
"docs": {
|
|
153
|
+
"tags": [],
|
|
154
|
+
"text": "Show description below name"
|
|
155
|
+
},
|
|
156
|
+
"getter": false,
|
|
157
|
+
"setter": false,
|
|
158
|
+
"reflect": false,
|
|
159
|
+
"attribute": "type-layout",
|
|
160
|
+
"defaultValue": "'default'"
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
static get states() {
|
|
165
|
+
return {
|
|
166
|
+
"filterText": {},
|
|
167
|
+
"parsedOptions": {}
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
static get events() {
|
|
171
|
+
return [{
|
|
172
|
+
"method": "dropiChange",
|
|
173
|
+
"name": "dropiChange",
|
|
174
|
+
"bubbles": true,
|
|
175
|
+
"cancelable": true,
|
|
176
|
+
"composed": true,
|
|
177
|
+
"docs": {
|
|
178
|
+
"tags": [],
|
|
179
|
+
"text": "Emitted on selection change. e.detail = selected option id"
|
|
180
|
+
},
|
|
181
|
+
"complexType": {
|
|
182
|
+
"original": "string | number",
|
|
183
|
+
"resolved": "number | string",
|
|
184
|
+
"references": {}
|
|
185
|
+
}
|
|
186
|
+
}, {
|
|
187
|
+
"method": "dropiSearch",
|
|
188
|
+
"name": "dropiSearch",
|
|
189
|
+
"bubbles": true,
|
|
190
|
+
"cancelable": true,
|
|
191
|
+
"composed": true,
|
|
192
|
+
"docs": {
|
|
193
|
+
"tags": [],
|
|
194
|
+
"text": "Emitted on search. e.detail = search text"
|
|
195
|
+
},
|
|
196
|
+
"complexType": {
|
|
197
|
+
"original": "string",
|
|
198
|
+
"resolved": "string",
|
|
199
|
+
"references": {}
|
|
200
|
+
}
|
|
201
|
+
}];
|
|
202
|
+
}
|
|
203
|
+
static get watchers() {
|
|
204
|
+
return [{
|
|
205
|
+
"propName": "options",
|
|
206
|
+
"methodName": "optionsChanged"
|
|
207
|
+
}];
|
|
208
|
+
}
|
|
209
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.read-more__text {
|
|
6
|
+
margin: 0 0 4px;
|
|
7
|
+
font-size: var(--font-size-s, 12px);
|
|
8
|
+
font-family: inherit;
|
|
9
|
+
color: var(--Gray-Gray-800, #1a2033);
|
|
10
|
+
line-height: 1.5;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.read-more__toggle {
|
|
14
|
+
background: none;
|
|
15
|
+
border: none;
|
|
16
|
+
padding: 0;
|
|
17
|
+
margin: 0;
|
|
18
|
+
font-size: var(--font-size-s, 12px);
|
|
19
|
+
font-family: inherit;
|
|
20
|
+
font-weight: var(--font-weight-bold, 700);
|
|
21
|
+
color: var(--Primary-Primary-500, #f49a3d);
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
text-decoration: underline;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.read-more__toggle:hover {
|
|
27
|
+
color: var(--Primary-Primary-600, #d4872e);
|
|
28
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* @component dropi-read-more
|
|
4
|
+
* Truncates text to a word limit with an expandable "Ver más / Ver menos" toggle.
|
|
5
|
+
*/
|
|
6
|
+
export class DropiReadMore {
|
|
7
|
+
/** Full text to display */
|
|
8
|
+
text = '';
|
|
9
|
+
/** Maximum number of words before truncating */
|
|
10
|
+
maxWords = 20;
|
|
11
|
+
/** Allow collapsing back after expanding */
|
|
12
|
+
showSeeLess = true;
|
|
13
|
+
expanded = false;
|
|
14
|
+
get words() {
|
|
15
|
+
return (this.text || '').split(/\s+/).filter(Boolean);
|
|
16
|
+
}
|
|
17
|
+
get needsTruncation() {
|
|
18
|
+
return this.words.length > this.maxWords;
|
|
19
|
+
}
|
|
20
|
+
get displayText() {
|
|
21
|
+
if (!this.needsTruncation || this.expanded)
|
|
22
|
+
return this.text;
|
|
23
|
+
return this.words.slice(0, this.maxWords).join(' ') + '…';
|
|
24
|
+
}
|
|
25
|
+
render() {
|
|
26
|
+
const showToggle = this.needsTruncation && (this.expanded ? this.showSeeLess : true);
|
|
27
|
+
return (h("div", { key: 'c1f9429714adae91cbc8431ef890304091415618', class: "read-more" }, h("p", { key: 'f17394eeeec531bdc2d77e3ad853cfb5079864bc', class: "read-more__text" }, this.displayText), showToggle && (h("button", { key: 'c5a1febc2557c2d96114edb10479048ab3af10b8', class: "read-more__toggle", onClick: () => this.expanded = !this.expanded }, this.expanded ? 'Ver menos' : 'Ver más'))));
|
|
28
|
+
}
|
|
29
|
+
static get is() { return "dropi-read-more"; }
|
|
30
|
+
static get encapsulation() { return "shadow"; }
|
|
31
|
+
static get originalStyleUrls() {
|
|
32
|
+
return {
|
|
33
|
+
"$": ["dropi-read-more.css"]
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
static get styleUrls() {
|
|
37
|
+
return {
|
|
38
|
+
"$": ["dropi-read-more.css"]
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
static get properties() {
|
|
42
|
+
return {
|
|
43
|
+
"text": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"mutable": false,
|
|
46
|
+
"complexType": {
|
|
47
|
+
"original": "string",
|
|
48
|
+
"resolved": "string",
|
|
49
|
+
"references": {}
|
|
50
|
+
},
|
|
51
|
+
"required": false,
|
|
52
|
+
"optional": false,
|
|
53
|
+
"docs": {
|
|
54
|
+
"tags": [],
|
|
55
|
+
"text": "Full text to display"
|
|
56
|
+
},
|
|
57
|
+
"getter": false,
|
|
58
|
+
"setter": false,
|
|
59
|
+
"reflect": false,
|
|
60
|
+
"attribute": "text",
|
|
61
|
+
"defaultValue": "''"
|
|
62
|
+
},
|
|
63
|
+
"maxWords": {
|
|
64
|
+
"type": "number",
|
|
65
|
+
"mutable": false,
|
|
66
|
+
"complexType": {
|
|
67
|
+
"original": "number",
|
|
68
|
+
"resolved": "number",
|
|
69
|
+
"references": {}
|
|
70
|
+
},
|
|
71
|
+
"required": false,
|
|
72
|
+
"optional": false,
|
|
73
|
+
"docs": {
|
|
74
|
+
"tags": [],
|
|
75
|
+
"text": "Maximum number of words before truncating"
|
|
76
|
+
},
|
|
77
|
+
"getter": false,
|
|
78
|
+
"setter": false,
|
|
79
|
+
"reflect": false,
|
|
80
|
+
"attribute": "max-words",
|
|
81
|
+
"defaultValue": "20"
|
|
82
|
+
},
|
|
83
|
+
"showSeeLess": {
|
|
84
|
+
"type": "boolean",
|
|
85
|
+
"mutable": false,
|
|
86
|
+
"complexType": {
|
|
87
|
+
"original": "boolean",
|
|
88
|
+
"resolved": "boolean",
|
|
89
|
+
"references": {}
|
|
90
|
+
},
|
|
91
|
+
"required": false,
|
|
92
|
+
"optional": false,
|
|
93
|
+
"docs": {
|
|
94
|
+
"tags": [],
|
|
95
|
+
"text": "Allow collapsing back after expanding"
|
|
96
|
+
},
|
|
97
|
+
"getter": false,
|
|
98
|
+
"setter": false,
|
|
99
|
+
"reflect": false,
|
|
100
|
+
"attribute": "show-see-less",
|
|
101
|
+
"defaultValue": "true"
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
static get states() {
|
|
106
|
+
return {
|
|
107
|
+
"expanded": {}
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
width: 100%;
|
|
4
|
+
position: relative;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
*, *::before, *::after { box-sizing: border-box; }
|
|
8
|
+
|
|
9
|
+
.search-label {
|
|
10
|
+
display: block;
|
|
11
|
+
font-size: var(--font-size-xs, 10px);
|
|
12
|
+
color: var(--Gray-Gray-600, #475066);
|
|
13
|
+
margin-bottom: 4px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* ── Input row ──────────────────────────────────────────── */
|
|
17
|
+
.search-input-row {
|
|
18
|
+
position: relative;
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
width: 100%;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.search-icon {
|
|
25
|
+
position: absolute;
|
|
26
|
+
left: 10px;
|
|
27
|
+
pointer-events: none;
|
|
28
|
+
z-index: 1;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.search-input {
|
|
32
|
+
width: 100%;
|
|
33
|
+
height: 40px;
|
|
34
|
+
padding: 0 36px 0 34px;
|
|
35
|
+
border: 1px solid var(--Gray-Gray-200, #c3c9d9);
|
|
36
|
+
border-radius: var(--Border-2, 8px);
|
|
37
|
+
background: var(--Neutral-White, #fff);
|
|
38
|
+
font-size: var(--font-size-s, 12px);
|
|
39
|
+
font-family: inherit;
|
|
40
|
+
color: var(--Gray-Gray-700, #32394d);
|
|
41
|
+
outline: none;
|
|
42
|
+
transition: border-color 0.2s;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.search-input:focus {
|
|
46
|
+
border-color: var(--Info-Info-500, #50a5f1);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.search-input::placeholder {
|
|
50
|
+
color: var(--Gray-Gray-400, #858ea6);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.search-clear {
|
|
54
|
+
position: absolute;
|
|
55
|
+
right: 10px;
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
background: none;
|
|
59
|
+
border: none;
|
|
60
|
+
padding: 0;
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
z-index: 1;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* ── Dropdown ───────────────────────────────────────────── */
|
|
66
|
+
.search-dropdown {
|
|
67
|
+
position: absolute;
|
|
68
|
+
top: calc(100% + 4px);
|
|
69
|
+
left: 0;
|
|
70
|
+
right: 0;
|
|
71
|
+
max-height: var(--dropdown-height, 240px);
|
|
72
|
+
overflow-y: auto;
|
|
73
|
+
background: var(--Neutral-White, #fff);
|
|
74
|
+
border: 1px solid var(--Gray-Gray-200, #c3c9d9);
|
|
75
|
+
border-radius: var(--Border-2, 8px);
|
|
76
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
|
|
77
|
+
z-index: 100;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.search-option {
|
|
81
|
+
display: flex;
|
|
82
|
+
align-items: center;
|
|
83
|
+
gap: var(--Size-2, 8px);
|
|
84
|
+
padding: var(--Size-2, 8px) var(--Size-3, 12px);
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
transition: background 0.15s;
|
|
87
|
+
user-select: none;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.search-option:hover {
|
|
91
|
+
background: var(--Gray-Gray-50, #f7f8fa);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.search-option--selected {
|
|
95
|
+
background: var(--Primary-Primary-50, #fff5eb);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.search-option__label {
|
|
99
|
+
flex: 1;
|
|
100
|
+
font-size: var(--font-size-s, 12px);
|
|
101
|
+
color: var(--Gray-Gray-700, #32394d);
|
|
102
|
+
overflow: hidden;
|
|
103
|
+
text-overflow: ellipsis;
|
|
104
|
+
white-space: nowrap;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.search-no-results {
|
|
108
|
+
padding: var(--Size-3, 12px);
|
|
109
|
+
font-size: var(--font-size-s, 12px);
|
|
110
|
+
color: var(--Gray-Gray-400, #858ea6);
|
|
111
|
+
text-align: center;
|
|
112
|
+
}
|