energy-components 2.6.0 → 2.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/dist/components/accordion.es.js +1 -1
- package/dist/components/avatar.es.js +1 -1
- package/dist/components/button.es.js +1 -1
- package/dist/components/checkbox.es.js +1 -1
- package/dist/components/collapsable.es.js +1 -1
- package/dist/components/{collapsable.scss_vue_type_style_index_0_src_true_lang-BfTKaP_f.js → collapsable.scss_vue_type_style_index_0_src_true_lang-CBOSJyvR.js} +1 -1
- package/dist/components/datepicker.es.js +1 -1
- package/dist/components/directAccess.es.js +1 -1
- package/dist/components/dragAndDrop.es.js +93 -75
- package/dist/components/dropdown.es.js +414 -272
- package/dist/components/fileUploadItem.es.js +1 -1
- package/dist/components/filterChip.es.js +1 -1
- package/dist/components/filterTag.es.js +1 -1
- package/dist/components/{icon-svg-CW3eQRcp.js → icon-svg-BWxX0W6p.js} +15 -3
- package/dist/components/iconList.es.js +1 -1
- package/dist/components/iconSvg.es.js +1 -1
- package/dist/components/index.es.js +2 -2
- package/dist/components/indicator.es.js +1 -1
- package/dist/components/indicatorDots.es.js +1 -1
- package/dist/components/infoBox.es.js +1 -1
- package/dist/components/link.es.js +1 -1
- package/dist/components/modal.es.js +1 -1
- package/dist/components/multiselect.es.js +14 -8
- package/dist/components/multiselectcontentwrapper.es.js +42 -36
- package/dist/components/persistentToast.es.js +1 -1
- package/dist/components/popover.es.js +90 -71
- package/dist/components/popoverMenu.es.js +67 -60
- package/dist/components/progressBar.es.js +1 -1
- package/dist/components/quantitySelector.es.js +1 -1
- package/dist/components/radioButton.es.js +1 -1
- package/dist/components/searchField.es.js +1 -1
- package/dist/components/selectionChip.es.js +1 -1
- package/dist/components/sidedrawer.es.js +1 -1
- package/dist/components/style/dragAndDrop.css +1 -1
- package/dist/components/style/dropdown.css +1 -1
- package/dist/components/style/multiselect.css +1 -1
- package/dist/components/style/multiselectcontentwrapper.css +1 -1
- package/dist/components/style/pagination.css +1 -1
- package/dist/components/style/popover.css +1 -1
- package/dist/components/style/popoverMenu.css +1 -1
- package/dist/components/style/table.css +1 -1
- package/dist/components/style/tableRenderer.css +1 -1
- package/dist/components/switch.es.js +1 -1
- package/dist/components/tabBar.es.js +1 -1
- package/dist/components/table.es.js +101 -92
- package/dist/components/tableRenderer.es.js +363 -214
- package/dist/components/tag.es.js +1 -1
- package/dist/components/textArea.es.js +1 -1
- package/dist/components/textField.es.js +1 -1
- package/dist/components/toggle.es.js +1 -1
- package/dist/components/tooltip.es.js +1 -1
- package/dist/energy-components.css +1 -1
- package/dist/energy-components.es.js +6511 -6143
- package/dist/energy-components.umd.js +2 -2
- package/dist/style.css +1 -1
- package/dist/types/src/components/content/table/table-renderer.vue.d.ts +7 -2
- package/dist/types/src/components/content/table/table.vue.d.ts +27 -1
- package/dist/types/src/components/content/table/use-column-reorder.d.ts +29 -0
- package/dist/types/src/components/input/drag-and-drop/drag-and-drop.vue.d.ts +15 -0
- package/dist/types/src/components/input/dropdown/Multiselect/MultiselectContentWrapper.vue.d.ts +9 -0
- package/dist/types/src/components/input/dropdown/dropdown.vue.d.ts +25 -0
- package/dist/types/src/components/overlay/popover/popover.vue.d.ts +4 -0
- package/dist/types/src/components/overlay/popover-menu/popover-menu.vue.d.ts +10 -4
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/llms/rdsdrag-and-drop.md +1 -0
- package/llms/rdsdropdown.md +4 -2
- package/llms/rdspopover-menu.md +2 -0
- package/llms/rdspopover.md +2 -0
- package/llms/rdstable.md +4 -0
- package/package.json +2 -2
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { defineComponent as Z, ref as h, useSlots as _, toRefs as ee, computed as f, watch as S, openBlock as u, createElementBlock as g, Fragment as B, createVNode as x, renderList as L, renderSlot as P, toDisplayString as le, createCommentVNode as T, createBlock as $, unref as K, withCtx as C, createSlots as te, normalizeProps as ae, guardReactiveProps as oe, withModifiers as D } from "vue";
|
|
2
|
+
import ne from "./tableRenderer.es.js";
|
|
3
|
+
import se from "./pagination.es.js";
|
|
4
4
|
import E from "./radioButton.es.js";
|
|
5
|
-
import { _ as
|
|
6
|
-
import
|
|
5
|
+
import { _ as ie } from "./radio-group.vue_vue_type_script_setup_true_lang-CwgSZYeD.js";
|
|
6
|
+
import re from "./loader.es.js";
|
|
7
7
|
import { g as de } from "./getInstance-GhoEcxLF.js";
|
|
8
|
-
import { _ as
|
|
9
|
-
import './style/table.css';const
|
|
8
|
+
import { _ as ue } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
|
+
import './style/table.css';const ce = { class: "rds-e-table__container" }, me = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "rds-e-table__loading-mobile"
|
|
12
|
-
},
|
|
12
|
+
}, ve = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "rds-e-table__empty"
|
|
15
|
-
},
|
|
15
|
+
}, ye = /* @__PURE__ */ Z({
|
|
16
16
|
__name: "table",
|
|
17
17
|
props: {
|
|
18
18
|
header: { default: () => [] },
|
|
@@ -26,6 +26,8 @@ import './style/table.css';const ue = { class: "rds-e-table__container" }, ce =
|
|
|
26
26
|
selectionMode: { default: "none" },
|
|
27
27
|
selectionPosition: { default: "right" },
|
|
28
28
|
checkedKeys: { default: () => [] },
|
|
29
|
+
selectAllAriaLabel: {},
|
|
30
|
+
rowAriaLabel: {},
|
|
29
31
|
loading: { type: Boolean },
|
|
30
32
|
hideHeaders: { type: Boolean },
|
|
31
33
|
hidePagination: { type: Boolean },
|
|
@@ -43,127 +45,130 @@ import './style/table.css';const ue = { class: "rds-e-table__container" }, ce =
|
|
|
43
45
|
cellClass: {},
|
|
44
46
|
isRowDisabled: {},
|
|
45
47
|
resizableColumns: { type: Boolean },
|
|
48
|
+
reorderableColumns: { type: Boolean },
|
|
46
49
|
resetPageOnSort: { type: Boolean, default: !1 }
|
|
47
50
|
},
|
|
48
|
-
emits: ["update:page", "update:pageSize", "update:sort", "update:checkedKeys", "optionsChange", "selectionChange", "rowExpand", "columnResize"],
|
|
51
|
+
emits: ["update:page", "update:pageSize", "update:sort", "update:checkedKeys", "optionsChange", "selectionChange", "rowExpand", "columnResize", "columnReorder"],
|
|
49
52
|
setup(a, { expose: H, emit: O }) {
|
|
50
|
-
const o = a, i = O,
|
|
51
|
-
const
|
|
52
|
-
return
|
|
53
|
-
},
|
|
54
|
-
if (o.asynchrone === !0) return
|
|
55
|
-
const e = (c.value - 1) *
|
|
56
|
-
return
|
|
57
|
-
}), F = f(() =>
|
|
58
|
-
const e = o.header.map((
|
|
59
|
-
...
|
|
60
|
-
sort:
|
|
61
|
-
})),
|
|
62
|
-
if (
|
|
53
|
+
const o = a, i = O, c = h(o.page), v = h(o.pageSize), m = h(o.sort || null), n = h([...o.checkedKeys]), b = h([]), V = _(), M = de(), { items: A, selectionMode: r, selectionPosition: I } = ee(o), j = f(() => o.rowKey), y = (e) => typeof e == "number" ? e : String(e), d = (e) => {
|
|
54
|
+
const t = o.rowKey, l = e[t];
|
|
55
|
+
return l === void 0 ? (console.warn(`[RDSTable] Row missing key '${String(o.rowKey)}'`, e), "unknown") : l;
|
|
56
|
+
}, p = f(() => {
|
|
57
|
+
if (o.asynchrone === !0) return A.value;
|
|
58
|
+
const e = (c.value - 1) * v.value, t = e + v.value;
|
|
59
|
+
return A.value.slice(e, t);
|
|
60
|
+
}), F = f(() => p.value), N = f(() => {
|
|
61
|
+
const e = o.header.map((l) => ({
|
|
62
|
+
...l,
|
|
63
|
+
sort: l.sortable && m.value?.key === l.key ? m.value.order : null
|
|
64
|
+
})), t = p.value.length > 0 && p.value.every((l) => n.value.includes(y(d(l))));
|
|
65
|
+
if (r.value !== "none" && I.value === "left")
|
|
63
66
|
return [{
|
|
64
67
|
key: "__select_all",
|
|
65
68
|
text: "",
|
|
66
69
|
type: "selection",
|
|
67
70
|
width: "48px",
|
|
68
71
|
align: "center",
|
|
69
|
-
sticky: !
|
|
70
|
-
allSelected:
|
|
72
|
+
sticky: !1,
|
|
73
|
+
allSelected: t
|
|
71
74
|
}, ...e];
|
|
72
|
-
if (
|
|
73
|
-
const
|
|
75
|
+
if (r.value !== "none" && I.value === "right") {
|
|
76
|
+
const l = {
|
|
74
77
|
key: "checkbox",
|
|
75
78
|
text: "",
|
|
76
79
|
type: "selection",
|
|
77
80
|
width: "48px",
|
|
78
81
|
align: "right",
|
|
79
|
-
sticky: !
|
|
80
|
-
allSelected:
|
|
82
|
+
sticky: !1,
|
|
83
|
+
allSelected: t
|
|
81
84
|
};
|
|
82
|
-
return [...e,
|
|
85
|
+
return [...e, l];
|
|
83
86
|
}
|
|
84
87
|
return e;
|
|
85
|
-
}), U = f(() => o.hideSelectAll ? !0 :
|
|
88
|
+
}), U = f(() => o.hideSelectAll ? !0 : r.value !== "multiple"), R = () => {
|
|
86
89
|
i("optionsChange", {
|
|
87
90
|
page: c.value,
|
|
88
|
-
pageSize:
|
|
91
|
+
pageSize: v.value,
|
|
89
92
|
sort: m.value
|
|
90
93
|
});
|
|
91
94
|
}, G = (e) => {
|
|
92
95
|
if (!e.sortable) return;
|
|
93
|
-
const
|
|
96
|
+
const t = m.value?.key, l = m.value?.order;
|
|
94
97
|
let s = "asc";
|
|
95
|
-
|
|
96
|
-
const
|
|
97
|
-
o.resetPageOnSort && (c.value = 1, i("update:page", 1)), m.value =
|
|
98
|
+
t === e.key && (l === "asc" ? s = "desc" : l === "desc" && (s = null));
|
|
99
|
+
const w = s ? { key: e.key, order: s } : null;
|
|
100
|
+
o.resetPageOnSort && (c.value = 1, i("update:page", 1)), m.value = w, i("update:sort", w), R();
|
|
98
101
|
}, q = (e) => {
|
|
99
|
-
e.page !== c.value && (c.value = e.page, i("update:page", e.page)), e.limit !==
|
|
102
|
+
e.page !== c.value && (c.value = e.page, i("update:page", e.page)), e.limit !== v.value && (v.value = e.limit, i("update:pageSize", e.limit)), R();
|
|
100
103
|
}, z = () => {
|
|
101
104
|
i("update:checkedKeys", [...n.value]), i("selectionChange", [...n.value]);
|
|
102
105
|
}, J = (e) => {
|
|
103
|
-
if (
|
|
104
|
-
const
|
|
105
|
-
if (
|
|
106
|
-
n.value = [
|
|
106
|
+
if (r.value === "none") return;
|
|
107
|
+
const t = y(d(e));
|
|
108
|
+
if (r.value === "single")
|
|
109
|
+
n.value = [t];
|
|
107
110
|
else {
|
|
108
|
-
const
|
|
109
|
-
|
|
111
|
+
const l = n.value.indexOf(t);
|
|
112
|
+
l === -1 ? n.value.push(t) : n.value.splice(l, 1);
|
|
110
113
|
}
|
|
111
114
|
z();
|
|
112
115
|
}, Q = (e) => {
|
|
113
|
-
if (
|
|
114
|
-
const
|
|
116
|
+
if (r.value !== "multiple") return;
|
|
117
|
+
const t = p.value.map((l) => y(d(l)));
|
|
115
118
|
if (e) {
|
|
116
|
-
const
|
|
117
|
-
n.value.push(...
|
|
119
|
+
const l = t.filter((s) => !n.value.includes(s));
|
|
120
|
+
n.value.push(...l);
|
|
118
121
|
} else
|
|
119
|
-
n.value = n.value.filter((
|
|
122
|
+
n.value = n.value.filter((l) => !t.includes(l));
|
|
120
123
|
z();
|
|
121
|
-
},
|
|
124
|
+
}, k = f({
|
|
122
125
|
get: () => n.value[0] || null,
|
|
123
126
|
set: (e) => {
|
|
124
|
-
e !== null &&
|
|
127
|
+
e !== null && r.value === "single" && (n.value = [e], z());
|
|
125
128
|
}
|
|
126
129
|
}), W = (e) => {
|
|
127
|
-
if (!e.expandible || !
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
+
if (!e.expandible || !V.expandible) return;
|
|
131
|
+
const t = y(d(e)), l = b.value.indexOf(t);
|
|
132
|
+
l === -1 ? b.value.push(t) : b.value.splice(l, 1), i("rowExpand", e);
|
|
130
133
|
}, X = (e) => {
|
|
131
134
|
i("columnResize", e);
|
|
135
|
+
}, Y = (e) => {
|
|
136
|
+
i("columnReorder", e);
|
|
132
137
|
};
|
|
133
|
-
return
|
|
138
|
+
return S(() => o.page, (e) => {
|
|
134
139
|
e && (c.value = e);
|
|
135
|
-
}),
|
|
136
|
-
e && (
|
|
137
|
-
}),
|
|
140
|
+
}), S(() => o.pageSize, (e) => {
|
|
141
|
+
e && (v.value = e);
|
|
142
|
+
}), S(() => o.sort, (e) => {
|
|
138
143
|
m.value = e || null;
|
|
139
|
-
}),
|
|
144
|
+
}), S(() => o.checkedKeys, (e) => {
|
|
140
145
|
n.value = [...e || []];
|
|
141
146
|
}), H({ reset: () => {
|
|
142
147
|
c.value = 1, n.value = [], m.value = null, R();
|
|
143
|
-
} }), (e,
|
|
148
|
+
} }), (e, t) => (u(), g("div", ce, [
|
|
144
149
|
a.isMobileDevice && e.$slots.mobile ? (u(), g(B, { key: 0 }, [
|
|
145
|
-
a.loading ? (u(), g("div",
|
|
146
|
-
x(
|
|
150
|
+
a.loading ? (u(), g("div", me, [
|
|
151
|
+
x(re, { size: 20 })
|
|
147
152
|
])) : (u(), g(B, { key: 1 }, [
|
|
148
|
-
(u(!0), g(B, null,
|
|
149
|
-
key: `${
|
|
153
|
+
(u(!0), g(B, null, L(p.value, (l, s) => (u(), g("div", {
|
|
154
|
+
key: `${y(d(l))}-m-${s}`,
|
|
150
155
|
class: "rds-e-table__mobile-item"
|
|
151
156
|
}, [
|
|
152
|
-
|
|
153
|
-
item:
|
|
157
|
+
P(e.$slots, "mobile", {
|
|
158
|
+
item: l,
|
|
154
159
|
index: s
|
|
155
160
|
}, void 0, !0)
|
|
156
161
|
]))), 128)),
|
|
157
|
-
|
|
162
|
+
p.value.length === 0 && a.showEmptyState ? (u(), g("div", ve, le(a.emptyStateText), 1)) : T("", !0)
|
|
158
163
|
], 64))
|
|
159
|
-
], 64)) : (u(),
|
|
164
|
+
], 64)) : (u(), $(ie, {
|
|
160
165
|
key: 1,
|
|
161
|
-
modelValue:
|
|
162
|
-
"onUpdate:modelValue":
|
|
163
|
-
"group-name": `table-radio-${K(
|
|
166
|
+
modelValue: k.value,
|
|
167
|
+
"onUpdate:modelValue": t[2] || (t[2] = (l) => k.value = l),
|
|
168
|
+
"group-name": `table-radio-${K(M)}`
|
|
164
169
|
}, {
|
|
165
170
|
default: C(() => [
|
|
166
|
-
x(
|
|
171
|
+
x(ne, {
|
|
167
172
|
headers: N.value,
|
|
168
173
|
rows: F.value,
|
|
169
174
|
"row-key": j.value,
|
|
@@ -174,60 +179,64 @@ import './style/table.css';const ue = { class: "rds-e-table__container" }, ce =
|
|
|
174
179
|
condensed: a.condensed,
|
|
175
180
|
"show-empty-state": a.showEmptyState,
|
|
176
181
|
"empty-state-text": a.emptyStateText,
|
|
182
|
+
"select-all-aria-label": a.selectAllAriaLabel,
|
|
183
|
+
"row-aria-label": a.rowAriaLabel,
|
|
177
184
|
"selected-keys": n.value,
|
|
178
|
-
"expanded-keys":
|
|
185
|
+
"expanded-keys": b.value,
|
|
179
186
|
"row-class": a.rowClass,
|
|
180
187
|
"cell-class": a.cellClass,
|
|
181
188
|
"is-row-disabled": a.isRowDisabled,
|
|
182
189
|
"resizable-columns": a.resizableColumns,
|
|
190
|
+
"reorderable-columns": a.reorderableColumns,
|
|
183
191
|
onColumnResize: X,
|
|
192
|
+
onColumnReorder: Y,
|
|
184
193
|
onHeaderClick: G,
|
|
185
194
|
onToggleSelectAll: Q,
|
|
186
195
|
onToggleRowSelection: J,
|
|
187
196
|
onRowClick: W
|
|
188
197
|
}, te({ _: 2 }, [
|
|
189
|
-
|
|
198
|
+
L(e.$slots, (l, s) => ({
|
|
190
199
|
name: s,
|
|
191
|
-
fn: C((
|
|
192
|
-
|
|
200
|
+
fn: C((w) => [
|
|
201
|
+
P(e.$slots, s, ae(oe(w)), void 0, !0)
|
|
193
202
|
])
|
|
194
203
|
})),
|
|
195
|
-
K(
|
|
204
|
+
K(r) === "single" ? {
|
|
196
205
|
name: "td-__select_all",
|
|
197
|
-
fn: C(({ item:
|
|
206
|
+
fn: C(({ item: l }) => [
|
|
198
207
|
x(E, {
|
|
199
|
-
id: `radio-left-${
|
|
200
|
-
option:
|
|
201
|
-
"model-value":
|
|
202
|
-
onClick:
|
|
208
|
+
id: `radio-left-${d(l)}`,
|
|
209
|
+
option: y(d(l)),
|
|
210
|
+
"model-value": k.value,
|
|
211
|
+
onClick: t[0] || (t[0] = D(() => {
|
|
203
212
|
}, ["stop"]))
|
|
204
213
|
}, null, 8, ["id", "option", "model-value"])
|
|
205
214
|
]),
|
|
206
215
|
key: "0"
|
|
207
216
|
} : void 0,
|
|
208
|
-
K(
|
|
217
|
+
K(r) === "single" ? {
|
|
209
218
|
name: "td-checkbox",
|
|
210
|
-
fn: C(({ item:
|
|
219
|
+
fn: C(({ item: l }) => [
|
|
211
220
|
x(E, {
|
|
212
|
-
id: `radio-right-${
|
|
213
|
-
option:
|
|
214
|
-
"model-value":
|
|
215
|
-
onClick:
|
|
221
|
+
id: `radio-right-${d(l)}`,
|
|
222
|
+
option: y(d(l)),
|
|
223
|
+
"model-value": k.value,
|
|
224
|
+
onClick: t[1] || (t[1] = D(() => {
|
|
216
225
|
}, ["stop"]))
|
|
217
226
|
}, null, 8, ["id", "option", "model-value"])
|
|
218
227
|
]),
|
|
219
228
|
key: "1"
|
|
220
229
|
} : void 0
|
|
221
|
-
]), 1032, ["headers", "rows", "row-key", "loading", "hide-headers", "hide-select-all", "variant", "condensed", "show-empty-state", "empty-state-text", "selected-keys", "expanded-keys", "row-class", "cell-class", "is-row-disabled", "resizable-columns"])
|
|
230
|
+
]), 1032, ["headers", "rows", "row-key", "loading", "hide-headers", "hide-select-all", "variant", "condensed", "show-empty-state", "empty-state-text", "select-all-aria-label", "row-aria-label", "selected-keys", "expanded-keys", "row-class", "cell-class", "is-row-disabled", "resizable-columns", "reorderable-columns"])
|
|
222
231
|
]),
|
|
223
232
|
_: 3
|
|
224
233
|
}, 8, ["modelValue", "group-name"])),
|
|
225
|
-
a.hidePagination ?
|
|
234
|
+
a.hidePagination ? T("", !0) : (u(), $(se, {
|
|
226
235
|
key: 2,
|
|
227
236
|
class: "rds-e-table__pagination",
|
|
228
237
|
"total-items": a.totalItemsLength,
|
|
229
238
|
"current-page": c.value,
|
|
230
|
-
"items-per-page":
|
|
239
|
+
"items-per-page": v.value,
|
|
231
240
|
"hide-leyend": a.hideLegend,
|
|
232
241
|
"jump-to": a.jumpTo,
|
|
233
242
|
"disable-first-load": a.disableFirstLoad,
|
|
@@ -237,7 +246,7 @@ import './style/table.css';const ue = { class: "rds-e-table__container" }, ce =
|
|
|
237
246
|
}, null, 8, ["total-items", "current-page", "items-per-page", "hide-leyend", "jump-to", "disable-first-load", "legend-text"]))
|
|
238
247
|
]));
|
|
239
248
|
}
|
|
240
|
-
}),
|
|
249
|
+
}), Ce = /* @__PURE__ */ ue(ye, [["__scopeId", "data-v-5dbe1d27"]]);
|
|
241
250
|
export {
|
|
242
|
-
|
|
251
|
+
Ce as default
|
|
243
252
|
};
|