UNPKG

winbox-ui-next

Version:

We Design Vue 2.0: A Vue.js 3 UI Library

1,523 lines 1.78 MB
var __defProp = Object.defineProperty; var __defProps = Object.defineProperties; var __getOwnPropDescs = Object.getOwnPropertyDescriptors; var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __hasOwnProp = Object.prototype.hasOwnProperty; var __propIsEnum = Object.prototype.propertyIsEnumerable; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __spreadValues = (a, b) => { for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]); if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) { if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]); } return a; }; var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); var __objRest = (source, exclude) => { var target = {}; for (var prop in source) if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop]; if (source != null && __getOwnPropSymbols) for (var prop of __getOwnPropSymbols(source)) { if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) target[prop] = source[prop]; } return target; }; (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.Winbox = factory(global2.Vue)); })(this, function(vue) { "use strict"; const opt$1 = Object.prototype.toString; function isArray$3(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$2(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 isWindow(el) { return el === window; } const isComponentInstance = (value) => { return (value == null ? void 0 : value.$) !== void 0; }; function isDayjs(time) { return isObject$2(time) && "$y" in time && "$M" in time && "$D" in time && "$d" in time && "$H" in time && "$m" in time && "$s" in time; } const configProviderInjectionKey$1 = Symbol("WinboxConfigProvider"); 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" }, 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" }, colorPicker: { undo: "\u64A4\u9500", redo: "\u91CD\u505A", confirm: "\u786E\u8BA4", clear: "\u6E05\u9664" } }; 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$1, 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 { locale, t: transform }; }; const COMPONENT_PREFIX = "W"; const CLASS_PREFIX = "w"; const GLOBAL_CONFIG_NAME = "$w"; 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] = __spreadProps(__spreadValues({}, (_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$1, void 0); const prefix2 = (_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 `${prefix2}-${componentName}`; } return prefix2; }; 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, ctx2) { if (ctx2 === void 0) { ctx2 = null; } for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) { var entry = _a[_i]; callback.call(ctx2, entry[1], entry[0]); } }; return class_1; }(); }(); var isBrowser$2 = 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$2 || 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$2 || !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$2) { 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 ctx2 = this.callbackCtx_; var entries = this.activeObservations_.map(function(observation) { return new ResizeObserverEntry(observation.target, observation.broadcastRect()); }); this.callback_.call(ctx2, entries, ctx2); 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" ? 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(); }; var ShapeFlags; (function(ShapeFlags2) { ShapeFlags2[ShapeFlags2["ELEMENT"] = 1] = "ELEMENT"; ShapeFlags2[ShapeFlags2["FUNCTIONAL_COMPONENT"] = 2] = "FUNCTIONAL_COMPONENT"; ShapeFlags2[ShapeFlags2["STATEFUL_COMPONENT"] = 4] = "STATEFUL_COMPONENT"; ShapeFlags2[ShapeFlags2["COMPONENT"] = 6] = "COMPONENT"; ShapeFlags2[ShapeFlags2["TEXT_CHILDREN"] = 8] = "TEXT_CHILDREN"; ShapeFlags2[ShapeFlags2["ARRAY_CHILDREN"] = 16] = "ARRAY_CHILDREN"; ShapeFlags2[ShapeFlags2["SLOTS_CHILDREN"] = 32] = "SLOTS_CHILDREN"; ShapeFlags2[ShapeFlags2["TELEPORT"] = 64] = "TELEPORT"; ShapeFlags2[ShapeFlags2["SUSPENSE"] = 128] = "SUSPENSE"; ShapeFlags2[ShapeFlags2["COMPONENT_SHOULD_KEEP_ALIVE"] = 256] = "COMPONENT_SHOULD_KEEP_ALIVE"; ShapeFlags2[ShapeFlags2["COMPONENT_KEPT_ALIVE"] = 512] = "COMPONENT_KEPT_ALIVE"; })(ShapeFlags || (ShapeFlags = {})); var PatchFlags; (function(PatchFlags2) { PatchFlags2[PatchFlags2["TEXT"] = 1] = "TEXT"; PatchFlags2[PatchFlags2["CLASS"] = 2] = "CLASS"; PatchFlags2[PatchFlags2["STYLE"] = 4] = "STYLE"; PatchFlags2[PatchFlags2["PROPS"] = 8] = "PROPS"; PatchFlags2[PatchFlags2["FULL_PROPS"] = 16] = "FULL_PROPS"; PatchFlags2[PatchFlags2["HYDRATE_EVENTS"] = 32] = "HYDRATE_EVENTS"; PatchFlags2[PatchFlags2["STABLE_FRAGMENT"] = 64] = "STABLE_FRAGMENT"; PatchFlags2[PatchFlags2["KEYED_FRAGMENT"] = 128] = "KEYED_FRAGMENT"; PatchFlags2[PatchFlags2["UNKEYED_FRAGMENT"] = 256] = "UNKEYED_FRAGMENT"; PatchFlags2[PatchFlags2["NEED_PATCH"] = 512] = "NEED_PATCH"; PatchFlags2[PatchFlags2["DYNAMIC_SLOTS"] = 1024] = "DYNAMIC_SLOTS"; PatchFlags2[PatchFlags2["DEV_ROOT_FRAGMENT"] = 2048] = "DEV_ROOT_FRAGMENT"; PatchFlags2[PatchFlags2["HOISTED"] = -1] = "HOISTED"; PatchFlags2[PatchFlags2["BAIL"] = -2] = "BAIL"; })(PatchFlags || (PatchFlags = {})); const getValueFromSlotsOrProps = (name, props, slots) => { if (slots == null ? void 0 : slots[name]) { return slots[name]; } if (props == null ? void 0 : props[name]) { return () => props[name]; } return void 0; }; const isElement = (vn) => { return Boolean(vn && vn.shapeFlag & 1); }; const isComponent = (vn, type) => { return Boolean(vn && vn.shapeFlag & 6); }; const isNamedComponent = (child, name) => { return isComponent(child, child.type) && child.type.name === name; }; 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$3(child)) { const result = getFirstComponent(child); if (result) return result; } } return void 0; }; const getComponentNumber = (vNodes, componentName) => { let count = 0; for (const item of vNodes) { if (isComponent(item, item.type) && item.type.name === componentName) { count++; } else if (isArrayChildren(item, item.children)) { count += getComponentNumber(item.children, componentName); } } return count; }; const isEmptyChildren = (children) => { if (!children) { return true; } for (const item of children) { if (item.children) { return false; } } return true; }; const getChildrenComponents = (children, name, props, startIndex = 0) => { var _a, _b, _c; const result = []; for (const item of children) { if (isNamedComponent(item, name)) { if (props) { const index2 = startIndex + result.length; const extraProps = isFunction$1(props) ? props(item, index2) : props; result.push(vue.cloneVNode(item, extraProps, true)); } else { result.push(item); } } else if (isArrayChildren(item, item.children)) { result.push(...getChildrenComponents(item.children, name, props, result.length)); } else if (isSlotsChildren(item, item.children)) { const defaultChildren = (_c = (_b = (_a = item.children).default) == null ? void 0 : _b.call(_a)) != null ? _c : []; result.push(...getChildrenComponents(defaultChildren, name, props, result.length)); } } return result; }; const mergeFirstChild = (children, extraProps) => { if (children && children.length > 0) { for (let i = 0; i < children.length; i++) { const child = children[i]; if (isElement(child) || isComponent(child)) { const props = isFunction$1(extraProps) ? extraProps(child) : extraProps; children[i] = 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$3(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 getBooleanProp = (value) => { return !!(value || isString$1(value)); }; 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$3(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 isServerRendering = (() => { try { return !(typeof window !== "undefined" && document !== void 0); } catch (e2) { return true; } })(); const on$1 = (() => { if (isServerRendering) { return NOOP; } return (element, event, handler, options = false) => { element.addEventListener(event, handler, options); }; })(); const off$1 = (() => { if (isServerRendering) { return NOOP; } return (element, type, handler, options = false) => { element.removeEventListener(type, handler, options); }; })(); const contains = (root2, ele) => { if (!root2 || !ele) { return false; } let node = ele; while (node) { if (node === root2) { return true; } node = node.parentNode; } return false; }; const getOverlay = (type) => { const popper = document.createElement("div"); popper.setAttribute("class", `w-overlay w-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 - (document.documentElement.offsetWidth || document.body.offsetWidth) : element.offsetWidth - element.clientWidth; }; var _export_sfc = (sfc, props) => { for (const [key, val] of props) { sfc[key] = val; } return sfc; }; function getTargetRect(target2) { return isWindow(target2) ? { top: 0, bottom: window.innerHeight } : target2.getBoundingClientRect(); } const _sfc_main$35 = 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] }, onChange: { type: [Function, Array] } }, emits: [ "change" ], 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 = __spreadValues(__spreadValues({}, newFixedStyles), newIsFixed ? newPlaceholderStyles : {}); }); vue.watchEffect((onInvalidate) => { const element = target2 && target2.value !== window && getElement(target2.value) || window; targetRef.value = element; if (element) { on$1(element, "scroll", updatePositionThrottle); on$1(element, "resize", updatePositionThrottle); onInvalidate(() => { off$1(element, "scroll", updatePositionThrottle); off$1(element, "resize", updatePositionThrottle); }); } }); vue.watchEffect((onInvalidate) => { if (!targetRef.value) return; const container2 = targetContainer && targetContainer.value !== window && getElement(targetContainer.value) || window; if (container2) { on$1(container2, "scroll", updatePositionThrottle); on$1(container2, "resize", updatePositionThrottle); onInvalidate(() => { off$1(container2, "scroll", updatePositionThrottle); off$1(container2, "resize", updatePositionThrottle); }); } }); return { wrapperRef, isFixed, classNames, placeholderStyles, fixedStyles, updatePositionThrottle }; }, methods: { updatePosition() { this.updatePositionThrottle(); } } }); const _hoisted_1$1h = { ref: "wrapperRef" }; function _sfc_render$34(_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$1h, [ _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$35, [["render", _sfc_render$34]]); const Affix = Object.assign(_Affix, { install: (app, options) => { setGlobalConfig(app, options); const componentPrefix = getComponentPrefix(options); app.component(componentPrefix + _Affix.name, _Affix); } }); const STATUSES = ["normal", "success", "warning", "danger"]; const MESSAGE_TYPES = ["info", "success", "warning", "error"]; const TRIGGER_POSITIONS = [ "top", "tl", "tr", "bottom", "bl", "br", "left", "lt", "lb", "right", "rt", "rb" ]; const TRIGGER_EVENTS$1 = [ "hover", "click", "focus", "contextMenu" ]; const INPUT_EVENTS = [ "onFocus", "onFocusin", "onFocusout", "onBlur", "onChange", "onBeforeinput", "onInput", "onReset", "onSubmit", "onInvalid", "onKeydown", "onKeypress", "onKeyup", "onCopy", "onCut", "onPaste", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onSelect", "autocomplete", "autofocus", "maxlength", "minlength", "name", "pattern", "readonly", "required" ]; const _sfc_main$34 = 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); } }, spin: Boolean }, setup(props) { const prefixCls = getPrefixCls("icon"); const cls = vue.computed(() => [prefixCls, `${prefixCls}-close`, { [`${prefixCls}-spin`]: props.spin }]); const innerStyle = vue.computed(() => { if (props.size) { return { fontSize: isNumber$1(props.size) ? `${props.size}px` : props.size }; } return void 0; }); return { cls, innerStyle }; } }); const _hoisted_1$1g = ["stroke-width", "stroke-linecap", "stroke-linejoin"]; const _hoisted_2$13 = /* @__PURE__ */ 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); const _hoisted_3$10 = [ _hoisted_2$13 ]; function _sfc_render$33(_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 }, _hoisted_3$10, 14, _hoisted_1$1g); } var _IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$34, [["render", _sfc_render$33]]); 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$33 = 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); } }, spin: Boolean }, setup(props) { const prefixCls = getPrefixCls("icon"); const cls = vue.computed(() => [prefixCls, `${prefixCls}-info-circle-fill`, { [`${prefixCls}-spin`]: props.spin }]); const innerStyle = vue.computed(() => { if (props.size) { return { fontSize: isNumber$1(props.size) ? `${props.size}px` : props.size }; } return void 0; }); return { cls, innerStyle }; } }); const _hoisted_1$1f = ["stroke-width", "stroke-linecap", "stroke-linejoin"]; const _hoisted_2$12 = /* @__PURE__ */ 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); const _hoisted_3$$ = [ _hoisted_2$12 ]; function _sfc_render$32(_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", stro