@arco-design/web-vue
Version:
Arco Design Vue 2.0: A Vue.js 3 UI Library
1,529 lines • 1.74 MB
JavaScript
(function(global2, factory) {
typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory(require("vue")) : typeof define === "function" && define.amd ? define(["vue"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, global2.ArcoVue = factory(global2.Vue));
})(this, function(vue) {
"use strict";
const opt$1 = Object.prototype.toString;
function isArray$1(obj) {
return opt$1.call(obj) === "[object Array]";
}
function isNull(obj) {
return opt$1.call(obj) === "[object Null]";
}
function isBoolean$1(obj) {
return opt$1.call(obj) === "[object Boolean]";
}
function isObject$1(obj) {
return opt$1.call(obj) === "[object Object]";
}
const isPromise = (obj) => {
return opt$1.call(obj) === "[object Promise]";
};
function isString$1(obj) {
return opt$1.call(obj) === "[object String]";
}
function isNumber$1(obj) {
return opt$1.call(obj) === "[object Number]" && obj === obj;
}
function isUndefined(obj) {
return obj === void 0;
}
function isFunction$1(obj) {
return typeof obj === "function";
}
function isEmptyObject$1(obj) {
return isObject$1(obj) && Object.keys(obj).length === 0;
}
function isExist(obj) {
return obj || obj === 0;
}
function isWindow(el) {
return el === window;
}
const isComponentInstance = (value) => {
return (value == null ? void 0 : value.$) !== void 0;
};
const isQuarter = (fromat) => {
return /\[Q]Q/.test(fromat);
};
function isDayjs(time) {
return isObject$1(time) && "$y" in time && "$M" in time && "$D" in time && "$d" in time && "$H" in time && "$m" in time && "$s" in time;
}
const configProviderInjectionKey = Symbol("ArcoConfigProvider");
const calendarLang = {
formatYear: "YYYY \u5E74",
formatMonth: "YYYY \u5E74 MM \u6708",
today: "\u4ECA\u5929",
view: {
month: "\u6708",
year: "\u5E74",
week: "\u5468",
day: "\u65E5"
},
month: {
long: {
January: "\u4E00\u6708",
February: "\u4E8C\u6708",
March: "\u4E09\u6708",
April: "\u56DB\u6708",
May: "\u4E94\u6708",
June: "\u516D\u6708",
July: "\u4E03\u6708",
August: "\u516B\u6708",
September: "\u4E5D\u6708",
October: "\u5341\u6708",
November: "\u5341\u4E00\u6708",
December: "\u5341\u4E8C\u6708"
},
short: {
January: "\u4E00\u6708",
February: "\u4E8C\u6708",
March: "\u4E09\u6708",
April: "\u56DB\u6708",
May: "\u4E94\u6708",
June: "\u516D\u6708",
July: "\u4E03\u6708",
August: "\u516B\u6708",
September: "\u4E5D\u6708",
October: "\u5341\u6708",
November: "\u5341\u4E00\u6708",
December: "\u5341\u4E8C\u6708"
}
},
week: {
long: {
self: "\u5468",
monday: "\u5468\u4E00",
tuesday: "\u5468\u4E8C",
wednesday: "\u5468\u4E09",
thursday: "\u5468\u56DB",
friday: "\u5468\u4E94",
saturday: "\u5468\u516D",
sunday: "\u5468\u65E5"
},
short: {
self: "\u5468",
monday: "\u4E00",
tuesday: "\u4E8C",
wednesday: "\u4E09",
thursday: "\u56DB",
friday: "\u4E94",
saturday: "\u516D",
sunday: "\u65E5"
}
}
};
const lang = {
locale: "zh-CN",
empty: {
description: "\u6682\u65E0\u6570\u636E"
},
drawer: {
okText: "\u786E\u5B9A",
cancelText: "\u53D6\u6D88"
},
popconfirm: {
okText: "\u786E\u5B9A",
cancelText: "\u53D6\u6D88"
},
modal: {
okText: "\u786E\u5B9A",
cancelText: "\u53D6\u6D88"
},
pagination: {
goto: "\u524D\u5F80",
page: "\u9875",
countPerPage: "\u6761/\u9875",
total: "\u5171 {0} \u6761"
},
table: {
okText: "\u786E\u5B9A",
resetText: "\u91CD\u7F6E"
},
upload: {
start: "\u5F00\u59CB",
cancel: "\u53D6\u6D88",
delete: "\u5220\u9664",
retry: "\u70B9\u51FB\u91CD\u8BD5",
buttonText: "\u70B9\u51FB\u4E0A\u4F20",
preview: "\u9884\u89C8",
drag: "\u70B9\u51FB\u6216\u62D6\u62FD\u6587\u4EF6\u5230\u6B64\u5904\u4E0A\u4F20",
dragHover: "\u91CA\u653E\u6587\u4EF6\u5E76\u5F00\u59CB\u4E0A\u4F20",
error: "\u4E0A\u4F20\u5931\u8D25"
},
calendar: calendarLang,
datePicker: {
view: calendarLang.view,
month: calendarLang.month,
week: calendarLang.week,
placeholder: {
date: "\u8BF7\u9009\u62E9\u65E5\u671F",
week: "\u8BF7\u9009\u62E9\u5468",
month: "\u8BF7\u9009\u62E9\u6708\u4EFD",
year: "\u8BF7\u9009\u62E9\u5E74\u4EFD",
quarter: "\u8BF7\u9009\u62E9\u5B63\u5EA6",
time: "\u8BF7\u9009\u62E9\u65F6\u95F4"
},
rangePlaceholder: {
date: ["\u5F00\u59CB\u65E5\u671F", "\u7ED3\u675F\u65E5\u671F"],
week: ["\u5F00\u59CB\u5468", "\u7ED3\u675F\u5468"],
month: ["\u5F00\u59CB\u6708\u4EFD", "\u7ED3\u675F\u6708\u4EFD"],
year: ["\u5F00\u59CB\u5E74\u4EFD", "\u7ED3\u675F\u5E74\u4EFD"],
quarter: ["\u5F00\u59CB\u5B63\u5EA6", "\u7ED3\u675F\u5B63\u5EA6"],
time: ["\u5F00\u59CB\u65F6\u95F4", "\u7ED3\u675F\u65F6\u95F4"]
},
selectTime: "\u9009\u62E9\u65F6\u95F4",
today: "\u4ECA\u5929",
now: "\u6B64\u523B",
ok: "\u786E\u5B9A"
},
image: {
loading: "\u52A0\u8F7D\u4E2D"
},
imagePreview: {
fullScreen: "\u5168\u5C4F",
rotateRight: "\u5411\u53F3\u65CB\u8F6C",
rotateLeft: "\u5411\u5DE6\u65CB\u8F6C",
zoomIn: "\u653E\u5927",
zoomOut: "\u7F29\u5C0F",
originalSize: "\u539F\u59CB\u5C3A\u5BF8"
},
typography: {
copied: "\u5DF2\u590D\u5236",
copy: "\u590D\u5236",
expand: "\u5C55\u5F00",
collapse: "\u6298\u53E0",
edit: "\u7F16\u8F91"
},
form: {
validateMessages: {
required: "#{field} \u662F\u5FC5\u586B\u9879",
type: {
string: "#{field} \u4E0D\u662F\u5408\u6CD5\u7684\u6587\u672C\u7C7B\u578B",
number: "#{field} \u4E0D\u662F\u5408\u6CD5\u7684\u6570\u5B57\u7C7B\u578B",
boolean: "#{field} \u4E0D\u662F\u5408\u6CD5\u7684\u5E03\u5C14\u7C7B\u578B",
array: "#{field} \u4E0D\u662F\u5408\u6CD5\u7684\u6570\u7EC4\u7C7B\u578B",
object: "#{field} \u4E0D\u662F\u5408\u6CD5\u7684\u5BF9\u8C61\u7C7B\u578B",
url: "#{field} \u4E0D\u662F\u5408\u6CD5\u7684 url \u5730\u5740",
email: "#{field} \u4E0D\u662F\u5408\u6CD5\u7684\u90AE\u7BB1\u5730\u5740",
ip: "#{field} \u4E0D\u662F\u5408\u6CD5\u7684 IP \u5730\u5740"
},
number: {
min: "`#{value}` \u5C0F\u4E8E\u6700\u5C0F\u503C `#{min}`",
max: "`#{value}` \u5927\u4E8E\u6700\u5927\u503C `#{max}`",
equal: "`#{value}` \u4E0D\u7B49\u4E8E `#{equal}`",
range: "`#{value}` \u4E0D\u5728 `#{min} ~ #{max}` \u8303\u56F4\u5185",
positive: "`#{value}` \u4E0D\u662F\u6B63\u6570",
negative: "`#{value}` \u4E0D\u662F\u8D1F\u6570"
},
array: {
length: "`#{field}` \u4E2A\u6570\u4E0D\u7B49\u4E8E #{length}",
minLength: "`#{field}` \u4E2A\u6570\u6700\u5C11\u4E3A #{minLength}",
maxLength: "`#{field}` \u4E2A\u6570\u6700\u591A\u4E3A #{maxLength}",
includes: "#{field} \u4E0D\u5305\u542B #{includes}",
deepEqual: "#{field} \u4E0D\u7B49\u4E8E #{deepEqual}",
empty: "`#{field}` \u4E0D\u662F\u7A7A\u6570\u7EC4"
},
string: {
minLength: "\u5B57\u7B26\u6570\u6700\u5C11\u4E3A #{minLength}",
maxLength: "\u5B57\u7B26\u6570\u6700\u591A\u4E3A #{maxLength}",
length: "\u5B57\u7B26\u6570\u5FC5\u987B\u662F #{length}",
match: "`#{value}` \u4E0D\u7B26\u5408\u6A21\u5F0F #{pattern}",
uppercase: "`#{value}` \u5FC5\u987B\u5168\u5927\u5199",
lowercase: "`#{value}` \u5FC5\u987B\u5168\u5C0F\u5199"
},
object: {
deepEqual: "`#{field}` \u4E0D\u7B49\u4E8E\u671F\u671B\u503C",
hasKeys: "`#{field}` \u4E0D\u5305\u542B\u5FC5\u987B\u5B57\u6BB5",
empty: "`#{field}` \u4E0D\u662F\u5BF9\u8C61"
},
boolean: {
true: "\u671F\u671B\u662F `true`",
false: "\u671F\u671B\u662F `false`"
}
}
},
colorPicker: {
history: "\u6700\u8FD1\u4F7F\u7528\u989C\u8272",
preset: "\u7CFB\u7EDF\u9884\u8BBE\u989C\u8272",
empty: "\u6682\u65E0"
}
};
const LOCALE = vue.ref("zh-CN");
const I18N_MESSAGES = vue.reactive({
"zh-CN": lang
});
const addI18nMessages = (messages, options) => {
for (const key of Object.keys(messages)) {
if (!I18N_MESSAGES[key] || (options == null ? void 0 : options.overwrite)) {
I18N_MESSAGES[key] = messages[key];
}
}
};
const useLocale = (locale) => {
if (!I18N_MESSAGES[locale]) {
console.warn(`use ${locale} failed! Please add ${locale} first`);
return;
}
LOCALE.value = locale;
};
const getLocale = () => {
return LOCALE.value;
};
const useI18n = () => {
const configProvider = vue.inject(configProviderInjectionKey, void 0);
const i18nMessage = vue.computed(
() => {
var _a;
return (_a = configProvider == null ? void 0 : configProvider.locale) != null ? _a : I18N_MESSAGES[LOCALE.value];
}
);
const locale = vue.computed(() => i18nMessage.value.locale);
const transform = (key, ...args) => {
const keyArray = key.split(".");
let temp = i18nMessage.value;
for (const keyItem of keyArray) {
if (!temp[keyItem]) {
return key;
}
temp = temp[keyItem];
}
if (isString$1(temp)) {
if (args.length > 0) {
return temp.replace(/{(\d+)}/g, (sub, index2) => {
var _a;
return (_a = args[index2]) != null ? _a : sub;
});
}
return temp;
}
return temp;
};
return {
i18nMessage,
locale,
t: transform
};
};
const COMPONENT_PREFIX = "A";
const CLASS_PREFIX = "arco";
const GLOBAL_CONFIG_NAME = "$arco";
const getComponentPrefix = (options) => {
var _a;
return (_a = options == null ? void 0 : options.componentPrefix) != null ? _a : COMPONENT_PREFIX;
};
const setGlobalConfig = (app, options) => {
var _a;
if (options && options.classPrefix) {
app.config.globalProperties[GLOBAL_CONFIG_NAME] = {
...(_a = app.config.globalProperties[GLOBAL_CONFIG_NAME]) != null ? _a : {},
classPrefix: options.classPrefix
};
}
};
const getPrefixCls = (componentName) => {
var _a, _b, _c;
const instance = vue.getCurrentInstance();
const configProvider = vue.inject(configProviderInjectionKey, void 0);
const prefix = (_c = (_b = configProvider == null ? void 0 : configProvider.prefixCls) != null ? _b : (_a = instance == null ? void 0 : instance.appContext.config.globalProperties[GLOBAL_CONFIG_NAME]) == null ? void 0 : _a.classPrefix) != null ? _c : CLASS_PREFIX;
if (componentName) {
return `${prefix}-${componentName}`;
}
return prefix;
};
var MapShim = function() {
if (typeof Map !== "undefined") {
return Map;
}
function getIndex(arr, key) {
var result = -1;
arr.some(function(entry, index2) {
if (entry[0] === key) {
result = index2;
return true;
}
return false;
});
return result;
}
return function() {
function class_1() {
this.__entries__ = [];
}
Object.defineProperty(class_1.prototype, "size", {
get: function() {
return this.__entries__.length;
},
enumerable: true,
configurable: true
});
class_1.prototype.get = function(key) {
var index2 = getIndex(this.__entries__, key);
var entry = this.__entries__[index2];
return entry && entry[1];
};
class_1.prototype.set = function(key, value) {
var index2 = getIndex(this.__entries__, key);
if (~index2) {
this.__entries__[index2][1] = value;
} else {
this.__entries__.push([key, value]);
}
};
class_1.prototype.delete = function(key) {
var entries = this.__entries__;
var index2 = getIndex(entries, key);
if (~index2) {
entries.splice(index2, 1);
}
};
class_1.prototype.has = function(key) {
return !!~getIndex(this.__entries__, key);
};
class_1.prototype.clear = function() {
this.__entries__.splice(0);
};
class_1.prototype.forEach = function(callback, ctx) {
if (ctx === void 0) {
ctx = null;
}
for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
var entry = _a[_i];
callback.call(ctx, entry[1], entry[0]);
}
};
return class_1;
}();
}();
var isBrowser = typeof window !== "undefined" && typeof document !== "undefined" && window.document === document;
var global$1 = function() {
if (typeof global !== "undefined" && global.Math === Math) {
return global;
}
if (typeof self !== "undefined" && self.Math === Math) {
return self;
}
if (typeof window !== "undefined" && window.Math === Math) {
return window;
}
return Function("return this")();
}();
var requestAnimationFrame$1 = function() {
if (typeof requestAnimationFrame === "function") {
return requestAnimationFrame.bind(global$1);
}
return function(callback) {
return setTimeout(function() {
return callback(Date.now());
}, 1e3 / 60);
};
}();
var trailingTimeout = 2;
function throttle(callback, delay) {
var leadingCall = false, trailingCall = false, lastCallTime = 0;
function resolvePending() {
if (leadingCall) {
leadingCall = false;
callback();
}
if (trailingCall) {
proxy();
}
}
function timeoutCallback() {
requestAnimationFrame$1(resolvePending);
}
function proxy() {
var timeStamp = Date.now();
if (leadingCall) {
if (timeStamp - lastCallTime < trailingTimeout) {
return;
}
trailingCall = true;
} else {
leadingCall = true;
trailingCall = false;
setTimeout(timeoutCallback, delay);
}
lastCallTime = timeStamp;
}
return proxy;
}
var REFRESH_DELAY = 20;
var transitionKeys = ["top", "right", "bottom", "left", "width", "height", "size", "weight"];
var mutationObserverSupported = typeof MutationObserver !== "undefined";
var ResizeObserverController = function() {
function ResizeObserverController2() {
this.connected_ = false;
this.mutationEventsAdded_ = false;
this.mutationsObserver_ = null;
this.observers_ = [];
this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);
}
ResizeObserverController2.prototype.addObserver = function(observer) {
if (!~this.observers_.indexOf(observer)) {
this.observers_.push(observer);
}
if (!this.connected_) {
this.connect_();
}
};
ResizeObserverController2.prototype.removeObserver = function(observer) {
var observers2 = this.observers_;
var index2 = observers2.indexOf(observer);
if (~index2) {
observers2.splice(index2, 1);
}
if (!observers2.length && this.connected_) {
this.disconnect_();
}
};
ResizeObserverController2.prototype.refresh = function() {
var changesDetected = this.updateObservers_();
if (changesDetected) {
this.refresh();
}
};
ResizeObserverController2.prototype.updateObservers_ = function() {
var activeObservers = this.observers_.filter(function(observer) {
return observer.gatherActive(), observer.hasActive();
});
activeObservers.forEach(function(observer) {
return observer.broadcastActive();
});
return activeObservers.length > 0;
};
ResizeObserverController2.prototype.connect_ = function() {
if (!isBrowser || this.connected_) {
return;
}
document.addEventListener("transitionend", this.onTransitionEnd_);
window.addEventListener("resize", this.refresh);
if (mutationObserverSupported) {
this.mutationsObserver_ = new MutationObserver(this.refresh);
this.mutationsObserver_.observe(document, {
attributes: true,
childList: true,
characterData: true,
subtree: true
});
} else {
document.addEventListener("DOMSubtreeModified", this.refresh);
this.mutationEventsAdded_ = true;
}
this.connected_ = true;
};
ResizeObserverController2.prototype.disconnect_ = function() {
if (!isBrowser || !this.connected_) {
return;
}
document.removeEventListener("transitionend", this.onTransitionEnd_);
window.removeEventListener("resize", this.refresh);
if (this.mutationsObserver_) {
this.mutationsObserver_.disconnect();
}
if (this.mutationEventsAdded_) {
document.removeEventListener("DOMSubtreeModified", this.refresh);
}
this.mutationsObserver_ = null;
this.mutationEventsAdded_ = false;
this.connected_ = false;
};
ResizeObserverController2.prototype.onTransitionEnd_ = function(_a) {
var _b = _a.propertyName, propertyName = _b === void 0 ? "" : _b;
var isReflowProperty = transitionKeys.some(function(key) {
return !!~propertyName.indexOf(key);
});
if (isReflowProperty) {
this.refresh();
}
};
ResizeObserverController2.getInstance = function() {
if (!this.instance_) {
this.instance_ = new ResizeObserverController2();
}
return this.instance_;
};
ResizeObserverController2.instance_ = null;
return ResizeObserverController2;
}();
var defineConfigurable = function(target2, props) {
for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {
var key = _a[_i];
Object.defineProperty(target2, key, {
value: props[key],
enumerable: false,
writable: false,
configurable: true
});
}
return target2;
};
var getWindowOf = function(target2) {
var ownerGlobal = target2 && target2.ownerDocument && target2.ownerDocument.defaultView;
return ownerGlobal || global$1;
};
var emptyRect = createRectInit(0, 0, 0, 0);
function toFloat(value) {
return parseFloat(value) || 0;
}
function getBordersSize(styles) {
var positions = [];
for (var _i = 1; _i < arguments.length; _i++) {
positions[_i - 1] = arguments[_i];
}
return positions.reduce(function(size, position) {
var value = styles["border-" + position + "-width"];
return size + toFloat(value);
}, 0);
}
function getPaddings(styles) {
var positions = ["top", "right", "bottom", "left"];
var paddings = {};
for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
var position = positions_1[_i];
var value = styles["padding-" + position];
paddings[position] = toFloat(value);
}
return paddings;
}
function getSVGContentRect(target2) {
var bbox = target2.getBBox();
return createRectInit(0, 0, bbox.width, bbox.height);
}
function getHTMLElementContentRect(target2) {
var clientWidth = target2.clientWidth, clientHeight = target2.clientHeight;
if (!clientWidth && !clientHeight) {
return emptyRect;
}
var styles = getWindowOf(target2).getComputedStyle(target2);
var paddings = getPaddings(styles);
var horizPad = paddings.left + paddings.right;
var vertPad = paddings.top + paddings.bottom;
var width = toFloat(styles.width), height = toFloat(styles.height);
if (styles.boxSizing === "border-box") {
if (Math.round(width + horizPad) !== clientWidth) {
width -= getBordersSize(styles, "left", "right") + horizPad;
}
if (Math.round(height + vertPad) !== clientHeight) {
height -= getBordersSize(styles, "top", "bottom") + vertPad;
}
}
if (!isDocumentElement(target2)) {
var vertScrollbar = Math.round(width + horizPad) - clientWidth;
var horizScrollbar = Math.round(height + vertPad) - clientHeight;
if (Math.abs(vertScrollbar) !== 1) {
width -= vertScrollbar;
}
if (Math.abs(horizScrollbar) !== 1) {
height -= horizScrollbar;
}
}
return createRectInit(paddings.left, paddings.top, width, height);
}
var isSVGGraphicsElement = function() {
if (typeof SVGGraphicsElement !== "undefined") {
return function(target2) {
return target2 instanceof getWindowOf(target2).SVGGraphicsElement;
};
}
return function(target2) {
return target2 instanceof getWindowOf(target2).SVGElement && typeof target2.getBBox === "function";
};
}();
function isDocumentElement(target2) {
return target2 === getWindowOf(target2).document.documentElement;
}
function getContentRect(target2) {
if (!isBrowser) {
return emptyRect;
}
if (isSVGGraphicsElement(target2)) {
return getSVGContentRect(target2);
}
return getHTMLElementContentRect(target2);
}
function createReadOnlyRect(_a) {
var x = _a.x, y = _a.y, width = _a.width, height = _a.height;
var Constr = typeof DOMRectReadOnly !== "undefined" ? DOMRectReadOnly : Object;
var rect = Object.create(Constr.prototype);
defineConfigurable(rect, {
x,
y,
width,
height,
top: y,
right: x + width,
bottom: height + y,
left: x
});
return rect;
}
function createRectInit(x, y, width, height) {
return { x, y, width, height };
}
var ResizeObservation = function() {
function ResizeObservation2(target2) {
this.broadcastWidth = 0;
this.broadcastHeight = 0;
this.contentRect_ = createRectInit(0, 0, 0, 0);
this.target = target2;
}
ResizeObservation2.prototype.isActive = function() {
var rect = getContentRect(this.target);
this.contentRect_ = rect;
return rect.width !== this.broadcastWidth || rect.height !== this.broadcastHeight;
};
ResizeObservation2.prototype.broadcastRect = function() {
var rect = this.contentRect_;
this.broadcastWidth = rect.width;
this.broadcastHeight = rect.height;
return rect;
};
return ResizeObservation2;
}();
var ResizeObserverEntry = function() {
function ResizeObserverEntry2(target2, rectInit) {
var contentRect = createReadOnlyRect(rectInit);
defineConfigurable(this, { target: target2, contentRect });
}
return ResizeObserverEntry2;
}();
var ResizeObserverSPI = function() {
function ResizeObserverSPI2(callback, controller, callbackCtx) {
this.activeObservations_ = [];
this.observations_ = new MapShim();
if (typeof callback !== "function") {
throw new TypeError("The callback provided as parameter 1 is not a function.");
}
this.callback_ = callback;
this.controller_ = controller;
this.callbackCtx_ = callbackCtx;
}
ResizeObserverSPI2.prototype.observe = function(target2) {
if (!arguments.length) {
throw new TypeError("1 argument required, but only 0 present.");
}
if (typeof Element === "undefined" || !(Element instanceof Object)) {
return;
}
if (!(target2 instanceof getWindowOf(target2).Element)) {
throw new TypeError('parameter 1 is not of type "Element".');
}
var observations = this.observations_;
if (observations.has(target2)) {
return;
}
observations.set(target2, new ResizeObservation(target2));
this.controller_.addObserver(this);
this.controller_.refresh();
};
ResizeObserverSPI2.prototype.unobserve = function(target2) {
if (!arguments.length) {
throw new TypeError("1 argument required, but only 0 present.");
}
if (typeof Element === "undefined" || !(Element instanceof Object)) {
return;
}
if (!(target2 instanceof getWindowOf(target2).Element)) {
throw new TypeError('parameter 1 is not of type "Element".');
}
var observations = this.observations_;
if (!observations.has(target2)) {
return;
}
observations.delete(target2);
if (!observations.size) {
this.controller_.removeObserver(this);
}
};
ResizeObserverSPI2.prototype.disconnect = function() {
this.clearActive();
this.observations_.clear();
this.controller_.removeObserver(this);
};
ResizeObserverSPI2.prototype.gatherActive = function() {
var _this = this;
this.clearActive();
this.observations_.forEach(function(observation) {
if (observation.isActive()) {
_this.activeObservations_.push(observation);
}
});
};
ResizeObserverSPI2.prototype.broadcastActive = function() {
if (!this.hasActive()) {
return;
}
var ctx = this.callbackCtx_;
var entries = this.activeObservations_.map(function(observation) {
return new ResizeObserverEntry(observation.target, observation.broadcastRect());
});
this.callback_.call(ctx, entries, ctx);
this.clearActive();
};
ResizeObserverSPI2.prototype.clearActive = function() {
this.activeObservations_.splice(0);
};
ResizeObserverSPI2.prototype.hasActive = function() {
return this.activeObservations_.length > 0;
};
return ResizeObserverSPI2;
}();
var observers = typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : new MapShim();
var ResizeObserver$2 = function() {
function ResizeObserver2(callback) {
if (!(this instanceof ResizeObserver2)) {
throw new TypeError("Cannot call a class as a function.");
}
if (!arguments.length) {
throw new TypeError("1 argument required, but only 0 present.");
}
var controller = ResizeObserverController.getInstance();
var observer = new ResizeObserverSPI(callback, controller, this);
observers.set(this, observer);
}
return ResizeObserver2;
}();
[
"observe",
"unobserve",
"disconnect"
].forEach(function(method) {
ResizeObserver$2.prototype[method] = function() {
var _a;
return (_a = observers.get(this))[method].apply(_a, arguments);
};
});
var index$1 = function() {
if (typeof global$1.ResizeObserver !== "undefined") {
return global$1.ResizeObserver;
}
return ResizeObserver$2;
}();
const toKebabCase = (string) => {
return string.replace(/\B([A-Z])/g, "-$1").toLowerCase();
};
const isElement = (vn) => {
return Boolean(vn && vn.shapeFlag & 1);
};
const isComponent = (vn, type) => {
return Boolean(vn && vn.shapeFlag & 6);
};
const isTextChildren = (child, children) => {
return Boolean(child && child.shapeFlag & 8);
};
const isArrayChildren = (vn, children) => {
return Boolean(vn && vn.shapeFlag & 16);
};
const isSlotsChildren = (vn, children) => {
return Boolean(vn && vn.shapeFlag & 32);
};
const getFirstComponent = (children) => {
var _a, _b;
if (!children) {
return void 0;
}
for (const child of children) {
if (isElement(child) || isComponent(child)) {
return child;
}
if (isArrayChildren(child, child.children)) {
const result = getFirstComponent(child.children);
if (result)
return result;
} else if (isSlotsChildren(child, child.children)) {
const children2 = (_b = (_a = child.children).default) == null ? void 0 : _b.call(_a);
if (children2) {
const result = getFirstComponent(children2);
if (result)
return result;
}
} else if (isArray$1(child)) {
const result = getFirstComponent(child);
if (result)
return result;
}
}
return void 0;
};
const isEmptyChildren = (children) => {
if (!children) {
return true;
}
for (const item of children) {
if (item.children) {
return false;
}
}
return true;
};
const mergeFirstChild = (children, extraProps) => {
if (children && children.length > 0) {
for (let i2 = 0; i2 < children.length; i2++) {
const child = children[i2];
if (isElement(child) || isComponent(child)) {
const props = isFunction$1(extraProps) ? extraProps(child) : extraProps;
children[i2] = vue.cloneVNode(child, props, true);
return true;
}
const _children = getChildrenArray(child);
if (_children && _children.length > 0) {
const result = mergeFirstChild(_children, extraProps);
if (result)
return true;
}
}
}
return false;
};
const getChildrenArray = (vn) => {
if (isArrayChildren(vn, vn.children)) {
return vn.children;
}
if (isArray$1(vn)) {
return vn;
}
return void 0;
};
const getFirstElementFromVNode = (vn) => {
var _a, _b;
if (isElement(vn)) {
return vn.el;
}
if (isComponent(vn)) {
if (((_a = vn.el) == null ? void 0 : _a.nodeType) === 1) {
return vn.el;
}
if ((_b = vn.component) == null ? void 0 : _b.subTree) {
const ele = getFirstElementFromVNode(vn.component.subTree);
if (ele)
return ele;
}
} else {
const children = getChildrenArray(vn);
return getFirstElementFromChildren(children);
}
return void 0;
};
const getFirstElementFromChildren = (children) => {
if (children && children.length > 0) {
for (const child of children) {
const element = getFirstElementFromVNode(child);
if (element)
return element;
}
}
return void 0;
};
const getAllElements = (children, includeText = false) => {
var _a, _b;
const results = [];
for (const item of children != null ? children : []) {
if (isElement(item) || isComponent(item) || includeText && isTextChildren(item, item.children)) {
results.push(item);
} else if (isArrayChildren(item, item.children)) {
results.push(...getAllElements(item.children, includeText));
} else if (isSlotsChildren(item, item.children)) {
results.push(...getAllElements((_b = (_a = item.children).default) == null ? void 0 : _b.call(_a), includeText));
} else if (isArray$1(item)) {
results.push(...getAllElements(item, includeText));
}
}
return results;
};
function unFragment(nodeList) {
function loop(nodes) {
const unFragmentNodeList = [];
nodes.forEach((node) => {
var _a, _b;
if (vue.isVNode(node) && node.type === vue.Fragment) {
if (isSlotsChildren(node, node.children)) {
unFragmentNodeList.push(...loop(((_b = (_a = node.children).default) == null ? void 0 : _b.call(_a)) || []));
} else if (isArrayChildren(node, node.children)) {
unFragmentNodeList.push(...loop(node.children));
} else if (isString$1(node.children)) {
unFragmentNodeList.push(node.children);
}
} else {
unFragmentNodeList.push(node);
}
});
return unFragmentNodeList;
}
return loop(nodeList);
}
const getSlotFunction = (param) => {
if (param) {
if (isFunction$1(param))
return param;
return () => param;
}
return void 0;
};
const getComponentsFromVNode = (vn, name) => {
var _a;
const components2 = [];
if (isComponent(vn, vn.type)) {
if (vn.type.name === name) {
if (vn.component) {
components2.push(vn.component.uid);
}
} else if ((_a = vn.component) == null ? void 0 : _a.subTree) {
components2.push(...getComponentsFromVNode(vn.component.subTree, name));
}
} else {
const children = getChildrenArray(vn);
if (children) {
components2.push(...getComponentsFromChildren(children, name));
}
}
return components2;
};
const getComponentsFromChildren = (children, name) => {
const components2 = [];
if (children && children.length > 0) {
for (const child of children) {
components2.push(...getComponentsFromVNode(child, name));
}
}
return components2;
};
var ResizeObserver$1 = vue.defineComponent({
name: "ResizeObserver",
emits: [
"resize"
],
setup(props, {
emit,
slots
}) {
let resizeObserver;
const componentRef = vue.ref();
const element = vue.computed(() => isComponentInstance(componentRef.value) ? componentRef.value.$el : componentRef.value);
const createResizeObserver = (target2) => {
if (!target2)
return;
resizeObserver = new index$1((entries) => {
const entry = entries[0];
emit("resize", entry);
});
resizeObserver.observe(target2);
};
const destroyResizeObserver = () => {
if (resizeObserver) {
resizeObserver.disconnect();
resizeObserver = null;
}
};
vue.watch(element, (_element) => {
if (resizeObserver)
destroyResizeObserver();
if (_element)
createResizeObserver(_element);
});
vue.onMounted(() => {
if (element.value) {
createResizeObserver(element.value);
}
});
vue.onUnmounted(() => {
destroyResizeObserver();
});
return () => {
var _a, _b;
const firstChild = getFirstComponent((_b = (_a = slots.default) == null ? void 0 : _a.call(slots)) != null ? _b : []);
if (firstChild) {
return vue.cloneVNode(firstChild, {
ref: componentRef
}, true);
}
return null;
};
}
});
const target$1 = typeof window === "undefined" ? global : window;
const raf = target$1.requestAnimationFrame;
const caf = target$1.cancelAnimationFrame;
function throttleByRaf(cb) {
let timer = 0;
const throttle2 = (...args) => {
if (timer) {
caf(timer);
}
timer = raf(() => {
cb(...args);
timer = 0;
});
};
throttle2.cancel = () => {
caf(timer);
timer = 0;
};
return throttle2;
}
const NOOP = () => {
return void 0;
};
const getDocumentSize = () => {
const { body } = document;
const html = document.documentElement;
let topBody;
try {
const topWindow = window.top || window.self || window;
topBody = topWindow.document.body;
} catch {
}
return {
height: Math.max(
body.scrollHeight,
body.offsetHeight,
html.clientHeight,
html.scrollHeight,
html.offsetHeight,
(topBody == null ? void 0 : topBody.scrollHeight) || 0,
(topBody == null ? void 0 : topBody.clientHeight) || 0
),
width: Math.max(
body.scrollWidth,
body.offsetWidth,
html.clientWidth,
html.scrollWidth,
html.offsetWidth,
(topBody == null ? void 0 : topBody.scrollWidth) || 0,
(topBody == null ? void 0 : topBody.clientWidth) || 0
)
};
};
const isServerRendering = (() => {
try {
return !(typeof window !== "undefined" && document !== void 0);
} catch (e2) {
return true;
}
})();
const on = (() => {
if (isServerRendering) {
return NOOP;
}
return (element, event, handler, options = false) => {
element.addEventListener(
event,
handler,
options
);
};
})();
const off = (() => {
if (isServerRendering) {
return NOOP;
}
return (element, type, handler, options = false) => {
element.removeEventListener(
type,
handler,
options
);
};
})();
const contains = (root, ele) => {
if (!root || !ele) {
return false;
}
let node = ele;
while (node) {
if (node === root) {
return true;
}
node = node.parentNode;
}
return false;
};
const getOverlay = (type) => {
const popper = document.createElement("div");
popper.setAttribute("class", `arco-overlay arco-overlay-${type}`);
return popper;
};
const querySelector = (selectors, container2) => {
var _a;
if (isServerRendering) {
return NOOP();
}
return (_a = (container2 != null ? container2 : document).querySelector(selectors)) != null ? _a : void 0;
};
const getElement = (target2, container2) => {
if (isString$1(target2)) {
const selector = target2[0] === "#" ? `[id='${target2.slice(1)}']` : target2;
return querySelector(selector, container2);
}
return target2;
};
const getRelativeRect = (target2, relative) => {
const targetRect = target2.getBoundingClientRect();
const relativeRect = relative.getBoundingClientRect();
return {
top: targetRect.top - relativeRect.top,
bottom: relativeRect.bottom - targetRect.bottom,
left: targetRect.left - relativeRect.left,
right: relativeRect.right - targetRect.right,
width: targetRect.width,
height: targetRect.height
};
};
const isScroll = (element) => {
return element.tagName === "BODY" ? document.documentElement.scrollHeight > window.innerHeight : element.scrollHeight > element.offsetHeight;
};
const getScrollBarWidth = (element) => {
return element.tagName === "BODY" ? window.innerWidth - getDocumentSize().width : element.offsetWidth - element.clientWidth;
};
var _export_sfc = (sfc, props) => {
const target2 = sfc.__vccOpts || sfc;
for (const [key, val] of props) {
target2[key] = val;
}
return target2;
};
function getTargetRect(target2) {
return isWindow(target2) ? {
top: 0,
bottom: window.innerHeight
} : target2.getBoundingClientRect();
}
const _sfc_main$30 = vue.defineComponent({
name: "Affix",
components: {
ResizeObserver: ResizeObserver$1
},
props: {
offsetTop: {
type: Number,
default: 0
},
offsetBottom: {
type: Number
},
target: {
type: [String, Object, Function]
},
targetContainer: {
type: [String, Object, Function]
}
},
emits: {
change: (fixed) => true
},
setup(props, { emit }) {
const prefixCls = getPrefixCls("affix");
const { target: target2, targetContainer } = vue.toRefs(props);
const wrapperRef = vue.ref();
const targetRef = vue.ref();
const isFixed = vue.ref(false);
const placeholderStyles = vue.ref({});
const fixedStyles = vue.ref({});
const classNames = vue.computed(() => ({ [prefixCls]: isFixed.value }));
const updatePositionThrottle = throttleByRaf(() => {
if (!wrapperRef.value || !targetRef.value)
return;
const { offsetTop, offsetBottom } = props;
const offsetType = isUndefined(offsetBottom) ? "top" : "bottom";
const wrapperRect = wrapperRef.value.getBoundingClientRect();
const targetRect = getTargetRect(targetRef.value);
let newIsFixed = false;
let newFixedStyles = {};
const newPlaceholderStyles = {
width: `${wrapperRef.value.offsetWidth}px`,
height: `${wrapperRef.value.offsetHeight}px`
};
if (offsetType === "top") {
newIsFixed = wrapperRect.top - targetRect.top < (offsetTop || 0);
newFixedStyles = newIsFixed ? {
position: "fixed",
top: `${targetRect.top + (offsetTop || 0)}px`
} : {};
} else {
newIsFixed = targetRect.bottom - wrapperRect.bottom < (offsetBottom || 0);
newFixedStyles = newIsFixed ? {
position: "fixed",
bottom: `${window.innerHeight - targetRect.bottom + (offsetBottom || 0)}px`
} : {};
}
if (newIsFixed !== isFixed.value) {
isFixed.value = newIsFixed;
emit("change", newIsFixed);
}
placeholderStyles.value = newPlaceholderStyles;
fixedStyles.value = {
...newFixedStyles,
...newIsFixed ? newPlaceholderStyles : {}
};
});
vue.onMounted(() => {
vue.watchEffect((onInvalidate) => {
const element = target2 && target2.value !== window && getElement(target2.value) || window;
targetRef.value = element;
if (element) {
on(element, "scroll", updatePositionThrottle);
on(element, "resize", updatePositionThrottle);
onInvalidate(() => {
off(element, "scroll", updatePositionThrottle);
off(element, "resize", updatePositionThrottle);
});
}
});
vue.watchEffect((onInvalidate) => {
if (!targetRef.value)
return;
const container2 = targetContainer && targetContainer.value !== window && getElement(targetContainer.value) || window;
if (container2) {
on(container2, "scroll", updatePositionThrottle);
on(container2, "resize", updatePositionThrottle);
onInvalidate(() => {
off(container2, "scroll", updatePositionThrottle);
off(container2, "resize", updatePositionThrottle);
});
}
});
});
return {
wrapperRef,
isFixed,
classNames,
placeholderStyles,
fixedStyles,
updatePositionThrottle
};
},
methods: {
updatePosition() {
this.updatePositionThrottle();
}
}
});
const _hoisted_1$1k = { ref: "wrapperRef" };
function _sfc_render$2$(_ctx, _cache, $props, $setup, $data, $options) {
const _component_ResizeObserver = vue.resolveComponent("ResizeObserver");
return vue.openBlock(), vue.createBlock(_component_ResizeObserver, { onResize: _ctx.updatePositionThrottle }, {
default: vue.withCtx(() => [
vue.createElementVNode("div", _hoisted_1$1k, [
_ctx.isFixed ? (vue.openBlock(), vue.createElementBlock("div", {
key: 0,
style: vue.normalizeStyle(_ctx.placeholderStyles)
}, null, 4)) : vue.createCommentVNode("v-if", true),
vue.createElementVNode("div", {
class: vue.normalizeClass(_ctx.classNames),
style: vue.normalizeStyle(_ctx.fixedStyles)
}, [
vue.createVNode(_component_ResizeObserver, { onResize: _ctx.updatePositionThrottle }, {
default: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "default")
]),
_: 3
}, 8, ["onResize"])
], 6)
], 512)
]),
_: 3
}, 8, ["onResize"]);
}
var _Affix = /* @__PURE__ */ _export_sfc(_sfc_main$30, [["render", _sfc_render$2$]]);
const Affix = Object.assign(_Affix, {
install: (app, options) => {
setGlobalConfig(app, options);
const componentPrefix = getComponentPrefix(options);
app.component(componentPrefix + _Affix.name, _Affix);
}
});
const _sfc_main$2$ = vue.defineComponent({
name: "IconHover",
props: {
prefix: {
type: String
},
size: {
type: String,
default: "medium"
},
disabled: {
type: Boolean,
default: false
}
},
setup() {
const prefixCls = getPrefixCls("icon-hover");
return {
prefixCls
};
}
});
function _sfc_render$2_(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock("span", {
class: vue.normalizeClass([
_ctx.prefixCls,
{
[`${_ctx.prefix}-icon-hover`]: _ctx.prefix,
[`${_ctx.prefixCls}-size-${_ctx.size}`]: _ctx.size !== "medium",
[`${_ctx.prefixCls}-disabled`]: _ctx.disabled
}
])
}, [
vue.renderSlot(_ctx.$slots, "default")
], 2);
}
var IconHover = /* @__PURE__ */ _export_sfc(_sfc_main$2$, [["render", _sfc_render$2_]]);
const _sfc_main$2_ = vue.defineComponent({
name: "IconClose",
props: {
size: {
type: [Number, String]
},
strokeWidth: {
type: Number,
default: 4
},
strokeLinecap: {
type: String,
default: "butt",
validator: (value) => {
return ["butt", "round", "square"].includes(value);
}
},
strokeLinejoin: {
type: String,
default: "miter",
validator: (value) => {
return ["arcs", "bevel", "miter", "miter-clip", "round"].includes(value);
}
},
rotate: Number,
spin: Boolean
},
emits: {
click: (ev) => true
},
setup(props, { emit }) {
const prefixCls = getPrefixCls("icon");
const cls = vue.computed(() => [prefixCls, `${prefixCls}-close`, { [`${prefixCls}-spin`]: props.spin }]);
const innerStyle = vue.computed(() => {
const styles = {};
if (props.size) {
styles.fontSize = isNumber$1(props.size) ? `${props.size}px` : props.size;
}
if (props.rotate) {
styles.transform = `rotate(${props.rotate}deg)`;
}
return styles;
});
const onClick = (ev) => {
emit("click", ev);
};
return {
cls,
innerStyle,
onClick
};
}
});
const _hoisted_1$1j = ["stroke-width", "stroke-linecap", "stroke-linejoin"];
function _sfc_render$2Z(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock("svg", {
viewBox: "0 0 48 48",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
stroke: "currentColor",
class: vue.normalizeClass(_ctx.cls),
style: vue.normalizeStyle(_ctx.innerStyle),
"stroke-width": _ctx.strokeWidth,
"stroke-linecap": _ctx.strokeLinecap,
"stroke-linejoin": _ctx.strokeLinejoin,
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args))
}, _cache[1] || (_cache[1] = [
vue.createElementVNode("path", { d: "M9.857 9.858 24 24m0 0 14.142 14.142M24 24 38.142 9.858M24 24 9.857 38.142" }, null, -1)
]), 14, _hoisted_1$1j);
}
var _IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$2_, [["render", _sfc_render$2Z]]);
const IconClose = Object.assign(_IconClose, {
install: (app, options) => {
var _a;
const iconPrefix = (_a = options == null ? void 0 : options.iconPrefix) != null ? _a : "";
app.component(iconPrefix + _IconClose.name, _IconClose);
}
});
const _sfc_main$2Z = vue.defineComponent({
name: "IconInfoCircleFill",
props: {
size: {
type: [Number, String]
},
strokeWidth: {
type: Number,
default: 4
},
strokeLinecap: {
type: String,
default: "butt",
validator: (value) => {
return ["butt", "round", "square"].includes(value);
}
},
strokeLinejoin: {
type: String,
default: "miter",
validator: (value) => {
return ["arcs", "bevel", "miter", "miter-clip", "round"].includes(value);
}
},
rotate: Number,
spin: Boolean
},
emits: {
click: (ev) => true
},
setup(props, { emit }) {
const prefixCls = getPrefixCls("icon");
const cls = vue.computed(() => [prefixCls, `${prefixCls}-info-circle-fill`, { [`${prefixCls}-spin`]: props.spin }]);
const innerStyle = vue.computed(() => {
const styles = {};
if (props.size) {
styles.fontSize = isNumber$1(props.size) ? `${props.size}px` : props.size;
}
if (props.rotate) {
styles.transform = `rotate(${props.rotate}deg)`;
}
return styles;
});
const onClick = (ev) => {
emit("click", ev);
};
return {
cls,
innerStyle,
onClick
};
}
});
const _hoisted_1$1i = ["stroke-width", "stroke-linecap", "stroke-linejoin"];
function _sfc_render$2Y(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock("svg", {
viewBox: "0 0 48 48",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
stroke: "currentColor",
class: vue.normalizeClass(_ctx.cls),
style: vue.normalizeStyle(_ctx.innerStyle),
"stroke-width": _ctx.strokeWidth,
"stroke-linecap": _ctx.strokeLinecap,
"stroke-linejoin": _ctx.strokeLinejoin,
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args))
}, _cache[1] || (_cache[1] = [
vue.createElementVNode("path", {
"fill-rule": "evenodd",
"clip-rule": "evenodd",
d: "M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm2-30a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2Zm0 17h1a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1v-8a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v11Z",
fill: "currentColor",
stroke: "none"
}, null, -1)
]), 14, _hoisted_1$1i);
}
var _IconInfoCircleFill = /* @__PURE__ */ _export_sfc(_sfc_main$2Z, [["render", _sfc_render$2Y]]);
const IconInfoCircleFill = Object.assign(_IconInfoCircleFill, {
install: (app, options) =