vue-devui 1.5.11 → 1.5.12
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/checkbox/index.es.js +71 -45
- package/checkbox/index.umd.js +9 -9
- package/date-picker-pro/index.es.js +64 -40
- package/date-picker-pro/index.umd.js +11 -11
- package/date-picker-pro/style.css +1 -1
- package/editor-md/index.es.js +609 -1401
- package/editor-md/index.umd.js +47 -47
- package/editor-md/style.css +1 -1
- package/package.json +1 -1
- package/pagination/index.es.js +94 -68
- package/pagination/index.umd.js +13 -13
- package/radio/index.es.js +65 -30
- package/radio/index.umd.js +15 -15
- package/radio/style.css +1 -1
- package/select/index.es.js +71 -45
- package/select/index.umd.js +14 -14
- package/slider/index.es.js +2 -2
- package/slider/index.umd.js +1 -1
- package/style.css +1 -1
- package/switch/index.es.js +50 -26
- package/switch/index.umd.js +16 -16
- package/table/index.es.js +82 -57
- package/table/index.umd.js +18 -18
- package/time-picker/index.es.js +78 -53
- package/time-picker/index.umd.js +13 -13
- package/time-picker/style.css +1 -1
- package/time-select/index.es.js +71 -45
- package/time-select/index.umd.js +11 -11
- package/tree/index.es.js +45 -20
- package/tree/index.umd.js +9 -9
- package/types/checkbox/src/checkbox-button.d.ts +3 -0
- package/types/checkbox/src/checkbox-group.d.ts +3 -0
- package/types/checkbox/src/checkbox-types.d.ts +4 -2
- package/types/checkbox/src/checkbox.d.ts +3 -0
- package/types/radio/src/radio-button.d.ts +9 -0
- package/types/radio/src/radio-types.d.ts +5 -1
- package/types/radio/src/radio.d.ts +9 -0
- package/types/transfer/src/components/transfer-panel.d.ts +1 -1
- package/types/transfer/src/composables/use-transfer-panel.d.ts +1 -1
- package/types/transfer/src/composables/use-transfer.d.ts +2 -2
- package/types/transfer/src/transfer.d.ts +1 -1
- package/vue-devui.es.js +1111 -1870
- package/vue-devui.umd.js +85 -85
package/checkbox/index.es.js
CHANGED
|
@@ -30,6 +30,7 @@ var __objRest = (source, exclude) => {
|
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
32
|
import { defineComponent, watch, provide, reactive, toRefs, createVNode, onUnmounted, Transition, mergeProps, ref, unref, nextTick, withModifiers, Comment, Text, h, Fragment, inject, withDirectives, cloneVNode, computed, onMounted, Teleport, createTextVNode, onBeforeUnmount, toRef } from "vue";
|
|
33
|
+
import "clipboard";
|
|
33
34
|
import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
|
|
34
35
|
const commonProps = {
|
|
35
36
|
name: {
|
|
@@ -64,7 +65,8 @@ const commonProps = {
|
|
|
64
65
|
default: void 0
|
|
65
66
|
},
|
|
66
67
|
size: {
|
|
67
|
-
type: String
|
|
68
|
+
type: String,
|
|
69
|
+
default: "md"
|
|
68
70
|
}
|
|
69
71
|
};
|
|
70
72
|
const checkboxProps = __spreadProps(__spreadValues({}, commonProps), {
|
|
@@ -137,7 +139,26 @@ const checkboxGroupProps = __spreadProps(__spreadValues({}, commonProps), {
|
|
|
137
139
|
}
|
|
138
140
|
});
|
|
139
141
|
const checkboxGroupInjectionKey = Symbol("d-checkbox-group");
|
|
140
|
-
function
|
|
142
|
+
function lockScroll() {
|
|
143
|
+
if (document.documentElement.scrollHeight > document.documentElement.clientHeight) {
|
|
144
|
+
const scrollTop = document.documentElement.scrollTop;
|
|
145
|
+
const style = document.documentElement.getAttribute("style");
|
|
146
|
+
document.documentElement.style.position = "fixed";
|
|
147
|
+
document.documentElement.style.top = `-${scrollTop}px`;
|
|
148
|
+
document.documentElement.style.width = document.documentElement.style.width || "100%";
|
|
149
|
+
document.documentElement.style.overflowY = "scroll";
|
|
150
|
+
return () => {
|
|
151
|
+
if (style) {
|
|
152
|
+
document.documentElement.setAttribute("style", style);
|
|
153
|
+
} else {
|
|
154
|
+
document.documentElement.removeAttribute("style");
|
|
155
|
+
}
|
|
156
|
+
document.documentElement.scrollTop = scrollTop;
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
function createBem$1(namespace, element, modifier) {
|
|
141
162
|
let cls = namespace;
|
|
142
163
|
if (element) {
|
|
143
164
|
cls += `__${element}`;
|
|
@@ -147,12 +168,12 @@ function createBem(namespace, element, modifier) {
|
|
|
147
168
|
}
|
|
148
169
|
return cls;
|
|
149
170
|
}
|
|
150
|
-
function useNamespace(block, needDot = false) {
|
|
171
|
+
function useNamespace$1(block, needDot = false) {
|
|
151
172
|
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
152
|
-
const b = () => createBem(namespace);
|
|
153
|
-
const e = (element) => element ? createBem(namespace, element) : "";
|
|
154
|
-
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
155
|
-
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
173
|
+
const b = () => createBem$1(namespace);
|
|
174
|
+
const e = (element) => element ? createBem$1(namespace, element) : "";
|
|
175
|
+
const m = (modifier) => modifier ? createBem$1(namespace, "", modifier) : "";
|
|
176
|
+
const em = (element, modifier) => element && modifier ? createBem$1(namespace, element, modifier) : "";
|
|
156
177
|
return {
|
|
157
178
|
b,
|
|
158
179
|
e,
|
|
@@ -209,6 +230,29 @@ const formProps = {
|
|
|
209
230
|
}
|
|
210
231
|
};
|
|
211
232
|
const FORM_TOKEN = Symbol("dForm");
|
|
233
|
+
function createBem(namespace, element, modifier) {
|
|
234
|
+
let cls = namespace;
|
|
235
|
+
if (element) {
|
|
236
|
+
cls += `__${element}`;
|
|
237
|
+
}
|
|
238
|
+
if (modifier) {
|
|
239
|
+
cls += `--${modifier}`;
|
|
240
|
+
}
|
|
241
|
+
return cls;
|
|
242
|
+
}
|
|
243
|
+
function useNamespace(block, needDot = false) {
|
|
244
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
245
|
+
const b = () => createBem(namespace);
|
|
246
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
247
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
248
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
249
|
+
return {
|
|
250
|
+
b,
|
|
251
|
+
e,
|
|
252
|
+
m,
|
|
253
|
+
em
|
|
254
|
+
};
|
|
255
|
+
}
|
|
212
256
|
function useFieldCollection() {
|
|
213
257
|
const itemContexts = [];
|
|
214
258
|
const addItemContext = (field) => {
|
|
@@ -5789,25 +5833,6 @@ const fixedOverlayProps = {
|
|
|
5789
5833
|
default: true
|
|
5790
5834
|
}
|
|
5791
5835
|
};
|
|
5792
|
-
function lockScroll() {
|
|
5793
|
-
if (document.documentElement.scrollHeight > document.documentElement.clientHeight) {
|
|
5794
|
-
const scrollTop = document.documentElement.scrollTop;
|
|
5795
|
-
const style = document.documentElement.getAttribute("style");
|
|
5796
|
-
document.documentElement.style.position = "fixed";
|
|
5797
|
-
document.documentElement.style.top = `-${scrollTop}px`;
|
|
5798
|
-
document.documentElement.style.width = document.documentElement.style.width || "100%";
|
|
5799
|
-
document.documentElement.style.overflowY = "scroll";
|
|
5800
|
-
return () => {
|
|
5801
|
-
if (style) {
|
|
5802
|
-
document.documentElement.setAttribute("style", style);
|
|
5803
|
-
} else {
|
|
5804
|
-
document.documentElement.removeAttribute("style");
|
|
5805
|
-
}
|
|
5806
|
-
document.documentElement.scrollTop = scrollTop;
|
|
5807
|
-
};
|
|
5808
|
-
}
|
|
5809
|
-
return;
|
|
5810
|
-
}
|
|
5811
5836
|
function useFixedOverlay(props, ctx) {
|
|
5812
5837
|
let lockScrollCb;
|
|
5813
5838
|
const onClick = (event) => {
|
|
@@ -7890,8 +7915,8 @@ function useCheckbox(props, ctx) {
|
|
|
7890
7915
|
var _a;
|
|
7891
7916
|
return (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.color.value) != null ? _a : props.color;
|
|
7892
7917
|
});
|
|
7893
|
-
const itemWidth = checkboxGroupConf == null ? void 0 : checkboxGroupConf.itemWidth
|
|
7894
|
-
const direction = checkboxGroupConf == null ? void 0 : checkboxGroupConf.direction
|
|
7918
|
+
const itemWidth = checkboxGroupConf == null ? void 0 : checkboxGroupConf.itemWidth;
|
|
7919
|
+
const direction = checkboxGroupConf == null ? void 0 : checkboxGroupConf.direction;
|
|
7895
7920
|
const canChange = (checked, val) => {
|
|
7896
7921
|
var _a;
|
|
7897
7922
|
if (mergedDisabled.value) {
|
|
@@ -7908,15 +7933,14 @@ function useCheckbox(props, ctx) {
|
|
|
7908
7933
|
return Promise.resolve(true);
|
|
7909
7934
|
};
|
|
7910
7935
|
const toggle = () => {
|
|
7911
|
-
const current = !
|
|
7936
|
+
const current = !mergedChecked.value;
|
|
7912
7937
|
checkboxGroupConf == null ? void 0 : checkboxGroupConf.toggleGroupVal(props.value);
|
|
7913
7938
|
ctx.emit("update:checked", current);
|
|
7914
7939
|
ctx.emit("update:modelValue", current);
|
|
7915
7940
|
ctx.emit("change", current);
|
|
7916
7941
|
};
|
|
7917
|
-
const handleClick = (
|
|
7918
|
-
|
|
7919
|
-
canChange(!isChecked.value, props.label).then((res) => res && toggle());
|
|
7942
|
+
const handleClick = () => {
|
|
7943
|
+
canChange(!mergedChecked.value, props.label).then((res) => res && toggle());
|
|
7920
7944
|
};
|
|
7921
7945
|
const size = computed(() => props.size || (checkboxGroupConf == null ? void 0 : checkboxGroupConf.size.value) || (formContext == null ? void 0 : formContext.size) || "md");
|
|
7922
7946
|
const border = computed(() => {
|
|
@@ -7924,7 +7948,8 @@ function useCheckbox(props, ctx) {
|
|
|
7924
7948
|
return (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.border.value) != null ? _a : props.border;
|
|
7925
7949
|
});
|
|
7926
7950
|
watch(() => props.modelValue, () => {
|
|
7927
|
-
formItemContext == null ? void 0 : formItemContext.validate("change").catch((
|
|
7951
|
+
formItemContext == null ? void 0 : formItemContext.validate("change").catch(() => {
|
|
7952
|
+
});
|
|
7928
7953
|
});
|
|
7929
7954
|
return {
|
|
7930
7955
|
mergedChecked,
|
|
@@ -7982,7 +8007,8 @@ function useCheckboxGroup(props, ctx) {
|
|
|
7982
8007
|
}
|
|
7983
8008
|
};
|
|
7984
8009
|
watch(() => props.modelValue, () => {
|
|
7985
|
-
formItemContext == null ? void 0 : formItemContext.validate("change").catch((
|
|
8010
|
+
formItemContext == null ? void 0 : formItemContext.validate("change").catch(() => {
|
|
8011
|
+
});
|
|
7986
8012
|
}, { deep: true });
|
|
7987
8013
|
const checkboxGroupSize = computed(() => props.size || (formContext == null ? void 0 : formContext.size) || "");
|
|
7988
8014
|
provide(checkboxGroupInjectionKey, {
|
|
@@ -8019,7 +8045,7 @@ var Checkbox = defineComponent({
|
|
|
8019
8045
|
props: checkboxProps,
|
|
8020
8046
|
emits: ["change", "update:checked", "update:modelValue"],
|
|
8021
8047
|
setup(props, ctx) {
|
|
8022
|
-
const ns2 = useNamespace("checkbox");
|
|
8048
|
+
const ns2 = useNamespace$1("checkbox");
|
|
8023
8049
|
const {
|
|
8024
8050
|
mergedChecked,
|
|
8025
8051
|
mergedDisabled,
|
|
@@ -8034,11 +8060,11 @@ var Checkbox = defineComponent({
|
|
|
8034
8060
|
} = useCheckbox(props, ctx);
|
|
8035
8061
|
return () => {
|
|
8036
8062
|
var _a, _b;
|
|
8037
|
-
const wrapperCls = {
|
|
8038
|
-
[ns2.e("column-margin")]: direction === "column",
|
|
8039
|
-
[ns2.e("wrap")]: typeof itemWidth !== "undefined"
|
|
8040
|
-
};
|
|
8041
|
-
const wrapperStyle = itemWidth ? [`width: ${itemWidth}px`] : [];
|
|
8063
|
+
const wrapperCls = computed(() => ({
|
|
8064
|
+
[ns2.e("column-margin")]: (direction == null ? void 0 : direction.value) === "column",
|
|
8065
|
+
[ns2.e("wrap")]: typeof (itemWidth == null ? void 0 : itemWidth.value) !== "undefined"
|
|
8066
|
+
}));
|
|
8067
|
+
const wrapperStyle = computed(() => (itemWidth == null ? void 0 : itemWidth.value) ? [`width: ${itemWidth.value}px`] : []);
|
|
8042
8068
|
const checkboxCls = {
|
|
8043
8069
|
[ns2.b()]: true,
|
|
8044
8070
|
active: mergedChecked.value,
|
|
@@ -8069,8 +8095,8 @@ var Checkbox = defineComponent({
|
|
|
8069
8095
|
indeterminate: props.halfChecked
|
|
8070
8096
|
};
|
|
8071
8097
|
return createVNode("div", {
|
|
8072
|
-
"class": wrapperCls,
|
|
8073
|
-
"style": wrapperStyle
|
|
8098
|
+
"class": wrapperCls.value,
|
|
8099
|
+
"style": wrapperStyle.value
|
|
8074
8100
|
}, [createVNode("div", {
|
|
8075
8101
|
"class": checkboxCls
|
|
8076
8102
|
}, [createVNode("label", {
|
|
@@ -8078,7 +8104,7 @@ var Checkbox = defineComponent({
|
|
|
8078
8104
|
"onClick": handleClick,
|
|
8079
8105
|
"class": labelCls,
|
|
8080
8106
|
"style": {
|
|
8081
|
-
width: itemWidth ? "100%" : "auto"
|
|
8107
|
+
width: (itemWidth == null ? void 0 : itemWidth.value) ? "100%" : "auto"
|
|
8082
8108
|
}
|
|
8083
8109
|
}, [createVNode("input", mergeProps({
|
|
8084
8110
|
"name": props.name || props.value,
|
|
@@ -8120,7 +8146,7 @@ var CheckboxGroup = defineComponent({
|
|
|
8120
8146
|
props: checkboxGroupProps,
|
|
8121
8147
|
emits: ["change", "update:modelValue"],
|
|
8122
8148
|
setup(props, ctx) {
|
|
8123
|
-
const ns2 = useNamespace("checkbox");
|
|
8149
|
+
const ns2 = useNamespace$1("checkbox");
|
|
8124
8150
|
const {
|
|
8125
8151
|
defaultOpt
|
|
8126
8152
|
} = useCheckboxGroup(props, ctx);
|
|
@@ -8166,7 +8192,7 @@ var CheckboxButton = defineComponent({
|
|
|
8166
8192
|
props: checkboxProps,
|
|
8167
8193
|
emits: ["change", "update:checked", "update:modelValue"],
|
|
8168
8194
|
setup(props, ctx) {
|
|
8169
|
-
const ns2 = useNamespace("checkbox-button");
|
|
8195
|
+
const ns2 = useNamespace$1("checkbox-button");
|
|
8170
8196
|
const {
|
|
8171
8197
|
mergedChecked,
|
|
8172
8198
|
mergedDisabled,
|