runtime-dom.cjs.js 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. var runtimeCore = require('@vue/runtime-core');
  4. var shared = require('@vue/shared');
  5. const svgNS = 'http://www.w3.org/2000/svg';
  6. const doc = (typeof document !== 'undefined' ? document : null);
  7. let tempContainer;
  8. let tempSVGContainer;
  9. const nodeOps = {
  10. insert: (child, parent, anchor) => {
  11. parent.insertBefore(child, anchor || null);
  12. },
  13. remove: child => {
  14. const parent = child.parentNode;
  15. if (parent) {
  16. parent.removeChild(child);
  17. }
  18. },
  19. createElement: (tag, isSVG, is) => isSVG
  20. ? doc.createElementNS(svgNS, tag)
  21. : doc.createElement(tag, is ? { is } : undefined),
  22. createText: text => doc.createTextNode(text),
  23. createComment: text => doc.createComment(text),
  24. setText: (node, text) => {
  25. node.nodeValue = text;
  26. },
  27. setElementText: (el, text) => {
  28. el.textContent = text;
  29. },
  30. parentNode: node => node.parentNode,
  31. nextSibling: node => node.nextSibling,
  32. querySelector: selector => doc.querySelector(selector),
  33. setScopeId(el, id) {
  34. el.setAttribute(id, '');
  35. },
  36. cloneNode(el) {
  37. return el.cloneNode(true);
  38. },
  39. // __UNSAFE__
  40. // Reason: innerHTML.
  41. // Static content here can only come from compiled templates.
  42. // As long as the user only uses trusted templates, this is safe.
  43. insertStaticContent(content, parent, anchor, isSVG) {
  44. const temp = isSVG
  45. ? tempSVGContainer ||
  46. (tempSVGContainer = doc.createElementNS(svgNS, 'svg'))
  47. : tempContainer || (tempContainer = doc.createElement('div'));
  48. temp.innerHTML = content;
  49. const first = temp.firstChild;
  50. let node = first;
  51. let last = node;
  52. while (node) {
  53. last = node;
  54. nodeOps.insert(node, parent, anchor);
  55. node = temp.firstChild;
  56. }
  57. return [first, last];
  58. }
  59. };
  60. // compiler should normalize class + :class bindings on the same element
  61. // into a single binding ['staticClass', dynamic]
  62. function patchClass(el, value, isSVG) {
  63. if (value == null) {
  64. value = '';
  65. }
  66. if (isSVG) {
  67. el.setAttribute('class', value);
  68. }
  69. else {
  70. // directly setting className should be faster than setAttribute in theory
  71. // if this is an element during a transition, take the temporary transition
  72. // classes into account.
  73. const transitionClasses = el._vtc;
  74. if (transitionClasses) {
  75. value = (value
  76. ? [value, ...transitionClasses]
  77. : [...transitionClasses]).join(' ');
  78. }
  79. el.className = value;
  80. }
  81. }
  82. function patchStyle(el, prev, next) {
  83. const style = el.style;
  84. if (!next) {
  85. el.removeAttribute('style');
  86. }
  87. else if (shared.isString(next)) {
  88. if (prev !== next) {
  89. style.cssText = next;
  90. }
  91. }
  92. else {
  93. for (const key in next) {
  94. setStyle(style, key, next[key]);
  95. }
  96. if (prev && !shared.isString(prev)) {
  97. for (const key in prev) {
  98. if (next[key] == null) {
  99. setStyle(style, key, '');
  100. }
  101. }
  102. }
  103. }
  104. }
  105. const importantRE = /\s*!important$/;
  106. function setStyle(style, name, val) {
  107. if (shared.isArray(val)) {
  108. val.forEach(v => setStyle(style, name, v));
  109. }
  110. else {
  111. if (name.startsWith('--')) {
  112. // custom property definition
  113. style.setProperty(name, val);
  114. }
  115. else {
  116. const prefixed = autoPrefix(style, name);
  117. if (importantRE.test(val)) {
  118. // !important
  119. style.setProperty(shared.hyphenate(prefixed), val.replace(importantRE, ''), 'important');
  120. }
  121. else {
  122. style[prefixed] = val;
  123. }
  124. }
  125. }
  126. }
  127. const prefixes = ['Webkit', 'Moz', 'ms'];
  128. const prefixCache = {};
  129. function autoPrefix(style, rawName) {
  130. const cached = prefixCache[rawName];
  131. if (cached) {
  132. return cached;
  133. }
  134. let name = runtimeCore.camelize(rawName);
  135. if (name !== 'filter' && name in style) {
  136. return (prefixCache[rawName] = name);
  137. }
  138. name = shared.capitalize(name);
  139. for (let i = 0; i < prefixes.length; i++) {
  140. const prefixed = prefixes[i] + name;
  141. if (prefixed in style) {
  142. return (prefixCache[rawName] = prefixed);
  143. }
  144. }
  145. return rawName;
  146. }
  147. const xlinkNS = 'http://www.w3.org/1999/xlink';
  148. function patchAttr(el, key, value, isSVG) {
  149. if (isSVG && key.startsWith('xlink:')) {
  150. if (value == null) {
  151. el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
  152. }
  153. else {
  154. el.setAttributeNS(xlinkNS, key, value);
  155. }
  156. }
  157. else {
  158. // note we are only checking boolean attributes that don't have a
  159. // corresponding dom prop of the same name here.
  160. const isBoolean = shared.isSpecialBooleanAttr(key);
  161. if (value == null || (isBoolean && value === false)) {
  162. el.removeAttribute(key);
  163. }
  164. else {
  165. el.setAttribute(key, isBoolean ? '' : value);
  166. }
  167. }
  168. }
  169. // __UNSAFE__
  170. // functions. The user is responsible for using them with only trusted content.
  171. function patchDOMProp(el, key, value,
  172. // the following args are passed only due to potential innerHTML/textContent
  173. // overriding existing VNodes, in which case the old tree must be properly
  174. // unmounted.
  175. prevChildren, parentComponent, parentSuspense, unmountChildren) {
  176. if (key === 'innerHTML' || key === 'textContent') {
  177. if (prevChildren) {
  178. unmountChildren(prevChildren, parentComponent, parentSuspense);
  179. }
  180. el[key] = value == null ? '' : value;
  181. return;
  182. }
  183. if (key === 'value' && el.tagName !== 'PROGRESS') {
  184. // store value as _value as well since
  185. // non-string values will be stringified.
  186. el._value = value;
  187. const newValue = value == null ? '' : value;
  188. if (el.value !== newValue) {
  189. el.value = newValue;
  190. }
  191. return;
  192. }
  193. if (value === '' || value == null) {
  194. const type = typeof el[key];
  195. if (value === '' && type === 'boolean') {
  196. // e.g. <select multiple> compiles to { multiple: '' }
  197. el[key] = true;
  198. return;
  199. }
  200. else if (value == null && type === 'string') {
  201. // e.g. <div :id="null">
  202. el[key] = '';
  203. el.removeAttribute(key);
  204. return;
  205. }
  206. else if (type === 'number') {
  207. // e.g. <img :width="null">
  208. el[key] = 0;
  209. el.removeAttribute(key);
  210. return;
  211. }
  212. }
  213. // some properties perform value validation and throw
  214. try {
  215. el[key] = value;
  216. }
  217. catch (e) {
  218. {
  219. runtimeCore.warn(`Failed setting prop "${key}" on <${el.tagName.toLowerCase()}>: ` +
  220. `value ${value} is invalid.`, e);
  221. }
  222. }
  223. }
  224. // Async edge case fix requires storing an event listener's attach timestamp.
  225. let _getNow = Date.now;
  226. // Determine what event timestamp the browser is using. Annoyingly, the
  227. // timestamp can either be hi-res (relative to page load) or low-res
  228. // (relative to UNIX epoch), so in order to compare time we have to use the
  229. // same timestamp type when saving the flush timestamp.
  230. if (typeof document !== 'undefined' &&
  231. _getNow() > document.createEvent('Event').timeStamp) {
  232. // if the low-res timestamp which is bigger than the event timestamp
  233. // (which is evaluated AFTER) it means the event is using a hi-res timestamp,
  234. // and we need to use the hi-res version for event listeners as well.
  235. _getNow = () => performance.now();
  236. }
  237. // To avoid the overhead of repeatedly calling performance.now(), we cache
  238. // and use the same timestamp for all event listeners attached in the same tick.
  239. let cachedNow = 0;
  240. const p = Promise.resolve();
  241. const reset = () => {
  242. cachedNow = 0;
  243. };
  244. const getNow = () => cachedNow || (p.then(reset), (cachedNow = _getNow()));
  245. function addEventListener(el, event, handler, options) {
  246. el.addEventListener(event, handler, options);
  247. }
  248. function removeEventListener(el, event, handler, options) {
  249. el.removeEventListener(event, handler, options);
  250. }
  251. function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
  252. // vei = vue event invokers
  253. const invokers = el._vei || (el._vei = {});
  254. const existingInvoker = invokers[rawName];
  255. if (nextValue && existingInvoker) {
  256. // patch
  257. existingInvoker.value = nextValue;
  258. }
  259. else {
  260. const [name, options] = parseName(rawName);
  261. if (nextValue) {
  262. // add
  263. const invoker = (invokers[rawName] = createInvoker(nextValue, instance));
  264. addEventListener(el, name, invoker, options);
  265. }
  266. else if (existingInvoker) {
  267. // remove
  268. removeEventListener(el, name, existingInvoker, options);
  269. invokers[rawName] = undefined;
  270. }
  271. }
  272. }
  273. const optionsModifierRE = /(?:Once|Passive|Capture)$/;
  274. function parseName(name) {
  275. let options;
  276. if (optionsModifierRE.test(name)) {
  277. options = {};
  278. let m;
  279. while ((m = name.match(optionsModifierRE))) {
  280. name = name.slice(0, name.length - m[0].length);
  281. options[m[0].toLowerCase()] = true;
  282. }
  283. }
  284. return [shared.hyphenate(name.slice(2)), options];
  285. }
  286. function createInvoker(initialValue, instance) {
  287. const invoker = (e) => {
  288. // async edge case #6566: inner click event triggers patch, event handler
  289. // attached to outer element during patch, and triggered again. This
  290. // happens because browsers fire microtask ticks between event propagation.
  291. // the solution is simple: we save the timestamp when a handler is attached,
  292. // and the handler would only fire if the event passed to it was fired
  293. // AFTER it was attached.
  294. const timeStamp = e.timeStamp || _getNow();
  295. if (timeStamp >= invoker.attached - 1) {
  296. runtimeCore.callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5 /* NATIVE_EVENT_HANDLER */, [e]);
  297. }
  298. };
  299. invoker.value = initialValue;
  300. invoker.attached = getNow();
  301. return invoker;
  302. }
  303. function patchStopImmediatePropagation(e, value) {
  304. if (shared.isArray(value)) {
  305. const originalStop = e.stopImmediatePropagation;
  306. e.stopImmediatePropagation = () => {
  307. originalStop.call(e);
  308. e._stopped = true;
  309. };
  310. return value.map(fn => (e) => !e._stopped && fn(e));
  311. }
  312. else {
  313. return value;
  314. }
  315. }
  316. const nativeOnRE = /^on[a-z]/;
  317. const forcePatchProp = (_, key) => key === 'value';
  318. const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
  319. switch (key) {
  320. // special
  321. case 'class':
  322. patchClass(el, nextValue, isSVG);
  323. break;
  324. case 'style':
  325. patchStyle(el, prevValue, nextValue);
  326. break;
  327. default:
  328. if (shared.isOn(key)) {
  329. // ignore v-model listeners
  330. if (!shared.isModelListener(key)) {
  331. patchEvent(el, key, prevValue, nextValue, parentComponent);
  332. }
  333. }
  334. else if (shouldSetAsProp(el, key, nextValue, isSVG)) {
  335. patchDOMProp(el, key, nextValue, prevChildren, parentComponent, parentSuspense, unmountChildren);
  336. }
  337. else {
  338. // special case for <input v-model type="checkbox"> with
  339. // :true-value & :false-value
  340. // store value as dom properties since non-string values will be
  341. // stringified.
  342. if (key === 'true-value') {
  343. el._trueValue = nextValue;
  344. }
  345. else if (key === 'false-value') {
  346. el._falseValue = nextValue;
  347. }
  348. patchAttr(el, key, nextValue, isSVG);
  349. }
  350. break;
  351. }
  352. };
  353. function shouldSetAsProp(el, key, value, isSVG) {
  354. if (isSVG) {
  355. // most keys must be set as attribute on svg elements to work
  356. // ...except innerHTML
  357. if (key === 'innerHTML') {
  358. return true;
  359. }
  360. // or native onclick with function values
  361. if (key in el && nativeOnRE.test(key) && shared.isFunction(value)) {
  362. return true;
  363. }
  364. return false;
  365. }
  366. // spellcheck and draggable are numerated attrs, however their
  367. // corresponding DOM properties are actually booleans - this leads to
  368. // setting it with a string "false" value leading it to be coerced to
  369. // `true`, so we need to always treat them as attributes.
  370. // Note that `contentEditable` doesn't have this problem: its DOM
  371. // property is also enumerated string values.
  372. if (key === 'spellcheck' || key === 'draggable') {
  373. return false;
  374. }
  375. // #1787, #2840 form property on form elements is readonly and must be set as
  376. // attribute.
  377. if (key === 'form') {
  378. return false;
  379. }
  380. // #1526 <input list> must be set as attribute
  381. if (key === 'list' && el.tagName === 'INPUT') {
  382. return false;
  383. }
  384. // #2766 <textarea type> must be set as attribute
  385. if (key === 'type' && el.tagName === 'TEXTAREA') {
  386. return false;
  387. }
  388. // native onclick with string value, must be set as attribute
  389. if (nativeOnRE.test(key) && shared.isString(value)) {
  390. return false;
  391. }
  392. return key in el;
  393. }
  394. function useCssModule(name = '$style') {
  395. /* istanbul ignore else */
  396. {
  397. const instance = runtimeCore.getCurrentInstance();
  398. if (!instance) {
  399. runtimeCore.warn(`useCssModule must be called inside setup()`);
  400. return shared.EMPTY_OBJ;
  401. }
  402. const modules = instance.type.__cssModules;
  403. if (!modules) {
  404. runtimeCore.warn(`Current instance does not have CSS modules injected.`);
  405. return shared.EMPTY_OBJ;
  406. }
  407. const mod = modules[name];
  408. if (!mod) {
  409. runtimeCore.warn(`Current instance does not have CSS module named "${name}".`);
  410. return shared.EMPTY_OBJ;
  411. }
  412. return mod;
  413. }
  414. }
  415. /**
  416. * Runtime helper for SFC's CSS variable injection feature.
  417. * @private
  418. */
  419. function useCssVars(getter) {
  420. return;
  421. }
  422. const TRANSITION = 'transition';
  423. const ANIMATION = 'animation';
  424. // DOM Transition is a higher-order-component based on the platform-agnostic
  425. // base Transition component, with DOM-specific logic.
  426. const Transition = (props, { slots }) => runtimeCore.h(runtimeCore.BaseTransition, resolveTransitionProps(props), slots);
  427. Transition.displayName = 'Transition';
  428. const DOMTransitionPropsValidators = {
  429. name: String,
  430. type: String,
  431. css: {
  432. type: Boolean,
  433. default: true
  434. },
  435. duration: [String, Number, Object],
  436. enterFromClass: String,
  437. enterActiveClass: String,
  438. enterToClass: String,
  439. appearFromClass: String,
  440. appearActiveClass: String,
  441. appearToClass: String,
  442. leaveFromClass: String,
  443. leaveActiveClass: String,
  444. leaveToClass: String
  445. };
  446. const TransitionPropsValidators = (Transition.props = /*#__PURE__*/ shared.extend({}, runtimeCore.BaseTransition.props, DOMTransitionPropsValidators));
  447. function resolveTransitionProps(rawProps) {
  448. let { name = 'v', type, css = true, duration, enterFromClass = `${name}-enter-from`, enterActiveClass = `${name}-enter-active`, enterToClass = `${name}-enter-to`, appearFromClass = enterFromClass, appearActiveClass = enterActiveClass, appearToClass = enterToClass, leaveFromClass = `${name}-leave-from`, leaveActiveClass = `${name}-leave-active`, leaveToClass = `${name}-leave-to` } = rawProps;
  449. const baseProps = {};
  450. for (const key in rawProps) {
  451. if (!(key in DOMTransitionPropsValidators)) {
  452. baseProps[key] = rawProps[key];
  453. }
  454. }
  455. if (!css) {
  456. return baseProps;
  457. }
  458. const durations = normalizeDuration(duration);
  459. const enterDuration = durations && durations[0];
  460. const leaveDuration = durations && durations[1];
  461. const { onBeforeEnter, onEnter, onEnterCancelled, onLeave, onLeaveCancelled, onBeforeAppear = onBeforeEnter, onAppear = onEnter, onAppearCancelled = onEnterCancelled } = baseProps;
  462. const finishEnter = (el, isAppear, done) => {
  463. removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
  464. removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
  465. done && done();
  466. };
  467. const finishLeave = (el, done) => {
  468. removeTransitionClass(el, leaveToClass);
  469. removeTransitionClass(el, leaveActiveClass);
  470. done && done();
  471. };
  472. const makeEnterHook = (isAppear) => {
  473. return (el, done) => {
  474. const hook = isAppear ? onAppear : onEnter;
  475. const resolve = () => finishEnter(el, isAppear, done);
  476. hook && hook(el, resolve);
  477. nextFrame(() => {
  478. removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
  479. addTransitionClass(el, isAppear ? appearToClass : enterToClass);
  480. if (!(hook && hook.length > 1)) {
  481. whenTransitionEnds(el, type, enterDuration, resolve);
  482. }
  483. });
  484. };
  485. };
  486. return shared.extend(baseProps, {
  487. onBeforeEnter(el) {
  488. onBeforeEnter && onBeforeEnter(el);
  489. addTransitionClass(el, enterFromClass);
  490. addTransitionClass(el, enterActiveClass);
  491. },
  492. onBeforeAppear(el) {
  493. onBeforeAppear && onBeforeAppear(el);
  494. addTransitionClass(el, appearFromClass);
  495. addTransitionClass(el, appearActiveClass);
  496. },
  497. onEnter: makeEnterHook(false),
  498. onAppear: makeEnterHook(true),
  499. onLeave(el, done) {
  500. const resolve = () => finishLeave(el, done);
  501. addTransitionClass(el, leaveFromClass);
  502. // force reflow so *-leave-from classes immediately take effect (#2593)
  503. forceReflow();
  504. addTransitionClass(el, leaveActiveClass);
  505. nextFrame(() => {
  506. removeTransitionClass(el, leaveFromClass);
  507. addTransitionClass(el, leaveToClass);
  508. if (!(onLeave && onLeave.length > 1)) {
  509. whenTransitionEnds(el, type, leaveDuration, resolve);
  510. }
  511. });
  512. onLeave && onLeave(el, resolve);
  513. },
  514. onEnterCancelled(el) {
  515. finishEnter(el, false);
  516. onEnterCancelled && onEnterCancelled(el);
  517. },
  518. onAppearCancelled(el) {
  519. finishEnter(el, true);
  520. onAppearCancelled && onAppearCancelled(el);
  521. },
  522. onLeaveCancelled(el) {
  523. finishLeave(el);
  524. onLeaveCancelled && onLeaveCancelled(el);
  525. }
  526. });
  527. }
  528. function normalizeDuration(duration) {
  529. if (duration == null) {
  530. return null;
  531. }
  532. else if (shared.isObject(duration)) {
  533. return [NumberOf(duration.enter), NumberOf(duration.leave)];
  534. }
  535. else {
  536. const n = NumberOf(duration);
  537. return [n, n];
  538. }
  539. }
  540. function NumberOf(val) {
  541. const res = shared.toNumber(val);
  542. validateDuration(res);
  543. return res;
  544. }
  545. function validateDuration(val) {
  546. if (typeof val !== 'number') {
  547. runtimeCore.warn(`<transition> explicit duration is not a valid number - ` +
  548. `got ${JSON.stringify(val)}.`);
  549. }
  550. else if (isNaN(val)) {
  551. runtimeCore.warn(`<transition> explicit duration is NaN - ` +
  552. 'the duration expression might be incorrect.');
  553. }
  554. }
  555. function addTransitionClass(el, cls) {
  556. cls.split(/\s+/).forEach(c => c && el.classList.add(c));
  557. (el._vtc ||
  558. (el._vtc = new Set())).add(cls);
  559. }
  560. function removeTransitionClass(el, cls) {
  561. cls.split(/\s+/).forEach(c => c && el.classList.remove(c));
  562. const { _vtc } = el;
  563. if (_vtc) {
  564. _vtc.delete(cls);
  565. if (!_vtc.size) {
  566. el._vtc = undefined;
  567. }
  568. }
  569. }
  570. function nextFrame(cb) {
  571. requestAnimationFrame(() => {
  572. requestAnimationFrame(cb);
  573. });
  574. }
  575. let endId = 0;
  576. function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {
  577. const id = (el._endId = ++endId);
  578. const resolveIfNotStale = () => {
  579. if (id === el._endId) {
  580. resolve();
  581. }
  582. };
  583. if (explicitTimeout) {
  584. return setTimeout(resolveIfNotStale, explicitTimeout);
  585. }
  586. const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
  587. if (!type) {
  588. return resolve();
  589. }
  590. const endEvent = type + 'end';
  591. let ended = 0;
  592. const end = () => {
  593. el.removeEventListener(endEvent, onEnd);
  594. resolveIfNotStale();
  595. };
  596. const onEnd = (e) => {
  597. if (e.target === el && ++ended >= propCount) {
  598. end();
  599. }
  600. };
  601. setTimeout(() => {
  602. if (ended < propCount) {
  603. end();
  604. }
  605. }, timeout + 1);
  606. el.addEventListener(endEvent, onEnd);
  607. }
  608. function getTransitionInfo(el, expectedType) {
  609. const styles = window.getComputedStyle(el);
  610. // JSDOM may return undefined for transition properties
  611. const getStyleProperties = (key) => (styles[key] || '').split(', ');
  612. const transitionDelays = getStyleProperties(TRANSITION + 'Delay');
  613. const transitionDurations = getStyleProperties(TRANSITION + 'Duration');
  614. const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
  615. const animationDelays = getStyleProperties(ANIMATION + 'Delay');
  616. const animationDurations = getStyleProperties(ANIMATION + 'Duration');
  617. const animationTimeout = getTimeout(animationDelays, animationDurations);
  618. let type = null;
  619. let timeout = 0;
  620. let propCount = 0;
  621. /* istanbul ignore if */
  622. if (expectedType === TRANSITION) {
  623. if (transitionTimeout > 0) {
  624. type = TRANSITION;
  625. timeout = transitionTimeout;
  626. propCount = transitionDurations.length;
  627. }
  628. }
  629. else if (expectedType === ANIMATION) {
  630. if (animationTimeout > 0) {
  631. type = ANIMATION;
  632. timeout = animationTimeout;
  633. propCount = animationDurations.length;
  634. }
  635. }
  636. else {
  637. timeout = Math.max(transitionTimeout, animationTimeout);
  638. type =
  639. timeout > 0
  640. ? transitionTimeout > animationTimeout
  641. ? TRANSITION
  642. : ANIMATION
  643. : null;
  644. propCount = type
  645. ? type === TRANSITION
  646. ? transitionDurations.length
  647. : animationDurations.length
  648. : 0;
  649. }
  650. const hasTransform = type === TRANSITION &&
  651. /\b(transform|all)(,|$)/.test(styles[TRANSITION + 'Property']);
  652. return {
  653. type,
  654. timeout,
  655. propCount,
  656. hasTransform
  657. };
  658. }
  659. function getTimeout(delays, durations) {
  660. while (delays.length < durations.length) {
  661. delays = delays.concat(delays);
  662. }
  663. return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
  664. }
  665. // Old versions of Chromium (below 61.0.3163.100) formats floating pointer
  666. // numbers in a locale-dependent way, using a comma instead of a dot.
  667. // If comma is not replaced with a dot, the input will be rounded down
  668. // (i.e. acting as a floor function) causing unexpected behaviors
  669. function toMs(s) {
  670. return Number(s.slice(0, -1).replace(',', '.')) * 1000;
  671. }
  672. // synchronously force layout to put elements into a certain state
  673. function forceReflow() {
  674. return document.body.offsetHeight;
  675. }
  676. const positionMap = new WeakMap();
  677. const newPositionMap = new WeakMap();
  678. const TransitionGroupImpl = {
  679. name: 'TransitionGroup',
  680. props: /*#__PURE__*/ shared.extend({}, TransitionPropsValidators, {
  681. tag: String,
  682. moveClass: String
  683. }),
  684. setup(props, { slots }) {
  685. const instance = runtimeCore.getCurrentInstance();
  686. const state = runtimeCore.useTransitionState();
  687. let prevChildren;
  688. let children;
  689. runtimeCore.onUpdated(() => {
  690. // children is guaranteed to exist after initial render
  691. if (!prevChildren.length) {
  692. return;
  693. }
  694. const moveClass = props.moveClass || `${props.name || 'v'}-move`;
  695. if (!hasCSSTransform(prevChildren[0].el, instance.vnode.el, moveClass)) {
  696. return;
  697. }
  698. // we divide the work into three loops to avoid mixing DOM reads and writes
  699. // in each iteration - which helps prevent layout thrashing.
  700. prevChildren.forEach(callPendingCbs);
  701. prevChildren.forEach(recordPosition);
  702. const movedChildren = prevChildren.filter(applyTranslation);
  703. // force reflow to put everything in position
  704. forceReflow();
  705. movedChildren.forEach(c => {
  706. const el = c.el;
  707. const style = el.style;
  708. addTransitionClass(el, moveClass);
  709. style.transform = style.webkitTransform = style.transitionDuration = '';
  710. const cb = (el._moveCb = (e) => {
  711. if (e && e.target !== el) {
  712. return;
  713. }
  714. if (!e || /transform$/.test(e.propertyName)) {
  715. el.removeEventListener('transitionend', cb);
  716. el._moveCb = null;
  717. removeTransitionClass(el, moveClass);
  718. }
  719. });
  720. el.addEventListener('transitionend', cb);
  721. });
  722. });
  723. return () => {
  724. const rawProps = runtimeCore.toRaw(props);
  725. const cssTransitionProps = resolveTransitionProps(rawProps);
  726. const tag = rawProps.tag || runtimeCore.Fragment;
  727. prevChildren = children;
  728. children = slots.default ? runtimeCore.getTransitionRawChildren(slots.default()) : [];
  729. for (let i = 0; i < children.length; i++) {
  730. const child = children[i];
  731. if (child.key != null) {
  732. runtimeCore.setTransitionHooks(child, runtimeCore.resolveTransitionHooks(child, cssTransitionProps, state, instance));
  733. }
  734. else {
  735. runtimeCore.warn(`<TransitionGroup> children must be keyed.`);
  736. }
  737. }
  738. if (prevChildren) {
  739. for (let i = 0; i < prevChildren.length; i++) {
  740. const child = prevChildren[i];
  741. runtimeCore.setTransitionHooks(child, runtimeCore.resolveTransitionHooks(child, cssTransitionProps, state, instance));
  742. positionMap.set(child, child.el.getBoundingClientRect());
  743. }
  744. }
  745. return runtimeCore.createVNode(tag, null, children);
  746. };
  747. }
  748. };
  749. const TransitionGroup = TransitionGroupImpl;
  750. function callPendingCbs(c) {
  751. const el = c.el;
  752. if (el._moveCb) {
  753. el._moveCb();
  754. }
  755. if (el._enterCb) {
  756. el._enterCb();
  757. }
  758. }
  759. function recordPosition(c) {
  760. newPositionMap.set(c, c.el.getBoundingClientRect());
  761. }
  762. function applyTranslation(c) {
  763. const oldPos = positionMap.get(c);
  764. const newPos = newPositionMap.get(c);
  765. const dx = oldPos.left - newPos.left;
  766. const dy = oldPos.top - newPos.top;
  767. if (dx || dy) {
  768. const s = c.el.style;
  769. s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
  770. s.transitionDuration = '0s';
  771. return c;
  772. }
  773. }
  774. function hasCSSTransform(el, root, moveClass) {
  775. // Detect whether an element with the move class applied has
  776. // CSS transitions. Since the element may be inside an entering
  777. // transition at this very moment, we make a clone of it and remove
  778. // all other transition classes applied to ensure only the move class
  779. // is applied.
  780. const clone = el.cloneNode();
  781. if (el._vtc) {
  782. el._vtc.forEach(cls => {
  783. cls.split(/\s+/).forEach(c => c && clone.classList.remove(c));
  784. });
  785. }
  786. moveClass.split(/\s+/).forEach(c => c && clone.classList.add(c));
  787. clone.style.display = 'none';
  788. const container = (root.nodeType === 1
  789. ? root
  790. : root.parentNode);
  791. container.appendChild(clone);
  792. const { hasTransform } = getTransitionInfo(clone);
  793. container.removeChild(clone);
  794. return hasTransform;
  795. }
  796. const getModelAssigner = (vnode) => {
  797. const fn = vnode.props['onUpdate:modelValue'];
  798. return shared.isArray(fn) ? value => shared.invokeArrayFns(fn, value) : fn;
  799. };
  800. function onCompositionStart(e) {
  801. e.target.composing = true;
  802. }
  803. function onCompositionEnd(e) {
  804. const target = e.target;
  805. if (target.composing) {
  806. target.composing = false;
  807. trigger(target, 'input');
  808. }
  809. }
  810. function trigger(el, type) {
  811. const e = document.createEvent('HTMLEvents');
  812. e.initEvent(type, true, true);
  813. el.dispatchEvent(e);
  814. }
  815. // We are exporting the v-model runtime directly as vnode hooks so that it can
  816. // be tree-shaken in case v-model is never used.
  817. const vModelText = {
  818. created(el, { modifiers: { lazy, trim, number } }, vnode) {
  819. el._assign = getModelAssigner(vnode);
  820. const castToNumber = number || el.type === 'number';
  821. addEventListener(el, lazy ? 'change' : 'input', e => {
  822. if (e.target.composing)
  823. return;
  824. let domValue = el.value;
  825. if (trim) {
  826. domValue = domValue.trim();
  827. }
  828. else if (castToNumber) {
  829. domValue = shared.toNumber(domValue);
  830. }
  831. el._assign(domValue);
  832. });
  833. if (trim) {
  834. addEventListener(el, 'change', () => {
  835. el.value = el.value.trim();
  836. });
  837. }
  838. if (!lazy) {
  839. addEventListener(el, 'compositionstart', onCompositionStart);
  840. addEventListener(el, 'compositionend', onCompositionEnd);
  841. // Safari < 10.2 & UIWebView doesn't fire compositionend when
  842. // switching focus before confirming composition choice
  843. // this also fixes the issue where some browsers e.g. iOS Chrome
  844. // fires "change" instead of "input" on autocomplete.
  845. addEventListener(el, 'change', onCompositionEnd);
  846. }
  847. },
  848. // set value on mounted so it's after min/max for type="range"
  849. mounted(el, { value }) {
  850. el.value = value == null ? '' : value;
  851. },
  852. beforeUpdate(el, { value, modifiers: { trim, number } }, vnode) {
  853. el._assign = getModelAssigner(vnode);
  854. // avoid clearing unresolved text. #2302
  855. if (el.composing)
  856. return;
  857. if (document.activeElement === el) {
  858. if (trim && el.value.trim() === value) {
  859. return;
  860. }
  861. if ((number || el.type === 'number') && shared.toNumber(el.value) === value) {
  862. return;
  863. }
  864. }
  865. const newValue = value == null ? '' : value;
  866. if (el.value !== newValue) {
  867. el.value = newValue;
  868. }
  869. }
  870. };
  871. const vModelCheckbox = {
  872. created(el, _, vnode) {
  873. el._assign = getModelAssigner(vnode);
  874. addEventListener(el, 'change', () => {
  875. const modelValue = el._modelValue;
  876. const elementValue = getValue(el);
  877. const checked = el.checked;
  878. const assign = el._assign;
  879. if (shared.isArray(modelValue)) {
  880. const index = shared.looseIndexOf(modelValue, elementValue);
  881. const found = index !== -1;
  882. if (checked && !found) {
  883. assign(modelValue.concat(elementValue));
  884. }
  885. else if (!checked && found) {
  886. const filtered = [...modelValue];
  887. filtered.splice(index, 1);
  888. assign(filtered);
  889. }
  890. }
  891. else if (shared.isSet(modelValue)) {
  892. const cloned = new Set(modelValue);
  893. if (checked) {
  894. cloned.add(elementValue);
  895. }
  896. else {
  897. cloned.delete(elementValue);
  898. }
  899. assign(cloned);
  900. }
  901. else {
  902. assign(getCheckboxValue(el, checked));
  903. }
  904. });
  905. },
  906. // set initial checked on mount to wait for true-value/false-value
  907. mounted: setChecked,
  908. beforeUpdate(el, binding, vnode) {
  909. el._assign = getModelAssigner(vnode);
  910. setChecked(el, binding, vnode);
  911. }
  912. };
  913. function setChecked(el, { value, oldValue }, vnode) {
  914. el._modelValue = value;
  915. if (shared.isArray(value)) {
  916. el.checked = shared.looseIndexOf(value, vnode.props.value) > -1;
  917. }
  918. else if (shared.isSet(value)) {
  919. el.checked = value.has(vnode.props.value);
  920. }
  921. else if (value !== oldValue) {
  922. el.checked = shared.looseEqual(value, getCheckboxValue(el, true));
  923. }
  924. }
  925. const vModelRadio = {
  926. created(el, { value }, vnode) {
  927. el.checked = shared.looseEqual(value, vnode.props.value);
  928. el._assign = getModelAssigner(vnode);
  929. addEventListener(el, 'change', () => {
  930. el._assign(getValue(el));
  931. });
  932. },
  933. beforeUpdate(el, { value, oldValue }, vnode) {
  934. el._assign = getModelAssigner(vnode);
  935. if (value !== oldValue) {
  936. el.checked = shared.looseEqual(value, vnode.props.value);
  937. }
  938. }
  939. };
  940. const vModelSelect = {
  941. created(el, { value, modifiers: { number } }, vnode) {
  942. const isSetModel = shared.isSet(value);
  943. addEventListener(el, 'change', () => {
  944. const selectedVal = Array.prototype.filter
  945. .call(el.options, (o) => o.selected)
  946. .map((o) => number ? shared.toNumber(getValue(o)) : getValue(o));
  947. el._assign(el.multiple
  948. ? isSetModel
  949. ? new Set(selectedVal)
  950. : selectedVal
  951. : selectedVal[0]);
  952. });
  953. el._assign = getModelAssigner(vnode);
  954. },
  955. // set value in mounted & updated because <select> relies on its children
  956. // <option>s.
  957. mounted(el, { value }) {
  958. setSelected(el, value);
  959. },
  960. beforeUpdate(el, _binding, vnode) {
  961. el._assign = getModelAssigner(vnode);
  962. },
  963. updated(el, { value }) {
  964. setSelected(el, value);
  965. }
  966. };
  967. function setSelected(el, value) {
  968. const isMultiple = el.multiple;
  969. if (isMultiple && !shared.isArray(value) && !shared.isSet(value)) {
  970. runtimeCore.warn(`<select multiple v-model> expects an Array or Set value for its binding, ` +
  971. `but got ${Object.prototype.toString.call(value).slice(8, -1)}.`);
  972. return;
  973. }
  974. for (let i = 0, l = el.options.length; i < l; i++) {
  975. const option = el.options[i];
  976. const optionValue = getValue(option);
  977. if (isMultiple) {
  978. if (shared.isArray(value)) {
  979. option.selected = shared.looseIndexOf(value, optionValue) > -1;
  980. }
  981. else {
  982. option.selected = value.has(optionValue);
  983. }
  984. }
  985. else {
  986. if (shared.looseEqual(getValue(option), value)) {
  987. el.selectedIndex = i;
  988. return;
  989. }
  990. }
  991. }
  992. if (!isMultiple) {
  993. el.selectedIndex = -1;
  994. }
  995. }
  996. // retrieve raw value set via :value bindings
  997. function getValue(el) {
  998. return '_value' in el ? el._value : el.value;
  999. }
  1000. // retrieve raw value for true-value and false-value set via :true-value or :false-value bindings
  1001. function getCheckboxValue(el, checked) {
  1002. const key = checked ? '_trueValue' : '_falseValue';
  1003. return key in el ? el[key] : checked;
  1004. }
  1005. const vModelDynamic = {
  1006. created(el, binding, vnode) {
  1007. callModelHook(el, binding, vnode, null, 'created');
  1008. },
  1009. mounted(el, binding, vnode) {
  1010. callModelHook(el, binding, vnode, null, 'mounted');
  1011. },
  1012. beforeUpdate(el, binding, vnode, prevVNode) {
  1013. callModelHook(el, binding, vnode, prevVNode, 'beforeUpdate');
  1014. },
  1015. updated(el, binding, vnode, prevVNode) {
  1016. callModelHook(el, binding, vnode, prevVNode, 'updated');
  1017. }
  1018. };
  1019. function callModelHook(el, binding, vnode, prevVNode, hook) {
  1020. let modelToUse;
  1021. switch (el.tagName) {
  1022. case 'SELECT':
  1023. modelToUse = vModelSelect;
  1024. break;
  1025. case 'TEXTAREA':
  1026. modelToUse = vModelText;
  1027. break;
  1028. default:
  1029. switch (vnode.props && vnode.props.type) {
  1030. case 'checkbox':
  1031. modelToUse = vModelCheckbox;
  1032. break;
  1033. case 'radio':
  1034. modelToUse = vModelRadio;
  1035. break;
  1036. default:
  1037. modelToUse = vModelText;
  1038. }
  1039. }
  1040. const fn = modelToUse[hook];
  1041. fn && fn(el, binding, vnode, prevVNode);
  1042. }
  1043. // SSR vnode transforms
  1044. {
  1045. vModelText.getSSRProps = ({ value }) => ({ value });
  1046. vModelRadio.getSSRProps = ({ value }, vnode) => {
  1047. if (vnode.props && shared.looseEqual(vnode.props.value, value)) {
  1048. return { checked: true };
  1049. }
  1050. };
  1051. vModelCheckbox.getSSRProps = ({ value }, vnode) => {
  1052. if (shared.isArray(value)) {
  1053. if (vnode.props && shared.looseIndexOf(value, vnode.props.value) > -1) {
  1054. return { checked: true };
  1055. }
  1056. }
  1057. else if (shared.isSet(value)) {
  1058. if (vnode.props && value.has(vnode.props.value)) {
  1059. return { checked: true };
  1060. }
  1061. }
  1062. else if (value) {
  1063. return { checked: true };
  1064. }
  1065. };
  1066. }
  1067. const systemModifiers = ['ctrl', 'shift', 'alt', 'meta'];
  1068. const modifierGuards = {
  1069. stop: e => e.stopPropagation(),
  1070. prevent: e => e.preventDefault(),
  1071. self: e => e.target !== e.currentTarget,
  1072. ctrl: e => !e.ctrlKey,
  1073. shift: e => !e.shiftKey,
  1074. alt: e => !e.altKey,
  1075. meta: e => !e.metaKey,
  1076. left: e => 'button' in e && e.button !== 0,
  1077. middle: e => 'button' in e && e.button !== 1,
  1078. right: e => 'button' in e && e.button !== 2,
  1079. exact: (e, modifiers) => systemModifiers.some(m => e[`${m}Key`] && !modifiers.includes(m))
  1080. };
  1081. /**
  1082. * @private
  1083. */
  1084. const withModifiers = (fn, modifiers) => {
  1085. return (event, ...args) => {
  1086. for (let i = 0; i < modifiers.length; i++) {
  1087. const guard = modifierGuards[modifiers[i]];
  1088. if (guard && guard(event, modifiers))
  1089. return;
  1090. }
  1091. return fn(event, ...args);
  1092. };
  1093. };
  1094. // Kept for 2.x compat.
  1095. // Note: IE11 compat for `spacebar` and `del` is removed for now.
  1096. const keyNames = {
  1097. esc: 'escape',
  1098. space: ' ',
  1099. up: 'arrow-up',
  1100. left: 'arrow-left',
  1101. right: 'arrow-right',
  1102. down: 'arrow-down',
  1103. delete: 'backspace'
  1104. };
  1105. /**
  1106. * @private
  1107. */
  1108. const withKeys = (fn, modifiers) => {
  1109. return (event) => {
  1110. if (!('key' in event))
  1111. return;
  1112. const eventKey = shared.hyphenate(event.key);
  1113. if (
  1114. // None of the provided key modifiers match the current event key
  1115. !modifiers.some(k => k === eventKey || keyNames[k] === eventKey)) {
  1116. return;
  1117. }
  1118. return fn(event);
  1119. };
  1120. };
  1121. const vShow = {
  1122. beforeMount(el, { value }, { transition }) {
  1123. el._vod = el.style.display === 'none' ? '' : el.style.display;
  1124. if (transition && value) {
  1125. transition.beforeEnter(el);
  1126. }
  1127. else {
  1128. setDisplay(el, value);
  1129. }
  1130. },
  1131. mounted(el, { value }, { transition }) {
  1132. if (transition && value) {
  1133. transition.enter(el);
  1134. }
  1135. },
  1136. updated(el, { value, oldValue }, { transition }) {
  1137. if (transition && value !== oldValue) {
  1138. if (value) {
  1139. transition.beforeEnter(el);
  1140. setDisplay(el, true);
  1141. transition.enter(el);
  1142. }
  1143. else {
  1144. transition.leave(el, () => {
  1145. setDisplay(el, false);
  1146. });
  1147. }
  1148. }
  1149. else {
  1150. setDisplay(el, value);
  1151. }
  1152. },
  1153. beforeUnmount(el, { value }) {
  1154. setDisplay(el, value);
  1155. }
  1156. };
  1157. {
  1158. vShow.getSSRProps = ({ value }) => {
  1159. if (!value) {
  1160. return { style: { display: 'none' } };
  1161. }
  1162. };
  1163. }
  1164. function setDisplay(el, value) {
  1165. el.style.display = value ? el._vod : 'none';
  1166. }
  1167. const rendererOptions = shared.extend({ patchProp, forcePatchProp }, nodeOps);
  1168. // lazy create the renderer - this makes core renderer logic tree-shakable
  1169. // in case the user only imports reactivity utilities from Vue.
  1170. let renderer;
  1171. let enabledHydration = false;
  1172. function ensureRenderer() {
  1173. return renderer || (renderer = runtimeCore.createRenderer(rendererOptions));
  1174. }
  1175. function ensureHydrationRenderer() {
  1176. renderer = enabledHydration
  1177. ? renderer
  1178. : runtimeCore.createHydrationRenderer(rendererOptions);
  1179. enabledHydration = true;
  1180. return renderer;
  1181. }
  1182. // use explicit type casts here to avoid import() calls in rolled-up d.ts
  1183. const render = ((...args) => {
  1184. ensureRenderer().render(...args);
  1185. });
  1186. const hydrate = ((...args) => {
  1187. ensureHydrationRenderer().hydrate(...args);
  1188. });
  1189. const createApp = ((...args) => {
  1190. const app = ensureRenderer().createApp(...args);
  1191. {
  1192. injectNativeTagCheck(app);
  1193. }
  1194. const { mount } = app;
  1195. app.mount = (containerOrSelector) => {
  1196. const container = normalizeContainer(containerOrSelector);
  1197. if (!container)
  1198. return;
  1199. const component = app._component;
  1200. if (!shared.isFunction(component) && !component.render && !component.template) {
  1201. component.template = container.innerHTML;
  1202. }
  1203. // clear content before mounting
  1204. container.innerHTML = '';
  1205. const proxy = mount(container);
  1206. if (container instanceof Element) {
  1207. container.removeAttribute('v-cloak');
  1208. container.setAttribute('data-v-app', '');
  1209. }
  1210. return proxy;
  1211. };
  1212. return app;
  1213. });
  1214. const createSSRApp = ((...args) => {
  1215. const app = ensureHydrationRenderer().createApp(...args);
  1216. {
  1217. injectNativeTagCheck(app);
  1218. }
  1219. const { mount } = app;
  1220. app.mount = (containerOrSelector) => {
  1221. const container = normalizeContainer(containerOrSelector);
  1222. if (container) {
  1223. return mount(container, true);
  1224. }
  1225. };
  1226. return app;
  1227. });
  1228. function injectNativeTagCheck(app) {
  1229. // Inject `isNativeTag`
  1230. // this is used for component name validation (dev only)
  1231. Object.defineProperty(app.config, 'isNativeTag', {
  1232. value: (tag) => shared.isHTMLTag(tag) || shared.isSVGTag(tag),
  1233. writable: false
  1234. });
  1235. }
  1236. function normalizeContainer(container) {
  1237. if (shared.isString(container)) {
  1238. const res = document.querySelector(container);
  1239. if (!res) {
  1240. runtimeCore.warn(`Failed to mount app: mount target selector "${container}" returned null.`);
  1241. }
  1242. return res;
  1243. }
  1244. if (container instanceof window.ShadowRoot &&
  1245. container.mode === 'closed') {
  1246. runtimeCore.warn(`mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`);
  1247. }
  1248. return container;
  1249. }
  1250. exports.Transition = Transition;
  1251. exports.TransitionGroup = TransitionGroup;
  1252. exports.createApp = createApp;
  1253. exports.createSSRApp = createSSRApp;
  1254. exports.hydrate = hydrate;
  1255. exports.render = render;
  1256. exports.useCssModule = useCssModule;
  1257. exports.useCssVars = useCssVars;
  1258. exports.vModelCheckbox = vModelCheckbox;
  1259. exports.vModelDynamic = vModelDynamic;
  1260. exports.vModelRadio = vModelRadio;
  1261. exports.vModelSelect = vModelSelect;
  1262. exports.vModelText = vModelText;
  1263. exports.vShow = vShow;
  1264. exports.withKeys = withKeys;
  1265. exports.withModifiers = withModifiers;
  1266. Object.keys(runtimeCore).forEach(function (k) {
  1267. if (k !== 'default' && !exports.hasOwnProperty(k)) exports[k] = runtimeCore[k];
  1268. });