vue-devui 1.0.0-rc.8 → 1.0.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/README.md +188 -149
- package/alert/index.es.js +14 -9
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/auto-complete/index.es.js +8392 -418
- package/auto-complete/index.umd.js +29 -5
- package/auto-complete/style.css +1 -1
- package/avatar/index.es.js +59 -74
- package/avatar/index.umd.js +1 -1
- package/badge/index.es.js +10 -4
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +191 -53
- package/button/index.umd.js +17 -17
- package/button/style.css +1 -1
- package/card/index.es.js +7 -3
- package/card/index.umd.js +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.es.js +8050 -241
- package/checkbox/index.umd.js +27 -1
- package/checkbox/style.css +1 -1
- package/{date-picker → collapse}/index.d.ts +0 -0
- package/collapse/index.es.js +213 -0
- package/collapse/index.umd.js +1 -0
- package/{date-picker → collapse}/package.json +1 -1
- package/collapse/style.css +1 -0
- package/countdown/index.es.js +56 -13
- package/countdown/index.umd.js +1 -1
- package/date-picker-pro/index.d.ts +7 -0
- package/date-picker-pro/index.es.js +12022 -0
- package/date-picker-pro/index.umd.js +27 -0
- package/date-picker-pro/package.json +7 -0
- package/date-picker-pro/style.css +1 -0
- package/drawer/index.es.js +24 -7
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.es.js +190 -165
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +785 -145
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +399 -300
- package/form/index.umd.js +16 -16
- package/form/style.css +1 -1
- package/fullscreen/index.es.js +2 -2
- package/fullscreen/index.umd.js +1 -1
- package/grid/index.es.js +8 -6
- package/grid/index.umd.js +1 -1
- package/icon/index.es.js +185 -23
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -0
- package/image-preview/index.es.js +2 -2
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/input/index.es.js +8220 -45
- package/input/index.umd.js +27 -1
- package/input/style.css +1 -1
- package/input-number/index.es.js +279 -204
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/layout/index.es.js +3 -3
- package/layout/index.umd.js +1 -1
- package/loading/index.es.js +53 -53
- package/loading/index.umd.js +1 -1
- package/loading/style.css +1 -1
- package/mention/index.d.ts +7 -0
- package/mention/index.es.js +8319 -0
- package/mention/index.umd.js +36 -0
- package/mention/package.json +7 -0
- package/mention/style.css +1 -0
- package/menu/index.d.ts +7 -0
- package/menu/index.es.js +921 -0
- package/menu/index.umd.js +1 -0
- package/menu/package.json +7 -0
- package/menu/style.css +1 -0
- package/message/index.d.ts +7 -0
- package/message/index.es.js +539 -0
- package/message/index.umd.js +1 -0
- package/message/package.json +7 -0
- package/message/style.css +1 -0
- package/modal/index.es.js +451 -173
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +212 -70
- package/notification/index.umd.js +1 -1
- package/notification/style.css +1 -1
- package/nuxt/components/CheckboxButton.js +3 -0
- package/nuxt/components/Collapse.js +3 -0
- package/nuxt/components/CollapseItem.js +3 -0
- package/nuxt/components/DRangeDatePickerPro.js +3 -0
- package/nuxt/components/DatePickerPro.js +3 -0
- package/nuxt/components/Icon.js +1 -0
- package/nuxt/components/IconGroup.js +3 -0
- package/nuxt/components/LABEL_DATA.js +3 -0
- package/nuxt/components/Mention.js +3 -0
- package/nuxt/components/Menu.js +3 -0
- package/nuxt/components/MenuItem.js +3 -0
- package/nuxt/components/Message.js +3 -0
- package/nuxt/components/Option.js +3 -0
- package/nuxt/components/OptionGroup.js +3 -0
- package/nuxt/components/RadioButton.js +3 -0
- package/nuxt/components/Step.js +3 -0
- package/nuxt/components/Steps.js +3 -0
- package/nuxt/components/SubMenu.js +3 -0
- package/nuxt/components/TABLE_TOKEN.js +3 -0
- package/nuxt/components/TimePicker.js +3 -0
- package/nuxt/components/TimeSelect.js +3 -0
- package/nuxt/components/animationInjectionKey.js +3 -0
- package/nuxt/components/collapseItemProps.js +3 -0
- package/nuxt/components/collapseProps.js +3 -0
- package/nuxt/components/datePickerProCommonProps.js +3 -0
- package/nuxt/components/datePickerProPanelProps.js +3 -0
- package/nuxt/components/datePickerProProps.js +3 -0
- package/nuxt/components/iconProps.js +1 -0
- package/nuxt/components/mentionProps.js +3 -0
- package/nuxt/components/messageProps.js +3 -0
- package/nuxt/components/paginationInjectionKey.js +3 -0
- package/nuxt/components/roundInjectionKey.js +3 -0
- package/nuxt/components/skeletonItemProps.js +3 -0
- package/nuxt/components/stepProps.js +3 -0
- package/nuxt/components/stepsProps.js +3 -0
- package/nuxt/components/svgIconProps.js +3 -0
- package/nuxt/components/tableProps.js +3 -0
- package/nuxt/components/timerPickerPanelProps.js +3 -0
- package/nuxt/components/treeNodeProps.js +3 -0
- package/overlay/index.es.js +89 -142
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +8 -4
- package/pagination/index.es.js +10180 -129
- package/pagination/index.umd.js +27 -1
- package/pagination/style.css +1 -1
- package/panel/index.es.js +4 -0
- package/panel/index.umd.js +1 -1
- package/panel/style.css +1 -1
- package/popover/index.es.js +262 -229
- package/popover/index.umd.js +15 -15
- package/popover/style.css +1 -1
- package/progress/index.es.js +2 -2
- package/progress/index.umd.js +2 -2
- package/progress/style.css +1 -1
- package/radio/index.es.js +7954 -156
- package/radio/index.umd.js +27 -1
- package/radio/style.css +1 -1
- package/rate/index.es.js +16 -8
- package/rate/index.umd.js +1 -1
- package/rate/style.css +1 -1
- package/result/index.es.js +170 -22
- package/result/index.umd.js +1 -1
- package/result/style.css +1 -1
- package/search/index.es.js +3829 -1042
- package/search/index.umd.js +18 -18
- package/search/style.css +1 -1
- package/select/index.es.js +9202 -495
- package/select/index.umd.js +27 -1
- package/select/style.css +1 -1
- package/skeleton/index.es.js +89 -263
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.es.js +118 -145
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +454 -233
- package/splitter/index.umd.js +13 -13
- package/splitter/style.css +1 -1
- package/statistic/index.es.js +34 -16
- package/statistic/index.umd.js +1 -1
- package/statistic/style.css +1 -1
- package/status/index.es.js +6 -2
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/steps/index.d.ts +7 -0
- package/steps/index.es.js +387 -0
- package/steps/index.umd.js +1 -0
- package/steps/package.json +7 -0
- package/steps/style.css +1 -0
- package/style.css +1 -1
- package/switch/index.es.js +7787 -62
- package/switch/index.umd.js +27 -1
- package/switch/style.css +1 -1
- package/table/index.es.js +5225 -1726
- package/table/index.umd.js +18 -18
- package/table/style.css +1 -1
- package/tabs/index.es.js +303 -102
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.es.js +11 -8
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/textarea/index.es.js +7876 -41
- package/textarea/index.umd.js +35 -1
- package/textarea/style.css +1 -1
- package/time-picker/index.d.ts +7 -0
- package/time-picker/index.es.js +9549 -0
- package/time-picker/index.umd.js +27 -0
- package/time-picker/package.json +7 -0
- package/time-picker/style.css +1 -0
- package/time-select/index.d.ts +7 -0
- package/time-select/index.es.js +9607 -0
- package/time-select/index.umd.js +27 -0
- package/time-select/package.json +7 -0
- package/time-select/style.css +1 -0
- package/timeline/index.es.js +170 -22
- package/timeline/index.umd.js +1 -1
- package/timeline/style.css +1 -1
- package/tooltip/index.es.js +286 -238
- package/tooltip/index.umd.js +14 -14
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +11342 -793
- package/tree/index.umd.js +27 -1
- package/tree/style.css +1 -1
- package/upload/index.es.js +458 -102
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +20475 -11072
- package/vue-devui.umd.js +31 -24
- package/date-picker/index.es.js +0 -1097
- package/date-picker/index.umd.js +0 -1
- package/date-picker/style.css +0 -1
- package/nuxt/components/DatePicker.js +0 -3
- package/nuxt/components/FormControl.js +0 -3
- package/nuxt/components/FormLabel.js +0 -3
- package/nuxt/components/Loading.js +0 -3
- package/nuxt/components/StickSlider.js +0 -3
- package/nuxt/components/formControlProps.js +0 -3
- package/nuxt/components/overlayEmits.js +0 -3
- package/nuxt/components/overlayProps.js +0 -3
package/input-number/index.es.js
CHANGED
|
@@ -1,8 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
2
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
3
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var __objRest = (source, exclude) => {
|
|
5
|
+
var target = {};
|
|
6
|
+
for (var prop in source)
|
|
7
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
8
|
+
target[prop] = source[prop];
|
|
9
|
+
if (source != null && __getOwnPropSymbols)
|
|
10
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
11
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
12
|
+
target[prop] = source[prop];
|
|
13
|
+
}
|
|
14
|
+
return target;
|
|
15
|
+
};
|
|
16
|
+
import { createVNode, computed, ref, toRefs, reactive, watch, defineComponent, mergeProps } from "vue";
|
|
2
17
|
const inputNumberProps = {
|
|
3
18
|
placeholder: {
|
|
4
|
-
type: String
|
|
5
|
-
default: void 0
|
|
19
|
+
type: String
|
|
6
20
|
},
|
|
7
21
|
disabled: {
|
|
8
22
|
type: Boolean,
|
|
@@ -10,7 +24,7 @@ const inputNumberProps = {
|
|
|
10
24
|
},
|
|
11
25
|
step: {
|
|
12
26
|
type: Number,
|
|
13
|
-
default:
|
|
27
|
+
default: 1
|
|
14
28
|
},
|
|
15
29
|
max: {
|
|
16
30
|
type: Number,
|
|
@@ -22,230 +36,291 @@ const inputNumberProps = {
|
|
|
22
36
|
},
|
|
23
37
|
size: {
|
|
24
38
|
type: String,
|
|
25
|
-
default: ""
|
|
39
|
+
default: "md"
|
|
26
40
|
},
|
|
27
41
|
modelValue: {
|
|
28
|
-
type: Number
|
|
29
|
-
default: 0
|
|
42
|
+
type: Number
|
|
30
43
|
},
|
|
31
|
-
|
|
32
|
-
type:
|
|
33
|
-
default: void 0
|
|
44
|
+
precision: {
|
|
45
|
+
type: Number
|
|
34
46
|
},
|
|
35
|
-
|
|
36
|
-
type:
|
|
37
|
-
default:
|
|
38
|
-
},
|
|
39
|
-
"onKeydown": {
|
|
40
|
-
type: Function,
|
|
41
|
-
default: void 0
|
|
42
|
-
},
|
|
43
|
-
"onFocus": {
|
|
44
|
-
type: Function,
|
|
45
|
-
default: void 0
|
|
46
|
-
},
|
|
47
|
-
"onBlur": {
|
|
48
|
-
type: Function,
|
|
49
|
-
default: void 0
|
|
47
|
+
reg: {
|
|
48
|
+
type: [RegExp, String],
|
|
49
|
+
default: ""
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
default: "",
|
|
57
|
-
required: true
|
|
58
|
-
},
|
|
59
|
-
size: {
|
|
60
|
-
type: String,
|
|
61
|
-
default: "inherit"
|
|
62
|
-
},
|
|
63
|
-
color: {
|
|
64
|
-
type: String,
|
|
65
|
-
default: "inherit"
|
|
66
|
-
},
|
|
67
|
-
classPrefix: {
|
|
68
|
-
type: String,
|
|
69
|
-
default: "icon"
|
|
52
|
+
function createBem(namespace, element, modifier) {
|
|
53
|
+
let cls = namespace;
|
|
54
|
+
if (element) {
|
|
55
|
+
cls += `__${element}`;
|
|
70
56
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
name: "DIcon",
|
|
74
|
-
props: iconProps,
|
|
75
|
-
setup(props) {
|
|
76
|
-
const {
|
|
77
|
-
name,
|
|
78
|
-
size,
|
|
79
|
-
color,
|
|
80
|
-
classPrefix
|
|
81
|
-
} = toRefs(props);
|
|
82
|
-
return () => {
|
|
83
|
-
return /^((https?):)?\/\//.test(name.value) ? createVNode("img", {
|
|
84
|
-
"src": name.value,
|
|
85
|
-
"alt": name.value.split("/")[name.value.split("/").length - 1],
|
|
86
|
-
"style": {
|
|
87
|
-
width: size.value,
|
|
88
|
-
verticalAlign: "text-bottom"
|
|
89
|
-
}
|
|
90
|
-
}, null) : createVNode("i", {
|
|
91
|
-
"class": `${classPrefix.value} ${classPrefix.value}-${name.value}`,
|
|
92
|
-
"style": {
|
|
93
|
-
fontSize: size.value,
|
|
94
|
-
color: color.value
|
|
95
|
-
}
|
|
96
|
-
}, null);
|
|
97
|
-
};
|
|
57
|
+
if (modifier) {
|
|
58
|
+
cls += `--${modifier}`;
|
|
98
59
|
}
|
|
99
|
-
|
|
60
|
+
return cls;
|
|
61
|
+
}
|
|
62
|
+
function useNamespace(block, needDot = false) {
|
|
63
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
64
|
+
const b = () => createBem(namespace);
|
|
65
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
66
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
67
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
68
|
+
return {
|
|
69
|
+
b,
|
|
70
|
+
e,
|
|
71
|
+
m,
|
|
72
|
+
em
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
const ns$1 = useNamespace("input-number");
|
|
76
|
+
function IncIcon() {
|
|
77
|
+
return createVNode("svg", {
|
|
78
|
+
"class": ns$1.e("icon-arrow"),
|
|
79
|
+
"width": "1em",
|
|
80
|
+
"height": "1em",
|
|
81
|
+
"viewBox": "0 0 16 16",
|
|
82
|
+
"version": "1.1",
|
|
83
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
84
|
+
}, [createVNode("g", {
|
|
85
|
+
"stroke": "none",
|
|
86
|
+
"stroke-width": "1",
|
|
87
|
+
"fill": "none",
|
|
88
|
+
"fill-rule": "evenodd"
|
|
89
|
+
}, [createVNode("path", {
|
|
90
|
+
"d": "M12.1464466,6.85355339 L8.35355339,10.6464466 C8.15829124,10.8417088 7.84170876,10.8417088 7.64644661,10.6464466 L3.85355339,6.85355339 C3.65829124,6.65829124 3.65829124,6.34170876 3.85355339,6.14644661 C3.94732158,6.05267842 4.07449854,6 4.20710678,6 L11.7928932,6 C12.0690356,6 12.2928932,6.22385763 12.2928932,6.5 C12.2928932,6.63260824 12.2402148,6.7597852 12.1464466,6.85355339 Z",
|
|
91
|
+
"fill-rule": "nonzero"
|
|
92
|
+
}, null)])]);
|
|
93
|
+
}
|
|
94
|
+
function DecIcon() {
|
|
95
|
+
return createVNode("svg", {
|
|
96
|
+
"class": ns$1.e("icon-arrow"),
|
|
97
|
+
"width": "1em",
|
|
98
|
+
"height": "1em",
|
|
99
|
+
"viewBox": "0 0 16 16",
|
|
100
|
+
"version": "1.1",
|
|
101
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
102
|
+
}, [createVNode("g", {
|
|
103
|
+
"stroke": "none",
|
|
104
|
+
"stroke-width": "1",
|
|
105
|
+
"fill": "none",
|
|
106
|
+
"fill-rule": "evenodd"
|
|
107
|
+
}, [createVNode("path", {
|
|
108
|
+
"d": "M12.1464466,6.85355339 L8.35355339,10.6464466 C8.15829124,10.8417088 7.84170876,10.8417088 7.64644661,10.6464466 L3.85355339,6.85355339 C3.65829124,6.65829124 3.65829124,6.34170876 3.85355339,6.14644661 C3.94732158,6.05267842 4.07449854,6 4.20710678,6 L11.7928932,6 C12.0690356,6 12.2928932,6.22385763 12.2928932,6.5 C12.2928932,6.63260824 12.2402148,6.7597852 12.1464466,6.85355339 Z",
|
|
109
|
+
"fill-rule": "nonzero"
|
|
110
|
+
}, null)])]);
|
|
111
|
+
}
|
|
112
|
+
const isNumber = (value) => typeof value === "number";
|
|
113
|
+
const isUndefined = (value) => value === void 0;
|
|
114
|
+
const ns = useNamespace("input-number");
|
|
115
|
+
function useRender(props, ctx) {
|
|
116
|
+
const _a = ctx.attrs, { style, class: customClass } = _a, otherAttrs = __objRest(_a, ["style", "class"]);
|
|
117
|
+
const customStyle = { style };
|
|
118
|
+
const wrapClass = computed(() => [
|
|
119
|
+
{
|
|
120
|
+
[ns.b()]: true,
|
|
121
|
+
[ns.m(props.size)]: true
|
|
122
|
+
},
|
|
123
|
+
customClass
|
|
124
|
+
]);
|
|
125
|
+
const controlButtonsClass = computed(() => ({
|
|
126
|
+
[ns.e("control-buttons")]: true,
|
|
127
|
+
disabled: props.disabled
|
|
128
|
+
}));
|
|
129
|
+
const inputWrapClass = computed(() => ({
|
|
130
|
+
[ns.e("input-wrap")]: true
|
|
131
|
+
}));
|
|
132
|
+
const inputInnerClass = computed(() => ({
|
|
133
|
+
[ns.e("input-box")]: true,
|
|
134
|
+
disabled: props.disabled
|
|
135
|
+
}));
|
|
136
|
+
return { wrapClass, customStyle, otherAttrs, controlButtonsClass, inputWrapClass, inputInnerClass };
|
|
137
|
+
}
|
|
138
|
+
function useExpose(ctx) {
|
|
139
|
+
const inputRef = ref();
|
|
140
|
+
const focus = () => {
|
|
141
|
+
inputRef.value.focus();
|
|
142
|
+
};
|
|
143
|
+
const blur = () => {
|
|
144
|
+
inputRef.value.blur();
|
|
145
|
+
};
|
|
146
|
+
const select = () => {
|
|
147
|
+
inputRef.value.select();
|
|
148
|
+
};
|
|
149
|
+
ctx.expose({ focus, blur, select });
|
|
150
|
+
return { inputRef };
|
|
151
|
+
}
|
|
152
|
+
function getPrecision(pre) {
|
|
153
|
+
let precision = 0;
|
|
154
|
+
if (isUndefined(pre)) {
|
|
155
|
+
return precision;
|
|
156
|
+
}
|
|
157
|
+
const preString = pre.toString();
|
|
158
|
+
const dotIndex = preString.indexOf(".");
|
|
159
|
+
if (dotIndex !== -1) {
|
|
160
|
+
precision = preString.length - dotIndex - 1;
|
|
161
|
+
}
|
|
162
|
+
return precision;
|
|
163
|
+
}
|
|
164
|
+
function useEvent(props, ctx, inputRef) {
|
|
165
|
+
const { min, max, step, disabled } = toRefs(props);
|
|
166
|
+
const state = reactive({
|
|
167
|
+
currentValue: props.modelValue || "",
|
|
168
|
+
userInputValue: void 0
|
|
169
|
+
});
|
|
170
|
+
const numPrecision = computed(() => {
|
|
171
|
+
if (!isUndefined(props.precision)) {
|
|
172
|
+
return props.precision;
|
|
173
|
+
} else {
|
|
174
|
+
return Math.max(getPrecision(props.modelValue), getPrecision(step.value));
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
const inputVal = computed(() => {
|
|
178
|
+
if (!isUndefined(state.userInputValue)) {
|
|
179
|
+
return state.userInputValue;
|
|
180
|
+
}
|
|
181
|
+
let currentValue = state.currentValue;
|
|
182
|
+
if (currentValue === "" || isUndefined(currentValue) || Number.isNaN(currentValue)) {
|
|
183
|
+
return "";
|
|
184
|
+
}
|
|
185
|
+
if (isNumber(currentValue)) {
|
|
186
|
+
currentValue = currentValue.toFixed(numPrecision.value);
|
|
187
|
+
}
|
|
188
|
+
return currentValue;
|
|
189
|
+
});
|
|
190
|
+
const toPrecision = (num) => {
|
|
191
|
+
return Number.parseFloat(num.toFixed(numPrecision.value));
|
|
192
|
+
};
|
|
193
|
+
const computeByStep = (val, addOrNot = 1) => {
|
|
194
|
+
if (!isNumber(val)) {
|
|
195
|
+
return state.currentValue;
|
|
196
|
+
}
|
|
197
|
+
return toPrecision(val + step.value * addOrNot);
|
|
198
|
+
};
|
|
199
|
+
const correctValue = (value) => {
|
|
200
|
+
const valueStr = value + "";
|
|
201
|
+
if (props.reg && !valueStr.match(new RegExp(props.reg))) {
|
|
202
|
+
return void 0;
|
|
203
|
+
}
|
|
204
|
+
let newVal = Number(value);
|
|
205
|
+
if (newVal !== 0 && (!Number(value) || Number.isNaN(newVal))) {
|
|
206
|
+
return void 0;
|
|
207
|
+
}
|
|
208
|
+
if (!isUndefined(props.precision)) {
|
|
209
|
+
newVal = toPrecision(newVal);
|
|
210
|
+
}
|
|
211
|
+
if (newVal > max.value || newVal < min.value) {
|
|
212
|
+
newVal = newVal > max.value ? max.value : min.value;
|
|
213
|
+
}
|
|
214
|
+
return newVal;
|
|
215
|
+
};
|
|
216
|
+
const setCurrentValue = (value) => {
|
|
217
|
+
const oldVal = state.currentValue;
|
|
218
|
+
const newVal = correctValue(value);
|
|
219
|
+
state.userInputValue = void 0;
|
|
220
|
+
if (newVal !== 0 && !newVal) {
|
|
221
|
+
ctx.emit("update:modelValue", oldVal);
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
if (oldVal === newVal) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
ctx.emit("update:modelValue", newVal);
|
|
228
|
+
ctx.emit("input", newVal);
|
|
229
|
+
ctx.emit("change", newVal, oldVal);
|
|
230
|
+
state.currentValue = newVal;
|
|
231
|
+
};
|
|
232
|
+
const minDisabled = computed(() => isNumber(state.currentValue) && computeByStep(state.currentValue, -1) < props.min);
|
|
233
|
+
const maxDisabled = computed(() => isNumber(state.currentValue) && computeByStep(state.currentValue) > props.max);
|
|
234
|
+
const onAdd = () => {
|
|
235
|
+
if (disabled.value || maxDisabled.value) {
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
inputRef.value.focus();
|
|
239
|
+
const newVal = computeByStep(state.currentValue || 0);
|
|
240
|
+
setCurrentValue(newVal);
|
|
241
|
+
};
|
|
242
|
+
const onSubtract = () => {
|
|
243
|
+
if (disabled.value || minDisabled.value) {
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
inputRef.value.focus();
|
|
247
|
+
const newVal = computeByStep(state.currentValue || 0, -1);
|
|
248
|
+
setCurrentValue(newVal);
|
|
249
|
+
};
|
|
250
|
+
watch(() => props.modelValue, (val) => {
|
|
251
|
+
state.currentValue = correctValue(val);
|
|
252
|
+
}, { immediate: true });
|
|
253
|
+
const onInput = (event) => {
|
|
254
|
+
state.userInputValue = event.target.value;
|
|
255
|
+
};
|
|
256
|
+
const onChange = (event) => {
|
|
257
|
+
setCurrentValue(event.target.value);
|
|
258
|
+
};
|
|
259
|
+
return { inputVal, minDisabled, maxDisabled, onAdd, onSubtract, onInput, onChange };
|
|
260
|
+
}
|
|
261
|
+
var inputNumber = "";
|
|
100
262
|
var InputNumber = defineComponent({
|
|
101
263
|
name: "DInputNumber",
|
|
102
264
|
props: inputNumberProps,
|
|
103
|
-
emits: ["update:modelValue", "change", "input"
|
|
265
|
+
emits: ["update:modelValue", "change", "input"],
|
|
104
266
|
setup(props, ctx) {
|
|
105
|
-
const inputVal = ref(props.modelValue < props.min ? props.min : props.modelValue);
|
|
106
|
-
const focusVal = ref("");
|
|
107
|
-
const isSize = computed(() => {
|
|
108
|
-
return `devui-input-number-${props.size}`;
|
|
109
|
-
});
|
|
110
|
-
const isDisabled = computed(() => {
|
|
111
|
-
return props.disabled;
|
|
112
|
-
});
|
|
113
|
-
const add = () => {
|
|
114
|
-
if (props.disabled) {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
if (inputVal.value >= props.max) {
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
if (props.step !== 0) {
|
|
121
|
-
const maxSpaceVal = props.max - inputVal.value;
|
|
122
|
-
if (inputVal.value < props.max && maxSpaceVal < props.step) {
|
|
123
|
-
inputVal.value += maxSpaceVal;
|
|
124
|
-
} else if (inputVal.value < props.max && maxSpaceVal > props.step) {
|
|
125
|
-
inputVal.value += props.step;
|
|
126
|
-
} else {
|
|
127
|
-
inputVal.value += props.step;
|
|
128
|
-
}
|
|
129
|
-
} else {
|
|
130
|
-
inputVal.value += 1;
|
|
131
|
-
}
|
|
132
|
-
focusVal.value = "active";
|
|
133
|
-
ctx.emit("change", inputVal.value);
|
|
134
|
-
ctx.emit("update:modelValue", inputVal.value);
|
|
135
|
-
};
|
|
136
|
-
const subtract = () => {
|
|
137
|
-
if (props.disabled) {
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
if (inputVal.value <= props.min) {
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
if (props.step !== 0) {
|
|
144
|
-
const minSpaceVal = inputVal.value - props.min;
|
|
145
|
-
if (inputVal.value > props.min && minSpaceVal > props.step) {
|
|
146
|
-
inputVal.value -= props.step;
|
|
147
|
-
} else if (inputVal.value > props.min && minSpaceVal < props.step) {
|
|
148
|
-
inputVal.value -= minSpaceVal;
|
|
149
|
-
} else {
|
|
150
|
-
inputVal.value -= props.step;
|
|
151
|
-
}
|
|
152
|
-
} else {
|
|
153
|
-
inputVal.value -= 1;
|
|
154
|
-
}
|
|
155
|
-
focusVal.value = "active";
|
|
156
|
-
ctx.emit("change", inputVal.value);
|
|
157
|
-
ctx.emit("update:modelValue", inputVal.value);
|
|
158
|
-
};
|
|
159
|
-
const onInput = (val) => {
|
|
160
|
-
inputVal.value = parseInt(val.data);
|
|
161
|
-
ctx.emit("input", inputVal.value);
|
|
162
|
-
ctx.emit("update:modelValue", inputVal.value);
|
|
163
|
-
};
|
|
164
|
-
const onFocus = ($event) => {
|
|
165
|
-
focusVal.value = "active";
|
|
166
|
-
ctx.emit("focus", $event);
|
|
167
|
-
};
|
|
168
|
-
const onBlur = ($event) => {
|
|
169
|
-
focusVal.value = "";
|
|
170
|
-
ctx.emit("blur", $event);
|
|
171
|
-
};
|
|
172
|
-
const onChange = ($event) => {
|
|
173
|
-
ctx.emit("change", $event.target.value);
|
|
174
|
-
};
|
|
175
|
-
const onKeydown = ($event) => {
|
|
176
|
-
ctx.emit("keydown", $event);
|
|
177
|
-
};
|
|
178
|
-
return {
|
|
179
|
-
inputVal,
|
|
180
|
-
focusVal,
|
|
181
|
-
isDisabled,
|
|
182
|
-
isSize,
|
|
183
|
-
add,
|
|
184
|
-
subtract,
|
|
185
|
-
onInput,
|
|
186
|
-
onChange,
|
|
187
|
-
onKeydown,
|
|
188
|
-
onBlur,
|
|
189
|
-
onFocus
|
|
190
|
-
};
|
|
191
|
-
},
|
|
192
|
-
render() {
|
|
193
267
|
const {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
268
|
+
disabled
|
|
269
|
+
} = toRefs(props);
|
|
270
|
+
const {
|
|
271
|
+
wrapClass,
|
|
272
|
+
customStyle,
|
|
273
|
+
otherAttrs,
|
|
274
|
+
controlButtonsClass,
|
|
275
|
+
inputWrapClass,
|
|
276
|
+
inputInnerClass
|
|
277
|
+
} = useRender(props, ctx);
|
|
278
|
+
const {
|
|
279
|
+
inputRef
|
|
280
|
+
} = useExpose(ctx);
|
|
281
|
+
const {
|
|
197
282
|
inputVal,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
283
|
+
minDisabled,
|
|
284
|
+
maxDisabled,
|
|
285
|
+
onAdd,
|
|
286
|
+
onSubtract,
|
|
201
287
|
onInput,
|
|
202
|
-
onChange
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
return createVNode("div", {
|
|
209
|
-
"class": dInputNum
|
|
210
|
-
}, [createVNode("div", {
|
|
211
|
-
"onBlur": onBlur,
|
|
212
|
-
"tabindex": "1",
|
|
213
|
-
"class": ["devui-control-buttons", focusVal.value]
|
|
288
|
+
onChange
|
|
289
|
+
} = useEvent(props, ctx, inputRef);
|
|
290
|
+
return () => createVNode("div", mergeProps({
|
|
291
|
+
"class": wrapClass.value
|
|
292
|
+
}, customStyle), [createVNode("div", {
|
|
293
|
+
"class": controlButtonsClass.value
|
|
214
294
|
}, [createVNode("span", {
|
|
215
|
-
"
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
"
|
|
219
|
-
}, null)]), createVNode("span", {
|
|
220
|
-
"
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
"
|
|
224
|
-
}, null)])]), createVNode("div", {
|
|
225
|
-
"class":
|
|
226
|
-
}, [createVNode("input", {
|
|
227
|
-
"
|
|
228
|
-
"value": inputVal,
|
|
229
|
-
"placeholder": placeholder,
|
|
230
|
-
"disabled":
|
|
231
|
-
"class":
|
|
295
|
+
"class": ["control-button control-inc", {
|
|
296
|
+
disabled: maxDisabled.value
|
|
297
|
+
}],
|
|
298
|
+
"onClick": onAdd
|
|
299
|
+
}, [createVNode(IncIcon, null, null)]), createVNode("span", {
|
|
300
|
+
"class": ["control-button control-dec", {
|
|
301
|
+
disabled: minDisabled.value
|
|
302
|
+
}],
|
|
303
|
+
"onClick": onSubtract
|
|
304
|
+
}, [createVNode(DecIcon, null, null)])]), createVNode("div", {
|
|
305
|
+
"class": inputWrapClass.value
|
|
306
|
+
}, [createVNode("input", mergeProps({
|
|
307
|
+
"ref": inputRef,
|
|
308
|
+
"value": inputVal.value,
|
|
309
|
+
"placeholder": props.placeholder,
|
|
310
|
+
"disabled": disabled.value,
|
|
311
|
+
"class": inputInnerClass.value
|
|
312
|
+
}, otherAttrs, {
|
|
232
313
|
"onInput": onInput,
|
|
233
|
-
"onChange": onChange
|
|
234
|
-
|
|
235
|
-
"onBlur": onBlur,
|
|
236
|
-
"onKeydown": onKeydown
|
|
237
|
-
}, null)])]);
|
|
314
|
+
"onChange": onChange
|
|
315
|
+
}), null)])]);
|
|
238
316
|
}
|
|
239
317
|
});
|
|
240
|
-
InputNumber.install = function(app) {
|
|
241
|
-
app.component(InputNumber.name, InputNumber);
|
|
242
|
-
};
|
|
243
318
|
var index = {
|
|
244
319
|
title: "InputNumber \u6570\u5B57\u8F93\u5165\u6846",
|
|
245
320
|
category: "\u6570\u636E\u5F55\u5165",
|
|
246
321
|
status: "50%",
|
|
247
322
|
install(app) {
|
|
248
|
-
app.
|
|
323
|
+
app.component(InputNumber.name, InputNumber);
|
|
249
324
|
}
|
|
250
325
|
};
|
|
251
326
|
export { InputNumber, index as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(l,
|
|
1
|
+
var R=Object.getOwnPropertySymbols;var T=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var k=(l,e)=>{var g={};for(var c in l)T.call(l,c)&&e.indexOf(c)<0&&(g[c]=l[c]);if(l!=null&&R)for(var c of R(l))e.indexOf(c)<0&&j.call(l,c)&&(g[c]=l[c]);return g};(function(l,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(l=typeof globalThis!="undefined"?globalThis:l||self,e(l.index={},l.Vue))})(this,function(l,e){"use strict";const g={placeholder:{type:String},disabled:{type:Boolean,default:!1},step:{type:Number,default:1},max:{type:Number,default:1/0},min:{type:Number,default:-1/0},size:{type:String,default:"md"},modelValue:{type:Number},precision:{type:Number},reg:{type:[RegExp,String],default:""}};function c(t,r,o){let s=t;return r&&(s+=`__${r}`),o&&(s+=`--${o}`),s}function P(t,r=!1){const o=r?`.devui-${t}`:`devui-${t}`;return{b:()=>c(o),e:n=>n?c(o,n):"",m:n=>n?c(o,"",n):"",em:(n,d)=>n&&d?c(o,n,d):""}}const D=P("input-number");function E(){return e.createVNode("svg",{class:D.e("icon-arrow"),width:"1em",height:"1em",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("path",{d:"M12.1464466,6.85355339 L8.35355339,10.6464466 C8.15829124,10.8417088 7.84170876,10.8417088 7.64644661,10.6464466 L3.85355339,6.85355339 C3.65829124,6.65829124 3.65829124,6.34170876 3.85355339,6.14644661 C3.94732158,6.05267842 4.07449854,6 4.20710678,6 L11.7928932,6 C12.0690356,6 12.2928932,6.22385763 12.2928932,6.5 C12.2928932,6.63260824 12.2402148,6.7597852 12.1464466,6.85355339 Z","fill-rule":"nonzero"},null)])])}function F(){return e.createVNode("svg",{class:D.e("icon-arrow"),width:"1em",height:"1em",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("path",{d:"M12.1464466,6.85355339 L8.35355339,10.6464466 C8.15829124,10.8417088 7.84170876,10.8417088 7.64644661,10.6464466 L3.85355339,6.85355339 C3.65829124,6.65829124 3.65829124,6.34170876 3.85355339,6.14644661 C3.94732158,6.05267842 4.07449854,6 4.20710678,6 L11.7928932,6 C12.0690356,6 12.2928932,6.22385763 12.2928932,6.5 C12.2928932,6.63260824 12.2402148,6.7597852 12.1464466,6.85355339 Z","fill-rule":"nonzero"},null)])])}const w=t=>typeof t=="number",h=t=>t===void 0,C=P("input-number");function M(t,r){const p=r.attrs,{style:o,class:s}=p,i=k(p,["style","class"]),m={style:o},f=e.computed(()=>[{[C.b()]:!0,[C.m(t.size)]:!0},s]),n=e.computed(()=>({[C.e("control-buttons")]:!0,disabled:t.disabled})),d=e.computed(()=>({[C.e("input-wrap")]:!0})),b=e.computed(()=>({[C.e("input-box")]:!0,disabled:t.disabled}));return{wrapClass:f,customStyle:m,otherAttrs:i,controlButtonsClass:n,inputWrapClass:d,inputInnerClass:b}}function $(t){const r=e.ref(),o=()=>{r.value.focus()},s=()=>{r.value.blur()},i=()=>{r.value.select()};return t.expose({focus:o,blur:s,select:i}),{inputRef:r}}function L(t){let r=0;if(h(t))return r;const o=t.toString(),s=o.indexOf(".");return s!==-1&&(r=o.length-s-1),r}function z(t,r,o){const{min:s,max:i,step:m,disabled:f}=e.toRefs(t),n=e.reactive({currentValue:t.modelValue||"",userInputValue:void 0}),d=e.computed(()=>h(t.precision)?Math.max(L(t.modelValue),L(m.value)):t.precision),b=e.computed(()=>{if(!h(n.userInputValue))return n.userInputValue;let u=n.currentValue;return u===""||h(u)||Number.isNaN(u)?"":(w(u)&&(u=u.toFixed(d.value)),u)}),p=u=>Number.parseFloat(u.toFixed(d.value)),N=(u,V=1)=>w(u)?p(u+m.value*V):n.currentValue,y=u=>{const V=u+"";if(t.reg&&!V.match(new RegExp(t.reg)))return;let a=Number(u);if(!(a!==0&&(!Number(u)||Number.isNaN(a))))return h(t.precision)||(a=p(a)),(a>i.value||a<s.value)&&(a=a>i.value?i.value:s.value),a},v=u=>{const V=n.currentValue,a=y(u);if(n.userInputValue=void 0,a!==0&&!a){r.emit("update:modelValue",V);return}V!==a&&(r.emit("update:modelValue",a),r.emit("input",a),r.emit("change",a,V),n.currentValue=a)},I=e.computed(()=>w(n.currentValue)&&N(n.currentValue,-1)<t.min),x=e.computed(()=>w(n.currentValue)&&N(n.currentValue)>t.max),B=()=>{if(f.value||x.value)return;o.value.focus();const u=N(n.currentValue||0);v(u)},_=()=>{if(f.value||I.value)return;o.value.focus();const u=N(n.currentValue||0,-1);v(u)};return e.watch(()=>t.modelValue,u=>{n.currentValue=y(u)},{immediate:!0}),{inputVal:b,minDisabled:I,maxDisabled:x,onAdd:B,onSubtract:_,onInput:u=>{n.userInputValue=u.target.value},onChange:u=>{v(u.target.value)}}}var O="",S=e.defineComponent({name:"DInputNumber",props:g,emits:["update:modelValue","change","input"],setup(t,r){const{disabled:o}=e.toRefs(t),{wrapClass:s,customStyle:i,otherAttrs:m,controlButtonsClass:f,inputWrapClass:n,inputInnerClass:d}=M(t,r),{inputRef:b}=$(r),{inputVal:p,minDisabled:N,maxDisabled:y,onAdd:v,onSubtract:I,onInput:x,onChange:B}=z(t,r,b);return()=>e.createVNode("div",e.mergeProps({class:s.value},i),[e.createVNode("div",{class:f.value},[e.createVNode("span",{class:["control-button control-inc",{disabled:y.value}],onClick:v},[e.createVNode(E,null,null)]),e.createVNode("span",{class:["control-button control-dec",{disabled:N.value}],onClick:I},[e.createVNode(F,null,null)])]),e.createVNode("div",{class:n.value},[e.createVNode("input",e.mergeProps({ref:b,value:p.value,placeholder:t.placeholder,disabled:o.value,class:d.value},m,{onInput:x,onChange:B}),null)])])}}),A={title:"InputNumber \u6570\u5B57\u8F93\u5165\u6846",category:"\u6570\u636E\u5F55\u5165",status:"50%",install(t){t.component(S.name,S)}};l.InputNumber=S,l.default=A,Object.defineProperty(l,"__esModule",{value:!0}),l[Symbol.toStringTag]="Module"});
|
package/input-number/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.devui-input-number{position:relative;display:inline-block;width:80px
|
|
1
|
+
.devui-input-number{position:relative;display:inline-block;width:80px}.devui-input-number:hover .devui-input-number__input-box:not(.disabled){border:1px solid var(--devui-form-control-line-hover, #575d6c);padding-right:24px}.devui-input-number:hover .devui-input-number__control-buttons:not(.disabled){display:flex;border-color:var(--devui-form-control-line-hover, #575d6c)}.devui-input-number:focus-within .devui-input-number__input-box:not(.disabled){border:1px solid var(--devui-form-control-line-active, #5e7ce0);padding-right:24px}.devui-input-number:focus-within .devui-input-number__control-buttons:not(.disabled){display:flex;border-color:var(--devui-form-control-line-active, #5e7ce0)}.devui-input-number .devui-input-number__input-box{box-sizing:border-box;width:100%;height:32px;line-height:var(--devui-line-height-base, 1.5);padding:4px 8px;display:block;font-size:var(--devui-font-size, 14px);outline:none;border-radius:var(--devui-border-radius, 2px);border:1px solid var(--devui-form-control-line, #d7d8da);cursor:text;-moz-appearance:textfield;transition:border-color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-input-number .devui-input-number__input-box:not(.disabled){background-color:var(--devui-base-bg, #ffffff);border-color:var(--devui-line, #d7d8da);color:var(--devui-text, #252b3a)}.devui-input-number .devui-input-number__input-box::-webkit-inner-spin-button,.devui-input-number .devui-input-number__input-box::-webkit-outer-spin-button{-webkit-appearance:none}.devui-input-number .devui-input-number__control-buttons{box-sizing:border-box;position:absolute;right:0;width:22px;height:100%;line-height:100%;display:none;flex-direction:column;justify-content:center;align-items:center;border:1px solid transparent;border-left-color:var(--devui-line, #d7d8da);border-radius:0 var(--devui-border-radius, 2px) var(--devui-border-radius, 2px) 0}.devui-input-number .devui-input-number__control-buttons.disabled{border-left-color:var(--devui-disabled-line, #dfe1e6)}.devui-input-number .devui-input-number__control-buttons .control-button{user-select:none;box-sizing:border-box;height:50%;line-height:50%;border-width:0 1px;display:flex;justify-content:center;align-items:center;background-color:var(--devui-base-bg, #ffffff);transition:transform var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-input-number .devui-input-number__control-buttons .control-button.control-inc svg{position:relative;top:2px;transform:rotate(180deg)}.devui-input-number .devui-input-number__control-buttons .control-button.control-dec svg{position:relative;bottom:2px}.devui-input-number .devui-input-number__control-buttons .control-button svg path{fill:var(--devui-text-weak, #575d6c)}.devui-input-number .devui-input-number__control-buttons .control-button:not(.disabled){cursor:pointer}.devui-input-number .devui-input-number__control-buttons .control-button:not(.disabled):hover>svg path{fill:var(--devui-icon-fill-active-hover, #252b3a)}.devui-input-number .devui-input-number__control-buttons .control-button.disabled>svg path{fill:var(--devui-disabled-text, #adb0b8)}.devui-input-number .devui-input-number__input-wrap{height:100%}.devui-input-number .disabled{cursor:not-allowed}.devui-input-number--lg{height:40px}.devui-input-number--lg .devui-input-number__input-box{font-size:var(--devui-font-size-lg, 14px);height:100%}.devui-input-number--lg .devui-input-number__control-buttons .control-button .devui-input-number__icon-arrow{width:20px;height:20px}.devui-input-number--md{height:32px}.devui-input-number--md .devui-input-number__input-box{font-size:var(--devui-font-size, 14px);height:100%}.devui-input-number--md .devui-input-number__control-buttons .control-button .devui-input-number__icon-arrow{width:18px;height:18px}.devui-input-number--sm{height:24px}.devui-input-number--sm .devui-input-number__input-box{font-size:var(--devui-font-size-sm, 12px);height:100%}.devui-input-number--sm .devui-input-number__control-buttons .control-button .devui-input-number__icon-arrow{width:16px;height:16px}
|
package/layout/index.es.js
CHANGED
|
@@ -9,8 +9,8 @@ function createBem(namespace, element, modifier) {
|
|
|
9
9
|
}
|
|
10
10
|
return cls;
|
|
11
11
|
}
|
|
12
|
-
function useNamespace(block) {
|
|
13
|
-
const namespace = `devui-${block}`;
|
|
12
|
+
function useNamespace(block, needDot = false) {
|
|
13
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
14
14
|
const b = () => createBem(namespace);
|
|
15
15
|
const e = (element) => element ? createBem(namespace, element) : "";
|
|
16
16
|
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
@@ -95,7 +95,7 @@ var Aside = defineComponent({
|
|
|
95
95
|
return () => {
|
|
96
96
|
var _a;
|
|
97
97
|
return createVNode("div", {
|
|
98
|
-
"class": ns.
|
|
98
|
+
"class": ns.em("aside", "inner")
|
|
99
99
|
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
100
100
|
};
|
|
101
101
|
}
|
package/layout/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(d,
|
|
1
|
+
(function(d,o){typeof exports=="object"&&typeof module!="undefined"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(d=typeof globalThis!="undefined"?globalThis:d||self,o(d.index={},d.Vue))})(this,function(d,o){"use strict";function c(a,e,t){let n=a;return e&&(n+=`__${e}`),t&&(n+=`--${t}`),n}function u(a,e=!1){const t=e?`.devui-${a}`:`devui-${a}`;return{b:()=>c(t),e:r=>r?c(t,r):"",m:r=>r?c(t,"",r):"",em:(r,C)=>r&&C?c(t,r,C):""}}var l="",i=o.defineComponent({name:"DLayout",emits:[],setup(a,{slots:e}){const t=u("layout");return()=>{var y;const n=(y=e.default)==null?void 0:y.call(e),v=`${n.some(r=>r.type.name==="DAside")?t.e("aside"):""} ${t.b()}`;return o.createVNode("div",{class:v},[n])}}}),A="",m=o.defineComponent({name:"DContent",setup(a,{slots:e}){const t=u("layout");return()=>{var n;return o.createVNode("div",{class:t.e("content")},[(n=e.default)==null?void 0:n.call(e)])}}}),V="",f=o.defineComponent({name:"DHeader",setup(a,{slots:e}){const t=u("layout");return()=>{var n;return o.createVNode("div",{class:t.e("header")},[(n=e.default)==null?void 0:n.call(e)])}}}),$="",s=o.defineComponent({name:"DFooter",setup(a,{slots:e}){const t=u("layout");return()=>{var n;return o.createVNode("div",{class:t.e("footer")},[(n=e.default)==null?void 0:n.call(e)])}}}),p=o.defineComponent({name:"DAside",setup(a,{slots:e}){const t=u("layout");return()=>{var n;return o.createVNode("div",{class:t.em("aside","inner")},[(n=e.default)==null?void 0:n.call(e)])}}}),D={title:"Layout \u5E03\u5C40",category:"\u5E03\u5C40",status:"100%",install(a){a.component(i.name,i),a.component(m.name,m),a.component(f.name,f),a.component(s.name,s),a.component(p.name,p)}};d.Aside=p,d.Content=m,d.Footer=s,d.Header=f,d.Layout=i,d.default=D,Object.defineProperty(d,"__esModule",{value:!0}),d[Symbol.toStringTag]="Module"});
|