@ulu/frontend-vue 0.5.2 → 0.5.4

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 (48) hide show
  1. package/dist/components/elements/UluCounterList.vue.d.ts +32 -0
  2. package/dist/components/elements/UluCounterList.vue.d.ts.map +1 -0
  3. package/dist/components/elements/UluCounterList.vue.js +77 -0
  4. package/dist/components/elements/UluDataTable.vue.d.ts +43 -0
  5. package/dist/components/elements/UluDataTable.vue.d.ts.map +1 -0
  6. package/dist/components/elements/UluDataTable.vue.js +114 -0
  7. package/dist/components/elements/UluDefinitionList.vue.d.ts +3 -2
  8. package/dist/components/elements/UluDefinitionList.vue.d.ts.map +1 -1
  9. package/dist/components/elements/UluDefinitionList.vue.js +34 -32
  10. package/dist/components/elements/UluDefinitionListItem.vue.d.ts +28 -0
  11. package/dist/components/elements/UluDefinitionListItem.vue.d.ts.map +1 -0
  12. package/dist/components/elements/UluDefinitionListItem.vue.js +46 -0
  13. package/dist/components/elements/UluList.vue.d.ts +5 -0
  14. package/dist/components/elements/UluList.vue.d.ts.map +1 -1
  15. package/dist/components/elements/UluList.vue.js +41 -22
  16. package/dist/components/elements/UluListItem.vue.d.ts +22 -0
  17. package/dist/components/elements/UluListItem.vue.d.ts.map +1 -0
  18. package/dist/components/elements/UluListItem.vue.js +28 -0
  19. package/dist/components/elements/UluTable.vue.d.ts +48 -0
  20. package/dist/components/elements/UluTable.vue.d.ts.map +1 -0
  21. package/dist/components/elements/UluTable.vue.js +211 -0
  22. package/dist/components/index.d.ts +5 -0
  23. package/dist/components/navigation/UluBreadcrumb.vue.js +23 -23
  24. package/dist/components/systems/table-sticky/UluTableSticky.vue.d.ts +104 -104
  25. package/dist/components/systems/table-sticky/UluTableSticky.vue.d.ts.map +1 -1
  26. package/dist/components/systems/table-sticky/UluTableSticky.vue.js +218 -256
  27. package/dist/components/systems/table-sticky/UluTableStickyRows.vue.d.ts +4 -4
  28. package/dist/components/systems/table-sticky/UluTableStickyTable.vue.d.ts +12 -12
  29. package/dist/components/utils/UluPlaceholderImage.vue.d.ts +2 -2
  30. package/dist/composables/index.d.ts +1 -0
  31. package/dist/composables/useTableData.d.ts +30 -0
  32. package/dist/composables/useTableData.d.ts.map +1 -0
  33. package/dist/composables/useTableData.js +68 -0
  34. package/dist/index.js +194 -182
  35. package/lib/components/collapsible/UluAccordionGroup.vue +44 -44
  36. package/lib/components/elements/UluCounterList.vue +77 -0
  37. package/lib/components/elements/UluDataTable.vue +115 -0
  38. package/lib/components/elements/UluDefinitionList.vue +32 -27
  39. package/lib/components/elements/UluDefinitionListItem.vue +43 -0
  40. package/lib/components/elements/UluList.vue +38 -18
  41. package/lib/components/elements/UluListItem.vue +24 -0
  42. package/lib/components/elements/UluTable.vue +217 -0
  43. package/lib/components/index.js +5 -0
  44. package/lib/components/navigation/UluBreadcrumb.vue +5 -5
  45. package/lib/components/systems/table-sticky/UluTableSticky.vue +26 -171
  46. package/lib/composables/index.js +1 -0
  47. package/lib/composables/useTableData.js +189 -0
  48. package/package.json +3 -3
