ninemoon-ui 0.0.27 → 0.1.1

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 (109) hide show
  1. package/dist/components/alert/alert.d.ts +3 -11
  2. package/dist/components/alert/alertcomponent.vue.d.ts +22 -11
  3. package/dist/components/badge/badge.vue.d.ts +2 -0
  4. package/dist/components/carousel/carousel.vue.d.ts +29 -3
  5. package/dist/components/{tree/tree.vue.d.ts → carousel/clickbutton.vue.d.ts} +6 -19
  6. package/dist/components/check/checkbox.vue.d.ts +24 -16
  7. package/dist/components/check/checkgroup.vue.d.ts +15 -3
  8. package/dist/components/date/datepicker.vue.d.ts +28 -6
  9. package/dist/components/date/datepickerRange.vue.d.ts +15 -4
  10. package/dist/components/form/form.vue.d.ts +7 -20
  11. package/dist/components/form/formlabel.vue.d.ts +3 -3
  12. package/dist/components/form/type.d.ts +11 -0
  13. package/dist/components/icon/add.vue.d.ts +2 -0
  14. package/dist/components/icon/alertTip.vue.d.ts +2 -0
  15. package/dist/components/icon/arrow.vue.d.ts +2 -0
  16. package/dist/components/icon/calendar.vue.d.ts +2 -0
  17. package/dist/components/icon/close.vue.d.ts +2 -0
  18. package/dist/components/icon/dateArrow.vue.d.ts +2 -0
  19. package/dist/components/icon/dateArrowplus.vue.d.ts +2 -0
  20. package/dist/components/icon/delete.vue.d.ts +2 -0
  21. package/dist/components/icon/ellipsis.vue.d.ts +2 -0
  22. package/dist/components/icon/errTip.vue.d.ts +2 -0
  23. package/dist/components/icon/eye.vue.d.ts +2 -0
  24. package/dist/components/icon/infoTip.vue.d.ts +2 -0
  25. package/dist/components/icon/minus.vue.d.ts +2 -0
  26. package/dist/components/icon/successTip.vue.d.ts +2 -0
  27. package/dist/components/icon/turnleft.vue.d.ts +2 -0
  28. package/dist/components/icon/turnright.vue.d.ts +2 -0
  29. package/dist/components/icon/warnTip.vue.d.ts +2 -0
  30. package/dist/components/input/input.vue.d.ts +13 -8
  31. package/dist/components/loadding/loadcomponent.vue.d.ts +24 -4
  32. package/dist/components/loadding/loadding.d.ts +12 -19
  33. package/dist/components/menu/menu.vue.d.ts +13 -3
  34. package/dist/components/message/message.d.ts +68 -14
  35. package/dist/components/message/messagecomponent.vue.d.ts +5 -13
  36. package/dist/components/numberInput/numberinput.vue.d.ts +3 -3
  37. package/dist/components/pagination/pagination.vue.d.ts +24 -0
  38. package/dist/components/popover/poparrow.d.ts +55 -0
  39. package/dist/components/popover/popover.vue.d.ts +10 -4
  40. package/dist/components/radio/radiobox.vue.d.ts +24 -16
  41. package/dist/components/radio/radiogroup.vue.d.ts +15 -3
  42. package/dist/components/scrollBar/movebar.vue.d.ts +2 -2
  43. package/dist/components/scrollBar/scrollBar.vue.d.ts +12 -16
  44. package/dist/components/scrollloading/scrolllead.d.ts +18 -11
  45. package/dist/components/select/select.vue.d.ts +15 -1
  46. package/dist/components/select/selectoption.vue.d.ts +18 -6
  47. package/dist/components/switch/switch.vue.d.ts +14 -14
  48. package/dist/components/table/table.vue.d.ts +20 -9
  49. package/dist/components/table/tableItem.vue.d.ts +10 -4
  50. package/dist/components/tabs/tabs.vue.d.ts +14 -1
  51. package/dist/dialog.css +9 -0
  52. package/dist/directives/arrowKeys.d.ts +10 -0
  53. package/dist/directives/drag.d.ts +20 -0
  54. package/dist/directives/escape.d.ts +7 -0
  55. package/dist/directives/outsideclick.d.ts +14 -0
  56. package/dist/directives/watchwindow.d.ts +13 -0
  57. package/dist/directives/wheel.d.ts +12 -0
  58. package/dist/directives/whitespaceclick.d.ts +12 -0
  59. package/dist/index.css +1186 -873
  60. package/dist/index.d.ts +831 -401
  61. package/dist/index.es.js +22 -23
  62. package/dist/index.umd.js +4019 -3764
  63. package/dist/js/arrow/arrow.js +17 -0
  64. package/dist/js/badge/badge.js +9 -16
  65. package/dist/js/calendar/calendar.js +87 -0
  66. package/dist/js/carousel/carousel.js +101 -117
  67. package/dist/js/carousel/carouselitem.js +1 -7
  68. package/dist/js/check/checkbox.js +38 -4
  69. package/dist/js/check/checkgroup.js +40 -51
  70. package/dist/js/date/datepicker.js +146 -150
  71. package/dist/js/date/datepickerRange.js +265 -354
  72. package/dist/js/dateArrowplus/dateArrowplus.js +25 -0
  73. package/dist/js/delete/delete.js +19 -0
  74. package/dist/js/dialog/dialog.js +41 -57
  75. package/dist/js/form/form.js +30 -38
  76. package/dist/js/form/formlabel.js +99 -130
  77. package/dist/js/image/image.js +199 -149
  78. package/dist/js/index/index.js +605 -507
  79. package/dist/js/input/input.js +60 -43
  80. package/dist/js/menu/menu.js +47 -20
  81. package/dist/js/numberInput/numberinput.js +52 -60
  82. package/dist/js/pagination/pagination.js +125 -156
  83. package/dist/js/popover/popover.js +238 -134
  84. package/dist/js/radio/radiobox.js +37 -4
  85. package/dist/js/radio/radiogroup.js +15 -51
  86. package/dist/js/scrollBar/scrollBar.js +100 -56
  87. package/dist/js/select/select.js +155 -70
  88. package/dist/js/select/selectoption.js +45 -4
  89. package/dist/js/shapeFlag/shapeFlag.js +17 -0
  90. package/dist/js/switch/switch.js +14 -14
  91. package/dist/js/table/table.js +165 -111
  92. package/dist/js/table/tableItem.js +1 -1
  93. package/dist/js/tabs/tabs.js +57 -59
  94. package/dist/js/upload/upload.js +8 -23
  95. package/dist/tabs.css +3 -3
  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/js/getcalendar/getcalendar.js +0 -48
  105. package/dist/js/tree/tree.js +0 -72
  106. package/dist/js/tree/treeleaf.js +0 -116
  107. package/dist/radiogroup.css +0 -44
  108. package/dist/scrollBar.css +0 -37
  109. package/dist/select.css +0 -20
