@code-coaching/vuetiful 0.8.1 → 0.9.0
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/style.css +1 -1
- package/dist/styles/all.css +387 -9
- package/dist/types/components/atoms/VButton.vue.d.ts +14 -7
- package/dist/types/services/drawer.service.test.d.ts +1 -0
- package/dist/types/services/rail.service.test.d.ts +1 -0
- package/dist/vuetiful.es.mjs +54 -22
- package/dist/vuetiful.umd.js +7 -7
- package/package.json +1 -1
- package/src/components/atoms/VButton.test.ts +109 -2
- package/src/components/atoms/VButton.vue +34 -2
- package/src/components/molecules/VRailTile.vue +18 -8
- package/src/services/rail.service.test.ts +5 -3
|
@@ -1,20 +1,27 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
icon: {
|
|
3
|
+
type: () => boolean;
|
|
4
|
+
default: boolean;
|
|
5
|
+
};
|
|
2
6
|
tag: {
|
|
3
7
|
type: () => string;
|
|
4
8
|
default: string;
|
|
5
9
|
};
|
|
6
|
-
|
|
7
|
-
|
|
10
|
+
}, () => void, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
click: () => void;
|
|
12
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
|
+
icon: {
|
|
14
|
+
type: () => boolean;
|
|
15
|
+
default: boolean;
|
|
8
16
|
};
|
|
9
|
-
}, () => void, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
10
17
|
tag: {
|
|
11
18
|
type: () => string;
|
|
12
19
|
default: string;
|
|
13
20
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
}>> & {
|
|
22
|
+
onClick?: (() => any) | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
icon: boolean;
|
|
18
25
|
tag: string;
|
|
19
26
|
}>;
|
|
20
27
|
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/vuetiful.es.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, useAttrs, openBlock, createElementBlock, normalizeClass, unref, renderSlot, createBlock, resolveDynamicComponent, withCtx,
|
|
1
|
+
import { defineComponent, useAttrs, openBlock, createElementBlock, normalizeClass, unref, renderSlot, createBlock, resolveDynamicComponent, withCtx, ref, reactive, readonly, toRefs, computed, onMounted, Fragment, createVNode, Transition, createCommentVNode, provide, createElementVNode, inject, mergeProps, toDisplayString, withDirectives, createTextVNode, resolveComponent, renderList, pushScopeId, popScopeId } from "vue";
|
|
2
2
|
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
3
3
|
__name: "VBadge",
|
|
4
4
|
setup(__props) {
|
|
@@ -16,29 +16,52 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
16
16
|
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
17
17
|
__name: "VButton",
|
|
18
18
|
props: {
|
|
19
|
+
icon: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: false
|
|
22
|
+
},
|
|
19
23
|
tag: {
|
|
20
24
|
type: String,
|
|
21
25
|
default: "button"
|
|
22
|
-
},
|
|
23
|
-
msg: {
|
|
24
|
-
type: String
|
|
25
26
|
}
|
|
26
27
|
},
|
|
27
|
-
|
|
28
|
+
emits: ["click"],
|
|
29
|
+
setup(__props, { emit }) {
|
|
28
30
|
const attrs = useAttrs();
|
|
31
|
+
const activate = () => {
|
|
32
|
+
emit("click");
|
|
33
|
+
};
|
|
34
|
+
const clickHandler = (event) => {
|
|
35
|
+
event.preventDefault();
|
|
36
|
+
activate();
|
|
37
|
+
};
|
|
38
|
+
const keydownHandler = (event) => {
|
|
39
|
+
if (["Enter", " "].includes(event.key))
|
|
40
|
+
event.preventDefault();
|
|
41
|
+
if (event.key === "Enter")
|
|
42
|
+
activate();
|
|
43
|
+
};
|
|
44
|
+
const keyupHandler = (event) => {
|
|
45
|
+
if (event.key === " ") {
|
|
46
|
+
event.preventDefault();
|
|
47
|
+
activate();
|
|
48
|
+
}
|
|
49
|
+
};
|
|
29
50
|
return (_ctx, _cache) => {
|
|
30
51
|
var _a;
|
|
31
52
|
return openBlock(), createBlock(resolveDynamicComponent(__props.tag), {
|
|
32
|
-
|
|
53
|
+
tabindex: "0",
|
|
54
|
+
role: "button",
|
|
55
|
+
class: normalizeClass(`vuetiful-button ${__props.icon ? "btn-icon" : "btn"} border-token hover:cursor-pointer ${(_a = unref(attrs).class) != null ? _a : ""}`),
|
|
56
|
+
onClick: clickHandler,
|
|
57
|
+
onKeydown: keydownHandler,
|
|
58
|
+
onKeyup: keyupHandler
|
|
33
59
|
}, {
|
|
34
60
|
default: withCtx(() => [
|
|
35
|
-
__props.msg ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
36
|
-
createTextVNode(toDisplayString(__props.msg), 1)
|
|
37
|
-
], 64)) : createCommentVNode("", true),
|
|
38
61
|
renderSlot(_ctx.$slots, "default")
|
|
39
62
|
]),
|
|
40
63
|
_: 3
|
|
41
|
-
},
|
|
64
|
+
}, 40, ["class"]);
|
|
42
65
|
};
|
|
43
66
|
}
|
|
44
67
|
});
|
|
@@ -264,24 +287,33 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
264
287
|
const { selectedRailTile: selectedRailTile2 } = useRail();
|
|
265
288
|
const active = inject("active");
|
|
266
289
|
const hover = inject("hover");
|
|
267
|
-
const
|
|
268
|
-
if (!props.value)
|
|
269
|
-
return;
|
|
290
|
+
const activate = () => {
|
|
270
291
|
selectedRailTile2.value = props.value;
|
|
271
292
|
emit("click");
|
|
272
293
|
};
|
|
273
|
-
const
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
294
|
+
const clickHandler = (event) => {
|
|
295
|
+
event.preventDefault();
|
|
296
|
+
activate();
|
|
297
|
+
};
|
|
298
|
+
const keydownHandler = (event) => {
|
|
299
|
+
if (["Enter", " "].includes(event.key))
|
|
300
|
+
event.preventDefault();
|
|
301
|
+
if (event.key === "Enter")
|
|
302
|
+
activate();
|
|
303
|
+
};
|
|
304
|
+
const keyupHandler = (event) => {
|
|
305
|
+
if (event.key === " ") {
|
|
306
|
+
event.preventDefault();
|
|
307
|
+
activate();
|
|
308
|
+
}
|
|
280
309
|
};
|
|
281
310
|
return (_ctx, _cache) => {
|
|
282
311
|
return openBlock(), createElementBlock("div", {
|
|
283
|
-
|
|
284
|
-
|
|
312
|
+
role: "button",
|
|
313
|
+
tabindex: "0",
|
|
314
|
+
onClick: clickHandler,
|
|
315
|
+
onKeydown: keydownHandler,
|
|
316
|
+
onKeyup: keyupHandler
|
|
285
317
|
}, [
|
|
286
318
|
(openBlock(), createBlock(resolveDynamicComponent(__props.tag), mergeProps(unref(attrs), {
|
|
287
319
|
class: `app-rail-tile unstyled grid aspect-square w-full cursor-pointer place-content-center place-items-center space-y-1.5 ${unref(hover)} ${unref(selectedRailTile2) === __props.value ? `${unref(active)}` : ""} ${unref(attrs).class || ""}`
|