@opensig/opendesign
Version:
<p align="center"><img src="../docs/public/opendesign-logo-light.png"/></p> <h1 align="center">opendesign</h1> <p align="center">一个 Vue 3 组件库</p> <p align="center"><b>皮肤可定制,使用 TypeScript</b></p>
18,587 lines • 602 kB
JavaScript
(function(global, factory) {
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("vue")) : typeof define === "function" && define.amd ? define(["exports", "vue"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.opendesign = {}, global.Vue));
})(this, function(exports2, vue) {
"use strict";var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
const SizeTypes = ["large", "medium", "small"];
const DirectionTypes = ["h", "v"];
const PositionTypes = ["left", "right", "top", "bottom"];
const VariantTypes = ["solid", "outline", "text"];
const ColorTypes = ["normal", "primary", "success", "warning", "danger"];
const Color2Types = ["normal", "success", "warning", "danger"];
const opt = Object.prototype.toString;
function isUndefined(val) {
return val === void 0;
}
function isNull(val) {
return opt.call(val) === "[object Null]";
}
function isBoolean(val) {
return opt.call(val) === "[object Boolean]";
}
function isString(val) {
return opt.call(val) === "[object String]";
}
function isNumber(val) {
return opt.call(val) === "[object Number]" && !Number.isNaN(val);
}
function isFunction(val) {
return typeof val === "function";
}
function isArray(val) {
return Array.isArray(val);
}
function isEmptyArray(val) {
return isArray(val) && val.length === 0;
}
function isArrayEqual(arr1, arr2) {
if (!isArray(arr1) || !isArray(arr2)) {
return false;
}
const len = arr1.length;
if (len !== arr2.length) {
return false;
}
for (let i = 0; i < len; i++) {
if (!arr2.includes(arr1[i])) {
return false;
}
}
return true;
}
function isEmptyObject(val) {
return opt.call(val) === "[object object]" && Object.keys(val).length === 0;
}
function isValidDate(val) {
return val instanceof Date && !Number.isNaN(val.valueOf());
}
function isObject(val) {
return val !== null && typeof val === "object";
}
function isPlainObject(val) {
return opt.call(val) === "[object Object]";
}
const isPromise = (val) => {
return isObject(val) && isFunction(val.then) && isFunction(val.catch);
};
const isClient = typeof window !== "undefined";
const isTouchDevice = isClient ? "ontouchstart" in document.documentElement : false;
function isWindow(val) {
return val === window;
}
function isCurrentPageLink(link) {
if (link.startsWith("#")) {
return true;
}
try {
const targetUrl = new URL(link, window.location.href);
return targetUrl.origin + targetUrl.pathname === window.location.origin + window.location.pathname;
} catch {
return false;
}
}
function debounce(fn, wait = 0, runFirst = true) {
let handler = 0;
return (...args) => {
if (runFirst) {
if (handler === 0) {
fn(...args);
}
}
clearTimeout(handler);
handler = window.setTimeout(() => {
if (!runFirst) {
fn(...args);
}
handler = 0;
}, wait);
};
}
function debounceRAF(fn) {
let handle = 0;
const rlt = (...args) => {
if (handle) {
cancelAnimationFrame(handle);
}
handle = requestAnimationFrame(() => {
fn(...args);
handle = 0;
});
};
rlt.cancel = () => {
cancelAnimationFrame(handle);
handle = 0;
};
return rlt;
}
function throttleRAF(fn) {
let handle = 0;
const rlt = (...args) => {
if (handle) {
return;
}
handle = requestAnimationFrame(() => {
fn(...args);
handle = 0;
});
};
rlt.cancel = () => {
cancelAnimationFrame(handle);
handle = 0;
};
return rlt;
}
class ColorPool {
constructor(pool) {
__publicField(this, "pool");
__publicField(this, "tmpPool");
this.pool = pool;
this.tmpPool = [...pool];
}
/**
* 返回指定位置颜色,或者从颜色池随机返回一个颜色
* @param index
* @returns
*/
pick(index) {
if (index !== void 0) {
return this.pool[index % this.pool.length];
}
const { length } = this.tmpPool;
if (length === 0) {
this.tmpPool = [...this.pool];
}
const idx = Math.floor(Math.random() * length);
const color2 = this.tmpPool[idx];
this.tmpPool.splice(idx, 1);
return color2;
}
}
function uniqueId(prefix = "", length = 8) {
const gen = (len) => {
if (len <= 11) {
return Math.random().toString(36).slice(2, 2 + len).padEnd(len, "0");
} else {
return gen(11) + gen(len - 11);
}
};
return prefix ? `${prefix}-${gen(length)}` : gen(length);
}
function chunk(arr = [], size2 = 1) {
return Array.from(
{
length: Math.ceil(arr.length / size2)
},
(_v, i) => arr.slice(i * size2, i * size2 + size2)
);
}
async function asyncSome(array, judgeFn) {
for (const iterator of array) {
try {
if (await judgeFn(iterator)) {
return true;
}
} catch (error) {
return false;
}
}
return false;
}
function getValueByPath(obj, path) {
if (!obj || !path) {
return;
}
const keys = path.split(".");
if (keys.length === 0) {
return;
}
let temp = obj;
for (let i = 0; i < keys.length; i++) {
if (!isObject(temp)) {
return;
}
temp = temp[keys[i]];
if (i === keys.length - 1) {
return temp;
}
}
}
function setValueByPath(obj, path, value) {
if (!obj || !path) {
return;
}
const keys = path.split(".");
if (keys.length === 0) {
return;
}
let temp = obj;
for (let i = 0; i < keys.length; i++) {
if (!isObject(temp)) {
throw new TypeError(`Cannot set properties of non-object (setting '${keys[i]}')!`);
}
const k = keys[i];
if (i === keys.length - 1) {
temp[k] = value;
} else {
if (isUndefined(temp[k])) {
temp[k] = Number(keys[i + 1]) ? [] : {};
}
temp = temp[k];
}
}
}
function moveToFirst(arr, item) {
const idx = arr.indexOf(item);
if (idx > 0) {
const tmp = [...arr];
tmp.splice(idx, 1);
tmp.unshift(item);
return tmp;
}
return arr;
}
function formateToString(val) {
if (isUndefined(val) || isNull(val) || typeof val === "number" && isNaN(val) || isPlainObject(val)) {
return "";
}
return String(val);
}
function requestImage(src) {
return new Promise((resolve, reject) => {
const onImgLoaded = () => {
resolve(src);
};
const onImgError = (e) => {
reject(e);
};
const img = new Image();
img.onload = onImgLoaded;
img.onerror = onImgError;
img.src = src;
});
}
function pick(source, keys) {
const result = {};
keys.forEach((key) => {
if (key in source) {
result[key] = source[key];
}
});
return result;
}
function performTask(tasks, sheduler) {
let runingIndex = 0;
function _runTask() {
sheduler((toContinue) => {
while (runingIndex < tasks.length && toContinue(runingIndex)) {
tasks[runingIndex++]();
}
if (runingIndex < tasks.length) {
_runTask();
}
});
}
_runTask();
}
function idlePerformTask(tasks) {
const sheduler = (runChunk) => {
requestIdleCallback((idle) => {
runChunk(() => idle.timeRemaining() > 0);
});
};
performTask(tasks, sheduler);
}
const defaultZIndex = vue.ref(1e3);
function initZIndex(val) {
defaultZIndex.value = val;
}
const defaultSize = vue.ref("medium");
function initSize(val) {
defaultSize.value = val;
}
const defaultRound = vue.ref();
function initRound(type) {
defaultRound.value = type;
}
const defaultPrestColor = ["#d9e6c3", "#ebd5be", "#d1e6de", "#e0ceeb", "#ebd3c7", "#e6dada", "#e3deeb", "#dedae6", "#cad0e8", "#cedeeb"];
const defaultPrestColorPool = vue.ref(new ColorPool(defaultPrestColor));
function initPrestColor(colors) {
defaultPrestColorPool.value = new ColorPool(colors);
}
const mediaPoint = vue.ref({
phone: 600,
pad: 1200
});
function initMediaPoint(point) {
mediaPoint.value = point;
}
let globalId$I = 0;
const _sfc_main$1R = vue.defineComponent({
name: "OIconVideoPlay",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-video-play", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$I++
};
}
});
const _export_sfc = (sfc, props) => {
const target = sfc.__vccOpts || sfc;
for (const [key, val] of props) {
target[key] = val;
}
return target;
};
const _hoisted_1$1k = {
key: 0,
d: "M21.386 14.373 6.645 22.506c-1.607.887-3.659.354-4.582-1.19a3.13 3.13 0 0 1-.446-1.606V3.444C1.617 1.663 3.12.22 4.973.22c.587 0 1.163.148 1.671.428l14.741 8.133c1.607.887 2.162 2.858 1.239 4.402a3.3 3.3 0 0 1-1.239 1.19z"
};
function _sfc_render$J(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$1k)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconVideoPlay = /* @__PURE__ */ _export_sfc(_sfc_main$1R, [["render", _sfc_render$J]]);
let globalId$H = 0;
const _sfc_main$1Q = vue.defineComponent({
name: "OIconTime",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-time", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$H++
};
}
});
const _hoisted_1$1j = {
key: 0,
d: "M12 2.293a9.7 9.7 0 0 1 4.613 1.164.7.7 0 0 1-.667 1.231 8.307 8.307 0 0 0-12.254 7.311 8.307 8.307 0 0 0 8.307 8.307 8.307 8.307 0 0 0 6.208-13.827.7.7 0 1 1 1.046-.93 9.67 9.67 0 0 1 2.453 6.45c0 5.361-4.346 9.707-9.707 9.707s-9.707-4.346-9.707-9.707 4.346-9.707 9.707-9.707zm0 3.375c.354 0 .647.263.694.605l.006.095v5.976l-3.246 3.047a.699.699 0 0 1-1.034-.936l.077-.084 2.804-2.633V6.369c0-.354.263-.647.605-.694z"
};
function _sfc_render$I(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$1j)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconTime = /* @__PURE__ */ _export_sfc(_sfc_main$1Q, [["render", _sfc_render$I]]);
let globalId$G = 0;
const _sfc_main$1P = vue.defineComponent({
name: "OIconStar",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-star", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$G++
};
}
});
function _sfc_render$H(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 16 16",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock(
vue.Fragment,
{ key: 0 },
[
_cache[0] || (_cache[0] = vue.createElementVNode(
"path",
{
"fill-rule": "evenodd",
d: "M8.345 2.745q.121.06.212.15a.8.8 0 0 1 .143.202L9.956 5.61a.24.24 0 0 0 .082.096.3.3 0 0 0 .119.048l2.808.403a.8.8 0 0 1 .292.102.8.8 0 0 1 .221.2.75.75 0 0 1 .154.41.78.78 0 0 1-.235.61l-2.032 1.956a.24.24 0 0 0-.066.105.2.2 0 0 0-.013.062l-.001.016q0 .022.005.046l.48 2.762a.8.8 0 0 1-.01.309.7.7 0 0 1-.124.271.77.77 0 0 1-.34.268.8.8 0 0 1-.42.05.8.8 0 0 1-.239-.08l-2.51-1.304a.26.26 0 0 0-.25 0l-2.514 1.303a.77.77 0 0 1-.44.085.8.8 0 0 1-.522-.276.75.75 0 0 1-.17-.626l.48-2.762q.006-.03.004-.062a.3.3 0 0 0-.012-.062.3.3 0 0 0-.066-.105L2.604 7.479a.76.76 0 0 1-.22-.394.8.8 0 0 1-.004-.305.9.9 0 0 1 .103-.264.8.8 0 0 1 .553-.36l2.808-.403a.3.3 0 0 0 .12-.047.3.3 0 0 0 .08-.096l1.258-2.513a.76.76 0 0 1 .449-.39.78.78 0 0 1 .594.038M6.647 6.142a1 1 0 0 0 .114-.18l1.24-2.48 1.24 2.48.064.112h.001a1.1 1.1 0 0 0 .316.31 1 1 0 0 0 .265.12h.001q.076.022.154.034l2.773.397-2.007 1.932-.082.09h-.001l-.005.006a1.05 1.05 0 0 0-.217.835l.473 2.727-2.48-1.287-.12-.053-.002-.002a1 1 0 0 0-.439-.064l-.065.005a1 1 0 0 0-.365.114l-2.479 1.287.473-2.727.015-.138a1.06 1.06 0 0 0-.172-.613 1 1 0 0 0-.15-.18L3.186 6.935l2.774-.397.123-.026h.005a1.1 1.1 0 0 0 .538-.344l.02-.024z"
},
null,
-1
/* HOISTED */
)),
_cache[1] || (_cache[1] = vue.createElementVNode(
"path",
{
"fill-rule": "evenodd",
d: "M7.309 3.104 6.052 5.621a.27.27 0 0 1-.112.117l-2.373.359-.537.077a.75.75 0 0 0-.44.222 1 1 0 0 0-.107.134.8.8 0 0 0-.1.26.7.7 0 0 0 .004.3.8.8 0 0 0 .11.26q.046.07.108.128l2.033 1.96a.2.2 0 0 1 .045.054q.015.027.025.056a.3.3 0 0 1 .013.064.3.3 0 0 1-.003.064l-.48 2.766a.73.73 0 0 0 .077.487.773.773 0 0 0 .975.35c.019-.002.132-.042.132-.042.088-.048.185-.091.258-.132l1.77-.945.419-.216q.03-.016.061-.024a.3.3 0 0 1 .07-.008.3.3 0 0 1 .13.03l.102.054 2.21 1.211q.104.056.213.08a1 1 0 0 0 .115.014.77.77 0 0 0 .86-.287.8.8 0 0 0 .142-.409 1 1 0 0 0-.01-.162l-.48-2.767q-.005-.03-.003-.063a.3.3 0 0 1 .037-.12.3.3 0 0 1 .045-.055l2.033-1.959a.75.75 0 0 0 .21-.742.8.8 0 0 0-.228-.373.76.76 0 0 0-.406-.19l-2.545-.365-.304-.046a.3.3 0 0 1-.104-.054.3.3 0 0 1-.069-.088L8.691 3.104a.8.8 0 0 0-.145-.202.8.8 0 0 0-.26-.168.4.4 0 0 0-.212-.057L8.04 2.67a.7.7 0 0 0-.194.025.74.74 0 0 0-.306.136.7.7 0 0 0-.127.117.8.8 0 0 0-.104.156"
},
null,
-1
/* HOISTED */
)),
_cache[2] || (_cache[2] = vue.createElementVNode(
"path",
{
"fill-rule": "evenodd",
d: "M8 2.67v9.24a.3.3 0 0 0-.07.01.2.2 0 0 0-.061.024l-.418.215-1.77.947c-.075.04-.17.082-.26.131 0 0-.112.04-.131.041a1 1 0 0 1-.098.033.8.8 0 0 1-.432-.012.9.9 0 0 1-.254-.138.8.8 0 0 1-.191-.232.75.75 0 0 1-.077-.487l.48-2.766.004-.049v-.015a.25.25 0 0 0-.04-.12.2.2 0 0 0-.044-.054L2.604 7.477a1 1 0 0 1-.107-.127.8.8 0 0 1-.127-.41v-.016a.7.7 0 0 1 .053-.273.7.7 0 0 1 .167-.256.8.8 0 0 1 .44-.223l.537-.076 2.373-.36a.25.25 0 0 0 .112-.117l1.257-2.515a1 1 0 0 1 .103-.157h.002a.7.7 0 0 1 .126-.117.7.7 0 0 1 .14-.082.7.7 0 0 1 .166-.055 1 1 0 0 1 .09-.017z"
},
null,
-1
/* HOISTED */
))
],
64
/* STABLE_FRAGMENT */
)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconStar = /* @__PURE__ */ _export_sfc(_sfc_main$1P, [["render", _sfc_render$H]]);
let globalId$F = 0;
const _sfc_main$1O = vue.defineComponent({
name: "OIconSearch",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-search", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$F++
};
}
});
const _hoisted_1$1i = {
key: 0,
d: "m17.549 16.523.087.074 2.76 2.754a.7.7 0 0 1-.902 1.065l-.087-.074-2.76-2.754a.7.7 0 0 1 .902-1.065M10.821 3.454a7.423 7.423 0 1 1 0 14.846 7.423 7.423 0 0 1 0-14.846m0 1.4a6.023 6.023 0 1 0 0 12.046 6.023 6.023 0 0 0 0-12.046"
};
function _sfc_render$G(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$1i)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconSearch = /* @__PURE__ */ _export_sfc(_sfc_main$1O, [["render", _sfc_render$G]]);
let globalId$E = 0;
const _sfc_main$1N = vue.defineComponent({
name: "OIconRefresh",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-refresh", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$E++
};
}
});
const _hoisted_1$1h = {
key: 0,
d: "M14.802 2.836a9.54 9.54 0 0 1 3.928 2.341l-.001-1.251c0-.354.263-.647.605-.694l.095-.006c.354 0 .647.263.694.605l.006.095v2.653a.95.95 0 0 1-.839.944l-.111.006h-2.653a.7.7 0 0 1-.095-1.394l.095-.006 1.174-.001A8.171 8.171 0 0 0 4.189 9.601a8.172 8.172 0 1 0 15.751.432.7.7 0 0 1 1.359-.337A9.572 9.572 0 0 1 9.205 21.143 9.57 9.57 0 0 1 2.85 9.19a9.57 9.57 0 0 1 11.953-6.355z"
};
function _sfc_render$F(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$1h)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconRefresh = /* @__PURE__ */ _export_sfc(_sfc_main$1N, [["render", _sfc_render$F]]);
let globalId$D = 0;
const _sfc_main$1M = vue.defineComponent({
name: "OIconMinus",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-minus", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$D++
};
}
});
const _hoisted_1$1g = {
key: 0,
d: "m3.608 11.321.114-.009 16.555-.024a.7.7 0 0 1 .116 1.391l-.114.009-16.555.024a.7.7 0 0 1-.116-1.391"
};
function _sfc_render$E(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$1g)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconMinus = /* @__PURE__ */ _export_sfc(_sfc_main$1M, [["render", _sfc_render$E]]);
let globalId$C = 0;
const _sfc_main$1L = vue.defineComponent({
name: "OIconLoading",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-loading", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$C++
};
}
});
function _sfc_render$D(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock(
vue.Fragment,
{ key: 0 },
[
_cache[0] || (_cache[0] = vue.createElementVNode(
"path",
{
d: "M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1m0 2c-4.971 0-9 4.029-9 9s4.029 9 9 9 9-4.029 9-9-4.029-9-9-9",
opacity: ".15"
},
null,
-1
/* HOISTED */
)),
_cache[1] || (_cache[1] = vue.createElementVNode(
"path",
{ d: "M12 1c6.075 0 11 4.925 11 11a1 1 0 0 1-2 0 9 9 0 0 0-9-9 1 1 0 0 1 0-2" },
null,
-1
/* HOISTED */
))
],
64
/* STABLE_FRAGMENT */
)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconLoading = /* @__PURE__ */ _export_sfc(_sfc_main$1L, [["render", _sfc_render$D]]);
let globalId$B = 0;
const _sfc_main$1K = vue.defineComponent({
name: "OIconLink",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-link", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$B++
};
}
});
const _hoisted_1$1f = {
key: 0,
d: "M11.122 9.9a.7.7 0 0 0-.902-.083l-.088.073-.554.543-.142.147c-1.175 1.285-1.217 3.186-.113 4.412l.138.144 4.972 4.867.154.142c1.447 1.26 3.705 1.144 5.147-.268 1.456-1.425 1.564-3.66.274-5.08l-.144-.149-1.921-1.881-.085-.072a.7.7 0 0 0-.975.982l.075.086 1.929 1.889.115.123c.753.872.651 2.222-.249 3.103-.914.895-2.322.986-3.216.24l-.124-.112-4.977-4.873-.11-.119c-.576-.686-.527-1.715.103-2.444l.125-.133.541-.53.083-.093a.7.7 0 0 0-.058-.912zM9.303 3.945c-1.447-1.26-3.705-1.144-5.147.268-1.456 1.425-1.564 3.66-.274 5.08l.144.149 1.921 1.881.085.072a.7.7 0 0 0 .975-.982l-.075-.086-1.929-1.889-.115-.123c-.753-.872-.651-2.222.249-3.103.914-.895 2.322-.986 3.216-.24l.124.112 4.977 4.873.11.119c.576.686.527 1.715-.103 2.444l-.125.133-.541.53-.083.093a.701.701 0 0 0 .96.995l.088-.073.554-.543.142-.147c1.175-1.285 1.217-3.186.113-4.412l-.138-.144-4.972-4.867-.154-.142z"
};
function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$1f)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconLink = /* @__PURE__ */ _export_sfc(_sfc_main$1K, [["render", _sfc_render$C]]);
let globalId$A = 0;
const _sfc_main$1J = vue.defineComponent({
name: "OIconImageError",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-image-error", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$A++
};
}
});
const _hoisted_1$1e = {
key: 0,
d: "M9.075 4a.7.7 0 0 1 .095 1.394l-.095.006H3.9a.5.5 0 0 0-.492.41L3.4 5.9v11.769q0 .116.048.214l3.273-3.241a3.7 3.7 0 0 1 2.38-1.064l.224-.007h.487a.7.7 0 0 1 .095 1.394l-.095.006h-.487a2.3 2.3 0 0 0-1.47.531l-.149.135-2.557 2.532h7.032c.91-1.279 1.357-2.21 1.357-2.712 0-.192-.071-.453-.223-.822l-.151-.343-.418-.866-.163-.346-.128-.291c-.168-.401-.23-.656-.241-.95l-.002-.1c0-.29.03-.497.153-.808l.096-.225.204-.423.445-.872.124-.259.098-.228.042-.109c.108-.289.162-.53.162-.733 0-.664-.366-1.626-1.119-2.853a.7.7 0 0 1-.247-.531c0-.354.263-.647.605-.694l.095-.006h6.8a1.9 1.9 0 0 1 1.894 1.752l.006.148v11.769a1.9 1.9 0 0 1-1.752 1.894l-.148.006H3.896a1.9 1.9 0 0 1-.614-.101 1.9 1.9 0 0 1-1.28-1.65l-.006-.148V5.899a1.9 1.9 0 0 1 1.752-1.894l.148-.006h5.175zm5.863 4.084c0 .392-.088.791-.251 1.225a7 7 0 0 1-.287.656l-.511 1.006-.104.217-.076.172-.028.072-.04.122-.013.052-.013.092-.001.042q0 .065.018.15l.034.126.025.074.067.173.043.101.168.37.368.761c.41.855.603 1.407.603 1.963 0 .708-.359 1.597-1.067 2.711l5.802.001a.5.5 0 0 0 .492-.41l.008-.09V5.901a.5.5 0 0 0-.41-.492l-.09-.008h-5.548c.539 1.035.813 1.924.813 2.684zm-8.744-.679c.715 0 1.294.564 1.294 1.259s-.579 1.259-1.294 1.259S4.9 9.359 4.9 8.664s.579-1.259 1.294-1.259"
};
function _sfc_render$B(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$1e)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconImageError = /* @__PURE__ */ _export_sfc(_sfc_main$1J, [["render", _sfc_render$B]]);
let globalId$z = 0;
const _sfc_main$1I = vue.defineComponent({
name: "OIconFilter",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-filter", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$z++
};
}
});
const _hoisted_1$1d = {
key: 0,
d: "M18.295 3.2c.895 0 1.605.748 1.605 1.653 0 .309-.084.612-.242.874l-.085.127-1.476 1.999a.7.7 0 0 1-1.182-.744l.055-.088 1.476-1.999a.3.3 0 0 0 .054-.169c0-.123-.07-.217-.153-.245l-.052-.008H5.705a.18.18 0 0 0-.112.042c-.087.071-.116.206-.074.317l.034.063 5.01 6.783c.181.246.292.537.32.842l.007.153.018 4.918c0 .066.022.126.057.172l.039.04 1.816 1.43q.052.04.11.04c.088 0 .171-.074.197-.184l.008-.07-.024-6.336a1.7 1.7 0 0 1 .242-.879l.086-.128 2.149-2.909a.7.7 0 0 1 1.182.744l-.055.088-2.149 2.909a.3.3 0 0 0-.048.108l-.006.062.024 6.336c.003.905-.704 1.656-1.599 1.659a1.57 1.57 0 0 1-.857-.251l-.124-.089-1.816-1.43a1.66 1.66 0 0 1-.621-1.138l-.009-.169-.018-4.918a.3.3 0 0 0-.025-.118l-.029-.05-5.01-6.783a1.69 1.69 0 0 1 .278-2.295c.243-.199.536-.321.844-.351l.155-.008z"
};
function _sfc_render$A(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$1d)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconFilter = /* @__PURE__ */ _export_sfc(_sfc_main$1I, [["render", _sfc_render$A]]);
let globalId$y = 0;
const _sfc_main$1H = vue.defineComponent({
name: "OIconFile",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-file", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$y++
};
}
});
const _hoisted_1$1c = {
key: 0,
d: "M15.071 2.576c.223 0 .439.077.611.215l.098.09 3.963 4.192a.98.98 0 0 1 .259.546l.008.124v6.786a.7.7 0 0 1-1.394.095l-.006-.095-.001-6.302-2.137.001a1.9 1.9 0 0 1-1.894-1.752l-.006-.148-.001-2.353-8.781.013a.4.4 0 0 0-.392.32l-.008.081v15.233a.4.4 0 0 0 .321.392l.081.008 12.419-.018a.4.4 0 0 0 .392-.32l.008-.081v-2.446a.7.7 0 0 1 1.394-.095l.006.095v2.446c0 .944-.726 1.718-1.651 1.795l-.148.006-12.419.018a1.8 1.8 0 0 1-1.797-1.652l-.006-.148V4.388c0-.944.726-1.718 1.651-1.795l.148-.006 9.283-.013zm.365 12.759a.7.7 0 0 1 .095 1.394l-.095.006H8.563a.7.7 0 0 1-.095-1.394l.095-.006zm0-4.035a.7.7 0 0 1 .095 1.394l-.095.006H8.563a.7.7 0 0 1-.095-1.394l.095-.006zm-3.432-4.035a.7.7 0 0 1 .095 1.394l-.095.006H8.563a.7.7 0 0 1-.095-1.394l.095-.006zm5.58-.437-1.613-1.706.001 1.207a.5.5 0 0 0 .41.492l.09.008z"
};
function _sfc_render$z(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$1c)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconFile = /* @__PURE__ */ _export_sfc(_sfc_main$1H, [["render", _sfc_render$z]]);
let globalId$x = 0;
const _sfc_main$1G = vue.defineComponent({
name: "OIconEye",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-eye", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$x++
};
}
});
const _hoisted_1$1b = {
key: 0,
d: "M12.028 4.789c1.794 0 3.578.6 5.242 1.658a.7.7 0 0 1-.751 1.181c-1.453-.925-2.985-1.439-4.491-1.439-2.045 0-4.153.957-5.97 2.53-1.428 1.236-2.473 2.745-2.473 3.279 0 .536 1.04 2.047 2.461 3.283 1.809 1.574 3.91 2.531 5.955 2.531s4.146-.958 5.955-2.532c1.421-1.236 2.461-2.748 2.461-3.284 0-.448-.785-1.685-1.934-2.806a.7.7 0 1 1 .978-1.002c1.398 1.365 2.356 2.874 2.356 3.808 0 2.596-5.311 7.216-9.816 7.216s-9.816-4.62-9.816-7.214c0-2.589 5.338-7.208 9.843-7.208zm-.041 3.603a3.63 3.63 0 1 1 0 7.26 3.63 3.63 0 0 1 0-7.26m0 1.4a2.23 2.23 0 1 0-.001 4.459 2.23 2.23 0 0 0 .001-4.459"
};
function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$1b)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconEye = /* @__PURE__ */ _export_sfc(_sfc_main$1G, [["render", _sfc_render$y]]);
let globalId$w = 0;
const _sfc_main$1F = vue.defineComponent({
name: "OIconEyeOff",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-eye-off", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$w++
};
}
});
const _hoisted_1$1a = {
key: 0,
d: "M21.483 8.021a.753.753 0 0 1 .158 1.054 15.6 15.6 0 0 1-2.067 2.282.1.1 0 0 1 .021.022l2.054 2.439a.754.754 0 0 1-1.153.971l-2.054-2.439-.031-.042c-.79.581-1.63 1.077-2.499 1.46l.965 3.406a.753.753 0 0 1-1.449.411l-.935-3.301a9.2 9.2 0 0 1-2.543.371 9 9 0 0 1-1.52-.134l-.869 3.067a.753.753 0 1 1-1.449-.411l.858-3.028a12.4 12.4 0 0 1-2.935-1.459l-1.817 2.158a.754.754 0 0 1-1.153-.971l1.76-2.089A15.7 15.7 0 0 1 2.352 9.2a.753.753 0 1 1 1.201-.909c2.106 2.783 5.337 4.859 8.397 4.859 3.105 0 6.391-2.144 8.478-4.968a.753.753 0 0 1 1.054-.158z"
};
function _sfc_render$x(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$1a)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconEyeOff = /* @__PURE__ */ _export_sfc(_sfc_main$1F, [["render", _sfc_render$x]]);
let globalId$v = 0;
const _sfc_main$1E = vue.defineComponent({
name: "OIconEllipsis",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-ellipsis", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$v++
};
}
});
const _hoisted_1$19 = {
key: 0,
d: "M12 10.5a1.5 1.5 0 1 1-.001 3.001A1.5 1.5 0 0 1 12 10.5m-6.485 0a1.5 1.5 0 1 1-.001 3.001 1.5 1.5 0 0 1 .001-3.001m12.997 0a1.5 1.5 0 1 1-.001 3.001 1.5 1.5 0 0 1 .001-3.001"
};
function _sfc_render$w(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$19)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconEllipsis = /* @__PURE__ */ _export_sfc(_sfc_main$1E, [["render", _sfc_render$w]]);
let globalId$u = 0;
const _sfc_main$1D = vue.defineComponent({
name: "OIconEdit",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-edit", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$u++
};
}
});
const _hoisted_1$18 = {
key: 0,
d: "M20.047 19.523a.7.7 0 0 1 .095 1.394l-.095.006H4.532a.7.7 0 0 1-.095-1.394l.095-.006zm0-3.167a.7.7 0 0 1 .095 1.394l-.095.006h-6.47a.7.7 0 0 1-.095-1.394l.095-.006zM12.661 3.721a2.2 2.2 0 0 1 3.111 0l2.118 2.118a2.2 2.2 0 0 1 0 3.111l-8.058 8.058a2.2 2.2 0 0 1-1.489.643l-3.459.105a1 1 0 0 1-1.03-.969v-.03l.105-3.489a2.2 2.2 0 0 1 .643-1.489zm2.121.99a.8.8 0 0 0-1.131 0l-8.058 8.058a.8.8 0 0 0-.234.541l-.092 3.034 3.034-.092a.8.8 0 0 0 .449-.155l.092-.079L16.9 7.96a.8.8 0 0 0 0-1.131z"
};
function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$18)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconEdit = /* @__PURE__ */ _export_sfc(_sfc_main$1D, [["render", _sfc_render$v]]);
let globalId$t = 0;
const _sfc_main$1C = vue.defineComponent({
name: "OIconDoubleArrowUp",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-double-arrow-up", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$t++
};
}
});
const _hoisted_1$17 = {
key: 0,
d: "M18.055 17.738a.74.74 0 0 0-.002-1.022l-4.948-4.957a1.7 1.7 0 0 0-2.296.099q-.628.629-4.863 4.811l-.063.072a.7.7 0 0 0 1.053.918l4.863-4.811.054-.043a.3.3 0 0 1 .37.043l4.842 4.89.072.063a.7.7 0 0 0 .918-.063m0-5.303a.7.7 0 0 0 0-.99l-4.842-4.89-.108-.099c-.668-.563-1.634-.567-2.296.099q-.662.666-4.863 4.811l-.063.072a.7.7 0 0 0 1.053.918l4.863-4.811.054-.043a.3.3 0 0 1 .37.043l4.842 4.89.072.063a.7.7 0 0 0 .918-.063"
};
function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$17)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconDoubleArrowUp = /* @__PURE__ */ _export_sfc(_sfc_main$1C, [["render", _sfc_render$u]]);
let globalId$s = 0;
const _sfc_main$1B = vue.defineComponent({
name: "OIconDoubleArrowRight",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-double-arrow-right", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$s++
};
}
});
const _hoisted_1$16 = {
key: 0,
d: "M6.262 5.945a.74.74 0 0 1 1.022.002l4.957 4.948a1.7 1.7 0 0 1-.099 2.296q-.629.629-4.811 4.863l-.072.063a.7.7 0 0 1-.918-1.053l4.811-4.863.043-.054a.3.3 0 0 0-.043-.37l-4.89-4.842-.063-.072a.7.7 0 0 1 .063-.918m5.303 0a.7.7 0 0 1 .99 0l4.89 4.842.099.108c.563.668.567 1.634-.099 2.296q-.666.662-4.811 4.863l-.072.063a.7.7 0 0 1-.918-1.053l4.811-4.863.043-.054a.3.3 0 0 0-.043-.37l-4.89-4.842-.063-.072a.7.7 0 0 1 .063-.918"
};
function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$16)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconDoubleArrowRight = /* @__PURE__ */ _export_sfc(_sfc_main$1B, [["render", _sfc_render$t]]);
let globalId$r = 0;
const _sfc_main$1A = vue.defineComponent({
name: "OIconDoubleArrowLeft",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-double-arrow-left", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$r++
};
}
});
const _hoisted_1$15 = {
key: 0,
d: "M17.738 5.945a.74.74 0 0 0-1.022.002l-4.957 4.948a1.7 1.7 0 0 0 .099 2.296q.629.629 4.811 4.863l.072.063a.7.7 0 0 0 .918-1.053l-4.811-4.863-.043-.054a.3.3 0 0 1 .043-.37l4.89-4.842.063-.072a.7.7 0 0 0-.063-.918m-5.303 0a.7.7 0 0 0-.99 0l-4.89 4.842-.099.108c-.563.668-.567 1.634.099 2.296q.666.662 4.811 4.863l.072.063a.7.7 0 0 0 .918-1.053l-4.811-4.863-.043-.054a.3.3 0 0 1 .043-.37l4.89-4.842.063-.072a.7.7 0 0 0-.063-.918"
};
function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$15)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconDoubleArrowLeft = /* @__PURE__ */ _export_sfc(_sfc_main$1A, [["render", _sfc_render$s]]);
let globalId$q = 0;
const _sfc_main$1z = vue.defineComponent({
name: "OIconDoubleArrowDown",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-double-arrow-down", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$q++
};
}
});
const _hoisted_1$14 = {
key: 0,
d: "M18.055 6.262a.74.74 0 0 1-.002 1.022l-4.948 4.957a1.7 1.7 0 0 1-2.296-.099q-.628-.629-4.863-4.811l-.063-.072a.7.7 0 0 1 1.053-.918l4.863 4.811.054.043a.3.3 0 0 0 .37-.043l4.842-4.89.072-.063a.7.7 0 0 1 .918.063m0 5.303a.7.7 0 0 1 0 .99l-4.842 4.89-.108.099c-.668.563-1.634.567-2.296-.099q-.662-.666-4.863-4.811l-.063-.072a.7.7 0 0 1 1.053-.918l4.863 4.811.054.043a.3.3 0 0 0 .37-.043l4.842-4.89.072-.063a.7.7 0 0 1 .918.063"
};
function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$14)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconDoubleArrowDown = /* @__PURE__ */ _export_sfc(_sfc_main$1z, [["render", _sfc_render$r]]);
let globalId$p = 0;
const _sfc_main$1y = vue.defineComponent({
name: "OIconDone",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-done", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$p++
};
}
});
const _hoisted_1$13 = {
key: 0,
d: "M20.402 5.956a.7.7 0 0 1 1.063.904l-.074.087L10.9 17.412a1.45 1.45 0 0 1-1.936.101l-.11-.099-5.231-5.202a.7.7 0 0 1 .9-1.066l.087.074 5.231 5.202a.05.05 0 0 0 .048.013l.023-.013z"
};
function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$13)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconDone = /* @__PURE__ */ _export_sfc(_sfc_main$1y, [["render", _sfc_render$q]]);
let globalId$o = 0;
const _sfc_main$1x = vue.defineComponent({
name: "OIconDelete",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-delete", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$o++
};
}
});
const _hoisted_1$12 = {
key: 0,
d: "M19.154 5.295a.7.7 0 0 1 .095 1.394l-.095.006-12.201-.001.001 12.413c0 .17.12.311.28.344l.071.007h9.39a.35.35 0 0 0 .344-.28l.007-.071V8.637a.7.7 0 0 1 1.394-.095l.006.095v10.47c0 .919-.708 1.672-1.608 1.745l-.144.006h-9.39a1.75 1.75 0 0 1-1.745-1.608l-.006-.144-.001-12.413-.707.001A.7.7 0 0 1 4.75 5.3l.095-.006zm-9.143 4.449c.354 0 .647.263.694.605l.006.095v5.68a.7.7 0 0 1-1.394.095l-.006-.095v-5.68a.7.7 0 0 1 .7-.7m3.942 0c.354 0 .647.263.694.605l.006.095v5.68a.7.7 0 0 1-1.394.095l-.006-.095v-5.68a.7.7 0 0 1 .7-.7m-.301-6.555a.7.7 0 0 1 .095 1.394l-.095.006H9.68a.7.7 0 0 1-.095-1.394l.095-.006z"
};
function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$12)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconDelete = /* @__PURE__ */ _export_sfc(_sfc_main$1x, [["render", _sfc_render$p]]);
let globalId$n = 0;
const _sfc_main$1w = vue.defineComponent({
name: "OIconClose",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-close", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$n++
};
}
});
const _hoisted_1$11 = {
key: 0,
d: "M18.528 5.472a.7.7 0 0 1 .074.903l-.074.087L12.988 12l.006.006-.989.989-.006-.006-5.538 5.54a.7.7 0 0 1-1.064-.903l.074-.087L11.009 12 5.471 6.462l-.074-.087a.7.7 0 0 1 .977-.977l.087.074 5.538 5.539 5.539-5.539a.7.7 0 0 1 .99 0m-3.977 8.089 3.978 3.978.074.087a.7.7 0 0 1-.977.977l-.087-.074-3.978-3.978a.7.7 0 0 1 .99-.99"
};
function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$11)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconClose = /* @__PURE__ */ _export_sfc(_sfc_main$1w, [["render", _sfc_render$o]]);
let globalId$m = 0;
const _sfc_main$1v = vue.defineComponent({
name: "OIconChevronUp",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-chevron-up", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$m++
};
}
});
const _hoisted_1$10 = {
key: 0,
d: "M5.759 15.127a.7.7 0 0 0 .918.063l.072-.063 5.016-5.016a.3.3 0 0 1 .37-.043l.054.043 5.062 5.062a.7.7 0 0 0 1.053-.918l-.063-.072-5.062-5.062a1.7 1.7 0 0 0-2.296-.099l-.108.099-5.016 5.016a.7.7 0 0 0 0 .99"
};
function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$10)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconChevronUp = /* @__PURE__ */ _export_sfc(_sfc_main$1v, [["render", _sfc_render$n]]);
let globalId$l = 0;
const _sfc_main$1u = vue.defineComponent({
name: "OIconChevronRight",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-chevron-right", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$l++
};
}
});
const _hoisted_1$$ = {
key: 0,
d: "M9.246 5.764a.7.7 0 0 0-.063.918l.063.072 5.016 5.016a.3.3 0 0 1 .043.37l-.043.054L9.2 17.256a.7.7 0 0 0 .918 1.053l.072-.063 5.062-5.062a1.7 1.7 0 0 0 .099-2.296l-.099-.108-5.016-5.016a.7.7 0 0 0-.99 0"
};
function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$$)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconChevronRight = /* @__PURE__ */ _export_sfc(_sfc_main$1u, [["render", _sfc_render$m]]);
let globalId$k = 0;
const _sfc_main$1t = vue.defineComponent({
name: "OIconChevronLeft",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-chevron-left", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$k++
};
}
});
const _hoisted_1$_ = {
key: 0,
d: "M14.754 5.764a.7.7 0 0 1 .063.918l-.063.072-5.016 5.016a.3.3 0 0 0-.043.37l.043.054 5.062 5.062a.7.7 0 0 1-.918 1.053l-.072-.063-5.062-5.062a1.7 1.7 0 0 1-.099-2.296l.099-.108 5.016-5.016a.7.7 0 0 1 .99 0"
};
function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$_)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconChevronLeft = /* @__PURE__ */ _export_sfc(_sfc_main$1t, [["render", _sfc_render$l]]);
let globalId$j = 0;
const _sfc_main$1s = vue.defineComponent({
name: "OIconChevronDown",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-chevron-down", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$j++
};
}
});
const _hoisted_1$Z = {
key: 0,
d: "M5.759 8.873a.7.7 0 0 1 .918-.063l.072.063 5.016 5.016a.3.3 0 0 0 .37.043l.054-.043 5.062-5.062a.7.7 0 0 1 1.053.918l-.063.072-5.062 5.062a1.7 1.7 0 0 1-2.296.099l-.108-.099-5.016-5.016a.7.7 0 0 1 0-.99"
};
function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$Z)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconChevronDown = /* @__PURE__ */ _export_sfc(_sfc_main$1s, [["render", _sfc_render$k]]);
let globalId$i = 0;
const _sfc_main$1r = vue.defineComponent({
name: "OIconChevronDownBold",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-chevron-down-bold", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$i++
};
}
});
const _hoisted_1$Y = {
key: 0,
d: "m18.214 9.877-.03.032-4.95 4.95a1.75 1.75 0 0 1-2.432.042l-.043-.042-4.95-4.95a.75.75 0 0 1-.216-.461l-.003-.046v-.046a.75.75 0 0 1 1.248-.538l.032.03 4.596 4.597a.75.75 0 0 0 1.029.03l.032-.03 4.596-4.596a.75.75 0 0 1 1.28.51v.046a.75.75 0 0 1-.189.472"
};
function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$Y)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconChevronDownBold = /* @__PURE__ */ _export_sfc(_sfc_main$1r, [["render", _sfc_render$j]]);
let globalId$h = 0;
const _sfc_main$1q = vue.defineComponent({
name: "OIconChecked",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-checked", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$h++
};
}
});
const _hoisted_1$X = {
key: 0,
d: "M5.08 13.094a1.2 1.2 0 0 1-.062-1.698 1.21 1.21 0 0 1 1.699-.057l3.508 3.269 6.753-7.24a1.195 1.195 0 0 1 1.578-.154l.117.096c.485.452.505 1.218.061 1.695l-7.572 8.119-.104.096a1.194 1.194 0 0 1-1.475.06l-.117-.096z"
};
function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$X)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconChecked = /* @__PURE__ */ _export_sfc(_sfc_main$1q, [["render", _sfc_render$i]]);
let globalId$g = 0;
const _sfc_main$1p = vue.defineComponent({
name: "OIconCaretUp",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-caret-up", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$g++
};
}
});
const _hoisted_1$W = {
key: 0,
d: "m12.384 9.461 3.932 4.719a.5.5 0 0 1-.384.82H8.067a.5.5 0 0 1-.384-.82l3.932-4.719a.5.5 0 0 1 .768 0z"
};
function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$W)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconCaretUp = /* @__PURE__ */ _export_sfc(_sfc_main$1p, [["render", _sfc_render$h]]);
let globalId$f = 0;
const _sfc_main$1o = vue.defineComponent({
name: "OIconCaretRight",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-caret-right", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$f++
};
}
});
const _hoisted_1$V = {
key: 0,
d: "M14.539 11.616 9.82 7.684a.5.5 0 0 0-.82.384v7.865a.5.5 0 0 0 .82.384l4.719-3.932a.5.5 0 0 0 0-.768z"
};
function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$V)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconCaretRight = /* @__PURE__ */ _export_sfc(_sfc_main$1o, [["render", _sfc_render$g]]);
let globalId$e = 0;
const _sfc_main$1n = vue.defineComponent({
name: "OIconCaretLeft",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-caret-left", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$e++
};
}
});
const _hoisted_1$U = {
key: 0,
d: "m9.461 11.616 4.719-3.932a.5.5 0 0 1 .82.384v7.865a.5.5 0 0 1-.82.384l-4.719-3.932a.5.5 0 0 1 0-.768z"
};
function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$U)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconCaretLeft = /* @__PURE__ */ _export_sfc(_sfc_main$1n, [["render", _sfc_render$f]]);
let globalId$d = 0;
const _sfc_main$1m = vue.defineComponent({
name: "OIconCaretDown",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-caret-down", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$d++
};
}
});
const _hoisted_1$T = {
key: 0,
d: "m12.384 14.539 3.932-4.719a.5.5 0 0 0-.384-.82H8.067a.5.5 0 0 0-.384.82l3.932 4.719a.5.5 0 0 0 .768 0z"
};
function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$T)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconCaretDown = /* @__PURE__ */ _export_sfc(_sfc_main$1m, [["render", _sfc_render$e]]);
let globalId$c = 0;
const _sfc_main$1l = vue.defineComponent({
name: "OIconCalendar",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-calendar", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$c++
};
}
});
const _hoisted_1$S = {
key: 0,
d: "M6.463 4.976a.7.7 0 0 1 .095 1.394l-.095.006H4.471a.14.14 0 0 0-.13.093l-.007.043v1.856h15.329l.001-1.856a.14.14 0 0 0-.093-.13l-.043-.007h-2.055a.7.7 0 0 1-.095-1.394l.095-.006h2.055c.801 0 1.46.614 1.53 1.397l.006.14v12.359c0 .801-.614 1.46-1.397 1.53l-.14.006H4.47c-.801 0-1.46-.614-1.53-1.397l-.006-.14V6.511c0-.801.614-1.46 1.397-1.53l.14-.006zm13.201 4.792H4.335v9.103c0 .06.039.111.093.13l.043.007h15.057c.06 0 .111-.039.13-.093l.007-.043-.001-9.103zm-3.482 5.663a.7.7 0 0 1 .095 1.394l-.095.006H7.817a.7.7 0 0 1-.095-1.394l.095-.006zm0-3.346a.7.7 0 0 1 .095 1.394l-.095.006H7.817a.7.7 0 0 1-.095-1.394l.095-.006zm-.696-8.467c.354 0 .647.263.694.605l.006.095v2.804a.7.7 0 0 1-1.394.095l-.006-.095V4.318a.7.7 0 0 1 .7-.7m-6.937-.026c.354 0 .647.263.694.605l.006.095v2.804a.7.7 0 0 1-1.394.095l-.006-.095V4.292a.7.7 0 0 1 .7-.7m4.946 1.384a.7.7 0 0 1 .095 1.394l-.095.006H10.53a.7.7 0 0 1-.095-1.394l.095-.006z"
};
function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$S)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconCalendar = /* @__PURE__ */ _export_sfc(_sfc_main$1l, [["render", _sfc_render$d]]);
let globalId$b = 0;
const _sfc_main$1k = vue.defineComponent({
name: "OIconArrowUp",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-arrow-up", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$b++
};
}
});
const _hoisted_1$R = {
key: 0,
d: "m11.978 3.099-.005.002-.084.006a.7.7 0 0 0-.589.597l-.006.095v16.402a.7.7 0 0 0 1.394.095l.006-.095-.001-14.919 5.699 5.698a.7.7 0 0 0 1.064-.903l-.074-.087-6.539-6.539a1.2 1.2 0 0 0-.812-.351l-.037-.001zm-7.359 7.868a.7.7 0 0 0 .903.073l.087-.074 4.571-4.574a.7.7 0 0 0-.99-.99L4.619 9.976a.7.7 0 0 0 0 .99z"
};
function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$R)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconArrowUp = /* @__PURE__ */ _export_sfc(_sfc_main$1k, [["render", _sfc_render$c]]);
let globalId$a = 0;
const _sfc_main$1j = vue.defineComponent({
name: "OIconArrowRight",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-arrow-right", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$a++
};
}
});
const _hoisted_1$Q = {
key: 0,
d: "m20.901 12.022-.002.005-.006.084a.7.7 0 0 1-.597.589l-.095.006H3.799a.7.7 0 0 1-.095-1.394l.095-.006 14.919.001-5.698-5.699a.7.7 0 0 1 .903-1.064l.087.074 6.539 6.539c.225.225.342.517.351.812l.001.037zm-7.868 7.359a.7.7 0 0 1-.073-.903l.074-.087 4.574-4.571a.7.7 0 0 1 .99.99l-4.574 4.571a.7.7 0 0 1-.99 0z"
};
function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$Q)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconArrowRight = /* @__PURE__ */ _export_sfc(_sfc_main$1j, [["render", _sfc_render$b]]);
let globalId$9 = 0;
const _sfc_main$1i = vue.defineComponent({
name: "OIconArrowLeft",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-arrow-left", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$9++
};
}
});
const _hoisted_1$P = {
key: 0,
d: "m3.099 12.022.002.005.006.084a.7.7 0 0 0 .597.589l.095.006h16.402a.7.7 0 0 0 .095-1.394l-.095-.006-14.919.001 5.698-5.699a.7.7 0 0 0-.903-1.064l-.087.074-6.539 6.539a1.2 1.2 0 0 0-.351.812l-.001.037zm7.868 7.359a.7.7 0 0 0 .073-.903l-.074-.087-4.574-4.571a.7.7 0 0 0-.99.99l4.574 4.571a.7.7 0 0 0 .99 0z"
};
function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$P)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconArrowLeft = /* @__PURE__ */ _export_sfc(_sfc_main$1i, [["render", _sfc_render$a]]);
let globalId$8 = 0;
const _sfc_main$1h = vue.defineComponent({
name: "OIconArrowDown",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-arrow-down", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$8++
};
}
});
const _hoisted_1$O = {
key: 0,
d: "m11.978 20.901-.005-.002-.084-.006a.7.7 0 0 1-.589-.597l-.006-.095V3.799a.7.7 0 0 1 1.394-.095l.006.095-.001 14.919 5.699-5.698a.7.7 0 0 1 1.064.903l-.074.087-6.539 6.539a1.2 1.2 0 0 1-.812.351l-.037.001zm-7.359-7.868a.7.7 0 0 1 .903-.073l.087.074 4.571 4.574a.7.7 0 0 1-.99.99l-4.571-4.574a.7.7 0 0 1 0-.99z"
};
function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$O)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconArrowDown = /* @__PURE__ */ _export_sfc(_sfc_main$1h, [["render", _sfc_render$9]]);
let globalId$7 = 0;
const _sfc_main$1g = vue.defineComponent({
name: "OIconAdd",
svgType: "fill",
setup() {
const classNames = ["o-svg-icon", "o-icon-add", "type-fill"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$7++
};
}
});
const _hoisted_1$N = {
key: 0,
d: "m3.608 11.302.114-.009 7.583-.011.012-7.58a.7.7 0 0 1 1.391-.112l.009.114-.024 16.555a.7.7 0 0 1-1.391.112l-.009-.114.01-7.574-7.579.01-.114-.009a.7.7 0 0 1-.002-1.382m11.294-.026 5.374-.007.114.009a.7.7 0 0 1 .002 1.382l-.114.009-5.378.007a.7.7 0 0 1-.69-.584l-.009-.115c0-.387.314-.7.701-.701"
};
function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("path", _hoisted_1$N)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconAdd = /* @__PURE__ */ _export_sfc(_sfc_main$1g, [["render", _sfc_render$8]]);
let globalId$6 = 0;
const _sfc_main$1f = vue.defineComponent({
name: "OIconWarning",
svgType: "color",
setup() {
const classNames = ["o-svg-icon", "o-icon-warning", "type-color"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$6++
};
}
});
function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock(
vue.Fragment,
{ key: 0 },
[
_cache[0] || (_cache[0] = vue.createElementVNode(
"path",
{
fill: "currentColor",
d: "M21 12c0 4.971-4.029 9-9 9s-9-4.029-9-9 4.029-9 9-9 9 4.029 9 9"
},
null,
-1
/* HOISTED */
)),
_cache[1] || (_cache[1] = vue.createElementVNode(
"path",
{
fill: "#fff",
d: "M12 13.621a.433.433 0 0 1-.432-.404l-.367-5.441-.002-.054c0-.408.306-.745.701-.795l.1-.006.054.002c.441.03.775.412.745.853l-.367 5.441a.433.433 0 0 1-.432.404m0 3.15a1.1 1.1 0 1 1-.001-2.199A1.1 1.1 0 0 1 12 16.771"
},
null,
-1
/* HOISTED */
))
],
64
/* STABLE_FRAGMENT */
)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconWarning = /* @__PURE__ */ _export_sfc(_sfc_main$1f, [["render", _sfc_render$7]]);
let globalId$5 = 0;
const _sfc_main$1e = vue.defineComponent({
name: "OIconSuccess",
svgType: "color",
setup() {
const classNames = ["o-svg-icon", "o-icon-success", "type-color"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$5++
};
}
});
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock(
vue.Fragment,
{ key: 0 },
[
_cache[0] || (_cache[0] = vue.createElementVNode(
"path",
{
fill: "currentColor",
d: "M21 12c0 4.971-4.029 9-9 9s-9-4.029-9-9 4.029-9 9-9 9 4.029 9 9"
},
null,
-1
/* HOISTED */
)),
_cache[1] || (_cache[1] = vue.createElementVNode(
"path",
{
fill: "#fff",
d: "m16.21 8.679-5.225 5.212-.043.032c-.047.026-.12.016-.169-.032l-2.478-2.465-.076-.064a.6.6 0 0 0-.77.915l2.478 2.465.105.094a1.35 1.35 0 0 0 1.8-.096l5.225-5.212.064-.076a.601.601 0 0 0-.912-.774z"
},
null,
-1
/* HOISTED */
))
],
64
/* STABLE_FRAGMENT */
)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconSuccess = /* @__PURE__ */ _export_sfc(_sfc_main$1e, [["render", _sfc_render$6]]);
let globalId$4 = 0;
const _sfc_main$1d = vue.defineComponent({
name: "OIconSkill",
svgType: "color",
setup() {
const classNames = ["o-svg-icon", "o-icon-skill", "type-color"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$4++
};
}
});
function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 23 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock(
vue.Fragment,
{ key: 0 },
[
_cache[0] || (_cache[0] = vue.createElementVNode(
"path",
{
fill: "#303030",
d: "M11.706 20.287q-.111.064-.223.126l-.222.121q-.222.119-.442.228l-.22.107c-3.105 1.484-5.919 1.565-7.475.008-1.503-1.503-1.486-4.183-.122-7.195l.052-.115.792.367c-1.28 2.764-1.311 5.12-.105 6.326 1.374 1.374 4.234 1.128 7.421-.667l.11-.063zm4.717-3.726-.145.149-.147.148-.617-.617q.143-.142.281-.286c4.186-4.337 5.77-9.453 3.737-11.486-2.085-2.085-7.39-.364-11.773 4.018a21.4 21.4 0 0 0-2.465 2.94l-.139.203-.724-.487A22 22 0 0 1 7.142 7.87c4.679-4.679 10.468-6.557 13.007-4.018 2.48 2.48.748 8.075-3.726 12.71z"
},
null,
-1
/* HOISTED */
)),
_cache[1] || (_cache[1] = vue.createElementVNode(
"path",
{
fill: "#303030",
d: "M7.142 16.858c4.679 4.679 10.468 6.557 13.007 4.018 2.346-2.346.93-7.5-3.076-12.008a.437.437 0 0 0-.652.58c3.738 4.207 5.027 8.896 3.112 10.811-2.085 2.085-7.39.364-11.773-4.018a.437.437 0 0 0-.617.617zm-4.076-5.671a.437.437 0 0 0 .792-.368c-1.291-2.774-1.326-5.141-.117-6.35 1.368-1.368 4.208-1.132 7.385.647a.436.436 0 1 0 .426-.762q-.225-.125-.447-.242l-.222-.114q-.167-.084-.332-.162l-.22-.102-.11-.049-.218-.095a13 13 0 0 0-.648-.256l-.213-.076c-2.513-.868-4.71-.715-6.018.593-1.527 1.527-1.485 4.267-.058 7.336"
},
null,
-1
/* HOISTED */
)),
_cache[2] || (_cache[2] = vue.createElementVNode(
"path",
{
fill: "#303030",
d: "M15.515 15.879a1.576 1.576 0 1 0 0 3.152 1.576 1.576 0 0 0 0-3.152m0 .727a.848.848 0 1 1 0 1.696.848.848 0 0 1 0-1.696M16 6.424a1.576 1.576 0 1 0 0 3.152 1.576 1.576 0 0 0 0-3.152m0 .728a.848.848 0 1 1 0 1.696.848.848 0 0 1 0-1.696M3.879 10.788a1.576 1.576 0 1 0 0 3.152 1.576 1.576 0 0 0 0-3.152m0 .727a.848.848 0 1 1 0 1.696.848.848 0 0 1 0-1.696"
},
null,
-1
/* HOISTED */
)),
_cache[3] || (_cache[3] = vue.createElementVNode(
"path",
{
fill: "currentColor",
d: "M10.627 9.939h-.891a.767.767 0 0 0-.767.767v.891c0 .423.343.767.767.767h.891a.767.767 0 0 0 .767-.767v-.891a.767.767 0 0 0-.767-.767m-.891.485h.891c.156 0 .282.126.282.282v.891a.28.28 0 0 1-.282.282h-.891a.28.28 0 0 1-.282-.282v-.891c0-.156.126-.282.282-.282M13.536 12.606h-.891a.767.767 0 0 0-.767.767v.891c0 .423.343.767.767.767h.891a.767.767 0 0 0 .767-.767v-.891a.767.767 0 0 0-.767-.767m-.891.485h.891c.156 0 .282.126.282.282v.891a.28.28 0 0 1-.282.282h-.891a.28.28 0 0 1-.282-.282v-.891c0-.156.126-.282.282-.282M12.549 10.381l-.35.35a.767.767 0 0 0 0 1.084l.35.35a.767.767 0 0 0 1.084 0l.35-.35a.767.767 0 0 0 0-1.084l-.35-.35a.767.767 0 0 0-1.084 0m.741.343.35.35c.11.11.11.288 0 .398l-.35.35a.28.28 0 0 1-.398 0l-.35-.35a.28.28 0 0 1 0-.398l.35-.35c.11-.11.288-.11.398 0M10.627 12.606h-.891a.767.767 0 0 0-.767.767v.891c0 .423.343.767.767.767h.891a.767.767 0 0 0 .767-.767v-.891a.767.767 0 0 0-.767-.767m-.891.485h.891c.156 0 .282.126.282.282v.891a.28.28 0 0 1-.282.282h-.891a.28.28 0 0 1-.282-.282v-.891c0-.156.126-.282.282-.282"
},
null,
-1
/* HOISTED */
))
],
64
/* STABLE_FRAGMENT */
)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconSkill = /* @__PURE__ */ _export_sfc(_sfc_main$1d, [["render", _sfc_render$5]]);
let globalId$3 = 0;
const _sfc_main$1c = vue.defineComponent({
name: "OIconKunpeng",
svgType: "color",
setup() {
const classNames = ["o-svg-icon", "o-icon-kunpeng", "type-color"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$3++
};
}
});
const _hoisted_1$M = ["id"];
const _hoisted_2$y = {
fill: "none",
"fill-rule": "evenodd",
class: "kunpeng_svg__a备份"
};
const _hoisted_3$o = { class: "kunpeng_svg__编组" };
const _hoisted_4$k = { transform: "translate(62.681 13.353)" };
const _hoisted_5$d = ["id"];
const _hoisted_6$b = ["xlink:href"];
const _hoisted_7$6 = ["mask"];
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
"xmlns:xlink": "http://www.w3.org/1999/xlink",
viewBox: "0 0 68 28",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock(
vue.Fragment,
{ key: 0 },
[
vue.createElementVNode("defs", null, [
vue.createElementVNode("path", {
id: `kunpeng_svg__a_${_ctx.globalId}`,
d: "M.128.067h4.814V8.1H.128z",
class: "kunpeng_svg__path-1"
}, null, 8, _hoisted_1$M)
]),
vue.createElementVNode("g", _hoisted_2$y, [
vue.createElementVNode("g", _hoisted_3$o, [
_cache[0] || (_cache[0] = vue.createStaticVNode('<path fill="#C7000B" d="m6.778 11.377-1.043 2.924L1 13.497l5.582 3.984L26.856 1z" class="kunpeng_svg__Fill-1"></path><path fill="#DBDADA" d="m7.445 18.096 12.368 8.847-5.24-8.462L25.413 3.35z" class="kunpeng_svg__Fill-2"></path><path fill="#000" d="M27.366 11.615h1.223v3.774c.226-.295.443-.599.65-.885l2.048-2.889h1.37l-2.454 3.305 2.663 4.199h-1.388l-2.047-3.314-.842.946v2.368h-1.223z" class="kunpeng_svg__Fill-3"></path><path fill="#000" d="M33.872 18.685c-.278-.347-.425-.876-.425-1.57v-3.591h1.197v3.504c0 .408.07.711.208.894.148.19.356.277.633.277.477 0 .937-.251 1.38-.763v-3.912h1.205v4.19c0 .468.009.936.044 1.405h-1.12a7 7 0 0 1-.103-.86c-.165.192-.33.348-.486.478a2.1 2.1 0 0 1-.573.338 1.8 1.8 0 0 1-.737.148c-.53 0-.937-.182-1.223-.538" class="kunpeng_svg__Fill-5"></path><path fill="#000" d="M39.614 14.955c0-.53-.009-.998-.034-1.431h1.127q.027.182.052.442c.018.173.035.312.043.434q.237-.3.486-.495c.157-.139.347-.251.564-.347.226-.086.468-.139.746-.139.52 0 .92.183 1.206.538.286.365.425.885.425 1.579v3.583h-1.197v-3.496c0-.79-.286-1.189-.842-1.189-.26 0-.494.07-.72.217a3.2 3.2 0 0 0-.65.573v3.895h-1.206z" class="kunpeng_svg__Fill-7"></path><path fill="#000" d="M48.86 17.748q.366-.52.365-1.535c0-.625-.104-1.076-.303-1.362a.96.96 0 0 0-.816-.417c-.234 0-.451.061-.65.174-.2.121-.382.277-.564.468v3.002c.121.06.26.104.416.147.165.035.321.052.477.052.469 0 .824-.173 1.076-.529m-3.174-2.854c0-.416-.017-.867-.043-1.37h1.136c.044.234.07.468.087.71.468-.537 1.006-.814 1.613-.814.356 0 .677.095.98.286.295.19.538.485.72.893.191.4.278.92.278 1.544q0 .973-.312 1.675c-.208.46-.504.806-.885 1.05a2.43 2.43 0 0 1-1.31.355 3 3 0 0 1-1.058-.191v2.307l-1.206.113z" class="kunpeng_svg__Fill-9"></path><path fill="#000" d="M54.75 15.675c-.017-.451-.13-.78-.312-1.006q-.283-.339-.763-.339a1 1 0 0 0-.763.339c-.2.225-.339.563-.4 1.006zm1.18.807h-3.452c.06 1.17.581 1.76 1.579 1.76q.375-.002.763-.095c.26-.07.503-.156.746-.26l.26.876c-.59.304-1.249.46-1.986.46-.564 0-1.032-.113-1.414-.339a2.06 2.06 0 0 1-.867-.971c-.2-.425-.295-.928-.295-1.518 0-.625.104-1.154.312-1.596q.302-.675.85-1.024a2.33 2.33 0 0 1 1.275-.356c.494 0 .91.13 1.25.374.329.251.58.572.736.988.165.408.243.868.243 1.362z" class="kunpeng_svg__Fill-11"></path><path fill="#000" d="M57.101 14.955c0-.53-.008-.998-.034-1.431h1.127q.027.182.052.442c.018.173.035.312.044.434q.236-.3.485-.495c.157-.139.347-.251.564-.347.226-.086.469-.139.746-.139.52 0 .92.183 1.206.538.286.365.425.885.425 1.579v3.583h-1.197v-3.496c0-.79-.286-1.189-.85-1.189-.252 0-.486.07-.712.217q-.324.21-.65.573v3.895h-1.206z" class="kunpeng_svg__Fill-13"></path>', 8)),
vue.createElementVNode("g", _hoisted_4$k, [
vue.createElementVNode("mask", {
id: `kunpeng_svg__b_${_ctx.globalId}`,
fill: "#fff",
class: "kunpeng_svg__mask-2"
}, [
vue.createElementVNode("use", {
"xlink:href": `#kunpeng_svg__a_${_ctx.globalId}`
}, null, 8, _hoisted_6$b)
], 8, _hoisted_5$d),
vue.createElementVNode("path", {
mask: `url(#kunpeng_svg__b_${_ctx.globalId})`,
fill: "#000",
d: "M3.146 4.656a2.1 2.1 0 0 0 .556-.469V1.273a2 2 0 0 0-.46-.2 2.1 2.1 0 0 0-.52-.07c-.278 0-.512.079-.72.244-.209.156-.365.399-.478.72-.112.312-.173.711-.173 1.17 0 .6.104 1.033.303 1.31q.302.407.772.408c.26 0 .504-.069.72-.2M1.342 7.962a6 6 0 0 1-.876-.33l.26-.928c.564.286 1.102.434 1.614.434.442 0 .78-.122 1.015-.356s.347-.625.347-1.162v-.573a2.8 2.8 0 0 1-.686.599 1.74 1.74 0 0 1-.902.225 1.83 1.83 0 0 1-.997-.286c-.295-.182-.538-.477-.72-.885-.182-.399-.27-.92-.27-1.535 0-.634.096-1.189.296-1.648q.3-.701.859-1.076c.381-.243.824-.373 1.353-.373q.352 0 .676.104.339.09.573.26l.251-.26h.807q-.041.702-.043 1.38v4.128q0 .78-.312 1.327a2 2 0 0 1-.86.816c-.364.182-.78.278-1.24.278q-.676.002-1.145-.14",
class: "kunpeng_svg__Fill-15"
}, null, 8, _hoisted_7$6)
])
])
])
],
64
/* STABLE_FRAGMENT */
)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconKunpeng = /* @__PURE__ */ _export_sfc(_sfc_main$1c, [["render", _sfc_render$4]]);
let globalId$2 = 0;
const _sfc_main$1b = vue.defineComponent({
name: "OIconInfo",
svgType: "color",
setup() {
const classNames = ["o-svg-icon", "o-icon-info", "type-color"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$2++
};
}
});
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock(
vue.Fragment,
{ key: 0 },
[
_cache[0] || (_cache[0] = vue.createElementVNode(
"path",
{
fill: "currentColor",
d: "M21 12c0 4.971-4.029 9-9 9s-9-4.029-9-9 4.029-9 9-9 9 4.029 9 9"
},
null,
-1
/* HOISTED */
)),
_cache[1] || (_cache[1] = vue.createElementVNode(
"path",
{
fill: "#fff",
d: "M12 10.433a.6.6 0 0 0-.6.6v5.5l.008.099a.6.6 0 0 0 1.192-.099v-5.5l-.008-.099a.6.6 0 0 0-.592-.501M12 7.3a1.1 1.1 0 1 0-.001 2.199A1.1 1.1 0 0 0 12 7.3"
},
null,
-1
/* HOISTED */
))
],
64
/* STABLE_FRAGMENT */
)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$1b, [["render", _sfc_render$3]]);
let globalId$1 = 0;
const _sfc_main$1a = vue.defineComponent({
name: "OIconDanger",
svgType: "color",
setup() {
const classNames = ["o-svg-icon", "o-icon-danger", "type-color"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId$1++
};
}
});
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 24 24",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock(
vue.Fragment,
{ key: 0 },
[
_cache[0] || (_cache[0] = vue.createElementVNode(
"path",
{
fill: "currentColor",
d: "M21 12c0 4.971-4.029 9-9 9s-9-4.029-9-9 4.029-9 9-9 9 4.029 9 9"
},
null,
-1
/* HOISTED */
)),
_cache[1] || (_cache[1] = vue.createElementVNode(
"path",
{
fill: "#fff",
d: "M12.989 12.989a.6.6 0 0 1 .766-.069l.083.069 2.271 2.271.032.035a.599.599 0 0 1-.765.902l-.084-.06-.035-.032-2.268-2.268a.6.6 0 0 1-.113-.689l.049-.084.064-.076zM7.895 7.895a.6.6 0 0 1 .727-.094l.086.062.035.032L12 11.151l3.257-3.256a.6.6 0 0 1 .674-.122l.091.052.083.069a.6.6 0 0 1 .092.73l-.06.084-.032.035-7.362 7.362a.601.601 0 0 1-.941-.73l.06-.084.032-.035 3.256-3.258-3.291-3.294a.6.6 0 0 1 .035-.81z"
},
null,
-1
/* HOISTED */
))
],
64
/* STABLE_FRAGMENT */
)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconDanger = /* @__PURE__ */ _export_sfc(_sfc_main$1a, [["render", _sfc_render$2]]);
let globalId = 0;
const _sfc_main$19 = vue.defineComponent({
name: "OIconAscend",
svgType: "color",
setup() {
const classNames = ["o-svg-icon", "o-icon-ascend", "type-color"];
const isClient2 = vue.ref(false);
vue.onMounted(() => {
isClient2.value = true;
});
return {
isClient: isClient2,
classNames,
globalId: globalId++
};
}
});
const _hoisted_1$L = {
key: 0,
fill: "none",
"fill-rule": "nonzero",
class: "ascend_svg__st_logo_dh_ascend"
};
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock(
"svg",
{
viewBox: "0 0 68 28",
class: vue.normalizeClass(_ctx.classNames)
},
[
_ctx.isClient ? (vue.openBlock(), vue.createElementBlock("g", _hoisted_1$L, _cache[0] || (_cache[0] = [
vue.createStaticVNode('<path fill="#040000" d="M52.442 13.264h-.772c-1.356.003-2.456.988-2.468 2.207l-.03 4.207h1.22v-4.125c0-.31.137-.608.38-.827.244-.22.575-.343.92-.343l.637.01c.733.012 1.32.549 1.322 1.208v4.073h1.223v-4.228a2.08 2.08 0 0 0-.714-1.544 2.57 2.57 0 0 0-1.718-.638" class="ascend_svg__path1"></path><path fill="#040000" d="M60.857 10.414v2.858a2.79 2.79 0 0 0-1.97-.784c-1.851 0-3.3 1.576-3.3 3.587s1.449 3.603 3.3 3.603c.727.015 1.43-.26 1.97-.769v.71H62v-9.205zm-1.97 3.274c1.326 0 1.93 1.239 1.93 2.387 0 1.149-.604 2.388-1.93 2.388-1.209 0-2.166-1.05-2.166-2.388s.95-2.394 2.167-2.394z" class="ascend_svg__形状"></path><path fill="#040000" d="m32.445 15.772-.425-.082c-.85-.163-1.151-.383-1.151-.703 0-.369.567-.637 1.16-.637.592 0 1.102.26 1.102.712v.215h1.449v-.215c0-1.126-1.039-1.798-2.55-1.798-1.43 0-2.608.726-2.608 1.723 0 .912.827 1.494 2.248 1.777l.403.075c1.26.24 1.366.574 1.366.882 0 .515-.576.875-1.398.875s-1.382-.43-1.382-1.024v-.214h-1.44v.214c0 1.237 1.166 2.106 2.833 2.106s2.868-.821 2.868-1.953c-.009-1.284-1.194-1.698-2.475-1.953M47.29 18.161c-.386.29-.991.438-1.798.438-1.084 0-1.958-.674-2.176-1.684l-.019-.087h-1.251l.013.12c.065.724.427 1.403 1.018 1.909.658.534 1.521.828 2.415.821 1.094 0 1.975-.236 2.623-.701l.345-.247-.89-.786zM47.49 13.602c-.629-.646-1.446-1.019-2.301-1.05-1.623 0-2.901 1.288-3.126 3.127l-.017.141h1.139l.017-.1c.207-1.14 1.006-1.905 1.987-1.905.972.003 1.82.735 2.063 1.78h-1.116v1.233h2.298l.023-.589c.039-.993-.314-1.956-.967-2.637" class="ascend_svg__路径"></path><path fill="#040000" d="M44.184 16.115h1.425v1h-1.425z" class="ascend_svg__矩形"></path><path fill="#040000" d="m25.06 10.414-3.68 9.258h1.418l1.076-3.03h2.852l1.083 3.036h1.41l-3.532-9.256zm1.232 5h-1.97l.942-2.425a.064.064 0 0 1 .064-.041.07.07 0 0 1 .066.04z" class="ascend_svg__形状"></path><path fill="#040000" d="M38.483 14.505c.581.042 1.12.35 1.481.846l.037.051h1.332l-.082-.189c-.521-1.156-1.586-1.905-2.768-1.949zM36.817 16.115c.11-.861.78-1.56 1.666-1.74v-1.11c-1.549.158-2.753 1.362-2.85 2.85zM40.74 17.665l-.037.051a2.21 2.21 0 0 1-2.254.812 2.13 2.13 0 0 1-1.645-1.7h-1.172c.169 1.67 1.504 2.85 3.297 2.85 1.412 0 2.554-.693 3.048-1.852l.069-.161z" class="ascend_svg__路径"></path><path fill="#C31D20" d="M7.553 17.76c3.302-3.788 6.674-6.125 9.55-7.192l-.021-5.683a.94.94 0 0 0-.612-.83.915.915 0 0 0-.99.245l-2.522 2.771-12.59 14.42a1.5 1.5 0 0 0-.295 1.448c.163.502.576.877 1.085.984a1.44 1.44 0 0 0 1.38-.463l5.009-5.691z" class="ascend_svg__路径"></path><path fill="#C31D20" d="m10.69 16.093 4.41 5.46c.351.287.84.344 1.25.146s.662-.614.644-1.062l.11-6.617c-2.542-.261-4.627.693-6.414 2.073" class="ascend_svg__路径"></path>', 8)
]))) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
}
const OIconAscend = /* @__PURE__ */ _export_sfc(_sfc_main$19, [["render", _sfc_render$1]]);
vue.shallowRef(OIconArrowUp);
vue.shallowRef(OIconArrowDown);
const IconArrowLeft = vue.shallowRef(OIconArrowLeft);
const IconArrowRight = vue.shallowRef(OIconArrowRight);
const IconChevronUp = vue.shallowRef(OIconChevronUp);
const IconChevronDown = vue.shallowRef(OIconChevronDown);
const IconChevronDownBold = vue.shallowRef(OIconChevronDownBold);
const IconChevronLeft = vue.shallowRef(OIconChevronLeft);
const IconChevronRight = vue.shallowRef(OIconChevronRight);
const IconInfo = vue.shallowRef(OIconInfo);
const IconSuccess = vue.shallowRef(OIconSuccess);
const IconWarning = vue.shallowRef(OIconWarning);
const IconDanger = vue.shallowRef(OIconDanger);
const IconLoading = vue.shallowRef(OIconLoading);
const IconLinkPrefix = vue.shallowRef(OIconLink);
const IconLinkArrow = vue.shallowRef(OIconArrowRight);
const IconDone = vue.shallowRef(OIconDone);
const IconClose = vue.shallowRef(OIconClose);
const IconAdd = vue.shallowRef(OIconAdd);
const IconMinus = vue.shallowRef(OIconMinus);
const IconEllipsis = vue.shallowRef(OIconEllipsis);
const IconStar = vue.shallowRef(OIconStar);
const IconRefresh = vue.shallowRef(OIconRefresh);
const IconDelete = vue.shallowRef(OIconDelete);
const IconPreview = vue.shallowRef(OIconEye);
const IconFile = vue.shallowRef(OIconFile);
const IconEdit = vue.shallowRef(OIconEdit);
const IconEyeOn = vue.shallowRef(OIconEye);
const IconEyeOff = vue.shallowRef(OIconEyeOff);
const IconImageError = vue.shallowRef(OIconImageError);
const IconVideoPlay = vue.shallowRef(OIconVideoPlay);
const IconChecked = vue.shallowRef(OIconChecked);
vue.shallowRef(OIconCalendar);
vue.shallowRef(OIconDoubleArrowLeft);
vue.shallowRef(OIconDoubleArrowRight);
vue.shallowRef(OIconChevronLeft);
vue.shallowRef(OIconChevronRight);
function initIconLoading(icon) {
IconLoading.value = icon;
}
function initIconLinkPrefix(icon) {
IconLinkPrefix.value = icon;
}
function initIconLinkArrow(icon) {
IconLinkArrow.value = icon;
}
function initIconClose(icon) {
IconClose.value = icon;
}
function initIconAdd(icon) {
IconAdd.value = icon;
}
function initIconMinus(icon) {
IconMinus.value = icon;
}
function initIconChevronUp(icon) {
IconChevronUp.value = icon;
}
function initIconChevronDown(icon) {
IconChevronDown.value = icon;
}
function initIconChevronLeft(icon) {
IconChevronLeft.value = icon;
}
function initIconChevronRight(icon) {
IconChevronRight.value = icon;
}
function initIconDone(icon) {
IconDone.value = icon;
}
function initIconEllipsis(icon) {
IconEllipsis.value = icon;
}
function initIconStar(icon) {
IconStar.value = icon;
}
function initIconVideoPlay(icon) {
IconVideoPlay.value = icon;
}
const observerPool = /* @__PURE__ */ new WeakMap();
let instance = null;
function createObserverInstance$1() {
if (!instance) {
const observer = new ResizeObserver((entries) => {
entries.forEach((entry) => {
var _a;
const ele = entry.target;
const ins = observerPool.get(ele);
if (!ins) {
return;
}
(_a = ins == null ? void 0 : ins.callbacks) == null ? void 0 : _a.forEach((fn) => fn(entry, ins.isFirst));
if (ins.isFirst) {
ins.isFirst = false;
}
});
});
instance = {
observer,
record: 0
};
}
return instance;
}
function useResizeObserver() {
const instance2 = createObserverInstance$1();
return {
/**
* 监听实例
*/
observer: instance2,
/**
* 创建监听实例
* el: 监听元素
* listener: resize回调, 移除监听时需要指定该监听函数
*/
observe: (el, listener2) => {
if (!el || !isFunction(listener2)) {
return null;
}
const val = observerPool.get(el);
if (val) {
val.callbacks.push(listener2);
} else {
instance2.observer.observe(el);
instance2.record++;
observerPool.set(el, {
element: el,
callbacks: [listener2],
isFirst: true
});
}
return instance2;
},
/**
* 移除监听
* el: 要移除监听的元素
* listener: 要移除的监听函数,如果不传,则使用初始化时的onResize回调
*/
unobserve: (el, listener2) => {
if (!el || !isFunction(listener2) || !instance2) {
return;
}
const val = observerPool.get(el);
if (val) {
const idx = val.callbacks.indexOf(listener2);
val.callbacks.splice(idx, 1);
if (val.callbacks.length === 0) {
instance2.observer.unobserve(el);
observerPool.delete(el);
instance2.record--;
if (instance2.record === 0) {
instance2.observer.disconnect();
}
}
}
},
destroy() {
instance2.observer.disconnect();
}
};
}
const defaultKey = {};
const instancePool = /* @__PURE__ */ new WeakMap();
function createObserverInstance(options) {
let instance2 = instancePool.get(options || defaultKey);
if (!instance2) {
const observer = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
var _a;
const ele = entry.target;
const ins = instance2 == null ? void 0 : instance2.elementPool.get(ele);
if (!ins) {
return;
}
(_a = ins == null ? void 0 : ins.callbacks) == null ? void 0 : _a.forEach((fn) => fn(entry, entry.isIntersecting));
});
}, options);
const elementPool = /* @__PURE__ */ new WeakMap();
instance2 = {
observer,
record: 0,
elementPool
};
instancePool.set(options || defaultKey, instance2);
}
return instance2;
}
function useIntersectionObserver(options) {
const instance2 = createObserverInstance(options);
return {
/**
* 监听实例
*/
observer: instance2.observer,
/**
* 创建监听实例
* el: 添加监听的元素
* listener: 进入视口回调, 移除监听时需要指定该监听函数
*/
observe: (el, listener2) => {
if (!el || !isFunction(listener2)) {
return null;
}
const val = instance2.elementPool.get(el);
if (val) {
val.callbacks.push(listener2);
} else {
instance2.observer.observe(el);
instance2.record++;
instance2.elementPool.set(el, {
element: el,
callbacks: [listener2]
});
}
return instance2.observer;
},
/**
* 移除对某元素的监听
* el: 要移除监听的元素
* listener: 要移除的监听函数,如果不传,则使用初始化时的回调
*/
unobserve: (el, listener2) => {
if (!el || !isFunction(listener2) || !instance2) {
return;
}
const val = instance2.elementPool.get(el);
if (val) {
const idx = val.callbacks.indexOf(listener2);
val.callbacks.splice(idx, 1);
if (val.callbacks.length === 0) {
instance2.observer.unobserve(el);
instance2.elementPool.delete(el);
instance2.record--;
if (instance2.record === 0) {
instance2.observer.disconnect();
}
}
}
},
/**
* 销毁观察器
*/
destroy() {
instance2.observer.disconnect();
}
};
}
function useElementDirective(onElementChange) {
const directive = {
mounted(el) {
onElementChange(el, "mounted");
},
updated(el) {
onElementChange(el, "updated");
},
unmounted() {
onElementChange(null, "unmounted");
}
};
return {
getElementDirective: directive
};
}
let ro$1 = null;
function useReiszeObserverDirective(onResize) {
return {
vResizeObserver: {
beforeMount() {
ro$1 = useResizeObserver();
},
mounted(el) {
if (isFunction(onResize)) {
ro$1 == null ? void 0 : ro$1.observe(el, onResize);
}
},
unmounted(el) {
if (onResize) {
ro$1 == null ? void 0 : ro$1.unobserve(el, onResize);
}
}
}
};
}
let io$1 = null;
function useIntersectionObserverDirective({
listener: listener2,
removeOnUnmounted
}) {
return {
vIntersectionObserver: {
beforeMount() {
io$1 = useIntersectionObserver();
},
mounted(el) {
if (isFunction(listener2)) {
io$1 == null ? void 0 : io$1.observe(el, listener2);
}
},
unmounted(el) {
if (listener2 && removeOnUnmounted) {
io$1 == null ? void 0 : io$1.unobserve(el, listener2);
}
}
}
};
}
const THEME_KEY = "__theme__";
function useTheme(defaultTheme = "light") {
if (!isClient) {
return {
theme: vue.ref(defaultTheme)
};
}
const currentTheme = vue.ref(localStorage.getItem(THEME_KEY) || defaultTheme);
vue.watchEffect(() => {
const theme = currentTheme.value;
document.documentElement.dataset.oTheme = theme;
localStorage.setItem(THEME_KEY, theme);
});
return {
theme: currentTheme
};
}
const DEFAULT_SCREEN_SIZE = 0;
const useScreen = () => {
const width = vue.ref(isClient ? window.innerWidth : DEFAULT_SCREEN_SIZE);
const isPhoneSize = vue.computed(() => {
if (isClient) {
return width.value <= mediaPoint.value.phone;
}
return false;
});
const isPadSize = vue.computed(() => {
if (isClient) {
return width.value > mediaPoint.value.phone && width.value <= mediaPoint.value.pad;
}
return false;
});
const isPhonePad = vue.computed(() => {
return isTouchDevice && (isPadSize.value || isPhoneSize.value);
});
const onResize = () => {
width.value = window.innerWidth;
};
vue.onMounted(() => {
window.addEventListener("resize", onResize);
});
vue.onUnmounted(() => {
window.removeEventListener("resize", onResize);
});
return {
isTouchDevice,
isPhoneSize,
isPadSize,
isPhonePad
};
};
const elList = /* @__PURE__ */ new Map();
const elListFast = /* @__PURE__ */ new Map();
let isBindEvent = false;
const Event$1 = {
start: isTouchDevice ? "touchstart" : "mousedown",
end: isTouchDevice ? "touchend" : "mouseup"
};
function addListener(el, fn, params) {
const list = (params == null ? void 0 : params.fast) ? elListFast : elList;
if (!list.has(el)) {
list.set(el, []);
}
const handlers = list.get(el);
if (handlers) {
handlers.push({
handler: fn,
exception: params == null ? void 0 : params.exception
});
}
}
function removeListener(el, listener2) {
if (listener2) {
const handlers = elList.get(el);
if (!handlers) {
return;
}
const idx = handlers.findIndex((item) => item.handler === listener2);
if (idx > -1) {
handlers.splice(idx, 1);
}
} else {
elList.delete(el);
}
}
function bindEvents() {
if (!isBindEvent) {
let isOutSide = false;
const runHandlers = (list, e) => {
list.forEach((handlers, el) => {
if (!el.contains(e.target)) {
handlers.forEach((item) => {
if (!item.exception || !item.exception(e)) {
item.handler();
}
});
}
});
};
window.addEventListener(Event$1.start, (e) => {
runHandlers(elListFast, e);
const keys = Array.from(elList.keys());
isOutSide = false;
keys.some((el) => {
if (!el.contains(e.target)) {
const handlers = elList.get(el);
if (!handlers) {
isOutSide = true;
} else {
isOutSide = handlers.some((item) => {
return !item.exception || !item.exception(e);
});
}
}
return isOutSide;
});
});
window.addEventListener(Event$1.end, (e) => {
if (!isOutSide) {
return;
}
runHandlers(elList, e);
});
isBindEvent = true;
}
}
function useOutClick() {
bindEvents();
return {
addListener,
removeListener
};
}
let out = null;
const vOutClick = {
beforeMount(el, binding) {
out = useOutClick();
out == null ? void 0 : out.addListener(el, binding.value, {
fast: binding.modifiers.fast
});
},
unmounted(el) {
out == null ? void 0 : out.removeListener(el);
}
};
const vFocus = {
mounted(el) {
el.focus();
}
};
let io = null;
let listener$1 = () => null;
const vIntersection = {
beforeMount() {
io = useIntersectionObserver();
},
mounted(el, binding) {
if (isFunction(binding.value)) {
listener$1 = binding.value;
io == null ? void 0 : io.observe(el, listener$1);
}
},
unmounted(el) {
if (listener$1) {
io == null ? void 0 : io.unobserve(el, listener$1);
}
}
};
let listener = () => null;
let ro = null;
const vOnResize = {
beforeMount() {
ro = useResizeObserver();
},
mounted(el, binding) {
if (isFunction(binding.value)) {
listener = binding.value;
ro == null ? void 0 : ro.observe(el, listener);
}
},
unmounted(el) {
if (listener) {
ro == null ? void 0 : ro.unobserve(el, listener);
}
}
};
const getUId = uniqueId;
const vUid = {
created(el, binding) {
const value = binding.value;
if (isFunction(value)) {
value(el, el.id || uniqueId());
} else if (isString(value) || isNumber(value)) {
el.setAttribute("id", String(value));
} else if (!el.id) {
el.setAttribute("id", uniqueId());
}
}
};
const intersectionObserver = vue.defineComponent({
name: "OIntersectionObserver",
emits: ["intersection"],
setup(_props, { emit, slots }) {
const { vIntersectionObserver } = useIntersectionObserverDirective({
listener: (entry) => {
emit("intersection", entry.isIntersecting, entry);
},
removeOnUnmounted: false
});
return () => {
var _a;
const children = (_a = slots.default) == null ? void 0 : _a.call(slots);
return children == null ? void 0 : children.map((item) => vue.withDirectives(vue.cloneVNode(item), [[vIntersectionObserver]]));
};
}
});
function easeInOutCubic(current, start, end, duration) {
let elapsed = end - start;
let time = current / (duration / 2);
if (time < 1) {
return elapsed / 2 * time * time * time + start;
}
time -= 2;
return elapsed / 2 * (time * time * time + 2) + start;
}
function isDocument(val) {
return val instanceof Document || (val == null ? void 0 : val.constructor.name) === "HTMLDocument";
}
function isHtmlElement(el) {
if (typeof HTMLElement === "object") {
return el instanceof HTMLElement;
} else if (el && typeof el === "object") {
const ele = el;
return (ele.nodeType === 1 || ele.nodeType === 9) && typeof ele.nodeName === "string";
}
return false;
}
function getOffsetElement(el) {
const offsetEl = el.offsetParent;
if (offsetEl && offsetEl.tagName === "BODY") {
const stylePosition = window.getComputedStyle(document.body).getPropertyValue("position");
if (stylePosition === "static") {
return document.documentElement;
}
}
return offsetEl;
}
function getScroll(el) {
const rlt = {
scrollLeft: 0,
scrollTop: 0
};
if (!el) {
return rlt;
}
if (isWindow(el)) {
rlt.scrollLeft = window.scrollX;
rlt.scrollTop = window.scrollY;
} else if (isDocument(el)) {
rlt.scrollLeft = el.documentElement.scrollLeft;
rlt.scrollTop = el.documentElement.scrollTop;
} else {
rlt.scrollLeft = el.scrollLeft;
rlt.scrollTop = el.scrollTop;
}
return rlt;
}
function getScrollParents(el) {
const parents = [];
let ele = el;
while (ele && ele !== document.documentElement) {
const { offsetHeight, offsetWidth, scrollHeight, scrollWidth } = ele;
if (offsetHeight < scrollHeight || offsetWidth < scrollWidth) {
parents.push(ele);
}
ele = ele.parentElement;
}
return parents;
}
function getElementSize(el) {
return {
width: el.innerWidth || el.clientWidth,
height: el.innerHeight || el.clientHeight,
offsetWidth: el.innerWidth || el.offsetWidth,
offsetHeight: el.innerHeight || el.offsetHeight
};
}
function getElementBorder(el, dir) {
const style = window.getComputedStyle(el);
let d = [];
{
d = isArray(dir) ? dir : ["left", "right", "bottom", "top"];
}
const rlt = {};
d.forEach((k) => {
rlt[k] = parseFloat(style.getPropertyValue(`border-${k}-width`));
});
return rlt;
}
function supportTouch() {
return "ontouchstart" in window;
}
function mergeClass(...classList) {
let rlt = [];
classList.forEach((item) => {
if (isArray(item)) {
rlt = rlt.concat(item);
} else {
rlt.push(item);
}
});
return rlt;
}
let cancelScrollRAF = null;
function scrollTo(y, opts) {
const { container = window, duration = 450 } = opts;
const { scrollTop } = getScroll(container);
const startTime = Date.now();
if (isFunction(cancelScrollRAF)) {
cancelScrollRAF();
cancelScrollRAF = null;
}
return new Promise((resolve) => {
const frameFn = () => {
const timeStamp = Date.now();
const time = timeStamp - startTime;
const nextScrollTop = easeInOutCubic(time > duration ? duration : time, scrollTop, y, duration);
if (isWindow(container)) {
window.scrollTo({
left: window.scrollX,
top: nextScrollTop,
behavior: "instant"
});
} else if (isDocument(container)) {
container.documentElement.scrollTop = nextScrollTop;
} else {
container.scrollTop = nextScrollTop;
}
if (time < duration) {
const fn = throttleRAF(frameFn);
cancelScrollRAF = fn.cancel;
fn();
} else {
throttleRAF(resolve)();
}
};
throttleRAF(frameFn)();
});
}
function isOverflown(element) {
if (!element) {
return false;
}
return element.scrollWidth > element.clientWidth || element.scrollHeight > element.clientHeight;
}
const isElement = (vnode) => {
return Boolean(
vnode && vnode.shapeFlag & 1
/* ELEMENT */
);
};
const isTextElement = (vnode) => {
return Boolean(
vnode && vnode.shapeFlag & 8
/* TEXT_CHILDREN */
);
};
function isComponent(vnode, _type) {
return Boolean(
vnode && vnode.shapeFlag & 6
/* COMPONENT */
);
}
const isSlotsChildren = (vnode, _children) => {
return Boolean(
vnode && vnode.shapeFlag & 32
/* SLOTS_CHILDREN */
);
};
const isArrayChildren = (vn, _children) => {
return Boolean(
vn && vn.shapeFlag & 16
/* ARRAY_CHILDREN */
);
};
function isComponentPublicInstance(val) {
return Boolean(val == null ? void 0 : val.$el);
}
function getFirstComponent(vn) {
var _a, _b;
if (isArray(vn)) {
for (const child of vn) {
const result = getFirstComponent(child);
if (result) {
return result;
}
}
} else if (isElement(vn) || isComponent(vn) || isTextElement(vn) && vn.type !== vue.Comment) {
return vn;
} else if (isArrayChildren(vn, vn.children)) {
for (const child of vn.children) {
const result = getFirstComponent(child);
if (result) {
return result;
}
}
} else if (isSlotsChildren(vn, vn.children)) {
const children = (_b = (_a = vn.children).default) == null ? void 0 : _b.call(_a);
if (children) {
const result = getFirstComponent(children);
if (result) {
return result;
}
}
}
return null;
}
const resolveHtmlElement = (elRef) => {
const queryElement = (el) => {
if (typeof el === "string") {
return document.querySelector(el);
} else if (isHtmlElement(el)) {
return el;
}
return null;
};
return new Promise((resolve) => {
if (vue.isRef(elRef)) {
vue.watchEffect(() => {
const { value } = elRef;
if (value) {
if (isComponentPublicInstance(value)) {
resolve(value.$el);
} else {
resolve(queryElement(value));
}
}
});
} else if (isComponentPublicInstance(elRef)) {
resolve(elRef.$el);
} else {
resolve(queryElement(elRef));
}
});
};
const isEmptySlot = (slot2) => {
var _a;
if (!slot2) {
return true;
}
const children = slot2();
if (children.length > 1) {
return false;
}
if (children.length === 0) {
return true;
}
if (isTextElement(children[0]) && !children[0].children) {
return true;
}
if (children[0].type === vue.Comment) {
return true;
}
if (children[0].type === vue.Fragment) {
return !((_a = children[0].children) == null ? void 0 : _a.length);
}
return false;
};
function filterSlots(slots, slotNames) {
const names = Object.values(slotNames);
const keys = Object.keys(slots);
const r = keys.filter((item) => names.includes(item));
return r || [];
}
const bindEvent = (child, vResizeObserver) => {
if (isElement(child) || isComponent(child)) {
return vue.withDirectives(vue.cloneVNode(child), [[vResizeObserver]]);
} else if (isArray(child.children)) {
child.children = child.children.map((item) => {
return bindEvent(item, vResizeObserver);
});
return child;
} else {
return child;
}
};
const OResizeObserver = vue.defineComponent({
name: "OResizeObserver",
emits: ["resize"],
setup(_props, { emit, slots }) {
const { vResizeObserver } = useReiszeObserverDirective((entry, isFirst) => {
emit("resize", entry, isFirst);
});
return () => {
var _a;
const children = (_a = slots.default) == null ? void 0 : _a.call(slots);
return children == null ? void 0 : children.map((item) => {
return bindEvent(item, vResizeObserver);
});
};
}
});
const OChildOnly = vue.defineComponent({
name: "OChildOnly",
setup(_props, { slots }) {
return () => {
var _a;
const children = (_a = slots.default) == null ? void 0 : _a.call(slots);
return children ? getFirstComponent(children) : null;
};
}
});
const AnchorSizeTypes = ["medium", "small", "menu"];
const anchorProps = {
/**
* @zh-CN 锚点的尺寸, menu为左侧菜单或移动端菜单混合使用
* @en-US Anchor size, 'menu' for aside menu-mixed or mobile menu mode
* @default 'medium'
*/
size: {
type: String,
default: "medium"
},
/**
* @zh-CN 监测容器
* @en-US Scroll container to monitor
* @default window
*/
container: {
type: [String, Object]
},
/**
* @zh-CN 锚点激活的边界范围
* @en-US Boundary for anchor activation
* @default 5
*/
bounds: {
type: Number,
default: 5
},
/**
* @zh-CN 锚点激活的判定边界
* @en-US Boundary for anchor activation
* @default 0
*/
targetOffset: {
type: Number,
default: 0
},
/**
* @zh-CN 点击锚点时是否改变浏览器地址栏的 hash 值
* @en-US Whether to change the browser's address bar hash value when clicking the anchor
* @default true
*/
changeHash: {
type: Boolean,
default: true
}
};
const anchorItemProps = {
/**
* @zh-CN 锚点标题
* @en-US Anchor title
*/
title: {
type: String,
default: ""
},
/**
* @zh-CN 锚点监听、跳转的目标元素(带#前缀)
* @en-US Target element for anchor navigation (with # prefix)
*/
href: {
type: String,
required: true
},
/**
* @zh-CN 锚点监听的目标元素(带#前缀),不传时监听href
* @en-US Target element for anchor observe (with # prefix),Use href prop by default
*/
observeHref: {
type: String
},
/**
* @zh-CN 锚点跳转方式
* @en-US Anchor navigation method
* @default '_self'
*/
target: {
type: String,
default: "_self"
},
/**
* @zh-CN 锚点是否禁用
* @en-US Anchor disable status
* @default false
*/
disabled: {
type: Boolean,
default: false
}
};
const anchorInjectKey = Symbol("provide-anchor");
const anchorItemInjectKey = Symbol("provide-anchor");
const _hoisted_1$K = { class: "o-anchor-line" };
const _hoisted_2$x = { class: "o-anchor-items" };
const _sfc_main$18 = /* @__PURE__ */ vue.defineComponent({
__name: "OAnchor",
props: anchorProps,
emits: ["click", "change"],
setup(__props, { emit: __emit }) {
const props = __props;
const emits = __emit;
const ANCHOR_REGX = /#([\S ]+)$/;
const anchorRef = vue.ref();
const isScrolling = vue.ref(false);
const links = vue.ref(/* @__PURE__ */ new Set());
const activeLink = vue.ref("");
const indicatorStyle = vue.ref({});
const scrollContainer = vue.ref();
const getContainer = (container = window) => {
if (isString(container)) {
const dom = document.querySelector(container);
return dom ? dom : window;
}
return container;
};
const updateIndicatorPosition = () => {
var _a;
const el = (_a = anchorRef.value) == null ? void 0 : _a.querySelector(".o-anchor-item-link.is-active");
if (!el) {
indicatorStyle.value = {};
} else {
const { offsetTop, offsetHeight } = el;
const depth = el.getAttribute("data-depth");
indicatorStyle.value.top = `${offsetTop}px`;
indicatorStyle.value.height = `${offsetHeight}px`;
indicatorStyle.value.opacity = depth === "0" ? 0 : 1;
}
};
const setActiveLink = async (link) => {
if (activeLink.value === link) {
return;
}
activeLink.value = link;
emits("change", activeLink.value);
await vue.nextTick();
updateIndicatorPosition();
};
const getAnchorTarget = (link) => {
const anchorMatches = ANCHOR_REGX.exec(link);
if (!anchorMatches) {
return;
}
const target = document.getElementById(anchorMatches[1]);
return target;
};
const getOffsetTop = (el, container) => {
const { top } = el.getBoundingClientRect();
if (isWindow(container)) {
return top - document.documentElement.clientTop;
}
return top - container.getBoundingClientRect().top;
};
const scrollIntoView = async (link) => {
if (!isCurrentPageLink(link)) {
return;
}
setActiveLink(link);
const target = getAnchorTarget(link);
if (!target) {
return;
}
isScrolling.value = true;
const { scrollTop } = getScroll(scrollContainer.value);
const offsetTop = getOffsetTop(target, scrollContainer.value);
const y = scrollTop + offsetTop - props.targetOffset;
await scrollTo(y, {
container: scrollContainer.value
});
isScrolling.value = false;
};
const activeNearest = () => {
const distances = [];
const { targetOffset: targetOffset2, bounds } = props;
let active = "";
links.value.forEach((link) => {
const target = getAnchorTarget(link);
if (target) {
const top = getOffsetTop(target, scrollContainer.value);
if (top < targetOffset2 + bounds) {
distances.push({
link,
top
});
}
}
});
if (distances.length) {
const max = distances.reduce((prev, cur) => prev.top > cur.top ? prev : cur);
active = max.link;
}
setActiveLink(active);
};
const onScroll = () => {
if (isScrolling.value) {
return;
}
activeNearest();
};
const bindEvent2 = () => {
if (isUndefined(scrollContainer.value)) {
return;
}
scrollContainer.value.addEventListener("scroll", onScroll, { passive: true });
};
const unbindEvent = () => {
if (isUndefined(scrollContainer.value)) {
return;
}
scrollContainer.value.removeEventListener("scroll", onScroll);
};
const addLink = (link) => {
if (!ANCHOR_REGX.test(link) || links.value.has(link)) {
return;
}
links.value.add(link);
};
const removeLink = (link) => {
links.value.add(link);
};
const onItemClick = (options) => {
const { event, link } = options;
emits("click", event, link);
};
vue.provide(anchorInjectKey, {
addLink,
removeLink,
onItemClick,
activeLink,
scrollIntoView,
getChangeHash: () => props.changeHash
});
vue.onMounted(() => {
scrollContainer.value = getContainer(props.container);
const hash = decodeURIComponent(window.location.hash);
if (hash) {
scrollIntoView(hash);
} else {
activeNearest();
}
vue.nextTick(() => {
bindEvent2();
});
});
vue.onUnmounted(() => {
unbindEvent();
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"div",
{
ref_key: "anchorRef",
ref: anchorRef,
class: vue.normalizeClass(["o-anchor", `o-anchor-${props.size}`])
},
[
vue.createElementVNode("div", _hoisted_1$K, [
vue.createElementVNode(
"div",
{
class: "o-anchor-indicator",
style: vue.normalizeStyle(indicatorStyle.value)
},
null,
4
/* STYLE */
)
]),
vue.createElementVNode("div", _hoisted_2$x, [
vue.renderSlot(_ctx.$slots, "default")
])
],
2
/* CLASS */
);
};
}
});
const PopupPositionTypes = ["top", "tl", "tr", "bottom", "bl", "br", "left", "lt", "lb", "right", "rt", "rb"];
const PopupTriggerTypes = ["none", "click", "click-outclick", "hover", "hover-outclick", "focus", "contextmenu"];
const popupProps = {
/**
* 是否可见
* v-model
*/
visible: {
type: Boolean
},
/**
* 弹出位置 PopupPositionT
*/
position: {
type: String,
default: "top"
},
/**
* 触发事件 PopupTriggerT | PopupTriggerT[]
* Pad&Phone: 只支持 'none', 'click', 'click-outclick'
*/
trigger: {
type: [String, Array],
default: "click"
},
/**
* 触发元素或组件
*/
target: {
type: [String, Object],
default: null
},
/**
* 是否禁用
*/
disabled: {
type: Boolean
},
/**
* 挂载容器,默认为body
*/
wrapper: {
type: [String, Object],
default: "body"
},
/**
* 距离target偏移量
*/
offset: {
type: Number,
default: 0
},
/**
* 距离viewport(屏幕)边缘偏移量
*/
edgeOffset: {
type: Number,
default: 0
},
/**
* hover事件延时触发的时间(毫秒)
*/
hoverDelay: {
type: Number,
default: 100
},
/**
* 是否当触发元素不可见时隐藏弹层
*/
hideWhenTargetInvisible: {
type: Boolean,
default: true
},
/**
* 是否计算箭头位置
*/
anchor: {
type: Boolean,
default: false
},
/**
* 锚点自定义class
*/
anchorClass: {
type: [String, Array],
default: void 0
},
/**
* 是否在popup隐藏时unmout
*/
unmountOnHide: {
type: Boolean,
default: true
},
/**
* popup wrap自定义class
*/
wrapClass: {
type: [String, Array],
default: void 0
},
/**
* popup body自定义class
*/
bodyClass: {
type: [String, Array],
default: void 0
},
/**
* popup最小宽度设置为触发元素宽度
*/
adjustMinWidth: {
type: Boolean,
default: true
},
/**
* popup宽度设置为触发元素宽度
*/
adjustWidth: {
type: Boolean,
default: true
},
/**
* 过渡名称
*/
transition: {
type: String,
default: "o-zoom-fade"
},
/**
* 是否自动隐藏
*/
autoHide: {
type: Boolean,
default: true
},
/**
* 显示前回调,根据返回值判断是否显示, false: 不显示; true|undefined: 显示
*/
beforeShow: {
type: Function
},
/**
* 隐藏前回调,根据返回值判断是否隐藏,false: 不隐藏; true|undefined: 隐藏
*/
beforeHide: {
type: Function
},
/**
* popup是否自适应边缘
*/
adaptive: {
type: Boolean,
default: true
}
};
function getWrapperContentRect(wrapperEl, wrapperRect) {
const { left = 0, top = 0, right = 0, bottom = 0 } = getElementBorder(wrapperEl);
const rect = wrapperRect || wrapperEl.getBoundingClientRect();
return {
left: rect.left + left,
top: rect.top + top,
right: rect.right - right,
bottom: rect.bottom - bottom
};
}
function getPopupViewOffset(position, t, p, {
offset = 0
} = {}) {
const formula = {
top: {
left: t.left + t.width / 2 - p.width / 2,
top: t.top - p.height - offset
},
tl: {
left: t.left,
top: t.top - p.height - offset
},
tr: {
left: t.right - p.width,
top: t.top - p.height - offset
},
bottom: {
left: t.left + t.width / 2 - p.width / 2,
top: t.bottom + offset
},
bl: {
left: t.left,
top: t.bottom + offset
},
br: {
left: t.right - p.width,
top: t.bottom + offset
},
left: {
left: t.left - p.width - offset,
top: t.top + t.height / 2 - p.height / 2
},
lt: {
left: t.left - p.width - offset,
top: t.top
},
lb: {
left: t.left - p.width - offset,
top: t.bottom - p.height
},
right: {
left: t.right + offset,
top: t.top + t.height / 2 - p.height / 2
},
rt: {
left: t.right + offset,
top: t.top
},
rb: {
left: t.right + offset,
top: t.bottom - p.height
}
};
return formula[position] || { left: 0, top: 0 };
}
function getWrapperViewEdge(popupSize, wrapperRect, edgeOffset = 0) {
const viewport = {
left: edgeOffset,
right: window.innerWidth - popupSize.width - edgeOffset,
top: edgeOffset,
bottom: window.innerHeight - popupSize.height - edgeOffset
};
if (!wrapperRect) {
return viewport;
}
return {
left: Math.max(viewport.left, wrapperRect.left),
top: Math.max(viewport.top, wrapperRect.top),
right: Math.min(viewport.right, wrapperRect.right - popupSize.width),
bottom: Math.min(viewport.bottom, wrapperRect.bottom - popupSize.height)
};
}
function getPopupEdge(popupSize, targetRect, anchorOffset = 0) {
const { left, right, top, bottom } = targetRect;
const { width, height } = popupSize;
return {
left: left - width + anchorOffset,
top: top - height + anchorOffset,
right: right - anchorOffset,
bottom: bottom - anchorOffset
};
}
function getPopupWrapOffset(pos, wrapperEl, wrapperContentRect) {
if (!wrapperEl) {
return pos;
}
const cs = getScroll(wrapperEl);
if (wrapperContentRect) {
return {
left: pos.left + cs.scrollLeft - wrapperContentRect.left,
top: pos.top + cs.scrollTop - wrapperContentRect.top
};
}
return {
left: pos.left + cs.scrollLeft,
top: pos.top + cs.scrollTop
};
}
function getDirection(position) {
switch (position) {
case "tl":
case "tr":
case "top":
return "top";
case "bl":
case "br":
case "bottom":
return "bottom";
case "lt":
case "lb":
case "left":
return "left";
case "rt":
case "rb":
case "right":
return "right";
}
}
function adjustPosition(position, direction) {
const fixFn = {
top: (p) => {
if (p === "bottom") {
return "top";
} else if (p === "bl") {
return "tl";
} else if (p === "br") {
return "tr";
}
return p;
},
bottom: (p) => {
if (p === "top") {
return "bottom";
} else if (p === "tl") {
return "bl";
} else if (p === "tr") {
return "br";
}
return p;
},
left: (p) => {
if (p === "right") {
return "left";
} else if (p === "rt") {
return "lt";
} else if (p === "rb") {
return "lb";
}
return p;
},
right: (p) => {
if (p === "left") {
return "right";
} else if (p === "lt") {
return "rt";
} else if (p === "lb") {
return "rb";
}
return p;
}
};
const fn = fixFn[direction];
return fn ? fn(position) : position;
}
function adjustOffset(position, popupPosition, popupSize, pRect, tRect, wRect, {
anchorOffset,
offset,
edgeOffset
} = {}) {
const { top, left } = popupPosition;
const edge = getWrapperViewEdge(popupSize, wRect, edgeOffset);
let fixedPosition = position;
let style = popupPosition;
const d = getDirection(position);
if (d === "top") {
if (edge.top > top) {
fixedPosition = adjustPosition(position, "bottom");
style = getPopupViewOffset(fixedPosition, tRect, pRect, { offset });
}
} else if (d === "left") {
if (edge.left > left) {
fixedPosition = adjustPosition(position, "right");
style = getPopupViewOffset(fixedPosition, tRect, pRect, { offset });
}
} else if (d === "right") {
if (edge.right < left) {
fixedPosition = adjustPosition(position, "left");
style = getPopupViewOffset(fixedPosition, tRect, pRect, { offset });
}
} else if (d === "bottom") {
if (edge.bottom < top) {
fixedPosition = adjustPosition(position, "top");
style = getPopupViewOffset(fixedPosition, tRect, pRect, { offset });
}
}
const popEdge = getPopupEdge(popupSize, tRect, anchorOffset);
if (["top", "bottom"].includes(d)) {
if (edge.left > left) {
style.left = edge.left < popEdge.right ? edge.left : popEdge.right;
} else if (edge.right < left) {
style.left = edge.right > popEdge.left ? edge.right : popEdge.left;
}
}
if (["left", "right"].includes(d)) {
if (edge.top > top) {
style.top = edge.top < popEdge.bottom ? edge.top : popEdge.bottom;
} else if (edge.bottom < top) {
style.top = edge.bottom > popEdge.top ? edge.bottom : popEdge.top;
}
}
return {
position: fixedPosition,
popupStyle: style
};
}
function getAnchorOffset(position, tRect, popupStyle, popupSize, anchorOffset = 8) {
const pos = {};
const limit = anchorOffset;
const { left: pl, top: pt } = popupStyle;
if (["top", "tl", "tr", "bottom", "bl", "br"].includes(position)) {
let l = tRect.left + tRect.width / 2 - pl;
if (l > popupSize.width - limit) {
l = popupSize.width - limit;
} else if (l < limit) {
l = limit;
}
pos.left = l;
if (["top", "tl", "tr"].includes(position)) {
pos.bottom = 0;
} else {
pos.top = 0;
}
} else if (["left", "lt", "lb", "right", "rt", "rb"].includes(position)) {
let t = tRect.top + tRect.height / 2 - pt;
if (t > popupSize.height - limit) {
t = popupSize.height - limit;
} else if (t < limit) {
t = limit;
}
pos.top = t;
if (["left", "lt", "lb"].includes(position)) {
pos.right = 0;
} else {
pos.left = 0;
}
}
return pos;
}
function calcPopupStyle(popupEl, targetEl, position, {
adaptive = true,
// 自适应容器边缘
anchor = true,
// 是否计算anchor
anchorOffset = 8,
// anchor与容器边缘偏移量
offset = 8,
// popup 距离target偏移量
edgeOffset = 0
// popup 与容器边缘最小距离
} = {}) {
const tRect = targetEl.getBoundingClientRect();
const pRect = popupEl.getBoundingClientRect();
const popupSize = getElementSize(popupEl);
let popupStyle = getPopupViewOffset(position, tRect, pRect, { offset });
let anchorStyle = {};
const wrapperEl = getOffsetElement(popupEl);
if (!wrapperEl) {
return {
popupStyle,
position,
anchorStyle
};
}
const wrapperRect = wrapperEl.getBoundingClientRect();
let wrapperContentRect = void 0;
if (wrapperEl.nodeName !== "HTML") {
wrapperContentRect = getWrapperContentRect(wrapperEl, wrapperRect);
}
let fixedPosition = position;
if (adaptive) {
const rlt = adjustOffset(position, popupStyle, popupSize, pRect, tRect, wrapperContentRect, {
offset,
anchorOffset: anchor ? anchorOffset : 0,
edgeOffset
});
fixedPosition = rlt.position;
popupStyle = rlt.popupStyle;
}
if (anchor) {
anchorStyle = getAnchorOffset(fixedPosition, tRect, popupStyle, popupSize, anchorOffset);
}
popupStyle = getPopupWrapOffset(popupStyle, wrapperEl, wrapperContentRect);
return {
position: fixedPosition,
popupStyle,
anchorStyle,
isFixed: fixedPosition === position
};
}
function bindTrigger(el, popupRef, triggers, {
updateFn,
hoverDelay = 100,
autoHide = true
}) {
if (!el) {
return [];
}
const outClick = useOutClick();
const listeners = [];
const showFn = () => {
updateFn(true);
};
const hideFn = () => {
updateFn(false);
};
const toggleFn = () => {
updateFn();
};
const enterFn = () => {
updateFn(true, hoverDelay);
};
const leavefn = () => {
updateFn(false, hoverDelay);
};
const onClickFn = () => {
hideFn();
outClick.removeListener(el, onClickFn);
};
const clickFn = (toggle) => {
const handlerFn = toggle ? toggleFn : showFn;
return () => {
el == null ? void 0 : el.addEventListener("click", () => {
handlerFn();
if (autoHide) {
outClick.addListener(el, onClickFn, {
exception: (e) => {
var _a;
return !!((_a = popupRef.value) == null ? void 0 : _a.contains(e.target));
}
});
}
});
listeners.push(() => {
el == null ? void 0 : el.removeEventListener("click", handlerFn);
});
};
};
const triggerHandlers = {
hover: () => {
el == null ? void 0 : el.addEventListener("mouseenter", enterFn);
listeners.push(() => {
el == null ? void 0 : el.removeEventListener("mouseenter", enterFn);
});
if (autoHide) {
el == null ? void 0 : el.addEventListener("mouseleave", leavefn);
listeners.push(() => {
el == null ? void 0 : el.removeEventListener("mouseleave", leavefn);
});
}
},
// 点击目标,切换显示
click: clickFn(true),
// 点击目标,始终显示,当点击外部才隐藏
"click-outclick": clickFn(false),
focus: () => {
el == null ? void 0 : el.addEventListener("focusin", showFn);
listeners.push(() => {
el == null ? void 0 : el.removeEventListener("focusin", showFn);
});
if (autoHide) {
el == null ? void 0 : el.addEventListener("focusout", hideFn);
listeners.push(() => {
el == null ? void 0 : el.removeEventListener("focusout", hideFn);
});
}
},
contextmenu: () => {
const fn = (e) => {
e.preventDefault();
showFn();
};
el == null ? void 0 : el.addEventListener("contextmenu", fn);
listeners.push(() => {
el == null ? void 0 : el.removeEventListener("contextmenu", fn);
});
if (autoHide) {
outClick.addListener(el, hideFn, {
exception: (e) => {
var _a;
return !!((_a = popupRef.value) == null ? void 0 : _a.contains(e.target));
}
});
listeners.push(() => {
outClick.removeListener(el, hideFn);
});
}
},
none: () => {
},
// hover 显示 outclick隐藏
"hover-outclick": () => {
el == null ? void 0 : el.addEventListener("mouseenter", enterFn);
listeners.push(() => {
el == null ? void 0 : el.removeEventListener("mouseenter", enterFn);
});
if (autoHide) {
outClick.addListener(el, hideFn, {
exception: (e) => {
var _a;
return !!((_a = popupRef.value) == null ? void 0 : _a.contains(e.target));
}
});
listeners.push(() => {
outClick.removeListener(el, hideFn);
});
}
}
};
triggers.forEach((tr) => {
const fn = triggerHandlers[tr];
if (fn) {
fn();
}
});
return listeners;
}
function getTransformOrigin(position) {
let left = "0px";
let top = "0px";
if (["lt", "lb", "left", "tr", "br"].includes(position)) {
left = "100%";
} else if (["top", "bottom"].includes(position)) {
left = "50%";
}
if (["tl", "tr", "top", "lb", "rb"].includes(position)) {
top = "100%";
} else if (["left", "right"].includes(position)) {
top = "50%";
}
return {
top,
left
};
}
const ClientOnly = vue.defineComponent({
name: "ClientOnly",
setup(_props, { slots }) {
const isMoutned = vue.ref(false);
vue.onMounted(() => {
isMoutned.value = true;
});
return () => {
var _a;
return isMoutned.value ? (_a = slots.default) == null ? void 0 : _a.call(slots) : null;
};
}
});
let topZIndex = 100;
vue.watchEffect(() => {
topZIndex = defaultZIndex.value;
});
function createTopZIndex() {
topZIndex += 1;
return topZIndex;
}
function removeZIndex(current) {
if (current === void 0 || current === topZIndex) {
topZIndex -= 1;
}
return topZIndex;
}
const __default__$3 = {
inheritAttrs: false
};
const _sfc_main$17 = /* @__PURE__ */ vue.defineComponent({
...__default__$3,
__name: "OPopup",
props: popupProps,
emits: ["update:visible", "change"],
setup(__props, { emit: __emit }) {
const props = __props;
const emits = __emit;
const { isPhonePad } = useScreen();
const triggers = vue.computed(() => {
const triggers2 = isArray(props.trigger) ? props.trigger : [props.trigger];
if (isPhonePad.value) {
const r = triggers2.filter((item) => ["none", "click-outclick", "click"].includes(item));
return r.length > 0 ? r : ["click"];
}
return triggers2;
});
const visible = vue.ref(false);
const targetElRef = vue.ref(null);
let targetEl = null;
const isTargetInViewport = vue.ref(true);
let wrapperEl = vue.ref(null);
const popupRef = vue.ref(null);
const popStyle = vue.reactive({
"--popup-edge-offset": `${props.edgeOffset}px`
});
const popPosition = vue.ref(props.position);
const wrapOrigin = vue.ref({ left: "0px", top: "0px" });
const wrapStyle = vue.computed(() => ({
transformOrigin: `${wrapOrigin.value.left} ${wrapOrigin.value.top}`
}));
const anchorStyle = vue.reactive({});
const toMount = vue.ref(false);
const isAnimating = vue.ref(false);
let ro2 = null;
let io2 = null;
const updateZIndex = (show) => {
if (show) {
popStyle["--popup-z-index"] = createTopZIndex();
} else {
removeZIndex(popStyle["--popup-z-index"]);
}
};
vue.onMounted(() => {
ro2 = useResizeObserver();
io2 = useIntersectionObserver();
visible.value = props.visible;
if (props.visible) {
updateZIndex(props.visible);
}
const { target, wrapper } = vue.toRefs(props);
resolveHtmlElement(target).then((el) => {
if (el) {
bindTargetEvent(el);
}
});
resolveHtmlElement(wrapper).then((el) => {
if (el) {
wrapperEl.value = el;
}
});
});
let triggerListener = [];
const bindTargetEvent = (el) => {
if (!el) {
return;
}
targetEl = el;
if (props.adjustMinWidth) {
popStyle.minWidth = `${targetEl.offsetWidth}px`;
} else if (props.adjustWidth) {
popStyle.width = `${targetEl.offsetWidth}px`;
}
triggerListener = bindTrigger(el, popupRef, triggers.value, {
updateFn: updateVisible,
hoverDelay: props.hoverDelay,
autoHide: props.autoHide
});
if (props.hideWhenTargetInvisible) {
io2 == null ? void 0 : io2.observe(targetEl, onTargetInterscting);
}
};
vue.onUnmounted(() => {
triggerListener.forEach((fn) => {
fn();
});
if (wrapperEl.value) {
ro2 == null ? void 0 : ro2.unobserve(wrapperEl.value, onResize);
}
if (targetEl) {
ro2 == null ? void 0 : ro2.unobserve(targetEl, onResize);
}
});
const updatePopupStyle = () => {
if (props.hideWhenTargetInvisible && !isTargetInViewport.value) {
return;
}
if (!targetEl || !popupRef.value || !wrapperEl.value) {
return;
}
const {
popupStyle: pStyle,
position,
anchorStyle: aStyle
} = calcPopupStyle(popupRef.value, targetEl, props.position, {
adaptive: props.adaptive,
offset: props.offset,
edgeOffset: props.edgeOffset,
anchor: props.anchor
});
wrapOrigin.value = getTransformOrigin(position);
if (pStyle) {
popStyle.top = `${Math.floor(pStyle.top)}px`;
popStyle.left = `${Math.floor(pStyle.left)}px`;
popPosition.value = position;
}
if (aStyle) {
Object.keys(aStyle).forEach((k) => {
const val = aStyle[k];
anchorStyle[k] = `${Math.floor(val)}px`;
});
}
};
let oldIntersecting = null;
const onTargetInterscting = (entry) => {
isTargetInViewport.value = entry.isIntersecting;
if (oldIntersecting !== null && entry.isIntersecting) {
if (visible.value) {
vue.nextTick(() => {
updatePopupStyle();
});
}
}
oldIntersecting = isTargetInViewport.value;
};
const beforeToggle = async (show) => {
let goon = true;
if (show) {
if (isFunction(props.beforeShow)) {
goon = await props.beforeShow();
}
} else {
if (isFunction(props.beforeHide)) {
goon = await props.beforeHide();
}
}
return goon !== false;
};
vue.watch(
() => props.visible,
async (val) => {
if (visible.value === val) {
return;
}
const goon = await beforeToggle(val);
if (!goon) {
emits("update:visible", visible.value);
return;
}
updateVisible(val);
updateZIndex(val);
if (val) {
vue.nextTick(() => {
updatePopupStyle();
});
}
}
);
let visibleTimer = 0;
const clearVisibleTimer = () => {
if (visibleTimer) {
window.clearTimeout(visibleTimer);
visibleTimer = 0;
}
};
const updateVisible = async (isVisible, delay) => {
if (props.disabled) {
return;
}
const v = isVisible === void 0 ? !visible.value : isVisible;
if (v === visible.value && visibleTimer === 0) {
return;
}
const update = () => {
if (visible.value === v) {
return;
}
visible.value = v;
updateZIndex(v);
emits("update:visible", v);
emits("change", v);
if (v) {
toMount.value = true;
if (props.hideWhenTargetInvisible && targetEl) {
io2 == null ? void 0 : io2.observe(targetEl, onTargetInterscting);
}
}
};
const goon = await beforeToggle(v);
if (!goon) {
return;
}
if (delay) {
clearVisibleTimer();
visibleTimer = window.setTimeout(update, delay);
} else {
update();
}
};
vue.watch(targetElRef, (elRef) => {
if (isHtmlElement(elRef == null ? void 0 : elRef.$el)) {
bindTargetEvent(elRef == null ? void 0 : elRef.$el);
}
});
const onResize = (_en, isFirst) => {
if (visible.value && !isFirst) {
updatePopupStyle();
}
};
const onPopupResize = debounce((en) => {
onResize(en, false);
}, 100);
const handleTransitionStart = () => {
isAnimating.value = true;
};
const handleTransitionEnd = () => {
isAnimating.value = false;
if (!visible.value && props.unmountOnHide) {
toMount.value = false;
}
};
const scrollListener = throttleRAF(() => {
if (visible.value) {
updatePopupStyle();
}
});
const listenScroll = (el) => {
el.addEventListener("scroll", scrollListener, { passive: true });
return () => {
el.removeEventListener("scroll", scrollListener);
};
};
vue.watch(popupRef, (popEl) => {
let handles = [];
if (popEl) {
if (targetEl) {
const scrollers = getScrollParents(targetEl);
handles = scrollers.map((el) => {
return listenScroll(el);
});
ro2 == null ? void 0 : ro2.observe(targetEl, (en, isFirst) => {
if (props.adjustMinWidth) {
popStyle.minWidth = `${targetEl == null ? void 0 : targetEl.offsetWidth}px`;
} else if (props.adjustWidth) {
popStyle.width = `${targetEl == null ? void 0 : targetEl.offsetWidth}px`;
}
onResize(en, isFirst);
});
}
if (wrapperEl.value) {
ro2 == null ? void 0 : ro2.observe(wrapperEl.value, onResize);
}
} else {
handles.forEach((hl) => hl());
if (wrapperEl.value) {
ro2 == null ? void 0 : ro2.unobserve(wrapperEl.value, onResize);
}
if (targetEl) {
ro2 == null ? void 0 : ro2.unobserve(targetEl, onResize);
io2 == null ? void 0 : io2.unobserve(targetEl, onTargetInterscting);
isTargetInViewport.value = true;
}
}
});
const onPopupHoverIn = () => {
if (triggers.value.includes("hover")) {
updateVisible(true, props.hoverDelay);
}
};
const onPopupHoverOut = () => {
if (triggers.value.includes("hover") && props.autoHide) {
updateVisible(false, props.hoverDelay);
}
};
const sholdUmMount = vue.computed(() => {
return toMount.value || visible.value || !props.unmountOnHide;
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
vue.Fragment,
null,
[
_ctx.$slots.target ? (vue.openBlock(), vue.createBlock(
vue.unref(OChildOnly),
{
key: 0,
ref_key: "targetElRef",
ref: targetElRef
},
{
default: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "target")
]),
_: 3
/* FORWARDED */
},
512
/* NEED_PATCH */
)) : vue.createCommentVNode("v-if", true),
!props.disabled ? (vue.openBlock(), vue.createBlock(vue.unref(ClientOnly), { key: 1 }, {
default: vue.withCtx(() => [
(vue.openBlock(), vue.createBlock(vue.Teleport, {
to: props.wrapper,
disabled: !props.wrapper
}, [
vue.createVNode(vue.unref(OResizeObserver), { onResize: vue.unref(onPopupResize) }, {
default: vue.withCtx(() => [
sholdUmMount.value ? (vue.openBlock(), vue.createElementBlock(
"div",
vue.mergeProps({
key: 0,
ref_key: "popupRef",
ref: popupRef,
class: ["o-popup", [
`o-popup-pos-${popPosition.value}`,
{
"out-view": props.hideWhenTargetInvisible && !isTargetInViewport.value,
animating: isAnimating.value
}
]],
style: popStyle
}, _ctx.$attrs, {
onMouseenter: onPopupHoverIn,
onMouseleave: onPopupHoverOut
}),
[
vue.createVNode(vue.Transition, {
name: props.transition,
appear: true,
onBeforeEnter: handleTransitionStart,
onAfterEnter: handleTransitionEnd,
onBeforeLeave: handleTransitionStart,
onAfterLeave: handleTransitionEnd,
persisted: ""
}, {
default: vue.withCtx(() => [
vue.withDirectives(vue.createElementVNode(
"div",
{
class: vue.normalizeClass(["o-popup-wrap", props.wrapClass]),
style: vue.normalizeStyle(wrapStyle.value)
},
[
vue.createElementVNode(
"div",
{
class: vue.normalizeClass(["o-popup-body", props.bodyClass])
},
[
vue.renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
),
props.anchor ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 0,
class: vue.normalizeClass(["o-popup-anchor", props.anchorClass]),
style: vue.normalizeStyle(anchorStyle)
},
[
vue.renderSlot(_ctx.$slots, "anchor")
],
6
/* CLASS, STYLE */
)) : vue.createCommentVNode("v-if", true)
],
6
/* CLASS, STYLE */
), [
[vue.vShow, visible.value]
])
]),
_: 3
/* FORWARDED */
}, 8, ["name"])
],
16
/* FULL_PROPS */
)) : vue.createCommentVNode("v-if", true)
]),
_: 3
/* FORWARDED */
}, 8, ["onResize"])
], 8, ["to", "disabled"]))
]),
_: 3
/* FORWARDED */
})) : vue.createCommentVNode("v-if", true)
],
64
/* STABLE_FRAGMENT */
);
};
}
});
const OPopup = Object.assign(_sfc_main$17, {
install(app) {
app.component("OPopup", _sfc_main$17);
}
});
popupProps.trigger.default = "hover";
popupProps.anchor.default = true;
popupProps.offset.default = 8;
const popoverProps = {
...popupProps
};
const __default__$2 = {
inheritAttrs: false
};
const _sfc_main$16 = /* @__PURE__ */ vue.defineComponent({
...__default__$2,
__name: "OPopover",
props: popoverProps,
emits: ["update:visible"],
setup(__props, { emit: __emit }) {
const props = __props;
const emits = __emit;
const updateVisible = (val) => {
emits("update:visible", val);
};
return (_ctx, _cache) => {
return props.disabled ? vue.renderSlot(_ctx.$slots, "target", { key: 0 }) : (vue.openBlock(), vue.createBlock(vue.unref(OPopup), {
key: 1,
class: "o-popover",
offset: props.offset,
"edge-offset": props.edgeOffset,
visible: props.visible,
position: props.position,
trigger: props.trigger,
target: props.target,
wrapper: props.wrapper,
"wrap-class": vue.unref(mergeClass)("o-popover-wrap", props.wrapClass),
"anchor-class": props.anchor ? vue.unref(mergeClass)("o-popover-anchor", props.anchorClass) : "",
"unmount-on-hide": props.unmountOnHide,
"auto-hide": props.autoHide,
disabled: props.disabled,
transition: props.transition,
"adjust-width": props.adjustWidth,
adaptive: props.adaptive,
"adjust-min-width": props.adjustMinWidth,
"hide-when-target-invisible": props.hideWhenTargetInvisible,
"hover-delay": props.hoverDelay,
"before-hide": props.beforeHide,
"before-show": props.beforeShow,
"onUpdate:visible": updateVisible
}, {
target: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "target")
]),
default: vue.withCtx(() => [
vue.createElementVNode(
"div",
vue.normalizeProps(vue.guardReactiveProps(_ctx.$attrs)),
[
vue.renderSlot(_ctx.$slots, "default")
],
16
/* FULL_PROPS */
)
]),
_: 3
/* FORWARDED */
}, 8, ["offset", "edge-offset", "visible", "position", "trigger", "target", "wrapper", "wrap-class", "anchor-class", "unmount-on-hide", "auto-hide", "disabled", "transition", "adjust-width", "adaptive", "adjust-min-width", "hide-when-target-invisible", "hover-delay", "before-hide", "before-show"]));
};
}
});
const OPopover = Object.assign(_sfc_main$16, {
install(app) {
app.component("OPopover", _sfc_main$16);
}
});
const _hoisted_1$J = ["href", "target", "data-depth"];
const _sfc_main$15 = /* @__PURE__ */ vue.defineComponent({
__name: "OAnchorItem",
props: anchorItemProps,
emits: ["item-click"],
setup(__props, { emit: __emit }) {
const props = __props;
const slots = vue.useSlots();
const emits = __emit;
const anchorInjection = vue.inject(anchorInjectKey, null);
const anchorItemInjection = vue.inject(anchorItemInjectKey, null);
const _observeHref = vue.computed(() => props.observeHref || props.href);
const isActive = vue.computed(() => {
return _observeHref.value === (anchorInjection == null ? void 0 : anchorInjection.activeLink.value);
});
const addItem = () => {
if (!_observeHref.value) {
return;
}
anchorInjection == null ? void 0 : anchorInjection.addLink(_observeHref.value);
};
const removeItem = () => {
if (!_observeHref.value) {
return;
}
anchorInjection == null ? void 0 : anchorInjection.removeLink(_observeHref.value);
};
const onClick = (event) => {
emits("item-click", event);
if (props.disabled) {
event.preventDefault();
return;
}
if (props.href && !isCurrentPageLink(props.href) || props.target && props.target !== "_self") {
return;
}
if (!(anchorInjection == null ? void 0 : anchorInjection.getChangeHash())) {
event.preventDefault();
}
anchorInjection == null ? void 0 : anchorInjection.onItemClick({
event,
link: _observeHref.value
});
if (_observeHref.value) {
anchorInjection == null ? void 0 : anchorInjection.scrollIntoView(_observeHref.value);
}
};
vue.watch(
() => _observeHref.value,
(newVal, oldVal) => {
vue.nextTick(() => {
if (oldVal) {
anchorInjection == null ? void 0 : anchorInjection.removeLink(oldVal);
}
if (newVal) {
anchorInjection == null ? void 0 : anchorInjection.addLink(newVal);
}
});
}
);
const depth = anchorItemInjection ? anchorItemInjection.depth + 1 : 1;
vue.provide(anchorItemInjectKey, { depth });
vue.onMounted(() => {
addItem();
});
vue.onUnmounted(() => {
removeItem();
});
const popoverVisible = vue.ref(false);
const handleMouseenter = (e) => {
if (!e.target || !isOverflown(e.target)) {
popoverVisible.value = false;
return;
}
popoverVisible.value = true;
};
const handleMouseleave = () => {
popoverVisible.value = false;
};
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"div",
{
class: vue.normalizeClass({ "o-anchor-item": true, "with-children": !vue.unref(isEmptySlot)(slots.default) })
},
[
vue.createVNode(vue.unref(OPopover), {
visible: popoverVisible.value,
disabled: !popoverVisible.value,
position: "right",
"wrap-class": "o-anchor-link-popover-wrapper"
}, {
target: vue.withCtx(() => [
vue.createElementVNode("a", {
href: props.href,
target: props.target,
class: vue.normalizeClass({ "o-anchor-item-link": true, "is-active": isActive.value, "disabled": props.disabled, "o-anchor-item-sub-link": vue.unref(depth) > 1 }),
style: vue.normalizeStyle({ "--anchor-item-depth": vue.unref(depth) - 1 }),
"data-depth": vue.unref(depth) - 1,
onClick
}, [
_cache[0] || (_cache[0] = vue.createElementVNode(
"div",
{ class: "o-anchor-item-lines" },
[
vue.createElementVNode("div", { class: "o-anchor-item-top-line" }),
vue.createElementVNode("div", { class: "o-anchor-item-circle" }),
vue.createElementVNode("div", { class: "o-anchor-item-bottom-line" })
],
-1
/* HOISTED */
)),
vue.renderSlot(_ctx.$slots, "title", {}, () => [
vue.createElementVNode(
"div",
{
ref: "anchorItemTitleRef",
class: "o-anchor-item-title",
onMouseenter: handleMouseenter,
onMouseleave: handleMouseleave
},
vue.toDisplayString(props.title),
545
/* TEXT, NEED_HYDRATION, NEED_PATCH */
)
])
], 14, _hoisted_1$J)
]),
default: vue.withCtx(() => [
vue.createTextVNode(
vue.toDisplayString(props.title) + " ",
1
/* TEXT */
)
]),
_: 3
/* FORWARDED */
}, 8, ["visible", "disabled"]),
vue.renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
);
};
}
});
const OAnchor = Object.assign(_sfc_main$18, {
OAnchorItem: _sfc_main$15,
install(app) {
app.component("OAnchor", _sfc_main$18);
app.component("OAnchorItem", _sfc_main$15);
}
});
const BadgeColorTypes = ["primary", "success", "warning", "danger"];
const badgeProps = {
/**
* @zh-CN 徽标内容
* @en-US Content of the badge
*/
value: {
type: [String, Number],
default: ""
},
/**
* @zh-CN 最大值,超过最大值显示${max}+(仅当 value 类型为 number 时生效)
* @en-US Max value, display ${max}+ if exceeded (only effective when value type is number)
* @default 99
*/
max: {
type: Number,
default: 99
},
/**
* @zh-CN 徽标颜色
* @en-US Color of the badge
* @default 'primary'
*/
color: {
type: String,
default: "primary"
},
/**
* @zh-CN 是否显示为小红点
* @en-US Whether to display as a small red dot
* @default false
*/
dot: {
type: Boolean,
default: false
},
/**
* @zh-CN 徽标位置偏移量
* @en-US Badge position offset
*/
offset: {
type: Array,
default: () => []
}
};
const _hoisted_1$I = { class: "o-badge-label" };
const _sfc_main$14 = /* @__PURE__ */ vue.defineComponent({
__name: "OBadge",
props: badgeProps,
setup(__props) {
const props = __props;
const content = vue.computed(() => {
if (props.dot) {
return "";
}
if (isNumber(props.value) && isNumber(props.max)) {
return props.value < props.max ? `${props.value}` : `${props.max}+`;
}
return props.value;
});
const style = vue.computed(() => {
const [x, y] = props.offset;
const right = isNumber(x) ? `-${x}px` : `-${x}`;
const top = isNumber(y) ? `${y}px` : `${y}`;
return {
right,
top
};
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"div",
{
class: vue.normalizeClass(["o-badge", [`o-badge-${props.color}`, { "o-badge-dot": props.dot, "o-badge-only": !_ctx.$slots.default }]])
},
[
vue.renderSlot(_ctx.$slots, "default"),
vue.createElementVNode(
"sup",
{
class: "o-badge-content",
style: vue.normalizeStyle(style.value)
},
[
vue.renderSlot(_ctx.$slots, "content", {}, () => [
vue.createElementVNode(
"div",
_hoisted_1$I,
vue.toDisplayString(content.value),
1
/* TEXT */
)
])
],
4
/* STYLE */
)
],
2
/* CLASS */
);
};
}
});
const OBadge = Object.assign(_sfc_main$14, {
install(app) {
app.component("OBadge", _sfc_main$14);
}
});
const breadcrumbProps = {
/**
* @zh-CN 分隔符字符
* @en-US Separator character
*/
separator: {
type: [String, Number]
}
};
const breadcrumbItemProps = {
/**
* @zh-CN 链接跳转地址
* @en-US Link jump address
*/
href: {
type: String
},
/**
* @zh-CN 链接跳转方式
* @en-US Link jump method
* @default '_self'
*/
target: {
type: String,
default: "_self"
},
/**
* @zh-CN 路由跳转对象。当使用该参数时,OBreadcrumbItem 会渲染为 RouterLink 组件
* @en-US Route jump object. When using this parameter, OBreadcrumbItem will render as a RouterLink component
*/
to: {
type: [String, Object]
},
/**
* @zh-CN 路由跳转时,是否覆盖浏览器历史记录。该参数会作为 RouterLink 的 replace 属性
* @en-US Whether to replace the browser history when routing. This parameter will be used as the replace attribute of RouterLink
* @default false
*/
replace: {
type: Boolean,
default: false
},
/**
* @zh-CN 分隔符字符。会覆盖 OBreadcrumb 的 separator 属性
* @en-US Separator character. This will override the separator property of OBreadcrumb
*/
separator: {
type: [String, Number]
}
};
const breadcrumbInjectKey = Symbol("provide-breadcrumb");
const _hoisted_1$H = { class: "o-breadcrumb" };
const _sfc_main$13 = /* @__PURE__ */ vue.defineComponent({
__name: "OBreadcrumb",
props: breadcrumbProps,
setup(__props) {
const props = __props;
vue.provide(breadcrumbInjectKey, {
separator: vue.toRef(props, "separator")
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$H, [
vue.renderSlot(_ctx.$slots, "default")
]);
};
}
});
const HtmlTag = vue.defineComponent({
name: "HtmlTag",
props: {
tag: {
type: String,
default: "div"
}
},
setup(props, { slots, attrs }) {
return () => {
var _a;
return vue.h(props.tag, attrs, (_a = slots.default) == null ? void 0 : _a.call(slots));
};
}
});
const _hoisted_1$G = { class: "o-breadcrumb-item" };
const _hoisted_2$w = { class: "o-breadcrumb-item-separator" };
const _sfc_main$12 = /* @__PURE__ */ vue.defineComponent({
__name: "OBreadcrumbItem",
props: breadcrumbItemProps,
setup(__props) {
const props = __props;
const breadcrumbInjection = vue.inject(breadcrumbInjectKey, null);
return (_ctx, _cache) => {
const _component_router_link = vue.resolveComponent("router-link");
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$G, [
vue.createCommentVNode(" label "),
props.to ? (vue.openBlock(), vue.createBlock(_component_router_link, {
key: 0,
to: props.to,
replace: props.replace,
class: "o-breadcrumb-item-label"
}, {
default: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "default")
]),
_: 3
/* FORWARDED */
}, 8, ["to", "replace"])) : (vue.openBlock(), vue.createBlock(vue.unref(HtmlTag), {
key: 1,
tag: !!props.href ? "a" : "span",
href: props.href,
target: props.href ? props.target : void 0,
class: "o-breadcrumb-item-label"
}, {
default: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "default")
]),
_: 3
/* FORWARDED */
}, 8, ["tag", "href", "target"])),
vue.createCommentVNode(" separator "),
vue.createElementVNode("span", _hoisted_2$w, [
vue.renderSlot(_ctx.$slots, "separator", {}, () => {
var _a, _b;
return [
props.separator ? (vue.openBlock(), vue.createElementBlock(
vue.Fragment,
{ key: 0 },
[
vue.createTextVNode(
vue.toDisplayString(props.separator),
1
/* TEXT */
)
],
64
/* STABLE_FRAGMENT */
)) : ((_a = vue.unref(breadcrumbInjection)) == null ? void 0 : _a.separator.value) ? (vue.openBlock(), vue.createElementBlock(
vue.Fragment,
{ key: 1 },
[
vue.createTextVNode(
vue.toDisplayString((_b = vue.unref(breadcrumbInjection)) == null ? void 0 : _b.separator.value),
1
/* TEXT */
)
],
64
/* STABLE_FRAGMENT */
)) : (vue.openBlock(), vue.createBlock(vue.unref(IconChevronRight), { key: 2 }))
];
})
])
]);
};
}
});
const OBreadcrumb = Object.assign(_sfc_main$13, {
OBreadcrumbItem: _sfc_main$12,
install(app) {
app.component("OBreadcrumb", _sfc_main$13);
app.component("OBreadcrumbItem", _sfc_main$12);
}
});
function getRoundClass(props, name) {
return {
class: vue.computed(() => {
if (props.round === "pill" || !props.round && defaultRound.value === "pill") {
return ["-", "_"].includes(name[0]) ? `o${name}-round-pill` : `o-${name}-round-pill`;
}
return "";
}),
style: vue.computed(() => {
if (props.round) {
return {
[`--${name}-radius`]: props.round === "pill" ? "100vh" : props.round
};
}
return {};
})
};
}
const ButtonSizeTypes = ["large", "medium", "small"];
const buttonProps = {
/**
* @zh-CN 颜色类型
* @en-US Color type
* @default 'normal'
*/
color: {
type: String,
default: "normal"
},
/**
* @zh-CN 按钮类型
* @en-US Button type
* @default 'outline'
*/
variant: {
type: String,
default: "outline"
},
/**
* @zh-CN 按钮尺寸
* @en-US Button size
*/
size: {
type: String
},
/**
* @zh-CN 圆角值
* @en-US Border radius
*/
round: {
type: String
},
/**
* @zh-CN 是否为加载状态
* @en-US Loading state
*/
loading: {
type: Boolean
},
/**
* @zh-CN 是否禁用
* @en-US Disabled state
*/
disabled: {
type: Boolean
},
/**
* @zh-CN 跳转链接,如果设置了此属性,则按钮会以 a 标签渲染
* @en-US Link to navigate, if set, the button will render as an anchor tag
*/
href: {
type: String
},
/**
* @zh-CN 前缀图标
* @en-US Prefix icon
*/
icon: {
type: Object
},
/**
* @zh-CN 自定义按钮渲染标签
* @en-US Custom button render tag
* @default 'button'
*/
tag: {
type: String,
default: "button"
}
};
const _hoisted_1$F = {
key: 1,
class: "o-btn-suffix"
};
const _sfc_main$11 = /* @__PURE__ */ vue.defineComponent({
__name: "OButton",
props: buttonProps,
emits: ["click"],
setup(__props, { emit: __emit }) {
const props = __props;
const emit = __emit;
const tag = vue.computed(() => props.href ? "a" : props.tag);
const round2 = getRoundClass(props, "btn");
const onClick = (e) => {
if (props.disabled || props.loading) {
e.preventDefault();
return;
}
emit("click", e);
};
return (_ctx, _cache) => {
return vue.openBlock(), vue.createBlock(vue.unref(HtmlTag), {
tag: tag.value,
href: props.href,
type: tag.value === "button" ? "button" : "",
class: vue.normalizeClass(["o-btn", [
`o-btn-${props.color}`,
`o-btn-${props.size || vue.unref(defaultSize)}`,
`o-btn-${props.variant}`,
vue.unref(round2).class.value,
{
"o-btn-icon-only": vue.unref(isEmptySlot)(_ctx.$slots.default) && (props.icon || _ctx.$slots.icon),
"o-btn-disabled": props.disabled
}
]]),
style: vue.normalizeStyle(vue.unref(round2).style.value),
onClick
}, {
default: vue.withCtx(() => [
props.icon || _ctx.$slots.icon || props.loading ? (vue.openBlock(), vue.createElementBlock(
"span",
{
key: 0,
class: vue.normalizeClass(["o-btn-prefix", { loading: props.loading }])
},
[
props.loading ? (vue.openBlock(), vue.createBlock(vue.unref(IconLoading), {
key: 0,
class: "o-rotating"
})) : vue.renderSlot(_ctx.$slots, "icon", { key: 1 }, () => [
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(props.icon)))
])
],
2
/* CLASS */
)) : vue.createCommentVNode("v-if", true),
vue.renderSlot(_ctx.$slots, "default"),
_ctx.$slots.suffix ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$F, [
vue.renderSlot(_ctx.$slots, "suffix")
])) : vue.createCommentVNode("v-if", true)
]),
_: 3
/* FORWARDED */
}, 8, ["tag", "href", "type", "class", "style"]);
};
}
});
const OButton = Object.assign(_sfc_main$11, {
install(app) {
app.component("OButton", _sfc_main$11);
}
});
const CardCoverFitTypes = ["cover", "contain", "fill", "none", "scale-down"];
const CardHoverCursorTypes = ["auto", "pointer"];
const cardProps = {
/**
* @zh-CN 卡片方向('v'为竖向,'h'为横向,'hr'为反向横向)
* @en-US Card direction('v' for vertical, 'h' for horizontal, 'hr' for reversed horizontal)
* @default 'v'
*/
layout: {
type: String,
default: "v"
},
/**
* @zh-CN 封面图片url
* @en-US Card cover image URL
*/
cover: {
type: String
},
/**
* @zh-CN 封面长宽比
* @en-US Cover aspect ratio
*/
coverRatio: {
type: Number
},
/**
* @zh-CN 封面填充方式
* @en-US Cover fit type
* @default 'cover'
*/
coverFit: {
type: String,
default: "cover"
},
/**
* @zh-CN 图标
* @en-US Icon
*/
icon: {
type: [String, Object]
},
/**
* @zh-CN title开头的行内图标
* @en-US Title prefix icon
*/
titleIcon: {
type: [String, Object]
},
/**
* @zh-CN 标题
* @en-US Title
*/
title: {
type: String
},
/**
* @zh-CN 标题行数(影响标题盒子高度)
* @en-US Title row count (affects the height of the title box)
*/
titleRow: {
type: Number
},
/**
* @zh-CN 标题最大行数(超过此行数会显示省略号)
* @en-US Title maximum row count (exceeds this row count will show ellipsis)
*/
titleMaxRow: {
type: Number
},
/**
* @zh-CN 详情
* @en-US Detail
*/
detail: {
type: String
},
/**
* @zh-CN 详情行数(影响详情盒子高度)
* @en-US Detail row count (affects the height of the detail box)
*/
detailRow: {
type: Number
},
/**
* @zh-CN 详情最大行数(超过此行数会显示省略号)
* @en-US Detail maximum row count (exceeds this row count will show ellipsis)
*/
detailMaxRow: {
type: Number
},
/**
* @zh-CN 是否有鼠标悬停效果
* @en-US Whether the card has a hover effect
*/
hoverable: {
type: Boolean
},
/**
* @zh-CN 鼠标悬停时的光标样式
* @en-US Cursor style when hovering over the card
* @default 'auto'
*/
cursor: {
type: String,
default: "auto"
},
/**
* @zh-CN 封面盒子的类名(用来定制封面样式)
* @en-US Class name for the cover box (used to customize the cover style)
*/
coverClass: {
type: [String, Array]
},
/**
* @zh-CN 跳转链接(该属性有值时,卡片会被渲染为链接)
* @en-US Link URL (when this property has a value, the card will be rendered as a link)
*/
href: {
type: String
},
/**
* @zh-CN 卡片尺寸是否跟随视口大小变化而变化
* @en-US Whether the card size changes with the viewport size
*/
noResponsive: {
type: Boolean
}
};
const layerProps = {
/**
* @zh-CN 控制浮层是否显示,双向绑定属性
* @en-US Controls whether the layer is displayed, two-way binding property
*/
visible: {
type: Boolean,
default: false
},
/**
* @zh-CN 浮层挂载的节点,值为 null 时挂载到父容器
* @en-US The mount node for the overlay component. When set to null, it mounts to the parent container.
* @default 'body'
*/
wrapper: {
type: [String, Object],
default: "body"
},
/**
* @zh-CN 是否在隐藏是卸载组件
* @en-US Whether to unmounted the component when hidden
*/
unmountOnHide: {
type: Boolean,
default: true
},
/**
* @zh-CN 默认插槽父容器的自定义类名
* @en-US Custom class name for default slot's parent container
*/
mainClass: {
type: [String, Array],
default: ""
},
/**
* @zh-CN 自定义内容盒子的过度动画
* @en-US Custom transition for content box
* @default 'o-zoom-fade2'
*/
mainTransition: {
type: String,
default: "o-zoom-fade2"
},
/**
* @zh-CN 自定义遮罩层的过度动画
* @en-US Custom transition for mask
* @default 'o-fade-in'
*/
maskTransition: {
type: String,
default: "o-fade-in"
},
/**
* @zh-CN 内容盒子缩放动画的 transform-origin 的值,'mouse' 表示鼠标点击的位置,'css' 表示使用 --layer-origin 变量(默认值 center)
* @en-US Set the value of transform-origin to main box scaling animation; 'mouse' indicates the mouse click position, 'css' indicates using the --layer-origin variable (default: center)
* @default 'mouse'
*/
transitionOrign: {
type: String,
default: "mouse"
},
/**
* @zh-CN 是否渲染遮罩层
* @en-US Whether to render the mask
* @default true
*/
mask: {
type: Boolean,
default: true
},
/**
* @zh-CN 点击遮罩层时是否关闭浮层
* @en-US Whether to close the layer when clicking the mask
* @default true
*/
maskClose: {
type: Boolean,
default: true
},
/**
* @zh-CN 是否渲染浮层的关闭按钮
* @en-US Whether to render the close button of the layer
* @default false
*/
buttonClose: {
type: Boolean,
default: false
},
/**
* @zh-CN 浮层打开前的回调,返回 false 表示取消打开浮层,否则打开浮层
* @en-US Callback before the layer is opened, returning false means canceling the opening of the layer, otherwise opening the layer
*/
beforeShow: {
type: Function
},
/**
* @zh-CN 浮层关闭前的回调,返回 false 表示取消关闭浮层,否则关闭浮层
* @en-US Callback before the layer is closed, returning false means canceling the closing of the layer, otherwise close the layer
*/
beforeHide: {
type: Function
}
};
function trigger(el, type) {
const evt = new Event(type, {
bubbles: true,
cancelable: true
});
el.dispatchEvent(evt);
}
const getPositionByType = {
page: (e) => ({ x: e.pageX, y: e.pageY }),
client: (e) => ({ x: e.clientX, y: e.clientY }),
screen: (e) => ({ x: e.screenX, y: e.screenY }),
offset: (e) => ({ x: e.offsetX, y: e.offsetY })
};
const defaultWindow = isClient ? window : null;
function useMouse(props = {}) {
const { defaultValue = { x: 0, y: 0 }, target = defaultWindow, type = "page" } = props;
const x = vue.ref(defaultValue.x);
const y = vue.ref(defaultValue.y);
const handler = (e) => {
const p = getPositionByType[type](e);
x.value = p.x;
y.value = p.y;
};
if (target) {
target.addEventListener("mousemove", handler, { passive: true });
trigger(target, "mousemove");
}
const destroy = () => {
target == null ? void 0 : target.removeEventListener("mousemove", handler);
};
return {
x,
y,
destroy
};
}
const iconProps = {
icon: {
type: Object
},
/**
* 按钮图标
*/
button: {
type: Boolean
},
/**
* 禁用
*/
disabled: {
type: Boolean
},
/**
* 是否为loading状态
*/
loading: {
type: Boolean
}
};
const _hoisted_1$E = ["tabindex"];
const _sfc_main$10 = /* @__PURE__ */ vue.defineComponent({
__name: "OIcon",
props: iconProps,
setup(__props) {
const props = __props;
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("div", {
class: vue.normalizeClass(["o-icon", [
{
"o-icon-btn": props.button,
"o-icon-btn-disabled": props.disabled
}
]]),
tabindex: props.button ? 0 : ""
}, [
vue.renderSlot(_ctx.$slots, "default", {}, () => [
props.loading ? (vue.openBlock(), vue.createBlock(vue.unref(IconLoading), {
key: 0,
class: "o-rotating"
})) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(props.icon), { key: 1 }))
])
], 10, _hoisted_1$E);
};
}
});
const OIcon = Object.assign(_sfc_main$10, {
install(app) {
app.component("OIcon", _sfc_main$10);
}
});
const __default__$1 = {
inheritAttrs: false
};
const _sfc_main$$ = /* @__PURE__ */ vue.defineComponent({
...__default__$1,
__name: "OLayer",
props: layerProps,
emits: ["change", "update:visible", "click:mask", "click:button"],
setup(__props, { expose: __expose, emit: __emit }) {
const props = __props;
const emits = __emit;
const visible = vue.ref(props.visible);
const toMount = vue.ref(props.visible);
const zIndex = vue.ref(visible.value ? createTopZIndex() : 0);
const isToBody = vue.ref(false);
const LayerClass = {
OPEN: "o-layer-open"
};
const mainRef = vue.ref(null);
let mouse = useMouse({
type: "client"
});
const layerRef = vue.ref(null);
let wrapperEl = null;
const initWrapperEl = () => {
if (!wrapperEl && layerRef.value) {
wrapperEl = layerRef.value.offsetParent;
if (!wrapperEl) {
wrapperEl = document.body;
isToBody.value = true;
} else {
isToBody.value = wrapperEl === document.body;
}
}
return wrapperEl;
};
const handleWrapperScroll = () => {
vue.nextTick(() => {
initWrapperEl();
if (wrapperEl) {
if (visible.value) {
wrapperEl.classList.add(LayerClass.OPEN);
} else {
wrapperEl.classList.remove(LayerClass.OPEN);
}
}
});
};
const mainStyle = vue.ref({});
const getOriginStyle = () => {
let ox = "center";
let oy = "center";
if (mainRef.value && mouse) {
const { offsetLeft, offsetTop } = mainRef.value;
if (isToBody.value) {
ox = `${mouse.x.value - offsetLeft}px`;
oy = `${mouse.y.value - offsetTop}px`;
} else if (wrapperEl) {
const size2 = wrapperEl.getBoundingClientRect();
ox = `${mouse.x.value - offsetLeft - size2.x}px`;
oy = `${mouse.y.value - offsetTop - size2.y}px`;
}
}
return `${ox} ${oy}`;
};
const updateOrigin = (_el) => {
if (props.transitionOrign === "mouse") {
initWrapperEl();
mainStyle.value.transformOrigin = getOriginStyle();
}
};
const beforeToggle = async (show) => {
let goon = true;
if (show) {
if (isFunction(props.beforeShow)) {
goon = await props.beforeShow();
}
} else {
if (isFunction(props.beforeHide)) {
goon = await props.beforeHide();
}
}
return goon !== false;
};
const updateZIndex = (show) => {
if (show) {
zIndex.value = createTopZIndex();
} else {
removeZIndex(zIndex.value);
}
};
vue.watch(
() => props.visible,
async (v) => {
if (visible.value !== v) {
const goon = await beforeToggle(v);
if (!goon) {
emits("update:visible", visible.value);
return;
}
updateZIndex(v);
visible.value = v;
emits("change", v);
handleWrapperScroll();
}
}
);
const toggle = async (show) => {
if (visible.value === show) {
return;
}
let toShow = show === void 0 ? !visible.value : show;
const goon = await beforeToggle(toShow);
if (!goon) {
return;
}
updateZIndex(toShow);
visible.value = toShow;
emits("update:visible", visible.value);
emits("change", visible.value);
handleWrapperScroll();
};
const isMounted = vue.computed(() => {
return !props.unmountOnHide || visible.value || toMount.value;
});
const handleTransitionStart = () => {
toMount.value = true;
};
const handleTransitionEnter = () => {
if (visible.value) {
updateOrigin(mainRef.value);
}
};
const handleTransitionEnd = () => {
if (!props.unmountOnHide) {
toMount.value = false;
} else if (!visible.value) {
toMount.value = false;
}
};
const onMaskClick = (e) => {
if (props.maskClose) {
toggle(false);
}
emits("click:mask", e);
};
const onCloseButtonClick = (e) => {
toggle(false);
emits("click:button", e);
};
vue.onMounted(() => {
if (visible.value) {
handleWrapperScroll();
}
});
vue.onUnmounted(() => {
mouse == null ? void 0 : mouse.destroy();
wrapperEl == null ? void 0 : wrapperEl.classList.remove(LayerClass.OPEN);
});
__expose({
/** Toggle the OLayer */
toggle
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createBlock(vue.Teleport, {
to: props.wrapper,
disabled: !props.wrapper
}, [
isMounted.value ? vue.withDirectives((vue.openBlock(), vue.createElementBlock(
"div",
vue.mergeProps({
key: 0,
ref_key: "layerRef",
ref: layerRef,
class: ["o-layer", { "o-layer-to-body": isToBody.value }]
}, _ctx.$attrs, {
style: {
"--layer-z-index": zIndex.value
}
}),
[
props.mask ? (vue.openBlock(), vue.createBlock(vue.Transition, {
key: 0,
name: props.maskTransition,
appear: true,
persisted: ""
}, {
default: vue.withCtx(() => [
vue.withDirectives(vue.createElementVNode(
"div",
{
class: "o-layer-mask",
onClick: onMaskClick
},
null,
512
/* NEED_PATCH */
), [
[vue.vShow, visible.value]
])
]),
_: 1
/* STABLE */
}, 8, ["name"])) : vue.createCommentVNode("v-if", true),
vue.createVNode(vue.Transition, {
appear: true,
name: props.mainTransition,
onBeforeEnter: handleTransitionStart,
onEnter: handleTransitionEnter,
onAfterEnter: handleTransitionEnd,
onBeforeLeave: handleTransitionStart,
onAfterLeave: handleTransitionEnd,
persisted: ""
}, {
default: vue.withCtx(() => [
vue.withDirectives(vue.createElementVNode(
"div",
{
ref_key: "mainRef",
ref: mainRef,
class: vue.normalizeClass([props.mainClass, "o-layer-main"]),
style: vue.normalizeStyle(mainStyle.value)
},
[
vue.renderSlot(_ctx.$slots, "default")
],
6
/* CLASS, STYLE */
), [
[vue.vShow, visible.value]
])
]),
_: 3
/* FORWARDED */
}, 8, ["name"]),
props.buttonClose ? (vue.openBlock(), vue.createElementBlock("div", {
key: 1,
class: "o-layer-close",
onClick: onCloseButtonClick
}, [
vue.renderSlot(_ctx.$slots, "close", {}, () => [
vue.createVNode(vue.unref(OIcon), {
button: "",
icon: vue.unref(IconClose),
class: "o-layer-close-icon"
}, null, 8, ["icon"])
])
])) : vue.createCommentVNode("v-if", true)
],
16
/* FULL_PROPS */
)), [
[vue.vShow, visible.value || toMount.value]
]) : vue.createCommentVNode("v-if", true)
], 8, ["to", "disabled"]);
};
}
});
const OLayer = Object.assign(_sfc_main$$, {
install(app) {
app.component("OLayer", _sfc_main$$);
}
});
const figureProps = {
/**
* 地址
*/
src: {
type: String,
required: true
},
/**
* 长宽比
*/
ratio: {
type: Number
},
/**
* 填充方式 cover | contain | fill | none | scale-down
*/
fit: {
type: String
},
/**
* img alt
*/
alt: {
type: String
},
/**
* 使用背景
*/
background: {
type: Boolean
},
/**
* 可hover
*/
hoverable: {
type: Boolean
},
/**
* 链接跳转
*/
href: {
type: String
},
/**
* 预置随机多彩背景
*/
colorful: {
type: Boolean
},
/**
* 预览
*/
preview: {
type: Boolean
},
/**
* 支持通过实例接口调用预览
*/
lazyPreiew: {
type: Boolean
},
/**
* 视频预览图
*/
videoPoster: {
type: Boolean
},
/**
* 关闭预览方式
*/
previewClose: {
type: [String, Array]
},
/**
* 图片懒加载
* [false]: 立即加载
* [true]: 启用懒加载,根据与视口的位置关系判断是否加载图片
* 1. background为false时,使用原生img loading=lazy判断是否加载
* 2. background为true时,使用IntersectionObserver检测是否进入视口,加载图片
* [IntersectionObserverInit]: { root, rootMargin, threshold },指定使用IntersectionObserver检测是否进入视口
* 配置参见 https://developer.mozilla.org/zh-CN/docs/Web/API/IntersectionObserver/IntersectionObserver
*/
lazy: {
type: [Boolean, Object]
}
};
const _hoisted_1$D = {
key: 0,
class: "o-figure-error-wrap"
};
const _hoisted_2$v = ["src", "alt", "loading"];
const _hoisted_3$n = ["src", "alt", "loading"];
const _hoisted_4$j = {
key: 1,
class: "o-figure-main"
};
const _hoisted_5$c = {
key: 0,
class: "o-figure-mask"
};
const _hoisted_6$a = { class: "o-figure-play-icon" };
const _hoisted_7$5 = {
key: 1,
class: "o-figure-content"
};
const _hoisted_8$2 = { class: "o-figure-title" };
const _hoisted_9$2 = { class: "o-figure-preview-img" };
const _hoisted_10$2 = ["src"];
const _sfc_main$_ = /* @__PURE__ */ vue.defineComponent({
__name: "OFigure",
props: figureProps,
emits: ["error", "load", "preview"],
setup(__props, { expose: __expose, emit: __emit }) {
const props = __props;
const emits = __emit;
const imgRef = vue.ref(null);
const { isPhonePad } = useScreen();
const isLoading = vue.ref(true);
const isError = vue.ref(false);
const prestColor = props.colorful ? defaultPrestColorPool.value.pick() : "";
const imgSrc = vue.ref(void 0);
const bgUrl = vue.computed(() => props.background && imgSrc.value ? `url(${imgSrc.value})` : void 0);
const useObserver = props.lazy && props.background || isObject(props.lazy);
const onImgLoaded = () => {
isLoading.value = false;
isError.value = false;
emits("load");
};
const onImgError = () => {
isLoading.value = false;
isError.value = true;
emits("error");
};
vue.watchEffect(() => {
if (!props.src) {
return;
}
if (props.lazy === false) {
imgSrc.value = props.src;
} else {
if (!useObserver) {
imgSrc.value = props.src;
}
}
if (props.background && imgSrc.value) {
requestImage(imgSrc.value).then(onImgLoaded).catch(onImgError);
}
});
let io2 = null;
const rootEl = vue.ref(null);
vue.onMounted(() => {
if (imgRef.value && imgRef.value.complete && imgSrc.value) {
onImgLoaded();
}
if (useObserver) {
io2 = useIntersectionObserver(isObject(props.lazy) ? props.lazy : {});
if (rootEl.value) {
io2 == null ? void 0 : io2.observe(rootEl.value.$el, (entry) => {
if (entry.isIntersecting) {
imgSrc.value = props.src;
}
});
}
}
});
const paddingTop = vue.computed(() => {
if (props.ratio) {
return `${(1 / props.ratio * 100).toFixed(2)}%`;
}
return "";
});
const previewVisible = vue.ref(false);
const canPreview = vue.computed(() => props.preview || props.lazyPreiew);
const previewCloseTypes = vue.computed(() => {
if (!props.previewClose) {
return isPhonePad.value ? ["image", "mask", "button"] : ["mask", "button"];
} else if (Array.isArray(props.previewClose)) {
return props.previewClose;
}
return [props.previewClose];
});
const isMaskClose = vue.computed(() => previewCloseTypes.value.includes("mask"));
const isButtonClose = vue.computed(() => previewCloseTypes.value.includes("button"));
const isBodyClose = vue.computed(() => previewCloseTypes.value.includes("body"));
const preview = (visible = true) => {
if (canPreview.value) {
previewVisible.value = visible;
}
};
const onPreviewChange = (visible) => {
emits("preview", visible);
};
const onPreviewImgClick = () => {
if (isBodyClose.value) {
previewVisible.value = false;
}
};
const onFigureClick = () => {
if (props.preview) {
preview();
}
};
__expose({
preview
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createBlock(vue.unref(HtmlTag), {
tag: !!props.href ? "a" : "div",
class: vue.normalizeClass(["o-figure", {
"is-loading": isLoading.value,
"is-error": isError.value,
"is-colorful": props.colorful,
"o-figure-hoverable": props.hoverable || !!props.href || props.preview || props.videoPoster,
"o-figure-previewable": props.preview,
"o-figure-video-poster": props.videoPoster
}]),
href: props.href,
style: vue.normalizeStyle({
"--figure-prest-color": vue.unref(prestColor),
"--figure-padding-top": paddingTop.value,
"--figure-fit": props.fit
}),
onClick: onFigureClick,
ref_key: "rootEl",
ref: rootEl
}, {
default: vue.withCtx(() => [
imgSrc.value ? (vue.openBlock(), vue.createElementBlock(
vue.Fragment,
{ key: 0 },
[
paddingTop.value || isError.value ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 0,
class: vue.normalizeClass(["o-figure-wrap", {
"o-figure-bg": props.background
}]),
style: vue.normalizeStyle({
backgroundImage: bgUrl.value
})
},
[
isError.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$D, [
vue.renderSlot(_ctx.$slots, "error", {}, () => [
vue.createVNode(vue.unref(IconImageError))
])
])) : !props.background ? (vue.openBlock(), vue.createElementBlock("img", {
key: 1,
ref_key: "imgRef",
ref: imgRef,
src: imgSrc.value,
alt: props.alt,
class: "o-figure-img-ratio",
loading: props.lazy === true ? "lazy" : "eager",
onLoad: onImgLoaded,
onError: onImgError
}, null, 40, _hoisted_2$v)) : vue.createCommentVNode("v-if", true)
],
6
/* CLASS, STYLE */
)) : !isError.value ? (vue.openBlock(), vue.createElementBlock("img", {
key: 1,
ref_key: "imgRef",
ref: imgRef,
src: imgSrc.value,
alt: props.alt,
class: "o-figure-img",
loading: props.lazy === true ? "lazy" : "eager",
onLoad: onImgLoaded,
onError: onImgError
}, null, 40, _hoisted_3$n)) : vue.createCommentVNode("v-if", true)
],
64
/* STABLE_FRAGMENT */
)) : vue.createCommentVNode("v-if", true),
props.videoPoster || _ctx.$slots.content || _ctx.$slots.title || _ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$j, [
vue.renderSlot(_ctx.$slots, "default"),
props.videoPoster ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$c, [
vue.renderSlot(_ctx.$slots, "play-icon", {}, () => [
vue.createElementVNode("div", _hoisted_6$a, [
vue.createVNode(vue.unref(IconVideoPlay))
])
])
])) : vue.createCommentVNode("v-if", true),
_ctx.$slots.content || _ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$5, [
vue.renderSlot(_ctx.$slots, "content", {}, () => [
vue.createElementVNode("div", _hoisted_8$2, [
vue.renderSlot(_ctx.$slots, "title")
])
])
])) : vue.createCommentVNode("v-if", true)
])) : vue.createCommentVNode("v-if", true),
canPreview.value ? (vue.openBlock(), vue.createBlock(vue.unref(OLayer), {
key: 2,
visible: previewVisible.value,
"onUpdate:visible": _cache[0] || (_cache[0] = ($event) => previewVisible.value = $event),
class: "o-figure-preview-layer",
onChange: onPreviewChange,
"mask-close": isMaskClose.value,
"button-close": isButtonClose.value
}, {
default: vue.withCtx(() => [
vue.createElementVNode("div", {
class: "o-figure-preview-wrapper",
onClick: onPreviewImgClick
}, [
vue.renderSlot(_ctx.$slots, "preview", { image: imgSrc.value }, () => [
vue.createElementVNode("div", _hoisted_9$2, [
vue.createElementVNode("img", { src: imgSrc.value }, null, 8, _hoisted_10$2)
]),
vue.renderSlot(_ctx.$slots, "preview-extra")
])
])
]),
_: 3
/* FORWARDED */
}, 8, ["visible", "mask-close", "button-close"])) : vue.createCommentVNode("v-if", true)
]),
_: 3
/* FORWARDED */
}, 8, ["tag", "href", "class", "style"]);
};
}
});
const OFigure = Object.assign(_sfc_main$_, {
install(app) {
app.component("OFigure", _sfc_main$_);
}
});
const _hoisted_1$C = {
key: 1,
class: "o-card-main"
};
const _hoisted_2$u = {
key: 0,
class: "o-card-icon"
};
const _hoisted_3$m = { class: "o-card-main-wrap" };
const _hoisted_4$i = {
key: 0,
class: "o-card-title-icon"
};
const _hoisted_5$b = { class: "o-card-content" };
const _hoisted_6$9 = {
key: 0,
class: "o-card-footer"
};
const _sfc_main$Z = /* @__PURE__ */ vue.defineComponent({
__name: "OCard",
props: cardProps,
setup(__props) {
const props = __props;
const slots = vue.useSlots();
const hasMain = vue.computed(
() => slots.main || props.icon || slots.icon || props.title || slots.title || slots.header || props.detail || slots.detail || slots.default
);
const isTitleLimited = vue.computed(() => {
return !isUndefined(props.titleMaxRow);
});
const isDetailLimited = vue.computed(() => {
return !isUndefined(props.detailMaxRow);
});
const hasTitleIcon = vue.computed(() => {
return props.titleIcon;
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createBlock(vue.unref(HtmlTag), {
tag: !!props.href ? "a" : "div",
href: props.href,
class: vue.normalizeClass(["o-card", [
`o-card-layout-${props.layout}`,
{
"o-card-hoverable": props.hoverable || !!props.href,
"o-card-cursor-pointer": props.cursor === "pointer" || !!props.href,
"o-card-no-responsive": props.noResponsive
}
]]),
tabindex: "-1"
}, {
default: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "card", {}, () => [
vue.createCommentVNode(" cover "),
!!slots.cover || props.cover ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 0,
class: vue.normalizeClass(["o-card-cover", [
props.coverClass,
`o-card-cover-${props.layout}`,
{
"o-card-only-cover": !hasMain.value
}
]])
},
[
vue.renderSlot(_ctx.$slots, "cover", {}, () => [
vue.createVNode(vue.unref(OFigure), {
ratio: props.coverRatio,
class: vue.normalizeClass(["o-card-cover-img", { "is-full": !props.coverRatio }]),
src: props.cover,
fit: props.coverFit
}, null, 8, ["ratio", "src", "fit", "class"])
])
],
2
/* CLASS */
)) : vue.createCommentVNode("v-if", true),
!!hasMain.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$C, [
vue.renderSlot(_ctx.$slots, "main", {}, () => [
vue.createCommentVNode(" icon "),
props.icon || !!slots.icon ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$u, [
vue.renderSlot(_ctx.$slots, "icon", {}, () => [
vue.unref(isString)(props.icon) ? (vue.openBlock(), vue.createBlock(vue.unref(OFigure), {
key: 0,
src: props.icon
}, null, 8, ["src"])) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(props.icon), { key: 1 }))
])
])) : vue.createCommentVNode("v-if", true),
vue.createElementVNode("div", _hoisted_3$m, [
vue.createElementVNode("div", null, [
vue.createCommentVNode(" header "),
props.title || !!slots.header || !!slots.title ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 0,
class: vue.normalizeClass({
"o-card-header": true,
"o-card-header-with-icon": hasTitleIcon.value
})
},
[
vue.renderSlot(_ctx.$slots, "header", {}, () => [
hasTitleIcon.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$i, [
vue.unref(isString)(props.titleIcon) ? (vue.openBlock(), vue.createBlock(vue.unref(OFigure), {
key: 0,
src: props.titleIcon,
class: "o-card-title-icon-figure"
}, null, 8, ["src"])) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(props.titleIcon), { key: 1 }))
])) : vue.createCommentVNode("v-if", true),
props.title ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 1,
class: vue.normalizeClass(["o-card-title", { "o-card-title-limited": isTitleLimited.value }]),
style: vue.normalizeStyle({ "--card-title-row": props.titleRow, "--card-title-max-row": props.titleMaxRow })
},
[
vue.renderSlot(_ctx.$slots, "title", {}, () => [
vue.createTextVNode(
vue.toDisplayString(props.title),
1
/* TEXT */
)
])
],
6
/* CLASS, STYLE */
)) : vue.createCommentVNode("v-if", true)
])
],
2
/* CLASS */
)) : vue.createCommentVNode("v-if", true),
vue.createCommentVNode(" content "),
vue.createElementVNode("div", _hoisted_5$b, [
props.detail || !!slots.detail ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 0,
class: vue.normalizeClass(["o-card-detail", { "o-card-detail-limited": isDetailLimited.value }]),
style: vue.normalizeStyle({ "--card-detail-row": props.detailRow, "--card-detail-max-row": props.detailMaxRow })
},
[
vue.renderSlot(_ctx.$slots, "detail", {}, () => [
vue.createTextVNode(
vue.toDisplayString(props.detail),
1
/* TEXT */
)
])
],
6
/* CLASS, STYLE */
)) : vue.createCommentVNode("v-if", true),
vue.renderSlot(_ctx.$slots, "default")
])
]),
vue.createCommentVNode(" footer "),
!!slots.footer ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$9, [
vue.renderSlot(_ctx.$slots, "footer")
])) : vue.createCommentVNode("v-if", true)
])
])
])) : vue.createCommentVNode("v-if", true)
])
]),
_: 3
/* FORWARDED */
}, 8, ["tag", "href", "class"]);
};
}
});
const OCard = Object.assign(_sfc_main$Z, {
install(app) {
app.component("OCard", _sfc_main$Z);
}
});
function noop() {
}
class OPointer {
constructor(el, options) {
__publicField(this, "el");
__publicField(this, "x1");
__publicField(this, "y1");
__publicField(this, "onStart");
__publicField(this, "onMove");
__publicField(this, "onEnd");
__publicField(this, "removeListener");
this.el = el;
this.x1 = 0;
this.y1 = 0;
this.bind();
this.onStart = options.onStart || noop;
this.onMove = options.onMove || noop;
this.onEnd = options.onEnd || noop;
this.removeListener = null;
}
bind() {
this.el.addEventListener("touchstart", (e) => {
const { pageX: x, pageY: y } = e.touches[0];
this.x1 = x;
this.y1 = y;
const moveFn = this.onPointerMove.bind(this);
const upFn = this.onPointerUp.bind(this);
window.addEventListener("touchmove", moveFn, { passive: false });
window.addEventListener("touchend", upFn);
window.addEventListener("touchcancel", upFn);
this.removeListener = () => {
window.removeEventListener("touchmove", moveFn);
window.removeEventListener("touchend", upFn);
window.removeEventListener("touchcancel", upFn);
};
this.onStart(
{
x,
y
},
e
);
});
}
onPointerMove(e) {
const { pageX: x, pageY: y } = e.touches[0];
let dx = x - this.x1;
let dy = y - this.y1;
this.onMove(
{
x,
y,
dx,
dy
},
e
);
}
onPointerUp(e) {
const { pageX: x, pageY: y } = e.changedTouches[0];
let dx = x - this.x1;
let dy = y - this.y1;
this.onEnd(
{
x,
y,
dx,
dy
},
e
);
if (this.removeListener) {
this.removeListener();
}
}
}
class Effect {
constructor(slideElList, slideContainer, options) {
__publicField(this, "total");
__publicField(this, "currentIndex");
__publicField(this, "activeClass");
__publicField(this, "onTouchstart");
__publicField(this, "onTouchend");
__publicField(this, "onBeforeChange");
__publicField(this, "onChanged");
__publicField(this, "isTouchStart");
// 是否开始touch事件
__publicField(this, "containerEl");
this.total = slideElList.length;
this.containerEl = slideContainer;
this.activeClass = options == null ? void 0 : options.activeClass;
this.currentIndex = -1;
this.isTouchStart = false;
this.onTouchstart = options == null ? void 0 : options.onTouchstart;
this.onTouchend = options == null ? void 0 : options.onTouchend;
this.onBeforeChange = options == null ? void 0 : options.onBeforeChange;
this.onChanged = options == null ? void 0 : options.onChanged;
this.handleTouch();
}
fixIndex(idx) {
const i = idx % this.total;
return i >= 0 ? i : i + this.total;
}
handleTouch() {
if (!supportTouch()) {
return;
}
new OPointer(this.containerEl, {
onStart: () => {
this.isTouchStart = true;
this.handleTouchStart();
if (isFunction(this.onTouchstart)) {
this.onTouchstart();
}
},
onMove: (pos, e) => {
if (!this.isTouchStart) {
return;
}
this.handleTouchMove(pos, e);
},
onEnd: (pos, e) => {
if (!this.isTouchStart) {
return;
}
this.isTouchStart = false;
const toIdx = this.handleTouchEnd(pos, e);
if (typeof toIdx === "number") {
const to = this.fixIndex(toIdx);
this.active(to, true, true);
}
if (isFunction(this.onTouchend)) {
this.onTouchend();
}
}
});
}
}
class Gallery extends Effect {
constructor(slideElList, slideContainer, activeIndex, options) {
super(slideElList, slideContainer, options);
__publicField(this, "container");
__publicField(this, "slideList");
__publicField(this, "alignType");
__publicField(this, "moveValue");
__publicField(this, "isChanging");
__publicField(this, "isSliding");
// 是否在切换
__publicField(this, "oldMoveValue");
__publicField(this, "destroyObserver");
__publicField(this, "resolveArr");
const { alignType = "center" } = options || {};
this.total = slideElList.length;
this.resolveArr = [];
slideContainer.addEventListener("transitionend", () => {
slideContainer.style.willChange = "";
slideContainer.classList.remove("is-animating");
this.isChanging = false;
if (this.resolveArr.length > 0) {
this.resolveArr.forEach((fn) => fn(null));
this.resolveArr = [];
}
});
this.alignType = alignType;
this.moveValue = 0;
this.isChanging = false;
this.isSliding = false;
this.oldMoveValue = 0;
this.slideList = [];
this.container = {
el: slideContainer,
width: 0
};
const or = useResizeObserver();
const listener2 = debounceRAF(() => {
this.update(slideElList, slideContainer);
this.active(activeIndex, false, true);
});
or.observe(slideContainer, listener2);
this.destroyObserver = () => {
or.unobserve(slideContainer, listener2);
};
}
update(slideElList, slideContainer) {
let s = 0;
this.slideList = slideElList.map((el, idx) => {
const w = el.clientWidth;
const l = s;
el.style.left = `${l}px`;
s += w;
return {
index: idx,
el,
width: el.clientWidth,
left: l
};
});
this.container = {
el: slideContainer,
width: slideContainer.clientWidth
};
}
handleTouchStart() {
this.oldMoveValue = this.moveValue;
this.isSliding = true;
}
handleTouchMove(pos, e) {
if (!this.isSliding) {
return;
}
const { dx, dy } = pos;
if (Math.abs(dx) > Math.abs(dy)) {
this.isSliding = true;
e.stopPropagation();
e.preventDefault();
e.stopImmediatePropagation();
this.transformX(this.oldMoveValue + dx, false);
} else {
this.isSliding = false;
}
}
handleTouchEnd(pos) {
this.isSliding = false;
const { width: sw } = this.slideList[this.currentIndex];
const step = Math.abs(pos.dx) / sw > 0.2 ? 1 : 0;
const toIdx = this.currentIndex + (pos.dx < 0 ? step : -1 * step);
return toIdx;
}
active(toIndex, animate = true, force = false) {
if (this.total === 0 || this.isChanging || !force && this.currentIndex === toIndex) {
return Promise.resolve(null);
}
if (this.currentIndex !== toIndex && isFunction(this.onBeforeChange) && this.onBeforeChange(toIndex, this.currentIndex) === false) {
Promise.resolve(null);
}
this.isChanging = animate;
const toSlide = this.slideList[toIndex];
const fromSlide = this.slideList[this.currentIndex];
if (!toSlide) {
return Promise.resolve(null);
}
toSlide.el.classList.add(
"o-carousel-toggle-current"
/* CURRENT */
);
fromSlide == null ? void 0 : fromSlide.el.classList.remove("o-carousel-toggle-current");
if (this.activeClass) {
toSlide.el.classList.add(this.activeClass);
fromSlide == null ? void 0 : fromSlide.el.classList.remove(this.activeClass);
}
if (!toSlide) {
return Promise.resolve(null);
}
const { width: cw } = this.container;
const { width: sw, left: sl } = toSlide;
if (this.alignType === "center") {
return this.transformX((cw - sw) / 2 - sl, animate).then(() => {
if (isFunction(this.onChanged) && this.currentIndex !== toIndex) {
this.onChanged(toIndex, this.currentIndex);
}
this.currentIndex = toIndex;
vue.nextTick().then(() => {
this.loopRange();
});
return toIndex;
});
}
return Promise.resolve(toIndex);
}
loopRange() {
const cidx = this.currentIndex;
const half = (this.total - 1) / 2;
const orderSlideList = [];
const tm = [];
for (let i = cidx; i <= cidx + Math.ceil(half); i++) {
if (i < this.total) {
orderSlideList.push(this.slideList[i]);
tm.push(i);
} else {
orderSlideList.push(this.slideList[i - this.total]);
tm.push(i - this.total);
}
}
for (let i = cidx - 1; i >= cidx - Math.floor(half); i--) {
if (i >= 0) {
orderSlideList.unshift(this.slideList[i]);
tm.unshift(i);
} else {
orderSlideList.unshift(this.slideList[this.total + i]);
tm.unshift(this.total + i);
}
}
let s = 0;
const { left: oldLeft } = this.slideList[cidx];
orderSlideList.forEach((item) => {
const { el, width } = item;
el.style.left = `${s}px`;
item.left = s;
s += width;
});
const { left: newLeft } = this.slideList[cidx];
const d = newLeft - oldLeft;
this.transformX(this.moveValue - d, false);
}
transformX(value, animate = true) {
return new Promise((resolve) => {
this.moveValue = value;
this.isChanging = false;
const { el } = this.container;
if (animate === true) {
el.classList.add("is-animating");
}
el.style.transform = `translate3d(${value}px,0,0)`;
if (animate) {
this.resolveArr.push(resolve);
} else {
resolve(null);
}
});
}
destroyed() {
if (isFunction(this.destroyObserver)) {
this.destroyObserver();
}
}
}
class Toggle extends Effect {
constructor(slideElList, slideContainer, activeIndex, options) {
super(slideElList, slideContainer, options);
__publicField(this, "slideList");
__publicField(this, "isChanging");
__publicField(this, "resolveArr");
this.isChanging = false;
this.resolveArr = [];
this.slideList = slideElList.map((el, idx) => {
el.addEventListener("animationend", () => {
el.classList.remove(
"o-carousel-toggle-in",
"o-carousel-toggle-out"
/* OUT */
);
this.isChanging = false;
if (idx === this.currentIndex) {
this.resolveArr.forEach((fn) => fn(null));
this.resolveArr = [];
}
});
return {
index: idx,
el
};
});
this.active(activeIndex, false, false);
}
handleTouchStart() {
}
handleTouchMove() {
}
handleTouchEnd(pos) {
if (this.isChanging) {
return;
}
const { dx, dy } = pos;
let toIdx = this.currentIndex;
if (Math.abs(dy) < Math.abs(dx) && Math.abs(dx) > 20) {
toIdx += dx < 0 ? 1 : -1;
return toIdx;
}
return;
}
active(toIndex, animate = true, force = false) {
return new Promise((resolve) => {
if (this.total === 0 || this.isChanging || !force && this.currentIndex === toIndex) {
return resolve(null);
}
if (this.currentIndex !== toIndex && isFunction(this.onBeforeChange) && this.onBeforeChange(toIndex, this.currentIndex) === false) {
Promise.resolve(null);
}
this.isChanging = animate;
const toSlide = this.slideList[toIndex];
const fromSlide = this.slideList[this.currentIndex];
if (!toSlide) {
return resolve(null);
}
fromSlide == null ? void 0 : fromSlide.el.classList.remove("o-carousel-toggle-current");
toSlide.el.classList.add(
"o-carousel-toggle-current"
/* CURRENT */
);
if (this.activeClass) {
toSlide.el.classList.add(this.activeClass);
fromSlide == null ? void 0 : fromSlide.el.classList.remove(this.activeClass);
}
if (animate) {
toSlide.el.classList.add(
"o-carousel-toggle-in"
/* IN */
);
fromSlide.el.classList.add(
"o-carousel-toggle-out"
/* OUT */
);
this.resolveArr.push(resolve);
} else {
return resolve(toIndex);
}
}).then(() => {
if (isFunction(this.onChanged) && this.currentIndex !== toIndex) {
this.onChanged(toIndex, this.currentIndex);
}
this.currentIndex = toIndex;
return toIndex;
});
}
destroyed() {
}
}
const carouselInjectKey = Symbol("provide-carousel");
const carouselProps = {
/**
* @zh-CN 激活索引 (v-model)
* @en-US Active index (v-model)
*/
activeIndex: {
type: Number
},
/**
* @zh-CN 切换效果
* @en-US Switch effect
* @default 'gallery'
*/
effect: {
type: String,
default: "gallery"
},
/**
* @zh-CN 自动播放
* @en-US Auto play
*/
autoPlay: {
type: Boolean
},
/**
* @zh-CN 播放间隔
* @en-US Play interval
* @default 5000
*/
interval: {
type: Number,
default: 5e3
},
/**
* @zh-CN 箭头显示时机
* @en-US Arrow display timing
* @default 'hover'
*/
arrow: {
type: String,
default: "hover"
},
/**
* @zh-CN 箭头容器类
* @en-US Arrow container class
*/
arrowWrapClass: {
type: [String, Array]
},
/**
* @zh-CN 隐藏指示器
* @en-US Hide indicator
*/
hideIndicator: {
type: Boolean
},
/**
* @zh-CN 指示器点击切换
* @en-US Indicator click to switch
*/
indicatorClick: {
type: Boolean
},
/**
* @zh-CN 指示器容器类
* @en-US Indicator container class
*/
indicatorWrapClass: {
type: [String, Array]
},
/**
* @zh-CN 点击卡片切换
* @en-US Click card to switch
*/
clickToSwitch: {
type: Boolean
},
/**
* @zh-CN 手动初始化,调用instance.init()
* @en-US Manual initialization, call instance.init()
*/
manualInit: {
type: Boolean
},
/**
* @zh-CN 自定义激活类
* @en-US Custom active class
*/
activeClass: {
type: String
},
/**
* @zh-CN 鼠标悬停时暂停自动切换
* @en-US Pause auto switching when mouse hover
*/
pauseOnHover: {
type: Boolean
}
};
const _hoisted_1$B = { class: "o-carousel-wrap" };
const _hoisted_2$t = ["onClick"];
const _hoisted_3$l = { class: "o-carousel-arrow-prev" };
const _hoisted_4$h = { class: "o-carousel-arrow-icon" };
const _hoisted_5$a = { class: "o-carousel-arrow-next" };
const _hoisted_6$8 = { class: "o-carousel-arrow-icon" };
const _sfc_main$Y = /* @__PURE__ */ vue.defineComponent({
__name: "OCarousel",
props: carouselProps,
emits: ["before-change", "change", "update:activeIndex", "pause"],
setup(__props, { expose: __expose, emit: __emit }) {
const props = __props;
const emits = __emit;
const containerRef = vue.ref(null);
const total = vue.computed(() => {
var _a;
return (_a = containerRef.value) == null ? void 0 : _a.children.length;
});
const isAutoPlay = vue.ref(props.autoPlay);
vue.watch(
() => props.autoPlay,
(a) => {
isAutoPlay.value = a;
}
);
const fixIndex = (idx) => {
if (!total.value) {
return idx;
}
const i = idx % total.value;
return i >= 0 ? i : i + total.value;
};
const activeIndex = vue.ref(props.activeIndex ? fixIndex(props.activeIndex) : 0);
vue.watch(
() => props.activeIndex,
(v) => {
activeIndex.value = v ?? 0;
}
);
const initialized = vue.ref(false);
const slidesRef = vue.ref(null);
const slideElList = vue.computed(() => {
var _a;
const c = (_a = containerRef.value) == null ? void 0 : _a.children;
return c ? Array.from(c).map((el) => el) : null;
});
let slidesInstance = null;
let isChanging = false;
const activeSlideByIndex = (index) => {
return new Promise((resolve) => {
const to = fixIndex(index);
const from = activeIndex.value;
if (isChanging || !slideElList.value) {
resolve(false);
return;
}
if (to === from) {
resolve(true);
return;
}
isChanging = true;
if (slidesInstance) {
activeIndex.value = to;
emits("update:activeIndex", to);
slidesInstance.active(to).then(() => {
isChanging = false;
resolve(true);
});
} else {
isChanging = false;
resolve(false);
}
});
};
let timer = null;
const isPlaying = vue.ref(isAutoPlay.value);
const pausePlay = () => {
if (timer) {
clearInterval(timer);
timer = null;
isPlaying.value = false;
emits("pause", activeIndex.value);
}
};
const resumePlay = () => {
if (isAutoPlay.value) {
setTimeout(() => {
startPlay();
}, 0);
}
};
const startPlay = () => {
pausePlay();
isPlaying.value = true;
timer = window.setInterval(() => {
activeSlideByIndex(activeIndex.value + 1);
}, props.interval);
};
const activeSlide = (index, resumeAutoPlay = true) => {
pausePlay();
return activeSlideByIndex(index).then((success) => {
if (!success) {
return;
}
if (!props.pauseOnHover || resumeAutoPlay) {
resumePlay();
}
});
};
const initSlides = () => {
if (!slideElList.value || !containerRef.value || initialized.value) {
return;
}
const options = {
activeClass: props.activeClass,
onTouchstart: () => {
pausePlay();
},
onTouchend: () => {
resumePlay();
},
onBeforeChange: (to, from) => {
emits("before-change", to, from);
},
onChanged: (to, from) => {
activeIndex.value = to;
emits("update:activeIndex", to);
emits("change", to, from);
}
};
let EffectType = null;
switch (props.effect) {
case "gallery": {
EffectType = Gallery;
break;
}
case "toggle": {
EffectType = Toggle;
break;
}
default: {
EffectType = Gallery;
break;
}
}
if (EffectType) {
slidesInstance = new EffectType(slideElList.value, containerRef.value, activeIndex.value, options);
}
if (props.clickToSwitch) {
slideElList.value.forEach((el, idx) => {
el.addEventListener("click", () => {
if (idx !== activeIndex.value) {
activeSlide(idx);
}
});
});
}
initialized.value = true;
};
vue.watch(
() => props.autoPlay,
(v) => {
if (v) {
startPlay();
} else {
pausePlay();
}
}
);
const init = () => {
initSlides();
if (isAutoPlay.value) {
startPlay();
}
};
vue.onMounted(() => {
if (!props.manualInit) {
init();
}
});
vue.onUnmounted(() => {
if (timer) {
clearInterval(timer);
timer = null;
}
slidesInstance == null ? void 0 : slidesInstance.destroyed();
});
vue.provide(carouselInjectKey, {
effect: props.effect
});
const play = () => {
isAutoPlay.value = true;
startPlay();
};
const pause = () => {
isAutoPlay.value = false;
pausePlay();
};
const onHoverIn = () => {
if (props.pauseOnHover) {
pausePlay();
}
};
const onHoverOut = () => {
if (props.pauseOnHover) {
resumePlay();
}
};
__expose({
init,
play,
pause,
active: activeSlide
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"div",
{
ref_key: "slidesRef",
ref: slidesRef,
class: vue.normalizeClass(["o-carousel", [
{
"o-carousel-visible": initialized.value,
"o-carousel-click-to-switch": props.clickToSwitch,
"o-carousel-hover-arrow": props.arrow === "hover",
"o-carousel-autoplay": isAutoPlay.value,
"is-playing": isPlaying.value
},
`o-carousel-effect-${props.effect}`
]]),
style: vue.normalizeStyle({
"--carousel-interval": props.interval + "ms"
}),
onMouseenter: onHoverIn,
onMouseleave: onHoverOut
},
[
vue.createElementVNode("div", _hoisted_1$B, [
vue.createElementVNode(
"div",
{
ref_key: "containerRef",
ref: containerRef,
class: vue.normalizeClass([`o-carousel-container-${props.effect}`])
},
[
vue.renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
)
]),
!props.hideIndicator ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 0,
class: vue.normalizeClass(["o-carousel-indicator-wrap", props.indicatorWrapClass])
},
[
(vue.openBlock(true), vue.createElementBlock(
vue.Fragment,
null,
vue.renderList(total.value, (item, idx) => {
return vue.openBlock(), vue.createElementBlock("div", {
key: item,
class: "o-carousel-indicator-item",
onClick: ($event) => props.indicatorClick && activeSlide(idx)
}, [
vue.renderSlot(_ctx.$slots, "indicator", {
active: item - 1 === activeIndex.value,
index: idx
}, () => [
vue.createElementVNode(
"div",
{
class: vue.normalizeClass(["o-carousel-indicator-bar", {
"o-carousel-indicator-bar-selected": item - 1 === activeIndex.value
}])
},
_cache[2] || (_cache[2] = [
vue.createElementVNode(
"div",
{ class: "o-carousel-indicator-line" },
null,
-1
/* HOISTED */
)
]),
2
/* CLASS */
)
])
], 8, _hoisted_2$t);
}),
128
/* KEYED_FRAGMENT */
))
],
2
/* CLASS */
)) : vue.createCommentVNode("v-if", true),
props.arrow !== "never" ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 1,
class: vue.normalizeClass(["o-carousel-arrow-wrap", props.arrowWrapClass])
},
[
vue.createElementVNode("div", {
onClick: _cache[0] || (_cache[0] = ($event) => activeSlide(activeIndex.value - 1, false))
}, [
vue.renderSlot(_ctx.$slots, "arrow-prev", {}, () => [
vue.createElementVNode("div", _hoisted_3$l, [
vue.createElementVNode("div", _hoisted_4$h, [
vue.renderSlot(_ctx.$slots, "arrow-prev-icon", {}, () => [
vue.createVNode(vue.unref(IconChevronLeft))
])
])
])
])
]),
vue.createElementVNode("div", {
onClick: _cache[1] || (_cache[1] = ($event) => activeSlide(activeIndex.value + 1, false))
}, [
vue.renderSlot(_ctx.$slots, "arrow-next", {}, () => [
vue.createElementVNode("div", _hoisted_5$a, [
vue.createElementVNode("div", _hoisted_6$8, [
vue.renderSlot(_ctx.$slots, "arrow-next-icon", {}, () => [
vue.createVNode(vue.unref(IconChevronRight))
])
])
])
])
])
],
2
/* CLASS */
)) : vue.createCommentVNode("v-if", true)
],
38
/* CLASS, STYLE, NEED_HYDRATION */
);
};
}
});
const _sfc_main$X = /* @__PURE__ */ vue.defineComponent({
__name: "OCarouselItem",
setup(__props) {
const injection = vue.inject(carouselInjectKey);
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"div",
{
class: vue.normalizeClass([vue.unref(injection) ? `o-carousel-item-${vue.unref(injection).effect}` : "o-carousel-item"])
},
[
vue.renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
);
};
}
});
const OCarousel = Object.assign(_sfc_main$Y, {
OCarouselItem: _sfc_main$X,
install(app) {
app.component("OCarousel", _sfc_main$Y);
}
});
const _sfc_main$W = /* @__PURE__ */ vue.defineComponent({
__name: "ScrollbarRail",
props: {
direction: { default: "y" },
thumbRate: {},
offsetRate: { default: 0 },
notStepJump: { type: Boolean },
size: { default: "medium" }
},
emits: ["scroll"],
setup(__props, { emit: __emit }) {
const props = __props;
const emits = __emit;
const isY = vue.computed(() => props.direction === "y");
const isDarggingBar = vue.ref(false);
const barRef = vue.ref(null);
const thumbRef = vue.ref(null);
const trackLength = vue.ref(0);
const thumbSize = vue.computed(() => {
if (trackLength.value && props.thumbRate) {
return Math.round(trackLength.value * props.thumbRate);
}
return 0;
});
const thumbSizeStyle = vue.computed(() => {
return `${thumbSize.value}px`;
});
const maxOffset = vue.computed(() => trackLength.value - thumbSize.value);
const sizeProp = vue.computed(() => {
return isY.value ? "height" : "width";
});
const offsetProp = vue.computed(() => {
return isY.value ? "translateY" : "translateX";
});
const offset = vue.ref(0);
vue.watch(
() => [props.offsetRate, trackLength.value],
(val) => {
if (!isDarggingBar.value) {
offset.value = Math.round(val[1] * val[0]);
}
},
{
immediate: true
}
);
const offsetStyle = vue.computed(() => {
return `${offsetProp.value}(${offset.value}px)`;
});
const adjustOffset2 = (pos) => {
if (pos < 0) {
return 0;
}
if (pos > maxOffset.value) {
return maxOffset.value;
}
return pos;
};
vue.onMounted(() => {
if (!barRef.value) {
return;
}
const { offsetHeight, offsetWidth } = barRef.value;
trackLength.value = props.direction === "x" ? offsetWidth : offsetHeight;
});
let s = 0;
let oldOffset = 0;
const onMouseMove = (e) => {
const pos = isY.value ? e.clientY : e.clientX;
const v = oldOffset + pos - s;
const of = adjustOffset2(v);
if (of !== offset.value) {
offset.value = of;
emits("scroll", offset.value / trackLength.value);
}
};
const onMouseUp = () => {
isDarggingBar.value = false;
window.removeEventListener("mousemove", onMouseMove);
window.removeEventListener("mouseup", onMouseUp);
window.removeEventListener("contextmenu", onMouseUp);
};
const onThumbMouseDown = (e) => {
e.preventDefault();
e.stopPropagation();
isDarggingBar.value = true;
s = isY.value ? e.clientY : e.clientX;
oldOffset = offset.value;
window.addEventListener("mousemove", onMouseMove);
window.addEventListener("mouseup", onMouseUp);
window.addEventListener("contextmenu", onMouseUp);
};
const onTrackClick = (e) => {
e.preventDefault();
if (!thumbRef.value || !barRef.value) {
return;
}
const pos = isY.value ? e.clientY : e.clientX;
let v = 0;
if (props.notStepJump) {
const bc = barRef.value.getBoundingClientRect();
v = pos - (isY.value ? bc.top : bc.left) - thumbSize.value / 2;
} else {
const bc = thumbRef.value.getBoundingClientRect();
const isPlus = pos > (isY.value ? bc.top : bc.left);
v = offset.value + thumbSize.value * (isPlus ? 1 : -1);
}
const of = adjustOffset2(v);
if (of !== offset.value) {
offset.value = of;
emits("scroll", offset.value / trackLength.value);
}
};
const onResize = () => {
if (!barRef.value) {
return;
}
const { offsetHeight, offsetWidth } = barRef.value;
trackLength.value = props.direction === "x" ? offsetWidth : offsetHeight;
};
return (_ctx, _cache) => {
return vue.withDirectives((vue.openBlock(), vue.createElementBlock(
"div",
{
ref_key: "barRef",
ref: barRef,
class: vue.normalizeClass(["o-scrollbar-rail", [
`o-scrollbar-${props.direction}`,
`o-scrollbar-${props.size}`,
{
"o-scrollbar-dragging": isDarggingBar.value
}
]]),
onClick: onTrackClick
},
[
vue.createElementVNode(
"div",
{
ref_key: "thumbRef",
ref: thumbRef,
class: vue.normalizeClass(["o-scrollbar-thumb", [
`o-scrollbar-${props.direction}-thumb`,
{
[`o-scrollbar-${props.direction}-thumb-dragging`]: isDarggingBar.value
}
]]),
style: vue.normalizeStyle({
[sizeProp.value]: thumbSizeStyle.value,
transform: offsetStyle.value
}),
onClick: _cache[0] || (_cache[0] = vue.withModifiers(() => {
}, ["stop"])),
onMousedown: onThumbMouseDown
},
[
vue.renderSlot(_ctx.$slots, "thumb", {
direction: props.direction,
dragging: isDarggingBar.value
}, () => [
vue.createElementVNode(
"div",
{
class: vue.normalizeClass([
`o-scrollbar-${props.direction}-thumb-bar`,
{
"is-dragging": isDarggingBar.value
}
])
},
null,
2
/* CLASS */
)
])
],
38
/* CLASS, STYLE, NEED_HYDRATION */
),
vue.renderSlot(_ctx.$slots, "track", {
direction: props.direction
}, () => [
vue.createElementVNode(
"div",
{
class: vue.normalizeClass(["o-scrollbar-track", [`o-scrollbar-${props.direction}-track`]])
},
null,
2
/* CLASS */
)
])
],
2
/* CLASS */
)), [
[vue.unref(vOnResize), onResize]
]);
};
}
});
const ScrollerSizeTypes = ["medium", "small"];
const baseScrollarProps = {
/**
* 禁用横向滚动
*/
disabledX: {
type: Boolean,
required: false
},
/**
* 禁用纵向滚动
*/
disabledY: {
type: Boolean
},
/**
* 滚动条在停止滚动多长时间后隐藏, ms
*/
duration: {
type: Number,
default: 600
},
/**
* 滚动条显示控制
* always:一直显示
* auto: 滚动中、滚动后hover滚动条、拖拽时显示
* hover: 滚动条hover时显示
* never: 不显示滚动条
*/
showType: {
type: String,
default: "auto"
},
/**
* 滚动条尺寸大小
*/
size: {
type: String,
default: "medium"
},
/**
* showType=always时,是否根据滚动容器滚动高度变化自动刷新滚动条
*/
autoUpdateOnScrollSize: {
type: Boolean
},
/**
* 滚动条尺寸大小
*/
barClass: {
type: String
}
};
const scrollerProps = {
...baseScrollarProps,
/**
* 滚动容器类
*/
wrapClass: {
type: [String, Array, Object]
}
};
const scrollbarProps = {
...baseScrollarProps,
/**
* 滚动关联目标容器,支持body、元素ref、HTMLElement
*/
target: {
type: [String, Object],
default: null
}
};
const _sfc_main$V = /* @__PURE__ */ vue.defineComponent({
__name: "OScrollbar",
props: scrollbarProps,
setup(__props, { expose: __expose }) {
const ScrollbarClass2 = {
container: "o-scrollbar-container"
};
const props = __props;
const { isPhonePad } = useScreen();
let scrollTargetEl = null;
let scrollListenEl = null;
const rootRef = vue.ref(null);
const hasY = vue.ref(false);
const hasX = vue.ref(false);
const hThumbRate = vue.ref(0);
const vThumbRate = vue.ref(0);
const hOffsetRate = vue.ref(0);
const vOffsetRate = vue.ref(0);
const isBody = vue.ref(false);
const showXBar = vue.ref(false);
const showYBar = vue.ref(false);
let lastTop = -1;
let lastLeft = -1;
let xTimer = null;
let yTimer = null;
let ro2 = null;
let lastScrollWidth = -1;
let lastScrollHeight = -1;
const updateScrollbar = () => {
if (!scrollTargetEl) {
return;
}
const { clientWidth, clientHeight, scrollWidth, scrollHeight, scrollTop, scrollLeft } = scrollTargetEl;
lastScrollWidth = scrollWidth;
lastScrollHeight = scrollHeight;
hThumbRate.value = clientWidth / scrollWidth;
vThumbRate.value = clientHeight / scrollHeight;
hOffsetRate.value = scrollLeft / scrollWidth;
vOffsetRate.value = scrollTop / scrollHeight;
if (!props.disabledX) {
hasX.value = clientWidth < scrollWidth;
}
if (!props.disabledY) {
hasY.value = clientHeight < scrollHeight;
}
};
const updateScrollbarByScollSize = () => {
if (!scrollTargetEl) {
return;
}
const { scrollWidth, scrollHeight } = scrollTargetEl;
if (lastScrollWidth !== scrollWidth || lastScrollHeight !== scrollHeight) {
updateScrollbar();
}
};
const onScroll = () => {
if (!scrollTargetEl) {
return;
}
const { scrollLeft, scrollWidth, scrollTop, scrollHeight } = scrollTargetEl;
if (lastScrollWidth !== scrollWidth || lastScrollHeight !== scrollHeight) {
updateScrollbar();
}
hOffsetRate.value = scrollLeft / scrollWidth;
vOffsetRate.value = scrollTop / scrollHeight;
if (lastLeft >= 0) {
showXBar.value = scrollLeft !== lastLeft;
if (xTimer) {
clearTimeout(xTimer);
}
xTimer = window.setTimeout(() => {
showXBar.value = false;
xTimer = null;
}, props.duration);
}
lastLeft = scrollLeft;
if (lastTop >= 0) {
showYBar.value = scrollTop !== lastTop;
if (yTimer) {
clearTimeout(yTimer);
yTimer = null;
}
yTimer = window.setTimeout(() => {
showYBar.value = false;
}, props.duration);
}
lastTop = scrollTop;
};
let childToObserve = null;
const init = () => {
if (!scrollTargetEl) {
return;
}
scrollTargetEl.classList.add(ScrollbarClass2.container);
ro2 = useResizeObserver();
ro2.observe(scrollTargetEl, updateScrollbar);
if (scrollTargetEl.children.length === 1 && scrollTargetEl.children[0] instanceof HTMLElement) {
childToObserve = scrollTargetEl.children[0];
ro2.observe(childToObserve, updateScrollbar);
}
updateScrollbar();
scrollListenEl = isBody.value ? window : scrollTargetEl;
scrollListenEl.addEventListener("scroll", onScroll, { passive: true });
handleWrapperHoverEvent();
};
let updateTimer;
let updateIdleTimer;
const updateScrollbarOnIdle = () => {
if (window.requestIdleCallback) {
updateTimer = window.setInterval(() => {
updateIdleTimer = window.requestIdleCallback(updateScrollbarByScollSize);
}, 1e3);
}
};
const cancelUpdateScrollbarOnIdle = () => {
if (updateTimer) {
clearInterval(updateTimer);
cancelIdleCallback && cancelIdleCallback(updateIdleTimer);
updateTimer = 0;
updateIdleTimer = 0;
}
};
const { target } = vue.toRefs(props);
resolveHtmlElement(target).then((el) => {
if (el === document.body) {
isBody.value = true;
scrollTargetEl = document.documentElement;
} else if (el) {
scrollTargetEl = el;
}
if (!scrollTargetEl) {
return;
}
init();
});
const isShowScrollbar = vue.ref(props.showType === "always");
vue.watchEffect(() => {
isShowScrollbar.value = props.showType === "always";
if (props.showType === "always") {
if (props.autoUpdateOnScrollSize) {
updateScrollbarOnIdle();
}
} else {
cancelUpdateScrollbarOnIdle();
}
});
let wrapperEl = null;
const onWrapperHoverIn = () => {
isShowScrollbar.value = true;
};
const onWrapperHoverOut = () => {
isShowScrollbar.value = false;
if (scrollTargetEl) {
const { scrollWidth, scrollHeight } = scrollTargetEl;
if (lastScrollWidth !== scrollWidth || lastScrollHeight !== scrollHeight) {
updateScrollbar();
}
}
};
const removeWrapperHoverEvent = () => {
if (wrapperEl) {
wrapperEl.removeEventListener("mouseenter", onWrapperHoverIn);
wrapperEl.removeEventListener("mouseleave", onWrapperHoverOut);
}
};
const handleWrapperHoverEvent = () => {
vue.watchEffect(() => {
var _a;
const isHoverShow = props.showType === "hover" && !isPhonePad.value;
wrapperEl = (_a = rootRef.value) == null ? void 0 : _a.offsetParent;
if (!wrapperEl) {
return;
}
if (isHoverShow) {
wrapperEl == null ? void 0 : wrapperEl.addEventListener("mouseenter", onWrapperHoverIn);
wrapperEl == null ? void 0 : wrapperEl.addEventListener("mouseleave", onWrapperHoverOut);
} else {
removeWrapperHoverEvent();
}
});
};
vue.onUnmounted(() => {
if (scrollTargetEl) {
ro2 == null ? void 0 : ro2.unobserve(scrollTargetEl, updateScrollbar);
scrollListenEl == null ? void 0 : scrollListenEl.removeEventListener("scroll", onScroll);
}
if (childToObserve) {
ro2 == null ? void 0 : ro2.unobserve(childToObserve, updateScrollbar);
}
removeWrapperHoverEvent();
cancelUpdateScrollbarOnIdle();
scrollTargetEl == null ? void 0 : scrollTargetEl.classList.remove(ScrollbarClass2.container);
});
const onHBarScroll = (ratio) => {
if (scrollTargetEl) {
const d = ratio * scrollTargetEl.scrollWidth;
scrollTargetEl.scrollTo({
left: d
});
}
};
const onVBarScroll = (ratio) => {
if (scrollTargetEl) {
const d = ratio * scrollTargetEl.scrollHeight;
scrollTargetEl.scrollTo({
top: d
});
}
};
const onBarHoverIn = (d) => {
if (isPhonePad.value) {
return;
}
if (d === "x") {
showXBar.value = true;
if (xTimer) {
clearTimeout(xTimer);
yTimer = null;
}
} else if (d === "y") {
showYBar.value = true;
if (yTimer) {
clearTimeout(yTimer);
yTimer = null;
}
}
};
const onBarHoverOut = (d) => {
if (isPhonePad.value) {
return;
}
if (d === "x") {
xTimer = window.setTimeout(() => {
showXBar.value = false;
}, props.duration);
} else if (d === "y") {
yTimer = window.setTimeout(() => {
showYBar.value = false;
}, props.duration);
}
};
__expose({
update: updateScrollbar
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"div",
{
class: vue.normalizeClass(["o-scrollbar", [
props.barClass,
`o-scrollbar-${props.size}`,
{
"o-scrollbar-auto-show": props.showType === "auto",
"o-scrollbar-always-show": props.showType === "always",
"o-scrollbar-hover-show": props.showType === "hover" && !vue.unref(isPhonePad),
"o-scrollbar-visible": isShowScrollbar.value,
"o-scrollbar-both": hasX.value && hasY.value,
"o-scrollbar-visible-x": showXBar.value,
"o-scrollbar-visible-y": showYBar.value,
"o-scrollbar-to-body": isBody.value
}
]]),
ref_key: "rootRef",
ref: rootRef
},
[
props.showType !== "never" ? (vue.openBlock(), vue.createElementBlock(
vue.Fragment,
{ key: 0 },
[
hasX.value && !props.disabledX ? (vue.openBlock(), vue.createBlock(_sfc_main$W, {
key: 0,
size: props.size,
direction: "x",
"thumb-rate": hThumbRate.value,
"offset-rate": hOffsetRate.value,
onScroll: onHBarScroll,
onMouseenter: _cache[0] || (_cache[0] = ($event) => onBarHoverIn("x")),
onMouseleave: _cache[1] || (_cache[1] = ($event) => onBarHoverOut("x"))
}, {
thumb: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "thumb")
]),
track: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "track")
]),
_: 3
/* FORWARDED */
}, 8, ["size", "thumb-rate", "offset-rate"])) : vue.createCommentVNode("v-if", true),
hasY.value && !props.disabledY ? (vue.openBlock(), vue.createBlock(_sfc_main$W, {
key: 1,
direction: "y",
size: props.size,
"thumb-rate": vThumbRate.value,
"offset-rate": vOffsetRate.value,
onScroll: onVBarScroll,
onMouseenter: _cache[2] || (_cache[2] = ($event) => onBarHoverIn("y")),
onMouseleave: _cache[3] || (_cache[3] = ($event) => onBarHoverOut("y"))
}, {
thumb: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "thumb")
]),
track: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "track")
]),
_: 3
/* FORWARDED */
}, 8, ["size", "thumb-rate", "offset-rate"])) : vue.createCommentVNode("v-if", true)
],
64
/* STABLE_FRAGMENT */
)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
};
}
});
const _hoisted_1$A = { class: "o-scroller o-scrollbar-wrapper" };
const _sfc_main$U = /* @__PURE__ */ vue.defineComponent({
__name: "OScroller",
props: scrollerProps,
setup(__props, { expose: __expose }) {
const props = __props;
const targetRef = vue.ref(null);
const scrollTo2 = (options) => {
if (!targetRef.value) {
return;
}
targetRef.value.scrollTo(options);
};
__expose({
scrollTo: scrollTo2,
getContainerEl() {
return targetRef.value;
}
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$A, [
vue.createElementVNode(
"div",
{
ref_key: "targetRef",
ref: targetRef,
class: vue.normalizeClass(["o-scroller-container", [
{
"is-x-disabled": props.disabledX,
"is-y-disabled": props.disabledY
},
props.wrapClass
]])
},
[
vue.renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
),
vue.createVNode(_sfc_main$V, {
target: targetRef.value,
"disabled-x": props.disabledX,
"disabled-y": props.disabledY,
duration: props.duration,
"show-type": props.showType,
size: props.size,
"auto-update-on-scroll-size": props.autoUpdateOnScrollSize
}, {
thumb: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "thumb")
]),
track: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "track")
]),
_: 3
/* FORWARDED */
}, 8, ["target", "disabled-x", "disabled-y", "duration", "show-type", "size", "auto-update-on-scroll-size"])
]);
};
}
});
const ScrollbarClass = {
wrapper: "o-scrollbar-wrapper"
};
function useScrollbar(options) {
const { wrapper, target, ...rests } = options;
const app = vue.createApp(_sfc_main$V, {
...rests,
target
});
const div = document.createElement("div");
const instance2 = app.mount(div);
let wrapperEl;
const mount = (wrapper2) => {
wrapperEl = wrapper2 || document.body;
wrapperEl == null ? void 0 : wrapperEl.appendChild(div.childNodes[0]);
wrapperEl == null ? void 0 : wrapperEl.classList.add(ScrollbarClass.wrapper);
};
if (wrapper) {
resolveHtmlElement(wrapper).then((el) => {
mount(el);
});
} else {
resolveHtmlElement(target).then((el) => {
mount(el == null ? void 0 : el.parentNode);
});
}
return {
scrollbar: instance2,
unmount: () => {
app.unmount();
wrapperEl == null ? void 0 : wrapperEl.classList.remove(ScrollbarClass.wrapper);
}
};
}
const scrollbarMap = /* @__PURE__ */ new WeakMap();
const vScrollbar = {
mounted(el, binding) {
const value = binding.value;
if (value === false) {
return;
}
const { unmount } = useScrollbar({
target: el,
...value
});
scrollbarMap.set(el, unmount);
},
unmounted(el) {
const unmount = scrollbarMap.get(el);
if (unmount) {
unmount();
}
}
};
const OScroller = Object.assign(_sfc_main$U, {
OScrollbar: _sfc_main$V,
install(app) {
app.component("OScroller", _sfc_main$U);
app.component("OScrollbar", _sfc_main$V);
}
});
const DialogSizeTypes = ["exlarge", "large", "medium", "small", "auto"];
const dialogProps = {
...layerProps,
/**
* @zh-CN 是否隐藏对话框的关闭按钮
* @en-US Whether to hide the close button of the dialog
*/
hideClose: {
type: Boolean
},
/**
* @zh-CN 对话框尺寸
* @en-US Dialog size
*/
size: {
type: String,
default: "auto"
},
/**
* @zh-CN 对话框底部按钮
* @en-US Dialog bottom button
*/
actions: {
type: Array
},
/**
* @zh-CN 是否禁用响应式
* @en-US Whether to disable responsive
*/
noResponsive: {
type: Boolean
},
/**
* @zh-CN 移动端是否渲染为半屏(宽度占满,高度占一半)
* @en-US Whether to render as half screen (width full, height half) on mobile phone
*/
phoneHalfFull: {
type: Boolean
},
/**
* @zh-CN 是否使用scrollbar,值为 false 不使用,值为 true 或 scrollbar 的配置对象则使用
* @en-US Whether to use scrollbar, value false not use, value true or scrollbar configuration object to use
*/
scrollbar: {
type: [Boolean, Object],
default: true
}
};
const _hoisted_1$z = {
key: 0,
class: "o-dlg-header"
};
const _hoisted_2$s = { class: "o-dlg-body-content" };
const _hoisted_3$k = {
key: 1,
class: "o-dlg-footer"
};
const _hoisted_4$g = { class: "o-dlg-actions" };
const _sfc_main$T = /* @__PURE__ */ vue.defineComponent({
__name: "ODialog",
props: dialogProps,
emits: ["change", "update:visible"],
setup(__props, { expose: __expose, emit: __emit }) {
const props = __props;
const emits = __emit;
const { isPhonePad } = useScreen();
const layerRef = vue.ref(null);
const onCloseClick = () => {
var _a;
(_a = layerRef.value) == null ? void 0 : _a.toggle(false);
};
const onChange = (visible) => {
emits("change", visible);
};
const onUpdateVisible = (value, e) => {
emits("update:visible", value, e);
};
const scrollbarProps2 = vue.computed(() => {
if (props.scrollbar === true) {
return {
showType: "hover",
size: "small"
};
}
return props.scrollbar;
});
__expose({
/** expose: Toggle the ODialog */
toggle(show) {
var _a;
(_a = layerRef.value) == null ? void 0 : _a.toggle(show);
}
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createBlock(vue.unref(OLayer), {
ref_key: "layerRef",
ref: layerRef,
class: vue.normalizeClass(["o-dialog", [
`o-dialog-${props.size}`,
{
"o-dialog-responsive": !props.noResponsive,
"o-dialog-phone-half-full": props.phoneHalfFull
}
]]),
visible: props.visible,
wrapper: props.wrapper,
"unmount-on-hide": props.unmountOnHide,
"main-class": vue.unref(mergeClass)("o-dlg-main", props.mainClass),
"main-transition": props.mainTransition,
"mask-transition": props.maskTransition,
mask: props.mask,
"mask-close": props.maskClose,
"before-hide": props.beforeHide,
"before-show": props.beforeShow,
"transition-orign": vue.unref(isPhonePad) ? "css" : "mouse",
onChange,
"onUpdate:visible": onUpdateVisible
}, {
default: vue.withCtx(() => [
_ctx.$slots.header ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$z, [
vue.renderSlot(_ctx.$slots, "header")
])) : vue.createCommentVNode("v-if", true),
vue.createElementVNode(
"div",
{
class: vue.normalizeClass(["o-dlg-body", {
"with-footer": _ctx.$slots.footer || props.actions
}])
},
[
vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_2$s, [
vue.renderSlot(_ctx.$slots, "default")
])), [
[vue.unref(vScrollbar), scrollbarProps2.value]
])
],
2
/* CLASS */
),
_ctx.$slots.footer || _ctx.$slots.actions || props.actions ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$k, [
vue.renderSlot(_ctx.$slots, "footer", {}, () => [
vue.createElementVNode("div", _hoisted_4$g, [
vue.renderSlot(_ctx.$slots, "actions", { isPhonePad: vue.unref(isPhonePad) }, () => [
vue.createCommentVNode(" 需要审视透传子组件属性 "),
(vue.openBlock(true), vue.createElementBlock(
vue.Fragment,
null,
vue.renderList(props.actions, (item) => {
return vue.openBlock(), vue.createBlock(vue.unref(OButton), {
key: item.id,
class: "o-dlg-btn",
color: item.color,
variant: !item.variant && vue.unref(isPhonePad) ? "text" : item.variant,
size: item.size,
round: item.round,
icon: item.icon,
loading: item.loading,
disabled: item.disabled,
onClick: item.onClick
}, {
default: vue.withCtx(() => [
vue.createTextVNode(
vue.toDisplayString(item.label),
1
/* TEXT */
)
]),
_: 2
/* DYNAMIC */
}, 1032, ["color", "variant", "size", "round", "icon", "loading", "disabled", "onClick"]);
}),
128
/* KEYED_FRAGMENT */
))
])
])
])
])) : vue.createCommentVNode("v-if", true),
!props.hideClose ? (vue.openBlock(), vue.createElementBlock("div", {
key: 2,
class: "o-dlg-btn-close",
onClick: onCloseClick
}, [
vue.createVNode(vue.unref(IconClose))
])) : vue.createCommentVNode("v-if", true)
]),
_: 3
/* FORWARDED */
}, 8, ["class", "visible", "wrapper", "unmount-on-hide", "main-class", "main-transition", "mask-transition", "mask", "mask-close", "before-hide", "before-show", "transition-orign"]);
};
}
});
const ODialog = Object.assign(_sfc_main$T, {
install(app) {
app.component("ODialog", _sfc_main$T);
}
});
const selectOptionInjectKey = Symbol("provide-select-option");
const OptionWidthModeTypes = ["auto", "min-width", "width"];
const selectProps = {
/**
* 下拉框的值
* v-model
*/
modelValue: {
type: [String, Number, Array]
},
/**
* 下拉框的默认值
* 非受控
*/
defaultValue: {
type: [String, Number, Array]
},
/**
* 大小 SizeT
*/
size: {
type: String
},
/**
* 圆角值 RoundT
*/
round: {
type: String
},
/**
* 颜色类型 Color2T
*/
color: {
type: String,
default: "normal"
},
/**
* 按钮类型:VariantT
*/
variant: {
type: String,
default: "outline"
},
/**
* 提示文本
*/
placeholder: {
type: String
},
/**
* 是否支持多选
*/
multiple: {
type: Boolean
},
/**
* 多选标签最大显示数量
*/
maxTagCount: {
type: Number
},
/**
* 是否可以清除
*/
clearable: {
type: Boolean
},
/**
* 是否禁用
*/
disabled: {
type: Boolean
},
/**
* 下拉选项触发方式 PopupTriggerT
*/
trigger: {
type: String,
default: "click"
},
/**
* 下拉选项位置 PopupPositionT
*/
optionPosition: {
type: String,
default: "bl"
},
/**
* 下拉选项宽度自适应规则 OptionWidthModeT
* 'auto':自动 | 'min-width':最小宽度与选择框一致 | 'width': 宽度与选择框一致
*/
optionWidthMode: {
type: String,
default: "min-width"
},
/**
* 下拉容器自定义类
*/
optionWrapClass: {
type: [String, Array]
},
/**
* 是否在结束选择时,卸载下拉选项
* v-model
*/
unmountOnHide: {
type: Boolean,
default: true
},
/**
* 过渡名称
*/
transition: {
type: String
},
/**
* 加载状态
*/
loading: {
type: Boolean
},
/**
* 选择前回调,根据返回值判断是否显示
*/
beforeSelect: {
type: Function
},
/**
* 显示前回调,根据返回值判断是否显示
*/
beforeOptionsShow: {
type: Function
},
/**
* 隐藏前回调,根据返回值判断是否隐藏
*/
beforeOptionsHide: {
type: Function
},
/**
* 挂载容器,默认为body
*/
optionsWrapper: {
type: [String, Object],
default: "body"
},
/**
* 多选超过最大tag是,文本显示
*/
foldLabel: {
type: Function
},
/**
* 浮层显示收起的多选tag
*/
showFoldTags: {
type: [Boolean, String],
default: "hover"
},
/**
* 选项标题(pad、phone显示)
*/
optionTitle: {
type: String
},
/**
* 下拉浮层是否响应式
*/
noResponsive: {
type: Boolean
}
};
const optionProps = {
/**
* 显示文本
*/
label: {
type: String,
default: ""
},
/**
* 值
*/
value: {
type: [String, Number],
default: ""
},
/**
* 禁用
*/
disabled: {
type: Boolean
}
};
const checkboxInjectKey = Symbol("provide-checkbox");
const checkboxGroupInjectKey = Symbol("provide-checkbox-group");
const checkboxProps = {
/**
* @zh-CN 多选框value,会作为 modelValue 的值
* @en-US Checkbox value, which will be the value of modelValue
*/
value: {
type: [String, Number],
required: true
},
/**
* @zh-CN 多选框双向绑定值
* @en-US Checkbox two-way binding value
*/
modelValue: {
type: Array
},
/**
* @zh-CN 非受控状态时,默认是否选中
* @en-US Default checked when uncontrolled
*/
defaultChecked: {
type: Boolean,
default: false
},
/**
* @zh-CN 是否禁用
* @en-US Whether to disable
*/
disabled: {
type: Boolean,
default: false
},
/**
* @zh-CN 是否半选
* @en-US Whether to select half
*/
indeterminate: {
type: Boolean,
default: false
},
/**
* @zh-CN 输入框的 id
* @en-US The id of the input box
*/
inputId: {
type: String
}
};
const _hoisted_1$y = ["for"];
const _hoisted_2$r = { class: "o-checkbox-wrap" };
const _hoisted_3$j = ["id", "value", "disabled", "checked"];
const _hoisted_4$f = { class: "o-checkbox-input-wrap" };
const _hoisted_5$9 = { class: "o-checkbox-input" };
const _hoisted_6$7 = {
key: 0,
class: "o-checkbox-input-icon-indeterminate"
};
const _hoisted_7$4 = { class: "o-checkbox-label" };
const _sfc_main$S = /* @__PURE__ */ vue.defineComponent({
__name: "OCheckbox",
props: checkboxProps,
emits: ["update:modelValue", "change"],
setup(__props, { expose: __expose, emit: __emit }) {
const props = __props;
const emits = __emit;
const inputId2 = vue.ref(props.inputId);
vue.onMounted(() => {
if (!inputId2.value) {
inputId2.value = uniqueId();
}
});
const checkboxGroupInjection = vue.inject(checkboxGroupInjectKey, null);
const _checked = vue.ref(props.defaultChecked);
const isChecked = vue.computed(() => {
if (isUndefined(props.value)) {
return false;
}
if (checkboxGroupInjection) {
return checkboxGroupInjection.realValue.value.includes(props.value);
}
if (isArray(props.modelValue)) {
return props.modelValue.includes(props.value);
}
return _checked.value;
});
vue.watch(
isChecked,
(val) => {
_checked.value = val;
},
{ immediate: true }
);
const isDisabled = vue.computed(() => {
return (checkboxGroupInjection == null ? void 0 : checkboxGroupInjection.disabled.value) || props.disabled || isChecked.value && ((checkboxGroupInjection == null ? void 0 : checkboxGroupInjection.isMinimum.value) ?? false) || !isChecked.value && ((checkboxGroupInjection == null ? void 0 : checkboxGroupInjection.isMaximum.value) ?? false);
});
const onClick = (ev) => {
ev.stopPropagation();
};
const onChange = (ev) => {
if (isUndefined(props.value)) {
return;
}
const { checked } = ev.target;
const set = checkboxGroupInjection ? /* @__PURE__ */ new Set([...checkboxGroupInjection.realValue.value]) : isArray(props.modelValue) ? /* @__PURE__ */ new Set([...props.modelValue]) : /* @__PURE__ */ new Set([]);
if (checked) {
set.add(props.value);
} else {
set.delete(props.value);
}
_checked.value = checked;
const val = Array.from(set);
emits("update:modelValue", val);
checkboxGroupInjection == null ? void 0 : checkboxGroupInjection.updateModelValue(val);
vue.nextTick(() => {
emits("change", val, ev);
checkboxGroupInjection == null ? void 0 : checkboxGroupInjection.onChange(val, ev);
});
};
__expose({
/** is checked */
checked: isChecked
});
vue.provide(checkboxInjectKey, {
checked: isChecked,
disabled: isDisabled
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("label", {
class: vue.normalizeClass(["o-checkbox", {
"o-checkbox-checked": isChecked.value,
"o-checkbox-disabled": isDisabled.value,
"o-checkbox-indeterminate": props.indeterminate
}]),
for: inputId2.value
}, [
vue.createElementVNode("div", _hoisted_2$r, [
vue.createElementVNode("input", {
id: inputId2.value,
type: "checkbox",
value: props.value,
disabled: isDisabled.value,
checked: isChecked.value,
onClick,
onChange
}, null, 40, _hoisted_3$j),
vue.renderSlot(_ctx.$slots, "checkbox", {
checked: isChecked.value,
disabled: isDisabled.value
}, () => [
vue.createElementVNode("div", _hoisted_4$f, [
vue.createElementVNode("span", _hoisted_5$9, [
vue.createVNode(vue.Transition, { name: "o-fade-in" }, {
default: vue.withCtx(() => [
props.indeterminate ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_6$7)) : isChecked.value ? (vue.openBlock(), vue.createBlock(vue.unref(IconChecked), { key: 1 })) : vue.createCommentVNode("v-if", true)
]),
_: 1
/* STABLE */
})
])
]),
vue.createElementVNode("span", _hoisted_7$4, [
vue.renderSlot(_ctx.$slots, "default")
])
])
])
], 10, _hoisted_1$y);
};
}
});
const OCheckbox = Object.assign(_sfc_main$S, {
install(app) {
app.component("OCheckbox", _sfc_main$S);
}
});
const _sfc_main$R = /* @__PURE__ */ vue.defineComponent({
__name: "OOption",
props: optionProps,
setup(__props) {
const props = __props;
const { label, value } = vue.toRefs(props);
const selectInject = vue.inject(selectOptionInjectKey, null);
const isMultiple = selectInject == null ? void 0 : selectInject.multiple;
const currentVal = vue.computed(() => {
return selectInject == null ? void 0 : selectInject.selectValue.value;
});
const isActive = vue.ref(false);
vue.watch(
[currentVal, value],
() => {
var _a;
isActive.value = Boolean((_a = currentVal.value) == null ? void 0 : _a.includes(value.value));
},
// currentVal 会被 OSelect 通过数组下标及push方法修改,所以需要deep
{ immediate: true, deep: true }
);
vue.watch(
[value, label],
([newValue, newLabel]) => {
selectInject == null ? void 0 : selectInject.select(
{
label: newLabel || `${newValue}`,
value: newValue
},
false
);
},
{ immediate: true }
);
const clickOption = () => {
if (!props.disabled) {
selectInject == null ? void 0 : selectInject.select(
{
label: label.value || `${value.value}`,
value: value.value
},
true
);
}
};
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("div", {
class: "o-option",
onClick: clickOption
}, [
vue.createElementVNode(
"div",
{
class: vue.normalizeClass(["o-option-item", [
{
active: isActive.value,
"o-option-disabled": props.disabled,
"o-option-multiple": vue.unref(isMultiple)
}
]])
},
[
vue.unref(isMultiple) ? (vue.openBlock(), vue.createBlock(vue.unref(OCheckbox), {
key: 0,
"model-value": currentVal.value,
value: props.value,
class: "o-option-checkbox",
disabled: props.disabled
}, {
default: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "default", {}, () => [
vue.createTextVNode(
vue.toDisplayString(props.label || `${props.value}`),
1
/* TEXT */
)
])
]),
_: 3
/* FORWARDED */
}, 8, ["model-value", "value", "disabled"])) : vue.renderSlot(_ctx.$slots, "default", { key: 1 }, () => [
vue.createTextVNode(
vue.toDisplayString(props.label || `${props.value}`),
1
/* TEXT */
)
])
],
2
/* CLASS */
)
]);
};
}
});
const _hoisted_1$x = { class: "o-option-list" };
const _sfc_main$Q = /* @__PURE__ */ vue.defineComponent({
__name: "OOptionList",
props: {
wrapClass: {},
scrollbar: { type: [Boolean, Object] }
},
setup(__props) {
const props = __props;
const scrollbarProps2 = vue.computed(() => {
if (props.scrollbar === true) {
return {
showType: "hover",
size: "small"
};
}
return props.scrollbar;
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$x, [
vue.withDirectives((vue.openBlock(), vue.createElementBlock(
"div",
{
class: vue.normalizeClass(["o-options-container", props.wrapClass])
},
[
vue.renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
)), [
[vue.unref(vScrollbar), scrollbarProps2.value]
])
]);
};
}
});
const _hoisted_1$w = { class: "o-option-group" };
const _hoisted_2$q = { class: "o-option-group-name" };
const _sfc_main$P = /* @__PURE__ */ vue.defineComponent({
__name: "OOptionGroup",
props: {
name: {}
},
setup(__props) {
const props = __props;
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$w, [
vue.renderSlot(_ctx.$slots, "name", {}, () => [
vue.createElementVNode(
"div",
_hoisted_2$q,
vue.toDisplayString(props.name),
1
/* TEXT */
)
]),
vue.renderSlot(_ctx.$slots, "default")
]);
};
}
});
const OOption = Object.assign(_sfc_main$R, {
install(app) {
app.component("OOption", _sfc_main$R);
app.component("OOptionGroup", _sfc_main$P);
}
});
const slot$1 = {
names: {
optionTarget: "option-target"
},
option: {
names: {
action: "action"
}
}
};
const _hoisted_1$v = {
key: 0,
class: "o-select-options-loading"
};
const _hoisted_2$p = {
key: 0,
class: "o-select-actions"
};
const _sfc_main$O = /* @__PURE__ */ vue.defineComponent({
__name: "SelectOption",
props: {
size: {},
wrapClass: {},
loading: { type: Boolean },
optionTitle: {},
multiple: { type: Boolean }
},
setup(__props) {
const props = __props;
const scrollbarCfg = {
barClass: "o-select-options-scrollbar",
size: "small",
showType: "hover"
};
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"div",
{
class: vue.normalizeClass(["o-select-options", [
`o-select-options-${props.size || vue.unref(defaultSize)}`,
{
"o-select-options-multiple": props.multiple
}
]])
},
[
vue.createVNode(vue.unref(_sfc_main$Q), {
"wrap-class": props.wrapClass,
scrollbar: scrollbarCfg
}, {
default: vue.withCtx(() => [
props.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$v, [
vue.createVNode(vue.unref(IconLoading), { class: "o-rotating" })
])) : vue.renderSlot(_ctx.$slots, vue.unref(slot$1).names.optionTarget, { key: 1 })
]),
_: 3
/* FORWARDED */
}, 8, ["wrap-class"]),
_ctx.$slots.action ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$p, [
vue.renderSlot(_ctx.$slots, vue.unref(slot$1).option.names.action)
])) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
};
}
});
const formInjectKey = Symbol("provide-form");
const formItemInjectKey = Symbol("provide-form-item");
const logFunction = {
info: console.info,
warn: console.warn,
error: console.error
};
function getLogFunction(level, prefix) {
if (process.env.NODE_ENV === "development") {
if (prefix) {
return logFunction[level].bind(window.console, prefix);
} else {
return logFunction[level].bind(window.console);
}
}
return () => {
};
}
class Log {
constructor(prefix) {
__publicField(this, "prefix", "");
if (prefix) {
this.prefix = `[${prefix}]`;
}
}
get info() {
return getLogFunction("info", this.prefix);
}
get warn() {
return getLogFunction("warn", this.prefix);
}
get error() {
return getLogFunction("error", this.prefix);
}
}
const log = new Log();
const configProviderProps = {
/**
* 语言词条
*/
locale: {
type: Object
},
/**
* Link组件全局配置
*/
link: {
type: Object
}
};
const configProviderInjectKey = Symbol("provide-config-provider");
const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
__name: "OConfigProvider",
props: configProviderProps,
setup(__props) {
const props = __props;
const { locale, link } = vue.toRefs(props);
const globalConfig = vue.reactive({
locale,
link
});
vue.provide(configProviderInjectKey, globalConfig);
return (_ctx, _cache) => {
return vue.renderSlot(_ctx.$slots, "default");
};
}
});
const OConfigProvider = Object.assign(_sfc_main$N, {
install(app) {
app.component("OConfigProvider", _sfc_main$N);
}
});
const zhCN = {
locale: "zh-CN",
// common
"common.empty": "暂无数据",
"common.loading": "加载中...",
// pagination
"pagination.goto": "前往",
"pagination.page": "页",
"pagination.countPerPage": "条/页",
"pagination.total": "共 {0} 条",
// upload
"upload.buttonLabel": "点击上传",
"upload.drag": "点击或拖拽文件到此处上传",
"upload.dragHover": "释放文件并开始上传",
"upload.retry": "点击重试",
"upload.delete": "删除",
"upload.preview": "预览",
"upload.edit": "编辑",
// select
"select.cancel": "取消",
"select.confirm": "确定",
// input
"input.limit": "<b>{0}</b>/{1}"
};
const currentLocal = vue.ref("zh-CN");
const i18nLanguage = vue.ref({
"zh-CN": zhCN
});
function addLocale(locale, opts) {
const locales = isArray(locale) ? locale : [locale];
locales.forEach((lc) => {
const currLocal = lc.locale;
if (!currLocal) {
return;
}
if (!i18nLanguage.value[currLocal]) {
i18nLanguage.value[currLocal] = {
locale: lc.locale
};
}
Object.keys(lc).forEach((key) => {
const k = key;
if (!i18nLanguage.value[currLocal][k] || (opts == null ? void 0 : opts.overwrite)) {
i18nLanguage.value[currLocal][k] = lc[key];
}
});
});
}
function useLocale(localeKey) {
if (!i18nLanguage.value[localeKey]) {
log.warn(`no '${localeKey}' languages configed`);
return;
}
currentLocal.value = localeKey;
}
function useI18n() {
const instance2 = vue.getCurrentInstance();
const configProvider = instance2 ? vue.inject(configProviderInjectKey, {}) : null;
const languages = vue.computed(() => {
return (configProvider == null ? void 0 : configProvider.locale) ?? i18nLanguage.value[currentLocal.value];
});
const locale = vue.computed(() => languages.value.locale);
const transform = (key, ...args) => {
if (!languages.value) {
log.warn("no languages configed");
return "";
}
const value = languages.value[key];
if (args.length > 0 && isString(value)) {
return value.replace(/{(\d+)}/g, (match, index) => {
return args[index] ?? match;
});
}
if (isUndefined(value)) {
log.warn(`Cannot translate the value of keypath '${key}'`);
}
return value;
};
return {
locale,
t: transform
};
}
const _hoisted_1$u = ["value", "placeholder"];
const _hoisted_2$o = { class: "o-select-tags-wrap" };
const _hoisted_3$i = ["onClick"];
const _hoisted_4$e = { class: "o-select-tags" };
const _hoisted_5$8 = ["onClick"];
const _hoisted_6$6 = { class: "o-select-suffix" };
const _hoisted_7$3 = { class: "o-select-suffix-icon" };
const _hoisted_8$1 = {
key: 0,
class: "o-select-loading"
};
const _hoisted_9$1 = { class: "o-select-option-wrap" };
const _hoisted_10$1 = { class: "o-select-empty" };
const _hoisted_11$1 = { class: "o-select-options-head" };
const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
__name: "OSelect",
props: selectProps,
emits: ["update:modelValue", "change", "options-visible-change", "clear"],
setup(__props, { emit: __emit }) {
const props = __props;
const emits = __emit;
const { isPhonePad } = useScreen();
const { t } = useI18n();
const selectRef = vue.ref();
const optionsRef = vue.ref(null);
const isSelecting = vue.ref(false);
const isResponding = vue.computed(() => {
return !props.noResponsive && isPhonePad.value;
});
const tagPopoverVisible = vue.ref(false);
vue.watch(
() => isSelecting.value,
() => {
if (isSelecting.value) {
tagPopoverVisible.value = false;
}
}
);
const formItemInjection = vue.inject(formItemInjectKey, null);
const color2 = vue.computed(() => {
var _a;
if (formItemInjection == null ? void 0 : formItemInjection.fieldResult.value) {
return (_a = formItemInjection == null ? void 0 : formItemInjection.fieldResult.value) == null ? void 0 : _a.type;
} else {
return props.color;
}
});
const optionLabels = vue.ref({});
const valueList = vue.ref([]);
const finalValueList = vue.ref([]);
if (isArray(props.modelValue)) {
valueList.value = [...props.modelValue];
} else if (isArray(props.defaultValue)) {
valueList.value = [...props.defaultValue];
} else {
const mrValue = props.modelValue ?? props.defaultValue;
if (!isUndefined(mrValue)) {
valueList.value = [mrValue];
} else {
valueList.value = [];
}
}
finalValueList.value = [...valueList.value];
const valueListDisplay = vue.computed(() => {
if (!props.maxTagCount) {
return finalValueList.value;
}
return finalValueList.value.slice(0, props.maxTagCount);
});
const valueListFold = vue.computed(() => {
if (!props.maxTagCount) {
return [];
}
return finalValueList.value.slice(props.maxTagCount);
});
const foldLabel = vue.computed(() => {
if (props.foldLabel) {
const tags = valueListFold.value.map((item) => ({
value: item,
label: optionLabels.value[item]
}));
return props.foldLabel(tags);
}
return `+${valueListFold.value.length}...`;
});
const foldTrigger = typeof props.showFoldTags === "string" ? props.showFoldTags : "hover";
const round2 = getRoundClass(props, "select");
vue.watch(
() => props.modelValue,
(v) => {
if (props.multiple) {
if (isArray(v)) {
if (!isArrayEqual(v, valueList.value)) {
valueList.value = [...v];
}
} else {
valueList.value = [];
}
} else if (valueList.value[0] !== v) {
valueList.value = [v];
}
finalValueList.value = [...valueList.value];
}
);
vue.watchEffect(() => {
if (!isResponding.value) {
finalValueList.value = [...valueList.value];
}
});
const isClearable = vue.computed(() => props.clearable && !props.disabled && valueList.value.length > 0);
const emitChange = (value) => {
var _a, _b;
if (props.multiple) {
emits("change", [...value]);
} else {
emits("change", value[0]);
}
(_b = formItemInjection == null ? void 0 : (_a = formItemInjection.fieldHandlers).onChange) == null ? void 0 : _b.call(_a);
};
const emitUpdateValue = (value) => {
if (props.multiple) {
emits("update:modelValue", [...value]);
} else {
emits("update:modelValue", value[0]);
}
};
const clearClick = (e) => {
e.stopPropagation();
valueList.value = [];
emits("clear", e);
emitChange(valueList.value);
emitUpdateValue(valueList.value);
};
const beforeSelect = async (value) => {
if (isFunction(props.beforeSelect)) {
const rlt = await props.beforeSelect(value, props.multiple ? valueList.value : valueList.value[0]);
return rlt;
}
return true;
};
vue.provide(selectOptionInjectKey, {
multiple: props.multiple,
selectValue: valueList,
select: async (option, userSelect) => {
if (userSelect) {
let toValue = option.value;
const rlt = await beforeSelect(option.value);
if (rlt === false) {
return;
}
if (typeof rlt !== "boolean") {
toValue = rlt;
}
if (!props.multiple) {
isSelecting.value = false;
if (valueList.value[0] !== toValue) {
valueList.value[0] = toValue;
emitUpdateValue(valueList.value);
emitChange(valueList.value);
}
} else {
const idx = valueList.value.indexOf(toValue);
if (idx > -1) {
valueList.value.splice(idx, 1);
} else {
valueList.value.push(toValue);
}
if (!isResponding.value) {
emitUpdateValue(valueList.value);
emitChange(valueList.value);
}
}
} else {
if (optionLabels.value[option.value] !== option.label) {
optionLabels.value[option.value] = option.label;
}
}
}
});
const onOptionVisibleChange = (visible) => {
emits("options-visible-change", visible);
};
const onRemoveTag = (value, e) => {
e.stopPropagation();
const idx = valueList.value.indexOf(value);
if (idx > -1) {
valueList.value.splice(idx, 1);
emitChange(valueList.value);
emitUpdateValue(valueList.value);
}
};
const onFoldTagClick = (e) => {
if (foldTrigger === "click") {
e.stopPropagation();
}
};
const beforeTagPopoverShow = () => {
if (isSelecting.value) {
return false;
}
return true;
};
const onSelectClick = () => {
if (isResponding.value) {
if (!props.disabled) {
isSelecting.value = true;
}
}
};
const onSelectDlgChange = (visible) => {
onOptionVisibleChange(visible);
};
const onselectDlgCancelClick = () => {
isSelecting.value = false;
valueList.value = [...finalValueList.value];
};
const onselectDlgOkClick = () => {
isSelecting.value = false;
finalValueList.value = [...valueList.value];
emitChange(valueList.value);
emitUpdateValue(valueList.value);
};
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"div",
{
ref_key: "selectRef",
ref: selectRef,
class: vue.normalizeClass(["o-select", [
`o-select-${color2.value}`,
`o-select-${props.variant}`,
`o-select-${props.size || vue.unref(defaultSize)}`,
vue.unref(round2).class.value,
{
"is-selecting": isSelecting.value,
"is-multiple": props.multiple && valueList.value.length > 0,
"o-select-disabled": props.disabled,
"o-select-clearable": isClearable.value,
"o-select-is-loading": props.loading
}
]]),
style: vue.normalizeStyle(vue.unref(round2).style.value),
onClick: onSelectClick
},
[
!props.multiple || props.multiple && valueList.value.length === 0 ? (vue.openBlock(), vue.createElementBlock("input", {
key: 0,
value: optionLabels.value[valueList.value[0]],
type: "text",
placeholder: props.placeholder,
class: "o-select-input",
readonly: ""
}, null, 8, _hoisted_1$u)) : (vue.openBlock(), vue.createBlock(vue.unref(OScroller), {
key: 1,
class: "o-select-tags-scroller",
"wrap-class": "o-select-value-list",
"show-type": "hover",
size: "small",
"disabled-x": ""
}, {
default: vue.withCtx(() => [
vue.createElementVNode("div", _hoisted_2$o, [
(vue.openBlock(true), vue.createElementBlock(
vue.Fragment,
null,
vue.renderList(valueListDisplay.value, (item) => {
return vue.openBlock(), vue.createElementBlock("div", {
key: item,
class: "o-select-tag"
}, [
vue.createTextVNode(
vue.toDisplayString(optionLabels.value[item]) + " ",
1
/* TEXT */
),
vue.createElementVNode("div", {
class: "o-select-tag-remove",
onClick: (e) => onRemoveTag(item, e)
}, [
vue.createVNode(vue.unref(IconClose))
], 8, _hoisted_3$i)
]);
}),
128
/* KEYED_FRAGMENT */
)),
_ctx.showFoldTags && valueListFold.value.length > 0 ? (vue.openBlock(), vue.createBlock(vue.unref(OPopover), {
key: 0,
visible: tagPopoverVisible.value,
"onUpdate:visible": _cache[0] || (_cache[0] = ($event) => tagPopoverVisible.value = $event),
trigger: vue.unref(foldTrigger),
class: "o-select-tag-popover",
position: "bottom",
"before-show": beforeTagPopoverShow
}, {
target: vue.withCtx(() => [
vue.createElementVNode("div", {
class: "o-select-tag",
onClick: onFoldTagClick
}, [
vue.renderSlot(_ctx.$slots, "tag-fold", {}, () => [
vue.createTextVNode(
vue.toDisplayString(foldLabel.value),
1
/* TEXT */
)
])
])
]),
default: vue.withCtx(() => [
vue.createElementVNode("div", _hoisted_4$e, [
(vue.openBlock(true), vue.createElementBlock(
vue.Fragment,
null,
vue.renderList(valueListFold.value, (item) => {
return vue.openBlock(), vue.createElementBlock("div", {
key: item,
class: "o-select-tag"
}, [
vue.createTextVNode(
vue.toDisplayString(optionLabels.value[item]) + " ",
1
/* TEXT */
),
vue.createElementVNode("div", {
class: "o-select-tag-remove",
onClick: (e) => onRemoveTag(item, e)
}, [
vue.createVNode(vue.unref(IconClose))
], 8, _hoisted_5$8)
]);
}),
128
/* KEYED_FRAGMENT */
))
])
]),
_: 3
/* FORWARDED */
}, 8, ["visible", "trigger"])) : vue.createCommentVNode("v-if", true)
])
]),
_: 3
/* FORWARDED */
})),
vue.createElementVNode("div", _hoisted_6$6, [
vue.createElementVNode("div", _hoisted_7$3, [
props.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8$1, [
vue.createVNode(vue.unref(IconLoading), { class: "o-rotating" })
])) : isClearable.value ? (vue.openBlock(), vue.createElementBlock("div", {
key: 1,
class: "o-select-clear",
onClick: clearClick
}, [
vue.createVNode(vue.unref(IconClose), { class: "o-select-clear-icon" })
])) : vue.createCommentVNode("v-if", true),
vue.createElementVNode(
"div",
{
class: vue.normalizeClass(["o-select-arrow", { active: isSelecting.value }])
},
[
vue.renderSlot(_ctx.$slots, "arrow", { active: isSelecting.value }, () => [
vue.createVNode(vue.unref(IconChevronDown))
])
],
2
/* CLASS */
)
]),
vue.renderSlot(_ctx.$slots, "suffix", { active: isSelecting.value })
]),
vue.createVNode(vue.unref(ClientOnly), null, {
default: vue.withCtx(() => [
(vue.openBlock(), vue.createBlock(vue.Teleport, {
to: optionsRef.value,
disabled: !optionsRef.value
}, [
vue.withDirectives(vue.createElementVNode(
"div",
_hoisted_9$1,
[
vue.renderSlot(_ctx.$slots, "default", {}, () => [
vue.createElementVNode("div", _hoisted_10$1, [
vue.renderSlot(_ctx.$slots, "empty", {}, () => [
vue.createElementVNode(
"span",
null,
vue.toDisplayString(vue.unref(t)("common.empty")),
1
/* TEXT */
)
])
])
])
],
512
/* NEED_PATCH */
), [
[vue.vShow, optionsRef.value]
])
], 8, ["to", "disabled"])),
isResponding.value ? (vue.openBlock(), vue.createBlock(vue.unref(ODialog), {
key: 0,
visible: isSelecting.value,
"onUpdate:visible": _cache[1] || (_cache[1] = ($event) => isSelecting.value = $event),
"before-show": props.beforeOptionsShow,
"before-hide": props.beforeOptionsHide,
"hide-close": "",
class: vue.normalizeClass(["o-select-dlg", {
"is-loading": props.loading
}]),
"mask-close": !props.multiple,
size: "small",
scrollbar: false,
onChange: onSelectDlgChange
}, vue.createSlots({
default: vue.withCtx(() => [
vue.createVNode(_sfc_main$O, {
size: props.size,
"wrap-class": props.optionWrapClass,
loading: props.loading,
class: "o-select-options-dlg",
"option-title": props.optionTitle,
multiple: props.multiple
}, vue.createSlots({
"option-target": vue.withCtx(() => [
vue.createElementVNode(
"div",
{
ref_key: "optionsRef",
ref: optionsRef
},
null,
512
/* NEED_PATCH */
)
]),
_: 2
/* DYNAMIC */
}, [
vue.renderList(vue.unref(filterSlots)(_ctx.$slots, vue.unref(slot$1).option.names), (name) => {
return {
name,
fn: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, name)
])
};
})
]), 1032, ["size", "wrap-class", "loading", "option-title", "multiple"])
]),
_: 2
/* DYNAMIC */
}, [
props.optionTitle ? {
name: "header",
fn: vue.withCtx(() => [
vue.createElementVNode(
"div",
_hoisted_11$1,
vue.toDisplayString(props.optionTitle),
1
/* TEXT */
)
]),
key: "0"
} : void 0,
props.multiple ? {
name: "actions",
fn: vue.withCtx(() => [
vue.createVNode(vue.unref(OButton), {
class: "o-dlg-btn",
variant: "text",
size: "large",
onClick: onselectDlgCancelClick
}, {
default: vue.withCtx(() => [
vue.createTextVNode(
vue.toDisplayString(vue.unref(t)("select.cancel")),
1
/* TEXT */
)
]),
_: 1
/* STABLE */
}),
vue.createVNode(vue.unref(OButton), {
class: "o-dlg-btn",
variant: "text",
size: "large",
onClick: onselectDlgOkClick
}, {
default: vue.withCtx(() => [
vue.createTextVNode(
vue.toDisplayString(vue.unref(t)("select.confirm")),
1
/* TEXT */
)
]),
_: 1
/* STABLE */
})
]),
key: "1"
} : void 0
]), 1032, ["visible", "before-show", "before-hide", "mask-close", "class"])) : (vue.openBlock(), vue.createElementBlock(
vue.Fragment,
{ key: 1 },
[
!props.disabled ? (vue.openBlock(), vue.createBlock(vue.unref(OPopup), {
key: 0,
visible: isSelecting.value,
"onUpdate:visible": _cache[2] || (_cache[2] = ($event) => isSelecting.value = $event),
"wrap-class": "o-options-popup",
transition: props.transition,
"unmount-on-hide": props.unmountOnHide,
position: props.optionPosition,
wrapper: props.optionsWrapper,
target: selectRef.value,
trigger: props.trigger,
offset: 4,
"adjust-min-width": props.optionWidthMode === "min-width",
"adjust-width": props.optionWidthMode === "width",
"before-show": props.beforeOptionsShow,
"before-hide": props.beforeOptionsHide,
onChange: onOptionVisibleChange
}, {
default: vue.withCtx(() => [
vue.createVNode(_sfc_main$O, {
size: props.size,
"wrap-class": props.optionWrapClass,
loading: props.loading,
multiple: props.multiple
}, vue.createSlots({
"option-target": vue.withCtx(() => [
vue.createElementVNode(
"div",
{
ref_key: "optionsRef",
ref: optionsRef
},
null,
512
/* NEED_PATCH */
)
]),
_: 2
/* DYNAMIC */
}, [
vue.renderList(vue.unref(filterSlots)(_ctx.$slots, vue.unref(slot$1).option.names), (name) => {
return {
name,
fn: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, name)
])
};
})
]), 1032, ["size", "wrap-class", "loading", "multiple"])
]),
_: 3
/* FORWARDED */
}, 8, ["visible", "transition", "unmount-on-hide", "position", "wrapper", "target", "trigger", "adjust-min-width", "adjust-width", "before-show", "before-hide"])) : vue.createCommentVNode("v-if", true)
],
64
/* STABLE_FRAGMENT */
))
]),
_: 3
/* FORWARDED */
})
],
6
/* CLASS, STYLE */
);
};
}
});
const OSelect = Object.assign(_sfc_main$M, {
install(app) {
app.component("OSelect", _sfc_main$M);
}
});
const DFS = (options, parentNode, depth) => {
for (let i = 0, len = options.length; i < len; i++) {
const item = options[i];
let node = {
value: item.value,
label: item.label,
parent: parentNode,
depth: depth + 1,
children: [],
isLeaf: true
};
parentNode.children.push(node);
if (item.children && item.children.length) {
node.isLeaf = false;
DFS(item.children, node, depth + 1);
}
}
};
class CascaderTree {
constructor() {
__publicField(this, "root");
this.root = {
value: NaN,
label: "",
depth: 0,
parent: null,
children: [],
isLeaf: true
};
}
updateTree(options) {
this.root = {
value: NaN,
label: "",
depth: 0,
parent: null,
children: [],
isLeaf: true
};
DFS(options, this.root, 0);
}
getNode(node, val) {
if (node.value === val) {
return node;
}
const children = node.children;
for (let i = 0, len = children.length; i < len; i++) {
const rlt = this.getNode(children[i], val);
if (rlt) {
return rlt;
}
}
}
getChild(node, val) {
const children = node.children;
return children.find((item) => item.value === val);
}
getPanelInfo(val) {
let rlt = [];
if (isUndefined(val)) {
return rlt;
}
if (!isArray(val)) {
let node = this.getNode(this.root, val);
if (isUndefined(node) || !node.isLeaf) {
const columnInfo = this.getNextColumnInfo(this.root);
if (!isUndefined(columnInfo)) {
rlt = [columnInfo];
}
} else {
while (node.parent) {
const columnInfo = this.getNextColumnInfo(node.parent, node.value);
if (!isUndefined(columnInfo)) {
rlt.unshift(columnInfo);
}
node = node.parent;
}
}
} else {
let parent = this.root;
for (let i = 0, len = val.length; i < len; i++) {
const child = this.getChild(parent, val[i]);
if (isUndefined(child) || !child.isLeaf && child.depth === len) {
const columnInfo = this.getNextColumnInfo(this.root);
if (!isUndefined(columnInfo)) {
rlt = [columnInfo];
}
break;
} else {
const columnInfo = this.getNextColumnInfo(parent, val[i]);
rlt.push(columnInfo);
parent = child;
}
}
}
return rlt;
}
getNextColumnInfo(node, activeVal) {
return node.children.map((item) => {
const rlt = {
value: item.value,
label: item.label,
depth: item.depth,
isActive: false,
isLeaf: item.children && item.children.length ? false : true
};
if (!isUndefined(activeVal)) {
rlt.isActive = item.value === activeVal;
}
return rlt;
});
}
}
const cascaderProps = {
/**
* @zh-CN 级联选择器选中值(v-model)
* @en-US Cascader selected value (v-model)
* @CascaderValueT string | number | Array<string | number>
*/
modelValue: {
type: [String, Number, Array],
default: ""
},
/**
* @zh-CN 级联选择器选项值
* @en-US Cascader option value
* @CascaderOptionT { value: string | number, label?: string, children?: Array<CascaderOptionT> }
*/
options: {
type: Array
},
/**
* @zh-CN modelValue 是否使用路径模式
* @en-US Whether to use path mode for modelValue
* @default false
*/
pathMode: {
type: Boolean,
default: false
},
/**
* @zh-CN 圆角大小
* @en-US Round size
*/
round: {
type: String
},
/**
* @zh-CN 样式
* @en-US Style
* @default 'outline'
*/
variant: {
type: String,
default: "outline"
},
/**
* @zh-CN 提示文本
* @en-US Placeholder
*/
placeholder: {
type: String
},
/**
* @zh-CN 触发方式
* @en-US Trigger
* @default 'click'
* @deprecated useless
*/
trigger: {
type: String,
default: "click"
},
/**
* @zh-CN 下拉选项位置
* @en-US Option position
* @default 'bl'
*/
optionPosition: {
type: String,
default: "bl"
},
/**
* @zh-CN 下拉选项容器类名
* @en-US Option container class name
*/
optionWrapClass: {
type: [String, Array]
},
/**
* @zh-CN 是否在隐藏时销毁 DOM
* @en-US Whether to destroy DOM when hidden
*/
unmountOnHide: {
type: Boolean,
default: true
},
/**
* @zh-CN 过渡动画名称
* @en-US Transition animation name
*/
transition: {
type: String
}
};
const cascaderPanelProps = {
/**
* @zh-CN 级联选择器选中值(v-model)
* @en-US Cascader selected value (v-model)
*/
modelValue: {
type: [String, Number, Array],
default: ""
},
/**
* @zh-CN 级联选择器选项值
* @en-US Cascader option value
*/
options: {
type: Array
},
/**
* @zh-CN modelValue 是否使用路径模式
* @en-US Whether to use path mode for modelValue
* @default false
*/
pathMode: {
type: Boolean,
default: false
}
};
const _hoisted_1$t = { class: "o-cascader-panel" };
const _hoisted_2$n = ["onClick"];
const _hoisted_3$h = { class: "o-cascader-option-label" };
const _hoisted_4$d = {
key: 0,
class: "o-cascader-option-arrow"
};
const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
__name: "OCascaderPanel",
props: cascaderPanelProps,
emits: ["change", "update:modelValue"],
setup(__props, { emit: __emit }) {
const selectInject = vue.inject(selectOptionInjectKey, null);
const props = __props;
const emits = __emit;
const _value = vue.ref(props.modelValue);
const inputLabel = vue.ref("");
const cascaderTree = new CascaderTree();
const panelInfo = vue.ref();
const getSelectedInfo = () => {
var _a;
let rlt = {
label: "",
path: []
};
(_a = panelInfo.value) == null ? void 0 : _a.forEach((columnInfo, index) => [
columnInfo.forEach((option) => {
if (option.isActive) {
rlt.label += `${index === 0 ? "" : "/"}${String(option.label)}`;
rlt.path.push(option.value);
}
})
]);
return rlt;
};
vue.watch(
() => props.options,
(val) => {
if (!isUndefined(val)) {
cascaderTree.updateTree(val);
panelInfo.value = cascaderTree.getPanelInfo(_value.value);
inputLabel.value = getSelectedInfo().label;
}
},
{
immediate: true,
deep: true
}
);
const currentVal = vue.computed(() => {
return selectInject == null ? void 0 : selectInject.selectValue.value;
});
const onClick = (option, columnInfo) => {
var _a, _b;
if (!isArray(panelInfo.value)) {
return;
}
while (option.depth < panelInfo.value.length) {
(_a = panelInfo.value) == null ? void 0 : _a.pop();
}
columnInfo.forEach((item) => {
item.isActive = item.value === option.value;
});
if (!option.isLeaf) {
const node = cascaderTree.getNode(cascaderTree.root, option.value);
if (node) {
panelInfo.value.push(cascaderTree.getNextColumnInfo(node));
}
} else {
const { label, path } = getSelectedInfo();
_value.value = path;
inputLabel.value = label;
if ((_b = currentVal.value) == null ? void 0 : _b.includes(path[path.length - 1])) {
return;
}
if (props.pathMode) {
emits("change", path);
emits("update:modelValue", path);
} else {
emits("change", path[path.length - 1]);
emits("update:modelValue", path[path.length - 1]);
}
selectInject == null ? void 0 : selectInject.select(
{
label: inputLabel.value,
value: path[path.length - 1]
},
true
);
}
};
vue.watchEffect(() => {
selectInject == null ? void 0 : selectInject.select(
{
label: inputLabel.value,
value: isArray(_value.value) ? _value.value[_value.value.length - 1] : _value.value
},
false
);
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$t, [
(vue.openBlock(true), vue.createElementBlock(
vue.Fragment,
null,
vue.renderList(panelInfo.value, (columnInfo, index) => {
return vue.openBlock(), vue.createElementBlock("ul", {
key: index,
class: "o-cascader-options"
}, [
(vue.openBlock(true), vue.createElementBlock(
vue.Fragment,
null,
vue.renderList(columnInfo, (option) => {
return vue.openBlock(), vue.createElementBlock("li", {
key: option.value,
class: vue.normalizeClass(["o-cascader-option", { "o-cascader-option-selected": option.isActive }]),
onClick: ($event) => onClick(option, columnInfo)
}, [
vue.createElementVNode(
"span",
_hoisted_3$h,
vue.toDisplayString(option.label),
1
/* TEXT */
),
!option.isLeaf ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$d, [
vue.createVNode(vue.unref(IconChevronRight))
])) : vue.createCommentVNode("v-if", true)
], 10, _hoisted_2$n);
}),
128
/* KEYED_FRAGMENT */
))
]);
}),
128
/* KEYED_FRAGMENT */
))
]);
};
}
});
const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
__name: "OCascader",
props: cascaderProps,
emits: ["change", "update:modelValue"],
setup(__props, { emit: __emit }) {
const props = __props;
const emits = __emit;
const handleChange = (val) => {
emits("change", val);
emits("update:modelValue", val);
};
const wrapClass = vue.computed(() => {
const classStr = "o-cascader";
if (isUndefined(props.optionWrapClass)) {
return classStr;
} else if (isString(props.optionWrapClass)) {
return `${classStr} ${props.optionWrapClass}`;
} else {
return [classStr, ...props.optionWrapClass].join(" ");
}
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createBlock(vue.unref(OSelect), {
"model-value": props.modelValue,
round: props.round,
variant: props.variant,
placeholder: props.placeholder,
triggre: props.trigger,
"option-position": props.optionPosition,
"option-width-mode": "auto",
"unmount-on-hide": props.unmountOnHide,
transition: props.transition,
"option-wrap-class": wrapClass.value
}, {
default: vue.withCtx(() => [
vue.createVNode(_sfc_main$L, {
options: props.options,
"model-value": props.modelValue,
"path-mode": props.pathMode,
onChange: handleChange
}, null, 8, ["options", "model-value", "path-mode"])
]),
_: 1
/* STABLE */
}, 8, ["model-value", "round", "variant", "placeholder", "triggre", "option-position", "unmount-on-hide", "transition", "option-wrap-class"]);
};
}
});
const OCascader = Object.assign(_sfc_main$K, {
OCascaderPanel: _sfc_main$L,
install(app) {
app.component("OCascader", _sfc_main$K);
app.component("OCascaderPanel", _sfc_main$L);
}
});
const checkboxGroupProps = {
/**
* @zh-CN 多选框组双向绑定值
* @en-US checkbox group two-way binding value
*/
modelValue: {
type: Array
},
/**
* @zh-CN 非受控状态时,多选框组默认值
* @en-US Default value when not controlled
*/
defaultValue: {
type: Array,
default: () => []
},
/**
* @zh-CN 是否禁用多选框组
* @en-US Whether to disable the checkbox group
*/
disabled: {
type: Boolean,
default: false
},
/**
* @zh-CN 多选框组布局方向
* @en-US Layout direction of checkbox group
*/
direction: {
type: String,
default: "h"
},
/**
* @zh-CN 最少选择数量
* @en-US Minimum number of selections
*/
min: {
type: Number,
default: void 0
},
/**
* @zh-CN 最多选择数量
* @en-US Maximum number of selections
*/
max: {
type: Number,
default: void 0
}
};
const _sfc_main$J = /* @__PURE__ */ vue.defineComponent({
__name: "OCheckboxGroup",
props: checkboxGroupProps,
emits: ["update:modelValue", "change"],
setup(__props, { emit: __emit }) {
const props = __props;
const emits = __emit;
const realValue = vue.ref(isArray(props.modelValue) ? props.modelValue : props.defaultValue);
const formItemInjection = vue.inject(formItemInjectKey, null);
vue.watch(
() => props.modelValue,
(val) => {
if (isArray(val)) {
realValue.value = val;
}
}
);
const isMinimum = vue.computed(() => isUndefined(props.min) ? false : realValue.value.length <= props.min);
const isMaximum = vue.computed(() => isUndefined(props.max) ? false : realValue.value.length >= props.max);
const updateModelValue = (val) => {
realValue.value = val;
emits("update:modelValue", val);
};
const onChange = (val, ev) => {
var _a, _b;
emits("change", val, ev);
(_b = formItemInjection == null ? void 0 : (_a = formItemInjection.fieldHandlers).onChange) == null ? void 0 : _b.call(_a);
};
vue.provide(checkboxGroupInjectKey, {
realValue,
disabled: vue.toRef(props, "disabled"),
isMinimum,
isMaximum,
updateModelValue,
onChange
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"div",
{
class: vue.normalizeClass(["o-checkbox-group", `o-checkbox-group-${props.direction}`])
},
[
vue.renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
);
};
}
});
const OCheckboxGroup = Object.assign(_sfc_main$J, {
install(app) {
app.component("OCheckboxGroup", _sfc_main$J);
}
});
const collapseProps = {
/**
* @zh-CN 是否开启手风琴模式
* @en-US Whether to enable accordion mode
* @default false
*/
accordion: {
type: Boolean,
default: false
},
/**
* @zh-CN 展开的面板,双向绑定值
* @en-US Expanded panel, two-way binding value
*/
modelValue: {
type: Array
},
/**
* @zh-CN 非受控模式时,默认展开的面板值
* @en-US Default value when not controlled
*/
defaultValue: {
type: Array,
default: () => []
}
};
const collapseItemProps = {
/**
* @zh-CN 折叠面板value
* @en-US Collapse panel value
*/
value: {
type: [String, Number],
required: true
},
/**
* @zh-CN 折叠面板标题
* @en-US Collapse panel title
*/
title: {
type: String
}
};
const collapseInjectKey = Symbol("provide-collapse");
const _hoisted_1$s = { class: "o-collapse" };
const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
__name: "OCollapse",
props: collapseProps,
emits: ["update:modelValue", "change"],
setup(__props, { emit: __emit }) {
const props = __props;
const emits = __emit;
const _innerValue = vue.ref(props.defaultValue);
const computedValue = vue.computed(() => {
const value = props.modelValue ?? _innerValue.value;
if (!isArray(value)) {
return [value];
}
return value;
});
const handleItemClick = (value, e) => {
let realValue = [];
if (props.accordion) {
if (!computedValue.value.includes(value)) {
realValue = [value];
}
} else {
realValue = [...computedValue.value];
const idx = realValue.indexOf(value);
if (idx > -1) {
realValue.splice(idx, 1);
} else {
realValue.push(value);
}
}
_innerValue.value = realValue;
emits("update:modelValue", realValue);
emitChange(realValue, e);
};
const emitChange = (val, e) => {
vue.nextTick(() => {
if (isArrayEqual(val, computedValue.value)) {
emits("change", computedValue.value, e);
}
});
};
vue.provide(collapseInjectKey, {
computedValue,
handleItemClick
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$s, [
vue.renderSlot(_ctx.$slots, "default")
]);
};
}
});
const _hoisted_1$r = { class: "o-collapse-item-icon" };
const _hoisted_2$m = {
key: 0,
class: "o-collapse-item-title"
};
const _hoisted_3$g = { class: "o-collapse-item-body" };
const _sfc_main$H = /* @__PURE__ */ vue.defineComponent({
__name: "OCollapseItem",
props: collapseItemProps,
setup(__props) {
const props = __props;
const collapseInjection = vue.inject(collapseInjectKey, null);
const isExpanded = vue.computed(() => {
if (isUndefined(props.value)) {
return false;
}
if (collapseInjection) {
return collapseInjection.computedValue.value.includes(props.value);
}
return false;
});
const onClick = (evt) => {
evt.stopPropagation();
if (isUndefined(props.value)) {
return;
}
collapseInjection == null ? void 0 : collapseInjection.handleItemClick(props.value, evt);
};
const onBeforeEnter = (el) => {
el.style.height = "0px";
};
const onEnter = (el) => {
el.style.height = `${el.scrollHeight}px`;
};
const onAfterEnter = (el) => {
el.style.height = "auto";
};
const onBeforeLeave = (el) => {
el.style.height = `${el.offsetHeight}px`;
};
const onLeave = (el) => {
el.style.height = "0px";
};
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"div",
{
class: vue.normalizeClass(["o-collapse-item", { "o-collapse-item-expanded": isExpanded.value }])
},
[
vue.createElementVNode("div", {
class: "o-collapse-item-header",
onClick
}, [
vue.createElementVNode("span", _hoisted_1$r, [
vue.createVNode(vue.unref(IconChevronRight))
]),
props.title || _ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_2$m, [
vue.renderSlot(_ctx.$slots, "title", {}, () => [
vue.createTextVNode(
vue.toDisplayString(props.title),
1
/* TEXT */
)
])
])) : vue.createCommentVNode("v-if", true)
]),
vue.createVNode(vue.Transition, {
onBeforeEnter,
onEnter,
onAfterEnter,
onBeforeLeave,
onLeave,
persisted: ""
}, {
default: vue.withCtx(() => [
vue.withDirectives(vue.createElementVNode(
"div",
_hoisted_3$g,
[
vue.renderSlot(_ctx.$slots, "default")
],
512
/* NEED_PATCH */
), [
[vue.vShow, isExpanded.value]
])
]),
_: 3
/* FORWARDED */
})
],
2
/* CLASS */
);
};
}
});
const OCollapse = Object.assign(_sfc_main$I, {
OCollapseItem: _sfc_main$H,
install(app) {
app.component("OCollapse", _sfc_main$I);
app.component("OCollapseItem", _sfc_main$H);
}
});
const DividerVariantTypes = ["solid", "dashed", "dotted"];
const dividerProps = {
/**
* 分割线类型 DividerVariantT
*/
variant: {
type: String,
default: "solid"
},
/**
* 分割线方向 DirectionT
*/
direction: {
type: String,
default: "h"
},
/**
* 自定义内容位置
*/
labelPosition: {
type: String,
default: "center"
},
/**
* 是否颜色加深
*/
darker: {
type: Boolean,
default: false
}
};
const _hoisted_1$q = { class: "o-divider-label" };
const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
__name: "ODivider",
props: dividerProps,
setup(__props) {
const props = __props;
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"div",
{
role: "separator",
class: vue.normalizeClass(["o-divider", [
`o-divider-${props.variant}`,
`o-divider-${props.direction}`,
{ "o-divider-darker": props.darker, [`o-divider-label-${props.labelPosition}`]: _ctx.$slots.default }
]])
},
[
props.direction === "h" ? (vue.openBlock(), vue.createElementBlock(
vue.Fragment,
{ key: 0 },
[
_cache[1] || (_cache[1] = vue.createElementVNode(
"div",
{ class: "o-divider-line" },
null,
-1
/* HOISTED */
)),
_ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock(
vue.Fragment,
{ key: 0 },
[
vue.createElementVNode("div", _hoisted_1$q, [
vue.renderSlot(_ctx.$slots, "default")
]),
_cache[0] || (_cache[0] = vue.createElementVNode(
"div",
{ class: "o-divider-line" },
null,
-1
/* HOISTED */
))
],
64
/* STABLE_FRAGMENT */
)) : vue.createCommentVNode("v-if", true)
],
64
/* STABLE_FRAGMENT */
)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
};
}
});
const ODivider = Object.assign(_sfc_main$G, {
install(app) {
app.component("ODivider", _sfc_main$G);
}
});
const dropdownProps = {
/**
* 弹出框是否可见
*/
visible: {
type: Boolean
},
/**
* 非受控模式,弹出框是否默认可见
*/
defaultVisible: {
type: Boolean,
default: false
},
/**
* 大小 SizeT
*/
size: {
type: String
},
/**
* 圆角值 RoundT
*/
round: {
type: String
},
/**
* 下拉选项触发方式 PopupTriggerT
*/
trigger: {
type: String,
default: "click"
},
/**
* 下拉选项位置 PopupPositionT
*/
optionPosition: {
type: String,
default: "bl"
},
/**
* 下拉选项宽度自适应规则
* 'auto':自动 | 'min-width':最小宽度与选择框一致 | 'width': 宽度与选择框一致
*/
optionWidthMode: {
type: String,
default: "min-width"
},
/**
* 挂载容器,默认为body
*/
optionsWrapper: {
type: [String, Object],
default: "body"
},
/**
* 下拉容器自定义类
*/
optionWrapClass: {
type: [String, Array]
},
/**
* 是否在结束选择时,卸载下拉选项
*/
unmountOnHide: {
type: Boolean,
default: true
},
/**
* 过渡名称
*/
transition: {
type: String
}
};
const dropdownItemProps = {
/**
* 显示文本
*/
label: {
type: String,
default: ""
},
/**
* 选项值
*/
value: {
type: [String, Number],
default: ""
},
/**
* 是否禁用
*/
disabled: {
type: Boolean,
default: false
}
};
const dropdownInjectKey = Symbol("provide-dropdown");
const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
__name: "ODropdown",
props: dropdownProps,
emits: ["update:visible", "visible-change"],
setup(__props, { emit: __emit }) {
const props = __props;
const emits = __emit;
const dropdownRef = vue.ref();
const isVisible = vue.ref(props.visible ?? props.defaultVisible);
vue.watch(
() => props.visible,
(val) => {
if (!isUndefined(val)) {
isVisible.value = val;
}
}
);
const updateVisible = (val) => {
isVisible.value = val;
emits("update:visible", val);
emits("visible-change", val);
};
vue.watch(isVisible, (val) => {
updateVisible(val);
});
vue.provide(dropdownInjectKey, { updateVisible });
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"div",
{
ref_key: "dropdownRef",
ref: dropdownRef,
class: "o-dropdown"
},
[
vue.renderSlot(_ctx.$slots, "default"),
vue.createVNode(vue.unref(OPopup), {
visible: isVisible.value,
"onUpdate:visible": _cache[0] || (_cache[0] = ($event) => isVisible.value = $event),
transition: props.transition,
"unmount-on-hide": props.unmountOnHide,
position: props.optionPosition,
wrapper: props.optionsWrapper,
target: dropdownRef.value,
trigger: props.trigger,
offset: 4,
"adjust-min-width": props.optionWidthMode === "min-width",
"adjust-width": props.optionWidthMode === "width"
}, {
default: vue.withCtx(() => [
vue.createElementVNode(
"ul",
{
class: vue.normalizeClass(["o-dropdown-list", [props.optionWrapClass]])
},
[
vue.renderSlot(_ctx.$slots, "dropdown")
],
2
/* CLASS */
)
]),
_: 3
/* FORWARDED */
}, 8, ["visible", "transition", "unmount-on-hide", "position", "wrapper", "target", "trigger", "adjust-min-width", "adjust-width"])
],
512
/* NEED_PATCH */
);
};
}
});
const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
__name: "ODropdownItem",
props: dropdownItemProps,
setup(__props) {
const props = __props;
const dropdownInjection = vue.inject(dropdownInjectKey, null);
const onItemClick = () => {
if (props.disabled) {
return;
}
dropdownInjection == null ? void 0 : dropdownInjection.updateVisible(false);
};
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"li",
{
class: vue.normalizeClass(["o-dropdown-item", { "o-dropdown-disabled": props.disabled }]),
onClick: onItemClick
},
[
vue.renderSlot(_ctx.$slots, "default", {}, () => [
vue.createTextVNode(
vue.toDisplayString(props.label || `${props.value}`),
1
/* TEXT */
)
])
],
2
/* CLASS */
);
};
}
});
const ODropdown = Object.assign(_sfc_main$F, {
ODropdownItem: _sfc_main$E,
install(app) {
app.component("ODropdown", _sfc_main$F);
app.component("ODropdownItem", _sfc_main$E);
}
});
const formProps = {
/**
* 表单数据对象
*/
model: {
type: Object
},
/**
* 子项是否包含必选,主要用于控制文本左对齐样式
*/
hasRequired: {
type: Boolean,
default: false
},
/**
* 布局
*/
layout: {
type: String,
default: "h"
},
/**
* 表单项文本垂直对齐方式
*/
labelAlign: {
type: String
},
/**
* 表单项文本水平对齐方式
*/
labelJustify: {
type: String
},
/**
* 表单项文本宽度,全局
*/
labelWidth: {
type: String
}
};
const formItemProps = {
/**
* 表单项在数据对象中的path
*/
field: {
type: String
},
/**
* 是否必选
*/
required: {
type: Boolean,
default: false
},
/**
* 表单项文本
*/
label: {
type: String,
default: void 0
},
/**
* 表单项文本垂直对齐方式
*/
labelAlign: {
type: String
},
/**
* 表单项文本水平对齐方式
*/
labelJustify: {
type: String
},
/**
* 表单项文本宽度
*/
labelWidth: {
type: String
},
/**
* 表单项内容类名
*/
mainClass: {
type: [String, Array]
},
/**
* 表单验证规则
*/
rules: {
type: Array
},
/**
* 表单验证的默认触发事件,在手动检验
*/
defaultTrigger: {
type: String
}
};
function getFlexValue(val) {
if (!val) {
return "";
}
if (["top", "left"].includes(val)) {
return "flex-start";
} else if (["bottom", "right"].includes(val)) {
return "flex-end";
} else if ("center" === val) {
return "center";
}
return "";
}
const defaultCheckRequired = (value) => {
return !isNull(value) && !isUndefined(value) && value !== "" && !isEmptyArray(value) && !isEmptyObject(value) ? "success" : "danger";
};
const defaultCheckType = (value, type) => {
return typeof value === type ? "success" : "danger";
};
function groupRules(rules, required) {
const tRules = {};
let hasRequired = false;
if (isArray(rules)) {
rules.forEach((item) => {
const triggers = item.triggers ? [].concat(item.triggers) : ["change"];
triggers.forEach((trigger2) => {
const tr = tRules[trigger2] || [];
if (item.type) {
tr.push((value) => ({
type: defaultCheckType(value, item.type),
message: item.message
}));
} else if (item.required) {
hasRequired = true;
tr.push((value) => ({
type: defaultCheckRequired(value),
message: item.message
}));
} else {
const fFn = item.validator;
if (fFn && isFunction(fFn)) {
tr.push(fFn);
}
}
tRules[trigger2] = tr;
});
});
}
if (!hasRequired && required) {
tRules.change = tRules.change || [];
tRules.change.push((value) => ({
type: defaultCheckRequired(value),
message: "required!"
}));
}
return tRules;
}
const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
__name: "OForm",
props: formProps,
emits: ["submit", "validate", "clear", "reset"],
setup(__props, { expose: __expose, emit: __emit }) {
const props = __props;
const emits = __emit;
const align = vue.computed(() => getFlexValue(props.labelAlign));
const justify = vue.computed(() => getFlexValue(props.labelJustify));
const filedList = [];
const doValidate = (filed) => {
const filedNames = filed ? [].concat(filed) : [];
const list = filedList.map((item) => {
if (filedNames.length === 0 || item.filed && filedNames.includes(item.filed)) {
return item.validate ? item.validate() : null;
}
return null;
});
return Promise.all(list).then((rlt) => {
emits("validate", rlt);
return rlt;
});
};
const clearValidate = (filed, onClear) => {
const filedNames = filed ? [].concat(filed) : [];
filedList.forEach((item) => {
if (filedNames.length === 0 || item.filed && filedNames.includes(item.filed)) {
item.clearValidate();
if (isFunction(onClear)) {
onClear(item);
}
}
});
emits("clear", filed);
};
const addFiled = (filedItem) => {
filedList.push(filedItem);
};
const removeFiled = (filed) => {
const idx = filedList.findIndex((item) => item.filed === filed);
filedList.splice(idx, 1);
};
const resetFields = (filed) => {
clearValidate(filed, (item) => {
item.resetFiled();
});
emits("reset", filed);
};
const onSubmit = () => {
doValidate().then((rlt) => {
emits("submit", rlt);
});
};
vue.provide(formInjectKey, {
model: vue.computed(() => props.model),
addFiled,
removeFiled
});
__expose({
validate: doValidate,
resetFields,
clearValidate
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"form",
{
class: vue.normalizeClass(["o-form", [
{
"o-form-has-required": props.hasRequired
},
`o-form-layout-${props.layout}`
]]),
style: vue.normalizeStyle({
"--form-label-width": props.labelWidth,
"--form-label-align": props.labelAlign,
"--form-label-justify": justify.value,
"--form-item-align": align.value
}),
onSubmit: vue.withModifiers(onSubmit, ["prevent"])
},
[
vue.renderSlot(_ctx.$slots, "default")
],
38
/* CLASS, STYLE, NEED_HYDRATION */
);
};
}
});
const _hoisted_1$p = { class: "o-form-item-label" };
const _hoisted_2$l = { class: "o-form-item-main" };
const _hoisted_3$f = { class: "o-form-item-main-wrap" };
const _hoisted_4$c = { key: 0 };
const _hoisted_5$7 = {
key: 1,
class: "o-form-item-extra"
};
const requireSymbol = "*";
const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
__name: "OFormItem",
props: formItemProps,
setup(__props) {
var _a;
const props = __props;
const formInject = vue.inject(formInjectKey, {});
const align = vue.computed(() => getFlexValue(props.labelAlign));
const justify = vue.computed(() => getFlexValue(props.labelJustify));
const isRequired = vue.computed(() => {
if (props.required) {
return true;
} else if (isArray(props.rules)) {
return props.rules.some((item) => item.required === true);
}
return false;
});
const rules = vue.computed(() => groupRules(props.rules, props.required));
const ruleTriggers = vue.computed(() => {
const t = Object.keys(rules.value);
return moveToFirst(t, "change");
});
const fieldResult = vue.ref(null);
const initialVal = ((_a = formInject.model) == null ? void 0 : _a.value) && props.field ? getValueByPath(formInject.model.value, props.field) : void 0;
const runValidate = async (trigger2) => {
var _a2;
if (!props.field || !((_a2 = formInject.model) == null ? void 0 : _a2.value)) {
return null;
}
const validators = rules.value[trigger2 || props.defaultTrigger || ruleTriggers.value[0]];
if (!validators || validators.length === 0) {
return null;
}
const value = getValueByPath(formInject.model.value, props.field);
fieldResult.value = null;
await asyncSome(validators, async (validatorFn) => {
var _a3;
try {
const rlt = await (validatorFn == null ? void 0 : validatorFn(value));
if ((rlt == null ? void 0 : rlt.type) === "danger") {
fieldResult.value = {
type: "danger",
message: rlt.message ? [rlt.message] : []
};
return true;
} else if ((rlt == null ? void 0 : rlt.type) === "warning") {
if (!fieldResult.value) {
fieldResult.value = {
type: "warning",
message: rlt.message ? [rlt.message] : []
};
} else if (rlt.message) {
(_a3 = fieldResult.value.message) == null ? void 0 : _a3.push(rlt.message);
}
return false;
}
} catch (e) {
log.error("failed to validate rules");
}
});
return fieldResult.value;
};
const clearValidate = () => {
var _a2;
if (!props.field || !((_a2 = formInject.model) == null ? void 0 : _a2.value)) {
return;
}
fieldResult.value = null;
};
const resetFiled = () => {
var _a2;
if (((_a2 = formInject.model) == null ? void 0 : _a2.value) && props.field) {
setValueByPath(formInject.model.value, props.field, initialVal);
}
};
const fieldHandlers = {
runValidate,
onChange() {
runValidate("change");
},
onFocus() {
runValidate("focus");
},
onInput() {
runValidate("input");
},
onBlur() {
runValidate("blur");
}
};
vue.onMounted(() => {
var _a2;
if (props.field) {
(_a2 = formInject.addFiled) == null ? void 0 : _a2.call(formInject, {
filed: props.field,
validate: runValidate,
clearValidate,
resetFiled
});
}
});
vue.onBeforeUnmount(() => {
var _a2;
if (props.field) {
(_a2 = formInject.removeFiled) == null ? void 0 : _a2.call(formInject, props.field);
}
});
vue.provide(formItemInjectKey, {
fieldHandlers,
fieldResult
});
return (_ctx, _cache) => {
var _a2, _b, _c, _d, _e;
return vue.openBlock(), vue.createElementBlock(
"div",
{
class: vue.normalizeClass(["o-form-item", [
{
"o-form-item-required": isRequired.value,
"o-form-item-danger": ((_a2 = fieldResult.value) == null ? void 0 : _a2.type) === "danger",
"o-form-item-warning": ((_b = fieldResult.value) == null ? void 0 : _b.type) === "warning"
}
]]),
style: vue.normalizeStyle({
"--form-label-width": props.labelWidth,
"--form-label-align": align.value,
"--form-label-justify": justify.value
})
},
[
vue.createElementVNode("div", _hoisted_1$p, [
vue.createElementVNode(
"span",
{
class: vue.normalizeClass(["o-form-require-symbol", {
visible: isRequired.value
}])
},
[
vue.renderSlot(_ctx.$slots, "symbol", {}, () => [
vue.createTextVNode(vue.toDisplayString(requireSymbol))
])
],
2
/* CLASS */
),
vue.renderSlot(_ctx.$slots, "label", {}, () => [
vue.createElementVNode(
"span",
null,
vue.toDisplayString(props.label),
1
/* TEXT */
)
])
]),
vue.createElementVNode("div", _hoisted_2$l, [
vue.createElementVNode("div", _hoisted_3$f, [
vue.renderSlot(_ctx.$slots, "default")
]),
((_c = fieldResult.value) == null ? void 0 : _c.message) ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 0,
class: vue.normalizeClass(["o-form-item-message", `type-${fieldResult.value.type}`])
},
[
vue.renderSlot(_ctx.$slots, "message", {
message: (_d = fieldResult.value) == null ? void 0 : _d.message,
type: (_e = fieldResult.value) == null ? void 0 : _e.type
}, () => {
var _a3, _b2, _c2;
return [
!vue.unref(isArray)((_a3 = fieldResult.value) == null ? void 0 : _a3.message) ? (vue.openBlock(), vue.createElementBlock(
"div",
_hoisted_4$c,
vue.toDisplayString((_b2 = fieldResult.value) == null ? void 0 : _b2.message),
1
/* TEXT */
)) : (vue.openBlock(true), vue.createElementBlock(
vue.Fragment,
{ key: 1 },
vue.renderList((_c2 = fieldResult.value) == null ? void 0 : _c2.message, (item) => {
return vue.openBlock(), vue.createElementBlock(
"div",
{ key: item },
vue.toDisplayString(item),
1
/* TEXT */
);
}),
128
/* KEYED_FRAGMENT */
))
];
})
],
2
/* CLASS */
)) : vue.createCommentVNode("v-if", true),
_ctx.$slots.extra ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$7, [
vue.renderSlot(_ctx.$slots, "extra")
])) : vue.createCommentVNode("v-if", true)
])
],
6
/* CLASS, STYLE */
);
};
}
});
const OForm = Object.assign(_sfc_main$D, {
OFormItem: _sfc_main$C,
install(app) {
app.component("OForm", _sfc_main$D);
}
});
const rowProps = {
/**
* 是否为inline-flex
*/
inline: {
type: Boolean
},
/**
* 同 align-items
*/
align: {
type: String
},
/**
* 同 justify-content
*/
justify: {
type: String
},
/**
* flex-wrap
*/
wrap: {
type: String,
default: "wrap"
},
/**
* flex-direction
*/
direction: {
type: String
},
/**
* gapX
*/
gap: {
type: String
},
/**
* gapX
*/
gapX: {
type: String
},
/**
* gapY
*/
gapY: {
type: String
},
/**
* @media (max-width: 1440px)
*/
laptop: {
type: Object
},
/**
* @media (max-width: 1200px)
*/
pad: {
type: Object
},
/**
* @media (max-width: 840px)
*/
padV: {
type: Object
},
/**
* @media (max-width: 600px)
*/
phone: {
type: Object
}
};
const colProps = {
/**
* flex-grow
*/
flex: {
type: String,
default: "1 0 auto"
},
/**
* 同 align-self
*/
align: {
type: String
},
/**
* @media (max-width: 1440px)
*/
laptop: {
type: Object
},
/**
* @media (max-width: 1200px)
*/
pad: {
type: Object
},
/**
* @media (max-width: 840px)
*/
padV: {
type: Object
},
/**
* @media (max-width: 600px)
*/
phone: {
type: Object
}
};
const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
__name: "ORow",
props: rowProps,
setup(__props) {
const props = __props;
const getMediaGap = (opts) => {
if (!opts) {
return;
}
const { gapX, gapY, gap: gapXY } = opts;
let gx = gapX;
let gy = gapY;
if (gapXY) {
const [x, y] = gapXY.split(" ");
gx = gx ?? x;
gy = gy ?? y ?? gx;
}
return {
x: gx === "auto" ? void 0 : gx,
y: gy === "auto" ? void 0 : gy
};
};
const gap = vue.computed(() => {
return getMediaGap(props);
});
const lgGap = vue.computed(() => {
return getMediaGap(props.laptop);
});
const mdGap = vue.computed(() => {
return getMediaGap(props.pad);
});
const smGap = vue.computed(() => {
return getMediaGap(props.padV);
});
const xsGap = vue.computed(() => {
return getMediaGap(props.phone);
});
return (_ctx, _cache) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
return vue.openBlock(), vue.createElementBlock(
"div",
{
class: vue.normalizeClass(["o-row", {
"o-row-phone": !!props.phone,
"o-row-pad-v": !!props.padV,
"o-row-pad": !!props.pad,
"o-row-laptop": !!props.laptop
}]),
style: vue.normalizeStyle({
justifyContent: props.justify,
flexDirection: props.direction,
alignItems: props.align,
flexWrap: props.wrap,
"--row-gap-x": (_a = gap.value) == null ? void 0 : _a.x,
"--row-gap-y": (_b = gap.value) == null ? void 0 : _b.y,
"--row-phone-gap-x": (_c = xsGap.value) == null ? void 0 : _c.x,
"--row-phone-gap-y": (_d = xsGap.value) == null ? void 0 : _d.y,
"--row-pad-v-gap-x": (_e = smGap.value) == null ? void 0 : _e.x,
"--row-pad-v-gap-y": (_f = smGap.value) == null ? void 0 : _f.y,
"--row-pad-gap-x": (_g = mdGap.value) == null ? void 0 : _g.x,
"--row-pad-gap-y": (_h = mdGap.value) == null ? void 0 : _h.y,
"--row-laptop-gap-x": (_i = lgGap.value) == null ? void 0 : _i.x,
"--row-laptop-gap-y": (_j = lgGap.value) == null ? void 0 : _j.y
})
},
[
vue.renderSlot(_ctx.$slots, "default")
],
6
/* CLASS, STYLE */
);
};
}
});
const _sfc_main$A = /* @__PURE__ */ vue.defineComponent({
__name: "OCol",
props: colProps,
setup(__props) {
const props = __props;
return (_ctx, _cache) => {
var _a, _b, _c, _d;
return vue.openBlock(), vue.createElementBlock(
"div",
{
class: vue.normalizeClass(["o-col", {
"o-col-phone": !!props.phone,
"o-col-pad-v": !!props.padV,
"o-col-pad": !!props.pad,
"o-col-laptop": !!props.laptop
}]),
style: vue.normalizeStyle({
alignSelf: props.align,
"--col-flex": props.flex,
"--col-phone-flex": (_a = props.phone) == null ? void 0 : _a.flex,
"--col-pad-v-flex": (_b = props.padV) == null ? void 0 : _b.flex,
"--col-pad-flex": (_c = props.pad) == null ? void 0 : _c.flex,
"--col-laptop-flex": (_d = props.laptop) == null ? void 0 : _d.flex
})
},
[
vue.renderSlot(_ctx.$slots, "default")
],
6
/* CLASS, STYLE */
);
};
}
});
const ORow = Object.assign(_sfc_main$B, {
OCol: _sfc_main$A,
install(app) {
app.component("ORow", _sfc_main$B);
app.component("OCol", _sfc_main$A);
}
});
const inInputProps = {
/**
* 下拉框的值
* v-model 受控
*/
modelValue: {
type: String
},
/**
* 下拉框的默认值
* 非受控
*/
defaultValue: {
type: String
},
/**
* 是否是密码输入
*/
type: {
type: String,
default: "text"
},
/**
* 提示文本
*/
placeholder: {
type: String
},
/**
* input id, 用于label关联
*/
inputId: {
type: String
},
/**
* 是否禁用
*/
disabled: {
type: Boolean
},
/**
* 是否只读
*/
readonly: {
type: Boolean
},
/**
* 是否可以清除
*/
clearable: {
type: Boolean
},
/**
* 最小字符长度
*/
minLength: {
type: Number
},
/**
* 最大字符长度
*/
maxLength: {
type: Number
},
/**
* 获取长度方法
*/
getLength: {
type: Function
},
/**
* 超过最大字符长度时是否允许输入
*/
inputOnOutlimit: {
type: Boolean,
default: true
},
/**
* 对值格式化,控制显示格式
*/
format: {
type: Function
},
/**
* 判断值的有效性
*/
validate: {
type: Function
},
/**
* 输入为无效值时,在blur/pressEnter时的回调,返回值为纠正后的值
*/
valueOnInvalidChange: {
type: Function
},
/**
* 显示密码的方式
*/
showPasswordEvent: {
type: String,
default: "pointerdown"
},
/**
* 是否自动适配内容宽度
*/
autoWidth: {
type: Boolean
},
/**
* 密码单个字符占位符
*/
passwordPlaceholder: {
type: String,
default: "•"
}
};
const inBoxProps = {
/**
* 大小 SizeT
*/
size: {
type: String
},
/**
* 圆角值 RoundT
*/
round: {
type: String
},
/**
* 颜色类型 Color2T
*/
color: {
type: String,
default: "normal"
},
/**
* 按钮类型 VariantT
*/
variant: {
type: String,
default: "outline"
},
/**
* 是否聚焦
*/
focused: {
type: Boolean
},
/**
* 是否禁用
*/
disabled: {
type: Boolean
},
/**
* 是否只读
*/
readonly: {
type: Boolean
}
};
const { size: size$1, round: round$1, color: color$1, variant: variant$1 } = inBoxProps;
const inputProps = {
...inInputProps,
size: size$1,
round: round$1,
color: color$1,
variant: variant$1,
/**
* 输入框的值
* v-model
*/
modelValue: {
type: [String, Number]
},
/**
* 输入框的默认值
* 非受控
*/
defaultValue: {
type: [String, Number]
}
};
const innerComponentInjectKey = Symbol("provide-inner-component");
function useComposition({ el } = {}) {
const isComposing = vue.ref(false);
const onCompositionStart = () => {
isComposing.value = true;
};
const onCompositionEnd = (e) => {
if (!isComposing.value) {
return;
}
isComposing.value = false;
trigger(e.target, "input");
};
vue.onMounted(() => {
if (!(el == null ? void 0 : el.value)) {
return;
}
el.value.addEventListener("compositionstart", onCompositionStart);
el.value.addEventListener("compositionend", onCompositionEnd);
});
vue.onUnmounted(() => {
if (!(el == null ? void 0 : el.value)) {
return;
}
el.value.removeEventListener("compositionstart", onCompositionStart);
el.value.removeEventListener("compositionend", onCompositionEnd);
});
return {
isComposing,
onCompositionStart,
onCompositionEnd
};
}
const Enter = {
key: "Enter"
};
function useInput(options) {
const { modelValue, defaultValue, format: format2, emits, emitUpdate, validate, valueOnInvalidChange, maxLength, minLength, calculateLength, inputOnOutlimit } = options;
const formatFn = (v) => {
return isFunction(format2) ? format2(v) : v;
};
const calculateStringLength = (v) => {
return isFunction(calculateLength) ? calculateLength(v) : v == null ? void 0 : v.length;
};
const uncontroledValue = vue.ref(defaultValue);
const controledValue = modelValue;
const computedValue = vue.computed(() => {
const cv = controledValue == null ? void 0 : controledValue.value;
const ucv = uncontroledValue.value ?? "";
return cv ?? ucv;
});
const displayValue = vue.ref(formatFn(computedValue.value));
const inputValueLength = vue.computed(() => {
return calculateStringLength(computedValue.value);
});
const validateMaxLength = (length) => {
if (!isNumber(maxLength == null ? void 0 : maxLength.value)) {
return true;
}
return length <= maxLength.value;
};
const validateMinLength = (length) => {
if (!isNumber(minLength == null ? void 0 : minLength.value)) {
return true;
}
return length >= minLength.value;
};
const validateLengthFn = (value) => {
const len = calculateStringLength(value);
return validateMaxLength(len) && validateMinLength(len);
};
const isOutLengthLimit = vue.computed(() => {
return !validateLengthFn(computedValue.value);
});
const mergedValidateFn = (v) => {
const r = validateLengthFn(v);
if (r && isFunction(validate)) {
return validate(v);
}
return r;
};
const inputEl = vue.ref();
const composition = useComposition({ el: inputEl });
const isFocus = vue.ref(false);
const isValid = vue.ref(true);
const validateValue = (value) => {
isValid.value = value === "" ? true : mergedValidateFn(value);
return isValid.value;
};
vue.watch(
() => [maxLength == null ? void 0 : maxLength.value, minLength == null ? void 0 : minLength.value],
() => {
validateValue(computedValue.value);
}
);
let lastValidValue = validateValue(computedValue.value) ? computedValue.value : "";
let lastValue = computedValue.value;
vue.watch(
() => computedValue.value,
(val) => {
if (!isUndefined(val) && validateValue(val)) {
lastValidValue = val;
}
if (isFocus.value) {
displayValue.value = val;
} else {
displayValue.value = formatFn(val);
}
}
);
const updateValue = (value) => {
uncontroledValue.value = value;
if (value !== computedValue.value) {
emitUpdate(value);
}
};
const getValidValue = () => {
let validVal = computedValue.value;
if (!isValid.value) {
if (isFunction(valueOnInvalidChange)) {
validVal = valueOnInvalidChange(computedValue.value, lastValidValue);
validateValue(validVal);
} else if (lastValidValue !== "") {
validVal = lastValidValue;
isValid.value = true;
}
}
return validVal;
};
const emitChange = (value) => {
if (value !== lastValue) {
vue.nextTick(() => {
lastValue = computedValue.value;
emits("change", computedValue.value, lastValue);
lastValue = computedValue.value;
});
}
};
const keepNativeDisplayValue = () => {
if (inputEl.value && inputEl.value.value !== displayValue.value) {
inputEl.value.value = displayValue.value;
}
};
const isAllowedToInputOnOutLimit = (value) => {
if (!isUndefined(maxLength == null ? void 0 : maxLength.value) && (inputOnOutlimit == null ? void 0 : inputOnOutlimit.value) === true) {
return true;
}
const len = calculateStringLength(value);
const isLower = validateMaxLength(len);
if (isLower) {
return true;
}
if (len < calculateStringLength(computedValue.value)) {
return true;
}
return false;
};
const handleInput = (e) => {
var _a;
const value = (_a = e.target) == null ? void 0 : _a.value;
if (composition.isComposing.value) {
displayValue.value = value;
return;
}
updateValue(value);
emits("input", e, value);
let newValue = value;
emits("input", e, value);
if (!isAllowedToInputOnOutLimit(value)) {
newValue = value.substring(0, maxLength == null ? void 0 : maxLength.value);
updateValue(newValue);
vue.nextTick(() => {
keepNativeDisplayValue();
});
}
};
const handleFocus = (e) => {
if (isFocus.value) {
return;
}
isFocus.value = true;
if (format2) {
displayValue.value = computedValue.value;
}
emits("focus", e);
};
const handleBlur = (e) => {
isFocus.value = false;
const validValue = getValidValue();
updateValue(validValue);
emitChange(validValue);
displayValue.value = formatFn(computedValue.value);
emits("blur", e);
};
const handlePressEnter = (e) => {
const keyCode = e.key || e.code;
if (!composition.isComposing.value && keyCode === Enter.key) {
const validValue = getValidValue();
updateValue(validValue);
emitChange(validValue);
emits("pressEnter", e);
}
};
const clearValue = () => {
displayValue.value = "";
isValid.value = true;
updateValue("");
emitChange("");
emits("clear");
};
const handleClear = (e) => {
e.stopPropagation();
e.preventDefault();
clearValue();
};
return {
realValue: vue.computed(() => computedValue.value),
displayValue: vue.computed(() => displayValue.value),
isValid,
inputEl,
clearValue,
inputValueLength,
isOutLengthLimit,
handleInput,
handleFocus,
handleBlur,
handlePressEnter,
handleClear
};
}
function useInputPassword(options) {
const showPassword = vue.ref(true);
vue.watchEffect(() => {
showPassword.value = options.type.value !== "password";
});
const toggle = (show) => {
if (show === void 0) {
showPassword.value = !showPassword.value;
} else {
showPassword.value = show;
}
};
const onEyeClick = () => {
if (options.disabled.value) {
return;
}
if (options.showPasswordEvent === "click") {
toggle();
}
};
const onEyeMouseUp = () => {
if (showPassword.value) {
toggle(false);
if (isTouchDevice) {
window.removeEventListener("touchend", onEyeMouseUp);
window.removeEventListener("touchcancel", onEyeMouseUp);
} else {
window.removeEventListener("mouseup", onEyeMouseUp);
}
}
};
const onEyeMouseDown = () => {
if (options.disabled.value) {
return;
}
if (options.showPasswordEvent === "pointerdown") {
toggle(true);
if (isTouchDevice) {
window.addEventListener("touchend", onEyeMouseUp);
window.addEventListener("touchcancel", onEyeMouseUp);
} else {
window.addEventListener("mouseup", onEyeMouseUp);
}
}
};
return {
showPassword,
onEyeMouseDown,
onEyeMouseUp,
onEyeClick
};
}
const _hoisted_1$o = ["for"];
const _hoisted_2$k = ["date-value"];
const _hoisted_3$e = ["id", "value", "type", "placeholder", "readonly", "disabled"];
const _hoisted_4$b = {
key: 0,
class: "o_input-suffix-icon"
};
const _hoisted_5$6 = ["innerHTML"];
const _hoisted_6$5 = { key: 4 };
const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
__name: "InInput",
props: inInputProps,
emits: ["update:modelValue", "change", "input", "focus", "blur", "clear", "pressEnter"],
setup(__props, { expose: __expose, emit: __emit }) {
const props = __props;
const slots = vue.useSlots();
const emits = __emit;
const { t } = useI18n();
const { disabled: disabled2, type, modelValue, inputOnOutlimit, maxLength, minLength } = vue.toRefs(props);
const {
displayValue,
clearValue: clear,
isValid,
inputValueLength,
isOutLengthLimit,
handleBlur,
handleInput,
handleFocus,
handlePressEnter,
handleClear,
inputEl
} = useInput({
emits,
maxLength,
minLength,
inputOnOutlimit,
modelValue,
defaultValue: props.defaultValue ?? "",
emitUpdate: (value) => {
emits("update:modelValue", value);
},
format: props.format,
validate: props.validate,
valueOnInvalidChange: props.valueOnInvalidChange,
calculateLength: props.getLength
});
const { showPassword, onEyeMouseDown, onEyeClick } = useInputPassword({
type,
disabled: disabled2,
showPasswordEvent: props.showPasswordEvent
});
const inputType = vue.ref(props.type);
const togglePassword = (visible) => {
if (isUndefined(visible)) {
if (inputType.value === "text") {
inputType.value = "password";
} else {
inputType.value = "text";
}
} else {
inputType.value = visible ? "text" : "password";
}
};
vue.watchEffect(() => {
togglePassword(showPassword.value);
});
const isClearable = vue.computed(() => props.clearable && !props.disabled && !props.readonly);
const focus = () => {
var _a;
(_a = inputEl.value) == null ? void 0 : _a.focus();
};
const blur = () => {
var _a;
(_a = inputEl.value) == null ? void 0 : _a.blur();
};
const autoWidth2 = vue.computed(() => props.autoWidth);
const mirrorValue = vue.computed(() => {
if (props.type === "password") {
return displayValue.value.replace(/./g, props.passwordPlaceholder);
}
return displayValue.value;
});
__expose({
inputEl,
focus,
blur,
clear,
togglePassword
});
return (_ctx, _cache) => {
var _a, _b, _c, _d;
return vue.openBlock(), vue.createElementBlock("label", {
class: vue.normalizeClass(["o_input", {
"o_input-clearable": isClearable.value && vue.unref(displayValue) !== "",
"o_input-disabled": props.disabled,
"o_input-readonly": props.readonly,
"o_input-password": props.type === "password",
"o_input-invalid": !vue.unref(isValid),
"o_input-auto-width": autoWidth2.value
}]),
for: props.inputId
}, [
((_a = slots.prefix) == null ? void 0 : _a.call(slots)) ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 0,
class: "o_input-prefix",
onMousedown: _cache[0] || (_cache[0] = vue.withModifiers(() => {
}, ["prevent"]))
},
[
vue.renderSlot(_ctx.$slots, "prefix")
],
32
/* NEED_HYDRATION */
)) : vue.createCommentVNode("v-if", true),
vue.createElementVNode("div", {
class: vue.normalizeClass(["o_input-wrap", { "o_input-wrap-auto-width": autoWidth2.value }]),
"date-value": mirrorValue.value
}, [
vue.createElementVNode("input", {
id: props.inputId,
ref_key: "inputEl",
ref: inputEl,
class: "o_input-input",
value: vue.unref(displayValue),
type: inputType.value,
placeholder: props.placeholder,
readonly: props.readonly,
disabled: props.disabled,
onFocus: _cache[1] || (_cache[1] = //@ts-ignore
(...args) => vue.unref(handleFocus) && vue.unref(handleFocus)(...args)),
onBlur: _cache[2] || (_cache[2] = //@ts-ignore
(...args) => vue.unref(handleBlur) && vue.unref(handleBlur)(...args)),
onInput: _cache[3] || (_cache[3] = //@ts-ignore
(...args) => vue.unref(handleInput) && vue.unref(handleInput)(...args)),
onKeydown: _cache[4] || (_cache[4] = //@ts-ignore
(...args) => vue.unref(handlePressEnter) && vue.unref(handlePressEnter)(...args))
}, null, 40, _hoisted_3$e)
], 10, _hoisted_2$k),
((_b = slots.suffix) == null ? void 0 : _b.call(slots)) || isClearable.value || props.type === "password" || props.maxLength ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 1,
class: "o_input-suffix",
onMousedown: _cache[10] || (_cache[10] = vue.withModifiers(() => {
}, ["prevent"]))
},
[
vue.createCommentVNode(" 自定义图标 "),
((_c = slots.suffix) == null ? void 0 : _c.call(slots)) ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$b, [
vue.renderSlot(_ctx.$slots, "suffix")
])) : vue.createCommentVNode("v-if", true),
vue.createCommentVNode(" 清除图标 "),
isClearable.value ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 1,
class: "o_input-clear",
onClick: _cache[5] || (_cache[5] = //@ts-ignore
(...args) => vue.unref(handleClear) && vue.unref(handleClear)(...args)),
onMousedown: _cache[6] || (_cache[6] = vue.withModifiers(() => {
}, ["prevent"]))
},
[
vue.createVNode(vue.unref(IconClose), { class: "o_input-clear-icon" })
],
32
/* NEED_HYDRATION */
)) : vue.createCommentVNode("v-if", true),
vue.createCommentVNode(" 密码图标 "),
props.type === "password" ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 2,
class: "o_input-eye",
onClick: _cache[7] || (_cache[7] = vue.withModifiers(
//@ts-ignore
(...args) => vue.unref(onEyeClick) && vue.unref(onEyeClick)(...args),
["prevent", "stop"]
)),
onMousedown: _cache[8] || (_cache[8] = vue.withModifiers(
//@ts-ignore
(...args) => vue.unref(onEyeMouseDown) && vue.unref(onEyeMouseDown)(...args),
["prevent", "stop"]
)),
onTouchstart: _cache[9] || (_cache[9] = vue.withModifiers(
//@ts-ignore
(...args) => vue.unref(onEyeMouseDown) && vue.unref(onEyeMouseDown)(...args),
["stop"]
))
},
[
vue.unref(showPassword) ? (vue.openBlock(), vue.createBlock(vue.unref(IconEyeOn), {
key: 0,
class: "o_input-eye-icon"
})) : (vue.openBlock(), vue.createBlock(vue.unref(IconEyeOff), {
key: 1,
class: "o_input-eye-icon"
}))
],
32
/* NEED_HYDRATION */
)) : vue.createCommentVNode("v-if", true),
vue.createCommentVNode(" 长度限制 "),
props.maxLength ? (vue.openBlock(), vue.createElementBlock("div", {
key: 3,
class: vue.normalizeClass(["o_input-limit", { "o_input-limit-error": vue.unref(isOutLengthLimit) }]),
innerHTML: vue.unref(t)("input.limit", vue.unref(inputValueLength), props.maxLength)
}, null, 10, _hoisted_5$6)) : vue.createCommentVNode("v-if", true),
((_d = slots.extra) == null ? void 0 : _d.call(slots)) ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_6$5, [
vue.renderSlot(_ctx.$slots, "extra")
])) : vue.createCommentVNode("v-if", true)
],
32
/* NEED_HYDRATION */
)) : vue.createCommentVNode("v-if", true)
], 10, _hoisted_1$o);
};
}
});
const _hoisted_1$n = {
key: 0,
class: "o_box-prepend"
};
const _hoisted_2$j = {
key: 1,
class: "o_box-append"
};
const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
__name: "InBox",
props: inBoxProps,
setup(__props) {
const props = __props;
const round2 = getRoundClass(props, "_box");
return (_ctx, _cache) => {
var _a, _b, _c, _d;
return vue.openBlock(), vue.createElementBlock(
"div",
{
class: vue.normalizeClass(["o_box", [`o_box-${props.color}`, `o_box-${props.variant}`, `o_box-${props.size || vue.unref(defaultSize)}`, vue.unref(round2).class.value]]),
style: vue.normalizeStyle(vue.unref(round2).style.value)
},
[
((_b = (_a = _ctx.$slots).prepend) == null ? void 0 : _b.call(_a)) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$n, [
vue.renderSlot(_ctx.$slots, "prepend")
])) : vue.createCommentVNode("v-if", true),
vue.createElementVNode(
"div",
{
class: vue.normalizeClass(["o_box-main", [
{
"o_box-disabled": props.disabled,
"o_box-readonly": props.readonly,
"o_box-focused": props.focused,
"has-prepend": _ctx.$slots.prepend,
"has-append": _ctx.$slots.append
}
]])
},
[
vue.renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
),
((_d = (_c = _ctx.$slots).append) == null ? void 0 : _d.call(_c)) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$j, [
vue.renderSlot(_ctx.$slots, "append")
])) : vue.createCommentVNode("v-if", true)
],
6
/* CLASS, STYLE */
);
};
}
});
const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
__name: "OInput",
props: inputProps,
emits: ["update:modelValue", "change", "input", "blur", "focus", "clear", "pressEnter"],
setup(__props, { expose: __expose, emit: __emit }) {
const props = __props;
const emits = __emit;
const innerComponentInject = vue.inject(innerComponentInjectKey, null);
const formItemInjection = (innerComponentInject == null ? void 0 : innerComponentInject.isInnerInput) ? null : vue.inject(formItemInjectKey, null);
const inInputRef = vue.ref();
const color2 = vue.computed(() => {
var _a;
if (formItemInjection == null ? void 0 : formItemInjection.fieldResult.value) {
return ((_a = formItemInjection == null ? void 0 : formItemInjection.fieldResult.value) == null ? void 0 : _a.type) || "normal";
}
return props.color;
});
const onInput = (e, value) => {
var _a, _b;
emits("input", e, value);
(_b = formItemInjection == null ? void 0 : (_a = formItemInjection.fieldHandlers).onInput) == null ? void 0 : _b.call(_a);
};
const isFocus = vue.ref(false);
const onFocus = (e) => {
var _a, _b;
if (isFocus.value) {
return;
}
isFocus.value = true;
emits("focus", e);
(_b = formItemInjection == null ? void 0 : (_a = formItemInjection.fieldHandlers).onFocus) == null ? void 0 : _b.call(_a);
};
const onBlur = (e) => {
var _a, _b;
isFocus.value = false;
emits("blur", e);
(_b = formItemInjection == null ? void 0 : (_a = formItemInjection.fieldHandlers).onBlur) == null ? void 0 : _b.call(_a);
};
const onPressEnter = (e) => {
emits("pressEnter", e);
};
const onClear = (e) => {
emits("clear", e);
};
const onUpdatedModelValue = (value) => {
emits("update:modelValue", value);
};
const onChange = (value) => {
var _a, _b;
emits("change", value);
(_b = formItemInjection == null ? void 0 : (_a = formItemInjection.fieldHandlers).onChange) == null ? void 0 : _b.call(_a);
};
const inputId2 = vue.ref(props.inputId);
vue.onMounted(() => {
if (!inputId2.value) {
inputId2.value = uniqueId();
}
});
__expose({
focus: () => {
var _a;
return (_a = inInputRef.value) == null ? void 0 : _a.focus();
},
blur: () => {
var _a;
return (_a = inInputRef.value) == null ? void 0 : _a.blur();
},
clear: () => {
var _a;
return (_a = inInputRef.value) == null ? void 0 : _a.clear();
},
inputEl: () => {
var _a;
return (_a = inInputRef.value) == null ? void 0 : _a.inputEl;
},
togglePassword: () => {
var _a;
return (_a = inInputRef.value) == null ? void 0 : _a.togglePassword();
}
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(
vue.h(
vue.unref(_sfc_main$y),
{
class: "o-input",
size: props.size,
variant: props.variant,
color: color2.value,
disabled: props.disabled,
readonly: props.readonly,
round: props.round,
focused: isFocus.value
},
{
default: () => vue.h(
vue.unref(_sfc_main$z),
{
ref: "inInputRef",
class: [
"o-input-wrap",
{
"has-suffix": _ctx.$slots.suffix,
"has-prepend": _ctx.$slots.prepend,
"has-append": _ctx.$slots.append
}
],
inputId: inputId2.value,
modelValue: vue.unref(formateToString)(props.modelValue),
defaultValue: vue.unref(formateToString)(props.defaultValue),
...vue.unref(pick)(props, [
"type",
"placeholder",
"disabled",
"readonly",
"clearable",
"format",
"showPasswordEvent",
"validate",
"valueOnInvalidChange",
"autoWidth",
"maxLength",
"minLength",
"getLength",
"inputOnOutlimit"
]),
onChange,
onInput,
onFocus,
onBlur,
onPressEnter,
onClear,
"onUpdate:modelValue": onUpdatedModelValue
},
vue.unref(pick)(_ctx.$slots, ["extra", "prefix", "suffix"])
),
...vue.unref(pick)(_ctx.$slots, ["append", "prepend"])
}
)
));
};
}
});
const OInput = Object.assign(_sfc_main$x, {
install(app) {
app.component("OInput", _sfc_main$x);
}
});
function string2number(value) {
return value === "" ? NaN : Number(value);
}
function number2string(value) {
return Number.isNaN(value) || isUndefined(value) ? "" : String(value);
}
function isValidNumber(val, min, max, parse) {
if (Number.isNaN(val)) {
return false;
}
const value = isFunction(parse) ? parse(String(val)) : val;
if (isNumber(Number(value))) {
const v = Number(value);
if (!isUndefined(min) && v < min) {
return false;
}
if (!isUndefined(max) && v > max) {
return false;
}
return true;
}
return false;
}
function correctValue(val, lastVal, min, max) {
if (isNumber(val)) {
if (!isUndefined(max) && val > max) {
return max;
}
if (!isUndefined(min) && val < min) {
return min;
}
return val;
}
return lastVal;
}
const { size, round, color, variant, placeholder, readonly, disabled, autoWidth, format, inputId } = inputProps;
const InputNumberControlTypes = ["both", "right", "left", "none"];
const inputNumberProps = {
/**
* 下拉框的值
* v-model
*/
modelValue: {
type: Number
},
/**
* 下拉框的默认值
* 非受控
*/
defaultValue: {
type: Number
},
/**
* 按钮点击时步长
*/
step: {
type: Number,
default: 1
},
/**
* 最小值
*/
min: {
type: Number
},
/**
* 最大值
*/
max: {
type: Number
},
/**
* 控制按钮位置 InputNumberControlT
*/
controls: {
type: String,
default: "both"
},
/**
* 是否可以清除
*/
clearable: {
type: Boolean,
default: false
},
/**
* 大小 SizeT
*/
size,
/**
* 圆角值 RoundT
*/
round,
/**
* 颜色类型 Color2T
*/
color,
/**
* 按钮类型 VariantT
*/
variant,
/**
* 提示文本
*/
placeholder,
/**
* 是否禁用
*/
disabled,
/**
* 是否只读
*/
readonly,
/**
* 是否自动增加宽度
*/
autoWidth,
/**
* 对值格式化,控制显示格式
*/
format,
/**
* 无效值判断
*/
validate: {
type: Function
},
/**
* input id
*/
inputId,
/**
* 当输入为空字符串时,默认值
*/
clearValue: {
type: Number
}
};
const _hoisted_1$m = { class: "o-input-number-btn-wrap" };
const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
__name: "NumberControl",
props: {
type: {},
addable: { type: Boolean },
reducible: { type: Boolean }
},
emits: ["plus", "minus"],
setup(__props, { emit: __emit }) {
const props = __props;
const emits = __emit;
const onControlClick = (type, e) => {
if (type === "plus" && props.addable) {
emits("plus", e);
} else if (type === "minus" && props.reducible) {
emits("minus", e);
}
};
const isDisabledWhenNotBoth = () => {
if (props.type === "plus") {
return !props.addable;
} else if (props.type === "minus") {
return !props.reducible;
}
};
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$m, [
props.type === "both" ? (vue.openBlock(), vue.createElementBlock(
vue.Fragment,
{ key: 0 },
[
vue.createElementVNode(
"div",
{
class: vue.normalizeClass(["o-input-number-btn", [
{
"is-disabled": !props.addable
},
`type-${props.type}`
]]),
tabindex: "-1",
onClick: _cache[0] || (_cache[0] = (e) => onControlClick("plus", e))
},
[
vue.renderSlot(_ctx.$slots, "plus", {}, () => [
vue.createVNode(vue.unref(IconChevronUp), { class: "o-input-number-icon-plus" })
])
],
2
/* CLASS */
),
vue.createElementVNode(
"div",
{
class: vue.normalizeClass(["o-input-number-btn minus", {
"is-disabled": !props.reducible
}]),
tabindex: "-1",
onClick: _cache[1] || (_cache[1] = (e) => onControlClick("minus", e))
},
[
vue.renderSlot(_ctx.$slots, "minus", {}, () => [
vue.createVNode(vue.unref(IconChevronDown), { class: "o-input-number-icon-minus" })
])
],
2
/* CLASS */
)
],
64
/* STABLE_FRAGMENT */
)) : (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 1,
class: vue.normalizeClass(["o-input-number-btn", {
"is-disabled": isDisabledWhenNotBoth()
}]),
tabindex: "-1",
onClick: _cache[2] || (_cache[2] = (e) => onControlClick(props.type, e))
},
[
props.type === "plus" ? vue.renderSlot(_ctx.$slots, "plus", { key: 0 }, () => [
vue.createVNode(vue.unref(IconAdd))
]) : vue.createCommentVNode("v-if", true),
props.type === "minus" ? vue.renderSlot(_ctx.$slots, "minus", { key: 1 }, () => [
vue.createVNode(vue.unref(IconMinus))
]) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
))
]);
};
}
});
const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
__name: "OInputNumber",
props: inputNumberProps,
emits: ["update:modelValue", "change", "input", "blur", "focus", "clear", "pressEnter", "plus", "minus"],
setup(__props, { emit: __emit }) {
const props = __props;
const emits = __emit;
const inputValue = vue.ref(number2string(props.modelValue ?? props.defaultValue));
const realValue = vue.ref(props.modelValue ?? props.defaultValue ?? NaN);
let lastValue = realValue.value;
const formItemInjection = vue.inject(formItemInjectKey, null);
const color2 = vue.computed(() => {
var _a;
if (formItemInjection == null ? void 0 : formItemInjection.fieldResult.value) {
return ((_a = formItemInjection == null ? void 0 : formItemInjection.fieldResult.value) == null ? void 0 : _a.type) || void 0;
} else {
return props.color;
}
});
vue.watch(
() => props.modelValue,
(val) => {
if (realValue.value !== val) {
inputValue.value = number2string(val);
realValue.value = val ?? 0;
lastValue = realValue.value;
}
}
);
const validate = (value) => {
const val = string2number(value);
let valid = isValidNumber(val, props.min, props.max);
if (valid) {
valid = isFunction(props.validate) ? props.validate(val) : true;
}
return valid;
};
const valueOnInvalidChange = (_, last) => {
return last;
};
const emitChange = () => {
var _a, _b;
if (realValue.value !== lastValue) {
emits("change", realValue.value);
lastValue = realValue.value;
(_b = formItemInjection == null ? void 0 : (_a = formItemInjection.fieldHandlers).onChange) == null ? void 0 : _b.call(_a);
}
};
const emitUpdateValue = () => {
emits("update:modelValue", realValue.value);
};
const onInput = (evt) => {
var _a, _b;
emits("input", evt);
(_b = formItemInjection == null ? void 0 : (_a = formItemInjection.fieldHandlers).onInput) == null ? void 0 : _b.call(_a);
};
const onFocus = (evt) => {
var _a, _b;
emits("focus", evt);
(_b = formItemInjection == null ? void 0 : (_a = formItemInjection.fieldHandlers).onFocus) == null ? void 0 : _b.call(_a);
};
const onBlur = (evt) => {
var _a, _b;
emits("blur", evt);
(_b = formItemInjection == null ? void 0 : (_a = formItemInjection.fieldHandlers).onBlur) == null ? void 0 : _b.call(_a);
};
const onPressEnter = (evt) => {
emits("pressEnter", evt);
};
const onChange = (value) => {
realValue.value = string2number(value);
if (isNaN(realValue.value) && isNumber(props.clearValue)) {
realValue.value = props.clearValue;
emitUpdateValue();
}
inputValue.value = number2string(realValue.value);
emitChange();
};
const onUpdateModelValue = (value) => {
inputValue.value = value;
realValue.value = string2number(value);
emitUpdateValue();
};
const addable = vue.computed(() => {
if (props.disabled) {
return false;
}
if (!isUndefined(props.max) && props.max <= realValue.value) {
return false;
}
return true;
});
const reducible = vue.computed(() => {
if (props.disabled) {
return false;
}
if (!isUndefined(props.min) && props.min >= realValue.value) {
return false;
}
return true;
});
const onControlEvent = (type, e) => {
if (props.disabled) {
return;
}
let v = Number.isNaN(realValue.value) ? 0 : realValue.value;
if (type === "plus") {
v += props.step;
} else if (type === "minus") {
v -= props.step;
}
v = correctValue(v, lastValue, props.min, props.max);
realValue.value = v;
inputValue.value = number2string(v);
emitUpdateValue();
emitChange();
if (type === "plus") {
emits("plus", v, e);
} else if (type === "minus") {
emits("minus", v, e);
}
};
vue.provide(innerComponentInjectKey, {
isInnerInput: true
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createBlock(vue.unref(OInput), {
"model-value": inputValue.value,
class: vue.normalizeClass(["o-input-number", [props.autoWidth ? "" : `o-input-number-size-${props.size || vue.unref(defaultSize)}`]]),
validate,
valueOnInvalidChange,
size: props.size,
placeholder: props.placeholder,
color: color2.value,
variant: props.variant,
round: props.round,
disabled: props.disabled,
readonly: props.readonly,
clearable: props.clearable,
"auto-width": props.autoWidth,
format: props.format,
"input-id": props.inputId,
type: "text",
onInput,
onBlur,
onFocus,
onPressEnter,
onChange,
"onUpdate:modelValue": onUpdateModelValue
}, vue.createSlots({
_: 2
/* DYNAMIC */
}, [
["both", "left"].includes(props.controls) ? {
name: "prepend",
fn: vue.withCtx(() => [
vue.createVNode(_sfc_main$w, {
class: vue.normalizeClass({ "o-input-control-left": props.controls === "both" }),
type: props.controls === "left" ? "both" : "minus",
addable: addable.value,
reducible: reducible.value,
onMinus: _cache[0] || (_cache[0] = (e) => onControlEvent("minus", e)),
onPlus: _cache[1] || (_cache[1] = (e) => onControlEvent("plus", e))
}, {
plus: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "plus")
]),
minus: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "minus")
]),
_: 3
/* FORWARDED */
}, 8, ["class", "type", "addable", "reducible"])
]),
key: "0"
} : void 0,
["both", "right"].includes(props.controls) ? {
name: "append",
fn: vue.withCtx(() => [
vue.createVNode(_sfc_main$w, {
class: vue.normalizeClass({ "o-input-control-right": props.controls === "both" }),
type: props.controls === "right" ? "both" : "plus",
addable: addable.value,
reducible: reducible.value,
onMinus: _cache[2] || (_cache[2] = (e) => onControlEvent("minus", e)),
onPlus: _cache[3] || (_cache[3] = (e) => onControlEvent("plus", e))
}, {
plus: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "plus")
]),
minus: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "minus")
]),
_: 3
/* FORWARDED */
}, 8, ["class", "type", "addable", "reducible"])
]),
key: "1"
} : void 0,
_ctx.$slots.prefix ? {
name: "prefix",
fn: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "prefix")
]),
key: "2"
} : void 0,
_ctx.$slots.suffix ? {
name: "suffix",
fn: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "suffix")
]),
key: "3"
} : void 0
]), 1032, ["model-value", "class", "size", "placeholder", "color", "variant", "round", "disabled", "readonly", "clearable", "auto-width", "format", "input-id"]);
};
}
});
const OInputNumber = Object.assign(_sfc_main$v, {
install(app) {
app.component("OInputNumber", _sfc_main$v);
}
});
const LinkSizeTypes = ["large", "medium", "small", "auto"];
const linkProps = {
/**
* 包含超链接指向的 URL 或 URL 片段。
*/
href: {
type: String
},
/**
* 指定在何处显示链接的资源。
*/
target: {
type: String
},
/**
* 是否为loading状态
*/
loading: {
type: Boolean
},
/**
* 链接颜色
*/
color: {
type: String,
default: "normal"
},
/**
* 按钮尺寸 SizeT
*/
size: {
type: String,
default: "auto"
},
/**
* 是否禁用
*/
disabled: {
type: Boolean
},
/**
* 前缀图标
*/
icon: {
type: Object
},
/**
* 后缀
*/
suffix: {
type: Boolean
},
/**
* hover时是否显示背景
*/
hoverBg: {
type: Boolean
},
/**
* hover时是否下划线
*/
hoverUnderline: {
type: Boolean
},
/**
* 元素标签
*/
tag: {
type: String,
default: "a"
},
/**
* 全局配置是否生效
*/
global: {
type: Boolean,
default: true
}
};
const _hoisted_1$l = {
key: 0,
class: "o-link-prefix"
};
const _hoisted_2$i = { class: "o-link-main" };
const _hoisted_3$d = {
key: 0,
class: "o-link-label"
};
const _hoisted_4$a = {
key: 1,
class: "o-link-suffix"
};
const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
__name: "OLink",
props: linkProps,
emits: ["click"],
setup(__props, { emit: __emit }) {
const props = __props;
const configProvider = vue.inject(configProviderInjectKey, {});
const $attr = vue.useAttrs();
const emits = __emit;
const onClick = (e) => {
var _a;
if (props.disabled || props.loading) {
e.preventDefault();
return;
}
emits("click", e);
if (props.global) {
(_a = configProvider.link) == null ? void 0 : _a.click(e, props, $attr);
}
};
return (_ctx, _cache) => {
return vue.openBlock(), vue.createBlock(vue.unref(HtmlTag), vue.mergeProps({
tag: props.tag,
class: ["o-link", [
{
"o-link-disabled": props.disabled,
"o-link-hover-bg": props.hoverBg,
"o-link-hover-underline": props.hoverUnderline
},
`o-link-${props.color}`,
`o-link-${props.size || vue.unref(defaultSize)}`
]],
href: props.href,
target: props.target
}, _ctx.$attrs, { onClick }), {
default: vue.withCtx(() => [
_ctx.$slots.icon || props.icon || props.loading ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$l, [
props.loading ? (vue.openBlock(), vue.createBlock(vue.unref(IconLoading), {
key: 0,
class: "o-rotating"
})) : vue.renderSlot(_ctx.$slots, "icon", { key: 1 }, () => [
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(props.icon)))
])
])) : vue.createCommentVNode("v-if", true),
vue.createElementVNode("span", _hoisted_2$i, [
props.hoverUnderline ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$d, [
vue.renderSlot(_ctx.$slots, "default")
])) : vue.renderSlot(_ctx.$slots, "default", { key: 1 })
]),
_ctx.$slots.suffix || props.suffix ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$a, [
vue.renderSlot(_ctx.$slots, "suffix", {}, () => [
vue.createVNode(vue.unref(IconLinkArrow), { class: "o-link-icon-arrow" })
])
])) : vue.createCommentVNode("v-if", true)
]),
_: 3
/* FORWARDED */
}, 16, ["tag", "href", "target", "class"]);
};
}
});
const OLink = Object.assign(_sfc_main$u, {
install(app) {
app.component("OLink", _sfc_main$u);
}
});
const { maskClose, ...extractProps } = layerProps;
const loadingProps = {
...extractProps,
/**
* loading文本
*/
label: {
type: String
},
/**
* loading图标
*/
icon: {
type: Object
},
/**
* loading图标是否旋转
*/
iconRotating: {
type: Boolean
}
};
const _hoisted_1$k = { class: "o-loading-icon" };
const _hoisted_2$h = {
key: 0,
class: "o-loading-label"
};
const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
__name: "OLoading",
props: loadingProps,
emits: ["change", "update:visible"],
setup(__props, { expose: __expose, emit: __emit }) {
const props = __props;
const emits = __emit;
const layerRef = vue.ref(null);
__expose({
toggle(show) {
var _a;
(_a = layerRef.value) == null ? void 0 : _a.toggle(show);
}
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createBlock(vue.unref(OLayer), {
ref_key: "layerRef",
ref: layerRef,
class: "o-loading",
visible: props.visible,
wrapper: props.wrapper,
"unmount-on-hide": props.unmountOnHide,
"main-class": vue.unref(mergeClass)("o-loading-main", props.mainClass),
"main-transition": props.mainTransition,
"mask-transition": props.maskTransition,
"transition-orign": "css",
mask: props.mask,
"mask-close": false,
onChange: _cache[0] || (_cache[0] = (v) => emits("change", v)),
"onUpdate:visible": _cache[1] || (_cache[1] = (v, e) => emits("update:visible", v, e))
}, {
default: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "default", {}, () => [
vue.createElementVNode("div", _hoisted_1$k, [
vue.renderSlot(_ctx.$slots, "icon", {}, () => [
props.icon ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(props.icon), {
key: 0,
class: vue.normalizeClass({ "o-rotating": props.iconRotating })
}, null, 8, ["class"])) : (vue.openBlock(), vue.createBlock(vue.unref(IconLoading), {
key: 1,
class: "o-rotating"
}))
])
]),
_ctx.$slots.label || props.label ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$h, [
vue.renderSlot(_ctx.$slots, "label", {}, () => [
vue.createTextVNode(
vue.toDisplayString(props.label),
1
/* TEXT */
)
])
])) : vue.createCommentVNode("v-if", true)
])
]),
_: 3
/* FORWARDED */
}, 8, ["visible", "wrapper", "unmount-on-hide", "main-class", "main-transition", "mask-transition", "mask"]);
};
}
});
let vLoadingOption = {};
const setVLoadingOption = (option) => {
vLoadingOption = option;
};
const vLoading = {
mounted(el, binding) {
const vnode = vue.h(
_sfc_main$t,
Object.assign(vLoadingOption, {
visible: binding.value,
wrapper: binding.modifiers.body ? "body" : null,
mask: !binding.modifiers.nomask
})
);
if (binding.modifiers.body) {
vue.render(vnode, document.body);
} else {
vue.render(vnode, el);
}
const vm = vnode.component;
el.__loading_data = {
instance: vm
};
},
updated(el, binding) {
if (binding.value !== binding.oldValue) {
const data = el.__loading_data;
if (data) {
data.instance.exposed.toggle(!!binding.value);
}
}
}
};
const initLoading = (opt2, el) => {
const vnode = vue.h(_sfc_main$t, Object.assign(opt2 || {}, { wrapper: el }));
if (el) {
vue.render(vnode, el);
}
return vnode.component;
};
const useLoading = (opt2, wrap = "body") => {
let instance2 = null;
if (vue.isRef(wrap)) {
vue.watch(
() => wrap.value,
(el) => {
instance2 = initLoading(opt2, el);
},
{
immediate: true
}
);
} else if (wrap.nodeType === 1) {
instance2 = initLoading(opt2, wrap);
} else if (typeof wrap === "string") {
vue.onMounted(() => {
const el = document.querySelector(wrap);
if (el) {
instance2 = initLoading(opt2, el);
}
});
}
return {
toggle(show) {
var _a;
(_a = instance2 == null ? void 0 : instance2.exposed) == null ? void 0 : _a.toggle(show);
}
};
};
const OLoading = Object.assign(_sfc_main$t, {
vLoading,
setVLoadingOption,
useLoading,
install(app) {
app.component("OLoading", _sfc_main$t);
}
});
const menuInjectKey = Symbol("provide-menu");
const subMenuInjectKey = Symbol("provide-sub-menu");
const MenuSizeTypes = ["medium", "small"];
const menuProps = {
/**
* @zh-CN 菜单尺寸
* @en-US Menu size
* @default 'medium'
*/
size: {
type: String,
default: "medium"
},
/**
* @zh-CN 是否开启手风琴模式
* @en-US Whether to enable accordion mode
* @default false
*/
accordion: {
type: Boolean,
default: false
},
/**
* @zh-CN 选中值
* @en-US Selected value
*/
modelValue: {
type: String
},
/**
* @zh-CN 非受控模式时,默认选中值
* @en-US Default selected value when not controlled
* @default ''
*/
defaultValue: {
type: String,
default: ""
},
/**
* @zh-CN 展开节点值
* @en-US Expanded node value
*/
expanded: {
type: Array
},
/**
* @zh-CN 非受控模式时,默认展开节点值
* @en-US Default expanded node value when not controlled
* @default []
*/
defaultExpanded: {
type: Array,
default: () => []
},
/**
* @zh-CN 父子节点是否关联
* @en-US Whether parent and child nodes are associated
* @default false
*/
selectStrictly: {
type: Boolean,
default: false
},
/**
* @zh-CN 折叠箭头的位置
* @en-US Position of the collapse arrow
* @default right
*/
arrowPosition: {
type: String,
default: "right"
}
};
const subMenuProps = {
/**
* @zh-CN 菜单项值
* @en-US Menu item value
*/
value: {
type: String,
required: true
},
/**
* @zh-CN 菜单项是否可选
* @en-US Whether the menu item is selectable
*/
selectable: {
type: Boolean
},
/**
* @zh-CN 前缀图标
* @en-US Prefix icon
*/
icon: {
type: Object
}
};
const menuItemProps = {
/**
* @zh-CN 菜单项值
* @en-US Menu item value
*/
value: {
type: String,
required: true
},
/**
* @zh-CN 前缀图标
* @en-US Prefix icon
*/
icon: {
type: Object
},
/**
* @zh-CN 禁用
* @en-US Disabled
* @default false
*/
disabled: {
type: Boolean,
default: false
}
};
class VTree {
constructor(value, parent, children = []) {
__publicField(this, "root");
this.root = {
value,
parent,
children
};
}
getNode(node, val) {
if (node.value === val) {
return node;
}
const children = node.children;
for (let i = 0, len = children.length; i < len; i++) {
const rlt = this.getNode(children[i], val);
if (rlt) {
return rlt;
}
}
}
getPath(node, val, path) {
const children = node.children;
for (let i = 0, len = children.length; i < len; i++) {
const child = children[i];
if (child.value === val) {
return [...path, child];
}
const rlt = this.getPath(child, val, [...path, child]);
if (rlt) {
return rlt;
}
}
}
hasSameNode(nodes, val) {
return nodes.some((item) => item.value === val);
}
addNode(node) {
const parent = node.parent;
if (!parent) {
if (!this.hasSameNode(this.root.children, node.value)) {
node.parent = this.root;
this.root.children.push(node);
}
} else {
const parentNode = this.getNode(this.root, parent.value);
if (parentNode && !this.hasSameNode(parentNode.children, node.value)) {
node.parent = parentNode;
parentNode.children.push(node);
}
}
}
}
class MenuTree extends VTree {
constructor(value, parent, children = []) {
super(value, parent, children);
}
addChild(options) {
const { value, parentVal } = options;
const node = {
value,
parent: null,
children: []
};
if (isUndefined(parentVal)) {
if (!this.hasSameNode(this.root.children, node.value)) {
node.parent = this.root;
this.root.children.push(node);
}
} else {
const parentNode = this.getNode(this.root, parentVal);
if (parentNode && !this.hasSameNode(parentNode.children, node.value)) {
node.parent = parentNode;
parentNode.children.push(node);
}
}
}
selectNode(val) {
const path = this.getPath(this.root, val, []) || [];
return path.map((node) => {
if (isString(node.value)) {
return node.value;
}
});
}
getSiblings(val) {
const node = this.getNode(this.root, val);
if (!node || !node.parent) {
return [];
}
return node.parent.children.map((item) => {
if (item.value !== val) {
return item.value;
}
});
}
}
const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
__name: "OMenu",
props: menuProps,
emits: ["update:modelValue", "change", "update:expanded", "expanded-change"],
setup(__props, { emit: __emit }) {
const props = __props;
const emits = __emit;
const menuTree = new MenuTree(NaN, null);
const { size: size2, accordion, modelValue, defaultValue, expanded, defaultExpanded } = vue.toRefs(props);
const realValue = vue.ref((modelValue == null ? void 0 : modelValue.value) ?? defaultValue.value);
vue.watch(
() => modelValue == null ? void 0 : modelValue.value,
(val) => {
if (!isUndefined(val)) {
realValue.value = val;
}
}
);
const updateModelValue = (val) => {
realValue.value = val;
emits("update:modelValue", val);
emits("change", val);
};
const activeNodes = vue.ref([]);
vue.watch(
() => realValue.value,
(val) => {
activeNodes.value = menuTree.selectNode(val);
}
);
vue.onMounted(() => {
activeNodes.value = menuTree.selectNode(realValue.value);
});
const realExpanded = vue.ref(isArray(expanded == null ? void 0 : expanded.value) ? expanded == null ? void 0 : expanded.value : defaultExpanded.value);
vue.watch(
() => expanded == null ? void 0 : expanded.value,
(val) => {
if (isArray(val)) {
realExpanded.value = val;
}
}
);
const updateExpanded = (val) => {
realExpanded.value = val;
emits("update:expanded", val);
emits("expanded-change", val);
};
vue.provide(menuInjectKey, {
size: size2,
accordion,
realValue,
activeNodes,
realExpanded,
menuTree,
updateModelValue,
updateExpanded,
arrowPosition: vue.toRef(props, "arrowPosition")
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"ul",
{
class: vue.normalizeClass([
"o-menu",
`o-menu-${vue.unref(size2)}`,
_ctx.arrowPosition && `o-menu-arrow-${_ctx.arrowPosition}`
])
},
[
vue.renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
);
};
}
});
const _hoisted_1$j = ["data-level"];
const _hoisted_2$g = {
key: 0,
class: "o-sub-menu-arrow"
};
const _hoisted_3$c = {
key: 1,
class: "o-sub-menu-title-icon"
};
const _hoisted_4$9 = {
key: 2,
class: "o-sub-menu-arrow"
};
const _hoisted_5$5 = { class: "o-sub-menu-children-wrap" };
const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
__name: "OSubMenu",
props: subMenuProps,
setup(__props) {
const props = __props;
const menuInjection = vue.inject(menuInjectKey, null);
const subMenuInjection = vue.inject(subMenuInjectKey, null);
const { arrowPosition } = menuInjection || {};
const isExpanded = vue.computed(() => {
if (isUndefined(props.value)) {
return false;
}
if (menuInjection) {
return menuInjection.realExpanded.value.includes(props.value);
}
return false;
});
const isAssociatedSelected = vue.computed(() => {
if (menuInjection) {
return menuInjection.activeNodes.value.includes(props.value);
}
return false;
});
const isSelected = vue.computed(() => {
if (menuInjection) {
return menuInjection.realValue.value === props.value;
}
return false;
});
const onSubItemClick = (ev) => {
ev.stopPropagation();
if (isUndefined(props.value)) {
return;
}
let set = menuInjection ? /* @__PURE__ */ new Set([...menuInjection.realExpanded.value]) : /* @__PURE__ */ new Set([]);
if (isExpanded.value && set.has(props.value)) {
set.delete(props.value);
}
if (!isExpanded.value && !set.has(props.value)) {
if (menuInjection == null ? void 0 : menuInjection.accordion.value) {
const siblings = (menuInjection == null ? void 0 : menuInjection.menuTree.getSiblings(props.value)) || [];
siblings.forEach((val) => {
set.delete(val);
});
}
set.add(props.value);
}
const expandedVal = Array.from(set);
menuInjection == null ? void 0 : menuInjection.updateExpanded(expandedVal);
if (props.selectable) {
menuInjection == null ? void 0 : menuInjection.updateModelValue(props.value);
}
};
const currentDepth = subMenuInjection ? subMenuInjection.parentDepth + 1 : 0;
vue.provide(subMenuInjectKey, {
value: props.value,
parentDepth: currentDepth
});
menuInjection == null ? void 0 : menuInjection.menuTree.addChild({
value: props.value,
parentVal: subMenuInjection == null ? void 0 : subMenuInjection.value
});
const subMenuTitleRef = vue.ref();
const itemContentRef = vue.ref();
const isContentOverflow = vue.ref(false);
const content = vue.ref("");
vue.onMounted(() => {
var _a;
if (!itemContentRef.value) {
return;
}
isContentOverflow.value = isOverflown(itemContentRef.value);
content.value = ((_a = itemContentRef.value) == null ? void 0 : _a.innerText) || "";
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("li", {
class: vue.normalizeClass({
"o-sub-menu": true,
"o-sub-menu-selected": isSelected.value,
"o-sub-menu-associated-selected": isAssociatedSelected.value,
"o-sub-menu-expanded": isExpanded.value
}),
style: vue.normalizeStyle({ "--menu-level": vue.unref(currentDepth) }),
"data-level": vue.unref(currentDepth),
onClick: onSubItemClick
}, [
vue.createElementVNode(
"div",
{
class: "o-sub-menu-title",
ref_key: "subMenuTitleRef",
ref: subMenuTitleRef
},
[
vue.unref(arrowPosition) === "left" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$g, [
vue.createVNode(vue.unref(IconChevronDownBold))
])) : vue.createCommentVNode("v-if", true),
_ctx.$slots.icon || props.icon ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$c, [
vue.renderSlot(_ctx.$slots, "icon", {}, () => [
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(props.icon)))
])
])) : vue.createCommentVNode("v-if", true),
vue.createElementVNode(
"div",
{
ref_key: "itemContentRef",
ref: itemContentRef,
class: "o-sub-menu-title-content"
},
[
vue.renderSlot(_ctx.$slots, "title")
],
512
/* NEED_PATCH */
),
!vue.unref(arrowPosition) || vue.unref(arrowPosition) === "right" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$9, [
vue.createVNode(vue.unref(IconChevronDownBold))
])) : vue.createCommentVNode("v-if", true)
],
512
/* NEED_PATCH */
),
vue.createElementVNode(
"ul",
{
class: vue.normalizeClass(["o-sub-menu-children", { "expanded": isExpanded.value }])
},
[
vue.createElementVNode("div", _hoisted_5$5, [
vue.renderSlot(_ctx.$slots, "default")
])
],
2
/* CLASS */
),
isContentOverflow.value ? (vue.openBlock(), vue.createBlock(vue.unref(OPopover), {
key: 0,
offset: 12,
target: subMenuTitleRef.value,
position: "bottom",
wrapClass: "o-menu-popover"
}, {
default: vue.withCtx(() => [
vue.createTextVNode(
vue.toDisplayString(content.value),
1
/* TEXT */
)
]),
_: 1
/* STABLE */
}, 8, ["target"])) : vue.createCommentVNode("v-if", true)
], 14, _hoisted_1$j);
};
}
});
const _hoisted_1$i = ["data-level"];
const _hoisted_2$f = {
key: 0,
class: "o-menu-item-icon"
};
const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
__name: "OMenuItem",
props: menuItemProps,
emits: ["click"],
setup(__props, { emit: __emit }) {
const props = __props;
const emits = __emit;
const menuInjection = vue.inject(menuInjectKey, null);
const subMenuInjection = vue.inject(subMenuInjectKey, null);
const isSelected = vue.computed(() => {
if (menuInjection) {
return menuInjection.realValue.value === props.value;
}
return false;
});
const onItemClick = (ev) => {
ev.stopPropagation();
if (props.disabled) {
return;
}
if (isUndefined(props.value)) {
return;
}
emits("click", ev);
menuInjection == null ? void 0 : menuInjection.updateModelValue(props.value);
};
const currentDepth = subMenuInjection ? subMenuInjection.parentDepth + 1 : 0;
menuInjection == null ? void 0 : menuInjection.menuTree.addChild({
value: props.value,
parentVal: subMenuInjection == null ? void 0 : subMenuInjection.value
});
const menuItemRef = vue.ref();
const itemContentRef = vue.ref();
const isContentOverflow = vue.ref(false);
const content = vue.ref("");
vue.onMounted(() => {
var _a;
if (!itemContentRef.value) {
return;
}
isContentOverflow.value = isOverflown(itemContentRef.value);
content.value = ((_a = itemContentRef.value) == null ? void 0 : _a.innerText) || "";
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("li", {
class: vue.normalizeClass({
"o-menu-item": true,
"o-menu-item-selected": isSelected.value,
"o-menu-item-disabled": _ctx.$props.disabled
}),
style: vue.normalizeStyle({
"--menu-level": vue.unref(currentDepth)
}),
"data-level": vue.unref(currentDepth),
onClick: onItemClick,
ref_key: "menuItemRef",
ref: menuItemRef
}, [
props.icon || _ctx.$slots.icon ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$f, [
vue.renderSlot(_ctx.$slots, "icon", {}, () => [
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(props.icon)))
])
])) : vue.createCommentVNode("v-if", true),
vue.createElementVNode(
"div",
{
class: "o-menu-item-content",
ref_key: "itemContentRef",
ref: itemContentRef
},
[
vue.renderSlot(_ctx.$slots, "default")
],
512
/* NEED_PATCH */
),
isContentOverflow.value ? (vue.openBlock(), vue.createBlock(vue.unref(OPopover), {
key: 1,
offset: 12,
target: menuItemRef.value,
position: "bottom",
wrapClass: "o-menu-popover"
}, {
default: vue.withCtx(() => [
vue.createTextVNode(
vue.toDisplayString(content.value),
1
/* TEXT */
)
]),
_: 1
/* STABLE */
}, 8, ["target"])) : vue.createCommentVNode("v-if", true)
], 14, _hoisted_1$i);
};
}
});
const OMenu = Object.assign(_sfc_main$s, {
OSubMenu: _sfc_main$r,
OMenuItem: _sfc_main$q,
install(app) {
app.component("OMenu", _sfc_main$s);
app.component("OMenuItem", _sfc_main$q);
app.component("OSubMenu", _sfc_main$r);
}
});
const MessageStatusTypes = ["info", "success", "warning", "danger", "loading"];
const messageProps = {
/**
* 消息是否可见 v-model
*/
visible: {
type: Boolean,
default: void 0
},
/**
* 非受控模式,消息是否默认可见
*/
defaultVisible: {
type: Boolean,
default: true
},
/**
* 状态 MessageStatusT
*/
status: {
type: String,
default: "info"
},
/**
* 预置背景(跟随状态)
*/
colorful: {
type: Boolean,
default: false
},
/**
* 消息显示的持续时间,函数式调用时,默认值为3000
*/
duration: {
type: Number
},
/**
* 是否可手动关闭
*/
closable: {
type: Boolean,
default: false
},
/**
* 关闭前的钩子函数
*/
beforeClose: {
type: Function
},
/**
* 消息标题
*/
title: {
type: String
}
};
const messageListProps = {
/**
* 消息列表位置 MessagePositionT
*/
position: {
type: String,
default: "top"
},
/**
* 消息列表销毁前的钩子函数
*/
onDestory: {
type: Function
}
};
const _hoisted_1$h = { class: "o-message-icon" };
const _hoisted_2$e = { class: "o-message-main" };
const _hoisted_3$b = {
key: 0,
class: "o-message-title"
};
const _hoisted_4$8 = { class: "o-message-content" };
const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
__name: "OMessage",
props: messageProps,
emits: ["duration-end", "close", "update:visible"],
setup(__props, { expose: __expose, emit: __emit }) {
const props = __props;
const iconMap = {
info: IconInfo.value,
success: IconSuccess.value,
warning: IconWarning.value,
danger: IconDanger.value,
loading: IconLoading.value
};
const icon = vue.computed(() => iconMap[props.status]);
const isVisible = vue.ref(props.visible ?? props.defaultVisible);
vue.watch(
() => props.visible,
(val) => {
if (!isUndefined(val)) {
isVisible.value = val;
}
}
);
const emits = __emit;
let timer = 0;
const clearTimer = () => {
if (timer) {
window.clearTimeout(timer);
timer = 0;
}
};
const startTimer = () => {
if (isUndefined(props.duration) || props.duration <= 0) {
return;
}
timer = window.setTimeout(() => {
emits("duration-end");
isVisible.value = false;
emits("update:visible", isVisible.value);
clearTimer();
}, props.duration);
};
const onClose = async (ev) => {
ev == null ? void 0 : ev.stopPropagation();
if (isFunction(props.beforeClose)) {
const rlt = await props.beforeClose();
if (rlt) {
isVisible.value = false;
emits("update:visible", isVisible.value);
emits("close", ev);
return;
}
}
isVisible.value = false;
emits("update:visible", isVisible.value);
emits("close", ev);
};
vue.onMounted(() => {
startTimer();
});
vue.onUnmounted(() => {
clearTimer();
});
__expose({
close: onClose
});
return (_ctx, _cache) => {
return isVisible.value ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 0,
class: vue.normalizeClass(["o-message", [`o-message-${props.status}`, { "o-message-colorful": props.colorful }]]),
onMouseenter: clearTimer,
onMouseleave: startTimer
},
[
vue.createElementVNode("span", _hoisted_1$h, [
vue.renderSlot(_ctx.$slots, "icon", {}, () => [
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(icon.value), {
class: vue.normalizeClass({ "o-rotating": props.status === "loading" })
}, null, 8, ["class"]))
])
]),
vue.createElementVNode("div", _hoisted_2$e, [
_ctx.$slots.title || props.title ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$b, [
vue.renderSlot(_ctx.$slots, "title", {}, () => [
vue.createTextVNode(
vue.toDisplayString(props.title),
1
/* TEXT */
)
])
])) : vue.createCommentVNode("v-if", true),
vue.createElementVNode("span", _hoisted_4$8, [
vue.renderSlot(_ctx.$slots, "default")
])
]),
props.closable ? (vue.openBlock(), vue.createElementBlock("span", {
key: 0,
class: "o-message-close",
onClick: onClose
}, [
vue.createVNode(vue.unref(IconClose))
])) : vue.createCommentVNode("v-if", true)
],
34
/* CLASS, NEED_HYDRATION */
)) : vue.createCommentVNode("v-if", true);
};
}
});
const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
__name: "OMessageList",
props: messageListProps,
setup(__props, { expose: __expose }) {
const props = __props;
const getUniqueId = /* @__PURE__ */ (() => {
let id = 0;
return () => {
id += 1;
return id;
};
})();
const optionList = vue.ref([]);
const add = (params) => {
const option = {
id: getUniqueId(),
...params
};
if (params.icon) {
option.icon = vue.shallowRef(params.icon);
}
optionList.value.push(option);
};
const remove = (idx) => {
optionList.value.splice(idx, 1);
};
const removeAll = () => {
optionList.value = [];
};
const close = (id) => {
const idx = optionList.value.findIndex((option) => option.id === id);
remove(idx);
if (optionList.value.length === 0 && props.onDestory) {
props.onDestory();
}
};
const handleDurationEnd = (item) => {
const { id, onDurationEnd } = item;
onDurationEnd == null ? void 0 : onDurationEnd();
close(id);
};
const handleClose = (item, ev) => {
const { id, onClose } = item;
onClose == null ? void 0 : onClose(ev);
close(id);
};
__expose({ add, remove, removeAll });
return (_ctx, _cache) => {
return optionList.value.length ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 0,
class: vue.normalizeClass(["o-message-list", [`o-message-list-${props.position}`]])
},
[
vue.createVNode(vue.TransitionGroup, { name: "o-message-fade" }, {
default: vue.withCtx(() => [
(vue.openBlock(true), vue.createElementBlock(
vue.Fragment,
null,
vue.renderList(optionList.value, (item) => {
return vue.openBlock(), vue.createBlock(_sfc_main$p, {
key: item.id,
status: item.status,
duration: item.duration,
closable: item.closable,
onDurationEnd: ($event) => handleDurationEnd(item),
onClose: (ev) => {
handleClose(item, ev);
}
}, vue.createSlots({
default: vue.withCtx(() => [
vue.unref(isString)(item.content) ? (vue.openBlock(), vue.createElementBlock(
vue.Fragment,
{ key: 0 },
[
vue.createTextVNode(
vue.toDisplayString(item.content),
1
/* TEXT */
)
],
64
/* STABLE_FRAGMENT */
)) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(item.content), { key: 1 }))
]),
_: 2
/* DYNAMIC */
}, [
item.icon ? {
name: "icon",
fn: vue.withCtx(() => [
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(item.icon)))
]),
key: "0"
} : void 0
]), 1032, ["status", "duration", "closable", "onDurationEnd", "onClose"]);
}),
128
/* KEYED_FRAGMENT */
))
]),
_: 1
/* STABLE */
})
],
2
/* CLASS */
)) : vue.createCommentVNode("v-if", true);
};
}
});
const DEFAULT_OPTIONS = {
status: "info",
position: "top",
duration: 3e3
};
const instanceMap = /* @__PURE__ */ new Map();
const targetOffset = 8;
const normalizeOptions = (params) => {
const options = !params || isString(params) ? { content: params } : params;
const normalized = {
...DEFAULT_OPTIONS,
...options
};
return normalized;
};
const getMessageStyle = async (target, position = "top", align = "center") => {
if (!target) {
return;
}
const targetEl = await resolveHtmlElement(target);
if (!targetEl) {
return;
}
const rect = targetEl.getBoundingClientRect();
let pos = "bottom";
let top = window.innerHeight - rect.top + targetOffset;
let left = rect.left;
let transform = "translateX(-50%)";
if (position === "bottom") {
pos = "top";
top = rect.top + rect.height + targetOffset;
}
if (align === "right") {
left = rect.left + rect.width;
transform = "translateX(-100%)";
} else if (align === "left") {
left = rect.left;
transform = "translateX(0%)";
} else {
left = rect.left + rect.width / 2;
transform = "translateX(-50%)";
}
return {
position: pos,
"--message-list-offset": `${top}px`,
left: `${left}px`,
transform
};
};
function useMessage(target) {
const showMessage = async (params) => {
var _a, _b;
const options = normalizeOptions(params);
const { position, targetAlign } = options;
const msgStyle = await getMessageStyle(target, position, targetAlign);
let instance2 = instanceMap.get(target ?? position);
if (!instance2) {
let wrap = document.createElement("div");
const vnode = vue.h(_sfc_main$o, {
position: (msgStyle == null ? void 0 : msgStyle.position) ?? position,
onDestory: () => {
if (wrap) {
document.body.removeChild(wrap);
wrap = null;
}
instanceMap.set(target ?? position, void 0);
},
style: msgStyle
});
vue.render(vnode, wrap);
const vm = vnode.component;
(_a = vm.exposed) == null ? void 0 : _a.add(options);
instance2 = vm;
instanceMap.set(target ?? position, instance2);
document.body.appendChild(wrap);
} else {
(_b = instance2.exposed) == null ? void 0 : _b.add(options);
}
};
const info = (params) => {
return showMessage({
...params,
status: "info"
});
};
const success = (params) => {
return showMessage({
...params,
status: "success"
});
};
const warning = (params) => {
return showMessage({
...params,
status: "warning"
});
};
const danger = (params) => {
return showMessage({
...params,
status: "danger"
});
};
const loading = (params) => {
return showMessage({
...params,
status: "loading"
});
};
const show = (params) => {
return showMessage({
...params
});
};
const closeAll = () => {
var _a;
for (const ins of instanceMap.values()) {
(_a = ins == null ? void 0 : ins.exposed) == null ? void 0 : _a.removeAll();
}
};
const close = () => {
var _a;
if (target) {
const instance2 = instanceMap.get(target);
(_a = instance2 == null ? void 0 : instance2.exposed) == null ? void 0 : _a.remove();
}
};
return {
info,
success,
warning,
danger,
loading,
show,
close,
closeAll
};
}
const OMessage = Object.assign(_sfc_main$p, {
install(app) {
app.component("OMessage", _sfc_main$p);
}
});
function getNumbers(min, max) {
const arr = [];
for (let i = min; i <= max; i++) {
arr.push(i);
}
return arr;
}
function getPagerList(totalPage, currentPage = 1, showPageCount = 9) {
const activePage = currentPage > totalPage ? totalPage : currentPage;
const maxCount = showPageCount > 3 ? showPageCount : 3;
const pages = [];
if (totalPage <= maxCount) {
for (let i = 1; i <= totalPage; i++) {
pages.push({ value: i });
}
return pages;
}
pages[0] = { value: 1 };
pages[maxCount - 1] = { value: totalPage };
if (maxCount === 3) {
pages[1] = {
isMore: true,
value: "left",
list: getNumbers(2, totalPage - 1)
};
} else {
const d = (maxCount - 3) / 2;
let min = activePage - Math.floor(d);
let max = activePage + Math.ceil(d);
if (max > totalPage - 1) {
min -= max - totalPage + 1;
max = totalPage - 1;
}
if (min < 2) {
max += 2 - min;
min = 2;
}
if (min < 3) {
pages[1] = { value: 2 };
min = 2;
} else {
pages[1] = {
isMore: true,
value: "left",
list: getNumbers(2, min)
};
}
if (max > totalPage - 2) {
pages[maxCount - 2] = { value: totalPage - 1 };
max = totalPage - 1;
} else {
pages[maxCount - 2] = {
isMore: true,
value: "right",
list: getNumbers(max, totalPage - 1)
};
}
getNumbers(min + 1, max - 1).forEach((item, idx) => {
pages[2 + idx] = { value: item };
});
}
return pages;
}
function getSizeOptions(pageSizes2, sufix, currentPageSize) {
return pageSizes2.map((item) => ({
label: item + sufix,
value: item,
active: currentPageSize === item
}));
}
const pageSizes = [6, 12, 24, 48];
const PaginationVariantTypes = ["solid", "outline"];
const PaginationLayoutTypes = ["total", "pagesize", "pager", "jumper"];
const paginationProps = {
/**
* 布局:PaginationVariantT
*/
layout: {
type: Array,
default: ["pagesize", "pager", "jumper"]
},
/**
* 按钮类型:PaginationVariantT
*/
variant: {
type: String,
default: "outline"
},
/**
* 圆角值 RoundT
*/
round: {
type: String
},
/**
* 支持选择的每页数据条数
*/
pageSizes: {
type: Array,
default: () => pageSizes
},
/**
* 每页数据条数 v-model
*/
pageSize: {
type: Number,
default: pageSizes[0]
},
/**
* 数据总条数
*/
total: {
type: Number,
default: 0
},
/**
* 当前页码 v-model
*/
page: {
type: Number,
default: 1
},
/**
* 显示页面数 > 3
*/
showPageCount: {
type: Number,
default: 9
},
/**
* 页码被隐藏时,hover显示所有页码
*/
showMore: {
type: Boolean,
default: true
},
/**
* 显示总数据量
*/
showTotal: {
type: Boolean
},
/**
* 显示输入跳转
*/
showJumper: {
type: Boolean
},
/**
* 简洁模式
*/
simple: {
type: Boolean
}
};
const virtualListProps = {
/**
* 默认滚动到第几项
*/
defaultStartIndex: {
type: Number,
default: 0
},
/**
* 列表数据,如果数据存在动态追加,需要每一项需包含唯一ID
*/
list: {
type: Array,
required: true,
default: []
},
/**
* 每一项的高度,如果每一项高度不一致或不确定(渲染时确定),则不传
*/
itemSize: {
type: Number
},
/**
* 不定高时,每一项的默认高度
*/
defaultItemSize: {
type: Number,
default: 80
},
/**
* 前后预留项,减少滚动式空白
*/
buffer: {
type: Number,
default: 1
},
/**
* 使用内置scrollbar,支持传递scrollbar配置项
*/
scrollbar: {
type: [Boolean, Object],
default: true
}
};
const _hoisted_1$g = { class: "o-virtual-list" };
const _hoisted_2$d = {
key: 1,
class: "o-virtual-render-item"
};
const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
__name: "OVirtualList",
props: virtualListProps,
emits: ["renderChange"],
setup(__props, { expose: __expose, emit: __emit }) {
const props = __props;
const emits = __emit;
const scrollbarProps2 = vue.computed(() => {
if (props.scrollbar === true) {
return {
showType: "always",
size: "medium"
};
}
return props.scrollbar;
});
const listData = vue.ref([]);
vue.watch(
() => props.list,
(value) => {
listData.value = value.map((item, index) => ({
id: item.id,
data: item,
index
}));
},
{
immediate: true
}
);
const defaultStartIndex = vue.computed(() => {
if (isUndefined(props.defaultStartIndex)) {
return 0;
}
return Math.max(Math.min(props.defaultStartIndex, props.list.length - 1), 0);
});
const visibleStartIndex = vue.ref(defaultStartIndex.value ?? 0);
let visibleStartId;
const renderCount = vue.ref(1);
const startIndex = vue.computed(() => {
return Math.max(visibleStartIndex.value - props.buffer, 0);
});
const endIndex = vue.computed(() => {
return Math.min(visibleStartIndex.value + renderCount.value + props.buffer - 1, listData.value.length - 1);
});
let lastVisibleStartIndex = visibleStartIndex.value;
let lastRenderCount = renderCount.value;
const emitRenderChange = () => {
if (lastVisibleStartIndex !== visibleStartIndex.value || lastRenderCount !== renderCount.value) {
emits("renderChange", {
start: startIndex.value,
end: endIndex.value,
count: renderCount.value,
visible: visibleStartIndex.value
});
lastVisibleStartIndex = visibleStartIndex.value;
lastRenderCount = renderCount.value;
}
};
const renderList = vue.computed(() => {
return listData.value.slice(startIndex.value, endIndex.value + 1);
});
vue.watch(listData, (value) => {
if (!isUndefined(visibleStartId) && wrapperRef.value) {
const top = wrapperRef.value.scrollTop - listMetaData[visibleStartIndex.value].top;
const index = value.findIndex((item) => item.id === visibleStartId);
if (index >= 0) {
visibleStartIndex.value = index;
wrapperRef.value.scrollTop = listMetaData[index].top + top;
}
}
});
const wrapperRef = vue.ref();
const contentSize = vue.ref((props.itemSize ? props.itemSize : props.defaultItemSize) * listData.value.length);
const containerSize = vue.ref({
height: 0,
width: 0
});
const onContainerResize = () => {
if (!wrapperRef.value) {
return;
}
containerSize.value.height = wrapperRef.value.offsetHeight;
containerSize.value.width = wrapperRef.value.offsetWidth;
if (containerSize.value.height === 0) {
offset.value = 0;
}
if (!initialScroll) {
if (contentSize.value < containerSize.value.height) {
visibleStartIndex.value = 0;
}
return;
}
const scrollTop = wrapperRef.value.scrollTop;
for (let i = visibleStartIndex.value; i >= 0; i--) {
const meta = listMetaData[i];
if (meta.top <= scrollTop) {
visibleStartIndex.value = i;
break;
}
}
let count = renderCount.value;
for (let i = endIndex.value; i < listMetaData.length; i++) {
const meta = listMetaData[i];
if (meta.top < scrollTop + containerSize.value.height) {
count++;
}
}
renderCount.value = count;
emitRenderChange();
};
const contentStyle = vue.computed(() => ({
"--content-height": `${contentSize.value}px`
}));
const offset = vue.ref(0);
const renderListStyle = vue.computed(() => {
return {
"--offsetY": `${offset.value}px`
};
});
let initialScroll = props.itemSize ? true : false;
const scrollToView = (index, align = "start", behavior = "instant") => {
if (!wrapperRef.value) {
return;
}
const toIndex = Math.max(Math.min(listMetaData.length - 1, index), 0);
const item = listMetaData[toIndex];
const itemTop = item.top;
const cSize = wrapperRef.value.offsetHeight;
let _align = align;
if (_align === "nearest") {
const currScrollTop = wrapperRef.value.scrollTop;
if (currScrollTop > itemTop) {
_align = "start";
} else if (currScrollTop + cSize < itemTop) {
_align = "end";
} else {
return;
}
}
let scrollTop = itemTop;
if (_align !== "start") {
const itemSize = listMetaData[toIndex].size;
if (_align === "center") {
scrollTop = itemTop - cSize / 2 + itemSize / 2;
} else if (_align === "end") {
scrollTop = itemTop - cSize + itemSize;
} else if (typeof _align === "number") {
scrollTop = itemTop - _align;
}
}
wrapperRef.value.scrollTo({
top: scrollTop,
behavior: props.itemSize ? behavior : "instant"
});
};
let listMetaData = [];
vue.watch(
[() => props.itemSize, () => listData.value],
([propSize, dataList]) => {
const itemSize = propSize ? propSize : props.defaultItemSize;
let lastTop = 0;
listMetaData = dataList.map((item, index) => {
if (!propSize) {
const m = listMetaData.find((mItem) => mItem.id === item.id);
if (m && m.measured) {
lastTop = m.bottom;
return m;
}
}
const metaItem = {
id: item.id,
index,
size: itemSize,
top: lastTop,
bottom: lastTop + itemSize,
measured: propSize ? true : false,
isScrolling: false
};
lastTop += itemSize;
return metaItem;
});
contentSize.value = listMetaData[listMetaData.length - 1].bottom;
},
{
immediate: true
}
);
const updateMeta = (start = 0) => {
for (let i = start + 1; i < listMetaData.length; i++) {
const lastMeta = listMetaData[i - 1];
const meta = listMetaData[i];
meta.top = lastMeta.bottom;
meta.bottom = meta.top + meta.size;
}
const last = listMetaData[listMetaData.length - 1];
last.bottom = last.top + last.size;
contentSize.value = last.bottom;
};
const updateVisibleCount = (scrollOffset) => {
var _a;
let scrollSize = scrollOffset;
if (isUndefined(scrollSize)) {
scrollSize = ((_a = wrapperRef.value) == null ? void 0 : _a.scrollTop) ?? 0;
}
const { height: containerHeight } = containerSize.value;
if (!wrapperRef.value || !containerHeight) {
return;
}
let render = 1;
for (let i = visibleStartIndex.value + 1; i < listMetaData.length; i++) {
const meta = listMetaData[i];
if (meta.top < scrollSize + containerHeight) {
render++;
}
}
renderCount.value = render;
emitRenderChange();
};
const debounceUpdateVisibleCount = debounceRAF(updateVisibleCount);
const getStartIndex = (scrollOffset) => {
let start = 0;
let end = listMetaData.length - 1;
while (start < end) {
const mid = Math.floor((start + end) / 2);
const { top, bottom } = listMetaData[mid];
if (top <= scrollOffset && bottom > scrollOffset) {
return mid;
} else if (bottom === scrollOffset) {
return mid + 1;
} else if (bottom < scrollOffset) {
start = mid;
} else if (top > scrollOffset) {
end = mid;
}
}
return start;
};
const onScroll = () => {
var _a;
const scrollOffset = ((_a = wrapperRef.value) == null ? void 0 : _a.scrollTop) ?? 0;
if (props.itemSize) {
visibleStartIndex.value = Math.floor(scrollOffset / props.itemSize);
} else {
visibleStartIndex.value = getStartIndex(scrollOffset);
}
offset.value = listMetaData[startIndex.value].top;
visibleStartId = listMetaData[visibleStartIndex.value].id;
debounceUpdateVisibleCount(scrollOffset);
};
const onItemResize = (en, index) => {
const el = en.target;
const meta = listMetaData[index];
const size2 = el.offsetHeight;
if (meta.measured && meta.size === size2) {
return;
}
if (meta.measured === false && wrapperRef.value && wrapperRef.value.scrollTop > meta.top) {
wrapperRef.value.scrollTop += size2 - meta.size;
}
meta.size = size2;
meta.measured = true;
meta.bottom = meta.top + meta.size;
updateMeta(index);
if (index === defaultStartIndex.value && !initialScroll) {
vue.nextTick(() => {
scrollToView(defaultStartIndex.value);
initialScroll = true;
});
}
debounceUpdateVisibleCount();
};
const init = () => {
if (!wrapperRef.value) {
return;
}
if (props.itemSize) {
scrollToView(defaultStartIndex.value);
}
};
vue.onMounted(() => {
init();
});
__expose({
scrollToView
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$g, [
vue.withDirectives((vue.openBlock(), vue.createElementBlock(
"div",
{
class: "o-virtual-list-wrapper",
ref_key: "wrapperRef",
ref: wrapperRef,
onScrollPassive: onScroll
},
[
vue.createElementVNode(
"div",
{
class: "o-virtual-body",
style: vue.normalizeStyle(contentStyle.value)
},
[
vue.createElementVNode(
"div",
{
class: "o-virtual-render-list",
style: vue.normalizeStyle(renderListStyle.value)
},
[
(vue.openBlock(true), vue.createElementBlock(
vue.Fragment,
null,
vue.renderList(renderList.value, (item) => {
return vue.openBlock(), vue.createElementBlock(
vue.Fragment,
{
key: item.index
},
[
props.itemSize ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 0,
class: "o-virtual-render-item",
style: vue.normalizeStyle({ height: props.itemSize + "px" })
},
[
vue.renderSlot(_ctx.$slots, "default", {
item: item.data,
index: item.index
})
],
4
/* STYLE */
)) : vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_2$d, [
vue.renderSlot(_ctx.$slots, "default", {
item: item.data,
index: item.index
})
])), [
[vue.unref(vOnResize), (en) => onItemResize(en, item.index)]
])
],
64
/* STABLE_FRAGMENT */
);
}),
128
/* KEYED_FRAGMENT */
))
],
4
/* STYLE */
)
],
4
/* STYLE */
)
],
32
/* NEED_HYDRATION */
)), [
[vue.unref(vOnResize), onContainerResize],
[vue.unref(vScrollbar), scrollbarProps2.value]
])
]);
};
}
});
const OVirtualList = Object.assign(_sfc_main$n, {
install(app) {
app.component("OVirtualList", _sfc_main$n);
}
});
const _hoisted_1$f = { class: "o-pagination-wrap" };
const _hoisted_2$c = {
key: 0,
class: "o-pagination-total"
};
const _hoisted_3$a = {
key: 1,
class: "o-pagination-size"
};
const _hoisted_4$7 = {
key: 1,
class: "o-pagination-page-size"
};
const _hoisted_5$4 = {
key: 2,
class: "o-pagination-pager"
};
const _hoisted_6$4 = { class: "o-pagination-pages" };
const _hoisted_7$2 = {
key: 0,
class: "o-pagination-simple"
};
const _hoisted_8 = ["onClick"];
const _hoisted_9 = { key: 0 };
const _hoisted_10 = ["onClick"];
const _hoisted_11 = {
key: 3,
class: "o-pagination-goto"
};
const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
__name: "OPagination",
props: /* @__PURE__ */ vue.mergeModels(paginationProps, {
"pageSize": {},
"pageSizeModifiers": {},
"page": {},
"pageModifiers": {}
}),
emits: /* @__PURE__ */ vue.mergeModels(["change"], ["update:pageSize", "update:page"]),
setup(__props, { expose: __expose, emit: __emit }) {
const props = __props;
const round2 = getRoundClass(props, "pagination");
const emits = __emit;
const { t } = useI18n();
const simpleLayout = ["pager"];
const pages = vue.ref([]);
const pageSize = vue.useModel(__props, "pageSize");
if (!pageSize.value) {
pageSize.value = props.pageSizes[0];
} else if (!props.pageSizes.includes(pageSize.value)) {
log.warn(`pageSize[${pageSize.value}] is not in pageSizes[${props.pageSizes}]! set to first value of pageSizes[${props.pageSizes[0]}]`);
pageSize.value = props.pageSizes[0];
}
const totalPage = vue.computed(() => Math.ceil(props.total / pageSize.value));
const pageVal = vue.useModel(__props, "page");
if (!pageVal.value) {
pageVal.value = 1;
}
pages.value = getPagerList(totalPage.value, pageVal.value, props.showPageCount);
const pageSizeList = vue.computed(() => {
return getSizeOptions(props.pageSizes, t("pagination.countPerPage"), pageSize.value);
});
const defaultSizeLabel = vue.computed(() => pageSize.value + t("pagination.countPerPage"));
const layout = vue.computed(() => {
return props.simple ? simpleLayout : props.layout;
});
vue.watch(
() => [totalPage.value, pageVal.value],
() => {
pages.value = getPagerList(totalPage.value, pageVal.value, props.showPageCount);
}
);
const updatePageAndPageSize = (page, size2) => {
let changed = false;
const oldPage = pageVal.value;
const oldPageSize = pageSize.value;
if (pageVal.value !== page) {
changed = true;
pageVal.value = page;
}
if (pageSize.value !== size2) {
changed = true;
pageSize.value = size2;
}
if (changed) {
emits("change", { page, pageSize: size2 }, { page: oldPage, pageSize: oldPageSize });
}
};
const selectPage = (page) => {
updatePageAndPageSize(Number(page), pageSize.value);
};
const clickPageBtn = (Increase) => {
updatePageAndPageSize(Increase ? pageVal.value + 1 : pageVal.value - 1, pageSize.value);
};
const moreVisible = vue.ref({
left: false,
right: false
});
const moreClick = (more) => {
const { value, list } = more;
if (!list || typeof value !== "string") {
return;
}
if (value === "left") {
updatePageAndPageSize(list[list.length - 1], pageSize.value);
} else if (value === "right") {
updatePageAndPageSize(list[0], pageSize.value);
}
moreVisible.value[value] = false;
};
const goToPage = (val) => {
let v = Math.round(Number(val));
if (v < 1 || isNaN(v)) {
v = 1;
} else if (v > totalPage.value) {
v = totalPage.value;
}
updatePageAndPageSize(v, pageSize.value);
};
const selectPageSize = (val) => {
const size2 = Number(val);
if (!size2) {
return;
}
const currentIndex = pageSize.value * (pageVal.value - 1);
const newPage = Math.floor(currentIndex / size2) + 1;
updatePageAndPageSize(newPage, size2);
};
const onMoreItemClick = (item, value) => {
selectPage(item);
if (value === "left" || value === "right") {
moreVisible.value[value] = false;
}
};
const validateInput = (value) => {
return value === Math.round(Number(value));
};
__expose({
pageCount: totalPage
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"div",
{
class: vue.normalizeClass(["o-pagination", [`o-pagination-${props.variant}`, vue.unref(round2).class.value]]),
style: vue.normalizeStyle(vue.unref(round2).style.value)
},
[
vue.createElementVNode("div", _hoisted_1$f, [
vue.createCommentVNode(" total "),
layout.value.includes("total") || _ctx.$props.showTotal ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$c, [
vue.renderSlot(_ctx.$slots, "total", {
total: props.total
}, () => [
vue.createTextVNode(
vue.toDisplayString(vue.unref(t)("pagination.total", props.total)),
1
/* TEXT */
)
])
])) : vue.createCommentVNode("v-if", true),
vue.createCommentVNode(" sizes "),
layout.value.includes("pagesize") ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$a, [
pageSizeList.value.length > 1 ? (vue.openBlock(), vue.createBlock(vue.unref(OSelect), {
key: 0,
"model-value": pageSize.value,
class: "o-pagination-select",
"default-label": defaultSizeLabel.value,
round: props.round,
variant: props.variant,
onChange: selectPageSize
}, {
default: vue.withCtx(() => [
(vue.openBlock(true), vue.createElementBlock(
vue.Fragment,
null,
vue.renderList(pageSizeList.value, (item) => {
return vue.openBlock(), vue.createBlock(vue.unref(OOption), {
key: item.value,
label: item.label,
value: item.value
}, null, 8, ["label", "value"]);
}),
128
/* KEYED_FRAGMENT */
))
]),
_: 1
/* STABLE */
}, 8, ["model-value", "default-label", "round", "variant"])) : (vue.openBlock(), vue.createElementBlock(
"div",
_hoisted_4$7,
vue.toDisplayString(pageSizeList.value[0].label),
1
/* TEXT */
))
])) : vue.createCommentVNode("v-if", true),
vue.createCommentVNode(" pager "),
layout.value.includes("pager") ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$4, [
vue.createElementVNode(
"div",
{
class: vue.normalizeClass(["o-pagination-prev", {
"is-disabled": pageVal.value === 1
}]),
tabindex: "-1",
onClick: _cache[0] || (_cache[0] = () => pageVal.value !== 1 && clickPageBtn(false))
},
[
vue.createVNode(vue.unref(IconChevronLeft))
],
2
/* CLASS */
),
vue.createElementVNode("div", _hoisted_6$4, [
props.simple ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$2, [
vue.createVNode(vue.unref(OInputNumber), {
"model-value": pageVal.value,
clearable: false,
class: "o-pagination-input",
controls: "none",
min: 1,
max: totalPage.value,
round: props.round,
variant: props.variant,
"empty-value": pageVal.value,
validate: validateInput,
onChange: goToPage
}, null, 8, ["model-value", "max", "round", "variant", "empty-value"]),
_cache[2] || (_cache[2] = vue.createTextVNode(" / ")),
vue.createElementVNode(
"span",
null,
vue.toDisplayString(totalPage.value),
1
/* TEXT */
)
])) : (vue.openBlock(true), vue.createElementBlock(
vue.Fragment,
{ key: 1 },
vue.renderList(pages.value, (item) => {
return vue.openBlock(), vue.createElementBlock("div", {
key: item.value,
class: vue.normalizeClass(["o-pagination-item", { active: item.value === pageVal.value }]),
tabindex: "-1",
onClick: ($event) => selectPage(item.value)
}, [
!item.isMore ? (vue.openBlock(), vue.createElementBlock(
"span",
_hoisted_9,
vue.toDisplayString(item.value),
1
/* TEXT */
)) : (vue.openBlock(), vue.createBlock(vue.unref(OPopover), {
key: 1,
position: "bottom",
"wrap-class": "o-options-popup",
disabled: !props.showMore,
visible: moreVisible.value[item.value],
"onUpdate:visible": ($event) => moreVisible.value[item.value] = $event
}, {
target: vue.withCtx(() => [
vue.createElementVNode("span", {
onClick: vue.withModifiers(($event) => moreClick(item), ["stop"]),
class: "o-pagination-more-icon-wrap"
}, [
vue.createVNode(vue.unref(OIcon), {
class: "o-pagination-more-icon",
icon: vue.unref(IconEllipsis)
}, null, 8, ["icon"]),
vue.createVNode(vue.unref(OIcon), {
class: "o-pagination-more-arrow-icon",
icon: item.value === "left" ? vue.unref(IconArrowLeft) : vue.unref(IconArrowRight)
}, null, 8, ["icon"])
], 8, _hoisted_10)
]),
default: vue.withCtx(() => [
vue.createVNode(
vue.unref(_sfc_main$Q),
{ scrollbar: "" },
{
default: vue.withCtx(() => [
vue.createCommentVNode(" 当下拉项大于50,采用虚拟列表 "),
item.list && item.list.length > 50 ? (vue.openBlock(), vue.createBlock(vue.unref(OVirtualList), {
key: 0,
list: item.list,
class: "o-pagination-virtual-more-list",
scrollbar: { showType: "hover", size: "small" }
}, {
default: vue.withCtx((data) => [
(vue.openBlock(), vue.createBlock(vue.unref(OOption), {
key: data.item,
class: "o-pagination-more-item",
label: String(data.item),
value: data.item,
onClick: ($event) => onMoreItemClick(data.item, item.value)
}, null, 8, ["label", "value", "onClick"]))
]),
_: 2
/* DYNAMIC */
}, 1032, ["list"])) : item.list ? (vue.openBlock(true), vue.createElementBlock(
vue.Fragment,
{ key: 1 },
vue.renderList(item.list, (opt2) => {
return vue.openBlock(), vue.createBlock(vue.unref(OOption), {
key: opt2,
class: "o-pagination-more-item",
label: String(opt2),
value: opt2,
onClick: ($event) => onMoreItemClick(opt2, item.value)
}, null, 8, ["label", "value", "onClick"]);
}),
128
/* KEYED_FRAGMENT */
)) : vue.createCommentVNode("v-if", true)
]),
_: 2
/* DYNAMIC */
},
1024
/* DYNAMIC_SLOTS */
)
]),
_: 2
/* DYNAMIC */
}, 1032, ["disabled", "visible", "onUpdate:visible"]))
], 10, _hoisted_8);
}),
128
/* KEYED_FRAGMENT */
))
]),
vue.createElementVNode(
"div",
{
class: vue.normalizeClass(["o-pagination-next", {
"is-disabled": pageVal.value === totalPage.value
}]),
tabindex: "-1",
onClick: _cache[1] || (_cache[1] = () => pageVal.value !== totalPage.value && clickPageBtn(true))
},
[
vue.createVNode(vue.unref(IconChevronRight))
],
2
/* CLASS */
)
])) : vue.createCommentVNode("v-if", true),
vue.createCommentVNode(" jumper "),
layout.value.includes("jumper") ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11, [
vue.createElementVNode(
"span",
null,
vue.toDisplayString(vue.unref(t)("pagination.goto")),
1
/* TEXT */
),
vue.createVNode(vue.unref(OInputNumber), {
"model-value": pageVal.value,
class: "o-pagination-input",
controls: "none",
min: 1,
max: totalPage.value,
round: props.round,
variant: props.variant,
validate: validateInput,
"empty-value": pageVal.value,
onChange: goToPage
}, null, 8, ["model-value", "max", "round", "variant", "empty-value"])
])) : vue.createCommentVNode("v-if", true)
])
],
6
/* CLASS, STYLE */
);
};
}
});
const OPagination = Object.assign(_sfc_main$m, {
install(app) {
app.component("OPagination", _sfc_main$m);
}
});
const ProgressVariantTypes = ["line", "circle"];
const ProgressSizeTypes = ["medium", "small"];
const ProgressColorTypes = ["primary", "success", "warning", "danger"];
const progressProps = {
/**
* 进度条类型 ProgressVariantT
*/
variant: {
type: String,
default: "line"
},
/**
* 进度条百分比
*/
percentage: {
type: Number,
default: 0,
validator: (val) => val >= 0 && val <= 100
},
/**
* 进度条线宽
*/
strokeWidth: {
type: Number
},
/**
* 进度条尺寸类型 ProgressSizeT
*/
size: {
type: String,
default: "medium"
},
/**
* 进度条颜色类型 ProgressColorT
*/
color: {
type: String,
default: "primary"
},
/**
* 进度条轨道宽度,当为环形进度条时,仅支持Number
*/
trackWidth: {
type: [Number, String]
},
/**
* 格式化文字
*/
format: {
type: Function,
default: (percentage) => `${percentage}%`
},
/**
* 是否展示文字
*/
showLabel: {
type: Boolean,
default: true
},
/**
* 线形进度条,文字是否在进度条内部
*/
labelInside: {
type: Boolean,
default: false
}
};
const _hoisted_1$e = {
key: 0,
class: "o-progress-line-wrap"
};
const _hoisted_2$b = {
key: 0,
class: "o-progress-line-inner-label"
};
const _hoisted_3$9 = {
key: 1,
class: "o-progress-circle-wrap"
};
const _hoisted_4$6 = ["width", "height", "view-box"];
const _hoisted_5$3 = ["cx", "cy", "r", "stroke-width"];
const _hoisted_6$3 = ["cx", "cy", "r", "stroke-width", "transform", "stroke-dasharray"];
const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
__name: "OProgress",
props: progressProps,
setup(__props) {
const DEFAULT_STROKE_WIDTH = {
medium: 8,
small: 4
};
const props = __props;
const strokeWidth = vue.computed(() => props.strokeWidth ?? DEFAULT_STROKE_WIDTH[props.size]);
const lineBarStyle = vue.computed(() => {
return {
width: `${props.percentage}%`,
borderRadius: `${strokeWidth.value}px`
};
});
const lineTrackStyle = vue.computed(() => {
const rlt = {
height: `${strokeWidth.value}px`,
borderRadius: `${strokeWidth.value}px`
};
if (!isUndefined(props.trackWidth)) {
rlt.width = isNumber(props.trackWidth) ? `${props.trackWidth}px` : props.trackWidth;
}
return rlt;
});
const label = vue.computed(() => props.format(props.percentage));
const DEFAULT_CIRCLE_SIZE = {
medium: 120,
small: 60
};
const circleDiameter = vue.computed(() => {
if (isNumber(props.trackWidth)) {
return props.trackWidth;
}
return DEFAULT_CIRCLE_SIZE[props.size];
});
const circleCenter = vue.computed(() => circleDiameter.value / 2);
const circleRadius = vue.computed(() => circleCenter.value - strokeWidth.value / 2);
const circleStrokeDashArr = vue.computed(() => {
const perimeter = 2 * Math.PI * circleRadius.value;
const percent = props.percentage / 100;
return `${perimeter * percent} ${perimeter * (1 - percent)}`;
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"div",
{
class: vue.normalizeClass(["o-progress", [`o-progress-${props.variant}`, `o-progress-${props.size}`, `o-progress-${props.color}`]])
},
[
vue.createCommentVNode(" variant === 'line' "),
props.variant === "line" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$e, [
vue.createElementVNode(
"div",
{
class: "o-progress-line-track",
style: vue.normalizeStyle(lineTrackStyle.value)
},
[
vue.createElementVNode(
"div",
{
class: "o-progress-line-bar",
style: vue.normalizeStyle(lineBarStyle.value)
},
[
props.showLabel && props.labelInside ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$b, [
vue.renderSlot(_ctx.$slots, "default", {
percentage: props.percentage
}, () => [
vue.createTextVNode(
vue.toDisplayString(label.value),
1
/* TEXT */
)
])
])) : vue.createCommentVNode("v-if", true)
],
4
/* STYLE */
)
],
4
/* STYLE */
),
props.showLabel && !props.labelInside ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 0,
class: vue.normalizeClass(["o-progress-line-label", { "is-icon": _ctx.$slots.icon }])
},
[
vue.renderSlot(_ctx.$slots, "icon", {
percentage: props.percentage
}, () => [
vue.renderSlot(_ctx.$slots, "default", {
percentage: props.percentage
}, () => [
vue.createTextVNode(
vue.toDisplayString(label.value),
1
/* TEXT */
)
])
])
],
2
/* CLASS */
)) : vue.createCommentVNode("v-if", true)
])) : vue.createCommentVNode("v-if", true),
vue.createCommentVNode(" variant === 'circle' "),
props.variant === "circle" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$9, [
(vue.openBlock(), vue.createElementBlock("svg", {
width: circleDiameter.value,
height: circleDiameter.value,
"view-box": `0 0 ${circleDiameter.value} ${circleDiameter.value}`
}, [
vue.createElementVNode("circle", {
class: "o-progress-circle-track",
fill: "none",
cx: circleCenter.value,
cy: circleCenter.value,
r: circleRadius.value,
"stroke-width": strokeWidth.value
}, null, 8, _hoisted_5$3),
vue.createElementVNode("circle", {
class: "o-progress-circle-bar",
fill: "none",
cx: circleCenter.value,
cy: circleCenter.value,
r: circleRadius.value,
"stroke-width": strokeWidth.value,
"stroke-linecap": "round",
transform: `matrix(0,-1,1,0,0,${circleDiameter.value})`,
"stroke-dasharray": circleStrokeDashArr.value
}, null, 8, _hoisted_6$3)
], 8, _hoisted_4$6)),
props.showLabel ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 0,
class: vue.normalizeClass(["o-progress-circle-label", { "is-icon": _ctx.$slots.icon }])
},
[
vue.renderSlot(_ctx.$slots, "icon", {
percentage: props.percentage
}, () => [
vue.renderSlot(_ctx.$slots, "default", {
percentage: props.percentage
}, () => [
vue.createTextVNode(
vue.toDisplayString(label.value),
1
/* TEXT */
)
])
])
],
2
/* CLASS */
)) : vue.createCommentVNode("v-if", true)
])) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
};
}
});
const OProgress = Object.assign(_sfc_main$l, {
install(app) {
app.component("OProgress", _sfc_main$l);
}
});
const radioInjectKey = Symbol("provide-radio");
const radioProps = {
/**
* 单选框value
*/
value: {
type: [String, Number, Boolean],
required: true
},
/**
* 单选框双向绑定值
*/
modelValue: {
type: [String, Number, Boolean]
},
/**
* 非受控状态时,默认是否选中
*/
defaultChecked: {
type: Boolean,
default: false
},
/**
* 是否禁用
*/
disabled: {
type: Boolean,
default: false
},
/**
* input id
*/
inputId: {
type: String
}
};
const radioGroupInjectKey = Symbol("provide-radio-group");
const _hoisted_1$d = ["for"];
const _hoisted_2$a = { class: "o-radio-wrap" };
const _hoisted_3$8 = ["id", "value", "disabled", "checked"];
const _hoisted_4$5 = { class: "o-radio-label" };
const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
__name: "ORadio",
props: radioProps,
emits: ["update:modelValue", "change"],
setup(__props, { expose: __expose, emit: __emit }) {
const props = __props;
const emits = __emit;
const radioGroupInjection = vue.inject(radioGroupInjectKey, null);
const inputId2 = vue.ref(props.inputId);
vue.onMounted(() => {
if (!inputId2.value) {
inputId2.value = uniqueId();
}
});
const _checked = vue.ref(props.defaultChecked);
const isChecked = vue.computed(() => {
if (radioGroupInjection) {
return radioGroupInjection.realValue.value === props.value;
}
if (!isUndefined(props.modelValue)) {
return props.modelValue === props.value;
}
return _checked.value;
});
vue.watch(
isChecked,
(val) => {
_checked.value = val;
},
{ immediate: true }
);
__expose({
checked: isChecked
});
const isDisabled = vue.computed(() => (radioGroupInjection == null ? void 0 : radioGroupInjection.disabled.value) || props.disabled);
const onClick = (ev) => {
ev.stopPropagation();
};
const onChange = (ev) => {
if (isDisabled.value) {
return;
}
_checked.value = true;
const val = props.value ?? true;
emits("update:modelValue", val);
radioGroupInjection == null ? void 0 : radioGroupInjection.updateModelValue(val);
vue.nextTick(() => {
emits("change", val, ev);
radioGroupInjection == null ? void 0 : radioGroupInjection.onChange(val, ev);
});
};
vue.provide(radioInjectKey, {
checked: isChecked,
disabled: isDisabled
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("label", {
class: vue.normalizeClass(["o-radio", {
"o-radio-checked": isChecked.value,
"o-radio-disabled": isDisabled.value
}]),
for: inputId2.value
}, [
vue.createElementVNode("div", _hoisted_2$a, [
vue.createElementVNode("input", {
id: inputId2.value,
type: "radio",
value: props.value,
disabled: isDisabled.value,
checked: isChecked.value,
onClick,
onChange
}, null, 40, _hoisted_3$8),
vue.renderSlot(_ctx.$slots, "radio", {
checked: isChecked.value,
disabled: isDisabled.value
}, () => [
_cache[0] || (_cache[0] = vue.createElementVNode(
"div",
{ class: "o-radio-input-wrap" },
[
vue.createElementVNode("span", { class: "o-radio-input" })
],
-1
/* HOISTED */
)),
vue.createElementVNode("span", _hoisted_4$5, [
vue.renderSlot(_ctx.$slots, "default")
])
])
])
], 10, _hoisted_1$d);
};
}
});
const ORadio = Object.assign(_sfc_main$k, {
install(app) {
app.component("ORadio", _sfc_main$k);
}
});
const radioGroupProps = {
/**
* 单选框组双向绑定值
*/
modelValue: {
type: [String, Number, Boolean]
},
/**
* 非受控状态时,单选框组默认值
*/
defaultValue: {
type: [String, Number, Boolean],
default: ""
},
/**
* 单选框组是否禁用
*/
disabled: {
type: Boolean,
default: false
},
/**
* 单选框组方向 DirectionT
*/
direction: {
type: String,
default: "h"
}
};
const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
__name: "ORadioGroup",
props: radioGroupProps,
emits: ["update:modelValue", "change"],
setup(__props, { emit: __emit }) {
const props = __props;
const emits = __emit;
const realValue = vue.ref(props.modelValue ?? props.defaultValue);
const formItemInjection = vue.inject(formItemInjectKey, null);
vue.watch(
() => props.modelValue,
(val) => {
if (!isUndefined(val)) {
realValue.value = val;
}
}
);
const updateModelValue = (val) => {
realValue.value = val;
emits("update:modelValue", val);
};
const onChange = (val, ev) => {
var _a, _b;
emits("change", val, ev);
(_b = formItemInjection == null ? void 0 : (_a = formItemInjection.fieldHandlers).onChange) == null ? void 0 : _b.call(_a);
};
vue.provide(radioGroupInjectKey, {
realValue,
disabled: vue.toRef(props, "disabled"),
updateModelValue,
onChange
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"div",
{
class: vue.normalizeClass(["o-radio-group", [`o-radio-group-${props.direction}`]])
},
[
vue.renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
);
};
}
});
const ORadioGroup = Object.assign(_sfc_main$j, {
install(app) {
app.component("ORadioGroup", _sfc_main$j);
}
});
const RateItemStatusTypes = ["full", "half", "empty"];
const RateSizeTypes = ["large", "medium"];
const rateProps = {
/**
* 评分数量
*/
count: {
type: Number,
default: 5
},
/**
* 双向绑定值
*/
modelValue: {
type: Number
},
/**
* 非受控状态时,默认值
*/
defaultValue: {
type: Number,
default: 0
},
/**
* 尺寸 RateSizeT
*/
size: {
type: String
},
/**
* 颜色类型 ColorT
*/
color: {
type: String,
default: "normal"
},
/**
* 是否只读
*/
readonly: {
type: Boolean,
default: false
},
/**
* 是否支持半选
*/
allowHalf: {
type: Boolean,
default: false
},
/**
* 是否支持可清空
*/
clearable: {
type: Boolean,
default: false
},
/**
* 文字
*/
labels: {
type: Array
}
};
const rateItemProps = {
/**
* 序号
*/
index: {
type: Number
},
/**
* 状态
*/
status: {
type: String,
default: "empty"
}
};
const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
__name: "ORateItem",
props: rateItemProps,
emits: ["hover", "change"],
setup(__props, { emit: __emit }) {
const props = __props;
const emits = __emit;
const onHover = (isHalf) => {
emits("hover", isHalf);
};
const onClick = (isHalf) => {
emits("change", isHalf);
};
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"div",
{
class: vue.normalizeClass(["o-rate-item", { "is-full": props.status === "full", "is-half": props.status === "half" }])
},
[
vue.createElementVNode(
"span",
{
class: "o-rate-icon o-rate-icon-top",
onMouseenter: _cache[0] || (_cache[0] = ($event) => onHover(true)),
onClick: _cache[1] || (_cache[1] = ($event) => onClick(true))
},
[
vue.renderSlot(_ctx.$slots, "default", {}, () => [
vue.createVNode(vue.unref(IconStar))
])
],
32
/* NEED_HYDRATION */
),
vue.createElementVNode(
"span",
{
class: "o-rate-icon o-rate-icon-bottom",
onMouseenter: _cache[2] || (_cache[2] = ($event) => onHover(false)),
onClick: _cache[3] || (_cache[3] = ($event) => onClick(false))
},
[
vue.renderSlot(_ctx.$slots, "default", {}, () => [
vue.createVNode(vue.unref(IconStar))
])
],
32
/* NEED_HYDRATION */
)
],
2
/* CLASS */
);
};
}
});
const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
__name: "ORate",
props: rateProps,
emits: ["update:modelValue", "change"],
setup(__props, { emit: __emit }) {
const props = __props;
const emits = __emit;
const realValue = vue.ref(props.modelValue ?? props.defaultValue);
vue.watch(
() => props.modelValue,
(val) => {
if (!isUndefined(val)) {
realValue.value = val;
}
}
);
const hoverIndex = vue.ref(-1);
const setHoverIndex = (index, isTopIcon) => {
if (props.readonly) {
return;
}
hoverIndex.value = props.allowHalf && isTopIcon ? index + 0.5 : index + 1;
};
const resetHoverIndex = () => {
hoverIndex.value = -1;
};
const setValue = (index, isTopIcon) => {
if (props.readonly) {
return;
}
if (props.clearable && realValue.value === hoverIndex.value) {
resetHoverIndex();
realValue.value = 0;
emits("update:modelValue", 0);
emits("change", 0);
} else {
hoverIndex.value = props.allowHalf && isTopIcon ? index + 0.5 : index + 1;
realValue.value = hoverIndex.value;
emits("update:modelValue", hoverIndex.value);
emits("change", hoverIndex.value);
}
};
const iconStatus = vue.computed(() => {
const statusArr = new Array(props.count).fill("");
for (let i = 0; i < props.count; i++) {
const val = hoverIndex.value === -1 ? realValue.value ?? -1 : hoverIndex.value;
if (!props.allowHalf) {
if (i + 1 <= val) {
statusArr[i] = "full";
}
} else {
if (i + 1 <= Math.floor(val)) {
statusArr[i] = "full";
} else if (i + 1 === Math.ceil(val)) {
statusArr[i] = "half";
}
}
}
return statusArr;
});
const showLabel = vue.computed(() => {
if (!isArray(props.labels)) {
return false;
}
return props.labels.length === props.count;
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"div",
{
class: vue.normalizeClass(["o-rate", [`o-rate-${props.color}`, `o-rate-${props.size || vue.unref(defaultSize)}`, { "o-rate-readonly": props.readonly }]]),
onMouseleave: resetHoverIndex
},
[
showLabel.value ? (vue.openBlock(true), vue.createElementBlock(
vue.Fragment,
{ key: 0 },
vue.renderList(_ctx.count, (item, idx) => {
return vue.openBlock(), vue.createBlock(
vue.unref(OPopover),
{
key: item,
"adjust-width": false,
"adjust-min-width": false,
visible: false,
"wrap-class": "o-rate-popover"
},
{
target: vue.withCtx(() => [
vue.createVNode(_sfc_main$i, {
status: iconStatus.value[idx],
onHover: (isHalf) => {
setHoverIndex(idx, isHalf);
},
onChange: (isHalf) => {
setValue(idx, isHalf);
}
}, {
default: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "icon", {
index: idx,
status: iconStatus.value[idx]
})
]),
_: 2
/* DYNAMIC */
}, 1032, ["status", "onHover", "onChange"])
]),
default: vue.withCtx(() => [
vue.createElementVNode(
"span",
null,
vue.toDisplayString(_ctx.labels && _ctx.labels[idx]),
1
/* TEXT */
)
]),
_: 2
/* DYNAMIC */
},
1024
/* DYNAMIC_SLOTS */
);
}),
128
/* KEYED_FRAGMENT */
)) : (vue.openBlock(true), vue.createElementBlock(
vue.Fragment,
{ key: 1 },
vue.renderList(_ctx.count, (item, idx) => {
return vue.openBlock(), vue.createBlock(_sfc_main$i, {
key: item,
index: idx,
status: iconStatus.value[idx],
onHover: (isHalf) => {
setHoverIndex(idx, isHalf);
},
onChange: (isHalf) => {
setValue(idx, isHalf);
}
}, {
default: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "icon", {
index: idx,
status: iconStatus.value[idx]
})
]),
_: 2
/* DYNAMIC */
}, 1032, ["index", "status", "onHover", "onChange"]);
}),
128
/* KEYED_FRAGMENT */
))
],
34
/* CLASS, NEED_HYDRATION */
);
};
}
});
const ORate = Object.assign(_sfc_main$h, {
install(app) {
app.component("ORate", _sfc_main$h);
}
});
const ResultStatusTypes = ["info", "success", "warning", "danger"];
const resultProps = {
/**
* 状态
*/
status: {
type: String
},
/**
* 标题
*/
title: {
type: String
},
/**
* 描述
**/
description: {
type: String
}
};
const _hoisted_1$c = {
key: 0,
class: "o-result-image"
};
const _hoisted_2$9 = {
key: 1,
class: "o-result-header"
};
const _hoisted_3$7 = {
key: 1,
class: "o-result-title"
};
const _hoisted_4$4 = {
key: 2,
class: "o-result-description"
};
const _hoisted_5$2 = {
key: 3,
class: "o-result-extra"
};
const _hoisted_6$2 = {
key: 4,
class: "o-result-content"
};
const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
__name: "OResult",
props: resultProps,
setup(__props) {
const props = __props;
const iconMap = {
info: IconInfo.value,
success: IconSuccess.value,
warning: IconWarning.value,
danger: IconDanger.value
};
const icon = vue.computed(() => props.status ? iconMap[props.status] : void 0);
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"div",
{
class: vue.normalizeClass(["o-result", { [`o-result-${props.status}`]: props.status }])
},
[
_ctx.$slots.image ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
vue.renderSlot(_ctx.$slots, "image")
])) : vue.createCommentVNode("v-if", true),
props.status || _ctx.$slots.icon || props.title || _ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$9, [
props.status || _ctx.$slots.icon ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 0,
class: vue.normalizeClass(["o-result-icon", { "o-result-icon-custom": _ctx.$slots.icon }])
},
[
vue.renderSlot(_ctx.$slots, "icon", {}, () => [
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(icon.value)))
])
],
2
/* CLASS */
)) : vue.createCommentVNode("v-if", true),
props.title || _ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$7, [
vue.renderSlot(_ctx.$slots, "title", {}, () => [
vue.createTextVNode(
vue.toDisplayString(props.title),
1
/* TEXT */
)
])
])) : vue.createCommentVNode("v-if", true)
])) : vue.createCommentVNode("v-if", true),
props.description || _ctx.$slots.description ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$4, [
vue.renderSlot(_ctx.$slots, "description", {}, () => [
vue.createTextVNode(
vue.toDisplayString(props.description),
1
/* TEXT */
)
])
])) : vue.createCommentVNode("v-if", true),
_ctx.$slots.extra ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$2, [
vue.renderSlot(_ctx.$slots, "extra")
])) : vue.createCommentVNode("v-if", true),
_ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$2, [
vue.renderSlot(_ctx.$slots, "default")
])) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
};
}
});
const OResult = Object.assign(_sfc_main$g, {
install(app) {
app.component("OResult", _sfc_main$g);
}
});
const skeletonTextProps = {
/**
* 行数
*/
rows: {
type: Number,
default: 3
}
};
const SkeletonAvatarSizeTypes = ["large", "medium", "small", "mini"];
const skeletonAvatarProps = {
/**
* 头像尺寸
*/
size: {
type: String,
default: "medium"
},
/**
* 圆角值 RoundT
*/
round: {
type: String,
default: "pill"
}
};
const skeletonFigureProps = {};
const skeletonProps = {
/**
* 是否显示加载中状态(即展示骨架屏)
*/
loading: {
type: Boolean,
default: true
},
/**
* 是否展示动画
*/
animation: {
type: Boolean,
default: false
},
/**
* 行数
*/
rows: {
type: Number,
default: 3
}
};
const _hoisted_1$b = { class: "o-skeleton-item o-skeleton-text" };
const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
__name: "OSkeletonText",
props: skeletonTextProps,
setup(__props) {
const props = __props;
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("ul", _hoisted_1$b, [
(vue.openBlock(true), vue.createElementBlock(
vue.Fragment,
null,
vue.renderList(props.rows, (item) => {
return vue.openBlock(), vue.createElementBlock("li", {
key: item,
class: "o-skeleton-line"
});
}),
128
/* KEYED_FRAGMENT */
))
]);
};
}
});
const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
__name: "OSkeleton",
props: skeletonProps,
setup(__props) {
const props = __props;
return (_ctx, _cache) => {
return props.loading ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 0,
class: vue.normalizeClass(["o-skeleton", { "o-skeleton-animation": props.animation }])
},
[
vue.renderSlot(_ctx.$slots, "template", {}, () => [
vue.createVNode(_sfc_main$f, {
rows: props.rows
}, null, 8, ["rows"])
])
],
2
/* CLASS */
)) : vue.renderSlot(_ctx.$slots, "default", { key: 1 });
};
}
});
const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
__name: "OSkeletonAvatar",
props: skeletonAvatarProps,
setup(__props) {
const props = __props;
const round2 = getRoundClass(props, "skeleton");
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"div",
{
class: vue.normalizeClass(["o-skeleton-item o-skeleton-avatar", [`o-skeleton-avatar-${props.size}`, vue.unref(round2).class.value]]),
style: vue.normalizeStyle(vue.unref(round2).style.value)
},
null,
6
/* CLASS, STYLE */
);
};
}
});
const _sfc_main$c = {};
const _hoisted_1$a = { class: "o-skeleton-item o-skeleton-figure" };
function _sfc_render(_ctx, _cache) {
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a);
}
const OSkeletonFigure = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render]]);
const OSkeleton = Object.assign(_sfc_main$e, {
OSkeletonText: _sfc_main$f,
OSkeletonAvatar: _sfc_main$d,
OSkeletonFigure,
install(app) {
app.component("OSkeleton", _sfc_main$e);
app.component("OSkeletonText", _sfc_main$f);
app.component("OSkeletonAvatar", _sfc_main$d);
app.component("OSkeletonFigure", OSkeletonFigure);
}
});
const SwitchSizeTypes = ["medium", "small"];
const switchProps = {
/**
* 双向绑定值
*/
modelValue: {
type: [String, Number, Boolean]
},
/**
* 非受控状态时,默认是否选中
*/
defaultChecked: {
type: Boolean,
default: false
},
/**
* 选中状态对应值
*/
checkedValue: {
type: [String, Number, Boolean],
default: true
},
/**
* 未选中状态对应值
*/
uncheckedValue: {
type: [String, Number, Boolean],
default: false
},
/**
* 开关尺寸 SwitchSizeT
*/
size: {
type: String,
default: "medium"
},
/**
* 圆角值 RoundT
*/
round: {
type: String
},
/**
* 是否禁用
*/
disabled: {
type: Boolean,
default: false
},
/**
* 是否加载中
*/
loading: {
type: Boolean,
default: false
},
/**
* 状态改变前的钩子函数
*/
beforeChange: {
type: Function
}
};
const _hoisted_1$9 = { class: "o-switch-wrap" };
const _hoisted_2$8 = { class: "o-switch-handler" };
const _hoisted_3$6 = {
key: 0,
class: "o-switch-icon-loading o-rotating"
};
const _hoisted_4$3 = {
key: 0,
class: "o-switch-label"
};
const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
__name: "OSwitch",
props: switchProps,
emits: ["update:modelValue", "change"],
setup(__props, { emit: __emit }) {
const props = __props;
const emits = __emit;
const round2 = getRoundClass(props, "switch");
const _checked = vue.ref(props.defaultChecked);
const isChecked = vue.computed(() => {
if (!isUndefined(props.modelValue)) {
return props.checkedValue === props.modelValue;
}
return _checked.value;
});
vue.watch(
isChecked,
(val) => {
_checked.value = val;
},
{ immediate: true }
);
const isChangeable = () => {
if (props.loading || props.disabled) {
return Promise.resolve(false);
}
if (!props.beforeChange) {
return Promise.resolve(true);
}
const res = props.beforeChange(!isChecked.value);
if (!(isPromise(res) || isBoolean(res))) {
return Promise.reject("beforeChange should return type `Promise<boolean>` or `boolean`");
}
return isBoolean(res) ? Promise.resolve(res) : res;
};
const onClick = (ev) => {
isChangeable().then((flag) => {
if (flag) {
const checked = !isChecked.value;
_checked.value = checked;
const val = checked ? props.checkedValue : props.uncheckedValue;
emits("update:modelValue", val);
emits("change", val, ev);
}
}).catch((err) => {
log.warn(`${err}`);
});
};
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"div",
{
class: vue.normalizeClass(["o-switch", [
`o-switch-${props.size}`,
vue.unref(round2).class.value,
{ "o-switch-checked": isChecked.value },
{ "o-switch-disabled": props.disabled },
{ "o-switch-loading": props.loading }
]]),
style: vue.normalizeStyle(vue.unref(round2).style.value),
onClick
},
[
vue.createElementVNode("div", _hoisted_1$9, [
vue.createElementVNode("div", _hoisted_2$8, [
props.loading ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$6, [
vue.createVNode(vue.unref(IconLoading))
])) : vue.createCommentVNode("v-if", true)
]),
_ctx.$slots.on || _ctx.$slots.off ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$3, [
isChecked.value ? vue.renderSlot(_ctx.$slots, "on", { key: 0 }) : vue.renderSlot(_ctx.$slots, "off", { key: 1 })
])) : vue.createCommentVNode("v-if", true)
])
],
6
/* CLASS, STYLE */
);
};
}
});
const OSwitch = Object.assign(_sfc_main$b, {
install(app) {
app.component("OSwitch", _sfc_main$b);
}
});
const tabInjectKey = Symbol("provide-tab");
const TabVariantTypes = ["solid", "text"];
const tabProps = {
/**
* tab选中的nav值
* v-model
*/
modelValue: {
type: [String, Number],
default: void 0
},
/**
* 类型 TabVariantT
*/
variant: {
type: String,
default: "text"
},
/**
* 大小 SizeT
*/
size: {
type: String
},
/**
* 是否激活时再加载
*/
lazy: {
type: Boolean
},
/**
* 是否可以添加页签
*/
addable: {
type: Boolean
},
/**
* 不激活新添加页签
*/
addInactive: {
type: Boolean
},
/**
* 是否展示nav线
*/
line: {
type: Boolean,
default: true
},
/**
* 头部是否固定
*/
headerClass: {
type: [String, Array],
default: void 0
}
};
const tabPaneProps = {
/**
* 页签项的key
*/
value: {
type: [String, Number],
default: void 0
},
/**
* 页签项的文本,如果不传,使用nav插槽或者value
*/
label: {
type: String,
default: void 0
},
/**
* 页签切换时过渡动画
*/
transition: {
type: String,
default: "o-fade-in"
},
/**
* 是否禁用选中该页签
*/
disabled: {
type: Boolean,
default: false
},
/**
* 是否可以删除该页签
*/
closable: {
type: Boolean,
default: false
},
/**
* 是否页签首次激活前不渲染页签内容
*/
lazy: {
type: Boolean,
default: false
},
/**
* 是否在隐藏时卸载页签内容
*/
unmountOnHide: {
type: Boolean,
default: false
}
};
const _hoisted_1$8 = {
key: 0,
class: "o-tab-head-prefix"
};
const _hoisted_2$7 = { class: "o-tab-navs" };
const _hoisted_3$5 = {
key: 1,
class: "o-tab-head-suffix"
};
const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
__name: "OTab",
props: tabProps,
emits: ["update:modelValue", "change", "delete", "add"],
setup(__props, { emit: __emit }) {
const props = __props;
const emits = __emit;
const { isPhonePad } = useScreen();
const activeKey = vue.ref(props.modelValue);
const anchorStyle = vue.ref({});
const navWrapRef = vue.ref(null);
const navsRef = vue.ref(null);
const bodyRef = vue.ref(null);
const valueSet = [];
let activeNavEl = null;
const isScroll = vue.ref(false);
const prevDisabled = vue.ref(true);
const nextDisabled = vue.ref(true);
const showArrow = vue.computed(() => {
return !isPhonePad.value && isScroll.value;
});
const scrollActiveNavIntoView = () => {
var _a;
if (isScroll.value && activeNavEl && navWrapRef.value) {
const { offsetLeft } = activeNavEl;
const { scrollLeft, clientWidth } = navWrapRef.value;
const center = scrollLeft + clientWidth / 2;
if (offsetLeft > center || offsetLeft < center) {
(_a = navWrapRef.value) == null ? void 0 : _a.scrollTo({
left: offsetLeft - clientWidth / 2,
behavior: "smooth"
});
}
}
};
const onWrapScroll = debounceRAF(() => {
if (navWrapRef.value) {
const { scrollLeft, scrollWidth, clientWidth } = navWrapRef.value;
prevDisabled.value = scrollLeft === 0;
nextDisabled.value = scrollLeft + 1 >= scrollWidth - clientWidth;
}
});
const updateNavScroll = () => {
if (navWrapRef.value && navsRef.value) {
const { clientWidth: wrapWidth } = navWrapRef.value;
const { clientWidth: width } = navsRef.value;
isScroll.value = wrapWidth < width;
if (isScroll.value) {
vue.nextTick(() => {
onWrapScroll();
scrollActiveNavIntoView();
});
}
}
};
vue.watch(
() => props.modelValue,
(v) => {
activeKey.value = v;
}
);
const updateAnchor = () => {
if (!activeNavEl) {
return;
}
const { clientWidth, offsetLeft } = activeNavEl;
anchorStyle.value = {
transform: `translate3d(${offsetLeft}px, 0px, 0px)`,
width: `${clientWidth}px`
};
};
vue.watch(() => isScroll.value, updateAnchor);
const updateValue = (value, navEl) => {
emits("update:modelValue", value);
activeNavEl = navEl;
if (activeKey.value !== value) {
emits("change", value, activeKey.value);
activeKey.value = value;
}
if (navEl) {
activeNavEl = navEl;
updateAnchor();
scrollActiveNavIntoView();
}
};
const isAdding = vue.ref(false);
const initValue = (value, navEl) => {
if (!valueSet.includes(value)) {
valueSet.push(value);
}
if (activeKey.value === void 0 || isAdding.value) {
updateValue(value, navEl);
isAdding.value = false;
}
if (activeKey.value === value && navEl) {
activeNavEl = navEl;
updateAnchor();
}
};
const onDeletePane = (value) => {
emits("delete", value);
const idx = valueSet.indexOf(value);
if (activeKey.value === value) {
activeKey.value = valueSet[idx > 0 ? idx - 1 : 0];
emits("change", activeKey.value, value);
}
valueSet.splice(idx, 1);
};
const onAddNav = (e) => {
emits("add", e);
if (!props.addInactive) {
isAdding.value = true;
}
};
vue.provide(tabInjectKey, {
lazy: props.lazy,
navsRef,
bodyRef,
activeValue: activeKey,
updateValue,
onDeletePane,
initValue
});
const onHeadResize = debounceRAF(() => {
updateAnchor();
updateNavScroll();
scrollActiveNavIntoView();
});
const navScroll = (to) => {
if (!navWrapRef.value) {
return;
}
const { clientWidth } = navWrapRef.value;
const i = to === "prev" ? -1 : to === "next" ? 1 : 0;
navWrapRef.value.scrollBy({ left: i * clientWidth, behavior: "smooth" });
};
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"div",
{
class: vue.normalizeClass(["o-tab", [`o-tab-${props.variant}`, `o-tab-${props.size || vue.unref(defaultSize)}`]])
},
[
vue.createElementVNode(
"div",
{
class: vue.normalizeClass(["o-tab-head", [
{
"with-act": _ctx.$slots.suffix || _ctx.$slots.prefix,
"show-line": props.line
},
props.headerClass
]])
},
[
_ctx.$slots.prefix ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
vue.renderSlot(_ctx.$slots, "prefix")
])), [
[vue.unref(vOnResize), vue.unref(onHeadResize)]
]) : vue.createCommentVNode("v-if", true),
vue.createElementVNode("div", _hoisted_2$7, [
vue.createElementVNode(
"div",
{
class: vue.normalizeClass([{ "o-tab-navs-scrollable": isScroll.value }, "o-tab-navs-container"])
},
[
showArrow.value ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 0,
class: vue.normalizeClass(["o-tab-nav-btn prev", { "o-tab-nav-btn-disabled": prevDisabled.value }]),
onClick: _cache[0] || (_cache[0] = ($event) => navScroll("prev"))
},
[
vue.createVNode(vue.unref(IconChevronLeft))
],
2
/* CLASS */
)) : vue.createCommentVNode("v-if", true),
vue.createElementVNode(
"div",
{
ref_key: "navWrapRef",
ref: navWrapRef,
class: "o-tab-navs-wrap o-hide-scrollbar",
onScrollPassive: _cache[1] || (_cache[1] = //@ts-ignore
(...args) => vue.unref(onWrapScroll) && vue.unref(onWrapScroll)(...args))
},
[
vue.withDirectives(vue.createElementVNode(
"div",
{
class: "o-tab-nav-list",
ref_key: "navsRef",
ref: navsRef
},
null,
512
/* NEED_PATCH */
), [
[vue.unref(vOnResize), vue.unref(onHeadResize)]
]),
props.variant === "text" ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 0,
class: "o-tab-nav-anchor",
style: vue.normalizeStyle(anchorStyle.value)
},
[
vue.renderSlot(_ctx.$slots, "anchor", {}, () => [
_cache[3] || (_cache[3] = vue.createElementVNode(
"div",
{ class: "o-tab-nav-anchor-line" },
null,
-1
/* HOISTED */
))
])
],
4
/* STYLE */
)) : vue.createCommentVNode("v-if", true)
],
544
/* NEED_HYDRATION, NEED_PATCH */
),
showArrow.value ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 1,
class: vue.normalizeClass(["o-tab-nav-btn next", { "o-tab-nav-btn-disabled": nextDisabled.value }]),
onClick: _cache[2] || (_cache[2] = ($event) => navScroll("next"))
},
[
vue.createVNode(vue.unref(IconChevronRight))
],
2
/* CLASS */
)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
),
props.addable ? (vue.openBlock(), vue.createElementBlock("div", {
key: 0,
class: "o-tab-nav-add",
onClick: onAddNav
}, [
vue.createVNode(vue.unref(IconAdd))
])) : vue.createCommentVNode("v-if", true)
]),
_ctx.$slots.suffix ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_3$5, [
vue.renderSlot(_ctx.$slots, "suffix")
])), [
[vue.unref(vOnResize), vue.unref(onHeadResize)]
]) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
),
vue.createElementVNode(
"div",
{
ref_key: "bodyRef",
ref: bodyRef,
class: "o-tab-body"
},
[
vue.renderSlot(_ctx.$slots, "default")
],
512
/* NEED_PATCH */
)
],
2
/* CLASS */
);
};
}
});
const __default__ = {
inheritAttrs: false
};
const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
...__default__,
__name: "OTabPane",
props: tabPaneProps,
setup(__props) {
const props = __props;
const isClosed = vue.ref(false);
const navRef = vue.ref(null);
const tabInjection = vue.inject(tabInjectKey, null);
const { navsRef, activeValue, lazy } = tabInjection || {};
const instance2 = vue.getCurrentInstance();
if (isUndefined(props.value) && isUndefined(props.label)) {
log.warn("OTabPane is missing prop: value or lable");
}
const paneKey = vue.computed(() => {
return props.value ?? props.label ?? (instance2 == null ? void 0 : instance2.uid) ?? Math.random();
});
const isActive = vue.computed(() => paneKey.value === (activeValue == null ? void 0 : activeValue.value));
const hasActived = vue.ref(isActive.value);
const toMount = vue.computed(() => {
if (isActive.value) {
return true;
}
if ((props.lazy || lazy) && !hasActived.value) {
return false;
}
if (props.unmountOnHide) {
return false;
}
return true;
});
vue.watch(
() => isActive.value,
(v) => {
if (v) {
hasActived.value = true;
tabInjection == null ? void 0 : tabInjection.updateValue(paneKey.value, navRef.value);
}
}
);
const navClick = () => {
if (!props.disabled) {
tabInjection == null ? void 0 : tabInjection.updateValue(paneKey.value, navRef.value);
}
};
const navCloseClick = (e) => {
e.stopImmediatePropagation();
isClosed.value = true;
tabInjection == null ? void 0 : tabInjection.onDeletePane(paneKey.value, e);
};
vue.onMounted(() => {
vue.nextTick(() => {
tabInjection == null ? void 0 : tabInjection.initValue(paneKey.value, navRef.value);
});
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
vue.Fragment,
null,
[
vue.createVNode(vue.unref(ClientOnly), null, {
default: vue.withCtx(() => [
vue.unref(navsRef) && !isClosed.value ? (vue.openBlock(), vue.createBlock(vue.Teleport, {
key: 0,
to: vue.unref(navsRef),
disabled: !vue.unref(navsRef)
}, [
vue.createElementVNode(
"div",
{
ref_key: "navRef",
ref: navRef,
class: vue.normalizeClass([
"o-tab-nav",
{
"o-tab-nav-active": isActive.value,
"o-tab-nav-disabled": props.disabled,
"o-tab-nav-closable": props.closable
}
]),
onClick: navClick
},
[
vue.renderSlot(_ctx.$slots, "nav", {}, () => [
vue.createTextVNode(
vue.toDisplayString(props.label || props.value),
1
/* TEXT */
)
]),
props.closable ? (vue.openBlock(), vue.createElementBlock("div", {
key: 0,
class: "o-tab-nav-close",
onClick: navCloseClick
}, [
vue.createVNode(vue.unref(IconClose))
])) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
)
], 8, ["to", "disabled"])) : vue.createCommentVNode("v-if", true)
]),
_: 3
/* FORWARDED */
}),
vue.createVNode(vue.Transition, {
name: props.transition
}, {
default: vue.withCtx(() => [
!isClosed.value && toMount.value ? vue.withDirectives((vue.openBlock(), vue.createElementBlock(
"div",
vue.mergeProps({
key: 0,
class: [
"o-tab-pane",
{
"o-tab-pane-active": isActive.value,
"o-tab-pane-disabled": props.disabled,
"o-tab-pane-closable": props.closable
}
]
}, _ctx.$attrs),
[
vue.renderSlot(_ctx.$slots, "default")
],
16
/* FULL_PROPS */
)), [
[vue.vShow, isActive.value]
]) : vue.createCommentVNode("v-if", true)
]),
_: 3
/* FORWARDED */
}, 8, ["name"])
],
64
/* STABLE_FRAGMENT */
);
};
}
});
const OTab = Object.assign(_sfc_main$a, {
OTabPane: _sfc_main$9,
install(app) {
app.component("OTab", _sfc_main$a);
app.component("OTabPane", _sfc_main$9);
}
});
const TableBorderTypes = ["all", "row", "column", "frame", "row-column", "row-frame", "column-frame", "none"];
const tableProps = {
/**
* 表头内容 TableColumnT[] | string[]
*/
columns: {
type: Array
},
/**
* 表头内容 ColumnKeysT
*/
columnKeys: {
type: Array
},
/**
* 表格数据 TableRowT[]
*/
data: {
type: Array
},
/**
* 是否显示边框 TableBorderT
*/
border: {
type: String,
default: "row"
},
/**
* 是否小表格
*/
small: {
type: Boolean
},
/**
* 处理单元格合并(表体部分,不包含表头) CellSpanT
*/
cellSpan: {
type: Function
},
/**
* 空数据提示文本
*/
emptyLabel: {
type: String
},
/**
* 是否正在加载
*/
loading: {
type: Boolean
},
/**
* 加载提示文本
*/
loadingLabel: {
type: String
}
};
function getColumnData(columns) {
if (!isArray(columns)) {
return [];
}
return columns.map((item) => {
if (isString(item)) {
return {
key: item,
label: item
};
}
return {
...item
};
});
}
function getSkipCell(rowIndex, columnIndex, span) {
const skip = {};
const { colspan = 1, rowspan = 1 } = span;
for (let i = 0; i < rowspan; i++) {
for (let j = 0; j < colspan; j++) {
if (i !== 0 || j !== 0) {
skip[`${rowIndex + i}-${columnIndex + j}`] = true;
}
}
}
return skip;
}
function getBodyData(columnData, bodyData, cellSpan) {
if (!bodyData) {
return [];
}
const t = bodyData.length;
const s = 0;
const colLenght = columnData.value.length;
const rlt = [];
let span = null;
const skipCell = {};
const end = Math.min(s + t, bodyData.length);
for (let r = s; r < end; r += 1) {
const row = bodyData[r];
const cols = [];
for (let c = 0; c < colLenght; c += 1) {
const col = columnData.value[c];
if (isFunction(cellSpan)) {
span = cellSpan(r, c, row, col);
}
const cell = {
value: row[col.key],
key: col.key
};
if (span) {
const { colspan = 1, rowspan = 1 } = span;
Object.assign(skipCell, getSkipCell(r, c, span));
if (colspan > 1) {
cell.colspan = colspan;
}
if (rowspan > 1) {
cell.rowspan = rowspan;
}
}
if (!skipCell[`${r}-${c}`]) {
if (c === colLenght - 1) {
cell.last = true;
}
cols.push(cell);
}
}
rlt.push({ key: row.key, data: cols });
}
return rlt;
}
const _hoisted_1$7 = { key: 0 };
const _hoisted_2$6 = { key: 1 };
const _hoisted_3$4 = ["rowspan", "colspan"];
const _hoisted_4$2 = {
key: 0,
class: "o-table-tip-wrap"
};
const _hoisted_5$1 = { class: "o-table-empty-label" };
const _hoisted_6$1 = {
key: 0,
class: "o-table-loading-wrap"
};
const _hoisted_7$1 = { class: "o-table-loading-label" };
const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
__name: "OTable",
props: tableProps,
setup(__props) {
const props = __props;
const { t } = useI18n();
const columnData = vue.computed(() => getColumnData(props.columns));
const tableData = vue.computed(() => getBodyData(columnData, props.data, props.cellSpan));
const emptyLabel = vue.computed(() => props.emptyLabel || t("common.empty"));
const loadingLabel = vue.computed(() => props.loadingLabel || t("common.loading"));
const boderClass = vue.computed(() => {
if (isString(props.border)) {
return props.border.split("-").map((item) => `o-table-border-${item}`);
}
return "";
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"div",
{
class: vue.normalizeClass(["o-table", [
{
"o-table-small": props.small,
"o-table-medium": !props.small
}
]])
},
[
vue.createElementVNode(
"div",
{
class: vue.normalizeClass(["o-table-wrap", boderClass.value])
},
[
vue.createElementVNode("table", null, [
vue.createElementVNode("colgroup", null, [
(vue.openBlock(true), vue.createElementBlock(
vue.Fragment,
null,
vue.renderList(columnData.value, (col) => {
return vue.openBlock(), vue.createElementBlock(
"col",
{
key: col.key,
style: vue.normalizeStyle(col.style)
},
null,
4
/* STYLE */
);
}),
128
/* KEYED_FRAGMENT */
))
]),
columnData.value.length > 1 ? (vue.openBlock(), vue.createElementBlock("thead", _hoisted_1$7, [
vue.renderSlot(_ctx.$slots, "header", { columns: columnData.value }, () => [
vue.createElementVNode("tr", null, [
(vue.openBlock(true), vue.createElementBlock(
vue.Fragment,
null,
vue.renderList(columnData.value, (col, idx) => {
return vue.openBlock(), vue.createElementBlock(
"th",
{
key: col.key || idx,
class: vue.normalizeClass({ last: idx + 1 === columnData.value.length })
},
[
vue.renderSlot(_ctx.$slots, `th_${col.key}`, { column: col }, () => [
vue.createTextVNode(
vue.toDisplayString(col.label),
1
/* TEXT */
)
])
],
2
/* CLASS */
);
}),
128
/* KEYED_FRAGMENT */
))
])
])
])) : vue.createCommentVNode("v-if", true),
tableData.value.length > 0 ? (vue.openBlock(), vue.createElementBlock("tbody", _hoisted_2$6, [
vue.renderSlot(_ctx.$slots, "body", { body: tableData.value }, () => [
(vue.openBlock(true), vue.createElementBlock(
vue.Fragment,
null,
vue.renderList(tableData.value, (row, rIdx) => {
return vue.openBlock(), vue.createElementBlock(
"tr",
{
key: row.key || rIdx,
class: vue.normalizeClass({ last: rIdx + 1 === tableData.value.length })
},
[
(vue.openBlock(true), vue.createElementBlock(
vue.Fragment,
null,
vue.renderList(row.data, (col, idx) => {
return vue.openBlock(), vue.createElementBlock("td", {
rowspan: col.rowspan,
colspan: col.colspan,
class: vue.normalizeClass({ last: col.last }),
key: col.key || idx
}, [
vue.renderSlot(_ctx.$slots, `td_${col.key}`, {
row: props.data ? props.data[rIdx] : {}
}, () => [
vue.createTextVNode(
vue.toDisplayString(col.value),
1
/* TEXT */
)
])
], 10, _hoisted_3$4);
}),
128
/* KEYED_FRAGMENT */
))
],
2
/* CLASS */
);
}),
128
/* KEYED_FRAGMENT */
))
])
])) : vue.createCommentVNode("v-if", true)
]),
!props.data || props.data.length === 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$2, [
!props.loading ? vue.renderSlot(_ctx.$slots, "empty", { key: 0 }, () => [
vue.createElementVNode(
"div",
_hoisted_5$1,
vue.toDisplayString(emptyLabel.value),
1
/* TEXT */
)
]) : vue.createCommentVNode("v-if", true)
])) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
),
props.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$1, [
vue.renderSlot(_ctx.$slots, "loading", {}, () => [
vue.createVNode(vue.unref(IconLoading), { class: "o-rotating" }),
vue.createElementVNode(
"div",
_hoisted_7$1,
vue.toDisplayString(loadingLabel.value),
1
/* TEXT */
)
])
])) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
);
};
}
});
const OTable = Object.assign(_sfc_main$8, {
install(app) {
app.component("OTable", _sfc_main$8);
}
});
const TagColorTypes = ["normal", "info", "primary", "success", "warning", "danger"];
const TagVariantTypes = ["solid", "outline"];
const TagSizeTypes = ["medium", "small"];
const tagProps = {
/**
* 标签颜色 ColorT
*/
color: {
type: String,
default: "normal"
},
/**
* 标签类型 TagVariantT
*/
variant: {
type: String,
default: "solid"
},
/**
* 标签尺寸 TagSizeT
*/
size: {
type: String,
default: "medium"
},
/**
* 圆角值 RoundT
*/
round: {
type: String
},
/**
* 是否可关闭
*/
closable: {
type: Boolean,
default: false
},
/**
* tag是否可见 v-model
*/
visible: {
type: Boolean,
default: void 0
},
/**
* 非受控模式,tag是否默认可见
*/
defaultVisible: {
type: Boolean,
default: true
},
/**
* 关闭前的钩子函数
*/
beforeClose: {
type: Function
}
};
const _hoisted_1$6 = {
key: 0,
class: "o-tag-icon"
};
const _hoisted_2$5 = { class: "o-tag-label" };
const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
__name: "OTag",
props: tagProps,
emits: ["update:visible", "close"],
setup(__props, { emit: __emit }) {
const props = __props;
const emits = __emit;
const round2 = getRoundClass(props, "tag");
const isVisible = vue.ref(props.visible ?? props.defaultVisible);
vue.watch(
() => props.visible,
(val) => {
if (!isUndefined(val)) {
isVisible.value = val;
}
}
);
const onClose = async (ev) => {
ev.stopPropagation();
if (isFunction(props.beforeClose)) {
const rlt = await props.beforeClose();
if (rlt) {
isVisible.value = false;
emits("update:visible", isVisible.value);
emits("close", ev);
return;
}
}
isVisible.value = false;
emits("update:visible", isVisible.value);
emits("close", ev);
};
return (_ctx, _cache) => {
return isVisible.value ? (vue.openBlock(), vue.createElementBlock(
"span",
{
key: 0,
class: vue.normalizeClass(["o-tag", [`o-tag-${props.variant}`, `o-tag-${props.color}`, `o-tag-${props.size}`, vue.unref(round2).class.value]]),
style: vue.normalizeStyle(vue.unref(round2).style.value)
},
[
_ctx.$slots.icon ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$6, [
vue.renderSlot(_ctx.$slots, "icon")
])) : vue.createCommentVNode("v-if", true),
vue.createElementVNode("span", _hoisted_2$5, [
vue.renderSlot(_ctx.$slots, "default")
]),
props.closable ? (vue.openBlock(), vue.createElementBlock("span", {
key: 1,
class: "o-tag-close",
onClick: onClose
}, [
vue.createVNode(vue.unref(IconClose))
])) : vue.createCommentVNode("v-if", true)
],
6
/* CLASS, STYLE */
)) : vue.createCommentVNode("v-if", true);
};
}
});
const OTag = Object.assign(_sfc_main$7, {
install(app) {
app.component("OTag", _sfc_main$7);
}
});
const inTextareaProps = {
/**
* 下拉框的值
* v-model
*/
modelValue: {
type: String
},
/**
* 下拉框的默认值
* 非受控
*/
defaultValue: {
type: String
},
/**
* 提示文本
*/
placeholder: {
type: String
},
/**
* 是否禁用
*/
disabled: {
type: Boolean
},
/**
* 是否只读
*/
readonly: {
type: Boolean
},
/**
* 是否可以清除
*/
clearable: {
type: Boolean
},
/**
* 对值格式化,控制显示格式
*/
format: {
type: Function
},
/**
* 判断值的有效性
*/
validate: {
type: Function
},
/**
* 输入为无效值时,在blur
*/
valueOnInvalidChange: {
type: Function
},
/**
* 显示的行数
*/
rows: {
type: Number,
default: void 0
},
/**
* 显示的列数
*/
cols: {
type: Number,
default: void 0
},
/**
* 是否支持调整尺寸 ResizeT
*/
resize: {
type: String,
default: "vertical"
},
/**
* 最小字符长度
*/
minLength: {
type: Number
},
/**
* 最大字符长度
*/
maxLength: {
type: Number
},
/**
* 获取长度方法
*/
getLength: {
type: Function
},
/**
* 超过最大字符长度时是否允许输入
*/
inputOnOutlimit: {
type: Boolean,
default: true
},
/**
* 根据内容自动计算高度
*/
autoSize: {
type: Boolean
},
/**
* textarea id, 用于label关联
*/
textareaId: {
type: String
},
/**
* 使用内置scrollbar,支持传递scrollbar配置项
*/
scrollbar: {
type: [Boolean, Object],
default: true
}
};
const textareaProps = {
...inTextareaProps,
/**
* 大小 SizeT
*/
size: {
type: String
},
/**
* 圆角值 RoundT
*/
round: {
type: String
},
/**
* 颜色类型 Color2T
*/
color: {
type: String,
default: "normal"
},
/**
* 按钮类型 VariantT
*/
variant: {
type: String,
default: "outline"
}
};
const _hoisted_1$5 = ["for"];
const _hoisted_2$4 = ["date-value"];
const _hoisted_3$3 = ["id", "value", "placeholder", "readonly", "disabled", "rows", "cols"];
const _hoisted_4$1 = ["innerHTML"];
const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
__name: "InTextarea",
props: inTextareaProps,
emits: ["update:modelValue", "change", "input", "blur", "focus", "clear", "pressEnter"],
setup(__props, { expose: __expose, emit: __emit }) {
const props = __props;
const emits = __emit;
const slots = vue.useSlots();
const { t } = useI18n();
const { modelValue, inputOnOutlimit, maxLength, minLength } = vue.toRefs(props);
const {
displayValue,
clearValue: clear,
isValid,
inputValueLength,
isOutLengthLimit,
handleBlur,
handleInput,
handleFocus,
handleClear,
inputEl
} = useInput({
emits,
maxLength,
minLength,
inputOnOutlimit,
modelValue,
defaultValue: props.defaultValue ?? "",
emitUpdate: (value) => {
emits("update:modelValue", value);
},
format: props.format,
validate: props.validate,
valueOnInvalidChange: props.valueOnInvalidChange
});
const resizeValue = vue.computed(() => {
if (props.autoSize || props.disabled) {
return "none";
} else {
if (props.resize === "h") {
return "horizontal";
} else if (props.resize === "v") {
return "vertical";
}
return props.resize;
}
});
const isClearable = vue.computed(() => props.clearable && !props.disabled && !props.readonly);
const focus = () => {
var _a;
(_a = inputEl.value) == null ? void 0 : _a.focus();
};
const blur = () => {
var _a;
(_a = inputEl.value) == null ? void 0 : _a.blur();
};
const mirrorValue = vue.computed(() => {
return displayValue.value;
});
const scrollbarProps2 = vue.computed(() => {
if (props.scrollbar === true) {
return {
showType: "hover",
size: "small"
};
}
return props.scrollbar;
});
__expose({
inputEl,
focus,
blur,
clear
});
return (_ctx, _cache) => {
var _a, _b;
return vue.openBlock(), vue.createElementBlock("label", {
class: vue.normalizeClass(["o_textarea", {
"o_textarea-clearable": isClearable.value && vue.unref(displayValue) !== "",
"o_textarea-disabled": props.disabled,
"o_textarea-readonly": props.readonly,
"o_textarea-invalid": !vue.unref(isValid),
"o_textarea-auto-size": props.autoSize,
"o_textarea-limit": props.maxLength
}]),
for: props.textareaId
}, [
((_a = slots.prefix) == null ? void 0 : _a.call(slots)) ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 0,
class: "o_textarea-prefix",
onMousedown: _cache[0] || (_cache[0] = vue.withModifiers(() => {
}, ["prevent"]))
},
[
vue.renderSlot(_ctx.$slots, "prefix")
],
32
/* NEED_HYDRATION */
)) : vue.createCommentVNode("v-if", true),
vue.createElementVNode("div", {
class: vue.normalizeClass(["o_textarea-wrap", {
"o_textarea-wrap-auto-size": props.autoSize
}]),
"date-value": mirrorValue.value
}, [
vue.withDirectives(vue.createElementVNode("textarea", {
id: props.textareaId,
ref_key: "inputEl",
ref: inputEl,
value: vue.unref(displayValue),
class: "o_textarea-textarea",
placeholder: props.placeholder,
readonly: props.readonly,
disabled: props.disabled,
rows: props.rows,
cols: props.cols,
style: vue.normalizeStyle({
resize: resizeValue.value
}),
onFocus: _cache[1] || (_cache[1] = //@ts-ignore
(...args) => vue.unref(handleFocus) && vue.unref(handleFocus)(...args)),
onBlur: _cache[2] || (_cache[2] = //@ts-ignore
(...args) => vue.unref(handleBlur) && vue.unref(handleBlur)(...args)),
onInput: _cache[3] || (_cache[3] = //@ts-ignore
(...args) => vue.unref(handleInput) && vue.unref(handleInput)(...args))
}, null, 44, _hoisted_3$3), [
[vue.unref(vScrollbar), scrollbarProps2.value]
]),
isClearable.value ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 0,
class: "o_textarea-icon o_textarea-clear",
onClick: _cache[4] || (_cache[4] = //@ts-ignore
(...args) => vue.unref(handleClear) && vue.unref(handleClear)(...args)),
onMousedown: _cache[5] || (_cache[5] = vue.withModifiers(() => {
}, ["prevent"]))
},
[
vue.createVNode(vue.unref(IconClose), { class: "o_textarea-clear-icon" })
],
32
/* NEED_HYDRATION */
)) : vue.createCommentVNode("v-if", true),
props.maxLength ? (vue.openBlock(), vue.createElementBlock("div", {
key: 1,
class: vue.normalizeClass(["o_textarea-icon o_textarea-count", { "o_textarea-count-error": vue.unref(isOutLengthLimit) }]),
innerHTML: vue.unref(t)("input.limit", vue.unref(inputValueLength), props.maxLength)
}, null, 10, _hoisted_4$1)) : vue.createCommentVNode("v-if", true)
], 10, _hoisted_2$4),
((_b = slots.suffix) == null ? void 0 : _b.call(slots)) ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 1,
class: "o_textarea-suffix",
onMousedown: _cache[6] || (_cache[6] = vue.withModifiers(() => {
}, ["prevent"]))
},
[
vue.renderSlot(_ctx.$slots, "suffix")
],
32
/* NEED_HYDRATION */
)) : vue.createCommentVNode("v-if", true)
], 10, _hoisted_1$5);
};
}
});
const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
__name: "OTextarea",
props: textareaProps,
emits: ["update:modelValue", "change", "input", "blur", "focus", "clear"],
setup(__props, { expose: __expose, emit: __emit }) {
const props = __props;
const emits = __emit;
const formItemInjection = vue.inject(formItemInjectKey, null);
const inTextareaRef = vue.ref();
const color2 = vue.computed(() => {
var _a;
if (formItemInjection == null ? void 0 : formItemInjection.fieldResult.value) {
return ((_a = formItemInjection == null ? void 0 : formItemInjection.fieldResult.value) == null ? void 0 : _a.type) || "normal";
} else {
return props.color;
}
});
const onInput = (e) => {
var _a, _b;
emits("input", e);
(_b = formItemInjection == null ? void 0 : (_a = formItemInjection.fieldHandlers).onInput) == null ? void 0 : _b.call(_a);
};
const isFocus = vue.ref(false);
const onFocus = (e) => {
var _a, _b;
if (isFocus.value) {
return;
}
isFocus.value = true;
emits("focus", e);
(_b = formItemInjection == null ? void 0 : (_a = formItemInjection.fieldHandlers).onFocus) == null ? void 0 : _b.call(_a);
};
const onBlur = (e) => {
var _a, _b;
isFocus.value = false;
emits("blur", e);
(_b = formItemInjection == null ? void 0 : (_a = formItemInjection.fieldHandlers).onBlur) == null ? void 0 : _b.call(_a);
};
const onClear = (e) => {
emits("clear", e);
};
const onUpdatedModelValue = (value) => {
emits("update:modelValue", value);
};
const onChange = (value) => {
var _a, _b;
emits("change", value);
(_b = formItemInjection == null ? void 0 : (_a = formItemInjection.fieldHandlers).onChange) == null ? void 0 : _b.call(_a);
};
const textareaId = vue.ref(props.textareaId);
vue.onMounted(() => {
if (!textareaId.value) {
textareaId.value = uniqueId();
}
});
const round2 = vue.computed(() => {
return props.round === "pill" ? "var(--o-radius_control-l)" : props.round;
});
__expose({
focus: () => {
var _a;
return (_a = inTextareaRef.value) == null ? void 0 : _a.focus();
},
blur: () => {
var _a;
return (_a = inTextareaRef.value) == null ? void 0 : _a.blur();
},
clear: () => {
var _a;
return (_a = inTextareaRef.value) == null ? void 0 : _a.clear();
},
inputEl: () => {
var _a;
return (_a = inTextareaRef.value) == null ? void 0 : _a.inputEl;
}
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(
vue.h(
vue.unref(_sfc_main$y),
{
class: "o-textarea",
size: props.size,
variant: props.variant,
color: color2.value,
disabled: props.disabled,
readonly: props.readonly,
round: round2.value,
focused: isFocus.value
},
{
default: () => vue.h(
vue.unref(_sfc_main$6),
{
ref: "inTextareaRef",
class: "o-textarea-textarea",
modelValue: vue.unref(formateToString)(props.modelValue),
defaultValue: vue.unref(formateToString)(props.defaultValue),
textareaId: textareaId.value,
...vue.unref(pick)(props, [
"scrollbar",
"placeholder",
"disabled",
"readonly",
"clearable",
"format",
"validate",
"valueOnInvalidChange",
"autoSize",
"resize",
"rows",
"cols",
"getLength",
"maxLength",
"inputOnOutlimit"
]),
onChange,
onInput,
onFocus,
onBlur,
onClear,
"onUpdate:modelValue": onUpdatedModelValue
},
vue.unref(pick)(_ctx.$slots, ["prefix", "suffix"])
)
}
)
));
};
}
});
const OTextarea = Object.assign(_sfc_main$5, {
install(app) {
app.component("OTextarea", _sfc_main$5);
}
});
const buttonToggleProps = {
/**
* 双向绑定值,是否被选中
*/
checked: {
type: Boolean,
default: void 0
},
/**
* 非受控状态时,默认是否选中
*/
defaultChecked: {
type: Boolean,
default: false
},
/**
* 圆角值 RoundT
*/
round: {
type: String
},
/**
* 前缀图标
*/
icon: {
type: Object
},
/**
* 是否禁用
*/
disabled: {
type: Boolean,
default: false
}
};
const _hoisted_1$4 = {
key: 0,
class: "o-toggle-prefix"
};
const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
__name: "OToggle",
props: buttonToggleProps,
emits: ["update:checked", "change"],
setup(__props, { emit: __emit }) {
const checkboxInjection = vue.inject(checkboxInjectKey, null);
const radioInjection = vue.inject(radioInjectKey, null);
const props = __props;
const round2 = getRoundClass(props, "toggle");
const isChecked = vue.ref(props.checked ?? props.defaultChecked);
const emits = __emit;
vue.watch(
() => props.checked,
(val) => {
if (!isUndefined(val)) {
isChecked.value = val;
}
}
);
const onClick = (ev) => {
if (props.disabled || checkboxInjection || radioInjection) {
return;
}
isChecked.value = !isChecked.value;
emits("update:checked", isChecked.value);
vue.nextTick(() => {
emits("change", isChecked.value, ev);
});
};
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"div",
{
class: vue.normalizeClass(["o-toggle", [
vue.unref(round2).class.value,
{
"o-toggle-disabled": props.disabled,
"o-toggle-checked": isChecked.value
}
]]),
onClick
},
[
props.icon || _ctx.$slots.icon ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$4, [
vue.renderSlot(_ctx.$slots, "icon", {}, () => [
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(props.icon)))
])
])) : vue.createCommentVNode("v-if", true),
vue.renderSlot(_ctx.$slots, "default")
],
2
/* CLASS */
);
};
}
});
const OToggle = Object.assign(_sfc_main$4, {
install(app) {
app.component("OButtonToggle", _sfc_main$4);
app.component("OToggle", _sfc_main$4);
}
});
const UploadFileStatusTypes = ["pending", "uploading", "finished", "failed"];
const UploadListTypes = ["text", "picture", "picture-card"];
const uploadProps = {
/**
* 文件列表(受控)
* v-model
*/
modelValue: {
type: Array
},
/**
* 文件列表(非受控)
*/
defaultFileList: {
type: Array
},
/**
* 文件选择 MIME类型
* image/jpeg;image/jpg;image/png;image/gif;video/mp4;
*/
accept: {
type: String
},
/**
* 是否为禁用状态
*/
disabled: {
type: Boolean
},
/**
* 是否支持多选
*/
multiple: {
type: Boolean
},
/**
* 选择文件前回调,根据返回值判断是否继续选择文件
*/
beforeSelect: {
type: Function
},
/**
* 选择后触发
*/
onAfterSelect: {
type: Function
},
/**
* 选择按钮文本
*/
btnLabel: {
type: String
},
/**
* 自定义上传请求
*/
uploadRequest: {
type: Function
},
/**
* true 选择完成后,手动触发上传;false 选择完成后自动上传
*/
lazyUpload: {
type: Boolean
},
/**
* 上传前触发
*/
onBeforeUpload: {
type: Function
},
/**
* 删除前触发
*/
onBeforeRemove: {
type: Function
},
/**
* 支持拖拽上传
*/
draggable: {
type: Boolean
},
/**
* 拖拽区域上传提示文本
*/
dragLabel: {
type: String
},
/**
* 拖拽区域拖拽中的提示文本
*/
dragHoverLabel: {
type: String
},
/**
* 文件列表类型
*/
listType: {
type: String,
default: "text"
},
/**
* 生成缩略图
*/
createThumbnail: {
type: Function
}
};
const slot = {
names: {
uploadItem: "item",
select: "default",
selectDrag: "select-drag",
selectDragExtra: "select-drag-extra"
}
};
const _hoisted_1$3 = { class: "o-upload-card-item-wrap" };
const _hoisted_2$3 = { class: "o-upload-card-file" };
const _hoisted_3$2 = {
key: 0,
class: "o-upload-progress o-upload-card-progress"
};
const _hoisted_4 = {
key: 0,
class: "o-upload-icon-link"
};
const _hoisted_5 = { class: "o-upload-row-label" };
const _hoisted_6 = { class: "o-upload-row-icons" };
const _hoisted_7 = {
key: 1,
class: "o-upload-progress o-upload-row-progress"
};
const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
__name: "UploadItem",
props: {
file: {},
listType: {}
},
emits: ["replace", "remove", "retry"],
setup(__props, { emit: __emit }) {
const props = __props;
const emits = __emit;
const { t } = useI18n();
const onFileRemove = (file) => {
emits("remove", file);
};
const onFileUploadRetry = (file) => {
emits("retry", file);
};
const showLoading = (file) => {
if (file.status !== "uploading") {
return false;
}
if (!file.percent && file.percent !== 0) {
return true;
}
return false;
};
const onFileReplace = (file) => {
emits("replace", file);
};
const figureRef = vue.ref(null);
const onPreview = () => {
var _a;
(_a = figureRef.value) == null ? void 0 : _a.preview();
};
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"div",
{
class: vue.normalizeClass(["o-upload-item", {
"o-upload-item-error": props.file.status === "failed"
}])
},
[
vue.renderSlot(_ctx.$slots, vue.unref(slot).names.uploadItem, { item: _ctx.file }, () => [
props.listType === "picture-card" ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 0,
class: vue.normalizeClass(["o-upload-card-item", {
"is-error": props.file.status === "failed"
}])
},
[
vue.createElementVNode("div", _hoisted_1$3, [
vue.createElementVNode("div", _hoisted_2$3, [
props.file.imgUrl ? (vue.openBlock(), vue.createBlock(vue.unref(OFigure), {
key: 0,
ref_key: "figureRef",
ref: figureRef,
"lazy-preiew": "",
class: "o-upload-thumbnail",
src: props.file.imgUrl
}, null, 8, ["src"])) : (vue.openBlock(), vue.createBlock(vue.unref(IconFile), {
key: 1,
class: "o-upload-icon-file"
}))
]),
vue.createElementVNode(
"div",
{
class: vue.normalizeClass(["o-upload-card-icons", {
"is-show": showLoading(props.file)
}])
},
[
props.file.retry ? (vue.openBlock(), vue.createBlock(vue.unref(OIcon), {
key: 0,
button: "",
class: "o-upload-icon-btn o-upload-icon-retry",
icon: vue.unref(IconRefresh),
onClick: _cache[0] || (_cache[0] = ($event) => onFileUploadRetry(props.file)),
title: vue.unref(t)("upload.retry")
}, null, 8, ["icon", "title"])) : vue.createCommentVNode("v-if", true),
props.file.status !== "failed" && props.file.imgUrl ? (vue.openBlock(), vue.createBlock(vue.unref(OIcon), {
key: 1,
button: "",
icon: vue.unref(IconPreview),
class: "o-upload-icon-btn o-upload-icon-preview",
onClick: onPreview,
title: vue.unref(t)("upload.preview")
}, null, 8, ["icon", "title"])) : vue.createCommentVNode("v-if", true),
showLoading(props.file) ? (vue.openBlock(), vue.createBlock(vue.unref(OIcon), {
key: 2,
class: "o-upload-icon-loading"
}, {
default: vue.withCtx(() => [
vue.createVNode(vue.unref(IconLoading), { class: "o-rotating" })
]),
_: 1
/* STABLE */
})) : vue.createCommentVNode("v-if", true),
props.file.status === "finished" ? (vue.openBlock(), vue.createBlock(vue.unref(OIcon), {
key: 3,
button: "",
icon: vue.unref(IconEdit),
class: "o-upload-icon-btn o-upload-icon-edit",
onClick: _cache[1] || (_cache[1] = ($event) => onFileReplace(props.file)),
title: vue.unref(t)("upload.edit")
}, null, 8, ["icon", "title"])) : vue.createCommentVNode("v-if", true),
vue.createVNode(vue.unref(OIcon), {
button: "",
class: "o-upload-icon-btn o-upload-icon-remove",
icon: vue.unref(IconDelete),
onClick: _cache[2] || (_cache[2] = ($event) => onFileRemove(props.file)),
title: vue.unref(t)("upload.delete")
}, null, 8, ["icon", "title"])
],
2
/* CLASS */
),
props.file.status === "uploading" && props.file.percent ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$2, [
vue.createElementVNode(
"div",
{
class: "o-upload-progress-bar",
style: vue.normalizeStyle({ width: props.file.percent + "%" })
},
null,
4
/* STYLE */
)
])) : vue.createCommentVNode("v-if", true)
])
],
2
/* CLASS */
)) : (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 1,
class: vue.normalizeClass(["o-upload-row-item", {
"is-error": props.file.status === "failed"
}])
},
[
props.file.icon !== false ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, [
props.file.icon ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(props.file.icon), { key: 0 })) : (vue.openBlock(), vue.createBlock(vue.unref(IconLinkPrefix), { key: 1 }))
])) : vue.createCommentVNode("v-if", true),
vue.createElementVNode(
"div",
_hoisted_5,
vue.toDisplayString(props.file.name),
1
/* TEXT */
),
vue.createElementVNode("div", _hoisted_6, [
showLoading(props.file) ? (vue.openBlock(), vue.createBlock(vue.unref(OIcon), {
key: 0,
class: "o-upload-icon-loading"
}, {
default: vue.withCtx(() => [
vue.createVNode(vue.unref(IconLoading), { class: "o-rotating" })
]),
_: 1
/* STABLE */
})) : vue.createCommentVNode("v-if", true),
props.file.retry ? (vue.openBlock(), vue.createBlock(vue.unref(OIcon), {
key: 1,
button: "",
class: "o-upload-row-icon o-upload-icon-hover-in o-upload-icon-retry",
icon: vue.unref(IconRefresh),
onClick: _cache[3] || (_cache[3] = ($event) => onFileUploadRetry(props.file)),
title: vue.unref(t)("upload.retry")
}, null, 8, ["icon", "title"])) : vue.createCommentVNode("v-if", true),
vue.createVNode(vue.unref(OIcon), {
button: "",
class: "o-upload-row-icon o-upload-icon-remove o-upload-icon-hover-in",
icon: vue.unref(IconDelete),
onClick: _cache[4] || (_cache[4] = ($event) => onFileRemove(props.file)),
title: vue.unref(t)("upload.delete")
}, null, 8, ["icon", "title"])
]),
props.file.status === "uploading" && props.file.percent ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, [
vue.createElementVNode(
"div",
{
class: "o-upload-progress-bar",
style: vue.normalizeStyle({ width: props.file.percent + "%" })
},
null,
4
/* STYLE */
)
])) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
)),
props.file.message ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 2,
class: vue.normalizeClass(["o-upload-item-tip", [
{
"is-error": props.file.status === "failed"
},
props.file.messageClass
]])
},
vue.toDisplayString(props.file.message),
3
/* TEXT, CLASS */
)) : vue.createCommentVNode("v-if", true)
])
],
2
/* CLASS */
);
};
}
});
const requestUploadFile = (file, options) => {
return new Promise((resolve) => {
if (isFunction(options.uploadRequest)) {
file.status = "uploading";
file.request = options.uploadRequest({
file,
onProgress(percent) {
file.percent = percent;
if (isFunction(options.onProgress)) {
options.onProgress(file);
}
},
onSuccess() {
file.status = "finished";
file.retry = false;
resolve(file);
if (isFunction(options.onSuccess)) {
options.onSuccess(file);
}
},
onError(response, retry) {
file.status = "failed";
file.message = response == null ? void 0 : response.message;
file.retry = retry;
if (file.percent) {
file.percent = 0;
}
resolve(file);
if (isFunction(options.onError)) {
options.onError(file);
}
}
});
} else {
resolve(file);
}
});
};
const doUploadFile = (file, options) => {
file.retry = false;
file.message = "";
if (isFunction(options.onBeforeUpload)) {
return options.onBeforeUpload(file).then((res) => {
if (res === false) {
return;
}
if (res instanceof File) {
file.file = res;
}
return requestUploadFile(file, options);
});
} else {
return requestUploadFile(file, options);
}
};
const doUploadFileList = (fileList, options) => {
if (fileList.length === 0) {
return;
}
const rlt = fileList.map((f) => {
if (f.status && ["finished", "uploading"].includes(f.status)) {
return Promise.resolve(f);
}
return doUploadFile(f, options);
});
return Promise.allSettled(rlt).then(() => {
return fileList;
});
};
function isImageType(file) {
var _a;
return (_a = file.type) == null ? void 0 : _a.includes("image/");
}
function generateImageDataUrl(file) {
if (typeof file === "string") {
return file;
}
if (isImageType(file)) {
return URL.createObjectURL(file);
} else {
return "";
}
}
function isPictureType(type) {
return !!type && ["picture", "picture-card"].includes(type);
}
const _hoisted_1$2 = { class: "o-upload-drag-label" };
const _hoisted_2$2 = {
key: 0,
class: "o-upload-select-extra"
};
const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
__name: "UploadSelect",
props: {
draggable: { type: Boolean },
dragLabel: {},
dragHoverLabel: {},
btnLabel: {},
disabled: { type: Boolean }
},
emits: ["to-select", "selected"],
setup(__props, { emit: __emit }) {
const props = __props;
const emits = __emit;
const { t } = useI18n();
const onSelectClick = () => {
if (props.disabled) {
return;
}
emits("to-select");
};
const isDragging = vue.ref(false);
let dragCnt = 0;
const onDragEnter = (e) => {
e.preventDefault();
if (props.disabled) {
return;
}
dragCnt++;
};
const onDragOver = (e) => {
e.preventDefault();
if (!isDragging.value && !props.disabled) {
isDragging.value = true;
}
};
const onDragLeave = () => {
if (props.disabled) {
return;
}
dragCnt--;
if (dragCnt === 0) {
isDragging.value = false;
}
};
const onDrap = (e) => {
var _a;
e.preventDefault();
if (props.disabled) {
return;
}
const files = (_a = e.dataTransfer) == null ? void 0 : _a.files;
if (files && files.length > 0) {
emits("selected", files);
}
isDragging.value = false;
dragCnt = 0;
};
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"div",
{
class: vue.normalizeClass(["o-upload-select", {
"o-upload-select-drag": props.draggable
}]),
onClick: onSelectClick
},
[
vue.renderSlot(_ctx.$slots, vue.unref(slot).names.select, {}, () => [
props.draggable ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 0,
class: vue.normalizeClass(["o-upload-drag", {
"o-upload-drag-dragging": isDragging.value,
"o-upload-drag-disabled": props.disabled
}]),
onDragenter: onDragEnter,
onDragover: onDragOver,
onDragleave: onDragLeave,
onDrop: onDrap
},
[
vue.renderSlot(_ctx.$slots, vue.unref(slot).names.selectDrag, {}, () => [
vue.createVNode(vue.unref(IconAdd), { class: "o-upload-drag-icon" }),
vue.createElementVNode(
"div",
_hoisted_1$2,
vue.toDisplayString(!isDragging.value ? props.dragLabel ?? vue.unref(t)("upload.drag") : props.dragHoverLabel ?? vue.unref(t)("upload.dragHover")),
1
/* TEXT */
),
_ctx.$slots[vue.unref(slot).names.selectDragExtra] ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$2, [
vue.renderSlot(_ctx.$slots, vue.unref(slot).names.selectDragExtra)
])) : vue.createCommentVNode("v-if", true)
])
],
34
/* CLASS, NEED_HYDRATION */
)) : (vue.openBlock(), vue.createBlock(_sfc_main$11, {
key: 1,
disabled: props.disabled,
icon: vue.unref(IconAdd)
}, {
default: vue.withCtx(() => [
vue.createTextVNode(
vue.toDisplayString(props.btnLabel ?? vue.unref(t)("upload.buttonLabel")),
1
/* TEXT */
)
]),
_: 1
/* STABLE */
}, 8, ["disabled", "icon"]))
])
],
2
/* CLASS */
);
};
}
});
const _hoisted_1$1 = { class: "o-upload-select-input" };
const _hoisted_2$1 = ["accept", "disabled"];
const _hoisted_3$1 = ["accept", "disabled"];
const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
__name: "InputSelect",
props: {
accept: {},
disabled: { type: Boolean }
},
emits: ["selected"],
setup(__props, { expose: __expose, emit: __emit }) {
const props = __props;
const emits = __emit;
const inputRef = vue.ref(null);
const multipleInputRef = vue.ref(null);
const onInputChange = function(e) {
const target = e.target;
const files = target.files;
if (files && files.length > 0) {
emits("selected", files);
}
target.value = "";
};
const select = (multiple) => {
var _a, _b;
if (props.disabled) {
return;
}
if (multiple) {
(_a = multipleInputRef.value) == null ? void 0 : _a.click();
} else {
(_b = inputRef.value) == null ? void 0 : _b.click();
}
};
__expose({
select
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
vue.createElementVNode("input", {
ref_key: "multipleInputRef",
ref: multipleInputRef,
type: "file",
class: "o-upload-input",
multiple: "",
accept: props.accept,
disabled: props.disabled,
onChange: onInputChange
}, null, 40, _hoisted_2$1),
vue.createElementVNode("input", {
ref_key: "inputRef",
ref: inputRef,
type: "file",
class: "o-upload-input",
accept: props.accept,
disabled: props.disabled,
onChange: onInputChange
}, null, 40, _hoisted_3$1)
]);
};
}
});
const _hoisted_1 = {
key: 0,
class: "o-upload-select-wrap"
};
const _hoisted_2 = {
key: 0,
class: "o-upload-select-extra"
};
const _hoisted_3 = { class: "o-upload-card-label" };
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
__name: "OUpload",
props: uploadProps,
emits: ["progress", "success", "error", "change", "select", "update:modelValue"],
setup(__props, { expose: __expose, emit: __emit }) {
const props = __props;
const emits = __emit;
const emitUpdateValue = (value) => {
emits("update:modelValue", value);
};
const { t } = useI18n();
const fileList = vue.ref(props.modelValue ?? props.defaultFileList ?? []);
vue.watch(
() => props.modelValue,
(v) => {
if (fileList.value === v) {
return;
}
if (isArray(v)) {
fileList.value = [...v];
} else {
fileList.value = [];
}
}
);
const formItemInjection = vue.inject(formItemInjectKey, null);
let fileId = 1;
const uploadOption = vue.computed(() => {
return {
uploadRequest: props.uploadRequest,
onBeforeUpload: props.onBeforeUpload,
onProgress: (file) => {
emits("progress", file);
},
onSuccess: (file) => {
emits("success", file);
emitUpdateValue(fileList.value);
emits("change", fileList.value);
},
onError: (file) => {
emits("error", file);
emitUpdateValue(fileList.value);
emits("change", fileList.value);
}
};
});
const selectRef = vue.ref(null);
let replaceId = "";
const uploadAll = () => {
return doUploadFileList(fileList.value, uploadOption.value);
};
const afterSelected = (files) => {
var _a, _b, _c, _d, _e, _f, _g;
if (replaceId) {
const idx = fileList.value.findIndex((item) => item.id === replaceId);
if (idx > -1) {
const f = fileList.value[idx];
(_a = f.request) == null ? void 0 : _a.abort();
fileList.value[idx] = files[0];
replaceId = "";
emitUpdateValue(fileList.value);
emits("select", fileList.value);
(_c = formItemInjection == null ? void 0 : (_b = formItemInjection.fieldHandlers).onChange) == null ? void 0 : _c.call(_b);
if (!props.lazyUpload) {
doUploadFile(fileList.value[idx], uploadOption.value);
}
}
} else {
let s = fileList.value.length;
let l = files.length;
if (props.multiple) {
fileList.value = fileList.value.concat(files);
} else {
(_e = (_d = fileList.value[0]) == null ? void 0 : _d.request) == null ? void 0 : _e.abort();
fileList.value = files;
s = 0;
l = 1;
}
emitUpdateValue(fileList.value);
emits("select", fileList.value);
(_g = formItemInjection == null ? void 0 : (_f = formItemInjection.fieldHandlers).onChange) == null ? void 0 : _g.call(_f);
if (!props.lazyUpload) {
doUploadFileList(fileList.value.slice(s, s + l), uploadOption.value);
}
}
};
const onFileSelected = async (files) => {
let list = [];
const isPicture = isPictureType(props.listType);
if (isFunction(props.onAfterSelect)) {
list = await props.onAfterSelect(files);
if (isPicture) {
list.forEach((item) => {
if (!item.imgUrl && item.file) {
item.imgUrl = generateImageDataUrl(item.file);
}
});
}
} else {
list = Array.from(files).map((item) => {
return {
id: `${fileId++}`,
name: item.name,
file: item,
imgUrl: isPicture ? generateImageDataUrl(item) : ""
};
});
}
afterSelected(list);
};
const removeFile = async (file) => {
var _a, _b, _c;
if (isFunction(props.onBeforeRemove)) {
const sure = await props.onBeforeRemove(file);
if (sure === false) {
return false;
}
}
(_a = file.request) == null ? void 0 : _a.abort();
fileList.value = fileList.value.filter((f) => f.id !== file.id);
(_c = formItemInjection == null ? void 0 : (_b = formItemInjection.fieldHandlers).onChange) == null ? void 0 : _c.call(_b);
emitUpdateValue(fileList.value);
return true;
};
const removeFileByIndex = (index) => {
if (index > -1 && index < fileList.value.length) {
return removeFile(fileList.value[index]);
}
};
const removeAllFiles = () => {
return new Promise((resolve) => {
Promise.allSettled(fileList.value.map((f) => removeFile(f))).then((res) => {
resolve(res);
});
fileList.value = [];
emitUpdateValue(fileList.value);
});
};
const onFileUploadRetry = (file) => {
if (!file.retry || !file.file) {
return;
}
doUploadFile(file, uploadOption.value);
};
const onFileReplace = (file) => {
var _a;
(_a = selectRef.value) == null ? void 0 : _a.select(false);
replaceId = file.id;
};
const doSelect = async () => {
var _a;
if (isFunction(props.beforeSelect)) {
const goon = await props.beforeSelect(fileList.value);
if (goon === false) {
return;
}
}
(_a = selectRef.value) == null ? void 0 : _a.select(props.multiple);
};
__expose({
upload: uploadAll,
select: doSelect,
retry: onFileUploadRetry,
replace: onFileReplace,
removeByIndex: removeFileByIndex,
removeAll: removeAllFiles
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock(
"div",
{
class: vue.normalizeClass(["o-upload", { "o-upload-draggable": _ctx.draggable }])
},
[
vue.createVNode(_sfc_main$1, {
ref_key: "selectRef",
ref: selectRef,
accept: props.accept,
disabled: props.disabled,
onSelected: onFileSelected
}, null, 8, ["accept", "disabled"]),
["text", "picture"].includes(props.listType) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
vue.createVNode(_sfc_main$2, {
disabled: props.disabled,
draggable: props.draggable,
"btn-label": props.btnLabel,
"drag-label": props.dragLabel,
"drag-hover-label": props.dragHoverLabel,
onToSelect: doSelect,
onSelected: onFileSelected
}, vue.createSlots({
_: 2
/* DYNAMIC */
}, [
vue.renderList(vue.unref(filterSlots)(_ctx.$slots, vue.unref(slot).names), (name) => {
return {
name,
fn: vue.withCtx((slotData) => [
vue.renderSlot(_ctx.$slots, name, vue.normalizeProps(vue.guardReactiveProps(slotData)))
])
};
})
]), 1032, ["disabled", "draggable", "btn-label", "drag-label", "drag-hover-label"]),
_ctx.$slots["select-extra"] ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
vue.renderSlot(_ctx.$slots, "select-extra")
])) : vue.createCommentVNode("v-if", true)
])) : vue.createCommentVNode("v-if", true),
vue.createElementVNode(
"div",
{
class: vue.normalizeClass(["o-upload-list", {
"o-upload-card-list": props.listType === "picture-card"
}])
},
[
(vue.openBlock(true), vue.createElementBlock(
vue.Fragment,
null,
vue.renderList(fileList.value, (item) => {
return vue.openBlock(), vue.createBlock(_sfc_main$3, {
key: item.id,
file: item,
"list-type": props.listType,
onRemove: removeFile,
onRetry: onFileUploadRetry,
onReplace: onFileReplace
}, vue.createSlots({
_: 2
/* DYNAMIC */
}, [
vue.renderList(vue.unref(filterSlots)(_ctx.$slots, vue.unref(slot).names), (name) => {
return {
name,
fn: vue.withCtx((slotData) => [
vue.renderSlot(_ctx.$slots, name, vue.mergeProps({ ref_for: true }, slotData))
])
};
})
]), 1032, ["file", "list-type"]);
}),
128
/* KEYED_FRAGMENT */
)),
props.listType === "picture-card" ? (vue.openBlock(), vue.createElementBlock(
"div",
{
key: 0,
class: vue.normalizeClass(["o-upload-card-add", {
"is-disabled": props.disabled
}]),
onClick: doSelect
},
[
vue.createElementVNode("div", null, [
vue.renderSlot(_ctx.$slots, "select-add", {}, () => [
vue.createVNode(vue.unref(IconAdd), { class: "o-upload-card-add-icon" }),
vue.createElementVNode("div", _hoisted_3, [
vue.renderSlot(_ctx.$slots, "select-add-label", {}, () => [
vue.createTextVNode(
vue.toDisplayString(props.btnLabel ?? vue.unref(t)("upload.buttonLabel")),
1
/* TEXT */
)
])
])
])
])
],
2
/* CLASS */
)) : vue.createCommentVNode("v-if", true)
],
2
/* CLASS */
)
],
2
/* CLASS */
);
};
}
});
const OUpload = Object.assign(_sfc_main, {
install(app) {
app.component("OUpload", _sfc_main);
}
});
exports2.AnchorSizeTypes = AnchorSizeTypes;
exports2.BadgeColorTypes = BadgeColorTypes;
exports2.ButtonSizeTypes = ButtonSizeTypes;
exports2.CardCoverFitTypes = CardCoverFitTypes;
exports2.CardHoverCursorTypes = CardHoverCursorTypes;
exports2.Color2Types = Color2Types;
exports2.ColorPool = ColorPool;
exports2.ColorTypes = ColorTypes;
exports2.DialogSizeTypes = DialogSizeTypes;
exports2.DirectionTypes = DirectionTypes;
exports2.DividerVariantTypes = DividerVariantTypes;
exports2.InputNumberControlTypes = InputNumberControlTypes;
exports2.LinkSizeTypes = LinkSizeTypes;
exports2.MenuSizeTypes = MenuSizeTypes;
exports2.MessageStatusTypes = MessageStatusTypes;
exports2.OAnchor = OAnchor;
exports2.OAnchorItem = _sfc_main$15;
exports2.OBadge = OBadge;
exports2.OBreadcrumb = OBreadcrumb;
exports2.OBreadcrumbItem = _sfc_main$12;
exports2.OButton = OButton;
exports2.OCard = OCard;
exports2.OCarousel = OCarousel;
exports2.OCarouselItem = _sfc_main$X;
exports2.OCascader = OCascader;
exports2.OCascaderPanel = _sfc_main$L;
exports2.OCheckbox = OCheckbox;
exports2.OCheckboxGroup = OCheckboxGroup;
exports2.OChildOnly = OChildOnly;
exports2.OCol = _sfc_main$A;
exports2.OCollapse = OCollapse;
exports2.OCollapseItem = _sfc_main$H;
exports2.OConfigProvider = OConfigProvider;
exports2.ODialog = ODialog;
exports2.ODivider = ODivider;
exports2.ODropdown = ODropdown;
exports2.ODropdownItem = _sfc_main$E;
exports2.OFigure = OFigure;
exports2.OForm = OForm;
exports2.OFormItem = _sfc_main$C;
exports2.OIcon = OIcon;
exports2.OIconAdd = OIconAdd;
exports2.OIconArrowDown = OIconArrowDown;
exports2.OIconArrowLeft = OIconArrowLeft;
exports2.OIconArrowRight = OIconArrowRight;
exports2.OIconArrowUp = OIconArrowUp;
exports2.OIconAscend = OIconAscend;
exports2.OIconCalendar = OIconCalendar;
exports2.OIconCaretDown = OIconCaretDown;
exports2.OIconCaretLeft = OIconCaretLeft;
exports2.OIconCaretRight = OIconCaretRight;
exports2.OIconCaretUp = OIconCaretUp;
exports2.OIconChecked = OIconChecked;
exports2.OIconChevronDown = OIconChevronDown;
exports2.OIconChevronDownBold = OIconChevronDownBold;
exports2.OIconChevronLeft = OIconChevronLeft;
exports2.OIconChevronRight = OIconChevronRight;
exports2.OIconChevronUp = OIconChevronUp;
exports2.OIconClose = OIconClose;
exports2.OIconDanger = OIconDanger;
exports2.OIconDelete = OIconDelete;
exports2.OIconDone = OIconDone;
exports2.OIconDoubleArrowDown = OIconDoubleArrowDown;
exports2.OIconDoubleArrowLeft = OIconDoubleArrowLeft;
exports2.OIconDoubleArrowRight = OIconDoubleArrowRight;
exports2.OIconDoubleArrowUp = OIconDoubleArrowUp;
exports2.OIconEdit = OIconEdit;
exports2.OIconEllipsis = OIconEllipsis;
exports2.OIconEye = OIconEye;
exports2.OIconEyeOff = OIconEyeOff;
exports2.OIconFile = OIconFile;
exports2.OIconFilter = OIconFilter;
exports2.OIconImageError = OIconImageError;
exports2.OIconInfo = OIconInfo;
exports2.OIconKunpeng = OIconKunpeng;
exports2.OIconLink = OIconLink;
exports2.OIconLoading = OIconLoading;
exports2.OIconMinus = OIconMinus;
exports2.OIconRefresh = OIconRefresh;
exports2.OIconSearch = OIconSearch;
exports2.OIconSkill = OIconSkill;
exports2.OIconStar = OIconStar;
exports2.OIconSuccess = OIconSuccess;
exports2.OIconTime = OIconTime;
exports2.OIconVideoPlay = OIconVideoPlay;
exports2.OIconWarning = OIconWarning;
exports2.OInput = OInput;
exports2.OInputNumber = OInputNumber;
exports2.OIntersectionObserver = intersectionObserver;
exports2.OLayer = OLayer;
exports2.OLink = OLink;
exports2.OLoading = OLoading;
exports2.OMenu = OMenu;
exports2.OMenuItem = _sfc_main$q;
exports2.OMessage = OMessage;
exports2.OOption = OOption;
exports2.OOptionGroup = _sfc_main$P;
exports2.OOptionList = _sfc_main$Q;
exports2.OPagination = OPagination;
exports2.OPopover = OPopover;
exports2.OPopup = OPopup;
exports2.OProgress = OProgress;
exports2.ORadio = ORadio;
exports2.ORadioGroup = ORadioGroup;
exports2.ORate = ORate;
exports2.OResizeObserver = OResizeObserver;
exports2.OResult = OResult;
exports2.ORow = ORow;
exports2.OScrollbar = _sfc_main$V;
exports2.OScroller = OScroller;
exports2.OSelect = OSelect;
exports2.OSkeleton = OSkeleton;
exports2.OSkeletonAvatar = _sfc_main$d;
exports2.OSkeletonFigure = OSkeletonFigure;
exports2.OSkeletonText = _sfc_main$f;
exports2.OSubMenu = _sfc_main$r;
exports2.OSwitch = OSwitch;
exports2.OTab = OTab;
exports2.OTabPane = _sfc_main$9;
exports2.OTable = OTable;
exports2.OTag = OTag;
exports2.OTextarea = OTextarea;
exports2.OToggle = OToggle;
exports2.OUpload = OUpload;
exports2.OVirtualList = OVirtualList;
exports2.OptionWidthModeTypes = OptionWidthModeTypes;
exports2.PaginationLayoutTypes = PaginationLayoutTypes;
exports2.PaginationVariantTypes = PaginationVariantTypes;
exports2.PopupPositionTypes = PopupPositionTypes;
exports2.PopupTriggerTypes = PopupTriggerTypes;
exports2.PositionTypes = PositionTypes;
exports2.ProgressColorTypes = ProgressColorTypes;
exports2.ProgressSizeTypes = ProgressSizeTypes;
exports2.ProgressVariantTypes = ProgressVariantTypes;
exports2.RateItemStatusTypes = RateItemStatusTypes;
exports2.RateSizeTypes = RateSizeTypes;
exports2.ResultStatusTypes = ResultStatusTypes;
exports2.ScrollerSizeTypes = ScrollerSizeTypes;
exports2.SizeTypes = SizeTypes;
exports2.SkeletonAvatarSizeTypes = SkeletonAvatarSizeTypes;
exports2.SwitchSizeTypes = SwitchSizeTypes;
exports2.TabVariantTypes = TabVariantTypes;
exports2.TableBorderTypes = TableBorderTypes;
exports2.TagColorTypes = TagColorTypes;
exports2.TagSizeTypes = TagSizeTypes;
exports2.TagVariantTypes = TagVariantTypes;
exports2.UploadFileStatusTypes = UploadFileStatusTypes;
exports2.UploadListTypes = UploadListTypes;
exports2.VariantTypes = VariantTypes;
exports2.addLocale = addLocale;
exports2.anchorItemProps = anchorItemProps;
exports2.anchorProps = anchorProps;
exports2.asyncSome = asyncSome;
exports2.badgeProps = badgeProps;
exports2.baseScrollarProps = baseScrollarProps;
exports2.breadcrumbItemProps = breadcrumbItemProps;
exports2.breadcrumbProps = breadcrumbProps;
exports2.buttonProps = buttonProps;
exports2.buttonToggleProps = buttonToggleProps;
exports2.cardProps = cardProps;
exports2.carouselProps = carouselProps;
exports2.cascaderPanelProps = cascaderPanelProps;
exports2.cascaderProps = cascaderProps;
exports2.checkboxGroupProps = checkboxGroupProps;
exports2.checkboxProps = checkboxProps;
exports2.chunk = chunk;
exports2.colProps = colProps;
exports2.collapseItemProps = collapseItemProps;
exports2.collapseProps = collapseProps;
exports2.configProviderInjectKey = configProviderInjectKey;
exports2.configProviderProps = configProviderProps;
exports2.debounce = debounce;
exports2.debounceRAF = debounceRAF;
exports2.dialogProps = dialogProps;
exports2.dividerProps = dividerProps;
exports2.dropdownItemProps = dropdownItemProps;
exports2.dropdownProps = dropdownProps;
exports2.figureProps = figureProps;
exports2.formInjectKey = formInjectKey;
exports2.formItemInjectKey = formItemInjectKey;
exports2.formItemProps = formItemProps;
exports2.formProps = formProps;
exports2.formateToString = formateToString;
exports2.getUId = getUId;
exports2.getValueByPath = getValueByPath;
exports2.iconProps = iconProps;
exports2.idlePerformTask = idlePerformTask;
exports2.initIconAdd = initIconAdd;
exports2.initIconChevronDown = initIconChevronDown;
exports2.initIconChevronLeft = initIconChevronLeft;
exports2.initIconChevronRight = initIconChevronRight;
exports2.initIconChevronUp = initIconChevronUp;
exports2.initIconClose = initIconClose;
exports2.initIconDone = initIconDone;
exports2.initIconEllipsis = initIconEllipsis;
exports2.initIconLinkArrow = initIconLinkArrow;
exports2.initIconLinkPrefix = initIconLinkPrefix;
exports2.initIconLoading = initIconLoading;
exports2.initIconMinus = initIconMinus;
exports2.initIconStar = initIconStar;
exports2.initIconVideoPlay = initIconVideoPlay;
exports2.initMediaPoint = initMediaPoint;
exports2.initPrestColor = initPrestColor;
exports2.initRound = initRound;
exports2.initSize = initSize;
exports2.initZIndex = initZIndex;
exports2.inputNumberProps = inputNumberProps;
exports2.inputProps = inputProps;
exports2.isArray = isArray;
exports2.isArrayEqual = isArrayEqual;
exports2.isBoolean = isBoolean;
exports2.isClient = isClient;
exports2.isCurrentPageLink = isCurrentPageLink;
exports2.isEmptyArray = isEmptyArray;
exports2.isEmptyObject = isEmptyObject;
exports2.isFunction = isFunction;
exports2.isNull = isNull;
exports2.isNumber = isNumber;
exports2.isObject = isObject;
exports2.isPlainObject = isPlainObject;
exports2.isPromise = isPromise;
exports2.isString = isString;
exports2.isTouchDevice = isTouchDevice;
exports2.isUndefined = isUndefined;
exports2.isValidDate = isValidDate;
exports2.isWindow = isWindow;
exports2.layerProps = layerProps;
exports2.linkProps = linkProps;
exports2.loadingProps = loadingProps;
exports2.menuInjectKey = menuInjectKey;
exports2.menuItemProps = menuItemProps;
exports2.menuProps = menuProps;
exports2.messageListProps = messageListProps;
exports2.messageProps = messageProps;
exports2.moveToFirst = moveToFirst;
exports2.optionProps = optionProps;
exports2.paginationProps = paginationProps;
exports2.performTask = performTask;
exports2.pick = pick;
exports2.popoverProps = popoverProps;
exports2.popupProps = popupProps;
exports2.progressProps = progressProps;
exports2.radioGroupProps = radioGroupProps;
exports2.radioProps = radioProps;
exports2.rateItemProps = rateItemProps;
exports2.rateProps = rateProps;
exports2.requestImage = requestImage;
exports2.resultProps = resultProps;
exports2.rowProps = rowProps;
exports2.scrollbarProps = scrollbarProps;
exports2.scrollerProps = scrollerProps;
exports2.selectProps = selectProps;
exports2.setVLoadingOption = setVLoadingOption;
exports2.setValueByPath = setValueByPath;
exports2.skeletonAvatarProps = skeletonAvatarProps;
exports2.skeletonFigureProps = skeletonFigureProps;
exports2.skeletonProps = skeletonProps;
exports2.skeletonTextProps = skeletonTextProps;
exports2.subMenuInjectKey = subMenuInjectKey;
exports2.subMenuProps = subMenuProps;
exports2.switchProps = switchProps;
exports2.tabPaneProps = tabPaneProps;
exports2.tabProps = tabProps;
exports2.tableProps = tableProps;
exports2.tagProps = tagProps;
exports2.textareaProps = textareaProps;
exports2.throttleRAF = throttleRAF;
exports2.uniqueId = uniqueId;
exports2.uploadProps = uploadProps;
exports2.useElementDirective = useElementDirective;
exports2.useI18n = useI18n;
exports2.useIntersectionObserver = useIntersectionObserver;
exports2.useIntersectionObserverDirective = useIntersectionObserverDirective;
exports2.useLoading = useLoading;
exports2.useLocale = useLocale;
exports2.useMessage = useMessage;
exports2.useReiszeObserverDirective = useReiszeObserverDirective;
exports2.useResizeObserver = useResizeObserver;
exports2.useScreen = useScreen;
exports2.useScrollbar = useScrollbar;
exports2.useTheme = useTheme;
exports2.vFocus = vFocus;
exports2.vIntersection = vIntersection;
exports2.vLoading = vLoading;
exports2.vOnResize = vOnResize;
exports2.vOutClick = vOutClick;
exports2.vScrollbar = vScrollbar;
exports2.vUid = vUid;
exports2.virtualListProps = virtualListProps;
Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
});
//# sourceMappingURL=opendesign.js.map