first commit
This commit is contained in:
42
node_modules/vant/lib/sidebar-item/SidebarItem.d.ts
generated
vendored
Normal file
42
node_modules/vant/lib/sidebar-item/SidebarItem.d.ts
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
import { type PropType, type ExtractPropTypes } from 'vue';
|
||||
import { type BadgeProps } from '../badge';
|
||||
export declare const sidebarItemProps: {
|
||||
to: PropType<import("vue-router").RouteLocationRaw>;
|
||||
url: StringConstructor;
|
||||
replace: BooleanConstructor;
|
||||
} & {
|
||||
dot: BooleanConstructor;
|
||||
title: StringConstructor;
|
||||
badge: (NumberConstructor | StringConstructor)[];
|
||||
disabled: BooleanConstructor;
|
||||
badgeProps: PropType<Partial<BadgeProps>>;
|
||||
};
|
||||
export type SidebarItemProps = ExtractPropTypes<typeof sidebarItemProps>;
|
||||
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
||||
to: PropType<import("vue-router").RouteLocationRaw>;
|
||||
url: StringConstructor;
|
||||
replace: BooleanConstructor;
|
||||
} & {
|
||||
dot: BooleanConstructor;
|
||||
title: StringConstructor;
|
||||
badge: (NumberConstructor | StringConstructor)[];
|
||||
disabled: BooleanConstructor;
|
||||
badgeProps: PropType<Partial<BadgeProps>>;
|
||||
}>, (() => import("vue/jsx-runtime").JSX.Element) | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
||||
to: PropType<import("vue-router").RouteLocationRaw>;
|
||||
url: StringConstructor;
|
||||
replace: BooleanConstructor;
|
||||
} & {
|
||||
dot: BooleanConstructor;
|
||||
title: StringConstructor;
|
||||
badge: (NumberConstructor | StringConstructor)[];
|
||||
disabled: BooleanConstructor;
|
||||
badgeProps: PropType<Partial<BadgeProps>>;
|
||||
}>> & Readonly<{
|
||||
onClick?: ((...args: any[]) => any) | undefined;
|
||||
}>, {
|
||||
replace: boolean;
|
||||
dot: boolean;
|
||||
disabled: boolean;
|
||||
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
||||
export default _default;
|
||||
91
node_modules/vant/lib/sidebar-item/SidebarItem.js
generated
vendored
Normal file
91
node_modules/vant/lib/sidebar-item/SidebarItem.js
generated
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
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,
|
||||
sidebarItemProps: () => sidebarItemProps
|
||||
});
|
||||
module.exports = __toCommonJS(stdin_exports);
|
||||
var import_vue = require("vue");
|
||||
var import_utils = require("../utils");
|
||||
var import_Sidebar = require("../sidebar/Sidebar");
|
||||
var import_use = require("@vant/use");
|
||||
var import_use_route = require("../composables/use-route");
|
||||
var import_badge = require("../badge");
|
||||
const [name, bem] = (0, import_utils.createNamespace)("sidebar-item");
|
||||
const sidebarItemProps = (0, import_utils.extend)({}, import_use_route.routeProps, {
|
||||
dot: Boolean,
|
||||
title: String,
|
||||
badge: import_utils.numericProp,
|
||||
disabled: Boolean,
|
||||
badgeProps: Object
|
||||
});
|
||||
var stdin_default = (0, import_vue.defineComponent)({
|
||||
name,
|
||||
props: sidebarItemProps,
|
||||
emits: ["click"],
|
||||
setup(props, {
|
||||
emit,
|
||||
slots
|
||||
}) {
|
||||
const route = (0, import_use_route.useRoute)();
|
||||
const {
|
||||
parent,
|
||||
index
|
||||
} = (0, import_use.useParent)(import_Sidebar.SIDEBAR_KEY);
|
||||
if (!parent) {
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
console.error("[Vant] <SidebarItem> must be a child component of <Sidebar>.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
const onClick = () => {
|
||||
if (props.disabled) {
|
||||
return;
|
||||
}
|
||||
emit("click", index.value);
|
||||
parent.setActive(index.value);
|
||||
route();
|
||||
};
|
||||
return () => {
|
||||
const {
|
||||
dot,
|
||||
badge,
|
||||
title,
|
||||
disabled
|
||||
} = props;
|
||||
const selected = index.value === parent.getActive();
|
||||
return (0, import_vue.createVNode)("div", {
|
||||
"role": "tab",
|
||||
"class": bem({
|
||||
select: selected,
|
||||
disabled
|
||||
}),
|
||||
"tabindex": disabled ? void 0 : 0,
|
||||
"aria-selected": selected,
|
||||
"onClick": onClick
|
||||
}, [(0, import_vue.createVNode)(import_badge.Badge, (0, import_vue.mergeProps)({
|
||||
"dot": dot,
|
||||
"class": bem("text"),
|
||||
"content": badge
|
||||
}, props.badgeProps), {
|
||||
default: () => [slots.title ? slots.title() : title]
|
||||
})]);
|
||||
};
|
||||
}
|
||||
});
|
||||
1
node_modules/vant/lib/sidebar-item/index.css
generated
vendored
Normal file
1
node_modules/vant/lib/sidebar-item/index.css
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
:root,:host{--van-sidebar-font-size: var(--van-font-size-md);--van-sidebar-line-height: var(--van-line-height-md);--van-sidebar-text-color: var(--van-text-color);--van-sidebar-disabled-text-color: var(--van-text-color-3);--van-sidebar-padding: 20px var(--van-padding-sm);--van-sidebar-active-color: var(--van-active-color);--van-sidebar-background: var(--van-background);--van-sidebar-selected-font-weight: var(--van-font-bold);--van-sidebar-selected-text-color: var(--van-text-color);--van-sidebar-selected-border-width: 4px;--van-sidebar-selected-border-height: 16px;--van-sidebar-selected-border-color: var(--van-primary-color);--van-sidebar-selected-background: var(--van-background-2)}.van-sidebar-item{position:relative;display:block;box-sizing:border-box;padding:var(--van-sidebar-padding);overflow:hidden;color:var(--van-sidebar-text-color);font-size:var(--van-sidebar-font-size);line-height:var(--van-sidebar-line-height);background:var(--van-sidebar-background);cursor:pointer;-webkit-user-select:none;user-select:none}.van-sidebar-item:active{background-color:var(--van-sidebar-active-color)}.van-sidebar-item:not(:last-child):after{border-bottom-width:1px}.van-sidebar-item__text{word-break:break-all}.van-sidebar-item--select{color:var(--van-sidebar-selected-text-color);font-weight:var(--van-sidebar-selected-font-weight)}.van-sidebar-item--select,.van-sidebar-item--select:active{background-color:var(--van-sidebar-selected-background)}.van-sidebar-item--select:before{position:absolute;top:50%;left:0;width:var(--van-sidebar-selected-border-width);height:var(--van-sidebar-selected-border-height);background-color:var(--van-sidebar-selected-border-color);transform:translateY(-50%);content:""}.van-sidebar-item--disabled{color:var(--van-sidebar-disabled-text-color);cursor:not-allowed}.van-sidebar-item--disabled:active{background-color:var(--van-sidebar-background)}
|
||||
36
node_modules/vant/lib/sidebar-item/index.d.ts
generated
vendored
Normal file
36
node_modules/vant/lib/sidebar-item/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
export declare const SidebarItem: import("../utils").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
||||
to: import("vue").PropType<import("vue-router").RouteLocationRaw>;
|
||||
url: StringConstructor;
|
||||
replace: BooleanConstructor;
|
||||
} & {
|
||||
dot: BooleanConstructor;
|
||||
title: StringConstructor;
|
||||
badge: (NumberConstructor | StringConstructor)[];
|
||||
disabled: BooleanConstructor;
|
||||
badgeProps: import("vue").PropType<Partial<import("..").BadgeProps>>;
|
||||
}>, (() => import("vue/jsx-runtime").JSX.Element) | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
||||
to: import("vue").PropType<import("vue-router").RouteLocationRaw>;
|
||||
url: StringConstructor;
|
||||
replace: BooleanConstructor;
|
||||
} & {
|
||||
dot: BooleanConstructor;
|
||||
title: StringConstructor;
|
||||
badge: (NumberConstructor | StringConstructor)[];
|
||||
disabled: BooleanConstructor;
|
||||
badgeProps: import("vue").PropType<Partial<import("..").BadgeProps>>;
|
||||
}>> & Readonly<{
|
||||
onClick?: ((...args: any[]) => any) | undefined;
|
||||
}>, {
|
||||
replace: boolean;
|
||||
dot: boolean;
|
||||
disabled: boolean;
|
||||
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
||||
export default SidebarItem;
|
||||
export { sidebarItemProps } from './SidebarItem';
|
||||
export type { SidebarItemProps } from './SidebarItem';
|
||||
export type { SidebarItemThemeVars } from './types';
|
||||
declare module 'vue' {
|
||||
interface GlobalComponents {
|
||||
VanSidebarItem: typeof SidebarItem;
|
||||
}
|
||||
}
|
||||
39
node_modules/vant/lib/sidebar-item/index.js
generated
vendored
Normal file
39
node_modules/vant/lib/sidebar-item/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, {
|
||||
SidebarItem: () => SidebarItem,
|
||||
default: () => stdin_default,
|
||||
sidebarItemProps: () => import_SidebarItem2.sidebarItemProps
|
||||
});
|
||||
module.exports = __toCommonJS(stdin_exports);
|
||||
var import_utils = require("../utils");
|
||||
var import_SidebarItem = __toESM(require("./SidebarItem"));
|
||||
var import_SidebarItem2 = require("./SidebarItem");
|
||||
const SidebarItem = (0, import_utils.withInstall)(import_SidebarItem.default);
|
||||
var stdin_default = SidebarItem;
|
||||
1
node_modules/vant/lib/sidebar-item/style/index.d.ts
generated
vendored
Normal file
1
node_modules/vant/lib/sidebar-item/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
4
node_modules/vant/lib/sidebar-item/style/index.js
generated
vendored
Normal file
4
node_modules/vant/lib/sidebar-item/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
require("../../style/base.css");
|
||||
require("../../badge/index.css");
|
||||
require("../../sidebar/index.css");
|
||||
require("../index.css");
|
||||
15
node_modules/vant/lib/sidebar-item/types.d.ts
generated
vendored
Normal file
15
node_modules/vant/lib/sidebar-item/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
export type SidebarItemThemeVars = {
|
||||
sidebarFontSize?: string;
|
||||
sidebarLineHeight?: number | string;
|
||||
sidebarTextColor?: string;
|
||||
sidebarDisabledTextColor?: string;
|
||||
sidebarPadding?: string;
|
||||
sidebarActiveColor?: string;
|
||||
sidebarBackground?: string;
|
||||
sidebarSelectedFontWeight?: string;
|
||||
sidebarSelectedTextColor?: string;
|
||||
sidebarSelectedBorderWidth?: string;
|
||||
sidebarSelectedBorderHeight?: string;
|
||||
sidebarSelectedBorderColor?: string;
|
||||
sidebarSelectedBackground?: string;
|
||||
};
|
||||
15
node_modules/vant/lib/sidebar-item/types.js
generated
vendored
Normal file
15
node_modules/vant/lib/sidebar-item/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