242 lines
7.1 KiB
JavaScript
242 lines
7.1 KiB
JavaScript
import {
|
|
ElIcon
|
|
} from "./chunk-3DJYPQW6.js";
|
|
import {
|
|
isClient,
|
|
useFormSize,
|
|
useResizeObserver
|
|
} from "./chunk-FYPMSKES.js";
|
|
import {
|
|
componentSizes
|
|
} from "./chunk-UFIWN4M6.js";
|
|
import {
|
|
_export_sfc
|
|
} from "./chunk-MUJDDH7P.js";
|
|
import {
|
|
buildProps,
|
|
get_default,
|
|
useNamespace,
|
|
withInstall
|
|
} from "./chunk-R2OGZABH.js";
|
|
import {
|
|
close_default
|
|
} from "./chunk-3C23FNYW.js";
|
|
import {
|
|
Transition,
|
|
computed,
|
|
createBaseVNode,
|
|
createBlock,
|
|
createCommentVNode,
|
|
createElementBlock,
|
|
createVNode,
|
|
defineComponent,
|
|
openBlock,
|
|
ref,
|
|
renderSlot,
|
|
shallowRef,
|
|
unref,
|
|
withCtx,
|
|
withModifiers
|
|
} from "./chunk-AAHVYXXY.js";
|
|
import {
|
|
capitalize,
|
|
init_shared_esm_bundler,
|
|
normalizeClass,
|
|
normalizeStyle
|
|
} from "./chunk-OWZYVOTZ.js";
|
|
|
|
// ../node_modules/.pnpm/element-plus@2.11.7_vue@3.5.24_typescript@5.9.3_/node_modules/element-plus/es/components/tag/src/tag.mjs
|
|
var tagProps = buildProps({
|
|
type: {
|
|
type: String,
|
|
values: ["primary", "success", "info", "warning", "danger"],
|
|
default: "primary"
|
|
},
|
|
closable: Boolean,
|
|
disableTransitions: Boolean,
|
|
hit: Boolean,
|
|
color: String,
|
|
size: {
|
|
type: String,
|
|
values: componentSizes
|
|
},
|
|
effect: {
|
|
type: String,
|
|
values: ["dark", "light", "plain"],
|
|
default: "light"
|
|
},
|
|
round: Boolean
|
|
});
|
|
var tagEmits = {
|
|
close: (evt) => evt instanceof MouseEvent,
|
|
click: (evt) => evt instanceof MouseEvent
|
|
};
|
|
|
|
// ../node_modules/.pnpm/element-plus@2.11.7_vue@3.5.24_typescript@5.9.3_/node_modules/element-plus/es/components/tag/src/tag2.mjs
|
|
var __default__ = defineComponent({
|
|
name: "ElTag"
|
|
});
|
|
var _sfc_main = defineComponent({
|
|
...__default__,
|
|
props: tagProps,
|
|
emits: tagEmits,
|
|
setup(__props, { emit }) {
|
|
const props = __props;
|
|
const tagSize = useFormSize();
|
|
const ns = useNamespace("tag");
|
|
const containerKls = computed(() => {
|
|
const { type, hit, effect, closable, round } = props;
|
|
return [
|
|
ns.b(),
|
|
ns.is("closable", closable),
|
|
ns.m(type || "primary"),
|
|
ns.m(tagSize.value),
|
|
ns.m(effect),
|
|
ns.is("hit", hit),
|
|
ns.is("round", round)
|
|
];
|
|
});
|
|
const handleClose = (event) => {
|
|
emit("close", event);
|
|
};
|
|
const handleClick = (event) => {
|
|
emit("click", event);
|
|
};
|
|
const handleVNodeMounted = (vnode) => {
|
|
var _a, _b, _c;
|
|
if ((_c = (_b = (_a = vnode == null ? void 0 : vnode.component) == null ? void 0 : _a.subTree) == null ? void 0 : _b.component) == null ? void 0 : _c.bum) {
|
|
vnode.component.subTree.component.bum = null;
|
|
}
|
|
};
|
|
return (_ctx, _cache) => {
|
|
return _ctx.disableTransitions ? (openBlock(), createElementBlock("span", {
|
|
key: 0,
|
|
class: normalizeClass(unref(containerKls)),
|
|
style: normalizeStyle({ backgroundColor: _ctx.color }),
|
|
onClick: handleClick
|
|
}, [
|
|
createBaseVNode("span", {
|
|
class: normalizeClass(unref(ns).e("content"))
|
|
}, [
|
|
renderSlot(_ctx.$slots, "default")
|
|
], 2),
|
|
_ctx.closable ? (openBlock(), createBlock(unref(ElIcon), {
|
|
key: 0,
|
|
class: normalizeClass(unref(ns).e("close")),
|
|
onClick: withModifiers(handleClose, ["stop"])
|
|
}, {
|
|
default: withCtx(() => [
|
|
createVNode(unref(close_default))
|
|
]),
|
|
_: 1
|
|
}, 8, ["class", "onClick"])) : createCommentVNode("v-if", true)
|
|
], 6)) : (openBlock(), createBlock(Transition, {
|
|
key: 1,
|
|
name: `${unref(ns).namespace.value}-zoom-in-center`,
|
|
appear: "",
|
|
onVnodeMounted: handleVNodeMounted
|
|
}, {
|
|
default: withCtx(() => [
|
|
createBaseVNode("span", {
|
|
class: normalizeClass(unref(containerKls)),
|
|
style: normalizeStyle({ backgroundColor: _ctx.color }),
|
|
onClick: handleClick
|
|
}, [
|
|
createBaseVNode("span", {
|
|
class: normalizeClass(unref(ns).e("content"))
|
|
}, [
|
|
renderSlot(_ctx.$slots, "default")
|
|
], 2),
|
|
_ctx.closable ? (openBlock(), createBlock(unref(ElIcon), {
|
|
key: 0,
|
|
class: normalizeClass(unref(ns).e("close")),
|
|
onClick: withModifiers(handleClose, ["stop"])
|
|
}, {
|
|
default: withCtx(() => [
|
|
createVNode(unref(close_default))
|
|
]),
|
|
_: 1
|
|
}, 8, ["class", "onClick"])) : createCommentVNode("v-if", true)
|
|
], 6)
|
|
]),
|
|
_: 3
|
|
}, 8, ["name"]));
|
|
};
|
|
}
|
|
});
|
|
var Tag = _export_sfc(_sfc_main, [["__file", "tag.vue"]]);
|
|
|
|
// ../node_modules/.pnpm/element-plus@2.11.7_vue@3.5.24_typescript@5.9.3_/node_modules/element-plus/es/components/tag/index.mjs
|
|
var ElTag = withInstall(Tag);
|
|
|
|
// ../node_modules/.pnpm/element-plus@2.11.7_vue@3.5.24_typescript@5.9.3_/node_modules/element-plus/es/constants/form.mjs
|
|
var MINIMUM_INPUT_WIDTH = 11;
|
|
var BORDER_HORIZONTAL_WIDTH = 2;
|
|
|
|
// ../node_modules/.pnpm/element-plus@2.11.7_vue@3.5.24_typescript@5.9.3_/node_modules/element-plus/es/hooks/use-calc-input-width/index.mjs
|
|
function useCalcInputWidth() {
|
|
const calculatorRef = shallowRef();
|
|
const calculatorWidth = ref(0);
|
|
const inputStyle = computed(() => ({
|
|
minWidth: `${Math.max(calculatorWidth.value, MINIMUM_INPUT_WIDTH)}px`
|
|
}));
|
|
const resetCalculatorWidth = () => {
|
|
var _a, _b;
|
|
calculatorWidth.value = (_b = (_a = calculatorRef.value) == null ? void 0 : _a.getBoundingClientRect().width) != null ? _b : 0;
|
|
};
|
|
useResizeObserver(calculatorRef, resetCalculatorWidth);
|
|
return {
|
|
calculatorRef,
|
|
calculatorWidth,
|
|
inputStyle
|
|
};
|
|
}
|
|
|
|
// ../node_modules/.pnpm/element-plus@2.11.7_vue@3.5.24_typescript@5.9.3_/node_modules/element-plus/es/components/select-v2/src/useProps.mjs
|
|
var defaultProps = {
|
|
label: "label",
|
|
value: "value",
|
|
disabled: "disabled",
|
|
options: "options"
|
|
};
|
|
function useProps(props) {
|
|
const aliasProps = computed(() => ({ ...defaultProps, ...props.props }));
|
|
const getLabel = (option) => get_default(option, aliasProps.value.label);
|
|
const getValue = (option) => get_default(option, aliasProps.value.value);
|
|
const getDisabled = (option) => get_default(option, aliasProps.value.disabled);
|
|
const getOptions = (option) => get_default(option, aliasProps.value.options);
|
|
return {
|
|
aliasProps,
|
|
getLabel,
|
|
getValue,
|
|
getDisabled,
|
|
getOptions
|
|
};
|
|
}
|
|
|
|
// ../node_modules/.pnpm/element-plus@2.11.7_vue@3.5.24_typescript@5.9.3_/node_modules/element-plus/es/utils/strings.mjs
|
|
init_shared_esm_bundler();
|
|
init_shared_esm_bundler();
|
|
var escapeStringRegexp = (string = "") => string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
|
|
var capitalize2 = (str) => capitalize(str);
|
|
|
|
// ../node_modules/.pnpm/element-plus@2.11.7_vue@3.5.24_typescript@5.9.3_/node_modules/element-plus/es/utils/raf.mjs
|
|
var rAF = (fn) => isClient ? window.requestAnimationFrame(fn) : setTimeout(fn, 16);
|
|
var cAF = (handle) => isClient ? window.cancelAnimationFrame(handle) : clearTimeout(handle);
|
|
|
|
export {
|
|
rAF,
|
|
cAF,
|
|
tagProps,
|
|
tagEmits,
|
|
ElTag,
|
|
MINIMUM_INPUT_WIDTH,
|
|
BORDER_HORIZONTAL_WIDTH,
|
|
useCalcInputWidth,
|
|
defaultProps,
|
|
useProps,
|
|
escapeStringRegexp,
|
|
capitalize2 as capitalize
|
|
};
|
|
//# sourceMappingURL=chunk-LZ2AJP2V.js.map
|