@varlet/ui 2.16.2 → 2.16.3-alpha.1694267513697
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/es/action-sheet/ActionSheet.mjs +20 -16
- package/es/app-bar/AppBar.mjs +10 -9
- package/es/avatar/Avatar.mjs +16 -15
- package/es/avatar-group/AvatarGroup.mjs +4 -3
- package/es/back-top/BackTop.mjs +20 -19
- package/es/badge/Badge.mjs +4 -3
- package/es/bottom-navigation/BottomNavigation.mjs +70 -63
- package/es/bottom-navigation-item/BottomNavigationItem.mjs +13 -10
- package/es/breadcrumb/Breadcrumb.mjs +5 -4
- package/es/breadcrumbs/Breadcrumbs.mjs +2 -1
- package/es/button/Button.mjs +10 -9
- package/es/button-group/ButtonGroup.mjs +2 -1
- package/es/card/Card.mjs +28 -26
- package/es/cell/Cell.mjs +5 -4
- package/es/checkbox/Checkbox.mjs +32 -29
- package/es/checkbox-group/CheckboxGroup.mjs +45 -40
- package/es/chip/Chip.mjs +6 -5
- package/es/col/Col.mjs +15 -14
- package/es/collapse/Collapse.mjs +30 -29
- package/es/collapse-item/CollapseItem.mjs +52 -47
- package/es/countdown/Countdown.mjs +36 -35
- package/es/counter/Counter.mjs +63 -60
- package/es/date-picker/DatePicker.mjs +67 -63
- package/es/dialog/Dialog.mjs +39 -29
- package/es/divider/Divider.mjs +6 -9
- package/es/drag/Drag.mjs +47 -45
- package/es/ellipsis/Ellipsis.mjs +6 -5
- package/es/fab/Fab.mjs +21 -20
- package/es/field-decorator/FieldDecorator.mjs +14 -13
- package/es/form/Form.mjs +41 -36
- package/es/form-details/FormDetails.mjs +2 -1
- package/es/hover-overlay/HoverOverlay.mjs +6 -7
- package/es/icon/Icon.mjs +14 -12
- package/es/image/Image.mjs +14 -12
- package/es/image-preview/ImagePreview.mjs +51 -50
- package/es/index-anchor/IndexAnchor.mjs +15 -12
- package/es/index-bar/IndexBar.mjs +68 -65
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/input/Input.mjs +63 -56
- package/es/link/Link.mjs +6 -5
- package/es/list/List.mjs +55 -46
- package/es/loading/Loading.mjs +11 -8
- package/es/loading-bar/LoadingBar.mjs +2 -1
- package/es/menu/Menu.mjs +2 -1
- package/es/option/Option.mjs +14 -11
- package/es/overlay/Overlay.mjs +18 -18
- package/es/pagination/Pagination.mjs +67 -64
- package/es/paper/Paper.mjs +4 -3
- package/es/picker/Picker.mjs +95 -85
- package/es/popup/Popup.mjs +26 -23
- package/es/progress/Progress.mjs +9 -8
- package/es/pull-refresh/PullRefresh.mjs +54 -51
- package/es/radio/Radio.mjs +25 -22
- package/es/radio-group/RadioGroup.mjs +30 -25
- package/es/rate/Rate.mjs +35 -28
- package/es/result/Result.mjs +6 -5
- package/es/row/Row.mjs +14 -13
- package/es/select/Select.mjs +57 -54
- package/es/skeleton/Skeleton.mjs +8 -9
- package/es/slider/Slider.mjs +86 -79
- package/es/snackbar/Snackbar.mjs +4 -3
- package/es/space/Space.mjs +5 -2
- package/es/step/Step.mjs +7 -4
- package/es/steps/Steps.mjs +5 -4
- package/es/sticky/Sticky.mjs +30 -27
- package/es/style-provider/StyleProvider.mjs +2 -1
- package/es/swipe/Swipe.mjs +95 -89
- package/es/swipe-item/SwipeItem.mjs +5 -4
- package/es/switch/Switch.mjs +22 -17
- package/es/tab/Tab.mjs +16 -12
- package/es/tab-item/TabItem.mjs +7 -6
- package/es/table/Table.mjs +8 -9
- package/es/tabs/Tabs.mjs +57 -52
- package/es/tabs-items/TabsItems.mjs +38 -29
- package/es/time-picker/TimePicker.mjs +63 -60
- package/es/tooltip/Tooltip.mjs +3 -2
- package/es/uploader/Uploader.mjs +100 -85
- package/es/utils/components.mjs +2 -1
- package/es/utils/shared.mjs +0 -1
- package/es/varlet.esm.js +9589 -8914
- package/es/watermark/Watermark.mjs +29 -26
- package/highlight/web-types.en-US.json +1 -1
- package/highlight/web-types.zh-CN.json +1 -1
- package/lib/varlet.cjs.js +2366 -2103
- package/package.json +12 -14
- package/umd/varlet.js +4 -4
|
@@ -4,6 +4,7 @@ import { useIndexBar } from './provide.mjs';
|
|
|
4
4
|
import { props } from './props.mjs';
|
|
5
5
|
import { createNamespace } from '../utils/components.mjs';
|
|
6
6
|
var {
|
|
7
|
+
name,
|
|
7
8
|
n,
|
|
8
9
|
classes
|
|
9
10
|
} = createNamespace('index-anchor');
|
|
@@ -24,22 +25,22 @@ function __render__(_ctx, _cache) {
|
|
|
24
25
|
}, 8 /* PROPS */, ["offset-top", "z-index", "disabled", "css-mode"]);
|
|
25
26
|
}
|
|
26
27
|
var __sfc__ = defineComponent({
|
|
27
|
-
name
|
|
28
|
+
name,
|
|
28
29
|
components: {
|
|
29
30
|
VarSticky
|
|
30
31
|
},
|
|
31
32
|
inheritAttrs: false,
|
|
32
33
|
props,
|
|
33
34
|
setup(props) {
|
|
35
|
+
var ownTop = ref(0);
|
|
36
|
+
var disabled = ref(false);
|
|
37
|
+
var name = computed(() => props.index);
|
|
38
|
+
var anchorEl = ref(null);
|
|
34
39
|
var {
|
|
35
40
|
index,
|
|
36
41
|
indexBar,
|
|
37
42
|
bindIndexBar
|
|
38
43
|
} = useIndexBar();
|
|
39
|
-
var ownTop = ref(0);
|
|
40
|
-
var disabled = ref(false);
|
|
41
|
-
var name = computed(() => props.index);
|
|
42
|
-
var anchorEl = ref(null);
|
|
43
44
|
var {
|
|
44
45
|
active,
|
|
45
46
|
sticky,
|
|
@@ -47,13 +48,6 @@ var __sfc__ = defineComponent({
|
|
|
47
48
|
stickyOffsetTop,
|
|
48
49
|
zIndex
|
|
49
50
|
} = indexBar;
|
|
50
|
-
var setOwnTop = () => {
|
|
51
|
-
if (!anchorEl.value) return;
|
|
52
|
-
ownTop.value = anchorEl.value.$el ? anchorEl.value.$el.offsetTop : anchorEl.value.offsetTop;
|
|
53
|
-
};
|
|
54
|
-
var setDisabled = value => {
|
|
55
|
-
disabled.value = value;
|
|
56
|
-
};
|
|
57
51
|
var indexAnchorProvider = {
|
|
58
52
|
index,
|
|
59
53
|
name,
|
|
@@ -62,6 +56,15 @@ var __sfc__ = defineComponent({
|
|
|
62
56
|
setDisabled
|
|
63
57
|
};
|
|
64
58
|
bindIndexBar(indexAnchorProvider);
|
|
59
|
+
function setOwnTop() {
|
|
60
|
+
if (!anchorEl.value) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
ownTop.value = anchorEl.value.$el ? anchorEl.value.$el.offsetTop : anchorEl.value.offsetTop;
|
|
64
|
+
}
|
|
65
|
+
function setDisabled(value) {
|
|
66
|
+
disabled.value = value;
|
|
67
|
+
}
|
|
65
68
|
return {
|
|
66
69
|
n,
|
|
67
70
|
classes,
|
|
@@ -9,6 +9,7 @@ import { props } from './props.mjs';
|
|
|
9
9
|
import { createNamespace, call } from '../utils/components.mjs';
|
|
10
10
|
import { onSmartMounted } from '@varlet/use';
|
|
11
11
|
var {
|
|
12
|
+
name,
|
|
12
13
|
n,
|
|
13
14
|
classes
|
|
14
15
|
} = createNamespace('index-bar');
|
|
@@ -41,14 +42,9 @@ function __render__(_ctx, _cache) {
|
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
var __sfc__ = defineComponent({
|
|
44
|
-
name
|
|
45
|
+
name,
|
|
45
46
|
props,
|
|
46
47
|
setup(props) {
|
|
47
|
-
var {
|
|
48
|
-
length,
|
|
49
|
-
indexAnchors,
|
|
50
|
-
bindIndexAnchors
|
|
51
|
-
} = useIndexAnchors();
|
|
52
48
|
var clickedName = ref('');
|
|
53
49
|
var barEl = ref(null);
|
|
54
50
|
var anchorNameList = ref([]);
|
|
@@ -57,6 +53,11 @@ var __sfc__ = defineComponent({
|
|
|
57
53
|
var cssMode = computed(() => props.stickyCssMode || props.cssMode);
|
|
58
54
|
var stickyOffsetTop = computed(() => toPxNum(props.stickyOffsetTop));
|
|
59
55
|
var zIndex = computed(() => props.zIndex);
|
|
56
|
+
var {
|
|
57
|
+
length,
|
|
58
|
+
indexAnchors,
|
|
59
|
+
bindIndexAnchors
|
|
60
|
+
} = useIndexAnchors();
|
|
60
61
|
var scroller = null;
|
|
61
62
|
var isDeactivated = false;
|
|
62
63
|
var indexBarProvider = {
|
|
@@ -66,16 +67,46 @@ var __sfc__ = defineComponent({
|
|
|
66
67
|
stickyOffsetTop,
|
|
67
68
|
zIndex
|
|
68
69
|
};
|
|
70
|
+
watch(() => length.value, /*#__PURE__*/_asyncToGenerator(function* () {
|
|
71
|
+
yield doubleRaf();
|
|
72
|
+
indexAnchors.forEach(_ref2 => {
|
|
73
|
+
var {
|
|
74
|
+
name,
|
|
75
|
+
setOwnTop
|
|
76
|
+
} = _ref2;
|
|
77
|
+
if (name.value) anchorNameList.value.push(name.value);
|
|
78
|
+
setOwnTop();
|
|
79
|
+
});
|
|
80
|
+
}));
|
|
81
|
+
onSmartMounted( /*#__PURE__*/_asyncToGenerator(function* () {
|
|
82
|
+
yield setScroller();
|
|
83
|
+
addScrollerListener();
|
|
84
|
+
}));
|
|
85
|
+
onBeforeUnmount(removeScrollerListener);
|
|
86
|
+
onDeactivated(() => {
|
|
87
|
+
isDeactivated = true;
|
|
88
|
+
removeScrollerListener();
|
|
89
|
+
});
|
|
90
|
+
onActivated(() => {
|
|
91
|
+
if (!isDeactivated || active.value === undefined) return;
|
|
92
|
+
anchorClick({
|
|
93
|
+
anchorName: active.value,
|
|
94
|
+
options: {
|
|
95
|
+
event: false
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
isDeactivated = false;
|
|
99
|
+
});
|
|
69
100
|
bindIndexAnchors(indexBarProvider);
|
|
70
|
-
|
|
101
|
+
function emitEvent(anchor, options) {
|
|
71
102
|
var anchorName = isPlainObject(anchor) ? anchor.name.value : anchor;
|
|
72
103
|
if (anchorName === active.value || anchorName === undefined) return;
|
|
73
104
|
active.value = anchorName;
|
|
74
105
|
if ((options == null ? void 0 : options.event) !== false) {
|
|
75
106
|
call(props.onChange, anchorName);
|
|
76
107
|
}
|
|
77
|
-
}
|
|
78
|
-
|
|
108
|
+
}
|
|
109
|
+
function getOffsetTop() {
|
|
79
110
|
if (isWindow(scroller)) return 0;
|
|
80
111
|
var {
|
|
81
112
|
top: parentTop
|
|
@@ -87,8 +118,8 @@ var __sfc__ = defineComponent({
|
|
|
87
118
|
top: targetTop
|
|
88
119
|
} = getRect(barEl.value);
|
|
89
120
|
return scrollTop - parentTop + targetTop;
|
|
90
|
-
}
|
|
91
|
-
|
|
121
|
+
}
|
|
122
|
+
function handleScroll() {
|
|
92
123
|
var scrollTop = getScrollTop(scroller);
|
|
93
124
|
var scrollHeight = scroller === window ? document.body.scrollHeight : scroller.scrollHeight;
|
|
94
125
|
var offsetTop = getOffsetTop();
|
|
@@ -102,24 +133,27 @@ var __sfc__ = defineComponent({
|
|
|
102
133
|
emitEvent(anchor);
|
|
103
134
|
}
|
|
104
135
|
});
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
|
|
136
|
+
}
|
|
137
|
+
function anchorClick(_x) {
|
|
138
|
+
return _anchorClick.apply(this, arguments);
|
|
139
|
+
}
|
|
140
|
+
function _anchorClick() {
|
|
141
|
+
_anchorClick = _asyncToGenerator(function* (_ref4) {
|
|
108
142
|
var {
|
|
109
143
|
anchorName,
|
|
110
144
|
manualCall = false,
|
|
111
145
|
options
|
|
112
|
-
} =
|
|
146
|
+
} = _ref4;
|
|
113
147
|
if (manualCall) {
|
|
114
148
|
call(props.onClick, anchorName);
|
|
115
149
|
}
|
|
116
150
|
if (anchorName === active.value && !isDeactivated) {
|
|
117
151
|
return;
|
|
118
152
|
}
|
|
119
|
-
var indexAnchor = indexAnchors.find(
|
|
153
|
+
var indexAnchor = indexAnchors.find(_ref5 => {
|
|
120
154
|
var {
|
|
121
155
|
name
|
|
122
|
-
} =
|
|
156
|
+
} = _ref5;
|
|
123
157
|
return anchorName === name.value;
|
|
124
158
|
});
|
|
125
159
|
if (!indexAnchor) {
|
|
@@ -139,70 +173,39 @@ var __sfc__ = defineComponent({
|
|
|
139
173
|
yield doubleRaf();
|
|
140
174
|
clickedName.value = '';
|
|
141
175
|
});
|
|
142
|
-
return
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
176
|
+
return _anchorClick.apply(this, arguments);
|
|
177
|
+
}
|
|
178
|
+
function setScroller() {
|
|
179
|
+
return _setScroller.apply(this, arguments);
|
|
180
|
+
}
|
|
181
|
+
function _setScroller() {
|
|
182
|
+
_setScroller = _asyncToGenerator(function* () {
|
|
148
183
|
yield doubleRaf();
|
|
149
184
|
scroller = getParentScroller(barEl.value);
|
|
150
185
|
});
|
|
151
|
-
return
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}();
|
|
155
|
-
var addScrollerListener = () => {
|
|
186
|
+
return _setScroller.apply(this, arguments);
|
|
187
|
+
}
|
|
188
|
+
function addScrollerListener() {
|
|
156
189
|
scroller.addEventListener('scroll', handleScroll);
|
|
157
|
-
}
|
|
158
|
-
|
|
190
|
+
}
|
|
191
|
+
function removeScrollerListener() {
|
|
159
192
|
scroller.removeEventListener('scroll', handleScroll);
|
|
160
|
-
}
|
|
193
|
+
}
|
|
161
194
|
|
|
162
195
|
// expose
|
|
163
|
-
|
|
196
|
+
function scrollTo(index, options) {
|
|
164
197
|
requestAnimationFrame(() => anchorClick({
|
|
165
198
|
anchorName: index,
|
|
166
199
|
options
|
|
167
200
|
}));
|
|
168
|
-
}
|
|
169
|
-
watch(() => length.value, /*#__PURE__*/_asyncToGenerator(function* () {
|
|
170
|
-
yield doubleRaf();
|
|
171
|
-
indexAnchors.forEach(_ref6 => {
|
|
172
|
-
var {
|
|
173
|
-
name,
|
|
174
|
-
setOwnTop
|
|
175
|
-
} = _ref6;
|
|
176
|
-
if (name.value) anchorNameList.value.push(name.value);
|
|
177
|
-
setOwnTop();
|
|
178
|
-
});
|
|
179
|
-
}));
|
|
180
|
-
onSmartMounted( /*#__PURE__*/_asyncToGenerator(function* () {
|
|
181
|
-
yield setScroller();
|
|
182
|
-
addScrollerListener();
|
|
183
|
-
}));
|
|
184
|
-
onBeforeUnmount(removeScrollerListener);
|
|
185
|
-
onDeactivated(() => {
|
|
186
|
-
isDeactivated = true;
|
|
187
|
-
removeScrollerListener();
|
|
188
|
-
});
|
|
189
|
-
onActivated(() => {
|
|
190
|
-
if (!isDeactivated || active.value === undefined) return;
|
|
191
|
-
anchorClick({
|
|
192
|
-
anchorName: active.value,
|
|
193
|
-
options: {
|
|
194
|
-
event: false
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
isDeactivated = false;
|
|
198
|
-
});
|
|
201
|
+
}
|
|
199
202
|
return {
|
|
200
|
-
n,
|
|
201
|
-
classes,
|
|
202
203
|
barEl,
|
|
203
204
|
active,
|
|
204
205
|
zIndex,
|
|
205
206
|
anchorNameList,
|
|
207
|
+
n,
|
|
208
|
+
classes,
|
|
206
209
|
toNumber,
|
|
207
210
|
scrollTo,
|
|
208
211
|
anchorClick
|
package/es/index.bundle.mjs
CHANGED
|
@@ -247,7 +247,7 @@ import './tooltip/style/index.mjs'
|
|
|
247
247
|
import './uploader/style/index.mjs'
|
|
248
248
|
import './watermark/style/index.mjs'
|
|
249
249
|
|
|
250
|
-
const version = '2.16.
|
|
250
|
+
const version = '2.16.3-alpha.1694267513697'
|
|
251
251
|
|
|
252
252
|
function install(app) {
|
|
253
253
|
ActionSheet.install && app.use(ActionSheet)
|
package/es/index.mjs
CHANGED
|
@@ -164,7 +164,7 @@ export * from './tooltip/index.mjs'
|
|
|
164
164
|
export * from './uploader/index.mjs'
|
|
165
165
|
export * from './watermark/index.mjs'
|
|
166
166
|
|
|
167
|
-
const version = '2.16.
|
|
167
|
+
const version = '2.16.3-alpha.1694267513697'
|
|
168
168
|
|
|
169
169
|
function install(app) {
|
|
170
170
|
ActionSheet.install && app.use(ActionSheet)
|
package/es/input/Input.mjs
CHANGED
|
@@ -7,6 +7,7 @@ import { useValidation, createNamespace, call } from '../utils/components.mjs';
|
|
|
7
7
|
import { useForm } from '../form/provide.mjs';
|
|
8
8
|
import { onSmartMounted } from '@varlet/use';
|
|
9
9
|
var {
|
|
10
|
+
name,
|
|
10
11
|
n,
|
|
11
12
|
classes
|
|
12
13
|
} = createNamespace('input');
|
|
@@ -150,7 +151,7 @@ function __render__(_ctx, _cache) {
|
|
|
150
151
|
}
|
|
151
152
|
|
|
152
153
|
var __sfc__ = defineComponent({
|
|
153
|
-
name
|
|
154
|
+
name,
|
|
154
155
|
components: {
|
|
155
156
|
VarFormDetails,
|
|
156
157
|
VarFieldDecorator
|
|
@@ -161,6 +162,18 @@ var __sfc__ = defineComponent({
|
|
|
161
162
|
var el = ref(null);
|
|
162
163
|
var isFocus = ref(false);
|
|
163
164
|
var isComposing = ref(false);
|
|
165
|
+
var {
|
|
166
|
+
bindForm,
|
|
167
|
+
form
|
|
168
|
+
} = useForm();
|
|
169
|
+
var {
|
|
170
|
+
errorMessage,
|
|
171
|
+
validateWithTrigger: vt,
|
|
172
|
+
validate: v,
|
|
173
|
+
// expose
|
|
174
|
+
resetValidation
|
|
175
|
+
} = useValidation();
|
|
176
|
+
var cursor = computed(() => props.disabled || props.readonly ? '' : 'text');
|
|
164
177
|
var normalizedType = computed(() => {
|
|
165
178
|
if (props.type === 'number') {
|
|
166
179
|
return 'text';
|
|
@@ -180,7 +193,6 @@ var __sfc__ = defineComponent({
|
|
|
180
193
|
}
|
|
181
194
|
return String(modelValue).length + "/" + maxlength;
|
|
182
195
|
});
|
|
183
|
-
var cursor = computed(() => props.disabled || props.readonly ? '' : 'text');
|
|
184
196
|
var placeholderColor = computed(() => {
|
|
185
197
|
var {
|
|
186
198
|
hint,
|
|
@@ -198,18 +210,18 @@ var __sfc__ = defineComponent({
|
|
|
198
210
|
}
|
|
199
211
|
return blurColor || 'var(--field-decorator-blur-color)';
|
|
200
212
|
});
|
|
201
|
-
var {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
} = useForm();
|
|
205
|
-
var {
|
|
206
|
-
errorMessage,
|
|
207
|
-
validateWithTrigger: vt,
|
|
208
|
-
validate: v,
|
|
209
|
-
// expose
|
|
213
|
+
var inputProvider = {
|
|
214
|
+
reset,
|
|
215
|
+
validate,
|
|
210
216
|
resetValidation
|
|
211
|
-
}
|
|
212
|
-
|
|
217
|
+
};
|
|
218
|
+
call(bindForm, inputProvider);
|
|
219
|
+
onSmartMounted(() => {
|
|
220
|
+
if (props.autofocus) {
|
|
221
|
+
focus();
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
function validateWithTrigger(trigger) {
|
|
213
225
|
nextTick(() => {
|
|
214
226
|
var {
|
|
215
227
|
validateTrigger,
|
|
@@ -218,18 +230,18 @@ var __sfc__ = defineComponent({
|
|
|
218
230
|
} = props;
|
|
219
231
|
vt(validateTrigger, trigger, rules, modelValue);
|
|
220
232
|
});
|
|
221
|
-
}
|
|
222
|
-
|
|
233
|
+
}
|
|
234
|
+
function handleFocus(e) {
|
|
223
235
|
isFocus.value = true;
|
|
224
236
|
call(props.onFocus, e);
|
|
225
237
|
validateWithTrigger('onFocus');
|
|
226
|
-
}
|
|
227
|
-
|
|
238
|
+
}
|
|
239
|
+
function handleBlur(e) {
|
|
228
240
|
isFocus.value = false;
|
|
229
241
|
call(props.onBlur, e);
|
|
230
242
|
validateWithTrigger('onBlur');
|
|
231
|
-
}
|
|
232
|
-
|
|
243
|
+
}
|
|
244
|
+
function updateValue(e) {
|
|
233
245
|
var target = e.target;
|
|
234
246
|
var {
|
|
235
247
|
value
|
|
@@ -238,18 +250,18 @@ var __sfc__ = defineComponent({
|
|
|
238
250
|
value = formatNumber(value);
|
|
239
251
|
}
|
|
240
252
|
return withMaxlength(withTrim(value));
|
|
241
|
-
}
|
|
242
|
-
|
|
253
|
+
}
|
|
254
|
+
function handleCompositionStart() {
|
|
243
255
|
isComposing.value = true;
|
|
244
|
-
}
|
|
245
|
-
|
|
256
|
+
}
|
|
257
|
+
function handleCompositionEnd(e) {
|
|
246
258
|
if (!isComposing.value) {
|
|
247
259
|
return;
|
|
248
260
|
}
|
|
249
261
|
isComposing.value = false;
|
|
250
262
|
e.target.dispatchEvent(new Event('input'));
|
|
251
|
-
}
|
|
252
|
-
|
|
263
|
+
}
|
|
264
|
+
function handleInput(e) {
|
|
253
265
|
if (isComposing.value) {
|
|
254
266
|
return;
|
|
255
267
|
}
|
|
@@ -257,13 +269,13 @@ var __sfc__ = defineComponent({
|
|
|
257
269
|
call(props['onUpdate:modelValue'], value);
|
|
258
270
|
call(props.onInput, value, e);
|
|
259
271
|
validateWithTrigger('onInput');
|
|
260
|
-
}
|
|
261
|
-
|
|
272
|
+
}
|
|
273
|
+
function handleChange(e) {
|
|
262
274
|
var value = updateValue(e);
|
|
263
275
|
call(props.onChange, value, e);
|
|
264
276
|
validateWithTrigger('onChange');
|
|
265
|
-
}
|
|
266
|
-
|
|
277
|
+
}
|
|
278
|
+
function handleClear() {
|
|
267
279
|
var {
|
|
268
280
|
disabled,
|
|
269
281
|
readonly,
|
|
@@ -276,8 +288,8 @@ var __sfc__ = defineComponent({
|
|
|
276
288
|
call(props['onUpdate:modelValue'], '');
|
|
277
289
|
call(onClear, '');
|
|
278
290
|
validateWithTrigger('onClear');
|
|
279
|
-
}
|
|
280
|
-
|
|
291
|
+
}
|
|
292
|
+
function handleClick(e) {
|
|
281
293
|
var {
|
|
282
294
|
disabled,
|
|
283
295
|
onClick
|
|
@@ -287,8 +299,8 @@ var __sfc__ = defineComponent({
|
|
|
287
299
|
}
|
|
288
300
|
call(onClick, e);
|
|
289
301
|
validateWithTrigger('onClick');
|
|
290
|
-
}
|
|
291
|
-
|
|
302
|
+
}
|
|
303
|
+
function formatNumber(value) {
|
|
292
304
|
var minusIndex = value.indexOf('-');
|
|
293
305
|
var dotIndex = value.indexOf('.');
|
|
294
306
|
if (minusIndex > -1) {
|
|
@@ -298,10 +310,14 @@ var __sfc__ = defineComponent({
|
|
|
298
310
|
value = value.slice(0, dotIndex + 1) + value.slice(dotIndex).replace(/\./g, '');
|
|
299
311
|
}
|
|
300
312
|
return value.replace(/[^-0-9.]/g, '');
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
313
|
+
}
|
|
314
|
+
function withTrim(value) {
|
|
315
|
+
return props.modelModifiers.trim ? value.trim() : value;
|
|
316
|
+
}
|
|
317
|
+
function withMaxlength(value) {
|
|
318
|
+
return props.maxlength ? value.slice(0, toNumber(props.maxlength)) : value;
|
|
319
|
+
}
|
|
320
|
+
function handleMousedown(e) {
|
|
305
321
|
var {
|
|
306
322
|
disabled
|
|
307
323
|
} = props;
|
|
@@ -310,40 +326,31 @@ var __sfc__ = defineComponent({
|
|
|
310
326
|
}
|
|
311
327
|
focus();
|
|
312
328
|
e.preventDefault();
|
|
313
|
-
}
|
|
329
|
+
}
|
|
314
330
|
|
|
315
331
|
// expose
|
|
316
|
-
|
|
332
|
+
function reset() {
|
|
317
333
|
call(props['onUpdate:modelValue'], '');
|
|
318
334
|
resetValidation();
|
|
319
|
-
}
|
|
335
|
+
}
|
|
320
336
|
|
|
321
337
|
// expose
|
|
322
|
-
|
|
338
|
+
function validate() {
|
|
339
|
+
return v(props.rules, props.modelValue);
|
|
340
|
+
}
|
|
323
341
|
|
|
324
342
|
// expose
|
|
325
|
-
|
|
343
|
+
function focus() {
|
|
326
344
|
var _el$value;
|
|
327
345
|
;
|
|
328
346
|
(_el$value = el.value) == null ? void 0 : _el$value.focus();
|
|
329
|
-
}
|
|
347
|
+
}
|
|
330
348
|
|
|
331
349
|
// expose
|
|
332
|
-
|
|
350
|
+
function blur() {
|
|
333
351
|
;
|
|
334
352
|
el.value.blur();
|
|
335
|
-
}
|
|
336
|
-
var inputProvider = {
|
|
337
|
-
reset,
|
|
338
|
-
validate,
|
|
339
|
-
resetValidation
|
|
340
|
-
};
|
|
341
|
-
call(bindForm, inputProvider);
|
|
342
|
-
onSmartMounted(() => {
|
|
343
|
-
if (props.autofocus) {
|
|
344
|
-
focus();
|
|
345
|
-
}
|
|
346
|
-
});
|
|
353
|
+
}
|
|
347
354
|
return {
|
|
348
355
|
el,
|
|
349
356
|
id,
|
package/es/link/Link.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import { props } from './props.mjs';
|
|
|
3
3
|
import { call, createNamespace } from '../utils/components.mjs';
|
|
4
4
|
import { toSizeUnit } from '../utils/elements.mjs';
|
|
5
5
|
var {
|
|
6
|
+
name,
|
|
6
7
|
n,
|
|
7
8
|
classes
|
|
8
9
|
} = createNamespace('link');
|
|
@@ -21,7 +22,7 @@ function __render__(_ctx, _cache) {
|
|
|
21
22
|
}, 16 /* FULL_PROPS */, ["class", "style", "onClick"]);
|
|
22
23
|
}
|
|
23
24
|
var __sfc__ = defineComponent({
|
|
24
|
-
name
|
|
25
|
+
name,
|
|
25
26
|
props,
|
|
26
27
|
setup(props) {
|
|
27
28
|
var tag = computed(() => {
|
|
@@ -64,17 +65,17 @@ var __sfc__ = defineComponent({
|
|
|
64
65
|
}
|
|
65
66
|
return {};
|
|
66
67
|
});
|
|
67
|
-
|
|
68
|
+
function handleClick(e) {
|
|
68
69
|
if (props.disabled) {
|
|
69
70
|
return;
|
|
70
71
|
}
|
|
71
72
|
call(props.onClick, e);
|
|
72
|
-
}
|
|
73
|
+
}
|
|
73
74
|
return {
|
|
74
|
-
n,
|
|
75
|
-
classes,
|
|
76
75
|
tag,
|
|
77
76
|
linkProps,
|
|
77
|
+
n,
|
|
78
|
+
classes,
|
|
78
79
|
handleClick,
|
|
79
80
|
toSizeUnit
|
|
80
81
|
};
|