@vue/runtime-dom 3.6.0-rc.5 → 3.6.0-rc.6

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.6.0-rc.5
2
+ * @vue/runtime-dom v3.6.0-rc.6
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -13,7 +13,7 @@ let _vue_shared = require("@vue/shared");
13
13
  let policy = void 0;
14
14
  const tt = typeof window !== "undefined" && window.trustedTypes;
15
15
  if (tt) try {
16
- policy = /* @__PURE__ */ tt.createPolicy("vue", { createHTML: (val) => val });
16
+ policy = /*@__PURE__*/ tt.createPolicy("vue", { createHTML: (val) => val });
17
17
  } catch (e) {
18
18
  (0, _vue_runtime_core.warn)(`Error creating trusted types policy: ${e}`);
19
19
  }
@@ -21,7 +21,7 @@ const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) =>
21
21
  const svgNS = "http://www.w3.org/2000/svg";
22
22
  const mathmlNS = "http://www.w3.org/1998/Math/MathML";
23
23
  const doc = typeof document !== "undefined" ? document : null;
24
- const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
24
+ const templateContainer = doc && /*@__PURE__*/ doc.createElement("template");
25
25
  const nodeOps = {
26
26
  insert: (child, parent, anchor) => {
27
27
  parent.insertBefore(child, anchor || null);
@@ -95,7 +95,7 @@ const DOMTransitionPropsValidators = {
95
95
  leaveActiveClass: String,
96
96
  leaveToClass: String
97
97
  };
98
- const TransitionPropsValidators = /* @__PURE__ */ (0, _vue_shared.extend)({}, _vue_runtime_core.BaseTransitionPropsValidators, DOMTransitionPropsValidators);
98
+ const TransitionPropsValidators = /*@__PURE__*/ (0, _vue_shared.extend)({}, _vue_runtime_core.BaseTransitionPropsValidators, DOMTransitionPropsValidators);
99
99
  /**
100
100
  * Wrap logic that attaches extra properties to Transition in a function
101
101
  * so that it can be annotated as pure
@@ -109,7 +109,7 @@ const decorate$1 = (t) => {
109
109
  * DOM Transition is a higher-order-component based on the platform-agnostic
110
110
  * base Transition component, with DOM-specific logic.
111
111
  */
112
- const Transition = /* @__PURE__ */ decorate$1((props, { slots }) => (0, _vue_runtime_core.h)(_vue_runtime_core.BaseTransition, resolveTransitionProps(props), slots));
112
+ const Transition = /*@__PURE__*/ decorate$1((props, { slots }) => (0, _vue_runtime_core.h)(_vue_runtime_core.BaseTransition, resolveTransitionProps(props), slots));
113
113
  /**
114
114
  * #3227 Incoming hooks may be merged into arrays when wrapping Transition
115
115
  * with custom HOCs.
@@ -331,14 +331,15 @@ const vShow = {
331
331
  },
332
332
  updated(el, { value, oldValue }, { transition }) {
333
333
  if (!value === !oldValue) return;
334
- if (transition) if (value) {
335
- transition.beforeEnter(el);
336
- setDisplay(el, true);
337
- transition.enter(el);
338
- } else transition.leave(el, () => {
339
- setDisplay(el, false);
340
- });
341
- else setDisplay(el, value);
334
+ if (transition) {
335
+ if (value) {
336
+ transition.beforeEnter(el);
337
+ setDisplay(el, true);
338
+ transition.enter(el);
339
+ } else transition.leave(el, () => {
340
+ setDisplay(el, false);
341
+ });
342
+ } else setDisplay(el, value);
342
343
  },
343
344
  beforeUnmount(el, { value }) {
344
345
  setDisplay(el, value);
@@ -369,11 +370,13 @@ function patchStyle(el, prev, next) {
369
370
  const isCssString = (0, _vue_shared.isString)(next);
370
371
  let hasControlledDisplay = false;
371
372
  if (next && !isCssString) {
372
- if (prev) if (!(0, _vue_shared.isString)(prev)) {
373
- for (const key in prev) if (next[key] == null) setStyle(style, key, "");
374
- } else for (const prevStyle of prev.split(";")) {
375
- const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
376
- if (next[key] == null) setStyle(style, key, "");
373
+ if (prev) {
374
+ if (!(0, _vue_shared.isString)(prev)) {
375
+ for (const key in prev) if (next[key] == null) setStyle(style, key, "");
376
+ } else for (const prevStyle of prev.split(";")) {
377
+ const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
378
+ if (next[key] == null) setStyle(style, key, "");
379
+ }
377
380
  }
378
381
  for (const key in next) {
379
382
  if (key === "display") hasControlledDisplay = true;
@@ -402,8 +405,10 @@ function setStyle(style, name, rawVal) {
402
405
  else {
403
406
  const val = rawVal == null ? "" : String(rawVal);
404
407
  if (semicolonRE.test(val)) (0, _vue_runtime_core.warn)(`Unexpected semicolon at the end of '${name}' style value: '${val}'`);
405
- if (name.startsWith("--")) style.setProperty(name, val);
406
- else {
408
+ if (name.startsWith("--")) {
409
+ if (importantRE.test(val)) style.setProperty(name, val.replace(importantRE, ""), "important");
410
+ else style.setProperty(name, val);
411
+ } else {
407
412
  const prefixed = autoPrefix(style, name);
408
413
  if (importantRE.test(val)) style.setProperty((0, _vue_shared.hyphenate)(prefixed), val.replace(importantRE, ""), "important");
409
414
  else style[prefixed] = val;
@@ -440,9 +445,10 @@ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
440
445
  //#region packages/runtime-dom/src/modules/attrs.ts
441
446
  const xlinkNS = "http://www.w3.org/1999/xlink";
442
447
  function patchAttr(el, key, value, isSVG, instance, isBoolean = (0, _vue_shared.isSpecialBooleanAttr)(key)) {
443
- if (isSVG && key.startsWith("xlink:")) if (value == null) el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
444
- else el.setAttributeNS(xlinkNS, key, value);
445
- else if (value == null || isBoolean && !(0, _vue_shared.includeBooleanAttr)(value)) el.removeAttribute(key);
448
+ if (isSVG && key.startsWith("xlink:")) {
449
+ if (value == null) el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
450
+ else el.setAttributeNS(xlinkNS, key, value);
451
+ } else if (value == null || isBoolean && !(0, _vue_shared.includeBooleanAttr)(value)) el.removeAttribute(key);
446
452
  else el.setAttribute(key, isBoolean ? "" : (0, _vue_shared.isSymbol)(value) ? String(value) : value);
447
453
  }
448
454
  //#endregion
@@ -515,7 +521,7 @@ function parseEventName(name) {
515
521
  return [name[2] === ":" ? name.slice(3) : (0, _vue_shared.hyphenate)(name.slice(2)), options];
516
522
  }
517
523
  let cachedNow = 0;
518
- const p = /* @__PURE__ */ Promise.resolve();
524
+ const p = /*@__PURE__*/ Promise.resolve();
519
525
  const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
520
526
  function createInvoker(initialValue, instance) {
521
527
  const invoker = (e) => {
@@ -583,7 +589,7 @@ function shouldSetAsPropForVueCE(el, key) {
583
589
  //#endregion
584
590
  //#region packages/runtime-dom/src/apiCustomElement.ts
585
591
  const REMOVAL = {};
586
- /* @__NO_SIDE_EFFECTS__ */
592
+ /*@__NO_SIDE_EFFECTS__*/
587
593
  function defineCustomElement(options, extraOptions, _createApp) {
588
594
  let Comp = (0, _vue_runtime_core.defineComponent)(options, extraOptions);
589
595
  if ((0, _vue_shared.isPlainObject)(Comp)) Comp = (0, _vue_shared.extend)({}, Comp, extraOptions);
@@ -632,12 +638,14 @@ var VueElementBase = class VueElementBase extends BaseClass {
632
638
  this._parent = parent;
633
639
  break;
634
640
  }
635
- if (!this._instance) if (this._resolved) this._mountComponent(this._def);
636
- else if (parent && parent._pendingResolve) this._pendingResolve = parent._pendingResolve.then(() => {
637
- this._pendingResolve = void 0;
638
- if (this.isConnected) return this._resolveDef();
639
- });
640
- else this._resolveDef();
641
+ if (!this._instance) {
642
+ if (this._resolved) this._mountComponent(this._def);
643
+ else if (parent && parent._pendingResolve) this._pendingResolve = parent._pendingResolve.then(() => {
644
+ this._pendingResolve = void 0;
645
+ if (this.isConnected) return this._resolveDef();
646
+ });
647
+ else this._resolveDef();
648
+ }
641
649
  }
642
650
  disconnectedCallback() {
643
651
  this._connected = false;
@@ -1035,7 +1043,7 @@ const decorate = (t) => {
1035
1043
  };
1036
1044
  const TransitionGroup = /* @__PURE__ */ decorate({
1037
1045
  name: "TransitionGroup",
1038
- props: /* @__PURE__ */ (0, _vue_shared.extend)({}, TransitionPropsValidators, {
1046
+ props: /*@__PURE__*/ (0, _vue_shared.extend)({}, TransitionPropsValidators, {
1039
1047
  tag: String,
1040
1048
  moveClass: String
1041
1049
  }),
@@ -1316,19 +1324,39 @@ const vModelSelectInit = (el, value, number, set) => {
1316
1324
  el._modelValue = value;
1317
1325
  addEventListener(el, "change", () => {
1318
1326
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map((o) => number ? (0, _vue_shared.looseToNumber)(getValue(o)) : getValue(o));
1319
- (set || el[assignKey])(el.multiple ? (0, _vue_shared.isSet)(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]);
1320
- el._assigning = true;
1321
- (0, _vue_runtime_core.nextTick)(() => {
1322
- el._assigning = false;
1323
- });
1327
+ const multiple = el.multiple;
1328
+ const assignedValue = multiple ? (0, _vue_shared.isSet)(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0];
1329
+ const pending = el._pendingValue = [multiple, multiple ? (0, _vue_shared.isArray)(assignedValue) ? selectedVal.slice() : selectedVal : assignedValue];
1330
+ try {
1331
+ (set || el[assignKey])(assignedValue);
1332
+ } finally {
1333
+ (0, _vue_runtime_core.nextTick)(() => {
1334
+ if (el._pendingValue === pending) el._pendingValue = void 0;
1335
+ });
1336
+ }
1324
1337
  });
1325
1338
  };
1339
+ function isSameSelectValue(value, assignedValue, multiple) {
1340
+ if (!multiple) return (0, _vue_shared.looseEqual)(value, assignedValue);
1341
+ if ((0, _vue_shared.isArray)(value)) return (0, _vue_shared.looseEqual)(value, assignedValue);
1342
+ if ((0, _vue_shared.isSet)(value)) {
1343
+ if (value.size !== assignedValue.length) return false;
1344
+ for (const item of assignedValue) if (!value.has(item)) return false;
1345
+ return true;
1346
+ }
1347
+ return false;
1348
+ }
1326
1349
  /**
1327
1350
  * @internal
1328
1351
  */
1329
1352
  const vModelSetSelected = (el, value) => {
1330
1353
  el._modelValue = value;
1331
- if (el._assigning) return;
1354
+ const pending = el._pendingValue;
1355
+ el._pendingValue = void 0;
1356
+ if (pending && pending[0] === el.multiple && isSameSelectValue(value, pending[1], pending[0])) return;
1357
+ setSelected(el, value);
1358
+ };
1359
+ function setSelected(el, value) {
1332
1360
  const isMultiple = el.multiple;
1333
1361
  const isArrayValue = (0, _vue_shared.isArray)(value);
1334
1362
  if (isMultiple && !isArrayValue && !(0, _vue_shared.isSet)(value)) {
@@ -1338,18 +1366,19 @@ const vModelSetSelected = (el, value) => {
1338
1366
  for (let i = 0, l = el.options.length; i < l; i++) {
1339
1367
  const option = el.options[i];
1340
1368
  const optionValue = getValue(option);
1341
- if (isMultiple) if (isArrayValue) {
1342
- const optionType = typeof optionValue;
1343
- if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
1344
- else option.selected = (0, _vue_shared.looseIndexOf)(value, optionValue) > -1;
1345
- } else option.selected = value.has(optionValue);
1346
- else if ((0, _vue_shared.looseEqual)(getValue(option), value)) {
1369
+ if (isMultiple) {
1370
+ if (isArrayValue) {
1371
+ const optionType = typeof optionValue;
1372
+ if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
1373
+ else option.selected = (0, _vue_shared.looseIndexOf)(value, optionValue) > -1;
1374
+ } else option.selected = value.has(optionValue);
1375
+ } else if ((0, _vue_shared.looseEqual)(getValue(option), value)) {
1347
1376
  if (el.selectedIndex !== i) el.selectedIndex = i;
1348
1377
  return;
1349
1378
  }
1350
1379
  }
1351
1380
  if (!isMultiple && el.selectedIndex !== -1) el.selectedIndex = -1;
1352
- };
1381
+ }
1353
1382
  /**
1354
1383
  * @internal retrieve raw value set via :value bindings
1355
1384
  */
@@ -1469,7 +1498,7 @@ const withKeys = (fn, modifiers) => {
1469
1498
  };
1470
1499
  //#endregion
1471
1500
  //#region packages/runtime-dom/src/index.ts
1472
- const rendererOptions = /* @__PURE__ */ (0, _vue_shared.extend)({ patchProp }, nodeOps);
1501
+ const rendererOptions = /*@__PURE__*/ (0, _vue_shared.extend)({ patchProp }, nodeOps);
1473
1502
  let renderer;
1474
1503
  let enabledHydration = false;
1475
1504
  function ensureRenderer() {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.6.0-rc.5
2
+ * @vue/runtime-dom v3.6.0-rc.6
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -13,13 +13,13 @@ let _vue_shared = require("@vue/shared");
13
13
  let policy = void 0;
14
14
  const tt = typeof window !== "undefined" && window.trustedTypes;
15
15
  if (tt) try {
16
- policy = /* @__PURE__ */ tt.createPolicy("vue", { createHTML: (val) => val });
16
+ policy = /*@__PURE__*/ tt.createPolicy("vue", { createHTML: (val) => val });
17
17
  } catch (e) {}
18
18
  const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val;
19
19
  const svgNS = "http://www.w3.org/2000/svg";
20
20
  const mathmlNS = "http://www.w3.org/1998/Math/MathML";
21
21
  const doc = typeof document !== "undefined" ? document : null;
22
- const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
22
+ const templateContainer = doc && /*@__PURE__*/ doc.createElement("template");
23
23
  const nodeOps = {
24
24
  insert: (child, parent, anchor) => {
25
25
  parent.insertBefore(child, anchor || null);
@@ -93,7 +93,7 @@ const DOMTransitionPropsValidators = {
93
93
  leaveActiveClass: String,
94
94
  leaveToClass: String
95
95
  };
96
- const TransitionPropsValidators = /* @__PURE__ */ (0, _vue_shared.extend)({}, _vue_runtime_core.BaseTransitionPropsValidators, DOMTransitionPropsValidators);
96
+ const TransitionPropsValidators = /*@__PURE__*/ (0, _vue_shared.extend)({}, _vue_runtime_core.BaseTransitionPropsValidators, DOMTransitionPropsValidators);
97
97
  /**
98
98
  * Wrap logic that attaches extra properties to Transition in a function
99
99
  * so that it can be annotated as pure
@@ -107,7 +107,7 @@ const decorate$1 = (t) => {
107
107
  * DOM Transition is a higher-order-component based on the platform-agnostic
108
108
  * base Transition component, with DOM-specific logic.
109
109
  */
110
- const Transition = /* @__PURE__ */ decorate$1((props, { slots }) => (0, _vue_runtime_core.h)(_vue_runtime_core.BaseTransition, resolveTransitionProps(props), slots));
110
+ const Transition = /*@__PURE__*/ decorate$1((props, { slots }) => (0, _vue_runtime_core.h)(_vue_runtime_core.BaseTransition, resolveTransitionProps(props), slots));
111
111
  /**
112
112
  * #3227 Incoming hooks may be merged into arrays when wrapping Transition
113
113
  * with custom HOCs.
@@ -327,14 +327,15 @@ const vShow = {
327
327
  },
328
328
  updated(el, { value, oldValue }, { transition }) {
329
329
  if (!value === !oldValue) return;
330
- if (transition) if (value) {
331
- transition.beforeEnter(el);
332
- setDisplay(el, true);
333
- transition.enter(el);
334
- } else transition.leave(el, () => {
335
- setDisplay(el, false);
336
- });
337
- else setDisplay(el, value);
330
+ if (transition) {
331
+ if (value) {
332
+ transition.beforeEnter(el);
333
+ setDisplay(el, true);
334
+ transition.enter(el);
335
+ } else transition.leave(el, () => {
336
+ setDisplay(el, false);
337
+ });
338
+ } else setDisplay(el, value);
338
339
  },
339
340
  beforeUnmount(el, { value }) {
340
341
  setDisplay(el, value);
@@ -365,11 +366,13 @@ function patchStyle(el, prev, next) {
365
366
  const isCssString = (0, _vue_shared.isString)(next);
366
367
  let hasControlledDisplay = false;
367
368
  if (next && !isCssString) {
368
- if (prev) if (!(0, _vue_shared.isString)(prev)) {
369
- for (const key in prev) if (next[key] == null) setStyle(style, key, "");
370
- } else for (const prevStyle of prev.split(";")) {
371
- const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
372
- if (next[key] == null) setStyle(style, key, "");
369
+ if (prev) {
370
+ if (!(0, _vue_shared.isString)(prev)) {
371
+ for (const key in prev) if (next[key] == null) setStyle(style, key, "");
372
+ } else for (const prevStyle of prev.split(";")) {
373
+ const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
374
+ if (next[key] == null) setStyle(style, key, "");
375
+ }
373
376
  }
374
377
  for (const key in next) {
375
378
  if (key === "display") hasControlledDisplay = true;
@@ -396,8 +399,10 @@ function setStyle(style, name, rawVal) {
396
399
  if ((0, _vue_shared.isArray)(rawVal)) rawVal.forEach((v) => setStyle(style, name, v));
397
400
  else {
398
401
  const val = rawVal == null ? "" : String(rawVal);
399
- if (name.startsWith("--")) style.setProperty(name, val);
400
- else {
402
+ if (name.startsWith("--")) {
403
+ if (importantRE.test(val)) style.setProperty(name, val.replace(importantRE, ""), "important");
404
+ else style.setProperty(name, val);
405
+ } else {
401
406
  const prefixed = autoPrefix(style, name);
402
407
  if (importantRE.test(val)) style.setProperty((0, _vue_shared.hyphenate)(prefixed), val.replace(importantRE, ""), "important");
403
408
  else style[prefixed] = val;
@@ -434,9 +439,10 @@ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
434
439
  //#region packages/runtime-dom/src/modules/attrs.ts
435
440
  const xlinkNS = "http://www.w3.org/1999/xlink";
436
441
  function patchAttr(el, key, value, isSVG, instance, isBoolean = (0, _vue_shared.isSpecialBooleanAttr)(key)) {
437
- if (isSVG && key.startsWith("xlink:")) if (value == null) el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
438
- else el.setAttributeNS(xlinkNS, key, value);
439
- else if (value == null || isBoolean && !(0, _vue_shared.includeBooleanAttr)(value)) el.removeAttribute(key);
442
+ if (isSVG && key.startsWith("xlink:")) {
443
+ if (value == null) el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
444
+ else el.setAttributeNS(xlinkNS, key, value);
445
+ } else if (value == null || isBoolean && !(0, _vue_shared.includeBooleanAttr)(value)) el.removeAttribute(key);
440
446
  else el.setAttribute(key, isBoolean ? "" : (0, _vue_shared.isSymbol)(value) ? String(value) : value);
441
447
  }
442
448
  //#endregion
@@ -507,7 +513,7 @@ function parseEventName(name) {
507
513
  return [name[2] === ":" ? name.slice(3) : (0, _vue_shared.hyphenate)(name.slice(2)), options];
508
514
  }
509
515
  let cachedNow = 0;
510
- const p = /* @__PURE__ */ Promise.resolve();
516
+ const p = /*@__PURE__*/ Promise.resolve();
511
517
  const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
512
518
  function createInvoker(initialValue, instance) {
513
519
  const invoker = (e) => {
@@ -570,7 +576,7 @@ function shouldSetAsPropForVueCE(el, key) {
570
576
  //#endregion
571
577
  //#region packages/runtime-dom/src/apiCustomElement.ts
572
578
  const REMOVAL = {};
573
- /* @__NO_SIDE_EFFECTS__ */
579
+ /*@__NO_SIDE_EFFECTS__*/
574
580
  function defineCustomElement(options, extraOptions, _createApp) {
575
581
  let Comp = (0, _vue_runtime_core.defineComponent)(options, extraOptions);
576
582
  if ((0, _vue_shared.isPlainObject)(Comp)) Comp = (0, _vue_shared.extend)({}, Comp, extraOptions);
@@ -619,12 +625,14 @@ var VueElementBase = class VueElementBase extends BaseClass {
619
625
  this._parent = parent;
620
626
  break;
621
627
  }
622
- if (!this._instance) if (this._resolved) this._mountComponent(this._def);
623
- else if (parent && parent._pendingResolve) this._pendingResolve = parent._pendingResolve.then(() => {
624
- this._pendingResolve = void 0;
625
- if (this.isConnected) return this._resolveDef();
626
- });
627
- else this._resolveDef();
628
+ if (!this._instance) {
629
+ if (this._resolved) this._mountComponent(this._def);
630
+ else if (parent && parent._pendingResolve) this._pendingResolve = parent._pendingResolve.then(() => {
631
+ this._pendingResolve = void 0;
632
+ if (this.isConnected) return this._resolveDef();
633
+ });
634
+ else this._resolveDef();
635
+ }
628
636
  }
629
637
  disconnectedCallback() {
630
638
  this._connected = false;
@@ -976,7 +984,7 @@ const decorate = (t) => {
976
984
  };
977
985
  const TransitionGroup = /* @__PURE__ */ decorate({
978
986
  name: "TransitionGroup",
979
- props: /* @__PURE__ */ (0, _vue_shared.extend)({}, TransitionPropsValidators, {
987
+ props: /*@__PURE__*/ (0, _vue_shared.extend)({}, TransitionPropsValidators, {
980
988
  tag: String,
981
989
  moveClass: String
982
990
  }),
@@ -1256,37 +1264,58 @@ const vModelSelectInit = (el, value, number, set) => {
1256
1264
  el._modelValue = value;
1257
1265
  addEventListener(el, "change", () => {
1258
1266
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map((o) => number ? (0, _vue_shared.looseToNumber)(getValue(o)) : getValue(o));
1259
- (set || el[assignKey])(el.multiple ? (0, _vue_shared.isSet)(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]);
1260
- el._assigning = true;
1261
- (0, _vue_runtime_core.nextTick)(() => {
1262
- el._assigning = false;
1263
- });
1267
+ const multiple = el.multiple;
1268
+ const assignedValue = multiple ? (0, _vue_shared.isSet)(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0];
1269
+ const pending = el._pendingValue = [multiple, multiple ? (0, _vue_shared.isArray)(assignedValue) ? selectedVal.slice() : selectedVal : assignedValue];
1270
+ try {
1271
+ (set || el[assignKey])(assignedValue);
1272
+ } finally {
1273
+ (0, _vue_runtime_core.nextTick)(() => {
1274
+ if (el._pendingValue === pending) el._pendingValue = void 0;
1275
+ });
1276
+ }
1264
1277
  });
1265
1278
  };
1279
+ function isSameSelectValue(value, assignedValue, multiple) {
1280
+ if (!multiple) return (0, _vue_shared.looseEqual)(value, assignedValue);
1281
+ if ((0, _vue_shared.isArray)(value)) return (0, _vue_shared.looseEqual)(value, assignedValue);
1282
+ if ((0, _vue_shared.isSet)(value)) {
1283
+ if (value.size !== assignedValue.length) return false;
1284
+ for (const item of assignedValue) if (!value.has(item)) return false;
1285
+ return true;
1286
+ }
1287
+ return false;
1288
+ }
1266
1289
  /**
1267
1290
  * @internal
1268
1291
  */
1269
1292
  const vModelSetSelected = (el, value) => {
1270
1293
  el._modelValue = value;
1271
- if (el._assigning) return;
1294
+ const pending = el._pendingValue;
1295
+ el._pendingValue = void 0;
1296
+ if (pending && pending[0] === el.multiple && isSameSelectValue(value, pending[1], pending[0])) return;
1297
+ setSelected(el, value);
1298
+ };
1299
+ function setSelected(el, value) {
1272
1300
  const isMultiple = el.multiple;
1273
1301
  const isArrayValue = (0, _vue_shared.isArray)(value);
1274
1302
  if (isMultiple && !isArrayValue && !(0, _vue_shared.isSet)(value)) return;
1275
1303
  for (let i = 0, l = el.options.length; i < l; i++) {
1276
1304
  const option = el.options[i];
1277
1305
  const optionValue = getValue(option);
1278
- if (isMultiple) if (isArrayValue) {
1279
- const optionType = typeof optionValue;
1280
- if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
1281
- else option.selected = (0, _vue_shared.looseIndexOf)(value, optionValue) > -1;
1282
- } else option.selected = value.has(optionValue);
1283
- else if ((0, _vue_shared.looseEqual)(getValue(option), value)) {
1306
+ if (isMultiple) {
1307
+ if (isArrayValue) {
1308
+ const optionType = typeof optionValue;
1309
+ if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
1310
+ else option.selected = (0, _vue_shared.looseIndexOf)(value, optionValue) > -1;
1311
+ } else option.selected = value.has(optionValue);
1312
+ } else if ((0, _vue_shared.looseEqual)(getValue(option), value)) {
1284
1313
  if (el.selectedIndex !== i) el.selectedIndex = i;
1285
1314
  return;
1286
1315
  }
1287
1316
  }
1288
1317
  if (!isMultiple && el.selectedIndex !== -1) el.selectedIndex = -1;
1289
- };
1318
+ }
1290
1319
  /**
1291
1320
  * @internal retrieve raw value set via :value bindings
1292
1321
  */
@@ -1406,7 +1435,7 @@ const withKeys = (fn, modifiers) => {
1406
1435
  };
1407
1436
  //#endregion
1408
1437
  //#region packages/runtime-dom/src/index.ts
1409
- const rendererOptions = /* @__PURE__ */ (0, _vue_shared.extend)({ patchProp }, nodeOps);
1438
+ const rendererOptions = /*@__PURE__*/ (0, _vue_shared.extend)({ patchProp }, nodeOps);
1410
1439
  let renderer;
1411
1440
  let enabledHydration = false;
1412
1441
  function ensureRenderer() {