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,5 @@
1
- import { defineComponent, ref, computed, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, onMounted, nextTick, onUnmounted, renderSlot, createVNode } from "vue";
2
- import { o as on, a as off, b as getScrollWidth, e as addResizeListener, r as removeResizeListener } from "../index/index.js";
1
+ import { defineComponent, ref, computed, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, onMounted, onUnmounted, renderSlot, createBlock, createCommentVNode } from "vue";
2
+ import { o as on, b as off, e as useResizeObserver } from "../index/index.js";
3
3
  const _sfc_main$1 = /* @__PURE__ */ defineComponent({
4
4
  __name: "movebar",
5
5
  props: {
@@ -47,8 +47,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
47
47
  e.target.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]
48
48
  );
49
49
  const thumbHalf = thumb.value[bar.value.offset] / 2;
50
- const thumbPositionPercentage = (offset - thumbHalf) * 100 / el.value[bar.value.offset];
51
- wrap.value[bar.value.scroll] = thumbPositionPercentage * wrap.value[bar.value.scrollSize] / 100;
50
+ const thumbPositionPercentage = (
51
+ // @ts-ignore
52
+ (offset - thumbHalf) * 100 / el.value[bar.value.offset]
53
+ );
54
+ wrap.value[bar.value.scroll] = // @ts-ignore
55
+ thumbPositionPercentage * wrap.value[bar.value.scrollSize] / 100;
52
56
  };
53
57
  const clickThumbHandler = (e) => {
54
58
  if (e.ctrlKey || e.button === 2) {
@@ -59,7 +63,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
59
63
  // 滑块的高度
60
64
  e.currentTarget[bar.value.offset] - // 点击滑块距离顶部的位置 减去 滑块元素距离顶部的位置
61
65
  // @ts-ignore
62
- (e[bar.value.client] - e.currentTarget.getBoundingClientRect()[bar.value.direction]);
66
+ (e[bar.value.client] - // @ts-ignore
67
+ e.currentTarget.getBoundingClientRect()[bar.value.direction]);
63
68
  };
64
69
  const cursorDown = ref(false);
65
70
  const startDrag = (e) => {
@@ -75,10 +80,18 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
75
80
  const prevPage = baraxis;
76
81
  if (!prevPage)
77
82
  return;
78
- const offset = (el.value.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]) * -1;
83
+ const offset = (
84
+ // @ts-ignore
85
+ (el.value.getBoundingClientRect()[bar.value.direction] - // @ts-ignore
86
+ e[bar.value.client]) * -1
87
+ );
79
88
  const thumbClickPosition = thumb.value[bar.value.offset] - prevPage;
80
- const thumbPositionPercentage = (offset - thumbClickPosition) * 100 / el.value[bar.value.offset];
81
- wrap.value[bar.value.scroll] = thumbPositionPercentage * wrap.value[bar.value.scrollSize] / 100;
89
+ const thumbPositionPercentage = (
90
+ // @ts-ignore
91
+ (offset - thumbClickPosition) * 100 / el.value[bar.value.offset]
92
+ );
93
+ wrap.value[bar.value.scroll] = // @ts-ignore
94
+ thumbPositionPercentage * wrap.value[bar.value.scrollSize] / 100;
82
95
  };
83
96
  const mouseUpDocumentHandler = () => {
84
97
  cursorDown.value = false;
@@ -100,109 +113,140 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
100
113
  onMousedown: clickTrackHandler,
101
114
  ref_key: "el",
102
115
  ref: el,
103
- class: normalizeClass(["tdd-absolute tdd-right-0.5 tdd-bottom-0.5 tdd-rounded tdd-transition-transform", [
104
- _ctx.vertical ? "isver" : "ishor"
105
- ]])
116
+ class: normalizeClass(["absolute right-0.5 bottom-0.5 rounded transition-transform", [_ctx.vertical ? "top-0.5 w-1.5" : "left-0.5 h-1.5"]])
106
117
  }, [
107
118
  createElementVNode("div", {
108
119
  onMousedown: clickThumbHandler,
109
120
  ref_key: "thumb",
110
121
  ref: thumb,
111
- class: "thumb",
122
+ class: normalizeClass([_ctx.vertical ? "w-full" : "h-full", "bg-[#9092984d] cursor-pointer rounded"]),
112
123
  style: normalizeStyle(renderThumbstyle())
113
- }, null, 36)
124
+ }, null, 38)
114
125
  ], 34);
