@antdv/ui
Version:
Fork from Ant Design Vue. An enterprise-class UI design language and Vue-based implementation
1,812 lines (1,770 loc) • 3.21 MB
JavaScript
/*! Ant Design Vue UI v4.2.4 */
(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.AntDesignVueUI = {}, global.Vue));
})(this, (function (exports, vue) { 'use strict';
const PresetColors$1 = [
"blue",
"purple",
"cyan",
"green",
"magenta",
"pink",
"red",
"orange",
"yellow",
"volcano",
"geekblue",
"lime",
"gold"
];
const PresetStatusColorTypes = [
"success",
"processing",
"error",
"default",
"warning"
];
const ANT_MARK = "internalMark";
const skipFlattenKey$1 = Symbol("skipFlatten");
const inputDefaultValue = Symbol("InputDefaultKey");
const autoAdjustOverflow$3 = {
adjustX: 1,
adjustY: 1
};
const targetOffset$4 = [0, 0];
const placements$3 = {
left: {
points: ["cr", "cl"],
overflow: autoAdjustOverflow$3,
offset: [-4, 0],
targetOffset: targetOffset$4
},
right: {
points: ["cl", "cr"],
overflow: autoAdjustOverflow$3,
offset: [4, 0],
targetOffset: targetOffset$4
},
top: {
points: ["bc", "tc"],
overflow: autoAdjustOverflow$3,
offset: [0, -4],
targetOffset: targetOffset$4
},
bottom: {
points: ["tc", "bc"],
overflow: autoAdjustOverflow$3,
offset: [0, 4],
targetOffset: targetOffset$4
},
topLeft: {
points: ["bl", "tl"],
overflow: autoAdjustOverflow$3,
offset: [0, -4],
targetOffset: targetOffset$4
},
leftTop: {
points: ["tr", "tl"],
overflow: autoAdjustOverflow$3,
offset: [-4, 0],
targetOffset: targetOffset$4
},
topRight: {
points: ["br", "tr"],
overflow: autoAdjustOverflow$3,
offset: [0, -4],
targetOffset: targetOffset$4
},
rightTop: {
points: ["tl", "tr"],
overflow: autoAdjustOverflow$3,
offset: [4, 0],
targetOffset: targetOffset$4
},
bottomRight: {
points: ["tr", "br"],
overflow: autoAdjustOverflow$3,
offset: [0, 4],
targetOffset: targetOffset$4
},
rightBottom: {
points: ["bl", "br"],
overflow: autoAdjustOverflow$3,
offset: [4, 0],
targetOffset: targetOffset$4
},
bottomLeft: {
points: ["tl", "bl"],
overflow: autoAdjustOverflow$3,
offset: [0, 4],
targetOffset: targetOffset$4
},
leftBottom: {
points: ["br", "bl"],
overflow: autoAdjustOverflow$3,
offset: [-4, 0],
targetOffset: targetOffset$4
}
};
const responsiveArray = ["xxxl", "xxl", "xl", "lg", "md", "sm", "xs"];
const InputStatuses = ["warning", "error", ""];
const ValidateStatuses = ["success", "warning", "error", "validating", ""];
const progressStatuses = ["normal", "exception", "active", "success"];
const inverseColors = PresetColors$1.map((color) => `${color}-inverse`);
const presetStatusColorTypes = [
"success",
"processing",
"error",
"default",
"warning"
];
function isPresetColor(color, includeInverse = true) {
if (includeInverse)
return [...inverseColors, ...PresetColors$1].includes(color);
return PresetColors$1.includes(color);
}
function isPresetStatusColor(color) {
return presetStatusColorTypes.includes(color);
}
function canUseDom$1() {
return !!(typeof window !== "undefined" && window.document && window.document.createElement);
}
let warned = {};
function warning$2(valid, message) {
}
function note(valid, message) {
}
function call(method, valid, message) {
if (!valid && !warned[message]) {
method(false, message);
warned[message] = true;
}
}
function warningOnce(valid, message) {
call(warning$2, valid, message);
}
function noteOnce(valid, message) {
call(note, valid, message);
}
let devWarning = () => {
};
function warningFn(valid, component, message) {
warningOnce(valid, `[ant-design-vue: ${component}] ${message}`);
}
function isNumeric(value) {
return !Number.isNaN(Number.parseFloat(value)) && Number.isFinite(value);
}
function isValidValue(val) {
return val !== void 0 && val !== null;
}
function isValid$2(value) {
return value !== void 0 && value !== null && value !== "";
}
function isWindow$1(obj) {
return obj !== null && obj !== void 0 && obj === obj.window;
}
const isFunction$1 = (val) => typeof val === "function";
const isArray$1 = Array.isArray;
const isString$1 = (val) => typeof val === "string";
const isObject$3 = (val) => val !== null && typeof val === "object";
const onRE = /^on[^a-z]/;
const isOn = (key) => onRE.test(key);
function isFragment(c) {
return c.length === 1 && c[0].type === vue.Fragment;
}
function isEmptyContent(c) {
return c === void 0 || c === null || c === "" || Array.isArray(c) && c.length === 0;
}
function isEmptyElement(c) {
return c && (c.type === vue.Comment || c.type === vue.Fragment && c.children.length === 0 || c.type === vue.Text && c.children.trim() === "");
}
function isStringElement(c) {
return c && c.type === vue.Text;
}
function isValidElement(element) {
if (Array.isArray(element) && element.length === 1)
element = element[0];
return element && element.__v_isVNode && typeof element.type !== "symbol";
}
function isVisible(element) {
if (!element)
return false;
if (element.offsetParent)
return true;
if (element.getBBox) {
const box = element.getBBox();
if (box.width || box.height)
return true;
}
if (element.getBoundingClientRect) {
const box = element.getBoundingClientRect();
if (box.width || box.height)
return true;
}
return false;
}
function isEqual$2(obj1, obj2, shallow = false) {
const refSet = /* @__PURE__ */ new Set();
function deepEqual(a, b, level = 1) {
const circular = refSet.has(a);
warningOnce(!circular, "Warning: There may be circular references");
if (circular)
return false;
if (a === b)
return true;
if (shallow && level > 1)
return false;
refSet.add(a);
const newLevel = level + 1;
if (Array.isArray(a)) {
if (!Array.isArray(b) || a.length !== b.length)
return false;
for (let i = 0; i < a.length; i++) {
if (!deepEqual(a[i], b[i], newLevel))
return false;
}
return true;
}
if (a && b && typeof a === "object" && typeof b === "object") {
const keys = Object.keys(a);
if (keys.length !== Object.keys(b).length)
return false;
return keys.every((key) => deepEqual(a[key], b[key], newLevel));
}
return false;
}
return deepEqual(obj1, obj2);
}
function isMobile() {
if (typeof navigator === "undefined" || typeof window === "undefined")
return false;
const agent = navigator.userAgent || navigator.vendor || window.opera;
return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(
agent
) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-([mpt])|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c([\- _agpst])|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac([ \-/])|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/([klu])|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t([\- ov])|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[23]|n30(0|2)|n50([025])|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan([adt])|pdxg|pg(13|-([1-8c]))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c([\-01])|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(
agent == null ? void 0 : agent.substring(0, 4)
);
}
function hasClass(node, className) {
if (node.classList)
return node.classList.contains(className);
const originClass = node.className;
return ` ${originClass} `.includes(` ${className} `);
}
function addClass(node, className) {
if (node.classList) {
node.classList.add(className);
} else {
if (!hasClass(node, className))
node.className = `${node.className} ${className}`;
}
}
function removeClass(node, className) {
if (node.classList) {
node.classList.remove(className);
} else {
if (hasClass(node, className)) {
const originClass = node.className;
node.className = ` ${originClass} `.replace(` ${className} `, " ");
}
}
}
function classNames(...args) {
const classes = [];
for (let i = 0; i < args.length; i++) {
const value = args[i];
if (!value)
continue;
if (isString$1(value)) {
classes.push(value);
} else if (isArray$1(value)) {
for (let j = 0; j < value.length; j++) {
const inner = classNames(value[j]);
if (inner)
classes.push(inner);
}
} else if (isObject$3(value)) {
for (const name in value) {
if (value[name])
classes.push(name);
}
}
}
return classes.join(" ");
}
function contains$1(root, n) {
if (!root)
return false;
if (root.contains)
return root.contains(n);
return false;
}
function getClientSize() {
const width = document.documentElement.clientWidth;
const height = window.innerHeight || document.documentElement.clientHeight;
return {
width,
height
};
}
function getOffset$3(node) {
const box = node.getBoundingClientRect();
const docElem = document.documentElement;
return {
left: box.left + (window.scrollX || docElem.scrollLeft) - (docElem.clientLeft || document.body.clientLeft || 0),
top: box.top + (window.scrollX || docElem.scrollTop) - (docElem.clientTop || document.body.clientTop || 0)
};
}
function styleToString(style) {
const styleNames = Array.prototype.slice.apply(style);
return styleNames.map((name) => `${name}: ${style.getPropertyValue(name)};`).join("");
}
function styleObjectToString(style) {
return Object.keys(style).reduce((acc, name) => {
const styleValue = style[name];
if (typeof styleValue === "undefined" || styleValue === null) {
return acc;
}
acc += `${name}: ${style[name]};`;
return acc;
}, "");
}
const APPEND_ORDER$1 = "data-vc-order";
const MARK_KEY$1 = `vc-util-key`;
const containerCache$1 = /* @__PURE__ */ new Map();
function getMark$1({ mark } = {}) {
if (mark)
return mark.startsWith("data-") ? mark : `data-${mark}`;
return MARK_KEY$1;
}
function getContainer$2(option) {
if (option.attachTo)
return option.attachTo;
const head = document.querySelector("head");
return head || document.body;
}
function getOrder$1(prepend) {
if (prepend === "queue")
return "prependQueue";
return prepend ? "prepend" : "append";
}
function findStyles$1(container) {
return Array.from((containerCache$1.get(container) || container).children).filter(
(node) => node.tagName === "STYLE"
);
}
function injectCSS$1(css, option = {}) {
if (!canUseDom$1())
return null;
const { csp, prepend } = option;
const styleNode = document.createElement("style");
styleNode.setAttribute(APPEND_ORDER$1, getOrder$1(prepend));
if (csp == null ? void 0 : csp.nonce)
styleNode.nonce = csp == null ? void 0 : csp.nonce;
styleNode.innerHTML = css;
const container = getContainer$2(option);
const { firstChild } = container;
if (prepend) {
if (prepend === "queue") {
const existStyle = findStyles$1(container).filter(
(node) => ["prepend", "prependQueue"].includes(node.getAttribute(APPEND_ORDER$1))
);
if (existStyle.length) {
container.insertBefore(styleNode, existStyle[existStyle.length - 1].nextSibling);
return styleNode;
}
}
container.insertBefore(styleNode, firstChild);
} else {
container.appendChild(styleNode);
}
return styleNode;
}
function findExistNode$1(key, option = {}) {
const container = getContainer$2(option);
return findStyles$1(container).find((node) => node.getAttribute(getMark$1(option)) === key);
}
function removeCSS(key, option = {}) {
const existNode = findExistNode$1(key, option);
if (existNode) {
const container = getContainer$2(option);
container.removeChild(existNode);
}
}
function syncRealContainer$1(container, option) {
const cachedRealContainer = containerCache$1.get(container);
if (!cachedRealContainer || !contains$1(document, cachedRealContainer)) {
const placeholderStyle = injectCSS$1("", option);
const { parentNode } = placeholderStyle;
containerCache$1.set(container, parentNode);
container.removeChild(placeholderStyle);
}
}
function updateCSS$1(css, key, option = {}) {
var _a, _b, _c;
const container = getContainer$2(option);
syncRealContainer$1(container, option);
const existNode = findExistNode$1(key, option);
if (existNode) {
if (((_a = option.csp) == null ? void 0 : _a.nonce) && existNode.nonce !== ((_b = option.csp) == null ? void 0 : _b.nonce))
existNode.nonce = (_c = option.csp) == null ? void 0 : _c.nonce;
if (existNode.innerHTML !== css)
existNode.innerHTML = css;
return existNode;
}
const newNode = injectCSS$1(css, option);
newNode.setAttribute(getMark$1(option), key);
return newNode;
}
const canUseDocElement = () => canUseDom$1() && window.document.documentElement;
function isStyleNameSupport(styleName) {
if (canUseDom$1() && window.document.documentElement) {
const styleNameList = Array.isArray(styleName) ? styleName : [styleName];
const { documentElement } = window.document;
return styleNameList.some((name) => name in documentElement.style);
}
return false;
}
function isStyleValueSupport(styleName, value) {
if (!isStyleNameSupport(styleName))
return false;
const ele = document.createElement("div");
const origin = ele.style[styleName];
ele.style[styleName] = value;
return ele.style[styleName] !== origin;
}
function isStyleSupport(styleName, styleValue) {
if (!Array.isArray(styleName) && styleValue !== void 0)
return isStyleValueSupport(styleName, styleValue);
return isStyleNameSupport(styleName);
}
let flexGapSupported;
function detectFlexGapSupported() {
if (!canUseDocElement())
return false;
if (flexGapSupported !== void 0)
return flexGapSupported;
const flex = document.createElement("div");
flex.style.display = "flex";
flex.style.flexDirection = "column";
flex.style.rowGap = "1px";
flex.appendChild(document.createElement("div"));
flex.appendChild(document.createElement("div"));
document.body.appendChild(flex);
flexGapSupported = flex.scrollHeight === 1;
document.body.removeChild(flex);
return flexGapSupported;
}
let supportsPassive = false;
try {
const opts = Object.defineProperty({}, "passive", {
get() {
supportsPassive = true;
}
});
window.addEventListener("testPassive", null, opts);
window.removeEventListener("testPassive", null, opts);
} catch (e) {
}
function addEventListenerWrap(target, eventType, cb, option) {
if (target && target.addEventListener) {
let opt = option;
if (opt === void 0 && supportsPassive && (eventType === "touchstart" || eventType === "touchmove" || eventType === "wheel")) {
opt = { passive: false };
}
target.addEventListener(eventType, cb, opt);
}
return {
remove: () => {
if (target && target.removeEventListener)
target.removeEventListener(eventType, cb);
}
};
}
const camel2hyphen = function(str) {
return str.replace(/[A-Z]/g, (match) => {
return `-${match.toLowerCase()}`;
}).toLowerCase();
};
const isDimension = function(feature) {
const re = /[height|width]$/;
return re.test(feature);
};
const obj2mq = function(obj) {
let mq = "";
const features = Object.keys(obj);
features.forEach((feature, index) => {
let value = obj[feature];
feature = camel2hyphen(feature);
if (isDimension(feature) && typeof value === "number")
value = `${value}px`;
if (value === true)
mq += feature;
else if (value === false)
mq += `not ${feature}`;
else
mq += `(${feature}: ${value})`;
if (index < features.length - 1)
mq += " and ";
});
return mq;
};
function json2mq(query) {
let mq = "";
if (typeof query === "string")
return query;
if (Array.isArray(query)) {
query.forEach((q, index) => {
mq += obj2mq(q);
if (index < query.length - 1)
mq += ", ";
});
return mq;
}
return obj2mq(query);
}
const KeyCode = {
/**
* MAC_ENTER
*/
MAC_ENTER: 3,
/**
* BACKSPACE
*/
BACKSPACE: 8,
/**
* TAB
*/
TAB: 9,
/**
* NUMLOCK on FF/Safari Mac
*/
NUM_CENTER: 12,
// NUMLOCK on FF/Safari Mac
/**
* ENTER
*/
ENTER: 13,
/**
* SHIFT
*/
SHIFT: 16,
/**
* CTRL
*/
CTRL: 17,
/**
* ALT
*/
ALT: 18,
/**
* PAUSE
*/
PAUSE: 19,
/**
* CAPS_LOCK
*/
CAPS_LOCK: 20,
/**
* ESC
*/
ESC: 27,
/**
* SPACE
*/
SPACE: 32,
/**
* PAGE_UP
*/
PAGE_UP: 33,
// also NUM_NORTH_EAST
/**
* PAGE_DOWN
*/
PAGE_DOWN: 34,
// also NUM_SOUTH_EAST
/**
* END
*/
END: 35,
// also NUM_SOUTH_WEST
/**
* HOME
*/
HOME: 36,
// also NUM_NORTH_WEST
/**
* LEFT
*/
LEFT: 37,
// also NUM_WEST
/**
* UP
*/
UP: 38,
// also NUM_NORTH
/**
* RIGHT
*/
RIGHT: 39,
// also NUM_EAST
/**
* DOWN
*/
DOWN: 40,
// also NUM_SOUTH
/**
* PRINT_SCREEN
*/
PRINT_SCREEN: 44,
/**
* INSERT
*/
INSERT: 45,
// also NUM_INSERT
/**
* DELETE
*/
DELETE: 46,
// also NUM_DELETE
/**
* ZERO
*/
ZERO: 48,
/**
* ONE
*/
ONE: 49,
/**
* TWO
*/
TWO: 50,
/**
* THREE
*/
THREE: 51,
/**
* FOUR
*/
FOUR: 52,
/**
* FIVE
*/
FIVE: 53,
/**
* SIX
*/
SIX: 54,
/**
* SEVEN
*/
SEVEN: 55,
/**
* EIGHT
*/
EIGHT: 56,
/**
* NINE
*/
NINE: 57,
/**
* QUESTION_MARK
*/
QUESTION_MARK: 63,
// needs localization
/**
* A
*/
A: 65,
/**
* B
*/
B: 66,
/**
* C
*/
C: 67,
/**
* D
*/
D: 68,
/**
* E
*/
E: 69,
/**
* F
*/
F: 70,
/**
* G
*/
G: 71,
/**
* H
*/
H: 72,
/**
* I
*/
I: 73,
/**
* J
*/
J: 74,
/**
* K
*/
K: 75,
/**
* L
*/
L: 76,
/**
* M
*/
M: 77,
/**
* N
*/
N: 78,
/**
* O
*/
O: 79,
/**
* P
*/
P: 80,
/**
* Q
*/
Q: 81,
/**
* R
*/
R: 82,
/**
* S
*/
S: 83,
/**
* T
*/
T: 84,
/**
* U
*/
U: 85,
/**
* V
*/
V: 86,
/**
* W
*/
W: 87,
/**
* X
*/
X: 88,
/**
* Y
*/
Y: 89,
/**
* Z
*/
Z: 90,
/**
* META
*/
META: 91,
// WIN_KEY_LEFT
/**
* WIN_KEY_RIGHT
*/
WIN_KEY_RIGHT: 92,
/**
* CONTEXT_MENU
*/
CONTEXT_MENU: 93,
/**
* NUM_ZERO
*/
NUM_ZERO: 96,
/**
* NUM_ONE
*/
NUM_ONE: 97,
/**
* NUM_TWO
*/
NUM_TWO: 98,
/**
* NUM_THREE
*/
NUM_THREE: 99,
/**
* NUM_FOUR
*/
NUM_FOUR: 100,
/**
* NUM_FIVE
*/
NUM_FIVE: 101,
/**
* NUM_SIX
*/
NUM_SIX: 102,
/**
* NUM_SEVEN
*/
NUM_SEVEN: 103,
/**
* NUM_EIGHT
*/
NUM_EIGHT: 104,
/**
* NUM_NINE
*/
NUM_NINE: 105,
/**
* NUM_MULTIPLY
*/
NUM_MULTIPLY: 106,
/**
* NUM_PLUS
*/
NUM_PLUS: 107,
/**
* NUM_MINUS
*/
NUM_MINUS: 109,
/**
* NUM_PERIOD
*/
NUM_PERIOD: 110,
/**
* NUM_DIVISION
*/
NUM_DIVISION: 111,
/**
* F1
*/
F1: 112,
/**
* F2
*/
F2: 113,
/**
* F3
*/
F3: 114,
/**
* F4
*/
F4: 115,
/**
* F5
*/
F5: 116,
/**
* F6
*/
F6: 117,
/**
* F7
*/
F7: 118,
/**
* F8
*/
F8: 119,
/**
* F9
*/
F9: 120,
/**
* F10
*/
F10: 121,
/**
* F11
*/
F11: 122,
/**
* F12
*/
F12: 123,
/**
* NUMLOCK
*/
NUMLOCK: 144,
/**
* SEMICOLON
*/
SEMICOLON: 186,
// needs localization
/**
* DASH
*/
DASH: 189,
// needs localization
/**
* EQUALS
*/
EQUALS: 187,
// needs localization
/**
* COMMA
*/
COMMA: 188,
// needs localization
/**
* PERIOD
*/
PERIOD: 190,
// needs localization
/**
* SLASH
*/
SLASH: 191,
// needs localization
/**
* APOSTROPHE
*/
APOSTROPHE: 192,
// needs localization
/**
* SINGLE_QUOTE
*/
SINGLE_QUOTE: 222,
// needs localization
/**
* OPEN_SQUARE_BRACKET
*/
OPEN_SQUARE_BRACKET: 219,
// needs localization
/**
* BACKSLASH
*/
BACKSLASH: 220,
// needs localization
/**
* CLOSE_SQUARE_BRACKET
*/
CLOSE_SQUARE_BRACKET: 221,
// needs localization
/**
* WIN_KEY
*/
WIN_KEY: 224,
/**
* MAC_FF_META
*/
MAC_FF_META: 224,
// Firefox (Gecko) fires this for the meta key instead of 91
/**
* WIN_IME
*/
WIN_IME: 229,
// ======================== Function ========================
/**
* whether text and modified key is entered at the same time.
*/
isTextModifyingKeyEvent: function isTextModifyingKeyEvent(e) {
const { keyCode } = e;
if (e.altKey && !e.ctrlKey || e.metaKey || keyCode >= KeyCode.F1 && keyCode <= KeyCode.F12) {
return false;
}
switch (keyCode) {
case KeyCode.ALT:
case KeyCode.CAPS_LOCK:
case KeyCode.CONTEXT_MENU:
case KeyCode.CTRL:
case KeyCode.DOWN:
case KeyCode.END:
case KeyCode.ESC:
case KeyCode.HOME:
case KeyCode.INSERT:
case KeyCode.LEFT:
case KeyCode.MAC_FF_META:
case KeyCode.META:
case KeyCode.NUMLOCK:
case KeyCode.NUM_CENTER:
case KeyCode.PAGE_DOWN:
case KeyCode.PAGE_UP:
case KeyCode.PAUSE:
case KeyCode.PRINT_SCREEN:
case KeyCode.RIGHT:
case KeyCode.SHIFT:
case KeyCode.UP:
case KeyCode.WIN_KEY:
case KeyCode.WIN_KEY_RIGHT:
return false;
default:
return true;
}
},
/**
* whether character is entered.
*/
isCharacterKey: function isCharacterKey(keyCode) {
if (keyCode >= KeyCode.ZERO && keyCode <= KeyCode.NINE)
return true;
if (keyCode >= KeyCode.NUM_ZERO && keyCode <= KeyCode.NUM_MULTIPLY)
return true;
if (keyCode >= KeyCode.A && keyCode <= KeyCode.Z)
return true;
if (window.navigator.userAgent.includes("WebKit") && keyCode === 0)
return true;
switch (keyCode) {
case KeyCode.SPACE:
case KeyCode.QUESTION_MARK:
case KeyCode.NUM_PLUS:
case KeyCode.NUM_MINUS:
case KeyCode.NUM_PERIOD:
case KeyCode.NUM_DIVISION:
case KeyCode.SEMICOLON:
case KeyCode.DASH:
case KeyCode.EQUALS:
case KeyCode.COMMA:
case KeyCode.PERIOD:
case KeyCode.SLASH:
case KeyCode.APOSTROPHE:
case KeyCode.SINGLE_QUOTE:
case KeyCode.OPEN_SQUARE_BRACKET:
case KeyCode.BACKSLASH:
case KeyCode.CLOSE_SQUARE_BRACKET:
return true;
default:
return false;
}
}
};
function toArray$7(value) {
if (value === void 0 || value === null)
return [];
return Array.isArray(value) ? value : [value];
}
function cacheStringFunction(fn) {
const cache = /* @__PURE__ */ Object.create(null);
return (str) => {
const hit = cache[str];
return hit || (cache[str] = fn(str));
};
}
const camelizeRE = /-(\w)/g;
const camelize = cacheStringFunction((str) => {
return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
});
const hyphenateRE = /\B([A-Z])/g;
const hyphenate = cacheStringFunction((str) => {
return str.replace(hyphenateRE, "-$1").toLowerCase();
});
const capitalize = cacheStringFunction((str) => {
return str.charAt(0).toUpperCase() + str.slice(1);
});
function firstNotUndefined(arr = []) {
for (let i = 0, len = arr.length; i < len; i++) {
if (arr[i] !== void 0)
return arr[i];
}
return void 0;
}
function get$1(entity, path) {
let current = entity;
for (let i = 0; i < path.length; i += 1) {
if (current === null || current === void 0)
return void 0;
current = current[path[i]];
}
return current;
}
function omit$2(obj, fields) {
const shallowCopy = Object.assign({}, obj);
for (let i = 0; i < fields.length; i += 1) {
const key = fields[i];
delete shallowCopy[key];
}
return shallowCopy;
}
const attributes = `accept acceptcharset accesskey action allowfullscreen allowtransparency
alt async autocomplete autofocus autoplay capture cellpadding cellspacing challenge
charset checked classid classname colspan cols content contenteditable contextmenu
controls coords crossorigin data datetime default defer dir disabled download draggable
enctype form formaction formenctype formmethod formnovalidate formtarget frameborder
headers height hidden high href hreflang htmlfor for httpequiv icon id inputmode integrity
is keyparams keytype kind label lang list loop low manifest marginheight marginwidth max maxlength media
mediagroup method min minlength multiple muted name novalidate nonce open
optimum pattern placeholder poster preload radiogroup readonly rel required
reversed role rowspan rows sandbox scope scoped scrolling seamless selected
shape size sizes span spellcheck src srcdoc srclang srcset start step style
summary tabindex target title type usemap value width wmode wrap`;
const eventsName = `onCopy onCut onPaste onCompositionend onCompositionstart onCompositionupdate onKeydown
onKeypress onKeyup onFocus onBlur onChange onInput onSubmit onClick onContextmenu onDoubleclick onDblclick
onDrag onDragend onDragenter onDragexit onDragleave onDragover onDragstart onDrop onMousedown
onMouseenter onMouseleave onMousemove onMouseout onMouseover onMouseup onSelect onTouchcancel
onTouchend onTouchmove onTouchstart onTouchstartPassive onTouchmovePassive onScroll onWheel onAbort onCanplay onCanplaythrough
onDurationchange onEmptied onEncrypted onEnded onError onLoadeddata onLoadedmetadata
onLoadstart onPause onPlay onPlaying onProgress onRatechange onSeeked onSeeking onStalled onSuspend onTimeupdate onVolumechange onWaiting onLoad onError`;
const propList = `${attributes} ${eventsName}`.split(/[\s\n]+/);
const ariaPrefix = "aria-";
const dataPrefix = "data-";
function match(key, prefix) {
return key.indexOf(prefix) === 0;
}
function pickAttrs(props, ariaOnly = false) {
let mergedConfig;
if (ariaOnly === false) {
mergedConfig = {
aria: true,
data: true,
attr: true
};
} else if (ariaOnly === true) {
mergedConfig = {
aria: true
};
} else {
mergedConfig = {
...ariaOnly
};
}
const attrs = {};
Object.keys(props).forEach((key) => {
if (
// Aria
mergedConfig.aria && (key === "role" || match(key, ariaPrefix)) || mergedConfig.data && match(key, dataPrefix) || mergedConfig.attr && (propList.includes(key) || propList.includes(key.toLowerCase()))
) {
attrs[key] = props[key];
}
});
return attrs;
}
function internalSet(entity, paths, value, removeIfUndefined) {
if (!paths.length)
return value;
const [path, ...restPath] = paths;
let clone;
if (!entity && typeof path === "number")
clone = [];
else if (Array.isArray(entity))
clone = [...entity];
else
clone = { ...entity };
if (removeIfUndefined && value === void 0 && restPath.length === 1)
delete clone[path][restPath[0]];
else
clone[path] = internalSet(clone[path], restPath, value, removeIfUndefined);
return clone;
}
function set(entity, paths, value, removeIfUndefined = false) {
if (paths.length && removeIfUndefined && value === void 0 && !get$1(entity, paths.slice(0, -1))) {
return entity;
}
return internalSet(entity, paths, value, removeIfUndefined);
}
function shallowEqualFn(objA, objB, compare, compareContext) {
let ret = compare ? compare.call(compareContext, objA, objB) : void 0;
if (ret !== void 0)
return !!ret;
if (objA === objB)
return true;
if (typeof objA !== "object" || !objA || typeof objB !== "object" || !objB)
return false;
const keysA = Object.keys(objA);
const keysB = Object.keys(objB);
if (keysA.length !== keysB.length)
return false;
const bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);
for (let idx = 0; idx < keysA.length; idx++) {
const key = keysA[idx];
if (!bHasOwnProperty(key))
return false;
const valueA = objA[key];
const valueB = objB[key];
ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;
if (ret === false || ret === void 0 && valueA !== valueB)
return false;
}
return true;
}
function shallowEqual(value, other) {
return shallowEqualFn(vue.toRaw(value), vue.toRaw(other));
}
const autoAdjustOverflowEnabled = {
adjustX: 1,
adjustY: 1
};
const autoAdjustOverflowDisabled = {
adjustX: 0,
adjustY: 0
};
const targetOffset$3 = [0, 0];
function getOverflowOptions(autoAdjustOverflow) {
if (typeof autoAdjustOverflow === "boolean")
return autoAdjustOverflow ? autoAdjustOverflowEnabled : autoAdjustOverflowDisabled;
return {
...autoAdjustOverflowDisabled,
...autoAdjustOverflow
};
}
function getPlacements$1(config) {
const {
arrowWidth = 4,
horizontalArrowShift = 16,
verticalArrowShift = 8,
autoAdjustOverflow,
arrowPointAtCenter
} = config;
const placementMap = {
left: {
points: ["cr", "cl"],
offset: [-4, 0]
},
right: {
points: ["cl", "cr"],
offset: [4, 0]
},
top: {
points: ["bc", "tc"],
offset: [0, -4]
},
bottom: {
points: ["tc", "bc"],
offset: [0, 4]
},
topLeft: {
points: ["bl", "tc"],
offset: [-(horizontalArrowShift + arrowWidth), -4]
},
leftTop: {
points: ["tr", "cl"],
offset: [-4, -(verticalArrowShift + arrowWidth)]
},
topRight: {
points: ["br", "tc"],
offset: [horizontalArrowShift + arrowWidth, -4]
},
rightTop: {
points: ["tl", "cr"],
offset: [4, -(verticalArrowShift + arrowWidth)]
},
bottomRight: {
points: ["tr", "bc"],
offset: [horizontalArrowShift + arrowWidth, 4]
},
rightBottom: {
points: ["bl", "cr"],
offset: [4, verticalArrowShift + arrowWidth]
},
bottomLeft: {
points: ["tl", "bc"],
offset: [-(horizontalArrowShift + arrowWidth), 4]
},
leftBottom: {
points: ["br", "cl"],
offset: [-4, verticalArrowShift + arrowWidth]
}
};
Object.keys(placementMap).forEach((key) => {
placementMap[key] = arrowPointAtCenter ? {
...placementMap[key],
overflow: getOverflowOptions(autoAdjustOverflow),
targetOffset: targetOffset$3
} : {
...placements$3[key],
overflow: getOverflowOptions(autoAdjustOverflow)
};
placementMap[key].ignoreShake = true;
});
return placementMap;
}
function getScroll$3(target, top) {
var _a, _b;
if (typeof window === "undefined")
return 0;
const method = top ? "scrollTop" : "scrollLeft";
let result = 0;
if (isWindow$1(target)) {
result = target[top ? "pageYOffset" : "pageXOffset"];
} else if (target instanceof Document) {
result = target.documentElement[method];
} else if (target instanceof HTMLElement) {
result = target[method];
} else if (target) {
result = target[method];
}
if (target && !isWindow$1(target) && typeof result !== "number")
result = (_b = ((_a = target.ownerDocument) != null ? _a : target).documentElement) == null ? void 0 : _b[method];
return result;
}
let cached;
function getScrollBarSize(fresh) {
if (typeof document === "undefined")
return 0;
if (fresh || cached === void 0) {
const inner = document.createElement("div");
inner.style.width = "100%";
inner.style.height = "200px";
const outer = document.createElement("div");
const outerStyle = outer.style;
outerStyle.position = "absolute";
outerStyle.top = "0";
outerStyle.left = "0";
outerStyle.pointerEvents = "none";
outerStyle.visibility = "hidden";
outerStyle.width = "200px";
outerStyle.height = "150px";
outerStyle.overflow = "hidden";
outer.appendChild(inner);
document.body.appendChild(outer);
const widthContained = inner.offsetWidth;
outer.style.overflow = "scroll";
let widthScroll = inner.offsetWidth;
if (widthContained === widthScroll)
widthScroll = outer.clientWidth;
document.body.removeChild(outer);
cached = widthContained - widthScroll;
}
return cached;
}
function ensureSize(str) {
const match = str.match(/^(.*)px$/);
const value = Number(match == null ? void 0 : match[1]);
return Number.isNaN(value) ? getScrollBarSize() : value;
}
function getTargetScrollBarSize(target) {
if (typeof document === "undefined" || !target || !(target instanceof Element))
return { width: 0, height: 0 };
const { width, height } = getComputedStyle(target, "::-webkit-scrollbar");
return {
width: ensureSize(width),
height: ensureSize(height)
};
}
let rafFn = (callback) => setTimeout(callback, 16);
let caf = (num) => clearTimeout(num);
if (typeof window !== "undefined" && "requestAnimationFrame" in window) {
rafFn = (callback) => window.requestAnimationFrame(callback);
caf = (handle) => window.cancelAnimationFrame(handle);
}
let rafUUID = 0;
const rafIds = /* @__PURE__ */ new Map();
function cleanup(id) {
rafIds.delete(id);
}
function raf(callback, times = 1) {
rafUUID += 1;
const id = rafUUID;
function callRef(leftTimes) {
if (leftTimes === 0) {
cleanup(id);
callback();
} else {
const realId = rafFn(() => {
callRef(leftTimes - 1);
});
rafIds.set(id, realId);
}
}
callRef(times);
return id;
}
raf.cancel = (id) => {
const realId = rafIds.get(id);
cleanup(realId);
return caf(realId);
};
function easeInOutCubic(t, b, c, d) {
const cc = c - b;
t /= d / 2;
if (t < 1)
return cc / 2 * t * t * t + b;
return cc / 2 * ((t -= 2) * t * t + 2) + b;
}
function scrollTo$1(y, options = {}) {
const { getContainer = () => window, callback, duration = 450 } = options;
const container = getContainer();
const scrollTop = getScroll$3(container, true);
const startTime = Date.now();
const frameFunc = () => {
const timestamp = Date.now();
const time = timestamp - startTime;
const nextScrollTop = easeInOutCubic(time > duration ? duration : time, scrollTop, y, duration);
if (isWindow$1(container))
container.scrollTo(window.scrollX, nextScrollTop);
else if (container instanceof Document)
container.documentElement.scrollTop = nextScrollTop;
else
container.scrollTop = nextScrollTop;
if (time < duration)
raf(frameFunc);
else if (typeof callback === "function")
callback();
};
raf(frameFunc);
}
function getStatusClassNames(prefixCls, status, hasFeedback) {
return classNames({
[`${prefixCls}-status-success`]: status === "success",
[`${prefixCls}-status-warning`]: status === "warning",
[`${prefixCls}-status-error`]: status === "error",
[`${prefixCls}-status-validating`]: status === "validating",
[`${prefixCls}-has-feedback`]: hasFeedback
});
}
function getMergedStatus(contextStatus, customStatus) {
return customStatus || contextStatus;
}
function throttleByAnimationFrame(fn) {
let requestId;
const later = (args) => () => {
requestId = null;
fn(...args);
};
const throttled = (...args) => {
if (requestId == null)
requestId = raf(later(args));
};
throttled.cancel = () => {
raf.cancel(requestId);
requestId = null;
};
return throttled;
}
function groupKeysMap(keys) {
const map = /* @__PURE__ */ new Map();
keys.forEach((key, index) => {
map.set(key, index);
});
return map;
}
function groupDisabledKeysMap(dataSource) {
const map = /* @__PURE__ */ new Map();
dataSource.forEach(({ disabled, key }, index) => {
if (disabled)
map.set(key, index);
});
return map;
}
const hasOwnProperty$e = Object.prototype.hasOwnProperty;
const hasOwn = (val, key) => hasOwnProperty$e.call(val, key);
function resolvePropValue(options, props, key, value) {
const opt = options[key];
if (opt != null) {
const hasDefault = hasOwn(opt, "default");
if (hasDefault && value === void 0) {
const defaultValue = opt.default;
value = opt.type !== Function && isFunction$1(defaultValue) ? defaultValue() : defaultValue;
}
if (opt.type === Boolean) {
if (!hasOwn(props, key) && !hasDefault)
value = false;
else if (value === "")
value = true;
}
}
return value;
}
function getDataAndAriaProps(props) {
return Object.keys(props).reduce((memo, key) => {
if (key.startsWith("data-") || key.startsWith("aria-"))
memo[key] = props[key];
return memo;
}, {});
}
function toPx(val) {
if (typeof val === "number")
return `${val}px`;
return val;
}
function renderHelper(v, props = {}, defaultV) {
if (typeof v === "function")
return v(props);
return v != null ? v : defaultV;
}
function wrapPromiseFn(openFn) {
let closeFn;
const closePromise = new Promise((resolve) => {
closeFn = openFn(() => {
resolve(true);
});
});
const result = () => {
closeFn == null ? void 0 : closeFn();
};
result.then = (filled, rejected) => closePromise.then(filled, rejected);
result.promise = closePromise;
return result;
}
function withUndefined(type) {
type.default = void 0;
return type;
}
function splitAttrs(attrs) {
const allAttrs = Object.keys(attrs);
const eventAttrs = {};
const onEvents = {};
const extraAttrs = {};
for (let i = 0, l = allAttrs.length; i < l; i++) {
const key = allAttrs[i];
if (isOn(key)) {
eventAttrs[key[2].toLowerCase() + key.slice(3)] = attrs[key];
onEvents[key] = attrs[key];
} else {
extraAttrs[key] = attrs[key];
}
}
return { onEvents, events: eventAttrs, extraAttrs };
}
function parseStyleText(cssText = "", camel = false) {
const res = {};
const listDelimiter = /;(?![^(]*\))/g;
const propertyDelimiter = /:(.+)/;
if (typeof cssText === "object")
return cssText;
cssText.split(listDelimiter).forEach((item) => {
if (item) {
const tmp = item.split(propertyDelimiter);
if (tmp.length > 1) {
const k = camel ? camelize(tmp[0].trim()) : tmp[0].trim();
res[k] = tmp[1].trim();
}
}
});
return res;
}
function hasProp(instance, prop) {
return instance[prop] !== void 0;
}
const skipFlattenKey = Symbol("skipFlatten");
function flattenChildren(children = [], filterEmpty2 = true) {
const temp = Array.isArray(children) ? children : [children];
const res = [];
temp.forEach((child) => {
if (Array.isArray(child)) {
res.push(...flattenChildren(child, filterEmpty2));
} else if (child && child.type === vue.Fragment) {
if (child.key === skipFlattenKey)
res.push(child);
else
res.push(...flattenChildren(child.children, filterEmpty2));
} else if (child && vue.isVNode(child)) {
if (filterEmpty2 && !isEmptyElement(child))
res.push(child);
else if (!filterEmpty2)
res.push(child);
} else if (isValid$2(child)) {
res.push(child);
}
});
return res;
}
function getSlot(self, name = "default", options = {}) {
if (vue.isVNode(self)) {
if (self.type === vue.Fragment)
return name === "default" ? flattenChildren(self.children) : [];
else if (self.children && self.children[name])
return flattenChildren(self.children[name](options));
else
return [];
} else {
const res = self.$slots[name] && self.$slots[name](options);
return flattenChildren(res);
}
}
function findDOMNode(instance) {
var _a;
let node = ((_a = instance == null ? void 0 : instance.vnode) == null ? void 0 : _a.el) || instance && (instance.$el || instance);
while (node && !node.tagName)
node = node.nextSibling;
return node;
}
function getOptionProps(instance) {
const res = {};
if (instance.$ && instance.$.vnode) {
const props = instance.$.vnode.props || {};
Object.keys(instance.$props).forEach((k) => {
const v = instance.$props[k];
const hyphenateKey = hyphenate(k);
if (v !== void 0 || hyphenateKey in props)
res[k] = v;
});
} else if (vue.isVNode(instance) && typeof instance.type === "object") {
const originProps = instance.props || {};
const props = {};
Object.keys(originProps).forEach((key) => {
props[camelize(key)] = originProps[key];
});
const options = instance.type.props || {};
Object.keys(options).forEach((k) => {
const v = resolvePropValue(options, props, k, props[k]);
if (v !== void 0 || k in props)
res[k] = v;
});
}
return res;
}
function getComponent(instance, prop = "default", options = instance, execute = true) {
let com;
if (instance.$) {
const temp = instance[prop];
if (temp !== void 0) {
return typeof temp === "function" && execute ? temp(options) : temp;
} else {
com = instance.$slots[prop];
com = execute && com ? com(options) : com;
}
} else if (vue.isVNode(instance)) {
const temp = instance.props && instance.props[prop];
if (temp !== void 0 && instance.props !== null) {
return typeof temp === "function" && execute ? temp(options) : temp;
} else if (instance.type === vue.Fragment) {
com = instance.children;
} else if (instance.children && instance.children[prop]) {
com = instance.children[prop];
com = execute && com ? com(options) : com;
}
}
if (Array.isArray(com)) {
com = flattenChildren(com);
com = com.length === 1 ? com[0] : com;
com = com.length === 0 ? void 0 : com;
}
return com;
}
function getEvents(ele = {}, on = true) {
let props = {};
if (ele.$)
props = { ...props, ...ele.$attrs };
else
props = { ...props, ...ele.props };
return splitAttrs(props)[on ? "onEvents" : "events"];
}
function getClass(ele) {
const props = (vue.isVNode(ele) ? ele.props : ele.$attrs) || {};
const tempCls = props.class || {};
let cls = {};
if (typeof tempCls === "string") {
tempCls.split(" ").forEach((c) => {
cls[c.trim()] = true;
});
} else if (Array.isArray(tempCls)) {
classNames(tempCls).split(" ").forEach((c) => {
cls[c.trim()] = true;
});
} else {
cls = { ...cls, ...tempCls };
}
return cls;
}
function getStyle$3(ele, camel) {
const props = (vue.isVNode(ele) ? ele.props : ele.$attrs) || {};
let style = props.style || {};
if (typeof style === "string") {
style = parseStyleText(style, camel);
} else if (camel && style) {
const res = {};
Object.keys(style).forEach((k) => res[camelize(k)] = style[k]);
return res;
}
return style;
}
function filterEmpty(children = []) {
const res = [];
children.forEach((child) => {
if (Array.isArray(child))
res.push(...child);
else if ((child == null ? void 0 : child.type) === vue.Fragment)
res.push(...filterEmpty(child.children));
else
res.push(child);
});
return res.filter((c) => !isEmptyElement(c));
}
function filterEmptyWithUndefined(children) {
if (children) {
const coms = filterEmpty(children);
return coms.length ? coms : void 0;
} else {
return children;
}
}
function getPropsSlot(slots, props, prop = "default") {
var _a, _b;
return (_b = props[prop]) != null ? _b : (_a = slots[prop]) == null ? void 0 : _a.call(slots);
}
var BaseMixin = {
methods: {
setState(state = {}, callback) {
let newState = typeof state === "function" ? state(this.$data, this.$props) : state;
if (this.getDerivedStateFromProps) {
const s = this.getDerivedStateFromProps(getOptionProps(this), {
...this.$data,
...newState
});
if (s === null)
return;
else
newState = { ...newState, ...s || {} };
}
Object.assign(this.$data, newState);
if (this._.isMounted)
this.$forceUpdate();
vue.nextTick(() => {
callback && callback();
});
},
__emit() {
const args = [].slice.call(arguments, 0);
let eventName = args[0];
eventName = `on${eventName[0].toUpperCase()}${eventName.substring(1)}`;
const event = this.$props[eventName] || this.$attrs[eventName];
if (args.length && event) {
if (Array.isArray(event)) {
for (let i = 0, l = event.length; i < l; i++)
event[i](...args.slice(1));
} else {
event(...args.slice(1));
}
}
}
}
};
function createRef() {
const func = (node) => {
func.current = node;
};
return func;
}
function eagerComputed(fn) {
const result = vue.shallowRef();
vue.watchEffect(
() => {
result.value = fn();
},
{
flush: "sync"
// needed so updates are immediate.
}
);
return result;
}
function initDefaultProps(types, defaultProps) {
const propTypes = { ...types };
Object.keys(defaultProps).forEach((k) => {
const prop = propTypes[k];
if (prop) {
if (prop.type || prop.default)
prop.default = defaultProps[k];
else if (prop.def)
prop.def(defaultProps[k]);
else
propTypes[k] = { type: prop, default: defaultProps[k] };
} else {
throw new Error(`not have