@andespindola/ui-core 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/ui-accordion-item.cjs.entry.js +2 -2
- package/dist/cjs/ui-accordion.cjs.entry.js +1 -1
- package/dist/cjs/ui-alert.cjs.entry.js +40 -0
- package/dist/cjs/ui-avatar-group.cjs.entry.js +17 -0
- package/dist/cjs/ui-avatar.cjs.entry.js +2 -2
- package/dist/cjs/ui-badge.cjs.entry.js +7 -2
- package/dist/cjs/ui-breadcrumb-item.cjs.entry.js +23 -0
- package/dist/cjs/ui-breadcrumb.cjs.entry.js +17 -0
- package/dist/cjs/ui-button.cjs.entry.js +5 -3
- package/dist/cjs/ui-card.cjs.entry.js +2 -2
- package/dist/cjs/ui-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/ui-container.cjs.entry.js +26 -0
- package/dist/cjs/ui-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ui-drawer.cjs.entry.js +1 -1
- package/dist/cjs/ui-dropdown-item.cjs.entry.js +1 -1
- package/dist/cjs/ui-dropdown-menu.cjs.entry.js +1 -1
- package/dist/cjs/ui-field.cjs.entry.js +1 -1
- package/dist/cjs/ui-grid.cjs.entry.js +34 -0
- package/dist/cjs/ui-input.cjs.entry.js +10 -2
- package/dist/cjs/ui-label.cjs.entry.js +1 -1
- package/dist/cjs/ui-pagination.cjs.entry.js +63 -0
- package/dist/cjs/ui-popover.cjs.entry.js +1 -1
- package/dist/cjs/ui-progress.cjs.entry.js +2 -2
- package/dist/cjs/ui-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/ui-reveal.cjs.entry.js +1 -1
- package/dist/cjs/ui-scroll-progress.cjs.entry.js +1 -1
- package/dist/cjs/ui-section.cjs.entry.js +2 -2
- package/dist/cjs/ui-segmented.cjs.entry.js +31 -0
- package/dist/cjs/ui-select.cjs.entry.js +2 -2
- package/dist/cjs/ui-separator.cjs.entry.js +1 -1
- package/dist/cjs/ui-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/ui-slider.cjs.entry.js +1 -1
- package/dist/cjs/ui-spinner.cjs.entry.js +1 -1
- package/dist/cjs/ui-stack.cjs.entry.js +53 -0
- package/dist/cjs/ui-stat.cjs.entry.js +28 -0
- package/dist/cjs/ui-switch.cjs.entry.js +1 -1
- package/dist/cjs/ui-tabs.cjs.entry.js +3 -3
- package/dist/cjs/ui-textarea.cjs.entry.js +2 -2
- package/dist/cjs/ui-theme-toggle.cjs.entry.js +1 -1
- package/dist/cjs/ui-toast.cjs.entry.js +1 -1
- package/dist/cjs/ui-toaster.cjs.entry.js +1 -1
- package/dist/cjs/ui-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/uikit.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +10 -0
- package/dist/collection/components/ui-accordion/ui-accordion.js +1 -1
- package/dist/collection/components/ui-accordion-item/ui-accordion-item.css +8 -0
- package/dist/collection/components/ui-accordion-item/ui-accordion-item.js +1 -1
- package/dist/collection/components/ui-alert/ui-alert.css +95 -0
- package/dist/collection/components/ui-alert/ui-alert.js +134 -0
- package/dist/collection/components/ui-avatar/ui-avatar.css +31 -0
- package/dist/collection/components/ui-avatar/ui-avatar.js +20 -1
- package/dist/collection/components/ui-avatar-group/ui-avatar-group.css +22 -0
- package/dist/collection/components/ui-avatar-group/ui-avatar-group.js +21 -0
- package/dist/collection/components/ui-badge/ui-badge.css +26 -0
- package/dist/collection/components/ui-badge/ui-badge.js +63 -1
- package/dist/collection/components/ui-breadcrumb/ui-breadcrumb.css +15 -0
- package/dist/collection/components/ui-breadcrumb/ui-breadcrumb.js +18 -0
- package/dist/collection/components/ui-breadcrumb-item/ui-breadcrumb-item.css +30 -0
- package/dist/collection/components/ui-breadcrumb-item/ui-breadcrumb-item.js +69 -0
- package/dist/collection/components/ui-button/ui-button.css +11 -1
- package/dist/collection/components/ui-button/ui-button.js +24 -2
- package/dist/collection/components/ui-card/ui-card.css +17 -3
- package/dist/collection/components/ui-card/ui-card.js +1 -1
- package/dist/collection/components/ui-checkbox/ui-checkbox.css +6 -2
- package/dist/collection/components/ui-checkbox/ui-checkbox.js +1 -1
- package/dist/collection/components/ui-container/ui-container.css +38 -0
- package/dist/collection/components/ui-container/ui-container.js +79 -0
- package/dist/collection/components/ui-dialog/ui-dialog.js +1 -1
- package/dist/collection/components/ui-drawer/ui-drawer.js +1 -1
- package/dist/collection/components/ui-dropdown-item/ui-dropdown-item.js +1 -1
- package/dist/collection/components/ui-dropdown-menu/ui-dropdown-menu.js +1 -1
- package/dist/collection/components/ui-field/ui-field.js +1 -1
- package/dist/collection/components/ui-grid/ui-grid.css +8 -0
- package/dist/collection/components/ui-grid/ui-grid.js +106 -0
- package/dist/collection/components/ui-input/ui-input.css +65 -14
- package/dist/collection/components/ui-input/ui-input.js +29 -1
- package/dist/collection/components/ui-label/ui-label.js +1 -1
- package/dist/collection/components/ui-pagination/ui-pagination.css +59 -0
- package/dist/collection/components/ui-pagination/ui-pagination.js +147 -0
- package/dist/collection/components/ui-popover/ui-popover.js +1 -1
- package/dist/collection/components/ui-progress/ui-progress.css +9 -4
- package/dist/collection/components/ui-progress/ui-progress.js +1 -1
- package/dist/collection/components/ui-radio-group/ui-radio-group.js +1 -1
- package/dist/collection/components/ui-reveal/ui-reveal.js +1 -1
- package/dist/collection/components/ui-scroll-progress/ui-scroll-progress.js +1 -1
- package/dist/collection/components/ui-section/ui-section.css +12 -5
- package/dist/collection/components/ui-section/ui-section.js +1 -1
- package/dist/collection/components/ui-segmented/ui-segmented.css +46 -0
- package/dist/collection/components/ui-segmented/ui-segmented.js +99 -0
- package/dist/collection/components/ui-select/ui-select.css +4 -0
- package/dist/collection/components/ui-select/ui-select.js +1 -1
- package/dist/collection/components/ui-separator/ui-separator.js +1 -1
- package/dist/collection/components/ui-skeleton/ui-skeleton.css +9 -6
- package/dist/collection/components/ui-skeleton/ui-skeleton.js +1 -1
- package/dist/collection/components/ui-slider/ui-slider.js +1 -1
- package/dist/collection/components/ui-spinner/ui-spinner.js +1 -1
- package/dist/collection/components/ui-stack/ui-stack.css +8 -0
- package/dist/collection/components/ui-stack/ui-stack.js +184 -0
- package/dist/collection/components/ui-stat/ui-stat.css +69 -0
- package/dist/collection/components/ui-stat/ui-stat.js +118 -0
- package/dist/collection/components/ui-switch/ui-switch.js +1 -1
- package/dist/collection/components/ui-tabs/ui-tabs.css +12 -0
- package/dist/collection/components/ui-tabs/ui-tabs.js +2 -2
- package/dist/collection/components/ui-textarea/ui-textarea.css +4 -0
- package/dist/collection/components/ui-textarea/ui-textarea.js +1 -1
- package/dist/collection/components/ui-theme-toggle/ui-theme-toggle.js +1 -1
- package/dist/collection/components/ui-toast/ui-toast.js +1 -1
- package/dist/collection/components/ui-toaster/ui-toaster.js +1 -1
- package/dist/collection/components/ui-tooltip/ui-tooltip.css +5 -4
- package/dist/collection/components/ui-tooltip/ui-tooltip.js +1 -1
- package/dist/components/{p-Bz9HyboB.js → p-BwNtNvTb.js} +1 -1
- package/dist/components/{p-C8ePpPG3.js → p-CgsjJD8o.js} +1 -1
- package/dist/components/ui-accordion-item.js +1 -1
- package/dist/components/ui-accordion.js +1 -1
- package/dist/components/ui-alert.d.ts +11 -0
- package/dist/components/ui-alert.js +1 -0
- package/dist/components/ui-avatar-group.d.ts +11 -0
- package/dist/components/ui-avatar-group.js +1 -0
- package/dist/components/ui-avatar.js +1 -1
- package/dist/components/ui-badge.js +1 -1
- package/dist/components/ui-breadcrumb-item.d.ts +11 -0
- package/dist/components/ui-breadcrumb-item.js +1 -0
- package/dist/components/ui-breadcrumb.d.ts +11 -0
- package/dist/components/ui-breadcrumb.js +1 -0
- package/dist/components/ui-button.js +1 -1
- package/dist/components/ui-card.js +1 -1
- package/dist/components/ui-checkbox.js +1 -1
- package/dist/components/ui-container.d.ts +11 -0
- package/dist/components/ui-container.js +1 -0
- package/dist/components/ui-dialog.js +1 -1
- package/dist/components/ui-drawer.js +1 -1
- package/dist/components/ui-dropdown-item.js +1 -1
- package/dist/components/ui-dropdown-menu.js +1 -1
- package/dist/components/ui-field.js +1 -1
- package/dist/components/ui-grid.d.ts +11 -0
- package/dist/components/ui-grid.js +1 -0
- package/dist/components/ui-input.js +1 -1
- package/dist/components/ui-label.js +1 -1
- package/dist/components/ui-loading-overlay.js +1 -1
- package/dist/components/ui-pagination.d.ts +11 -0
- package/dist/components/ui-pagination.js +1 -0
- package/dist/components/ui-popover.js +1 -1
- package/dist/components/ui-progress.js +1 -1
- package/dist/components/ui-radio-group.js +1 -1
- package/dist/components/ui-reveal.js +1 -1
- package/dist/components/ui-scroll-progress.js +1 -1
- package/dist/components/ui-section.js +1 -1
- package/dist/components/ui-segmented.d.ts +11 -0
- package/dist/components/ui-segmented.js +1 -0
- package/dist/components/ui-select.js +1 -1
- package/dist/components/ui-separator.js +1 -1
- package/dist/components/ui-skeleton.js +1 -1
- package/dist/components/ui-slider.js +1 -1
- package/dist/components/ui-spinner.js +1 -1
- package/dist/components/ui-stack.d.ts +11 -0
- package/dist/components/ui-stack.js +1 -0
- package/dist/components/ui-stat.d.ts +11 -0
- package/dist/components/ui-stat.js +1 -0
- package/dist/components/ui-switch.js +1 -1
- package/dist/components/ui-tabs.js +1 -1
- package/dist/components/ui-textarea.js +1 -1
- package/dist/components/ui-theme-toggle.js +1 -1
- package/dist/components/ui-toast.js +1 -1
- package/dist/components/ui-toaster.js +1 -1
- package/dist/components/ui-tooltip.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/ui-accordion-item.entry.js +2 -2
- package/dist/esm/ui-accordion.entry.js +1 -1
- package/dist/esm/ui-alert.entry.js +38 -0
- package/dist/esm/ui-avatar-group.entry.js +15 -0
- package/dist/esm/ui-avatar.entry.js +2 -2
- package/dist/esm/ui-badge.entry.js +8 -3
- package/dist/esm/ui-breadcrumb-item.entry.js +21 -0
- package/dist/esm/ui-breadcrumb.entry.js +15 -0
- package/dist/esm/ui-button.entry.js +5 -3
- package/dist/esm/ui-card.entry.js +2 -2
- package/dist/esm/ui-checkbox.entry.js +2 -2
- package/dist/esm/ui-container.entry.js +24 -0
- package/dist/esm/ui-dialog.entry.js +1 -1
- package/dist/esm/ui-drawer.entry.js +1 -1
- package/dist/esm/ui-dropdown-item.entry.js +1 -1
- package/dist/esm/ui-dropdown-menu.entry.js +1 -1
- package/dist/esm/ui-field.entry.js +1 -1
- package/dist/esm/ui-grid.entry.js +32 -0
- package/dist/esm/ui-input.entry.js +10 -2
- package/dist/esm/ui-label.entry.js +1 -1
- package/dist/esm/ui-pagination.entry.js +61 -0
- package/dist/esm/ui-popover.entry.js +1 -1
- package/dist/esm/ui-progress.entry.js +2 -2
- package/dist/esm/ui-radio-group.entry.js +1 -1
- package/dist/esm/ui-reveal.entry.js +1 -1
- package/dist/esm/ui-scroll-progress.entry.js +1 -1
- package/dist/esm/ui-section.entry.js +2 -2
- package/dist/esm/ui-segmented.entry.js +29 -0
- package/dist/esm/ui-select.entry.js +2 -2
- package/dist/esm/ui-separator.entry.js +1 -1
- package/dist/esm/ui-skeleton.entry.js +2 -2
- package/dist/esm/ui-slider.entry.js +1 -1
- package/dist/esm/ui-spinner.entry.js +1 -1
- package/dist/esm/ui-stack.entry.js +51 -0
- package/dist/esm/ui-stat.entry.js +26 -0
- package/dist/esm/ui-switch.entry.js +1 -1
- package/dist/esm/ui-tabs.entry.js +3 -3
- package/dist/esm/ui-textarea.entry.js +2 -2
- package/dist/esm/ui-theme-toggle.entry.js +1 -1
- package/dist/esm/ui-toast.entry.js +1 -1
- package/dist/esm/ui-toaster.entry.js +1 -1
- package/dist/esm/ui-tooltip.entry.js +2 -2
- package/dist/esm/uikit.js +1 -1
- package/dist/types/components/ui-alert/ui-alert.d.ts +17 -0
- package/dist/types/components/ui-avatar/ui-avatar.d.ts +2 -0
- package/dist/types/components/ui-avatar-group/ui-avatar-group.d.ts +6 -0
- package/dist/types/components/ui-badge/ui-badge.d.ts +7 -0
- package/dist/types/components/ui-breadcrumb/ui-breadcrumb.d.ts +3 -0
- package/dist/types/components/ui-breadcrumb-item/ui-breadcrumb-item.d.ts +8 -0
- package/dist/types/components/ui-button/ui-button.d.ts +2 -0
- package/dist/types/components/ui-container/ui-container.d.ts +8 -0
- package/dist/types/components/ui-grid/ui-grid.d.ts +10 -0
- package/dist/types/components/ui-input/ui-input.d.ts +3 -0
- package/dist/types/components/ui-pagination/ui-pagination.d.ts +15 -0
- package/dist/types/components/ui-segmented/ui-segmented.d.ts +15 -0
- package/dist/types/components/ui-stack/ui-stack.d.ts +17 -0
- package/dist/types/components/ui-stat/ui-stat.d.ts +13 -0
- package/dist/types/components.d.ts +552 -0
- package/dist/uikit/{p-8cebbe65.entry.js → p-09895cd0.entry.js} +1 -1
- package/dist/uikit/p-0cba0d11.entry.js +1 -0
- package/dist/uikit/p-12db6a6e.entry.js +1 -0
- package/dist/uikit/{p-4a1abc1c.entry.js → p-1d016ea4.entry.js} +1 -1
- package/dist/uikit/{p-19b81437.entry.js → p-25637424.entry.js} +1 -1
- package/dist/uikit/p-2601d8b6.entry.js +1 -0
- package/dist/uikit/p-2de05aac.entry.js +1 -0
- package/dist/uikit/{p-3d30bc7a.entry.js → p-3996590f.entry.js} +1 -1
- package/dist/uikit/p-3fc062a6.entry.js +1 -0
- package/dist/uikit/p-45e80e73.entry.js +1 -0
- package/dist/uikit/{p-b61e3df4.entry.js → p-55a23f91.entry.js} +1 -1
- package/dist/uikit/p-567f7496.entry.js +1 -0
- package/dist/uikit/p-5951a496.entry.js +1 -0
- package/dist/uikit/{p-9aa557d1.entry.js → p-595e146f.entry.js} +1 -1
- package/dist/uikit/p-635862e6.entry.js +1 -0
- package/dist/uikit/{p-c72ed105.entry.js → p-67963692.entry.js} +1 -1
- package/dist/uikit/p-6c0e9809.entry.js +1 -0
- package/dist/uikit/p-74b60a60.entry.js +1 -0
- package/dist/uikit/p-7a3d85da.entry.js +1 -0
- package/dist/uikit/{p-f7402442.entry.js → p-7f2c2924.entry.js} +1 -1
- package/dist/uikit/{p-5df32809.entry.js → p-81b45a43.entry.js} +1 -1
- package/dist/uikit/p-86ed6154.entry.js +1 -0
- package/dist/uikit/p-94ad46a5.entry.js +1 -0
- package/dist/uikit/{p-e410c789.entry.js → p-95cd976e.entry.js} +1 -1
- package/dist/uikit/{p-4382718f.entry.js → p-979f6178.entry.js} +1 -1
- package/dist/uikit/p-97d4dbf4.entry.js +1 -0
- package/dist/uikit/p-9a4dc343.entry.js +1 -0
- package/dist/uikit/p-9a9590b9.entry.js +1 -0
- package/dist/uikit/p-a01305a5.entry.js +1 -0
- package/dist/uikit/p-a080f46a.entry.js +1 -0
- package/dist/uikit/p-a92a7b19.entry.js +1 -0
- package/dist/uikit/p-a977a0db.entry.js +1 -0
- package/dist/uikit/p-b2df8437.entry.js +1 -0
- package/dist/uikit/{p-9e7b81ef.entry.js → p-c73c1009.entry.js} +1 -1
- package/dist/uikit/{p-83159bfc.entry.js → p-cd0ec835.entry.js} +1 -1
- package/dist/uikit/p-d20452b4.entry.js +1 -0
- package/dist/uikit/p-d7021157.entry.js +1 -0
- package/dist/uikit/p-db07f9c5.entry.js +1 -0
- package/dist/uikit/p-dca9f6f9.entry.js +1 -0
- package/dist/uikit/p-ddd70374.entry.js +1 -0
- package/dist/uikit/{p-629c1728.entry.js → p-faa98928.entry.js} +1 -1
- package/dist/uikit/p-fd832f52.entry.js +1 -0
- package/dist/uikit/uikit.esm.js +1 -1
- package/package.json +8 -3
- package/dist/uikit/p-06d6d907.entry.js +0 -1
- package/dist/uikit/p-0fb4949b.entry.js +0 -1
- package/dist/uikit/p-162302d1.entry.js +0 -1
- package/dist/uikit/p-24edfe3e.entry.js +0 -1
- package/dist/uikit/p-57058c30.entry.js +0 -1
- package/dist/uikit/p-5ea42ee5.entry.js +0 -1
- package/dist/uikit/p-76f0f79f.entry.js +0 -1
- package/dist/uikit/p-8bcd423c.entry.js +0 -1
- package/dist/uikit/p-90d49509.entry.js +0 -1
- package/dist/uikit/p-94fb298e.entry.js +0 -1
- package/dist/uikit/p-9c57cf57.entry.js +0 -1
- package/dist/uikit/p-9d784b04.entry.js +0 -1
- package/dist/uikit/p-9f7c6ca8.entry.js +0 -1
- package/dist/uikit/p-a7be1c69.entry.js +0 -1
- package/dist/uikit/p-b30aa6a6.entry.js +0 -1
- package/dist/uikit/p-cb2adfb7.entry.js +0 -1
- package/dist/uikit/p-cf10ca3b.entry.js +0 -1
- package/dist/uikit/p-fd1648bf.entry.js +0 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
width: 100%;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.container {
|
|
7
|
+
margin-inline: auto;
|
|
8
|
+
width: 100%;
|
|
9
|
+
font-family: var(--ui-font-sans);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/* Tamanhos */
|
|
13
|
+
.size-sm {
|
|
14
|
+
max-width: 40rem;
|
|
15
|
+
}
|
|
16
|
+
.size-md {
|
|
17
|
+
max-width: 48rem;
|
|
18
|
+
}
|
|
19
|
+
.size-lg {
|
|
20
|
+
max-width: 64rem;
|
|
21
|
+
}
|
|
22
|
+
.size-xl {
|
|
23
|
+
max-width: 80rem;
|
|
24
|
+
}
|
|
25
|
+
.size-full {
|
|
26
|
+
max-width: none;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* Padding lateral responsivo */
|
|
30
|
+
.padded {
|
|
31
|
+
padding-inline: 1.25rem;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@media (min-width: 640px) {
|
|
35
|
+
.padded {
|
|
36
|
+
padding-inline: 2rem;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
export class UiContainer {
|
|
3
|
+
constructor() {
|
|
4
|
+
/** Largura máxima do container. */
|
|
5
|
+
this.size = "lg";
|
|
6
|
+
/** Aplica padding lateral responsivo. */
|
|
7
|
+
this.padded = true;
|
|
8
|
+
}
|
|
9
|
+
render() {
|
|
10
|
+
const classes = {
|
|
11
|
+
container: true,
|
|
12
|
+
[`size-${this.size}`]: true,
|
|
13
|
+
padded: this.padded,
|
|
14
|
+
};
|
|
15
|
+
return (h(Host, { key: '4f00ee39f0ae347fafac349ee8e42c991c8013dd' }, h("div", { key: 'a0f8f0c6d418f119c6631d0387f9328af8fbb416', class: classes }, h("slot", { key: '86178f8371c958123fcf8b7e6bfe059aeed9f690' }))));
|
|
16
|
+
}
|
|
17
|
+
static get is() { return "ui-container"; }
|
|
18
|
+
static get encapsulation() { return "shadow"; }
|
|
19
|
+
static get originalStyleUrls() {
|
|
20
|
+
return {
|
|
21
|
+
"$": ["ui-container.css"]
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
static get styleUrls() {
|
|
25
|
+
return {
|
|
26
|
+
"$": ["ui-container.css"]
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
static get properties() {
|
|
30
|
+
return {
|
|
31
|
+
"size": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"mutable": false,
|
|
34
|
+
"complexType": {
|
|
35
|
+
"original": "UiContainerSize",
|
|
36
|
+
"resolved": "\"full\" | \"lg\" | \"md\" | \"sm\" | \"xl\"",
|
|
37
|
+
"references": {
|
|
38
|
+
"UiContainerSize": {
|
|
39
|
+
"location": "local",
|
|
40
|
+
"path": "/Users/andersonespindola/.ghq/github.com/andersonflima/ui/packages/core/src/components/ui-container/ui-container.tsx",
|
|
41
|
+
"id": "src/components/ui-container/ui-container.tsx::UiContainerSize"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"required": false,
|
|
46
|
+
"optional": false,
|
|
47
|
+
"docs": {
|
|
48
|
+
"tags": [],
|
|
49
|
+
"text": "Largura m\u00E1xima do container."
|
|
50
|
+
},
|
|
51
|
+
"getter": false,
|
|
52
|
+
"setter": false,
|
|
53
|
+
"reflect": false,
|
|
54
|
+
"attribute": "size",
|
|
55
|
+
"defaultValue": "\"lg\""
|
|
56
|
+
},
|
|
57
|
+
"padded": {
|
|
58
|
+
"type": "boolean",
|
|
59
|
+
"mutable": false,
|
|
60
|
+
"complexType": {
|
|
61
|
+
"original": "boolean",
|
|
62
|
+
"resolved": "boolean",
|
|
63
|
+
"references": {}
|
|
64
|
+
},
|
|
65
|
+
"required": false,
|
|
66
|
+
"optional": false,
|
|
67
|
+
"docs": {
|
|
68
|
+
"tags": [],
|
|
69
|
+
"text": "Aplica padding lateral responsivo."
|
|
70
|
+
},
|
|
71
|
+
"getter": false,
|
|
72
|
+
"setter": false,
|
|
73
|
+
"reflect": false,
|
|
74
|
+
"attribute": "padded",
|
|
75
|
+
"defaultValue": "true"
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -37,7 +37,7 @@ export class UiDialog {
|
|
|
37
37
|
this.open = false;
|
|
38
38
|
}
|
|
39
39
|
render() {
|
|
40
|
-
return (h(Host, { key: '
|
|
40
|
+
return (h(Host, { key: 'e6c34700dc04fd3754eedeab279a67cd3997fb3d' }, h("dialog", { key: 'fdb23f89bd4b9aef79abaec586bf39add47ce013', class: "dialog", ref: (el) => (this.dialogEl = el), onClose: this.onClose, onCancel: this.onClose, onClick: this.onBackdropClick }, h("div", { key: '8a86f47c263d4fac68debdcef9cc8ed7e0be7ca8', class: "content" }, h("slot", { key: 'fe9d9105c13670104b5a60c939f9256b44694e8e' })))));
|
|
41
41
|
}
|
|
42
42
|
static get is() { return "ui-dialog"; }
|
|
43
43
|
static get encapsulation() { return "shadow"; }
|
|
@@ -39,7 +39,7 @@ export class UiDrawer {
|
|
|
39
39
|
this.open = false;
|
|
40
40
|
}
|
|
41
41
|
render() {
|
|
42
|
-
return (h(Host, { key: '
|
|
42
|
+
return (h(Host, { key: '5d44e7d604eab21d2d30d5cbaaa225658c8e7e71' }, h("dialog", { key: 'ecdfc2057a8864f6b8dc961ddcd51c3f349b2b54', class: `drawer side-${this.side}`, ref: (el) => (this.dialogEl = el), onClose: this.onClose, onCancel: this.onClose, onClick: this.onBackdropClick }, h("div", { key: 'c14965ebb97a2c77d06c4a50466d00bf4036bafa', class: "content" }, h("slot", { key: '2bdbb4cbd2cd30ade870090c5383d398cfb6772b' })))));
|
|
43
43
|
}
|
|
44
44
|
static get is() { return "ui-drawer"; }
|
|
45
45
|
static get encapsulation() { return "shadow"; }
|
|
@@ -11,7 +11,7 @@ export class UiDropdownItem {
|
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
render() {
|
|
14
|
-
return (h(Host, { key: '
|
|
14
|
+
return (h(Host, { key: 'a73d394ff94b232151c37e749d398f4485f46bde' }, h("button", { key: '3827857b88fc5d63681e80dc2cc470b58faf69e1', type: "button", class: "item", role: "menuitem", disabled: this.disabled, onClick: this.onClick }, h("slot", { key: 'a6dbd79c7b171ef6a8a53aa5da39fbca37725e1c' }))));
|
|
15
15
|
}
|
|
16
16
|
static get is() { return "ui-dropdown-item"; }
|
|
17
17
|
static get encapsulation() { return "shadow"; }
|
|
@@ -76,7 +76,7 @@ export class UiDropdownMenu {
|
|
|
76
76
|
this.cleanup = undefined;
|
|
77
77
|
}
|
|
78
78
|
render() {
|
|
79
|
-
return (h(Host, { key: '
|
|
79
|
+
return (h(Host, { key: '6d1ac3cd9096527745a84f24443a3b230bf2aaf0' }, h("span", { key: '5594e37030b1fd69260b4de30393aacfbc636ca3', class: "trigger", ref: (el) => (this.triggerEl = el), onClick: this.onTriggerClick }, h("slot", { key: '763b6bf28fe4c79a13a2cc5a620d19e51ae5f6e2', name: "trigger" })), h("div", { key: '0bec01181593abbcb1a8634eb027ce0cef0d860d', class: { menu: true, "is-open": this.open }, role: "menu", ref: (el) => (this.floatingEl = el) }, h("slot", { key: '1b1fa528fc1186c81dd433d0cb9b775df8357641' }))));
|
|
80
80
|
}
|
|
81
81
|
static get is() { return "ui-dropdown-menu"; }
|
|
82
82
|
static get encapsulation() { return "shadow"; }
|
|
@@ -5,7 +5,7 @@ export class UiField {
|
|
|
5
5
|
this.required = false;
|
|
6
6
|
}
|
|
7
7
|
render() {
|
|
8
|
-
return (h(Host, { key: '
|
|
8
|
+
return (h(Host, { key: '1910a6ce3a389ab7faa9e3b46e0397e6a9bfbaab' }, h("div", { key: 'fb76fb030b9af9129578f7b2f0b85eaffefc8d67', class: "field" }, this.label && (h("label", { key: '659a7c0982360c133891a1a22a98cdae32a529ed', class: "label", htmlFor: this.fieldId }, this.label, this.required && (h("span", { key: 'de93f19b8a2dd063df1175c00c68c0b7c9b092d6', class: "required", "aria-hidden": "true" }, " *")))), h("slot", { key: 'a510f107aab90a202c178f1d22727689db828fdc' }), this.error ? (h("p", { class: "error", role: "alert" }, this.error)) : (this.description && h("p", { class: "description" }, this.description)))));
|
|
9
9
|
}
|
|
10
10
|
static get is() { return "ui-field"; }
|
|
11
11
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
const GAP = {
|
|
3
|
+
xs: "0.25rem",
|
|
4
|
+
sm: "0.5rem",
|
|
5
|
+
md: "1rem",
|
|
6
|
+
lg: "1.5rem",
|
|
7
|
+
xl: "2rem",
|
|
8
|
+
};
|
|
9
|
+
export class UiGrid {
|
|
10
|
+
constructor() {
|
|
11
|
+
/** Número de colunas da grade. */
|
|
12
|
+
this.columns = 12;
|
|
13
|
+
/** Espaçamento entre células. */
|
|
14
|
+
this.gap = "md";
|
|
15
|
+
}
|
|
16
|
+
render() {
|
|
17
|
+
const style = {
|
|
18
|
+
gridTemplateColumns: this.minItemWidth
|
|
19
|
+
? `repeat(auto-fit, minmax(${this.minItemWidth}, 1fr))`
|
|
20
|
+
: `repeat(${this.columns}, minmax(0, 1fr))`,
|
|
21
|
+
gap: GAP[this.gap],
|
|
22
|
+
};
|
|
23
|
+
return (h(Host, { key: '465a816e064af42d8282185ee92e32477a6112fd' }, h("div", { key: 'da2e151c56959ced55477e3fe6c99aa5563b38aa', class: "grid", style: style }, h("slot", { key: '5bb285ce0feaf16d066b627010fc3fb595a85c15' }))));
|
|
24
|
+
}
|
|
25
|
+
static get is() { return "ui-grid"; }
|
|
26
|
+
static get encapsulation() { return "shadow"; }
|
|
27
|
+
static get originalStyleUrls() {
|
|
28
|
+
return {
|
|
29
|
+
"$": ["ui-grid.css"]
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
static get styleUrls() {
|
|
33
|
+
return {
|
|
34
|
+
"$": ["ui-grid.css"]
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
static get properties() {
|
|
38
|
+
return {
|
|
39
|
+
"columns": {
|
|
40
|
+
"type": "number",
|
|
41
|
+
"mutable": false,
|
|
42
|
+
"complexType": {
|
|
43
|
+
"original": "number",
|
|
44
|
+
"resolved": "number",
|
|
45
|
+
"references": {}
|
|
46
|
+
},
|
|
47
|
+
"required": false,
|
|
48
|
+
"optional": false,
|
|
49
|
+
"docs": {
|
|
50
|
+
"tags": [],
|
|
51
|
+
"text": "N\u00FAmero de colunas da grade."
|
|
52
|
+
},
|
|
53
|
+
"getter": false,
|
|
54
|
+
"setter": false,
|
|
55
|
+
"reflect": false,
|
|
56
|
+
"attribute": "columns",
|
|
57
|
+
"defaultValue": "12"
|
|
58
|
+
},
|
|
59
|
+
"gap": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"mutable": false,
|
|
62
|
+
"complexType": {
|
|
63
|
+
"original": "UiGridGap",
|
|
64
|
+
"resolved": "\"lg\" | \"md\" | \"sm\" | \"xl\" | \"xs\"",
|
|
65
|
+
"references": {
|
|
66
|
+
"UiGridGap": {
|
|
67
|
+
"location": "local",
|
|
68
|
+
"path": "/Users/andersonespindola/.ghq/github.com/andersonflima/ui/packages/core/src/components/ui-grid/ui-grid.tsx",
|
|
69
|
+
"id": "src/components/ui-grid/ui-grid.tsx::UiGridGap"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"required": false,
|
|
74
|
+
"optional": false,
|
|
75
|
+
"docs": {
|
|
76
|
+
"tags": [],
|
|
77
|
+
"text": "Espa\u00E7amento entre c\u00E9lulas."
|
|
78
|
+
},
|
|
79
|
+
"getter": false,
|
|
80
|
+
"setter": false,
|
|
81
|
+
"reflect": false,
|
|
82
|
+
"attribute": "gap",
|
|
83
|
+
"defaultValue": "\"md\""
|
|
84
|
+
},
|
|
85
|
+
"minItemWidth": {
|
|
86
|
+
"type": "string",
|
|
87
|
+
"mutable": false,
|
|
88
|
+
"complexType": {
|
|
89
|
+
"original": "string",
|
|
90
|
+
"resolved": "string | undefined",
|
|
91
|
+
"references": {}
|
|
92
|
+
},
|
|
93
|
+
"required": false,
|
|
94
|
+
"optional": true,
|
|
95
|
+
"docs": {
|
|
96
|
+
"tags": [],
|
|
97
|
+
"text": "Largura m\u00EDnima por item para layout responsivo (auto-fit)."
|
|
98
|
+
},
|
|
99
|
+
"getter": false,
|
|
100
|
+
"setter": false,
|
|
101
|
+
"reflect": false,
|
|
102
|
+
"attribute": "min-item-width"
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -2,39 +2,90 @@
|
|
|
2
2
|
display: block;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
.
|
|
5
|
+
.field {
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
gap: 0.5rem;
|
|
6
9
|
width: 100%;
|
|
7
10
|
height: 2.75rem;
|
|
8
|
-
padding: 0
|
|
11
|
+
padding: 0 0.875rem;
|
|
9
12
|
border: 1px solid var(--ui-border);
|
|
10
13
|
border-radius: var(--ui-radius-sm);
|
|
11
14
|
background: var(--ui-panel);
|
|
12
|
-
color: var(--ui-foreground);
|
|
13
|
-
font-family: var(--ui-font-sans);
|
|
14
|
-
font-size: 0.875rem;
|
|
15
|
-
outline: none;
|
|
16
15
|
backdrop-filter: blur(22px);
|
|
17
16
|
transition: all var(--ui-duration) var(--ui-ease);
|
|
18
17
|
box-sizing: border-box;
|
|
19
18
|
}
|
|
20
19
|
|
|
21
|
-
.
|
|
22
|
-
color: var(--ui-
|
|
20
|
+
.field:hover:not(.disabled) {
|
|
21
|
+
border-color: var(--ui-border-strong);
|
|
23
22
|
}
|
|
24
23
|
|
|
25
|
-
.
|
|
24
|
+
.field:focus-within {
|
|
26
25
|
border-color: var(--ui-accent);
|
|
27
26
|
box-shadow: 0 0 0 2px var(--ui-ring);
|
|
28
27
|
}
|
|
29
28
|
|
|
30
|
-
.
|
|
29
|
+
.field.invalid {
|
|
30
|
+
border-color: var(--ui-danger);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.field.invalid:focus-within {
|
|
34
|
+
box-shadow: 0 0 0 2px color-mix(in srgb, var(--ui-danger) 40%, transparent);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.field.disabled {
|
|
31
38
|
opacity: 0.5;
|
|
32
39
|
pointer-events: none;
|
|
33
40
|
}
|
|
34
41
|
|
|
35
|
-
.input
|
|
36
|
-
|
|
42
|
+
.input {
|
|
43
|
+
flex: 1;
|
|
44
|
+
min-width: 0;
|
|
45
|
+
height: 100%;
|
|
46
|
+
border: none;
|
|
47
|
+
background: transparent;
|
|
48
|
+
color: var(--ui-foreground);
|
|
49
|
+
font-family: var(--ui-font-sans);
|
|
50
|
+
font-size: 0.875rem;
|
|
51
|
+
outline: none;
|
|
37
52
|
}
|
|
38
|
-
|
|
39
|
-
|
|
53
|
+
|
|
54
|
+
.input::placeholder {
|
|
55
|
+
color: var(--ui-text-faint);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* Slots de prefixo/sufixo (ícones). Vazios não ocupam espaço. */
|
|
59
|
+
.affix {
|
|
60
|
+
display: inline-flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
color: var(--ui-text-muted);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.affix::slotted(svg),
|
|
66
|
+
::slotted([slot="prefix"]),
|
|
67
|
+
::slotted([slot="suffix"]) {
|
|
68
|
+
display: inline-flex;
|
|
69
|
+
color: var(--ui-text-muted);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.clear {
|
|
73
|
+
display: inline-flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: center;
|
|
76
|
+
flex: none;
|
|
77
|
+
width: 1.25rem;
|
|
78
|
+
height: 1.25rem;
|
|
79
|
+
padding: 0;
|
|
80
|
+
border: none;
|
|
81
|
+
border-radius: var(--ui-radius-full);
|
|
82
|
+
background: var(--ui-chip);
|
|
83
|
+
color: var(--ui-text-muted);
|
|
84
|
+
cursor: pointer;
|
|
85
|
+
transition: all var(--ui-duration) var(--ui-ease);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.clear:hover {
|
|
89
|
+
color: var(--ui-foreground);
|
|
90
|
+
background: var(--ui-panel-strong);
|
|
40
91
|
}
|
|
@@ -9,6 +9,8 @@ export class UiInput {
|
|
|
9
9
|
this.disabled = false;
|
|
10
10
|
/** Marca o campo como inválido (estilo + aria-invalid). */
|
|
11
11
|
this.invalid = false;
|
|
12
|
+
/** Exibe um botão para limpar o valor quando preenchido. */
|
|
13
|
+
this.clearable = false;
|
|
12
14
|
this.onInput = (event) => {
|
|
13
15
|
const target = event.target;
|
|
14
16
|
this.value = target.value;
|
|
@@ -17,9 +19,15 @@ export class UiInput {
|
|
|
17
19
|
this.onChange = (event) => {
|
|
18
20
|
this.uiChange.emit(event.target.value);
|
|
19
21
|
};
|
|
22
|
+
this.clear = () => {
|
|
23
|
+
this.value = "";
|
|
24
|
+
this.uiInput.emit("");
|
|
25
|
+
this.uiChange.emit("");
|
|
26
|
+
};
|
|
20
27
|
}
|
|
21
28
|
render() {
|
|
22
|
-
|
|
29
|
+
const showClear = this.clearable && !!this.value && !this.disabled;
|
|
30
|
+
return (h(Host, { key: 'a87a7c9a1aba5631099f2f9c3a3083a9e7374854' }, h("div", { key: '04d3493ab32a4636f3f2540aaba0b30e4c018225', class: { field: true, invalid: this.invalid, disabled: this.disabled } }, h("span", { key: '66fa079a8b6ccc62dca78f4266d92800dd8727b0', class: "affix" }, h("slot", { key: 'c9db74515db3226bc730beb42a2a8f2d8eb6ee9f', name: "prefix" })), h("input", { key: 'a8f4db568e49ee22b5eeae078c4e4b3fdbc48983', class: "input", type: this.type, value: this.value, name: this.name, placeholder: this.placeholder, disabled: this.disabled, "aria-invalid": this.invalid ? "true" : null, onInput: this.onInput, onChange: this.onChange }), showClear && (h("button", { key: 'e38a2279db1b1c677274a6e22019bf3183ae1920', class: "clear", type: "button", "aria-label": "Limpar", onClick: this.clear }, h("svg", { key: '0982ea65d3b1598620953fcd600b1eb1945348ee', viewBox: "0 0 24 24", width: "14", height: "14", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round" }, h("path", { key: '26f833d4ccf8feab9f2ec4f4527b8c8e9c00d09b', d: "M18 6 6 18M6 6l12 12" })))), h("span", { key: '22c7d4d4a030157a4a9eb73ef0a260f4db56c848', class: "affix" }, h("slot", { key: 'fa74011b1237908aa9eea78f88294afcdf09f0f5', name: "suffix" })))));
|
|
23
31
|
}
|
|
24
32
|
static get is() { return "ui-input"; }
|
|
25
33
|
static get encapsulation() { return "shadow"; }
|
|
@@ -152,6 +160,26 @@ export class UiInput {
|
|
|
152
160
|
"setter": false,
|
|
153
161
|
"reflect": false,
|
|
154
162
|
"attribute": "name"
|
|
163
|
+
},
|
|
164
|
+
"clearable": {
|
|
165
|
+
"type": "boolean",
|
|
166
|
+
"mutable": false,
|
|
167
|
+
"complexType": {
|
|
168
|
+
"original": "boolean",
|
|
169
|
+
"resolved": "boolean",
|
|
170
|
+
"references": {}
|
|
171
|
+
},
|
|
172
|
+
"required": false,
|
|
173
|
+
"optional": false,
|
|
174
|
+
"docs": {
|
|
175
|
+
"tags": [],
|
|
176
|
+
"text": "Exibe um bot\u00E3o para limpar o valor quando preenchido."
|
|
177
|
+
},
|
|
178
|
+
"getter": false,
|
|
179
|
+
"setter": false,
|
|
180
|
+
"reflect": false,
|
|
181
|
+
"attribute": "clearable",
|
|
182
|
+
"defaultValue": "false"
|
|
155
183
|
}
|
|
156
184
|
};
|
|
157
185
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
export class UiLabel {
|
|
3
3
|
render() {
|
|
4
|
-
return (h(Host, { key: '
|
|
4
|
+
return (h(Host, { key: '15695a208223a3270e49d72972a49c26fe3acd4d' }, h("label", { key: 'a6d0290c845797368e59fa936b80c8fee55dbcb1', class: "label" }, h("slot", { key: 'daae42c194f0c31d69a82bfad95a97b85cf2cdf2' }))));
|
|
5
5
|
}
|
|
6
6
|
static get is() { return "ui-label"; }
|
|
7
7
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.pagination {
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
gap: 0.25rem;
|
|
9
|
+
font-family: var(--ui-font-sans);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.page {
|
|
13
|
+
display: inline-flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
min-width: 2.25rem;
|
|
17
|
+
height: 2.25rem;
|
|
18
|
+
padding: 0 0.5rem;
|
|
19
|
+
border: 1px solid var(--ui-border);
|
|
20
|
+
border-radius: var(--ui-radius-sm);
|
|
21
|
+
background: transparent;
|
|
22
|
+
color: var(--ui-foreground);
|
|
23
|
+
font-family: var(--ui-font-sans);
|
|
24
|
+
font-size: 0.875rem;
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
outline: none;
|
|
27
|
+
transition: all var(--ui-duration) var(--ui-ease);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.page:hover {
|
|
31
|
+
border-color: var(--ui-border-strong);
|
|
32
|
+
background: var(--ui-chip);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.page:focus-visible {
|
|
36
|
+
box-shadow: 0 0 0 2px var(--ui-ring);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.page:disabled {
|
|
40
|
+
pointer-events: none;
|
|
41
|
+
opacity: 0.5;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.page.active {
|
|
45
|
+
background: var(--ui-accent);
|
|
46
|
+
color: var(--ui-accent-contrast);
|
|
47
|
+
border-color: var(--ui-accent);
|
|
48
|
+
box-shadow: var(--ui-shadow-sm);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.ellipsis {
|
|
52
|
+
display: inline-flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
min-width: 2.25rem;
|
|
56
|
+
height: 2.25rem;
|
|
57
|
+
color: var(--ui-text-faint);
|
|
58
|
+
font-size: 0.875rem;
|
|
59
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
export class UiPagination {
|
|
3
|
+
constructor() {
|
|
4
|
+
/** Total de páginas. */
|
|
5
|
+
this.total = 1;
|
|
6
|
+
/** Página atual. */
|
|
7
|
+
this.current = 1;
|
|
8
|
+
/** Quantidade de páginas ao redor da atual. */
|
|
9
|
+
this.siblings = 1;
|
|
10
|
+
this.clamp = (page) => Math.min(Math.max(page, 1), Math.max(this.total, 1));
|
|
11
|
+
this.go = (page) => {
|
|
12
|
+
const next = this.clamp(page);
|
|
13
|
+
if (next === this.current)
|
|
14
|
+
return;
|
|
15
|
+
this.current = next;
|
|
16
|
+
this.uiChange.emit(next);
|
|
17
|
+
};
|
|
18
|
+
this.buildRange = () => {
|
|
19
|
+
const total = Math.max(this.total, 1);
|
|
20
|
+
const current = this.clamp(this.current);
|
|
21
|
+
const siblings = Math.max(this.siblings, 0);
|
|
22
|
+
const start = Math.max(current - siblings, 1);
|
|
23
|
+
const end = Math.min(current + siblings, total);
|
|
24
|
+
const pages = new Set([1, total]);
|
|
25
|
+
for (let page = start; page <= end; page += 1)
|
|
26
|
+
pages.add(page);
|
|
27
|
+
const sorted = Array.from(pages)
|
|
28
|
+
.filter((page) => page >= 1 && page <= total)
|
|
29
|
+
.sort((a, b) => a - b);
|
|
30
|
+
const result = [];
|
|
31
|
+
let previous = 0;
|
|
32
|
+
for (const page of sorted) {
|
|
33
|
+
if (previous && page - previous > 1)
|
|
34
|
+
result.push("...");
|
|
35
|
+
result.push(page);
|
|
36
|
+
previous = page;
|
|
37
|
+
}
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
const total = Math.max(this.total, 1);
|
|
43
|
+
const current = this.clamp(this.current);
|
|
44
|
+
const entries = this.buildRange();
|
|
45
|
+
return (h(Host, { key: '405a1c41db3850f25ffc14a053b12c0767809b1e' }, h("nav", { key: 'bd9baa3307cb5576ca81ab82653b44ccd4cb0385', class: "pagination", role: "navigation", "aria-label": "Pagina\u00E7\u00E3o" }, h("button", { key: '8efdfeb278037fabab6b82ba4083a7d23a00d612', class: "page nav", type: "button", "aria-label": "P\u00E1gina anterior", disabled: current <= 1, onClick: () => this.go(current - 1) }, "\u2039"), entries.map((entry, index) => {
|
|
46
|
+
if (entry === "...") {
|
|
47
|
+
return (h("span", { key: `ellipsis-${index}`, class: "ellipsis", "aria-hidden": "true" }, "\u2026"));
|
|
48
|
+
}
|
|
49
|
+
const active = entry === current;
|
|
50
|
+
return (h("button", { key: entry, class: { page: true, active }, type: "button", "aria-label": `Página ${entry}`, "aria-current": active ? "page" : undefined, onClick: () => this.go(entry) }, entry));
|
|
51
|
+
}), h("button", { key: '5ba13b9a59857423e65a4d10630eb66cc32c30fe', class: "page nav", type: "button", "aria-label": "Pr\u00F3xima p\u00E1gina", disabled: current >= total, onClick: () => this.go(current + 1) }, "\u203A"))));
|
|
52
|
+
}
|
|
53
|
+
static get is() { return "ui-pagination"; }
|
|
54
|
+
static get encapsulation() { return "shadow"; }
|
|
55
|
+
static get originalStyleUrls() {
|
|
56
|
+
return {
|
|
57
|
+
"$": ["ui-pagination.css"]
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
static get styleUrls() {
|
|
61
|
+
return {
|
|
62
|
+
"$": ["ui-pagination.css"]
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
static get properties() {
|
|
66
|
+
return {
|
|
67
|
+
"total": {
|
|
68
|
+
"type": "number",
|
|
69
|
+
"mutable": false,
|
|
70
|
+
"complexType": {
|
|
71
|
+
"original": "number",
|
|
72
|
+
"resolved": "number",
|
|
73
|
+
"references": {}
|
|
74
|
+
},
|
|
75
|
+
"required": false,
|
|
76
|
+
"optional": false,
|
|
77
|
+
"docs": {
|
|
78
|
+
"tags": [],
|
|
79
|
+
"text": "Total de p\u00E1ginas."
|
|
80
|
+
},
|
|
81
|
+
"getter": false,
|
|
82
|
+
"setter": false,
|
|
83
|
+
"reflect": false,
|
|
84
|
+
"attribute": "total",
|
|
85
|
+
"defaultValue": "1"
|
|
86
|
+
},
|
|
87
|
+
"current": {
|
|
88
|
+
"type": "number",
|
|
89
|
+
"mutable": true,
|
|
90
|
+
"complexType": {
|
|
91
|
+
"original": "number",
|
|
92
|
+
"resolved": "number",
|
|
93
|
+
"references": {}
|
|
94
|
+
},
|
|
95
|
+
"required": false,
|
|
96
|
+
"optional": false,
|
|
97
|
+
"docs": {
|
|
98
|
+
"tags": [],
|
|
99
|
+
"text": "P\u00E1gina atual."
|
|
100
|
+
},
|
|
101
|
+
"getter": false,
|
|
102
|
+
"setter": false,
|
|
103
|
+
"reflect": true,
|
|
104
|
+
"attribute": "current",
|
|
105
|
+
"defaultValue": "1"
|
|
106
|
+
},
|
|
107
|
+
"siblings": {
|
|
108
|
+
"type": "number",
|
|
109
|
+
"mutable": false,
|
|
110
|
+
"complexType": {
|
|
111
|
+
"original": "number",
|
|
112
|
+
"resolved": "number",
|
|
113
|
+
"references": {}
|
|
114
|
+
},
|
|
115
|
+
"required": false,
|
|
116
|
+
"optional": false,
|
|
117
|
+
"docs": {
|
|
118
|
+
"tags": [],
|
|
119
|
+
"text": "Quantidade de p\u00E1ginas ao redor da atual."
|
|
120
|
+
},
|
|
121
|
+
"getter": false,
|
|
122
|
+
"setter": false,
|
|
123
|
+
"reflect": false,
|
|
124
|
+
"attribute": "siblings",
|
|
125
|
+
"defaultValue": "1"
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
static get events() {
|
|
130
|
+
return [{
|
|
131
|
+
"method": "uiChange",
|
|
132
|
+
"name": "uiChange",
|
|
133
|
+
"bubbles": true,
|
|
134
|
+
"cancelable": true,
|
|
135
|
+
"composed": true,
|
|
136
|
+
"docs": {
|
|
137
|
+
"tags": [],
|
|
138
|
+
"text": "Emitido quando a p\u00E1gina muda."
|
|
139
|
+
},
|
|
140
|
+
"complexType": {
|
|
141
|
+
"original": "number",
|
|
142
|
+
"resolved": "number",
|
|
143
|
+
"references": {}
|
|
144
|
+
}
|
|
145
|
+
}];
|
|
146
|
+
}
|
|
147
|
+
}
|