115
126
  };
116
127
  }
117
128
  });
118
129
  const _hoisted_1 = {
119
- key: 1,
120
- class: "tdd-group/scroll tdd-relative tdd-h-full tdd-w-full tdd-overflow-hidden pageScroll"
130
+ key: 0,
131
+ class: "group/scroll relative h-full overflow-hidden"
121
132
  };
122
133
  const _sfc_main = /* @__PURE__ */ defineComponent({
123
134
  __name: "scrollBar",
124
135
  props: {
125
136
  native: { type: Boolean, default: false },
126
- noresize: { type: Boolean, default: false },
127
- vertical: { type: Boolean, default: false },
128
- isSelectdom: { type: Boolean, default: false }
137
+ height: {},
138
+ maxHeight: {}
129
139
  },
130
- setup(__props) {
140
+ setup(__props, { expose: __expose }) {
131
141
  const props = __props;
132
- const marginnum = ref(0);
133
- onMounted(() => {
134
- if (props.native)
135
- return;
136
- marginnum.value = getScrollWidth();
142
+ const warpStyle = computed(() => {
143
+ return {
144
+ maxHeight: props.maxHeight,
145
+ height: props.height
146
+ };
137
147
  });
138
148
  const wrap = ref();
139
- const resize = ref();
149
+ const contentBox = ref();
140
150
  const moveX = ref(0);
141
151
  const moveY = ref(0);
142
- const sizeHeight = ref("");
143
- const sizeWidth = ref("");
152
+ const isTouching = ref(false);
153
+ const heightPercentage = ref(100);
154
+ const widthPercentage = ref(100);
155
+ const hasHor = computed(() => {
156
+ return widthPercentage.value !== 100;
157
+ });
158
+ const hasVer = computed(() => {
159
+ return heightPercentage.value !== 100;
160
+ });
161
+ const sizeHeight = computed(() => {
162
+ return `${heightPercentage.value}%`;
163
+ });
164
+ const sizeWidth = computed(() => {
165
+ return `${widthPercentage.value}%`;
166
+ });
144
167
  const handleScroll = () => {
145
168
  moveY.value = wrap.value.scrollTop / wrap.value.clientHeight * 100;
146
169
  moveX.value = wrap.value.scrollLeft / wrap.value.clientWidth * 100;
147
170
  };
148
171
  const update = () => {
149
- let heightPercentage, widthPercentage;
150
- if (!wrap.value)
151
- return;
152
- heightPercentage = wrap.value.clientHeight * 100 / wrap.value.scrollHeight;
153
- widthPercentage = wrap.value.clientWidth * 100 / wrap.value.scrollWidth;
154
- sizeHeight.value = heightPercentage < 100 ? heightPercentage + "%" : "";
155
- sizeWidth.value = widthPercentage < 100 ? widthPercentage + "%" : "";
172
+ if (wrap.value) {
173
+ const { clientWidth, clientHeight, scrollWidth, scrollHeight } = wrap.value;
174
+ heightPercentage.value = scrollHeight > 0 ? Math.min(clientHeight / scrollHeight * 100, 100) : 100;
175
+ widthPercentage.value = scrollWidth > 0 ? Math.min(clientWidth / scrollWidth * 100, 100) : 100;
176
+ }
156
177
  };
178
+ const { observe, unobserve } = useResizeObserver(update);
157
179
  onMounted(() => {
158
180
  if (props.native)
159
181
  return;
160
- nextTick(() => update);
161
- !props.noresize && addResizeListener(resize.value, update);
182
+ contentBox.value && observe(contentBox.value);
162
183
  });
163
184
  onUnmounted(() => {
164
185
  if (props.native)
165
186
  return;
166
- !props.noresize && removeResizeListener(resize.value, update);
187
+ contentBox.value && unobserve(contentBox.value);
188
+ });
189
+ const setScrollTop = (percentage, options = { behavior: "auto" }) => {
190
+ if (!wrap.value)
191
+ return;
192
+ const validPercentage = Math.max(0, Math.min(percentage, 100));
193
+ const maxScroll = wrap.value.scrollHeight - wrap.value.clientHeight;
194
+ wrap.value.scrollTo({
195
+ top: maxScroll * validPercentage / 100,
196
+ behavior: options.behavior
197
+ });
198
+ };
199
+ const setScrollLeft = (percentage, options = { behavior: "auto" }) => {
200
+ if (!wrap.value)
201
+ return;
202
+ const validPercentage = Math.max(0, Math.min(percentage, 100));
203
+ const maxScroll = wrap.value.scrollWidth - wrap.value.clientWidth;
204
+ wrap.value.scrollTo({
205
+ left: maxScroll * validPercentage / 100,
206
+ behavior: options.behavior
207
+ });
208
+ };
209
+ __expose({
210
+ setScrollTop,
211
+ setScrollLeft
167
212
  });
168
213
  return (_ctx, _cache) => {
169
- return _ctx.native ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createElementBlock("div", _hoisted_1, [
214
+ return !_ctx.native ? (openBlock(), createElementBlock("div", _hoisted_1, [
170
215
  createElementVNode("div", {
171
216
  ref_key: "wrap",
172
217
  ref: wrap,
173
- onScroll: handleScroll,
174
- class: normalizeClass([{ "tdd-max-h-[300px]": _ctx.isSelectdom }, "tddScroll tdd-overscroll-contain tdd-overflow-scroll"]),
175
- style: normalizeStyle({
176
- marginRight: `-${marginnum.value}px`,
177
- marginBottom: `-${marginnum.value}px`
178
- })
218
+ onScrollPassive: handleScroll,
219
+ class: "overscroll-contain overflow-auto h-full scrollbar-none uiscroll",
220
+ style: normalizeStyle(warpStyle.value),
221
+ onTouchstart: _cache[0] || (_cache[0] = ($event) => isTouching.value = true),
222
+ onTouchend: _cache[1] || (_cache[1] = ($event) => isTouching.value = false)
179
223
  }, [
180
224
  createElementVNode("div", {
181
- ref_key: "resize",
182
- ref: resize,
183
- class: "block"
225
+ ref_key: "contentBox",
226
+ ref: contentBox
184
227
  }, [
185
228
  renderSlot(_ctx.$slots, "default")
186
229
  ], 512)
187
- ], 38),
188
- createVNode(_sfc_main$1, {
230
+ ], 36),
231
+ hasHor.value ? (openBlock(), createBlock(_sfc_main$1, {
232
+ key: 0,
189
233
  move: moveX.value,
190
234
  size: sizeWidth.value,
191
235
  parent: wrap.value,
192
- class: "tdd-opacity-0 group-hover/scroll:tdd-opacity-100"
193
- }, null, 8, ["move", "size", "parent"]),
194
- createVNode(_sfc_main$1, {
236
+ class: normalizeClass(["opacity-0 group-hover/scroll:opacity-100 max-sm:opacity-100 sm:group-hover/scroll:opacity-100 transition-opacity duration-300", { "opacity-100": isTouching.value }])
237
+ }, null, 8, ["move", "size", "parent", "class"])) : createCommentVNode("", true),
238
+ hasVer.value ? (openBlock(), createBlock(_sfc_main$1, {
239
+ key: 1,
195
240
  vertical: "",
196
241
  move: moveY.value,
197
242
  size: sizeHeight.value,
198
243
  parent: wrap.value,
199
- class: "tdd-opacity-0 group-hover/scroll:tdd-opacity-100"
200
- }, null, 8, ["move", "size", "parent"])
201
- ]));
244
+ class: normalizeClass(["opacity-0 group-hover/scroll:opacity-100 max-sm:opacity-100 sm:group-hover/scroll:opacity-100 transition-opacity duration-300", { "opacity-100": isTouching.value }])
245
+ }, null, 8, ["move", "size", "parent", "class"])) : createCommentVNode("", true)
246
+ ])) : renderSlot(_ctx.$slots, "default", { key: 1 });
202
247
  };
203
248
  }
204
249
  });
