ninemoon-ui 0.1.7 → 0.1.9

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 (36) hide show
  1. package/dist/components/date/datepicker.vue.d.ts +3 -3
  2. package/dist/components/date/datepickerRange.vue.d.ts +2 -2
  3. package/dist/components/form/form.vue.d.ts +5 -0
  4. package/dist/components/form/formlabel.vue.d.ts +10 -0
  5. package/dist/components/input/input.vue.d.ts +10 -3
  6. package/dist/components/numberInput/numberinput.vue.d.ts +3 -3
  7. package/dist/components/select/select.vue.d.ts +3 -3
  8. package/dist/components/table/table.vue.d.ts +8 -1
  9. package/dist/components/table/tableItem.vue.d.ts +2 -0
  10. package/dist/directives/index.d.ts +1 -2
  11. package/dist/directives/looplead.d.ts +19 -0
  12. package/dist/directives/scrolllead.d.ts +3 -11
  13. package/dist/directives/watchwindow.d.ts +1 -1
  14. package/dist/hooks/teleportcontainer.d.ts +5 -0
  15. package/dist/index.d.ts +128 -30
  16. package/dist/index.es.js +26 -27
  17. package/dist/js/badge/badge.js +3 -3
  18. package/dist/js/carousel/carousel.js +1 -1
  19. package/dist/js/check/checkbox.js +4 -4
  20. package/dist/js/date/datepicker.js +4 -3
  21. package/dist/js/date/datepickerRange.js +22 -17
  22. package/dist/js/dialog/dialog.js +36 -37
  23. package/dist/js/form/form.js +3 -1
  24. package/dist/js/form/formlabel.js +39 -8
  25. package/dist/js/image/image.js +2 -2
  26. package/dist/js/index/index.js +130 -113
  27. package/dist/js/input/input.js +26 -6
  28. package/dist/js/numberInput/numberinput.js +2 -1
  29. package/dist/js/pagination/pagination.js +2 -1
  30. package/dist/js/popover/popover.js +11 -17
  31. package/dist/js/radio/radiobox.js +4 -4
  32. package/dist/js/select/select.js +4 -3
  33. package/dist/js/table/table.js +243 -188
  34. package/dist/js/table/tableItem.js +2 -1
  35. package/package.json +2 -1
  36. package/dist/directives/whitespaceclick.d.ts +0 -12
@@ -34,7 +34,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
34
34
  const heightClass = computed(() => ({
35
35
  "h-10": props.size === "large",
36
36
  "h-9": props.size === "default",
37
- "h-8": props.size === "small"
37
+ "h-8": props.size === "small",
38
+ "h-7": props.size === "mini"
38
39
  }));
39
40
  const emit = __emit;
