@ulu/frontend-vue 0.5.7 → 0.5.9
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.
- package/dist/components/elements/UluCard.vue.d.ts +2 -2
- package/dist/components/elements/UluCard.vue.d.ts.map +1 -1
- package/dist/components/elements/UluCard.vue.js +52 -53
- package/dist/utils/props.d.ts +0 -8
- package/dist/utils/props.d.ts.map +1 -1
- package/dist/utils/props.js +2 -6
- package/dist/vite.d.ts +1 -0
- package/dist/vite.js +4 -3
- package/lib/components/elements/UluCard.vue +6 -15
- package/lib/utils/props.js +0 -13
- package/lib/vite.js +2 -1
- package/package.json +1 -1
|
@@ -22,7 +22,7 @@ declare const __VLS_component: import('vue').DefineComponent<{}, {
|
|
|
22
22
|
titleTo?: string | Record<string, any> | undefined;
|
|
23
23
|
titleHref?: string | undefined;
|
|
24
24
|
titleTarget?: string | undefined;
|
|
25
|
-
image?:
|
|
25
|
+
image?: Record<string, any> | undefined;
|
|
26
26
|
imageSrc?: string | undefined;
|
|
27
27
|
imageAlt?: string | undefined;
|
|
28
28
|
$props: {
|
|
@@ -43,7 +43,7 @@ declare const __VLS_component: import('vue').DefineComponent<{}, {
|
|
|
43
43
|
readonly titleTo?: string | Record<string, any> | undefined;
|
|
44
44
|
readonly titleHref?: string | undefined;
|
|
45
45
|
readonly titleTarget?: string | undefined;
|
|
46
|
-
readonly image?:
|
|
46
|
+
readonly image?: Record<string, any> | undefined;
|
|
47
47
|
readonly imageSrc?: string | undefined;
|
|
48
48
|
readonly imageAlt?: string | undefined;
|
|
49
49
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UluCard.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/elements/UluCard.vue"],"names":[],"mappings":"AA+EA;
|
|
1
|
+
{"version":3,"file":"UluCard.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/elements/UluCard.vue"],"names":[],"mappings":"AA+EA;wBA+rBqB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;;6BAEtE,CAAC,EAAE,CAAC;;;AAbjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAUG"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { useSlots as
|
|
1
|
+
import { useSlots as V, computed as o, ref as f, createBlock as k, openBlock as a, resolveDynamicComponent as P, normalizeStyle as p, normalizeClass as h, unref as n, withCtx as S, createElementVNode as $, createElementBlock as m, createCommentVNode as y, renderSlot as i, createTextVNode as C, toDisplayString as x, createVNode as A, normalizeProps as I, guardReactiveProps as q } from "vue";
|
|
2
2
|
import { RouterLink as B } from "vue-router";
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import { refToElement as
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
const K = { class: "card__body" }, Q = { class: "card__main" }, W = ["href", "target"], X = {
|
|
3
|
+
import { useModifiers as L } from "../../composables/useModifiers.js";
|
|
4
|
+
import { refToElement as F } from "../../utils/dom.js";
|
|
5
|
+
import G from "./UluImage.vue.js";
|
|
6
|
+
const J = { class: "card__body" }, K = { class: "card__main" }, Q = ["href", "target"], W = {
|
|
8
7
|
key: 0,
|
|
9
8
|
class: "card__aside"
|
|
10
|
-
},
|
|
9
|
+
}, X = {
|
|
11
10
|
key: 1,
|
|
12
11
|
class: "card__footer"
|
|
13
|
-
},
|
|
12
|
+
}, le = {
|
|
14
13
|
__name: "UluCard",
|
|
15
14
|
props: {
|
|
16
15
|
/**
|
|
@@ -84,17 +83,17 @@ const K = { class: "card__body" }, Q = { class: "card__main" }, W = ["href", "ta
|
|
|
84
83
|
default: () => ({})
|
|
85
84
|
},
|
|
86
85
|
/**
|
|
87
|
-
*
|
|
86
|
+
* Advanced configuration for the underlying `<UluImage>` component.
|
|
87
|
+
* Accepts a full configuration object (e.g., for lazy loading, srcset, etc.).
|
|
88
88
|
*/
|
|
89
|
-
image:
|
|
89
|
+
image: Object,
|
|
90
90
|
/**
|
|
91
|
-
*
|
|
92
|
-
*
|
|
91
|
+
* Convenience prop for quickly setting the image source.
|
|
92
|
+
* For advanced image configurations, use the `image` prop or `#image` slot instead.
|
|
93
93
|
*/
|
|
94
94
|
imageSrc: String,
|
|
95
95
|
/**
|
|
96
|
-
*
|
|
97
|
-
* @deprecated Use `image` (as an object with `alt`) instead.
|
|
96
|
+
* The alt text for the image when using the `imageSrc` convenience prop.
|
|
98
97
|
*/
|
|
99
98
|
imageAlt: String,
|
|
100
99
|
/**
|
|
@@ -120,37 +119,37 @@ const K = { class: "card__body" }, Q = { class: "card__main" }, W = ["href", "ta
|
|
|
120
119
|
modifiers: [Array, String]
|
|
121
120
|
},
|
|
122
121
|
emits: ["proxy-click"],
|
|
123
|
-
setup(t, { emit:
|
|
124
|
-
const e = t, H =
|
|
125
|
-
e.proxyClick && (e.to || e.href) && console.warn("UluCard: 'proxyClick' is ignored when 'to' or 'href' are present."), (e.titleTo || e.titleHref) && (e.to || e.href) && console.warn("UluCard: 'titleTo'/'titleHref' should not be used with 'to'/'href'.")
|
|
126
|
-
const b =
|
|
122
|
+
setup(t, { emit: O }) {
|
|
123
|
+
const e = t, H = O, s = V();
|
|
124
|
+
e.proxyClick && (e.to || e.href) && console.warn("UluCard: 'proxyClick' is ignored when 'to' or 'href' are present."), (e.titleTo || e.titleHref) && (e.to || e.href) && console.warn("UluCard: 'titleTo'/'titleHref' should not be used with 'to'/'href'.");
|
|
125
|
+
const b = o(() => e.image ? e.image : e.imageSrc ? {
|
|
127
126
|
src: e.imageSrc,
|
|
128
127
|
alt: e.imageAlt || ""
|
|
129
|
-
} : null), T = f(null),
|
|
128
|
+
} : null), T = f(null), v = f(null), { resolvedModifiers: M } = L({ props: e, baseClass: "card" }), E = f(null), c = f(!1), u = o(() => e.proxyClick && !e.to && !e.href), w = o(() => u.value && (e.titleTo || e.titleHref)), j = o(() => u.value && !w.value), g = o(() => u.value || null), z = o(() => ({
|
|
130
129
|
selectorPrevent: "input, select, textarea, button, a, [tabindex='-1']",
|
|
131
130
|
mousedownDurationPrevent: 250,
|
|
132
131
|
...e.proxyClickOptions
|
|
133
|
-
})),
|
|
134
|
-
function
|
|
135
|
-
if (!
|
|
136
|
-
const { selectorPrevent:
|
|
137
|
-
c.value = !1, l.closest(
|
|
132
|
+
})), D = o(() => u.value ? "pointer" : null), N = o(() => e.to ? B : e.href ? "a" : e.cardElement);
|
|
133
|
+
function R({ target: l, timeStamp: d }) {
|
|
134
|
+
if (!g.value) return;
|
|
135
|
+
const { selectorPrevent: r } = z.value;
|
|
136
|
+
c.value = !1, l.closest(r) || (c.value = !0, E.value = d);
|
|
138
137
|
}
|
|
139
|
-
function
|
|
140
|
-
if (!
|
|
141
|
-
const { mousedownDurationPrevent: d } =
|
|
142
|
-
if (l -
|
|
143
|
-
if (
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
} else if (
|
|
147
|
-
const
|
|
148
|
-
|
|
138
|
+
function U({ timeStamp: l }) {
|
|
139
|
+
if (!g.value || !c.value) return;
|
|
140
|
+
const { mousedownDurationPrevent: d } = z.value;
|
|
141
|
+
if (l - E.value < d) {
|
|
142
|
+
if (w.value) {
|
|
143
|
+
const r = F(v.value);
|
|
144
|
+
r ? r.click() : console.warn("Unable to resolve title link ref");
|
|
145
|
+
} else if (j.value) {
|
|
146
|
+
const r = T.value?.querySelector("[data-ulu-card-proxy-target]");
|
|
147
|
+
r ? r.click() : H("proxy-click");
|
|
149
148
|
}
|
|
150
149
|
}
|
|
151
150
|
c.value = !1;
|
|
152
151
|
}
|
|
153
|
-
return (l, d) => (a(), k(
|
|
152
|
+
return (l, d) => (a(), k(P(N.value), {
|
|
154
153
|
ref_key: "cardRoot",
|
|
155
154
|
ref: T,
|
|
156
155
|
class: h(["card", [
|
|
@@ -161,18 +160,18 @@ const K = { class: "card__body" }, Q = { class: "card__main" }, W = ["href", "ta
|
|
|
161
160
|
},
|
|
162
161
|
n(M)
|
|
163
162
|
]]),
|
|
164
|
-
onMousedown:
|
|
165
|
-
onMouseup:
|
|
166
|
-
style:
|
|
163
|
+
onMousedown: R,
|
|
164
|
+
onMouseup: U,
|
|
165
|
+
style: p({ cursor: D.value }),
|
|
167
166
|
target: t.target,
|
|
168
167
|
to: t.to,
|
|
169
168
|
href: t.href,
|
|
170
|
-
"data-ulu-proxy-click-init":
|
|
169
|
+
"data-ulu-proxy-click-init": g.value
|
|
171
170
|
}, {
|
|
172
171
|
default: S(() => [
|
|
173
|
-
$("div",
|
|
174
|
-
$("div",
|
|
175
|
-
t.title || n(s).title ? (a(), k(
|
|
172
|
+
$("div", J, [
|
|
173
|
+
$("div", K, [
|
|
174
|
+
t.title || n(s).title ? (a(), k(P(t.titleElement), {
|
|
176
175
|
key: 0,
|
|
177
176
|
class: h(["card__title", t.classes.title])
|
|
178
177
|
}, {
|
|
@@ -182,7 +181,7 @@ const K = { class: "card__body" }, Q = { class: "card__main" }, W = ["href", "ta
|
|
|
182
181
|
class: "card__title-link",
|
|
183
182
|
to: t.titleTo,
|
|
184
183
|
ref_key: "link",
|
|
185
|
-
ref:
|
|
184
|
+
ref: v
|
|
186
185
|
}, {
|
|
187
186
|
default: S(() => [
|
|
188
187
|
i(l.$slots, "title", {}, () => [
|
|
@@ -196,22 +195,22 @@ const K = { class: "card__body" }, Q = { class: "card__main" }, W = ["href", "ta
|
|
|
196
195
|
href: t.titleHref,
|
|
197
196
|
target: t.titleTarget,
|
|
198
197
|
ref_key: "link",
|
|
199
|
-
ref:
|
|
198
|
+
ref: v
|
|
200
199
|
}, [
|
|
201
200
|
i(l.$slots, "title", {}, () => [
|
|
202
201
|
C(x(t.title), 1)
|
|
203
202
|
])
|
|
204
|
-
], 8,
|
|
203
|
+
], 8, Q)) : i(l.$slots, "title", { key: 2 }, () => [
|
|
205
204
|
C(x(t.title), 1)
|
|
206
205
|
])
|
|
207
206
|
]),
|
|
208
207
|
_: 3
|
|
209
|
-
}, 8, ["class"])) :
|
|
208
|
+
}, 8, ["class"])) : y("", !0),
|
|
210
209
|
i(l.$slots, "body")
|
|
211
210
|
]),
|
|
212
|
-
n(s).aside ? (a(), m("div",
|
|
211
|
+
n(s).aside ? (a(), m("div", W, [
|
|
213
212
|
i(l.$slots, "aside")
|
|
214
|
-
])) :
|
|
213
|
+
])) : y("", !0)
|
|
215
214
|
]),
|
|
216
215
|
n(s).image || b.value ? (a(), m("div", {
|
|
217
216
|
key: 0,
|
|
@@ -221,17 +220,17 @@ const K = { class: "card__body" }, Q = { class: "card__main" }, W = ["href", "ta
|
|
|
221
220
|
]])
|
|
222
221
|
}, [
|
|
223
222
|
i(l.$slots, "image", {}, () => [
|
|
224
|
-
|
|
223
|
+
A(G, I(q(b.value)), null, 16)
|
|
225
224
|
])
|
|
226
|
-
], 2)) :
|
|
227
|
-
n(s).footer ? (a(), m("div",
|
|
225
|
+
], 2)) : y("", !0),
|
|
226
|
+
n(s).footer ? (a(), m("div", X, [
|
|
228
227
|
i(l.$slots, "footer")
|
|
229
|
-
])) :
|
|
228
|
+
])) : y("", !0)
|
|
230
229
|
]),
|
|
231
230
|
_: 3
|
|
232
231
|
}, 40, ["class", "style", "target", "to", "href", "data-ulu-proxy-click-init"]));
|
|
233
232
|
}
|
|
234
233
|
};
|
|
235
234
|
export {
|
|
236
|
-
|
|
235
|
+
le as default
|
|
237
236
|
};
|
package/dist/utils/props.d.ts
CHANGED
|
@@ -4,12 +4,4 @@
|
|
|
4
4
|
* @returns {Boolean} Whether all are objects within
|
|
5
5
|
*/
|
|
6
6
|
export function isArrayOfObjects(array: any[]): boolean;
|
|
7
|
-
/**
|
|
8
|
-
* Logs a deprecation warning for a component prop in non-production environments.
|
|
9
|
-
* @param {String} componentName The name of the component using the deprecated prop.
|
|
10
|
-
* @param {Object} props The component's props object.
|
|
11
|
-
* @param {String} oldProp The name of the deprecated prop.
|
|
12
|
-
* @param {String} newProp The name of the new prop to use instead.
|
|
13
|
-
*/
|
|
14
|
-
export function warnDeprecatedProp(componentName: string, props: Object, oldProp: string, newProp: string): void;
|
|
15
7
|
//# 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;;;;GAIG;AACH,wDAEC"}
|
package/dist/utils/props.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
function t(e) {
|
|
2
|
-
return e.every((
|
|
3
|
-
}
|
|
4
|
-
function i(e, n, r, o) {
|
|
5
|
-
n[r] !== void 0 && typeof process < "u" && process.env.NODE_ENV !== "production" && console.warn(`[${e}]: Prop '${r}' is deprecated and will be removed in future, Use '${o}' instead`);
|
|
2
|
+
return e.every((r) => typeof r == "object");
|
|
6
3
|
}
|
|
7
4
|
export {
|
|
8
|
-
t as isArrayOfObjects
|
|
9
|
-
i as warnDeprecatedProp
|
|
5
|
+
t as isArrayOfObjects
|
|
10
6
|
};
|
package/dist/vite.d.ts
CHANGED
package/dist/vite.js
CHANGED
|
@@ -83,7 +83,6 @@
|
|
|
83
83
|
import { RouterLink } from "vue-router";
|
|
84
84
|
import { useModifiers } from "../../composables/useModifiers.js";
|
|
85
85
|
import { refToElement } from '../../utils/dom.js';
|
|
86
|
-
import { warnDeprecatedProp } from '../../utils/props.js';
|
|
87
86
|
import UluImage from './UluImage.vue';
|
|
88
87
|
|
|
89
88
|
const props = defineProps({
|
|
@@ -158,17 +157,17 @@
|
|
|
158
157
|
default: () => ({})
|
|
159
158
|
},
|
|
160
159
|
/**
|
|
161
|
-
*
|
|
160
|
+
* Advanced configuration for the underlying `<UluImage>` component.
|
|
161
|
+
* Accepts a full configuration object (e.g., for lazy loading, srcset, etc.).
|
|
162
162
|
*/
|
|
163
|
-
image:
|
|
163
|
+
image: Object,
|
|
164
164
|
/**
|
|
165
|
-
*
|
|
166
|
-
*
|
|
165
|
+
* Convenience prop for quickly setting the image source.
|
|
166
|
+
* For advanced image configurations, use the `image` prop or `#image` slot instead.
|
|
167
167
|
*/
|
|
168
168
|
imageSrc: String,
|
|
169
169
|
/**
|
|
170
|
-
*
|
|
171
|
-
* @deprecated Use `image` (as an object with `alt`) instead.
|
|
170
|
+
* The alt text for the image when using the `imageSrc` convenience prop.
|
|
172
171
|
*/
|
|
173
172
|
imageAlt: String,
|
|
174
173
|
/**
|
|
@@ -205,16 +204,8 @@
|
|
|
205
204
|
console.warn("UluCard: 'titleTo'/'titleHref' should not be used with 'to'/'href'.");
|
|
206
205
|
}
|
|
207
206
|
|
|
208
|
-
// Deprecation Warnings
|
|
209
|
-
// - Note these should be removed in the next minor or maybe major release
|
|
210
|
-
warnDeprecatedProp('UluCard', props, 'imageSrc', 'image');
|
|
211
|
-
warnDeprecatedProp('UluCard', props, 'imageAlt', 'image');
|
|
212
|
-
|
|
213
207
|
const resolvedImage = computed(() => {
|
|
214
208
|
if (props.image) {
|
|
215
|
-
if (typeof props.image === 'string') {
|
|
216
|
-
return { src: props.image };
|
|
217
|
-
}
|
|
218
209
|
return props.image;
|
|
219
210
|
} else if (props.imageSrc) {
|
|
220
211
|
return {
|
package/lib/utils/props.js
CHANGED
|
@@ -5,17 +5,4 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export function isArrayOfObjects(array) {
|
|
7
7
|
return array.every(item => typeof item === "object");
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Logs a deprecation warning for a component prop in non-production environments.
|
|
12
|
-
* @param {String} componentName The name of the component using the deprecated prop.
|
|
13
|
-
* @param {Object} props The component's props object.
|
|
14
|
-
* @param {String} oldProp The name of the deprecated prop.
|
|
15
|
-
* @param {String} newProp The name of the new prop to use instead.
|
|
16
|
-
*/
|
|
17
|
-
export function warnDeprecatedProp(componentName, props, oldProp, newProp) {
|
|
18
|
-
if (props[oldProp] !== undefined && typeof process !== "undefined" && process.env.NODE_ENV !== "production") {
|
|
19
|
-
console.warn(`[${ componentName }]: Prop '${ oldProp }' is deprecated and will be removed in future, Use '${ newProp }' instead`);
|
|
20
|
-
}
|
|
21
8
|
}
|
package/lib/vite.js
CHANGED
package/package.json
CHANGED