@geckou/ui-vue 0.5.0 → 0.6.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/README.md +52 -2
- package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/components/ArticleList/Card/Artistic.vue.js +9 -0
- package/dist/components/ArticleList/Card/Artistic.vue2.js +105 -0
- package/dist/components/ArticleList/Card/Artistic.vue3.js +27 -0
- package/dist/components/ArticleList/Card/Entertainment.vue.js +9 -0
- package/dist/components/ArticleList/Card/Entertainment.vue2.js +120 -0
- package/dist/components/ArticleList/Card/Entertainment.vue3.js +31 -0
- package/dist/components/ArticleList/Card/Gallery.vue.js +9 -0
- package/dist/components/ArticleList/Card/Gallery.vue2.js +103 -0
- package/dist/components/ArticleList/Card/Gallery.vue3.js +23 -0
- package/dist/components/ArticleList/Card/Grid.vue.js +9 -0
- package/dist/components/ArticleList/Card/Grid.vue2.js +114 -0
- package/dist/components/ArticleList/Card/Grid.vue3.js +25 -0
- package/dist/components/ArticleList/Card/News.vue.js +9 -0
- package/dist/components/ArticleList/Card/News.vue2.js +95 -0
- package/dist/components/ArticleList/Card/News.vue3.js +19 -0
- package/dist/components/ArticleList/Card/Rounded.vue.js +9 -0
- package/dist/components/ArticleList/Card/Rounded.vue2.js +96 -0
- package/dist/components/ArticleList/Card/Rounded.vue3.js +15 -0
- package/dist/components/ArticleList/Card/Row.vue.js +9 -0
- package/dist/components/ArticleList/Card/Row.vue2.js +97 -0
- package/dist/components/ArticleList/Card/Row.vue3.js +17 -0
- package/dist/components/ArticleList/Card/Simple.vue.js +9 -0
- package/dist/components/ArticleList/Card/Simple.vue2.js +98 -0
- package/dist/components/ArticleList/Card/Simple.vue3.js +23 -0
- package/dist/components/ArticleList/Card/Standard.vue.js +9 -0
- package/dist/components/ArticleList/Card/Standard.vue2.js +93 -0
- package/dist/components/ArticleList/Card/Standard.vue3.js +21 -0
- package/dist/components/ArticleList/Card/Tile.vue.js +9 -0
- package/dist/components/ArticleList/Card/Tile.vue2.js +96 -0
- package/dist/components/ArticleList/Card/Tile.vue3.js +23 -0
- package/dist/components/ArticleList/GenericArticleList.vue.js +9 -0
- package/dist/components/ArticleList/GenericArticleList.vue2.js +72 -0
- package/dist/components/ArticleList/GenericArticleList.vue3.js +11 -0
- package/dist/components/ArticleList/List/Artistic.vue.js +22 -0
- package/dist/components/ArticleList/List/Artistic.vue2.js +4 -0
- package/dist/components/ArticleList/List/Entertainment.vue.js +22 -0
- package/dist/components/ArticleList/List/Entertainment.vue2.js +4 -0
- package/dist/components/ArticleList/List/Gallery.vue.js +22 -0
- package/dist/components/ArticleList/List/Gallery.vue2.js +4 -0
- package/dist/components/ArticleList/List/Grid.vue.js +9 -0
- package/dist/components/ArticleList/List/Grid.vue2.js +120 -0
- package/dist/components/ArticleList/List/Grid.vue3.js +9 -0
- package/dist/components/ArticleList/List/News.vue.js +22 -0
- package/dist/components/ArticleList/List/News.vue2.js +4 -0
- package/dist/components/ArticleList/List/Rounded.vue.js +22 -0
- package/dist/components/ArticleList/List/Rounded.vue2.js +4 -0
- package/dist/components/ArticleList/List/Row.vue.js +22 -0
- package/dist/components/ArticleList/List/Row.vue2.js +4 -0
- package/dist/components/ArticleList/List/Simple.vue.js +22 -0
- package/dist/components/ArticleList/List/Simple.vue2.js +4 -0
- package/dist/components/ArticleList/List/Standard.vue.js +22 -0
- package/dist/components/ArticleList/List/Standard.vue2.js +4 -0
- package/dist/components/ArticleList/List/Tile.vue.js +22 -0
- package/dist/components/ArticleList/List/Tile.vue2.js +4 -0
- package/dist/components/ArticleList/Parts/AuthorInfo.vue.js +9 -0
- package/dist/components/ArticleList/Parts/AuthorInfo.vue2.js +64 -0
- package/dist/components/ArticleList/Parts/AuthorInfo.vue3.js +11 -0
- package/dist/components/ArticleList/Parts/CardContainer.vue.js +9 -0
- package/dist/components/ArticleList/Parts/CardContainer.vue2.js +18 -0
- package/dist/components/ArticleList/Parts/CardContainer.vue3.js +7 -0
- package/dist/components/ArticleList/Parts/CardHeading.vue.js +9 -0
- package/dist/components/ArticleList/Parts/CardHeading.vue2.js +25 -0
- package/dist/components/ArticleList/Parts/CardHeading.vue3.js +7 -0
- package/dist/components/ArticleList/Parts/CategoryList.vue.js +38 -0
- package/dist/components/ArticleList/Parts/CategoryList.vue2.js +4 -0
- package/dist/components/ArticleList/Parts/ExcerptText.vue.js +9 -0
- package/dist/components/ArticleList/Parts/ExcerptText.vue2.js +24 -0
- package/dist/components/ArticleList/Parts/ExcerptText.vue3.js +7 -0
- package/dist/components/ArticleList/Parts/MetadataList.vue.js +9 -0
- package/dist/components/ArticleList/Parts/MetadataList.vue2.js +62 -0
- package/dist/components/ArticleList/Parts/MetadataList.vue3.js +17 -0
- package/dist/components/ArticleList/Parts/NoImage.vue.js +9 -0
- package/dist/components/ArticleList/Parts/NoImage.vue2.js +16 -0
- package/dist/components/ArticleList/Parts/NoImage.vue3.js +7 -0
- package/dist/components/ArticleList/Parts/PostedDate.vue.js +9 -0
- package/dist/components/ArticleList/Parts/PostedDate.vue2.js +28 -0
- package/dist/components/ArticleList/Parts/PostedDate.vue3.js +7 -0
- package/dist/components/ArticleList/Parts/TagList.vue.js +32 -0
- package/dist/components/ArticleList/Parts/TagList.vue2.js +4 -0
- package/dist/components/ArticleList/Parts/ThumbnailImage.vue.js +9 -0
- package/dist/components/ArticleList/Parts/ThumbnailImage.vue2.js +50 -0
- package/dist/components/ArticleList/Parts/ThumbnailImage.vue3.js +7 -0
- package/dist/components/BasicButton.vue.js +9 -0
- package/dist/components/BasicButton.vue2.js +71 -0
- package/dist/components/BasicButton.vue3.js +11 -0
- package/dist/components/CheckBox.vue.d.ts +8 -0
- package/dist/components/CheckBox.vue.js +9 -0
- package/dist/components/CheckBox.vue2.js +76 -0
- package/dist/components/CheckBox.vue3.js +11 -0
- package/dist/components/CheckBoxes.vue.js +9 -0
- package/dist/components/CheckBoxes.vue2.js +104 -0
- package/dist/components/CheckBoxes.vue3.js +7 -0
- package/dist/components/CheckButton.vue.js +9 -0
- package/dist/components/CheckButton.vue2.js +54 -0
- package/dist/components/CheckButton.vue3.js +11 -0
- package/dist/components/DatePicker.vue.js +9 -0
- package/dist/components/DatePicker.vue2.js +137 -0
- package/dist/components/DatePicker.vue3.js +15 -0
- package/dist/components/DateRangePicker.vue.js +9 -0
- package/dist/components/DateRangePicker.vue2.js +74 -0
- package/dist/components/DateRangePicker.vue3.js +9 -0
- package/dist/components/DateSelector.vue.d.ts +5 -0
- package/dist/components/DateSelector.vue.js +9 -0
- package/dist/components/DateSelector.vue2.js +174 -0
- package/dist/components/DateSelector.vue3.js +13 -0
- package/dist/components/DropdownUi.vue.d.ts +1 -0
- package/dist/components/DropdownUi.vue.js +9 -0
- package/dist/components/DropdownUi.vue2.js +65 -0
- package/dist/components/DropdownUi.vue3.js +15 -0
- package/dist/components/ErrorMessage.vue.js +9 -0
- package/dist/components/ErrorMessage.vue2.js +30 -0
- package/dist/components/ErrorMessage.vue3.js +7 -0
- package/dist/components/Icon/CalendarIcon.vue.js +15 -0
- package/dist/components/Icon/CheckIcon.vue.js +15 -0
- package/dist/components/Icon/CloseIcon.vue.js +15 -0
- package/dist/components/Icon/Folder.vue.js +15 -0
- package/dist/components/Icon/Image.vue.js +21 -0
- package/dist/components/Icon/KeyboardArrowDownIcon.vue.js +15 -0
- package/dist/components/Icon/Tag.vue.js +15 -0
- package/dist/components/InputBox.vue.js +9 -0
- package/dist/components/InputBox.vue2.js +62 -0
- package/dist/components/InputBox.vue3.js +7 -0
- package/dist/components/InputGroup.vue.js +17 -0
- package/dist/components/InputGroup.vue2.js +7 -0
- package/dist/components/LabeledCheckbox.vue.js +9 -0
- package/dist/components/LabeledCheckbox.vue2.js +60 -0
- package/dist/components/LabeledCheckbox.vue3.js +9 -0
- package/dist/components/LabeledFieldset.vue.js +9 -0
- package/dist/components/LabeledFieldset.vue2.js +29 -0
- package/dist/components/LabeledFieldset.vue3.js +11 -0
- package/dist/components/LoadingSpinner.vue.js +15 -0
- package/dist/components/ModalBox.vue.d.ts +22 -16
- package/dist/components/ModalBox.vue.js +9 -0
- package/dist/components/ModalBox.vue2.js +85 -0
- package/dist/components/ModalBox.vue3.js +23 -0
- package/dist/components/PopupBox.vue.js +9 -0
- package/dist/components/PopupBox.vue2.js +35 -0
- package/dist/components/PopupBox.vue3.js +15 -0
- package/dist/components/RadioButtons.vue.js +9 -0
- package/dist/components/RadioButtons.vue2.js +75 -0
- package/dist/components/RadioButtons.vue3.js +11 -0
- package/dist/components/SelectBox.vue.js +9 -0
- package/dist/components/SelectBox.vue2.js +109 -0
- package/dist/components/SelectBox.vue3.js +9 -0
- package/dist/components/SlideDownUi.vue.js +9 -0
- package/dist/components/SlideDownUi.vue2.js +66 -0
- package/dist/components/SlideDownUi.vue3.js +17 -0
- package/dist/components/TabUI.vue.d.ts +0 -18
- package/dist/components/TabUI.vue.js +9 -0
- package/dist/components/TabUI.vue2.js +77 -0
- package/dist/components/TabUI.vue3.js +9 -0
- package/dist/components/TextArea.vue.js +9 -0
- package/dist/components/TextArea.vue2.js +82 -0
- package/dist/components/TextArea.vue3.js +7 -0
- package/dist/components/TextBox.vue.js +9 -0
- package/dist/components/TextBox.vue2.js +76 -0
- package/dist/components/TextBox.vue3.js +7 -0
- package/dist/components/TextButton.vue.js +9 -0
- package/dist/components/TextButton.vue2.js +24 -0
- package/dist/components/TextButton.vue3.js +7 -0
- package/dist/components/ToggleButton.vue.d.ts +12 -9
- package/dist/components/ToggleButton.vue.js +9 -0
- package/dist/components/ToggleButton.vue2.js +94 -0
- package/dist/components/ToggleButton.vue3.js +13 -0
- package/dist/const/list-theme.js +65 -0
- package/dist/index.js +112 -3513
- package/dist/scripts/form-validation-manager.js +38 -0
- package/dist/scripts/unique-id.d.ts +4 -0
- package/dist/scripts/unique-id.js +9 -0
- package/dist/scripts/use-click-outside.js +13 -0
- package/dist/scripts/utils.js +21 -0
- package/dist/style.css +1 -1
- package/package.json +8 -5
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { defineComponent as x, computed as f, openBlock as v, createElementBlock as S, normalizeClass as h, normalizeStyle as V, withModifiers as z, withDirectives as L, createElementVNode as C, vModelCheckbox as g, renderSlot as p, createBlock as $, createCommentVNode as w } from "vue";
|
|
2
|
+
import G from "./Icon/CheckIcon.vue.js";
|
|
3
|
+
import { COLOR as t } from "@geckou/ui-core";
|
|
4
|
+
const A = ["aria-checked", "aria-labelledby", "aria-label"], E = ["name", "value", "disabled"], I = /* @__PURE__ */ x({
|
|
5
|
+
__name: "CheckBox",
|
|
6
|
+
props: {
|
|
7
|
+
name: {},
|
|
8
|
+
value: { default: void 0 },
|
|
9
|
+
modelValue: { type: Boolean },
|
|
10
|
+
isDisabled: { type: Boolean },
|
|
11
|
+
cssStyle: { default: void 0 },
|
|
12
|
+
isDisableAnimation: { type: Boolean },
|
|
13
|
+
ariaLabel: { default: void 0 },
|
|
14
|
+
ariaLabelledBy: { default: void 0 }
|
|
15
|
+
},
|
|
16
|
+
emits: ["update:modelValue"],
|
|
17
|
+
setup(e, { emit: B }) {
|
|
18
|
+
const D = B, l = e, i = f({
|
|
19
|
+
get: () => l.modelValue ?? !1,
|
|
20
|
+
set: (a) => D("update:modelValue", a)
|
|
21
|
+
}), d = f(() => {
|
|
22
|
+
var o, r;
|
|
23
|
+
const a = l.isDisabled ? (o = l.cssStyle) == null ? void 0 : o.disabled : (r = l.cssStyle) == null ? void 0 : r.default;
|
|
24
|
+
return {
|
|
25
|
+
textColor: l.isDisabled ? t.darkGray : t.blue,
|
|
26
|
+
backgroundColor: l.isDisabled ? t.lightGray : t.white,
|
|
27
|
+
border: {
|
|
28
|
+
color: l.isDisabled ? t.darkGray : t.blue,
|
|
29
|
+
size: "1px",
|
|
30
|
+
radius: ".25rem"
|
|
31
|
+
},
|
|
32
|
+
...a
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
return (a, o) => {
|
|
36
|
+
var r, s, n, u, c, b, m, y;
|
|
37
|
+
return v(), S("button", {
|
|
38
|
+
class: h(a.$style.check_box),
|
|
39
|
+
style: V({
|
|
40
|
+
"--text-color": (r = d.value) == null ? void 0 : r.textColor,
|
|
41
|
+
"--border-color": (n = (s = d.value) == null ? void 0 : s.border) == null ? void 0 : n.color,
|
|
42
|
+
"--border-size": (c = (u = d.value) == null ? void 0 : u.border) == null ? void 0 : c.size,
|
|
43
|
+
"--radius-size": (m = (b = d.value) == null ? void 0 : b.border) == null ? void 0 : m.radius,
|
|
44
|
+
"--background-color": (y = d.value) == null ? void 0 : y.backgroundColor,
|
|
45
|
+
"--duration": e.isDisableAnimation ? "0s" : ".3s"
|
|
46
|
+
}),
|
|
47
|
+
type: "button",
|
|
48
|
+
role: "checkbox",
|
|
49
|
+
"aria-checked": i.value,
|
|
50
|
+
"aria-labelledby": e.ariaLabelledBy,
|
|
51
|
+
"aria-label": e.ariaLabelledBy ? void 0 : e.ariaLabel ?? e.name,
|
|
52
|
+
onClick: o[1] || (o[1] = z((k) => e.isDisabled ? null : i.value = !i.value, ["stop"]))
|
|
53
|
+
}, [
|
|
54
|
+
L(C("input", {
|
|
55
|
+
"onUpdate:modelValue": o[0] || (o[0] = (k) => i.value = k),
|
|
56
|
+
type: "checkbox",
|
|
57
|
+
tabindex: "-1",
|
|
58
|
+
name: e.name,
|
|
59
|
+
value: e.value,
|
|
60
|
+
disabled: e.isDisabled
|
|
61
|
+
}, null, 8, E), [
|
|
62
|
+
[g, i.value]
|
|
63
|
+
]),
|
|
64
|
+
C("div", {
|
|
65
|
+
class: h(a.$style.check_container)
|
|
66
|
+
}, [
|
|
67
|
+
p(a.$slots, "check"),
|
|
68
|
+
a.$slots.check ? w("", !0) : (v(), $(G, { key: 0 }))
|
|
69
|
+
], 2)
|
|
70
|
+
], 14, A);
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
export {
|
|
75
|
+
I as default
|
|
76
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { defineComponent as V, ref as k, computed as E, watch as m, openBlock as i, createElementBlock as y, normalizeClass as q, Fragment as M, renderList as x, createBlock as B, createVNode as D } from "vue";
|
|
2
|
+
import { COLOR as v, MESSAGES as _ } from "@geckou/ui-core";
|
|
3
|
+
import A from "./LabeledCheckbox.vue.js";
|
|
4
|
+
import L from "./ErrorMessage.vue.js";
|
|
5
|
+
const F = /* @__PURE__ */ V({
|
|
6
|
+
__name: "CheckBoxes",
|
|
7
|
+
props: {
|
|
8
|
+
name: {},
|
|
9
|
+
options: {},
|
|
10
|
+
modelValue: { default: void 0 },
|
|
11
|
+
isDisabled: { type: Boolean },
|
|
12
|
+
isRequired: { type: Boolean },
|
|
13
|
+
cssStyle: { default: void 0 }
|
|
14
|
+
},
|
|
15
|
+
emits: ["update:modelValue"],
|
|
16
|
+
setup(p, { emit: g }) {
|
|
17
|
+
var b, f;
|
|
18
|
+
const S = g, a = p, s = k(
|
|
19
|
+
a.options.map((e) => {
|
|
20
|
+
var r;
|
|
21
|
+
return {
|
|
22
|
+
value: e.value,
|
|
23
|
+
label: e.label,
|
|
24
|
+
checked: ((r = a.modelValue) == null ? void 0 : r.includes(e.value)) || !1
|
|
25
|
+
};
|
|
26
|
+
})
|
|
27
|
+
), c = E(
|
|
28
|
+
() => s.value.filter((e) => e.checked).map((e) => e.value)
|
|
29
|
+
), n = k(""), C = () => n.value = a.isRequired && c.value.length === 0 ? _.required : "";
|
|
30
|
+
m(
|
|
31
|
+
c,
|
|
32
|
+
(e, r) => {
|
|
33
|
+
r && ((l, u) => l.length === u.length && l.every((o, d) => o === u[d]))(e, r) || (C(), S("update:modelValue", e));
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
deep: !0,
|
|
37
|
+
immediate: !!((b = a.modelValue) != null && b.length)
|
|
38
|
+
}
|
|
39
|
+
), m(
|
|
40
|
+
() => a.modelValue,
|
|
41
|
+
(e) => {
|
|
42
|
+
e && s.value.forEach(
|
|
43
|
+
(r) => r.checked = e.includes(r.value)
|
|
44
|
+
);
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
deep: !0,
|
|
48
|
+
immediate: !0
|
|
49
|
+
}
|
|
50
|
+
), m(
|
|
51
|
+
() => a.options,
|
|
52
|
+
(e) => {
|
|
53
|
+
if (e.length === s.value.length && e.every(
|
|
54
|
+
(l, u) => {
|
|
55
|
+
var o, d;
|
|
56
|
+
return l.value === ((o = s.value[u]) == null ? void 0 : o.value) && l.label === ((d = s.value[u]) == null ? void 0 : d.label);
|
|
57
|
+
}
|
|
58
|
+
))
|
|
59
|
+
return;
|
|
60
|
+
const t = new Set(c.value);
|
|
61
|
+
s.value = e.map((l) => ({
|
|
62
|
+
value: l.value,
|
|
63
|
+
label: l.label,
|
|
64
|
+
checked: a.modelValue ? a.modelValue.includes(l.value) : t.has(l.value)
|
|
65
|
+
}));
|
|
66
|
+
},
|
|
67
|
+
{ deep: !0 }
|
|
68
|
+
);
|
|
69
|
+
const h = {
|
|
70
|
+
...((f = a.cssStyle) == null ? void 0 : f.error) ?? {},
|
|
71
|
+
textColor: v.white,
|
|
72
|
+
backgroundColor: v.red,
|
|
73
|
+
border: {
|
|
74
|
+
color: v.red,
|
|
75
|
+
size: "1px",
|
|
76
|
+
radius: ".25rem"
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
return (e, r) => (i(), y("div", {
|
|
80
|
+
class: q(e.$style.check_boxes)
|
|
81
|
+
}, [
|
|
82
|
+
(i(!0), y(M, null, x(s.value, (t, l) => (i(), B(A, {
|
|
83
|
+
key: t.value,
|
|
84
|
+
modelValue: s.value[l].checked,
|
|
85
|
+
"onUpdate:modelValue": (u) => s.value[l].checked = u,
|
|
86
|
+
name: p.name,
|
|
87
|
+
value: t.value,
|
|
88
|
+
label: t.label,
|
|
89
|
+
isDisabled: a.isDisabled,
|
|
90
|
+
cssStyle: a.cssStyle
|
|
91
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "name", "value", "label", "isDisabled", "cssStyle"]))), 128)),
|
|
92
|
+
D(L, {
|
|
93
|
+
errorMessages: n.value ? [n.value] : [],
|
|
94
|
+
cssStyle: {
|
|
95
|
+
textColor: h.textColor,
|
|
96
|
+
backgroundColor: h.backgroundColor
|
|
97
|
+
}
|
|
98
|
+
}, null, 8, ["errorMessages", "cssStyle"])
|
|
99
|
+
], 2));
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
export {
|
|
103
|
+
F as default
|
|
104
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { defineComponent as C, ref as V, computed as B, watch as b, openBlock as k, createElementBlock as D, normalizeClass as f, normalizeStyle as S, withDirectives as z, createElementVNode as p, vModelCheckbox as $, renderSlot as g, createBlock as w, createCommentVNode as x } from "vue";
|
|
2
|
+
import A from "./Icon/CheckIcon.vue.js";
|
|
3
|
+
const E = ["name", "disabled"], M = /* @__PURE__ */ C({
|
|
4
|
+
__name: "CheckButton",
|
|
5
|
+
props: {
|
|
6
|
+
name: {},
|
|
7
|
+
modelValue: { type: Boolean },
|
|
8
|
+
isDisabled: { type: Boolean },
|
|
9
|
+
cssStyle: { default: () => ({ default: {} }) },
|
|
10
|
+
isDisableAnimation: { type: Boolean }
|
|
11
|
+
},
|
|
12
|
+
emits: ["update:modelValue"],
|
|
13
|
+
setup(o, { emit: y }) {
|
|
14
|
+
const h = y, l = o, t = V(l.modelValue ?? !1), a = B(() => l.isDisabled ? l.cssStyle.disabled : l.cssStyle.default);
|
|
15
|
+
return b(
|
|
16
|
+
() => t.value,
|
|
17
|
+
(e) => h("update:modelValue", e)
|
|
18
|
+
), b(
|
|
19
|
+
() => l.modelValue,
|
|
20
|
+
(e) => t.value = e,
|
|
21
|
+
{ immediate: !0 }
|
|
22
|
+
), (e, s) => {
|
|
23
|
+
var r, n, i, d, c, u, m;
|
|
24
|
+
return k(), D("label", {
|
|
25
|
+
class: f(e.$style.check_box),
|
|
26
|
+
style: S({
|
|
27
|
+
"--border-color": ((n = (r = a.value) == null ? void 0 : r.border) == null ? void 0 : n.color) || "blue",
|
|
28
|
+
"--border-size": ((d = (i = a.value) == null ? void 0 : i.border) == null ? void 0 : d.size) || "1px",
|
|
29
|
+
"--radius-size": ((u = (c = a.value) == null ? void 0 : c.border) == null ? void 0 : u.radius) || "0.25rem",
|
|
30
|
+
"--background-color": ((m = a.value) == null ? void 0 : m.backgroundColor) || "#fff",
|
|
31
|
+
"--duration": o.isDisableAnimation ? "0s" : ".3s"
|
|
32
|
+
})
|
|
33
|
+
}, [
|
|
34
|
+
z(p("input", {
|
|
35
|
+
"onUpdate:modelValue": s[0] || (s[0] = (v) => t.value = v),
|
|
36
|
+
type: "checkbox",
|
|
37
|
+
name: o.name,
|
|
38
|
+
disabled: o.isDisabled
|
|
39
|
+
}, null, 8, E), [
|
|
40
|
+
[$, t.value]
|
|
41
|
+
]),
|
|
42
|
+
p("div", {
|
|
43
|
+
class: f(e.$style.check_container)
|
|
44
|
+
}, [
|
|
45
|
+
g(e.$slots, "check"),
|
|
46
|
+
e.$slots.check ? x("", !0) : (k(), w(A, { key: 0 }))
|
|
47
|
+
], 2)
|
|
48
|
+
], 6);
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
export {
|
|
53
|
+
M as default
|
|
54
|
+
};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { defineComponent as E, ref as f, reactive as C, watch as V, onBeforeUnmount as R, openBlock as b, createBlock as U, normalizeClass as r, withCtx as N, createElementVNode as m, createVNode as p, withDirectives as u, vModelDynamic as O, vModelText as v, createTextVNode as z, createElementBlock as g, createCommentVNode as h } from "vue";
|
|
2
|
+
import { MESSAGES as I, validateDateObject as P, splitDate as S, composeDateValue as j, formatDateValue as T } from "@geckou/ui-core";
|
|
3
|
+
import w from "./InputBox.vue.js";
|
|
4
|
+
import A from "./Icon/CalendarIcon.vue.js";
|
|
5
|
+
import G from "./ErrorMessage.vue.js";
|
|
6
|
+
const F = ["type", "name", "max", "min", "required", "disabled"], H = ["aria-label", "disabled"], J = ["aria-label", "disabled"], K = { key: 0 }, L = ["aria-label", "disabled"], _ = /* @__PURE__ */ E({
|
|
7
|
+
__name: "DatePicker",
|
|
8
|
+
props: {
|
|
9
|
+
name: {},
|
|
10
|
+
modelValue: {},
|
|
11
|
+
isDisabled: { type: Boolean, default: !1 },
|
|
12
|
+
isRequired: { type: Boolean },
|
|
13
|
+
formValidationManager: { default: null },
|
|
14
|
+
minDate: { default: "" },
|
|
15
|
+
maxDate: { default: "" },
|
|
16
|
+
size: { default: "medium" },
|
|
17
|
+
type: { default: "date" }
|
|
18
|
+
},
|
|
19
|
+
emits: ["update:modelValue"],
|
|
20
|
+
setup(t, { emit: M }) {
|
|
21
|
+
const k = M, x = f(null), l = t, d = C({
|
|
22
|
+
year: "",
|
|
23
|
+
month: "",
|
|
24
|
+
day: ""
|
|
25
|
+
}), s = f(""), n = f(""), o = (e) => {
|
|
26
|
+
l.formValidationManager && l.formValidationManager.setValid(l.name, e);
|
|
27
|
+
}, y = (e) => !e && l.isRequired ? { isValid: !1, message: I.required } : { isValid: !0, message: "" }, $ = (e) => P(
|
|
28
|
+
{ year: e.year, month: e.month, day: e.day ?? "" },
|
|
29
|
+
{ type: l.type, isRequired: l.isRequired }
|
|
30
|
+
), c = (e) => {
|
|
31
|
+
const { year: a, month: i, day: B } = S(e);
|
|
32
|
+
d.year = a, d.month = i, d.day = l.type === "month" ? "" : B;
|
|
33
|
+
}, q = () => j({ ...d }, l.type);
|
|
34
|
+
V(
|
|
35
|
+
() => s.value,
|
|
36
|
+
(e) => {
|
|
37
|
+
c(e);
|
|
38
|
+
const { isValid: a, message: i } = y(e);
|
|
39
|
+
n.value = i, k("update:modelValue", e), o(a);
|
|
40
|
+
}
|
|
41
|
+
), V(
|
|
42
|
+
() => d,
|
|
43
|
+
(e) => {
|
|
44
|
+
const { isValid: a, message: i } = $(e);
|
|
45
|
+
n.value = i, o(a), a && (s.value = q());
|
|
46
|
+
},
|
|
47
|
+
{ deep: !0 }
|
|
48
|
+
);
|
|
49
|
+
const D = (e) => {
|
|
50
|
+
if (!e) {
|
|
51
|
+
s.value = "", c(""), n.value = "", o(y("").isValid);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const a = T(e, l.type);
|
|
55
|
+
!a || a === s.value || (s.value = a, c(a));
|
|
56
|
+
};
|
|
57
|
+
return V(
|
|
58
|
+
() => l.modelValue,
|
|
59
|
+
(e) => D(e)
|
|
60
|
+
), D(l.modelValue), o(y(s.value).isValid), R(() => {
|
|
61
|
+
var e;
|
|
62
|
+
return (e = l.formValidationManager) == null ? void 0 : e.remove(l.name);
|
|
63
|
+
}), (e, a) => (b(), U(w, {
|
|
64
|
+
isDisabled: t.isDisabled,
|
|
65
|
+
class: r([
|
|
66
|
+
e.$style.date_picker,
|
|
67
|
+
e.$style[t.size],
|
|
68
|
+
{ [e.$style.is_disabled]: t.isDisabled }
|
|
69
|
+
]),
|
|
70
|
+
isErrored: !!n.value
|
|
71
|
+
}, {
|
|
72
|
+
default: N(() => [
|
|
73
|
+
m("div", {
|
|
74
|
+
class: r(e.$style.date_input)
|
|
75
|
+
}, [
|
|
76
|
+
p(A, {
|
|
77
|
+
class: r(e.$style.icon)
|
|
78
|
+
}, null, 8, ["class"]),
|
|
79
|
+
u(m("input", {
|
|
80
|
+
ref_key: "datePicker",
|
|
81
|
+
ref: x,
|
|
82
|
+
"onUpdate:modelValue": a[0] || (a[0] = (i) => s.value = i),
|
|
83
|
+
type: t.type,
|
|
84
|
+
name: t.name,
|
|
85
|
+
max: t.maxDate,
|
|
86
|
+
min: t.minDate,
|
|
87
|
+
required: t.isRequired,
|
|
88
|
+
disabled: t.isDisabled
|
|
89
|
+
}, null, 8, F), [
|
|
90
|
+
[O, s.value]
|
|
91
|
+
])
|
|
92
|
+
], 2),
|
|
93
|
+
u(m("input", {
|
|
94
|
+
"onUpdate:modelValue": a[1] || (a[1] = (i) => d.year = i),
|
|
95
|
+
placeholder: "年",
|
|
96
|
+
"aria-label": `${t.name}の年`,
|
|
97
|
+
maxlength: "4",
|
|
98
|
+
type: "text",
|
|
99
|
+
disabled: t.isDisabled,
|
|
100
|
+
class: r(e.$style.year)
|
|
101
|
+
}, null, 10, H), [
|
|
102
|
+
[v, d.year]
|
|
103
|
+
]),
|
|
104
|
+
a[4] || (a[4] = z("/ ", -1)),
|
|
105
|
+
u(m("input", {
|
|
106
|
+
"onUpdate:modelValue": a[2] || (a[2] = (i) => d.month = i),
|
|
107
|
+
placeholder: "月",
|
|
108
|
+
"aria-label": `${t.name}の月`,
|
|
109
|
+
maxlength: "2",
|
|
110
|
+
type: "text",
|
|
111
|
+
disabled: t.isDisabled
|
|
112
|
+
}, null, 8, J), [
|
|
113
|
+
[v, d.month]
|
|
114
|
+
]),
|
|
115
|
+
t.type === "date" ? (b(), g("span", K, "/")) : h("", !0),
|
|
116
|
+
t.type === "date" ? u((b(), g("input", {
|
|
117
|
+
key: 1,
|
|
118
|
+
"onUpdate:modelValue": a[3] || (a[3] = (i) => d.day = i),
|
|
119
|
+
placeholder: "日",
|
|
120
|
+
"aria-label": `${t.name}の日`,
|
|
121
|
+
maxlength: "2",
|
|
122
|
+
type: "text",
|
|
123
|
+
disabled: t.isDisabled
|
|
124
|
+
}, null, 8, L)), [
|
|
125
|
+
[v, d.day]
|
|
126
|
+
]) : h("", !0),
|
|
127
|
+
p(G, {
|
|
128
|
+
errorMessages: n.value ? [n.value] : []
|
|
129
|
+
}, null, 8, ["errorMessages"])
|
|
130
|
+
]),
|
|
131
|
+
_: 1
|
|
132
|
+
}, 8, ["isDisabled", "class", "isErrored"]));
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
export {
|
|
136
|
+
_ as default
|
|
137
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const _ = "_icon_13vkb_1", t = "_date_input_13vkb_14", e = "_date_picker_13vkb_34", a = "_year_13vkb_45", c = "_small_13vkb_51", n = {
|
|
2
|
+
icon: _,
|
|
3
|
+
date_input: t,
|
|
4
|
+
date_picker: e,
|
|
5
|
+
year: a,
|
|
6
|
+
small: c
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
t as date_input,
|
|
10
|
+
e as date_picker,
|
|
11
|
+
n as default,
|
|
12
|
+
_ as icon,
|
|
13
|
+
c as small,
|
|
14
|
+
a as year
|
|
15
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { defineComponent as R, computed as i, watch as z, onBeforeUnmount as E, openBlock as b, createElementBlock as q, normalizeClass as c, createVNode as r, createElementVNode as x, unref as k } from "vue";
|
|
2
|
+
import { MESSAGES as B } from "@geckou/ui-core";
|
|
3
|
+
import g from "./DatePicker.vue.js";
|
|
4
|
+
import S from "./ErrorMessage.vue.js";
|
|
5
|
+
const A = /* @__PURE__ */ R({
|
|
6
|
+
__name: "DateRangePicker",
|
|
7
|
+
props: {
|
|
8
|
+
name: {},
|
|
9
|
+
modelValue: { default: () => ({ start: "", end: "" }) },
|
|
10
|
+
isDisabled: { type: Boolean, default: !1 },
|
|
11
|
+
isRequired: { type: Boolean, default: !1 },
|
|
12
|
+
formValidationManager: { default: null },
|
|
13
|
+
minDate: { default: "" },
|
|
14
|
+
maxDate: { default: "" },
|
|
15
|
+
size: { default: "medium" },
|
|
16
|
+
type: { default: "date" }
|
|
17
|
+
},
|
|
18
|
+
emits: ["update:modelValue"],
|
|
19
|
+
setup(e, { emit: M }) {
|
|
20
|
+
const u = M, t = e, l = i(() => t.modelValue.start), n = i(() => t.modelValue.end), s = i(
|
|
21
|
+
() => !(l.value && n.value && l.value > n.value)
|
|
22
|
+
), f = i(() => `${t.name}Range`);
|
|
23
|
+
z(
|
|
24
|
+
[s, f],
|
|
25
|
+
([a, d], m) => {
|
|
26
|
+
var V, D;
|
|
27
|
+
const o = m == null ? void 0 : m[1];
|
|
28
|
+
o && o !== d && ((V = t.formValidationManager) == null || V.remove(o)), (D = t.formValidationManager) == null || D.setValid(d, a);
|
|
29
|
+
},
|
|
30
|
+
{ immediate: !0 }
|
|
31
|
+
), E(() => {
|
|
32
|
+
var a;
|
|
33
|
+
return (a = t.formValidationManager) == null ? void 0 : a.remove(f.value);
|
|
34
|
+
});
|
|
35
|
+
const v = (a) => u("update:modelValue", { start: a ?? "", end: n.value }), y = (a) => u("update:modelValue", { start: l.value, end: a ?? "" });
|
|
36
|
+
return (a, d) => (b(), q("div", {
|
|
37
|
+
class: c(a.$style.date_range_picker)
|
|
38
|
+
}, [
|
|
39
|
+
r(g, {
|
|
40
|
+
name: `${e.name}Start`,
|
|
41
|
+
modelValue: l.value,
|
|
42
|
+
isDisabled: e.isDisabled,
|
|
43
|
+
isRequired: e.isRequired,
|
|
44
|
+
formValidationManager: e.formValidationManager,
|
|
45
|
+
minDate: e.minDate,
|
|
46
|
+
maxDate: n.value || e.maxDate,
|
|
47
|
+
size: e.size,
|
|
48
|
+
type: e.type,
|
|
49
|
+
"onUpdate:modelValue": v
|
|
50
|
+
}, null, 8, ["name", "modelValue", "isDisabled", "isRequired", "formValidationManager", "minDate", "maxDate", "size", "type"]),
|
|
51
|
+
x("div", {
|
|
52
|
+
class: c(a.$style.range)
|
|
53
|
+
}, "〜", 2),
|
|
54
|
+
r(g, {
|
|
55
|
+
name: `${e.name}End`,
|
|
56
|
+
modelValue: n.value,
|
|
57
|
+
isDisabled: e.isDisabled,
|
|
58
|
+
isRequired: e.isRequired,
|
|
59
|
+
formValidationManager: e.formValidationManager,
|
|
60
|
+
minDate: l.value || e.minDate,
|
|
61
|
+
maxDate: e.maxDate,
|
|
62
|
+
size: e.size,
|
|
63
|
+
type: e.type,
|
|
64
|
+
"onUpdate:modelValue": y
|
|
65
|
+
}, null, 8, ["name", "modelValue", "isDisabled", "isRequired", "formValidationManager", "minDate", "maxDate", "size", "type"]),
|
|
66
|
+
r(S, {
|
|
67
|
+
errorMessages: s.value ? void 0 : [k(B).startAfterEnd]
|
|
68
|
+
}, null, 8, ["errorMessages"])
|
|
69
|
+
], 2));
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
export {
|
|
73
|
+
A as default
|
|
74
|
+
};
|
|
@@ -5,6 +5,9 @@ type __VLS_Props = {
|
|
|
5
5
|
isRequired?: boolean;
|
|
6
6
|
formValidationManager?: FormValidationManager | null;
|
|
7
7
|
type?: 'date' | 'month';
|
|
8
|
+
/** 選べる年の下限・上限。既定は「今年 -100 〜 今年 -14」(生年月日向け) */
|
|
9
|
+
minYear?: number;
|
|
10
|
+
maxYear?: number;
|
|
8
11
|
};
|
|
9
12
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
10
13
|
"update:modelValue": (newValue: string) => any;
|
|
@@ -13,5 +16,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
13
16
|
}>, {
|
|
14
17
|
type: "date" | "month";
|
|
15
18
|
formValidationManager: FormValidationManager | null;
|
|
19
|
+
minYear: number;
|
|
20
|
+
maxYear: number;
|
|
16
21
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
17
22
|
export default _default;
|