@web-utils/form-ui 1.0.0-beta3 → 1.0.0-beta30

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.
Files changed (176) hide show
  1. package/api/index.d.ts +60 -0
  2. package/api/index.mjs +42 -0
  3. package/awesome-button/index.d.ts +60 -0
  4. package/awesome-button/index.mjs +49 -0
  5. package/base.css +1 -1
  6. package/chunks/4ZuVpQf6.mjs +478 -0
  7. package/chunks/B99alfW4.mjs +207 -0
  8. package/chunks/BQ77eAb3.mjs +71 -0
  9. package/chunks/BV_N8p9t.mjs +83 -0
  10. package/chunks/BV_P9a8o.mjs +100 -0
  11. package/chunks/BgDYHgyH.mjs +189 -0
  12. package/chunks/Bm5eiSmT.mjs +79 -0
  13. package/chunks/BmZieBZW.mjs +88 -0
  14. package/chunks/Br4i8stg.mjs +222 -0
  15. package/chunks/C3a15Ful.mjs +95 -0
  16. package/chunks/C4bM8miy.mjs +174 -0
  17. package/chunks/C9J3j0PX.mjs +93 -0
  18. package/chunks/CKErj8Ax.mjs +637 -0
  19. package/chunks/Cby3mvvZ.mjs +216 -0
  20. package/chunks/Cc3EJjbV.mjs +25 -0
  21. package/chunks/Cgl-hCE5.mjs +25 -0
  22. package/chunks/Ci1XxmdE.mjs +51 -0
  23. package/chunks/CkFapoKt.mjs +8 -0
  24. package/chunks/CsfgUCe9.mjs +17 -0
  25. package/chunks/CugRu2Ka.mjs +42 -0
  26. package/chunks/Cy-4nmyC.mjs +106 -0
  27. package/chunks/D1EOkWJ7.mjs +25 -0
  28. package/chunks/D1G2MMMx.mjs +1360 -0
  29. package/chunks/DO8dVGef.mjs +98 -0
  30. package/chunks/DazglPJZ.mjs +180 -0
  31. package/chunks/Dt6gY213.mjs +62 -0
  32. package/chunks/DtAYXPvz.mjs +108 -0
  33. package/chunks/JhyiXnbd.mjs +76 -0
  34. package/chunks/S64sNmuR.mjs +226 -0
  35. package/chunks/bnRb5PUB.mjs +108 -0
  36. package/chunks/dM-icPM8.mjs +107 -0
  37. package/chunks/pxFLMMUm.mjs +110 -0
  38. package/chunks/q1SlJP1y.mjs +171 -0
  39. package/confirm-button/index.d.ts +113 -0
  40. package/confirm-button/index.mjs +35 -0
  41. package/confirmable/index.d.ts +84 -0
  42. package/confirmable/index.mjs +8 -0
  43. package/constants/index.d.ts +42 -0
  44. package/constants/index.mjs +4 -0
  45. package/dict-render/index.d.ts +28 -0
  46. package/element-dialog/index.d.ts +374 -0
  47. package/element-dialog/index.mjs +2 -91
  48. package/empty-view/index.d.ts +29 -0
  49. package/empty-view/index.mjs +1 -1
  50. package/flex-scroll-area/index.d.ts +22 -0
  51. package/flex-scroll-area/index.mjs +1 -1
  52. package/form-advice/index.d.ts +9 -0
  53. package/form-advice/index.mjs +13 -12
  54. package/form-button/index.d.ts +114 -0
  55. package/form-button/index.mjs +36 -0
  56. package/form-cascader/index.d.ts +486 -0
  57. package/form-cascader/index.mjs +2 -0
  58. package/form-cell/index.d.ts +25 -0
  59. package/form-check-box-group/index.d.ts +295 -0
  60. package/form-check-box-group/index.mjs +1 -1
  61. package/form-checkbox/index.d.ts +273 -0
  62. package/form-checkbox/index.mjs +1 -1
  63. package/form-date-picker/index.d.ts +423 -0
  64. package/form-date-picker/index.mjs +1 -1
  65. package/form-holder/index.d.ts +166 -0
  66. package/form-holder/index.mjs +1 -1
  67. package/form-holder/style.css +1 -1
  68. package/form-image/index.d.ts +226 -0
  69. package/form-image/index.mjs +1 -1
  70. package/form-input/index.d.ts +389 -0
  71. package/form-input/index.mjs +1 -1
  72. package/form-input/style.css +1 -0
  73. package/form-input-cron-expression/index.d.ts +217 -0
  74. package/form-input-cron-expression/index.mjs +2 -0
  75. package/form-input-cron-expression/style.css +1 -0
  76. package/form-input-email/index.d.ts +363 -0
  77. package/form-input-email/index.mjs +1 -1
  78. package/form-input-id-card/index.d.ts +363 -0
  79. package/form-input-id-card/index.mjs +1 -1
  80. package/form-input-number/index.d.ts +327 -0
  81. package/form-input-number/index.mjs +1 -1
  82. package/form-input-phone-number/index.d.ts +363 -0
  83. package/form-input-phone-number/index.mjs +1 -1
  84. package/form-input-tag/index.d.ts +2 -0
  85. package/form-input-time/index.d.ts +2 -0
  86. package/form-item-config-provider/index.d.ts +22 -0
  87. package/form-item-config-provider/index.mjs +24 -0
  88. package/form-item-group/index.d.ts +94 -0
  89. package/form-item-group/index.mjs +2 -78
  90. package/form-item-group/style.css +1 -1
  91. package/form-item-x/index.d.ts +184 -0
  92. package/form-item-x/index.mjs +1 -1
  93. package/form-item-x/style.css +1 -0
  94. package/form-radio-group/index.d.ts +283 -0
  95. package/form-radio-group/index.mjs +1 -1
  96. package/form-rate/index.d.ts +321 -0
  97. package/form-rate/index.mjs +1 -1
  98. package/form-red-table/index.d.ts +21 -0
  99. package/form-red-table/index.mjs +27 -26
  100. package/form-row/index.d.ts +11 -0
  101. package/form-row/index.mjs +1 -1
  102. package/form-select/index.d.ts +542 -0
  103. package/form-select/index.mjs +1 -1
  104. package/form-slider/index.d.ts +350 -0
  105. package/form-slider/index.mjs +1 -1
  106. package/form-switch/index.d.ts +339 -0
  107. package/form-switch/index.mjs +1 -1
  108. package/form-text/index.d.ts +229 -0
  109. package/form-text/index.mjs +1 -1
  110. package/form-view/index.d.ts +2 -0
  111. package/form-view/index.mjs +1 -1
  112. package/helper/dictionary.d.ts +15 -0
  113. package/helper/dictionary.mjs +97 -0
  114. package/hook/useDictionary.d.ts +60 -0
  115. package/hook/useDictionary.mjs +15 -0
  116. package/hook/useVisibilityChange.d.ts +4 -0
  117. package/hook/useVisibilityChange.mjs +14 -0
  118. package/iframe-window/index.d.ts +9 -0
  119. package/iframe-window/index.mjs +37 -0
  120. package/iframe-window/style.css +1 -0
  121. package/index.d.ts +51 -0
  122. package/index.mjs +51 -37
  123. package/month-calendar/index.d.ts +80 -0
  124. package/package.json +12 -7
  125. package/pageable-table/index.d.ts +436 -0
  126. package/pageable-table/index.mjs +2 -0
  127. package/pageable-table/style.css +1 -0
  128. package/resize-observer/index.d.ts +8 -0
  129. package/resize-observer/index.mjs +40 -0
  130. package/resize-observer/style.css +1 -0
  131. package/resolver/index.d.ts +9 -0
  132. package/resolver/index.mjs +29 -0
  133. package/table-column/index.d.ts +160 -0
  134. package/table-column/index.mjs +2 -0
  135. package/table-column/style.css +1 -0
  136. package/table-column-def/index.d.ts +85 -0
  137. package/table-column-def/index.mjs +11 -0
  138. package/table-column-filter/index.d.ts +11 -0
  139. package/table-column-filterable/index.d.ts +10 -0
  140. package/table-view/index.d.ts +2 -0
  141. package/table-view/index.mjs +1 -1
  142. package/toolbar/index.d.ts +129 -0
  143. package/toolbar/index.mjs +1 -8
  144. package/toolbar/style.css +1 -0
  145. package/toolbar-button/index.d.ts +77 -0
  146. package/toolbar-button/index.mjs +1 -8
  147. package/vue-cron/index.d.ts +191 -0
  148. package/vue-cron/index.mjs +2 -0
  149. package/vue-cron/style.css +1 -0
  150. package/web-types.json +1 -1
  151. package/x-input-tag/index.d.ts +2 -0
  152. package/x-input-tag/index.mjs +226 -0
  153. package/x-input-tag/style.css +1 -0
  154. package/year-calendar/index.d.ts +99 -0
  155. package/year-calendar/index.mjs +2 -0
  156. package/year-calendar/style.css +1 -0
  157. package/chunks/B4M_TFeR.mjs +0 -152
  158. package/chunks/B5BIQCcK.mjs +0 -149
  159. package/chunks/BHNKrW1j.mjs +0 -61
  160. package/chunks/BO9jWhBl.mjs +0 -46
  161. package/chunks/BZ8aOa78.mjs +0 -35
  162. package/chunks/Bsz7y4Xp.mjs +0 -73
  163. package/chunks/Bxj372sF.mjs +0 -53
  164. package/chunks/C33EmJN8.mjs +0 -32
  165. package/chunks/C6Li3-l7.mjs +0 -28
  166. package/chunks/CBcdalMX.mjs +0 -35
  167. package/chunks/CdRsyF0n.mjs +0 -43
  168. package/chunks/ClNahmiU.mjs +0 -23
  169. package/chunks/CstztYMu.mjs +0 -28
  170. package/chunks/DC9b53M6.mjs +0 -32
  171. package/chunks/DDVAgRED.mjs +0 -36
  172. package/chunks/DpJQABVD.mjs +0 -91
  173. package/chunks/ZsLNWI9x.mjs +0 -46
  174. package/chunks/jn_iQrVZ.mjs +0 -28
  175. package/constants.mjs +0 -4
  176. package/input/style.css +0 -1
