| | |
| | | return str.charAt(0).toUpperCase() + str.slice(1); |
| | | }); |
| | | const toHandlerKey = cacheStringFunction((str) => { |
| | | const s = str ? `on${capitalize(str)}` : ``; |
| | | return s; |
| | | const s2 = str ? `on${capitalize(str)}` : ``; |
| | | return s2; |
| | | }); |
| | | const hasChanged = (value, oldValue) => !Object.is(value, oldValue); |
| | | const invokeArrayFns$1 = (fns, arg) => { |
| | |
| | | const getGlobalThis = () => { |
| | | return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}); |
| | | }; |
| | | function normalizeStyle(value) { |
| | | if (isArray(value)) { |
| | | const res = {}; |
| | | for (let i = 0; i < value.length; i++) { |
| | | const item = value[i]; |
| | | const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item); |
| | | if (normalized) { |
| | | for (const key in normalized) { |
| | | res[key] = normalized[key]; |
| | | } |
| | | } |
| | | } |
| | | return res; |
| | | } else if (isString(value) || isObject(value)) { |
| | | return value; |
| | | } |
| | | } |
| | | const listDelimiterRE = /;(?![^(]*\))/g; |
| | | const propertyDelimiterRE = /:([^]+)/; |
| | | const styleCommentRE = /\/\*[^]*?\*\//g; |
| | | function parseStringStyle(cssText) { |
| | | const ret = {}; |
| | | cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => { |
| | | if (item) { |
| | | const tmp = item.split(propertyDelimiterRE); |
| | | tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); |
| | | } |
| | | }); |
| | | return ret; |
| | | } |
| | | const toDisplayString = (val) => { |
| | | return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val); |
| | | }; |
| | |
| | | } |
| | | return ret; |
| | | } |
| | | function stringifyStyle(value) { |
| | | if (isString(value)) { |
| | | return value; |
| | | } |
| | | return stringify(normalizeStyle(value)); |
| | | } |
| | | function stringify(styles) { |
| | | let ret = ""; |
| | | if (!styles || isString(styles)) { |
| | | return ret; |
| | | } |
| | | for (const key in styles) { |
| | | ret += `${key.startsWith(`--`) ? key : hyphenate(key)}:${styles[key]};`; |
| | | } |
| | | return ret; |
| | | } |
| | | const o = (value, key) => vOn(value, key); |
| | | const f = (source, renderItem) => vFor(source, renderItem); |
| | | const s = (value) => stringifyStyle(value); |
| | | const e = (target, ...sources) => extend(target, ...sources); |
| | | const t = (val) => toDisplayString(val); |
| | | const p = (props) => renderProps(props); |
| | |
| | | exports.p = p; |
| | | exports.ref = ref; |
| | | exports.resolveComponent = resolveComponent; |
| | | exports.s = s; |
| | | exports.t = t; |
| | | exports.wx$1 = wx$1; |