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.
- package/dist/components/alert/alert.d.ts +3 -11
- package/dist/components/alert/alertcomponent.vue.d.ts +22 -11
- package/dist/components/badge/badge.vue.d.ts +2 -0
- package/dist/components/carousel/carousel.vue.d.ts +29 -3
- package/dist/components/{tree/tree.vue.d.ts → carousel/clickbutton.vue.d.ts} +6 -19
- package/dist/components/check/checkbox.vue.d.ts +24 -16
- package/dist/components/check/checkgroup.vue.d.ts +15 -3
- package/dist/components/date/datepicker.vue.d.ts +28 -6
- package/dist/components/date/datepickerRange.vue.d.ts +15 -4
- package/dist/components/form/form.vue.d.ts +7 -20
- package/dist/components/form/formlabel.vue.d.ts +3 -3
- package/dist/components/form/type.d.ts +11 -0
- package/dist/components/icon/add.vue.d.ts +2 -0
- package/dist/components/icon/alertTip.vue.d.ts +2 -0
- package/dist/components/icon/arrow.vue.d.ts +2 -0
- package/dist/components/icon/calendar.vue.d.ts +2 -0
- package/dist/components/icon/close.vue.d.ts +2 -0
- package/dist/components/icon/dateArrow.vue.d.ts +2 -0
- package/dist/components/icon/dateArrowplus.vue.d.ts +2 -0
- package/dist/components/icon/delete.vue.d.ts +2 -0
- package/dist/components/icon/ellipsis.vue.d.ts +2 -0
- package/dist/components/icon/errTip.vue.d.ts +2 -0
- package/dist/components/icon/eye.vue.d.ts +2 -0
- package/dist/components/icon/infoTip.vue.d.ts +2 -0
- package/dist/components/icon/minus.vue.d.ts +2 -0
- package/dist/components/icon/successTip.vue.d.ts +2 -0
- package/dist/components/icon/turnleft.vue.d.ts +2 -0
- package/dist/components/icon/turnright.vue.d.ts +2 -0
- package/dist/components/icon/warnTip.vue.d.ts +2 -0
- package/dist/components/input/input.vue.d.ts +13 -8
- package/dist/components/loadding/loadcomponent.vue.d.ts +24 -4
- package/dist/components/loadding/loadding.d.ts +12 -19
- package/dist/components/menu/menu.vue.d.ts +13 -3
- package/dist/components/message/message.d.ts +68 -14
- package/dist/components/message/messagecomponent.vue.d.ts +5 -13
- package/dist/components/numberInput/numberinput.vue.d.ts +3 -3
- package/dist/components/pagination/pagination.vue.d.ts +24 -0
- package/dist/components/popover/poparrow.d.ts +55 -0
- package/dist/components/popover/popover.vue.d.ts +10 -4
- package/dist/components/radio/radiobox.vue.d.ts +24 -16
- package/dist/components/radio/radiogroup.vue.d.ts +15 -3
- package/dist/components/scrollBar/movebar.vue.d.ts +2 -2
- package/dist/components/scrollBar/scrollBar.vue.d.ts +12 -16
- package/dist/components/scrollloading/scrolllead.d.ts +18 -11
- package/dist/components/select/select.vue.d.ts +15 -1
- package/dist/components/select/selectoption.vue.d.ts +18 -6
- package/dist/components/switch/switch.vue.d.ts +14 -14
- package/dist/components/table/table.vue.d.ts +20 -9
- package/dist/components/table/tableItem.vue.d.ts +10 -4
- package/dist/components/tabs/tabs.vue.d.ts +14 -1
- package/dist/dialog.css +9 -0
- package/dist/directives/arrowKeys.d.ts +10 -0
- package/dist/directives/drag.d.ts +20 -0
- package/dist/directives/escape.d.ts +7 -0
- package/dist/directives/outsideclick.d.ts +14 -0
- package/dist/directives/watchwindow.d.ts +13 -0
- package/dist/directives/wheel.d.ts +12 -0
- package/dist/directives/whitespaceclick.d.ts +12 -0
- package/dist/index.css +1186 -873
- package/dist/index.d.ts +831 -401
- package/dist/index.es.js +22 -23
- package/dist/index.umd.js +4019 -3764
- package/dist/js/arrow/arrow.js +17 -0
- package/dist/js/badge/badge.js +9 -16
- package/dist/js/calendar/calendar.js +87 -0
- package/dist/js/carousel/carousel.js +101 -117
- package/dist/js/carousel/carouselitem.js +1 -7
- package/dist/js/check/checkbox.js +38 -4
- package/dist/js/check/checkgroup.js +40 -51
- package/dist/js/date/datepicker.js +146 -150
- package/dist/js/date/datepickerRange.js +265 -354
- package/dist/js/dateArrowplus/dateArrowplus.js +25 -0
- package/dist/js/delete/delete.js +19 -0
- package/dist/js/dialog/dialog.js +41 -57
- package/dist/js/form/form.js +30 -38
- package/dist/js/form/formlabel.js +99 -130
- package/dist/js/image/image.js +199 -149
- package/dist/js/index/index.js +605 -507
- package/dist/js/input/input.js +60 -43
- package/dist/js/menu/menu.js +47 -20
- package/dist/js/numberInput/numberinput.js +52 -60
- package/dist/js/pagination/pagination.js +125 -156
- package/dist/js/popover/popover.js +238 -134
- package/dist/js/radio/radiobox.js +37 -4
- package/dist/js/radio/radiogroup.js +15 -51
- package/dist/js/scrollBar/scrollBar.js +100 -56
- package/dist/js/select/select.js +155 -70
- package/dist/js/select/selectoption.js +45 -4
- package/dist/js/shapeFlag/shapeFlag.js +17 -0
- package/dist/js/switch/switch.js +14 -14
- package/dist/js/table/table.js +165 -111
- package/dist/js/table/tableItem.js +1 -1
- package/dist/js/tabs/tabs.js +57 -59
- package/dist/js/upload/upload.js +8 -23
- package/dist/tabs.css +3 -3
- package/dist/types/shapeFlag.d.ts +13 -0
- package/dist/{components/utils → utils}/tool.d.ts +11 -4
- package/package.json +1 -1
- package/dist/badge.css +0 -27
- package/dist/carousel.css +0 -13
- package/dist/checkgroup.css +0 -41
- package/dist/datepickerRange.css +0 -79
- package/dist/image.css +0 -8
- package/dist/js/getcalendar/getcalendar.js +0 -48
- package/dist/js/tree/tree.js +0 -72
- package/dist/js/tree/treeleaf.js +0 -116
- package/dist/radiogroup.css +0 -44
- package/dist/scrollBar.css +0 -37
- package/dist/select.css +0 -20
|
@@ -1,5 +1,170 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, nextTick,
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent, h, normalizeClass, normalizeStyle, ref, computed, nextTick, openBlock, createElementBlock, withModifiers, renderSlot, createBlock, Teleport, createVNode, Transition, withCtx, withDirectives, unref, vShow } from "vue";
|
|
2
|
+
import { d as debounce, u as usePotion, c as createEscapeDirective } from "../index/index.js";
|
|
3
|
+
const DEFAULT_DEBOUNCE_WAIT$1 = 100;
|
|
4
|
+
const createBgClickDirective = (options) => {
|
|
5
|
+
const config = {
|
|
6
|
+
debounceWait: DEFAULT_DEBOUNCE_WAIT$1,
|
|
7
|
+
moveModel: false,
|
|
8
|
+
onCheckOut: () => {
|
|
9
|
+
},
|
|
10
|
+
...options
|
|
11
|
+
};
|
|
12
|
+
const bindEvents = (el, binding) => {
|
|
13
|
+
if (el._checkout_handlers_)
|
|
14
|
+
return;
|
|
15
|
+
const clickDom = debounce((e) => {
|
|
16
|
+
e.preventDefault();
|
|
17
|
+
config.onCheckOut(e, el);
|
|
18
|
+
}, config.debounceWait);
|
|
19
|
+
el._checkout_handlers_ = {
|
|
20
|
+
click: clickDom
|
|
21
|
+
};
|
|
22
|
+
if (config.moveModel) {
|
|
23
|
+
document.addEventListener("mousemove", clickDom);
|
|
24
|
+
} else {
|
|
25
|
+
document.addEventListener("click", clickDom);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const unbindEvents = (el) => {
|
|
29
|
+
if (el._checkout_handlers_) {
|
|
30
|
+
if (config.moveModel) {
|
|
31
|
+
document.removeEventListener("mousemove", el._checkout_handlers_.click);
|
|
32
|
+
} else {
|
|
33
|
+
document.removeEventListener("click", el._checkout_handlers_.click);
|
|
34
|
+
}
|
|
35
|
+
delete el._checkout_handlers_;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
return {
|
|
39
|
+
mounted(el, binding) {
|
|
40
|
+
bindEvents(el);
|
|
41
|
+
},
|
|
42
|
+
beforeUnmount(el) {
|
|
43
|
+
unbindEvents(el);
|
|
44
|
+
},
|
|
45
|
+
// 添加 updated 钩子处理配置变化
|
|
46
|
+
updated(el, binding) {
|
|
47
|
+
if (binding.value !== binding.oldValue) {
|
|
48
|
+
unbindEvents(el);
|
|
49
|
+
bindEvents(el);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
const DEFAULT_DEBOUNCE_WAIT = 100;
|
|
55
|
+
const createScrollDirective = (options) => {
|
|
56
|
+
const config = {
|
|
57
|
+
debounceWait: DEFAULT_DEBOUNCE_WAIT,
|
|
58
|
+
onMove: () => {
|
|
59
|
+
},
|
|
60
|
+
...options
|
|
61
|
+
};
|
|
62
|
+
const bindEvents = (el, binding) => {
|
|
63
|
+
if (el._watchwindow_handlers_) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const moveDom = debounce((e) => {
|
|
67
|
+
e.preventDefault();
|
|
68
|
+
config.onMove();
|
|
69
|
+
}, config.debounceWait);
|
|
70
|
+
el._watchwindow_handlers_ = {
|
|
71
|
+
move: moveDom
|
|
72
|
+
};
|
|
73
|
+
window.addEventListener("resize", el._watchwindow_handlers_.move);
|
|
74
|
+
window.addEventListener("scroll", el._watchwindow_handlers_.move);
|
|
75
|
+
};
|
|
76
|
+
const unbindEvents = (el) => {
|
|
77
|
+
if (el._watchwindow_handlers_) {
|
|
78
|
+
window.removeEventListener("resize", el._watchwindow_handlers_.move);
|
|
79
|
+
window.removeEventListener("scroll", el._watchwindow_handlers_.move);
|
|
80
|
+
delete el._watchwindow_handlers_;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
return {
|
|
84
|
+
mounted(el, binding) {
|
|
85
|
+
bindEvents(el);
|
|
86
|
+
},
|
|
87
|
+
beforeUnmount(el) {
|
|
88
|
+
unbindEvents(el);
|
|
89
|
+
},
|
|
90
|
+
// 添加 updated 钩子处理配置变化
|
|
91
|
+
updated(el, binding) {
|
|
92
|
+
if (binding.value !== binding.oldValue) {
|
|
93
|
+
unbindEvents(el);
|
|
94
|
+
bindEvents(el);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
const PLACEMENT_GROUPS = {
|
|
100
|
+
top: ["topleft", "topmiddle", "topright"],
|
|
101
|
+
bottom: ["bottomleft", "bottommiddle", "bottomright"],
|
|
102
|
+
center: ["centerleft", "centerright"]
|
|
103
|
+
};
|
|
104
|
+
const ARROW_CLASSES = {
|
|
105
|
+
base: 'absolute w-2.5 h-2.5 before:z-[-1] before:border before:border-gray-300 before:bg-white before:content-border before:rotate-45 before:content-[" "] before:w-2.5 before:h-2.5 before:absolute',
|
|
106
|
+
top: {
|
|
107
|
+
normal: "before:border-t-transparent before:border-l-transparent before:rounded-br",
|
|
108
|
+
exchange: "before:border-b-transparent before:border-r-transparent before:rounded-tl"
|
|
109
|
+
},
|
|
110
|
+
bottom: {
|
|
111
|
+
normal: "before:border-b-transparent before:border-r-transparent before:rounded-tl",
|
|
112
|
+
exchange: "before:border-t-transparent before:border-l-transparent before:rounded-br"
|
|
113
|
+
},
|
|
114
|
+
center: {
|
|
115
|
+
right: "before:border-r-transparent before:border-t-transparent before:rounded-bl",
|
|
116
|
+
left: "before:border-l-transparent before:border-b-transparent before:rounded-tr"
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
const arrowComponent = defineComponent({
|
|
120
|
+
name: "PopArrow",
|
|
121
|
+
props: {
|
|
122
|
+
arrowLeft: { type: Number, required: true },
|
|
123
|
+
arrowTop: { type: Number, required: true },
|
|
124
|
+
placement: { type: String, required: true },
|
|
125
|
+
arrowshow: { type: Boolean, required: true },
|
|
126
|
+
exChange: { type: Boolean, required: true },
|
|
127
|
+
beforebgcolor: { type: String }
|
|
128
|
+
},
|
|
129
|
+
setup(props) {
|
|
130
|
+
const getArrowStyles = () => {
|
|
131
|
+
const { placement, exChange, arrowLeft, arrowTop } = props;
|
|
132
|
+
const isTopGroup = PLACEMENT_GROUPS.top.includes(placement);
|
|
133
|
+
const isBottomGroup = PLACEMENT_GROUPS.bottom.includes(placement);
|
|
134
|
+
const isCenterGroup = PLACEMENT_GROUPS.center.includes(placement);
|
|
135
|
+
return {
|
|
136
|
+
left: isTopGroup || isBottomGroup ? `${arrowLeft}px` : placement === "centerright" ? "-5px" : null,
|
|
137
|
+
right: placement === "centerleft" ? "-5px" : null,
|
|
138
|
+
top: isCenterGroup ? `${arrowTop}px` : isBottomGroup && !exChange || isTopGroup && exChange ? "-5px" : null,
|
|
139
|
+
bottom: isTopGroup && !exChange || isBottomGroup && exChange ? "-5px" : null
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
const getArrowClasses = () => {
|
|
143
|
+
const { placement, exChange, beforebgcolor } = props;
|
|
144
|
+
const classes = [ARROW_CLASSES.base, beforebgcolor];
|
|
145
|
+
if (PLACEMENT_GROUPS.top.includes(placement)) {
|
|
146
|
+
classes.push(exChange ? ARROW_CLASSES.top.exchange : ARROW_CLASSES.top.normal);
|
|
147
|
+
}
|
|
148
|
+
if (PLACEMENT_GROUPS.bottom.includes(placement)) {
|
|
149
|
+
classes.push(exChange ? ARROW_CLASSES.bottom.exchange : ARROW_CLASSES.bottom.normal);
|
|
150
|
+
}
|
|
151
|
+
if (placement === "centerright") {
|
|
152
|
+
classes.push(ARROW_CLASSES.center.right);
|
|
153
|
+
}
|
|
154
|
+
if (placement === "centerleft") {
|
|
155
|
+
classes.push(ARROW_CLASSES.center.left);
|
|
156
|
+
}
|
|
157
|
+
return classes;
|
|
158
|
+
};
|
|
159
|
+
if (!props.arrowshow)
|
|
160
|
+
return;
|
|
161
|
+
return () => h("span", {
|
|
162
|
+
class: normalizeClass(getArrowClasses()),
|
|
163
|
+
style: normalizeStyle(getArrowStyles())
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
const defaultWidth = "200px";
|
|
3
168
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
169
|
__name: "popover",
|
|
5
170
|
props: {
|
|
@@ -10,99 +175,45 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
10
175
|
beforeHidden: {},
|
|
11
176
|
modelValue: { type: Boolean },
|
|
12
177
|
beforebgcolor: {},
|
|
13
|
-
arrowshow: { type: Boolean, default: true }
|
|
178
|
+
arrowshow: { type: Boolean, default: true },
|
|
179
|
+
isselectMode: { type: Boolean, default: false }
|
|
14
180
|
},
|
|
15
181
|
emits: ["update:modelValue"],
|
|
16
182
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
17
183
|
const props = __props;
|
|
18
|
-
const bindName = ref("body");
|
|
19
184
|
const base = ref();
|
|
20
185
|
const pop = ref();
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (showPop.value || props.trigger === "native" && props.modelValue) {
|
|
26
|
-
nextTick(() => {
|
|
27
|
-
setPosition();
|
|
28
|
-
});
|
|
29
|
-
} else {
|
|
30
|
-
window.removeEventListener("resize", setPosition);
|
|
31
|
-
window.removeEventListener("scroll", setPosition, true);
|
|
186
|
+
const isLocalOpen = ref(false);
|
|
187
|
+
const shouldShow = computed(() => {
|
|
188
|
+
if (isLocalOpen.value || props.trigger === "native" && props.modelValue) {
|
|
189
|
+
nextTick(setPosition);
|
|
32
190
|
}
|
|
33
191
|
if (props.trigger === "native") {
|
|
34
192
|
return props.modelValue;
|
|
35
193
|
} else {
|
|
36
|
-
return
|
|
194
|
+
return isLocalOpen.value;
|
|
37
195
|
}
|
|
38
196
|
});
|
|
39
197
|
const emitAct = __emit;
|
|
40
198
|
const marginClass = computed(() => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
break;
|
|
53
|
-
case "centerleft":
|
|
54
|
-
margin = "-tdd-ml-3";
|
|
55
|
-
break;
|
|
56
|
-
case "centerright":
|
|
57
|
-
margin = "tdd-ml-3";
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
return margin;
|
|
199
|
+
const marginMap = {
|
|
200
|
+
topleft: "-mt-3",
|
|
201
|
+
topmiddle: "-mt-3",
|
|
202
|
+
topright: "-mt-3",
|
|
203
|
+
bottomleft: "mt-3",
|
|
204
|
+
bottommiddle: "mt-3",
|
|
205
|
+
bottomright: "mt-3",
|
|
206
|
+
centerleft: "-ml-3",
|
|
207
|
+
centerright: "ml-3"
|
|
208
|
+
};
|
|
209
|
+
return marginMap[props.placement];
|
|
61
210
|
});
|
|
62
|
-
const styleConditions = {
|
|
63
|
-
left: (placement) => ["topleft", "topmiddle", "topright", "bottomleft", "bottommiddle", "bottomright"].includes(placement) ? `${arrowLeft.value}px` : "centerright" == placement ? "-5px" : null,
|
|
64
|
-
right: (placement) => "centerleft" == placement ? "-5px" : null,
|
|
65
|
-
top: (placement, exChange2) => ["bottomleft", "bottommiddle", "bottomright"].includes(placement) && !exChange2 ? "-5px" : ["topleft", "topmiddle", "topright"].includes(placement) && exChange2 ? "-5px" : ["centerright", "centerleft"].includes(placement) ? `${arrowTop.value}px` : null,
|
|
66
|
-
bottom: (placement, exChange2) => ["topleft", "topmiddle", "topright"].includes(placement) && !exChange2 ? "-5px" : ["bottomleft", "bottommiddle", "bottomright"].includes(placement) && exChange2 ? "-5px" : null
|
|
67
|
-
};
|
|
68
|
-
const arrowHandle = () => {
|
|
69
|
-
const resultStyles = {};
|
|
70
|
-
for (const styleName in styleConditions) {
|
|
71
|
-
const condition = styleConditions[styleName];
|
|
72
|
-
if (typeof condition === "function") {
|
|
73
|
-
resultStyles[styleName] = condition(props.placement, exChange.value);
|
|
74
|
-
} else if (condition) {
|
|
75
|
-
resultStyles[styleName] = condition;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
const publicClass = "tdd-absolute tdd-z-1000 tdd-w-2.5 tdd-h-2.5 before:tdd-z-[-1] before:tdd-border before:tdd-border-gray-300 before:tdd-bg-white before:tdd-content-border before:tdd-rotate-45 before:tdd-content-[' '] before:tdd-w-2.5 before:tdd-h-2.5 before:tdd-absolute";
|
|
79
|
-
return h(
|
|
80
|
-
"span",
|
|
81
|
-
{
|
|
82
|
-
class: normalizeClass(
|
|
83
|
-
[
|
|
84
|
-
publicClass,
|
|
85
|
-
["topleft", "topmiddle", "topright"].includes(props.placement) && !exChange.value ? "before:tdd-border-t-transparent before:tdd-border-l-transparent before:tdd-rounded-br" : "",
|
|
86
|
-
["topleft", "topmiddle", "topright"].includes(props.placement) && exChange.value ? "before:tdd-border-b-transparent before:tdd-border-r-transparent before:tdd-rounded-tl" : "",
|
|
87
|
-
["bottomleft", "bottommiddle", "bottomright"].includes(props.placement) && !exChange.value ? "before:tdd-border-b-transparent before:tdd-border-r-transparent before:tdd-rounded-tl" : "",
|
|
88
|
-
["bottomleft", "bottommiddle", "bottomright"].includes(props.placement) && exChange.value ? "before:tdd-border-t-transparent before:tdd-border-l-transparent before:tdd-rounded-br" : "",
|
|
89
|
-
"centerright" == props.placement ? "before:tdd-border-r-transparent before:tdd-border-t-transparent before:tdd-rounded-bl" : "",
|
|
90
|
-
"centerleft" == props.placement ? "before:tdd-border-l-transparent before:tdd-border-b-transparent before:tdd-rounded-tr" : "",
|
|
91
|
-
props.beforebgcolor
|
|
92
|
-
]
|
|
93
|
-
),
|
|
94
|
-
style: normalizeStyle(
|
|
95
|
-
resultStyles
|
|
96
|
-
)
|
|
97
|
-
}
|
|
98
|
-
);
|
|
99
|
-
};
|
|
100
211
|
const showHandle = () => {
|
|
101
|
-
|
|
212
|
+
isLocalOpen.value = true;
|
|
102
213
|
};
|
|
103
214
|
const hovershowHandle = () => {
|
|
104
215
|
if (props.trigger === "hover") {
|
|
105
|
-
|
|
216
|
+
isLocalOpen.value = true;
|
|
106
217
|
}
|
|
107
218
|
};
|
|
108
219
|
const Left = ref(0);
|
|
@@ -113,11 +224,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
113
224
|
const setPosition = () => {
|
|
114
225
|
const { top, bottom } = base.value.getBoundingClientRect();
|
|
115
226
|
if (top < 0 || bottom > window.innerHeight) {
|
|
116
|
-
|
|
117
|
-
emitAct("update:modelValue", false);
|
|
118
|
-
} else {
|
|
119
|
-
showPop.value = false;
|
|
120
|
-
}
|
|
227
|
+
hideHandle();
|
|
121
228
|
return;
|
|
122
229
|
}
|
|
123
230
|
const position = usePotion(base.value, pop.value, {
|
|
@@ -128,41 +235,36 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
128
235
|
arrowTop.value = position.arrowTop;
|
|
129
236
|
arrowLeft.value = position.arrowLeft;
|
|
130
237
|
exChange.value = position.exChange;
|
|
131
|
-
window.addEventListener("resize", setPosition);
|
|
132
|
-
window.addEventListener("scroll", setPosition, true);
|
|
133
238
|
};
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
case "hover":
|
|
152
|
-
document.addEventListener("mousemove", el._vueClickOutside_);
|
|
153
|
-
break;
|
|
239
|
+
const vScroll = createScrollDirective({
|
|
240
|
+
onMove: () => {
|
|
241
|
+
if (shouldShow.value == false)
|
|
242
|
+
return;
|
|
243
|
+
setPosition();
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
const vClickoutside = createBgClickDirective({
|
|
247
|
+
onCheckOut: (event, el) => {
|
|
248
|
+
if (shouldShow.value == false)
|
|
249
|
+
return;
|
|
250
|
+
if (el.contains(event.target)) {
|
|
251
|
+
return;
|
|
252
|
+
} else if (base.value.contains(event.target)) {
|
|
253
|
+
return;
|
|
254
|
+
} else {
|
|
255
|
+
closeCenter();
|
|
154
256
|
}
|
|
155
257
|
},
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
258
|
+
moveModel: props.trigger === "hover"
|
|
259
|
+
});
|
|
260
|
+
const vEsc = createEscapeDirective({
|
|
261
|
+
onEscape: () => {
|
|
262
|
+
if (shouldShow.value == false)
|
|
263
|
+
return;
|
|
264
|
+
console.log("work");
|
|
265
|
+
hideHandle();
|
|
164
266
|
}
|
|
165
|
-
};
|
|
267
|
+
});
|
|
166
268
|
const closeCenter = () => {
|
|
167
269
|
if (props.beforeHidden) {
|
|
168
270
|
props.beforeHidden(hideHandle);
|
|
@@ -177,61 +279,63 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
177
279
|
if (props.trigger === "native") {
|
|
178
280
|
emitAct("update:modelValue", false);
|
|
179
281
|
} else {
|
|
180
|
-
|
|
282
|
+
isLocalOpen.value = false;
|
|
181
283
|
}
|
|
182
284
|
}
|
|
183
285
|
};
|
|
184
286
|
const widthNum = computed(() => {
|
|
287
|
+
if (!props.width)
|
|
288
|
+
return defaultWidth;
|
|
185
289
|
if (typeof props.width === "number") {
|
|
186
290
|
return `${props.width}px`;
|
|
187
291
|
} else if (typeof props.width === "string") {
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
return "200px";
|
|
193
|
-
} else {
|
|
194
|
-
return `${Number(props.width)}px`;
|
|
195
|
-
}
|
|
196
|
-
} else {
|
|
197
|
-
return "200px";
|
|
292
|
+
const validUnit = /^(?:\d+(?:\.\d+)?)(?:px|%|em|rem|vw|vh)$/.test(
|
|
293
|
+
props.width
|
|
294
|
+
);
|
|
295
|
+
return validUnit ? props.width : `${props.width}px`;
|
|
198
296
|
}
|
|
199
|
-
|
|
200
|
-
onUnmounted(() => {
|
|
201
|
-
window.removeEventListener("resize", setPosition);
|
|
202
|
-
window.removeEventListener("scroll", setPosition, true);
|
|
297
|
+
return defaultWidth;
|
|
203
298
|
});
|
|
204
299
|
__expose({
|
|
205
300
|
hideHandle
|
|
206
301
|
});
|
|
207
302
|
return (_ctx, _cache) => {
|
|
208
303
|
return openBlock(), createElementBlock("div", {
|
|
209
|
-
class: "
|
|
304
|
+
class: "inline-block w-full h-full",
|
|
210
305
|
ref_key: "base",
|
|
211
306
|
ref: base,
|
|
212
307
|
onClick: showHandle,
|
|
213
308
|
onMouseenter: withModifiers(hovershowHandle, ["prevent"])
|
|
214
309
|
}, [
|
|
215
310
|
renderSlot(_ctx.$slots, "reference"),
|
|
216
|
-
(openBlock(), createBlock(Teleport, { to:
|
|
311
|
+
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
217
312
|
createVNode(Transition, { name: "opecity" }, {
|
|
218
313
|
default: withCtx(() => [
|
|
219
314
|
withDirectives((openBlock(), createElementBlock("div", {
|
|
220
315
|
ref_key: "pop",
|
|
221
316
|
ref: pop,
|
|
222
|
-
class: normalizeClass(["
|
|
317
|
+
class: normalizeClass(["absolute z-1000 rounded bg-white p-4 drop-shadow border border-gray-300 box-border", [marginClass.value, _ctx.insertClass]]),
|
|
223
318
|
style: normalizeStyle({ width: widthNum.value, top: `${Top.value}px`, left: `${Left.value}px` })
|
|
224
319
|
}, [
|
|
225
320
|
renderSlot(_ctx.$slots, "default"),
|
|
226
|
-
|
|
321
|
+
createVNode(unref(arrowComponent), {
|
|
322
|
+
arrowLeft: arrowLeft.value,
|
|
323
|
+
arrowTop: arrowTop.value,
|
|
324
|
+
exChange: exChange.value,
|
|
325
|
+
beforebgcolor: _ctx.beforebgcolor,
|
|
326
|
+
placement: _ctx.placement,
|
|
327
|
+
arrowshow: _ctx.arrowshow
|
|
328
|
+
}, null, 8, ["arrowLeft", "arrowTop", "exChange", "beforebgcolor", "placement", "arrowshow"])
|
|
227
329
|
], 6)), [
|
|
228
|
-
[vShow,
|
|
229
|
-
[vClickoutside,
|
|
330
|
+
[vShow, shouldShow.value],
|
|
331
|
+
[unref(vClickoutside)],
|
|
332
|
+
[unref(vEsc)],
|
|
333
|
+
[unref(vScroll)]
|
|
230
334
|
])
|
|
231
335
|
]),
|
|
232
336
|
_: 3
|
|
233
337
|
})
|
|
234
|
-
]
|
|
338
|
+
]))
|
|
235
339
|
], 544);
|
|
236
340
|
};
|
|
237
341
|
}
|
|
@@ -1,13 +1,46 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, inject, ref, computed, openBlock, createElementBlock, normalizeClass, withDirectives, createElementVNode, vModelRadio, toDisplayString } from "vue";
|
|
2
|
+
const _hoisted_1 = ["value", "disabled"];
|
|
3
|
+
const _hoisted_2 = { class: "pl-2 peer-disabled:text-word9" };
|
|
2
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
3
5
|
__name: "radiobox",
|
|
4
6
|
props: {
|
|
5
7
|
label: {},
|
|
6
|
-
|
|
8
|
+
value: {},
|
|
9
|
+
modelValue: {},
|
|
10
|
+
disabled: { type: Boolean, default: false },
|
|
11
|
+
button: { type: Boolean }
|
|
7
12
|
},
|
|
8
|
-
|
|
13
|
+
emits: ["update:modelValue"],
|
|
14
|
+
setup(__props, { emit: __emit }) {
|
|
15
|
+
const props = __props;
|
|
16
|
+
const changeHandle = inject("_changeHandle_", (_) => {
|
|
17
|
+
});
|
|
18
|
+
const checkedValues = inject("_checkedValues_", ref());
|
|
19
|
+
const checkedState = computed({
|
|
20
|
+
get: () => {
|
|
21
|
+
return props.modelValue || (checkedValues == null ? void 0 : checkedValues.value);
|
|
22
|
+
},
|
|
23
|
+
set: (val) => {
|
|
24
|
+
emit("update:modelValue", val);
|
|
25
|
+
changeHandle(val);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const emit = __emit;
|
|
9
29
|
return (_ctx, _cache) => {
|
|
10
|
-
return
|
|
30
|
+
return openBlock(), createElementBlock("label", {
|
|
31
|
+
class: normalizeClass(["select-none inline-flex items-center", { "cursor-not-allowed": _ctx.disabled }])
|
|
32
|
+
}, [
|
|
33
|
+
withDirectives(createElementVNode("input", {
|
|
34
|
+
type: "radio",
|
|
35
|
+
value: _ctx.value,
|
|
36
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => checkedState.value = $event),
|
|
37
|
+
disabled: _ctx.disabled,
|
|
38
|
+
class: "peer disabled:cursor-not-allowed form-tick appearance-none h-4 w-4 rounded-full border border-gray-300 checked:border-transparent checked:bg-blue-600 focus:outline-none"
|
|
39
|
+
}, null, 8, _hoisted_1), [
|
|
40
|
+
[vModelRadio, checkedState.value]
|
|
41
|
+
]),
|
|
42
|
+
createElementVNode("span", _hoisted_2, toDisplayString(_ctx.label), 1)
|
|
43
|
+
], 2);
|
|
11
44
|
};
|
|
12
45
|
}
|
|
13
46
|
});
|
|
@@ -1,69 +1,33 @@
|
|
|
1
|
-
import { defineComponent, inject,
|
|
1
|
+
import { defineComponent, inject, provide, computed, openBlock, createElementBlock, renderSlot } from "vue";
|
|
2
2
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
3
3
|
__name: "radiogroup",
|
|
4
4
|
props: {
|
|
5
5
|
modelValue: {},
|
|
6
|
-
showinput: { type: Boolean, default: false }
|
|
6
|
+
showinput: { type: Boolean, default: false },
|
|
7
|
+
disabled: { type: Boolean }
|
|
7
8
|
},
|
|
8
9
|
emits: ["update:modelValue", "change"],
|
|
9
10
|
setup(__props, { emit: __emit }) {
|
|
10
11
|
const props = __props;
|
|
11
12
|
const ParentGetChangeHandle = inject("changHandle", () => null);
|
|
12
13
|
const emit = __emit;
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"label",
|
|
18
|
-
{
|
|
19
|
-
class: normalizeClass(["radioGroup", [(_a = MySlot.props) == null ? void 0 : _a.class, props.modelValue == MySlot.props.label ? "tdd-bg-wordblue" : ""]])
|
|
20
|
-
},
|
|
21
|
-
[
|
|
22
|
-
withDirectives(
|
|
23
|
-
h("input", {
|
|
24
|
-
type: "radio",
|
|
25
|
-
value: MySlot.props.label,
|
|
26
|
-
"onUpdate:modelValue": (value) => {
|
|
27
|
-
ParentGetChangeHandle(value);
|
|
28
|
-
emit("update:modelValue", value);
|
|
29
|
-
},
|
|
30
|
-
class: normalizeClass(["hiddeninput form-tick", [props.showinput ? "" : "tdd-hidden"]])
|
|
31
|
-
}),
|
|
32
|
-
[[vModelRadio, props.modelValue]]
|
|
33
|
-
),
|
|
34
|
-
h(
|
|
35
|
-
"span",
|
|
36
|
-
{
|
|
37
|
-
class: normalizeClass(["tdd-text-sm", [props.modelValue == MySlot.props.label ? "tdd-text-white" : "tdd-text-word6"]])
|
|
38
|
-
},
|
|
39
|
-
((_b = MySlot.children) == null ? void 0 : _b.default()) || MySlot.props.label
|
|
40
|
-
)
|
|
41
|
-
]
|
|
42
|
-
);
|
|
43
|
-
};
|
|
44
|
-
const renderBoxs = () => {
|
|
45
|
-
return h(
|
|
46
|
-
"div",
|
|
47
|
-
{},
|
|
48
|
-
slots.default().map((MySlot) => {
|
|
49
|
-
if (typeof MySlot.children === "string")
|
|
50
|
-
return null;
|
|
51
|
-
if (Array.isArray(MySlot.children)) {
|
|
52
|
-
return MySlot.children.map((slot) => {
|
|
53
|
-
return BoxHandle(slot);
|
|
54
|
-
});
|
|
55
|
-
} else {
|
|
56
|
-
return BoxHandle(MySlot);
|
|
57
|
-
}
|
|
58
|
-
})
|
|
59
|
-
);
|
|
14
|
+
const changeHandle = (newVal) => {
|
|
15
|
+
emit("update:modelValue", newVal);
|
|
16
|
+
emit("change", newVal);
|
|
17
|
+
ParentGetChangeHandle(newVal);
|
|
60
18
|
};
|
|
19
|
+
provide("_changeHandle_", changeHandle);
|
|
20
|
+
provide(
|
|
21
|
+
"_checkedValues_",
|
|
22
|
+
computed(() => props.modelValue)
|
|
23
|
+
);
|
|
61
24
|
return (_ctx, _cache) => {
|
|
62
|
-
return openBlock(),
|
|
25
|
+
return openBlock(), createElementBlock("div", null, [
|
|
26
|
+
renderSlot(_ctx.$slots, "default")
|
|
27
|
+
]);
|
|
63
28
|
};
|
|
64
29
|
}
|
|
65
30
|
});
|
|
66
|
-
const radiogroup_vue_vue_type_style_index_0_lang = "";
|
|
67
31
|
export {
|
|
68
32
|
_sfc_main as default
|
|
69
33
|
};
|