@@ -0,0 +1,28 @@
1
+ import { inject as c, computed as s, createBlock as r, openBlock as i, resolveDynamicComponent as m, normalizeClass as u, withCtx as p, renderSlot as d } from "vue";
2
+ const f = {
3
+ __name: "UluListItem",
4
+ props: {
5
+ /**
6
+ * Optional class binding to append to the injected parent classes
7
+ */
8
+ classes: [String, Array, Object],
9
+ /**
10
+ * The HTML element to render the item as
11
+ */
12
+ element: String
13
+ },
14
+ setup(e) {
15
+ const l = e, t = c("uluListContext", { value: {} }), n = s(() => t.value?.classes || {}), a = s(() => l.element || t.value?.itemElement || "li");
16
+ return (o, v) => (i(), r(m(a.value), {
17
+ class: u([n.value.item, e.classes])
18
+ }, {
19
+ default: p(() => [
20
+ d(o.$slots, "default")
21
+ ]),
22
+ _: 3
23
+ }, 8, ["class"]));
24
+ }
25
+ };
26
+ export {
27
+ f as default
28
+ };
@@ -0,0 +1,48 @@
1
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
2
+ export default _default;
3
+ type __VLS_WithTemplateSlots<T, S> = T & (new () => {
4
+ $slots: S;
5
+ });
6
+ declare const __VLS_component: import('vue').DefineComponent<{}, {
7
+ classes: Record<string, any>;
8
+ idPrefix: string;
9
+ columns?: unknown[] | undefined;
10
+ rows?: unknown[] | undefined;
11
+ footerRows?: unknown[] | undefined;
12
+ caption?: string | undefined;
13
+ getRowValue?: Function | undefined;
14
+ getColumnTitle?: Function | undefined;
15
+ $props: {
16
+ readonly classes?: Record<string, any> | undefined;
17
+ readonly idPrefix?: string | undefined;
18
+ readonly columns?: unknown[] | undefined;
19
+ readonly rows?: unknown[] | undefined;
20
+ readonly footerRows?: unknown[] | undefined;
21
+ readonly caption?: string | undefined;
22
+ readonly getRowValue?: Function | undefined;
23
+ readonly getColumnTitle?: Function | undefined;
24
+ };
25
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLTableElement>;
26
+ type __VLS_TemplateResult = {
27
+ attrs: Partial<{}>;
28
+ slots: Partial<Record<any, (_: {
29
+ column: never;
30
+ index: number;
31
+ }) => any>> & Partial<Record<any, (_: {
32
+ row: any;
33
+ column: any;
34
+ rowIndex: number;
35
+ index: number;
36
+ }) => any>> & Partial<Record<any, (_: {
37
+ row: any;
38
+ column: any;
39
+ rowIndex: number;
40
+ index: number;
41
+ }) => any>> & {
42
+ caption?(_: {}): any;
43
+ default?(_: {}): any;
44
+ };
45
+ refs: {};
46
+ rootEl: HTMLTableElement;
47
+ };
48
+ //# sourceMappingURL=UluTable.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UluTable.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/elements/UluTable.vue"],"names":[],"mappings":"AAwGA;wBAshBqB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;;6BAEtE,CAAC,EAAE,CAAC;;;AAXjC;;;;;;;;;;;;;;;;;;;wPAQG"}
@@ -0,0 +1,211 @@
1
+ import { createElementBlock as i, openBlock as r, normalizeClass as o, renderSlot as u, Fragment as y, createCommentVNode as C, createElementVNode as R, createTextVNode as g, toDisplayString as $, renderList as f, unref as h, createBlock as w, resolveDynamicComponent as L, withCtx as F } from "vue";
2
+ import { isArrayOfObjects as T } from "../../utils/props.js";
3
+ import { useTableData as j } from "../../composables/useTableData.js";
4
+ const S = ["id", "rowspan", "colspan", "scope", "headers"], B = ["innerHTML"], D = ["id"], N = ["innerHTML"], O = ["id"], E = ["innerHTML"], q = {
5
+ __name: "UluTable",
6
+ props: {
7
+ /**
8
+ * Array of column configurations to convert to list output
9
+ *
10
+ * @property {Object} column A column config
11
+ * @property {String|Boolean} column.title The title to output for the column if set to a falsey value nothing will print
12
+ * @property {Array} column.columns Array of child columns
13
+ * @property {String} column.key The key that should be usec to grab column's value from rows
14
+ * @property {Function} column.value A function that returns the column's value used instead of key passed (row, column)
15
+ * @property {String} column.slot Register custom slot name to use as a template for this column. Passing a slot with this name will link them. The slot are passed the ({row, column}). Note this will disable output of the column's value
16
+ * @property {String} column.slotHeader Register custom slot name to use in the header
17
+ * @property {String} column.classHeader Custom class(s) to be set to column <th>
18
+ * @property {String} column.class Custom class(s) to be set to column's value <td>
19
+ * @property {String} column.html Use v-html output for value
20
+ * @property {String} column.rowHeader When this column is printed in the <tbody> it should be a header for the row. Note supports multiple row headers from left to right only. No rowspan support for rowHeaders.
21
+ */
22
+ columns: {
23
+ type: Array,
24
+ validator: T
25
+ },
26
+ /**
27
+ * Array of tables rows (tbody)
28
+ * - Each row is an object who's value will be matched to columns
29
+ */
30
+ rows: {
31
+ type: Array,
32
+ validator: T
33
+ },
34
+ /**
35
+ * Array of rows for footer (tfoot)
36
+ */
37
+ footerRows: {
38
+ type: Array,
39
+ validator: T
40
+ },
41
+ /**
42
+ * Hidden caption for accessibility (or visible depending on styles). Can also be passed via slot.
43
+ */
44
+ caption: String,
45
+ /**
46
+ * Allows user to pass classes object to add custom classes to parts of the component
47
+ */
48
+ classes: {
49
+ type: Object,
50
+ default: () => ({})
51
+ },
52
+ /**
53
+ * Prefix used for id generation
54
+ */
55
+ idPrefix: {
56
+ type: String,
57
+ default: "table"
58
+ },
59
+ /**
60
+ * Optional user overridden value getter (for rows)
61
+ * @param {Object} row The current row
62
+ * @param {Object} column The current column in the row
63
+ */
64
+ getRowValue: {
65
+ type: Function,
66
+ default: ({ row: l, column: k }) => l[k.key]
67
+ },
68
+ /**
69
+ * Optional user overridden title getter (for headers)
70
+ * @param {Object} column The current column
71
+ */
72
+ getColumnTitle: {
73
+ type: Function,
74
+ default: ({ column: l }) => l.title
75
+ }
76
+ },
77
+ setup(l) {
78
+ const k = l, {
79
+ currentRows: M,
80
+ currentFooterRows: b,
81
+ headerRows: V,
82
+ rowColumns: p
83
+ } = j(k), c = (s, n = null) => {
84
+ if (!(typeof s > "u"))
85
+ return typeof s == "function" ? s(n) : s;
86
+ }, A = (s) => {
87
+ const n = s.headers.filter((a) => a !== s.id);
88
+ if (n.length)
89
+ return n.join(" ");
90
+ }, v = (s, n) => {
91
+ const a = s.headers.join(" "), t = s.getRowHeaders(n), e = t.length ? " " : "";
92
+ return `${a}${e}${t}`;
93
+ }, H = ({ row: s, column: n, rowIndex: a }) => {
94
+ const t = n.value;
95
+ return t ? t({ row: s.data, column: n, rowIndex: a }) : k.getRowValue({ row: s.data, column: n, rowIndex: a });
96
+ };
97
+ return (s, n) => (r(), i("table", {
98
+ class: o(l.classes?.table)
99
+ }, [
100
+ l.columns && l.rows ? (r(), i(y, { key: 0 }, [
101
+ l.caption || s.$slots.caption ? (r(), i("caption", {
102
+ key: 0,
103
+ class: o(l.classes?.caption)
104
+ }, [
105
+ u(s.$slots, "caption", {}, () => [
106
+ g($(l.caption), 1)
107
+ ])
108
+ ], 2)) : C("", !0),
109
+ R("thead", {
110
+ class: o(l.classes?.thead)
111
+ }, [
112
+ (r(!0), i(y, null, f(h(V), (a, t) => (r(), i("tr", {
113
+ key: `hr-${t}`,
114
+ class: o(c(l.classes?.rowHeader, { row: a, rowIndex: t }))
115
+ }, [
116
+ (r(!0), i(y, null, f(a.columns, (e, d) => (r(), i("th", {
117
+ key: `hc-${d}`,
118
+ id: e.id,
119
+ rowspan: e.rowspan,
120
+ colspan: e.colspan,
121
+ class: o(c(e.classHeader, { column: e, index: d })),
122
+ scope: e.colspan > 1 ? "colgroup" : "col",
123
+ headers: A(e)
124
+ }, [
125
+ s.$slots[e.slotHeader] ? u(s.$slots, e.slotHeader, {
126
+ key: 0,
127
+ column: e,
128
+ index: d
129
+ }) : e.htmlTitle ? (r(), i("div", {
130
+ key: 1,
131
+ innerHTML: l.getColumnTitle({ column: e, index: d })
132
+ }, null, 8, B)) : (r(), i(y, { key: 2 }, [
133
+ g($(l.getColumnTitle({ column: e, index: d })), 1)
134
+ ], 64))
135
+ ], 10, S))), 128))
136
+ ], 2))), 128))
137
+ ], 2),
138
+ R("tbody", {
139
+ class: o(l.classes?.tbody)
140
+ }, [
141
+ (r(!0), i(y, null, f(h(M), (a, t) => (r(), i("tr", {
142
+ key: `br-${t}`,
143
+ id: a.id,
144
+ class: o(c(l.classes?.row, { row: a.data, rowIndex: t }))
145
+ }, [
146
+ (r(!0), i(y, null, f(h(p), (e, d) => (r(), w(L(e.rowHeader ? "th" : "td"), {
147
+ key: `bc-${d}`,
148
+ id: e.rowHeader ? e.getRowHeaderId(t) : void 0,
149
+ scope: e.rowHeader ? "row" : void 0,
150
+ headers: v(e, t),
151
+ class: o(c(e.class, { column: e, index: d, row: a, rowIndex: t }))
152
+ }, {
153
+ default: F(() => [
154
+ s.$slots[e.slot] ? u(s.$slots, e.slot, {
155
+ key: 0,
156
+ row: a.data,
157
+ column: e,
158
+ rowIndex: t,
159
+ index: d
160
+ }) : e.html ? (r(), i("div", {
161
+ key: 1,
162
+ innerHTML: H({ row: a, column: e, rowIndex: t })
163
+ }, null, 8, N)) : (r(), i(y, { key: 2 }, [
164
+ g($(H({ row: a, column: e, rowIndex: t })), 1)
165
+ ], 64))
166
+ ]),
167
+ _: 2
168
+ }, 1032, ["id", "scope", "headers", "class"]))), 128))
169
+ ], 10, D))), 128))
170
+ ], 2),
171
+ h(b).length ? (r(), i("tfoot", {
172
+ key: 1,
173
+ class: o(l.classes?.tfoot)
174
+ }, [
175
+ (r(!0), i(y, null, f(h(b), (a, t) => (r(), i("tr", {
176
+ key: `fr-${t}`,
177
+ id: a.id,
178
+ class: o(c(l.classes?.rowFooter, { row: a.data, rowIndex: t }))
179
+ }, [
180
+ (r(!0), i(y, null, f(h(p), (e, d) => (r(), w(L(e.rowHeader ? "th" : "td"), {
181
+ key: `fc-${d}`,
182
+ id: e.rowHeader ? e.getRowHeaderId(t) : void 0,
183
+ scope: e.rowHeader ? "row" : void 0,
184
+ headers: v(e, t),
185
+ class: o(c(e.class, { column: e, index: d, row: a, rowIndex: t }))
186
+ }, {
187
+ default: F(() => [
188
+ s.$slots[e.slot] ? u(s.$slots, e.slot, {
189
+ key: 0,
190
+ row: a.data,
191
+ column: e,
192
+ rowIndex: t,
193
+ index: d
194
+ }) : e.html ? (r(), i("div", {
195
+ key: 1,
196
+ innerHTML: H({ row: a, column: e, rowIndex: t })
197
+ }, null, 8, E)) : (r(), i(y, { key: 2 }, [
198
+ g($(H({ row: a, column: e, rowIndex: t })), 1)
199
+ ], 64))
200
+ ]),
201
+ _: 2
202
+ }, 1032, ["id", "scope", "headers", "class"]))), 128))
203
+ ], 10, O))), 128))
204
+ ], 2)) : C("", !0)
205
+ ], 64)) : u(s.$slots, "default", { key: 1 })
206
+ ], 2));
207
+ }
208
+ };
209
+ export {
210
+ q as default
211
+ };
@@ -17,17 +17,22 @@ export { default as UluButtonVerbose } from './elements/UluButtonVerbose.vue';
17
17
  export { default as UluCallout } from './elements/UluCallout.vue';
18
18
  export { default as UluCaptionedFigure } from './elements/UluCaptionedFigure.vue';
19
19
  export { default as UluCard } from './elements/UluCard.vue';
20
+ export { default as UluDataTable } from './elements/UluDataTable.vue';
20
21
  export { default as UluDefinitionList } from './elements/UluDefinitionList.vue';
22
+ export { default as UluDefinitionListItem } from './elements/UluDefinitionListItem.vue';
21
23
  export { default as UluExternalLink } from './elements/UluExternalLink.vue';
22
24
  export { default as UluIcon } from './elements/UluIcon.vue';
23
25
  export { default as UluImage } from './elements/UluImage.vue';
24
26
  export { default as UluList } from './elements/UluList.vue';
27
+ export { default as UluListItem } from './elements/UluListItem.vue';
28
+ export { default as UluCounterList } from './elements/UluCounterList.vue';
25
29
  export { default as UluMain } from './elements/UluMain.vue';
26
30
  export { default as UluOverflowScroller } from './elements/UluOverflowScroller.vue';
27
31
  export { default as UluRule } from './elements/UluRule.vue';
28
32
  export { default as UluScrollSlider } from './elements/UluScrollSlider.vue';
29
33
  export { default as UluSlider } from './elements/UluSlider.vue';
30
34
  export { default as UluSpokeSpinner } from './elements/UluSpokeSpinner.vue';
35
+ export { default as UluTable } from './elements/UluTable.vue';
31
36
  export { default as UluTag } from './elements/UluTag.vue';
32
37
  export { default as UluSelectableMenu } from './forms/UluSelectableMenu.vue';
33
38
  export { default as UluFileDisplay } from './forms/UluFileDisplay.vue';
@@ -1,4 +1,4 @@
1
- import { resolveComponent as d, createElementBlock as s, createCommentVNode as o, openBlock as a, normalizeClass as t, createElementVNode as b, Fragment as k, renderList as f, createBlock as y, renderSlot as c, withCtx as p, createTextVNode as u, toDisplayString as i, createVNode as g } from "vue";
1
+ import { resolveComponent as d, createElementBlock as s, createCommentVNode as o, openBlock as t, normalizeClass as r, createElementVNode as b, Fragment as k, renderList as f, createBlock as y, renderSlot as c, withCtx as g, createTextVNode as u, toDisplayString as i, createVNode as p } from "vue";
2
2
  import h from "../elements/UluIcon.vue.js";
3
3
  const N = {
4
4
  __name: "UluBreadcrumb",
@@ -17,7 +17,7 @@ const N = {
17
17
  separatorIcon: String,
18
18
  /**
19
19
  * Classes object to be applied to elements.
20
- * Keys: nav, list, item, link, icon
20
+ * Keys: nav, list, item, link, current, separator
21
21
  */
22
22
  classes: {
23
23
  type: Object,
@@ -31,45 +31,45 @@ const N = {
31
31
  })
32
32
  }
33
33
  },
34
- setup(e) {
34
+ setup(a) {
35
35
  return (l, B) => {
36
36
  const m = d("router-link");
37
- return e.items.length ? (a(), s("nav", {
37
+ return a.items.length ? (t(), s("nav", {
38
38
  key: 0,
39
- class: t(e.classes.nav),
39
+ class: r(a.classes.nav),
40
40
  "aria-label": "Breadcrumb"
41
41
  }, [
42
42
  b("ol", {
43
- class: t(e.classes.list)
43
+ class: r(a.classes.list)
44
44
  }, [
45
- (a(!0), s(k, null, f(e.items, (r, n) => (a(), s("li", {
45
+ (t(!0), s(k, null, f(a.items, (e, n) => (t(), s("li", {
46
46
  key: n,
47
- class: t(e.classes.item)
47
+ class: r([a.classes.item, e?.classes?.item])
48
48
  }, [
49
- r.current ? (a(), s("span", {
49
+ e.current ? (t(), s("span", {
50
50
  key: 1,
51
- class: t(r.current)
51
+ class: r([a.classes.current, e?.classes?.current])
52
52
  }, [
53
- c(l.$slots, "default", { item: r }, () => [
54
- u(i(r.title), 1)
53
+ c(l.$slots, "default", { item: e }, () => [
54
+ u(i(e.title), 1)
55
55
  ])
56
- ], 2)) : (a(), y(m, {
56
+ ], 2)) : (t(), y(m, {
57
57
  key: 0,
58
- to: r.to,
59
- class: t(e.classes.link),
60
- "aria-current": r.current ? "page" : null
58
+ to: e.to,
59
+ class: r([a.classes.link, e?.classes?.link]),
60
+ "aria-current": e.current ? "page" : null
61
61
  }, {
62
- default: p(() => [
63
- c(l.$slots, "default", { item: r }, () => [
64
- u(i(r.title), 1)
62
+ default: g(() => [
63
+ c(l.$slots, "default", { item: e }, () => [
64
+ u(i(e.title), 1)
65
65
  ])
66
66
  ]),
67
67
  _: 2
68
68
  }, 1032, ["to", "class", "aria-current"])),
69
- n < e.items.length - 1 ? c(l.$slots, "separator", { key: 2 }, () => [
70
- g(h, {
71
- class: t(e.classes.separator),
72
- icon: e.separatorIcon || "type:pathSeparator"
69
+ n < a.items.length - 1 ? c(l.$slots, "separator", { key: 2 }, () => [
70
+ p(h, {
71
+ class: r([a.classes.separator, e?.classes?.separator]),
72
+ icon: a.separatorIcon || "type:pathSeparator"
73
73
  }, null, 8, ["class", "icon"])
74
74
  ]) : o("", !0)
75
75
  ], 2))), 128))