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,90 +0,0 @@
1
- import { defineComponent, computed, inject, openBlock, createElementBlock, renderSlot, withDirectives, createElementVNode, vModelDynamic, vShow } from "vue";
2
- const _hoisted_1 = { class: "tdd-relative tdd-flex tdd-h-full tdd-w-full tdd-items-center tdd-overflow-hidden tdd-rounded tdd-border tdd-border-solid" };
3
- const _hoisted_2 = ["placeholder", "type"];
4
- const _sfc_main = /* @__PURE__ */ defineComponent({
5
- __name: "input",
6
- props: {
7
- modelValue: { default: null },
8
- modelModifiers: {},
9
- type: { default: "text" },
10
- placeHolder: {},
11
- clearable: { type: Boolean, default: false }
12
- },
13
- emits: ["update:modelValue", "blur", "input", "change"],
14
- setup(__props, { emit: __emit }) {
15
- const prop = __props;
16
- const inputValue = computed({
17
- get() {
18
- return prop.modelValue;
19
- },
20
- set(value) {
21
- var _a;
22
- if ((_a = prop == null ? void 0 : prop.modelModifiers) == null ? void 0 : _a.number) {
23
- updateValue("update:modelValue", isNaN(Number(value)) ? prop.modelValue : Number(value));
24
- } else {
25
- updateValue("update:modelValue", value);
26
- }
27
- }
28
- });
29
- const updateValue = __emit;
30
- const ParentGetInputHandle = inject("inputHandle", () => null);
31
- const ParentGetBlurHandle = inject("blurHandle", () => null);
32
- const clearHandle = () => {
33
- updateValue("update:modelValue", null);
34
- };
35
- const showcloseico = computed(() => {
36
- return prop.clearable && prop.modelValue;
37
- });
38
- const defaultEvent = async ({ target, type }) => {
39
- var _a;
40
- if ((_a = prop == null ? void 0 : prop.modelModifiers) == null ? void 0 : _a.number) {
41
- if (type == "blur") {
42
- ParentGetBlurHandle(isNaN(Number(target.value)) ? prop.modelValue : Number(target.value));
43
- } else {
44
- ParentGetInputHandle(isNaN(Number(target.value)) ? prop.modelValue : Number(target.value));
45
- }
46
- } else {
47
- if (type == "blur") {
48
- ParentGetBlurHandle(target.value);
49
- } else {
50
- ParentGetInputHandle(target.value);
51
- }
52
- }
53
- };
54
- return (_ctx, _cache) => {
55
- return openBlock(), createElementBlock("div", _hoisted_1, [
56
- renderSlot(_ctx.$slots, "prepend"),
57
- withDirectives(createElementVNode("input", {
58
- class: "tdd-h-full tdd-w-full tdd-p-2 tdd-outline-none",
59
- placeholder: _ctx.placeHolder,
60
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
61
- type: _ctx.type,
62
- onBlur: defaultEvent,
63
- onInput: defaultEvent,
64
- onChange: defaultEvent
65
- }, null, 40, _hoisted_2), [
66
- [vModelDynamic, inputValue.value]
67
- ]),
68
- withDirectives((openBlock(), createElementBlock("svg", {
69
- onClick: clearHandle,
70
- viewBox: "64 64 896 896",
71
- class: "tdd-mr-2 tdd-cursor-pointer",
72
- focusable: "false",
73
- "data-icon": "close",
74
- width: "1em",
75
- height: "1em",
76
- fill: "currentColor",
77
- "aria-hidden": "true"
78
- }, _cache[1] || (_cache[1] = [
79
- createElementVNode("path", { d: "M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z" }, null, -1)
80
- ]), 512)), [
81
- [vShow, showcloseico.value]
82
- ]),
83
- renderSlot(_ctx.$slots, "append")
84
- ]);
85
- };
86
- }
87
- });
88
- export {
89
- _sfc_main as default
90
- };
@@ -1,59 +0,0 @@
1
- import { defineComponent, ref, watch, openBlock, createElementBlock, createElementVNode, Fragment, renderList, withDirectives, vModelRadio, normalizeClass, toDisplayString, normalizeStyle } from "vue";
2
- const _hoisted_1 = ["value"];
3
- const _hoisted_2 = { class: "tdd-w-full tdd-border-t-2 tdd-border-gray-200 tdd-border-solid tdd-mt-2 tdd-relative" };
4
- const _sfc_main = /* @__PURE__ */ defineComponent({
5
- __name: "menu",
6
- props: {
7
- menulist: {}
8
- },
9
- emits: ["updatemenu"],
10
- setup(__props, { emit: __emit }) {
11
- const bigIndex = ref(-1);
12
- const arrowNum = ref(0);
13
- const emit = __emit;
14
- const baseclass = ref();
15
- watch(bigIndex, (n) => {
16
- var _a;
17
- let dom = (_a = baseclass.value) == null ? void 0 : _a.children[n];
18
- if (dom) {
19
- arrowNum.value = dom.offsetLeft - baseclass.value.offsetLeft;
20
- }
21
- emit("updatemenu", n);
22
- });
23
- return (_ctx, _cache) => {
24
- return openBlock(), createElementBlock("div", null, [
25
- createElementVNode("div", {
26
- class: "tdd-w-full tdd-flex tdd-text-word6",
27
- ref_key: "baseclass",
28
- ref: baseclass
29
- }, [
30
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.menulist, (item, i) => {
31
- return openBlock(), createElementBlock("label", { key: item }, [
32
- withDirectives(createElementVNode("input", {
33
- class: "tdd-hidden",
34
- name: "classone",
35
- type: "radio",
36
- value: i,
37
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => bigIndex.value = $event)
38
- }, null, 8, _hoisted_1), [
39
- [vModelRadio, bigIndex.value]
40
- ]),
41
- createElementVNode("span", {
42
- class: normalizeClass(["hover:tdd-text-blue-brand tdd-text-sm tdd-mr-4 tdd-cursor-pointer tdd-inline-block tdd-w-14 tdd-text-center", { "tdd-text-blue-brand": bigIndex.value == i }])
43
- }, toDisplayString(item), 3)
44
- ]);
45
- }), 128))
46
- ], 512),
47
- createElementVNode("div", _hoisted_2, [
48
- createElementVNode("div", {
49
- class: "tdd-absolute tdd-w-14 tdd-border-t-2 tdd-border-solid tdd-border-blue-brand tdd-bottom-0 tdd-transition",
50
- style: normalizeStyle({ transform: `translateX(${arrowNum.value}px` })
51
- }, null, 4)
52
- ])
53
- ]);
54
- };
55
- }
56
- });
57
- export {
58
- _sfc_main as default
59
- };
@@ -1,127 +0,0 @@
1
- import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, normalizeClass, withDirectives, vModelText } from "vue";
2
- const _hoisted_1 = { class: "tdd-inline-flex tdd-w-full tdd-rounded-sm tdd-border tdd-border-gray-400 focus-within:tdd-border-blue-300" };
3
- const _hoisted_2 = ["disabled"];
4
- const _hoisted_3 = ["disabled"];
5
- const _sfc_main = /* @__PURE__ */ defineComponent({
6
- __name: "numberinput",
7
- props: {
8
- modelValue: {},
9
- size: { default: "normal" },
10
- min: {},
11
- max: {},
12
- strict: { type: Boolean, default: false },
13
- step: { default: 1 },
14
- integer: { type: Boolean, default: false }
15
- },
16
- emits: ["update:modelValue", "NumChange"],
17
- setup(__props, { emit: __emit }) {
18
- const props = __props;
19
- function updateModelValueAndEmit(value) {
20
- const formattedValue = value.toFixed(lastLen.value);
21
- emitAct("update:modelValue", Number(formattedValue));
22
- emitAct("NumChange", Number(formattedValue));
23
- }
24
- const emitAct = __emit;
25
- const lastLen = computed(() => {
26
- var _a;
27
- return (_a = props.step.toString().split(".")[1]) == null ? void 0 : _a.length;
28
- });
29
- const addHandle = () => {
30
- let result = props.modelValue + props.step;
31
- updateModelValueAndEmit(result);
32
- };
33
- const reduceHandle = () => {
34
- let result = props.modelValue - props.step;
35
- updateModelValueAndEmit(result);
36
- };
37
- const inputValue = computed({
38
- get() {
39
- return props.modelValue;
40
- },
41
- set(value) {
42
- if (isNaN(Number(value))) {
43
- emitAct("update:modelValue", Number(props.modelValue));
44
- } else if (props.integer && /[.]/.test(value.toString())) {
45
- emitAct("update:modelValue", Number(props.modelValue));
46
- } else {
47
- emitAct("update:modelValue", Number(value));
48
- emitAct("NumChange", Number(value));
49
- }
50
- }
51
- });
52
- const reduceDisable = computed(() => {
53
- if (props.min !== void 0) {
54
- if (Number(props.modelValue) <= props.min) {
55
- return true;
56
- } else {
57
- return false;
58
- }
59
- } else {
60
- return false;
61
- }
62
- });
63
- const addDisable = computed(() => {
64
- if (props.max !== void 0) {
65
- if (Number(props.modelValue) >= props.max) {
66
- return true;
67
- } else {
68
- return false;
69
- }
70
- } else {
71
- return false;
72
- }
73
- });
74
- return (_ctx, _cache) => {
75
- return openBlock(), createElementBlock("div", _hoisted_1, [
76
- createElementVNode("button", {
77
- type: "button",
78
- disabled: reduceDisable.value,
79
- onClick: reduceHandle,
80
- class: normalizeClass(["tdd-flex-none tdd-bg-gray-200 tdd-text-xs", {
81
- "tdd-h-8 tdd-w-8": _ctx.size == "normal",
82
- "tdd-h-6 tdd-w-6": _ctx.size != "normal",
83
- "tdd-cursor-not-allowed": reduceDisable.value
84
- }])
85
- }, _cache[1] || (_cache[1] = [
86
- createElementVNode("svg", {
87
- class: "tdd-h-4 tdd-w-4 tdd-fill-word6 tdd-inline-block",
88
- viewBox: "0 0 1024 1024",
89
- version: "1.1",
90
- xmlns: "http://www.w3.org/2000/svg"
91
- }, [
92
- createElementVNode("path", { d: "M853.333333 544H170.666667c-17.066667 0-32-14.933333-32-32s14.933333-32 32-32h682.666666c17.066667 0 32 14.933333 32 32s-14.933333 32-32 32z" })
93
- ], -1)
94
- ]), 10, _hoisted_2),
95
- withDirectives(createElementVNode("input", {
96
- class: "tdd-w-full tdd-px-1 tdd-text-center tdd-outline-none",
97
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
98
- type: "text"
99
- }, null, 512), [
100
- [vModelText, inputValue.value]
101
- ]),
102
- createElementVNode("button", {
103
- type: "button",
104
- disabled: addDisable.value,
105
- onClick: addHandle,
106
- class: normalizeClass(["tdd-flex-none tdd-bg-gray-200 tdd-text-xs", {
107
- "tdd-h-8 tdd-w-8": _ctx.size == "normal",
108
- "tdd-h-6 tdd-w-6": _ctx.size != "normal",
109
- "tdd-cursor-not-allowed": addDisable.value
110
- }])
111
- }, _cache[2] || (_cache[2] = [
112
- createElementVNode("svg", {
113
- class: "tdd-h-4 tdd-w-4 tdd-fill-word6 tdd-inline-block",
114
- viewBox: "0 0 1024 1024",
115
- version: "1.1",
116
- xmlns: "http://www.w3.org/2000/svg"
117
- }, [
118
- createElementVNode("path", { d: "M853.333333 480H544V170.666667c0-17.066667-14.933333-32-32-32s-32 14.933333-32 32v309.333333H170.666667c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h309.333333V853.333333c0 17.066667 14.933333 32 32 32s32-14.933333 32-32V544H853.333333c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32z" })
119
- ], -1)
120
- ]), 10, _hoisted_3)
121
- ]);
122
- };
123
- }
124
- });
125
- export {
126
- _sfc_main as default
127
- };
@@ -1,234 +0,0 @@
1
- import { defineComponent, computed, ref, watch, resolveComponent, withDirectives, openBlock, createElementBlock, createVNode, withCtx, Fragment, renderList, createBlock, createCommentVNode, createElementVNode, normalizeClass, toDisplayString, vShow } from "vue";
2
- const _hoisted_1 = { class: "tdd-flex tdd-items-center tdd-w-full tdd-h-7 tdd-text-sm tdd-text-center" };
3
- const _hoisted_2 = {
4
- key: 0,
5
- class: "tdd-w-24 tdd-flex-none tdd-px-1"
6
- };
7
- const _hoisted_3 = ["disabled"];
8
- const _hoisted_4 = { class: "tdd-flex tdd-items-center" };
9
- const _hoisted_5 = {
10
- key: 0,
11
- class: "tdd-fill-word6 tdd-w-4 tdd-h-4 tdd-block",
12
- style: { "width": "1em", "height": "1em", "vertical-align": "middle", "fill": "currentColor", "overflow": "hidden" },
13
- viewBox: "0 0 1024 1024",
14
- version: "1.1",
15
- xmlns: "http://www.w3.org/2000/svg"
16
- };
17
- const _hoisted_6 = ["onClick"];
18
- const _hoisted_7 = {
19
- key: 1,
20
- class: "tdd-fill-word6 tdd-w-4 tdd-h-4 tdd-block",
21
- style: { "width": "1em", "height": "1em", "vertical-align": "middle", "fill": "currentColor", "overflow": "hidden" },
22
- viewBox: "0 0 1024 1024",
23
- version: "1.1",
24
- xmlns: "http://www.w3.org/2000/svg"
25
- };
26
- const _hoisted_8 = ["disabled"];
27
- const _sfc_main = /* @__PURE__ */ defineComponent({
28
- __name: "pagination",
29
- props: {
30
- sizeArr: {},
31
- total: {},
32
- hideOnSinglePage: { type: Boolean, default: false }
33
- },
34
- emits: ["size-change", "current-change"],
35
- setup(__props, { emit: __emit }) {
36
- const props = __props;
37
- const showSizeArr = computed(() => {
38
- var _a;
39
- return props.sizeArr && ((_a = props.sizeArr) == null ? void 0 : _a.length) > 0;
40
- });
41
- const emit = __emit;
42
- const size = ref(20);
43
- if (props.sizeArr && props.sizeArr.length > 0) {
44
- size.value = props.sizeArr[0];
45
- }
46
- const maxNumber = computed(() => {
47
- return Math.ceil(props.total / size.value);
48
- });
49
- const numberArr = computed(() => {
50
- let arr = [];
51
- for (let i = 2; i < maxNumber.value; i++) {
52
- arr.push(i);
53
- }
54
- return arr;
55
- });
56
- const showComponent = computed(() => {
57
- if (props.hideOnSinglePage === true) {
58
- return maxNumber.value > 1;
59
- } else {
60
- return true;
61
- }
62
- });
63
- const activeIndex = ref(1);
64
- const firstBtnDisable = computed(() => {
65
- return activeIndex.value === 1;
66
- });
67
- const lastBtnDisable = computed(() => {
68
- return activeIndex.value >= maxNumber.value;
69
- });
70
- const showFirst = computed(() => {
71
- return activeIndex.value - 5 > 0 && maxNumber.value > 7;
72
- });
73
- const showLast = computed(() => {
74
- return maxNumber.value - activeIndex.value > 4 && maxNumber.value > 7;
75
- });
76
- const addNum = () => {
77
- activeIndex.value += 1;
78
- };
79
- const redNum = () => {
80
- activeIndex.value -= 1;
81
- };
82
- const indexHandle = (k) => {
83
- activeIndex.value = k;
84
- };
85
- watch(activeIndex, (pagenum) => {
86
- emit("current-change", pagenum);
87
- });
88
- watch(size, (sizenum) => {
89
- emit("size-change", sizenum);
90
- });
91
- const hiddenHandle = (i) => {
92
- if (activeIndex.value <= 3) {
93
- if (i <= 7) {
94
- return true;
95
- } else {
96
- return false;
97
- }
98
- } else if (maxNumber.value - activeIndex.value <= 3) {
99
- if (i >= maxNumber.value - 7) {
100
- return true;
101
- } else {
102
- return false;
103
- }
104
- } else if (activeIndex.value > i && activeIndex.value - 3 <= i) {
105
- return true;
106
- } else if (activeIndex.value < i && activeIndex.value + 3 >= i) {
107
- return true;
108
- } else if (activeIndex.value === i) {
109
- return true;
110
- } else {
111
- return false;
112
- }
113
- };
114
- return (_ctx, _cache) => {
115
- const _component_LibSelectOption = resolveComponent("LibSelectOption");
116
- const _component_LibSelect = resolveComponent("LibSelect");
117
- return withDirectives((openBlock(), createElementBlock("div", _hoisted_1, [
118
- showSizeArr.value ? (openBlock(), createElementBlock("div", _hoisted_2, [
119
- createVNode(_component_LibSelect, {
120
- modelValue: size.value,
121
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => size.value = $event)
122
- }, {
123
- default: withCtx(() => [
124
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.sizeArr, (i) => {
125
- return openBlock(), createBlock(_component_LibSelectOption, {
126
- value: i,
127
- label: `${i}条/页`
128
- }, null, 8, ["value", "label"]);
129
- }), 256))
130
- ]),
131
- _: 1
132
- }, 8, ["modelValue"])
133
- ])) : createCommentVNode("", true),
134
- createElementVNode("button", {
135
- onClick: redNum,
136
- type: "button",
137
- class: normalizeClass(["w-5 h-5", { "tdd-cursor-not-allowed": firstBtnDisable.value }]),
138
- disabled: firstBtnDisable.value
139
- }, _cache[3] || (_cache[3] = [
140
- createElementVNode("svg", {
141
- class: "tdd-w-4 tdd-h-4 tdd-block tdd-fill-word6",
142
- viewBox: "0 0 1024 1024",
143
- version: "1.1",
144
- xmlns: "http://www.w3.org/2000/svg"
145
- }, [
146
- createElementVNode("path", {
147
- 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",
148
- fill: "currentColor"
149
- }),
150
- createElementVNode("path", {
151
- 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",
152
- fill: "currentColor"
153
- })
154
- ], -1)
155
- ]), 10, _hoisted_3),
156
- createElementVNode("ul", _hoisted_4, [
157
- createElementVNode("li", {
158
- onClick: _cache[1] || (_cache[1] = ($event) => indexHandle(1)),
159
- class: normalizeClass(["tdd-px-2 tdd-h-5 tdd-leading-5 tdd-cursor-pointer tdd-font-bold", { "tdd-text-blue-500": 1 === activeIndex.value }])
160
- }, " 1 ", 2),
161
- showFirst.value ? (openBlock(), createElementBlock("svg", _hoisted_5, _cache[4] || (_cache[4] = [
162
- createElementVNode("path", {
163
- d: "M192 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z",
164
- fill: "currentColor"
165
- }, null, -1),
166
- createElementVNode("path", {
167
- d: "M512 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z",
168
- fill: "currentColor"
169
- }, null, -1),
170
- createElementVNode("path", {
171
- d: "M832 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z",
172
- fill: "currentColor"
173
- }, null, -1)
174
- ]))) : createCommentVNode("", true),
175
- (openBlock(true), createElementBlock(Fragment, null, renderList(numberArr.value, (i) => {
176
- return withDirectives((openBlock(), createElementBlock("li", {
177
- onClick: ($event) => indexHandle(i),
178
- class: normalizeClass([{ "tdd-text-blue-500": i === activeIndex.value }, "tdd-px-2 tdd-h-5 tdd-leading-5 tdd-cursor-pointer tdd-font-bold"]),
179
- key: i
180
- }, toDisplayString(i), 11, _hoisted_6)), [
181
- [vShow, hiddenHandle(i)]
182
- ]);
183
- }), 128)),
184
- showLast.value ? (openBlock(), createElementBlock("svg", _hoisted_7, _cache[5] || (_cache[5] = [
185
- createElementVNode("path", {
186
- d: "M192 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z",
187
- fill: "currentColor"
188
- }, null, -1),
189
- createElementVNode("path", {
190
- d: "M512 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z",
191
- fill: "currentColor"
192
- }, null, -1),
193
- createElementVNode("path", {
194
- d: "M832 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z",
195
- fill: "currentColor"
196
- }, null, -1)
197
- ]))) : createCommentVNode("", true),
198
- maxNumber.value > 1 ? (openBlock(), createElementBlock("li", {
199
- key: 2,
200
- onClick: _cache[2] || (_cache[2] = ($event) => indexHandle(maxNumber.value)),
201
- class: normalizeClass(["tdd-px-2 tdd-h-5 tdd-leading-5 tdd-cursor-pointer tdd-font-bold", { "tdd-text-blue-500": maxNumber.value === activeIndex.value }])
202
- }, toDisplayString(maxNumber.value), 3)) : createCommentVNode("", true)
203
- ]),
204
- createElementVNode("button", {
205
- onClick: addNum,
206
- type: "button",
207
- class: normalizeClass(["tdd-w-5 tdd-h-5", { "tdd-cursor-not-allowed": lastBtnDisable.value }]),
208
- disabled: lastBtnDisable.value
209
- }, _cache[6] || (_cache[6] = [
210
- createElementVNode("svg", {
211
- class: "tdd-w-4 tdd-h-4 tdd-block tdd-fill-word6",
212
- viewBox: "0 0 1024 1024",
213
- version: "1.1",
214
- xmlns: "http://www.w3.org/2000/svg"
215
- }, [
216
- createElementVNode("path", {
217
- 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",
218
- fill: "currentColor"
219
- }),
220
- createElementVNode("path", {
221
- 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",
222
- fill: "currentColor"
223
- })
224
- ], -1)
225
- ]), 10, _hoisted_8)
226
- ], 512)), [
227
- [vShow, showComponent.value]
228
- ]);
229
- };
230
- }
231
- });
232
- export {
233
- _sfc_main as default
234
- };