提交 ad2c1f3f 编写于 作者: Q qiang

style: rename word

上级 86e1d0a3
...@@ -38,7 +38,7 @@ export function requestComponentObserver( ...@@ -38,7 +38,7 @@ export function requestComponentObserver(
boundingClientRect: normalizeRect(entrie.boundingClientRect), boundingClientRect: normalizeRect(entrie.boundingClientRect),
relativeRect: normalizeRect(entrie.rootBounds!), relativeRect: normalizeRect(entrie.rootBounds!),
time: Date.now(), time: Date.now(),
// dataset: getCostomDataset(entrie.target), // dataset: getCustomDataset(entrie.target),
// id: entrie.target.id, // id: entrie.target.id,
}) })
}) })
......
...@@ -2,13 +2,13 @@ import { App } from 'vue' ...@@ -2,13 +2,13 @@ import { App } from 'vue'
import { initLongPress } from './longPress' import { initLongPress } from './longPress'
import { initAppConfig } from './appConfig' import { initAppConfig } from './appConfig'
import { initCostomDataset } from '@dcloudio/uni-shared' import { initCustomDataset } from '@dcloudio/uni-shared'
export function initView(app: App) { export function initView(app: App) {
if (__NODE_JS__) { if (__NODE_JS__) {
return return
} }
initCostomDataset() initCustomDataset()
if (__UNI_FEATURE_LONGPRESS__) { if (__UNI_FEATURE_LONGPRESS__) {
initLongPress() initLongPress()
} }
......
import {isFunction, extend, hyphenate, isPlainObject, isString, isArray, hasOwn, isObject, capitalize, toRawType, makeMap as makeMap$1, isPromise, invokeArrayFns as invokeArrayFns$1} from "@vue/shared"; import {isFunction, extend, hyphenate, isPlainObject, isString, isArray, hasOwn, isObject, capitalize, toRawType, makeMap as makeMap$1, isPromise, invokeArrayFns as invokeArrayFns$1} from "@vue/shared";
import {injectHook, withModifiers, createVNode, getCurrentInstance, inject, provide, reactive, openBlock, createBlock, mergeProps, toDisplayString, defineComponent, ref, computed, watch, onUnmounted, onBeforeUnmount, onActivated, onMounted, nextTick, onBeforeMount, withDirectives, vShow, shallowRef, watchEffect, isVNode, Fragment, markRaw, createTextVNode, onBeforeActivate, onBeforeDeactivate, renderList, onDeactivated, Teleport, createApp, Transition, withCtx, KeepAlive, resolveDynamicComponent, resolveComponent, createCommentVNode, renderSlot} from "vue"; import {injectHook, withModifiers, createVNode, getCurrentInstance, inject, provide, reactive, openBlock, createBlock, mergeProps, toDisplayString, defineComponent, ref, computed, watch, onUnmounted, onBeforeUnmount, onActivated, onMounted, nextTick, onBeforeMount, withDirectives, vShow, shallowRef, watchEffect, isVNode, Fragment, markRaw, createTextVNode, onBeforeActivate, onBeforeDeactivate, renderList, onDeactivated, Teleport, createApp, Transition, withCtx, KeepAlive, resolveDynamicComponent, resolveComponent, createCommentVNode, renderSlot} from "vue";
import {once, passive, normalizeTarget, isBuiltInComponent, initCostomDataset, invokeArrayFns, NAVBAR_HEIGHT, parseQuery, PRIMARY_COLOR, debounce, getCostomDataset, callOptions, removeLeadingSlash, getLen, ON_REACH_BOTTOM_DISTANCE, decodedQuery, updateElementStyle, addFont, scrollTo, RESPONSIVE_MIN_WIDTH, formatDateTime} from "@dcloudio/uni-shared"; import {once, passive, normalizeTarget, isBuiltInComponent, initCustomDataset, invokeArrayFns, NAVBAR_HEIGHT, parseQuery, PRIMARY_COLOR, debounce, getCustomDataset, callOptions, removeLeadingSlash, getLen, ON_REACH_BOTTOM_DISTANCE, decodedQuery, updateElementStyle, addFont, scrollTo, RESPONSIVE_MIN_WIDTH, formatDateTime} from "@dcloudio/uni-shared";
import {initVueI18n, LOCALE_EN, LOCALE_ES, LOCALE_FR, LOCALE_ZH_HANS, LOCALE_ZH_HANT} from "@dcloudio/uni-i18n"; import {initVueI18n, LOCALE_EN, LOCALE_ES, LOCALE_FR, LOCALE_ZH_HANS, LOCALE_ZH_HANT} from "@dcloudio/uni-i18n";
import {useRoute, createRouter, createWebHistory, createWebHashHistory, useRouter, isNavigationFailure, RouterView} from "vue-router"; import {useRoute, createRouter, createWebHistory, createWebHashHistory, useRouter, isNavigationFailure, RouterView} from "vue-router";
function applyOptions(options, instance2, publicThis) { function applyOptions(options, instance2, publicThis) {
...@@ -485,7 +485,7 @@ var safeAreaInsets = { ...@@ -485,7 +485,7 @@ var safeAreaInsets = {
onChange, onChange,
offChange offChange
}; };
var D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out = safeAreaInsets; var out = safeAreaInsets;
const onEventPrevent = /* @__PURE__ */ withModifiers(() => { const onEventPrevent = /* @__PURE__ */ withModifiers(() => {
}, ["prevent"]); }, ["prevent"]);
const onEventStop = /* @__PURE__ */ withModifiers(() => { const onEventStop = /* @__PURE__ */ withModifiers(() => {
...@@ -497,10 +497,10 @@ function getWindowOffset() { ...@@ -497,10 +497,10 @@ function getWindowOffset() {
const left = parseInt(style.getPropertyValue("--window-left")); const left = parseInt(style.getPropertyValue("--window-left"));
const right = parseInt(style.getPropertyValue("--window-right")); const right = parseInt(style.getPropertyValue("--window-right"));
return { return {
top: top ? top + D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.top : 0, top: top ? top + out.top : 0,
bottom: bottom ? bottom + D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.bottom : 0, bottom: bottom ? bottom + out.bottom : 0,
left: left ? left + D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.left : 0, left: left ? left + out.left : 0,
right: right ? right + D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.right : 0 right: right ? right + out.right : 0
}; };
} }
function updateCssVar(cssVars) { function updateCssVar(cssVars) {
...@@ -968,7 +968,7 @@ function initAppConfig$1(appConfig) { ...@@ -968,7 +968,7 @@ function initAppConfig$1(appConfig) {
} }
} }
function initView(app) { function initView(app) {
initCostomDataset(); initCustomDataset();
if (__UNI_FEATURE_LONGPRESS__) { if (__UNI_FEATURE_LONGPRESS__) {
initLongPress(); initLongPress();
} }
...@@ -1194,7 +1194,7 @@ function normalizePageMeta(pageMeta) { ...@@ -1194,7 +1194,7 @@ function normalizePageMeta(pageMeta) {
let offset = rpx2px(refreshOptions.offset); let offset = rpx2px(refreshOptions.offset);
const {type} = navigationBar; const {type} = navigationBar;
if (type !== "transparent" && type !== "none") { if (type !== "transparent" && type !== "none") {
offset += NAVBAR_HEIGHT + D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.top; offset += NAVBAR_HEIGHT + out.top;
} }
refreshOptions.offset = offset; refreshOptions.offset = offset;
refreshOptions.height = rpx2px(refreshOptions.height); refreshOptions.height = rpx2px(refreshOptions.height);
...@@ -9638,7 +9638,7 @@ function getNodeInfo(el, fields2) { ...@@ -9638,7 +9638,7 @@ function getNodeInfo(el, fields2) {
info.id = el.id; info.id = el.id;
} }
if (fields2.dataset) { if (fields2.dataset) {
info.dataset = getCostomDataset(el); info.dataset = getCustomDataset(el);
} }
if (fields2.rect || fields2.size) { if (fields2.rect || fields2.size) {
const rect = el.getBoundingClientRect(); const rect = el.getBoundingClientRect();
...@@ -15052,7 +15052,7 @@ const getSystemInfoSync = /* @__PURE__ */ defineSyncApi("getSystemInfoSync", () ...@@ -15052,7 +15052,7 @@ const getSystemInfoSync = /* @__PURE__ */ defineSyncApi("getSystemInfoSync", ()
const windowWidth = getWindowWidth(screenWidth); const windowWidth = getWindowWidth(screenWidth);
let windowHeight = window.innerHeight; let windowHeight = window.innerHeight;
const language = navigator.language; const language = navigator.language;
const statusBarHeight = D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.top; const statusBarHeight = out.top;
let osname; let osname;
let osversion; let osversion;
let model; let model;
...@@ -15165,12 +15165,12 @@ const getSystemInfoSync = /* @__PURE__ */ defineSyncApi("getSystemInfoSync", () ...@@ -15165,12 +15165,12 @@ const getSystemInfoSync = /* @__PURE__ */ defineSyncApi("getSystemInfoSync", ()
const system = `${osname} ${osversion}`; const system = `${osname} ${osversion}`;
const platform = osname.toLocaleLowerCase(); const platform = osname.toLocaleLowerCase();
const safeArea = { const safeArea = {
left: D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.left, left: out.left,
right: windowWidth - D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.right, right: windowWidth - out.right,
top: D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.top, top: out.top,
bottom: windowHeight - D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.bottom, bottom: windowHeight - out.bottom,
width: windowWidth - D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.left - D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.right, width: windowWidth - out.left - out.right,
height: windowHeight - D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.top - D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.bottom height: windowHeight - out.top - out.bottom
}; };
const {top: windowTop, bottom: windowBottom} = getWindowOffset(); const {top: windowTop, bottom: windowBottom} = getWindowOffset();
windowHeight -= windowTop; windowHeight -= windowTop;
...@@ -15190,10 +15190,10 @@ const getSystemInfoSync = /* @__PURE__ */ defineSyncApi("getSystemInfoSync", () ...@@ -15190,10 +15190,10 @@ const getSystemInfoSync = /* @__PURE__ */ defineSyncApi("getSystemInfoSync", ()
model, model,
safeArea, safeArea,
safeAreaInsets: { safeAreaInsets: {
top: D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.top, top: out.top,
right: D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.right, right: out.right,
bottom: D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.bottom, bottom: out.bottom,
left: D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.left left: out.left
} }
}; };
}); });
......
import { ComponentPublicInstance } from 'vue' import { ComponentPublicInstance } from 'vue'
import { getCostomDataset } from '@dcloudio/uni-shared' import { getCustomDataset } from '@dcloudio/uni-shared'
import { getWindowOffset } from '@dcloudio/uni-core' import { getWindowOffset } from '@dcloudio/uni-core'
import { getContextInfo } from '@dcloudio/uni-components' import { getContextInfo } from '@dcloudio/uni-components'
...@@ -57,7 +57,7 @@ function getNodeInfo(el: HTMLElement, fields: NodeField): NodeInfo { ...@@ -57,7 +57,7 @@ function getNodeInfo(el: HTMLElement, fields: NodeField): NodeInfo {
info.id = el.id info.id = el.id
} }
if (fields.dataset) { if (fields.dataset) {
info.dataset = getCostomDataset(el) info.dataset = getCustomDataset(el)
} }
if (fields.rect || fields.size) { if (fields.rect || fields.size) {
const rect = el.getBoundingClientRect() const rect = el.getBoundingClientRect()
......
...@@ -7,7 +7,7 @@ var shared = require('@vue/shared'); ...@@ -7,7 +7,7 @@ var shared = require('@vue/shared');
function formatKey(key) { function formatKey(key) {
return shared.camelize(key.substring(5)); return shared.camelize(key.substring(5));
} }
function initCostomDataset() { function initCustomDataset() {
const prototype = HTMLElement.prototype; const prototype = HTMLElement.prototype;
const setAttribute = prototype.setAttribute; const setAttribute = prototype.setAttribute;
prototype.setAttribute = function (key, value) { prototype.setAttribute = function (key, value) {
...@@ -28,7 +28,7 @@ function initCostomDataset() { ...@@ -28,7 +28,7 @@ function initCostomDataset() {
removeAttribute.call(this, key); removeAttribute.call(this, key);
}; };
} }
function getCostomDataset(el) { function getCustomDataset(el) {
return shared.extend({}, el.dataset, el.__uniDataset); return shared.extend({}, el.dataset, el.__uniDataset);
} }
...@@ -64,7 +64,7 @@ function normalizeTarget(el) { ...@@ -64,7 +64,7 @@ function normalizeTarget(el) {
const { id, offsetTop, offsetLeft } = el; const { id, offsetTop, offsetLeft } = el;
return { return {
id, id,
dataset: getCostomDataset(el), dataset: getCustomDataset(el),
offsetTop, offsetTop,
offsetLeft, offsetLeft,
}; };
...@@ -414,10 +414,10 @@ exports.decode = decode; ...@@ -414,10 +414,10 @@ exports.decode = decode;
exports.decodedQuery = decodedQuery; exports.decodedQuery = decodedQuery;
exports.defaultRpx2Unit = defaultRpx2Unit; exports.defaultRpx2Unit = defaultRpx2Unit;
exports.formatDateTime = formatDateTime; exports.formatDateTime = formatDateTime;
exports.getCostomDataset = getCostomDataset; exports.getCustomDataset = getCustomDataset;
exports.getEnvLocale = getEnvLocale; exports.getEnvLocale = getEnvLocale;
exports.getLen = getLen; exports.getLen = getLen;
exports.initCostomDataset = initCostomDataset; exports.initCustomDataset = initCustomDataset;
exports.invokeArrayFns = invokeArrayFns; exports.invokeArrayFns = invokeArrayFns;
exports.isBuiltInComponent = isBuiltInComponent; exports.isBuiltInComponent = isBuiltInComponent;
exports.isCustomElement = isCustomElement; exports.isCustomElement = isCustomElement;
......
...@@ -46,7 +46,7 @@ export declare function formatDateTime({ date, mode }: { ...@@ -46,7 +46,7 @@ export declare function formatDateTime({ date, mode }: {
mode?: string | undefined; mode?: string | undefined;
}): string; }): string;
export declare function getCostomDataset(el: HTMLElement | HTMLElementWithDataset): DOMStringMap & Record<string, any>; export declare function getCustomDataset(el: HTMLElement | HTMLElementWithDataset): DOMStringMap & Record<string, any>;
export declare function getEnvLocale(): string; export declare function getEnvLocale(): string;
...@@ -56,7 +56,7 @@ declare interface HTMLElementWithDataset extends HTMLElement { ...@@ -56,7 +56,7 @@ declare interface HTMLElementWithDataset extends HTMLElement {
__uniDataset?: Record<string, any>; __uniDataset?: Record<string, any>;
} }
export declare function initCostomDataset(): void; export declare function initCustomDataset(): void;
export declare const invokeArrayFns: (fns: Function[], arg?: any) => any; export declare const invokeArrayFns: (fns: Function[], arg?: any) => any;
......
...@@ -3,7 +3,7 @@ import { camelize, extend, isString, isHTMLTag, isSVGTag, isPlainObject, isArray ...@@ -3,7 +3,7 @@ import { camelize, extend, isString, isHTMLTag, isSVGTag, isPlainObject, isArray
function formatKey(key) { function formatKey(key) {
return camelize(key.substring(5)); return camelize(key.substring(5));
} }
function initCostomDataset() { function initCustomDataset() {
const prototype = HTMLElement.prototype; const prototype = HTMLElement.prototype;
const setAttribute = prototype.setAttribute; const setAttribute = prototype.setAttribute;
prototype.setAttribute = function (key, value) { prototype.setAttribute = function (key, value) {
...@@ -24,7 +24,7 @@ function initCostomDataset() { ...@@ -24,7 +24,7 @@ function initCostomDataset() {
removeAttribute.call(this, key); removeAttribute.call(this, key);
}; };
} }
function getCostomDataset(el) { function getCustomDataset(el) {
return extend({}, el.dataset, el.__uniDataset); return extend({}, el.dataset, el.__uniDataset);
} }
...@@ -60,7 +60,7 @@ function normalizeTarget(el) { ...@@ -60,7 +60,7 @@ function normalizeTarget(el) {
const { id, offsetTop, offsetLeft } = el; const { id, offsetTop, offsetLeft } = el;
return { return {
id, id,
dataset: getCostomDataset(el), dataset: getCustomDataset(el),
offsetTop, offsetTop,
offsetLeft, offsetLeft,
}; };
...@@ -387,4 +387,4 @@ function getEnvLocale() { ...@@ -387,4 +387,4 @@ function getEnvLocale() {
return (lang && lang.replace(/[.:].*/, '')) || 'en'; return (lang && lang.replace(/[.:].*/, '')) || 'en';
} }
export { BUILT_IN_TAGS, COMPONENT_NAME_PREFIX, COMPONENT_PREFIX, COMPONENT_SELECTOR_PREFIX, NAVBAR_HEIGHT, ON_REACH_BOTTOM_DISTANCE, PLUS_RE, PRIMARY_COLOR, RESPONSIVE_MIN_WIDTH, TABBAR_HEIGHT, TAGS, UNI_SSR, UNI_SSR_DATA, UNI_SSR_GLOBAL_DATA, UNI_SSR_STORE, addFont, callOptions, createRpx2Unit, debounce, decode, decodedQuery, defaultRpx2Unit, formatDateTime, getCostomDataset, getEnvLocale, getLen, initCostomDataset, invokeArrayFns, isBuiltInComponent, isCustomElement, isNativeTag, normalizeDataset, normalizeTarget, once, parseQuery, passive, plusReady, removeLeadingSlash, sanitise, scrollTo, stringifyQuery, updateElementStyle }; export { BUILT_IN_TAGS, COMPONENT_NAME_PREFIX, COMPONENT_PREFIX, COMPONENT_SELECTOR_PREFIX, NAVBAR_HEIGHT, ON_REACH_BOTTOM_DISTANCE, PLUS_RE, PRIMARY_COLOR, RESPONSIVE_MIN_WIDTH, TABBAR_HEIGHT, TAGS, UNI_SSR, UNI_SSR_DATA, UNI_SSR_GLOBAL_DATA, UNI_SSR_STORE, addFont, callOptions, createRpx2Unit, debounce, decode, decodedQuery, defaultRpx2Unit, formatDateTime, getCustomDataset, getEnvLocale, getLen, initCustomDataset, invokeArrayFns, isBuiltInComponent, isCustomElement, isNativeTag, normalizeDataset, normalizeTarget, once, parseQuery, passive, plusReady, removeLeadingSlash, sanitise, scrollTo, stringifyQuery, updateElementStyle };
...@@ -7,7 +7,7 @@ function formatKey(key: string) { ...@@ -7,7 +7,7 @@ function formatKey(key: string) {
return camelize(key.substring(5)) return camelize(key.substring(5))
} }
export function initCostomDataset() { export function initCustomDataset() {
const prototype = HTMLElement.prototype const prototype = HTMLElement.prototype
const setAttribute = prototype.setAttribute const setAttribute = prototype.setAttribute
prototype.setAttribute = function (key, value) { prototype.setAttribute = function (key, value) {
...@@ -32,6 +32,6 @@ export function initCostomDataset() { ...@@ -32,6 +32,6 @@ export function initCostomDataset() {
} }
} }
export function getCostomDataset(el: HTMLElement | HTMLElementWithDataset) { export function getCustomDataset(el: HTMLElement | HTMLElementWithDataset) {
return extend({}, el.dataset, (el as HTMLElementWithDataset).__uniDataset) return extend({}, el.dataset, (el as HTMLElementWithDataset).__uniDataset)
} }
import { FontFaceDescriptors } from 'css-font-loading-module' import { FontFaceDescriptors } from 'css-font-loading-module'
import { isString } from '@vue/shared' import { isString } from '@vue/shared'
import { getCostomDataset } from './costomDataset' import { getCustomDataset } from './CustomDataset'
export { initCostomDataset, getCostomDataset } from './costomDataset' export { initCustomDataset, getCustomDataset } from './CustomDataset'
export * from './style' export * from './style'
...@@ -18,7 +18,7 @@ export function normalizeTarget(el: HTMLElement) { ...@@ -18,7 +18,7 @@ export function normalizeTarget(el: HTMLElement) {
const { id, offsetTop, offsetLeft } = el const { id, offsetTop, offsetLeft } = el
return { return {
id, id,
dataset: getCostomDataset(el), dataset: getCustomDataset(el),
offsetTop, offsetTop,
offsetLeft, offsetLeft,
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册