first commit
This commit is contained in:
106
node_modules/vant/lib/tree-select/TreeSelect.d.ts
generated
vendored
Normal file
106
node_modules/vant/lib/tree-select/TreeSelect.d.ts
generated
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
import { type PropType, type ExtractPropTypes } from 'vue';
|
||||
import { type Numeric } from '../utils';
|
||||
export type TreeSelectChild = {
|
||||
id: Numeric;
|
||||
text: string;
|
||||
disabled?: boolean;
|
||||
};
|
||||
export type TreeSelectItem = {
|
||||
dot?: boolean;
|
||||
text: string;
|
||||
badge?: Numeric;
|
||||
children?: TreeSelectChild[];
|
||||
disabled?: boolean;
|
||||
className?: unknown;
|
||||
};
|
||||
export declare const treeSelectProps: {
|
||||
max: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
items: {
|
||||
type: PropType<TreeSelectItem[]>;
|
||||
default: () => never[];
|
||||
};
|
||||
height: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
selectedIcon: {
|
||||
type: PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
mainActiveIndex: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
activeId: {
|
||||
type: PropType<Numeric | Numeric[]>;
|
||||
default: number;
|
||||
};
|
||||
};
|
||||
export type TreeSelectProps = ExtractPropTypes<typeof treeSelectProps>;
|
||||
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
||||
max: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
items: {
|
||||
type: PropType<TreeSelectItem[]>;
|
||||
default: () => never[];
|
||||
};
|
||||
height: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
selectedIcon: {
|
||||
type: PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
mainActiveIndex: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
activeId: {
|
||||
type: PropType<Numeric | Numeric[]>;
|
||||
default: number;
|
||||
};
|
||||
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clickItem" | "clickNav" | "update:activeId" | "update:mainActiveIndex")[], "clickItem" | "clickNav" | "update:activeId" | "update:mainActiveIndex", import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
||||
max: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
items: {
|
||||
type: PropType<TreeSelectItem[]>;
|
||||
default: () => never[];
|
||||
};
|
||||
height: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
selectedIcon: {
|
||||
type: PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
mainActiveIndex: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
activeId: {
|
||||
type: PropType<Numeric | Numeric[]>;
|
||||
default: number;
|
||||
};
|
||||
}>> & Readonly<{
|
||||
onClickItem?: ((...args: any[]) => any) | undefined;
|
||||
onClickNav?: ((...args: any[]) => any) | undefined;
|
||||
"onUpdate:activeId"?: ((...args: any[]) => any) | undefined;
|
||||
"onUpdate:mainActiveIndex"?: ((...args: any[]) => any) | undefined;
|
||||
}>, {
|
||||
height: string | number;
|
||||
max: string | number;
|
||||
items: TreeSelectItem[];
|
||||
selectedIcon: string;
|
||||
mainActiveIndex: string | number;
|
||||
activeId: Numeric | Numeric[];
|
||||
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
||||
export default _default;
|
||||
122
node_modules/vant/lib/tree-select/TreeSelect.js
generated
vendored
Normal file
122
node_modules/vant/lib/tree-select/TreeSelect.js
generated
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
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,
|
||||
treeSelectProps: () => treeSelectProps
|
||||
});
|
||||
module.exports = __toCommonJS(stdin_exports);
|
||||
var import_vue = require("vue");
|
||||
var import_utils = require("../utils");
|
||||
var import_icon = require("../icon");
|
||||
var import_sidebar = require("../sidebar");
|
||||
var import_sidebar_item = require("../sidebar-item");
|
||||
const [name, bem] = (0, import_utils.createNamespace)("tree-select");
|
||||
const treeSelectProps = {
|
||||
max: (0, import_utils.makeNumericProp)(Infinity),
|
||||
items: (0, import_utils.makeArrayProp)(),
|
||||
height: (0, import_utils.makeNumericProp)(300),
|
||||
selectedIcon: (0, import_utils.makeStringProp)("success"),
|
||||
mainActiveIndex: (0, import_utils.makeNumericProp)(0),
|
||||
activeId: {
|
||||
type: [Number, String, Array],
|
||||
default: 0
|
||||
}
|
||||
};
|
||||
var stdin_default = (0, import_vue.defineComponent)({
|
||||
name,
|
||||
props: treeSelectProps,
|
||||
emits: ["clickNav", "clickItem", "update:activeId", "update:mainActiveIndex"],
|
||||
setup(props, {
|
||||
emit,
|
||||
slots
|
||||
}) {
|
||||
const isActiveItem = (id) => Array.isArray(props.activeId) ? props.activeId.includes(id) : props.activeId === id;
|
||||
const renderSubItem = (item) => {
|
||||
const onClick = () => {
|
||||
if (item.disabled) {
|
||||
return;
|
||||
}
|
||||
let activeId;
|
||||
if (Array.isArray(props.activeId)) {
|
||||
activeId = props.activeId.slice();
|
||||
const index = activeId.indexOf(item.id);
|
||||
if (index !== -1) {
|
||||
activeId.splice(index, 1);
|
||||
} else if (activeId.length < +props.max) {
|
||||
activeId.push(item.id);
|
||||
}
|
||||
} else {
|
||||
activeId = item.id;
|
||||
}
|
||||
emit("update:activeId", activeId);
|
||||
emit("clickItem", item);
|
||||
};
|
||||
return (0, import_vue.createVNode)("div", {
|
||||
"key": item.id,
|
||||
"class": ["van-ellipsis", bem("item", {
|
||||
active: isActiveItem(item.id),
|
||||
disabled: item.disabled
|
||||
})],
|
||||
"onClick": onClick
|
||||
}, [item.text, isActiveItem(item.id) && (0, import_vue.createVNode)(import_icon.Icon, {
|
||||
"name": props.selectedIcon,
|
||||
"class": bem("selected")
|
||||
}, null)]);
|
||||
};
|
||||
const onSidebarChange = (index) => {
|
||||
emit("update:mainActiveIndex", index);
|
||||
};
|
||||
const onClickSidebarItem = (index) => emit("clickNav", index);
|
||||
const renderSidebar = () => {
|
||||
const Items = props.items.map((item) => (0, import_vue.createVNode)(import_sidebar_item.SidebarItem, {
|
||||
"dot": item.dot,
|
||||
"badge": item.badge,
|
||||
"class": [bem("nav-item"), item.className],
|
||||
"disabled": item.disabled,
|
||||
"onClick": onClickSidebarItem
|
||||
}, {
|
||||
title: () => slots["nav-text"] ? slots["nav-text"](item) : item.text
|
||||
}));
|
||||
return (0, import_vue.createVNode)(import_sidebar.Sidebar, {
|
||||
"class": bem("nav"),
|
||||
"modelValue": props.mainActiveIndex,
|
||||
"onChange": onSidebarChange
|
||||
}, {
|
||||
default: () => [Items]
|
||||
});
|
||||
};
|
||||
const renderContent = () => {
|
||||
if (slots.content) {
|
||||
return slots.content();
|
||||
}
|
||||
const selected = props.items[+props.mainActiveIndex] || {};
|
||||
if (selected.children) {
|
||||
return selected.children.map(renderSubItem);
|
||||
}
|
||||
};
|
||||
return () => (0, import_vue.createVNode)("div", {
|
||||
"class": bem(),
|
||||
"style": {
|
||||
height: (0, import_utils.addUnit)(props.height)
|
||||
}
|
||||
}, [renderSidebar(), (0, import_vue.createVNode)("div", {
|
||||
"class": bem("content")
|
||||
}, [renderContent()])]);
|
||||
}
|
||||
});
|
||||
1
node_modules/vant/lib/tree-select/index.css
generated
vendored
Normal file
1
node_modules/vant/lib/tree-select/index.css
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
:root,:host{--van-tree-select-font-size: var(--van-font-size-md);--van-tree-select-nav-background: var(--van-background);--van-tree-select-content-background: var(--van-background-2);--van-tree-select-nav-item-padding: 14px var(--van-padding-sm);--van-tree-select-item-height: 48px;--van-tree-select-item-active-color: var(--van-primary-color);--van-tree-select-item-disabled-color: var(--van-gray-5);--van-tree-select-item-selected-size: 16px}.van-tree-select{position:relative;display:flex;font-size:var(--van-tree-select-font-size)}.van-tree-select__nav{flex:1;overflow-y:auto;background:var(--van-tree-select-nav-background);-webkit-overflow-scrolling:touch}.van-tree-select__nav-item{padding:var(--van-tree-select-nav-item-padding)}.van-tree-select__content{flex:2;overflow-y:auto;background:var(--van-tree-select-content-background);-webkit-overflow-scrolling:touch}.van-tree-select__item{position:relative;padding:0 32px 0 var(--van-padding-md);font-weight:var(--van-font-bold);line-height:var(--van-tree-select-item-height);-webkit-user-select:none;user-select:none;cursor:pointer}.van-tree-select__item--active{color:var(--van-tree-select-item-active-color)}.van-tree-select__item:active{background-color:var(--van-active-color)}.van-tree-select__item--disabled{color:var(--van-tree-select-item-disabled-color);cursor:not-allowed}.van-tree-select__item--disabled:active{background-color:transparent}.van-tree-select__selected{position:absolute;top:50%;right:var(--van-padding-md);margin-top:calc(var(--van-padding-xs) * -1);font-size:var(--van-tree-select-item-selected-size)}
|
||||
72
node_modules/vant/lib/tree-select/index.d.ts
generated
vendored
Normal file
72
node_modules/vant/lib/tree-select/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
export declare const TreeSelect: import("../utils").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
||||
max: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
items: {
|
||||
type: import("vue").PropType<import("./TreeSelect").TreeSelectItem[]>;
|
||||
default: () => never[];
|
||||
};
|
||||
height: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
selectedIcon: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
mainActiveIndex: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
activeId: {
|
||||
type: import("vue").PropType<import("../utils").Numeric | import("../utils").Numeric[]>;
|
||||
default: number;
|
||||
};
|
||||
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clickItem" | "clickNav" | "update:activeId" | "update:mainActiveIndex")[], "clickItem" | "clickNav" | "update:activeId" | "update:mainActiveIndex", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
||||
max: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
items: {
|
||||
type: import("vue").PropType<import("./TreeSelect").TreeSelectItem[]>;
|
||||
default: () => never[];
|
||||
};
|
||||
height: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
selectedIcon: {
|
||||
type: import("vue").PropType<string>;
|
||||
default: string;
|
||||
};
|
||||
mainActiveIndex: {
|
||||
type: (NumberConstructor | StringConstructor)[];
|
||||
default: number;
|
||||
};
|
||||
activeId: {
|
||||
type: import("vue").PropType<import("../utils").Numeric | import("../utils").Numeric[]>;
|
||||
default: number;
|
||||
};
|
||||
}>> & Readonly<{
|
||||
onClickItem?: ((...args: any[]) => any) | undefined;
|
||||
onClickNav?: ((...args: any[]) => any) | undefined;
|
||||
"onUpdate:activeId"?: ((...args: any[]) => any) | undefined;
|
||||
"onUpdate:mainActiveIndex"?: ((...args: any[]) => any) | undefined;
|
||||
}>, {
|
||||
height: string | number;
|
||||
max: string | number;
|
||||
items: import("./TreeSelect").TreeSelectItem[];
|
||||
selectedIcon: string;
|
||||
mainActiveIndex: string | number;
|
||||
activeId: import("../utils").Numeric | import("../utils").Numeric[];
|
||||
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
||||
export default TreeSelect;
|
||||
export { treeSelectProps } from './TreeSelect';
|
||||
export type { TreeSelectItem, TreeSelectChild, TreeSelectProps, } from './TreeSelect';
|
||||
export type { TreeSelectThemeVars } from './types';
|
||||
declare module 'vue' {
|
||||
interface GlobalComponents {
|
||||
VanTreeSelect: typeof TreeSelect;
|
||||
}
|
||||
}
|
||||
39
node_modules/vant/lib/tree-select/index.js
generated
vendored
Normal file
39
node_modules/vant/lib/tree-select/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, {
|
||||
TreeSelect: () => TreeSelect,
|
||||
default: () => stdin_default,
|
||||
treeSelectProps: () => import_TreeSelect2.treeSelectProps
|
||||
});
|
||||
module.exports = __toCommonJS(stdin_exports);
|
||||
var import_utils = require("../utils");
|
||||
var import_TreeSelect = __toESM(require("./TreeSelect"));
|
||||
var import_TreeSelect2 = require("./TreeSelect");
|
||||
const TreeSelect = (0, import_utils.withInstall)(import_TreeSelect.default);
|
||||
var stdin_default = TreeSelect;
|
||||
1
node_modules/vant/lib/tree-select/style/index.d.ts
generated
vendored
Normal file
1
node_modules/vant/lib/tree-select/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
6
node_modules/vant/lib/tree-select/style/index.js
generated
vendored
Normal file
6
node_modules/vant/lib/tree-select/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
require("../../style/base.css");
|
||||
require("../../badge/index.css");
|
||||
require("../../icon/index.css");
|
||||
require("../../sidebar/index.css");
|
||||
require("../../sidebar-item/index.css");
|
||||
require("../index.css");
|
||||
10
node_modules/vant/lib/tree-select/types.d.ts
generated
vendored
Normal file
10
node_modules/vant/lib/tree-select/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
export type TreeSelectThemeVars = {
|
||||
treeSelectFontSize?: string;
|
||||
treeSelectNavBackground?: string;
|
||||
treeSelectContentBackground?: string;
|
||||
treeSelectNavItemPadding?: string;
|
||||
treeSelectItemHeight?: string;
|
||||
treeSelectItemActiveColor?: string;
|
||||
treeSelectItemDisabledColor?: string;
|
||||
treeSelectItemSelectedSize?: string;
|
||||
};
|
||||
15
node_modules/vant/lib/tree-select/types.js
generated
vendored
Normal file
15
node_modules/vant/lib/tree-select/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