@@ -1,5 +1,7 @@
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" };
1
+ import { defineComponent, computed, inject, openBlock, createElementBlock, renderSlot, withDirectives, createElementVNode, normalizeClass, vModelDynamic, createVNode, vShow } from "vue";
2
+ import { d as delIcon } from "../delete/delete.js";
3
+ import "../index/index.js";
4
+ const _hoisted_1 = { class: "relative flex h-full w-full items-center overflow-hidden rounded border border-solid" };
3
5
  const _hoisted_2 = ["placeholder", "type"];
4
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
5
7
  __name: "input",
@@ -8,76 +10,91 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
8
10
  modelModifiers: {},
9
11
  type: { default: "text" },
10
12
  placeHolder: {},
11
- clearable: { type: Boolean, default: false }
13
+ clearable: { type: Boolean, default: false },
14
+ size: { default: "default" }
12
15
  },
13
16
  emits: ["update:modelValue", "blur", "input", "change"],
14
17
  setup(__props, { emit: __emit }) {
15
- const prop = __props;
18
+ const props = __props;
19
+ const heightClass = computed(() => ({
20
+ "h-8": props.size === "large",
21
+ "h-7": props.size === "default",
22
+ "h-6": props.size === "small"
23
+ }));
16
24
  const inputValue = computed({
17
25
  get() {
18
- return prop.modelValue;
26
+ return props.modelValue;
19
27
  },
20
28
  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);
29
+ var _a, _b;
30
+ let processedValue = value;
31
+ if ((_a = props.modelModifiers) == null ? void 0 : _a.trim) {
32
+ if (typeof processedValue === "string") {
33
+ processedValue = processedValue.trim();
34
+ }
26
35
  }
36
+ if ((_b = props.modelModifiers) == null ? void 0 : _b.number) {
37
+ processedValue = processedValue ? Number(processedValue) : null;
38
+ }
39
+ emit("update:modelValue", processedValue);
27
40
  }
28
41
  });