205
- const scrollBar_vue_vue_type_style_index_0_lang = "";
206
250
  export {
207
251
  _sfc_main as default
208
252
  };
@@ -1,4 +1,64 @@
1
- import { defineComponent, defineAsyncComponent, inject, useSlots, ref, computed, openBlock, createBlock, unref, withCtx, createElementVNode, createVNode, h, normalizeClass } from "vue";
1
+ import { defineComponent, defineAsyncComponent, computed, inject, ref, watch, provide, toRef, openBlock, createBlock, unref, withCtx, createElementVNode, normalizeClass, createVNode, withDirectives, createElementBlock, renderSlot } from "vue";
2
+ import { A as ArrowIcon } from "../arrow/arrow.js";
3
+ import "../index/index.js";
4
+ const directionMap = {
5
+ ArrowUp: "up",
6
+ Up: "up",
7
+ // IE/Edge 兼容
8
+ ArrowDown: "down",
9
+ Down: "down",
10
+ // IE/Edge 兼容
11
+ ArrowLeft: "left",
12
+ Left: "left",
13
+ // IE/Edge 兼容
14
+ ArrowRight: "right",
15
+ Right: "right"
16
+ // IE/Edge 兼容
17
+ };
18
+ const createArrowKeysDirective = (options) => {
19
+ const config = {
20
+ // 默认配置
21
+ up: () => {
22
+ },
23
+ down: () => {
24
+ },
25
+ left: () => {
26
+ },
27
+ right: () => {
28
+ },
29
+ ...options
30
+ };
31
+ const bindEvents = (el, binding) => {
32
+ const handler = (e) => {
33
+ var _a;
34
+ const direction = directionMap[e.key];
35
+ if (direction && config[direction]) {
36
+ e.preventDefault();
37
+ (_a = config[direction]) == null ? void 0 : _a.call(config, e);
38
+ }
39
+ };
40
+ el._arrowKeysHandler = handler;
41
+ document.addEventListener("keydown", handler);
42
+ };
43
+ const unbindEvents = (el) => {
44
+ if (el._arrowKeysHandler) {
45
+ document.removeEventListener("keydown", el._arrowKeysHandler);
46
+ }
47
+ delete el._arrowKeysHandler;
48
+ };
49
+ return {
50
+ mounted(el, binding) {
51
+ bindEvents(el);
52
+ },
53
+ updated(el, binding) {
54
+ unbindEvents(el);
55
+ bindEvents(el);
56
+ },
57
+ unmounted(el) {
58
+ unbindEvents(el);
59
+ }
60
+ };
61
+ };
2
62
  const _hoisted_1 = ["value", "disabled", "readonly", "placeholder"];