40
41
  const dateChangeHandle = (e) => {
@@ -227,11 +228,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
227
228
  onClick: showHandle,
228
229
  class: "relative inline-flex h-full w-full items-center overflow-hidden rounded border border-solid"
229
230
  }, [
230
- createVNode(Calendar, { class: "ml-1" }),
231
+ createVNode(Calendar, { class: "ml-1 flex-shrink-0" }),
231
232
  createElementVNode("input", {
232
233
  type: "text",
233
234
  value: _ctx.modelValue,
234
- class: normalizeClass(["w-full px-2 outline-none text-sm text-word3 text-center", heightClass.value]),
235
+ class: normalizeClass(["w-full px-2 outline-none text-sm text-word3", heightClass.value]),
235
236
  placeholder: _ctx.placeholder,
236
237
  onFocus: showDatePick,
237
238
  onBlur: dateChangeHandle,
@@ -11,8 +11,8 @@ const _hoisted_6 = { class: "w-1/2 flex items-center" };
11
11
  const _hoisted_7 = { class: "flex-1 text-center font-medium text-sm" };
12
12
  const _hoisted_8 = { class: "w-10 inline-block" };
13
13
  const _hoisted_9 = { class: "font-medium" };
14
- const _hoisted_10 = { class: "flex" };
15
- const _hoisted_11 = { class: "w-64 px-2 pt-3 pb-1 relative overflow-hidden" };
14
+ const _hoisted_10 = { class: "flex justify-center" };
15
+ const _hoisted_11 = { class: "w-[252px] box-content pt-3 pb-1 relative overflow-hidden" };
16
16
  const _hoisted_12 = {
17
17
  class: "w-full text-center table-fixed cursor-pointer text-word3 select-none",
18
18
  cellpadding: "0",
@@ -20,7 +20,7 @@ const _hoisted_12 = {
20
20
  };
21
21
  const _hoisted_13 = ["onMouseenter"];
22
22
  const _hoisted_14 = ["onClick"];
23
- const _hoisted_15 = { class: "w-64 px-2 pt-3 pb-1 relative overflow-hidden" };
23
+ const _hoisted_15 = { class: "w-[252px] box-content pt-3 pb-1 relative overflow-hidden" };
24
24
  const _hoisted_16 = {
25
25
  class: "w-full text-center table-fixed cursor-pointer text-word3 select-none",
26
26
  cellpadding: "0",
@@ -47,7 +47,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
47
47
  const heightClass = computed(() => ({
48
48
  "h-10": props.size === "large",
49
49
  "h-9": props.size === "default",
50
- "h-8": props.size === "small"
50
+ "h-8": props.size === "small",
51
+ "h-7": props.size === "mini"
51
52
  }));
52
53
  const deleteDateHandle = () => {
53
54
  emit("update:modelValue", [null, null]);
@@ -320,7 +321,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
320
321
  onClick: showPopHandle,
321
322
  class: "inline-flex relative h-full w-full items-center overflow-hidden rounded border border-solid text-word3"
322
323
  }, [
323
- createVNode(Calendar, { class: "ml-1" }),
324
+ createVNode(Calendar, { class: "ml-1 flex-shrink-0" }),
324
325
  createElementVNode("input", {
325
326
  type: "text",
326
327
  value: inputOneShowValue.value,
@@ -406,22 +407,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
406
407
  (openBlock(true), createElementBlock(Fragment, null, renderList(i, (j) => {
407
408
  return openBlock(), createElementBlock("td", {
408
409
  key: j.d,
409
- class: "py-1",
410
+ class: "py-1 box-border",
410
411
  onMouseenter: ($event) => secondDaymoveHandle(j)
411
412
  }, [
412
413
  createElementVNode("div", {
413
- class: normalizeClass(["text-xs w-full h-7 leading-6 flex items-center justify-center", {
414
+ class: normalizeClass(["text-xs h-7 leading-6 relative", {
414
415
  "text-word9 cursor-default": j.pred || j.nextd,
415
416
  "bg-gray-200 text-word9 cursor-not-allowed": j.disabled,
416
417
  "bg-[#e6f4ff]": j.between || j.isChoosed1Day || j.isChoosed2Day,
417
- "rounded-l-[1.75rem]": j.isChoosed1Day,
418
- "rounded-r-[1.75rem]": j.isChoosed2Day
418
+ "rounded-l-[14px] ml-1": j.isChoosed1Day,
419
+ "rounded-r-[14px] mr-1": j.isChoosed2Day
419
420
  }]),
420
421
  onClick: ($event) => setAimdate(j)
421
422
  }, [
422
423
  createElementVNode("div", {
423
- class: normalizeClass(["w-6 h-6", {
424
- "bg-blue-500 rounded-full text-white": j.isChoosed1Day || j.isChoosed2Day
424
+ class: normalizeClass(["w-6 h-6 absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2", {
425
+ "bg-blue-500 rounded-full text-white": j.isChoosed1Day || j.isChoosed2Day,
426
+ "-ml-0.5": j.isChoosed1Day && !j.isChoosed2Day,
427
+ "ml-0.5": j.isChoosed2Day && !j.isChoosed1Day
425
428
  }])
426
429
  }, toDisplayString(j.d), 3)
427
430
  ], 10, _hoisted_14)
@@ -450,22 +453,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
450
453
  (openBlock(true), createElementBlock(Fragment, null, renderList(i, (j) => {
451
454
  return openBlock(), createElementBlock("td", {
452
455
  key: j.d,
453
- class: "py-1",
456
+ class: "py-1 box-border",
454
457
  onMouseenter: ($event) => secondDaymoveHandle(j)
455
458
  }, [
456
459
  createElementVNode("div", {
457
- class: normalizeClass(["text-xs w-full h-7 leading-6 flex items-center justify-center", {
460
+ class: normalizeClass(["text-xs h-7 leading-6 relative", {
458
461
  "text-word9 cursor-default": j.pred || j.nextd,
459
462
  "bg-gray-200 text-word9 cursor-not-allowed": j.disabled,
460
463
  "bg-[#e6f4ff]": j.between || j.isChoosed1Day || j.isChoosed2Day,
461
- "rounded-l-[1.75rem]": j.isChoosed1Day,
462
- "rounded-r-[1.75rem]": j.isChoosed2Day
464
+ "rounded-l-[14px] ml-1": j.isChoosed1Day,
465
+ "rounded-r-[14px] mr-1": j.isChoosed2Day
463
466
  }]),
464
467
  onClick: ($event) => setAimdate(j)
465
468
  }, [
466
469
  createElementVNode("div", {
467
- class: normalizeClass(["w-6 h-6", {
468
- "bg-blue-500 rounded-full text-white": j.isChoosed1Day || j.isChoosed2Day
470
+ class: normalizeClass(["w-6 h-6 absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2", {
471
+ "bg-blue-500 rounded-full text-white": j.isChoosed1Day || j.isChoosed2Day,
472
+ "-ml-0.5": j.isChoosed1Day && !j.isChoosed2Day,
473
+ "ml-0.5": j.isChoosed2Day && !j.isChoosed1Day
469
474
  }])
470
475
  }, toDisplayString(j.d), 3)
471
476
  ], 10, _hoisted_18)
@@ -1,5 +1,5 @@
1
- import { defineComponent, computed, watch, openBlock, createBlock, Teleport, createVNode, Transition, withCtx, withDirectives, createElementBlock, withModifiers, createElementVNode, normalizeClass, normalizeStyle, toDisplayString, createCommentVNode, renderSlot, unref } from "vue";
2
- import { c as createEscapeDirective, C as CloseIcon } from "../index/index.js";
1
+ import { defineComponent, computed, watch, openBlock, createBlock, Teleport, unref, withDirectives, createElementBlock, withModifiers, createElementVNode, normalizeClass, normalizeStyle, toDisplayString, createVNode, createCommentVNode, renderSlot } from "vue";
2
+ import { c as createEscapeDirective, s as selector, C as CloseIcon } from "../index/index.js";
3
3
  const _hoisted_1 = {
4
4
  key: 0,
5
5
  class: "flex w-full justify-between p-2"
@@ -37,7 +37,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
37
37
  return `${props.width}px`;
38
38
  }
39
39
  if (typeof props.width === "string") {
40
- const validUnit = /^(?:\d+(?:\.\d+)?)(?:px|%|em|rem|vw|vh)$/.test(props.width);
40
+ const validUnit = /^(?:\d+(?:\.\d+)?)(?:px|%|em|rem|vw|vh)$/.test(
41
+ props.width
42
+ );
41
43
  return validUnit ? props.width : `${props.width}px`;
42
44
  }
43
45
  return defaultWidth;
@@ -78,41 +80,38 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
78
80
  }
79
81
  });
80
82
  return (_ctx, _cache) => {
81
- return openBlock(), createBlock(Teleport, { to: "body" }, [
82
- createVNode(Transition, { name: "fade" }, {
83
- default: withCtx(() => [
84
- _ctx.visible ? withDirectives((openBlock(), createElementBlock("div", {
85
- key: 0,
86
- class: "fixed top-0 right-0 left-0 bottom-0 bg-black bg-opacity-30 text-sm z-1000",
87
- onClick: withModifiers(whiteSpaceClick, ["self"])
88
- }, [
89
- createElementVNode("div", {
90
- class: normalizeClass(["divide-y divide-gray-300 rounded drop-shadow mt-[20vh] mx-auto", { "w-96": !hasselfwidth.value, "bg-white": !_ctx.isDiy }]),
91
- style: normalizeStyle({ width: selfwidth.value })
83
+ return openBlock(), createBlock(Teleport, {
84
+ to: `#${unref(selector)}`
85
+ }, [
86
+ _ctx.visible ? withDirectives((openBlock(), createElementBlock("div", {
87
+ key: 0,
88
+ class: "fixed top-0 right-0 left-0 bottom-0 bg-black bg-opacity-30 text-sm z-1000",
89
+ onClick: withModifiers(whiteSpaceClick, ["self"])
90
+ }, [
91
+ createElementVNode("div", {
92
+ class: normalizeClass(["divide-y divide-gray-300 rounded drop-shadow mt-20 mx-auto", { "w-96": !hasselfwidth.value, "bg-white": !_ctx.isDiy }]),
93
+ style: normalizeStyle({ width: selfwidth.value })
94
+ }, [
95
+ showdefaultHand.value ? (openBlock(), createElementBlock("div", _hoisted_1, [
96
+ createElementVNode("span", null, toDisplayString(_ctx.title), 1),
97
+ createElementVNode("button", {
98
+ type: "button",
99
+ onClick: closeDialogHandle,
100
+ class: "appearance-none fill-gray-600"
92
101
  }, [
93
- showdefaultHand.value ? (openBlock(), createElementBlock("div", _hoisted_1, [
94
- createElementVNode("span", null, toDisplayString(_ctx.title), 1),
95
- createElementVNode("button", {
96
- type: "button",
97
- onClick: closeDialogHandle,
98
- class: "appearance-none fill-gray-600"
99
- }, [
100
- createVNode(CloseIcon)
101
- ])
102
- ])) : createCommentVNode("", true),
103
- createElementVNode("div", {
104
- class: normalizeClass({ "p-2": !_ctx.isDiy })
105
- }, [
106
- renderSlot(_ctx.$slots, "default")
107
- ], 2)
108
- ], 6)
109
- ])), [
110
- [unref(vEsc)]
111
- ]) : createCommentVNode("", true)
112
- ]),
113
- _: 3
114
- })
115
- ]);
102
+ createVNode(CloseIcon)
103
+ ])
104
+ ])) : createCommentVNode("", true),
105
+ createElementVNode("div", {
106
+ class: normalizeClass({ "p-2": !_ctx.isDiy })
107
+ }, [
108
+ renderSlot(_ctx.$slots, "default")
109
+ ], 2)
110
+ ], 6)
111
+ ])), [
112
+ [unref(vEsc), _ctx.visible]
113
+ ]) : createCommentVNode("", true)
114
+ ], 8, ["to"]);
116
115
  };
117
116
  }
118
117
  });
@@ -4,7 +4,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4
4
  props: {
5
5
  rule: {},
6
6
  model: {},
7
- inline: { type: Boolean, default: false }
7
+ inline: { type: Boolean, default: false },
8
+ labelPosition: { default: "right" }
8
9
  },
9
10
  setup(__props, { expose: __expose }) {
10
11
  const props = __props;
@@ -61,6 +62,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
61
62
  provide("_ParentRules_", props.rule);
62
63
  provide("_ParentModels_", readonly(toRef(props, "model")));
63
64
  provide("_ParentLineStatus_", toRef(props, "inline"));
65
+ provide("_ParentLabelPosition_", toRef(props, "labelPosition"));
64
66
  provide("_formRuleCheck_", (item, checkFunction) => {
65
67
  ruleCheck.set(item, checkFunction);
66
68
  });
@@ -1,5 +1,5 @@
1
- import { defineComponent, inject, ref, computed, provide, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, toDisplayString, renderSlot, createVNode, Transition, withCtx, createCommentVNode } from "vue";
2
- const _hoisted_1 = { class: "relative flex-1 items-center h-full leading-8 flex" };
1
+ import { defineComponent, computed, inject, ref, provide, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, toDisplayString, createCommentVNode, renderSlot, createVNode, Transition, withCtx } from "vue";
2
+ const _hoisted_1 = { class: "relative flex-1 flex" };
3
3
  const _hoisted_2 = {
4
4
  key: 0,
5
5
  class: "absolute -bottom-5 left-0 text-xs text-red-600"
@@ -10,15 +10,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
10
10
  label: {},
11
11
  prop: {},
12
12
  inline: { type: Boolean, default: void 0 },
13
- width: { default: 70 }
13
+ width: { default: 70 },
14
+ showRequire: { type: Boolean, default: false },
15
+ labelPosition: { default: void 0 }
14
16
  },
15
17
  setup(__props, { expose: __expose }) {
16
18
  const props = __props;
19
+ const haslabel = computed(() => !!props.label);
17
20
  const Rules = inject("_ParentRules_", {});
18
21
  const Model = inject("_ParentModels_", ref());
19
22
  const sendCheck = inject("_formRuleCheck_", () => null);
20
23
  const sendClear = inject("_validateClear_", () => null);
21
24
  const parentLineStatus = inject("_ParentLineStatus_", ref());
25
+ const parentLabelPosition = inject("_ParentLabelPosition_", ref());
22
26
  const getThisRule = computed(() => {
23
27
  if (!props.prop) {
24
28
  return [];
@@ -32,9 +36,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
32
36
  return parentLineStatus.value;
33
37
  }
34
38
  });
39
+ const labelPosition = computed(() => {
40
+ if (props.labelPosition) {
41
+ return props.labelPosition;
42
+ } else {
43
+ return parentLabelPosition.value;
44
+ }
45
+ });
35
46
  const checkPropHandle = async (callBack, eventName) => {
36
47
  if (!props.prop)
37
48
  return;
49
+ if (getThisRule.value.length === 0) {
50
+ callBack && callBack(true);
51
+ return;
52
+ }
38
53
  const setErrHandle = (errword) => {
39
54
  if (errword)
40
55
  tip.value = errword;
@@ -102,7 +117,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
102
117
  });
103
118
  });
104
119
  };
105
- sendCheck(props.prop, checkPropHandle);
120
+ props.prop && sendCheck(props.prop, checkPropHandle);
106
121
  sendClear(resetField);
107
122
  provide("inputHandle", () => checkPropHandle(void 0, "input"));
108
123
  provide("blurHandle", () => checkPropHandle(void 0, "blur"));
@@ -112,12 +127,28 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
112
127
  });
113
128
  return (_ctx, _cache) => {
114
129
  return openBlock(), createElementBlock("div", {
115
- class: normalizeClass(["mb-5", { "inline-flex mr-5": isInline.value, "flex flex-col": !isInline.value }])
130
+ class: normalizeClass([
131
+ "mb-5 h-full leading-8",
132
+ isInline.value ? "inline-flex mr-5" : labelPosition.value === "top" ? "flex flex-col" : "inline-flex w-full"
133
+ ])
116
134
  }, [
117
- createElementVNode("div", {
118
- class: "text-sm flex items-center",
135
+ haslabel.value ? (openBlock(), createElementBlock("div", {
136
+ key: 0,
137
+ class: normalizeClass([
138
+ "text-sm flex items-center h-8",
139
+ {
140
+ "text-right": labelPosition.value === "right",
141
+ "text-left": labelPosition.value === "left"
142
+ }
143
+ ]),
119
144
  style: normalizeStyle({ width: `${_ctx.width}px` })
120
- }, toDisplayString(_ctx.label), 5),
145
+ }, [
146
+ createElementVNode("span", {
147
+ class: normalizeClass({
148
+ "before:content-['*'] before:text-[#E4391D] before:mr-1": _ctx.showRequire
149
+ })
150
+ }, toDisplayString(_ctx.label), 3)
151
+ ], 6)) : createCommentVNode("", true),
121
152
  createElementVNode("div", _hoisted_1, [
122
153
  renderSlot(_ctx.$slots, "default"),
123
154
  createVNode(Transition, { name: "opecity" }, {
@@ -181,10 +181,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
181
181
  })
182
182
  }, null, 14, _hoisted_6)
183
183
  ], 4)), [
184
- [unref(vMove)]
184
+ [unref(vMove), showBig.value]
185
185
  ])
186
186
  ])), [
187
- [unref(vWheel)]
187
+ [unref(vWheel), showBig.value]
188
188
  ])
189
189
  ])) : createCommentVNode("", true)
190
190
  ]),