29
- const updateValue = __emit;
42
+ const emit = __emit;
30
43
  const ParentGetInputHandle = inject("inputHandle", () => null);
31
44
  const ParentGetBlurHandle = inject("blurHandle", () => null);
32
45
  const clearHandle = () => {
33
- updateValue("update:modelValue", null);
46
+ emit("update:modelValue", null);
47
+ emit("change", null);
34
48
  };
35
49
  const showcloseico = computed(() => {
36
- return prop.clearable && prop.modelValue;
50
+ return props.clearable && props.modelValue !== null && props.modelValue !== "";
37
51
  });
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
- }
52
+ const processValue = (rawValue, methodStr) => {
53
+ var _a, _b;
54
+ let value = ((_a = props.modelModifiers) == null ? void 0 : _a.trim) ? rawValue.trim() : rawValue;
55
+ if ((_b = props.modelModifiers) == null ? void 0 : _b.number) {
56
+ return value ? Number(value) : null;
57
+ }
58
+ if (methodStr === "blur") {
59
+ ParentGetBlurHandle(value || null);
46
60
  } else {
47
- if (type == "blur") {
48
- ParentGetBlurHandle(target.value);
49
- } else {
50
- ParentGetInputHandle(target.value);
51
- }
61
+ ParentGetInputHandle(value || null);
52
62
  }
63
+ return value || null;
64
+ };
65
+ const handleBlur = (event) => {
66
+ const target = event.target;
67
+ emit("blur", processValue(target.value, "blur"));
68
+ };
69
+ const handleInput = (event) => {
70
+ const target = event.target;
71
+ emit("input", processValue(target.value, "input"));
72
+ };
73
+ const handleChange = (event) => {
74
+ const target = event.target;
75
+ emit("change", processValue(target.value, "change"));
53
76
  };
