aiflowy-ui-admin/node_modules/.vite/deps/chunk-3DJYPQW6.js

172 lines
4.3 KiB
JavaScript

import {
isClient
} from "./chunk-FYPMSKES.js";
import {
debugWarn,
isNumber,
isStringNumber,
isUndefined
} from "./chunk-UFIWN4M6.js";
import {
_export_sfc
} from "./chunk-MUJDDH7P.js";
import {
buildProps,
definePropType,
get_default,
set_default,
useNamespace,
withInstall
} from "./chunk-R2OGZABH.js";
import {
computed,
createElementBlock,
defineComponent,
mergeProps,
openBlock,
renderSlot,
unref
} from "./chunk-AAHVYXXY.js";
import {
camelize,
init_shared_esm_bundler,
isObject,
isString
} 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/icon/src/icon.mjs
var iconProps = buildProps({
size: {
type: definePropType([Number, String])
},
color: {
type: String
}
});
// ../node_modules/.pnpm/element-plus@2.11.7_vue@3.5.24_typescript@5.9.3_/node_modules/element-plus/es/utils/dom/style.mjs
init_shared_esm_bundler();
// ../node_modules/.pnpm/element-plus@2.11.7_vue@3.5.24_typescript@5.9.3_/node_modules/element-plus/es/utils/objects.mjs
init_shared_esm_bundler();
var keysOf = (arr) => Object.keys(arr);
var entriesOf = (arr) => Object.entries(arr);
var getProp = (obj, path, defaultValue) => {
return {
get value() {
return get_default(obj, path, defaultValue);
},
set value(val) {
set_default(obj, path, val);
}
};
};
// ../node_modules/.pnpm/element-plus@2.11.7_vue@3.5.24_typescript@5.9.3_/node_modules/element-plus/es/utils/dom/style.mjs
var SCOPE = "utils/dom/style";
var classNameToArray = (cls = "") => cls.split(" ").filter((item) => !!item.trim());
var hasClass = (el, cls) => {
if (!el || !cls)
return false;
if (cls.includes(" "))
throw new Error("className should not contain space.");
return el.classList.contains(cls);
};
var addClass = (el, cls) => {
if (!el || !cls.trim())
return;
el.classList.add(...classNameToArray(cls));
};
var removeClass = (el, cls) => {
if (!el || !cls.trim())
return;
el.classList.remove(...classNameToArray(cls));
};
var getStyle = (element, styleName) => {
var _a;
if (!isClient || !element || !styleName)
return "";
let key = camelize(styleName);
if (key === "float")
key = "cssFloat";
try {
const style = element.style[key];
if (style)
return style;
const computed2 = (_a = document.defaultView) == null ? void 0 : _a.getComputedStyle(element, "");
return computed2 ? computed2[key] : "";
} catch (e) {
return element.style[key];
}
};
var setStyle = (element, styleName, value) => {
if (!element || !styleName)
return;
if (isObject(styleName)) {
entriesOf(styleName).forEach(([prop, value2]) => setStyle(element, prop, value2));
} else {
const key = camelize(styleName);
element.style[key] = value;
}
};
function addUnit(value, defaultUnit = "px") {
if (!value)
return "";
if (isNumber(value) || isStringNumber(value)) {
return `${value}${defaultUnit}`;
} else if (isString(value)) {
return value;
}
debugWarn(SCOPE, "binding value must be a string or number");
}
// ../node_modules/.pnpm/element-plus@2.11.7_vue@3.5.24_typescript@5.9.3_/node_modules/element-plus/es/components/icon/src/icon2.mjs
var __default__ = defineComponent({
name: "ElIcon",
inheritAttrs: false
});
var _sfc_main = defineComponent({
...__default__,
props: iconProps,
setup(__props) {
const props = __props;
const ns = useNamespace("icon");
const style = computed(() => {
const { size, color } = props;
if (!size && !color)
return {};
return {
fontSize: isUndefined(size) ? void 0 : addUnit(size),
"--color": color
};
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("i", mergeProps({
class: unref(ns).b(),
style: unref(style)
}, _ctx.$attrs), [
renderSlot(_ctx.$slots, "default")
], 16);
};
}
});
var Icon = _export_sfc(_sfc_main, [["__file", "icon.vue"]]);
// ../node_modules/.pnpm/element-plus@2.11.7_vue@3.5.24_typescript@5.9.3_/node_modules/element-plus/es/components/icon/index.mjs
var ElIcon = withInstall(Icon);
export {
keysOf,
entriesOf,
getProp,
hasClass,
addClass,
removeClass,
getStyle,
setStyle,
addUnit,
iconProps,
ElIcon
};
//# sourceMappingURL=chunk-3DJYPQW6.js.map