first commit
This commit is contained in:
11
node_modules/vant/lib/index-anchor/IndexAnchor.d.ts
generated
vendored
Normal file
11
node_modules/vant/lib/index-anchor/IndexAnchor.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { type ExtractPropTypes } from 'vue';
|
||||
export declare const indexAnchorProps: {
|
||||
index: (NumberConstructor | StringConstructor)[];
|
||||
};
|
||||
export type IndexAnchorProps = ExtractPropTypes<typeof indexAnchorProps>;
|
||||
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
||||
index: (NumberConstructor | StringConstructor)[];
|
||||
}>, (() => import("vue/jsx-runtime").JSX.Element) | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
||||
index: (NumberConstructor | StringConstructor)[];
|
||||
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
||||
export default _default;
|
||||
106
node_modules/vant/lib/index-anchor/IndexAnchor.js
generated
vendored
Normal file
106
node_modules/vant/lib/index-anchor/IndexAnchor.js
generated
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name2 in all)
|
||||
__defProp(target, name2, { get: all[name2], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var stdin_exports = {};
|
||||
__export(stdin_exports, {
|
||||
default: () => stdin_default,
|
||||
indexAnchorProps: () => indexAnchorProps
|
||||
});
|
||||
module.exports = __toCommonJS(stdin_exports);
|
||||
var import_vue = require("vue");
|
||||
var import_utils = require("../utils");
|
||||
var import_IndexBar = require("../index-bar/IndexBar");
|
||||
var import_dom = require("../utils/dom");
|
||||
var import_use = require("@vant/use");
|
||||
var import_use_expose = require("../composables/use-expose");
|
||||
const [name, bem] = (0, import_utils.createNamespace)("index-anchor");
|
||||
const indexAnchorProps = {
|
||||
index: import_utils.numericProp
|
||||
};
|
||||
var stdin_default = (0, import_vue.defineComponent)({
|
||||
name,
|
||||
props: indexAnchorProps,
|
||||
setup(props, {
|
||||
slots
|
||||
}) {
|
||||
const state = (0, import_vue.reactive)({
|
||||
top: 0,
|
||||
left: null,
|
||||
rect: {
|
||||
top: 0,
|
||||
height: 0
|
||||
},
|
||||
width: null,
|
||||
active: false
|
||||
});
|
||||
const root = (0, import_vue.ref)();
|
||||
const {
|
||||
parent
|
||||
} = (0, import_use.useParent)(import_IndexBar.INDEX_BAR_KEY);
|
||||
if (!parent) {
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
console.error("[Vant] <IndexAnchor> must be a child component of <IndexBar>.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
const isSticky = () => state.active && parent.props.sticky;
|
||||
const anchorStyle = (0, import_vue.computed)(() => {
|
||||
const {
|
||||
zIndex,
|
||||
highlightColor
|
||||
} = parent.props;
|
||||
if (isSticky()) {
|
||||
return (0, import_utils.extend)((0, import_utils.getZIndexStyle)(zIndex), {
|
||||
left: state.left ? `${state.left}px` : void 0,
|
||||
width: state.width ? `${state.width}px` : void 0,
|
||||
transform: state.top ? `translate3d(0, ${state.top}px, 0)` : void 0,
|
||||
color: highlightColor
|
||||
});
|
||||
}
|
||||
});
|
||||
const getRect = (scrollParent, scrollParentRect) => {
|
||||
const rootRect = (0, import_use.useRect)(root);
|
||||
state.rect.height = rootRect.height;
|
||||
if (scrollParent === window || scrollParent === document.body) {
|
||||
state.rect.top = rootRect.top + (0, import_dom.getRootScrollTop)();
|
||||
} else {
|
||||
state.rect.top = rootRect.top + (0, import_dom.getScrollTop)(scrollParent) - scrollParentRect.top;
|
||||
}
|
||||
return state.rect;
|
||||
};
|
||||
(0, import_use_expose.useExpose)({
|
||||
state,
|
||||
getRect
|
||||
});
|
||||
return () => {
|
||||
const sticky = isSticky();
|
||||
return (0, import_vue.createVNode)("div", {
|
||||
"ref": root,
|
||||
"style": {
|
||||
height: sticky ? `${state.rect.height}px` : void 0
|
||||
}
|
||||
}, [(0, import_vue.createVNode)("div", {
|
||||
"style": anchorStyle.value,
|
||||
"class": [bem({
|
||||
sticky
|
||||
}), {
|
||||
[import_utils.BORDER_BOTTOM]: sticky
|
||||
}]
|
||||
}, [slots.default ? slots.default() : props.index])]);
|
||||
};
|
||||
}
|
||||
});
|
||||
1
node_modules/vant/lib/index-anchor/index.css
generated
vendored
Normal file
1
node_modules/vant/lib/index-anchor/index.css
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
:root,:host{--van-index-anchor-z-index: 1;--van-index-anchor-padding: 0 var(--van-padding-md);--van-index-anchor-text-color: var(--van-text-color);--van-index-anchor-font-weight: var(--van-font-bold);--van-index-anchor-font-size: var(--van-font-size-md);--van-index-anchor-line-height: 32px;--van-index-anchor-background: transparent;--van-index-anchor-sticky-text-color: var(--van-primary-color);--van-index-anchor-sticky-background: var(--van-background-2)}.van-index-anchor{z-index:var(--van-index-anchor-z-index);box-sizing:border-box;padding:var(--van-index-anchor-padding);color:var(--van-index-anchor-text-color);font-weight:var(--van-index-anchor-font-weight);font-size:var(--van-index-anchor-font-size);line-height:var(--van-index-anchor-line-height);background:var(--van-index-anchor-background)}.van-index-anchor--sticky{position:fixed;top:0;right:0;left:0;color:var(--van-index-anchor-sticky-text-color);background:var(--van-index-anchor-sticky-background)}
|
||||
14
node_modules/vant/lib/index-anchor/index.d.ts
generated
vendored
Normal file
14
node_modules/vant/lib/index-anchor/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
export declare const IndexAnchor: import("../utils").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
||||
index: (NumberConstructor | StringConstructor)[];
|
||||
}>, (() => import("vue/jsx-runtime").JSX.Element) | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
||||
index: (NumberConstructor | StringConstructor)[];
|
||||
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
||||
export default IndexAnchor;
|
||||
export { indexAnchorProps } from './IndexAnchor';
|
||||
export type { IndexAnchorProps } from './IndexAnchor';
|
||||
export type { IndexAnchorThemeVars } from './types';
|
||||
declare module 'vue' {
|
||||
interface GlobalComponents {
|
||||
VanIndexAnchor: typeof IndexAnchor;
|
||||
}
|
||||
}
|
||||
39
node_modules/vant/lib/index-anchor/index.js
generated
vendored
Normal file
39
node_modules/vant/lib/index-anchor/index.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var stdin_exports = {};
|
||||
__export(stdin_exports, {
|
||||
IndexAnchor: () => IndexAnchor,
|
||||
default: () => stdin_default,
|
||||
indexAnchorProps: () => import_IndexAnchor2.indexAnchorProps
|
||||
});
|
||||
module.exports = __toCommonJS(stdin_exports);
|
||||
var import_utils = require("../utils");
|
||||
var import_IndexAnchor = __toESM(require("./IndexAnchor"));
|
||||
var import_IndexAnchor2 = require("./IndexAnchor");
|
||||
const IndexAnchor = (0, import_utils.withInstall)(import_IndexAnchor.default);
|
||||
var stdin_default = IndexAnchor;
|
||||
1
node_modules/vant/lib/index-anchor/style/index.d.ts
generated
vendored
Normal file
1
node_modules/vant/lib/index-anchor/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
3
node_modules/vant/lib/index-anchor/style/index.js
generated
vendored
Normal file
3
node_modules/vant/lib/index-anchor/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
require("../../style/base.css");
|
||||
require("../../index-bar/index.css");
|
||||
require("../index.css");
|
||||
11
node_modules/vant/lib/index-anchor/types.d.ts
generated
vendored
Normal file
11
node_modules/vant/lib/index-anchor/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
export type IndexAnchorThemeVars = {
|
||||
indexAnchorZIndex?: number | string;
|
||||
indexAnchorPadding?: string;
|
||||
indexAnchorTextColor?: string;
|
||||
indexAnchorFontWeight?: string;
|
||||
indexAnchorFontSize?: string;
|
||||
indexAnchorLineHeight?: number | string;
|
||||
indexAnchorBackground?: string;
|
||||
indexAnchorStickyTextColor?: string;
|
||||
indexAnchorStickyBackground?: string;
|
||||
};
|
||||
15
node_modules/vant/lib/index-anchor/types.js
generated
vendored
Normal file
15
node_modules/vant/lib/index-anchor/types.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var stdin_exports = {};
|
||||
module.exports = __toCommonJS(stdin_exports);
|
||||
Reference in New Issue
Block a user