@ulu/frontend-vue 0.1.3-beta.4 → 0.1.3-beta.6

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.
@@ -0,0 +1,19 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {
2
+ $props: Partial<typeof props>;
3
+ large: boolean;
4
+ semantic: boolean;
5
+ short: boolean;
6
+ light: boolean;
7
+ margin?: string | undefined;
8
+ modifiers?: string | unknown[] | undefined;
9
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
10
+ export default _default;
11
+ declare const props: {
12
+ readonly large: boolean;
13
+ readonly semantic: boolean;
14
+ readonly short: boolean;
15
+ readonly light: boolean;
16
+ readonly margin?: string | undefined;
17
+ readonly modifiers?: string | unknown[] | undefined;
18
+ };
19
+ //# sourceMappingURL=UluRule.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UluRule.vue.d.ts","sourceRoot":"","sources":["../../../../lib/components/elements/UluRule.vue"],"names":[],"mappings":";YAgJmB,OAAO,CAAC,OAAO,KAAK,CAAC;;;;;;;;;AA3FtC;;;;;;;EAyBG"}
@@ -20,6 +20,7 @@ export { default as UluExternalLink } from "./elements/UluExternalLink.vue";
20
20
  export { default as UluIcon } from "./elements/UluIcon.vue";
21
21
  export { default as UluList } from "./elements/UluList.vue";
22
22
  export { default as UluMain } from "./elements/UluMain.vue";
23
+ export { default as UluRule } from "./elements/UluRule.vue";
23
24
  export { default as UluSpokeSpinner } from "./elements/UluSpokeSpinner.vue";
24
25
  export { default as UluTag } from "./elements/UluTag.vue";
25
26
  export { default as UluSelectableMenu } from "./forms/UluSelectableMenu.vue";
@@ -1,11 +1,30 @@
1
- declare const _default: import("vue").DefineComponent<{}, {
1
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
2
+ export default _default;
3
+ type __VLS_WithSlots<T, S> = T & (new () => {
4
+ $slots: S;
5
+ });
6
+ declare const __VLS_component: import("vue").DefineComponent<{}, {
2
7
  $emit: typeof emit;
3
8
  $props: Partial<typeof props>;
9
+ classes: Record<string, any>;
4
10
  facets: unknown[];
5
11
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
- export default _default;
12
+ type __VLS_Slots = {
13
+ label?: ((props: {}) => any) | undefined;
14
+ } & {
15
+ optionAll?: ((props: {
16
+ group: unknown;
17
+ }) => any) | undefined;
18
+ } & {
19
+ option?: ((props: {
20
+ group: unknown;
21
+ option: any;
22
+ index: number;
23
+ }) => any) | undefined;
24
+ };
7
25
  declare const emit: (event: "facet-change", ...args: any[]) => void;
8
26
  declare const props: {
27
+ readonly classes: Record<string, any>;
9
28
  readonly facets: unknown[];
10
29
  };
11
30
  //# sourceMappingURL=UluFacetsFilterSelects.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UluFacetsFilterSelects.vue.d.ts","sourceRoot":"","sources":["../../../../../lib/components/systems/facets/UluFacetsFilterSelects.vue"],"names":[],"mappings":";WA+KkB,OAAO,IAAI;YADV,OAAO,CAAC,OAAO,KAAK,CAAC;;;;AA9FxC,oEAA2C;AAP3C;;EAKG"}
1
+ {"version":3,"file":"UluFacetsFilterSelects.vue.d.ts","sourceRoot":"","sources":["../../../../../lib/components/systems/facets/UluFacetsFilterSelects.vue"],"names":[],"mappings":"wBAqPqB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;;qBAEpD,CAAC,EAAE,CAAC;;;AATzB;WAIkB,OAAO,IAAI;YADV,OAAO,CAAC,OAAO,KAAK,CAAC;;;2OAGrC;;;;;;;;;;;;;;AA5HH,oEAA2C;AApB3C;;;EAeG"}
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../../lib/plugins/popovers/defaults.js"],"names":[],"mappings":";gBAGY,MAAM;;;;;;;;;iBAuDN,MAAM"}
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../../lib/plugins/popovers/defaults.js"],"names":[],"mappings":";gBAGY,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,QAuIhB;AArLD;;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":"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"}
@@ -216,14 +216,14 @@
216
216
  // Define the internal modifiers object as a computed property (so it can react to changes)
217
217
  const internalModifiers = computed(() => ({
218
218
  [props.position]: props.position,
219
- "resize": props.allowResize,
220
- "no-resize": !props.allowResize,
221
- "no-header": !hasHeader.value,
222
- "body-fills": props.bodyFills,
223
- "no-backdrop": props.noBackdrop,
224
- "no-min-height": props.noMinHeight,
225
- "non-modal": props.nonModal,
226
- "resizer-active": resizerEnabled.value,
219
+ "resize" : props.allowResize,
220
+ "no-resize" : !props.allowResize,
221
+ "no-header" : !hasHeader.value,
222
+ "body-fills" : props.bodyFills,
223
+ "no-backdrop" : props.noBackdrop,
224
+ "no-min-height" : props.noMinHeight,
225
+ "non-modal" : props.nonModal,
226
+ "resizer-active" : resizerEnabled.value,
227
227
  }));
228
228
 
229
229
  const { resolvedModifiers } = useModifiers({
@@ -0,0 +1,49 @@
1
+ <template>
2
+ <hr v-if="semantic" class="rule" :class="resolvedModifiers">
3
+ <div v-else class="rule" :class="resolvedModifiers"></div>
4
+ </template>
5
+
6
+ <script setup>
7
+ import { computed } from "vue";
8
+ import { useModifiers } from "../../composables/useModifiers.js";
9
+
10
+ const props = defineProps({
11
+ /**
12
+ * Whether to use the actual <hr> vs superficial <div></div> for rule element
13
+ */
14
+ semantic: Boolean,
15
+ /**
16
+ * Use short modifier
17
+ */
18
+ short: Boolean,
19
+ /**
20
+ * Optional margin (keyword from your rule margins config in frontend)
21
+ */
22
+ margin: String,
23
+ /**
24
+ * Add light modifier (if set, usually exists, this is for convenience, use modifiers prop if you have custom naming)
25
+ */
26
+ light: Boolean,
27
+ /**
28
+ * Add large modifier (if set, usually exists, this is for convenience, use modifiers prop if you have custom naming)
29
+ */
30
+ large: Boolean,
31
+ /**
32
+ * Modifiers (to add any modifier classes based on base class [ie. 'tertiary'])
33
+ */
34
+ modifiers: [String, Array]
35
+ });
36
+
37
+ const internalModifiers = computed(() => ({
38
+ "short" : props.short,
39
+ "light" : props.light,
40
+ "large" : props.large,
41
+ [`margin-${ props.margin }`] : props.margin
42
+ }));
43
+
44
+ const { resolvedModifiers } = useModifiers({
45
+ props,
46
+ baseClass: "rule",
47
+ internal: internalModifiers
48
+ });
49
+ </script>
@@ -25,6 +25,7 @@ export { default as UluExternalLink } from './elements/UluExternalLink.vue';
25
25
  export { default as UluIcon } from './elements/UluIcon.vue';
26
26
  export { default as UluList } from './elements/UluList.vue';
27
27
  export { default as UluMain } from './elements/UluMain.vue';
28
+ export { default as UluRule } from './elements/UluRule.vue';
28
29
  export { default as UluSpokeSpinner } from './elements/UluSpokeSpinner.vue';
29
30
  export { default as UluTag } from './elements/UluTag.vue';
30
31
  export { default as UluSelectableMenu } from './forms/UluSelectableMenu.vue';
@@ -1,26 +1,40 @@
1
1
  <template>
2
- <div class="facets-dropdown-filters">
2
+ <div class="facets-dropdown-filters" :class="classes.container">
3
3
  <div
4
4
  class="facets-dropdown-filters__group"
5
+ :class="classes.group"
5
6
  v-for="group in facets"
6
7
  :key="group.uid"
7
8
  >
8
- <label :for="`facet-dropdown-${group.uid}`" class="facets-dropdown-filters__label">
9
- {{ group.name }}
9
+ <label
10
+ :for="`facet-dropdown-${ group.uid }`"
11
+ class="facets-dropdown-filters__label"
12
+ :class="classes.label"
13
+ >
14
+ <slot name="label">
15
+ {{ group.name }}
16
+ </slot>
10
17
  </label>
11
18
  <select
12
19
  :id="`facet-dropdown-${group.uid}`"
13
20
  class="facets-dropdown-filters__select"
21
+ :class="classes.select"
14
22
  @change="onFilterChange(group, $event)"
15
23
  >
16
- <option value="">All {{ group.name }}s</option>
24
+ <option value="">
25
+ <slot name="optionAll" :group="group">
26
+ All {{ group.name }}s
27
+ </slot>
28
+ </option>
17
29
  <option
18
- v-for="option in group.children"
30
+ v-for="(option, index) in group.children"
19
31
  :key="option.uid"
20
32
  :value="option.uid"
21
33
  :selected="option.selected"
22
34
  >
23
- {{ option.label }}
35
+ <slot name="option" :group="group" :option="option" :index="index">
36
+ {{ option.label }}
37
+ </slot>
24
38
  </option>
25
39
  </select>
26
40
  </div>
@@ -29,12 +43,25 @@
29
43
 
30
44
  <script setup>
31
45
  const props = defineProps({
46
+ /**
47
+ * Facets Array
48
+ */
32
49
  facets: {
33
50
  type: Array,
34
51
  default: () => []
35
- }
52
+ },
53
+ /**
54
+ * Optional classes bindings for all elements { container, group, label, select }
55
+ */
56
+ classes: {
57
+ type: Object,
58
+ default: () => ({})
59
+ },
36
60
  });
37
61
 
62
+ console.log(props);
63
+
64
+
38
65
  const emit = defineEmits(['facet-change']);
39
66
 
40
67
  function onFilterChange(group, event) {
@@ -9,16 +9,7 @@ export default {
9
9
  * @type {String}
10
10
  */
11
11
  directiveName: "ulu-tooltip",
12
- /**
13
- * The element that the tooltip should be rendered within
14
- * - Default bottom of the body (on top of everything)
15
- * - Doesn't need to be inline for accessibility since tooltips are just an enhancement
16
- * content displayed within them should be hidden for assistive devices,
17
- * they are not visible to assistive devices
18
- * @type {String}
19
- */
20
- tooltipTeleportTo: "body",
21
- },
12
+ },
22
13
  /**
23
14
  * Default Popover Options
24
15
  */
@@ -59,6 +50,15 @@ export default {
59
50
  * @type {Object}
60
51
  */
61
52
  tooltip: {
53
+ /**
54
+ * The element that the tooltip should be rendered within
55
+ * - Default bottom of the body if this is unset
56
+ * - Doesn't need to be inline for accessibility since tooltips are just an enhancement
57
+ * content displayed within them should be hidden for assistive devices,
58
+ * they are not visible to assistive devices
59
+ * @type {String}
60
+ */
61
+ teleportTo: null,
62
62
  /**
63
63
  * Optional class binding for tooltip element
64
64
  * @type {String|Object|Array}
@@ -70,6 +70,15 @@ export default function install(app, userOptions = {}) {
70
70
  config: {},
71
71
  });
72
72
  const showTooltip = (triggerEl, configObj) => {
73
+ // If a teleport target isn't already specified in the config,
74
+ // try to find a parent dialog to teleport to automatically.
75
+ if (triggerEl && !configObj.teleportTo) {
76
+ const dialog = triggerEl.closest("dialog");
77
+ if (dialog) {
78
+ configObj.teleportTo = dialog;
79
+ }
80
+ }
81
+
73
82
  // If a tooltip is already active for a different element, remove its attribute.
74
83
  if (tooltipState.trigger && tooltipState.trigger !== triggerEl) {
75
84
  if (tooltipState.trigger?.removeAttribute) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ulu/frontend-vue",
3
- "version": "0.1.3-beta.4",
3
+ "version": "0.1.3-beta.6",
4
4
  "description": "A modular and tree-shakeable Vue 3 component library for the Ulu frontend",
5
5
  "type": "module",
6
6
  "files": [