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