3
63
  const _sfc_main = /* @__PURE__ */ defineComponent({
4
64
  __name: "select",
@@ -6,87 +66,102 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
6
66
  modelValue: {},
7
67
  filter: { type: Boolean, default: false },
8
68
  placeHolder: { default: "点击选择" },
9
- disabled: { type: Boolean, default: false }
69
+ disabled: { type: Boolean, default: false },
70
+ size: { default: "default" }
10
71
  },
11
72
  emits: ["update:modelValue", "change"],
12
73
  setup(__props, { emit: __emit }) {
13
- const LibScrollBar = defineAsyncComponent(() => import("../scrollBar/scrollBar.js"));
14
74
  const Pop = defineAsyncComponent(() => import("../popover/popover.js"));
75
+ const LibScrollBar = defineAsyncComponent(() => import("../scrollBar/scrollBar.js"));
15
76
  const props = __props;
16
- const ParentGetChangeHandle = inject(
17
- "changHandle",
18
- (_params) => null
19
- // false
20
- );
77
+ const heightClass = computed(() => ({
78
+ "h-8": props.size === "large",
79
+ "h-7": props.size === "default",
80
+ "h-6": props.size === "small"
81
+ }));
82
+ const ParentGetChangeHandle = inject("changHandle", (_params) => null);
83
+ const inputbox = ref();
84
+ const popwidth = computed(() => {
85
+ var _a;
86
+ return ((_a = inputbox.value) == null ? void 0 : _a.clientWidth) || 200;
87
+ });
88
+ const scrollRef = ref();
89
+ const vArrowKeys = createArrowKeysDirective({
90
+ up: () => {
91
+ if (showOption.value) {
92
+ const newIndex = (inputLabelIndex.value - 1 + totalNum.value) % totalNum.value;
93
+ updateModelvalue(selectDataArr.value[newIndex].value);
94
+ }
95
+ },
96
+ down: () => {
97
+ if (showOption.value) {
98
+ const newIndex = (inputLabelIndex.value + 1 + totalNum.value) % totalNum.value;
99
+ updateModelvalue(selectDataArr.value[newIndex].value);
100
+ }
101
+ }
102
+ });
21
103
  const emit = __emit;
22
- const slots = useSlots();
23
104
  const showOption = ref(false);
24
105
  const showHandle = () => {
25
106
  if (props.disabled === true)
26
107
  return;
27
108
  showOption.value = !showOption.value;
28
109
  };
29
- const inputLabel = computed(() => {
30
- const isThis = optionList.value.filter((v) => v.value === props.modelValue);
31
- if (isThis.length > 0) {
32
- return isThis[0].label;
33
- } else if (props.modelValue) {
34
- return;
35
- } else {
36
- return null;
110
+ const selectDataArr = ref([]);
111
+ const insertData = (data) => {
112
+ selectDataArr.value.push(data);
113
+ };
114
+ watch(showOption, (newval) => {
115
+ if (newval === false) {
116
+ LastChildSelect(props.modelValue);
37
117
  }
38
118
  });
39
- const optionList = ref([]);
40
- const optionHandle = (it) => {
41
- optionList.value.push({
42
- value: it.props.value,
43
- label: it.props.label
44
- });
45
- return h(
46
- "div",
47
- {
48
- class: normalizeClass(["label", [props.modelValue === it.props.value ? "labelselect" : ""]]),
49
- key: it.props.key,
50
- onClick: () => {
51
- emit("update:modelValue", it.props.value);
52
- ParentGetChangeHandle && ParentGetChangeHandle(it.props.value);
53
- emit("change", it.props.value);
54
- showOption.value = false;
55
- }
56
- },
57
- it.children || it.props.label
58
- );
119
+ const updateModelvalue = (value) => {
120
+ emit("update:modelValue", value);
121
+ emit("change", value);
122
+ LastChildSelect(value);
123
+ ParentGetChangeHandle && ParentGetChangeHandle(value);
59
124
  };
60
- const renderOption = () => {
61
- return h(
62
- "div",
63
- {
64
- class: "selectOption"
65
- },
66
- slots.default().map((i, _j) => {
67
- if (typeof i.children == "string")
68
- return null;
69
- if (Array.isArray(i.children)) {
70
- return i.children.map((it) => {
71
- return optionHandle(it);
72
- });
73
- } else {
74
- return optionHandle(i);
75
- }
76
- })
77
- );
125
+ provide("_SelectItemPush_", insertData);
126
+ provide("_UpdateSelectData_", (value) => {
127
+ updateModelvalue(value);
128
+ showOption.value = false;
129
+ });
130
+ provide("_SelectModelValue_", toRef(props, "modelValue"));
131
+ const lastMouseEnterValue = toRef(props.modelValue);
132
+ const LastChildSelect = (value) => {
133
+ lastMouseEnterValue.value = value;
78
134
  };
135
+ provide("_LastSelectValue_", lastMouseEnterValue);
136
+ provide("_LastChildSelect_", LastChildSelect);
137
+ const inputLabel = computed(() => {
138
+ const isThis = selectDataArr.value.find((v) => v.value === props.modelValue);
139
+ return isThis ? isThis.label : props.modelValue;
140
+ });
141
+ const inputLabelIndex = computed(() => {
142
+ return selectDataArr.value.findIndex((v) => v.value === props.modelValue);
143
+ });
144
+ const totalNum = computed(() => {
145
+ return selectDataArr.value.length;
146
+ });
79
147
  return (_ctx, _cache) => {
80
148
  return openBlock(), createBlock(unref(Pop), {
149
+ isselectMode: "",
81
150
  trigger: "native",
82
151
  modelValue: showOption.value,
83
152
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => showOption.value = $event),
84
- insertClass: "tdd-min-w-[200px] tdd-z-2000 tdd-text-sm !tdd-p-1",
85
- placement: "bottomleft"
153
+ width: popwidth.value,
154
+ insertClass: "z-2000 text-sm py-0.5 px-0",
155
+ placement: "bottommiddle"
86
156
  }, {
87
157
  reference: withCtx(() => [
88
158
  createElementVNode("div", {
89
- class: "tdd-relative tdd-flex tdd-h-full tdd-w-full tdd-items-center tdd-overflow-hidden tdd-rounded tdd-border tdd-border-solid",
159
+ ref_key: "inputbox",
160
+ ref: inputbox,
161
+ class: normalizeClass([{
162
+ "bg-gray-100 cursor-default": _ctx.disabled,
163
+ "cursor-pointer": !_ctx.disabled
164
+ }, "relative flex h-full w-full items-center overflow-hidden rounded border border-solid"]),
90
165
  onClick: showHandle
91
166
  }, [
92
167
  createElementVNode("input", {
@@ -94,25 +169,35 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
94
169
  type: "text",
95
170
  disabled: _ctx.disabled,
96
171
  readonly: !_ctx.filter,
97
- class: "tdd-h-full tdd-w-full tdd-cursor-pointer tdd-appearance-none tdd-p-2 tdd-text-sm tdd-outline-none",
172
+ class: normalizeClass(["w-full cursor-pointer appearance-none px-2 text-sm outline-none disabled:cursor-default text-word3", heightClass.value]),
98
173
  placeholder: _ctx.placeHolder
99
- }, null, 8, _hoisted_1)
100
- ])
174
+ }, null, 10, _hoisted_1),
175
+ createVNode(ArrowIcon, {
176
+ class: normalizeClass(["w-3 h-3 fill-gray-300 inline-block transform transition-all mx-1", { "-rotate-90": showOption.value, "rotate-90": !showOption.value }])
177
+ }, null, 8, ["class"])
178
+ ], 2)
101
179
  ]),
102
180
  default: withCtx(() => [
103
- createVNode(unref(LibScrollBar), { isSelectdom: true }, {
104
- default: withCtx(() => [
105
- createVNode(renderOption)
106
- ]),
107
- _: 1
108
- })
181
+ withDirectives((openBlock(), createElementBlock("div", null, [
182
+ createVNode(unref(LibScrollBar), {
183
+ ref_key: "scrollRef",
184
+ ref: scrollRef,
185
+ maxHeight: "274px"
186
+ }, {
187
+ default: withCtx(() => [
188
+ renderSlot(_ctx.$slots, "default")
189
+ ]),
190
+ _: 3
191
+ }, 512)
192
+ ])), [
193
+ [unref(vArrowKeys)]
194
+ ])
109
195
  ]),
110
- _: 1
111
- }, 8, ["modelValue"]);
196
+ _: 3
197
+ }, 8, ["modelValue", "width"]);
112
198
  };
