@ds-autonomie/web-components 1.7.0 → 1.8.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/CHANGELOG.md +13 -0
- package/dist/chunks/{chunk.ADVUEL4K.js → chunk.22WSILHD.js} +1 -1
- package/dist/chunks/{chunk.AQC66RY2.js → chunk.2AEUQXKH.js} +18 -1
- package/dist/chunks/chunk.2AHY5V6G.js +25 -0
- package/dist/chunks/{chunk.RBJL56T2.js → chunk.43PVVN7Q.js} +1 -1
- package/dist/chunks/chunk.5L7UO75X.js +17 -0
- package/dist/chunks/chunk.65JZEQ4F.js +33 -0
- package/dist/chunks/{chunk.7PKGNYXP.js → chunk.6A2LWKQY.js} +22 -1
- package/dist/chunks/chunk.6OP6GCU4.js +89 -0
- package/dist/chunks/{chunk.HXH4JLAN.js → chunk.6RX5APL3.js} +1 -1
- package/dist/chunks/{chunk.XVDH3KHQ.js → chunk.7KYHO6CO.js} +4 -2
- package/dist/chunks/{chunk.ZCKAXIC4.js → chunk.7UXBTLEE.js} +2 -2
- package/dist/chunks/{chunk.7FSWPNRP.js → chunk.7XNMTM6N.js} +1 -1
- package/dist/chunks/{chunk.X6ZGA6WS.js → chunk.A5II52AY.js} +20 -6
- package/dist/chunks/{chunk.AJ4QV4YB.js → chunk.ADG7SYDH.js} +2 -2
- package/dist/chunks/chunk.AFFFEIW7.js +154 -0
- package/dist/chunks/chunk.AHPXKIVU.js +24 -0
- package/dist/chunks/{chunk.MCMUWBT5.js → chunk.AXJZDS4O.js} +6 -1
- package/dist/chunks/{chunk.D5MIBH2P.js → chunk.B3VBH7AS.js} +44 -178
- package/dist/chunks/{chunk.K2ICEURU.js → chunk.B5DEC3ZW.js} +15 -2
- package/dist/chunks/{chunk.YDCBGMSA.js → chunk.BEGWFCAR.js} +28 -0
- package/dist/chunks/chunk.C33YMWL6.js +33 -0
- package/dist/chunks/{chunk.PCJUYERL.js → chunk.C7BQI7NH.js} +1 -1
- package/dist/chunks/chunk.CHKVYEHB.js +53 -0
- package/dist/chunks/{chunk.R5PR2MDK.js → chunk.CW4YJC4U.js} +1 -1
- package/dist/chunks/{chunk.GXQ7CTJX.js → chunk.D2VOYAK5.js} +9 -3
- package/dist/chunks/{chunk.5T654YBW.js → chunk.DFH66YHJ.js} +1 -1
- package/dist/chunks/{chunk.R4PCVUXB.js → chunk.DIC5NUF5.js} +32 -10
- package/dist/chunks/{chunk.B6CXFMFM.js → chunk.DJDCH3MP.js} +1 -1
- package/dist/chunks/{chunk.QBPZ6I5Q.js → chunk.DMP5NRB3.js} +2 -2
- package/dist/chunks/{chunk.GENB7E6Z.js → chunk.DNSF5O4C.js} +1 -1
- package/dist/chunks/{chunk.5LSEWF5M.js → chunk.F4KJFS2T.js} +1 -1
- package/dist/chunks/{chunk.L5HKY6WB.js → chunk.F6EDQPCA.js} +4 -4
- package/dist/chunks/chunk.FWOMF5BY.js +23 -0
- package/dist/chunks/{chunk.PZTXAAW2.js → chunk.H7OOLAC7.js} +1 -1
- package/dist/chunks/chunk.HB7A2UQ7.js +16 -0
- package/dist/chunks/chunk.HL632DKM.js +86 -0
- package/dist/chunks/{chunk.GS7HSU6O.js → chunk.HWR5JOYI.js} +1 -1
- package/dist/chunks/{chunk.CWMR6PEK.js → chunk.HXWTBL6A.js} +1 -1
- package/dist/chunks/{chunk.Z2QW2HUR.js → chunk.ICD5HBUY.js} +5 -2
- package/dist/chunks/{chunk.LSECPSSR.js → chunk.IDMVVAVX.js} +1 -1
- package/dist/chunks/{chunk.Z6TBD2AC.js → chunk.INLQD4SQ.js} +1 -2
- package/dist/chunks/{chunk.PQD7VKIK.js → chunk.JGWZGEQY.js} +1 -1
- package/dist/chunks/chunk.K55HKFUM.js +55 -0
- package/dist/chunks/{chunk.KG6MIENB.js → chunk.KY6SFO3D.js} +1 -1
- package/dist/chunks/{chunk.Y5M7ZKHX.js → chunk.KZIAHLAV.js} +38 -0
- package/dist/chunks/{chunk.TFMB54OO.js → chunk.L5YSEAAK.js} +1 -1
- package/dist/chunks/chunk.M2SPGS54.js +31 -0
- package/dist/chunks/{chunk.4ABNA6LY.js → chunk.MIO6K4QD.js} +1 -1
- package/dist/chunks/{chunk.ZR7AGQFC.js → chunk.MUBB5GXY.js} +1 -1
- package/dist/chunks/chunk.MVKY65HC.js +33 -0
- package/dist/chunks/{chunk.UTAUMIPE.js → chunk.MZMKGGW2.js} +1 -1
- package/dist/chunks/chunk.N6EX6BDJ.js +128 -0
- package/dist/chunks/chunk.NEIICCKM.js +211 -0
- package/dist/chunks/{chunk.AXG2LFB3.js → chunk.O3TGEE3I.js} +2 -1
- package/dist/chunks/chunk.OBTE6PY7.js +41 -0
- package/dist/chunks/chunk.OIWFTO2A.js +156 -0
- package/dist/chunks/{chunk.YZ66DKLU.js → chunk.OQ2AY2BC.js} +1 -1
- package/dist/chunks/chunk.OSR4H2UW.js +17 -0
- package/dist/chunks/chunk.PO3AZ63O.js +18 -0
- package/dist/chunks/{chunk.XRHDURFE.js → chunk.Q255SJAB.js} +1 -1
- package/dist/chunks/chunk.RB5YRDTE.js +77 -0
- package/dist/chunks/{chunk.EBCLOXNV.js → chunk.SEH7BBNZ.js} +1 -1
- package/dist/chunks/chunk.TB6DCJYX.js +57 -0
- package/dist/chunks/{chunk.FKKOUYXE.js → chunk.TFXRULTL.js} +2 -2
- package/dist/chunks/{chunk.SL4M42DS.js → chunk.TRMEXXU2.js} +4 -4
- package/dist/chunks/{chunk.RC2LGXYT.js → chunk.VN7U4QIC.js} +1 -1
- package/dist/chunks/{chunk.WGN7OZLZ.js → chunk.VZIVZSLP.js} +3 -2
- package/dist/chunks/{chunk.NIYQMA5Y.js → chunk.WMEXYRBL.js} +1 -1
- package/dist/chunks/{chunk.IAKOROM4.js → chunk.WTGBJNXJ.js} +1 -1
- package/dist/chunks/{chunk.ZQQCFKOX.js → chunk.XEZX466O.js} +1 -1
- package/dist/chunks/{chunk.7RMRIPUN.js → chunk.YF45VJOV.js} +1 -1
- package/dist/chunks/chunk.Z4V2DJQS.js +44 -0
- package/dist/chunks/chunk.ZBTNUV7V.js +26 -0
- package/dist/chunks/{chunk.2PVIV5ZH.js → chunk.ZCNXAXKX.js} +9 -4
- package/dist/components/accordion/accordion.js +3 -2
- package/dist/components/alert/alert.js +6 -5
- package/dist/components/alert/alert.styles.js +1 -1
- package/dist/components/breadcrumb/breadcrumb.js +3 -2
- package/dist/components/breadcrumb-item/breadcrumb-item.js +3 -2
- package/dist/components/button/button.d.ts +2 -0
- package/dist/components/button/button.js +4 -3
- package/dist/components/checkbox/checkbox.d.ts +2 -0
- package/dist/components/checkbox/checkbox.js +3 -3
- package/dist/components/checkbox/checkbox.styles.js +2 -2
- package/dist/components/checkbox-group/checkbox-group.d.ts +4 -0
- package/dist/components/checkbox-group/checkbox-group.js +3 -3
- package/dist/components/checkbox-group/checkbox-group.styles.js +2 -2
- package/dist/components/combobox/combobox.js +9 -8
- package/dist/components/combobox/combobox.styles.js +2 -2
- package/dist/components/dialog/dialog.js +5 -4
- package/dist/components/drawer/drawer.js +5 -4
- package/dist/components/dropdown/dropdown.js +3 -2
- package/dist/components/error-message-panel/error-message-panel.js +3 -2
- package/dist/components/file-upload/file-upload.js +3 -3
- package/dist/components/file-upload/file-upload.styles.js +2 -2
- package/dist/components/format-bytes/format-bytes.js +3 -2
- package/dist/components/format-date/format-date.js +3 -2
- package/dist/components/format-number/format-number.js +3 -2
- package/dist/components/icon-button/icon-button.d.ts +2 -0
- package/dist/components/icon-button/icon-button.js +2 -2
- package/dist/components/icon-button/icon-button.styles.js +1 -1
- package/dist/components/input/input.js +5 -4
- package/dist/components/input/input.styles.js +2 -2
- package/dist/components/input-mask/input-mask.js +5 -4
- package/dist/components/input-mask/input-mask.styles.js +2 -2
- package/dist/components/input-phone/input-phone.js +13 -12
- package/dist/components/input-phone/input-phone.styles.js +2 -2
- package/dist/components/option/option.js +3 -2
- package/dist/components/pagination/pagination.d.ts +33 -0
- package/dist/components/pagination/pagination.js +37 -0
- package/dist/components/pagination/pagination.styles.d.ts +2 -0
- package/dist/components/pagination/pagination.styles.js +8 -0
- package/dist/components/pagination-button/pagination-button.d.ts +27 -0
- package/dist/components/pagination-button/pagination-button.js +12 -0
- package/dist/components/pagination-button/pagination-button.styles.d.ts +2 -0
- package/dist/components/pagination-button/pagination-button.styles.js +9 -0
- package/dist/components/progress-bar/progress-bar.js +3 -2
- package/dist/components/radio/radio.js +2 -2
- package/dist/components/radio/radio.styles.js +1 -1
- package/dist/components/radio-group/radio-group.d.ts +4 -0
- package/dist/components/radio-group/radio-group.js +4 -3
- package/dist/components/radio-group/radio-group.styles.js +2 -2
- package/dist/components/relative-time/relative-time.js +3 -2
- package/dist/components/select/select.js +8 -7
- package/dist/components/select/select.styles.js +2 -2
- package/dist/components/spinner/spinner.js +3 -2
- package/dist/components/step/step.js +3 -2
- package/dist/components/tab/tab.js +3 -2
- package/dist/components/tab-group/tab-group.js +3 -2
- package/dist/components/table/defs.d.ts +6 -0
- package/dist/components/table/defs.js +9 -0
- package/dist/components/table/table-body/table-body.d.ts +19 -0
- package/dist/components/table/table-body/table-body.js +10 -0
- package/dist/components/table/table-body/table-body.styles.d.ts +2 -0
- package/dist/components/table/table-body/table-body.styles.js +8 -0
- package/dist/components/table/table-caption/table-caption.d.ts +21 -0
- package/dist/components/table/table-caption/table-caption.js +13 -0
- package/dist/components/table/table-caption/table-caption.styles.d.ts +2 -0
- package/dist/components/table/table-caption/table-caption.styles.js +8 -0
- package/dist/components/table/table-cell/table-cell.d.ts +19 -0
- package/dist/components/table/table-cell/table-cell.js +10 -0
- package/dist/components/table/table-cell/table-cell.styles.d.ts +2 -0
- package/dist/components/table/table-cell/table-cell.styles.js +8 -0
- package/dist/components/table/table-head/table-head.d.ts +19 -0
- package/dist/components/table/table-head/table-head.js +10 -0
- package/dist/components/table/table-head/table-head.styles.d.ts +2 -0
- package/dist/components/table/table-head/table-head.styles.js +8 -0
- package/dist/components/table/table-header-cell/table-header-cell.d.ts +44 -0
- package/dist/components/table/table-header-cell/table-header-cell.js +15 -0
- package/dist/components/table/table-header-cell/table-header-cell.styles.d.ts +2 -0
- package/dist/components/table/table-header-cell/table-header-cell.styles.js +8 -0
- package/dist/components/table/table-header-row/table-header-row.d.ts +17 -0
- package/dist/components/table/table-header-row/table-header-row.js +12 -0
- package/dist/components/table/table-header-row/table-header-row.styles.d.ts +2 -0
- package/dist/components/table/table-header-row/table-header-row.styles.js +8 -0
- package/dist/components/table/table-row/table-row.d.ts +23 -0
- package/dist/components/table/table-row/table-row.js +10 -0
- package/dist/components/table/table-row/table-row.styles.d.ts +2 -0
- package/dist/components/table/table-row/table-row.styles.js +8 -0
- package/dist/components/table/table.d.ts +30 -0
- package/dist/components/table/table.js +11 -0
- package/dist/components/table/table.styles.d.ts +2 -0
- package/dist/components/table/table.styles.js +8 -0
- package/dist/components/table/types.d.ts +5 -0
- package/dist/components/table/types.js +12 -0
- package/dist/components/table-container/table-container.d.ts +17 -0
- package/dist/components/table-container/table-container.js +10 -0
- package/dist/components/table-container/table-container.styles.d.ts +2 -0
- package/dist/components/table-container/table-container.styles.js +8 -0
- package/dist/components/tag/tag.d.ts +2 -0
- package/dist/components/tag/tag.js +5 -4
- package/dist/components/textarea/textarea.js +3 -3
- package/dist/components/textarea/textarea.styles.js +2 -2
- package/dist/components/tooltip/tooltip.js +3 -2
- package/dist/components/tree/tree.js +8 -7
- package/dist/components/tree-item/tree-item.js +7 -6
- package/dist/custom-elements.json +5302 -3882
- package/dist/design-system.d.ts +11 -0
- package/dist/design-system.js +145 -88
- package/dist/events/dsa-page-change.d.ts +9 -0
- package/dist/events/dsa-page-change.js +1 -0
- package/dist/events/dsa-table-header-cell-sort.d.ts +11 -0
- package/dist/events/dsa-table-header-cell-sort.js +1 -0
- package/dist/events/events.d.ts +2 -0
- package/dist/internal/components/button-group/button-group.js +1 -1
- package/dist/styles/form-control.styles.js +2 -1
- package/dist/themes/dsa-wc-theme.css +63 -0
- package/dist/themes/dsa-wc-theme.min.css +1 -1
- package/dist/themes/dsa-wc-theme.styles.js +68 -0
- package/dist/translations/en-gb.js +2 -1
- package/dist/translations/en.js +2 -1
- package/dist/translations/fr.js +2 -1
- package/dist/utilities/localize.d.ts +11 -0
- package/dist/utilities/localize.js +2 -1
- package/dist/vscode.html-custom-data.json +484 -262
- package/dist/web-types.json +1896 -1189
- package/package.json +1 -1
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import {
|
|
2
|
+
pagination_styles_default
|
|
3
|
+
} from "./chunk.N6EX6BDJ.js";
|
|
4
|
+
import {
|
|
5
|
+
HasSlotController
|
|
6
|
+
} from "./chunk.YIY5RM53.js";
|
|
7
|
+
import {
|
|
8
|
+
LocalizeController
|
|
9
|
+
} from "./chunk.KZIAHLAV.js";
|
|
10
|
+
import {
|
|
11
|
+
watch
|
|
12
|
+
} from "./chunk.6IH66JBY.js";
|
|
13
|
+
import {
|
|
14
|
+
ShoelaceElement
|
|
15
|
+
} from "./chunk.YCXTCVAZ.js";
|
|
16
|
+
import {
|
|
17
|
+
__decorateClass
|
|
18
|
+
} from "./chunk.6M63UXML.js";
|
|
19
|
+
|
|
20
|
+
// src/components/pagination/pagination.ts
|
|
21
|
+
import { html } from "lit";
|
|
22
|
+
import { customElement, property, query, state } from "lit/decorators.js";
|
|
23
|
+
var MIN_PAGES_FOR_SUSPENDED_PAGINATION = 8;
|
|
24
|
+
var DSAPagination = class extends ShoelaceElement {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(...arguments);
|
|
27
|
+
this.hasSlotController = new HasSlotController(this, "[default]");
|
|
28
|
+
this.localize = new LocalizeController(this);
|
|
29
|
+
this.totalPages = 1;
|
|
30
|
+
this.currentPage = 1;
|
|
31
|
+
this.totalItems = 1;
|
|
32
|
+
this.itemsPerPage = 10;
|
|
33
|
+
}
|
|
34
|
+
handlePageButtonClick(event) {
|
|
35
|
+
if (event.target.value !== -1 && !event.target.selected) {
|
|
36
|
+
this.emit("dsa-page-change", {
|
|
37
|
+
detail: { page: `${event.target.value}` }
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
handlePageInputChange(event) {
|
|
42
|
+
this.emit("dsa-page-change", {
|
|
43
|
+
detail: { page: event.target.value }
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
renderButtonsRange(start, end) {
|
|
47
|
+
return Array.from({ length: end - start + 1 }, (_, i) => {
|
|
48
|
+
const pageNumber = start + i;
|
|
49
|
+
return html`<dsa-pagination-button
|
|
50
|
+
value=${pageNumber}
|
|
51
|
+
?selected=${this.currentPage === pageNumber}
|
|
52
|
+
></dsa-pagination-button>`;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
getPageButtons() {
|
|
56
|
+
if (this.totalPages < MIN_PAGES_FOR_SUSPENDED_PAGINATION) {
|
|
57
|
+
return this.renderButtonsRange(1, this.totalPages);
|
|
58
|
+
} else if (this.currentPage < 4 || this.currentPage > this.totalPages - 3) {
|
|
59
|
+
return html`
|
|
60
|
+
${this.renderButtonsRange(1, 3)}
|
|
61
|
+
<dsa-pagination-button value="-1"></dsa-pagination-button>
|
|
62
|
+
${this.renderButtonsRange(this.totalPages - 2, this.totalPages)}
|
|
63
|
+
`;
|
|
64
|
+
} else {
|
|
65
|
+
return html`
|
|
66
|
+
<dsa-pagination-button value="1"></dsa-pagination-button>
|
|
67
|
+
<dsa-pagination-button value="-1"></dsa-pagination-button>
|
|
68
|
+
${this.renderButtonsRange(this.currentPage - 1, this.currentPage + 1)}
|
|
69
|
+
<dsa-pagination-button value="-1"></dsa-pagination-button>
|
|
70
|
+
<dsa-pagination-button
|
|
71
|
+
value="${this.totalPages}"
|
|
72
|
+
></dsa-pagination-button>
|
|
73
|
+
`;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
handleDefaultSlotChange() {
|
|
77
|
+
const select = this.querySelector("dsa-select");
|
|
78
|
+
select == null ? void 0 : select.setAttribute("size", "small");
|
|
79
|
+
select == null ? void 0 : select.setAttribute("title", this.localize.term("linesPerPage"));
|
|
80
|
+
}
|
|
81
|
+
updateTotalPages() {
|
|
82
|
+
this.totalPages = Math.ceil(this.totalItems / this.itemsPerPage);
|
|
83
|
+
}
|
|
84
|
+
render() {
|
|
85
|
+
const fromItem = 1 + (this.currentPage - 1) * this.itemsPerPage;
|
|
86
|
+
const toItem = this.currentPage * this.itemsPerPage;
|
|
87
|
+
return html`
|
|
88
|
+
<div class="pagination">
|
|
89
|
+
<!-- Mobile Navigation -->
|
|
90
|
+
<nav
|
|
91
|
+
class="pagination__navigation--mobile"
|
|
92
|
+
arial-label=${this.localize.term("pagination")}
|
|
93
|
+
>
|
|
94
|
+
<dsa-pagination-button
|
|
95
|
+
value="${this.currentPage - 1}"
|
|
96
|
+
?disabled=${this.currentPage < 2}
|
|
97
|
+
class="pagination__navigation__button--mobile"
|
|
98
|
+
>
|
|
99
|
+
<dsa-icon name="chevron_left" slot="prefix"></dsa-icon
|
|
100
|
+
>${this.localize.term("previousPage")}
|
|
101
|
+
</dsa-pagination-button>
|
|
102
|
+
<div class="pagination__navigation__page-input">
|
|
103
|
+
<dsa-input
|
|
104
|
+
title=${this.localize.term("page")}
|
|
105
|
+
variant="layer"
|
|
106
|
+
size="small"
|
|
107
|
+
type="number"
|
|
108
|
+
inputmode="numeric"
|
|
109
|
+
min="1"
|
|
110
|
+
max=${this.totalPages}
|
|
111
|
+
value=${this.currentPage}
|
|
112
|
+
@dsa-change=${this.handlePageInputChange}
|
|
113
|
+
class="pagination__input"
|
|
114
|
+
>
|
|
115
|
+
</dsa-input>
|
|
116
|
+
<p>${this.localize.term("ofTotal", this.totalPages)}</p>
|
|
117
|
+
</div>
|
|
118
|
+
<dsa-pagination-button
|
|
119
|
+
value="${this.currentPage + 1}"
|
|
120
|
+
?disabled=${this.currentPage > this.totalPages - 1}
|
|
121
|
+
class="pagination__navigation__button--mobile"
|
|
122
|
+
>${this.localize.term("nextPage")}
|
|
123
|
+
<dsa-icon name="chevron_right" slot="suffix"></dsa-icon>
|
|
124
|
+
</dsa-pagination-button>
|
|
125
|
+
</nav>
|
|
126
|
+
|
|
127
|
+
<!-- Items displayed and items per page -->
|
|
128
|
+
<div class="pagination__items">
|
|
129
|
+
<p
|
|
130
|
+
aria-label=${this.localize.term(
|
|
131
|
+
"paginationResultsAriaLabel",
|
|
132
|
+
fromItem,
|
|
133
|
+
toItem,
|
|
134
|
+
this.totalItems
|
|
135
|
+
)}
|
|
136
|
+
>
|
|
137
|
+
${this.localize.term(
|
|
138
|
+
"paginationResults",
|
|
139
|
+
fromItem,
|
|
140
|
+
toItem,
|
|
141
|
+
this.totalItems
|
|
142
|
+
)}
|
|
143
|
+
</p>
|
|
144
|
+
|
|
145
|
+
${this.hasSlotController.test("[default]") ? html`<dsa-divider vertical="true" class="divider"></dsa-divider>
|
|
146
|
+
|
|
147
|
+
<div class="pagination__itemsperpage">
|
|
148
|
+
<p>${this.localize.term("linesPerPage")}</p>
|
|
149
|
+
<slot @slotchange=${this.handleDefaultSlotChange}></slot>
|
|
150
|
+
</div>` : ""}
|
|
151
|
+
</div>
|
|
152
|
+
|
|
153
|
+
<!-- Desktop Navigation -->
|
|
154
|
+
<nav
|
|
155
|
+
class="pagination__navigation--desktop"
|
|
156
|
+
arial-label=${this.localize.term("pagination")}
|
|
157
|
+
>
|
|
158
|
+
<dsa-internal-button-group
|
|
159
|
+
squeezed
|
|
160
|
+
horizontal
|
|
161
|
+
@click=${this.handlePageButtonClick}
|
|
162
|
+
>
|
|
163
|
+
<dsa-pagination-button
|
|
164
|
+
value="${this.currentPage - 1}"
|
|
165
|
+
?disabled=${this.currentPage < 2}
|
|
166
|
+
>
|
|
167
|
+
<dsa-icon name="chevron_left" slot="prefix"></dsa-icon>
|
|
168
|
+
${this.localize.term("previousPage")}</dsa-pagination-button
|
|
169
|
+
>
|
|
170
|
+
${this.getPageButtons()}
|
|
171
|
+
<dsa-pagination-button
|
|
172
|
+
value="${this.currentPage + 1}"
|
|
173
|
+
?disabled=${this.currentPage > this.totalPages - 1}
|
|
174
|
+
>${this.localize.term("nextPage")}
|
|
175
|
+
<dsa-icon name="chevron_right" slot="suffix"></dsa-icon>
|
|
176
|
+
</dsa-pagination-button>
|
|
177
|
+
</dsa-internal-button-group>
|
|
178
|
+
</nav>
|
|
179
|
+
</div>
|
|
180
|
+
`;
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
DSAPagination.styles = pagination_styles_default;
|
|
184
|
+
__decorateClass([
|
|
185
|
+
query(".pagination__navigation--desktop")
|
|
186
|
+
], DSAPagination.prototype, "desktopNavigation", 2);
|
|
187
|
+
__decorateClass([
|
|
188
|
+
query(".pagination__navigation--mobile")
|
|
189
|
+
], DSAPagination.prototype, "mobileNavigation", 2);
|
|
190
|
+
__decorateClass([
|
|
191
|
+
state()
|
|
192
|
+
], DSAPagination.prototype, "totalPages", 2);
|
|
193
|
+
__decorateClass([
|
|
194
|
+
property({ type: Number, attribute: "current-page" })
|
|
195
|
+
], DSAPagination.prototype, "currentPage", 2);
|
|
196
|
+
__decorateClass([
|
|
197
|
+
property({ type: Number, attribute: "total-items" })
|
|
198
|
+
], DSAPagination.prototype, "totalItems", 2);
|
|
199
|
+
__decorateClass([
|
|
200
|
+
property({ type: Number, attribute: "items-per-page" })
|
|
201
|
+
], DSAPagination.prototype, "itemsPerPage", 2);
|
|
202
|
+
__decorateClass([
|
|
203
|
+
watch(["totalItems", "itemsPerPage"])
|
|
204
|
+
], DSAPagination.prototype, "updateTotalPages", 1);
|
|
205
|
+
DSAPagination = __decorateClass([
|
|
206
|
+
customElement("dsa-pagination")
|
|
207
|
+
], DSAPagination);
|
|
208
|
+
|
|
209
|
+
export {
|
|
210
|
+
DSAPagination
|
|
211
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {
|
|
2
|
+
table_row_styles_default
|
|
3
|
+
} from "./chunk.Z4V2DJQS.js";
|
|
4
|
+
import {
|
|
5
|
+
ShoelaceElement
|
|
6
|
+
} from "./chunk.YCXTCVAZ.js";
|
|
7
|
+
import {
|
|
8
|
+
__decorateClass
|
|
9
|
+
} from "./chunk.6M63UXML.js";
|
|
10
|
+
|
|
11
|
+
// src/components/table/table-row/table-row.ts
|
|
12
|
+
import { html } from "lit";
|
|
13
|
+
import { customElement, property } from "lit/decorators.js";
|
|
14
|
+
var DSATableRow = class extends ShoelaceElement {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.role = "row";
|
|
18
|
+
this.size = "medium";
|
|
19
|
+
this.selected = false;
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
return html` <slot></slot> `;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
DSATableRow.styles = table_row_styles_default;
|
|
26
|
+
__decorateClass([
|
|
27
|
+
property({ reflect: true })
|
|
28
|
+
], DSATableRow.prototype, "role", 2);
|
|
29
|
+
__decorateClass([
|
|
30
|
+
property({ reflect: true })
|
|
31
|
+
], DSATableRow.prototype, "size", 2);
|
|
32
|
+
__decorateClass([
|
|
33
|
+
property({ type: Boolean, reflect: true })
|
|
34
|
+
], DSATableRow.prototype, "selected", 2);
|
|
35
|
+
DSATableRow = __decorateClass([
|
|
36
|
+
customElement("dsa-table-row")
|
|
37
|
+
], DSATableRow);
|
|
38
|
+
|
|
39
|
+
export {
|
|
40
|
+
DSATableRow
|
|
41
|
+
};
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DSATableCell
|
|
3
|
+
} from "./chunk.C33YMWL6.js";
|
|
4
|
+
import {
|
|
5
|
+
table_header_cell_styles_default
|
|
6
|
+
} from "./chunk.6OP6GCU4.js";
|
|
7
|
+
import {
|
|
8
|
+
LocalizeController
|
|
9
|
+
} from "./chunk.KZIAHLAV.js";
|
|
10
|
+
import {
|
|
11
|
+
TABLE_SORT_CYCLE
|
|
12
|
+
} from "./chunk.HB7A2UQ7.js";
|
|
13
|
+
import {
|
|
14
|
+
watch
|
|
15
|
+
} from "./chunk.6IH66JBY.js";
|
|
16
|
+
import {
|
|
17
|
+
__decorateClass
|
|
18
|
+
} from "./chunk.6M63UXML.js";
|
|
19
|
+
|
|
20
|
+
// src/components/table/table-header-cell/table-header-cell.ts
|
|
21
|
+
import { html } from "lit";
|
|
22
|
+
import { customElement, property, query, state } from "lit/decorators.js";
|
|
23
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
24
|
+
var DSATableHeaderCell = class extends DSATableCell {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(...arguments);
|
|
27
|
+
this.localize = new LocalizeController(this);
|
|
28
|
+
this.nextSortDirection = this.getNextSortDirection();
|
|
29
|
+
this.isHovered = false;
|
|
30
|
+
this.role = "columnheader";
|
|
31
|
+
this.sortable = false;
|
|
32
|
+
this.alignment = "left";
|
|
33
|
+
this.sortDirection = "none" /* NONE */;
|
|
34
|
+
}
|
|
35
|
+
handleSort() {
|
|
36
|
+
const newSortDirection = this.getNextSortDirection();
|
|
37
|
+
this.emit("dsa-table-header-cell-sort", {
|
|
38
|
+
detail: {
|
|
39
|
+
oldSortDirection: this.sortDirection,
|
|
40
|
+
sortDirection: newSortDirection
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
this.sortDirection = newSortDirection;
|
|
44
|
+
this.isHovered = false;
|
|
45
|
+
}
|
|
46
|
+
getNextSortDirection() {
|
|
47
|
+
const currentDirectionIndex = TABLE_SORT_CYCLE.findIndex(
|
|
48
|
+
(direction) => direction === this.sortDirection
|
|
49
|
+
);
|
|
50
|
+
let nextDirectionIndex = currentDirectionIndex + 1;
|
|
51
|
+
if (TABLE_SORT_CYCLE[nextDirectionIndex] === void 0) {
|
|
52
|
+
nextDirectionIndex = 0;
|
|
53
|
+
}
|
|
54
|
+
const nextDirection = TABLE_SORT_CYCLE[nextDirectionIndex];
|
|
55
|
+
return nextDirection;
|
|
56
|
+
}
|
|
57
|
+
handleMouseOver() {
|
|
58
|
+
this.isHovered = true;
|
|
59
|
+
}
|
|
60
|
+
handleMouseOut() {
|
|
61
|
+
this.isHovered = false;
|
|
62
|
+
}
|
|
63
|
+
handleSortableChange() {
|
|
64
|
+
if (this.sortable) {
|
|
65
|
+
this.setAttribute("aria-sort", this.sortDirection);
|
|
66
|
+
} else {
|
|
67
|
+
this.removeAttribute("aria-sort");
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
handleSortDirectionChange() {
|
|
71
|
+
if (this.sortable) {
|
|
72
|
+
this.setAttribute("aria-sort", this.sortDirection);
|
|
73
|
+
this.nextSortDirection = this.getNextSortDirection();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/** Simulates a click on the sort button. */
|
|
77
|
+
click() {
|
|
78
|
+
this.button.click();
|
|
79
|
+
}
|
|
80
|
+
/** Sets focus on the sort button. */
|
|
81
|
+
focus(options) {
|
|
82
|
+
this.button.focus(options);
|
|
83
|
+
}
|
|
84
|
+
/** Removes focus from the sort button. */
|
|
85
|
+
blur() {
|
|
86
|
+
this.button.blur();
|
|
87
|
+
}
|
|
88
|
+
render() {
|
|
89
|
+
if (this.sortable) {
|
|
90
|
+
const visualSortDirection = this.isHovered ? this.nextSortDirection : this.sortDirection;
|
|
91
|
+
return html`
|
|
92
|
+
<button
|
|
93
|
+
type="button"
|
|
94
|
+
part="sort-button"
|
|
95
|
+
aria-label=${this.localize.term(
|
|
96
|
+
"nextSortDirection",
|
|
97
|
+
this.nextSortDirection
|
|
98
|
+
)}
|
|
99
|
+
class=${classMap({
|
|
100
|
+
"sort-button--align-right": this.alignment === "right",
|
|
101
|
+
"sort-button--align-left": this.alignment === "left"
|
|
102
|
+
})}
|
|
103
|
+
@click=${this.handleSort}
|
|
104
|
+
@mouseover=${this.handleMouseOver}
|
|
105
|
+
@mouseout=${this.handleMouseOut}
|
|
106
|
+
>
|
|
107
|
+
<slot></slot>
|
|
108
|
+
<dsa-icon
|
|
109
|
+
class=${classMap({
|
|
110
|
+
"sort-button-icon": true,
|
|
111
|
+
"sort-button--icon--ascending": visualSortDirection === "ascending" /* ASCENDING */,
|
|
112
|
+
"sort-button--icon--descending": visualSortDirection === "descending" /* DESCENDING */
|
|
113
|
+
})}
|
|
114
|
+
name="arrow_upward"
|
|
115
|
+
></dsa-icon>
|
|
116
|
+
</button>
|
|
117
|
+
`;
|
|
118
|
+
}
|
|
119
|
+
return html` <slot></slot> `;
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
DSATableHeaderCell.styles = table_header_cell_styles_default;
|
|
123
|
+
__decorateClass([
|
|
124
|
+
query('[part~="sort-button"]')
|
|
125
|
+
], DSATableHeaderCell.prototype, "button", 2);
|
|
126
|
+
__decorateClass([
|
|
127
|
+
state()
|
|
128
|
+
], DSATableHeaderCell.prototype, "nextSortDirection", 2);
|
|
129
|
+
__decorateClass([
|
|
130
|
+
state()
|
|
131
|
+
], DSATableHeaderCell.prototype, "isHovered", 2);
|
|
132
|
+
__decorateClass([
|
|
133
|
+
property({ reflect: true })
|
|
134
|
+
], DSATableHeaderCell.prototype, "role", 2);
|
|
135
|
+
__decorateClass([
|
|
136
|
+
property({ type: Boolean, reflect: true })
|
|
137
|
+
], DSATableHeaderCell.prototype, "sortable", 2);
|
|
138
|
+
__decorateClass([
|
|
139
|
+
property()
|
|
140
|
+
], DSATableHeaderCell.prototype, "alignment", 2);
|
|
141
|
+
__decorateClass([
|
|
142
|
+
property({ attribute: "sort-direction", reflect: true })
|
|
143
|
+
], DSATableHeaderCell.prototype, "sortDirection", 2);
|
|
144
|
+
__decorateClass([
|
|
145
|
+
watch("sortable")
|
|
146
|
+
], DSATableHeaderCell.prototype, "handleSortableChange", 1);
|
|
147
|
+
__decorateClass([
|
|
148
|
+
watch("sortDirection", { waitUntilFirstUpdate: true })
|
|
149
|
+
], DSATableHeaderCell.prototype, "handleSortDirectionChange", 1);
|
|
150
|
+
DSATableHeaderCell = __decorateClass([
|
|
151
|
+
customElement("dsa-table-header-cell")
|
|
152
|
+
], DSATableHeaderCell);
|
|
153
|
+
|
|
154
|
+
export {
|
|
155
|
+
DSATableHeaderCell
|
|
156
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
component_styles_default
|
|
3
|
+
} from "./chunk.TUVJKY7S.js";
|
|
4
|
+
|
|
5
|
+
// src/components/table/table-body/table-body.styles.ts
|
|
6
|
+
import { css } from "lit";
|
|
7
|
+
var table_body_styles_default = css`
|
|
8
|
+
${component_styles_default}
|
|
9
|
+
|
|
10
|
+
:host {
|
|
11
|
+
display: table-row-group;
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
table_body_styles_default
|
|
17
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
component_styles_default
|
|
3
|
+
} from "./chunk.TUVJKY7S.js";
|
|
4
|
+
|
|
5
|
+
// src/components/table/table.styles.ts
|
|
6
|
+
import { css } from "lit";
|
|
7
|
+
var table_styles_default = css`
|
|
8
|
+
${component_styles_default}
|
|
9
|
+
|
|
10
|
+
:host {
|
|
11
|
+
display: table;
|
|
12
|
+
inline-size: 100%;
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
table_styles_default
|
|
18
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import {
|
|
2
|
+
pagination_button_styles_default
|
|
3
|
+
} from "./chunk.CHKVYEHB.js";
|
|
4
|
+
import {
|
|
5
|
+
HasSlotController
|
|
6
|
+
} from "./chunk.YIY5RM53.js";
|
|
7
|
+
import {
|
|
8
|
+
ShoelaceElement
|
|
9
|
+
} from "./chunk.YCXTCVAZ.js";
|
|
10
|
+
import {
|
|
11
|
+
__decorateClass
|
|
12
|
+
} from "./chunk.6M63UXML.js";
|
|
13
|
+
|
|
14
|
+
// src/components/pagination-button/pagination-button.ts
|
|
15
|
+
import { html } from "lit";
|
|
16
|
+
import { customElement, property, query } from "lit/decorators.js";
|
|
17
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
18
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
19
|
+
var DSAPaginationButton = class extends ShoelaceElement {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
this.hasSlotController = new HasSlotController(
|
|
23
|
+
this,
|
|
24
|
+
"[default]",
|
|
25
|
+
"prefix",
|
|
26
|
+
"suffix"
|
|
27
|
+
);
|
|
28
|
+
this.value = 0;
|
|
29
|
+
this.selected = false;
|
|
30
|
+
this.disabled = false;
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
33
|
+
const isInactive = this.selected || this.value === -1;
|
|
34
|
+
return html`
|
|
35
|
+
<button
|
|
36
|
+
part="base"
|
|
37
|
+
class=${classMap({
|
|
38
|
+
button: true,
|
|
39
|
+
"button-pagination": true,
|
|
40
|
+
"button-number": !this.hasSlotController.test("[default]"),
|
|
41
|
+
"button--selected": this.selected,
|
|
42
|
+
"button--inactive": isInactive,
|
|
43
|
+
"button--disabled": this.disabled,
|
|
44
|
+
"button--has-prefix": this.hasSlotController.test("prefix"),
|
|
45
|
+
"button--has-suffix": this.hasSlotController.test("suffix")
|
|
46
|
+
})}
|
|
47
|
+
value="${this.value}"
|
|
48
|
+
?disabled=${this.disabled || isInactive}
|
|
49
|
+
aria-current=${ifDefined(this.selected ? "page" : void 0)}
|
|
50
|
+
>
|
|
51
|
+
<slot name="prefix" part="prefix" class="button__prefix"></slot>
|
|
52
|
+
<slot part="label">${this.value === -1 ? "\u2026" : this.value}</slot>
|
|
53
|
+
<slot name="suffix" part="suffix" class="button__suffix"></slot>
|
|
54
|
+
</button>
|
|
55
|
+
`;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
DSAPaginationButton.styles = pagination_button_styles_default;
|
|
59
|
+
__decorateClass([
|
|
60
|
+
query(".button")
|
|
61
|
+
], DSAPaginationButton.prototype, "button", 2);
|
|
62
|
+
__decorateClass([
|
|
63
|
+
property({ type: Number })
|
|
64
|
+
], DSAPaginationButton.prototype, "value", 2);
|
|
65
|
+
__decorateClass([
|
|
66
|
+
property({ type: Boolean, attribute: "selected" })
|
|
67
|
+
], DSAPaginationButton.prototype, "selected", 2);
|
|
68
|
+
__decorateClass([
|
|
69
|
+
property({ type: Boolean })
|
|
70
|
+
], DSAPaginationButton.prototype, "disabled", 2);
|
|
71
|
+
DSAPaginationButton = __decorateClass([
|
|
72
|
+
customElement("dsa-pagination-button")
|
|
73
|
+
], DSAPaginationButton);
|
|
74
|
+
|
|
75
|
+
export {
|
|
76
|
+
DSAPaginationButton
|
|
77
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import {
|
|
2
|
+
table_caption_styles_default
|
|
3
|
+
} from "./chunk.K55HKFUM.js";
|
|
4
|
+
import {
|
|
5
|
+
HasSlotController
|
|
6
|
+
} from "./chunk.YIY5RM53.js";
|
|
7
|
+
import {
|
|
8
|
+
LocalizeController
|
|
9
|
+
} from "./chunk.KZIAHLAV.js";
|
|
10
|
+
import {
|
|
11
|
+
ShoelaceElement
|
|
12
|
+
} from "./chunk.YCXTCVAZ.js";
|
|
13
|
+
import {
|
|
14
|
+
__decorateClass
|
|
15
|
+
} from "./chunk.6M63UXML.js";
|
|
16
|
+
|
|
17
|
+
// src/components/table/table-caption/table-caption.ts
|
|
18
|
+
import { html } from "lit";
|
|
19
|
+
import { customElement } from "lit/decorators.js";
|
|
20
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
21
|
+
var DSATableCaption = class extends ShoelaceElement {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
this.hasSlotController = new HasSlotController(
|
|
25
|
+
this,
|
|
26
|
+
"total-items"
|
|
27
|
+
);
|
|
28
|
+
this.localize = new LocalizeController(this);
|
|
29
|
+
}
|
|
30
|
+
render() {
|
|
31
|
+
const hasTotalItems = this.hasSlotController.test("total-items");
|
|
32
|
+
return html`
|
|
33
|
+
<slot part="title" name="title"></slot>
|
|
34
|
+
<slot part="subtitle" name="subtitle"></slot>
|
|
35
|
+
<p
|
|
36
|
+
part="total-items"
|
|
37
|
+
class=${classMap({
|
|
38
|
+
"has-total-items": hasTotalItems
|
|
39
|
+
})}
|
|
40
|
+
aria-hidden=${hasTotalItems ? "false" : "true"}
|
|
41
|
+
>
|
|
42
|
+
<slot name="total-items"></slot>
|
|
43
|
+
<span part="total-item--indicator"
|
|
44
|
+
>${this.localize.term("results")}</span
|
|
45
|
+
>
|
|
46
|
+
</p>
|
|
47
|
+
`;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
DSATableCaption.styles = table_caption_styles_default;
|
|
51
|
+
DSATableCaption = __decorateClass([
|
|
52
|
+
customElement("dsa-table-caption")
|
|
53
|
+
], DSATableCaption);
|
|
54
|
+
|
|
55
|
+
export {
|
|
56
|
+
DSATableCaption
|
|
57
|
+
};
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk.CMJ2SRTL.js";
|
|
7
7
|
import {
|
|
8
8
|
combobox_styles_default
|
|
9
|
-
} from "./chunk.
|
|
9
|
+
} from "./chunk.DJDCH3MP.js";
|
|
10
10
|
import {
|
|
11
11
|
FormControlController
|
|
12
12
|
} from "./chunk.KIFBWPW5.js";
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
} from "./chunk.V7RJROLH.js";
|
|
27
27
|
import {
|
|
28
28
|
LocalizeController
|
|
29
|
-
} from "./chunk.
|
|
29
|
+
} from "./chunk.KZIAHLAV.js";
|
|
30
30
|
import {
|
|
31
31
|
watch
|
|
32
32
|
} from "./chunk.6IH66JBY.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
input_styles_default
|
|
3
|
-
} from "./chunk.AQC66RY2.js";
|
|
4
1
|
import {
|
|
5
2
|
getOverridenIconDetails,
|
|
6
3
|
isPrefixIconOverriden
|
|
7
4
|
} from "./chunk.KBT2EKLF.js";
|
|
5
|
+
import {
|
|
6
|
+
input_styles_default
|
|
7
|
+
} from "./chunk.2AEUQXKH.js";
|
|
8
8
|
import {
|
|
9
9
|
defaultValue
|
|
10
10
|
} from "./chunk.CMJ2SRTL.js";
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from "./chunk.YIY5RM53.js";
|
|
17
17
|
import {
|
|
18
18
|
LocalizeController
|
|
19
|
-
} from "./chunk.
|
|
19
|
+
} from "./chunk.KZIAHLAV.js";
|
|
20
20
|
import {
|
|
21
21
|
watch
|
|
22
22
|
} from "./chunk.6IH66JBY.js";
|