@web-utils/form-ui 1.0.0-beta13 → 1.0.0-beta15
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/chunks/{DeOt3q3a.mjs → BDhGvPmU.mjs} +1 -1
- package/chunks/{CaHyPp0T.mjs → BXOvvlL2.mjs} +1 -1
- package/chunks/{ALt4yf68.mjs → C6tYoDfK.mjs} +1 -1
- package/chunks/{BG_Z3LzE.mjs → CAYDWMXC.mjs} +1 -1
- package/chunks/{oRDjUjCZ.mjs → CXHvVx2H.mjs} +1 -1
- package/chunks/{BJCpNo2b.mjs → CykRgGj0.mjs} +5 -9
- package/chunks/{BGad3Wff.mjs → D4SiGR5u.mjs} +2 -2
- package/chunks/{DZdQxw_s.mjs → DAEpRn3D.mjs} +2 -2
- package/chunks/{Bc4d8vFN.mjs → DL4ovOwO.mjs} +1 -1
- package/chunks/{BouiHKbN.mjs → DXrQ5tWJ.mjs} +1 -1
- package/chunks/{CmtaSp-T.mjs → Xww4oyW1.mjs} +1 -1
- package/chunks/{BYqiGFdT.mjs → ciEWoJ1U.mjs} +1 -1
- package/chunks/dwnrVqcq.mjs +315 -0
- package/chunks/{CQowXkhx.mjs → jpMiw_3M.mjs} +1 -1
- package/chunks/{Dr0gqiWt.mjs → vlkluoXb.mjs} +1 -1
- package/chunks/{B9ZV4Ei4.mjs → wo0ekOcp.mjs} +2 -2
- package/form-check-box-group/index.mjs +1 -1
- package/form-checkbox/index.mjs +1 -1
- package/form-date-picker/index.mjs +1 -1
- package/form-holder/index.mjs +1 -1
- package/form-image/index.mjs +1 -1
- package/form-input/index.mjs +1 -1
- package/form-input-email/index.mjs +1 -1
- package/form-input-id-card/index.mjs +1 -1
- package/form-input-number/index.mjs +1 -1
- package/form-input-phone-number/index.mjs +1 -1
- package/form-item-x/index.mjs +1 -1
- package/form-radio-group/index.mjs +1 -1
- package/form-rate/index.mjs +1 -1
- package/form-row/index.mjs +1 -1
- package/form-select/index.mjs +1 -1
- package/form-slider/index.mjs +1 -1
- package/form-switch/index.mjs +1 -1
- package/form-text/index.mjs +1 -1
- package/index.d.ts +3 -2
- package/index.mjs +36 -34
- package/month-calendar/index.d.ts +80 -0
- package/month-calendar/index.mjs +2 -0
- package/month-calendar/style.css +1 -0
- package/package.json +2 -1
- package/web-types.json +1 -1
- package/year-calendar/index.d.ts +99 -0
- package/year-calendar/index.mjs +173 -0
- package/year-calendar/style.css +1 -0
- package/chunks/BM34G781.mjs +0 -26848
- package/json-editor/index.d.ts +0 -32
- package/json-editor/index.mjs +0 -2
- package/json-editor/style.css +0 -1
- /package/chunks/{6Ukll2os.mjs → B5BIQCcK.mjs} +0 -0
- /package/chunks/{Bpox2cVQ.mjs → CI_28Uw4.mjs} +0 -0
- /package/chunks/{Cqm2ahW2.mjs → DK2YoEOD.mjs} +0 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
|
+
showYearSelector: {
|
|
3
|
+
type: BooleanConstructor;
|
|
4
|
+
default: () => true;
|
|
5
|
+
};
|
|
6
|
+
activeDates: {
|
|
7
|
+
type: ArrayConstructor;
|
|
8
|
+
default: () => never[];
|
|
9
|
+
validator: (dateArray: unknown) => true;
|
|
10
|
+
};
|
|
11
|
+
modelValue: {
|
|
12
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
13
|
+
default: number;
|
|
14
|
+
};
|
|
15
|
+
lang: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
activeClass: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
default: () => "";
|
|
22
|
+
};
|
|
23
|
+
prefixClass: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
default: () => "calendar--active";
|
|
26
|
+
};
|
|
27
|
+
hideWeekend: {
|
|
28
|
+
type: BooleanConstructor;
|
|
29
|
+
default: boolean;
|
|
30
|
+
};
|
|
31
|
+
hideSunday: {
|
|
32
|
+
type: BooleanConstructor;
|
|
33
|
+
default: boolean;
|
|
34
|
+
};
|
|
35
|
+
}>, {}, {
|
|
36
|
+
isUsingString: boolean;
|
|
37
|
+
}, {
|
|
38
|
+
month(): {};
|
|
39
|
+
activeYear: {
|
|
40
|
+
get(): number;
|
|
41
|
+
set(val: any): void;
|
|
42
|
+
};
|
|
43
|
+
}, {
|
|
44
|
+
changeYear(idx: any): void;
|
|
45
|
+
toggleDate(dateObj: any): void;
|
|
46
|
+
modifiedActiveDates(dateIndex: any, activeDate: any): unknown[];
|
|
47
|
+
monthClick(monthYearInfo: any): void;
|
|
48
|
+
}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("update:modelValue" | "toggleDate" | "monthClick" | "update:activeDates")[], "update:modelValue" | "toggleDate" | "monthClick" | "update:activeDates", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
49
|
+
showYearSelector: {
|
|
50
|
+
type: BooleanConstructor;
|
|
51
|
+
default: () => true;
|
|
52
|
+
};
|
|
53
|
+
activeDates: {
|
|
54
|
+
type: ArrayConstructor;
|
|
55
|
+
default: () => never[];
|
|
56
|
+
validator: (dateArray: unknown) => true;
|
|
57
|
+
};
|
|
58
|
+
modelValue: {
|
|
59
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
60
|
+
default: number;
|
|
61
|
+
};
|
|
62
|
+
lang: {
|
|
63
|
+
type: StringConstructor;
|
|
64
|
+
default: string;
|
|
65
|
+
};
|
|
66
|
+
activeClass: {
|
|
67
|
+
type: StringConstructor;
|
|
68
|
+
default: () => "";
|
|
69
|
+
};
|
|
70
|
+
prefixClass: {
|
|
71
|
+
type: StringConstructor;
|
|
72
|
+
default: () => "calendar--active";
|
|
73
|
+
};
|
|
74
|
+
hideWeekend: {
|
|
75
|
+
type: BooleanConstructor;
|
|
76
|
+
default: boolean;
|
|
77
|
+
};
|
|
78
|
+
hideSunday: {
|
|
79
|
+
type: BooleanConstructor;
|
|
80
|
+
default: boolean;
|
|
81
|
+
};
|
|
82
|
+
}>> & Readonly<{
|
|
83
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
84
|
+
onToggleDate?: ((...args: any[]) => any) | undefined;
|
|
85
|
+
onMonthClick?: ((...args: any[]) => any) | undefined;
|
|
86
|
+
"onUpdate:activeDates"?: ((...args: any[]) => any) | undefined;
|
|
87
|
+
}>, {
|
|
88
|
+
modelValue: string | number;
|
|
89
|
+
activeDates: unknown[];
|
|
90
|
+
lang: string;
|
|
91
|
+
activeClass: string;
|
|
92
|
+
prefixClass: string;
|
|
93
|
+
showYearSelector: boolean;
|
|
94
|
+
hideWeekend: boolean;
|
|
95
|
+
hideSunday: boolean;
|
|
96
|
+
}, {}, {
|
|
97
|
+
MonthCalendar: any;
|
|
98
|
+
}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
99
|
+
export default _default;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { n as e, t } from "../chunks/dwnrVqcq.mjs";
|
|
2
|
+
import { Fragment as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createStaticVNode as o, createVNode as s, normalizeClass as c, openBlock as l, renderList as u, toDisplayString as d } from "vue";
|
|
3
|
+
import f from "dayjs";
|
|
4
|
+
//#region src/components/material-year-calendar/YearCalendar.vue
|
|
5
|
+
var p = {
|
|
6
|
+
name: "YearCalendar",
|
|
7
|
+
components: { MonthCalendar: t },
|
|
8
|
+
props: {
|
|
9
|
+
showYearSelector: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
default: () => !0
|
|
12
|
+
},
|
|
13
|
+
activeDates: {
|
|
14
|
+
type: Array,
|
|
15
|
+
default: () => [],
|
|
16
|
+
validator: (e) => {
|
|
17
|
+
let t = !0, n = null;
|
|
18
|
+
return e.forEach((e) => {
|
|
19
|
+
typeof e == "string" ? n = e : typeof e == "object" && Object.prototype.hasOwnProperty.call(e, "date") && (n = e.date), /^\d{4}\-\d{1,2}\-\d{1,2}$/.test(n) || (t = !1);
|
|
20
|
+
let r = n.split("-"), i = parseInt(r[2], 10), a = parseInt(r[1], 10), o = parseInt(r[0], 10);
|
|
21
|
+
(o < 1e3 || o > 3e3 || a === 0 || a > 12) && (t = !1);
|
|
22
|
+
let s = [
|
|
23
|
+
31,
|
|
24
|
+
28,
|
|
25
|
+
31,
|
|
26
|
+
30,
|
|
27
|
+
31,
|
|
28
|
+
30,
|
|
29
|
+
31,
|
|
30
|
+
31,
|
|
31
|
+
30,
|
|
32
|
+
31,
|
|
33
|
+
30,
|
|
34
|
+
31
|
|
35
|
+
];
|
|
36
|
+
(o % 400 == 0 || o % 100 != 0 && o % 4 == 0) && (s[1] = 29), i > 0 && i <= s[a - 1] || (t = !1);
|
|
37
|
+
}), t;
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
modelValue: {
|
|
41
|
+
type: [String, Number],
|
|
42
|
+
default: f().year()
|
|
43
|
+
},
|
|
44
|
+
lang: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: "en"
|
|
47
|
+
},
|
|
48
|
+
activeClass: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: () => ""
|
|
51
|
+
},
|
|
52
|
+
prefixClass: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: () => "calendar--active"
|
|
55
|
+
},
|
|
56
|
+
hideWeekend: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: !1
|
|
59
|
+
},
|
|
60
|
+
hideSunday: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: !1
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
emits: [
|
|
66
|
+
"toggleDate",
|
|
67
|
+
"monthClick",
|
|
68
|
+
"update:activeDates",
|
|
69
|
+
"update:modelValue"
|
|
70
|
+
],
|
|
71
|
+
data() {
|
|
72
|
+
return { isUsingString: !0 };
|
|
73
|
+
},
|
|
74
|
+
computed: {
|
|
75
|
+
month() {
|
|
76
|
+
let e = {};
|
|
77
|
+
return this.activeDates.forEach((t) => {
|
|
78
|
+
let n;
|
|
79
|
+
if (n = typeof t == "string" ? {
|
|
80
|
+
date: t,
|
|
81
|
+
className: this.activeClass
|
|
82
|
+
} : {
|
|
83
|
+
date: t.date,
|
|
84
|
+
className: t.className || ""
|
|
85
|
+
}, f(n.date).year() !== parseInt(this.modelValue)) return;
|
|
86
|
+
let r = (f(n.date).month() + 1).toString();
|
|
87
|
+
e[r] || (e[r] = []), e[r].push(n);
|
|
88
|
+
}), e;
|
|
89
|
+
},
|
|
90
|
+
activeYear: {
|
|
91
|
+
get() {
|
|
92
|
+
return parseInt(this.modelValue);
|
|
93
|
+
},
|
|
94
|
+
set(e) {
|
|
95
|
+
this.$emit("update:modelValue", e);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
created() {
|
|
100
|
+
this.isUsingString = this.activeDates.length && typeof this.activeDates[0] == "string";
|
|
101
|
+
},
|
|
102
|
+
methods: {
|
|
103
|
+
changeYear(e) {
|
|
104
|
+
this.activeYear = e + this.activeYear - 3;
|
|
105
|
+
},
|
|
106
|
+
toggleDate(e) {
|
|
107
|
+
let t = f().set("year", this.modelValue).set("month", e.month - 1).set("date", e.date).format("YYYY-MM-DD");
|
|
108
|
+
this.$emit("toggleDate", {
|
|
109
|
+
date: t,
|
|
110
|
+
selected: e.selected,
|
|
111
|
+
className: e.className
|
|
112
|
+
});
|
|
113
|
+
let n, r;
|
|
114
|
+
if (this.isUsingString) n = this.activeDates.indexOf(t), r = this.modifiedActiveDates(n, t);
|
|
115
|
+
else {
|
|
116
|
+
let i = {
|
|
117
|
+
date: t,
|
|
118
|
+
className: e.className
|
|
119
|
+
};
|
|
120
|
+
n = this.activeDates.indexOf(this.activeDates.find((e) => e.date === t)), r = this.modifiedActiveDates(n, i);
|
|
121
|
+
}
|
|
122
|
+
this.$emit("update:activeDates", r);
|
|
123
|
+
},
|
|
124
|
+
modifiedActiveDates(e, t) {
|
|
125
|
+
let n = [...this.activeDates];
|
|
126
|
+
return e === -1 ? n.push(t) : n.splice(e, 1), n;
|
|
127
|
+
},
|
|
128
|
+
monthClick(e) {
|
|
129
|
+
this.$emit("monthClick", e);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}, m = { class: "vue-calendar__container" }, h = {
|
|
133
|
+
key: 0,
|
|
134
|
+
class: "container__year"
|
|
135
|
+
}, g = ["onClick"];
|
|
136
|
+
function _(e, f, p, _, v, y) {
|
|
137
|
+
let b = t;
|
|
138
|
+
return l(), i("div", m, [p.showYearSelector ? (l(), i("div", h, [
|
|
139
|
+
r(" <span><button @click=\"addYear(-1)\">back</button></span> "),
|
|
140
|
+
(l(), i(n, null, u(5, (e) => a("span", {
|
|
141
|
+
key: e,
|
|
142
|
+
class: "year__chooser",
|
|
143
|
+
onClick: (t) => y.changeYear(e)
|
|
144
|
+
}, d(e + y.activeYear - 3), 9, g)), 64)),
|
|
145
|
+
r(" <span><button @click=\"addYear(1)\">next</button></span> ")
|
|
146
|
+
])) : r("v-if", !0), a("div", { class: c(["container__months", {
|
|
147
|
+
"hide-weekend": p.hideWeekend,
|
|
148
|
+
"hide-sunday": p.hideSunday
|
|
149
|
+
}]) }, [(l(), i(n, null, u(12, (e) => s(b, {
|
|
150
|
+
key: `month-${e}`,
|
|
151
|
+
class: "container__month",
|
|
152
|
+
year: y.activeYear,
|
|
153
|
+
month: e,
|
|
154
|
+
"active-dates": y.month[e],
|
|
155
|
+
"active-class": p.activeClass,
|
|
156
|
+
lang: p.lang,
|
|
157
|
+
"prefix-class": p.prefixClass,
|
|
158
|
+
onToggleDate: y.toggleDate,
|
|
159
|
+
onMonthClickEvent: y.monthClick
|
|
160
|
+
}, null, 8, [
|
|
161
|
+
"year",
|
|
162
|
+
"month",
|
|
163
|
+
"active-dates",
|
|
164
|
+
"active-class",
|
|
165
|
+
"lang",
|
|
166
|
+
"prefix-class",
|
|
167
|
+
"onToggleDate",
|
|
168
|
+
"onMonthClickEvent"
|
|
169
|
+
])), 64)), f[0] || (f[0] = o("<div class=\"container__month p-0\" data-v-dc54a16d></div><div class=\"container__month p-0\" data-v-dc54a16d></div><div class=\"container__month p-0\" data-v-dc54a16d></div><div class=\"container__month p-0\" data-v-dc54a16d></div><div class=\"container__month p-0\" data-v-dc54a16d></div>", 5))], 2)]);
|
|
170
|
+
}
|
|
171
|
+
var v = /* @__PURE__ */ e(p, [["render", _], ["__scopeId", "data-v-dc54a16d"]]);
|
|
172
|
+
//#endregion
|
|
173
|
+
export { v as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.container__months.hide-sunday .calendar__day:nth-of-type(7n){display:none}.container__months.hide-sunday .calendar__day{flex:16.66%}.container__months.hide-weekend .calendar__day:nth-of-type(7n),.container__months.hide-weekend .calendar__day:nth-of-type(7n-1){display:none}.container__months.hide-weekend .calendar__day{flex:19%}.vue-calendar__container[data-v-dc54a16d]{background-color:#f6f6f3;border-radius:2px;min-width:0;text-decoration:none;position:relative;box-shadow:0 2px 1px -1px #0003,0 1px 1px #00000024,0 1px 3px #0000001f}.vue-calendar__container .container__year[data-v-dc54a16d]{-webkit-user-select:none;user-select:none;text-align:center;background-color:#fff;flex:100%;height:65px;font-size:24px;display:flex}.vue-calendar__container .container__year .year__chooser[data-v-dc54a16d]{cursor:pointer;color:#000000e6;flex:1;justify-content:center;align-items:center;height:100%;display:flex}.vue-calendar__container .container__year .year__chooser[data-v-dc54a16d]:hover{background-color:#6666661a}.vue-calendar__container .container__year .year__chooser[data-v-dc54a16d]:nth-child(4n-3){color:#0000004d}.vue-calendar__container .container__year .year__chooser[data-v-dc54a16d]:nth-child(2n){color:#0009}.vue-calendar__container .container__year .year__chooser[data-v-dc54a16d]:nth-child(3){box-shadow:inset 0 -3px #4792bd}.vue-calendar__container .container__months[data-v-dc54a16d]{flex-wrap:wrap;padding:15px;display:flex}.vue-calendar__container .container__month[data-v-dc54a16d]{flex:16.66%;padding:8px}@media (max-width:1300px){.vue-calendar__container .container__month[data-v-dc54a16d]{flex:25%}}@media (max-width:992px){.vue-calendar__container .container__month[data-v-dc54a16d]{flex:33.3%}}@media (max-width:768px){.vue-calendar__container .container__month[data-v-dc54a16d]{flex:50%}}@media (max-width:450px){.vue-calendar__container .container__month[data-v-dc54a16d]{flex:100%}}.vue-calendar__container .p-0[data-v-dc54a16d]{padding:0}
|