54
77
  return (_ctx, _cache) => {
55
78
  return openBlock(), createElementBlock("div", _hoisted_1, [
56
79
  renderSlot(_ctx.$slots, "prepend"),
57
80
  withDirectives(createElementVNode("input", {
58
- class: "tdd-h-full tdd-w-full tdd-p-2 tdd-outline-none",
81
+ class: normalizeClass(["w-full px-2 outline-none appearance-none", heightClass.value]),
59
82
  placeholder: _ctx.placeHolder,
60
83
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
61
84
  type: _ctx.type,
62
- onBlur: defaultEvent,
63
- onInput: defaultEvent,
64
- onChange: defaultEvent
65
- }, null, 40, _hoisted_2), [
85
+ onBlur: handleBlur,
86
+ onInput: handleInput,
87
+ onChange: handleChange
88
+ }, null, 42, _hoisted_2), [
66
89
  [vModelDynamic, inputValue.value]
67
90
  ]),
68
- withDirectives((openBlock(), createElementBlock("svg", {
91
+ withDirectives(createElementVNode("button", {
92
+ type: "button",
69
93
  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)), [
94
+ class: "mr-2 flex-grow-0"
95
+ }, [
96
+ createVNode(delIcon, { class: "w-3 h-3" })
97
+ ], 512), [
81
98
  [vShow, showcloseico.value]
82
99
  ]),
83
100
  renderSlot(_ctx.$slots, "append")
@@ -1,36 +1,63 @@
1
- import { defineComponent, ref, watch, openBlock, createElementBlock, createElementVNode, Fragment, renderList, withDirectives, vModelRadio, normalizeClass, toDisplayString, normalizeStyle } from "vue";
1
+ import { defineComponent, computed, ref, openBlock, createElementBlock, createElementVNode, Fragment, renderList, withDirectives, vModelRadio, normalizeClass, toDisplayString, normalizeStyle } from "vue";
2
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" };
3
+ const _hoisted_2 = { class: "w-full border-t-2 border-gray-200 border-solid mt-2 relative" };
4
4
  const _sfc_main = /* @__PURE__ */ defineComponent({
5
5
  __name: "menu",
6
6
  props: {
7
- menulist: {}
7
+ menulist: {},
8
+ activeIndex: { default: 1 }
8
9
  },
9
- emits: ["updatemenu"],
10
+ emits: ["updatemenu", "update:activeIndex"],
10
11
  setup(__props, { emit: __emit }) {
11
- const bigIndex = ref(-1);
12
- const arrowNum = ref(0);
12
+ const props = __props;
13
+ const bigIndex = computed({
14
+ set(val) {
15
+ emit("update:activeIndex", val);
16
+ emit("updatemenu", val);
17
+ },
18
+ get() {
19
+ updateIndicatorPosition();
20
+ if (props.menulist.length === 0)
21
+ return 0;
22
+ if (props.menulist.length <= props.activeIndex)
23
+ return props.menulist.length - 1;
24
+ return props.activeIndex;
25
+ }
26
+ });
13
27
  const emit = __emit;
14
- const baseclass = ref();
15
- watch(bigIndex, (n) => {
28
+ const menuListRef = ref();
29
+ const indicatorPosition = ref(0);
30
+ const indicatorStyle = computed(() => ({
31
+ transform: `translateX(${indicatorPosition.value}px)`,
32
+ width: `${currentItemWidth.value}px`
33
+ }));
34
+ const currentItemWidth = computed(() => {
16
35
  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);
36
+ if (!menuListRef.value)
37
+ return 0;
38
+ return ((_a = menuListRef.value.children[props.activeIndex]) == null ? void 0 : _a.clientWidth) || 0;
22
39
  });
40
+ const updateIndicatorPosition = () => {
41
+ if (!menuListRef.value)
42
+ return;
43
+ const currentItem = menuListRef.value.children[props.activeIndex];
44
+ if (currentItem) {
45
+ const containerRect = menuListRef.value.getBoundingClientRect();
46
+ const itemRect = currentItem.getBoundingClientRect();
47
+ indicatorPosition.value = itemRect.left - containerRect.left;
48
+ }
49
+ };
23
50
  return (_ctx, _cache) => {
24
51
  return openBlock(), createElementBlock("div", null, [
25
52
  createElementVNode("div", {
26
- class: "tdd-w-full tdd-flex tdd-text-word6",
27
- ref_key: "baseclass",
28
- ref: baseclass
53
+ class: "w-full flex text-word6 space-x-4",
54
+ ref_key: "menuListRef",
55
+ ref: menuListRef
29
56
  }, [
30
57
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.menulist, (item, i) => {
31
58
  return openBlock(), createElementBlock("label", { key: item }, [
32
59
  withDirectives(createElementVNode("input", {
33
- class: "tdd-hidden",
60
+ class: "hidden",
34
61
  name: "classone",
35
62
  type: "radio",
36
63
  value: i,
@@ -39,15 +66,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
39
66
  [vModelRadio, bigIndex.value]
40
67
  ]),
41
68
  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 }])
69
+ class: normalizeClass(["hover:text-blue-brand text-sm cursor-pointer inline-block text-center px-2", { "text-blue-brand": bigIndex.value == i }])
43
70
  }, toDisplayString(item), 3)
44
71
  ]);
45
72
  }), 128))
46
73
  ], 512),
47
74
  createElementVNode("div", _hoisted_2, [
48
75
  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` })
76
+ class: "absolute w-14 border-t-2 border-solid border-blue-brand bottom-0 transition",
77
+ style: normalizeStyle(indicatorStyle.value)
51
78
  }, null, 4)
52
79
  ])
53
80
  ]);
@@ -1,12 +1,37 @@
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" };
1
+ import { openBlock, createElementBlock, createElementVNode, defineComponent, computed, normalizeClass, createVNode, withDirectives, vModelText } from "vue";
2
+ import { _ as _export_sfc } from "../index/index.js";
3
+ const _sfc_main$2 = {};
4
+ const _hoisted_1$2 = {
5
+ viewBox: "0 0 1024 1024",
6
+ version: "1.1",
7
+ xmlns: "http://www.w3.org/2000/svg"
8
+ };
9
+ function _sfc_render$1(_ctx, _cache) {
10
+ return openBlock(), createElementBlock("svg", _hoisted_1$2, _cache[0] || (_cache[0] = [
11
+ 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" }, null, -1)
12
+ ]));
13
+ }
14
+ const minusIcon = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1]]);
15
+ const _sfc_main$1 = {};
16
+ const _hoisted_1$1 = {
17
+ viewBox: "0 0 1024 1024",
18
+ version: "1.1",
19
+ xmlns: "http://www.w3.org/2000/svg"
20
+ };
21
+ function _sfc_render(_ctx, _cache) {
22
+ return openBlock(), createElementBlock("svg", _hoisted_1$1, _cache[0] || (_cache[0] = [
23
+ 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" }, null, -1)
24
+ ]));
25
+ }
26
+ const addIcon = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render]]);
27
+ const _hoisted_1 = { class: "inline-flex w-full rounded-sm border border-solid" };
3
28
  const _hoisted_2 = ["disabled"];
4
29
  const _hoisted_3 = ["disabled"];
5
30
  const _sfc_main = /* @__PURE__ */ defineComponent({
6
31
  __name: "numberinput",
7
32
  props: {
8
33
  modelValue: {},
9
- size: { default: "normal" },
34
+ size: { default: "default" },
10
35
  min: {},
11
36
  max: {},
12
37
  strict: { type: Boolean, default: false },
@@ -16,6 +41,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
16
41
  emits: ["update:modelValue", "NumChange"],
17
42
  setup(__props, { emit: __emit }) {
18
43
  const props = __props;
44
+ const sizeClass = computed(() => ({
45
+ "h-8 w-8": props.size === "large",
46
+ "h-7 w-7": props.size === "default",
47
+ "h-6 w-6": props.size === "small"
48
+ }));
49
+ const bounds = computed(() => ({
50
+ min: props.min ?? -Infinity,
51
+ max: props.max ?? Infinity
52
+ }));
53
+ const isMinReached = computed(() => props.modelValue <= bounds.value.min);
54
+ const isMaxReached = computed(() => props.modelValue >= bounds.value.max);
19
55
  function updateModelValueAndEmit(value) {
20
56
  const formattedValue = value.toFixed(lastLen.value);
21
57
  emitAct("update:modelValue", Number(formattedValue));
@@ -23,8 +59,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
23
59
  }
24
60
  const emitAct = __emit;
25
61
  const lastLen = computed(() => {
26
- var _a;
27
- return (_a = props.step.toString().split(".")[1]) == null ? void 0 : _a.length;
62
+ const stepString = props.step.toString();
63
+ return stepString.includes(".") ? stepString.split(".")[1].length : 0;
28
64
  });
29
65
  const addHandle = () => {
30
66
  let result = props.modelValue + props.step;
@@ -49,51 +85,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
49
85
  }
50
86
  }
51
87
  });
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
88
  return (_ctx, _cache) => {
75
89
  return openBlock(), createElementBlock("div", _hoisted_1, [
76
90
  createElementVNode("button", {
77
91
  type: "button",
78
- disabled: reduceDisable.value,
92
+ disabled: isMinReached.value,
79
93
  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),
94
+ class: normalizeClass(["disabled:cursor-not-allowed flex-none bg-gray-200 text-xs", sizeClass.value])
95
+ }, [
96
+ createVNode(minusIcon, { class: "h-4 w-4 fill-word6 inline-block" })
97
+ ], 10, _hoisted_2),
95
98
  withDirectives(createElementVNode("input", {
96
- class: "tdd-w-full tdd-px-1 tdd-text-center tdd-outline-none",
99
+ class: "w-full px-1 text-center outline-none text-word3",
97
100
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
98
101
  type: "text"
99
102
  }, null, 512), [
@@ -101,23 +104,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
101
104
  ]),
102
105
  createElementVNode("button", {
103
106
  type: "button",
104
- disabled: addDisable.value,
107
+ disabled: isMaxReached.value,
105
108
  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)
109
+ class: normalizeClass(["disabled:cursor-not-allowed flex-none bg-gray-200 text-xs", sizeClass.value])
110
+ }, [
111
+ createVNode(addIcon, { class: "h-4 w-4 fill-word6 inline-block" })
112
+ ], 10, _hoisted_3)
121
113
  ]);
122
114
  };
123
115
  }