113
199
  }
114
200
  });
115
- const select_vue_vue_type_style_index_0_lang = "";
116
201
  export {
117
202
  _sfc_main as default
118
203
  };
@@ -1,13 +1,54 @@
1
- import { defineComponent, renderSlot } from "vue";
1
+ import { defineComponent, ref, inject, computed, useSlots, openBlock, createElementBlock, normalizeClass, toDisplayString, renderSlot } from "vue";
2
+ const _hoisted_1 = { key: 0 };
2
3
  const _sfc_main = /* @__PURE__ */ defineComponent({
3
4
  __name: "selectoption",
4
5
  props: {
5
6
  value: {},
6
- label: {}
7
+ label: {},
8
+ disabled: { type: Boolean, default: false }
7
9
  },
8
- setup(__props) {
10
+ setup(__props, { expose: __expose }) {
11
+ const props = __props;
12
+ const elRef = ref();
13
+ const modelValue = inject("_SelectModelValue_");
14
+ const isSelected = computed(() => modelValue.value === props.value);
15
+ const slots = useSlots();
16
+ const pushData = inject("_SelectItemPush_", (_params) => {
17
+ });
18
+ const selectHandle = inject("_UpdateSelectData_", (_params) => {
19
+ });
20
+ const hoverValue = inject("_LastSelectValue_");
21
+ const hoverHandle = inject("_LastChildSelect_", (_params) => {
22
+ });
23
+ const clickMeHandle = () => {
24
+ if (props.disabled)
25
+ return;
26
+ selectHandle(props.value);
27
+ };
28
+ pushData({ ...props });
29
+ const hasSlot = computed(() => !!slots.default);
30
+ const isHovered = computed(() => hoverValue.value === props.value);
31
+ const moveIn = () => {
32
+ hoverHandle(props.value);
33
+ };
34
+ __expose({
35
+ el: elRef
36
+ });
9
37
  return (_ctx, _cache) => {
10
- return renderSlot(_ctx.$slots, "default");
38
+ return openBlock(), createElementBlock("div", {
39
+ ref_key: "elRef",
40
+ ref: elRef,
41
+ onClick: clickMeHandle,
42
+ onMouseenter: moveIn,
43
+ class: normalizeClass(["px-1 py-2 cursor-pointer", {
44
+ "text-blue-light": isSelected.value,
45
+ "opacity-50 cursor-not-allowed": _ctx.disabled,
46
+ "bg-gray-100": !_ctx.disabled && isHovered.value,
47
+ "bg-inherit": !isHovered.value
48
+ }])
49
+ }, [
50
+ !hasSlot.value ? (openBlock(), createElementBlock("div", _hoisted_1, toDisplayString(_ctx.label || _ctx.value), 1)) : renderSlot(_ctx.$slots, "default", { key: 1 })
51
+ ], 34);
11
52
  };
12
53
  }
13
54
  });
@@ -0,0 +1,17 @@
1
+ var ShapeFlags = /* @__PURE__ */ ((ShapeFlags2) => {
2
+ ShapeFlags2[ShapeFlags2["ELEMENT"] = 1] = "ELEMENT";
3
+ ShapeFlags2[ShapeFlags2["FUNCTIONAL_COMPONENT"] = 2] = "FUNCTIONAL_COMPONENT";
4
+ ShapeFlags2[ShapeFlags2["STATEFUL_COMPONENT"] = 4] = "STATEFUL_COMPONENT";
5
+ ShapeFlags2[ShapeFlags2["TEXT_CHILDREN"] = 8] = "TEXT_CHILDREN";
6
+ ShapeFlags2[ShapeFlags2["ARRAY_CHILDREN"] = 16] = "ARRAY_CHILDREN";
7
+ ShapeFlags2[ShapeFlags2["SLOTS_CHILDREN"] = 32] = "SLOTS_CHILDREN";
8
+ ShapeFlags2[ShapeFlags2["TELEPORT"] = 64] = "TELEPORT";
9
+ ShapeFlags2[ShapeFlags2["SUSPENSE"] = 128] = "SUSPENSE";
10
+ ShapeFlags2[ShapeFlags2["COMPONENT_SHOULD_KEEP_ALIVE"] = 256] = "COMPONENT_SHOULD_KEEP_ALIVE";
11
+ ShapeFlags2[ShapeFlags2["COMPONENT_KEPT_ALIVE"] = 512] = "COMPONENT_KEPT_ALIVE";
12
+ ShapeFlags2[ShapeFlags2["COMPONENT"] = 6] = "COMPONENT";
13
+ return ShapeFlags2;
14
+ })(ShapeFlags || {});
15
+ export {
16
+ ShapeFlags as S
17
+ };
@@ -1,20 +1,20 @@
1
1
  import { defineComponent, openBlock, createElementBlock, createElementVNode, normalizeStyle, normalizeClass, toDisplayString } from "vue";
2
- const _hoisted_1 = { class: "tdd-inline-block tdd-cursor-pointer tdd-select-none tdd-text-xs" };
2
+ const _hoisted_1 = { class: "inline-block cursor-pointer select-none text-xs relative" };
3
3
  const _hoisted_2 = {
4
4
  key: 0,
5
- class: "tdd-z-10 tdd-absolute tdd-top-0 tdd-font-semibold tdd-text-white tdd-left-1 tdd-leading-5 tdd-rounded-tr-sm tdd-rounded-br-sm"
5
+ class: "z-10 font-semibold text-white leading-5 mr-6 pl-1"
6
6
  };
7
7
  const _hoisted_3 = {
8
8
  key: 1,
9
- class: "tdd-z-10 tdd-absolute tdd-top-0 tdd-font-semibold tdd-text-white tdd-right-1 tdd-leading-5 tdd-rounded-tl-sm tdd-rounded-bl-sm"
9
+ class: "z-10 font-semibold text-white leading-5 ml-6 pr-1"
10
10
  };
11
11
  const _sfc_main = /* @__PURE__ */ defineComponent({
12
12
  __name: "switch",
13
13
  props: {
14
- labelChecked: {},
15
- labelUnchecked: {},
16
- colorChecked: { default: "#25b9e9" },
17
- colorUnchecked: { default: "#666666" },
14
+ checkedLabel: {},
15
+ uncheckedLabel: {},
16
+ checkedColor: { default: "#25b9e9" },
17
+ uncheckedColor: { default: "#666666" },
18
18
  modelValue: { type: Boolean, default: false }
19
19
  },
20
20
  emits: ["update:modelValue", "switchChange"],
@@ -29,18 +29,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
29
29
  return openBlock(), createElementBlock("label", _hoisted_1, [
30
30
  createElementVNode("input", {
31
31
  type: "checkbox",
32
- class: "tdd-hidden",
32
+ class: "hidden",
33
33
  onChange: togglehandle
34
34
  }, null, 32),
35
35
  createElementVNode("div", {
36
- class: "tdd-relative tdd-m-0 tdd-box-border tdd-block tdd-h-5 tdd-w-10 tdd-transform tdd-select-none tdd-overflow-hidden tdd-rounded-xl tdd-outline-0 tdd-ring-2 tdd-ring-gray-300 tdd-transition",
37
- style: normalizeStyle({ backgroundColor: _ctx.modelValue ? _ctx.colorChecked : _ctx.colorUnchecked })
36
+ class: "relative box-border block h-5 min-w-10 select-none overflow-hidden rounded-xl outline-0 ring-2 ring-gray-300",
37
+ style: normalizeStyle({ backgroundColor: _ctx.modelValue ? _ctx.checkedColor : _ctx.uncheckedColor })
38
38
  }, [
39
39
  createElementVNode("div", {
40
- class: normalizeClass(["tdd-absolute tdd-top-0 tdd-left-0 tdd-z-10 tdd-block tdd-h-full tdd-w-1/2 tdd-translate-x-0 tdd-transform tdd-rounded-full tdd-bg-slate-50 tdd-transition", { "tdd-translate-x-full ": _ctx.modelValue }])
41
- }, null, 2)
42
- ], 4),
43
- _ctx.modelValue ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(_ctx.labelChecked), 1)) : (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(_ctx.labelUnchecked), 1))
40
+ class: normalizeClass(["absolute top-0 z-10 block h-5 w-5 transform rounded-full bg-slate-50 transition-all", [_ctx.modelValue ? "left-[calc(100%-20px)]" : "left-0"]])
41
+ }, null, 2),
42
+ _ctx.modelValue ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(_ctx.checkedLabel), 1)) : (openBlock(), createElementBlock("div", _hoisted_3, toDisplayString(_ctx.uncheckedLabel), 1))
43
+ ], 4)
44
44
  ]);
45
45
  };
46
46
  }