ninemoon-ui 0.0.27 → 0.1.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.
Files changed (135) hide show
  1. package/dist/assets/dialog-a1b585e9.css +9 -0
  2. package/dist/assets/index-6d2c28a9.css +1210 -0
  3. package/dist/{tabs.css → assets/tabs-d2c8965f.css} +3 -3
  4. package/dist/components/alert/alert.d.ts +3 -11
  5. package/dist/components/alert/alertcomponent.vue.d.ts +22 -11
  6. package/dist/components/badge/badge.vue.d.ts +2 -0
  7. package/dist/components/carousel/carousel.vue.d.ts +29 -3
  8. package/dist/components/{tree/tree.vue.d.ts → carousel/clickbutton.vue.d.ts} +6 -19
  9. package/dist/components/check/checkbox.vue.d.ts +24 -16
  10. package/dist/components/check/checkgroup.vue.d.ts +15 -3
  11. package/dist/components/date/datepicker.vue.d.ts +28 -6
  12. package/dist/components/date/datepickerRange.vue.d.ts +15 -4
  13. package/dist/components/form/form.vue.d.ts +7 -20
  14. package/dist/components/form/formlabel.vue.d.ts +3 -3
  15. package/dist/components/form/type.d.ts +11 -0
  16. package/dist/components/icon/add.vue.d.ts +2 -0
  17. package/dist/components/icon/alertTip.vue.d.ts +2 -0
  18. package/dist/components/icon/arrow.vue.d.ts +2 -0
  19. package/dist/components/icon/calendar.vue.d.ts +2 -0
  20. package/dist/components/icon/close.vue.d.ts +2 -0
  21. package/dist/components/icon/dateArrow.vue.d.ts +2 -0
  22. package/dist/components/icon/dateArrowplus.vue.d.ts +2 -0
  23. package/dist/components/icon/delete.vue.d.ts +2 -0
  24. package/dist/components/icon/ellipsis.vue.d.ts +2 -0
  25. package/dist/components/icon/errTip.vue.d.ts +2 -0
  26. package/dist/components/icon/eye.vue.d.ts +2 -0
  27. package/dist/components/icon/infoTip.vue.d.ts +2 -0
  28. package/dist/components/icon/minus.vue.d.ts +2 -0
  29. package/dist/components/icon/successTip.vue.d.ts +2 -0
  30. package/dist/components/icon/turnleft.vue.d.ts +2 -0
  31. package/dist/components/icon/turnright.vue.d.ts +2 -0
  32. package/dist/components/icon/warnTip.vue.d.ts +2 -0
  33. package/dist/components/input/input.vue.d.ts +13 -8
  34. package/dist/components/loadding/loadcomponent.vue.d.ts +24 -4
  35. package/dist/components/loadding/loadding.d.ts +12 -19
  36. package/dist/components/menu/menu.vue.d.ts +13 -3
  37. package/dist/components/message/message.d.ts +68 -14
  38. package/dist/components/message/messagecomponent.vue.d.ts +5 -13
  39. package/dist/components/numberInput/numberinput.vue.d.ts +3 -3
  40. package/dist/components/pagination/pagination.vue.d.ts +24 -0
  41. package/dist/components/popover/poparrow.d.ts +55 -0
  42. package/dist/components/popover/popover.vue.d.ts +10 -4
  43. package/dist/components/radio/radiobox.vue.d.ts +24 -16
  44. package/dist/components/radio/radiogroup.vue.d.ts +15 -3
  45. package/dist/components/scrollBar/movebar.vue.d.ts +2 -2
  46. package/dist/components/scrollBar/scrollBar.vue.d.ts +12 -16
  47. package/dist/components/scrollloading/scrolllead.d.ts +18 -11
  48. package/dist/components/select/select.vue.d.ts +15 -1
  49. package/dist/components/select/selectoption.vue.d.ts +18 -6
  50. package/dist/components/switch/switch.vue.d.ts +14 -14
  51. package/dist/components/table/table.vue.d.ts +20 -9
  52. package/dist/components/table/tableItem.vue.d.ts +10 -4
  53. package/dist/components/tabs/tabs.vue.d.ts +14 -1
  54. package/dist/directives/arrowKeys.d.ts +10 -0
  55. package/dist/directives/drag.d.ts +20 -0
  56. package/dist/directives/escape.d.ts +7 -0
  57. package/dist/directives/outsideclick.d.ts +14 -0
  58. package/dist/directives/watchwindow.d.ts +13 -0
  59. package/dist/directives/wheel.d.ts +12 -0
  60. package/dist/directives/whitespaceclick.d.ts +12 -0
  61. package/dist/index.d.ts +831 -401
  62. package/dist/js/arrow-ebe47bd0.js +17 -0
  63. package/dist/js/{badge/badge.js → badge-496028b6.js} +9 -16
  64. package/dist/js/calendar-5c242731.js +87 -0
  65. package/dist/js/carousel-10621aeb.js +155 -0
  66. package/dist/js/{carousel/carouselitem.js → carouselitem-89116745.js} +1 -7
  67. package/dist/js/checkbox-530025c4.js +50 -0
  68. package/dist/js/checkgroup-e4e6adbc.js +58 -0
  69. package/dist/js/dateArrowplus-8181993f.js +25 -0
  70. package/dist/js/datepicker-ef8b7019.js +362 -0
  71. package/dist/js/datepickerRange-4c400f88.js +500 -0
  72. package/dist/js/delete-e898f83c.js +19 -0
  73. package/dist/js/dialog-0127ca01.js +122 -0
  74. package/dist/js/form-6ae96387.js +79 -0
  75. package/dist/js/formlabel-9339bd1c.js +136 -0
  76. package/dist/js/image-76711716.js +300 -0
  77. package/dist/js/index-283810a0.js +6261 -0
  78. package/dist/js/index-b4e420ce.js +958 -0
  79. package/dist/js/index-e12c8d65.js +36 -0
  80. package/dist/js/input-11fe67a5.js +107 -0
  81. package/dist/js/menu-fb9b4a4f.js +86 -0
  82. package/dist/js/numberinput-00fa4429.js +119 -0
  83. package/dist/js/pagination-3bcaa109.js +203 -0
  84. package/dist/js/popover-45f75f86.js +345 -0
  85. package/dist/js/radiobox-8f11e726.js +49 -0
  86. package/dist/js/radiogroup-727923c7.js +33 -0
  87. package/dist/js/scrollBar-07906042.js +252 -0
  88. package/dist/js/select-b5bbb138.js +203 -0
  89. package/dist/js/selectoption-00c8f06d.js +57 -0
  90. package/dist/js/shapeFlag-8cf4bcf1.js +17 -0
  91. package/dist/js/switch-06ae74cc.js +50 -0
  92. package/dist/js/table-9bb52630.js +270 -0
  93. package/dist/js/{table/tableItem.js → tableItem-7d8bf2db.js} +1 -1
  94. package/dist/js/{tabs/tabs.js → tabs-9d7be734.js} +57 -59
  95. package/dist/js/{upload/upload.js → upload-16dbef22.js} +8 -23
  96. package/dist/types/shapeFlag.d.ts +13 -0
  97. package/dist/{components/utils → utils}/tool.d.ts +11 -4
  98. package/package.json +1 -1
  99. package/dist/badge.css +0 -27
  100. package/dist/carousel.css +0 -13
  101. package/dist/checkgroup.css +0 -41
  102. package/dist/datepickerRange.css +0 -79
  103. package/dist/image.css +0 -8
  104. package/dist/index.css +0 -897
  105. package/dist/index.es.js +0 -37
  106. package/dist/index.umd.js +0 -6006
  107. package/dist/js/carousel/carousel.js +0 -171
  108. package/dist/js/check/checkbox.js +0 -16
  109. package/dist/js/check/checkgroup.js +0 -69
  110. package/dist/js/date/datepicker.js +0 -366
  111. package/dist/js/date/datepickerRange.js +0 -589
  112. package/dist/js/dialog/dialog.js +0 -138
  113. package/dist/js/form/form.js +0 -87
  114. package/dist/js/form/formlabel.js +0 -167
  115. package/dist/js/getcalendar/getcalendar.js +0 -48
  116. package/dist/js/image/image.js +0 -250
  117. package/dist/js/index/index.js +0 -860
  118. package/dist/js/input/input.js +0 -90
  119. package/dist/js/menu/menu.js +0 -59
  120. package/dist/js/numberInput/numberinput.js +0 -127
  121. package/dist/js/pagination/pagination.js +0 -234
  122. package/dist/js/popover/popover.js +0 -241
  123. package/dist/js/radio/radiobox.js +0 -16
  124. package/dist/js/radio/radiogroup.js +0 -69
  125. package/dist/js/scrollBar/scrollBar.js +0 -208
  126. package/dist/js/select/select.js +0 -118
  127. package/dist/js/select/selectoption.js +0 -16
  128. package/dist/js/switch/switch.js +0 -50
  129. package/dist/js/table/table.js +0 -216
  130. package/dist/js/tree/tree.js +0 -72
  131. package/dist/js/tree/treeleaf.js +0 -116
  132. package/dist/radiogroup.css +0 -44
  133. package/dist/scrollBar.css +0 -37
  134. package/dist/select.css +0 -20
  135. /package/dist/js/{tabs/tabsPane.js → tabsPane-f024a6bf.js} +0 -0