package/api/index.d.ts ADDED
@@ -0,0 +1,60 @@
1
+ export interface DictItem {
2
+ id: string;
3
+ dictId: string;
4
+ label: string;
5
+ dictType: string;
6
+ description: string;
7
+ sortOrder: number;
8
+ createBy: string;
9
+ updateBy: string;
10
+ createTime: string;
11
+ updateTime: string;
12
+ remarks: null;
13
+ delFlag: string;
14
+ value: string;
15
+ }
16
+ export interface ConfigOptions {
17
+ privilege?: {
18
+ processButtons?: (buttons: Array<string | Record<string, string>>) => Array<string | Record<string, boolean>>;
19
+ hasAuthority?: (privilege: string) => boolean;
20
+ };
21
+ dict?: {
22
+ getDictTreeByType?: (type: string, options: {
23
+ idAsValue?: boolean;
24
+ labelAsValue?: boolean;
25
+ }) => Promise<{
26
+ data: {
27
+ data: DictItem[];
28
+ };
29
+ }>;
30
+ remote?: (type: string) => Promise<{
31
+ data: {
32
+ data: DictItem[];
33
+ };
34
+ }>;
35
+ };
36
+ tableView?: {
37
+ reload?: () => void;
38
+ };
39
+ toolbar?: {
40
+ goBack?: (path: string) => void;
41
+ };
42
+ }
43
+ export declare const processButtons: (buttons: Array<string | Record<string, string>>) => (string | Record<string, boolean>)[] | undefined;
44
+ export declare const hasAuthority: (str: string) => boolean | undefined;
45
+ export declare const goBack: (path: string) => void | undefined;
46
+ export declare const reloadTable: () => void | undefined;
47
+ export declare const getDictTreeByType: (type: string, options: {
48
+ idAsValue?: boolean;
49
+ labelAsValue?: boolean;
50
+ }) => Promise<{
51
+ data: {
52
+ data: DictItem[];
53
+ };
54
+ }> | undefined;
55
+ export declare const remote: (type: string) => Promise<{
56
+ data: {
57
+ data: DictItem[];
58
+ };
59
+ }> | undefined;
60
+ export declare const config: (options: ConfigOptions) => void;
package/api/index.mjs ADDED
@@ -0,0 +1,42 @@
1
+ import { isObject as e, isString as t } from "@web-utils/core";
2
+ import { mergeWith as n } from "@web-utils/integrations/lodash";
3
+ //#region src/api/index.ts
4
+ var r = { privilege: {
5
+ processButtons(n) {
6
+ return n.map((n) => {
7
+ if (e(n)) {
8
+ let e = n, r = {};
9
+ for (let n in e) t(e[n]) && (r[n] = a(e[n]) ?? !0);
10
+ return r;
11
+ }
12
+ return n;
13
+ });
14
+ },
15
+ hasAuthority(e) {
16
+ return !0;
17
+ }
18
+ } }, i = (e) => {
19
+ var t, n;
20
+ return (t = r.privilege) == null || (n = t.processButtons) == null ? void 0 : n.call(t, e);
21
+ }, a = (e) => {
22
+ var t, n;
23
+ return (t = r.privilege) == null || (n = t.hasAuthority) == null ? void 0 : n.call(t, e);
24
+ }, o = (e) => {
25
+ var t, n;
26
+ return (t = r.toolbar) == null || (n = t.goBack) == null ? void 0 : n.call(t, e);
27
+ }, s = () => {
28
+ var e, t;
29
+ return (e = r.tableView) == null || (t = e.reload) == null ? void 0 : t.call(e);
30
+ }, c = (e, t) => {
31
+ var n, i;
32
+ return (n = r.dict) == null || (i = n.getDictTreeByType) == null ? void 0 : i.call(n, e, t);
33
+ }, l = (e) => {
34
+ var t, n;
35
+ return (t = r.dict) == null || (n = t.remote) == null ? void 0 : n.call(t, e);
36
+ }, u = (e) => {
37
+ n(r, e, (e, t) => {
38
+ if (typeof t == "function") return t;
39
+ });
40
+ };
41
+ //#endregion
42
+ export { u as config, c as getDictTreeByType, o as goBack, a as hasAuthority, i as processButtons, s as reloadTable, l as remote };
@@ -0,0 +1,60 @@
1
+ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<{
2
+ type: {
3
+ type: StringConstructor;
4
+ default: string;
5
+ };
6
+ size: StringConstructor;
7
+ icon: {
8
+ type: StringConstructor;
9
+ default: string;
10
+ };
11
+ nativeType: {
12
+ type: StringConstructor;
13
+ default: string;
14
+ };
15
+ loading: BooleanConstructor;
16
+ disabled: BooleanConstructor;
17
+ plain: BooleanConstructor;
18
+ autofocus: BooleanConstructor;
19
+ round: BooleanConstructor;
20
+ text: {
21
+ type: StringConstructor;
22
+ default: string;
23
+ };
24
+ }>, () => globalThis.VNode<import('vue').RendererNode, import('vue').RendererElement, {
25
+ [key: string]: any;
26
+ }>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
27
+ type: {
28
+ type: StringConstructor;
29
+ default: string;
30
+ };
31
+ size: StringConstructor;
32
+ icon: {
33
+ type: StringConstructor;
34
+ default: string;
35
+ };
36
+ nativeType: {
37
+ type: StringConstructor;
38
+ default: string;
39
+ };
40
+ loading: BooleanConstructor;
41
+ disabled: BooleanConstructor;
42
+ plain: BooleanConstructor;
43
+ autofocus: BooleanConstructor;
44
+ round: BooleanConstructor;
45
+ text: {
46
+ type: StringConstructor;
47
+ default: string;
48
+ };
49
+ }>> & Readonly<{}>, {
50
+ loading: boolean;
51
+ disabled: boolean;
52
+ plain: boolean;
53
+ autofocus: boolean;
54
+ round: boolean;
55
+ type: string;
56
+ icon: string;
57
+ nativeType: string;
58
+ text: string;
59
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
60
+ export default _default;
@@ -0,0 +1,49 @@
1
+ import { isFunction as e } from "@web-utils/core";
2
+ import { h as t, ref as n, resolveComponent as r } from "vue";
3
+ //#region src/components/button/AwesomeButton.vue
4
+ var i = {
5
+ name: "AwesomeButton",
6
+ inheritAttrs: !1,
7
+ props: {
8
+ type: {
9
+ type: String,
10
+ default: "primary"
11
+ },
12
+ size: String,
13
+ icon: {
14
+ type: String,
15
+ default: ""
16
+ },
17
+ nativeType: {
18
+ type: String,
19
+ default: "button"
20
+ },
21
+ loading: Boolean,
22
+ disabled: Boolean,
23
+ plain: Boolean,
24
+ autofocus: Boolean,
25
+ round: Boolean,
26
+ text: {
27
+ type: String,
28
+ default: ""
29
+ }
30
+ },
31
+ setup(i, { attrs: a, slots: o }) {
32
+ let s = r("ElButton"), { text: c, ...l } = i, { onClick: u, ...d } = a, f = n(!1), p = async (t) => {
33
+ if (f.value = !0, e(u)) try {
34
+ await u(t);
35
+ } catch (e) {
36
+ console.error(e);
37
+ }
38
+ f.value = !1;
39
+ };
40
+ return () => t(s, {
41
+ ...d,
42
+ ...l,
43
+ disabled: f.value,
44
+ onClick: p
45
+ }, { default: o.default || (() => c) });
46
+ }
47
+ };
48
+ //#endregion
49
+ export { i as default };
package/base.css CHANGED
@@ -1 +1 @@
1
-
1
+ :root{--el-disabled-text-color:#606266;--border-color:#d7dae0}.border-bottom{border-bottom:1px solid #d7dae0}.clear-fix:after{clear:both;visibility:hidden;content:" ";height:0;display:block}.flex-row{flex-direction:row;flex-shrink:0;display:flex}.flex-row.vertical-center{align-items:center}.flex-row.vertical-start{align-items:flex-start}.flex-row.horizon-center{justify-content:center}.text-center{text-align:center}.flex-column{flex-direction:column;display:flex}.flex-column.vertical-center{justify-content:center}.flex-column.horizon-center{align-items:center}.flex-item,.flex-item-relative{flex:auto}.flex-item-relative{position:relative}.flex-item-relative .flex-content{position:absolute;top:0;bottom:0;left:0;right:0}.flex-not-shrink{flex-shrink:0}
@@ -0,0 +1,478 @@
1
+ import { t as e } from "./CkFapoKt.mjs";
2
+ import { Fragment as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createStaticVNode as a, createVNode as o, normalizeClass as s, normalizeStyle as c, openBlock as l, renderList as u, toDisplayString as d, withModifiers as f } from "vue";
3
+ import p from "dayjs";
4
+ //#region src/components/material-year-calendar/MonthCalendar.vue
5
+ var m = {
6
+ name: "MonthCalendar",
7
+ props: {
8
+ activeDates: {
9
+ type: Array,
10
+ default: () => []
11
+ },
12
+ month: {
13
+ type: [String, Number],
14
+ default: () => p().month() + 1
15
+ },
16
+ year: {
17
+ type: [String, Number],
18
+ default: () => p().year()
19
+ },
20
+ lang: {
21
+ type: String,
22
+ default: "en"
23
+ },
24
+ activeClass: {
25
+ type: String,
26
+ default: () => ""
27
+ },
28
+ prefixClass: {
29
+ type: String,
30
+ default: () => "calendar--active"
31
+ }
32
+ },
33
+ emits: ["toggleDate", "monthClickEvent"],
34
+ data() {
35
+ return {
36
+ showDays: [],
37
+ isMouseDown: !1
38
+ };
39
+ },
40
+ computed: {
41
+ weekTitleFontSizeAdjustLang() {
42
+ return {
43
+ tw: "16px",
44
+ en: "14px",
45
+ pt: "14px",
46
+ de: "14px",
47
+ es: "14px",
48
+ pl: "12px",
49
+ ru: "14px"
50
+ }[this.lang];
51
+ },
52
+ monthTitle() {
53
+ return {
54
+ tw: [
55
+ "一月",
56
+ "二月",
57
+ "三月",
58
+ "四月",
59
+ "五月",
60
+ "六月",
61
+ "七月",
62
+ "八月",
63
+ "九月",
64
+ "十月",
65
+ "十一月",
66
+ "十二月"
67
+ ],
68
+ en: [
69
+ "January",
70
+ "February",
71
+ "March",
72
+ "April",
73
+ "May",
74
+ "June",
75
+ "July",
76
+ "August",
77
+ "September",
78
+ "October",
79
+ "November",
80
+ "December"
81
+ ],
82
+ pt: [
83
+ "Janeiro",
84
+ "Fevereiro",
85
+ "Março",
86
+ "Abril",
87
+ "Maio",
88
+ "Junho",
89
+ "Julho",
90
+ "Agosto",
91
+ "Setembro",
92
+ "Outubro",
93
+ "Novembro",
94
+ "Dezembro"
95
+ ],
96
+ de: [
97
+ "Januar",
98
+ "Februar",
99
+ "März",
100
+ "April",
101
+ "Mai",
102
+ "Juni",
103
+ "Juli",
104
+ "August",
105
+ "September",
106
+ "Oktober",
107
+ "November",
108
+ "Dezember"
109
+ ],
110
+ es: [
111
+ "Enero",
112
+ "Febrero",
113
+ "Marzo",
114
+ "Abril",
115
+ "Mayo",
116
+ "Junio",
117
+ "Julio",
118
+ "Agosto",
119
+ "Septiembre",
120
+ "Octubre",
121
+ "Noviembre",
122
+ "Diciembre"
123
+ ],
124
+ pl: [
125
+ "Styczeń",
126
+ "Luty",
127
+ "Marzec",
128
+ "Kwiecień",
129
+ "Maj",
130
+ "Czerwiec",
131
+ "Lipiec",
132
+ "Sierpień",
133
+ "Wrzesień",
134
+ "Październik",
135
+ "Listopad",
136
+ "Grudzień"
137
+ ],
138
+ ru: [
139
+ "Январь",
140
+ "Февраль",
141
+ "Март",
142
+ "Апрель",
143
+ "Май",
144
+ "Июнь",
145
+ "Июль",
146
+ "Август",
147
+ "Сентябрь",
148
+ "Октябрь",
149
+ "Ноябрь",
150
+ "Декабрь"
151
+ ]
152
+ }[this.lang][this.month - 1];
153
+ }
154
+ },
155
+ watch: {
156
+ year(e) {
157
+ this.initCalendar();
158
+ },
159
+ activeDates(e, t) {
160
+ this.initCalendar();
161
+ }
162
+ },
163
+ created() {
164
+ this.initCalendar();
165
+ },
166
+ methods: {
167
+ initCalendar() {
168
+ if (!this.year || !this.month) return [];
169
+ let e = p().set("date", 1).set("year", this.year).set("month", this.month - 1), t = e.startOf("month").day() - 1;
170
+ t < 0 && (t += 7);
171
+ let n = e.endOf("month").date(), r = t >= 5 ? 6 : 5, i = 0;
172
+ this.showDays = Array.from(Array(r * 7).keys()).map((e) => ({
173
+ value: t <= e ? i++ % n + 1 : "",
174
+ active: !1,
175
+ isOtherMonth: t > e || i > n
176
+ })), this.activeDates.forEach((e) => {
177
+ let n;
178
+ typeof e == "string" ? n = {
179
+ date: e,
180
+ className: this.activeClass
181
+ } : typeof e == "object" && (n = e);
182
+ let r = p(n.date);
183
+ if (r.year() !== this.year) return;
184
+ let i = r.date(), a = Math.floor(i / 7), o = i % 7 - 1 + t + 7 * a;
185
+ this.showDays[o].active = !0, this.showDays[o].className = n.className;
186
+ });
187
+ },
188
+ showDayTitle(e) {
189
+ return {
190
+ tw: [
191
+ "一",
192
+ "二",
193
+ "三",
194
+ "四",
195
+ "五",
196
+ "六",
197
+ "日"
198
+ ],
199
+ en: [
200
+ "Mo",
201
+ "Tu",
202
+ "We",
203
+ "Th",
204
+ "Fr",
205
+ "Sa",
206
+ "Su"
207
+ ],
208
+ pt: [
209
+ "2ª",
210
+ "3ª",
211
+ "4ª",
212
+ "5ª",
213
+ "6ª",
214
+ "Sa",
215
+ "Do"
216
+ ],
217
+ de: [
218
+ "Mo",
219
+ "Di",
220
+ "Mi",
221
+ "Do",
222
+ "Fr",
223
+ "Sa",
224
+ "So"
225
+ ],
226
+ es: [
227
+ "Lu",
228
+ "Ma",
229
+ "Mi",
230
+ "Ju",
231
+ "Vi",
232
+ "Sá",
233
+ "Do"
234
+ ],
235
+ pl: [
236
+ "Pon",
237
+ "Wt",
238
+ "Śr",
239
+ "Czw",
240
+ "Pt",
241
+ "Sob",
242
+ "Nie"
243
+ ],
244
+ ru: [
245
+ "Пн",
246
+ "Вт",
247
+ "Ср",
248
+ "Чт",
249
+ "Пт",
250
+ "Сб",
251
+ "Вс"
252
+ ]
253
+ }[this.lang][e];
254
+ },
255
+ toggleDay(e) {
256
+ e.isOtherMonth || this.$emit("toggleDate", {
257
+ month: this.month,
258
+ date: e.value,
259
+ selected: !e.active,
260
+ className: this.activeClass
261
+ });
262
+ },
263
+ dragDay(e) {
264
+ this.isMouseDown && this.toggleDay(e);
265
+ },
266
+ mouseDown(e) {
267
+ this.toggleDay(e), this.isMouseDown = !0;
268
+ },
269
+ mouseUp() {
270
+ this.isMouseDown = !1;
271
+ },
272
+ classList(e) {
273
+ let t = {
274
+ "calendar__day--otherMonth": e.isOtherMonth,
275
+ [this.prefixClass]: e.active
276
+ };
277
+ return e.active && (t[e.className] = !0), t;
278
+ },
279
+ monthClickEvent(e) {
280
+ let t = {
281
+ monthTitle: this.monthTitle,
282
+ month: this.month,
283
+ year: e
284
+ };
285
+ this.$emit("monthClickEvent", t);
286
+ }
287
+ }
288
+ }, h = { class: "c-wrapper" }, g = { class: "calendar__body" }, _ = ["onMouseover", "onMousedown"];
289
+ function v(e, n, a, o, p, m) {
290
+ return l(), r("div", h, [i("div", {
291
+ class: "calendar",
292
+ onMouseup: n[1] || (n[1] = (...e) => m.mouseUp && m.mouseUp(...e)),
293
+ onMouseleave: n[2] || (n[2] = f((...e) => m.mouseUp && m.mouseUp(...e), ["stop"]))
294
+ }, [i("div", {
295
+ class: "calendar__title",
296
+ onClick: n[0] || (n[0] = (e) => m.monthClickEvent(a.year))
297
+ }, d(m.monthTitle), 1), i("div", g, [(l(), r(t, null, u(7, (e, t) => i("div", {
298
+ key: `title${e}`,
299
+ class: "calendar__day day__weektitle",
300
+ style: c({ fontSize: m.weekTitleFontSizeAdjustLang })
301
+ }, d(m.showDayTitle(t)), 5)), 64)), (l(!0), r(t, null, u(p.showDays, (e, t) => (l(), r("div", {
302
+ key: `day${t}`,
303
+ class: "calendar__day"
304
+ }, [i("div", {
305
+ class: s(["day", m.classList(e)]),
306
+ onMouseover: (t) => m.dragDay(e),
307
+ onMousedown: (t) => m.mouseDown(e)
308
+ }, d(e.value), 43, _)]))), 128))])], 32)]);
309
+ }
310
+ var y = /* @__PURE__ */ e(m, [["render", v], ["__scopeId", "data-v-2a7f150d"]]), b = {
311
+ name: "YearCalendar",
312
+ components: { MonthCalendar: y },
313
+ props: {
314
+ showYearSelector: {
315
+ type: Boolean,
316
+ default: () => !0
317
+ },
318
+ activeDates: {
319
+ type: Array,
320
+ default: () => [],
321
+ validator: (e) => {
322
+ let t = !0, n = null;
323
+ return e.forEach((e) => {
324
+ 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);
325
+ let r = n.split("-"), i = parseInt(r[2], 10), a = parseInt(r[1], 10), o = parseInt(r[0], 10);
326
+ (o < 1e3 || o > 3e3 || a === 0 || a > 12) && (t = !1);
327
+ let s = [
328
+ 31,
329
+ 28,
330
+ 31,
331
+ 30,
332
+ 31,
333
+ 30,
334
+ 31,
335
+ 31,
336
+ 30,
337
+ 31,
338
+ 30,
339
+ 31
340
+ ];
341
+ (o % 400 == 0 || o % 100 != 0 && o % 4 == 0) && (s[1] = 29), i > 0 && i <= s[a - 1] || (t = !1);
342
+ }), t;
343
+ }
344
+ },
345
+ modelValue: {
346
+ type: [String, Number],
347
+ default: p().year()
348
+ },
349
+ lang: {
350
+ type: String,
351
+ default: "en"
352
+ },
353
+ activeClass: {
354
+ type: String,
355
+ default: () => ""
356
+ },
357
+ prefixClass: {
358
+ type: String,
359
+ default: () => "calendar--active"
360
+ },
361
+ hideWeekend: {
362
+ type: Boolean,
363
+ default: !1
364
+ },
365
+ hideSunday: {
366
+ type: Boolean,
367
+ default: !1
368
+ }
369
+ },
370
+ emits: [
371
+ "toggleDate",
372
+ "monthClick",
373
+ "update:activeDates",
374
+ "update:modelValue"
375
+ ],
376
+ data() {
377
+ return { isUsingString: !0 };
378
+ },
379
+ computed: {
380
+ month() {
381
+ let e = {};
382
+ return this.activeDates.forEach((t) => {
383
+ let n;
384
+ if (n = typeof t == "string" ? {
385
+ date: t,
386
+ className: this.activeClass
387
+ } : {
388
+ date: t.date,
389
+ className: t.className || ""
390
+ }, p(n.date).year() !== parseInt(this.modelValue)) return;
391
+ let r = (p(n.date).month() + 1).toString();
392
+ e[r] || (e[r] = []), e[r].push(n);
393
+ }), e;
394
+ },
395
+ activeYear: {
396
+ get() {
397
+ return parseInt(this.modelValue);
398
+ },
399
+ set(e) {
400
+ this.$emit("update:modelValue", e);
401
+ }
402
+ }
403
+ },
404
+ created() {
405
+ this.isUsingString = this.activeDates.length && typeof this.activeDates[0] == "string";
406
+ },
407
+ methods: {
408
+ changeYear(e) {
409
+ this.activeYear = e + this.activeYear - 3;
410
+ },
411
+ toggleDate(e) {
412
+ let t = p().set("year", this.modelValue).set("month", e.month - 1).set("date", e.date).format("YYYY-MM-DD");
413
+ this.$emit("toggleDate", {
414
+ date: t,
415
+ selected: e.selected,
416
+ className: e.className
417
+ });
418
+ let n, r;
419
+ if (this.isUsingString) n = this.activeDates.indexOf(t), r = this.modifiedActiveDates(n, t);
420
+ else {
421
+ let i = {
422
+ date: t,
423
+ className: e.className
424
+ };
425
+ n = this.activeDates.indexOf(this.activeDates.find((e) => e.date === t)), r = this.modifiedActiveDates(n, i);
426
+ }
427
+ this.$emit("update:activeDates", r);
428
+ },
429
+ modifiedActiveDates(e, t) {
430
+ let n = [...this.activeDates];
431
+ return e === -1 ? n.push(t) : n.splice(e, 1), n;
432
+ },
433
+ monthClick(e) {
434
+ this.$emit("monthClick", e);
435
+ }
436
+ }
437
+ }, x = { class: "vue-calendar__container" }, S = {
438
+ key: 0,
439
+ class: "container__year"
440
+ }, C = ["onClick"];
441
+ function w(e, c, f, p, m, h) {
442
+ let g = y;
443
+ return l(), r("div", x, [f.showYearSelector ? (l(), r("div", S, [
444
+ n(" <span><button @click=\"addYear(-1)\">back</button></span> "),
445
+ (l(), r(t, null, u(5, (e) => i("span", {
446
+ key: e,
447
+ class: "year__chooser",
448
+ onClick: (t) => h.changeYear(e)
449
+ }, d(e + h.activeYear - 3), 9, C)), 64)),
450
+ n(" <span><button @click=\"addYear(1)\">next</button></span> ")
451
+ ])) : n("v-if", !0), i("div", { class: s(["container__months", {
452
+ "hide-weekend": f.hideWeekend,
453
+ "hide-sunday": f.hideSunday
454
+ }]) }, [(l(), r(t, null, u(12, (e) => o(g, {
455
+ key: `month-${e}`,
456
+ class: "container__month",
457
+ year: h.activeYear,
458
+ month: e,
459
+ "active-dates": h.month[e],
460
+ "active-class": f.activeClass,
461
+ lang: f.lang,
462
+ "prefix-class": f.prefixClass,
463
+ onToggleDate: h.toggleDate,
464
+ onMonthClickEvent: h.monthClick
465
+ }, null, 8, [
466
+ "year",
467
+ "month",
468
+ "active-dates",
469
+ "active-class",
470
+ "lang",
471
+ "prefix-class",
472
+ "onToggleDate",
473
+ "onMonthClickEvent"
474
+ ])), 64)), c[0] || (c[0] = a("<div class=\"container__month p-0\" data-v-5cc87b9a></div><div class=\"container__month p-0\" data-v-5cc87b9a></div><div class=\"container__month p-0\" data-v-5cc87b9a></div><div class=\"container__month p-0\" data-v-5cc87b9a></div><div class=\"container__month p-0\" data-v-5cc87b9a></div>", 5))], 2)]);
475
+ }
476
+ var T = /* @__PURE__ */ e(b, [["render", w], ["__scopeId", "data-v-5cc87b9a"]]);
477
+ //#endregion
478
+ export { T as t };