@antdv/pro-list
Version:
@antdv/pro-list
1,529 lines (1,528 loc) • 4.96 MB
JavaScript
(function(global2, factory) {
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("vue")) : typeof define === "function" && define.amd ? define(["exports", "vue"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2["pro-list"] = {}, global2.Vue));
})(this, function(exports2, require$$1) {
"use strict";
function _typeof$2(o2) {
"@babel/helpers - typeof";
return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
return typeof o3;
} : function(o3) {
return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
}, _typeof$2(o2);
}
function toPrimitive$1(t2, r2) {
if ("object" != _typeof$2(t2) || !t2) return t2;
var e2 = t2[Symbol.toPrimitive];
if (void 0 !== e2) {
var i2 = e2.call(t2, r2);
if ("object" != _typeof$2(i2)) return i2;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r2 ? String : Number)(t2);
}
function toPropertyKey$1(t2) {
var i2 = toPrimitive$1(t2, "string");
return "symbol" == _typeof$2(i2) ? i2 : i2 + "";
}
function _defineProperty$Y(e2, r2, t2) {
return (r2 = toPropertyKey$1(r2)) in e2 ? Object.defineProperty(e2, r2, {
value: t2,
enumerable: true,
configurable: true,
writable: true
}) : e2[r2] = t2, e2;
}
function ownKeys$1(e2, r2) {
var t2 = Object.keys(e2);
if (Object.getOwnPropertySymbols) {
var o2 = Object.getOwnPropertySymbols(e2);
r2 && (o2 = o2.filter(function(r3) {
return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
})), t2.push.apply(t2, o2);
}
return t2;
}
function _objectSpread2$3(e2) {
for (var r2 = 1; r2 < arguments.length; r2++) {
var t2 = null != arguments[r2] ? arguments[r2] : {};
r2 % 2 ? ownKeys$1(Object(t2), true).forEach(function(r3) {
_defineProperty$Y(e2, r3, t2[r3]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$1(Object(t2)).forEach(function(r3) {
Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
});
}
return e2;
}
function _extends$2() {
return _extends$2 = Object.assign ? Object.assign.bind() : function(n2) {
for (var e2 = 1; e2 < arguments.length; e2++) {
var t2 = arguments[e2];
for (var r2 in t2) ({}).hasOwnProperty.call(t2, r2) && (n2[r2] = t2[r2]);
}
return n2;
}, _extends$2.apply(null, arguments);
}
const isFunction$2 = (val) => typeof val === "function";
const isArray$2 = Array.isArray;
const isString$2 = (val) => typeof val === "string";
const isObject$4 = (val) => val !== null && typeof val === "object";
const onRE = /^on[^a-z]/;
const isOn = (key2) => onRE.test(key2);
const cacheStringFunction$1 = (fn) => {
const cache = /* @__PURE__ */ Object.create(null);
return (str) => {
const hit = cache[str];
return hit || (cache[str] = fn(str));
};
};
const camelizeRE$1 = /-(\w)/g;
const camelize$1 = cacheStringFunction$1((str) => {
return str.replace(camelizeRE$1, (_2, c2) => c2 ? c2.toUpperCase() : "");
});
const hyphenateRE = /\B([A-Z])/g;
const hyphenate = cacheStringFunction$1((str) => {
return str.replace(hyphenateRE, "-$1").toLowerCase();
});
const capitalize = cacheStringFunction$1((str) => {
return str.charAt(0).toUpperCase() + str.slice(1);
});
const hasOwnProperty$f = Object.prototype.hasOwnProperty;
const hasOwn$3 = (val, key2) => hasOwnProperty$f.call(val, key2);
function resolvePropValue(options, props2, key2, value) {
const opt = options[key2];
if (opt != null) {
const hasDefault = hasOwn$3(opt, "default");
if (hasDefault && value === void 0) {
const defaultValue = opt.default;
value = opt.type !== Function && isFunction$2(defaultValue) ? defaultValue() : defaultValue;
}
if (opt.type === Boolean) {
if (!hasOwn$3(props2, key2) && !hasDefault) {
value = false;
} else if (value === "") {
value = true;
}
}
}
return value;
}
function toPx(val) {
if (typeof val === "number") return `${val}px`;
return val;
}
function renderHelper(v2) {
let props2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
let defaultV = arguments.length > 2 ? arguments[2] : void 0;
if (typeof v2 === "function") {
return v2(props2);
}
return v2 !== null && v2 !== void 0 ? v2 : defaultV;
}
function wrapPromiseFn(openFn) {
let closeFn;
const closePromise = new Promise((resolve) => {
closeFn = openFn(() => {
resolve(true);
});
});
const result = () => {
closeFn === null || closeFn === void 0 ? void 0 : closeFn();
};
result.then = (filled, rejected) => closePromise.then(filled, rejected);
result.promise = closePromise;
return result;
}
function classNames$2() {
const classes = [];
for (let i2 = 0; i2 < arguments.length; i2++) {
const value = i2 < 0 || arguments.length <= i2 ? void 0 : arguments[i2];
if (!value) continue;
if (isString$2(value)) {
classes.push(value);
} else if (isArray$2(value)) {
for (let i3 = 0; i3 < value.length; i3++) {
const inner = classNames$2(value[i3]);
if (inner) {
classes.push(inner);
}
}
} else if (isObject$4(value)) {
for (const name in value) {
if (value[name]) {
classes.push(name);
}
}
}
}
return classes.join(" ");
}
var MapShim = function() {
if (typeof Map !== "undefined") {
return Map;
}
function getIndex(arr, key2) {
var result = -1;
arr.some(function(entry, index2) {
if (entry[0] === key2) {
result = index2;
return true;
}
return false;
});
return result;
}
return (
/** @class */
function() {
function class_1() {
this.__entries__ = [];
}
Object.defineProperty(class_1.prototype, "size", {
/**
* @returns {boolean}
*/
get: function() {
return this.__entries__.length;
},
enumerable: true,
configurable: true
});
class_1.prototype.get = function(key2) {
var index2 = getIndex(this.__entries__, key2);
var entry = this.__entries__[index2];
return entry && entry[1];
};
class_1.prototype.set = function(key2, value) {
var index2 = getIndex(this.__entries__, key2);
if (~index2) {
this.__entries__[index2][1] = value;
} else {
this.__entries__.push([key2, value]);
}
};
class_1.prototype.delete = function(key2) {
var entries = this.__entries__;
var index2 = getIndex(entries, key2);
if (~index2) {
entries.splice(index2, 1);
}
};
class_1.prototype.has = function(key2) {
return !!~getIndex(this.__entries__, key2);
};
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, _a2 = this.__entries__; _i < _a2.length; _i++) {
var entry = _a2[_i];
callback.call(ctx, entry[1], entry[0]);
}
};
return class_1;
}()
);
}();
var isBrowser$1 = 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$1(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 = (
/** @class */
function() {
function ResizeObserverController2() {
this.connected_ = false;
this.mutationEventsAdded_ = false;
this.mutationsObserver_ = null;
this.observers_ = [];
this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
this.refresh = throttle$1(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$1 || 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$1 || !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(_a2) {
var _b2 = _a2.propertyName, propertyName = _b2 === void 0 ? "" : _b2;
var isReflowProperty = transitionKeys.some(function(key2) {
return !!~propertyName.indexOf(key2);
});
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(target, props2) {
for (var _i = 0, _a2 = Object.keys(props2); _i < _a2.length; _i++) {
var key2 = _a2[_i];
Object.defineProperty(target, key2, {
value: props2[key2],
enumerable: false,
writable: false,
configurable: true
});
}
return target;
};
var getWindowOf = function(target) {
var ownerGlobal = target && target.ownerDocument && target.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, position2) {
var value = styles["border-" + position2 + "-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 position2 = positions_1[_i];
var value = styles["padding-" + position2];
paddings[position2] = toFloat(value);
}
return paddings;
}
function getSVGContentRect(target) {
var bbox = target.getBBox();
return createRectInit(0, 0, bbox.width, bbox.height);
}
function getHTMLElementContentRect(target) {
var clientWidth = target.clientWidth, clientHeight = target.clientHeight;
if (!clientWidth && !clientHeight) {
return emptyRect;
}
var styles = getWindowOf(target).getComputedStyle(target);
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(target)) {
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(target) {
return target instanceof getWindowOf(target).SVGGraphicsElement;
};
}
return function(target) {
return target instanceof getWindowOf(target).SVGElement && typeof target.getBBox === "function";
};
}();
function isDocumentElement(target) {
return target === getWindowOf(target).document.documentElement;
}
function getContentRect(target) {
if (!isBrowser$1) {
return emptyRect;
}
if (isSVGGraphicsElement(target)) {
return getSVGContentRect(target);
}
return getHTMLElementContentRect(target);
}
function createReadOnlyRect(_a2) {
var x2 = _a2.x, y2 = _a2.y, width = _a2.width, height = _a2.height;
var Constr = typeof DOMRectReadOnly !== "undefined" ? DOMRectReadOnly : Object;
var rect = Object.create(Constr.prototype);
defineConfigurable(rect, {
x: x2,
y: y2,
width,
height,
top: y2,
right: x2 + width,
bottom: height + y2,
left: x2
});
return rect;
}
function createRectInit(x2, y2, width, height) {
return { x: x2, y: y2, width, height };
}
var ResizeObservation = (
/** @class */
function() {
function ResizeObservation2(target) {
this.broadcastWidth = 0;
this.broadcastHeight = 0;
this.contentRect_ = createRectInit(0, 0, 0, 0);
this.target = target;
}
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 = (
/** @class */
/* @__PURE__ */ function() {
function ResizeObserverEntry2(target, rectInit) {
var contentRect = createReadOnlyRect(rectInit);
defineConfigurable(this, { target, contentRect });
}
return ResizeObserverEntry2;
}()
);
var ResizeObserverSPI = (
/** @class */
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(target) {
if (!arguments.length) {
throw new TypeError("1 argument required, but only 0 present.");
}
if (typeof Element === "undefined" || !(Element instanceof Object)) {
return;
}
if (!(target instanceof getWindowOf(target).Element)) {
throw new TypeError('parameter 1 is not of type "Element".');
}
var observations = this.observations_;
if (observations.has(target)) {
return;
}
observations.set(target, new ResizeObservation(target));
this.controller_.addObserver(this);
this.controller_.refresh();
};
ResizeObserverSPI2.prototype.unobserve = function(target) {
if (!arguments.length) {
throw new TypeError("1 argument required, but only 0 present.");
}
if (typeof Element === "undefined" || !(Element instanceof Object)) {
return;
}
if (!(target instanceof getWindowOf(target).Element)) {
throw new TypeError('parameter 1 is not of type "Element".');
}
var observations = this.observations_;
if (!observations.has(target)) {
return;
}
observations.delete(target);
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 = (
/** @class */
/* @__PURE__ */ 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(method2) {
ResizeObserver$2.prototype[method2] = function() {
var _a2;
return (_a2 = observers.get(this))[method2].apply(_a2, arguments);
};
});
var index$1 = function() {
if (typeof global$1.ResizeObserver !== "undefined") {
return global$1.ResizeObserver;
}
return ResizeObserver$2;
}();
const ResizeObserver_es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: index$1
}, Symbol.toStringTag, { value: "Module" }));
const isValid$4 = (value) => {
return value !== void 0 && value !== null && value !== "";
};
const initDefaultProps$1 = (types2, defaultProps2) => {
const propTypes2 = _extends$2({}, types2);
Object.keys(defaultProps2).forEach((k2) => {
const prop = propTypes2[k2];
if (prop) {
if (prop.type || prop.default) {
prop.default = defaultProps2[k2];
} else if (prop.def) {
prop.def(defaultProps2[k2]);
} else {
propTypes2[k2] = {
type: prop,
default: defaultProps2[k2]
};
}
} else {
throw new Error(`not have ${k2} prop`);
}
});
return propTypes2;
};
const splitAttrs = (attrs) => {
const allAttrs = Object.keys(attrs);
const eventAttrs = {};
const onEvents = {};
const extraAttrs = {};
for (let i2 = 0, l2 = allAttrs.length; i2 < l2; i2++) {
const key2 = allAttrs[i2];
if (isOn(key2)) {
eventAttrs[key2[2].toLowerCase() + key2.slice(3)] = attrs[key2];
onEvents[key2] = attrs[key2];
} else {
extraAttrs[key2] = attrs[key2];
}
}
return {
onEvents,
events: eventAttrs,
extraAttrs
};
};
const parseStyleText = function() {
let cssText = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
let camel = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
const res = {};
const listDelimiter = /;(?![^(]*\))/g;
const propertyDelimiter = /:(.+)/;
if (typeof cssText === "object") return cssText;
cssText.split(listDelimiter).forEach(function(item) {
if (item) {
const tmp = item.split(propertyDelimiter);
if (tmp.length > 1) {
const k2 = camel ? camelize$1(tmp[0].trim()) : tmp[0].trim();
res[k2] = tmp[1].trim();
}
}
});
return res;
};
const hasProp = (instance, prop) => {
return instance[prop] !== void 0;
};
const skipFlattenKey$1 = Symbol("skipFlatten");
const flattenChildren$1 = function() {
let children = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
let filterEmpty2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
const temp = Array.isArray(children) ? children : [children];
const res = [];
temp.forEach((child) => {
if (Array.isArray(child)) {
res.push(...flattenChildren$1(child, filterEmpty2));
} else if (child && child.type === require$$1.Fragment) {
if (child.key === skipFlattenKey$1) {
res.push(child);
} else {
res.push(...flattenChildren$1(child.children, filterEmpty2));
}
} else if (child && require$$1.isVNode(child)) {
if (filterEmpty2 && !isEmptyElement$1(child)) {
res.push(child);
} else if (!filterEmpty2) {
res.push(child);
}
} else if (isValid$4(child)) {
res.push(child);
}
});
return res;
};
const getSlot = function(self2) {
let name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "default";
let options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
if (require$$1.isVNode(self2)) {
if (self2.type === require$$1.Fragment) {
return name === "default" ? flattenChildren$1(self2.children) : [];
} else if (self2.children && self2.children[name]) {
return flattenChildren$1(self2.children[name](options));
} else {
return [];
}
} else {
const res = self2.$slots[name] && self2.$slots[name](options);
return flattenChildren$1(res);
}
};
const findDOMNode = (instance) => {
var _a2;
let node2 = ((_a2 = instance === null || instance === void 0 ? void 0 : instance.vnode) === null || _a2 === void 0 ? void 0 : _a2.el) || instance && (instance.$el || instance);
while (node2 && !node2.tagName) {
node2 = node2.nextSibling;
}
return node2;
};
const getOptionProps = (instance) => {
const res = {};
if (instance.$ && instance.$.vnode) {
const props2 = instance.$.vnode.props || {};
Object.keys(instance.$props).forEach((k2) => {
const v2 = instance.$props[k2];
const hyphenateKey = hyphenate(k2);
if (v2 !== void 0 || hyphenateKey in props2) {
res[k2] = v2;
}
});
} else if (require$$1.isVNode(instance) && typeof instance.type === "object") {
const originProps = instance.props || {};
const props2 = {};
Object.keys(originProps).forEach((key2) => {
props2[camelize$1(key2)] = originProps[key2];
});
const options = instance.type.props || {};
Object.keys(options).forEach((k2) => {
const v2 = resolvePropValue(options, props2, k2, props2[k2]);
if (v2 !== void 0 || k2 in props2) {
res[k2] = v2;
}
});
}
return res;
};
const getComponent = function(instance) {
let prop = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "default";
let options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : instance;
let execute = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true;
let com = void 0;
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 (require$$1.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 === require$$1.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$1(com);
com = com.length === 1 ? com[0] : com;
com = com.length === 0 ? void 0 : com;
}
return com;
};
function getEvents() {
let ele = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
let on = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
let props2 = {};
if (ele.$) {
props2 = _extends$2(_extends$2({}, props2), ele.$attrs);
} else {
props2 = _extends$2(_extends$2({}, props2), ele.props);
}
return splitAttrs(props2)[on ? "onEvents" : "events"];
}
function getStyle$3(ele, camel) {
const props2 = (require$$1.isVNode(ele) ? ele.props : ele.$attrs) || {};
let style2 = props2.style || {};
if (typeof style2 === "string") {
style2 = parseStyleText(style2, camel);
}
return style2;
}
function isFragment$1(c2) {
return c2.length === 1 && c2[0].type === require$$1.Fragment;
}
function isEmptyElement$1(c2) {
return c2 && (c2.type === require$$1.Comment || c2.type === require$$1.Fragment && c2.children.length === 0 || c2.type === require$$1.Text && c2.children.trim() === "");
}
function isStringElement(c2) {
return c2 && c2.type === require$$1.Text;
}
function filterEmpty$1() {
let children = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
const res = [];
children.forEach((child) => {
if (Array.isArray(child)) {
res.push(...child);
} else if ((child === null || child === void 0 ? void 0 : child.type) === require$$1.Fragment) {
res.push(...filterEmpty$1(child.children));
} else {
res.push(child);
}
});
return res.filter((c2) => !isEmptyElement$1(c2));
}
function isValidElement$1(element) {
if (Array.isArray(element) && element.length === 1) {
element = element[0];
}
return element && element.__v_isVNode && typeof element.type !== "symbol";
}
function getPropsSlot(slots, props2) {
let prop = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "default";
var _a2, _b2;
return (_a2 = props2[prop]) !== null && _a2 !== void 0 ? _a2 : (_b2 = slots[prop]) === null || _b2 === void 0 ? void 0 : _b2.call(slots);
}
const ResizeObserver$1 = require$$1.defineComponent({
compatConfig: {
MODE: 3
},
name: "ResizeObserver",
props: {
disabled: Boolean,
onResize: Function
},
emits: ["resize"],
setup(props2, _ref) {
let {
slots
} = _ref;
const state = require$$1.reactive({
width: 0,
height: 0,
offsetHeight: 0,
offsetWidth: 0
});
let currentElement = null;
let resizeObserver = null;
const destroyObserver = () => {
if (resizeObserver) {
resizeObserver.disconnect();
resizeObserver = null;
}
};
const onResize = (entries) => {
const {
onResize: onResize2
} = props2;
const target = entries[0].target;
const {
width,
height
} = target.getBoundingClientRect();
const {
offsetWidth,
offsetHeight
} = target;
const fixedWidth = Math.floor(width);
const fixedHeight = Math.floor(height);
if (state.width !== fixedWidth || state.height !== fixedHeight || state.offsetWidth !== offsetWidth || state.offsetHeight !== offsetHeight) {
const size = {
width: fixedWidth,
height: fixedHeight,
offsetWidth,
offsetHeight
};
_extends$2(state, size);
if (onResize2) {
Promise.resolve().then(() => {
onResize2(_extends$2(_extends$2({}, size), {
offsetWidth,
offsetHeight
}), target);
});
}
}
};
const instance = require$$1.getCurrentInstance();
const registerObserver = () => {
const {
disabled
} = props2;
if (disabled) {
destroyObserver();
return;
}
const element = findDOMNode(instance);
const elementChanged = element !== currentElement;
if (elementChanged) {
destroyObserver();
currentElement = element;
}
if (!resizeObserver && element) {
resizeObserver = new index$1(onResize);
resizeObserver.observe(element);
}
};
require$$1.onMounted(() => {
registerObserver();
});
require$$1.onUpdated(() => {
registerObserver();
});
require$$1.onUnmounted(() => {
destroyObserver();
});
require$$1.watch(() => props2.disabled, () => {
registerObserver();
}, {
flush: "post"
});
return () => {
var _a2;
return (_a2 = slots.default) === null || _a2 === void 0 ? void 0 : _a2.call(slots)[0];
};
}
});
let raf$1 = (callback) => setTimeout(callback, 16);
let caf = (num) => clearTimeout(num);
if (typeof window !== "undefined" && "requestAnimationFrame" in window) {
raf$1 = (callback) => window.requestAnimationFrame(callback);
caf = (handle) => window.cancelAnimationFrame(handle);
}
let rafUUID = 0;
const rafIds = /* @__PURE__ */ new Map();
function cleanup(id) {
rafIds.delete(id);
}
function wrapperRaf(callback) {
let times = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1;
rafUUID += 1;
const id = rafUUID;
function callRef(leftTimes) {
if (leftTimes === 0) {
cleanup(id);
callback();
} else {
const realId = raf$1(() => {
callRef(leftTimes - 1);
});
rafIds.set(id, realId);
}
}
callRef(times);
return id;
}
wrapperRaf.cancel = (id) => {
const realId = rafIds.get(id);
cleanup(realId);
return caf(realId);
};
const tuple$2 = function() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return args;
};
const tupleNum$1 = function() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
return args;
};
const withInstall$1 = (comp) => {
const c2 = comp;
c2.install = function(app) {
app.component(c2.displayName || c2.name, comp);
};
return comp;
};
function eventType$1() {
return {
type: [Function, Array]
};
}
function objectType$2(defaultVal) {
return {
type: Object,
default: defaultVal
};
}
function booleanType$1(defaultVal) {
return {
type: Boolean,
default: defaultVal
};
}
function functionType$1(defaultVal) {
return {
type: Function,
default: defaultVal
};
}
function anyType$2(defaultVal, required2) {
const type2 = {
validator: () => true,
default: defaultVal
};
return type2;
}
function vNodeType$2() {
return {
validator: () => true
};
}
function arrayType$2(defaultVal) {
return {
type: Array,
default: defaultVal
};
}
function stringType$2(defaultVal) {
return {
type: String,
default: defaultVal
};
}
function someType$1(types2, defaultVal) {
return types2 ? {
type: types2,
default: defaultVal
} : anyType$2(defaultVal);
}
let supportsPassive$1 = false;
try {
const opts = Object.defineProperty({}, "passive", {
get() {
supportsPassive$1 = true;
}
});
window.addEventListener("testPassive", null, opts);
window.removeEventListener("testPassive", null, opts);
} catch (e2) {
}
function addEventListenerWrap(target, eventType2, cb, option) {
if (target && target.addEventListener) {
let opt = option;
if (opt === void 0 && supportsPassive$1 && (eventType2 === "touchstart" || eventType2 === "touchmove" || eventType2 === "wheel")) {
opt = {
passive: false
};
}
target.addEventListener(eventType2, cb, opt);
}
return {
remove: () => {
if (target && target.removeEventListener) {
target.removeEventListener(eventType2, cb);
}
}
};
}
const defaultIconPrefixCls$1 = "anticon";
const GlobalFormContextKey$1 = Symbol("GlobalFormContextKey");
const useProvideGlobalForm$1 = (state) => {
require$$1.provide(GlobalFormContextKey$1, state);
};
const useInjectGlobalForm$1 = () => {
return require$$1.inject(GlobalFormContextKey$1, {
validateMessages: require$$1.computed(() => void 0)
});
};
const configProviderProps$1 = () => ({
iconPrefixCls: String,
getTargetContainer: {
type: Function
},
getPopupContainer: {
type: Function
},
prefixCls: String,
getPrefixCls: {
type: Function
},
renderEmpty: {
type: Function
},
transformCellText: {
type: Function
},
csp: objectType$2(),
input: objectType$2(),
autoInsertSpaceInButton: {
type: Boolean,
default: void 0
},
locale: objectType$2(),
pageHeader: objectType$2(),
componentSize: {
type: String
},
componentDisabled: {
type: Boolean,
default: void 0
},
direction: {
type: String,
default: "ltr"
},
space: objectType$2(),
virtual: {
type: Boolean,
default: void 0
},
dropdownMatchSelectWidth: {
type: [Number, Boolean],
default: true
},
form: objectType$2(),
pagination: objectType$2(),
theme: objectType$2(),
select: objectType$2(),
wave: objectType$2()
});
const configProviderKey$1 = Symbol("configProvider");
const defaultConfigProvider$1 = {
getPrefixCls: (suffixCls, customizePrefixCls) => {
if (customizePrefixCls) return customizePrefixCls;
return suffixCls ? `ant-${suffixCls}` : "ant";
},
iconPrefixCls: require$$1.computed(() => defaultIconPrefixCls$1),
getPopupContainer: require$$1.computed(() => () => document.body),
direction: require$$1.computed(() => "ltr")
};
const useConfigContextInject$1 = () => {
return require$$1.inject(configProviderKey$1, defaultConfigProvider$1);
};
const useConfigContextProvider$1 = (props2) => {
return require$$1.provide(configProviderKey$1, props2);
};
const DisabledContextKey = Symbol("DisabledContextKey");
const useInjectDisabled = () => {
return require$$1.inject(DisabledContextKey, require$$1.ref(void 0));
};
const useProviderDisabled = (disabled) => {
const parentDisabled = useInjectDisabled();
require$$1.provide(DisabledContextKey, require$$1.computed(() => {
var _a2;
return (_a2 = disabled.value) !== null && _a2 !== void 0 ? _a2 : parentDisabled.value;
}));
return disabled;
};
const enUS = {
// Options.jsx
items_per_page: "/ page",
jump_to: "Go to",
jump_to_confirm: "confirm",
page: "",
// Pagination.jsx
prev_page: "Previous Page",
next_page: "Next Page",
prev_5: "Previous 5 Pages",
next_5: "Next 5 Pages",
prev_3: "Previous 3 Pages",
next_3: "Next 3 Pages"
};
const locale$3 = {
locale: "en_US",
today: "Today",
now: "Now",
backToToday: "Back to today",
ok: "Ok",
clear: "Clear",
month: "Month",
year: "Year",
timeSelect: "select time",
dateSelect: "select date",
weekSelect: "Choose a week",
monthSelect: "Choose a month",
yearSelect: "Choose a year",
decadeSelect: "Choose a decade",
yearFormat: "YYYY",
dateFormat: "M/D/YYYY",
dayFormat: "D",
dateTimeFormat: "M/D/YYYY HH:mm:ss",
monthBeforeYear: true,
previousMonth: "Previous month (PageUp)",
nextMonth: "Next month (PageDown)",
previousYear: "Last year (Control + left)",
nextYear: "Next year (Control + right)",
previousDecade: "Last decade",
nextDecade: "Next decade",
previousCentury: "Last century",
nextCentury: "Next century"
};
const locale$2 = {
placeholder: "Select time",
rangePlaceholder: ["Start time", "End time"]
};
const locale$1 = {
lang: _extends$2({
placeholder: "Select date",
yearPlaceholder: "Select year",
quarterPlaceholder: "Select quarter",
monthPlaceholder: "Select month",
weekPlaceholder: "Select week",
rangePlaceholder: ["Start date", "End date"],
rangeYearPlaceholder: ["Start year", "End year"],
rangeQuarterPlaceholder: ["Start quarter", "End quarter"],
rangeMonthPlaceholder: ["Start month", "End month"],
rangeWeekPlaceholder: ["Start week", "End week"]
}, locale$3),
timePickerLocale: _extends$2({}, locale$2)
};
const typeTemplate$2 = "${label} is not a valid ${type}";
const localeValues$1 = {
locale: "en",
Pagination: enUS,
DatePicker: locale$1,
TimePicker: locale$2,
Calendar: locale$1,
global: {
placeholder: "Please select"
},
Table: {
filterTitle: "Filter menu",
filterConfirm: "OK",
filterReset: "Reset",
filterEmptyText: "No filters",
filterCheckall: "Select all items",
filterSearchPlaceholder: "Search in filters",
emptyText: "No data",
selectAll: "Select current page",
selectInvert: "Invert current page",
selectNone: "Clear all data",
selectionAll: "Select all data",
sortTitle: "Sort",
expand: "Expand row",
collapse: "Collapse row",
triggerDesc: "Click to sort descending",
triggerAsc: "Click to sort ascending",
cancelSort: "Click to cancel sorting"
},
Tour: {
Next: "Next",
Previous: "Previous",
Finish: "Finish"
},
Modal: {
okText: "OK",
cancelText: "Cancel",
justOkText: "OK"
},
Popconfirm: {
okText: "OK",
cancelText: "Cancel"
},
Transfer: {
titles: ["", ""],
searchPlaceholder: "Search here",
itemUnit: "item",
itemsUnit: "items",
remove: "Remove",
selectCurrent: "Select current page",
removeCurrent: "Remove current page",
selectAll: "Select all data",
removeAll: "Remove all data",
selectInvert: "Invert current page"
},
Upload: {
uploading: "Uploading...",
removeFile: "Remove file",
uploadError: "Upload error",
previewFile: "Preview file",
downloadFile: "Download file"
},
Empty: {
description: "No data"
},
Icon: {
icon: "icon"
},
Text: {
edit: "Edit",
copy: "Copy",
copied: "Copied",
expand: "Expand"
},
PageHeader: {
back: "Back"
},
Form: {
optional: "(optional)",
defaultValidateMessages: {
default: "Field validation error for ${label}",
required: "Please enter ${label}",
enum: "${label} must be one of [${enum}]",
whitespace: "${label} cannot be a blank character",
date: {
format: "${label} date format is invalid",
parse: "${label} cannot be converted to a date",
invalid: "${label} is an invalid date"
},
types: {
string: typeTemplate$2,
method: typeTemplate$2,
array: typeTemplate$2,
object: typeTemplate$2,
number: typeTemplate$2,
date: typeTemplate$2,
boolean: typeTemplate$2,
integer: typeTemplate$2,
float: typeTemplate$2,
regexp: typeTemplate$2,
email: typeTemplate$2,
url: typeTemplate$2,
hex: typeTemplate$2
},
string: {
len: "${label} must be ${len} characters",
min: "${label} must be at least ${min} characters",
max: "${label} must be up to ${max} characters",
range: "${label} must be between ${min}-${max} characters"
},
number: {
len: "${label} must be equal to ${len}",
min: "${label} must be minimum ${min}",
max: "${label} must be maximum ${max}",
range: "${label} must be between ${min}-${max}"
},
array: {
len: "Must be ${len} ${label}",
min: "At least ${min} ${label}",
max: "At most ${max} ${label}",
range: "The amount of ${label} must be between ${min}-${max}"
},
pattern: {
mismatch: "${label} does not match the pattern ${pattern}"
}
}
},
Image: {
preview: "Preview"
},
QRCode: {
expired: "QR code expired",
refresh: "Refresh",
scanned: "Scanned"
}
};
const LocaleReceiver$2 = require$$1.defineComponent({
compatConfig: {
MODE: 3
},
name: "LocaleReceiver",
props: {
componentName: String,
defaultLocale: {
type: [Object, Function]
},
children: {
type: Function
}
},
setup(props2, _ref) {
let {
slots
} = _ref;
const localeData2 = require$$1.inject("localeData", {});
const locale2 = require$$1.computed(() => {
const {
componentName = "global",
defaultLocale
} = props2;
const locale3 = defaultLocale || localeValues$1[componentName || "global"];
const {
antLocale
} = localeData2;
const localeFromContext = componentName && antLocale ? antLocale[componentName] : {};
return _extends$2(_extends$2({}, typeof locale3 === "function" ? locale3() : locale3), localeFromContext || {});
});
const localeCode = require$$1.computed(() => {
const {
antLocale
} = localeData2;
const localeCode2 = antLocale && antLocale.locale;
if (antLocale && antLocale.exist && !localeCode2) {
return localeValues$1.locale;
}
return localeCode2;
});
return () => {
const children = props2.children || slots.default;
const {
antLocale
} = localeData2;
return children === null || children === void 0 ? void 0 : children(locale2.value, localeCode.value, antLocale);
};
}
});
function useLocaleReceiver(componentName, defaultLocale, propsLocale) {
const localeData2 = require$$1.inject("localeData", {});
const componentLocale = require$$1.computed(() => {
const {
antLocale
} = localeData2;
const locale2 = require$$1.unref(defaultLocale) || localeValues$1[componentName || "global"];
const localeFromContext = componentName && antLocale ? antLocale[componentName] : {};
return _extends$2(_extends$2(_extends$2({}, typeof locale2 === "function" ? locale2() : locale2), localeFromContext || {}), require$$1.unref(propsLocale) || {});
});
return [componentLocale];
}
function murmur2(str) {
var h2 = 0;
var k2, i2 = 0, len = str.length;
for (; len >= 4; ++i2, len -= 4) {
k2 = str.charCodeAt(i2) & 255 | (str.charCodeAt(++i2) & 255) << 8 | (str.charCodeAt(++i2) & 255) << 16 | (str.charCodeAt(++i2) & 255) << 24;
k2 = /* Math.imul(k, m): */
(k2 & 65535) * 1540483477 + ((k2 >>> 16) * 59797 << 16);
k2 ^= /* k >>> r: */
k2 >>> 24;
h2 = /* Math.imul(k, m): */
(k2 & 65535) * 1540483477 + ((k2 >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */
(h2 & 65535) * 1540483477 + ((h2 >>> 16) * 59797 << 16);
}
switch (len) {
case 3:
h2 ^= (str.charCodeAt(i2 + 2) & 255) << 16;
case 2:
h2 ^= (str.charCodeAt(i2 + 1) & 255) << 8;
case 1:
h2 ^= str.charCodeAt(i2) & 255;
h2 = /* Math.imul(h, m): */
(h2 & 65535) * 1540483477 + ((h2 >>> 16) * 59797 << 16);
}
h2 ^= h2 >>> 13;
h2 = /* Math.imul(h, m): */
(h2 & 65535) * 1540483477 + ((h2 >>> 16) * 59797 << 16);
return ((h2 ^ h2 >>> 15) >>> 0).toString(36);
}
const emotionHash_esm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: murmur2
}, Symbol.toStringTag, { value: "Module" }));
const SPLIT = "%";
class Entity {
constructor(instanceId) {
this.cache = /* @__PURE__ */ new Map();
this.instanceId = instanceId;
}
get(keys2) {
return this.cache.get(Array.isArray(keys2) ? keys2.join(SPLIT) : keys2) || null;
}
update(keys2, valueFn) {
const path2 = Array.isArray(keys2) ? keys2.join(SPLIT) : keys2;
const prevValue = this.cache.get(path2);
const nextValue = valueFn(prevValue);
if (nextValue === null) {
this.cache.delete(path2);
} else {
this.cache.set(path2, nextValue);
}
}
}
const ATTR_TOKEN = "data-token-hash";
const ATTR_MARK = "data-css-hash";
const ATTR_CACHE_PATH = "data-cache-path";
const CSS_IN_JS_INSTANCE = "__cssinjs_instance__";
function createCache() {
const cssinjsInstanceId = Math.random().toString(12).slice(2);
if (typeof document !== "undefined" && document.head && document.body) {
const styles = document.body.querySelectorAll(`style[${ATTR_MARK}]`) || [];
const {