@@ -1,171 +0,0 @@
1
- import { defineComponent, useSlots, ref, computed, onMounted, watch, onUnmounted, openBlock, createElementBlock, normalizeStyle, createElementVNode, createVNode, h, normalizeClass } from "vue";
2
- const _sfc_main = /* @__PURE__ */ defineComponent({
3
- __name: "carousel",
4
- props: {
5
- height: {}
6
- },
7
- setup(__props) {
8
- const props = __props;
9
- const slots = useSlots();
10
- const activeIndex = ref(0);
11
- const totalLen = computed(() => {
12
- return slots.default().reduce((pre, cur) => {
13
- if (typeof cur.children === "string") {
14
- return pre;
15
- }
16
- if (Array.isArray(cur.children)) {
17
- return pre += cur.children.length;
18
- } else {
19
- return pre += 1;
20
- }
21
- }, 0);
22
- });
23
- const bodyHandle = (MySlot, d) => {
24
- let between = d - activeIndex.value;
25
- let transformNum = 0;
26
- if (totalLen.value <= 2) {
27
- transformNum = Math.abs(between * translatexNum.value);
28
- } else {
29
- if (activeIndex.value === 0 && d == totalLen.value - 1) {
30
- transformNum = -translatexNum.value;
31
- } else if (between < -1) {
32
- transformNum = (totalLen.value + between) * translatexNum.value;
33
- } else {
34
- transformNum = between * translatexNum.value;
35
- }
36
- }
37
- return h(
38
- "div",
39
- {
40
- class: normalizeClass(["carouselBody", [activeIndex.value === d ? "" : "tdd-opacity-0"]]),
41
- style: {
42
- transform: `translateX(${transformNum}px)`
43
- }
44
- },
45
- h(MySlot)
46
- );
47
- };
48
- const renderBody = () => {
49
- let indexflag = -1;
50
- return slots.default().map((MySlot, _) => {
51
- if (typeof MySlot.children == "string")
52
- return null;
53
- if (Array.isArray(MySlot.children)) {
54
- return MySlot.children.map((slot, _2) => {
55
- indexflag += 1;
56
- return bodyHandle(slot, indexflag);
57
- });
58
- } else {
59
- indexflag += 1;
60
- return bodyHandle(MySlot, indexflag);
61
- }
62
- });
63
- };
64
- const body = ref();
65
- const translatexNum = ref(0);
66
- onMounted(() => {
67
- translatexNum.value = body.value.offsetWidth;
68
- });
69
- const preHandle = () => {
70
- if (activeIndex.value === 0) {
71
- activeIndex.value = totalLen.value - 1;
72
- } else {
73
- activeIndex.value -= 1;
74
- }
75
- animationFrame && cancelAnimationFrame(animationFrame);
76
- };
77
- const nextHandle = () => {
78
- if (activeIndex.value === totalLen.value - 1) {
79
- activeIndex.value = 0;
80
- } else {
81
- activeIndex.value += 1;
82
- }
83
- animationFrame && cancelAnimationFrame(animationFrame);
84
- };
85
- let flagTime;
86
- let animationFrame;
87
- const autoAddHandle = () => {
88
- if (totalLen.value === 1 || totalLen.value === 0) {
89
- animationFrame && cancelAnimationFrame(animationFrame);
90
- return;
91
- }
92
- let newtime = (/* @__PURE__ */ new Date()).getTime();
93
- if (flagTime == null)
94
- flagTime = newtime;
95
- if (newtime - flagTime >= 2e3) {
96
- if (activeIndex.value + 1 == totalLen.value) {
97
- activeIndex.value = 0;
98
- } else {
99
- activeIndex.value += 1;
100
- }
101
- flagTime = newtime;
102
- }
103
- animationFrame = requestAnimationFrame(autoAddHandle);
104
- };
105
- const mouseEnterHandle = () => {
106
- flagTime = null;
107
- animationFrame && cancelAnimationFrame(animationFrame);
108
- };
109
- const mouseLeaveHandle = () => {
110
- flagTime = null;
111
- animationFrame && cancelAnimationFrame(animationFrame);
112
- autoAddHandle();
113
- };
114
- onMounted(() => {
115
- autoAddHandle();
116
- });
117
- watch(totalLen, () => {
118
- flagTime = null;
119
- animationFrame && cancelAnimationFrame(animationFrame);
120
- autoAddHandle();
121
- });
122
- onUnmounted(() => {
123
- flagTime = null;
124
- animationFrame && cancelAnimationFrame(animationFrame);
125
- });
126
- return (_ctx, _cache) => {
127
- return openBlock(), createElementBlock("div", {
128
- onMouseleave: mouseLeaveHandle,
129
- onMouseenter: mouseEnterHandle,
130
- class: "tdd-relative tdd-w-full tdd-group tdd-text-center tdd-overflow-x-hidden",
131
- ref_key: "body",
132
- ref: body,
133
- style: normalizeStyle({ height: `${props.height || 200}px` })
134
- }, [
135
- createElementVNode("button", {
136
- onClick: preHandle,
137
- type: "button",
138
- class: "tdd-z-20 tdd-text-center group-hover:tdd-flex tdd-hidden tdd-items-center tdd-justify-center tdd-absolute tdd-top-1/2 tdd--translate-y-1/2 tdd-left-1 tdd-w-6 tdd-h-6 tdd-rounded-full tdd-bg-slate-300 tdd-appearance-none tdd-transform tdd-rotate-180"
139
- }, _cache[0] || (_cache[0] = [
140
- createElementVNode("svg", {
141
- class: "tdd-w-4 tdd-h-4 tdd-fill-white tdd-inline-block",
142
- viewBox: "0 0 1024 1024",
143
- version: "1.1",
144
- xmlns: "http://www.w3.org/2000/svg"
145
- }, [
146
- createElementVNode("path", { d: "M320 885.333333c-8.533333 0-17.066667-4.266667-23.466667-10.666666-12.8-12.8-10.666667-34.133333 2.133334-44.8L654.933333 512 298.666667 194.133333c-12.8-10.666667-14.933333-32-2.133334-44.8 10.666667-12.8 32-14.933333 44.8-2.133333l384 341.333333c6.4 6.4 10.666667 14.933333 10.666667 23.466667 0 8.533333-4.266667 17.066667-10.666667 23.466667l-384 341.333333c-6.4 6.4-12.8 8.533333-21.333333 8.533333z" })
147
- ], -1)
148
- ])),
149
- createElementVNode("button", {
150
- onClick: nextHandle,
151
- type: "button",
152
- class: "tdd-z-20 tdd-text-center group-hover:tdd-flex tdd-hidden tdd-items-center tdd-justify-center tdd-absolute tdd-top-1/2 tdd--translate-y-1/2 tdd-right-1 tdd-w-6 tdd-h-6 tdd-rounded-full tdd-bg-slate-300 tdd-appearance-none"
153
- }, _cache[1] || (_cache[1] = [
154
- createElementVNode("svg", {
155
- class: "tdd-w-4 tdd-h-4 tdd-fill-white tdd-inline-block",
156
- viewBox: "0 0 1024 1024",
157
- version: "1.1",
158
- xmlns: "http://www.w3.org/2000/svg"
159
- }, [
160
- createElementVNode("path", { d: "M320 885.333333c-8.533333 0-17.066667-4.266667-23.466667-10.666666-12.8-12.8-10.666667-34.133333 2.133334-44.8L654.933333 512 298.666667 194.133333c-12.8-10.666667-14.933333-32-2.133334-44.8 10.666667-12.8 32-14.933333 44.8-2.133333l384 341.333333c6.4 6.4 10.666667 14.933333 10.666667 23.466667 0 8.533333-4.266667 17.066667-10.666667 23.466667l-384 341.333333c-6.4 6.4-12.8 8.533333-21.333333 8.533333z" })
161
- ], -1)
162
- ])),
163
- createVNode(renderBody)
164
- ], 36);
165
- };
166
- }
167
- });
168
- const carousel_vue_vue_type_style_index_0_lang = "";
169
- export {
170
- _sfc_main as default
171
- };
@@ -1,16 +0,0 @@
1
- import { defineComponent, renderSlot } from "vue";
2
- const _sfc_main = /* @__PURE__ */ defineComponent({
3
- __name: "checkbox",
4
- props: {
5
- label: {},
6
- class: {}
7
- },
8
- setup(__props) {
9
- return (_ctx, _cache) => {
10
- return renderSlot(_ctx.$slots, "default");
11
- };
12
- }
13
- });
14
- export {
15
- _sfc_main as default
16
- };
@@ -1,69 +0,0 @@
1
- import { defineComponent, inject, useSlots, openBlock, createBlock, h, normalizeClass, withDirectives, vModelCheckbox } from "vue";
2
- const _sfc_main = /* @__PURE__ */ defineComponent({
3
- __name: "checkgroup",
4
- props: {
5
- modelValue: {},
6
- showinput: { type: Boolean, default: false }
7
- },
8
- emits: ["update:modelValue", "change"],
9
- setup(__props, { emit: __emit }) {
10
- const props = __props;
11
- const ParentGetChangeHandle = inject("changHandle", () => null);
12
- const emit = __emit;
13
- const slots = useSlots();
14
- const BoxHandle = (MySlot) => {
15
- var _a;
16
- return h(
17
- "label",
18
- {
19
- class: normalizeClass(["checkGroup", [MySlot.props.class, props.modelValue.includes(MySlot.props.label) ? "tdd-bg-wordblue" : ""]])
20
- },
21
- [
22
- withDirectives(
23
- h("input", {
24
- type: "checkbox",
25
- value: MySlot.props.label,
26
- "onUpdate:modelValue": (value) => {
27
- ParentGetChangeHandle(value);
28
- emit("update:modelValue", value);
29
- },
30
- class: normalizeClass(["hiddeninput form-tick", [props.showinput ? "" : "tdd-hidden"]])
31
- }),
32
- [[vModelCheckbox, props.modelValue]]
33
- ),
34
- h(
35
- "span",
36
- {
37
- class: normalizeClass(["tdd-text-sm", [props.modelValue.includes(MySlot.props.label) ? "tdd-text-white" : "tdd-text-word6"]])
38
- },
39
- ((_a = MySlot.children) == null ? void 0 : _a.default()) || MySlot.props.label
40
- )
41
- ]
42
- );
43
- };
44
- const renderBoxs = () => {
45
- return h(
46
- "div",
47
- {},
48
- slots.default().map((MySlot) => {
49
- if (typeof MySlot.children === "string")
50
- return null;
51
- if (Array.isArray(MySlot.children)) {
52
- return MySlot.children.map((slot) => {
53
- return BoxHandle(slot);
54
- });
55
- } else {
56
- return BoxHandle(MySlot);
57
- }
58
- })
59
- );
60
- };
61
- return (_ctx, _cache) => {
62
- return openBlock(), createBlock(renderBoxs);
63
- };
64
- }
65
- });
66
- const checkgroup_vue_vue_type_style_index_0_lang = "";
67
- export {
68
- _sfc_main as default
69
- };
@@ -1,366 +0,0 @@
1
- import { defineComponent, defineAsyncComponent, computed, ref, openBlock, createBlock, unref, withCtx, createElementVNode, createElementBlock, createCommentVNode, toDisplayString, withDirectives, vShow, createVNode, TransitionGroup, Fragment, renderList, normalizeClass } from "vue";
2
- import { g as getNewArray } from "../index/index.js";
3
- import { a as addZero, g as getMonthDays } from "../getcalendar/getcalendar.js";
4
- const _hoisted_1 = { class: "tdd-flex tdd-items-center tdd-justify-between tdd-p-3" };
5
- const _hoisted_2 = { class: "tdd-flex-1 tdd-text-center tdd-text-sm tdd-font-medium" };
6
- const _hoisted_3 = { class: "tdd-relative tdd-overflow-hidden tdd-px-2 tdd-pt-3 tdd-pb-1" };
7
- const _hoisted_4 = {
8
- class: "tdd-w-full tdd-text-center tdd-table-fixed tdd-cursor-pointer tdd-text-word3",
9
- key: "daymode"
10
- };
11
- const _hoisted_5 = ["onClick"];
12
- const _hoisted_6 = {
13
- class: "tdd-w-full tdd-text-center tdd-table-fixed tdd-cursor-pointer tdd-text-word3",
14
- key: "monthmode"
15
- };
16
- const _hoisted_7 = ["onClick"];
17
- const _hoisted_8 = { class: "tdd-relative tdd-inline-flex tdd-h-full tdd-w-full tdd-items-center tdd-overflow-hidden tdd-rounded tdd-border tdd-border-solid" };
18
- const _hoisted_9 = ["value", "placeholder"];
19
- const _sfc_main = /* @__PURE__ */ defineComponent({
20
- __name: "datepicker",
21
- props: {
22
- modelValue: {},
23
- type: {}
24
- },
25
- emits: ["update:modelValue", "change"],
26
- setup(__props, { emit: __emit }) {
27
- const Pop = defineAsyncComponent(() => import("../popover/popover.js"));
28
- const props = __props;
29
- const placeholder = computed(() => {
30
- if (props.type === "week") {
31
- return "请选择周";
32
- } else if (props.type === "month") {
33
- return "请选择月份";
34
- } else if (props.type === "quarter") {
35
- return "请选择季度";
36
- } else if (props.type === "year") {
37
- return "请选择年份";
38
- } else {
39
- return "请选择日期";
40
- }
41
- });
42
- const emit = __emit;
43
- const dateChangeHandle = (e) => {
44
- let target = e.target;
45
- let year = new Date(target.value).getFullYear();
46
- let month = new Date(target.value).getMonth() + 1;
47
- let day = new Date(target.value).getDate();
48
- emit("update:modelValue", `${year}-${addZero(month)}-${addZero(day)}`);
49
- };
50
- const showD = ref(false);
51
- const showDatePick = () => {
52
- if (props.modelValue != null && props.modelValue != "") {
53
- if (typeof props.modelValue === "string") {
54
- const [y, m] = props.modelValue.split("-").map((i) => parseInt(i));
55
- Year.value = y;
56
- Month.value = m;
57
- } else if (props.modelValue instanceof Date) {
58
- Year.value = new Date(props.modelValue).getFullYear();
59
- Month.value = new Date(props.modelValue).getMonth() + 1;
60
- }
61
- }
62
- FullTableMonth(Year.value, Month.value);
63
- showD.value = true;
64
- };
65
- const hideDatePick = () => {
66
- showD.value = false;
67
- };
68
- const WeekList = ["一", "二", "三", "四", "五", "六", "日"];
69
- const MonthList = [
70
- ["1月", "2月", "3月"],
71
- ["4月", "5月", "6月"],
72
- ["7月", "8月", "9月"],
73
- ["10月", "11月", "12月"]
74
- ];
75
- const dayMode = ref(true);
76
- const monthMode = ref(false);
77
- const MonthPreHandle = () => {
78
- MonthChangeHandle(-1);
79
- };
80
- const MonthNextHandle = () => {
81
- MonthChangeHandle(1);
82
- };
83
- const MonthChangeHandle = (i) => {
84
- let year = Year.value;
85
- let month = Month.value;
86
- Month.value = new Date(year, month - 1 + i).getMonth() + 1;
87
- Year.value = new Date(year, month - 1 + i).getFullYear();
88
- FullTableMonth(Year.value, Month.value);
89
- };
90
- const YearPreHandle = () => {
91
- YearChangeHandle(-1);
92
- };
93
- const YearNextHandle = () => {
94
- YearChangeHandle(1);
95
- };
96
- const YearChangeHandle = (i) => {
97
- Year.value += i;
98
- FullTableMonth(Year.value, Month.value);
99
- };
100
- const setMonthMode = () => {
101
- dayMode.value = false;
102
- monthMode.value = true;
103
- };
104
- const getMonthHandle = (i) => {
105
- Month.value = parseInt(i);
106
- monthMode.value = false;
107
- dayMode.value = true;
108
- FullTableMonth(Year.value, Month.value);
109
- };
110
- const Year = ref((/* @__PURE__ */ new Date()).getFullYear());
111
- const Month = ref(1 + (/* @__PURE__ */ new Date()).getMonth());
112
- const thisMonth = ref([]);
113
- const isChoosedDay = (date) => {
114
- const [y, m, d] = props.modelValue.split("-").map((i) => parseInt(i));
115
- if (y === date.y && m === date.m && d === date.d) {
116
- return true;
117
- } else {
118
- return false;
119
- }
120
- };
121
- const FullTableMonth = (year, month) => {
122
- let preM = [];
123
- let thisM = [];
124
- let nextM = [];
125
- preM = getMonthDays(
126
- new Date(year, month - 2).getFullYear(),
127
- new Date(year, month - 2).getMonth() + 1,
128
- 1
129
- );
130
- thisM = getMonthDays(
131
- new Date(year, month - 1).getFullYear(),
132
- new Date(year, month - 1).getMonth() + 1
133
- );
134
- nextM = getMonthDays(new Date(year, month).getFullYear(), new Date(year, month).getMonth() + 1, 2);
135
- preM.map((i) => {
136
- if (isChoosedDay(i) === true) {
137
- i.isChoosed = true;
138
- } else {
139
- i.isChoosed = false;
140
- }
141
- });
142
- thisM.map((i) => {
143
- if (isChoosedDay(i) === true) {
144
- i.isChoosed = true;
145
- } else {
146
- i.isChoosed = false;
147
- }
148
- });
149
- nextM.map((i) => {
150
- if (isChoosedDay(i) === true) {
151
- i.isChoosed = true;
152
- } else {
153
- i.isChoosed = false;
154
- }
155
- });
156
- let start = WeekList.indexOf(thisM[0].week);
157
- let end = WeekList.length - (WeekList.indexOf(thisM[thisM.length - 1].week) + 1);
158
- let tempArr = [...preM.splice(preM.length - start, start), ...thisM, ...nextM.splice(0, end)];
159
- if (tempArr.length === 28) {
160
- tempArr = [...tempArr, ...nextM.splice(0, 14)];
161
- } else if (tempArr.length === 35) {
162
- tempArr = [...tempArr, ...nextM.splice(0, 7)];
163
- }
164
- thisMonth.value = [...tempArr];
165
- };
166
- const RenderDaydata = computed(() => getNewArray(thisMonth.value, 7));
167
- const setAimdate = (d) => {
168
- if (Year.value !== d.y || Month.value !== d.m) {
169
- Year.value = d.y;
170
- Month.value = d.m;
171
- FullTableMonth(Year.value, Month.value);
172
- }
173
- let choosetime = `${Year.value}-${addZero(Month.value)}-${addZero(d.d)}`;
174
- emit("update:modelValue", choosetime);
175
- hideDatePick();
176
- };
177
- return (_ctx, _cache) => {
178
- return openBlock(), createBlock(unref(Pop), {
179
- width: "288",
180
- insertClass: "tdd-z-2000 !tdd-p-0",
181
- trigger: "native",
182
- modelValue: showD.value,
183
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => showD.value = $event),
184
- placement: "bottomleft"
185
- }, {
186
- reference: withCtx(() => [
187
- createElementVNode("div", _hoisted_8, [
188
- createElementVNode("input", {
189
- type: "text",
190
- value: _ctx.modelValue,
191
- class: "tdd-w-full tdd-p-2 tdd-outline-none",
192
- placeholder: placeholder.value,
193
- onFocus: showDatePick,
194
- onChange: dateChangeHandle
195
- }, null, 40, _hoisted_9)
196
- ])
197
- ]),
198
- default: withCtx(() => [
199
- createElementVNode("div", _hoisted_1, [
200
- createElementVNode("button", {
201
- type: "button",
202
- class: "tdd-h-4 tdd-w-4 tdd-appearance-none",
203
- onClick: YearPreHandle
204
- }, _cache[1] || (_cache[1] = [
205
- createElementVNode("svg", {
206
- class: "tdd-h-4 tdd-w-4",
207
- viewBox: "0 0 1024 1024",
208
- version: "1.1",
209
- xmlns: "http://www.w3.org/2000/svg",
210
- "p-id": "669"
211
- }, [
212
- createElementVNode("path", {
213
- d: "M842.666667 864c-8.533333 0-14.933333-2.133333-21.333334-8.533333l-341.333333-309.333334c-6.4-6.4-10.666667-14.933333-10.666667-23.466666 0-8.533333 4.266667-17.066667 10.666667-23.466667l341.333333-309.333333c12.8-12.8 34.133333-10.666667 44.8 2.133333 12.8 12.8 10.666667 34.133333-2.133333 44.8L548.266667 522.666667l315.733333 285.866666c12.8 10.666667 14.933333 32 2.133333 44.8-6.4 6.4-14.933333 10.666667-23.466666 10.666667z",
214
- fill: "#666666",
215
- "p-id": "670"
216
- }),
217
- createElementVNode("path", {
218
- d: "M512 864c-8.533333 0-14.933333-2.133333-21.333333-8.533333L149.333333 546.133333c-6.4-6.4-10.666667-14.933333-10.666666-23.466666 0-8.533333 4.266667-17.066667 10.666666-23.466667L490.666667 189.866667c12.8-12.8 34.133333-10.666667 44.8 2.133333 12.8 12.8 10.666667 34.133333-2.133334 44.8L217.6 522.666667 533.333333 808.533333c12.8 12.8 14.933333 32 2.133334 44.8-6.4 6.4-14.933333 10.666667-23.466667 10.666667z",
219
- fill: "#666666",
220
- "p-id": "671"
221
- })
222
- ], -1)
223
- ])),
224
- dayMode.value ? (openBlock(), createElementBlock("button", {
225
- key: 0,
226
- type: "button",
227
- class: "tdd-ml-1 tdd-h-4 tdd-w-4 tdd-appearance-none",
228
- onClick: MonthPreHandle
229
- }, _cache[2] || (_cache[2] = [
230
- createElementVNode("svg", {
231
- class: "tdd-h-4 tdd-w-4 tdd-rotate-180 tdd-transform",
232
- viewBox: "0 0 1024 1024",
233
- version: "1.1",
234
- xmlns: "http://www.w3.org/2000/svg",
235
- "p-id": "613"
236
- }, [
237
- createElementVNode("path", {
238
- d: "M320 885.333333c-8.533333 0-17.066667-4.266667-23.466667-10.666666-12.8-12.8-10.666667-34.133333 2.133334-44.8L654.933333 512 298.666667 194.133333c-12.8-10.666667-14.933333-32-2.133334-44.8 10.666667-12.8 32-14.933333 44.8-2.133333l384 341.333333c6.4 6.4 10.666667 14.933333 10.666667 23.466667 0 8.533333-4.266667 17.066667-10.666667 23.466667l-384 341.333333c-6.4 6.4-12.8 8.533333-21.333333 8.533333z",
239
- fill: "#666666",
240
- "p-id": "614"
241
- })
242
- ], -1)
243
- ]))) : createCommentVNode("", true),
244
- createElementVNode("div", _hoisted_2, [
245
- createElementVNode("span", null, toDisplayString(Year.value) + "年", 1),
246
- withDirectives(createElementVNode("button", {
247
- type: "button",
248
- class: "tdd-w-10 tdd-appearance-none",
249
- onClick: setMonthMode
250
- }, toDisplayString(Month.value) + "月 ", 513), [
251
- [vShow, dayMode.value && !monthMode.value]
252
- ])
253
- ]),
254
- dayMode.value ? (openBlock(), createElementBlock("button", {
255
- key: 1,
256
- type: "button",
257
- class: "tdd-h-4 tdd-w-4 tdd-appearance-none",
258
- onClick: MonthNextHandle
259
- }, _cache[3] || (_cache[3] = [
260
- createElementVNode("svg", {
261
- class: "tdd-h-4 tdd-w-4",
262
- viewBox: "0 0 1024 1024",
263
- version: "1.1",
264
- xmlns: "http://www.w3.org/2000/svg",
265
- "p-id": "613"
266
- }, [
267
- createElementVNode("path", {
268
- d: "M320 885.333333c-8.533333 0-17.066667-4.266667-23.466667-10.666666-12.8-12.8-10.666667-34.133333 2.133334-44.8L654.933333 512 298.666667 194.133333c-12.8-10.666667-14.933333-32-2.133334-44.8 10.666667-12.8 32-14.933333 44.8-2.133333l384 341.333333c6.4 6.4 10.666667 14.933333 10.666667 23.466667 0 8.533333-4.266667 17.066667-10.666667 23.466667l-384 341.333333c-6.4 6.4-12.8 8.533333-21.333333 8.533333z",
269
- fill: "#666666",
270
- "p-id": "614"
271
- })
272
- ], -1)
273
- ]))) : createCommentVNode("", true),
274
- createElementVNode("button", {
275
- type: "button",
276
- class: "tdd-h-4 tdd-w-4 tdd-appearance-none",
277
- onClick: YearNextHandle
278
- }, _cache[4] || (_cache[4] = [
279
- createElementVNode("svg", {
280
- class: "tdd-h-4 tdd-w-4",
281
- viewBox: "0 0 1024 1024",
282
- version: "1.1",
283
- xmlns: "http://www.w3.org/2000/svg",
284
- "p-id": "693"
285
- }, [
286
- createElementVNode("path", {
287
- d: "M544 522.666667c0-8.533333-4.266667-17.066667-10.666667-23.466667L192 189.866667c-12.8-12.8-34.133333-10.666667-44.8 2.133333-12.8 12.8-10.666667 34.133333 2.133333 44.8l315.733334 285.866667L149.333333 808.533333c-12.8 12.8-14.933333 32-2.133333 44.8 6.4 6.4 14.933333 10.666667 23.466667 10.666667 8.533333 0 14.933333-2.133333 21.333333-8.533333l341.333333-309.333334c6.4-6.4 10.666667-14.933333 10.666667-23.466666z",
288
- fill: "#666666",
289
- "p-id": "694"
290
- }),
291
- createElementVNode("path", {
292
- d: "M864 499.2l-341.333333-309.333333c-12.8-12.8-34.133333-10.666667-44.8 2.133333-12.8 12.8-10.666667 34.133333 2.133333 44.8l315.733333 285.866667-315.733333 285.866666c-12.8 12.8-14.933333 32-2.133333 44.8 6.4 6.4 14.933333 10.666667 23.466666 10.666667 8.533333 0 14.933333-2.133333 21.333334-8.533333l341.333333-309.333334c6.4-6.4 10.666667-14.933333 10.666667-23.466666 0-8.533333-4.266667-17.066667-10.666667-23.466667z",
293
- fill: "#666666",
294
- "p-id": "695"
295
- })
296
- ], -1)
297
- ]))
298
- ]),
299
- createElementVNode("div", _hoisted_3, [
300
- createVNode(TransitionGroup, { name: "translate" }, {
301
- default: withCtx(() => [
302
- dayMode.value ? (openBlock(), createElementBlock("table", _hoisted_4, [
303
- createElementVNode("thead", null, [
304
- createElementVNode("tr", null, [
305
- (openBlock(), createElementBlock(Fragment, null, renderList(WeekList, (i) => {
306
- return createElementVNode("th", {
307
- class: "tdd-text-sm tdd-font-normal",
308
- key: i
309
- }, toDisplayString(i), 1);
310
- }), 64))
311
- ])
312
- ]),
313
- createElementVNode("tbody", null, [
314
- (openBlock(true), createElementBlock(Fragment, null, renderList(RenderDaydata.value, (i, d) => {
315
- return openBlock(), createElementBlock("tr", { key: d }, [
316
- (openBlock(true), createElementBlock(Fragment, null, renderList(i, (j) => {
317
- return openBlock(), createElementBlock("td", {
318
- key: j.d,
319
- class: "tdd-py-1.5 tdd-relative tdd-overflow-hidden"
320
- }, [
321
- createElementVNode("div", {
322
- class: normalizeClass(["tdd-text-sm tdd-w-6 tdd-h-6 tdd-leading-6 tdd-inline-block tdd-z-10 tdd-relative", {
323
- "tdd-text-word9": j.pred || j.nextd,
324
- "tdd-bg-blue-500 tdd-text-white": j.isChoosed,
325
- "hover:tdd-bg-gray-200": !j.isChoosed
326
- }]),
327
- onClick: ($event) => setAimdate(j)
328
- }, toDisplayString(j.d), 11, _hoisted_5)
329
- ]);
330
- }), 128))
331
- ]);
332
- }), 128))
333
- ])
334
- ])) : createCommentVNode("", true),
335
- monthMode.value ? (openBlock(), createElementBlock("table", _hoisted_6, [
336
- createElementVNode("tbody", null, [
337
- (openBlock(), createElementBlock(Fragment, null, renderList(MonthList, (i, d) => {
338
- return createElementVNode("tr", { key: d }, [
339
- (openBlock(true), createElementBlock(Fragment, null, renderList(i, (j) => {
340
- return openBlock(), createElementBlock("td", {
341
- key: j,
342
- class: "tdd-py-1.5"
343
- }, [
344
- createElementVNode("div", {
345
- class: "tdd-cursor-pointer tdd-text-word3 tdd-text-sm tdd-w-6 tdd-h-6 tdd-leading-6 hover:tdd-bg-gray-200 tdd-inline-block",
346
- onClick: ($event) => getMonthHandle(j)
347
- }, toDisplayString(j), 9, _hoisted_7)
348
- ]);
349
- }), 128))
350
- ]);
351
- }), 64))
352
- ])
353
- ])) : createCommentVNode("", true)
354
- ]),
355
- _: 1
356
- })
357
- ])
358
- ]),
359
- _: 1
360
- }, 8, ["modelValue"]);
361
- };
362
- }
363
- });
364
- export {
365
- _sfc_main as default
366
- };