@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,32 @@
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
+ element: string;
9
+ itemElement: string;
10
+ alphabetical: boolean;
11
+ noReset: boolean;
12
+ modifiers?: string | unknown[] | undefined;
13
+ items?: unknown[] | undefined;
14
+ $props: {
15
+ readonly classes?: Record<string, any> | undefined;
16
+ readonly element?: string | undefined;
17
+ readonly itemElement?: string | undefined;
18
+ readonly alphabetical?: boolean | undefined;
19
+ readonly noReset?: boolean | undefined;
20
+ readonly modifiers?: string | unknown[] | undefined;
21
+ readonly items?: unknown[] | undefined;
22
+ };
23
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
24
+ type __VLS_TemplateResult = {
25
+ attrs: Partial<{}>;
26
+ slots: {
27
+ default?(_: {}): any;
28
+ };
29
+ refs: {};
30
+ rootEl: any;
31
+ };
32
+ //# sourceMappingURL=UluCounterList.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UluCounterList.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/elements/UluCounterList.vue"],"names":[],"mappings":"AAcA;wBA4NqB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;;6BAEtE,CAAC,EAAE,CAAC;;;AAXjC;;;;;;;;;;;;;;;;;2OAQG"}
@@ -0,0 +1,77 @@
1
+ import { computed as l, createBlock as r, openBlock as o, normalizeClass as m, unref as c, createSlots as u, withCtx as f, renderSlot as d, normalizeProps as p, guardReactiveProps as y } from "vue";
2
+ import { useModifiers as b } from "../../composables/useModifiers.js";
3
+ import h from "./UluList.vue.js";
4
+ const B = {
5
+ __name: "UluCounterList",
6
+ props: {
7
+ /**
8
+ * Array of list items, output as is or use slot to template the item
9
+ * - Note item can add classes by defining { classes: { item } }
10
+ */
11
+ items: Array,
12
+ /**
13
+ * HTML element for the list
14
+ */
15
+ element: {
16
+ type: String,
17
+ default: "ol"
18
+ },
19
+ /**
20
+ * HTML element for the list items (when using items array)
21
+ */
22
+ itemElement: {
23
+ type: String,
24
+ default: "li"
25
+ },
26
+ /**
27
+ * Classes object (keys are { list, item } to be applied to list and item elements)
28
+ */
29
+ classes: {
30
+ type: Object,
31
+ default: () => ({})
32
+ },
33
+ /**
34
+ * Use alphabetical counter
35
+ */
36
+ alphabetical: Boolean,
37
+ /**
38
+ * Remove counter reset
39
+ */
40
+ noReset: Boolean,
41
+ /**
42
+ * Modifiers (to add any modifier classes based on base class [ie. 'alphabetical'])
43
+ */
44
+ modifiers: [String, Array]
45
+ },
46
+ setup(t) {
47
+ const e = t, { resolvedModifiers: a } = b({
48
+ props: e,
49
+ baseClass: "counter-list",
50
+ internal: l(() => ({
51
+ alphabetical: e.alphabetical,
52
+ "no-reset": e.noReset
53
+ }))
54
+ }), i = l(() => ({
55
+ list: e.classes.list,
56
+ item: ["counter-list__item", e.classes.item]
57
+ }));
58
+ return (s, C) => (o(), r(h, {
59
+ class: m(["counter-list", c(a)]),
60
+ items: t.items,
61
+ element: t.element,
62
+ itemElement: t.itemElement,
63
+ classes: i.value
64
+ }, u({ _: 2 }, [
65
+ s.$slots.default ? {
66
+ name: "default",
67
+ fn: f((n) => [
68
+ d(s.$slots, "default", p(y(n)))
69
+ ]),
70
+ key: "0"
71
+ } : void 0
72
+ ]), 1032, ["class", "items", "element", "itemElement", "classes"]));
73
+ }
74
+ };
75
+ export {
76
+ B as default
77
+ };
@@ -0,0 +1,43 @@
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
+ striped: boolean;
9
+ largeFirst: boolean;
10
+ modifiers?: string | unknown[] | undefined;
11
+ columns?: unknown[] | undefined;
12
+ rows?: unknown[] | undefined;
13
+ footerRows?: unknown[] | undefined;
14
+ idPrefix?: string | undefined;
15
+ caption?: string | undefined;
16
+ getRowValue?: Function | undefined;
17
+ getColumnTitle?: Function | undefined;
18
+ $props: {
19
+ readonly classes?: Record<string, any> | undefined;
20
+ readonly striped?: boolean | undefined;
21
+ readonly largeFirst?: boolean | undefined;
22
+ readonly modifiers?: string | unknown[] | undefined;
23
+ readonly columns?: unknown[] | undefined;
24
+ readonly rows?: unknown[] | undefined;
25
+ readonly footerRows?: unknown[] | undefined;
26
+ readonly idPrefix?: string | undefined;
27
+ readonly caption?: string | undefined;
28
+ readonly getRowValue?: Function | undefined;
29
+ readonly getColumnTitle?: Function | undefined;
30
+ };
31
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLTableElement>;
32
+ type __VLS_TemplateResult = {
33
+ attrs: Partial<{}>;
34
+ slots: Partial<Record<number, (_: {
35
+ row: any;
36
+ column: any;
37
+ rowIndex: number;
38
+ index: number;
39
+ }) => any>>;
40
+ refs: {};
41
+ rootEl: HTMLTableElement;
42
+ };
43
+ //# sourceMappingURL=UluDataTable.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UluDataTable.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/elements/UluDataTable.vue"],"names":[],"mappings":"AAqBA;wBA6SqB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;;6BAEtE,CAAC,EAAE,CAAC;;;AAXjC;;;;;;;;;;;;;;;;;;;;;;;;;wPAQG"}
@@ -0,0 +1,114 @@
1
+ import { computed as l, createBlock as n, openBlock as c, mergeProps as u, unref as f, createSlots as m, renderList as d, withCtx as g, renderSlot as w, normalizeProps as y, guardReactiveProps as R } from "vue";
2
+ import { useModifiers as b } from "../../composables/useModifiers.js";
3
+ import p from "./UluTable.vue.js";
4
+ import { isArrayOfObjects as o } from "../../utils/props.js";
5
+ const x = {
6
+ __name: "UluDataTable",
7
+ props: {
8
+ /**
9
+ * Array of column configurations to convert to list output
10
+ *
11
+ * @property {Object} column A column config
12
+ * @property {String|Boolean} column.title The title to output for the column if set to a falsey value nothing will print
13
+ * @property {Array} column.columns Array of child columns
14
+ * @property {String} column.key The key that should be usec to grab column's value from rows
15
+ * @property {Function} column.value A function that returns the column's value used instead of key passed (row, column)
16
+ * @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
17
+ * @property {String} column.slotHeader Register custom slot name to use in the header
18
+ * @property {String} column.classHeader Custom class(s) to be set to column <th>
19
+ * @property {String} column.class Custom class(s) to be set to column's value <td>
20
+ * @property {String} column.html Use v-html output for value
21
+ * @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.
22
+ */
23
+ columns: {
24
+ type: Array,
25
+ validator: o
26
+ },
27
+ /**
28
+ * Array of tables rows (tbody)
29
+ * - Each row is an object who's value will be matched to columns
30
+ */
31
+ rows: {
32
+ type: Array,
33
+ validator: o
34
+ },
35
+ /**
36
+ * Array of rows for footer (tfoot)
37
+ */
38
+ footerRows: {
39
+ type: Array,
40
+ validator: o
41
+ },
42
+ /**
43
+ * Hidden caption for accessibility (or visible depending on styles). Can also be passed via slot.
44
+ */
45
+ caption: String,
46
+ /**
47
+ * Prefix used for id generation
48
+ */
49
+ idPrefix: String,
50
+ /**
51
+ * Optional user overridden value getter (for rows)
52
+ * @param {Object} row The current row
53
+ * @param {Object} column The current column in the row
54
+ */
55
+ getRowValue: Function,
56
+ /**
57
+ * Optional user overridden title getter (for headers)
58
+ * @param {Object} column The current column
59
+ */
60
+ getColumnTitle: Function,
61
+ /**
62
+ * Applies striped row styling
63
+ */
64
+ striped: Boolean,
65
+ /**
66
+ * Enhances the first column's visual prominence
67
+ */
68
+ largeFirst: Boolean,
69
+ /**
70
+ * Additional style modifiers
71
+ */
72
+ modifiers: [String, Array],
73
+ /**
74
+ * Allows user to pass classes object to add custom classes to parts of the component
75
+ */
76
+ classes: {
77
+ type: Object,
78
+ default: () => ({})
79
+ }
80
+ },
81
+ setup(e) {
82
+ const t = e, { resolvedModifiers: s } = b({
83
+ props: t,
84
+ baseClass: "data-table",
85
+ internal: l(() => ({
86
+ striped: t.striped,
87
+ "large-first": t.largeFirst
88
+ }))
89
+ });
90
+ return (r, P) => (c(), n(p, u({ class: "data-table" }, r.$attrs, {
91
+ columns: e.columns,
92
+ rows: e.rows,
93
+ footerRows: e.footerRows,
94
+ caption: e.caption,
95
+ idPrefix: e.idPrefix,
96
+ getRowValue: e.getRowValue,
97
+ getColumnTitle: e.getColumnTitle,
98
+ classes: {
99
+ ...e.classes,
100
+ table: [f(s), e.classes?.table]
101
+ }
102
+ }), m({ _: 2 }, [
103
+ d(r.$slots, (C, a) => ({
104
+ name: a,
105
+ fn: g((i) => [
106
+ w(r.$slots, a, y(R(i)))
107
+ ])
108
+ }))
109
+ ]), 1040, ["columns", "rows", "footerRows", "caption", "idPrefix", "getRowValue", "getColumnTitle", "classes"]));
110
+ }
111
+ };
112
+ export {
113
+ x as default
114
+ };
@@ -6,9 +6,9 @@ type __VLS_WithTemplateSlots<T, S> = T & (new () => {
6
6
  declare const __VLS_component: import('vue').DefineComponent<{}, {
7
7
  classes: Record<string, any>;
8
8
  compact: boolean;
9
+ table: boolean;
9
10
  inline: boolean;
10
11
  inlineAll: boolean;
11
- table: boolean;
12
12
  separated: boolean;
13
13
  separatedFirst: boolean;
14
14
  separatedLast: boolean;
@@ -17,9 +17,9 @@ declare const __VLS_component: import('vue').DefineComponent<{}, {
17
17
  $props: {
18
18
  readonly classes?: Record<string, any> | undefined;
19
19
  readonly compact?: boolean | undefined;
20
+ readonly table?: boolean | undefined;
20
21
  readonly inline?: boolean | undefined;
21
22
  readonly inlineAll?: boolean | undefined;
22
- readonly table?: boolean | undefined;
23
23
  readonly separated?: boolean | undefined;
24
24
  readonly separatedFirst?: boolean | undefined;
25
25
  readonly separatedLast?: boolean | undefined;
@@ -40,6 +40,7 @@ type __VLS_TemplateResult = {
40
40
  index: number;
41
41
  descriptionIndex: number;
42
42
  }): any;
43
+ default?(_: {}): any;
43
44
  };
44
45
  refs: {};
45
46
  rootEl: any;
@@ -1 +1 @@
1
- {"version":3,"file":"UluDefinitionList.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/elements/UluDefinitionList.vue"],"names":[],"mappings":"AAmCA;wBAyQqB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;;6BAEtE,CAAC,EAAE,CAAC;;;AAVjC;;;;;;;;;;;;;;;;;;;;;;;2OAOG"}
1
+ {"version":3,"file":"UluDefinitionList.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/elements/UluDefinitionList.vue"],"names":[],"mappings":"AAsCA;wBAuRqB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;;6BAEtE,CAAC,EAAE,CAAC;;;AAVjC;;;;;;;;;;;;;;;;;;;;;;;2OAOG"}
@@ -1,6 +1,6 @@
1
- import { computed as b, createElementBlock as r, createCommentVNode as g, openBlock as a, normalizeClass as n, unref as k, Fragment as d, renderList as m, createElementVNode as L, renderSlot as p, createTextVNode as u, toDisplayString as f } from "vue";
2
- import { useModifiers as C } from "../../composables/useModifiers.js";
3
- const N = {
1
+ import { provide as b, computed as m, createElementBlock as i, createCommentVNode as g, openBlock as a, normalizeClass as r, unref as L, renderSlot as o, Fragment as u, renderList as f, createElementVNode as C, createTextVNode as p, toDisplayString as y } from "vue";
2
+ import { useModifiers as D } from "../../composables/useModifiers.js";
3
+ const M = {
4
4
  __name: "UluDefinitionList",
5
5
  props: {
6
6
  /**
@@ -48,55 +48,57 @@ const N = {
48
48
  */
49
49
  compact: Boolean
50
50
  },
51
- setup(t) {
52
- const e = t, y = b(() => ({
53
- inline: e.inline,
54
- "inline-all": e.inlineAll,
55
- table: e.table,
56
- separated: e.separated,
57
- "separated-first": e.separatedFirst,
58
- "separated-last": e.separatedLast,
59
- compact: e.compact
60
- })), { resolvedModifiers: B } = C({
61
- props: e,
62
- internal: y,
51
+ setup(e) {
52
+ const t = e;
53
+ b("uluDefinitionListClasses", m(() => t.classes));
54
+ const B = m(() => ({
55
+ inline: t.inline,
56
+ "inline-all": t.inlineAll,
57
+ table: t.table,
58
+ separated: t.separated,
59
+ "separated-first": t.separatedFirst,
60
+ "separated-last": t.separatedLast,
61
+ compact: t.compact
62
+ })), { resolvedModifiers: k } = D({
63
+ props: t,
64
+ internal: B,
63
65
  baseClass: "definition-list"
64
66
  }), A = (s) => Array.isArray(s.description) ? s.description : [s.description];
65
- return (s, D) => t.items?.length ? (a(), r("dl", {
67
+ return (s, $) => (e.items !== void 0 ? e.items.length : s.$slots.default) ? (a(), i("dl", {
66
68
  key: 0,
67
- class: n(["definition-list", [k(B), t.classes.list]])
69
+ class: r(["definition-list", [L(k), e.classes.list]])
68
70
  }, [
69
- (a(!0), r(d, null, m(t.items, (i, l) => (a(), r("div", {
71
+ e.items !== void 0 ? (a(!0), i(u, { key: 0 }, f(e.items, (n, l) => (a(), i("div", {
70
72
  key: l,
71
- class: n(t.classes.item)
73
+ class: r(e.classes.item)
72
74
  }, [
73
- L("dt", {
74
- class: n(t.classes.term)
75
+ C("dt", {
76
+ class: r(e.classes.term)
75
77
  }, [
76
- p(s.$slots, "term", {
77
- item: i,
78
+ o(s.$slots, "term", {
79
+ item: n,
78
80
  index: l
79
81
  }, () => [
80
- u(f(i.term), 1)
82
+ p(y(n.term), 1)
81
83
  ])
82
84
  ], 2),
83
- (a(!0), r(d, null, m(A(i), (o, c) => (a(), r("dd", {
85
+ (a(!0), i(u, null, f(A(n), (d, c) => (a(), i("dd", {
84
86
  key: c,
85
- class: n(t.classes.description)
87
+ class: r(e.classes.description)
86
88
  }, [
87
- p(s.$slots, "description", {
88
- item: i,
89
- description: o,
89
+ o(s.$slots, "description", {
90
+ item: n,
91
+ description: d,
90
92
  index: l,
91
93
  descriptionIndex: c
92
94
  }, () => [
93
- u(f(o), 1)
95
+ p(y(d), 1)
94
96
  ])
95
97
  ], 2))), 128))
96
- ], 2))), 128))
98
+ ], 2))), 128)) : o(s.$slots, "default", { key: 1 })
97
99
  ], 2)) : g("", !0);
98
100
  }
99
101
  };
100
102
  export {
101
- N as default
103
+ M as default
102
104
  };
@@ -0,0 +1,28 @@
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> | undefined;
8
+ description?: string | unknown[] | undefined;
9
+ term?: string | undefined;
10
+ $props: {
11
+ readonly classes?: Record<string, any> | undefined;
12
+ readonly description?: string | unknown[] | undefined;
13
+ readonly term?: string | undefined;
14
+ };
15
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
16
+ type __VLS_TemplateResult = {
17
+ attrs: Partial<{}>;
18
+ slots: {
19
+ term?(_: {}): any;
20
+ description?(_: {
21
+ description: unknown;
22
+ index: number;
23
+ }): any;
24
+ };
25
+ refs: {};
26
+ rootEl: HTMLDivElement;
27
+ };
28
+ //# sourceMappingURL=UluDefinitionListItem.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UluDefinitionListItem.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/elements/UluDefinitionListItem.vue"],"names":[],"mappings":"AAgBA;wBAwIqB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;;6BAEtE,CAAC,EAAE,CAAC;;;AAXjC;;;;;;;;;sPAQG"}
@@ -0,0 +1,46 @@
1
+ import { inject as f, computed as o, createElementBlock as r, openBlock as i, normalizeClass as n, createElementVNode as y, renderSlot as d, createTextVNode as u, toDisplayString as m, Fragment as g, renderList as C } from "vue";
2
+ const k = {
3
+ __name: "UluDefinitionListItem",
4
+ props: {
5
+ /**
6
+ * The term text (renders inside dt)
7
+ */
8
+ term: String,
9
+ /**
10
+ * The description text or array of strings (renders inside dd)
11
+ */
12
+ description: [String, Array],
13
+ /**
14
+ * Optional classes object to override/append to injected parent classes { item, term, description }
15
+ */
16
+ classes: Object
17
+ },
18
+ setup(e) {
19
+ const t = e, p = f("uluDefinitionListClasses", { value: {} }), s = o(() => p.value || {}), v = o(() => t.description ? Array.isArray(t.description) ? t.description : [t.description] : []);
20
+ return (c, S) => (i(), r("div", {
21
+ class: n([s.value.item, e.classes?.item])
22
+ }, [
23
+ y("dt", {
24
+ class: n([s.value.term, e.classes?.term])
25
+ }, [
26
+ d(c.$slots, "term", {}, () => [
27
+ u(m(e.term), 1)
28
+ ])
29
+ ], 2),
30
+ (i(!0), r(g, null, C(v.value, (l, a) => (i(), r("dd", {
31
+ key: a,
32
+ class: n([s.value.description, e.classes?.description])
33
+ }, [
34
+ d(c.$slots, "description", {
35
+ description: l,
36
+ index: a
37
+ }, () => [
38
+ u(m(l), 1)
39
+ ])
40
+ ], 2))), 128))
41
+ ], 2));
42
+ }
43
+ };
44
+ export {
45
+ k as default
46
+ };
@@ -11,8 +11,10 @@ declare const __VLS_component: import('vue').DefineComponent<{}, {
11
11
  lines: boolean;
12
12
  forceOrdered: boolean;
13
13
  reversed: boolean;
14
+ itemElement: string;
14
15
  start?: string | undefined;
15
16
  items?: unknown[] | undefined;
17
+ element?: string | undefined;
16
18
  listStyleType?: string | undefined;
17
19
  $props: {
18
20
  readonly classes?: Record<string, any> | undefined;
@@ -22,8 +24,10 @@ declare const __VLS_component: import('vue').DefineComponent<{}, {
22
24
  readonly lines?: boolean | undefined;
23
25
  readonly forceOrdered?: boolean | undefined;
24
26
  readonly reversed?: boolean | undefined;
27
+ readonly itemElement?: string | undefined;
25
28
  readonly start?: string | undefined;
26
29
  readonly items?: unknown[] | undefined;
30
+ readonly element?: string | undefined;
27
31
  readonly listStyleType?: string | undefined;
28
32
  };
29
33
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -34,6 +38,7 @@ type __VLS_TemplateResult = {
34
38
  item: unknown;
35
39
  index: number;
36
40
  }): any;
41
+ default?(_: {}): any;
37
42
  };
38
43
  refs: {};
39
44
  rootEl: any;
@@ -1 +1 @@
1
- {"version":3,"file":"UluList.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/elements/UluList.vue"],"names":[],"mappings":"AAiCA;wBAmPqB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;;6BAEtE,CAAC,EAAE,CAAC;;;AAVjC;;;;;;;;;;;;;;;;;;;;;;;2OAOG"}
1
+ {"version":3,"file":"UluList.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/elements/UluList.vue"],"names":[],"mappings":"AAqCA;wBA0SqB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;;6BAEtE,CAAC,EAAE,CAAC;;;AAVjC;;;;;;;;;;;;;;;;;;;;;;;;;;;2OAOG"}
@@ -1,4 +1,4 @@
1
- import { computed as n, createBlock as m, createCommentVNode as u, openBlock as l, resolveDynamicComponent as y, normalizeStyle as B, normalizeClass as o, withCtx as f, createElementBlock as d, Fragment as v, renderList as S, renderSlot as g, createTextVNode as k, toDisplayString as C } from "vue";
1
+ import { provide as f, computed as r, createBlock as i, createCommentVNode as v, openBlock as n, resolveDynamicComponent as o, normalizeStyle as S, normalizeClass as c, withCtx as m, createElementBlock as B, renderSlot as u, Fragment as g, renderList as k, createTextVNode as E, toDisplayString as C } from "vue";
2
2
  const h = {
3
3
  __name: "UluList",
4
4
  props: {
@@ -8,7 +8,7 @@ const h = {
8
8
  */
9
9
  items: Array,
10
10
  /**
11
- * Classes object (keys are { list, item } to be applied to <ul> and <li>)
11
+ * Classes object (keys are { list, item } to be applied to list and item elements)
12
12
  * - Any valid class binding for each
13
13
  */
14
14
  classes: {
@@ -47,13 +47,29 @@ const h = {
47
47
  /**
48
48
  * Define list style type (ie. disc, decimal, etc)
49
49
  */
50
- listStyleType: String
50
+ listStyleType: String,
51
+ /**
52
+ * Element to render the list as (overrides ul/ol)
53
+ */
54
+ element: String,
55
+ /**
56
+ * Element to render items as when using items array
57
+ */
58
+ itemElement: {
59
+ type: String,
60
+ default: "li"
61
+ }
51
62
  },
52
63
  setup(e) {
53
- const r = e, s = n(() => r.ordered || r.forceOrdered), c = n(() => s.value ? "ol" : "ul");
54
- return (i, O) => e.items?.length ? (l(), m(y(c.value), {
64
+ const t = e;
65
+ f("uluListContext", r(() => ({
66
+ classes: t.classes,
67
+ itemElement: t.itemElement
68
+ })));
69
+ const a = r(() => t.ordered || t.forceOrdered), y = r(() => t.element || (a.value ? "ol" : "ul"));
70
+ return (l, O) => (e.items !== void 0 ? e.items.length : l.$slots.default) ? (n(), i(o(y.value), {
55
71
  key: 0,
56
- class: o([
72
+ class: c([
57
73
  {
58
74
  "list-ordered": e.ordered,
59
75
  "list-unordered": e.unordered,
@@ -62,30 +78,33 @@ const h = {
62
78
  },
63
79
  e.classes.list
64
80
  ]),
65
- style: B({
81
+ style: S({
66
82
  listStyleType: e.listStyleType
67
83
  }),
68
- reversed: s.value ? e.reversed : null,
84
+ reversed: a.value ? e.reversed : null,
69
85
  start: e.start
70
86
  }, {
71
- default: f(() => [
72
- (l(!0), d(v, null, S(e.items, (t, a) => (l(), d("li", {
73
- key: a,
74
- class: o([
87
+ default: m(() => [
88
+ e.items !== void 0 ? (n(!0), B(g, { key: 0 }, k(e.items, (s, d) => (n(), i(o(e.itemElement), {
89
+ key: d,
90
+ class: c([
75
91
  e.classes.item,
76
- t?.classes?.item
77
- ])
78
- }, [
79
- g(i.$slots, "default", {
80
- item: t,
81
- index: a
82
- }, () => [
83
- k(C(t), 1)
92
+ s?.classes?.item
84
93
  ])
85
- ], 2))), 128))
94
+ }, {
95
+ default: m(() => [
96
+ u(l.$slots, "default", {
97
+ item: s,
98
+ index: d
99
+ }, () => [
100
+ E(C(s), 1)
101
+ ])
102
+ ]),
103
+ _: 2
104
+ }, 1032, ["class"]))), 128)) : u(l.$slots, "default", { key: 1 })
86
105
  ]),
87
106
  _: 3
88
- }, 8, ["class", "style", "reversed", "start"])) : u("", !0);
107
+ }, 8, ["class", "style", "reversed", "start"])) : v("", !0);
89
108
  }
90
109
  };
91
110
  export {
@@ -0,0 +1,22 @@
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?: string | Record<string, any> | unknown[] | undefined;
8
+ element?: string | undefined;
9
+ $props: {
10
+ readonly classes?: string | Record<string, any> | unknown[] | undefined;
11
+ readonly element?: string | undefined;
12
+ };
13
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
14
+ type __VLS_TemplateResult = {
15
+ attrs: Partial<{}>;
16
+ slots: {
17
+ default?(_: {}): any;
18
+ };
19
+ refs: {};
20
+ rootEl: any;
21
+ };
22
+ //# sourceMappingURL=UluListItem.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UluListItem.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/elements/UluListItem.vue"],"names":[],"mappings":"AAKA;wBAqGqB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;;6BAEtE,CAAC,EAAE,CAAC;;;AAXjC;;;;;;;2OAQG"}