@vuact/runtime-dom 3.5.28-vuact.2 → 3.5.29-vuact.0
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/runtime-dom.cjs.js +138 -67
- package/dist/runtime-dom.cjs.prod.js +138 -64
- package/dist/runtime-dom.d.ts +693 -647
- package/dist/runtime-dom.esm-browser.js +2966 -2686
- package/dist/runtime-dom.esm-browser.prod.js +4 -3
- package/dist/runtime-dom.esm-bundler.js +142 -72
- package/dist/runtime-dom.global.js +2938 -2656
- package/dist/runtime-dom.global.prod.js +4 -3
- package/package.json +8 -8
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @
|
|
2
|
+
* @vue/runtime-dom v3.5.29
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
|
-
import { warn, BaseTransitionPropsValidators, h, BaseTransition, assertNumber, getCurrentInstance, onBeforeUpdate, queuePostFlushCb, onMounted, watch, onUnmounted, Fragment, Static, camelize, callWithAsyncErrorHandling,
|
|
6
|
+
import { warn, BaseTransitionPropsValidators, h, BaseTransition, assertNumber, getCurrentInstance, onBeforeUpdate, queuePostFlushCb, onMounted, watch, onUnmounted, Fragment, Static, camelize, callWithAsyncErrorHandling, nextTick, unref, createVNode, defineComponent, useTransitionState, onUpdated, toRaw, getTransitionRawChildren, setTransitionHooks, resolveTransitionHooks, Text, createRenderer, isRuntimeOnly, createHydrationRenderer } from '@vue/runtime-core';
|
|
7
7
|
export * from '@vue/runtime-core';
|
|
8
|
-
import { extend, isObject, toNumber, isArray, NOOP, isString, hyphenate, capitalize,
|
|
8
|
+
import { extend, isObject, toNumber, isArray, NOOP, normalizeCssVarValue, isString, hyphenate, capitalize, includeBooleanAttr, isSymbol, isSpecialBooleanAttr, isFunction, isOn, isModelListener, camelize as camelize$1, hasOwn, isPlainObject, EMPTY_OBJ, looseIndexOf, isSet, looseEqual, looseToNumber, invokeArrayFns, isHTMLTag, isSVGTag, isMathMLTag } from '@vue/shared';
|
|
9
9
|
|
|
10
10
|
let policy = void 0;
|
|
11
11
|
const tt = typeof window !== "undefined" && window.trustedTypes;
|
|
@@ -90,7 +90,7 @@ const nodeOps = {
|
|
|
90
90
|
|
|
91
91
|
const TRANSITION = "transition";
|
|
92
92
|
const ANIMATION = "animation";
|
|
93
|
-
const vtcKey = Symbol("_vtc");
|
|
93
|
+
const vtcKey = /* @__PURE__ */ Symbol("_vtc");
|
|
94
94
|
const DOMTransitionPropsValidators = {
|
|
95
95
|
name: String,
|
|
96
96
|
type: String,
|
|
@@ -214,11 +214,11 @@ function resolveTransitionProps(rawProps) {
|
|
|
214
214
|
const resolve = () => finishLeave(el, done);
|
|
215
215
|
addTransitionClass(el, leaveFromClass);
|
|
216
216
|
if (!el._enterCancelled) {
|
|
217
|
-
forceReflow();
|
|
217
|
+
forceReflow(el);
|
|
218
218
|
addTransitionClass(el, leaveActiveClass);
|
|
219
219
|
} else {
|
|
220
220
|
addTransitionClass(el, leaveActiveClass);
|
|
221
|
-
forceReflow();
|
|
221
|
+
forceReflow(el);
|
|
222
222
|
}
|
|
223
223
|
nextFrame(() => {
|
|
224
224
|
if (!el._isLeaving) {
|
|
@@ -344,7 +344,7 @@ function getTransitionInfo(el, expectedType) {
|
|
|
344
344
|
type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
|
|
345
345
|
propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
|
|
346
346
|
}
|
|
347
|
-
const hasTransform = type === TRANSITION && /\b(transform|all)(
|
|
347
|
+
const hasTransform = type === TRANSITION && /\b(?:transform|all)(?:,|$)/.test(
|
|
348
348
|
getStyleProperties(`${TRANSITION}Property`).toString()
|
|
349
349
|
);
|
|
350
350
|
return {
|
|
@@ -364,8 +364,9 @@ function toMs(s) {
|
|
|
364
364
|
if (s === "auto") return 0;
|
|
365
365
|
return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
|
|
366
366
|
}
|
|
367
|
-
function forceReflow() {
|
|
368
|
-
|
|
367
|
+
function forceReflow(el) {
|
|
368
|
+
const targetDocument = el ? el.ownerDocument : document;
|
|
369
|
+
return targetDocument.body.offsetHeight;
|
|
369
370
|
}
|
|
370
371
|
|
|
371
372
|
function patchClass(el, value, isSVG) {
|
|
@@ -382,9 +383,11 @@ function patchClass(el, value, isSVG) {
|
|
|
382
383
|
}
|
|
383
384
|
}
|
|
384
385
|
|
|
385
|
-
const vShowOriginalDisplay = Symbol("_vod");
|
|
386
|
-
const vShowHidden = Symbol("_vsh");
|
|
386
|
+
const vShowOriginalDisplay = /* @__PURE__ */ Symbol("_vod");
|
|
387
|
+
const vShowHidden = /* @__PURE__ */ Symbol("_vsh");
|
|
387
388
|
const vShow = {
|
|
389
|
+
// used for prop mismatch check during hydration
|
|
390
|
+
name: "show",
|
|
388
391
|
beforeMount(el, { value }, { transition }) {
|
|
389
392
|
el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
|
|
390
393
|
if (transition && value) {
|
|
@@ -418,9 +421,6 @@ const vShow = {
|
|
|
418
421
|
setDisplay(el, value);
|
|
419
422
|
}
|
|
420
423
|
};
|
|
421
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
422
|
-
vShow.name = "show";
|
|
423
|
-
}
|
|
424
424
|
function setDisplay(el, value) {
|
|
425
425
|
el.style.display = value ? el[vShowOriginalDisplay] : "none";
|
|
426
426
|
el[vShowHidden] = !value;
|
|
@@ -433,7 +433,7 @@ function initVShowForSSR() {
|
|
|
433
433
|
};
|
|
434
434
|
}
|
|
435
435
|
|
|
436
|
-
const CSS_VAR_TEXT = Symbol(!!(process.env.NODE_ENV !== "production") ? "CSS_VAR_TEXT" : "");
|
|
436
|
+
const CSS_VAR_TEXT = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? "CSS_VAR_TEXT" : "");
|
|
437
437
|
function useCssVars(getter) {
|
|
438
438
|
const instance = getCurrentInstance();
|
|
439
439
|
if (!instance) {
|
|
@@ -498,14 +498,15 @@ function setVarsOnNode(el, vars) {
|
|
|
498
498
|
const style = el.style;
|
|
499
499
|
let cssText = "";
|
|
500
500
|
for (const key in vars) {
|
|
501
|
-
|
|
502
|
-
|
|
501
|
+
const value = normalizeCssVarValue(vars[key]);
|
|
502
|
+
style.setProperty(`--${key}`, value);
|
|
503
|
+
cssText += `--${key}: ${value};`;
|
|
503
504
|
}
|
|
504
505
|
style[CSS_VAR_TEXT] = cssText;
|
|
505
506
|
}
|
|
506
507
|
}
|
|
507
508
|
|
|
508
|
-
const displayRE = /(
|
|
509
|
+
const displayRE = /(?:^|;)\s*display\s*:/;
|
|
509
510
|
function patchStyle(el, prev, next) {
|
|
510
511
|
const style = el.style;
|
|
511
512
|
const isCssString = isString(next);
|
|
@@ -682,7 +683,7 @@ function addEventListener(el, event, handler, options) {
|
|
|
682
683
|
function removeEventListener(el, event, handler, options) {
|
|
683
684
|
el.removeEventListener(event, handler, options);
|
|
684
685
|
}
|
|
685
|
-
const veiKey = Symbol("_vei");
|
|
686
|
+
const veiKey = /* @__PURE__ */ Symbol("_vei");
|
|
686
687
|
function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
|
|
687
688
|
const invokers = el[veiKey] || (el[veiKey] = {});
|
|
688
689
|
const existingInvoker = invokers[rawName];
|
|
@@ -806,6 +807,9 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
|
|
806
807
|
if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") {
|
|
807
808
|
return false;
|
|
808
809
|
}
|
|
810
|
+
if (key === "sandbox" && el.tagName === "IFRAME") {
|
|
811
|
+
return false;
|
|
812
|
+
}
|
|
809
813
|
if (key === "form") {
|
|
810
814
|
return false;
|
|
811
815
|
}
|
|
@@ -828,11 +832,10 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
|
|
828
832
|
}
|
|
829
833
|
|
|
830
834
|
const REMOVAL = {};
|
|
831
|
-
/*! #__NO_SIDE_EFFECTS__ */
|
|
832
835
|
// @__NO_SIDE_EFFECTS__
|
|
833
836
|
function defineCustomElement(options, extraOptions, _createApp) {
|
|
834
|
-
|
|
835
|
-
if (isPlainObject(Comp)) extend(Comp, extraOptions);
|
|
837
|
+
let Comp = defineComponent(options, extraOptions);
|
|
838
|
+
if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions);
|
|
836
839
|
class VueCustomElement extends VueElement {
|
|
837
840
|
constructor(initialProps) {
|
|
838
841
|
super(Comp, initialProps, _createApp);
|
|
@@ -841,10 +844,9 @@ function defineCustomElement(options, extraOptions, _createApp) {
|
|
|
841
844
|
VueCustomElement.def = Comp;
|
|
842
845
|
return VueCustomElement;
|
|
843
846
|
}
|
|
844
|
-
|
|
845
|
-
const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
|
|
847
|
+
const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
|
|
846
848
|
return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
|
|
847
|
-
};
|
|
849
|
+
});
|
|
848
850
|
const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
|
|
849
851
|
};
|
|
850
852
|
class VueElement extends BaseClass {
|
|
@@ -868,6 +870,8 @@ class VueElement extends BaseClass {
|
|
|
868
870
|
this._nonce = this._def.nonce;
|
|
869
871
|
this._connected = false;
|
|
870
872
|
this._resolved = false;
|
|
873
|
+
this._patching = false;
|
|
874
|
+
this._dirty = false;
|
|
871
875
|
this._numberProps = null;
|
|
872
876
|
this._styleChildren = /* @__PURE__ */ new WeakSet();
|
|
873
877
|
this._ob = null;
|
|
@@ -880,7 +884,11 @@ class VueElement extends BaseClass {
|
|
|
880
884
|
);
|
|
881
885
|
}
|
|
882
886
|
if (_def.shadowRoot !== false) {
|
|
883
|
-
this.attachShadow(
|
|
887
|
+
this.attachShadow(
|
|
888
|
+
extend({}, _def.shadowRootOptions, {
|
|
889
|
+
mode: "open"
|
|
890
|
+
})
|
|
891
|
+
);
|
|
884
892
|
this._root = this.shadowRoot;
|
|
885
893
|
} else {
|
|
886
894
|
this._root = this;
|
|
@@ -940,9 +948,18 @@ class VueElement extends BaseClass {
|
|
|
940
948
|
this._app && this._app.unmount();
|
|
941
949
|
if (this._instance) this._instance.ce = void 0;
|
|
942
950
|
this._app = this._instance = null;
|
|
951
|
+
if (this._teleportTargets) {
|
|
952
|
+
this._teleportTargets.clear();
|
|
953
|
+
this._teleportTargets = void 0;
|
|
954
|
+
}
|
|
943
955
|
}
|
|
944
956
|
});
|
|
945
957
|
}
|
|
958
|
+
_processMutations(mutations) {
|
|
959
|
+
for (const m of mutations) {
|
|
960
|
+
this._setAttr(m.attributeName);
|
|
961
|
+
}
|
|
962
|
+
}
|
|
946
963
|
/**
|
|
947
964
|
* resolve inner component definition (handle possible async component)
|
|
948
965
|
*/
|
|
@@ -953,11 +970,7 @@ class VueElement extends BaseClass {
|
|
|
953
970
|
for (let i = 0; i < this.attributes.length; i++) {
|
|
954
971
|
this._setAttr(this.attributes[i].name);
|
|
955
972
|
}
|
|
956
|
-
this._ob = new MutationObserver((
|
|
957
|
-
for (const m of mutations) {
|
|
958
|
-
this._setAttr(m.attributeName);
|
|
959
|
-
}
|
|
960
|
-
});
|
|
973
|
+
this._ob = new MutationObserver(this._processMutations.bind(this));
|
|
961
974
|
this._ob.observe(this, { attributes: true });
|
|
962
975
|
const resolve = (def, isAsync = false) => {
|
|
963
976
|
this._resolved = true;
|
|
@@ -988,9 +1001,10 @@ class VueElement extends BaseClass {
|
|
|
988
1001
|
};
|
|
989
1002
|
const asyncDef = this._def.__asyncLoader;
|
|
990
1003
|
if (asyncDef) {
|
|
991
|
-
this._pendingResolve = asyncDef().then(
|
|
992
|
-
|
|
993
|
-
|
|
1004
|
+
this._pendingResolve = asyncDef().then((def) => {
|
|
1005
|
+
def.configureApp = this._def.configureApp;
|
|
1006
|
+
resolve(this._def = def, true);
|
|
1007
|
+
});
|
|
994
1008
|
} else {
|
|
995
1009
|
resolve(this._def);
|
|
996
1010
|
}
|
|
@@ -1033,7 +1047,7 @@ class VueElement extends BaseClass {
|
|
|
1033
1047
|
return this._getProp(key);
|
|
1034
1048
|
},
|
|
1035
1049
|
set(val) {
|
|
1036
|
-
this._setProp(key, val, true,
|
|
1050
|
+
this._setProp(key, val, true, !this._patching);
|
|
1037
1051
|
}
|
|
1038
1052
|
});
|
|
1039
1053
|
}
|
|
@@ -1059,6 +1073,7 @@ class VueElement extends BaseClass {
|
|
|
1059
1073
|
*/
|
|
1060
1074
|
_setProp(key, val, shouldReflect = true, shouldUpdate = false) {
|
|
1061
1075
|
if (val !== this._props[key]) {
|
|
1076
|
+
this._dirty = true;
|
|
1062
1077
|
if (val === REMOVAL) {
|
|
1063
1078
|
delete this._props[key];
|
|
1064
1079
|
} else {
|
|
@@ -1072,7 +1087,10 @@ class VueElement extends BaseClass {
|
|
|
1072
1087
|
}
|
|
1073
1088
|
if (shouldReflect) {
|
|
1074
1089
|
const ob = this._ob;
|
|
1075
|
-
|
|
1090
|
+
if (ob) {
|
|
1091
|
+
this._processMutations(ob.takeRecords());
|
|
1092
|
+
ob.disconnect();
|
|
1093
|
+
}
|
|
1076
1094
|
if (val === true) {
|
|
1077
1095
|
this.setAttribute(hyphenate(key), "");
|
|
1078
1096
|
} else if (typeof val === "string" || typeof val === "number") {
|
|
@@ -1176,7 +1194,7 @@ class VueElement extends BaseClass {
|
|
|
1176
1194
|
* Only called when shadowRoot is false
|
|
1177
1195
|
*/
|
|
1178
1196
|
_renderSlots() {
|
|
1179
|
-
const outlets =
|
|
1197
|
+
const outlets = this._getSlots();
|
|
1180
1198
|
const scopeId = this._instance.type.__scopeId;
|
|
1181
1199
|
for (let i = 0; i < outlets.length; i++) {
|
|
1182
1200
|
const o = outlets[i];
|
|
@@ -1202,12 +1220,51 @@ class VueElement extends BaseClass {
|
|
|
1202
1220
|
parent.removeChild(o);
|
|
1203
1221
|
}
|
|
1204
1222
|
}
|
|
1223
|
+
/**
|
|
1224
|
+
* @internal
|
|
1225
|
+
*/
|
|
1226
|
+
_getSlots() {
|
|
1227
|
+
const roots = [this];
|
|
1228
|
+
if (this._teleportTargets) {
|
|
1229
|
+
roots.push(...this._teleportTargets);
|
|
1230
|
+
}
|
|
1231
|
+
const slots = /* @__PURE__ */ new Set();
|
|
1232
|
+
for (const root of roots) {
|
|
1233
|
+
const found = root.querySelectorAll("slot");
|
|
1234
|
+
for (let i = 0; i < found.length; i++) {
|
|
1235
|
+
slots.add(found[i]);
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
return Array.from(slots);
|
|
1239
|
+
}
|
|
1205
1240
|
/**
|
|
1206
1241
|
* @internal
|
|
1207
1242
|
*/
|
|
1208
1243
|
_injectChildStyle(comp) {
|
|
1209
1244
|
this._applyStyles(comp.styles, comp);
|
|
1210
1245
|
}
|
|
1246
|
+
/**
|
|
1247
|
+
* @internal
|
|
1248
|
+
*/
|
|
1249
|
+
_beginPatch() {
|
|
1250
|
+
this._patching = true;
|
|
1251
|
+
this._dirty = false;
|
|
1252
|
+
}
|
|
1253
|
+
/**
|
|
1254
|
+
* @internal
|
|
1255
|
+
*/
|
|
1256
|
+
_endPatch() {
|
|
1257
|
+
this._patching = false;
|
|
1258
|
+
if (this._dirty && this._instance) {
|
|
1259
|
+
this._update();
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
/**
|
|
1263
|
+
* @internal
|
|
1264
|
+
*/
|
|
1265
|
+
_hasShadowRoot() {
|
|
1266
|
+
return this._def.shadowRoot !== false;
|
|
1267
|
+
}
|
|
1211
1268
|
/**
|
|
1212
1269
|
* @internal
|
|
1213
1270
|
*/
|
|
@@ -1270,8 +1327,8 @@ function useCssModule(name = "$style") {
|
|
|
1270
1327
|
|
|
1271
1328
|
const positionMap = /* @__PURE__ */ new WeakMap();
|
|
1272
1329
|
const newPositionMap = /* @__PURE__ */ new WeakMap();
|
|
1273
|
-
const moveCbKey = Symbol("_moveCb");
|
|
1274
|
-
const enterCbKey = Symbol("_enterCb");
|
|
1330
|
+
const moveCbKey = /* @__PURE__ */ Symbol("_moveCb");
|
|
1331
|
+
const enterCbKey = /* @__PURE__ */ Symbol("_enterCb");
|
|
1275
1332
|
const decorate = (t) => {
|
|
1276
1333
|
delete t.props.mode;
|
|
1277
1334
|
return t;
|
|
@@ -1303,7 +1360,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
|
|
|
1303
1360
|
prevChildren.forEach(callPendingCbs);
|
|
1304
1361
|
prevChildren.forEach(recordPosition);
|
|
1305
1362
|
const movedChildren = prevChildren.filter(applyTranslation);
|
|
1306
|
-
forceReflow();
|
|
1363
|
+
forceReflow(instance.vnode.el);
|
|
1307
1364
|
movedChildren.forEach((c) => {
|
|
1308
1365
|
const el = c.el;
|
|
1309
1366
|
const style = el.style;
|
|
@@ -1313,7 +1370,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
|
|
|
1313
1370
|
if (e && e.target !== el) {
|
|
1314
1371
|
return;
|
|
1315
1372
|
}
|
|
1316
|
-
if (!e ||
|
|
1373
|
+
if (!e || e.propertyName.endsWith("transform")) {
|
|
1317
1374
|
el.removeEventListener("transitionend", cb);
|
|
1318
1375
|
el[moveCbKey] = null;
|
|
1319
1376
|
removeTransitionClass(el, moveClass);
|
|
@@ -1342,10 +1399,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
|
|
|
1342
1399
|
instance
|
|
1343
1400
|
)
|
|
1344
1401
|
);
|
|
1345
|
-
positionMap.set(
|
|
1346
|
-
child,
|
|
1347
|
-
child.el.getBoundingClientRect()
|
|
1348
|
-
);
|
|
1402
|
+
positionMap.set(child, getPosition(child.el));
|
|
1349
1403
|
}
|
|
1350
1404
|
}
|
|
1351
1405
|
}
|
|
@@ -1376,7 +1430,7 @@ function callPendingCbs(c) {
|
|
|
1376
1430
|
}
|
|
1377
1431
|
}
|
|
1378
1432
|
function recordPosition(c) {
|
|
1379
|
-
newPositionMap.set(c, c.el
|
|
1433
|
+
newPositionMap.set(c, getPosition(c.el));
|
|
1380
1434
|
}
|
|
1381
1435
|
function applyTranslation(c) {
|
|
1382
1436
|
const oldPos = positionMap.get(c);
|
|
@@ -1384,12 +1438,29 @@ function applyTranslation(c) {
|
|
|
1384
1438
|
const dx = oldPos.left - newPos.left;
|
|
1385
1439
|
const dy = oldPos.top - newPos.top;
|
|
1386
1440
|
if (dx || dy) {
|
|
1387
|
-
const
|
|
1388
|
-
s
|
|
1441
|
+
const el = c.el;
|
|
1442
|
+
const s = el.style;
|
|
1443
|
+
const rect = el.getBoundingClientRect();
|
|
1444
|
+
let scaleX = 1;
|
|
1445
|
+
let scaleY = 1;
|
|
1446
|
+
if (el.offsetWidth) scaleX = rect.width / el.offsetWidth;
|
|
1447
|
+
if (el.offsetHeight) scaleY = rect.height / el.offsetHeight;
|
|
1448
|
+
if (!Number.isFinite(scaleX) || scaleX === 0) scaleX = 1;
|
|
1449
|
+
if (!Number.isFinite(scaleY) || scaleY === 0) scaleY = 1;
|
|
1450
|
+
if (Math.abs(scaleX - 1) < 0.01) scaleX = 1;
|
|
1451
|
+
if (Math.abs(scaleY - 1) < 0.01) scaleY = 1;
|
|
1452
|
+
s.transform = s.webkitTransform = `translate(${dx / scaleX}px,${dy / scaleY}px)`;
|
|
1389
1453
|
s.transitionDuration = "0s";
|
|
1390
1454
|
return c;
|
|
1391
1455
|
}
|
|
1392
1456
|
}
|
|
1457
|
+
function getPosition(el) {
|
|
1458
|
+
const rect = el.getBoundingClientRect();
|
|
1459
|
+
return {
|
|
1460
|
+
left: rect.left,
|
|
1461
|
+
top: rect.top
|
|
1462
|
+
};
|
|
1463
|
+
}
|
|
1393
1464
|
function hasCSSTransform(el, root, moveClass) {
|
|
1394
1465
|
const clone = el.cloneNode();
|
|
1395
1466
|
const _vtc = el[vtcKey];
|
|
@@ -1421,25 +1492,23 @@ function onCompositionEnd(e) {
|
|
|
1421
1492
|
target.dispatchEvent(new Event("input"));
|
|
1422
1493
|
}
|
|
1423
1494
|
}
|
|
1424
|
-
const assignKey = Symbol("_assign");
|
|
1495
|
+
const assignKey = /* @__PURE__ */ Symbol("_assign");
|
|
1496
|
+
function castValue(value, trim, number) {
|
|
1497
|
+
if (trim) value = value.trim();
|
|
1498
|
+
if (number) value = looseToNumber(value);
|
|
1499
|
+
return value;
|
|
1500
|
+
}
|
|
1425
1501
|
const vModelText = {
|
|
1426
1502
|
created(el, { modifiers: { lazy, trim, number } }, vnode) {
|
|
1427
1503
|
el[assignKey] = getModelAssigner(vnode);
|
|
1428
1504
|
const castToNumber = number || vnode.props && vnode.props.type === "number";
|
|
1429
1505
|
addEventListener(el, lazy ? "change" : "input", (e) => {
|
|
1430
1506
|
if (e.target.composing) return;
|
|
1431
|
-
|
|
1432
|
-
if (trim) {
|
|
1433
|
-
domValue = domValue.trim();
|
|
1434
|
-
}
|
|
1435
|
-
if (castToNumber) {
|
|
1436
|
-
domValue = looseToNumber(domValue);
|
|
1437
|
-
}
|
|
1438
|
-
el[assignKey](domValue);
|
|
1507
|
+
el[assignKey](castValue(el.value, trim, castToNumber));
|
|
1439
1508
|
});
|
|
1440
|
-
if (trim) {
|
|
1509
|
+
if (trim || castToNumber) {
|
|
1441
1510
|
addEventListener(el, "change", () => {
|
|
1442
|
-
el.value = el.value
|
|
1511
|
+
el.value = castValue(el.value, trim, castToNumber);
|
|
1443
1512
|
});
|
|
1444
1513
|
}
|
|
1445
1514
|
if (!lazy) {
|
|
@@ -1702,15 +1771,16 @@ const modifierGuards = {
|
|
|
1702
1771
|
exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
|
|
1703
1772
|
};
|
|
1704
1773
|
const withModifiers = (fn, modifiers) => {
|
|
1774
|
+
if (!fn) return fn;
|
|
1705
1775
|
const cache = fn._withMods || (fn._withMods = {});
|
|
1706
1776
|
const cacheKey = modifiers.join(".");
|
|
1707
|
-
return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
|
|
1777
|
+
return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
|
|
1708
1778
|
for (let i = 0; i < modifiers.length; i++) {
|
|
1709
1779
|
const guard = modifierGuards[modifiers[i]];
|
|
1710
1780
|
if (guard && guard(event, modifiers)) return;
|
|
1711
1781
|
}
|
|
1712
1782
|
return fn(event, ...args);
|
|
1713
|
-
});
|
|
1783
|
+
}));
|
|
1714
1784
|
};
|
|
1715
1785
|
const keyNames = {
|
|
1716
1786
|
esc: "escape",
|
|
@@ -1724,7 +1794,7 @@ const keyNames = {
|
|
|
1724
1794
|
const withKeys = (fn, modifiers) => {
|
|
1725
1795
|
const cache = fn._withKeys || (fn._withKeys = {});
|
|
1726
1796
|
const cacheKey = modifiers.join(".");
|
|
1727
|
-
return cache[cacheKey] || (cache[cacheKey] = (event) => {
|
|
1797
|
+
return cache[cacheKey] || (cache[cacheKey] = ((event) => {
|
|
1728
1798
|
if (!("key" in event)) {
|
|
1729
1799
|
return;
|
|
1730
1800
|
}
|
|
@@ -1734,7 +1804,7 @@ const withKeys = (fn, modifiers) => {
|
|
|
1734
1804
|
)) {
|
|
1735
1805
|
return fn(event);
|
|
1736
1806
|
}
|
|
1737
|
-
});
|
|
1807
|
+
}));
|
|
1738
1808
|
};
|
|
1739
1809
|
|
|
1740
1810
|
const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
|
|
@@ -1748,13 +1818,13 @@ function ensureHydrationRenderer() {
|
|
|
1748
1818
|
enabledHydration = true;
|
|
1749
1819
|
return renderer;
|
|
1750
1820
|
}
|
|
1751
|
-
const render = (...args) => {
|
|
1821
|
+
const render = ((...args) => {
|
|
1752
1822
|
ensureRenderer().render(...args);
|
|
1753
|
-
};
|
|
1754
|
-
const hydrate = (...args) => {
|
|
1823
|
+
});
|
|
1824
|
+
const hydrate = ((...args) => {
|
|
1755
1825
|
ensureHydrationRenderer().hydrate(...args);
|
|
1756
|
-
};
|
|
1757
|
-
const createApp = (...args) => {
|
|
1826
|
+
});
|
|
1827
|
+
const createApp = ((...args) => {
|
|
1758
1828
|
const app = ensureRenderer().createApp(...args);
|
|
1759
1829
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1760
1830
|
injectNativeTagCheck(app);
|
|
@@ -1779,8 +1849,8 @@ const createApp = (...args) => {
|
|
|
1779
1849
|
return proxy;
|
|
1780
1850
|
};
|
|
1781
1851
|
return app;
|
|
1782
|
-
};
|
|
1783
|
-
const createSSRApp = (...args) => {
|
|
1852
|
+
});
|
|
1853
|
+
const createSSRApp = ((...args) => {
|
|
1784
1854
|
const app = ensureHydrationRenderer().createApp(...args);
|
|
1785
1855
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1786
1856
|
injectNativeTagCheck(app);
|
|
@@ -1794,7 +1864,7 @@ const createSSRApp = (...args) => {
|
|
|
1794
1864
|
}
|
|
1795
1865
|
};
|
|
1796
1866
|
return app;
|
|
1797
|
-
};
|
|
1867
|
+
});
|
|
1798
1868
|
function resolveRootNamespace(container) {
|
|
1799
1869
|
if (container instanceof SVGElement) {
|
|
1800
1870
|
return "svg";
|
|
@@ -1864,4 +1934,4 @@ const initDirectivesForSSR = () => {
|
|
|
1864
1934
|
}
|
|
1865
1935
|
} ;
|
|
1866
1936
|
|
|
1867
|
-
export { Transition, TransitionGroup, VueElement, createApp, createSSRApp, defineCustomElement, defineSSRCustomElement, hydrate, initDirectivesForSSR, render, rendererOptions, useCssModule, useCssVars, useHost, useShadowRoot, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, withKeys, withModifiers };
|
|
1937
|
+
export { Transition, TransitionGroup, VueElement, createApp, createSSRApp, defineCustomElement, defineSSRCustomElement, hydrate, initDirectivesForSSR, nodeOps, patchProp, render, rendererOptions, useCssModule, useCssVars, useHost, useShadowRoot, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, withKeys, withModifiers };
|