@ulu/frontend-vue 0.5.16 → 0.6.1

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 (133) hide show
  1. package/dist/components/elements/UluBadge.vue.d.ts +2 -0
  2. package/dist/components/elements/UluBadge.vue.d.ts.map +1 -1
  3. package/dist/components/elements/UluBadge.vue.js +30 -21
  4. package/dist/components/elements/UluButton.vue.d.ts +4 -0
  5. package/dist/components/elements/UluButton.vue.d.ts.map +1 -1
  6. package/dist/components/elements/UluButton.vue.js +31 -16
  7. package/dist/components/elements/UluIcon.vue.js +21 -36
  8. package/dist/components/forms/UluFormCheckbox.vue.d.ts +3 -19
  9. package/dist/components/forms/UluFormCheckbox.vue.d.ts.map +1 -1
  10. package/dist/components/forms/UluFormCheckbox.vue.js +10 -31
  11. package/dist/components/forms/UluFormFile.vue.d.ts +3 -25
  12. package/dist/components/forms/UluFormFile.vue.d.ts.map +1 -1
  13. package/dist/components/forms/UluFormFile.vue.js +11 -49
  14. package/dist/components/forms/UluFormItem.vue.d.ts +23 -8
  15. package/dist/components/forms/UluFormItem.vue.d.ts.map +1 -1
  16. package/dist/components/forms/UluFormItem.vue.js +126 -29
  17. package/dist/components/forms/UluFormLabel.vue.d.ts +24 -0
  18. package/dist/components/forms/UluFormLabel.vue.d.ts.map +1 -0
  19. package/dist/components/forms/UluFormLabel.vue.js +34 -0
  20. package/dist/components/forms/UluFormRadio.vue.d.ts +7 -25
  21. package/dist/components/forms/UluFormRadio.vue.d.ts.map +1 -1
  22. package/dist/components/forms/UluFormRadio.vue.js +11 -37
  23. package/dist/components/forms/UluFormSelect.vue.d.ts +7 -23
  24. package/dist/components/forms/UluFormSelect.vue.d.ts.map +1 -1
  25. package/dist/components/forms/UluFormSelect.vue.js +24 -43
  26. package/dist/components/forms/UluFormText.vue.d.ts +5 -23
  27. package/dist/components/forms/UluFormText.vue.d.ts.map +1 -1
  28. package/dist/components/forms/UluFormText.vue.js +10 -38
  29. package/dist/components/forms/UluFormTextarea.vue.d.ts +5 -23
  30. package/dist/components/forms/UluFormTextarea.vue.d.ts.map +1 -1
  31. package/dist/components/forms/UluFormTextarea.vue.js +10 -37
  32. package/dist/components/forms/UluSearchForm.vue.d.ts +24 -3
  33. package/dist/components/forms/UluSearchForm.vue.d.ts.map +1 -1
  34. package/dist/components/forms/UluSearchForm.vue.js +67 -22
  35. package/dist/components/index.d.ts +1 -0
  36. package/dist/components/systems/facets/UluFacetsFilterSelects.vue.d.ts.map +1 -1
  37. package/dist/components/systems/facets/UluFacetsFilterSelects.vue.js +21 -22
  38. package/dist/components/systems/facets/useFacets.d.ts.map +1 -1
  39. package/dist/components/systems/scroll-anchors/useScrollAnchorSection.d.ts.map +1 -1
  40. package/dist/components/systems/scroll-anchors/useScrollAnchorSections.d.ts.map +1 -1
  41. package/dist/components/systems/scroll-anchors/useScrollAnchors.d.ts.map +1 -1
  42. package/dist/components/utils/UluAction.vue.d.ts +2 -0
  43. package/dist/components/utils/UluAction.vue.d.ts.map +1 -1
  44. package/dist/components/utils/UluAction.vue.js +9 -5
  45. package/dist/components/visualizations/UluProgressBar.vue.d.ts +2 -2
  46. package/dist/composables/useBreakpointManager.d.ts.map +1 -1
  47. package/dist/composables/useDocumentTitle.d.ts.map +1 -1
  48. package/dist/composables/useIcon.d.ts +3 -0
  49. package/dist/composables/useIcon.d.ts.map +1 -1
  50. package/dist/composables/useModifiers.d.ts.map +1 -1
  51. package/dist/composables/usePagination.d.ts.map +1 -1
  52. package/dist/composables/useRequiredInject.d.ts.map +1 -1
  53. package/dist/composables/useTableData.d.ts.map +1 -1
  54. package/dist/composables/useUluFloating.d.ts.map +1 -1
  55. package/dist/composables/useWindowResize.d.ts.map +1 -1
  56. package/dist/index.js +130 -128
  57. package/dist/mcp-data.json +17685 -0
  58. package/dist/plugins/breakpoints/index.d.ts.map +1 -1
  59. package/dist/plugins/core/index.d.ts.map +1 -1
  60. package/dist/plugins/core/index.js +17 -16
  61. package/dist/plugins/modals/api.d.ts.map +1 -1
  62. package/dist/plugins/modals/index.d.ts.map +1 -1
  63. package/dist/plugins/modals/useModals.d.ts.map +1 -1
  64. package/dist/plugins/popovers/defaults.d.ts.map +1 -1
  65. package/dist/plugins/popovers/index.d.ts.map +1 -1
  66. package/dist/plugins/popovers/useTooltip.d.ts.map +1 -1
  67. package/dist/plugins/popovers/useTooltipFollow.d.ts.map +1 -1
  68. package/dist/plugins/toast/index.d.ts.map +1 -1
  69. package/dist/plugins/toast/store.d.ts.map +1 -1
  70. package/dist/plugins/toast/useToast.d.ts.map +1 -1
  71. package/dist/resolver.d.ts.map +1 -1
  72. package/dist/utils/dom.d.ts +3 -0
  73. package/dist/utils/dom.d.ts.map +1 -1
  74. package/dist/utils/props.d.ts +10 -0
  75. package/dist/utils/props.d.ts.map +1 -1
  76. package/dist/utils/props.js +8 -2
  77. package/dist/utils/router.d.ts +12 -15
  78. package/dist/utils/router.d.ts.map +1 -1
  79. package/lib/components/elements/UluBadge.vue +16 -5
  80. package/lib/components/elements/UluButton.vue +18 -3
  81. package/lib/components/elements/UluIcon.vue +8 -26
  82. package/lib/components/forms/UluForm.vue +25 -25
  83. package/lib/components/forms/UluFormCheckbox.vue +11 -25
  84. package/lib/components/forms/UluFormFieldset.vue +6 -6
  85. package/lib/components/forms/UluFormFile.vue +10 -40
  86. package/lib/components/forms/UluFormItem.vue +150 -39
  87. package/lib/components/forms/UluFormLabel.vue +30 -0
  88. package/lib/components/forms/UluFormRadio.vue +15 -34
  89. package/lib/components/forms/UluFormSelect.vue +19 -24
  90. package/lib/components/forms/UluFormText.vue +7 -25
  91. package/lib/components/forms/UluFormTextarea.vue +7 -25
  92. package/lib/components/forms/UluSearchForm.vue +67 -19
  93. package/lib/components/forms/UluSelectableMenu.vue +62 -62
  94. package/lib/components/index.js +4 -0
  95. package/lib/components/systems/facets/UluFacetsFilterSelects.vue +11 -14
  96. package/lib/components/systems/facets/useFacets.js +3 -0
  97. package/lib/components/systems/index.js +3 -0
  98. package/lib/components/systems/scroll-anchors/useScrollAnchorSection.js +3 -0
  99. package/lib/components/systems/scroll-anchors/useScrollAnchorSections.js +3 -0
  100. package/lib/components/systems/scroll-anchors/useScrollAnchors.js +3 -0
  101. package/lib/components/utils/UluAction.vue +6 -2
  102. package/lib/composables/useBreakpointManager.js +3 -0
  103. package/lib/composables/useDocumentTitle.js +3 -0
  104. package/lib/composables/useIcon.js +3 -0
  105. package/lib/composables/useModifiers.js +3 -1
  106. package/lib/composables/usePagination.js +3 -0
  107. package/lib/composables/useRequiredInject.js +3 -0
  108. package/lib/composables/useTableData.js +3 -0
  109. package/lib/composables/useUluFloating.js +3 -0
  110. package/lib/composables/useWindowResize.js +3 -0
  111. package/lib/index.js +1 -1
  112. package/lib/meta.js +1 -1
  113. package/lib/plugins/breakpoints/index.js +3 -0
  114. package/lib/plugins/core/index.js +4 -2
  115. package/lib/plugins/index.js +1 -1
  116. package/lib/plugins/modals/api.js +3 -0
  117. package/lib/plugins/modals/index.js +2 -3
  118. package/lib/plugins/modals/useModals.js +3 -0
  119. package/lib/plugins/popovers/defaults.js +3 -0
  120. package/lib/plugins/popovers/index.js +3 -0
  121. package/lib/plugins/popovers/useTooltip.js +3 -0
  122. package/lib/plugins/popovers/useTooltipFollow.js +3 -0
  123. package/lib/plugins/toast/defaults.js +3 -0
  124. package/lib/plugins/toast/index.js +3 -0
  125. package/lib/plugins/toast/store.js +3 -0
  126. package/lib/plugins/toast/useToast.js +3 -0
  127. package/lib/resolver.js +3 -0
  128. package/lib/utils/dom.js +3 -0
  129. package/lib/utils/index.js +3 -0
  130. package/lib/utils/props.js +17 -0
  131. package/lib/utils/router.js +10 -10
  132. package/lib/vite.js +3 -0
  133. package/package.json +19 -6
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/plugins/breakpoints/index.js"],"names":[],"mappings":"AAiBA;;;;;;;;;GASG;AACH,qCALW,MAAM,eAEd;IAA6B,gBAAgB;IAChB,cAAc;CAC7C,QA8BA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/plugins/breakpoints/index.js"],"names":[],"mappings":"AAoBA;;;;;;;;;GASG;AACH,qCALW,MAAM,eAEd;IAA6B,gBAAgB;IAChB,cAAc;CAC7C,QA8BA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/plugins/core/index.js"],"names":[],"mappings":"AAmCA;;;;;;;;;;GAUG;AACH,qCAPW,MAAM,iBAEd;IAA+B,iBAAiB;IAClB,aAAa;IACX,gBAAgB;IAClB,WAAW;CAC3C,QA0DA;AAtED,gCAA0D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/plugins/core/index.js"],"names":[],"mappings":"AAqCA;;;;;;;;;;GAUG;AACH,qCAPW,MAAM,iBAEd;IAA+B,iBAAiB;IAClB,aAAa;IACX,gBAAgB;IAClB,WAAW;CAC3C,QA0DA;AAtED,gCAA0D"}
@@ -2,7 +2,7 @@ import { reactive as c } from "vue";
2
2
  const o = {
3
3
  fontAwesomeStatic: !1,
4
4
  iconComponent: null,
5
- iconPropResolver: (a) => ({ icon: a }),
5
+ iconPropResolver: (n) => ({ icon: n }),
6
6
  iconsByType: {
7
7
  danger: "fas fa-triangle-exclamation",
8
8
  warning: "fas fa-circle-exclamation",
@@ -22,12 +22,13 @@ const o = {
22
22
  file: "fas fa-file",
23
23
  previous: "fas fa-chevron-left",
24
24
  next: "fas fa-chevron-right",
25
- dropdownExpand: "fas fa-caret-down"
25
+ dropdownExpand: "fas fa-caret-down",
26
+ search: "fas fa-search"
26
27
  }
27
28
  };
28
- function p(a, f = {}) {
29
- const t = c({ ...o }), { iconsByType: i, ...r } = f || {};
30
- r && Object.assign(t, r);
29
+ function p(n, f = {}) {
30
+ const t = c({ ...o }), { iconsByType: r, ...i } = f || {};
31
+ i && Object.assign(t, i);
31
32
  const s = {
32
33
  // Methods to interact with settings
33
34
  getSettings() {
@@ -46,25 +47,25 @@ function p(a, f = {}) {
46
47
  }
47
48
  return t[e];
48
49
  },
49
- updateSetting(e, n) {
50
+ updateSetting(e, a) {
50
51
  if (typeof e != "string")
51
52
  throw new Error("Expected key to be string");
52
- t[e] = n;
53
+ t[e] = a;
53
54
  },
54
55
  getIcon(e) {
55
- const n = t.iconsByType;
56
- if (!n[e])
56
+ const a = t.iconsByType;
57
+ if (!a[e])
57
58
  throw new Error(`Icon type "${e}" not found!`);
58
- return n[e];
59
+ return a[e];
59
60
  },
60
- setIcon(e, n) {
61
- t.iconsByType[e] = n;
61
+ setIcon(e, a) {
62
+ t.iconsByType[e] = a;
62
63
  }
63
64
  };
64
- if (i)
65
- for (const [e, n] of Object.entries(i))
66
- s.setIcon(e, n);
67
- a.provide("uluCore", s), a.config.globalProperties.$uluCore = s;
65
+ if (r)
66
+ for (const [e, a] of Object.entries(r))
67
+ s.setIcon(e, a);
68
+ n.provide("uluCore", s), n.config.globalProperties.$uluCore = s;
68
69
  }
69
70
  export {
70
71
  p as default
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../lib/plugins/modals/api.js"],"names":[],"mappings":";;;;AA6BO;;IAML;;;;OAIG;;IAKH;;;OAGG;oBADS,MAAM;IAUlB;;OAEG;;IAKH;;;OAGG;uBADS,MAAM;EAUlB;AAxDF;;GAEG;AACH;;;EAAyB;AAnBzB,4BAAkB"}
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../lib/plugins/modals/api.js"],"names":[],"mappings":";;;;AAgCO;;IAML;;;;OAIG;;IAKH;;;OAGG;oBADS,MAAM;IAUlB;;OAEG;;IAKH;;;OAGG;uBADS,MAAM;EAUlB;AAxDF;;GAEG;AACH;;;EAAyB;AAnBzB,4BAAkB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/plugins/modals/index.js"],"names":[],"mappings":"AAsBA;;;;GAIG;AACH,uDAFW,sBAAsB,QA8BhC;;;;;;;;;;;;kBAxCa,eAAe"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/plugins/modals/index.js"],"names":[],"mappings":"AAqBA;;;;GAIG;AACH,uDAFW,sBAAsB,QA8BhC;;;;;;;;;;;;kBAxCa,eAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"useModals.d.ts","sourceRoot":"","sources":["../../../lib/plugins/modals/useModals.js"],"names":[],"mappings":"AASO,6BAHM,MAAM,CASlB"}
1
+ {"version":3,"file":"useModals.d.ts","sourceRoot":"","sources":["../../../lib/plugins/modals/useModals.js"],"names":[],"mappings":"AAYO,6BAHM,MAAM,CASlB"}
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../lib/plugins/popovers/defaults.js"],"names":[],"mappings":";gBAGY,MAAM;;;;;;;;;iBA8CN,MAAM"}
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../lib/plugins/popovers/defaults.js"],"names":[],"mappings":";gBAMY,MAAM;;;;;;;;;iBA8CN,MAAM"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/plugins/popovers/index.js"],"names":[],"mappings":"AAiDA;;;;GAIG;AACH,qCAHW,MAAM,gBACN,MAAM,QAgJhB;AA9LD;;GAEG;AACH,kCAAmC,mBAAmB,CAAC;AAEvD;;GAEG;AACH,gCAAiC,iBAAiB,CAAC;AAEnD;;GAEG;AACH,yBAA0B,oBAAoB,CAAC;;;AAcxC,gDAJI,GAAC,mBACD,MAAM,GACJ,MAAM,GAAC,IAAI,CAgBvB;2BA3C0B,iBAAiB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/plugins/popovers/index.js"],"names":[],"mappings":"AAoDA;;;;GAIG;AACH,qCAHW,MAAM,gBACN,MAAM,QAgJhB;AA9LD;;GAEG;AACH,kCAAmC,mBAAmB,CAAC;AAEvD;;GAEG;AACH,gCAAiC,iBAAiB,CAAC;AAEnD;;GAEG;AACH,yBAA0B,oBAAoB,CAAC;;;AAcxC,gDAJI,GAAC,mBACD,MAAM,GACJ,MAAM,GAAC,IAAI,CAgBvB;2BA3C0B,iBAAiB"}
@@ -1 +1 @@
1
- {"version":3,"file":"useTooltip.d.ts","sourceRoot":"","sources":["../../../lib/plugins/popovers/useTooltip.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,8BAFa;IAAC,WAAW,WAAW;IAAC,WAAW,WAAW;IAAC,YAAY,EAAE,MAAM,CAAA;CAAC,CAmBhF"}
1
+ {"version":3,"file":"useTooltip.d.ts","sourceRoot":"","sources":["../../../lib/plugins/popovers/useTooltip.js"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,8BAFa;IAAC,WAAW,WAAW;IAAC,WAAW,WAAW;IAAC,YAAY,EAAE,MAAM,CAAA;CAAC,CAmBhF"}
@@ -1 +1 @@
1
- {"version":3,"file":"useTooltipFollow.d.ts","sourceRoot":"","sources":["../../../lib/plugins/popovers/useTooltipFollow.js"],"names":[],"mappings":"AAKA;;;;;;EA4DC"}
1
+ {"version":3,"file":"useTooltipFollow.d.ts","sourceRoot":"","sources":["../../../lib/plugins/popovers/useTooltipFollow.js"],"names":[],"mappings":"AAQA;;;;;;EA4DC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/plugins/toast/index.js"],"names":[],"mappings":"AAIA;;GAEG;AACH,kEASC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/plugins/toast/index.js"],"names":[],"mappings":"AAOA;;GAEG;AACH,kEASC"}
@@ -1 +1 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../lib/plugins/toast/store.js"],"names":[],"mappings":"AAMA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBG;;IAMD;;;;OAIG;IACH,sBAHW,MAAM,OAYhB;IACD;;;OAGG;IACH,gCAKC;IACD;;OAEG;IACH,2BAEC"}
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../lib/plugins/toast/store.js"],"names":[],"mappings":"AASA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBG;;IAMD;;;;OAIG;IACH,sBAHW,MAAM,OAYhB;IACD;;;OAGG;IACH,gCAKC;IACD;;OAEG;IACH,2BAEC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useToast.d.ts","sourceRoot":"","sources":["../../../lib/plugins/toast/useToast.js"],"names":[],"mappings":"AAWO,4BAPM,MAAM,CAalB"}
1
+ {"version":3,"file":"useToast.d.ts","sourceRoot":"","sources":["../../../lib/plugins/toast/useToast.js"],"names":[],"mappings":"AAcO,4BAPM,MAAM,CAalB"}
@@ -1 +1 @@
1
- {"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../lib/resolver.js"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,iEAHG;IAA+B,QAAQ,EAA/B,KAAK,QAAQ;CACrB,OAeF"}
1
+ {"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../lib/resolver.js"],"names":[],"mappings":"AAWA;;;;;GAKG;AACH,iEAHG;IAA+B,QAAQ,EAA/B,KAAK,QAAQ;CACrB,OAeF"}
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @module utils.dom
3
+ */
1
4
  /**
2
5
  * Resolves a Vue template ref's unwrapped value to its underlying DOM element
3
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../lib/utils/dom.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,oCAHW,WAAW,GAAC,MAAM,GAChB,WAAW,CASvB;AAKD;;;;;;GAMG;AACH,+BAHW,MAAM,GACJ,MAAM,CASlB"}
1
+ {"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../lib/utils/dom.js"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;GAKG;AACH,oCAHW,WAAW,GAAC,MAAM,GAChB,WAAW,CASvB;AAKD;;;;;;GAMG;AACH,+BAHW,MAAM,GACJ,MAAM,CASlB"}
@@ -1,7 +1,17 @@
1
+ /**
2
+ * @module utils.props
3
+ */
1
4
  /**
2
5
  * Ensures the array consists of objects
3
6
  * @param {Array} array Array to check
4
7
  * @returns {Boolean} Whether all are objects within
5
8
  */
6
9
  export function isArrayOfObjects(array: any[]): boolean;
10
+ /**
11
+ * Checks for deprecated props and calls a callback for each match
12
+ * @param {object} props - The current props object
13
+ * @param {string[]} deprecatedNames - Array of prop names to check
14
+ * @param {function} callback - Function called for each match, receiving the prop name
15
+ */
16
+ export function checkDeprecatedProps(props: object, deprecatedNames: string[], callback: Function): void;
7
17
  //# sourceMappingURL=props.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../lib/utils/props.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wDAEC"}
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../lib/utils/props.js"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;GAIG;AACH,wDAEC;AAED;;;;;GAKG;AACH,4CAJW,MAAM,mBACN,MAAM,EAAE,4BASlB"}
@@ -1,6 +1,12 @@
1
- function t(e) {
1
+ function f(e) {
2
2
  return e.every((r) => typeof r == "object");
3
3
  }
4
+ function o(e, r, t) {
5
+ r.forEach((c) => {
6
+ e[c] !== void 0 && t(c);
7
+ });
8
+ }
4
9
  export {
5
- t as isArrayOfObjects
10
+ o as checkDeprecatedProps,
11
+ f as isArrayOfObjects
6
12
  };
@@ -1,8 +1,9 @@
1
1
  /**
2
- * This Module Creates Menus from route or router config
3
- * - Note: Functions prefixed with "$" work with $route objects (running application, provided by vue-router ie $router, useRoute, etc),
4
- * @module router-utils
2
+ * @module utils.router
5
3
  */
4
+ /**
5
+ * This Module Creates Menus from route or router config
6
+
6
7
  /**
7
8
  * Resolves a route's title from its meta.
8
9
  * - If `meta.title` is a function, it's called with the `currentRoute` (or the route itself).
@@ -25,7 +26,7 @@ export function getRouteTitle(route: object, currentRoute?: object): string | un
25
26
  * @param {Object} options Options
26
27
  * @param {Object} options.qualifier Callback to qualify as a base route (defaults to isStaticBaseRoute)
27
28
  * @param {Object} options.item Options for createMenuItem
28
- * @returns {Array.<RouteMenuItem>} Array of menu items
29
+ * @returns {Array<RouteMenuItem>} Array of menu items
29
30
  */
30
31
  export function createBaseMenu(routes: any, options: {
31
32
  qualifier: Object;
@@ -42,9 +43,9 @@ export function flattenMenu(menu: Array<RouteMenuItem>): Array<RouteMenuItem>;
42
43
  * @param {*} routes All routes
43
44
  * @param {*} sectionPath Path for section to create menu
44
45
  * @param {Object} options Options
45
- * @param {Boolean} options.includeIndex Include the parent/index in the menu items ie ({ path: "" })
46
+ * @param {Boolean} options.includeIndex Include the parent/index in the menu items ie path: ""
46
47
  * @param {Object} options.item Options to be passed to createMenuItem
47
- * @returns {Array.<RouteMenuItem>} Array of menu items
48
+ * @returns {Array<RouteMenuItem>} Array of menu items
48
49
  */
49
50
  export function createSectionMenu(routes: any, sectionPath: any, options: {
50
51
  includeIndex: boolean;
@@ -82,7 +83,7 @@ export function isStaticRoute(route: Object): boolean;
82
83
  */
83
84
  export function isStaticBaseRoute(route: Object): boolean;
84
85
  /**
85
- * Function to make normal <a> behave as router links instread of page reload
86
+ * Function to make normal `<a>` behave as router links instread of page reload
86
87
  * @param {Object} router Router instance (ie src/router) to push routes to
87
88
  * @param {Object} event The event object that triggered route change (ie. onclick) pass event object
88
89
  */
@@ -107,9 +108,9 @@ export function $getParentRoute(route: Object, deepest: Object): Object | null;
107
108
  * @param {Object} route Actual $route object
108
109
  * @param {Object} options Options
109
110
  * @param {Object} options.parent Route parent object, defaults to parent of route
110
- * @param {Boolean} options.includeIndex Include the parent/index in the menu items ie ({ path: "" })
111
+ * @param {Boolean} options.includeIndex Include the parent/index in the menu items ie path: ""
111
112
  * @param {Object} options.item Options for createMenuItem
112
- * @returns {Array.<RouteMenuItem>} Array of menu items
113
+ * @returns {Array<RouteMenuItem>} Array of menu items
113
114
  */
114
115
  export function $createSectionMenu(route: Object, options: {
115
116
  parent: Object;
@@ -123,13 +124,9 @@ export function $createSectionMenu(route: Object, options: {
123
124
  * - Skips routes where `meta.breadcrumb` is set to `false`.
124
125
  * - Avoids duplicate crumbs for nested routes with empty paths.
125
126
  * @param {Object} route The Vue Router `$route` object.
126
- * @returns {Array.<{title: String, to: Object, current: Boolean}>} An array of breadcrumb items.
127
+ * @returns {Array<Object>} An array of breadcrumb items with title, to, and current properties.
127
128
  */
128
- export function $createBreadcrumb(route: Object): Array<{
129
- title: string;
130
- to: Object;
131
- current: boolean;
132
- }>;
129
+ export function $createBreadcrumb(route: Object): Array<Object>;
133
130
  /**
134
131
  * Route Menu Item
135
132
  */
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../lib/utils/router.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;GAQG;AACH,qCAJW,MAAM,iBACN,MAAM,GACJ,MAAM,GAAC,SAAS,CAW5B;AAED;;;;;GAKG;AAEH;;;;;;;GAOG;AACH,uCANW,GAAC,WAET;IAAwB,SAAS,EAAzB,MAAM;IACU,IAAI,EAApB,MAAM;CACd,GAAU,KAAK,CAAE,aAAa,CAAC,CAgCjC;AAED;;;;GAIG;AACH,kCAHW,KAAK,CAAC,aAAa,CAAC,GAClB,KAAK,CAAC,aAAa,CAAC,CAgBhC;AAED;;;;;;;;GAQG;AACH,0CAPW,GAAC,eACD,GAAC,WAET;IAAyB,YAAY;IACb,IAAI,EAApB,MAAM;CACd,GAAU,KAAK,CAAE,aAAa,CAAC,CA4BjC;AAED;;;;GAIG;AACH,qDAFa,MAAM,CAIlB;AAED;;;;;;;;GAQG;AACH,sCAPW,MAAM,aACN,MAAM,uBAEd;IAA0B,MAAM;IACN,SAAS;CACnC,GAAU,aAAa,CAuBzB;AAED;;;;GAIG;AACH,qCAHW,MAAM,WAKhB;AAED;;;;GAIG;AACH,yCAHW,MAAM,WAMhB;AAED;;;;GAIG;AACH,yCAHW,MAAM,SACN,MAAM,QAYhB;AAED;;;;GAIG;AACH,yCAHW,MAAM,2BACJ,KAAK,CAAC,MAAM,CAAC,GAAC,SAAS,CAInC;AAED;;;;;GAKG;AACH,uCAJW,MAAM,WACN,MAAM,GACL,MAAM,OAAK,CAUtB;AAUD;;;;;;;;;;GAUG;AACH,0CAPW,MAAM,WAEd;IAAwB,MAAM,EAAtB,MAAM;IACW,YAAY;IACb,IAAI,EAApB,MAAM;CACd,GAAU,KAAK,CAAE,aAAa,CAAC,CAgBjC;AAED;;;;;;;;GAQG;AACH,yCAHW,MAAM,GACJ,KAAK,CAAE;IAAC,KAAK,SAAS;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,UAAS;CAAC,CAAC,CAmCjE"}
1
+ {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../lib/utils/router.js"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;GAWG;AACH,qCAJW,MAAM,iBACN,MAAM,GACJ,MAAM,GAAC,SAAS,CAW5B;AAED;;;;;GAKG;AAEH;;;;;;;GAOG;AACH,uCANW,GAAC,WAET;IAAwB,SAAS,EAAzB,MAAM;IACU,IAAI,EAApB,MAAM;CACd,GAAU,KAAK,CAAC,aAAa,CAAC,CAgChC;AAED;;;;GAIG;AACH,kCAHW,KAAK,CAAC,aAAa,CAAC,GAClB,KAAK,CAAC,aAAa,CAAC,CAgBhC;AAED;;;;;;;;GAQG;AACH,0CAPW,GAAC,eACD,GAAC,WAET;IAAyB,YAAY;IACb,IAAI,EAApB,MAAM;CACd,GAAU,KAAK,CAAC,aAAa,CAAC,CA4BhC;AAED;;;;GAIG;AACH,qDAFa,MAAM,CAIlB;AAED;;;;;;;;GAQG;AACH,sCAPW,MAAM,aACN,MAAM,uBAEd;IAA0B,MAAM;IACN,SAAS;CACnC,GAAU,aAAa,CAuBzB;AAED;;;;GAIG;AACH,qCAHW,MAAM,WAKhB;AAED;;;;GAIG;AACH,yCAHW,MAAM,WAMhB;AAED;;;;GAIG;AACH,yCAHW,MAAM,SACN,MAAM,QAYhB;AAED;;;;GAIG;AACH,yCAHW,MAAM,2BACJ,KAAK,CAAC,MAAM,CAAC,GAAC,SAAS,CAInC;AAED;;;;;GAKG;AACH,uCAJW,MAAM,WACN,MAAM,GACL,MAAM,OAAK,CAUtB;AAUD;;;;;;;;;;GAUG;AACH,0CAPW,MAAM,WAEd;IAAwB,MAAM,EAAtB,MAAM;IACW,YAAY;IACb,IAAI,EAApB,MAAM;CACd,GAAU,KAAK,CAAC,aAAa,CAAC,CAgBhC;AAED;;;;;;;;GAQG;AACH,yCAHW,MAAM,GACJ,KAAK,CAAC,MAAM,CAAC,CAmCzB"}
@@ -1,11 +1,7 @@
1
1
  <template>
2
2
  <component
3
3
  class="badge"
4
- :class="[
5
- size ? `badge--${ size }` : null,
6
- type ? `badge--${ type }` : null,
7
- { 'badge--clickable' : isInteractive }
8
- ]"
4
+ :class="resolvedModifiers"
9
5
  :is="element"
10
6
  :to="to"
11
7
  :href="href"
@@ -29,6 +25,7 @@
29
25
  <script setup>
30
26
  import { computed } from "vue";
31
27
  import { RouterLink } from "vue-router";
28
+ import { useModifiers } from "../../composables/useModifiers.js";
32
29
 
33
30
  const props = defineProps({
34
31
  /**
@@ -63,12 +60,26 @@
63
60
  * A URL. Renders as a standard <a> tag.
64
61
  */
65
62
  href: String,
63
+ /**
64
+ * Modifiers (to add any modifier classes based on base class [ie. 'tertiary'])
65
+ */
66
+ modifiers: [String, Array]
66
67
  });
67
68
 
68
69
  const isInteractive = computed(() => {
69
70
  return Boolean(props.to || props.click);
70
71
  });
71
72
 
73
+ const { resolvedModifiers } = useModifiers({
74
+ props,
75
+ baseClass: "badge",
76
+ internal: computed(() => ({
77
+ [props.size] : props.size,
78
+ [props.type] : props.type,
79
+ "clickable" : isInteractive.value
80
+ }))
81
+ });
82
+
72
83
  const element = computed(() => {
73
84
  const { click, to, href } = props;
74
85
  /* eslint-disable */
@@ -4,6 +4,7 @@
4
4
  :href="href"
5
5
  :target="target"
6
6
  :download="download"
7
+ :type="type"
7
8
  class="button"
8
9
  :class="[
9
10
  {
@@ -38,6 +39,7 @@
38
39
  import UluAction from "../utils/UluAction.vue";
39
40
  import UluIcon from "./UluIcon.vue";
40
41
  import { useModifiers } from "../../composables/useModifiers.js";
42
+ import { checkDeprecatedProps } from "../../utils/props.js";
41
43
 
42
44
  const props = defineProps({
43
45
  /**
@@ -70,9 +72,14 @@
70
72
  */
71
73
  download: [Boolean, String],
72
74
  /**
73
- * For icon only buttons or buttons that need an explicit label
75
+ * **Deprecated!** Use `ariaLabel` instead.
76
+ * @deprecated Use `ariaLabel` instead.
74
77
  */
75
78
  alt: String,
79
+ /**
80
+ * For icon only buttons or buttons that need an explicit aria-label
81
+ */
82
+ ariaLabel: String,
76
83
  /**
77
84
  * If not using slot this sets the buttons text via prop
78
85
  */
@@ -112,7 +119,15 @@
112
119
  /**
113
120
  * Modifiers (to add any modifier classes based on base class [ie. 'tertiary'])
114
121
  */
115
- modifiers: [String, Array]
122
+ modifiers: [String, Array],
123
+ /**
124
+ * Button type (e.g. 'submit', 'reset', 'button').
125
+ */
126
+ type: String
127
+ });
128
+
129
+ checkDeprecatedProps(props, ["alt"], (name) => {
130
+ console.warn(`[@ulu/frontend-vue] UluButton: The "${ name }" prop is deprecated. Please use "ariaLabel" instead.`);
116
131
  });
117
132
 
118
133
  const { resolvedModifiers } = useModifiers({
@@ -131,7 +146,7 @@
131
146
  });
132
147
 
133
148
  const resolvedAriaLabel = computed(() => {
134
- const label = props.alt || (props.iconOnly && props.text);
149
+ const label = props.ariaLabel || props.alt || (props.iconOnly && props.text);
135
150
  return label ? label : null;
136
151
  });
137
152
  </script>
@@ -6,7 +6,7 @@
6
6
  :class="commonClasses"
7
7
  />
8
8
  <component
9
- v-else-if="!useStaticFa && faIconComponent && resolvedDefinition"
9
+ v-else-if="!useStaticFa && faIconComponent"
10
10
  :is="faIconComponent"
11
11
  v-bind="iconProps"
12
12
  :class="commonClasses"
@@ -19,19 +19,19 @@
19
19
  </template>
20
20
 
21
21
  <script setup>
22
- import { ref, defineAsyncComponent, markRaw, watchEffect, computed, inject } from "vue";
22
+ import { defineAsyncComponent, computed, inject } from "vue";
23
23
  import { useIcon } from "../../composables/useIcon.js";
24
24
 
25
25
  const uluCore = inject('uluCore');
26
- const faIconComponent = ref(null);
27
26
  const { getIconProps, getClassesFromDefinition } = useIcon();
28
27
 
29
- let FaModule;
28
+ const AsyncFontAwesomeIcon = defineAsyncComponent(() =>
29
+ import("@fortawesome/vue-fontawesome").then(m => m.FontAwesomeIcon)
30
+ );
30
31
 
31
32
  const props = defineProps({
32
33
  /**
33
34
  * Icon definition can be string (fa classes), or array or object (any prop format FaIcon accepts)
34
- * - This will override the 'type' prop if both are provided
35
35
  */
36
36
  icon: [String, Array, Object, Boolean],
37
37
  /**
@@ -86,28 +86,10 @@
86
86
  'flow-inline': props.spaced
87
87
  }));
88
88
 
89
- // Watch for changes to prop
90
- // - Use watchEffect because we are watching reactive object property access (props)
91
- // - Load FA if needed (so it's not included if it's unneeded)
92
- // - Replace the empty component after load or if value changes
93
- watchEffect(async () => {
94
- // Only attempt to load the component if we are NOT using the static version
89
+ const faIconComponent = computed(() => {
95
90
  if (!useStaticFa.value && resolvedDefinition.value) {
96
- if (faIconComponent.value === null) {
97
- if (FaModule) {
98
- faIconComponent.value = markRaw(FaModule.FontAwesomeIcon);
99
- } else {
100
- const componentPromise = defineAsyncComponent(async () => {
101
- const module = await import("@fortawesome/vue-fontawesome");
102
- FaModule = module;
103
- return module.FontAwesomeIcon;
104
- });
105
- faIconComponent.value = markRaw(componentPromise);
106
- }
107
- }
108
- } else {
109
- // If using static FA or no definition, ensure component is null
110
- faIconComponent.value = null;
91
+ return AsyncFontAwesomeIcon;
111
92
  }
93
+ return null;
112
94
  });
113
95
  </script>
@@ -14,29 +14,29 @@
14
14
  </template>
15
15
 
16
16
  <script setup>
17
- defineProps({
18
- /**
19
- * The HTML element to use for the form.
20
- */
21
- element: {
22
- type: String,
23
- default: 'form'
24
- },
25
- /**
26
- * If true, applies the full-width styles to text inputs.
27
- */
28
- fullWidth: Boolean,
29
- /**
30
- * If true, applies the full-width styles to select inputs.
31
- */
32
- fullWidthSelect: Boolean,
33
- /**
34
- * If true, hides all labels in the form.
35
- */
36
- hideLabels: Boolean,
37
- /**
38
- * If true, right-aligns the form actions.
39
- */
40
- actionsRight: Boolean
41
- });
17
+ defineProps({
18
+ /**
19
+ * The HTML element to use for the form.
20
+ */
21
+ element: {
22
+ type: String,
23
+ default: 'form'
24
+ },
25
+ /**
26
+ * If true, applies the full-width styles to text inputs.
27
+ */
28
+ fullWidth: Boolean,
29
+ /**
30
+ * If true, applies the full-width styles to select inputs.
31
+ */
32
+ fullWidthSelect: Boolean,
33
+ /**
34
+ * If true, hides all labels in the form.
35
+ */
36
+ hideLabels: Boolean,
37
+ /**
38
+ * If true, right-aligns the form actions.
39
+ */
40
+ actionsRight: Boolean
41
+ });
42
42
  </script>
@@ -1,38 +1,24 @@
1
1
  <template>
2
2
  <input
3
3
  type="checkbox"
4
- :id="id"
4
+ v-bind="fieldAttrs"
5
5
  :checked="modelValue"
6
6
  @change="$emit('update:modelValue', $event.target.checked)"
7
- :required="required"
8
7
  >
9
- <label :for="id">
10
- <slot>
11
- {{ label }}<UluFormRequiredChar v-if="required" />
12
- </slot>
13
- </label>
14
8
  </template>
15
9
 
16
10
  <script setup>
17
- import { newId } from "../../utils/dom.js";
18
- import UluFormRequiredChar from "./UluFormRequiredChar.vue";
11
+ import { inject, computed } from "vue";
19
12
 
20
- defineProps({
21
- /**
22
- * The label for the checkbox.
23
- */
24
- label: String,
25
- /**
26
- * The value of the checkbox (for v-model).
27
- */
28
- modelValue: Boolean,
29
- /**
30
- * If true, the field will be required.
31
- */
32
- required: Boolean
33
- });
13
+ const props = defineProps({
14
+ /**
15
+ * The value of the checkbox (for v-model).
16
+ */
17
+ modelValue: Boolean
18
+ });
34
19
 
35
- defineEmits(['update:modelValue']);
20
+ defineEmits(["update:modelValue"]);
36
21
 
37
- const id = newId();
22
+ const injectedAttrs = inject("uluFormFieldAttrs", null);
23
+ const fieldAttrs = computed(() => injectedAttrs ? injectedAttrs.value : {});
38
24
  </script>
@@ -6,10 +6,10 @@
6
6
  </template>
7
7
 
8
8
  <script setup>
9
- defineProps({
10
- /**
11
- * The legend for the fieldset.
12
- */
13
- legend: String
14
- });
9
+ defineProps({
10
+ /**
11
+ * The legend for the fieldset.
12
+ */
13
+ legend: String
14
+ });
15
15
  </script>
@@ -1,59 +1,29 @@
1
1
  <template>
2
- <label
3
- :class="{ 'hidden-visually' : labelHidden }"
4
- :for="id"
5
- >
6
- <slot name="label">
7
- {{ label }}<UluFormRequiredChar v-if="required" />
8
- </slot>
9
- </label>
10
2
  <input
11
3
  type="file"
12
- @change="onChangeFile"
4
+ v-bind="fieldAttrs"
13
5
  :multiple="multiple"
14
- :id="id"
15
- v-bind="inputAttrs"
16
- :required="required"
6
+ @change="onChangeFile"
17
7
  />
18
8
  </template>
19
9
 
20
10
  <script setup>
21
- import { newId } from "../../utils/dom.js";
22
- import UluFormRequiredChar from "./UluFormRequiredChar.vue";
11
+ import { inject, computed } from "vue";
23
12
 
24
- defineProps({
25
- /**
26
- * The label for the file input.
27
- */
28
- label: {
29
- type: String,
30
- default: "Select File"
31
- },
32
- /**
33
- * If true, the label will be visually hidden.
34
- */
35
- labelHidden: Boolean,
36
- /**
37
- * If true, default classes will not be applied.
38
- */
39
- noClasses: Boolean,
13
+ const props = defineProps({
40
14
  /**
41
15
  * If true, allows multiple file selection.
42
16
  */
43
- multiple: Boolean,
44
- /**
45
- * Additional attributes to bind to the input element.
46
- */
47
- inputAttrs: Object,
48
- /**
49
- * If true, the field will be required.
50
- */
51
- required: Boolean
17
+ multiple: Boolean
52
18
  });
53
19
 
54
20
  const emit = defineEmits(["file-change"]);
55
21
 
56
- const id = newId();
22
+ const injectedAttrs = inject("uluFormFieldAttrs", null);
23
+ const fieldAttrs = computed(() => {
24
+ const attrs = injectedAttrs ? { ...injectedAttrs.value } : {};
25
+ return attrs;
26
+ });
57
27
 
58
28
  const onChangeFile = (event) => {
59
29
  emit("file-change", event.target.files);