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