@polyv/iar-lottery-ui 2.0.0-rc-20250116.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +8 -0
- package/index.d.ts +113 -0
- package/index.es.js +6742 -0
- package/index.umd.js +8 -0
- package/mobile-lottery-receive.cjs.js +8 -0
- package/mobile-lottery-receive.es.js +4755 -0
- package/mobile-lottery-receive.umd.js +8 -0
- package/mobile-lottery-record.cjs.js +9 -0
- package/mobile-lottery-record.es.js +677 -0
- package/package.json +7 -0
- package/pc-lottery-receive.cjs.js +8 -0
- package/pc-lottery-receive.es.js +5071 -0
- package/pc-lottery-receive.umd.js +8 -0
- package/pc-lottery-record.cjs.js +9 -0
- package/pc-lottery-record.es.js +677 -0
|
@@ -0,0 +1,4755 @@
|
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('.plv-iar-mobile-popup{position:fixed;width:100%;height:100%;top:0;left:0;background:#0006}.plv-iar-mobile-popup__content{position:absolute;width:100%;bottom:0;left:0;border-radius:8px 8px 0 0;max-height:90%;overflow:hidden}.plv-iar-mobile-popup__title{line-height:48px;text-align:center;color:#333;font-size:18px;padding:0 40px}.plv-iar-mobile-popup__close{position:absolute;top:16px;right:12px;font-size:16px;color:#999}.plv-iar-mobile-popup--fill-body .plv-iar-mobile-popup__content{height:90%}.iar-popup-slide-enter-active{animation:iar-popup-slide-in .2s ease-in-out}.iar-popup-slide-leave-active{animation:iar-popup-slide-in .15s reverse ease-in-out}@keyframes iar-popup-slide-in{0%{transform:translateY(100%)}to{transform:translate(0)}}.plv-area-picker-mob{width:100%;height:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;background:#fff}.plv-area-picker-mob .plv-area-picker__tab{height:58px;width:100%;display:-webkit-box;display:-ms-flexbox;display:flex}.plv-area-picker-mob .plv-area-picker__tab__item{height:58px;line-height:58px;-webkit-box-flex:1;-ms-flex:1;flex:1;font-size:16px;text-align:center;position:relative;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.plv-area-picker-mob .plv-area-picker__tab__item--selected{color:#3f76fc}.plv-area-picker-mob .plv-area-picker__tab__item--selected:after{content:"";height:2px;width:35px;background:#3f76fc;position:absolute;bottom:12px;left:50%;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translate(-50%)}.plv-area-picker-mob .plv-area-picker__popper{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow-y:hidden}.plv-area-picker-mob .plv-area-picker__popper__inner{height:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.plv-area-picker-mob .plv-area-picker__list{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow-y:scroll}.plv-area-picker-mob .plv-area-picker__list__item{height:44px;line-height:44px;padding-left:33px;padding-right:32px;font-size:16px}.plv-area-picker-mob .plv-area-picker__list__item:nth-child(odd){background:#fafafa}.plv-area-picker-mob .plv-area-picker__list__item .plv-front-mob-icon-check{font-size:24px;color:#3f76fc;display:none}.plv-area-picker-mob .plv-area-picker__list__item .plv-area-picker-mob__area__item__inner{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.plv-area-picker-mob .plv-area-picker__list__item--selected{color:#3f76fc}.plv-area-picker-mob .plv-area-picker__list__item--selected .plv-front-mob-icon-check{display:block}.plv-iar-mobile-form-area-picker__body{box-sizing:border-box;display:flex;align-items:center;width:100%;height:50px;border-bottom:1px solid #E6E6E6}.plv-iar-mobile-form-area-picker__body__input{background:none;border:none;border-radius:0;outline:none;box-sizing:border-box;display:block;flex:1;height:100%;font-size:14px;padding:0}.plv-iar-mobile-form-area-picker__body__input::-webkit-input-placeholder{color:#9e9e9e}.plv-iar-mobile-form-area-picker__body__input::placeholder{color:#9e9e9e}.plv-iar-mobile-form-area-picker__body__input::-webkit-outer-spin-button,.plv-iar-mobile-form-area-picker__body__input::-webkit-inner-spin-button{-webkit-appearance:none!important;margin:0}.plv-iar-mobile-form-area-picker__body__input[type=number]{-moz-appearance:textfield}.plv-iar-mobile-form-area-picker__body__input[disabled]{opacity:1}.plv-iar-mobile-form-area-picker__body__input[type=button],.plv-iar-mobile-form-area-picker__body__input[type=submit],.plv-iar-mobile-form-area-picker__body__input[type=reset]{-webkit-appearance:none;background:#fff}.plv-iar-mobile-form-area-picker__body__icon{display:flex;margin-right:16px;font-size:20px!important;color:#9e9e9e}.plv-iar-mobile-form-area-picker__header{box-sizing:border-box;display:flex;flex-shrink:0;width:100%;height:50px;padding:0 16px;font-size:16px;line-height:50px}.plv-iar-mobile-form-area-picker__header__cancel{color:#9195a1}.plv-iar-mobile-form-area-picker__header__confirm{color:#3082fe}.plv-iar-mobile-form-area-picker__header__confirm.plv-iar-mobile-form-area-picker__header__confirm--disabled{color:#9e9e9e}.plv-iar-mobile-form-area-picker__header__placeholder{flex:1;overflow:hidden;font-size:16px;text-align:center;color:#333}.plv-iar-mobile-form-area-picker__popup{height:100%;display:flex;flex-direction:column}.plv-iar-mobile-form-area-picker__popup__content{flex:1;overflow:hidden}.plv-iar-mobile-form-input{display:flex;border-bottom:1px solid #E6E6E6}.plv-iar-mobile-form-input__main{position:relative;box-sizing:border-box;display:flex;flex:1;align-items:center;height:50px;overflow:hidden}.plv-iar-mobile-form-input__main__input{box-sizing:border-box;display:block;flex:1;height:100%;color:inherit}.plv-iar-mobile-form-input__main__input__inner{border:none;border-radius:0;outline:none;display:block;width:100%;height:100%;background:none;padding:0;font-size:14px}.plv-iar-mobile-form-input__main__input__inner::-webkit-input-placeholder{color:#9e9e9e}.plv-iar-mobile-form-input__main__input__inner::placeholder{color:#9e9e9e}.plv-iar-mobile-form-input__main__input__inner::-webkit-outer-spin-button,.plv-iar-mobile-form-input__main__input__inner::-webkit-inner-spin-button{-webkit-appearance:none!important;margin:0}.plv-iar-mobile-form-input__main__input__inner[type=number]{-moz-appearance:textfield}.plv-iar-mobile-form-input__main__input__inner[disabled]{opacity:1}.plv-iar-mobile-form-input__main__input__inner[type=button],.plv-iar-mobile-form-input__main__input__inner[type=submit],.plv-iar-mobile-form-input__main__input__inner[type=reset]{-webkit-appearance:none;background:#fff}.plv-iar-mobile-form-input__main__input__clearabled{display:flex;margin-right:16px;font-size:20px;color:#999}.plv-iar-mobile-form-input__main__input__suffix-text{padding-right:16px;font-size:16px;color:#aaa}.plv-iar-mobile-form-input--textarea .plv-iar-mobile-form-input__main{height:initial}.plv-iar-mobile-form-input--textarea .plv-iar-mobile-form-input__main__input__inner{padding-top:16px}.plv-iar-mobile-form-checkbox{display:flex;align-items:flex-start}.plv-iar-mobile-form-checkbox__inner{box-sizing:border-box;display:flex;flex-shrink:0;align-items:center;justify-content:center;width:16px;height:16px;margin-top:2px;margin-right:6px;overflow:hidden;cursor:pointer;background:#fff;border:1px solid #cfd8dc;border-radius:2px}.plv-iar-mobile-form-checkbox__inner__circle{border-radius:50%}.plv-iar-mobile-form-checkbox__inner__icon{display:flex;font-size:14px!important;color:#fff}.plv-iar-mobile-form-checkbox__content{font-size:14px;line-height:22px}.plv-iar-mobile-form-checkbox.is-checked .plv-iar-mobile-form-checkbox__inner{background:#3f76fc;border:none}.c-mobile-form-protocol{position:relative}.c-mobile-form-protocol__content{font-size:14px}.c-mobile-form-protocol__content a{font-style:normal;color:#3f76fc;text-decoration:none;cursor:pointer}.c-mobile-form-protocol__content p{padding:0;margin:0}.c-mobile-form-protocol-popup{height:100%;-webkit-overflow-scrolling:touch}.c-mobile-form-protocol-popup__iframe{width:100%;height:100%;overflow-x:hidden;border:none}.plv-iar-form-item{position:relative;display:flex;align-items:flex-start;margin-bottom:12px}.plv-iar-form-item__anchor{position:absolute;top:0;left:0;opacity:0}.plv-iar-form-item__label__required{color:#ff3636}.plv-iar-form-item__label{box-sizing:border-box;display:flex;flex-shrink:0;align-items:center;justify-content:flex-end;padding-right:16px;font-size:14px}.plv-iar-form-item__content{position:relative;flex-shrink:0}.plv-iar-form-item__content:not(.plv-iar-form-item__content--has-width){flex:1}.plv-iar-form-item--header{flex-direction:column}.plv-iar-form-item--header .plv-iar-form-item__label{justify-content:flex-start;width:100%;padding-right:0;margin-bottom:8px;line-height:1.5;color:#333}.plv-iar-form-item--header .plv-iar-form-item__content{width:100%}.plv-iar-form-item--header.plv-iar-form-item--mobile .plv-iar-form-item__label{padding:0 16px}.plv-iar-form-item--mobile{margin-bottom:0}.plv-iar-form-item--mobile .plv-iar-form-item__label{justify-content:flex-start;padding-left:12px}.plv-iar-form-item__content__error{box-sizing:border-box;width:100%;padding-top:5px;font-size:12px;color:#ff5722}.plv-iar-button{position:relative;display:flex;width:100%;padding:0 12px;border-radius:20px;height:40px;border:none;outline:none;cursor:pointer;font-size:16px;justify-content:center;align-items:center}.plv-iar-button.is-disabled{opacity:.6}.plv-iar-button--type-primary{background:#3082fe;color:#fff}.plv-iar-button--type-primary.is-outline{background:#fff;border:1px solid #3082FE;color:#3082fe}.plv-iar-button--type-multicolour{background:linear-gradient(98deg,#fe9668,#fe3f52 45%,#ff5691);color:#fff}.plv-iar-button--type-multicolour.is-disabled{opacity:.4}.plv-iar-button--size-middle{height:48px;border-radius:24px}.plv-iar-mobile-reward-receive__deadline{height:400px;display:flex;flex-direction:column;justify-content:center;align-items:center}.plv-iar-mobile-reward-receive__deadline__icon{font-size:60px;color:#0009}.plv-iar-mobile-reward-receive__deadlin__tips{color:#999;font-size:14px;margin-top:8px;line-height:18px}.plv-iar-mobile-reward-receive__desc{color:#666;font-size:14px;margin-top:12px;margin-bottom:12px;padding:0 12px;line-height:17px;text-align:center}.plv-iar-mobile-reward-receive__submit{padding:24px 24px 34px}.plv-iar-mobile-reward-receive__qrcode{height:362px;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center}.plv-iar-mobile-reward-receive__qrcode__inner{width:140px;height:140px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARgAAAEYCAMAAACwUBm+AAAAolBMVEUAAAD/Qln/QFX/VY7/gJ3/kGf/lGf/VZD//4D/lWn/Q1r/kGn/VZX/QFX/VY7/VYz/T4D/R2r/U4v/SnL/TXj+W13/Tnz/SW7/UYT+ZF7/Uof+fGP/S3X/Rmb/RWP/RGD+Vlz+QVj+Qlv+gWP+YF3+Ulv+S1r+cmH+bmD/VI7+eGL+aF/+jWb+RVn+SFn+imX+h2T/Q13+dWH+T1r+a1/+hGQHYDIWAAAAEHRSTlMAmZmZApmZmQKZZWAYGG9v7ra/jAAAA/ZJREFUeNrs1O1OGkEYhuGXRkiRNNEIKAGFChQCbUE+zv/U6ibszCzskzoG58/c9wYO4MrzjrXbrffv/b+oeapj+fTj22WNRsOcSuECTFGjyFrt70Zn3RSLAUbAtIC5hOGUWEz8YoAB5rMwv8M2vm3ZsWxaaRi0Kj7X7tTCtSx+rsOpdaVBpVlQ76zJWXPfvuxX0F/fH99P1wdgzlQ0y7BaqOJZQpmgksXLeJVYF4/iWbRLRUXANAMYyzpgPgTTBAaY/8G8AlPbKzDAAANMUDqYjWVdFabTuQHmAub21oI2wPiAAQaYz/YGDIuJg3kDJhJma1nHG6NgWEwkzBYYYIAB5gowY2BYTExjYDilqMYS5mhZB0wszBEYYIABBhgXMCJgRMCIksFMp5Z1wCiYF2Bqe2ExAobFAAMMMEHAiIARASMCRgSMKB3M0LJOwgyBAaYW5hkYYGJ6BgYYYIDxASMCRgSMCBgRMKJ0MKuVZZ2GyX0x9yymtntgeGNYDG9MJRZTGzAiYETAiNLB7CzrWEwszI7FAAMMMMC4gBEBIwJGlAxmAQwwtTCP6pQWlnV6McAAU39KwAAT0yMwwAADTFA6mKVlnYRZshgWE7cYYIABBpgrwDwAw2KA4ZR8wCTqAZhYmINlnYQ5AAMMMMAA4wJGBIwIGBEwonQwa8s6CbMGBhhgYmBGwLCYmEYsBhhgvhZmYFknYQYshlOKWwynBAwwwABTBowImFSNusAAE1MXGGCAASYoHczMsk7CzIABBhhggHEBk6huHxgWAwyn5ANGxiklqS8X07OskzA9YIABBhhgyoARASMCRgSMCBgRMCJgUtW/AwaYmO6AiYWZWNZJmAkwwAADDDAuYETAiIARASMCRgSMCBhRMpg5MAJmblnHKbEYYK4D8wQMiwGGU/q6noBhMSwGmKB0MHvLOmBiYfbAAAMMMP/ap6PVhGEACsOpFQplbLWOKmWb6EWhFwq+/8utYTOmaQ7Ym9zk/5O8wMcJMC5gEnXsgVkJM5isk19pYDEsJlavYAZggAEGGGBcwIiAEQEjAkYEjCgdzM1knYS55b6YVsFkvpgWGAHTA8NigAHmGTAiYETpYK4m64BZC3MFBhhggAHGBYwIGFE6mLPJOhajYEZgoo0K5pz7VwLmlcXU9RaYEGb78W42G2CWMGUJDDDAAAOMKBmM7fLsPt1Hp/vJ78fr2x6vXazDdP32h33Y17zPsK7r7HM1TWNf0DGon9UuGv00zCXIsWgXSzNr52g0y3SXaZfu7/o5lIDFPsXSR1jskzD0HzDAAANMJGDSZGEqYCRMAcwSpgJGLqbgK7GYVTBFrNrk01sZVJVVBYyE+QWd+QZoUw07+wAAAABJRU5ErkJggg==);background-size:100% 100%;display:flex;align-items:center;justify-content:center}.plv-iar-mobile-reward-receive__qrcode__inner img{width:126px;height:126px}.plv-iar-mobile-reward-receive__qrcode__tips{margin-top:22px;font-size:16px;color:#fe3f52;text-align:center;padding:0 24px;line-height:24px}.plv-iar-mobile-reward-receive__protocol{padding:0 12px;margin-top:12px;margin-bottom:-4px}')),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}}();
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
import require$$0, { computed, onMounted, unref, onBeforeUnmount, defineComponent, ref, watch, nextTick, getCurrentInstance, provide, inject, watchEffect, onBeforeMount, useAttrs } from "vue";
|
|
6
|
+
function getDefaultExportFromCjs(x2) {
|
|
7
|
+
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
8
|
+
}
|
|
9
|
+
var iconBuilder = {};
|
|
10
|
+
var interfaces = {};
|
|
11
|
+
(function(exports) {
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.getColorDescription = exports.defaultIconConfig = exports.currentColor = void 0;
|
|
14
|
+
exports.currentColor = "currentColor";
|
|
15
|
+
exports.defaultIconConfig = {
|
|
16
|
+
size: "1em",
|
|
17
|
+
type: "outline",
|
|
18
|
+
strokeLinecap: "round",
|
|
19
|
+
strokeLinejoin: "round",
|
|
20
|
+
colors: {
|
|
21
|
+
outline: {
|
|
22
|
+
background: "none"
|
|
23
|
+
},
|
|
24
|
+
filled: {
|
|
25
|
+
background: "#FFF"
|
|
26
|
+
},
|
|
27
|
+
twoTone: {
|
|
28
|
+
stroke: "#333",
|
|
29
|
+
fill: "#2F88FF"
|
|
30
|
+
},
|
|
31
|
+
multiColor: {
|
|
32
|
+
outStroke: "#333",
|
|
33
|
+
outFill: "#2F88FF",
|
|
34
|
+
innerStroke: "#FFF",
|
|
35
|
+
innerFill: "#43CCF8"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
var getColorDescription = function(colorProp, iconType) {
|
|
40
|
+
var color = typeof colorProp === "string" ? [colorProp] : colorProp || [];
|
|
41
|
+
var colorDesc = [exports.currentColor, exports.currentColor, exports.currentColor, exports.currentColor];
|
|
42
|
+
switch (iconType) {
|
|
43
|
+
case "outline": {
|
|
44
|
+
colorDesc[0] = typeof color[0] === "string" ? color[0] : exports.currentColor;
|
|
45
|
+
colorDesc[1] = "none";
|
|
46
|
+
colorDesc[2] = typeof color[0] === "string" ? color[0] : exports.currentColor;
|
|
47
|
+
colorDesc[3] = "none";
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
case "filled": {
|
|
51
|
+
colorDesc[0] = typeof color[0] === "string" ? color[0] : exports.currentColor;
|
|
52
|
+
colorDesc[1] = typeof color[0] === "string" ? color[0] : exports.currentColor;
|
|
53
|
+
colorDesc[2] = "#FFF";
|
|
54
|
+
colorDesc[3] = "#FFF";
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
case "two-tone": {
|
|
58
|
+
var _a = exports.defaultIconConfig.colors.twoTone, stroke = _a.stroke, fill = _a.fill;
|
|
59
|
+
colorDesc[0] = typeof color[0] === "string" ? color[0] : stroke;
|
|
60
|
+
colorDesc[1] = typeof color[1] === "string" ? color[1] : fill;
|
|
61
|
+
colorDesc[2] = typeof color[0] === "string" ? color[0] : stroke;
|
|
62
|
+
colorDesc[3] = typeof color[1] === "string" ? color[1] : fill;
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
case "multi-color": {
|
|
66
|
+
var _b = exports.defaultIconConfig.colors.multiColor, outStroke = _b.outStroke, outFill = _b.outFill, innerStroke = _b.innerStroke, innerFill = _b.innerFill;
|
|
67
|
+
colorDesc[0] = typeof color[0] === "string" ? color[0] : outStroke;
|
|
68
|
+
colorDesc[1] = typeof color[1] === "string" ? color[1] : outFill;
|
|
69
|
+
colorDesc[2] = typeof color[2] === "string" ? color[2] : innerStroke;
|
|
70
|
+
colorDesc[3] = typeof color[3] === "string" ? color[3] : innerFill;
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return colorDesc;
|
|
75
|
+
};
|
|
76
|
+
exports.getColorDescription = getColorDescription;
|
|
77
|
+
})(interfaces);
|
|
78
|
+
var utils = {};
|
|
79
|
+
var config = {};
|
|
80
|
+
Object.defineProperty(config, "__esModule", { value: true });
|
|
81
|
+
config.CLASS_NAME_PREFIX = void 0;
|
|
82
|
+
config.CLASS_NAME_PREFIX = "polyv";
|
|
83
|
+
Object.defineProperty(utils, "__esModule", { value: true });
|
|
84
|
+
utils.line2UpperCase = utils.createClsName = void 0;
|
|
85
|
+
var config_1 = config;
|
|
86
|
+
var createClsName = function(name) {
|
|
87
|
+
return "".concat(config_1.CLASS_NAME_PREFIX, "-").concat(name);
|
|
88
|
+
};
|
|
89
|
+
utils.createClsName = createClsName;
|
|
90
|
+
var line2UpperCase = function(text) {
|
|
91
|
+
return text.replace(/(^\w|-\w)/g, function(c2) {
|
|
92
|
+
return c2.slice(-1).toUpperCase();
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
utils.line2UpperCase = line2UpperCase;
|
|
96
|
+
Object.defineProperty(iconBuilder, "__esModule", { value: true });
|
|
97
|
+
var IconBuilder_1 = iconBuilder.IconBuilder = void 0;
|
|
98
|
+
var interfaces_1 = interfaces;
|
|
99
|
+
var utils_1 = utils;
|
|
100
|
+
var IconBuilder = function(lineName, render12) {
|
|
101
|
+
var IconComponent = {
|
|
102
|
+
name: lineName,
|
|
103
|
+
props: ["size", "type", "color", "strokeLinecap", "strokeLinejoin"],
|
|
104
|
+
computed: {
|
|
105
|
+
renderData: function() {
|
|
106
|
+
var colorProp = this.color;
|
|
107
|
+
var iconType = this.type || interfaces_1.defaultIconConfig.type;
|
|
108
|
+
var size = this.size || interfaces_1.defaultIconConfig.size;
|
|
109
|
+
var strokeLinecap = this.strokeLinecap || interfaces_1.defaultIconConfig.strokeLinecap;
|
|
110
|
+
var strokeLinejoin = this.strokeLinejoin || interfaces_1.defaultIconConfig.strokeLinejoin;
|
|
111
|
+
var colorDesc = (0, interfaces_1.getColorDescription)(colorProp, iconType);
|
|
112
|
+
return {
|
|
113
|
+
size,
|
|
114
|
+
colorDesc,
|
|
115
|
+
strokeLinecap,
|
|
116
|
+
strokeLinejoin
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
render: function(h2) {
|
|
121
|
+
var renderData = this.renderData;
|
|
122
|
+
var classes = [
|
|
123
|
+
(0, utils_1.createClsName)("icon"),
|
|
124
|
+
(0, utils_1.createClsName)("icon-".concat(lineName))
|
|
125
|
+
];
|
|
126
|
+
var styles = {};
|
|
127
|
+
if (renderData.size) {
|
|
128
|
+
styles.fontSize = "".concat(renderData.size, "px");
|
|
129
|
+
}
|
|
130
|
+
return h2("span", {
|
|
131
|
+
class: classes.join(" "),
|
|
132
|
+
style: styles,
|
|
133
|
+
on: this.$listeners,
|
|
134
|
+
attrs: this.$attrs,
|
|
135
|
+
domProps: {
|
|
136
|
+
innerHTML: render12(renderData)
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
return IconComponent;
|
|
142
|
+
};
|
|
143
|
+
IconBuilder_1 = iconBuilder.IconBuilder = IconBuilder;
|
|
144
|
+
const IarIconArrowDown = IconBuilder_1(
|
|
145
|
+
"arrow-down",
|
|
146
|
+
(data) => `
|
|
147
|
+
<svg
|
|
148
|
+
width="${data.size}"
|
|
149
|
+
height="${data.size}"
|
|
150
|
+
fill="${data.colorDesc[0]}"
|
|
151
|
+
viewBox="0 0 1024 1024"
|
|
152
|
+
>
|
|
153
|
+
<path
|
|
154
|
+
d="M253.44 373.504a31.744 31.744 0 0 1 23.04-10.24c8.789333 0 17.066667 3.669333 23.210667 10.24L501.248 587.946667l198.656-211.541334c12.8-13.568 33.536-13.568 46.336 0 12.8 13.653333 12.8 35.754667 0 49.322667L525.994667 660.309333a31.232 31.232 0 0 1-40.277334 5.034667 32.170667 32.170667 0 0 1-12.117333-8.106667L253.44 422.741333a36.437333 36.437333 0 0 1 0-49.237333z"
|
|
155
|
+
/>
|
|
156
|
+
</svg>
|
|
157
|
+
`
|
|
158
|
+
);
|
|
159
|
+
IconBuilder_1(
|
|
160
|
+
"arrow-left",
|
|
161
|
+
(data) => `
|
|
162
|
+
<svg
|
|
163
|
+
width="${data.size}"
|
|
164
|
+
height="${data.size}"
|
|
165
|
+
fill="${data.colorDesc[0]}"
|
|
166
|
+
viewBox="0 0 1024 1024"
|
|
167
|
+
>
|
|
168
|
+
<path
|
|
169
|
+
d="M650.496 253.44a31.744 31.744 0 0 1 10.24 23.04c0 8.78933301-3.669333 17.066667-10.24 23.210667L436.053333 501.24799999l211.541334 198.65600001c13.568 12.8 13.568 33.536 0 46.336-13.653333 12.8-35.754667 12.79999999-49.322667 0L363.690667 525.994667a31.232 31.232 0 0 1-5.034667-40.277334 32.170667 32.170667 0 0 1 8.106667-12.117333L601.258667 253.44a36.437333 36.437333 0 0 1 49.237333 0z"
|
|
170
|
+
/>
|
|
171
|
+
</svg>
|
|
172
|
+
`
|
|
173
|
+
);
|
|
174
|
+
IconBuilder_1(
|
|
175
|
+
"arrow-right",
|
|
176
|
+
(data) => `
|
|
177
|
+
<svg
|
|
178
|
+
width="${data.size}"
|
|
179
|
+
height="${data.size}"
|
|
180
|
+
fill="${data.colorDesc[0]}"
|
|
181
|
+
viewBox="0 0 1024 1024"
|
|
182
|
+
>
|
|
183
|
+
<path
|
|
184
|
+
d="M373.504 770.56a31.744 31.744 0 0 1-10.24-23.04c0-8.78933301 3.669333-17.066667 10.24-23.210667L587.946667 522.75200001l-211.541334-198.65600001c-13.568-12.8-13.568-33.536 0-46.336 13.653333-12.8 35.754667-12.79999999 49.322667 0L660.309333 498.005333a31.232 31.232 0 0 1 5.034667 40.277334 32.170667 32.170667 0 0 1-8.106667 12.117333L422.741333 770.56a36.437333 36.437333 0 0 1-49.237333 0z"
|
|
185
|
+
/>
|
|
186
|
+
</svg>
|
|
187
|
+
`
|
|
188
|
+
);
|
|
189
|
+
IconBuilder_1(
|
|
190
|
+
"arrow-up",
|
|
191
|
+
(data) => `
|
|
192
|
+
<svg
|
|
193
|
+
width="${data.size}"
|
|
194
|
+
height="${data.size}"
|
|
195
|
+
fill="${data.colorDesc[0]}"
|
|
196
|
+
viewBox="0 0 1024 1024"
|
|
197
|
+
>
|
|
198
|
+
<path
|
|
199
|
+
d="M770.56 650.496a31.744 31.744 0 0 1-23.04 10.24c-8.78933301 0-17.066667-3.669333-23.210667-10.24L522.75200001 436.053333l-198.65600001 211.541334c-12.8 13.568-33.536 13.568-46.336 0-12.8-13.653333-12.79999999-35.754667 0-49.322667L498.005333 363.690667a31.232 31.232 0 0 1 40.277334-5.034667 32.170667 32.170667 0 0 1 12.117333 8.106667L770.56 601.258667a36.437333 36.437333 0 0 1 0 49.237333z"
|
|
200
|
+
/>
|
|
201
|
+
</svg>
|
|
202
|
+
`
|
|
203
|
+
);
|
|
204
|
+
const IarIconCheck = IconBuilder_1(
|
|
205
|
+
"check",
|
|
206
|
+
(data) => `
|
|
207
|
+
<svg
|
|
208
|
+
width="${data.size}"
|
|
209
|
+
height="${data.size}"
|
|
210
|
+
fill="${data.colorDesc[0]}"
|
|
211
|
+
viewBox="0 0 1024 1024"
|
|
212
|
+
>
|
|
213
|
+
<path
|
|
214
|
+
d="M217.856 393.344l226.24 226.304 362.048-362.048L896.64 348.16 444.16 800.64 127.36 483.84z"
|
|
215
|
+
/>
|
|
216
|
+
</svg>
|
|
217
|
+
`
|
|
218
|
+
);
|
|
219
|
+
const IarIconCloseRoundFill = IconBuilder_1(
|
|
220
|
+
"close-round-fill",
|
|
221
|
+
(data) => `
|
|
222
|
+
<svg
|
|
223
|
+
width="${data.size}"
|
|
224
|
+
height="${data.size}"
|
|
225
|
+
fill="${data.colorDesc[0]}"
|
|
226
|
+
viewBox="0 0 1024 1024"
|
|
227
|
+
>
|
|
228
|
+
<path
|
|
229
|
+
d="M512 0c282.7776 0 512 229.2224 512 512s-229.2224 512-512 512S0 794.7776 0 512 229.2224 0 512 0zM376.5248 319.0784a40.6528 40.6528 0 0 0-57.344 57.4976l143.872 144.0256-143.872 143.872a40.6016 40.6016 0 1 0 57.4464 57.5488l143.872-143.9744 143.9232 143.9744a40.6528 40.6528 0 0 0 57.4464-57.4976l-143.872-143.9232L721.92 376.576a40.6016 40.6016 0 1 0-57.3952-57.4976l-143.9744 144.0256z"
|
|
230
|
+
/>
|
|
231
|
+
</svg>
|
|
232
|
+
`
|
|
233
|
+
);
|
|
234
|
+
const IarIconInfoCircleFilled = IconBuilder_1(
|
|
235
|
+
"info-circle-filled",
|
|
236
|
+
(data) => `
|
|
237
|
+
<svg width="${data.size}" height="${data.size}" fill="none" viewBox="0 0 24 24">
|
|
238
|
+
<g>
|
|
239
|
+
<g>
|
|
240
|
+
<path
|
|
241
|
+
fill="${data.colorDesc[0]}"
|
|
242
|
+
fill-opacity="1"
|
|
243
|
+
fill-rule="evenodd"
|
|
244
|
+
d="M21,12Q21,12.22094,20.9892,12.44161Q20.9783,12.66228,20.9567,12.88215Q20.935,13.102,20.9026,13.3206Q20.8702,13.5391,20.8271,13.7558Q20.784,13.9725,20.7303,14.1868Q20.6766,14.4011,20.6125,14.6126Q20.5483,14.824,20.4739,15.032Q20.3995,15.24,20.3149,15.4441Q20.2304,15.6483,20.1359,15.848Q20.0414,16.0477,19.9373,16.2426Q19.8331,16.4374,19.7196,16.6269Q19.606,16.8164,19.4832,17.0001Q19.3605,17.183799999999998,19.2289,17.3613Q19.0973,17.538800000000002,18.9571,17.7095Q18.8169,17.8803,18.668599999999998,18.044Q18.520200000000003,18.207700000000003,18.364,18.364Q18.207700000000003,18.520200000000003,18.044,18.668599999999998Q17.8803,18.8169,17.7095,18.9571Q17.538800000000002,19.0973,17.3613,19.2289Q17.183799999999998,19.3605,17.0001,19.4832Q16.8164,19.606,16.6269,19.7196Q16.4374,19.8331,16.2426,19.9373Q16.0477,20.0414,15.848,20.1359Q15.6483,20.2304,15.4441,20.3149Q15.24,20.3995,15.032,20.4739Q14.824,20.5483,14.6126,20.6125Q14.4011,20.6766,14.1868,20.7303Q13.9725,20.784,13.7558,20.8271Q13.5391,20.8702,13.3206,20.9026Q13.102,20.935,12.88215,20.9567Q12.66228,20.9783,12.44161,20.9892Q12.22094,21,12,21Q11.77906,21,11.55839,20.9892Q11.33772,20.9783,11.11785,20.9567Q10.89797,20.935,10.67943,20.9026Q10.46088,20.8702,10.24419,20.8271Q10.02749,20.784,9.81318,20.7303Q9.59886,20.6766,9.38744,20.6125Q9.17601,20.5483,8.96799,20.4739Q8.75997,20.3995,8.55585,20.3149Q8.35173,20.2304,8.152000000000001,20.1359Q7.95228,20.0414,7.75743,19.9373Q7.56258,19.8331,7.37308,19.7196Q7.18357,19.606,6.99987,19.4832Q6.81616,19.3605,6.63871,19.2289Q6.46125,19.0973,6.2904599999999995,18.9571Q6.11967,18.8169,5.955970000000001,18.668599999999998Q5.79227,18.520200000000003,5.6360399999999995,18.364Q5.4798100000000005,18.207700000000003,5.331440000000001,18.044Q5.18307,17.8803,5.04291,17.7095Q4.90274,17.538800000000002,4.77113,17.3613Q4.63952,17.183799999999998,4.51677,17.0001Q4.39403,16.8164,4.2804400000000005,16.6269Q4.16686,16.4374,4.06271,16.2426Q3.958559,16.0477,3.864096,15.848Q3.769633,15.6483,3.685084,15.4441Q3.600535,15.24,3.526103,15.032Q3.451672,14.824,3.387537,14.6126Q3.323402,14.4011,3.269719,14.1868Q3.216035,13.9725,3.172932,13.7558Q3.12983,13.5391,3.0974114,13.3206Q3.0649931,13.102,3.0433375,12.88215Q3.0216818,12.66228,3.0108409,12.44161Q3,12.22094,3,12Q3,11.77906,3.0108409,11.55839Q3.0216818,11.33772,3.0433375,11.11785Q3.0649931,10.89797,3.0974114,10.67943Q3.12983,10.46088,3.172932,10.24419Q3.216035,10.02749,3.269719,9.81318Q3.323402,9.59886,3.387537,9.38744Q3.451672,9.17601,3.526103,8.96799Q3.600535,8.75997,3.685084,8.55585Q3.769633,8.35173,3.864096,8.152000000000001Q3.958559,7.95228,4.06271,7.75743Q4.16686,7.56258,4.2804400000000005,7.37308Q4.39403,7.18357,4.51677,6.99987Q4.63952,6.81616,4.77113,6.63871Q4.90274,6.46125,5.04291,6.2904599999999995Q5.18307,6.11967,5.331440000000001,5.955970000000001Q5.4798100000000005,5.79227,5.6360399999999995,5.6360399999999995Q5.79227,5.4798100000000005,5.955970000000001,5.331440000000001Q6.11967,5.18307,6.2904599999999995,5.04291Q6.46125,4.90274,6.63871,4.77113Q6.81616,4.63952,6.99987,4.51677Q7.18357,4.39403,7.37308,4.2804400000000005Q7.56258,4.16686,7.75743,4.06271Q7.95228,3.958559,8.152000000000001,3.864096Q8.35173,3.769633,8.55585,3.685084Q8.75997,3.600535,8.96799,3.526103Q9.17601,3.451672,9.38744,3.387537Q9.59886,3.323402,9.81318,3.269719Q10.02749,3.216035,10.24419,3.172932Q10.46088,3.12983,10.67943,3.0974114Q10.89797,3.0649931,11.11785,3.0433375Q11.33772,3.0216818,11.55839,3.0108409Q11.77906,3,12,3Q12.22094,3,12.44161,3.0108409Q12.66228,3.0216818,12.88215,3.0433375Q13.102,3.0649931,13.3206,3.0974114Q13.5391,3.12983,13.7558,3.172932Q13.9725,3.216035,14.1868,3.269719Q14.4011,3.323402,14.6126,3.387537Q14.824,3.451672,15.032,3.526103Q15.24,3.600535,15.4441,3.685084Q15.6483,3.769633,15.848,3.864096Q16.0477,3.958559,16.2426,4.06271Q16.4374,4.16686,16.6269,4.2804400000000005Q16.8164,4.39403,17.0001,4.51677Q17.183799999999998,4.63952,17.3613,4.77113Q17.538800000000002,4.90274,17.7095,5.04291Q17.8803,5.18307,18.044,5.331440000000001Q18.207700000000003,5.4798100000000005,18.364,5.6360399999999995Q18.520200000000003,5.79227,18.668599999999998,5.955970000000001Q18.8169,6.11967,18.9571,6.2904599999999995Q19.0973,6.46125,19.2289,6.63871Q19.3605,6.81616,19.4832,6.99987Q19.606,7.18357,19.7196,7.37308Q19.8331,7.56258,19.9373,7.75743Q20.0414,7.95228,20.1359,8.152000000000001Q20.2304,8.35173,20.3149,8.55585Q20.3995,8.75997,20.4739,8.96799Q20.5483,9.17601,20.6125,9.38744Q20.6766,9.59886,20.7303,9.81318Q20.784,10.02749,20.8271,10.24419Q20.8702,10.46088,20.9026,10.67943Q20.935,10.89797,20.9567,11.11785Q20.9783,11.33772,20.9892,11.55839Q21,11.77906,21,12ZM13,8Q13,8.09849,12.98078,8.19509Q12.96157,8.29169,12.92388,8.38268Q12.88619,8.47368,12.83147,8.55557Q12.77675,8.63746,12.70711,8.70711Q12.63746,8.77675,12.55557,8.83147Q12.47368,8.88619,12.38268,8.92388Q12.29169,8.96157,12.19509,8.98078Q12.09849,9,12,9Q11.90151,9,11.80491,8.98078Q11.70831,8.96157,11.61732,8.92388Q11.52632,8.88619,11.44443,8.83147Q11.36254,8.77675,11.29289,8.70711Q11.22325,8.63746,11.16853,8.55557Q11.11381,8.47368,11.07612,8.38268Q11.03843,8.29169,11.01921,8.19509Q11,8.09849,11,8Q11,7.90151,11.01921,7.80491Q11.03843,7.70831,11.07612,7.61732Q11.11381,7.52632,11.16853,7.44443Q11.22325,7.36254,11.29289,7.29289Q11.36254,7.22325,11.44443,7.16853Q11.52632,7.11381,11.61732,7.07612Q11.70831,7.03843,11.80491,7.01921Q11.90151,7,12,7Q12.09849,7,12.19509,7.01921Q12.29169,7.03843,12.38268,7.07612Q12.47368,7.11381,12.55557,7.16853Q12.63746,7.22325,12.70711,7.29289Q12.77675,7.36254,12.83147,7.44443Q12.88619,7.52632,12.92388,7.61732Q12.96157,7.70831,12.98078,7.80491Q13,7.90151,13,8ZM11,11L11,16Q11,16.0985,11.01921,16.1951Q11.03843,16.2917,11.07612,16.3827Q11.11381,16.4737,11.16853,16.5556Q11.22325,16.6375,11.29289,16.7071Q11.36254,16.776699999999998,11.44443,16.8315Q11.52632,16.886200000000002,11.61732,16.9239Q11.70831,16.9616,11.80491,16.980800000000002Q11.90151,17,12,17Q12.09849,17,12.19509,16.980800000000002Q12.29169,16.9616,12.38268,16.9239Q12.47368,16.886200000000002,12.55557,16.8315Q12.63746,16.776699999999998,12.70711,16.7071Q12.77675,16.6375,12.83147,16.5556Q12.88619,16.4737,12.92388,16.3827Q12.96157,16.2917,12.98078,16.1951Q13,16.0985,13,16L13,11Q13,10.90151,12.98078,10.80491Q12.96157,10.70831,12.92388,10.61732Q12.88619,10.52632,12.83147,10.44443Q12.77675,10.36254,12.70711,10.29289Q12.63746,10.22325,12.55557,10.16853Q12.47368,10.11381,12.38268,10.07612Q12.29169,10.03843,12.19509,10.019210000000001Q12.09849,10,12,10Q11.90151,10,11.80491,10.01922Q11.70831,10.03843,11.61732,10.07612Q11.52632,10.11381,11.44443,10.16853Q11.36254,10.22325,11.29289,10.29289Q11.22325,10.36254,11.16853,10.44443Q11.11381,10.52632,11.07612,10.61732Q11.03843,10.70831,11.01921,10.80491Q11,10.90151,11,11Z"
|
|
245
|
+
/>
|
|
246
|
+
</g>
|
|
247
|
+
</g>
|
|
248
|
+
</svg>
|
|
249
|
+
`
|
|
250
|
+
);
|
|
251
|
+
const IarIconPopupClose = IconBuilder_1(
|
|
252
|
+
"popup-close",
|
|
253
|
+
(data) => `
|
|
254
|
+
<svg width="${data.size}" height="${data.size}" fill="none" viewBox="0 0 16 16">
|
|
255
|
+
<g>
|
|
256
|
+
<g>
|
|
257
|
+
<path
|
|
258
|
+
fill="${data.colorDesc[0]}"
|
|
259
|
+
fill-opacity="1"
|
|
260
|
+
d="M9.08388,8L14.7842,2.2973C15.0719,2.00945,15.0719,1.5348709999999999,14.7842,1.247013L14.7531,1.215893C14.4654,0.9280356,13.991,0.9280356,13.7032,1.215893L8.00292,6.92637L2.3026,1.215893C2.01486,0.9280356,1.54048,0.9280356,1.252743,1.215893L1.221636,1.247013C0.9261214,1.5348709999999999,0.9261214,2.00945,1.221636,2.2973L6.92196,8L1.221636,13.7027C0.9338981,13.9906,0.9338981,14.4651,1.221636,14.753L1.252743,14.7841C1.54048,15.072,2.01486,15.072,2.3026,14.7841L8.00292,9.08141L13.7032,14.7841C13.991,15.072,14.4654,15.072,14.7531,14.7841L14.7842,14.753C15.0719,14.4651,15.0719,13.9906,14.7842,13.7027L9.08388,8Z"
|
|
261
|
+
/>
|
|
262
|
+
</g>
|
|
263
|
+
</g>
|
|
264
|
+
</svg>
|
|
265
|
+
`
|
|
266
|
+
);
|
|
267
|
+
const emitFunc = () => () => true;
|
|
268
|
+
function updateModelEmit(field) {
|
|
269
|
+
return {
|
|
270
|
+
[`update:${field}`]: () => true
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
/*!
|
|
274
|
+
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
275
|
+
*
|
|
276
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
277
|
+
* Released under the MIT License.
|
|
278
|
+
*/
|
|
279
|
+
function isObject$1(o2) {
|
|
280
|
+
return Object.prototype.toString.call(o2) === "[object Object]";
|
|
281
|
+
}
|
|
282
|
+
function isPlainObject(o2) {
|
|
283
|
+
var ctor, prot;
|
|
284
|
+
if (isObject$1(o2) === false) return false;
|
|
285
|
+
ctor = o2.constructor;
|
|
286
|
+
if (ctor === void 0) return true;
|
|
287
|
+
prot = ctor.prototype;
|
|
288
|
+
if (isObject$1(prot) === false) return false;
|
|
289
|
+
if (prot.hasOwnProperty("isPrototypeOf") === false) {
|
|
290
|
+
return false;
|
|
291
|
+
}
|
|
292
|
+
return true;
|
|
293
|
+
}
|
|
294
|
+
var define_process_env_default$1 = {};
|
|
295
|
+
function t() {
|
|
296
|
+
return t = Object.assign ? Object.assign.bind() : function(e2) {
|
|
297
|
+
for (var t2 = 1; t2 < arguments.length; t2++) {
|
|
298
|
+
var r2 = arguments[t2];
|
|
299
|
+
for (var n2 in r2) Object.prototype.hasOwnProperty.call(r2, n2) && (e2[n2] = r2[n2]);
|
|
300
|
+
}
|
|
301
|
+
return e2;
|
|
302
|
+
}, t.apply(this, arguments);
|
|
303
|
+
}
|
|
304
|
+
function r(e2, t2) {
|
|
305
|
+
if (null == e2) return {};
|
|
306
|
+
var r2, n2, i2 = {}, o2 = Object.keys(e2);
|
|
307
|
+
for (n2 = 0; n2 < o2.length; n2++) t2.indexOf(r2 = o2[n2]) >= 0 || (i2[r2] = e2[r2]);
|
|
308
|
+
return i2;
|
|
309
|
+
}
|
|
310
|
+
const n = { silent: false, logLevel: "warn" }, i = ["validator"], o = Object.prototype, a = o.toString, s = o.hasOwnProperty, u = /^\s*function (\w+)/;
|
|
311
|
+
function l(e2) {
|
|
312
|
+
var t2;
|
|
313
|
+
const r2 = null !== (t2 = null == e2 ? void 0 : e2.type) && void 0 !== t2 ? t2 : e2;
|
|
314
|
+
if (r2) {
|
|
315
|
+
const e3 = r2.toString().match(u);
|
|
316
|
+
return e3 ? e3[1] : "";
|
|
317
|
+
}
|
|
318
|
+
return "";
|
|
319
|
+
}
|
|
320
|
+
const c = isPlainObject, f = (e2) => e2;
|
|
321
|
+
let d = f;
|
|
322
|
+
if ("production" !== define_process_env_default$1.NODE_ENV) {
|
|
323
|
+
const e2 = "undefined" != typeof console;
|
|
324
|
+
d = e2 ? function(e3, t2 = n.logLevel) {
|
|
325
|
+
false === n.silent && console[t2](`[VueTypes warn]: ${e3}`);
|
|
326
|
+
} : f;
|
|
327
|
+
}
|
|
328
|
+
const p = (e2, t2) => s.call(e2, t2), y = Number.isInteger || function(e2) {
|
|
329
|
+
return "number" == typeof e2 && isFinite(e2) && Math.floor(e2) === e2;
|
|
330
|
+
}, v = Array.isArray || function(e2) {
|
|
331
|
+
return "[object Array]" === a.call(e2);
|
|
332
|
+
}, h = (e2) => "[object Function]" === a.call(e2), b = (e2) => c(e2) && p(e2, "_vueTypes_name"), g = (e2) => c(e2) && (p(e2, "type") || ["_vueTypes_name", "validator", "default", "required"].some((t2) => p(e2, t2)));
|
|
333
|
+
function O(e2, t2) {
|
|
334
|
+
return Object.defineProperty(e2.bind(t2), "__original", { value: e2 });
|
|
335
|
+
}
|
|
336
|
+
function m(e2, t2, r2 = false) {
|
|
337
|
+
let n2, i2 = true, o2 = "";
|
|
338
|
+
n2 = c(e2) ? e2 : { type: e2 };
|
|
339
|
+
const a2 = b(n2) ? n2._vueTypes_name + " - " : "";
|
|
340
|
+
if (g(n2) && null !== n2.type) {
|
|
341
|
+
if (void 0 === n2.type || true === n2.type) return i2;
|
|
342
|
+
if (!n2.required && void 0 === t2) return i2;
|
|
343
|
+
v(n2.type) ? (i2 = n2.type.some((e3) => true === m(e3, t2, true)), o2 = n2.type.map((e3) => l(e3)).join(" or ")) : (o2 = l(n2), i2 = "Array" === o2 ? v(t2) : "Object" === o2 ? c(t2) : "String" === o2 || "Number" === o2 || "Boolean" === o2 || "Function" === o2 ? function(e3) {
|
|
344
|
+
if (null == e3) return "";
|
|
345
|
+
const t3 = e3.constructor.toString().match(u);
|
|
346
|
+
return t3 ? t3[1] : "";
|
|
347
|
+
}(t2) === o2 : t2 instanceof n2.type);
|
|
348
|
+
}
|
|
349
|
+
if (!i2) {
|
|
350
|
+
const e3 = `${a2}value "${t2}" should be of type "${o2}"`;
|
|
351
|
+
return false === r2 ? (d(e3), false) : e3;
|
|
352
|
+
}
|
|
353
|
+
if (p(n2, "validator") && h(n2.validator)) {
|
|
354
|
+
const e3 = d, o3 = [];
|
|
355
|
+
if (d = (e4) => {
|
|
356
|
+
o3.push(e4);
|
|
357
|
+
}, i2 = n2.validator(t2), d = e3, !i2) {
|
|
358
|
+
const e4 = (o3.length > 1 ? "* " : "") + o3.join("\n* ");
|
|
359
|
+
return o3.length = 0, false === r2 ? (d(e4), i2) : e4;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
return i2;
|
|
363
|
+
}
|
|
364
|
+
function j(e2, t2) {
|
|
365
|
+
const r2 = Object.defineProperties(t2, { _vueTypes_name: { value: e2, writable: true }, isRequired: { get() {
|
|
366
|
+
return this.required = true, this;
|
|
367
|
+
} }, def: { value(e3) {
|
|
368
|
+
return void 0 === e3 ? (p(this, "default") && delete this.default, this) : h(e3) || true === m(this, e3, true) ? (this.default = v(e3) ? () => [...e3] : c(e3) ? () => Object.assign({}, e3) : e3, this) : (d(`${this._vueTypes_name} - invalid default value: "${e3}"`), this);
|
|
369
|
+
} } }), { validator: n2 } = r2;
|
|
370
|
+
return h(n2) && (r2.validator = O(n2, r2)), r2;
|
|
371
|
+
}
|
|
372
|
+
function _(e2, t2) {
|
|
373
|
+
const r2 = j(e2, t2);
|
|
374
|
+
return Object.defineProperty(r2, "validate", { value(e3) {
|
|
375
|
+
return h(this.validator) && d(`${this._vueTypes_name} - calling .validate() will overwrite the current custom validator function. Validator info:
|
|
376
|
+
${JSON.stringify(this)}`), this.validator = O(e3, this), this;
|
|
377
|
+
} });
|
|
378
|
+
}
|
|
379
|
+
function T(e2, t2, n2) {
|
|
380
|
+
const o2 = function(e3) {
|
|
381
|
+
const t3 = {};
|
|
382
|
+
return Object.getOwnPropertyNames(e3).forEach((r2) => {
|
|
383
|
+
t3[r2] = Object.getOwnPropertyDescriptor(e3, r2);
|
|
384
|
+
}), Object.defineProperties({}, t3);
|
|
385
|
+
}(t2);
|
|
386
|
+
if (o2._vueTypes_name = e2, !c(n2)) return o2;
|
|
387
|
+
const { validator: a2 } = n2, s2 = r(n2, i);
|
|
388
|
+
if (h(a2)) {
|
|
389
|
+
let { validator: e3 } = o2;
|
|
390
|
+
e3 && (e3 = null !== (l2 = (u2 = e3).__original) && void 0 !== l2 ? l2 : u2), o2.validator = O(e3 ? function(t3) {
|
|
391
|
+
return e3.call(this, t3) && a2.call(this, t3);
|
|
392
|
+
} : a2, o2);
|
|
393
|
+
}
|
|
394
|
+
var u2, l2;
|
|
395
|
+
return Object.assign(o2, s2);
|
|
396
|
+
}
|
|
397
|
+
function $(e2) {
|
|
398
|
+
return e2.replace(/^(?!\s*$)/gm, " ");
|
|
399
|
+
}
|
|
400
|
+
const w = () => _("any", {}), P = () => _("function", { type: Function }), x = () => _("boolean", { type: Boolean }), E = () => _("string", { type: String }), N = () => _("number", { type: Number }), q = () => _("array", { type: Array }), A = () => _("object", { type: Object }), V = () => j("integer", { type: Number, validator: (e2) => y(e2) }), S = () => j("symbol", { validator: (e2) => "symbol" == typeof e2 });
|
|
401
|
+
function D(e2, t2 = "custom validation failed") {
|
|
402
|
+
if ("function" != typeof e2) throw new TypeError("[VueTypes error]: You must provide a function as argument");
|
|
403
|
+
return j(e2.name || "<<anonymous function>>", { type: null, validator(r2) {
|
|
404
|
+
const n2 = e2(r2);
|
|
405
|
+
return n2 || d(`${this._vueTypes_name} - ${t2}`), n2;
|
|
406
|
+
} });
|
|
407
|
+
}
|
|
408
|
+
function L(e2) {
|
|
409
|
+
if (!v(e2)) throw new TypeError("[VueTypes error]: You must provide an array as argument.");
|
|
410
|
+
const t2 = `oneOf - value should be one of "${e2.join('", "')}".`, r2 = e2.reduce((e3, t3) => {
|
|
411
|
+
if (null != t3) {
|
|
412
|
+
const r3 = t3.constructor;
|
|
413
|
+
-1 === e3.indexOf(r3) && e3.push(r3);
|
|
414
|
+
}
|
|
415
|
+
return e3;
|
|
416
|
+
}, []);
|
|
417
|
+
return j("oneOf", { type: r2.length > 0 ? r2 : void 0, validator(r3) {
|
|
418
|
+
const n2 = -1 !== e2.indexOf(r3);
|
|
419
|
+
return n2 || d(t2), n2;
|
|
420
|
+
} });
|
|
421
|
+
}
|
|
422
|
+
function F(e2) {
|
|
423
|
+
if (!v(e2)) throw new TypeError("[VueTypes error]: You must provide an array as argument");
|
|
424
|
+
let t2 = false, r2 = [];
|
|
425
|
+
for (let n3 = 0; n3 < e2.length; n3 += 1) {
|
|
426
|
+
const i2 = e2[n3];
|
|
427
|
+
if (g(i2)) {
|
|
428
|
+
if (b(i2) && "oneOf" === i2._vueTypes_name && i2.type) {
|
|
429
|
+
r2 = r2.concat(i2.type);
|
|
430
|
+
continue;
|
|
431
|
+
}
|
|
432
|
+
if (h(i2.validator) && (t2 = true), true === i2.type || !i2.type) {
|
|
433
|
+
d('oneOfType - invalid usage of "true" or "null" as types.');
|
|
434
|
+
continue;
|
|
435
|
+
}
|
|
436
|
+
r2 = r2.concat(i2.type);
|
|
437
|
+
} else r2.push(i2);
|
|
438
|
+
}
|
|
439
|
+
r2 = r2.filter((e3, t3) => r2.indexOf(e3) === t3);
|
|
440
|
+
const n2 = r2.length > 0 ? r2 : null;
|
|
441
|
+
return j("oneOfType", t2 ? { type: n2, validator(t3) {
|
|
442
|
+
const r3 = [], n3 = e2.some((e3) => {
|
|
443
|
+
const n4 = m(b(e3) && "oneOf" === e3._vueTypes_name ? e3.type || null : e3, t3, true);
|
|
444
|
+
return "string" == typeof n4 && r3.push(n4), true === n4;
|
|
445
|
+
});
|
|
446
|
+
return n3 || d(`oneOfType - provided value does not match any of the ${r3.length} passed-in validators:
|
|
447
|
+
${$(r3.join("\n"))}`), n3;
|
|
448
|
+
} } : { type: n2 });
|
|
449
|
+
}
|
|
450
|
+
function Y(e2) {
|
|
451
|
+
return j("arrayOf", { type: Array, validator(t2) {
|
|
452
|
+
let r2 = "";
|
|
453
|
+
const n2 = t2.every((t3) => (r2 = m(e2, t3, true), true === r2));
|
|
454
|
+
return n2 || d(`arrayOf - value validation error:
|
|
455
|
+
${$(r2)}`), n2;
|
|
456
|
+
} });
|
|
457
|
+
}
|
|
458
|
+
function B(e2) {
|
|
459
|
+
return j("instanceOf", { type: e2 });
|
|
460
|
+
}
|
|
461
|
+
function I(e2) {
|
|
462
|
+
return j("objectOf", { type: Object, validator(t2) {
|
|
463
|
+
let r2 = "";
|
|
464
|
+
const n2 = Object.keys(t2).every((n3) => (r2 = m(e2, t2[n3], true), true === r2));
|
|
465
|
+
return n2 || d(`objectOf - value validation error:
|
|
466
|
+
${$(r2)}`), n2;
|
|
467
|
+
} });
|
|
468
|
+
}
|
|
469
|
+
function J(e2) {
|
|
470
|
+
const t2 = Object.keys(e2), r2 = t2.filter((t3) => {
|
|
471
|
+
var r3;
|
|
472
|
+
return !(null === (r3 = e2[t3]) || void 0 === r3 || !r3.required);
|
|
473
|
+
}), n2 = j("shape", { type: Object, validator(n3) {
|
|
474
|
+
if (!c(n3)) return false;
|
|
475
|
+
const i2 = Object.keys(n3);
|
|
476
|
+
if (r2.length > 0 && r2.some((e3) => -1 === i2.indexOf(e3))) {
|
|
477
|
+
const e3 = r2.filter((e4) => -1 === i2.indexOf(e4));
|
|
478
|
+
return d(1 === e3.length ? `shape - required property "${e3[0]}" is not defined.` : `shape - required properties "${e3.join('", "')}" are not defined.`), false;
|
|
479
|
+
}
|
|
480
|
+
return i2.every((r3) => {
|
|
481
|
+
if (-1 === t2.indexOf(r3)) return true === this._vueTypes_isLoose || (d(`shape - shape definition does not include a "${r3}" property. Allowed keys: "${t2.join('", "')}".`), false);
|
|
482
|
+
const i3 = m(e2[r3], n3[r3], true);
|
|
483
|
+
return "string" == typeof i3 && d(`shape - "${r3}" property validation error:
|
|
484
|
+
${$(i3)}`), true === i3;
|
|
485
|
+
});
|
|
486
|
+
} });
|
|
487
|
+
return Object.defineProperty(n2, "_vueTypes_isLoose", { writable: true, value: false }), Object.defineProperty(n2, "loose", { get() {
|
|
488
|
+
return this._vueTypes_isLoose = true, this;
|
|
489
|
+
} }), n2;
|
|
490
|
+
}
|
|
491
|
+
const M = ["name", "validate", "getter"], R = /* @__PURE__ */ (() => {
|
|
492
|
+
var e2;
|
|
493
|
+
return (e2 = class {
|
|
494
|
+
static get any() {
|
|
495
|
+
return w();
|
|
496
|
+
}
|
|
497
|
+
static get func() {
|
|
498
|
+
return P().def(this.defaults.func);
|
|
499
|
+
}
|
|
500
|
+
static get bool() {
|
|
501
|
+
return x().def(this.defaults.bool);
|
|
502
|
+
}
|
|
503
|
+
static get string() {
|
|
504
|
+
return E().def(this.defaults.string);
|
|
505
|
+
}
|
|
506
|
+
static get number() {
|
|
507
|
+
return N().def(this.defaults.number);
|
|
508
|
+
}
|
|
509
|
+
static get array() {
|
|
510
|
+
return q().def(this.defaults.array);
|
|
511
|
+
}
|
|
512
|
+
static get object() {
|
|
513
|
+
return A().def(this.defaults.object);
|
|
514
|
+
}
|
|
515
|
+
static get integer() {
|
|
516
|
+
return V().def(this.defaults.integer);
|
|
517
|
+
}
|
|
518
|
+
static get symbol() {
|
|
519
|
+
return S();
|
|
520
|
+
}
|
|
521
|
+
static get nullable() {
|
|
522
|
+
return { type: null };
|
|
523
|
+
}
|
|
524
|
+
static extend(e3) {
|
|
525
|
+
if (v(e3)) return e3.forEach((e4) => this.extend(e4)), this;
|
|
526
|
+
const { name: t2, validate: n2 = false, getter: i2 = false } = e3, o2 = r(e3, M);
|
|
527
|
+
if (p(this, t2)) throw new TypeError(`[VueTypes error]: Type "${t2}" already defined`);
|
|
528
|
+
const { type: a2 } = o2;
|
|
529
|
+
if (b(a2)) return delete o2.type, Object.defineProperty(this, t2, i2 ? { get: () => T(t2, a2, o2) } : { value(...e4) {
|
|
530
|
+
const r2 = T(t2, a2, o2);
|
|
531
|
+
return r2.validator && (r2.validator = r2.validator.bind(r2, ...e4)), r2;
|
|
532
|
+
} });
|
|
533
|
+
let s2;
|
|
534
|
+
return s2 = i2 ? { get() {
|
|
535
|
+
const e4 = Object.assign({}, o2);
|
|
536
|
+
return n2 ? _(t2, e4) : j(t2, e4);
|
|
537
|
+
}, enumerable: true } : { value(...e4) {
|
|
538
|
+
const r2 = Object.assign({}, o2);
|
|
539
|
+
let i3;
|
|
540
|
+
return i3 = n2 ? _(t2, r2) : j(t2, r2), r2.validator && (i3.validator = r2.validator.bind(i3, ...e4)), i3;
|
|
541
|
+
}, enumerable: true }, Object.defineProperty(this, t2, s2);
|
|
542
|
+
}
|
|
543
|
+
}).defaults = {}, e2.sensibleDefaults = void 0, e2.config = n, e2.custom = D, e2.oneOf = L, e2.instanceOf = B, e2.oneOfType = F, e2.arrayOf = Y, e2.objectOf = I, e2.shape = J, e2.utils = { validate: (e3, t2) => true === m(t2, e3, true), toType: (e3, t2, r2 = false) => r2 ? _(e3, t2) : j(e3, t2) }, e2;
|
|
544
|
+
})();
|
|
545
|
+
function z(e2 = { func: () => {
|
|
546
|
+
}, bool: true, string: "", number: 0, array: () => [], object: () => ({}), integer: 0 }) {
|
|
547
|
+
var r2;
|
|
548
|
+
return (r2 = class extends R {
|
|
549
|
+
static get sensibleDefaults() {
|
|
550
|
+
return t({}, this.defaults);
|
|
551
|
+
}
|
|
552
|
+
static set sensibleDefaults(r3) {
|
|
553
|
+
this.defaults = false !== r3 ? t({}, true !== r3 ? r3 : e2) : {};
|
|
554
|
+
}
|
|
555
|
+
}).defaults = t({}, e2), r2;
|
|
556
|
+
}
|
|
557
|
+
class C extends z() {
|
|
558
|
+
}
|
|
559
|
+
class PropUtils {
|
|
560
|
+
/** String 类型,默认:'' */
|
|
561
|
+
static get string() {
|
|
562
|
+
return E().def("");
|
|
563
|
+
}
|
|
564
|
+
/** String 类型,默认:undefined */
|
|
565
|
+
static get looseString() {
|
|
566
|
+
return E();
|
|
567
|
+
}
|
|
568
|
+
/** Number 类型,默认:0 */
|
|
569
|
+
static get number() {
|
|
570
|
+
return N().def(0);
|
|
571
|
+
}
|
|
572
|
+
/** Number 类型,默认:undefined */
|
|
573
|
+
static get looseNumber() {
|
|
574
|
+
return N();
|
|
575
|
+
}
|
|
576
|
+
/** Boolean 类型,默认:true */
|
|
577
|
+
static get bool() {
|
|
578
|
+
return x().def(true);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
__publicField(PropUtils, "objectType", A);
|
|
582
|
+
/** Array 类型,默认:[] */
|
|
583
|
+
__publicField(PropUtils, "array", () => {
|
|
584
|
+
return q().def([]);
|
|
585
|
+
});
|
|
586
|
+
/** Object 类型 */
|
|
587
|
+
__publicField(PropUtils, "object", A);
|
|
588
|
+
/** Function 类型 */
|
|
589
|
+
__publicField(PropUtils, "func", P);
|
|
590
|
+
/** 指定为数组中的值 */
|
|
591
|
+
__publicField(PropUtils, "oneOf", L);
|
|
592
|
+
/** 自定义类型 */
|
|
593
|
+
__publicField(PropUtils, "oneOfType", F);
|
|
594
|
+
/** 枚举类型 */
|
|
595
|
+
__publicField(PropUtils, "enum", E);
|
|
596
|
+
/** 任意类型 */
|
|
597
|
+
__publicField(PropUtils, "any", w);
|
|
598
|
+
const useProps = (props) => {
|
|
599
|
+
const ret = {};
|
|
600
|
+
for (const key in props) {
|
|
601
|
+
ret[key] = computed(() => props[key]);
|
|
602
|
+
}
|
|
603
|
+
return ret;
|
|
604
|
+
};
|
|
605
|
+
var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
|
|
606
|
+
ButtonType2["Primary"] = "primary";
|
|
607
|
+
ButtonType2["Success"] = "success";
|
|
608
|
+
ButtonType2["Danger"] = "danger";
|
|
609
|
+
ButtonType2["Multicolour"] = "multicolour";
|
|
610
|
+
return ButtonType2;
|
|
611
|
+
})(ButtonType || {});
|
|
612
|
+
var ButtonSize = /* @__PURE__ */ ((ButtonSize2) => {
|
|
613
|
+
ButtonSize2["Default"] = "";
|
|
614
|
+
ButtonSize2["Middle"] = "middle";
|
|
615
|
+
ButtonSize2["Small"] = "small";
|
|
616
|
+
return ButtonSize2;
|
|
617
|
+
})(ButtonSize || {});
|
|
618
|
+
const iarButtonProps = () => ({
|
|
619
|
+
type: PropUtils.enum().def(
|
|
620
|
+
"primary"
|
|
621
|
+
/* Primary */
|
|
622
|
+
),
|
|
623
|
+
disabled: PropUtils.bool.def(false),
|
|
624
|
+
size: PropUtils.enum().def(
|
|
625
|
+
""
|
|
626
|
+
/* Default */
|
|
627
|
+
),
|
|
628
|
+
outline: PropUtils.bool.def(false)
|
|
629
|
+
});
|
|
630
|
+
const iarButtonEmits = () => ({
|
|
631
|
+
"click": emitFunc()
|
|
632
|
+
});
|
|
633
|
+
const useIarButton = (options) => {
|
|
634
|
+
const { emit, props } = options;
|
|
635
|
+
function onClick(event) {
|
|
636
|
+
emit("click", event);
|
|
637
|
+
}
|
|
638
|
+
return {
|
|
639
|
+
onClick
|
|
640
|
+
};
|
|
641
|
+
};
|
|
642
|
+
var popperManager = function(e) {
|
|
643
|
+
var n2 = {};
|
|
644
|
+
function t2(r2) {
|
|
645
|
+
if (n2[r2]) return n2[r2].exports;
|
|
646
|
+
var o2 = n2[r2] = { i: r2, l: false, exports: {} };
|
|
647
|
+
return e[r2].call(o2.exports, o2, o2.exports, t2), o2.l = true, o2.exports;
|
|
648
|
+
}
|
|
649
|
+
return t2.m = e, t2.c = n2, t2.d = function(e2, n3, r2) {
|
|
650
|
+
t2.o(e2, n3) || Object.defineProperty(e2, n3, { enumerable: true, get: r2 });
|
|
651
|
+
}, t2.r = function(e2) {
|
|
652
|
+
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e2, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e2, "__esModule", { value: true });
|
|
653
|
+
}, t2.t = function(e2, n3) {
|
|
654
|
+
if (1 & n3 && (e2 = t2(e2)), 8 & n3) return e2;
|
|
655
|
+
if (4 & n3 && "object" == typeof e2 && e2 && e2.__esModule) return e2;
|
|
656
|
+
var r2 = /* @__PURE__ */ Object.create(null);
|
|
657
|
+
if (t2.r(r2), Object.defineProperty(r2, "default", { enumerable: true, value: e2 }), 2 & n3 && "string" != typeof e2) for (var o2 in e2) t2.d(r2, o2, (function(n4) {
|
|
658
|
+
return e2[n4];
|
|
659
|
+
}).bind(null, o2));
|
|
660
|
+
return r2;
|
|
661
|
+
}, t2.n = function(e2) {
|
|
662
|
+
var n3 = e2 && e2.__esModule ? function() {
|
|
663
|
+
return e2.default;
|
|
664
|
+
} : function() {
|
|
665
|
+
return e2;
|
|
666
|
+
};
|
|
667
|
+
return t2.d(n3, "a", n3), n3;
|
|
668
|
+
}, t2.o = function(e2, n3) {
|
|
669
|
+
return Object.prototype.hasOwnProperty.call(e2, n3);
|
|
670
|
+
}, t2.p = "", t2(t2.s = 14);
|
|
671
|
+
}({ 14: function(e, n2, t2) {
|
|
672
|
+
t2.r(n2);
|
|
673
|
+
t2(42);
|
|
674
|
+
var r2 = "@@polyvAdminUIzIndex", o2 = { ctx: r2, openPopper: function(e2) {
|
|
675
|
+
o2.zIndex++, e2.style.zIndex = o2.zIndex;
|
|
676
|
+
}, install: function(e2) {
|
|
677
|
+
var n3 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, t3 = n3.defaultZIndex, o3 = void 0 === t3 ? 3e3 : t3;
|
|
678
|
+
window[r2] = o3;
|
|
679
|
+
} };
|
|
680
|
+
Object.defineProperty(o2, "zIndex", { configurable: true, get: function() {
|
|
681
|
+
return window[r2] || (window[r2] = 3e3), window[r2];
|
|
682
|
+
}, set: function(e2) {
|
|
683
|
+
window[r2] = e2;
|
|
684
|
+
} }), n2.default = o2;
|
|
685
|
+
}, 42: function(e, n2, t2) {
|
|
686
|
+
} }).default;
|
|
687
|
+
const PlvPopperManager = /* @__PURE__ */ getDefaultExportFromCjs(popperManager);
|
|
688
|
+
const useAppendTo = (elemRef, parentRef) => {
|
|
689
|
+
function getBodyElement() {
|
|
690
|
+
return document.body;
|
|
691
|
+
}
|
|
692
|
+
let _parentRef = getBodyElement();
|
|
693
|
+
onMounted(() => {
|
|
694
|
+
const elem = unref(elemRef);
|
|
695
|
+
const parentElem = unref(_parentRef);
|
|
696
|
+
if (!elem || !parentElem) {
|
|
697
|
+
console.warn("useAppendTo fail, elem is undefined");
|
|
698
|
+
return;
|
|
699
|
+
}
|
|
700
|
+
parentElem.appendChild(elem);
|
|
701
|
+
});
|
|
702
|
+
onBeforeUnmount(() => {
|
|
703
|
+
const elem = unref(elemRef);
|
|
704
|
+
if (elem && elem.parentNode) {
|
|
705
|
+
elem.parentNode.removeChild(elem);
|
|
706
|
+
}
|
|
707
|
+
});
|
|
708
|
+
};
|
|
709
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
710
|
+
__name: "iar-mobile-popup",
|
|
711
|
+
props: {
|
|
712
|
+
value: PropUtils.bool.def(false),
|
|
713
|
+
/** 标题 */
|
|
714
|
+
title: PropUtils.string.def(""),
|
|
715
|
+
/** 背景 */
|
|
716
|
+
background: PropUtils.string.def("#fff"),
|
|
717
|
+
/** 显示关闭 */
|
|
718
|
+
closeable: PropUtils.bool.def(true),
|
|
719
|
+
/** 填充 */
|
|
720
|
+
fillBody: PropUtils.bool.def(false)
|
|
721
|
+
},
|
|
722
|
+
emits: {
|
|
723
|
+
input: emitFunc()
|
|
724
|
+
},
|
|
725
|
+
setup(__props, { emit }) {
|
|
726
|
+
const props = __props;
|
|
727
|
+
const wrapVisible = ref(false);
|
|
728
|
+
const wrapRef = ref();
|
|
729
|
+
useAppendTo(wrapRef);
|
|
730
|
+
const contentVisible = ref(false);
|
|
731
|
+
function open() {
|
|
732
|
+
wrapVisible.value = true;
|
|
733
|
+
contentVisible.value = true;
|
|
734
|
+
nextTick(() => {
|
|
735
|
+
if (wrapRef.value) {
|
|
736
|
+
PlvPopperManager.openPopper(wrapRef.value);
|
|
737
|
+
}
|
|
738
|
+
});
|
|
739
|
+
}
|
|
740
|
+
function close() {
|
|
741
|
+
contentVisible.value = false;
|
|
742
|
+
emit("input", false);
|
|
743
|
+
}
|
|
744
|
+
function onAfterLeave() {
|
|
745
|
+
wrapVisible.value = false;
|
|
746
|
+
}
|
|
747
|
+
watch(
|
|
748
|
+
() => props.value,
|
|
749
|
+
() => {
|
|
750
|
+
if (props.value) {
|
|
751
|
+
open();
|
|
752
|
+
} else {
|
|
753
|
+
close();
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
);
|
|
757
|
+
return { __sfc: true, props, emit, wrapVisible, wrapRef, contentVisible, open, close, onAfterLeave, IarIconPopupClose };
|
|
758
|
+
}
|
|
759
|
+
});
|
|
760
|
+
function normalizeComponent(scriptExports, render12, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
|
|
761
|
+
var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
|
|
762
|
+
if (render12) {
|
|
763
|
+
options.render = render12;
|
|
764
|
+
options.staticRenderFns = staticRenderFns;
|
|
765
|
+
options._compiled = true;
|
|
766
|
+
}
|
|
767
|
+
return {
|
|
768
|
+
exports: scriptExports,
|
|
769
|
+
options
|
|
770
|
+
};
|
|
771
|
+
}
|
|
772
|
+
var _sfc_render$a = function render() {
|
|
773
|
+
var _vm = this, _c = _vm._self._c, _setup = _vm._self._setupProxy;
|
|
774
|
+
return _c("div", { directives: [{ name: "show", rawName: "v-show", value: _setup.wrapVisible, expression: "wrapVisible" }], ref: "wrapRef", staticClass: "plv-iar-mobile-popup", class: {
|
|
775
|
+
"plv-iar-mobile-popup--fill-body": _vm.fillBody
|
|
776
|
+
}, on: { "click": _setup.close } }, [_c("transition", { attrs: { "name": "iar-popup-slide" }, on: { "after-leave": _setup.onAfterLeave } }, [_c("div", { directives: [{ name: "show", rawName: "v-show", value: _setup.contentVisible, expression: "contentVisible" }], staticClass: "plv-iar-mobile-popup__content", style: {
|
|
777
|
+
background: _vm.background
|
|
778
|
+
}, on: { "click": function($event) {
|
|
779
|
+
$event.stopPropagation();
|
|
780
|
+
} } }, [_vm.title ? _c("div", { staticClass: "plv-iar-mobile-popup__title" }, [_vm._v(_vm._s(_vm.title))]) : _vm._e(), _vm.closeable ? _c(_setup.IarIconPopupClose, { staticClass: "plv-iar-mobile-popup__close", on: { "click": _setup.close } }) : _vm._e(), _vm._t("default")], 2)])], 1);
|
|
781
|
+
};
|
|
782
|
+
var _sfc_staticRenderFns$a = [];
|
|
783
|
+
var __component__$a = /* @__PURE__ */ normalizeComponent(
|
|
784
|
+
_sfc_main$a,
|
|
785
|
+
_sfc_render$a,
|
|
786
|
+
_sfc_staticRenderFns$a
|
|
787
|
+
);
|
|
788
|
+
const MobilePopup = __component__$a.exports;
|
|
789
|
+
var areaPicker = function(t2) {
|
|
790
|
+
var e = {};
|
|
791
|
+
function n2(r2) {
|
|
792
|
+
if (e[r2]) return e[r2].exports;
|
|
793
|
+
var o2 = e[r2] = { i: r2, l: false, exports: {} };
|
|
794
|
+
return t2[r2].call(o2.exports, o2, o2.exports, n2), o2.l = true, o2.exports;
|
|
795
|
+
}
|
|
796
|
+
return n2.m = t2, n2.c = e, n2.d = function(t3, e2, r2) {
|
|
797
|
+
n2.o(t3, e2) || Object.defineProperty(t3, e2, { enumerable: true, get: r2 });
|
|
798
|
+
}, n2.r = function(t3) {
|
|
799
|
+
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t3, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t3, "__esModule", { value: true });
|
|
800
|
+
}, n2.t = function(t3, e2) {
|
|
801
|
+
if (1 & e2 && (t3 = n2(t3)), 8 & e2) return t3;
|
|
802
|
+
if (4 & e2 && "object" == typeof t3 && t3 && t3.__esModule) return t3;
|
|
803
|
+
var r2 = /* @__PURE__ */ Object.create(null);
|
|
804
|
+
if (n2.r(r2), Object.defineProperty(r2, "default", { enumerable: true, value: t3 }), 2 & e2 && "string" != typeof t3) for (var o2 in t3) n2.d(r2, o2, (function(e3) {
|
|
805
|
+
return t3[e3];
|
|
806
|
+
}).bind(null, o2));
|
|
807
|
+
return r2;
|
|
808
|
+
}, n2.n = function(t3) {
|
|
809
|
+
var e2 = t3 && t3.__esModule ? function() {
|
|
810
|
+
return t3.default;
|
|
811
|
+
} : function() {
|
|
812
|
+
return t3;
|
|
813
|
+
};
|
|
814
|
+
return n2.d(e2, "a", e2), e2;
|
|
815
|
+
}, n2.o = function(t3, e2) {
|
|
816
|
+
return Object.prototype.hasOwnProperty.call(t3, e2);
|
|
817
|
+
}, n2.p = "", n2(n2.s = 56);
|
|
818
|
+
}([function(t2, e, n2) {
|
|
819
|
+
function r2(t3, e2, n3, r3, o2, i2, a2, c2) {
|
|
820
|
+
var s2, u2 = "function" == typeof t3 ? t3.options : t3;
|
|
821
|
+
if (e2 && (u2.render = e2, u2.staticRenderFns = n3, u2._compiled = true), r3 && (u2.functional = true), i2 && (u2._scopeId = "data-v-" + i2), a2 ? (s2 = function(t4) {
|
|
822
|
+
(t4 = t4 || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) || "undefined" == typeof __VUE_SSR_CONTEXT__ || (t4 = __VUE_SSR_CONTEXT__), o2 && o2.call(this, t4), t4 && t4._registeredComponents && t4._registeredComponents.add(a2);
|
|
823
|
+
}, u2._ssrRegister = s2) : o2 && (s2 = c2 ? function() {
|
|
824
|
+
o2.call(this, this.$root.$options.shadowRoot);
|
|
825
|
+
} : o2), s2) if (u2.functional) {
|
|
826
|
+
u2._injectStyles = s2;
|
|
827
|
+
var l2 = u2.render;
|
|
828
|
+
u2.render = function(t4, e3) {
|
|
829
|
+
return s2.call(e3), l2(t4, e3);
|
|
830
|
+
};
|
|
831
|
+
} else {
|
|
832
|
+
var f2 = u2.beforeCreate;
|
|
833
|
+
u2.beforeCreate = f2 ? [].concat(f2, s2) : [s2];
|
|
834
|
+
}
|
|
835
|
+
return { exports: t3, options: u2 };
|
|
836
|
+
}
|
|
837
|
+
n2.d(e, "a", function() {
|
|
838
|
+
return r2;
|
|
839
|
+
});
|
|
840
|
+
}, , function(t2, e, n2) {
|
|
841
|
+
t2.exports = n2(15);
|
|
842
|
+
}, function(t2, e, n2) {
|
|
843
|
+
var r2 = n2(16), o2 = n2(13), i2 = n2(10), a2 = n2(17);
|
|
844
|
+
t2.exports = function(t3) {
|
|
845
|
+
return r2(t3) || o2(t3) || i2(t3) || a2();
|
|
846
|
+
}, t2.exports.default = t2.exports, t2.exports.__esModule = true;
|
|
847
|
+
}, , function(t2, e) {
|
|
848
|
+
t2.exports = function(t3, e2, n2) {
|
|
849
|
+
return e2 in t3 ? Object.defineProperty(t3, e2, { value: n2, enumerable: true, configurable: true, writable: true }) : t3[e2] = n2, t3;
|
|
850
|
+
}, t2.exports.default = t2.exports, t2.exports.__esModule = true;
|
|
851
|
+
}, , function(t2, e, n2) {
|
|
852
|
+
n2.d(e, "a", function() {
|
|
853
|
+
return u2;
|
|
854
|
+
});
|
|
855
|
+
var r2 = n2(11), o2 = n2.n(r2), i2 = n2(12), a2 = n2.n(i2), c2 = n2(9), s2 = n2.n(c2).a.prototype.$isServer, u2 = new (function() {
|
|
856
|
+
function t3(e2) {
|
|
857
|
+
o2()(this, t3), this.configKey = e2.configKey;
|
|
858
|
+
}
|
|
859
|
+
return a2()(t3, [{ key: "getGlobalConfig", value: function() {
|
|
860
|
+
return s2 ? {} : (window[this.configKey] || (window[this.configKey] = {}), window[this.configKey]);
|
|
861
|
+
} }, { key: "getCompConfig", value: function(t4) {
|
|
862
|
+
var e2 = this.getGlobalConfig();
|
|
863
|
+
return e2[t4] || (e2[t4] = {}), e2[t4];
|
|
864
|
+
} }, { key: "getConfig", value: function(t4, e2, n3) {
|
|
865
|
+
var r3 = this.getCompConfig(t4)[e2];
|
|
866
|
+
return void 0 === r3 && (r3 = n3), r3;
|
|
867
|
+
} }, { key: "setCompConfig", value: function(t4, e2) {
|
|
868
|
+
this.getGlobalConfig()[t4] = e2;
|
|
869
|
+
} }, { key: "setConfig", value: function(t4, e2, n3) {
|
|
870
|
+
this.getCompConfig(t4)[e2] = n3;
|
|
871
|
+
} }]), t3;
|
|
872
|
+
}())({ configKey: "@@polyv-ui-admin-config" });
|
|
873
|
+
}, function(t2, e) {
|
|
874
|
+
t2.exports = function(t3, e2) {
|
|
875
|
+
(null == e2 || e2 > t3.length) && (e2 = t3.length);
|
|
876
|
+
for (var n2 = 0, r2 = new Array(e2); n2 < e2; n2++) r2[n2] = t3[n2];
|
|
877
|
+
return r2;
|
|
878
|
+
}, t2.exports.default = t2.exports, t2.exports.__esModule = true;
|
|
879
|
+
}, function(t2, e) {
|
|
880
|
+
t2.exports = require$$0;
|
|
881
|
+
}, function(t2, e, n2) {
|
|
882
|
+
var r2 = n2(8);
|
|
883
|
+
t2.exports = function(t3, e2) {
|
|
884
|
+
if (t3) {
|
|
885
|
+
if ("string" == typeof t3) return r2(t3, e2);
|
|
886
|
+
var n3 = Object.prototype.toString.call(t3).slice(8, -1);
|
|
887
|
+
return "Object" === n3 && t3.constructor && (n3 = t3.constructor.name), "Map" === n3 || "Set" === n3 ? Array.from(t3) : "Arguments" === n3 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n3) ? r2(t3, e2) : void 0;
|
|
888
|
+
}
|
|
889
|
+
}, t2.exports.default = t2.exports, t2.exports.__esModule = true;
|
|
890
|
+
}, function(t2, e) {
|
|
891
|
+
t2.exports = function(t3, e2) {
|
|
892
|
+
if (!(t3 instanceof e2)) throw new TypeError("Cannot call a class as a function");
|
|
893
|
+
}, t2.exports.default = t2.exports, t2.exports.__esModule = true;
|
|
894
|
+
}, function(t2, e) {
|
|
895
|
+
function n2(t3, e2) {
|
|
896
|
+
for (var n3 = 0; n3 < e2.length; n3++) {
|
|
897
|
+
var r2 = e2[n3];
|
|
898
|
+
r2.enumerable = r2.enumerable || false, r2.configurable = true, "value" in r2 && (r2.writable = true), Object.defineProperty(t3, r2.key, r2);
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
t2.exports = function(t3, e2, r2) {
|
|
902
|
+
return e2 && n2(t3.prototype, e2), r2 && n2(t3, r2), t3;
|
|
903
|
+
}, t2.exports.default = t2.exports, t2.exports.__esModule = true;
|
|
904
|
+
}, function(t2, e) {
|
|
905
|
+
t2.exports = function(t3) {
|
|
906
|
+
if ("undefined" != typeof Symbol && Symbol.iterator in Object(t3)) return Array.from(t3);
|
|
907
|
+
}, t2.exports.default = t2.exports, t2.exports.__esModule = true;
|
|
908
|
+
}, function(t2, e, n2) {
|
|
909
|
+
n2.d(e, "a", function() {
|
|
910
|
+
return i2;
|
|
911
|
+
});
|
|
912
|
+
var r2 = n2(20), o2 = n2.n(r2), i2 = "__polyvUILangKey";
|
|
913
|
+
function a2(t3, e2, n3) {
|
|
914
|
+
return n3.replace(new RegExp("\\${" + t3 + "}", "g"), e2);
|
|
915
|
+
}
|
|
916
|
+
e.b = { inject: { configProvider: { default: null } }, computed: { $currentLocale: function() {
|
|
917
|
+
var t3 = this.configProvider;
|
|
918
|
+
return t3 && t3.locale;
|
|
919
|
+
}, $currentLang: function() {
|
|
920
|
+
return this.$currentLocale && this.$currentLocale.$lang ? this.$currentLocale.$lang : "zh_CN";
|
|
921
|
+
} }, methods: { $uiLang: function(t3) {
|
|
922
|
+
var e2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "", n3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, r3 = this.configProvider, o3 = null;
|
|
923
|
+
if (r3 && r3.locale ? o3 = r3.locale : window[i2] && (o3 = window[i2]), !o3 || !o3[t3]) return e2;
|
|
924
|
+
var c2 = o3[t3];
|
|
925
|
+
if (n3) for (var s2 = Object.keys(n3), u2 = 0, l2 = s2; u2 < l2.length; u2++) {
|
|
926
|
+
var f2 = l2[u2], p2 = n3[f2];
|
|
927
|
+
c2 = a2(f2, p2, c2);
|
|
928
|
+
}
|
|
929
|
+
return c2;
|
|
930
|
+
}, shortNumber: function(t3) {
|
|
931
|
+
return console.warn("this.$currentLang", this.$currentLang), function(t4) {
|
|
932
|
+
var e2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "w", n3 = { w: 1e4, k: 1e3 }[e2];
|
|
933
|
+
if (t4 >= n3) {
|
|
934
|
+
var r3 = (t4 / n3).toFixed(1), i3 = r3.split("."), a3 = o2()(i3, 2), c2 = a3[0], s2 = a3[1];
|
|
935
|
+
return (r3 = 0 === Number(s2) ? c2 : r3) + e2;
|
|
936
|
+
}
|
|
937
|
+
return t4.toString();
|
|
938
|
+
}(t3, "zh_CN" === this.$currentLang ? "w" : "k");
|
|
939
|
+
} } };
|
|
940
|
+
}, function(t2, e, n2) {
|
|
941
|
+
var r2 = function(t3) {
|
|
942
|
+
var e2, n3 = Object.prototype, r3 = n3.hasOwnProperty, o2 = "function" == typeof Symbol ? Symbol : {}, i2 = o2.iterator || "@@iterator", a2 = o2.asyncIterator || "@@asyncIterator", c2 = o2.toStringTag || "@@toStringTag";
|
|
943
|
+
function s2(t4, e3, n4) {
|
|
944
|
+
return Object.defineProperty(t4, e3, { value: n4, enumerable: true, configurable: true, writable: true }), t4[e3];
|
|
945
|
+
}
|
|
946
|
+
try {
|
|
947
|
+
s2({}, "");
|
|
948
|
+
} catch (t4) {
|
|
949
|
+
s2 = function(t5, e3, n4) {
|
|
950
|
+
return t5[e3] = n4;
|
|
951
|
+
};
|
|
952
|
+
}
|
|
953
|
+
function u2(t4, e3, n4, r4) {
|
|
954
|
+
var o3 = e3 && e3.prototype instanceof y2 ? e3 : y2, i3 = Object.create(o3.prototype), a3 = new O2(r4 || []);
|
|
955
|
+
return i3._invoke = /* @__PURE__ */ function(t5, e4, n5) {
|
|
956
|
+
var r5 = f2;
|
|
957
|
+
return function(o4, i4) {
|
|
958
|
+
if (r5 === h2) throw new Error("Generator is already running");
|
|
959
|
+
if (r5 === d2) {
|
|
960
|
+
if ("throw" === o4) throw i4;
|
|
961
|
+
return k();
|
|
962
|
+
}
|
|
963
|
+
for (n5.method = o4, n5.arg = i4; ; ) {
|
|
964
|
+
var a4 = n5.delegate;
|
|
965
|
+
if (a4) {
|
|
966
|
+
var c3 = E2(a4, n5);
|
|
967
|
+
if (c3) {
|
|
968
|
+
if (c3 === v2) continue;
|
|
969
|
+
return c3;
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
if ("next" === n5.method) n5.sent = n5._sent = n5.arg;
|
|
973
|
+
else if ("throw" === n5.method) {
|
|
974
|
+
if (r5 === f2) throw r5 = d2, n5.arg;
|
|
975
|
+
n5.dispatchException(n5.arg);
|
|
976
|
+
} else "return" === n5.method && n5.abrupt("return", n5.arg);
|
|
977
|
+
r5 = h2;
|
|
978
|
+
var s3 = l2(t5, e4, n5);
|
|
979
|
+
if ("normal" === s3.type) {
|
|
980
|
+
if (r5 = n5.done ? d2 : p2, s3.arg === v2) continue;
|
|
981
|
+
return { value: s3.arg, done: n5.done };
|
|
982
|
+
}
|
|
983
|
+
"throw" === s3.type && (r5 = d2, n5.method = "throw", n5.arg = s3.arg);
|
|
984
|
+
}
|
|
985
|
+
};
|
|
986
|
+
}(t4, n4, a3), i3;
|
|
987
|
+
}
|
|
988
|
+
function l2(t4, e3, n4) {
|
|
989
|
+
try {
|
|
990
|
+
return { type: "normal", arg: t4.call(e3, n4) };
|
|
991
|
+
} catch (t5) {
|
|
992
|
+
return { type: "throw", arg: t5 };
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
t3.wrap = u2;
|
|
996
|
+
var f2 = "suspendedStart", p2 = "suspendedYield", h2 = "executing", d2 = "completed", v2 = {};
|
|
997
|
+
function y2() {
|
|
998
|
+
}
|
|
999
|
+
function m2() {
|
|
1000
|
+
}
|
|
1001
|
+
function g2() {
|
|
1002
|
+
}
|
|
1003
|
+
var b2 = {};
|
|
1004
|
+
s2(b2, i2, function() {
|
|
1005
|
+
return this;
|
|
1006
|
+
});
|
|
1007
|
+
var w2 = Object.getPrototypeOf, _2 = w2 && w2(w2(L2([])));
|
|
1008
|
+
_2 && _2 !== n3 && r3.call(_2, i2) && (b2 = _2);
|
|
1009
|
+
var x2 = g2.prototype = y2.prototype = Object.create(b2);
|
|
1010
|
+
function C2(t4) {
|
|
1011
|
+
["next", "throw", "return"].forEach(function(e3) {
|
|
1012
|
+
s2(t4, e3, function(t5) {
|
|
1013
|
+
return this._invoke(e3, t5);
|
|
1014
|
+
});
|
|
1015
|
+
});
|
|
1016
|
+
}
|
|
1017
|
+
function S2(t4, e3) {
|
|
1018
|
+
var n4;
|
|
1019
|
+
this._invoke = function(o3, i3) {
|
|
1020
|
+
function a3() {
|
|
1021
|
+
return new e3(function(n5, a4) {
|
|
1022
|
+
!function n6(o4, i4, a5, c3) {
|
|
1023
|
+
var s3 = l2(t4[o4], t4, i4);
|
|
1024
|
+
if ("throw" !== s3.type) {
|
|
1025
|
+
var u3 = s3.arg, f3 = u3.value;
|
|
1026
|
+
return f3 && "object" == typeof f3 && r3.call(f3, "__await") ? e3.resolve(f3.__await).then(function(t5) {
|
|
1027
|
+
n6("next", t5, a5, c3);
|
|
1028
|
+
}, function(t5) {
|
|
1029
|
+
n6("throw", t5, a5, c3);
|
|
1030
|
+
}) : e3.resolve(f3).then(function(t5) {
|
|
1031
|
+
u3.value = t5, a5(u3);
|
|
1032
|
+
}, function(t5) {
|
|
1033
|
+
return n6("throw", t5, a5, c3);
|
|
1034
|
+
});
|
|
1035
|
+
}
|
|
1036
|
+
c3(s3.arg);
|
|
1037
|
+
}(o3, i3, n5, a4);
|
|
1038
|
+
});
|
|
1039
|
+
}
|
|
1040
|
+
return n4 = n4 ? n4.then(a3, a3) : a3();
|
|
1041
|
+
};
|
|
1042
|
+
}
|
|
1043
|
+
function E2(t4, n4) {
|
|
1044
|
+
var r4 = t4.iterator[n4.method];
|
|
1045
|
+
if (r4 === e2) {
|
|
1046
|
+
if (n4.delegate = null, "throw" === n4.method) {
|
|
1047
|
+
if (t4.iterator.return && (n4.method = "return", n4.arg = e2, E2(t4, n4), "throw" === n4.method)) return v2;
|
|
1048
|
+
n4.method = "throw", n4.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
1049
|
+
}
|
|
1050
|
+
return v2;
|
|
1051
|
+
}
|
|
1052
|
+
var o3 = l2(r4, t4.iterator, n4.arg);
|
|
1053
|
+
if ("throw" === o3.type) return n4.method = "throw", n4.arg = o3.arg, n4.delegate = null, v2;
|
|
1054
|
+
var i3 = o3.arg;
|
|
1055
|
+
return i3 ? i3.done ? (n4[t4.resultName] = i3.value, n4.next = t4.nextLoc, "return" !== n4.method && (n4.method = "next", n4.arg = e2), n4.delegate = null, v2) : i3 : (n4.method = "throw", n4.arg = new TypeError("iterator result is not an object"), n4.delegate = null, v2);
|
|
1056
|
+
}
|
|
1057
|
+
function A2(t4) {
|
|
1058
|
+
var e3 = { tryLoc: t4[0] };
|
|
1059
|
+
1 in t4 && (e3.catchLoc = t4[1]), 2 in t4 && (e3.finallyLoc = t4[2], e3.afterLoc = t4[3]), this.tryEntries.push(e3);
|
|
1060
|
+
}
|
|
1061
|
+
function j2(t4) {
|
|
1062
|
+
var e3 = t4.completion || {};
|
|
1063
|
+
e3.type = "normal", delete e3.arg, t4.completion = e3;
|
|
1064
|
+
}
|
|
1065
|
+
function O2(t4) {
|
|
1066
|
+
this.tryEntries = [{ tryLoc: "root" }], t4.forEach(A2, this), this.reset(true);
|
|
1067
|
+
}
|
|
1068
|
+
function L2(t4) {
|
|
1069
|
+
if (t4) {
|
|
1070
|
+
var n4 = t4[i2];
|
|
1071
|
+
if (n4) return n4.call(t4);
|
|
1072
|
+
if ("function" == typeof t4.next) return t4;
|
|
1073
|
+
if (!isNaN(t4.length)) {
|
|
1074
|
+
var o3 = -1, a3 = function n5() {
|
|
1075
|
+
for (; ++o3 < t4.length; ) if (r3.call(t4, o3)) return n5.value = t4[o3], n5.done = false, n5;
|
|
1076
|
+
return n5.value = e2, n5.done = true, n5;
|
|
1077
|
+
};
|
|
1078
|
+
return a3.next = a3;
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
return { next: k };
|
|
1082
|
+
}
|
|
1083
|
+
function k() {
|
|
1084
|
+
return { value: e2, done: true };
|
|
1085
|
+
}
|
|
1086
|
+
return m2.prototype = g2, s2(x2, "constructor", g2), s2(g2, "constructor", m2), m2.displayName = s2(g2, c2, "GeneratorFunction"), t3.isGeneratorFunction = function(t4) {
|
|
1087
|
+
var e3 = "function" == typeof t4 && t4.constructor;
|
|
1088
|
+
return !!e3 && (e3 === m2 || "GeneratorFunction" === (e3.displayName || e3.name));
|
|
1089
|
+
}, t3.mark = function(t4) {
|
|
1090
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(t4, g2) : (t4.__proto__ = g2, s2(t4, c2, "GeneratorFunction")), t4.prototype = Object.create(x2), t4;
|
|
1091
|
+
}, t3.awrap = function(t4) {
|
|
1092
|
+
return { __await: t4 };
|
|
1093
|
+
}, C2(S2.prototype), s2(S2.prototype, a2, function() {
|
|
1094
|
+
return this;
|
|
1095
|
+
}), t3.AsyncIterator = S2, t3.async = function(e3, n4, r4, o3, i3) {
|
|
1096
|
+
void 0 === i3 && (i3 = Promise);
|
|
1097
|
+
var a3 = new S2(u2(e3, n4, r4, o3), i3);
|
|
1098
|
+
return t3.isGeneratorFunction(n4) ? a3 : a3.next().then(function(t4) {
|
|
1099
|
+
return t4.done ? t4.value : a3.next();
|
|
1100
|
+
});
|
|
1101
|
+
}, C2(x2), s2(x2, c2, "Generator"), s2(x2, i2, function() {
|
|
1102
|
+
return this;
|
|
1103
|
+
}), s2(x2, "toString", function() {
|
|
1104
|
+
return "[object Generator]";
|
|
1105
|
+
}), t3.keys = function(t4) {
|
|
1106
|
+
var e3 = [];
|
|
1107
|
+
for (var n4 in t4) e3.push(n4);
|
|
1108
|
+
return e3.reverse(), function n5() {
|
|
1109
|
+
for (; e3.length; ) {
|
|
1110
|
+
var r4 = e3.pop();
|
|
1111
|
+
if (r4 in t4) return n5.value = r4, n5.done = false, n5;
|
|
1112
|
+
}
|
|
1113
|
+
return n5.done = true, n5;
|
|
1114
|
+
};
|
|
1115
|
+
}, t3.values = L2, O2.prototype = { constructor: O2, reset: function(t4) {
|
|
1116
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = e2, this.done = false, this.delegate = null, this.method = "next", this.arg = e2, this.tryEntries.forEach(j2), !t4) for (var n4 in this) "t" === n4.charAt(0) && r3.call(this, n4) && !isNaN(+n4.slice(1)) && (this[n4] = e2);
|
|
1117
|
+
}, stop: function() {
|
|
1118
|
+
this.done = true;
|
|
1119
|
+
var t4 = this.tryEntries[0].completion;
|
|
1120
|
+
if ("throw" === t4.type) throw t4.arg;
|
|
1121
|
+
return this.rval;
|
|
1122
|
+
}, dispatchException: function(t4) {
|
|
1123
|
+
if (this.done) throw t4;
|
|
1124
|
+
var n4 = this;
|
|
1125
|
+
function o3(r4, o4) {
|
|
1126
|
+
return c3.type = "throw", c3.arg = t4, n4.next = r4, o4 && (n4.method = "next", n4.arg = e2), !!o4;
|
|
1127
|
+
}
|
|
1128
|
+
for (var i3 = this.tryEntries.length - 1; i3 >= 0; --i3) {
|
|
1129
|
+
var a3 = this.tryEntries[i3], c3 = a3.completion;
|
|
1130
|
+
if ("root" === a3.tryLoc) return o3("end");
|
|
1131
|
+
if (a3.tryLoc <= this.prev) {
|
|
1132
|
+
var s3 = r3.call(a3, "catchLoc"), u3 = r3.call(a3, "finallyLoc");
|
|
1133
|
+
if (s3 && u3) {
|
|
1134
|
+
if (this.prev < a3.catchLoc) return o3(a3.catchLoc, true);
|
|
1135
|
+
if (this.prev < a3.finallyLoc) return o3(a3.finallyLoc);
|
|
1136
|
+
} else if (s3) {
|
|
1137
|
+
if (this.prev < a3.catchLoc) return o3(a3.catchLoc, true);
|
|
1138
|
+
} else {
|
|
1139
|
+
if (!u3) throw new Error("try statement without catch or finally");
|
|
1140
|
+
if (this.prev < a3.finallyLoc) return o3(a3.finallyLoc);
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
}, abrupt: function(t4, e3) {
|
|
1145
|
+
for (var n4 = this.tryEntries.length - 1; n4 >= 0; --n4) {
|
|
1146
|
+
var o3 = this.tryEntries[n4];
|
|
1147
|
+
if (o3.tryLoc <= this.prev && r3.call(o3, "finallyLoc") && this.prev < o3.finallyLoc) {
|
|
1148
|
+
var i3 = o3;
|
|
1149
|
+
break;
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
i3 && ("break" === t4 || "continue" === t4) && i3.tryLoc <= e3 && e3 <= i3.finallyLoc && (i3 = null);
|
|
1153
|
+
var a3 = i3 ? i3.completion : {};
|
|
1154
|
+
return a3.type = t4, a3.arg = e3, i3 ? (this.method = "next", this.next = i3.finallyLoc, v2) : this.complete(a3);
|
|
1155
|
+
}, complete: function(t4, e3) {
|
|
1156
|
+
if ("throw" === t4.type) throw t4.arg;
|
|
1157
|
+
return "break" === t4.type || "continue" === t4.type ? this.next = t4.arg : "return" === t4.type ? (this.rval = this.arg = t4.arg, this.method = "return", this.next = "end") : "normal" === t4.type && e3 && (this.next = e3), v2;
|
|
1158
|
+
}, finish: function(t4) {
|
|
1159
|
+
for (var e3 = this.tryEntries.length - 1; e3 >= 0; --e3) {
|
|
1160
|
+
var n4 = this.tryEntries[e3];
|
|
1161
|
+
if (n4.finallyLoc === t4) return this.complete(n4.completion, n4.afterLoc), j2(n4), v2;
|
|
1162
|
+
}
|
|
1163
|
+
}, catch: function(t4) {
|
|
1164
|
+
for (var e3 = this.tryEntries.length - 1; e3 >= 0; --e3) {
|
|
1165
|
+
var n4 = this.tryEntries[e3];
|
|
1166
|
+
if (n4.tryLoc === t4) {
|
|
1167
|
+
var r4 = n4.completion;
|
|
1168
|
+
if ("throw" === r4.type) {
|
|
1169
|
+
var o3 = r4.arg;
|
|
1170
|
+
j2(n4);
|
|
1171
|
+
}
|
|
1172
|
+
return o3;
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
throw new Error("illegal catch attempt");
|
|
1176
|
+
}, delegateYield: function(t4, n4, r4) {
|
|
1177
|
+
return this.delegate = { iterator: L2(t4), resultName: n4, nextLoc: r4 }, "next" === this.method && (this.arg = e2), v2;
|
|
1178
|
+
} }, t3;
|
|
1179
|
+
}(t2.exports);
|
|
1180
|
+
try {
|
|
1181
|
+
regeneratorRuntime = r2;
|
|
1182
|
+
} catch (t3) {
|
|
1183
|
+
"object" == typeof globalThis ? globalThis.regeneratorRuntime = r2 : Function("r", "regeneratorRuntime = r")(r2);
|
|
1184
|
+
}
|
|
1185
|
+
}, function(t2, e, n2) {
|
|
1186
|
+
var r2 = n2(8);
|
|
1187
|
+
t2.exports = function(t3) {
|
|
1188
|
+
if (Array.isArray(t3)) return r2(t3);
|
|
1189
|
+
}, t2.exports.default = t2.exports, t2.exports.__esModule = true;
|
|
1190
|
+
}, function(t2, e) {
|
|
1191
|
+
t2.exports = function() {
|
|
1192
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1193
|
+
}, t2.exports.default = t2.exports, t2.exports.__esModule = true;
|
|
1194
|
+
}, , , function(t2, e, n2) {
|
|
1195
|
+
var r2 = n2(21), o2 = n2(27), i2 = n2(10), a2 = n2(22);
|
|
1196
|
+
t2.exports = function(t3, e2) {
|
|
1197
|
+
return r2(t3) || o2(t3, e2) || i2(t3, e2) || a2();
|
|
1198
|
+
}, t2.exports.default = t2.exports, t2.exports.__esModule = true;
|
|
1199
|
+
}, function(t2, e) {
|
|
1200
|
+
t2.exports = function(t3) {
|
|
1201
|
+
if (Array.isArray(t3)) return t3;
|
|
1202
|
+
}, t2.exports.default = t2.exports, t2.exports.__esModule = true;
|
|
1203
|
+
}, function(t2, e) {
|
|
1204
|
+
t2.exports = function() {
|
|
1205
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1206
|
+
}, t2.exports.default = t2.exports, t2.exports.__esModule = true;
|
|
1207
|
+
}, function(t2, e, n2) {
|
|
1208
|
+
function r2(t3, e2) {
|
|
1209
|
+
var n3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, r3 = t3.$scopedSlots[e2], o2 = t3.$slots[e2];
|
|
1210
|
+
return r3 ? r3(n3) : o2 || null;
|
|
1211
|
+
}
|
|
1212
|
+
n2.d(e, "b", function() {
|
|
1213
|
+
return r2;
|
|
1214
|
+
}), e.a = { props: { slotName: { type: String, default: "default" }, scopedData: Object, target: Object, className: [String, Array], tagName: { type: String, default: "div" } }, computed: { renderSlot: function() {
|
|
1215
|
+
var t3 = this.slotName, e2 = this.target.$scopedSlots[t3], n3 = this.target.$slots[t3];
|
|
1216
|
+
return e2 || n3 ? function(t4, r3) {
|
|
1217
|
+
return e2 ? e2(r3) : n3;
|
|
1218
|
+
} : function() {
|
|
1219
|
+
};
|
|
1220
|
+
} }, render: function() {
|
|
1221
|
+
var t3 = arguments[0];
|
|
1222
|
+
return t3(this.tagName, { class: this.className }, [this.renderSlot(this.$createElement, this.scopedData)]);
|
|
1223
|
+
} };
|
|
1224
|
+
}, , , function(t2, e) {
|
|
1225
|
+
var n2 = Object.prototype.hasOwnProperty, r2 = e.extend = Object.assign || function(t3) {
|
|
1226
|
+
if (null == t3) throw new Error("target cannot be null");
|
|
1227
|
+
for (var e2, r3, o3 = 0, i3 = arguments.length; ++o3 < i3; ) if (null != (r3 = arguments[o3])) for (e2 in r3) n2.call(r3, e2) && (t3[e2] = r3[e2]);
|
|
1228
|
+
return t3;
|
|
1229
|
+
}, o2 = Object.prototype.toString, i2 = e.isFunction = function(t3) {
|
|
1230
|
+
return "[object Function]" === o2.call(t3);
|
|
1231
|
+
};
|
|
1232
|
+
e.isDate = function(t3) {
|
|
1233
|
+
return "[object Date]" === o2.call(t3);
|
|
1234
|
+
}, e.isObject = function(t3) {
|
|
1235
|
+
return "[object Object]" === o2.call(t3);
|
|
1236
|
+
}, e.isEmptyObject = function(t3) {
|
|
1237
|
+
if (null != t3) {
|
|
1238
|
+
for (var e2 in t3) if (n2.call(t3, e2)) return false;
|
|
1239
|
+
}
|
|
1240
|
+
return true;
|
|
1241
|
+
}, e.each = function(t3, e2) {
|
|
1242
|
+
if (null != t3) {
|
|
1243
|
+
var r3, o3 = t3.length;
|
|
1244
|
+
if (void 0 === o3 || i2(t3)) {
|
|
1245
|
+
for (r3 in t3) if (n2.call(t3, r3) && false === e2.call(t3[r3], t3[r3], r3)) break;
|
|
1246
|
+
} else for (r3 = -1; ++r3 < o3 && false !== e2.call(t3[r3], t3[r3], r3); ) ;
|
|
1247
|
+
}
|
|
1248
|
+
return t3;
|
|
1249
|
+
}, e.toArray = function(t3) {
|
|
1250
|
+
var e2;
|
|
1251
|
+
try {
|
|
1252
|
+
e2 = Array.prototype.slice.call(t3);
|
|
1253
|
+
} catch (r3) {
|
|
1254
|
+
e2 = [];
|
|
1255
|
+
for (var n3 = t3.length; n3; ) e2[--n3] = t3[n3];
|
|
1256
|
+
}
|
|
1257
|
+
return e2;
|
|
1258
|
+
}, e.mergeArray = function(t3, e2) {
|
|
1259
|
+
for (var n3 = e2.length, r3 = t3.length, o3 = 0; o3 < n3; ) t3[r3++] = e2[o3++];
|
|
1260
|
+
return t3.length = r3, t3;
|
|
1261
|
+
}, e.randomStr = function(t3) {
|
|
1262
|
+
var e2 = "";
|
|
1263
|
+
do {
|
|
1264
|
+
e2 += Math.random().toString(36).substr(2);
|
|
1265
|
+
} while (e2.length < 10);
|
|
1266
|
+
return e2 = e2.substr(0, 10) + ("00000" + Math.abs(/* @__PURE__ */ new Date())).slice(-6), t3 && (e2 = t3 + e2), e2;
|
|
1267
|
+
}, e.createClass = function(t3, e2, o3, i3) {
|
|
1268
|
+
var a2 = o3 ? function() {
|
|
1269
|
+
o3.apply(this, i3 ? "function" == typeof i3 ? i3.apply(this, arguments) : i3 : arguments), t3.apply(this, arguments);
|
|
1270
|
+
} : function() {
|
|
1271
|
+
t3.apply(this, arguments);
|
|
1272
|
+
};
|
|
1273
|
+
if (o3) {
|
|
1274
|
+
var c2 = function() {
|
|
1275
|
+
};
|
|
1276
|
+
c2.prototype = o3.prototype, a2.prototype = new c2(), a2.prototype.constructor = a2, r2(a2, o3);
|
|
1277
|
+
}
|
|
1278
|
+
if (e2) for (var s2 in e2) n2.call(e2, s2) && (a2.prototype[s2] = e2[s2]);
|
|
1279
|
+
return a2;
|
|
1280
|
+
};
|
|
1281
|
+
}, function(t2, e) {
|
|
1282
|
+
t2.exports = function(t3, e2) {
|
|
1283
|
+
if ("undefined" != typeof Symbol && Symbol.iterator in Object(t3)) {
|
|
1284
|
+
var n2 = [], r2 = true, o2 = false, i2 = void 0;
|
|
1285
|
+
try {
|
|
1286
|
+
for (var a2, c2 = t3[Symbol.iterator](); !(r2 = (a2 = c2.next()).done) && (n2.push(a2.value), !e2 || n2.length !== e2); r2 = true) ;
|
|
1287
|
+
} catch (t4) {
|
|
1288
|
+
o2 = true, i2 = t4;
|
|
1289
|
+
} finally {
|
|
1290
|
+
try {
|
|
1291
|
+
r2 || null == c2.return || c2.return();
|
|
1292
|
+
} finally {
|
|
1293
|
+
if (o2) throw i2;
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
return n2;
|
|
1297
|
+
}
|
|
1298
|
+
}, t2.exports.default = t2.exports, t2.exports.__esModule = true;
|
|
1299
|
+
}, , , , , , , , , , function(t2, e) {
|
|
1300
|
+
var n2;
|
|
1301
|
+
n2 = /* @__PURE__ */ function() {
|
|
1302
|
+
return this;
|
|
1303
|
+
}();
|
|
1304
|
+
try {
|
|
1305
|
+
n2 = n2 || new Function("return this")();
|
|
1306
|
+
} catch (t3) {
|
|
1307
|
+
"object" == typeof window && (n2 = window);
|
|
1308
|
+
}
|
|
1309
|
+
t2.exports = n2;
|
|
1310
|
+
}, , , , , , , , function(t2, e, n2) {
|
|
1311
|
+
var r2 = n2(21), o2 = n2(13), i2 = n2(10), a2 = n2(22);
|
|
1312
|
+
t2.exports = function(t3) {
|
|
1313
|
+
return r2(t3) || o2(t3) || i2(t3) || a2();
|
|
1314
|
+
}, t2.exports.default = t2.exports, t2.exports.__esModule = true;
|
|
1315
|
+
}, function(t2, e) {
|
|
1316
|
+
function n2(t3, e2) {
|
|
1317
|
+
var n3 = (65535 & t3) + (65535 & e2);
|
|
1318
|
+
return (t3 >> 16) + (e2 >> 16) + (n3 >> 16) << 16 | 65535 & n3;
|
|
1319
|
+
}
|
|
1320
|
+
function r2(t3, e2, r3, o3, i3, a3) {
|
|
1321
|
+
return n2((c3 = n2(n2(e2, t3), n2(o3, a3))) << (s3 = i3) | c3 >>> 32 - s3, r3);
|
|
1322
|
+
var c3, s3;
|
|
1323
|
+
}
|
|
1324
|
+
function o2(t3, e2, n3, o3, i3, a3, c3) {
|
|
1325
|
+
return r2(e2 & n3 | ~e2 & o3, t3, e2, i3, a3, c3);
|
|
1326
|
+
}
|
|
1327
|
+
function i2(t3, e2, n3, o3, i3, a3, c3) {
|
|
1328
|
+
return r2(e2 & o3 | n3 & ~o3, t3, e2, i3, a3, c3);
|
|
1329
|
+
}
|
|
1330
|
+
function a2(t3, e2, n3, o3, i3, a3, c3) {
|
|
1331
|
+
return r2(e2 ^ n3 ^ o3, t3, e2, i3, a3, c3);
|
|
1332
|
+
}
|
|
1333
|
+
function c2(t3, e2, n3, o3, i3, a3, c3) {
|
|
1334
|
+
return r2(n3 ^ (e2 | ~o3), t3, e2, i3, a3, c3);
|
|
1335
|
+
}
|
|
1336
|
+
function s2(t3) {
|
|
1337
|
+
return function(t4) {
|
|
1338
|
+
for (var e2 = "", n3 = 0; n3 < 32 * t4.length; n3 += 8) e2 += String.fromCharCode(t4[n3 >> 5] >>> n3 % 32 & 255);
|
|
1339
|
+
return e2;
|
|
1340
|
+
}(function(t4, e2) {
|
|
1341
|
+
t4[e2 >> 5] |= 128 << e2 % 32, t4[14 + (e2 + 64 >>> 9 << 4)] = e2;
|
|
1342
|
+
for (var r3 = 1732584193, s3 = -271733879, u2 = -1732584194, l2 = 271733878, f2 = 0; f2 < t4.length; f2 += 16) {
|
|
1343
|
+
var p2 = r3, h2 = s3, d2 = u2, v2 = l2;
|
|
1344
|
+
r3 = o2(r3, s3, u2, l2, t4[f2 + 0], 7, -680876936), l2 = o2(l2, r3, s3, u2, t4[f2 + 1], 12, -389564586), u2 = o2(u2, l2, r3, s3, t4[f2 + 2], 17, 606105819), s3 = o2(s3, u2, l2, r3, t4[f2 + 3], 22, -1044525330), r3 = o2(r3, s3, u2, l2, t4[f2 + 4], 7, -176418897), l2 = o2(l2, r3, s3, u2, t4[f2 + 5], 12, 1200080426), u2 = o2(u2, l2, r3, s3, t4[f2 + 6], 17, -1473231341), s3 = o2(s3, u2, l2, r3, t4[f2 + 7], 22, -45705983), r3 = o2(r3, s3, u2, l2, t4[f2 + 8], 7, 1770035416), l2 = o2(l2, r3, s3, u2, t4[f2 + 9], 12, -1958414417), u2 = o2(u2, l2, r3, s3, t4[f2 + 10], 17, -42063), s3 = o2(s3, u2, l2, r3, t4[f2 + 11], 22, -1990404162), r3 = o2(r3, s3, u2, l2, t4[f2 + 12], 7, 1804603682), l2 = o2(l2, r3, s3, u2, t4[f2 + 13], 12, -40341101), u2 = o2(u2, l2, r3, s3, t4[f2 + 14], 17, -1502002290), r3 = i2(r3, s3 = o2(s3, u2, l2, r3, t4[f2 + 15], 22, 1236535329), u2, l2, t4[f2 + 1], 5, -165796510), l2 = i2(l2, r3, s3, u2, t4[f2 + 6], 9, -1069501632), u2 = i2(u2, l2, r3, s3, t4[f2 + 11], 14, 643717713), s3 = i2(s3, u2, l2, r3, t4[f2 + 0], 20, -373897302), r3 = i2(r3, s3, u2, l2, t4[f2 + 5], 5, -701558691), l2 = i2(l2, r3, s3, u2, t4[f2 + 10], 9, 38016083), u2 = i2(u2, l2, r3, s3, t4[f2 + 15], 14, -660478335), s3 = i2(s3, u2, l2, r3, t4[f2 + 4], 20, -405537848), r3 = i2(r3, s3, u2, l2, t4[f2 + 9], 5, 568446438), l2 = i2(l2, r3, s3, u2, t4[f2 + 14], 9, -1019803690), u2 = i2(u2, l2, r3, s3, t4[f2 + 3], 14, -187363961), s3 = i2(s3, u2, l2, r3, t4[f2 + 8], 20, 1163531501), r3 = i2(r3, s3, u2, l2, t4[f2 + 13], 5, -1444681467), l2 = i2(l2, r3, s3, u2, t4[f2 + 2], 9, -51403784), u2 = i2(u2, l2, r3, s3, t4[f2 + 7], 14, 1735328473), r3 = a2(r3, s3 = i2(s3, u2, l2, r3, t4[f2 + 12], 20, -1926607734), u2, l2, t4[f2 + 5], 4, -378558), l2 = a2(l2, r3, s3, u2, t4[f2 + 8], 11, -2022574463), u2 = a2(u2, l2, r3, s3, t4[f2 + 11], 16, 1839030562), s3 = a2(s3, u2, l2, r3, t4[f2 + 14], 23, -35309556), r3 = a2(r3, s3, u2, l2, t4[f2 + 1], 4, -1530992060), l2 = a2(l2, r3, s3, u2, t4[f2 + 4], 11, 1272893353), u2 = a2(u2, l2, r3, s3, t4[f2 + 7], 16, -155497632), s3 = a2(s3, u2, l2, r3, t4[f2 + 10], 23, -1094730640), r3 = a2(r3, s3, u2, l2, t4[f2 + 13], 4, 681279174), l2 = a2(l2, r3, s3, u2, t4[f2 + 0], 11, -358537222), u2 = a2(u2, l2, r3, s3, t4[f2 + 3], 16, -722521979), s3 = a2(s3, u2, l2, r3, t4[f2 + 6], 23, 76029189), r3 = a2(r3, s3, u2, l2, t4[f2 + 9], 4, -640364487), l2 = a2(l2, r3, s3, u2, t4[f2 + 12], 11, -421815835), u2 = a2(u2, l2, r3, s3, t4[f2 + 15], 16, 530742520), r3 = c2(r3, s3 = a2(s3, u2, l2, r3, t4[f2 + 2], 23, -995338651), u2, l2, t4[f2 + 0], 6, -198630844), l2 = c2(l2, r3, s3, u2, t4[f2 + 7], 10, 1126891415), u2 = c2(u2, l2, r3, s3, t4[f2 + 14], 15, -1416354905), s3 = c2(s3, u2, l2, r3, t4[f2 + 5], 21, -57434055), r3 = c2(r3, s3, u2, l2, t4[f2 + 12], 6, 1700485571), l2 = c2(l2, r3, s3, u2, t4[f2 + 3], 10, -1894986606), u2 = c2(u2, l2, r3, s3, t4[f2 + 10], 15, -1051523), s3 = c2(s3, u2, l2, r3, t4[f2 + 1], 21, -2054922799), r3 = c2(r3, s3, u2, l2, t4[f2 + 8], 6, 1873313359), l2 = c2(l2, r3, s3, u2, t4[f2 + 15], 10, -30611744), u2 = c2(u2, l2, r3, s3, t4[f2 + 6], 15, -1560198380), s3 = c2(s3, u2, l2, r3, t4[f2 + 13], 21, 1309151649), r3 = c2(r3, s3, u2, l2, t4[f2 + 4], 6, -145523070), l2 = c2(l2, r3, s3, u2, t4[f2 + 11], 10, -1120210379), u2 = c2(u2, l2, r3, s3, t4[f2 + 2], 15, 718787259), s3 = c2(s3, u2, l2, r3, t4[f2 + 9], 21, -343485551), r3 = n2(r3, p2), s3 = n2(s3, h2), u2 = n2(u2, d2), l2 = n2(l2, v2);
|
|
1345
|
+
}
|
|
1346
|
+
return Array(r3, s3, u2, l2);
|
|
1347
|
+
}(function(t4) {
|
|
1348
|
+
for (var e2 = Array(t4.length >> 2), n3 = 0; n3 < e2.length; n3++) e2[n3] = 0;
|
|
1349
|
+
for (n3 = 0; n3 < 8 * t4.length; n3 += 8) e2[n3 >> 5] |= (255 & t4.charCodeAt(n3 / 8)) << n3 % 32;
|
|
1350
|
+
return e2;
|
|
1351
|
+
}(t3), 8 * t3.length));
|
|
1352
|
+
}
|
|
1353
|
+
t2.exports = function(t3) {
|
|
1354
|
+
return function(t4) {
|
|
1355
|
+
for (var e2, n3 = "", r3 = 0; r3 < t4.length; r3++) e2 = t4.charCodeAt(r3), n3 += "0123456789abcdef".charAt(e2 >>> 4 & 15) + "0123456789abcdef".charAt(15 & e2);
|
|
1356
|
+
return n3;
|
|
1357
|
+
}(s2(function(t4) {
|
|
1358
|
+
for (var e2, n3, r3 = "", o3 = -1; ++o3 < t4.length; ) e2 = t4.charCodeAt(o3), n3 = o3 + 1 < t4.length ? t4.charCodeAt(o3 + 1) : 0, 55296 <= e2 && e2 <= 56319 && 56320 <= n3 && n3 <= 57343 && (e2 = 65536 + ((1023 & e2) << 10) + (1023 & n3), o3++), e2 <= 127 ? r3 += String.fromCharCode(e2) : e2 <= 2047 ? r3 += String.fromCharCode(192 | e2 >>> 6 & 31, 128 | 63 & e2) : e2 <= 65535 ? r3 += String.fromCharCode(224 | e2 >>> 12 & 15, 128 | e2 >>> 6 & 63, 128 | 63 & e2) : e2 <= 2097151 && (r3 += String.fromCharCode(240 | e2 >>> 18 & 7, 128 | e2 >>> 12 & 63, 128 | e2 >>> 6 & 63, 128 | 63 & e2));
|
|
1359
|
+
return r3;
|
|
1360
|
+
}(t3)));
|
|
1361
|
+
};
|
|
1362
|
+
}, function(t2, e, n2) {
|
|
1363
|
+
var r2 = n2(26), o2 = n2(62), i2 = n2(65), a2 = n2(66), c2 = window, s2 = c2.document, u2 = s2.head || s2.getElementsByTagName("head")[0], l2 = "Request cancelled";
|
|
1364
|
+
function f2() {
|
|
1365
|
+
var t3 = new Error(l2);
|
|
1366
|
+
return t3.isAJAXCancel = true, t3;
|
|
1367
|
+
}
|
|
1368
|
+
var p2 = "Request timeout";
|
|
1369
|
+
function h2() {
|
|
1370
|
+
var t3 = new Error(p2);
|
|
1371
|
+
return t3.isAJAXTimeout = true, t3;
|
|
1372
|
+
}
|
|
1373
|
+
function d2(t3) {
|
|
1374
|
+
return function(e2, n3) {
|
|
1375
|
+
(n3 = "function" == typeof n3 ? { onload: n3 } : r2.extend({}, n3)).timeout && (n3.timeout = i2.parse(n3.timeout));
|
|
1376
|
+
var o3 = r2.extend({}, n3.data);
|
|
1377
|
+
n3.nocache && (o3._ = +/* @__PURE__ */ new Date());
|
|
1378
|
+
for (var c3 = [e2 = a2.append(e2, o3, { ignoreEmpty: true }), n3], s3 = 2; s3 < arguments.length; s3++) c3.push(arguments[s3]);
|
|
1379
|
+
return t3.apply(this, c3);
|
|
1380
|
+
};
|
|
1381
|
+
}
|
|
1382
|
+
var v2 = "onload" in s2.createElement("script") ? "onload" : "onreadystatechange", y2 = e.getScript = d2(function(t3, e2, n3) {
|
|
1383
|
+
return new o2(function(o3, i3) {
|
|
1384
|
+
var a3, l3, p3;
|
|
1385
|
+
function d3() {
|
|
1386
|
+
a3 && (p3 || !a3.readyState || /loaded|complete/.test(a3.readyState)) && (a3[v2] = a3.onerror = null, u2.removeChild(a3), a3 = null, l3 && clearTimeout(l3), n3 && (window[n3] = null), p3 || o3());
|
|
1387
|
+
}
|
|
1388
|
+
function y3(t4) {
|
|
1389
|
+
!p3 && a3 && (p3 = true, d3(), t4 && i3(t4()));
|
|
1390
|
+
}
|
|
1391
|
+
n3 && (c2[n3] = function() {
|
|
1392
|
+
p3 || o3(r2.toArray(arguments));
|
|
1393
|
+
}), a3 = s2.createElement("script"), e2.charset && (a3.charset = e2.charset), a3.async = true, a3[v2] = a3.onerror = d3, a3.src = t3, u2.firstChild ? u2.insertBefore(a3, u2.firstChild) : u2.appendChild(a3), e2.receiveCancel && e2.receiveCancel.call(c2, function() {
|
|
1394
|
+
y3(f2);
|
|
1395
|
+
});
|
|
1396
|
+
var m3 = Number(e2.timeout);
|
|
1397
|
+
m3 > 0 && (l3 = setTimeout(function() {
|
|
1398
|
+
y3(h2);
|
|
1399
|
+
}, m3));
|
|
1400
|
+
});
|
|
1401
|
+
});
|
|
1402
|
+
var m2 = e.jsonp = function(t3, e2) {
|
|
1403
|
+
var n3;
|
|
1404
|
+
e2 = r2.extend({}, e2);
|
|
1405
|
+
var u3 = "POST" === String(e2.method).toUpperCase();
|
|
1406
|
+
return /[?&]callback=([^&]+)/.test(t3) ? n3 = RegExp.$1 : (n3 = e2.callbackName || function(t4) {
|
|
1407
|
+
var e3 = s2.createElement("a");
|
|
1408
|
+
e3.href = t4;
|
|
1409
|
+
var n4 = e3.pathname.split("/");
|
|
1410
|
+
n4 = (n4[n4.length - 1] || "index").replace(/\.\w+$/, "");
|
|
1411
|
+
for (var r3 = "jsonp_callback_" + (e3.host + "_" + n4).replace(/\W+/g, ""), o3 = r3, i3 = 1; void 0 !== c2[o3]; ) o3 = r3 + "_" + i3++;
|
|
1412
|
+
return o3;
|
|
1413
|
+
}(t3), u3 || (t3 = a2.append(t3, { callback: n3 }))), u3 ? function(t4, e3, n4) {
|
|
1414
|
+
return new o2(function(o3, a3) {
|
|
1415
|
+
var u4, l3, p3, d3;
|
|
1416
|
+
function v3() {
|
|
1417
|
+
u4 && (l3.removeEventListener ? l3.removeEventListener("load", v3, false) : l3.detachEvent && l3.detachEvent("onload", v3), u4.parentNode && u4.parentNode.removeChild(u4), u4 = l3 = null, p3 && clearTimeout(p3), n4 && (window[n4] = null), d3 || o3());
|
|
1418
|
+
}
|
|
1419
|
+
function y3(t5) {
|
|
1420
|
+
!d3 && u4 && (d3 = true, v3(), t5 && a3(t5()));
|
|
1421
|
+
}
|
|
1422
|
+
n4 && (c2[n4] = function() {
|
|
1423
|
+
d3 || o3(r2.toArray(arguments));
|
|
1424
|
+
}), (u4 = s2.createElement("div")).style.display = "none";
|
|
1425
|
+
var m3 = r2.randomStr("form-target-");
|
|
1426
|
+
u4.innerHTML = '<form action="' + t4 + '" target="' + m3 + '" method="post"><input type="hidden" name="callback" value="' + n4 + '" /></form><iframe name="' + m3 + '" id="' + m3 + '"></iframe>';
|
|
1427
|
+
var g2 = u4.firstChild;
|
|
1428
|
+
r2.each(e3.data, function t5(e4, n5) {
|
|
1429
|
+
Array.isArray(e4) && e4.forEach(function(e5) {
|
|
1430
|
+
t5(e5, n5);
|
|
1431
|
+
});
|
|
1432
|
+
var r3 = s2.createElement("input");
|
|
1433
|
+
r3.type = "hidden", r3.name = n5, r3.value = e4, g2.appendChild(r3);
|
|
1434
|
+
});
|
|
1435
|
+
var b3 = s2.body;
|
|
1436
|
+
b3.firstChild ? b3.insertBefore(u4, b3.firstChild) : b3.appendChild(u4), g2.submit(), (l3 = g2.nextSibling).addEventListener ? l3.addEventListener("load", v3, false) : l3.attachEvent && l3.attachEvent("onload", v3), e3.receiveCancel && e3.receiveCancel.call(c2, function() {
|
|
1437
|
+
y3(f2);
|
|
1438
|
+
});
|
|
1439
|
+
var w3 = Number(i2.parse(e3.timeout || 0));
|
|
1440
|
+
w3 > 0 && (p3 = setTimeout(function() {
|
|
1441
|
+
y3(h2);
|
|
1442
|
+
}, w3));
|
|
1443
|
+
});
|
|
1444
|
+
}(t3, e2, n3) : y2(t3, e2, n3);
|
|
1445
|
+
};
|
|
1446
|
+
e.getImage = d2(function(t3) {
|
|
1447
|
+
return new o2(function(n3, r3) {
|
|
1448
|
+
var o3 = new Image();
|
|
1449
|
+
o3.onload = function() {
|
|
1450
|
+
n3(t3);
|
|
1451
|
+
}, o3.onabort = o3.onerror = function() {
|
|
1452
|
+
r3(new Error("Failed to load image"));
|
|
1453
|
+
}, o3.src = t3;
|
|
1454
|
+
}).finally(function() {
|
|
1455
|
+
});
|
|
1456
|
+
});
|
|
1457
|
+
var b2 = e.createXHR = c2.XMLHttpRequest ? function() {
|
|
1458
|
+
return new c2.XMLHttpRequest();
|
|
1459
|
+
} : function() {
|
|
1460
|
+
return new c2.ActiveXObject("Microsoft.XMLHTTP");
|
|
1461
|
+
};
|
|
1462
|
+
var w2 = /(?:^|;\s*)(?:application|text)\/([a-z]+)/i;
|
|
1463
|
+
e.send = function(t3, e2) {
|
|
1464
|
+
"string" != typeof t3 && (t3 = (e2 = t3).url), e2 = e2 || {};
|
|
1465
|
+
var n3 = String(e2.responseType || e2.dataType || "").toLowerCase();
|
|
1466
|
+
return "jsonp" === n3 ? m2(t3, e2) : new o2(function(o3, u3) {
|
|
1467
|
+
var l3, p3, d3 = b2();
|
|
1468
|
+
function v3(t4) {
|
|
1469
|
+
p3 || 4 === d3.readyState || (p3 = true, d3.abort(), t4 && u3(t4()));
|
|
1470
|
+
}
|
|
1471
|
+
function y3() {
|
|
1472
|
+
if (!p3) {
|
|
1473
|
+
var t4 = d3.readyState, e3 = 4 === t4 ? d3.status : 0;
|
|
1474
|
+
if (4 === t4 && e3) {
|
|
1475
|
+
var r3, i3, a3;
|
|
1476
|
+
switch (l3 && clearTimeout(l3), n3 = n3 || function(t5) {
|
|
1477
|
+
if (w2.test(t5)) return RegExp.$1.toLowerCase();
|
|
1478
|
+
}(d3.getResponseHeader("Content-Type"))) {
|
|
1479
|
+
case "json":
|
|
1480
|
+
var c3 = (d3.responseText || "").trim();
|
|
1481
|
+
if (c3) try {
|
|
1482
|
+
r3 = JSON.parse(c3);
|
|
1483
|
+
} catch (t5) {
|
|
1484
|
+
i3 = "Invalid JSON format";
|
|
1485
|
+
}
|
|
1486
|
+
break;
|
|
1487
|
+
case "xml":
|
|
1488
|
+
(r3 = d3.responseXML) && r3.documentElement || (i3 = "Invalid XML format");
|
|
1489
|
+
break;
|
|
1490
|
+
default:
|
|
1491
|
+
r3 = d3.responseText;
|
|
1492
|
+
}
|
|
1493
|
+
!(e3 >= 200 && e3 < 300 || 1223 === e3 || 304 === e3) ? ((a3 = new Error("Error (HTTP status code: " + e3 + ")")).code = e3, a3.data = r3) : i3 && (a3 = new Error(i3)), a3 ? u3(a3) : o3(r3);
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
var m3, g2 = (e2.method || "GET").toUpperCase(), _2 = "boolean" != typeof e2.async || e2.async, x2 = e2.data, C2 = e2.headers || {}, S2 = String(e2.requestType || "form").toLowerCase();
|
|
1498
|
+
x2 && ("GET" === g2 || "DELETE" === g2 ? (t3 = a2.append(t3, x2, { ignoreEmpty: true }), x2 = null) : ("json" === S2 ? (x2 = JSON.stringify(x2), m3 = "application/json; charset=utf-8") : "string" != typeof x2 && (x2 = a2.stringify(x2, { ignoreEmpty: true }), m3 = "application/x-www-form-urlencoded; charset=utf-8"), C2["Content-Type"] = C2["Content-Type"] || m3));
|
|
1499
|
+
if (e2.nocache && (t3 = a2.append(t3, { _: +/* @__PURE__ */ new Date() })), _2) {
|
|
1500
|
+
var E2 = Number(i2.parse(e2.timeout || 0));
|
|
1501
|
+
E2 > 0 && (l3 = setTimeout(function() {
|
|
1502
|
+
v3(h2);
|
|
1503
|
+
}, E2)), d3.onreadystatechange = y3, "onerror" in d3 && (d3.onerror = function() {
|
|
1504
|
+
l3 && clearTimeout(l3), p3 = true, u3(new Error("Network error"));
|
|
1505
|
+
});
|
|
1506
|
+
}
|
|
1507
|
+
e2.username ? d3.open(g2, t3, _2, e2.username, e2.password) : d3.open(g2, t3, _2), function(t4) {
|
|
1508
|
+
var e3 = s2.createElement("div");
|
|
1509
|
+
e3.innerHTML = '<a href="' + t4 + '"></a>';
|
|
1510
|
+
var n4 = e3.firstChild;
|
|
1511
|
+
n4.href = n4.href;
|
|
1512
|
+
var r3 = n4.host !== c2.location.host;
|
|
1513
|
+
return e3 = n4 = null, r3;
|
|
1514
|
+
}(t3) && (d3.withCredentials = !!e2.withCredentials), r2.each(C2, function(t4, e3) {
|
|
1515
|
+
d3.setRequestHeader(e3, t4);
|
|
1516
|
+
}), e2.beforeSend && e2.beforeSend.call(c2, d3), d3.send(x2 || ""), e2.receiveCancel && e2.receiveCancel.call(c2, function() {
|
|
1517
|
+
v3(f2);
|
|
1518
|
+
}), _2 || y3.call(d3);
|
|
1519
|
+
});
|
|
1520
|
+
}, e.serializeForm = function(t3) {
|
|
1521
|
+
if ("nodeType" in t3 || "function" != typeof t3.get || (t3 = t3.get(0)), "FORM" !== t3.tagName) throw new Error("Form must be an HTML form element");
|
|
1522
|
+
var e2, n3, r3, o3, i3 = {}, a3 = t3.elements, c3 = a3.length;
|
|
1523
|
+
for (e2 = 0; e2 < c3; e2++) r3 = (n3 = a3[e2]).name, !n3.disabled && r3 && ("INPUT" !== n3.tagName || "radio" !== n3.type && "checkbox" !== n3.type || n3.checked) && (o3 = "password" === n3.type ? n3.value : n3.value.trim(), i3.hasOwnProperty(r3) ? (Array.isArray(i3[r3]) || (i3[r3] = [i3[r3]]), i3[r3].push(o3)) : i3[r3] = o3);
|
|
1524
|
+
return i3;
|
|
1525
|
+
};
|
|
1526
|
+
}, , , , , , , , , function(t2, e, n2) {
|
|
1527
|
+
n2.r(e);
|
|
1528
|
+
n2(61);
|
|
1529
|
+
var r2 = n2(2), o2 = n2.n(r2), i2 = n2(5), a2 = n2.n(i2), c2 = n2(3), s2 = n2.n(c2), u2 = n2(45), l2 = n2.n(u2);
|
|
1530
|
+
function f2(t3, e2) {
|
|
1531
|
+
var n3 = [], r3 = l2()(t3), o3 = r3[0], i3 = r3.slice(1);
|
|
1532
|
+
if (void 0 === o3) return n3;
|
|
1533
|
+
var a3 = e2.find(function(t4) {
|
|
1534
|
+
return t4.code === o3;
|
|
1535
|
+
});
|
|
1536
|
+
return a3 && (n3 = [a3]), Array.isArray(a3.childrens) && (n3 = [].concat(s2()(n3), s2()(f2(i3, a3.childrens)))), n3;
|
|
1537
|
+
}
|
|
1538
|
+
var p2 = n2(23);
|
|
1539
|
+
function h2(t3, e2) {
|
|
1540
|
+
var n3 = Object.keys(t3);
|
|
1541
|
+
if (Object.getOwnPropertySymbols) {
|
|
1542
|
+
var r3 = Object.getOwnPropertySymbols(t3);
|
|
1543
|
+
e2 && (r3 = r3.filter(function(e3) {
|
|
1544
|
+
return Object.getOwnPropertyDescriptor(t3, e3).enumerable;
|
|
1545
|
+
})), n3.push.apply(n3, r3);
|
|
1546
|
+
}
|
|
1547
|
+
return n3;
|
|
1548
|
+
}
|
|
1549
|
+
var d2 = { name: "plv-cascader-picker-core", data: function() {
|
|
1550
|
+
return { dimension: 0 };
|
|
1551
|
+
}, props: { value: { type: Array, default: function() {
|
|
1552
|
+
return [];
|
|
1553
|
+
}, validator: function(t3) {
|
|
1554
|
+
return Array.isArray(t3);
|
|
1555
|
+
} }, data: { type: Array, default: function() {
|
|
1556
|
+
return [];
|
|
1557
|
+
}, validator: function(t3) {
|
|
1558
|
+
return Array.isArray(t3);
|
|
1559
|
+
} }, tabList: { type: Array, default: function() {
|
|
1560
|
+
return [];
|
|
1561
|
+
}, validator: function(t3) {
|
|
1562
|
+
return Array.isArray(t3);
|
|
1563
|
+
} }, wrapClass: String, tabWrapClass: String, tabItemClass: String, tabItemSelectedClass: String, listClass: String, listItemClass: String, listItemSelectedClass: String }, computed: { tabListData: function() {
|
|
1564
|
+
var t3 = s2()(this.tabList);
|
|
1565
|
+
return f2(this.value, this.data).forEach(function(e2, n3) {
|
|
1566
|
+
n3 < t3.length && (t3[n3] = e2.name);
|
|
1567
|
+
}), t3;
|
|
1568
|
+
}, listData: function() {
|
|
1569
|
+
var t3 = [], e2 = f2(this.value, this.data);
|
|
1570
|
+
if (0 === this.dimension) t3 = s2()(this.data);
|
|
1571
|
+
else {
|
|
1572
|
+
var n3 = e2[this.dimension - 1];
|
|
1573
|
+
Array.isArray(n3 && n3.childrens) && (t3 = s2()(n3.childrens));
|
|
1574
|
+
}
|
|
1575
|
+
return t3 = t3.map(function(t4) {
|
|
1576
|
+
var n4 = t4.code;
|
|
1577
|
+
return function(t5) {
|
|
1578
|
+
for (var e3 = 1; e3 < arguments.length; e3++) {
|
|
1579
|
+
var n5 = null != arguments[e3] ? arguments[e3] : {};
|
|
1580
|
+
e3 % 2 ? h2(n5, true).forEach(function(e4) {
|
|
1581
|
+
a2()(t5, e4, n5[e4]);
|
|
1582
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t5, Object.getOwnPropertyDescriptors(n5)) : h2(n5).forEach(function(e4) {
|
|
1583
|
+
Object.defineProperty(t5, e4, Object.getOwnPropertyDescriptor(n5, e4));
|
|
1584
|
+
});
|
|
1585
|
+
}
|
|
1586
|
+
return t5;
|
|
1587
|
+
}({}, t4, { selected: -1 !== e2.findIndex(function(t5) {
|
|
1588
|
+
return t5.code === n4;
|
|
1589
|
+
}) });
|
|
1590
|
+
});
|
|
1591
|
+
}, isFinish: function() {
|
|
1592
|
+
var t3 = f2(this.value, this.data), e2 = t3[t3.length - 1] || {};
|
|
1593
|
+
return t3.length && (!e2.childrens || !e2.childrens.length) || this.tabList.length && this.tabList.length <= t3.length;
|
|
1594
|
+
} }, methods: { handleTabClick: function(t3) {
|
|
1595
|
+
var e2 = this, n3 = f2(this.value, this.data)[t3 - 1];
|
|
1596
|
+
(0 === t3 || Array.isArray(n3 && n3.childrens)) && (this.dimension = t3), setTimeout(function() {
|
|
1597
|
+
e2.$emit("handleUpdatePopper");
|
|
1598
|
+
});
|
|
1599
|
+
}, handleListClick: function(t3) {
|
|
1600
|
+
var e2 = this, n3 = s2()(this.value);
|
|
1601
|
+
n3[this.dimension] = t3.code, n3 = n3.slice(0, this.dimension + 1), this.$emit("input", n3), this.$nextTick(function() {
|
|
1602
|
+
e2.isFinish ? e2.$emit("finish") : e2.dimension += 1;
|
|
1603
|
+
}), setTimeout(function() {
|
|
1604
|
+
e2.$emit("handleUpdatePopper");
|
|
1605
|
+
});
|
|
1606
|
+
} }, render: function() {
|
|
1607
|
+
var t3 = this, e2 = arguments[0];
|
|
1608
|
+
return e2("div", { class: this.wrapClass }, [e2("div", { class: this.tabWrapClass }, [this.tabListData.map(function(n3, r3) {
|
|
1609
|
+
var o3 = [t3.tabItemClass];
|
|
1610
|
+
return r3 === t3.dimension && o3.push(t3.tabItemSelectedClass), e2("div", { class: o3, on: { click: function() {
|
|
1611
|
+
return t3.handleTabClick(r3);
|
|
1612
|
+
} } }, [n3]);
|
|
1613
|
+
})]), e2("div", { class: this.listClass }, [this.listData.map(function(n3) {
|
|
1614
|
+
var r3 = [t3.listItemClass];
|
|
1615
|
+
n3.selected && r3.push(t3.listItemSelectedClass);
|
|
1616
|
+
var o3 = { label: n3.name, selected: n3.selected };
|
|
1617
|
+
return e2("div", { class: r3, on: { click: function() {
|
|
1618
|
+
return t3.handleListClick(n3);
|
|
1619
|
+
} } }, [Object(p2.b)(t3, "item", o3)]);
|
|
1620
|
+
})])]);
|
|
1621
|
+
}, getSelectData: f2, isSelectFinish: function(t3, e2) {
|
|
1622
|
+
var n3 = f2(t3, e2), r3 = n3[n3.length - 1] || {};
|
|
1623
|
+
return n3.length && (!r3.childrens || !r3.childrens.length);
|
|
1624
|
+
}, install: function(t3) {
|
|
1625
|
+
t3.component(d2.name, d2);
|
|
1626
|
+
} }, v2 = d2, y2 = n2(7), m2 = n2(46), g2 = n2.n(m2), b2 = n2(47), w2 = { md5: g2.a, ajax: b2.send }, _2 = "https://s4.videocc.net/library/china-area/china-area-20200630.json", x2 = {};
|
|
1627
|
+
function C2(t3) {
|
|
1628
|
+
var e2 = t3 || y2.a.getConfig("AreaPicker", "areaDataUrl") || _2;
|
|
1629
|
+
return x2[e2] || (x2[e2] = new Promise(function(t4) {
|
|
1630
|
+
var n3;
|
|
1631
|
+
o2.a.async(function(r3) {
|
|
1632
|
+
for (; ; ) switch (r3.prev = r3.next) {
|
|
1633
|
+
case 0:
|
|
1634
|
+
return r3.next = 2, o2.a.awrap(w2.ajax({ url: e2 }));
|
|
1635
|
+
case 2:
|
|
1636
|
+
n3 = r3.sent, t4(n3);
|
|
1637
|
+
case 4:
|
|
1638
|
+
case "end":
|
|
1639
|
+
return r3.stop();
|
|
1640
|
+
}
|
|
1641
|
+
});
|
|
1642
|
+
})), x2[e2];
|
|
1643
|
+
}
|
|
1644
|
+
var S2 = { props: { value: { type: Array, default: function() {
|
|
1645
|
+
return [];
|
|
1646
|
+
}, validator: function(t3) {
|
|
1647
|
+
return Array.isArray(t3);
|
|
1648
|
+
} }, areaData: { type: Array, default: function() {
|
|
1649
|
+
return [];
|
|
1650
|
+
} }, areaDataUrl: { type: String, default: "" }, precision: { type: String, default: "area", validator: function(t3) {
|
|
1651
|
+
return -1 !== ["", "area", "city", "province"].indexOf(t3);
|
|
1652
|
+
} }, placeholder: { type: String, default: "请选择省市区" } }, methods: { loadAreaDataUrl: function() {
|
|
1653
|
+
return C2(this.areaDataUrl);
|
|
1654
|
+
} }, loadAreaDataUrl: C2 }, E2 = { name: "plv-area-picker-core", mixins: [S2, n2(14).b], components: { PlvCascaderPickerCore: v2 }, methods: { handleSelectChange: function(t3) {
|
|
1655
|
+
this.$emit("input", t3);
|
|
1656
|
+
}, handleSelectFinish: function() {
|
|
1657
|
+
this.$emit("finish");
|
|
1658
|
+
}, handleUpdatePopper: function() {
|
|
1659
|
+
this.$emit("handleUpdatePopper");
|
|
1660
|
+
} }, computed: { tabList: function() {
|
|
1661
|
+
var t3 = [this.$uiLang("areaPicker.province", "省份"), this.$uiLang("areaPicker.city", "城市"), this.$uiLang("areaPicker.area", "地区")];
|
|
1662
|
+
switch (this.precision) {
|
|
1663
|
+
case "province":
|
|
1664
|
+
return t3.slice(0, 1);
|
|
1665
|
+
case "city":
|
|
1666
|
+
return t3.slice(0, 2);
|
|
1667
|
+
case "area":
|
|
1668
|
+
return t3.slice(0, 3);
|
|
1669
|
+
}
|
|
1670
|
+
return t3;
|
|
1671
|
+
} }, getSelectData: v2.getSelectData, isSelectFinish: v2.isSelectFinish, loadAreaDataUrl: C2 }, A2 = n2(0), j2 = { name: "plv-area-picker-mob", mixins: [S2], components: { PlvAreaPickerCore: Object(A2.a)(E2, function() {
|
|
1672
|
+
var t3 = this, e2 = t3.$createElement, n3 = t3._self._c || e2;
|
|
1673
|
+
return n3("div", { staticClass: "plv-area-picker__popper" }, [n3("plv-cascader-picker-core", { staticClass: "plv-area-picker__popper__inner", attrs: { "tab-wrap-class": "plv-area-picker__tab", "tab-item-class": "plv-area-picker__tab__item", "tab-item-selected-class": "plv-area-picker__tab__item--selected", "list-class": "plv-area-picker__list", "list-item-class": "plv-area-picker__list__item", "list-item-selected-class": "plv-area-picker__list__item--selected", "tab-list": t3.tabList, value: t3.value, data: t3.areaData }, on: { input: t3.handleSelectChange, handleUpdatePopper: t3.handleUpdatePopper, finish: t3.handleSelectFinish }, scopedSlots: t3._u([{ key: "item", fn: function(e3) {
|
|
1674
|
+
return n3("div", { staticClass: "plv-area-picker__list__item__inner" }, [t3._t("item", [t3._v(t3._s(e3.label))], null, e3)], 2);
|
|
1675
|
+
} }], null, true) })], 1);
|
|
1676
|
+
}, [], false, null, null, null).exports }, data: function() {
|
|
1677
|
+
return { realAreaData: [] };
|
|
1678
|
+
}, watch: { areaData: { immediate: true, handler: function() {
|
|
1679
|
+
return o2.a.async(function(t3) {
|
|
1680
|
+
for (; ; ) switch (t3.prev = t3.next) {
|
|
1681
|
+
case 0:
|
|
1682
|
+
if (0 !== this.areaData.length) {
|
|
1683
|
+
t3.next = 6;
|
|
1684
|
+
break;
|
|
1685
|
+
}
|
|
1686
|
+
return t3.next = 3, o2.a.awrap(this.loadAreaDataUrl());
|
|
1687
|
+
case 3:
|
|
1688
|
+
this.realAreaData = t3.sent, t3.next = 7;
|
|
1689
|
+
break;
|
|
1690
|
+
case 6:
|
|
1691
|
+
this.realAreaData = this.areaData;
|
|
1692
|
+
case 7:
|
|
1693
|
+
case "end":
|
|
1694
|
+
return t3.stop();
|
|
1695
|
+
}
|
|
1696
|
+
}, null, this);
|
|
1697
|
+
} } }, methods: { handleInput: function(t3) {
|
|
1698
|
+
this.$emit("input", t3);
|
|
1699
|
+
}, handleFinish: function() {
|
|
1700
|
+
this.$emit("finish");
|
|
1701
|
+
} }, getSelectData: v2.getSelectData, isSelectFinish: v2.isSelectFinish, loadAreaDataUrl: C2 }, O2 = Object(A2.a)(j2, function() {
|
|
1702
|
+
var t3 = this, e2 = t3.$createElement, n3 = t3._self._c || e2;
|
|
1703
|
+
return n3("div", { staticClass: "plv-area-picker-mob" }, [n3("plv-area-picker-core", { attrs: { value: t3.value, "area-data": t3.realAreaData }, on: { input: t3.handleInput, finish: t3.handleFinish }, scopedSlots: t3._u([{ key: "item", fn: function(e3) {
|
|
1704
|
+
return n3("div", { staticClass: "plv-area-picker-mob__area__item__inner" }, [n3("span", [t3._v(t3._s(e3.label))]), t3._v(" "), n3("span", { staticClass: "plv-front-mob-icon-check" })]);
|
|
1705
|
+
} }]) })], 1);
|
|
1706
|
+
}, [], false, null, null, null).exports;
|
|
1707
|
+
O2.install = function(t3) {
|
|
1708
|
+
t3.component(O2.name, O2);
|
|
1709
|
+
};
|
|
1710
|
+
e.default = O2;
|
|
1711
|
+
}, , , , , function(t2, e, n2) {
|
|
1712
|
+
}, function(t2, e, n2) {
|
|
1713
|
+
(function(e2) {
|
|
1714
|
+
var r2;
|
|
1715
|
+
void 0 !== e2 ? r2 = e2.Promise : "undefined" != typeof window && (r2 = window.Promise), (r2 = n2(r2 ? 63 : 64)).series = function(t3) {
|
|
1716
|
+
return t3.length ? t3.slice(1).reduce(function(t4, e3) {
|
|
1717
|
+
return t4.then(function(t5) {
|
|
1718
|
+
return e3(t5);
|
|
1719
|
+
});
|
|
1720
|
+
}, t3[0]()) : r2.resolve();
|
|
1721
|
+
}, r2.delay = function(t3) {
|
|
1722
|
+
return new r2(function(e3) {
|
|
1723
|
+
setTimeout(e3, t3);
|
|
1724
|
+
});
|
|
1725
|
+
}, t2.exports = r2;
|
|
1726
|
+
}).call(this, n2(37));
|
|
1727
|
+
}, function(t2, e, n2) {
|
|
1728
|
+
var r2 = n2(26).createClass(function(t3) {
|
|
1729
|
+
this._promise = new Promise(t3);
|
|
1730
|
+
}, { then: function(t3, e2) {
|
|
1731
|
+
var n3 = this;
|
|
1732
|
+
return new r2(function(r3) {
|
|
1733
|
+
r3(n3._promise.then(t3, e2));
|
|
1734
|
+
});
|
|
1735
|
+
}, spread: function(t3, e2) {
|
|
1736
|
+
var n3 = this;
|
|
1737
|
+
return new r2(function(r3) {
|
|
1738
|
+
r3(n3._promise.then(function(e3) {
|
|
1739
|
+
return t3.apply(this, e3);
|
|
1740
|
+
}, e2));
|
|
1741
|
+
});
|
|
1742
|
+
}, catch: function(t3) {
|
|
1743
|
+
var e2 = this;
|
|
1744
|
+
return new r2(function(n3) {
|
|
1745
|
+
n3(e2._promise.catch(t3));
|
|
1746
|
+
});
|
|
1747
|
+
}, finally: function(t3) {
|
|
1748
|
+
var e2 = this;
|
|
1749
|
+
return new r2(function(n3, r3) {
|
|
1750
|
+
e2._promise.then(function(e3) {
|
|
1751
|
+
t3.apply(this, arguments), n3(e3);
|
|
1752
|
+
}, function(e3) {
|
|
1753
|
+
t3.apply(this, arguments), r3(e3);
|
|
1754
|
+
});
|
|
1755
|
+
});
|
|
1756
|
+
} });
|
|
1757
|
+
["all", "race", "reject", "resolve"].forEach(function(t3) {
|
|
1758
|
+
r2[t3] = Promise[t3];
|
|
1759
|
+
}), t2.exports = r2;
|
|
1760
|
+
}, function(t2, e, n2) {
|
|
1761
|
+
var r2 = n2(26), o2 = "undefined" != typeof console && "function" == typeof console.error ? function(t3) {
|
|
1762
|
+
console.error("Uncaught (in promise) %o", t3);
|
|
1763
|
+
} : function(t3) {
|
|
1764
|
+
throw t3;
|
|
1765
|
+
};
|
|
1766
|
+
function i2(t3, e2, n3) {
|
|
1767
|
+
var r3;
|
|
1768
|
+
(r3 = t3) && "function" == typeof r3.then ? t3.then(e2, n3) : e2(t3);
|
|
1769
|
+
}
|
|
1770
|
+
var a2 = 1, c2 = 2, s2 = r2.createClass(function(t3) {
|
|
1771
|
+
if ("function" != typeof t3) throw new Error("Executor must be a function");
|
|
1772
|
+
var e2 = this;
|
|
1773
|
+
function n3(t4) {
|
|
1774
|
+
e2._settle(c2, t4);
|
|
1775
|
+
}
|
|
1776
|
+
e2._status = 0, e2._pendings = {};
|
|
1777
|
+
try {
|
|
1778
|
+
t3(function(t4) {
|
|
1779
|
+
i2(t4, function(t5) {
|
|
1780
|
+
e2._settle(a2, t5);
|
|
1781
|
+
}, n3);
|
|
1782
|
+
}, n3);
|
|
1783
|
+
} catch (t4) {
|
|
1784
|
+
n3(t4);
|
|
1785
|
+
}
|
|
1786
|
+
}, { _settle: function(t3, e2) {
|
|
1787
|
+
var n3 = this;
|
|
1788
|
+
0 === n3._status && (n3._status = t3, n3._value = e2, setTimeout(function() {
|
|
1789
|
+
if (n3._status !== c2 || n3._hasRejectedHandler) {
|
|
1790
|
+
var r3 = n3._pendings[t3];
|
|
1791
|
+
r3 && r3.forEach(function(t4) {
|
|
1792
|
+
t4(e2);
|
|
1793
|
+
}), delete n3._pendings;
|
|
1794
|
+
} else o2(e2);
|
|
1795
|
+
}, 0));
|
|
1796
|
+
}, _listen: function(t3, e2) {
|
|
1797
|
+
var n3 = this;
|
|
1798
|
+
t3 === c2 && (n3._hasRejectedHandler = true), n3._pendings ? (n3._pendings[t3] = n3._pendings[t3] || [], n3._pendings[t3].push(e2)) : n3._status === t3 && setTimeout(function() {
|
|
1799
|
+
e2(n3._value);
|
|
1800
|
+
}, 0);
|
|
1801
|
+
}, _then: function(t3, e2, n3) {
|
|
1802
|
+
var r3 = this;
|
|
1803
|
+
return new s2(function(o3, s3) {
|
|
1804
|
+
r3._listen(a2, function() {
|
|
1805
|
+
var e3 = r3._value;
|
|
1806
|
+
if (t3) try {
|
|
1807
|
+
e3 = n3 && Array.isArray(e3) ? t3.apply(this, e3) : t3.call(this, e3);
|
|
1808
|
+
} catch (t4) {
|
|
1809
|
+
return void s3(t4);
|
|
1810
|
+
}
|
|
1811
|
+
i2(e3, o3, s3);
|
|
1812
|
+
}), r3._listen(c2, function() {
|
|
1813
|
+
var t4 = r3._value;
|
|
1814
|
+
if (e2) {
|
|
1815
|
+
try {
|
|
1816
|
+
t4 = e2.call(this, t4);
|
|
1817
|
+
} catch (t5) {
|
|
1818
|
+
return void s3(t5);
|
|
1819
|
+
}
|
|
1820
|
+
i2(t4, o3, s3);
|
|
1821
|
+
} else s3(t4);
|
|
1822
|
+
});
|
|
1823
|
+
});
|
|
1824
|
+
}, then: function(t3, e2) {
|
|
1825
|
+
return this._then(t3, e2);
|
|
1826
|
+
}, spread: function(t3) {
|
|
1827
|
+
return this._then(t3, null, true);
|
|
1828
|
+
}, catch: function(t3) {
|
|
1829
|
+
return this.then(null, t3);
|
|
1830
|
+
}, finally: function(t3) {
|
|
1831
|
+
var e2 = this;
|
|
1832
|
+
return new s2(function(n3, r3) {
|
|
1833
|
+
function o3() {
|
|
1834
|
+
var o4, i3 = e2._value;
|
|
1835
|
+
switch (e2._status) {
|
|
1836
|
+
case a2:
|
|
1837
|
+
o4 = function() {
|
|
1838
|
+
n3(i3);
|
|
1839
|
+
};
|
|
1840
|
+
break;
|
|
1841
|
+
case c2:
|
|
1842
|
+
o4 = function() {
|
|
1843
|
+
r3(i3);
|
|
1844
|
+
};
|
|
1845
|
+
}
|
|
1846
|
+
if (t3) try {
|
|
1847
|
+
t3();
|
|
1848
|
+
} catch (t4) {
|
|
1849
|
+
return void r3(t4);
|
|
1850
|
+
}
|
|
1851
|
+
o4 && o4();
|
|
1852
|
+
}
|
|
1853
|
+
e2._listen(a2, o3), e2._listen(c2, o3);
|
|
1854
|
+
});
|
|
1855
|
+
} });
|
|
1856
|
+
r2.extend(s2, { all: function(t3) {
|
|
1857
|
+
var e2 = t3.length;
|
|
1858
|
+
return e2 ? new s2(function(n3, r3) {
|
|
1859
|
+
var o3 = new Array(e2);
|
|
1860
|
+
t3.forEach(function(t4, i3) {
|
|
1861
|
+
t4.then(function(t5) {
|
|
1862
|
+
o3[i3] = t5, --e2 || n3(o3);
|
|
1863
|
+
}, r3);
|
|
1864
|
+
});
|
|
1865
|
+
}) : s2.resolve([]);
|
|
1866
|
+
}, race: function(t3) {
|
|
1867
|
+
return new s2(function(e2, n3) {
|
|
1868
|
+
t3.forEach(function(t4) {
|
|
1869
|
+
t4.then(e2, n3);
|
|
1870
|
+
});
|
|
1871
|
+
});
|
|
1872
|
+
}, resolve: function(t3) {
|
|
1873
|
+
return new s2(function(e2, n3) {
|
|
1874
|
+
i2(t3, e2, n3);
|
|
1875
|
+
});
|
|
1876
|
+
}, reject: function(t3) {
|
|
1877
|
+
return new s2(function(e2, n3) {
|
|
1878
|
+
n3(t3);
|
|
1879
|
+
});
|
|
1880
|
+
} }), t2.exports = s2;
|
|
1881
|
+
}, function(t2, e) {
|
|
1882
|
+
var n2 = { SEC: 1e3, MIN: 6e4, HOUR: 36e5, DAY: 864e5, MONTH: 2592e6, YEAR: 31536e6 }, r2 = e.parse = function(t3) {
|
|
1883
|
+
if ("number" == typeof t3) return t3;
|
|
1884
|
+
if (!isNaN(t3)) return Number(t3);
|
|
1885
|
+
var e2 = parseFloat(t3);
|
|
1886
|
+
if (isNaN(e2)) throw new Error("Invalid timespan string");
|
|
1887
|
+
var r3 = t3.split(e2)[1].trim().toUpperCase().replace(/S$/, "");
|
|
1888
|
+
if (n2.hasOwnProperty(r3)) return e2 * n2[r3];
|
|
1889
|
+
throw new Error('Invalid time unit "' + r3 + '"');
|
|
1890
|
+
};
|
|
1891
|
+
e.addToDate = function(t3, e2) {
|
|
1892
|
+
return new Date(("number" == typeof t3 ? t3 : t3.getTime()) + r2(e2));
|
|
1893
|
+
};
|
|
1894
|
+
}, function(t2, e, n2) {
|
|
1895
|
+
var r2 = n2(26);
|
|
1896
|
+
e.parse = function(t3, e2) {
|
|
1897
|
+
if ("string" != typeof t3) return {};
|
|
1898
|
+
e2 = r2.extend({ decode: decodeURIComponent }, e2);
|
|
1899
|
+
var n3 = {};
|
|
1900
|
+
return t3.split("&").forEach(function(t4) {
|
|
1901
|
+
if (t4) {
|
|
1902
|
+
t4 = t4.split("=");
|
|
1903
|
+
var r3 = e2.decode(t4[0]), o3 = e2.decode(t4[1] || "");
|
|
1904
|
+
!o3 && e2.ignoreEmpty || (n3.hasOwnProperty(r3) ? (Array.isArray(n3[r3]) || (n3[r3] = [n3[r3]]), n3[r3].push(o3)) : n3[r3] = o3);
|
|
1905
|
+
}
|
|
1906
|
+
}), n3;
|
|
1907
|
+
};
|
|
1908
|
+
var o2 = e.stringify = function(t3, e2) {
|
|
1909
|
+
if ("object" != typeof t3) return "";
|
|
1910
|
+
e2 = r2.extend({ encode: encodeURIComponent }, e2);
|
|
1911
|
+
var n3, o3, i2 = [];
|
|
1912
|
+
function a2(t4, n4) {
|
|
1913
|
+
null == n4 && (n4 = ""), "" === n4 && e2.ignoreEmpty || i2.push(e2.encode(t4) + "=" + e2.encode(n4));
|
|
1914
|
+
}
|
|
1915
|
+
function c2(t4) {
|
|
1916
|
+
a2(n3, t4);
|
|
1917
|
+
}
|
|
1918
|
+
for (n3 in t3) t3.hasOwnProperty(n3) && (o3 = t3[n3], Array.isArray(o3) ? o3.forEach(c2) : a2(n3, o3));
|
|
1919
|
+
return i2.join("&");
|
|
1920
|
+
};
|
|
1921
|
+
e.append = function(t3, e2, n3) {
|
|
1922
|
+
if (!("string" == typeof e2 && "" !== e2 || "object" == typeof e2 && !r2.isEmptyObject(e2))) return t3;
|
|
1923
|
+
var i2 = t3.indexOf("#"), a2 = "";
|
|
1924
|
+
return -1 !== i2 && (a2 = t3.substring(i2, t3.length), t3 = t3.substring(0, i2)), t3 = t3.replace(/[?&]$/, ""), e2 = "string" != typeof e2 ? o2(e2, n3) : e2.replace(/^[?&]/, ""), t3 + (-1 !== t3.indexOf("?") ? "&" : "?") + e2 + a2;
|
|
1925
|
+
};
|
|
1926
|
+
}]).default;
|
|
1927
|
+
const PlvAreaPicker = /* @__PURE__ */ getDefaultExportFromCjs(areaPicker);
|
|
1928
|
+
var FormSize = /* @__PURE__ */ ((FormSize2) => {
|
|
1929
|
+
FormSize2["Default"] = "default";
|
|
1930
|
+
FormSize2["Medium"] = "medium";
|
|
1931
|
+
FormSize2["Small"] = "small";
|
|
1932
|
+
return FormSize2;
|
|
1933
|
+
})(FormSize || {});
|
|
1934
|
+
function formatStyleSize(size) {
|
|
1935
|
+
if (typeof size === "string") {
|
|
1936
|
+
return size;
|
|
1937
|
+
}
|
|
1938
|
+
if (typeof size === "number") {
|
|
1939
|
+
return `${size}px`;
|
|
1940
|
+
}
|
|
1941
|
+
return size;
|
|
1942
|
+
}
|
|
1943
|
+
var define_process_env_default = {};
|
|
1944
|
+
function _extends() {
|
|
1945
|
+
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
1946
|
+
for (var i2 = 1; i2 < arguments.length; i2++) {
|
|
1947
|
+
var source = arguments[i2];
|
|
1948
|
+
for (var key in source) {
|
|
1949
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1950
|
+
target[key] = source[key];
|
|
1951
|
+
}
|
|
1952
|
+
}
|
|
1953
|
+
}
|
|
1954
|
+
return target;
|
|
1955
|
+
};
|
|
1956
|
+
return _extends.apply(this, arguments);
|
|
1957
|
+
}
|
|
1958
|
+
function _inheritsLoose(subClass, superClass) {
|
|
1959
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
1960
|
+
subClass.prototype.constructor = subClass;
|
|
1961
|
+
_setPrototypeOf(subClass, superClass);
|
|
1962
|
+
}
|
|
1963
|
+
function _getPrototypeOf(o2) {
|
|
1964
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf2(o22) {
|
|
1965
|
+
return o22.__proto__ || Object.getPrototypeOf(o22);
|
|
1966
|
+
};
|
|
1967
|
+
return _getPrototypeOf(o2);
|
|
1968
|
+
}
|
|
1969
|
+
function _setPrototypeOf(o2, p2) {
|
|
1970
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o22, p22) {
|
|
1971
|
+
o22.__proto__ = p22;
|
|
1972
|
+
return o22;
|
|
1973
|
+
};
|
|
1974
|
+
return _setPrototypeOf(o2, p2);
|
|
1975
|
+
}
|
|
1976
|
+
function _isNativeReflectConstruct() {
|
|
1977
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
1978
|
+
if (Reflect.construct.sham) return false;
|
|
1979
|
+
if (typeof Proxy === "function") return true;
|
|
1980
|
+
try {
|
|
1981
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
1982
|
+
}));
|
|
1983
|
+
return true;
|
|
1984
|
+
} catch (e) {
|
|
1985
|
+
return false;
|
|
1986
|
+
}
|
|
1987
|
+
}
|
|
1988
|
+
function _construct(Parent, args, Class) {
|
|
1989
|
+
if (_isNativeReflectConstruct()) {
|
|
1990
|
+
_construct = Reflect.construct.bind();
|
|
1991
|
+
} else {
|
|
1992
|
+
_construct = function _construct2(Parent2, args2, Class2) {
|
|
1993
|
+
var a2 = [null];
|
|
1994
|
+
a2.push.apply(a2, args2);
|
|
1995
|
+
var Constructor = Function.bind.apply(Parent2, a2);
|
|
1996
|
+
var instance = new Constructor();
|
|
1997
|
+
if (Class2) _setPrototypeOf(instance, Class2.prototype);
|
|
1998
|
+
return instance;
|
|
1999
|
+
};
|
|
2000
|
+
}
|
|
2001
|
+
return _construct.apply(null, arguments);
|
|
2002
|
+
}
|
|
2003
|
+
function _isNativeFunction(fn) {
|
|
2004
|
+
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
2005
|
+
}
|
|
2006
|
+
function _wrapNativeSuper(Class) {
|
|
2007
|
+
var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
2008
|
+
_wrapNativeSuper = function _wrapNativeSuper2(Class2) {
|
|
2009
|
+
if (Class2 === null || !_isNativeFunction(Class2)) return Class2;
|
|
2010
|
+
if (typeof Class2 !== "function") {
|
|
2011
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
2012
|
+
}
|
|
2013
|
+
if (typeof _cache !== "undefined") {
|
|
2014
|
+
if (_cache.has(Class2)) return _cache.get(Class2);
|
|
2015
|
+
_cache.set(Class2, Wrapper);
|
|
2016
|
+
}
|
|
2017
|
+
function Wrapper() {
|
|
2018
|
+
return _construct(Class2, arguments, _getPrototypeOf(this).constructor);
|
|
2019
|
+
}
|
|
2020
|
+
Wrapper.prototype = Object.create(Class2.prototype, {
|
|
2021
|
+
constructor: {
|
|
2022
|
+
value: Wrapper,
|
|
2023
|
+
enumerable: false,
|
|
2024
|
+
writable: true,
|
|
2025
|
+
configurable: true
|
|
2026
|
+
}
|
|
2027
|
+
});
|
|
2028
|
+
return _setPrototypeOf(Wrapper, Class2);
|
|
2029
|
+
};
|
|
2030
|
+
return _wrapNativeSuper(Class);
|
|
2031
|
+
}
|
|
2032
|
+
var formatRegExp = /%[sdj%]/g;
|
|
2033
|
+
var warning = function warning2() {
|
|
2034
|
+
};
|
|
2035
|
+
if (typeof process !== "undefined" && define_process_env_default && define_process_env_default.NODE_ENV !== "production" && typeof window !== "undefined" && typeof document !== "undefined") {
|
|
2036
|
+
warning = function warning3(type4, errors) {
|
|
2037
|
+
if (typeof console !== "undefined" && console.warn && typeof ASYNC_VALIDATOR_NO_WARNING === "undefined") {
|
|
2038
|
+
if (errors.every(function(e) {
|
|
2039
|
+
return typeof e === "string";
|
|
2040
|
+
})) {
|
|
2041
|
+
console.warn(type4, errors);
|
|
2042
|
+
}
|
|
2043
|
+
}
|
|
2044
|
+
};
|
|
2045
|
+
}
|
|
2046
|
+
function convertFieldsError(errors) {
|
|
2047
|
+
if (!errors || !errors.length) return null;
|
|
2048
|
+
var fields = {};
|
|
2049
|
+
errors.forEach(function(error) {
|
|
2050
|
+
var field = error.field;
|
|
2051
|
+
fields[field] = fields[field] || [];
|
|
2052
|
+
fields[field].push(error);
|
|
2053
|
+
});
|
|
2054
|
+
return fields;
|
|
2055
|
+
}
|
|
2056
|
+
function format(template) {
|
|
2057
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
2058
|
+
args[_key - 1] = arguments[_key];
|
|
2059
|
+
}
|
|
2060
|
+
var i2 = 0;
|
|
2061
|
+
var len = args.length;
|
|
2062
|
+
if (typeof template === "function") {
|
|
2063
|
+
return template.apply(null, args);
|
|
2064
|
+
}
|
|
2065
|
+
if (typeof template === "string") {
|
|
2066
|
+
var str = template.replace(formatRegExp, function(x2) {
|
|
2067
|
+
if (x2 === "%%") {
|
|
2068
|
+
return "%";
|
|
2069
|
+
}
|
|
2070
|
+
if (i2 >= len) {
|
|
2071
|
+
return x2;
|
|
2072
|
+
}
|
|
2073
|
+
switch (x2) {
|
|
2074
|
+
case "%s":
|
|
2075
|
+
return String(args[i2++]);
|
|
2076
|
+
case "%d":
|
|
2077
|
+
return Number(args[i2++]);
|
|
2078
|
+
case "%j":
|
|
2079
|
+
try {
|
|
2080
|
+
return JSON.stringify(args[i2++]);
|
|
2081
|
+
} catch (_2) {
|
|
2082
|
+
return "[Circular]";
|
|
2083
|
+
}
|
|
2084
|
+
break;
|
|
2085
|
+
default:
|
|
2086
|
+
return x2;
|
|
2087
|
+
}
|
|
2088
|
+
});
|
|
2089
|
+
return str;
|
|
2090
|
+
}
|
|
2091
|
+
return template;
|
|
2092
|
+
}
|
|
2093
|
+
function isNativeStringType(type4) {
|
|
2094
|
+
return type4 === "string" || type4 === "url" || type4 === "hex" || type4 === "email" || type4 === "date" || type4 === "pattern";
|
|
2095
|
+
}
|
|
2096
|
+
function isEmptyValue(value, type4) {
|
|
2097
|
+
if (value === void 0 || value === null) {
|
|
2098
|
+
return true;
|
|
2099
|
+
}
|
|
2100
|
+
if (type4 === "array" && Array.isArray(value) && !value.length) {
|
|
2101
|
+
return true;
|
|
2102
|
+
}
|
|
2103
|
+
if (isNativeStringType(type4) && typeof value === "string" && !value) {
|
|
2104
|
+
return true;
|
|
2105
|
+
}
|
|
2106
|
+
return false;
|
|
2107
|
+
}
|
|
2108
|
+
function asyncParallelArray(arr, func, callback) {
|
|
2109
|
+
var results = [];
|
|
2110
|
+
var total = 0;
|
|
2111
|
+
var arrLength = arr.length;
|
|
2112
|
+
function count(errors) {
|
|
2113
|
+
results.push.apply(results, errors || []);
|
|
2114
|
+
total++;
|
|
2115
|
+
if (total === arrLength) {
|
|
2116
|
+
callback(results);
|
|
2117
|
+
}
|
|
2118
|
+
}
|
|
2119
|
+
arr.forEach(function(a2) {
|
|
2120
|
+
func(a2, count);
|
|
2121
|
+
});
|
|
2122
|
+
}
|
|
2123
|
+
function asyncSerialArray(arr, func, callback) {
|
|
2124
|
+
var index = 0;
|
|
2125
|
+
var arrLength = arr.length;
|
|
2126
|
+
function next(errors) {
|
|
2127
|
+
if (errors && errors.length) {
|
|
2128
|
+
callback(errors);
|
|
2129
|
+
return;
|
|
2130
|
+
}
|
|
2131
|
+
var original = index;
|
|
2132
|
+
index = index + 1;
|
|
2133
|
+
if (original < arrLength) {
|
|
2134
|
+
func(arr[original], next);
|
|
2135
|
+
} else {
|
|
2136
|
+
callback([]);
|
|
2137
|
+
}
|
|
2138
|
+
}
|
|
2139
|
+
next([]);
|
|
2140
|
+
}
|
|
2141
|
+
function flattenObjArr(objArr) {
|
|
2142
|
+
var ret = [];
|
|
2143
|
+
Object.keys(objArr).forEach(function(k) {
|
|
2144
|
+
ret.push.apply(ret, objArr[k] || []);
|
|
2145
|
+
});
|
|
2146
|
+
return ret;
|
|
2147
|
+
}
|
|
2148
|
+
var AsyncValidationError = /* @__PURE__ */ function(_Error) {
|
|
2149
|
+
_inheritsLoose(AsyncValidationError2, _Error);
|
|
2150
|
+
function AsyncValidationError2(errors, fields) {
|
|
2151
|
+
var _this;
|
|
2152
|
+
_this = _Error.call(this, "Async Validation Error") || this;
|
|
2153
|
+
_this.errors = errors;
|
|
2154
|
+
_this.fields = fields;
|
|
2155
|
+
return _this;
|
|
2156
|
+
}
|
|
2157
|
+
return AsyncValidationError2;
|
|
2158
|
+
}(/* @__PURE__ */ _wrapNativeSuper(Error));
|
|
2159
|
+
function asyncMap(objArr, option, func, callback, source) {
|
|
2160
|
+
if (option.first) {
|
|
2161
|
+
var _pending = new Promise(function(resolve, reject) {
|
|
2162
|
+
var next = function next2(errors) {
|
|
2163
|
+
callback(errors);
|
|
2164
|
+
return errors.length ? reject(new AsyncValidationError(errors, convertFieldsError(errors))) : resolve(source);
|
|
2165
|
+
};
|
|
2166
|
+
var flattenArr = flattenObjArr(objArr);
|
|
2167
|
+
asyncSerialArray(flattenArr, func, next);
|
|
2168
|
+
});
|
|
2169
|
+
_pending["catch"](function(e) {
|
|
2170
|
+
return e;
|
|
2171
|
+
});
|
|
2172
|
+
return _pending;
|
|
2173
|
+
}
|
|
2174
|
+
var firstFields = option.firstFields === true ? Object.keys(objArr) : option.firstFields || [];
|
|
2175
|
+
var objArrKeys = Object.keys(objArr);
|
|
2176
|
+
var objArrLength = objArrKeys.length;
|
|
2177
|
+
var total = 0;
|
|
2178
|
+
var results = [];
|
|
2179
|
+
var pending = new Promise(function(resolve, reject) {
|
|
2180
|
+
var next = function next2(errors) {
|
|
2181
|
+
results.push.apply(results, errors);
|
|
2182
|
+
total++;
|
|
2183
|
+
if (total === objArrLength) {
|
|
2184
|
+
callback(results);
|
|
2185
|
+
return results.length ? reject(new AsyncValidationError(results, convertFieldsError(results))) : resolve(source);
|
|
2186
|
+
}
|
|
2187
|
+
};
|
|
2188
|
+
if (!objArrKeys.length) {
|
|
2189
|
+
callback(results);
|
|
2190
|
+
resolve(source);
|
|
2191
|
+
}
|
|
2192
|
+
objArrKeys.forEach(function(key) {
|
|
2193
|
+
var arr = objArr[key];
|
|
2194
|
+
if (firstFields.indexOf(key) !== -1) {
|
|
2195
|
+
asyncSerialArray(arr, func, next);
|
|
2196
|
+
} else {
|
|
2197
|
+
asyncParallelArray(arr, func, next);
|
|
2198
|
+
}
|
|
2199
|
+
});
|
|
2200
|
+
});
|
|
2201
|
+
pending["catch"](function(e) {
|
|
2202
|
+
return e;
|
|
2203
|
+
});
|
|
2204
|
+
return pending;
|
|
2205
|
+
}
|
|
2206
|
+
function isErrorObj(obj) {
|
|
2207
|
+
return !!(obj && obj.message !== void 0);
|
|
2208
|
+
}
|
|
2209
|
+
function getValue(value, path) {
|
|
2210
|
+
var v2 = value;
|
|
2211
|
+
for (var i2 = 0; i2 < path.length; i2++) {
|
|
2212
|
+
if (v2 == void 0) {
|
|
2213
|
+
return v2;
|
|
2214
|
+
}
|
|
2215
|
+
v2 = v2[path[i2]];
|
|
2216
|
+
}
|
|
2217
|
+
return v2;
|
|
2218
|
+
}
|
|
2219
|
+
function complementError(rule, source) {
|
|
2220
|
+
return function(oe) {
|
|
2221
|
+
var fieldValue;
|
|
2222
|
+
if (rule.fullFields) {
|
|
2223
|
+
fieldValue = getValue(source, rule.fullFields);
|
|
2224
|
+
} else {
|
|
2225
|
+
fieldValue = source[oe.field || rule.fullField];
|
|
2226
|
+
}
|
|
2227
|
+
if (isErrorObj(oe)) {
|
|
2228
|
+
oe.field = oe.field || rule.fullField;
|
|
2229
|
+
oe.fieldValue = fieldValue;
|
|
2230
|
+
return oe;
|
|
2231
|
+
}
|
|
2232
|
+
return {
|
|
2233
|
+
message: typeof oe === "function" ? oe() : oe,
|
|
2234
|
+
fieldValue,
|
|
2235
|
+
field: oe.field || rule.fullField
|
|
2236
|
+
};
|
|
2237
|
+
};
|
|
2238
|
+
}
|
|
2239
|
+
function deepMerge(target, source) {
|
|
2240
|
+
if (source) {
|
|
2241
|
+
for (var s2 in source) {
|
|
2242
|
+
if (source.hasOwnProperty(s2)) {
|
|
2243
|
+
var value = source[s2];
|
|
2244
|
+
if (typeof value === "object" && typeof target[s2] === "object") {
|
|
2245
|
+
target[s2] = _extends({}, target[s2], value);
|
|
2246
|
+
} else {
|
|
2247
|
+
target[s2] = value;
|
|
2248
|
+
}
|
|
2249
|
+
}
|
|
2250
|
+
}
|
|
2251
|
+
}
|
|
2252
|
+
return target;
|
|
2253
|
+
}
|
|
2254
|
+
var required$1 = function required(rule, value, source, errors, options, type4) {
|
|
2255
|
+
if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type4 || rule.type))) {
|
|
2256
|
+
errors.push(format(options.messages.required, rule.fullField));
|
|
2257
|
+
}
|
|
2258
|
+
};
|
|
2259
|
+
var whitespace = function whitespace2(rule, value, source, errors, options) {
|
|
2260
|
+
if (/^\s+$/.test(value) || value === "") {
|
|
2261
|
+
errors.push(format(options.messages.whitespace, rule.fullField));
|
|
2262
|
+
}
|
|
2263
|
+
};
|
|
2264
|
+
var urlReg;
|
|
2265
|
+
var getUrlRegex = function() {
|
|
2266
|
+
if (urlReg) {
|
|
2267
|
+
return urlReg;
|
|
2268
|
+
}
|
|
2269
|
+
var word = "[a-fA-F\\d:]";
|
|
2270
|
+
var b2 = function b22(options) {
|
|
2271
|
+
return options && options.includeBoundaries ? "(?:(?<=\\s|^)(?=" + word + ")|(?<=" + word + ")(?=\\s|$))" : "";
|
|
2272
|
+
};
|
|
2273
|
+
var v4 = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}";
|
|
2274
|
+
var v6seg = "[a-fA-F\\d]{1,4}";
|
|
2275
|
+
var v6 = ("\n(?:\n(?:" + v6seg + ":){7}(?:" + v6seg + "|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8\n(?:" + v6seg + ":){6}(?:" + v4 + "|:" + v6seg + "|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4\n(?:" + v6seg + ":){5}(?::" + v4 + "|(?::" + v6seg + "){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4\n(?:" + v6seg + ":){4}(?:(?::" + v6seg + "){0,1}:" + v4 + "|(?::" + v6seg + "){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4\n(?:" + v6seg + ":){3}(?:(?::" + v6seg + "){0,2}:" + v4 + "|(?::" + v6seg + "){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4\n(?:" + v6seg + ":){2}(?:(?::" + v6seg + "){0,3}:" + v4 + "|(?::" + v6seg + "){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4\n(?:" + v6seg + ":){1}(?:(?::" + v6seg + "){0,4}:" + v4 + "|(?::" + v6seg + "){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4\n(?::(?:(?::" + v6seg + "){0,5}:" + v4 + "|(?::" + v6seg + "){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4\n)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1\n").replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim();
|
|
2276
|
+
var v46Exact = new RegExp("(?:^" + v4 + "$)|(?:^" + v6 + "$)");
|
|
2277
|
+
var v4exact = new RegExp("^" + v4 + "$");
|
|
2278
|
+
var v6exact = new RegExp("^" + v6 + "$");
|
|
2279
|
+
var ip = function ip2(options) {
|
|
2280
|
+
return options && options.exact ? v46Exact : new RegExp("(?:" + b2(options) + v4 + b2(options) + ")|(?:" + b2(options) + v6 + b2(options) + ")", "g");
|
|
2281
|
+
};
|
|
2282
|
+
ip.v4 = function(options) {
|
|
2283
|
+
return options && options.exact ? v4exact : new RegExp("" + b2(options) + v4 + b2(options), "g");
|
|
2284
|
+
};
|
|
2285
|
+
ip.v6 = function(options) {
|
|
2286
|
+
return options && options.exact ? v6exact : new RegExp("" + b2(options) + v6 + b2(options), "g");
|
|
2287
|
+
};
|
|
2288
|
+
var protocol = "(?:(?:[a-z]+:)?//)";
|
|
2289
|
+
var auth = "(?:\\S+(?::\\S*)?@)?";
|
|
2290
|
+
var ipv4 = ip.v4().source;
|
|
2291
|
+
var ipv6 = ip.v6().source;
|
|
2292
|
+
var host = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)";
|
|
2293
|
+
var domain = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*";
|
|
2294
|
+
var tld = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))";
|
|
2295
|
+
var port = "(?::\\d{2,5})?";
|
|
2296
|
+
var path = '(?:[/?#][^\\s"]*)?';
|
|
2297
|
+
var regex = "(?:" + protocol + "|www\\.)" + auth + "(?:localhost|" + ipv4 + "|" + ipv6 + "|" + host + domain + tld + ")" + port + path;
|
|
2298
|
+
urlReg = new RegExp("(?:^" + regex + "$)", "i");
|
|
2299
|
+
return urlReg;
|
|
2300
|
+
};
|
|
2301
|
+
var pattern$2 = {
|
|
2302
|
+
// http://emailregex.com/
|
|
2303
|
+
email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
|
|
2304
|
+
// url: new RegExp(
|
|
2305
|
+
// '^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$',
|
|
2306
|
+
// 'i',
|
|
2307
|
+
// ),
|
|
2308
|
+
hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
|
|
2309
|
+
};
|
|
2310
|
+
var types = {
|
|
2311
|
+
integer: function integer(value) {
|
|
2312
|
+
return types.number(value) && parseInt(value, 10) === value;
|
|
2313
|
+
},
|
|
2314
|
+
"float": function float(value) {
|
|
2315
|
+
return types.number(value) && !types.integer(value);
|
|
2316
|
+
},
|
|
2317
|
+
array: function array(value) {
|
|
2318
|
+
return Array.isArray(value);
|
|
2319
|
+
},
|
|
2320
|
+
regexp: function regexp(value) {
|
|
2321
|
+
if (value instanceof RegExp) {
|
|
2322
|
+
return true;
|
|
2323
|
+
}
|
|
2324
|
+
try {
|
|
2325
|
+
return !!new RegExp(value);
|
|
2326
|
+
} catch (e) {
|
|
2327
|
+
return false;
|
|
2328
|
+
}
|
|
2329
|
+
},
|
|
2330
|
+
date: function date(value) {
|
|
2331
|
+
return typeof value.getTime === "function" && typeof value.getMonth === "function" && typeof value.getYear === "function" && !isNaN(value.getTime());
|
|
2332
|
+
},
|
|
2333
|
+
number: function number(value) {
|
|
2334
|
+
if (isNaN(value)) {
|
|
2335
|
+
return false;
|
|
2336
|
+
}
|
|
2337
|
+
return typeof value === "number";
|
|
2338
|
+
},
|
|
2339
|
+
object: function object(value) {
|
|
2340
|
+
return typeof value === "object" && !types.array(value);
|
|
2341
|
+
},
|
|
2342
|
+
method: function method(value) {
|
|
2343
|
+
return typeof value === "function";
|
|
2344
|
+
},
|
|
2345
|
+
email: function email(value) {
|
|
2346
|
+
return typeof value === "string" && value.length <= 320 && !!value.match(pattern$2.email);
|
|
2347
|
+
},
|
|
2348
|
+
url: function url(value) {
|
|
2349
|
+
return typeof value === "string" && value.length <= 2048 && !!value.match(getUrlRegex());
|
|
2350
|
+
},
|
|
2351
|
+
hex: function hex(value) {
|
|
2352
|
+
return typeof value === "string" && !!value.match(pattern$2.hex);
|
|
2353
|
+
}
|
|
2354
|
+
};
|
|
2355
|
+
var type$1 = function type(rule, value, source, errors, options) {
|
|
2356
|
+
if (rule.required && value === void 0) {
|
|
2357
|
+
required$1(rule, value, source, errors, options);
|
|
2358
|
+
return;
|
|
2359
|
+
}
|
|
2360
|
+
var custom = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"];
|
|
2361
|
+
var ruleType = rule.type;
|
|
2362
|
+
if (custom.indexOf(ruleType) > -1) {
|
|
2363
|
+
if (!types[ruleType](value)) {
|
|
2364
|
+
errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
|
|
2365
|
+
}
|
|
2366
|
+
} else if (ruleType && typeof value !== rule.type) {
|
|
2367
|
+
errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
|
|
2368
|
+
}
|
|
2369
|
+
};
|
|
2370
|
+
var range = function range2(rule, value, source, errors, options) {
|
|
2371
|
+
var len = typeof rule.len === "number";
|
|
2372
|
+
var min = typeof rule.min === "number";
|
|
2373
|
+
var max = typeof rule.max === "number";
|
|
2374
|
+
var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
|
2375
|
+
var val = value;
|
|
2376
|
+
var key = null;
|
|
2377
|
+
var num = typeof value === "number";
|
|
2378
|
+
var str = typeof value === "string";
|
|
2379
|
+
var arr = Array.isArray(value);
|
|
2380
|
+
if (num) {
|
|
2381
|
+
key = "number";
|
|
2382
|
+
} else if (str) {
|
|
2383
|
+
key = "string";
|
|
2384
|
+
} else if (arr) {
|
|
2385
|
+
key = "array";
|
|
2386
|
+
}
|
|
2387
|
+
if (!key) {
|
|
2388
|
+
return false;
|
|
2389
|
+
}
|
|
2390
|
+
if (arr) {
|
|
2391
|
+
val = value.length;
|
|
2392
|
+
}
|
|
2393
|
+
if (str) {
|
|
2394
|
+
val = value.replace(spRegexp, "_").length;
|
|
2395
|
+
}
|
|
2396
|
+
if (len) {
|
|
2397
|
+
if (val !== rule.len) {
|
|
2398
|
+
errors.push(format(options.messages[key].len, rule.fullField, rule.len));
|
|
2399
|
+
}
|
|
2400
|
+
} else if (min && !max && val < rule.min) {
|
|
2401
|
+
errors.push(format(options.messages[key].min, rule.fullField, rule.min));
|
|
2402
|
+
} else if (max && !min && val > rule.max) {
|
|
2403
|
+
errors.push(format(options.messages[key].max, rule.fullField, rule.max));
|
|
2404
|
+
} else if (min && max && (val < rule.min || val > rule.max)) {
|
|
2405
|
+
errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));
|
|
2406
|
+
}
|
|
2407
|
+
};
|
|
2408
|
+
var ENUM$1 = "enum";
|
|
2409
|
+
var enumerable$1 = function enumerable(rule, value, source, errors, options) {
|
|
2410
|
+
rule[ENUM$1] = Array.isArray(rule[ENUM$1]) ? rule[ENUM$1] : [];
|
|
2411
|
+
if (rule[ENUM$1].indexOf(value) === -1) {
|
|
2412
|
+
errors.push(format(options.messages[ENUM$1], rule.fullField, rule[ENUM$1].join(", ")));
|
|
2413
|
+
}
|
|
2414
|
+
};
|
|
2415
|
+
var pattern$1 = function pattern(rule, value, source, errors, options) {
|
|
2416
|
+
if (rule.pattern) {
|
|
2417
|
+
if (rule.pattern instanceof RegExp) {
|
|
2418
|
+
rule.pattern.lastIndex = 0;
|
|
2419
|
+
if (!rule.pattern.test(value)) {
|
|
2420
|
+
errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
|
|
2421
|
+
}
|
|
2422
|
+
} else if (typeof rule.pattern === "string") {
|
|
2423
|
+
var _pattern = new RegExp(rule.pattern);
|
|
2424
|
+
if (!_pattern.test(value)) {
|
|
2425
|
+
errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
|
|
2426
|
+
}
|
|
2427
|
+
}
|
|
2428
|
+
}
|
|
2429
|
+
};
|
|
2430
|
+
var rules = {
|
|
2431
|
+
required: required$1,
|
|
2432
|
+
whitespace,
|
|
2433
|
+
type: type$1,
|
|
2434
|
+
range,
|
|
2435
|
+
"enum": enumerable$1,
|
|
2436
|
+
pattern: pattern$1
|
|
2437
|
+
};
|
|
2438
|
+
var string = function string2(rule, value, callback, source, options) {
|
|
2439
|
+
var errors = [];
|
|
2440
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
2441
|
+
if (validate) {
|
|
2442
|
+
if (isEmptyValue(value, "string") && !rule.required) {
|
|
2443
|
+
return callback();
|
|
2444
|
+
}
|
|
2445
|
+
rules.required(rule, value, source, errors, options, "string");
|
|
2446
|
+
if (!isEmptyValue(value, "string")) {
|
|
2447
|
+
rules.type(rule, value, source, errors, options);
|
|
2448
|
+
rules.range(rule, value, source, errors, options);
|
|
2449
|
+
rules.pattern(rule, value, source, errors, options);
|
|
2450
|
+
if (rule.whitespace === true) {
|
|
2451
|
+
rules.whitespace(rule, value, source, errors, options);
|
|
2452
|
+
}
|
|
2453
|
+
}
|
|
2454
|
+
}
|
|
2455
|
+
callback(errors);
|
|
2456
|
+
};
|
|
2457
|
+
var method2 = function method3(rule, value, callback, source, options) {
|
|
2458
|
+
var errors = [];
|
|
2459
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
2460
|
+
if (validate) {
|
|
2461
|
+
if (isEmptyValue(value) && !rule.required) {
|
|
2462
|
+
return callback();
|
|
2463
|
+
}
|
|
2464
|
+
rules.required(rule, value, source, errors, options);
|
|
2465
|
+
if (value !== void 0) {
|
|
2466
|
+
rules.type(rule, value, source, errors, options);
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2469
|
+
callback(errors);
|
|
2470
|
+
};
|
|
2471
|
+
var number2 = function number3(rule, value, callback, source, options) {
|
|
2472
|
+
var errors = [];
|
|
2473
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
2474
|
+
if (validate) {
|
|
2475
|
+
if (value === "") {
|
|
2476
|
+
value = void 0;
|
|
2477
|
+
}
|
|
2478
|
+
if (isEmptyValue(value) && !rule.required) {
|
|
2479
|
+
return callback();
|
|
2480
|
+
}
|
|
2481
|
+
rules.required(rule, value, source, errors, options);
|
|
2482
|
+
if (value !== void 0) {
|
|
2483
|
+
rules.type(rule, value, source, errors, options);
|
|
2484
|
+
rules.range(rule, value, source, errors, options);
|
|
2485
|
+
}
|
|
2486
|
+
}
|
|
2487
|
+
callback(errors);
|
|
2488
|
+
};
|
|
2489
|
+
var _boolean = function _boolean2(rule, value, callback, source, options) {
|
|
2490
|
+
var errors = [];
|
|
2491
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
2492
|
+
if (validate) {
|
|
2493
|
+
if (isEmptyValue(value) && !rule.required) {
|
|
2494
|
+
return callback();
|
|
2495
|
+
}
|
|
2496
|
+
rules.required(rule, value, source, errors, options);
|
|
2497
|
+
if (value !== void 0) {
|
|
2498
|
+
rules.type(rule, value, source, errors, options);
|
|
2499
|
+
}
|
|
2500
|
+
}
|
|
2501
|
+
callback(errors);
|
|
2502
|
+
};
|
|
2503
|
+
var regexp2 = function regexp3(rule, value, callback, source, options) {
|
|
2504
|
+
var errors = [];
|
|
2505
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
2506
|
+
if (validate) {
|
|
2507
|
+
if (isEmptyValue(value) && !rule.required) {
|
|
2508
|
+
return callback();
|
|
2509
|
+
}
|
|
2510
|
+
rules.required(rule, value, source, errors, options);
|
|
2511
|
+
if (!isEmptyValue(value)) {
|
|
2512
|
+
rules.type(rule, value, source, errors, options);
|
|
2513
|
+
}
|
|
2514
|
+
}
|
|
2515
|
+
callback(errors);
|
|
2516
|
+
};
|
|
2517
|
+
var integer2 = function integer3(rule, value, callback, source, options) {
|
|
2518
|
+
var errors = [];
|
|
2519
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
2520
|
+
if (validate) {
|
|
2521
|
+
if (isEmptyValue(value) && !rule.required) {
|
|
2522
|
+
return callback();
|
|
2523
|
+
}
|
|
2524
|
+
rules.required(rule, value, source, errors, options);
|
|
2525
|
+
if (value !== void 0) {
|
|
2526
|
+
rules.type(rule, value, source, errors, options);
|
|
2527
|
+
rules.range(rule, value, source, errors, options);
|
|
2528
|
+
}
|
|
2529
|
+
}
|
|
2530
|
+
callback(errors);
|
|
2531
|
+
};
|
|
2532
|
+
var floatFn = function floatFn2(rule, value, callback, source, options) {
|
|
2533
|
+
var errors = [];
|
|
2534
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
2535
|
+
if (validate) {
|
|
2536
|
+
if (isEmptyValue(value) && !rule.required) {
|
|
2537
|
+
return callback();
|
|
2538
|
+
}
|
|
2539
|
+
rules.required(rule, value, source, errors, options);
|
|
2540
|
+
if (value !== void 0) {
|
|
2541
|
+
rules.type(rule, value, source, errors, options);
|
|
2542
|
+
rules.range(rule, value, source, errors, options);
|
|
2543
|
+
}
|
|
2544
|
+
}
|
|
2545
|
+
callback(errors);
|
|
2546
|
+
};
|
|
2547
|
+
var array2 = function array3(rule, value, callback, source, options) {
|
|
2548
|
+
var errors = [];
|
|
2549
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
2550
|
+
if (validate) {
|
|
2551
|
+
if ((value === void 0 || value === null) && !rule.required) {
|
|
2552
|
+
return callback();
|
|
2553
|
+
}
|
|
2554
|
+
rules.required(rule, value, source, errors, options, "array");
|
|
2555
|
+
if (value !== void 0 && value !== null) {
|
|
2556
|
+
rules.type(rule, value, source, errors, options);
|
|
2557
|
+
rules.range(rule, value, source, errors, options);
|
|
2558
|
+
}
|
|
2559
|
+
}
|
|
2560
|
+
callback(errors);
|
|
2561
|
+
};
|
|
2562
|
+
var object2 = function object3(rule, value, callback, source, options) {
|
|
2563
|
+
var errors = [];
|
|
2564
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
2565
|
+
if (validate) {
|
|
2566
|
+
if (isEmptyValue(value) && !rule.required) {
|
|
2567
|
+
return callback();
|
|
2568
|
+
}
|
|
2569
|
+
rules.required(rule, value, source, errors, options);
|
|
2570
|
+
if (value !== void 0) {
|
|
2571
|
+
rules.type(rule, value, source, errors, options);
|
|
2572
|
+
}
|
|
2573
|
+
}
|
|
2574
|
+
callback(errors);
|
|
2575
|
+
};
|
|
2576
|
+
var ENUM = "enum";
|
|
2577
|
+
var enumerable2 = function enumerable3(rule, value, callback, source, options) {
|
|
2578
|
+
var errors = [];
|
|
2579
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
2580
|
+
if (validate) {
|
|
2581
|
+
if (isEmptyValue(value) && !rule.required) {
|
|
2582
|
+
return callback();
|
|
2583
|
+
}
|
|
2584
|
+
rules.required(rule, value, source, errors, options);
|
|
2585
|
+
if (value !== void 0) {
|
|
2586
|
+
rules[ENUM](rule, value, source, errors, options);
|
|
2587
|
+
}
|
|
2588
|
+
}
|
|
2589
|
+
callback(errors);
|
|
2590
|
+
};
|
|
2591
|
+
var pattern2 = function pattern3(rule, value, callback, source, options) {
|
|
2592
|
+
var errors = [];
|
|
2593
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
2594
|
+
if (validate) {
|
|
2595
|
+
if (isEmptyValue(value, "string") && !rule.required) {
|
|
2596
|
+
return callback();
|
|
2597
|
+
}
|
|
2598
|
+
rules.required(rule, value, source, errors, options);
|
|
2599
|
+
if (!isEmptyValue(value, "string")) {
|
|
2600
|
+
rules.pattern(rule, value, source, errors, options);
|
|
2601
|
+
}
|
|
2602
|
+
}
|
|
2603
|
+
callback(errors);
|
|
2604
|
+
};
|
|
2605
|
+
var date2 = function date3(rule, value, callback, source, options) {
|
|
2606
|
+
var errors = [];
|
|
2607
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
2608
|
+
if (validate) {
|
|
2609
|
+
if (isEmptyValue(value, "date") && !rule.required) {
|
|
2610
|
+
return callback();
|
|
2611
|
+
}
|
|
2612
|
+
rules.required(rule, value, source, errors, options);
|
|
2613
|
+
if (!isEmptyValue(value, "date")) {
|
|
2614
|
+
var dateObject;
|
|
2615
|
+
if (value instanceof Date) {
|
|
2616
|
+
dateObject = value;
|
|
2617
|
+
} else {
|
|
2618
|
+
dateObject = new Date(value);
|
|
2619
|
+
}
|
|
2620
|
+
rules.type(rule, dateObject, source, errors, options);
|
|
2621
|
+
if (dateObject) {
|
|
2622
|
+
rules.range(rule, dateObject.getTime(), source, errors, options);
|
|
2623
|
+
}
|
|
2624
|
+
}
|
|
2625
|
+
}
|
|
2626
|
+
callback(errors);
|
|
2627
|
+
};
|
|
2628
|
+
var required2 = function required3(rule, value, callback, source, options) {
|
|
2629
|
+
var errors = [];
|
|
2630
|
+
var type4 = Array.isArray(value) ? "array" : typeof value;
|
|
2631
|
+
rules.required(rule, value, source, errors, options, type4);
|
|
2632
|
+
callback(errors);
|
|
2633
|
+
};
|
|
2634
|
+
var type2 = function type3(rule, value, callback, source, options) {
|
|
2635
|
+
var ruleType = rule.type;
|
|
2636
|
+
var errors = [];
|
|
2637
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
2638
|
+
if (validate) {
|
|
2639
|
+
if (isEmptyValue(value, ruleType) && !rule.required) {
|
|
2640
|
+
return callback();
|
|
2641
|
+
}
|
|
2642
|
+
rules.required(rule, value, source, errors, options, ruleType);
|
|
2643
|
+
if (!isEmptyValue(value, ruleType)) {
|
|
2644
|
+
rules.type(rule, value, source, errors, options);
|
|
2645
|
+
}
|
|
2646
|
+
}
|
|
2647
|
+
callback(errors);
|
|
2648
|
+
};
|
|
2649
|
+
var any = function any2(rule, value, callback, source, options) {
|
|
2650
|
+
var errors = [];
|
|
2651
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
2652
|
+
if (validate) {
|
|
2653
|
+
if (isEmptyValue(value) && !rule.required) {
|
|
2654
|
+
return callback();
|
|
2655
|
+
}
|
|
2656
|
+
rules.required(rule, value, source, errors, options);
|
|
2657
|
+
}
|
|
2658
|
+
callback(errors);
|
|
2659
|
+
};
|
|
2660
|
+
var validators = {
|
|
2661
|
+
string,
|
|
2662
|
+
method: method2,
|
|
2663
|
+
number: number2,
|
|
2664
|
+
"boolean": _boolean,
|
|
2665
|
+
regexp: regexp2,
|
|
2666
|
+
integer: integer2,
|
|
2667
|
+
"float": floatFn,
|
|
2668
|
+
array: array2,
|
|
2669
|
+
object: object2,
|
|
2670
|
+
"enum": enumerable2,
|
|
2671
|
+
pattern: pattern2,
|
|
2672
|
+
date: date2,
|
|
2673
|
+
url: type2,
|
|
2674
|
+
hex: type2,
|
|
2675
|
+
email: type2,
|
|
2676
|
+
required: required2,
|
|
2677
|
+
any
|
|
2678
|
+
};
|
|
2679
|
+
function newMessages() {
|
|
2680
|
+
return {
|
|
2681
|
+
"default": "Validation error on field %s",
|
|
2682
|
+
required: "%s is required",
|
|
2683
|
+
"enum": "%s must be one of %s",
|
|
2684
|
+
whitespace: "%s cannot be empty",
|
|
2685
|
+
date: {
|
|
2686
|
+
format: "%s date %s is invalid for format %s",
|
|
2687
|
+
parse: "%s date could not be parsed, %s is invalid ",
|
|
2688
|
+
invalid: "%s date %s is invalid"
|
|
2689
|
+
},
|
|
2690
|
+
types: {
|
|
2691
|
+
string: "%s is not a %s",
|
|
2692
|
+
method: "%s is not a %s (function)",
|
|
2693
|
+
array: "%s is not an %s",
|
|
2694
|
+
object: "%s is not an %s",
|
|
2695
|
+
number: "%s is not a %s",
|
|
2696
|
+
date: "%s is not a %s",
|
|
2697
|
+
"boolean": "%s is not a %s",
|
|
2698
|
+
integer: "%s is not an %s",
|
|
2699
|
+
"float": "%s is not a %s",
|
|
2700
|
+
regexp: "%s is not a valid %s",
|
|
2701
|
+
email: "%s is not a valid %s",
|
|
2702
|
+
url: "%s is not a valid %s",
|
|
2703
|
+
hex: "%s is not a valid %s"
|
|
2704
|
+
},
|
|
2705
|
+
string: {
|
|
2706
|
+
len: "%s must be exactly %s characters",
|
|
2707
|
+
min: "%s must be at least %s characters",
|
|
2708
|
+
max: "%s cannot be longer than %s characters",
|
|
2709
|
+
range: "%s must be between %s and %s characters"
|
|
2710
|
+
},
|
|
2711
|
+
number: {
|
|
2712
|
+
len: "%s must equal %s",
|
|
2713
|
+
min: "%s cannot be less than %s",
|
|
2714
|
+
max: "%s cannot be greater than %s",
|
|
2715
|
+
range: "%s must be between %s and %s"
|
|
2716
|
+
},
|
|
2717
|
+
array: {
|
|
2718
|
+
len: "%s must be exactly %s in length",
|
|
2719
|
+
min: "%s cannot be less than %s in length",
|
|
2720
|
+
max: "%s cannot be greater than %s in length",
|
|
2721
|
+
range: "%s must be between %s and %s in length"
|
|
2722
|
+
},
|
|
2723
|
+
pattern: {
|
|
2724
|
+
mismatch: "%s value %s does not match pattern %s"
|
|
2725
|
+
},
|
|
2726
|
+
clone: function clone() {
|
|
2727
|
+
var cloned = JSON.parse(JSON.stringify(this));
|
|
2728
|
+
cloned.clone = this.clone;
|
|
2729
|
+
return cloned;
|
|
2730
|
+
}
|
|
2731
|
+
};
|
|
2732
|
+
}
|
|
2733
|
+
var messages = newMessages();
|
|
2734
|
+
var Schema = /* @__PURE__ */ function() {
|
|
2735
|
+
function Schema2(descriptor) {
|
|
2736
|
+
this.rules = null;
|
|
2737
|
+
this._messages = messages;
|
|
2738
|
+
this.define(descriptor);
|
|
2739
|
+
}
|
|
2740
|
+
var _proto = Schema2.prototype;
|
|
2741
|
+
_proto.define = function define(rules2) {
|
|
2742
|
+
var _this = this;
|
|
2743
|
+
if (!rules2) {
|
|
2744
|
+
throw new Error("Cannot configure a schema with no rules");
|
|
2745
|
+
}
|
|
2746
|
+
if (typeof rules2 !== "object" || Array.isArray(rules2)) {
|
|
2747
|
+
throw new Error("Rules must be an object");
|
|
2748
|
+
}
|
|
2749
|
+
this.rules = {};
|
|
2750
|
+
Object.keys(rules2).forEach(function(name) {
|
|
2751
|
+
var item = rules2[name];
|
|
2752
|
+
_this.rules[name] = Array.isArray(item) ? item : [item];
|
|
2753
|
+
});
|
|
2754
|
+
};
|
|
2755
|
+
_proto.messages = function messages2(_messages) {
|
|
2756
|
+
if (_messages) {
|
|
2757
|
+
this._messages = deepMerge(newMessages(), _messages);
|
|
2758
|
+
}
|
|
2759
|
+
return this._messages;
|
|
2760
|
+
};
|
|
2761
|
+
_proto.validate = function validate(source_, o2, oc) {
|
|
2762
|
+
var _this2 = this;
|
|
2763
|
+
if (o2 === void 0) {
|
|
2764
|
+
o2 = {};
|
|
2765
|
+
}
|
|
2766
|
+
if (oc === void 0) {
|
|
2767
|
+
oc = function oc2() {
|
|
2768
|
+
};
|
|
2769
|
+
}
|
|
2770
|
+
var source = source_;
|
|
2771
|
+
var options = o2;
|
|
2772
|
+
var callback = oc;
|
|
2773
|
+
if (typeof options === "function") {
|
|
2774
|
+
callback = options;
|
|
2775
|
+
options = {};
|
|
2776
|
+
}
|
|
2777
|
+
if (!this.rules || Object.keys(this.rules).length === 0) {
|
|
2778
|
+
if (callback) {
|
|
2779
|
+
callback(null, source);
|
|
2780
|
+
}
|
|
2781
|
+
return Promise.resolve(source);
|
|
2782
|
+
}
|
|
2783
|
+
function complete(results) {
|
|
2784
|
+
var errors = [];
|
|
2785
|
+
var fields = {};
|
|
2786
|
+
function add(e) {
|
|
2787
|
+
if (Array.isArray(e)) {
|
|
2788
|
+
var _errors;
|
|
2789
|
+
errors = (_errors = errors).concat.apply(_errors, e);
|
|
2790
|
+
} else {
|
|
2791
|
+
errors.push(e);
|
|
2792
|
+
}
|
|
2793
|
+
}
|
|
2794
|
+
for (var i2 = 0; i2 < results.length; i2++) {
|
|
2795
|
+
add(results[i2]);
|
|
2796
|
+
}
|
|
2797
|
+
if (!errors.length) {
|
|
2798
|
+
callback(null, source);
|
|
2799
|
+
} else {
|
|
2800
|
+
fields = convertFieldsError(errors);
|
|
2801
|
+
callback(errors, fields);
|
|
2802
|
+
}
|
|
2803
|
+
}
|
|
2804
|
+
if (options.messages) {
|
|
2805
|
+
var messages$1 = this.messages();
|
|
2806
|
+
if (messages$1 === messages) {
|
|
2807
|
+
messages$1 = newMessages();
|
|
2808
|
+
}
|
|
2809
|
+
deepMerge(messages$1, options.messages);
|
|
2810
|
+
options.messages = messages$1;
|
|
2811
|
+
} else {
|
|
2812
|
+
options.messages = this.messages();
|
|
2813
|
+
}
|
|
2814
|
+
var series = {};
|
|
2815
|
+
var keys = options.keys || Object.keys(this.rules);
|
|
2816
|
+
keys.forEach(function(z2) {
|
|
2817
|
+
var arr = _this2.rules[z2];
|
|
2818
|
+
var value = source[z2];
|
|
2819
|
+
arr.forEach(function(r2) {
|
|
2820
|
+
var rule = r2;
|
|
2821
|
+
if (typeof rule.transform === "function") {
|
|
2822
|
+
if (source === source_) {
|
|
2823
|
+
source = _extends({}, source);
|
|
2824
|
+
}
|
|
2825
|
+
value = source[z2] = rule.transform(value);
|
|
2826
|
+
}
|
|
2827
|
+
if (typeof rule === "function") {
|
|
2828
|
+
rule = {
|
|
2829
|
+
validator: rule
|
|
2830
|
+
};
|
|
2831
|
+
} else {
|
|
2832
|
+
rule = _extends({}, rule);
|
|
2833
|
+
}
|
|
2834
|
+
rule.validator = _this2.getValidationMethod(rule);
|
|
2835
|
+
if (!rule.validator) {
|
|
2836
|
+
return;
|
|
2837
|
+
}
|
|
2838
|
+
rule.field = z2;
|
|
2839
|
+
rule.fullField = rule.fullField || z2;
|
|
2840
|
+
rule.type = _this2.getType(rule);
|
|
2841
|
+
series[z2] = series[z2] || [];
|
|
2842
|
+
series[z2].push({
|
|
2843
|
+
rule,
|
|
2844
|
+
value,
|
|
2845
|
+
source,
|
|
2846
|
+
field: z2
|
|
2847
|
+
});
|
|
2848
|
+
});
|
|
2849
|
+
});
|
|
2850
|
+
var errorFields = {};
|
|
2851
|
+
return asyncMap(series, options, function(data, doIt) {
|
|
2852
|
+
var rule = data.rule;
|
|
2853
|
+
var deep = (rule.type === "object" || rule.type === "array") && (typeof rule.fields === "object" || typeof rule.defaultField === "object");
|
|
2854
|
+
deep = deep && (rule.required || !rule.required && data.value);
|
|
2855
|
+
rule.field = data.field;
|
|
2856
|
+
function addFullField(key, schema) {
|
|
2857
|
+
return _extends({}, schema, {
|
|
2858
|
+
fullField: rule.fullField + "." + key,
|
|
2859
|
+
fullFields: rule.fullFields ? [].concat(rule.fullFields, [key]) : [key]
|
|
2860
|
+
});
|
|
2861
|
+
}
|
|
2862
|
+
function cb(e) {
|
|
2863
|
+
if (e === void 0) {
|
|
2864
|
+
e = [];
|
|
2865
|
+
}
|
|
2866
|
+
var errorList = Array.isArray(e) ? e : [e];
|
|
2867
|
+
if (!options.suppressWarning && errorList.length) {
|
|
2868
|
+
Schema2.warning("async-validator:", errorList);
|
|
2869
|
+
}
|
|
2870
|
+
if (errorList.length && rule.message !== void 0) {
|
|
2871
|
+
errorList = [].concat(rule.message);
|
|
2872
|
+
}
|
|
2873
|
+
var filledErrors = errorList.map(complementError(rule, source));
|
|
2874
|
+
if (options.first && filledErrors.length) {
|
|
2875
|
+
errorFields[rule.field] = 1;
|
|
2876
|
+
return doIt(filledErrors);
|
|
2877
|
+
}
|
|
2878
|
+
if (!deep) {
|
|
2879
|
+
doIt(filledErrors);
|
|
2880
|
+
} else {
|
|
2881
|
+
if (rule.required && !data.value) {
|
|
2882
|
+
if (rule.message !== void 0) {
|
|
2883
|
+
filledErrors = [].concat(rule.message).map(complementError(rule, source));
|
|
2884
|
+
} else if (options.error) {
|
|
2885
|
+
filledErrors = [options.error(rule, format(options.messages.required, rule.field))];
|
|
2886
|
+
}
|
|
2887
|
+
return doIt(filledErrors);
|
|
2888
|
+
}
|
|
2889
|
+
var fieldsSchema = {};
|
|
2890
|
+
if (rule.defaultField) {
|
|
2891
|
+
Object.keys(data.value).map(function(key) {
|
|
2892
|
+
fieldsSchema[key] = rule.defaultField;
|
|
2893
|
+
});
|
|
2894
|
+
}
|
|
2895
|
+
fieldsSchema = _extends({}, fieldsSchema, data.rule.fields);
|
|
2896
|
+
var paredFieldsSchema = {};
|
|
2897
|
+
Object.keys(fieldsSchema).forEach(function(field) {
|
|
2898
|
+
var fieldSchema = fieldsSchema[field];
|
|
2899
|
+
var fieldSchemaList = Array.isArray(fieldSchema) ? fieldSchema : [fieldSchema];
|
|
2900
|
+
paredFieldsSchema[field] = fieldSchemaList.map(addFullField.bind(null, field));
|
|
2901
|
+
});
|
|
2902
|
+
var schema = new Schema2(paredFieldsSchema);
|
|
2903
|
+
schema.messages(options.messages);
|
|
2904
|
+
if (data.rule.options) {
|
|
2905
|
+
data.rule.options.messages = options.messages;
|
|
2906
|
+
data.rule.options.error = options.error;
|
|
2907
|
+
}
|
|
2908
|
+
schema.validate(data.value, data.rule.options || options, function(errs) {
|
|
2909
|
+
var finalErrors = [];
|
|
2910
|
+
if (filledErrors && filledErrors.length) {
|
|
2911
|
+
finalErrors.push.apply(finalErrors, filledErrors);
|
|
2912
|
+
}
|
|
2913
|
+
if (errs && errs.length) {
|
|
2914
|
+
finalErrors.push.apply(finalErrors, errs);
|
|
2915
|
+
}
|
|
2916
|
+
doIt(finalErrors.length ? finalErrors : null);
|
|
2917
|
+
});
|
|
2918
|
+
}
|
|
2919
|
+
}
|
|
2920
|
+
var res;
|
|
2921
|
+
if (rule.asyncValidator) {
|
|
2922
|
+
res = rule.asyncValidator(rule, data.value, cb, data.source, options);
|
|
2923
|
+
} else if (rule.validator) {
|
|
2924
|
+
try {
|
|
2925
|
+
res = rule.validator(rule, data.value, cb, data.source, options);
|
|
2926
|
+
} catch (error) {
|
|
2927
|
+
console.error == null ? void 0 : console.error(error);
|
|
2928
|
+
if (!options.suppressValidatorError) {
|
|
2929
|
+
setTimeout(function() {
|
|
2930
|
+
throw error;
|
|
2931
|
+
}, 0);
|
|
2932
|
+
}
|
|
2933
|
+
cb(error.message);
|
|
2934
|
+
}
|
|
2935
|
+
if (res === true) {
|
|
2936
|
+
cb();
|
|
2937
|
+
} else if (res === false) {
|
|
2938
|
+
cb(typeof rule.message === "function" ? rule.message(rule.fullField || rule.field) : rule.message || (rule.fullField || rule.field) + " fails");
|
|
2939
|
+
} else if (res instanceof Array) {
|
|
2940
|
+
cb(res);
|
|
2941
|
+
} else if (res instanceof Error) {
|
|
2942
|
+
cb(res.message);
|
|
2943
|
+
}
|
|
2944
|
+
}
|
|
2945
|
+
if (res && res.then) {
|
|
2946
|
+
res.then(function() {
|
|
2947
|
+
return cb();
|
|
2948
|
+
}, function(e) {
|
|
2949
|
+
return cb(e);
|
|
2950
|
+
});
|
|
2951
|
+
}
|
|
2952
|
+
}, function(results) {
|
|
2953
|
+
complete(results);
|
|
2954
|
+
}, source);
|
|
2955
|
+
};
|
|
2956
|
+
_proto.getType = function getType(rule) {
|
|
2957
|
+
if (rule.type === void 0 && rule.pattern instanceof RegExp) {
|
|
2958
|
+
rule.type = "pattern";
|
|
2959
|
+
}
|
|
2960
|
+
if (typeof rule.validator !== "function" && rule.type && !validators.hasOwnProperty(rule.type)) {
|
|
2961
|
+
throw new Error(format("Unknown rule type %s", rule.type));
|
|
2962
|
+
}
|
|
2963
|
+
return rule.type || "string";
|
|
2964
|
+
};
|
|
2965
|
+
_proto.getValidationMethod = function getValidationMethod(rule) {
|
|
2966
|
+
if (typeof rule.validator === "function") {
|
|
2967
|
+
return rule.validator;
|
|
2968
|
+
}
|
|
2969
|
+
var keys = Object.keys(rule);
|
|
2970
|
+
var messageIndex = keys.indexOf("message");
|
|
2971
|
+
if (messageIndex !== -1) {
|
|
2972
|
+
keys.splice(messageIndex, 1);
|
|
2973
|
+
}
|
|
2974
|
+
if (keys.length === 1 && keys[0] === "required") {
|
|
2975
|
+
return validators.required;
|
|
2976
|
+
}
|
|
2977
|
+
return validators[this.getType(rule)] || void 0;
|
|
2978
|
+
};
|
|
2979
|
+
return Schema2;
|
|
2980
|
+
}();
|
|
2981
|
+
Schema.register = function register(type4, validator) {
|
|
2982
|
+
if (typeof validator !== "function") {
|
|
2983
|
+
throw new Error("Cannot register a validator by type, validator is not a function");
|
|
2984
|
+
}
|
|
2985
|
+
validators[type4] = validator;
|
|
2986
|
+
};
|
|
2987
|
+
Schema.warning = warning;
|
|
2988
|
+
Schema.messages = messages;
|
|
2989
|
+
Schema.validators = validators;
|
|
2990
|
+
Schema.warning = () => {
|
|
2991
|
+
};
|
|
2992
|
+
const tupleString = (...args) => args;
|
|
2993
|
+
const formItemLabelModels = tupleString("inline", "header");
|
|
2994
|
+
const useVue = () => {
|
|
2995
|
+
const instanceVm = getCurrentInstance();
|
|
2996
|
+
function getInstance() {
|
|
2997
|
+
return instanceVm == null ? void 0 : instanceVm.proxy;
|
|
2998
|
+
}
|
|
2999
|
+
function destroyCurrentInstance() {
|
|
3000
|
+
var _a;
|
|
3001
|
+
(_a = getInstance()) == null ? void 0 : _a.$destroy();
|
|
3002
|
+
}
|
|
3003
|
+
function getCurrentElem() {
|
|
3004
|
+
const instance = getInstance();
|
|
3005
|
+
return instance == null ? void 0 : instance.$el;
|
|
3006
|
+
}
|
|
3007
|
+
function getCurrentChildrens() {
|
|
3008
|
+
var _a;
|
|
3009
|
+
return (_a = getInstance()) == null ? void 0 : _a.$children;
|
|
3010
|
+
}
|
|
3011
|
+
function getSlot(slotName = "default") {
|
|
3012
|
+
const instance = getInstance();
|
|
3013
|
+
return (instance == null ? void 0 : instance.$slots) && instance.$slots[slotName] || [];
|
|
3014
|
+
}
|
|
3015
|
+
return {
|
|
3016
|
+
getInstance,
|
|
3017
|
+
destroyCurrentInstance,
|
|
3018
|
+
getCurrentElem,
|
|
3019
|
+
getCurrentChildrens,
|
|
3020
|
+
getSlot
|
|
3021
|
+
};
|
|
3022
|
+
};
|
|
3023
|
+
function canMatchKeywords(e, t2) {
|
|
3024
|
+
e = e.toLowerCase();
|
|
3025
|
+
const n2 = /[/\s;_-]/, s2 = /[/\s;_-]/;
|
|
3026
|
+
return t2.some((t3) => {
|
|
3027
|
+
const o2 = e.indexOf(t3.toLowerCase());
|
|
3028
|
+
if (-1 !== o2 && (n2.test(e[o2 - 1]) || 0 === o2) && (s2.test(e[o2 + t3.length]) || o2 + t3.length >= e.length)) return true;
|
|
3029
|
+
});
|
|
3030
|
+
}
|
|
3031
|
+
function canMatchModelRule(e, t2) {
|
|
3032
|
+
return !!/;\s*([^;)]*?)(?:\s+Build\/[^;)]+)?(?:;(?:\s*wv)?)?\)/.test(e) && t2.test(RegExp.$1);
|
|
3033
|
+
}
|
|
3034
|
+
function execRules(e, t2) {
|
|
3035
|
+
let n2;
|
|
3036
|
+
return t2.some((t3) => {
|
|
3037
|
+
let s2, o2 = false;
|
|
3038
|
+
return t3.regExp ? (o2 = t3.regExp.test(e), o2 && (s2 = RegExp.$1)) : t3.keywords ? o2 = canMatchKeywords(e, t3.keywords) : t3.modelRegExp && (o2 = canMatchModelRule(e, t3.modelRegExp)), o2 && (n2 = { name: t3.name, version: s2 }), o2;
|
|
3039
|
+
}), n2;
|
|
3040
|
+
}
|
|
3041
|
+
const osRules = [{ name: "windows", regExp: /\bWindows\s?NT\s?(([\d.]+))\b/ }, { name: "ios", regExp: /\bOS(?:\s([\d_.]+))?\slike\sMac\sOS\sX\b/ }, { name: "macos", regExp: /\bMac\sOS\sX(?:\s([\d_.]+))?/ }, { name: "openharmony", regExp: /\bOpenHarmony\s([\d.]+)\b/ }, { name: "android", regExp: /\bAndroid;?(?:[-/\s]([\d.]+))?(?:\b|_)/ }, { name: "android", regExp: /\bAdr\s([\d.]+)(?:\b|_)/ }];
|
|
3042
|
+
function compareVersions(r2, e) {
|
|
3043
|
+
const t2 = /(\.0+)+$/, n2 = String(r2).replace(t2, "").split("."), s2 = String(e).replace(t2, "").split("."), i2 = Math.min(n2.length, s2.length);
|
|
3044
|
+
for (let r3 = 0; r3 < i2; r3++) {
|
|
3045
|
+
const e2 = parseInt(n2[r3]) - parseInt(s2[r3]);
|
|
3046
|
+
if (e2) return e2;
|
|
3047
|
+
}
|
|
3048
|
+
return n2.length - s2.length;
|
|
3049
|
+
}
|
|
3050
|
+
class Version {
|
|
3051
|
+
constructor(r2) {
|
|
3052
|
+
this._ver = (r2 || "").replace(/_/g, ".").replace(/\.+$/, ""), Object.freeze(this);
|
|
3053
|
+
}
|
|
3054
|
+
_compare(r2, e) {
|
|
3055
|
+
if (!this._ver || !r2) return false;
|
|
3056
|
+
const t2 = Array.isArray(e) ? e : [e], n2 = compareVersions(this._ver, r2);
|
|
3057
|
+
return t2.some(function(r3) {
|
|
3058
|
+
return n2 * r3 > 0 || 0 === n2 && 0 === r3;
|
|
3059
|
+
});
|
|
3060
|
+
}
|
|
3061
|
+
gt(r2) {
|
|
3062
|
+
return this._compare(r2, 1);
|
|
3063
|
+
}
|
|
3064
|
+
gte(r2) {
|
|
3065
|
+
return this._compare(r2, [1, 0]);
|
|
3066
|
+
}
|
|
3067
|
+
lt(r2) {
|
|
3068
|
+
return this._compare(r2, -1);
|
|
3069
|
+
}
|
|
3070
|
+
lte(r2) {
|
|
3071
|
+
return this._compare(r2, [-1, 0]);
|
|
3072
|
+
}
|
|
3073
|
+
eq(r2) {
|
|
3074
|
+
return this._compare(r2, 0);
|
|
3075
|
+
}
|
|
3076
|
+
toString() {
|
|
3077
|
+
return this._ver;
|
|
3078
|
+
}
|
|
3079
|
+
}
|
|
3080
|
+
const propMap$3 = { ios: "isIOS", openharmony: "isOpenHarmony", android: "isAndroid", windows: "isWindows", macos: "isMacOS" };
|
|
3081
|
+
function platformToOS(s2) {
|
|
3082
|
+
switch (s2) {
|
|
3083
|
+
case "Android":
|
|
3084
|
+
return "android";
|
|
3085
|
+
case "iPad":
|
|
3086
|
+
case "iPhone":
|
|
3087
|
+
case "iPod":
|
|
3088
|
+
return "ios";
|
|
3089
|
+
case "MacIntel":
|
|
3090
|
+
return "macos";
|
|
3091
|
+
case "Win32":
|
|
3092
|
+
return "windows";
|
|
3093
|
+
}
|
|
3094
|
+
}
|
|
3095
|
+
class OSInfo {
|
|
3096
|
+
constructor(s2, o2) {
|
|
3097
|
+
var i2;
|
|
3098
|
+
let e;
|
|
3099
|
+
if (this.isIOS = false, this.isAndroid = false, this.isHarmonyOS = false, this.isOpenHarmony = false, this.isWindows = false, this.isMacOS = false, null == o2 ? void 0 : o2.platform) {
|
|
3100
|
+
const s3 = platformToOS(o2.platform);
|
|
3101
|
+
void 0 !== s3 && (e = { name: s3, version: "" });
|
|
3102
|
+
}
|
|
3103
|
+
let n2 = null !== (i2 = execRules(s2, osRules)) && void 0 !== i2 ? i2 : e;
|
|
3104
|
+
n2 ? (e && e.name !== n2.name && (n2 = e), "macos" === n2.name && (null == o2 ? void 0 : o2.maxTouchPoints) && (n2.name = "ios", n2.version = ""), this[propMap$3[n2.name]] = true, this.version = new Version(n2.version), this.isAndroid && /\bHarmonyOS\b/.test(s2) && (this.isHarmonyOS = true), Object.freeze(this)) : this.version = Object.freeze(new Version(""));
|
|
3105
|
+
}
|
|
3106
|
+
}
|
|
3107
|
+
const appleRules = [{ name: "ipad", regExp: /iPad/ }, { name: "ipod", regExp: /iPod/ }, { name: "iphone", regExp: /iPhone/ }];
|
|
3108
|
+
const androidRules = [{ name: "huawei", regExp: /\b(?:huawei|honor)/i }, { name: "huawei", keywords: ["ideahub", "figi"] }, { name: "vivo", keywords: ["vivo"] }, { name: "oppo", keywords: ["oppo"] }, { name: "mi", keywords: ["redmi", "hongmi", "shark", "Mi", "MIX", "POCO"] }, { name: "mi", regExp: /\bxiaomi/i }, { name: "samsung", keywords: ["samsung", "galaxy"] }, { name: "oneplus", keywords: ["oneplus", "one"] }, { name: "huawei", modelRegExp: /^Mate\s*\d{2}/i }, { name: "huawei", modelRegExp: /^MatePad/i }, { name: "huawei", modelRegExp: /^Nova\s\d$/ }, { name: "huawei", regExp: /\b(?:Liantong|UNICOMVSENS)VP\d{3}\b/ }, { name: "huawei", regExp: /\bCMDCSP\d{3}\b/ }, { name: "huawei", regExp: /\bTDTECH/i }, { name: "huawei", modelRegExp: /^[A-Z]{3}\d?-W[0-3]9[A-Z]*$/ }, { name: "huawei", modelRegExp: /^[A-Z][A-Za-z]{2,3}-(?:AN|BD|BX|AL|TL)\d{2}[A-Za-z]*$/ }, { name: "huawei", modelRegExp: /^TYH\d+[A-Z]?$/ }, { name: "huawei", modelRegExp: /^H60-L0[12]$/ }, { name: "mi", modelRegExp: /^MI\s?(?:\d|CC|Note|MAX|PLAY|PAD)/i }, { name: "mi", modelRegExp: /^(?:AWM|SKR|SKW|DLT)-/ }, { name: "mi", modelRegExp: /^XIG\d{2}$/ }, { name: "mi", modelRegExp: /^M\d{4}[A-Z]\d{1,2}[A-Z]{1,3}$/ }, { name: "mi", modelRegExp: /^2\d{3}[A-Z0-9]{6}$/ }, { name: "mi", modelRegExp: /^2\d{5}[0-9A-Z]{2}[A-Z]$/ }, { name: "mi", modelRegExp: /^2\d{6}[A-Z]$/ }, { name: "mi", modelRegExp: /^2\d{7}[A-Z]{2,3}$/ }, { name: "samsung", modelRegExp: /^S(?:M|[CGP]H)-[A-Za-z0-9]+$/ }, { name: "samsung", modelRegExp: /^SCV3\d$/ }, { name: "samsung", modelRegExp: /^SC-\d{2}[A-Z]$/ }, { name: "samsung", modelRegExp: /^SH[WV]-/ }, { name: "samsung", modelRegExp: /^GT[-_][A-Z][A-Z0-9]{3,}$/i }, { name: "oppo", modelRegExp: /^(?:CPH|OPD|iPA)\d{4}$/ }, { name: "oppo", modelRegExp: /^OPG\d{2}$/ }, { name: "oppo", modelRegExp: /^A10[1-9]OP$/ }, { name: "oneplus", modelRegExp: /^(?:KB|HD|IN|GM|NE|LE|MT)\d{4}$/ }, { name: "vivo", modelRegExp: /^V[12]\d{3}[A-Z]{0,2}$/ }];
|
|
3109
|
+
const propMap$2 = { ipod: "isIPod", iphone: "isIPhone", ipad: "isIPad", huawei: "isHuawei", mi: "isMi", oppo: "isOppo", vivo: "isVivo", oneplus: "isOnePlus", samsung: "isSamsung" };
|
|
3110
|
+
class BrandInfo {
|
|
3111
|
+
constructor(i2, s2) {
|
|
3112
|
+
let e;
|
|
3113
|
+
if (this.isHuawei = false, this.isMi = false, this.isOppo = false, this.isVivo = false, this.isOnePlus = false, this.isSamsung = false, this.isIPod = false, this.isIPhone = false, this.isIPad = false, this.isMac = false, this.isApple = false, s2.isIOS ? (e = appleRules, this.isApple = true) : s2.isMacOS ? (this.isMac = true, this.isApple = true) : (s2.isAndroid || s2.isOpenHarmony) && (e = androidRules), e) {
|
|
3114
|
+
const o2 = execRules(i2, e);
|
|
3115
|
+
o2 ? this[propMap$2[o2.name]] = true : s2.isIOS && (this.isIPad = true);
|
|
3116
|
+
}
|
|
3117
|
+
Object.freeze(this);
|
|
3118
|
+
}
|
|
3119
|
+
}
|
|
3120
|
+
const browserRules = [{ name: "edge", regExp: /\bEdge\/([\d.]+)/ }, { name: "chrome", regExp: /\b(?:Chrome|CrMo|CriOS)\/([\d.]+)/ }, { name: "safari", regExp: /\b(?:Version\/([\d.]+).*\s?)?Safari\b/ }, { name: "ie", regExp: /\bMSIE\s(\d+)/i }, { name: "ie", regExp: /\bTrident\/.*;\srv:(\d+)/ }, { name: "firefox", regExp: /\bFirefox\/([\d.]+)/ }, { name: "opera-presto", regExp: /\bOpera\/([\d.]+)/ }];
|
|
3121
|
+
const propMap$1 = { chrome: "isChrome", safari: "isSafari", edge: "isEdge", ie: "isIE", firefox: "isFirefox", "opera-presto": "isPrestoOpera" };
|
|
3122
|
+
class BrowserInfo {
|
|
3123
|
+
constructor(e) {
|
|
3124
|
+
this.isChrome = false, this.isSafari = false, this.isEdge = false, this.isIE = false, this.isFirefox = false, this.isPrestoOpera = false;
|
|
3125
|
+
const s2 = execRules(e, browserRules);
|
|
3126
|
+
s2 ? (this[propMap$1[s2.name]] = true, this.version = new Version(s2.version)) : this.version = new Version(""), Object.freeze(this);
|
|
3127
|
+
}
|
|
3128
|
+
}
|
|
3129
|
+
let clientRules = [{ name: "wxwork", regExp: /\bwxwork\/([\d.]+)/ }, { name: "wx", regExp: /\bMicroMessenger\/([\d.]+)/ }, { name: "ding", regExp: /\bDingTalk\/([\d.]+)/ }, { name: "qq", regExp: /\bQQ\/([\d.]+)/ }, { name: "qq", regExp: /\bIPadQQ\b/ }, { name: "weibo", regExp: /(?:\b|_)Weibo(?:\b|_)/i }, { name: "edge", regExp: /\bEdge?\/([\d.]+)/ }, { name: "opera-blink", regExp: /\bOPR\/([\d.]+)/ }, { name: "qqbrowser", regExp: /\bM?QQBrowser(?:\/([\d.]+))?/i }, { name: "ucbrowser", regExp: /\b(?:UCBrowser|UCWEB)(?:-CMCC)?\/?\s?([\d.]+)/ }, { name: "ucbrowser", regExp: /\bUC\b/ }, { name: "quark", regExp: /\bQuark\/([\d.]+)/ }, { name: "maxthon", regExp: /\b(?:Maxthon|MxBrowser)(?:[/\s]([\d.]+))?/ }, { name: "theworld", regExp: /\bTheWorld(?:\s([\d.]+))?/i }, { name: "baidubrowser", regExp: /\b(?:baidubrowser|bdbrowser_i18n|BIDUBrowser)(?:[/\s]([\d.]+))?/i }, { name: "baidubrowser", regExp: /\bbaidubrowserpad\b/ }, { name: "baiduapp", regExp: /\bbaiduboxapp\b\/([\d.]+)?/i }, { name: "baiduapp", regExp: /\bbaiduboxpad\b/i }];
|
|
3130
|
+
clientRules = clientRules.concat(browserRules);
|
|
3131
|
+
const propMap = { wxwork: "isWxWork", wx: "isWx", ding: "isDing", qq: "isQQ", weibo: "isWeibo", edge: "isEdge", "opera-blink": "isOpera", "opera-presto": "isOpera", qqbrowser: "isQQBrowser", ucbrowser: "isUCBrowser", quark: "isQuark", maxthon: "isMaxthon", theworld: "isTheWorld", baidubrowser: "isBaiduBrowser", baiduapp: "isBaiduApp", chrome: "isChrome", safari: "isSafari", ie: "isIE", firefox: "isFirefox" };
|
|
3132
|
+
class ClientInfo {
|
|
3133
|
+
constructor(i2) {
|
|
3134
|
+
this.isWxWork = false, this.isWx = false, this.isWxMiniProgram = false, this.isDing = false, this.isQQ = false, this.isWeibo = false, this.isEdge = false, this.isOpera = false, this.isQQBrowser = false, this.isUCBrowser = false, this.isQuark = false, this.isMaxthon = false, this.isTheWorld = false, this.isBaiduBrowser = false, this.isBaiduApp = false, this.isChrome = false, this.isSafari = false, this.isIE = false, this.isFirefox = false;
|
|
3135
|
+
const s2 = execRules(i2, clientRules);
|
|
3136
|
+
s2 ? (this[propMap[s2.name]] = true, this.version = new Version(s2.version)) : this.version = new Version(""), this.isWxMiniProgram = (this.isWx || this.isWxWork) && /\bMiniProgramEnv\b/.test(i2), Object.freeze(this);
|
|
3137
|
+
}
|
|
3138
|
+
}
|
|
3139
|
+
class UAInfo {
|
|
3140
|
+
constructor(t2, e) {
|
|
3141
|
+
this.os = Object.freeze(new OSInfo(t2, e)), this.brand = Object.freeze(new BrandInfo(t2, this.os)), this.browser = Object.freeze(new BrowserInfo(t2)), this.client = Object.freeze(new ClientInfo(t2)), this.os.isIOS || this.os.isAndroid ? this.isPortable = true : /\(X11[;)]/i.test(t2) || /\b(Windows\sNT|Macintosh)\b/.test(t2) ? this.isPortable = false : this.isPortable = /mobile|android/i.test(t2), this.isTablet = this.brand.isIPad || /\bTablet\b/i.test(t2) || this.os.isAndroid && !/\bMobile\b/i.test(t2), Object.freeze(this);
|
|
3142
|
+
}
|
|
3143
|
+
}
|
|
3144
|
+
let currentUAInfo;
|
|
3145
|
+
function getCurrentUAInfo() {
|
|
3146
|
+
return currentUAInfo || (currentUAInfo = Object.freeze("undefined" != typeof window ? new UAInfo(window.navigator.userAgent, window.navigator) : new UAInfo(""))), currentUAInfo;
|
|
3147
|
+
}
|
|
3148
|
+
const ua = navigator.userAgent.toLowerCase();
|
|
3149
|
+
const uaInfo = getCurrentUAInfo();
|
|
3150
|
+
const isWeixin = uaInfo.client.isWx;
|
|
3151
|
+
const isWorkWeixin = uaInfo.client.isWxWork;
|
|
3152
|
+
const isPcMiniProgram = (isWeixin || isWorkWeixin) && /miniprogramenv/.test(ua);
|
|
3153
|
+
function __isMobile() {
|
|
3154
|
+
const ua2 = navigator.userAgent;
|
|
3155
|
+
if (/mobile|android/i.test(ua2)) {
|
|
3156
|
+
return true;
|
|
3157
|
+
} else {
|
|
3158
|
+
if (/\b(Windows\sNT|Macintosh|x86(_(32|64))?|amd64|i[1-6]86)\b/.test(ua2) || !("onorientationchange" in window)) {
|
|
3159
|
+
return false;
|
|
3160
|
+
} else {
|
|
3161
|
+
return true;
|
|
3162
|
+
}
|
|
3163
|
+
}
|
|
3164
|
+
}
|
|
3165
|
+
function __isTablet() {
|
|
3166
|
+
const ua2 = navigator.userAgent;
|
|
3167
|
+
if (/(?:iPad|PlayBook)/.test(ua2)) return true;
|
|
3168
|
+
if (uaInfo.os.isAndroid && !/(?:Mobile)/.test(ua2) || /(?:Tablet)/.test(ua2)) return true;
|
|
3169
|
+
return false;
|
|
3170
|
+
}
|
|
3171
|
+
const isMob = __isMobile();
|
|
3172
|
+
isMob && __isTablet();
|
|
3173
|
+
const isMobile = /* @__PURE__ */ (() => {
|
|
3174
|
+
return isMob || isPcMiniProgram;
|
|
3175
|
+
})();
|
|
3176
|
+
const formWrapProps = () => ({
|
|
3177
|
+
/** 绑定的表单对象 */
|
|
3178
|
+
formData: PropUtils.object().def({}),
|
|
3179
|
+
/** 验证规则 */
|
|
3180
|
+
formRules: PropUtils.object().def({}),
|
|
3181
|
+
/** 表单标题宽度 */
|
|
3182
|
+
labelWidth: PropUtils.number.def(170),
|
|
3183
|
+
/** 表单标题高度 */
|
|
3184
|
+
labelHeight: PropUtils.number.def(isMobile ? 52 : 40),
|
|
3185
|
+
/** 表单输入框内容宽度 */
|
|
3186
|
+
contentWidth: PropUtils.looseNumber,
|
|
3187
|
+
/** 表单提交方法 */
|
|
3188
|
+
submitAction: PropUtils.func(),
|
|
3189
|
+
/** 表单主题,dark-黑暗 */
|
|
3190
|
+
theme: PropUtils.enum(),
|
|
3191
|
+
/** label 模式,默认:inline */
|
|
3192
|
+
labelModel: PropUtils.oneOf(formItemLabelModels).def("inline"),
|
|
3193
|
+
/** 是否开启 debug 打印,默认:false */
|
|
3194
|
+
debug: PropUtils.bool.def(false)
|
|
3195
|
+
});
|
|
3196
|
+
const formWrapEmits = () => ({
|
|
3197
|
+
// 表单提交事件
|
|
3198
|
+
"submit-form": emitFunc()
|
|
3199
|
+
});
|
|
3200
|
+
const FORM_WRAP_PROPS_PROVIDE_KEY = Symbol(
|
|
3201
|
+
"FORM_WRAP_PROPS_PROVIDE_KEY"
|
|
3202
|
+
);
|
|
3203
|
+
const useFormWrapPropsInject = () => {
|
|
3204
|
+
return inject(FORM_WRAP_PROPS_PROVIDE_KEY);
|
|
3205
|
+
};
|
|
3206
|
+
const FORM_WRAP_PROVIDE_KEY = Symbol("FORM_WRAP_PROVIDE_KEY");
|
|
3207
|
+
const useFormWrapInject = () => {
|
|
3208
|
+
return inject(FORM_WRAP_PROVIDE_KEY);
|
|
3209
|
+
};
|
|
3210
|
+
const useFormWrap = (options) => {
|
|
3211
|
+
const { props, emit } = options;
|
|
3212
|
+
const { formData, submitAction, debug } = useProps(props);
|
|
3213
|
+
const { getCurrentChildrens } = useVue();
|
|
3214
|
+
const isSubmiting = ref(false);
|
|
3215
|
+
async function validateCurrentForm(validateOptions = {}) {
|
|
3216
|
+
const childrens = getCurrentChildrens();
|
|
3217
|
+
if (!childrens || childrens.length === 0) {
|
|
3218
|
+
return;
|
|
3219
|
+
}
|
|
3220
|
+
for (let i2 = 0; i2 < childrens.length; i2++) {
|
|
3221
|
+
const instance = childrens[i2];
|
|
3222
|
+
if (isFormItemInstance(instance)) {
|
|
3223
|
+
try {
|
|
3224
|
+
await instance.validateFormItem(validateOptions);
|
|
3225
|
+
} catch (e) {
|
|
3226
|
+
return Promise.reject(e);
|
|
3227
|
+
}
|
|
3228
|
+
}
|
|
3229
|
+
}
|
|
3230
|
+
}
|
|
3231
|
+
async function submitForm(validateOptions) {
|
|
3232
|
+
try {
|
|
3233
|
+
await validateCurrentForm(validateOptions);
|
|
3234
|
+
emit("submit-form", unref(formData));
|
|
3235
|
+
const submitActionFn = unref(submitAction);
|
|
3236
|
+
if (typeof submitActionFn === "function") {
|
|
3237
|
+
isSubmiting.value = true;
|
|
3238
|
+
try {
|
|
3239
|
+
await submitActionFn(unref(formData));
|
|
3240
|
+
} catch (e) {
|
|
3241
|
+
isSubmiting.value = false;
|
|
3242
|
+
} finally {
|
|
3243
|
+
isSubmiting.value = false;
|
|
3244
|
+
}
|
|
3245
|
+
}
|
|
3246
|
+
} catch (error) {
|
|
3247
|
+
console.error("submitForm-error", error.message);
|
|
3248
|
+
}
|
|
3249
|
+
}
|
|
3250
|
+
provide(FORM_WRAP_PROPS_PROVIDE_KEY, props);
|
|
3251
|
+
provide(FORM_WRAP_PROVIDE_KEY, {
|
|
3252
|
+
debug,
|
|
3253
|
+
isSubmiting,
|
|
3254
|
+
validateCurrentForm,
|
|
3255
|
+
submitForm
|
|
3256
|
+
});
|
|
3257
|
+
return {
|
|
3258
|
+
isSubmiting,
|
|
3259
|
+
validateCurrentForm,
|
|
3260
|
+
submitForm
|
|
3261
|
+
};
|
|
3262
|
+
};
|
|
3263
|
+
const formItemProps = () => ({
|
|
3264
|
+
/** 该节点属于表单数据中的哪个字段 */
|
|
3265
|
+
formField: PropUtils.looseString,
|
|
3266
|
+
/** 节点标签 */
|
|
3267
|
+
label: PropUtils.looseString,
|
|
3268
|
+
/** 表单标题宽度 */
|
|
3269
|
+
labelWidth: PropUtils.looseNumber,
|
|
3270
|
+
/** 表单标题高度 */
|
|
3271
|
+
labelHeight: PropUtils.looseNumber,
|
|
3272
|
+
/** 表单输入框内容宽度 */
|
|
3273
|
+
contentWidth: PropUtils.looseNumber,
|
|
3274
|
+
/** 是否显示异常信息 */
|
|
3275
|
+
showErrorMessage: PropUtils.bool.def(true),
|
|
3276
|
+
/** 节点异常信息 */
|
|
3277
|
+
errorMessage: PropUtils.looseString,
|
|
3278
|
+
/** label 模式 */
|
|
3279
|
+
labelModel: PropUtils.oneOf(formItemLabelModels),
|
|
3280
|
+
/** 是否显示必填星号 */
|
|
3281
|
+
required: PropUtils.bool.def(false)
|
|
3282
|
+
});
|
|
3283
|
+
const isFormItemInstance = (instance) => {
|
|
3284
|
+
const _instance = instance;
|
|
3285
|
+
return (_instance == null ? void 0 : _instance.isFormItem) ?? false;
|
|
3286
|
+
};
|
|
3287
|
+
const FORM_ITEM_PROVIDE_KEY = Symbol("FORM_ITEM_PROVIDE_KEY");
|
|
3288
|
+
const useFormItemInject = () => {
|
|
3289
|
+
return inject(FORM_ITEM_PROVIDE_KEY, void 0);
|
|
3290
|
+
};
|
|
3291
|
+
const useFormItem = (options) => {
|
|
3292
|
+
const { props } = options;
|
|
3293
|
+
const required4 = computed(() => props.required);
|
|
3294
|
+
const formProps = useFormWrapPropsInject();
|
|
3295
|
+
const labelText = computed(() => props.label);
|
|
3296
|
+
const labelModel = computed(
|
|
3297
|
+
() => props.labelModel ?? (formProps == null ? void 0 : formProps.labelModel) ?? "inline"
|
|
3298
|
+
);
|
|
3299
|
+
const labelStyle = computed(() => {
|
|
3300
|
+
if (unref(labelModel) === "header") {
|
|
3301
|
+
return {};
|
|
3302
|
+
}
|
|
3303
|
+
const width = props.labelWidth ?? (formProps == null ? void 0 : formProps.labelWidth);
|
|
3304
|
+
const height = props.labelHeight ?? (formProps == null ? void 0 : formProps.labelHeight);
|
|
3305
|
+
return {
|
|
3306
|
+
width: formatStyleSize(width),
|
|
3307
|
+
height: formatStyleSize(height)
|
|
3308
|
+
};
|
|
3309
|
+
});
|
|
3310
|
+
const contentWidthStyle = computed(() => {
|
|
3311
|
+
const width = props.contentWidth ?? (formProps == null ? void 0 : formProps.contentWidth);
|
|
3312
|
+
return formatStyleSize(width);
|
|
3313
|
+
});
|
|
3314
|
+
const itemErrorMessage = ref();
|
|
3315
|
+
const formItemIsError = computed(() => typeof unref(itemErrorMessage) !== "undefined");
|
|
3316
|
+
watchEffect(() => {
|
|
3317
|
+
if (props.errorMessage) {
|
|
3318
|
+
setErrorMessage(props.errorMessage);
|
|
3319
|
+
} else {
|
|
3320
|
+
itemErrorMessage.value = void 0;
|
|
3321
|
+
}
|
|
3322
|
+
});
|
|
3323
|
+
watch(() => formProps == null ? void 0 : formProps.formRules, () => {
|
|
3324
|
+
itemErrorMessage.value = void 0;
|
|
3325
|
+
});
|
|
3326
|
+
function setErrorMessage(message) {
|
|
3327
|
+
if (message && !props.showErrorMessage) return;
|
|
3328
|
+
itemErrorMessage.value = message;
|
|
3329
|
+
}
|
|
3330
|
+
function removeErrorMessage() {
|
|
3331
|
+
itemErrorMessage.value = void 0;
|
|
3332
|
+
}
|
|
3333
|
+
function validateFormItem(validateOptions = {}) {
|
|
3334
|
+
const showErrorMessage = validateOptions.showErrorMessage ?? true;
|
|
3335
|
+
const validateField = props.formField;
|
|
3336
|
+
const formDataVal = formProps == null ? void 0 : formProps.formData;
|
|
3337
|
+
const formRulesVal = formProps == null ? void 0 : formProps.formRules;
|
|
3338
|
+
if (!validateField || !formDataVal || !formRulesVal || !formRulesVal[validateField]) {
|
|
3339
|
+
return Promise.resolve();
|
|
3340
|
+
}
|
|
3341
|
+
const descriptor = {
|
|
3342
|
+
[validateField]: formRulesVal[validateField]
|
|
3343
|
+
};
|
|
3344
|
+
const validateVal = {
|
|
3345
|
+
[validateField]: formDataVal[validateField]
|
|
3346
|
+
};
|
|
3347
|
+
const validator = new Schema(descriptor);
|
|
3348
|
+
let message;
|
|
3349
|
+
validator.validate(validateVal, (errors) => {
|
|
3350
|
+
if (errors && errors.length) {
|
|
3351
|
+
message = errors[0].message;
|
|
3352
|
+
}
|
|
3353
|
+
});
|
|
3354
|
+
if (showErrorMessage && props.showErrorMessage) {
|
|
3355
|
+
setErrorMessage(message);
|
|
3356
|
+
}
|
|
3357
|
+
return new Promise((resolve, reject) => {
|
|
3358
|
+
if (typeof message === "undefined") {
|
|
3359
|
+
resolve();
|
|
3360
|
+
} else {
|
|
3361
|
+
reject(new Error(message));
|
|
3362
|
+
}
|
|
3363
|
+
});
|
|
3364
|
+
}
|
|
3365
|
+
const formItemInstance = {
|
|
3366
|
+
isFormItem: true,
|
|
3367
|
+
formItemIsError,
|
|
3368
|
+
setErrorMessage,
|
|
3369
|
+
removeErrorMessage,
|
|
3370
|
+
validateFormItem
|
|
3371
|
+
};
|
|
3372
|
+
provide(FORM_ITEM_PROVIDE_KEY, formItemInstance);
|
|
3373
|
+
return {
|
|
3374
|
+
required: required4,
|
|
3375
|
+
labelText,
|
|
3376
|
+
labelModel,
|
|
3377
|
+
labelStyle,
|
|
3378
|
+
contentWidthStyle,
|
|
3379
|
+
itemErrorMessage,
|
|
3380
|
+
formItemIsError,
|
|
3381
|
+
removeErrorMessage,
|
|
3382
|
+
validateFormItem,
|
|
3383
|
+
formItemInstance
|
|
3384
|
+
};
|
|
3385
|
+
};
|
|
3386
|
+
const formCommonProps = () => ({
|
|
3387
|
+
/** 尺寸 */
|
|
3388
|
+
size: PropUtils.enum(),
|
|
3389
|
+
/** 主题 */
|
|
3390
|
+
theme: PropUtils.enum(),
|
|
3391
|
+
/** 是否进行表单验证 */
|
|
3392
|
+
validateForm: PropUtils.bool.def(true)
|
|
3393
|
+
});
|
|
3394
|
+
const useFormCommon = (options) => {
|
|
3395
|
+
const { props, classPrefix } = options;
|
|
3396
|
+
const formProps = useFormWrapPropsInject();
|
|
3397
|
+
const commonClassNames = computed(() => {
|
|
3398
|
+
const list = [];
|
|
3399
|
+
const sizeVal = props.size;
|
|
3400
|
+
if (sizeVal && sizeVal !== FormSize.Default) {
|
|
3401
|
+
list.push(`${classPrefix}--size-${sizeVal}`);
|
|
3402
|
+
}
|
|
3403
|
+
const themeVal = props.theme || (formProps == null ? void 0 : formProps.theme);
|
|
3404
|
+
if (unref(themeVal)) {
|
|
3405
|
+
list.push(`${classPrefix}--theme-${themeVal}`);
|
|
3406
|
+
}
|
|
3407
|
+
return list;
|
|
3408
|
+
});
|
|
3409
|
+
return {
|
|
3410
|
+
commonClassNames
|
|
3411
|
+
};
|
|
3412
|
+
};
|
|
3413
|
+
const useFormCommonValidate = (options) => {
|
|
3414
|
+
const { props } = options;
|
|
3415
|
+
const formItemContext = useFormItemInject();
|
|
3416
|
+
async function validateCurrentFormItem() {
|
|
3417
|
+
await (formItemContext == null ? void 0 : formItemContext.validateFormItem());
|
|
3418
|
+
}
|
|
3419
|
+
async function blurToValidateItem() {
|
|
3420
|
+
if (!props.validateForm) {
|
|
3421
|
+
return;
|
|
3422
|
+
}
|
|
3423
|
+
try {
|
|
3424
|
+
await validateCurrentFormItem();
|
|
3425
|
+
} catch (error) {
|
|
3426
|
+
console.error("blur-validate", error.message);
|
|
3427
|
+
}
|
|
3428
|
+
}
|
|
3429
|
+
function focusToRemoveError() {
|
|
3430
|
+
if (!props.validateForm) {
|
|
3431
|
+
return;
|
|
3432
|
+
}
|
|
3433
|
+
formItemContext == null ? void 0 : formItemContext.removeErrorMessage();
|
|
3434
|
+
}
|
|
3435
|
+
const formItemIsError = computed(() => {
|
|
3436
|
+
if (!props.validateForm || !formItemContext) {
|
|
3437
|
+
return false;
|
|
3438
|
+
}
|
|
3439
|
+
return unref(formItemContext.formItemIsError);
|
|
3440
|
+
});
|
|
3441
|
+
return {
|
|
3442
|
+
validateCurrentFormItem,
|
|
3443
|
+
blurToValidateItem,
|
|
3444
|
+
focusToRemoveError,
|
|
3445
|
+
formItemIsError
|
|
3446
|
+
};
|
|
3447
|
+
};
|
|
3448
|
+
function getSelectData(value, data) {
|
|
3449
|
+
let res = [];
|
|
3450
|
+
const [first, ...otherValue] = value;
|
|
3451
|
+
if (typeof first === "undefined") {
|
|
3452
|
+
return res;
|
|
3453
|
+
}
|
|
3454
|
+
const selected = data.find((item) => item.code === first);
|
|
3455
|
+
if (selected) {
|
|
3456
|
+
res = [selected];
|
|
3457
|
+
}
|
|
3458
|
+
if (selected && Array.isArray(selected.childrens)) {
|
|
3459
|
+
res = [...res, ...getSelectData(otherValue, selected.childrens)];
|
|
3460
|
+
}
|
|
3461
|
+
return res;
|
|
3462
|
+
}
|
|
3463
|
+
function isSelectFinish(value, data) {
|
|
3464
|
+
const selectData = getSelectData(value, data);
|
|
3465
|
+
const lastData = selectData[selectData.length - 1] || {};
|
|
3466
|
+
return !!(selectData.length && (!lastData.childrens || !lastData.childrens.length));
|
|
3467
|
+
}
|
|
3468
|
+
const formAreaPickerProps = () => ({
|
|
3469
|
+
...formCommonProps(),
|
|
3470
|
+
/** 绑定值 */
|
|
3471
|
+
value: PropUtils.array(),
|
|
3472
|
+
areaPickerText: PropUtils.array(),
|
|
3473
|
+
/** 占位文本 */
|
|
3474
|
+
placeholder: PropUtils.string
|
|
3475
|
+
});
|
|
3476
|
+
const formAreaPickerEmit = () => ({
|
|
3477
|
+
input: emitFunc(),
|
|
3478
|
+
...updateModelEmit("areaPickerText")
|
|
3479
|
+
});
|
|
3480
|
+
let areaDataRecord;
|
|
3481
|
+
const useFormAreaPicker = (options) => {
|
|
3482
|
+
const areaData = ref([]);
|
|
3483
|
+
const { AreaPicker, props, emit } = options;
|
|
3484
|
+
const { formItemIsError, blurToValidateItem, focusToRemoveError } = useFormCommonValidate({
|
|
3485
|
+
props
|
|
3486
|
+
});
|
|
3487
|
+
const innerValue = ref([]);
|
|
3488
|
+
const inputPlaceholder = computed(() => props.placeholder);
|
|
3489
|
+
const isFinish = computed(() => {
|
|
3490
|
+
return isSelectFinish(props.value, areaData.value);
|
|
3491
|
+
});
|
|
3492
|
+
const innerIsFinish = computed(() => {
|
|
3493
|
+
return isSelectFinish(innerValue.value, areaData.value);
|
|
3494
|
+
});
|
|
3495
|
+
const pickerTexts = computed(() => {
|
|
3496
|
+
let data = [];
|
|
3497
|
+
if (innerIsFinish.value) {
|
|
3498
|
+
data = getSelectData(innerValue.value, areaData.value);
|
|
3499
|
+
} else if (isSelectFinish(props.value, areaData.value)) {
|
|
3500
|
+
data = getSelectData(props.value, areaData.value);
|
|
3501
|
+
}
|
|
3502
|
+
return data.map((item) => item.name);
|
|
3503
|
+
});
|
|
3504
|
+
const inputValue = computed(() => {
|
|
3505
|
+
return pickerTexts.value.join("/");
|
|
3506
|
+
});
|
|
3507
|
+
watch(pickerTexts, () => {
|
|
3508
|
+
emit("update:areaPickerText", pickerTexts.value);
|
|
3509
|
+
}, {
|
|
3510
|
+
immediate: true
|
|
3511
|
+
});
|
|
3512
|
+
watch(
|
|
3513
|
+
() => unref(innerValue),
|
|
3514
|
+
() => {
|
|
3515
|
+
if (!isMobile) {
|
|
3516
|
+
emit("input", unref(innerValue));
|
|
3517
|
+
}
|
|
3518
|
+
}
|
|
3519
|
+
);
|
|
3520
|
+
const instance = {
|
|
3521
|
+
isFinish
|
|
3522
|
+
};
|
|
3523
|
+
const pickerVisible = ref(false);
|
|
3524
|
+
const refreshKey = ref(1);
|
|
3525
|
+
function openPicker() {
|
|
3526
|
+
if (!isFinish.value) {
|
|
3527
|
+
refreshKey.value += 1;
|
|
3528
|
+
}
|
|
3529
|
+
pickerVisible.value = true;
|
|
3530
|
+
onShowPicker();
|
|
3531
|
+
}
|
|
3532
|
+
function closePicker() {
|
|
3533
|
+
pickerVisible.value = false;
|
|
3534
|
+
onHiddenPicker();
|
|
3535
|
+
}
|
|
3536
|
+
function onHiddenPicker() {
|
|
3537
|
+
if (!innerIsFinish.value) {
|
|
3538
|
+
innerValue.value = props.value;
|
|
3539
|
+
} else {
|
|
3540
|
+
emit("input", unref(innerValue));
|
|
3541
|
+
}
|
|
3542
|
+
blurToValidateItem();
|
|
3543
|
+
}
|
|
3544
|
+
function onShowPicker() {
|
|
3545
|
+
focusToRemoveError();
|
|
3546
|
+
}
|
|
3547
|
+
function onClickConfirm() {
|
|
3548
|
+
if (!unref(innerIsFinish)) {
|
|
3549
|
+
return;
|
|
3550
|
+
}
|
|
3551
|
+
emit("input", unref(innerValue));
|
|
3552
|
+
closePicker();
|
|
3553
|
+
}
|
|
3554
|
+
onBeforeMount(async () => {
|
|
3555
|
+
if (areaData.value.length === 0) {
|
|
3556
|
+
if (areaDataRecord) {
|
|
3557
|
+
areaData.value = areaDataRecord;
|
|
3558
|
+
} else {
|
|
3559
|
+
const data = await AreaPicker.loadAreaDataUrl();
|
|
3560
|
+
areaDataRecord = data;
|
|
3561
|
+
areaData.value = data;
|
|
3562
|
+
}
|
|
3563
|
+
}
|
|
3564
|
+
});
|
|
3565
|
+
return {
|
|
3566
|
+
innerValue,
|
|
3567
|
+
isFinish,
|
|
3568
|
+
innerIsFinish,
|
|
3569
|
+
instance,
|
|
3570
|
+
inputValue,
|
|
3571
|
+
inputPlaceholder,
|
|
3572
|
+
refreshKey,
|
|
3573
|
+
formItemIsError,
|
|
3574
|
+
blurToValidateItem,
|
|
3575
|
+
focusToRemoveError,
|
|
3576
|
+
pickerVisible,
|
|
3577
|
+
openPicker,
|
|
3578
|
+
closePicker,
|
|
3579
|
+
onHiddenPicker,
|
|
3580
|
+
onShowPicker,
|
|
3581
|
+
onClickConfirm
|
|
3582
|
+
};
|
|
3583
|
+
};
|
|
3584
|
+
const commonZh = {
|
|
3585
|
+
confirm: "确认",
|
|
3586
|
+
cancel: "取消",
|
|
3587
|
+
close: "关闭",
|
|
3588
|
+
submit: "提交",
|
|
3589
|
+
submitSuccess: "提交成功"
|
|
3590
|
+
};
|
|
3591
|
+
const commonEn = {
|
|
3592
|
+
confirm: "Confirm",
|
|
3593
|
+
cancel: "Cancel",
|
|
3594
|
+
close: "Close",
|
|
3595
|
+
submit: "Submit",
|
|
3596
|
+
submitSuccess: "Success"
|
|
3597
|
+
};
|
|
3598
|
+
function compressObject(obj, prefix = "") {
|
|
3599
|
+
return Object.keys(obj).reduce((acc, key) => {
|
|
3600
|
+
const value = obj[key];
|
|
3601
|
+
const newKey = prefix ? `${prefix}.${key}` : key;
|
|
3602
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value)) {
|
|
3603
|
+
Object.assign(acc, compressObject(value, newKey));
|
|
3604
|
+
} else {
|
|
3605
|
+
acc[newKey] = value;
|
|
3606
|
+
}
|
|
3607
|
+
return acc;
|
|
3608
|
+
}, {});
|
|
3609
|
+
}
|
|
3610
|
+
function mitt(n2) {
|
|
3611
|
+
return { all: n2 = n2 || /* @__PURE__ */ new Map(), on: function(t2, e) {
|
|
3612
|
+
var i2 = n2.get(t2);
|
|
3613
|
+
i2 ? i2.push(e) : n2.set(t2, [e]);
|
|
3614
|
+
}, off: function(t2, e) {
|
|
3615
|
+
var i2 = n2.get(t2);
|
|
3616
|
+
i2 && (e ? i2.splice(i2.indexOf(e) >>> 0, 1) : n2.set(t2, []));
|
|
3617
|
+
}, emit: function(t2, e) {
|
|
3618
|
+
var i2 = n2.get(t2);
|
|
3619
|
+
i2 && i2.slice().map(function(n3) {
|
|
3620
|
+
n3(e);
|
|
3621
|
+
}), (i2 = n2.get("*")) && i2.slice().map(function(n3) {
|
|
3622
|
+
n3(t2, e);
|
|
3623
|
+
});
|
|
3624
|
+
} };
|
|
3625
|
+
}
|
|
3626
|
+
const globalKey = "__iar-event-emitter-key";
|
|
3627
|
+
function createEmitter() {
|
|
3628
|
+
if (window[globalKey]) {
|
|
3629
|
+
return window[globalKey];
|
|
3630
|
+
}
|
|
3631
|
+
const emitter = mitt();
|
|
3632
|
+
window[globalKey] = emitter;
|
|
3633
|
+
return emitter;
|
|
3634
|
+
}
|
|
3635
|
+
const IarInjectKey = "interactGlobalConfig";
|
|
3636
|
+
const useGlobalInject = () => {
|
|
3637
|
+
const injectData = inject(IarInjectKey, {
|
|
3638
|
+
globalLang: "zh_CN"
|
|
3639
|
+
});
|
|
3640
|
+
const toast = (msg) => {
|
|
3641
|
+
injectData.toast && injectData.toast(msg);
|
|
3642
|
+
};
|
|
3643
|
+
function getEmitter() {
|
|
3644
|
+
if (injectData.getEmitter) {
|
|
3645
|
+
return injectData.getEmitter();
|
|
3646
|
+
}
|
|
3647
|
+
return createEmitter();
|
|
3648
|
+
}
|
|
3649
|
+
return {
|
|
3650
|
+
injectData,
|
|
3651
|
+
toast,
|
|
3652
|
+
getEmitter
|
|
3653
|
+
};
|
|
3654
|
+
};
|
|
3655
|
+
const useI18n = (config2 = {
|
|
3656
|
+
zh: {},
|
|
3657
|
+
en: {},
|
|
3658
|
+
key: ""
|
|
3659
|
+
}) => {
|
|
3660
|
+
const { injectData } = useGlobalInject();
|
|
3661
|
+
const zhLang = compressObject({
|
|
3662
|
+
common: commonZh,
|
|
3663
|
+
[config2.key]: config2.zh
|
|
3664
|
+
});
|
|
3665
|
+
const enLang = compressObject({
|
|
3666
|
+
common: commonEn,
|
|
3667
|
+
[config2.key]: config2.en
|
|
3668
|
+
});
|
|
3669
|
+
const currentLang = computed(() => {
|
|
3670
|
+
return injectData.globalLang || "zh_CN";
|
|
3671
|
+
});
|
|
3672
|
+
function $t(key) {
|
|
3673
|
+
const currentLangData = currentLang.value === "zh_CN" ? zhLang : enLang;
|
|
3674
|
+
return currentLangData[key];
|
|
3675
|
+
}
|
|
3676
|
+
return {
|
|
3677
|
+
$t
|
|
3678
|
+
};
|
|
3679
|
+
};
|
|
3680
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
3681
|
+
__name: "mobile-form-area-picker",
|
|
3682
|
+
props: formAreaPickerProps(),
|
|
3683
|
+
emits: formAreaPickerEmit(),
|
|
3684
|
+
setup(__props, { expose, emit }) {
|
|
3685
|
+
const props = __props;
|
|
3686
|
+
const { $t } = useI18n();
|
|
3687
|
+
const {
|
|
3688
|
+
innerValue,
|
|
3689
|
+
pickerVisible,
|
|
3690
|
+
openPicker,
|
|
3691
|
+
closePicker,
|
|
3692
|
+
inputValue,
|
|
3693
|
+
inputPlaceholder,
|
|
3694
|
+
instance,
|
|
3695
|
+
formItemIsError,
|
|
3696
|
+
onClickConfirm,
|
|
3697
|
+
innerIsFinish,
|
|
3698
|
+
refreshKey,
|
|
3699
|
+
onHiddenPicker
|
|
3700
|
+
} = useFormAreaPicker({
|
|
3701
|
+
props,
|
|
3702
|
+
emit,
|
|
3703
|
+
AreaPicker: PlvAreaPicker
|
|
3704
|
+
});
|
|
3705
|
+
expose(instance);
|
|
3706
|
+
return { __sfc: true, props, emit, $t, innerValue, pickerVisible, openPicker, closePicker, inputValue, inputPlaceholder, instance, formItemIsError, onClickConfirm, innerIsFinish, refreshKey, onHiddenPicker, IarIconArrowDown, MobilePopup, PlvAreaPicker };
|
|
3707
|
+
}
|
|
3708
|
+
});
|
|
3709
|
+
var _sfc_render$9 = function render2() {
|
|
3710
|
+
var _vm = this, _c = _vm._self._c, _setup = _vm._self._setupProxy;
|
|
3711
|
+
return _c("div", { staticClass: "plv-iar-mobile-form-area-picker", class: {
|
|
3712
|
+
"plv-iar-mobile-form-area-picker--error": _setup.formItemIsError
|
|
3713
|
+
} }, [_c("div", { staticClass: "plv-iar-mobile-form-area-picker__body", on: { "click": _setup.openPicker } }, [_c("input", { staticClass: "plv-iar-mobile-form-area-picker__body__input", attrs: { "type": "text", "readonly": "", "placeholder": _setup.inputPlaceholder }, domProps: { "value": _setup.inputValue } }), _c(_setup.IarIconArrowDown, { staticClass: "plv-iar-mobile-form-area-picker__body__icon" })], 1), _c(_setup.MobilePopup, { attrs: { "closeable": false, "fill-body": "" }, on: { "close": _setup.onHiddenPicker }, model: { value: _setup.pickerVisible, callback: function($$v) {
|
|
3714
|
+
_setup.pickerVisible = $$v;
|
|
3715
|
+
}, expression: "pickerVisible" } }, [_c("div", { staticClass: "plv-iar-mobile-form-area-picker__popup" }, [_c("div", { staticClass: "plv-iar-mobile-form-area-picker__header" }, [_c("div", { staticClass: "plv-iar-mobile-form-area-picker__header__cancel", on: { "click": _setup.closePicker } }, [_vm._v(" " + _vm._s(_setup.$t("common.cancel")) + " ")]), _c("div", { staticClass: "plv-iar-mobile-form-area-picker__header__placeholder" }, [_vm._v(_vm._s(_setup.inputPlaceholder))]), _c("div", { staticClass: "plv-iar-mobile-form-area-picker__header__confirm", class: {
|
|
3716
|
+
"plv-iar-mobile-form-area-picker__header__confirm--disabled": !_setup.innerIsFinish
|
|
3717
|
+
}, on: { "click": _setup.onClickConfirm } }, [_vm._v(" " + _vm._s(_setup.$t("common.confirm")) + " ")])]), _c(_setup.PlvAreaPicker, { key: _setup.refreshKey, staticClass: "plv-iar-mobile-form-area-picker__popup__content", model: { value: _setup.innerValue, callback: function($$v) {
|
|
3718
|
+
_setup.innerValue = $$v;
|
|
3719
|
+
}, expression: "innerValue" } })], 1)])], 1);
|
|
3720
|
+
};
|
|
3721
|
+
var _sfc_staticRenderFns$9 = [];
|
|
3722
|
+
var __component__$9 = /* @__PURE__ */ normalizeComponent(
|
|
3723
|
+
_sfc_main$9,
|
|
3724
|
+
_sfc_render$9,
|
|
3725
|
+
_sfc_staticRenderFns$9
|
|
3726
|
+
);
|
|
3727
|
+
const IarMobileAreaPicker = __component__$9.exports;
|
|
3728
|
+
const formInputProps = () => ({
|
|
3729
|
+
...formCommonProps(),
|
|
3730
|
+
/** 只读 */
|
|
3731
|
+
readonly: PropUtils.bool.def(false),
|
|
3732
|
+
/** 禁用输入 */
|
|
3733
|
+
disabled: PropUtils.bool.def(false),
|
|
3734
|
+
/** 绑定值 */
|
|
3735
|
+
value: PropUtils.oneOfType([String, Number]).def(""),
|
|
3736
|
+
/** 输入框原生类型 */
|
|
3737
|
+
type: PropUtils.string.def("text"),
|
|
3738
|
+
/** 输入框占位 */
|
|
3739
|
+
placeholder: PropUtils.string.def(""),
|
|
3740
|
+
/** 最大长度 */
|
|
3741
|
+
maxlength: PropUtils.number.def(Infinity),
|
|
3742
|
+
/** 显示字数限制,默认:false */
|
|
3743
|
+
showWordLimit: PropUtils.bool.def(false),
|
|
3744
|
+
/** 尾部文字 */
|
|
3745
|
+
suffixText: PropUtils.string.def(""),
|
|
3746
|
+
/** 清空,PC 端默认 true,移动端默认 false */
|
|
3747
|
+
clearabled: PropUtils.bool.def(false),
|
|
3748
|
+
/** 使用 textarea */
|
|
3749
|
+
useTextarea: PropUtils.bool.def(false),
|
|
3750
|
+
/** 行数 */
|
|
3751
|
+
rows: PropUtils.number.def(4),
|
|
3752
|
+
/** 输入框标题,仅移动端下适用 */
|
|
3753
|
+
inputTitle: PropUtils.string.def(""),
|
|
3754
|
+
/** 输入框标题宽度,仅移动端下适用 */
|
|
3755
|
+
inputTitleWidth: PropUtils.number.def(void 0)
|
|
3756
|
+
});
|
|
3757
|
+
const formInputEmits = () => ({
|
|
3758
|
+
input: emitFunc(),
|
|
3759
|
+
/** 失焦 */
|
|
3760
|
+
blur: emitFunc(),
|
|
3761
|
+
/** 聚焦 */
|
|
3762
|
+
focus: emitFunc(),
|
|
3763
|
+
/** 回车事件 */
|
|
3764
|
+
enter: emitFunc()
|
|
3765
|
+
});
|
|
3766
|
+
const useFormInput = (options) => {
|
|
3767
|
+
const { emit, props, classPrefix } = options;
|
|
3768
|
+
const { blurToValidateItem, focusToRemoveError, formItemIsError } = useFormCommonValidate({
|
|
3769
|
+
props
|
|
3770
|
+
});
|
|
3771
|
+
const { commonClassNames } = useFormCommon({
|
|
3772
|
+
props,
|
|
3773
|
+
classPrefix
|
|
3774
|
+
});
|
|
3775
|
+
const inputRef = ref();
|
|
3776
|
+
const isFocus = ref(false);
|
|
3777
|
+
const inputClassNames = computed(() => {
|
|
3778
|
+
const classNames = [...unref(commonClassNames)];
|
|
3779
|
+
if (unref(formItemIsError)) {
|
|
3780
|
+
classNames.push(`${classPrefix}--error`);
|
|
3781
|
+
}
|
|
3782
|
+
if (props.useTextarea) {
|
|
3783
|
+
classNames.push(`${classPrefix}--textarea`);
|
|
3784
|
+
}
|
|
3785
|
+
return classNames;
|
|
3786
|
+
});
|
|
3787
|
+
const wordLimitText = computed(() => {
|
|
3788
|
+
if (!props.showWordLimit) {
|
|
3789
|
+
return "";
|
|
3790
|
+
}
|
|
3791
|
+
const length = `${props.value ?? ""}`.length;
|
|
3792
|
+
if (props.maxlength === Infinity) {
|
|
3793
|
+
return `${length}`;
|
|
3794
|
+
}
|
|
3795
|
+
return `${length}/${props.maxlength}`;
|
|
3796
|
+
});
|
|
3797
|
+
function clearValue() {
|
|
3798
|
+
emit("input", "");
|
|
3799
|
+
focusInput();
|
|
3800
|
+
}
|
|
3801
|
+
function onInputChanged(event) {
|
|
3802
|
+
const target = event.target;
|
|
3803
|
+
let value = target.value;
|
|
3804
|
+
if (props.type === "number") {
|
|
3805
|
+
value = value.slice(0, props.maxlength);
|
|
3806
|
+
if (inputRef.value) {
|
|
3807
|
+
inputRef.value.setAttribute("value", value);
|
|
3808
|
+
}
|
|
3809
|
+
}
|
|
3810
|
+
emit("input", value);
|
|
3811
|
+
}
|
|
3812
|
+
function onInputBlur() {
|
|
3813
|
+
isFocus.value = false;
|
|
3814
|
+
blurToValidateItem();
|
|
3815
|
+
emit("blur", props.value);
|
|
3816
|
+
}
|
|
3817
|
+
function onInputFocus() {
|
|
3818
|
+
isFocus.value = true;
|
|
3819
|
+
focusToRemoveError();
|
|
3820
|
+
emit("focus", props.value);
|
|
3821
|
+
}
|
|
3822
|
+
function onInputEnter() {
|
|
3823
|
+
emit("enter", props.value);
|
|
3824
|
+
}
|
|
3825
|
+
const { getInstance } = useVue();
|
|
3826
|
+
function forceUpdate() {
|
|
3827
|
+
const instance = getInstance();
|
|
3828
|
+
instance == null ? void 0 : instance.$forceUpdate();
|
|
3829
|
+
}
|
|
3830
|
+
function focusInput() {
|
|
3831
|
+
var _a;
|
|
3832
|
+
(_a = inputRef.value) == null ? void 0 : _a.focus();
|
|
3833
|
+
}
|
|
3834
|
+
function blurInput() {
|
|
3835
|
+
var _a;
|
|
3836
|
+
(_a = inputRef.value) == null ? void 0 : _a.blur();
|
|
3837
|
+
}
|
|
3838
|
+
const formInstance = {
|
|
3839
|
+
forceUpdate,
|
|
3840
|
+
focusInput,
|
|
3841
|
+
blurInput
|
|
3842
|
+
};
|
|
3843
|
+
return {
|
|
3844
|
+
inputRef,
|
|
3845
|
+
inputClassNames,
|
|
3846
|
+
isFocus,
|
|
3847
|
+
onInputChanged,
|
|
3848
|
+
onInputBlur,
|
|
3849
|
+
onInputFocus,
|
|
3850
|
+
onInputEnter,
|
|
3851
|
+
clearValue,
|
|
3852
|
+
formInstance,
|
|
3853
|
+
wordLimitText
|
|
3854
|
+
};
|
|
3855
|
+
};
|
|
3856
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
3857
|
+
__name: "mobile-form-input",
|
|
3858
|
+
props: formInputProps(),
|
|
3859
|
+
emits: formInputEmits(),
|
|
3860
|
+
setup(__props, { expose, emit }) {
|
|
3861
|
+
const props = __props;
|
|
3862
|
+
const { value, type: type4, placeholder, maxlength, inputTitle } = useProps(props);
|
|
3863
|
+
const {
|
|
3864
|
+
inputRef,
|
|
3865
|
+
inputClassNames,
|
|
3866
|
+
onInputChanged,
|
|
3867
|
+
onInputBlur,
|
|
3868
|
+
onInputFocus,
|
|
3869
|
+
formInstance,
|
|
3870
|
+
wordLimitText,
|
|
3871
|
+
clearValue,
|
|
3872
|
+
isFocus
|
|
3873
|
+
} = useFormInput({
|
|
3874
|
+
props,
|
|
3875
|
+
emit,
|
|
3876
|
+
classPrefix: "plv-iar-mobile-form-input"
|
|
3877
|
+
});
|
|
3878
|
+
expose(formInstance);
|
|
3879
|
+
return { __sfc: true, emit, props, value, type: type4, placeholder, maxlength, inputTitle, inputRef, inputClassNames, onInputChanged, onInputBlur, onInputFocus, formInstance, wordLimitText, clearValue, isFocus, IarIconCloseRoundFill };
|
|
3880
|
+
}
|
|
3881
|
+
});
|
|
3882
|
+
var _sfc_render$8 = function render3() {
|
|
3883
|
+
var _vm = this, _c = _vm._self._c, _setup = _vm._self._setupProxy;
|
|
3884
|
+
return _c("div", { staticClass: "plv-iar-mobile-form-input", class: _setup.inputClassNames }, [_c("div", { staticClass: "plv-iar-mobile-form-input__main", class: {
|
|
3885
|
+
"plv-iar-mobile-form-input__main--has-title": _setup.inputTitle
|
|
3886
|
+
} }, [_vm._t("prefix"), _c("div", { staticClass: "plv-iar-mobile-form-input__main__input" }, [!_vm.useTextarea ? _c("input", { ref: "inputRef", staticClass: "plv-iar-mobile-form-input__main__input__inner", attrs: { "type": _setup.type, "placeholder": _setup.placeholder, "maxlength": _setup.maxlength, "disabled": _vm.disabled, "readonly": _vm.readonly }, domProps: { "value": _setup.value }, on: { "input": _setup.onInputChanged, "blur": _setup.onInputBlur, "focus": _setup.onInputFocus } }) : _c("textarea", { ref: "inputRef", staticClass: "plv-iar-mobile-form-input__main__input__inner", attrs: { "type": _setup.type, "placeholder": _setup.placeholder, "maxlength": _setup.maxlength, "disabled": _vm.disabled, "readonly": _vm.readonly, "rows": _vm.rows }, domProps: { "value": _setup.value }, on: { "input": _setup.onInputChanged, "blur": _setup.onInputBlur, "focus": _setup.onInputFocus } })]), _vm.clearabled && _setup.value && _setup.isFocus ? [_c(_setup.IarIconCloseRoundFill, { staticClass: "plv-iar-mobile-form-input__main__input__clearabled", nativeOn: { "touchstart": function($event) {
|
|
3887
|
+
return _setup.clearValue.apply(null, arguments);
|
|
3888
|
+
} } })] : _vm._e(), _vm._t("suffix", function() {
|
|
3889
|
+
return [_vm.suffixText ? _c("span", { staticClass: "plv-iar-mobile-form-input__main__input__suffix-text" }, [_vm._v(" " + _vm._s(_vm.suffixText) + " ")]) : _setup.wordLimitText ? _c("span", { staticClass: "plv-iar-mobile-form-input__main__input__suffix-text" }, [_vm._v(" " + _vm._s(_setup.wordLimitText) + " ")]) : _vm._e()];
|
|
3890
|
+
})], 2)]);
|
|
3891
|
+
};
|
|
3892
|
+
var _sfc_staticRenderFns$8 = [];
|
|
3893
|
+
var __component__$8 = /* @__PURE__ */ normalizeComponent(
|
|
3894
|
+
_sfc_main$8,
|
|
3895
|
+
_sfc_render$8,
|
|
3896
|
+
_sfc_staticRenderFns$8
|
|
3897
|
+
);
|
|
3898
|
+
const IarMobileInput = __component__$8.exports;
|
|
3899
|
+
const formCheckboxProps = () => ({
|
|
3900
|
+
/** 使用圆形样式 */
|
|
3901
|
+
circle: PropUtils.bool.def(false),
|
|
3902
|
+
/** 是否选中,支持.sync */
|
|
3903
|
+
checked: PropUtils.bool.def(false)
|
|
3904
|
+
});
|
|
3905
|
+
const formCheckboxEmits = () => ({
|
|
3906
|
+
...updateModelEmit("checked"),
|
|
3907
|
+
change: emitFunc()
|
|
3908
|
+
});
|
|
3909
|
+
const useFormCheckbox = (options) => {
|
|
3910
|
+
const { props, emit } = options;
|
|
3911
|
+
const isChecked = computed(() => props.checked);
|
|
3912
|
+
function onClickCheckbox() {
|
|
3913
|
+
emit("update:checked", !unref(isChecked));
|
|
3914
|
+
emit("change", !unref(isChecked));
|
|
3915
|
+
}
|
|
3916
|
+
return {
|
|
3917
|
+
isChecked,
|
|
3918
|
+
onClickCheckbox
|
|
3919
|
+
};
|
|
3920
|
+
};
|
|
3921
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
3922
|
+
__name: "mobile-form-checkbox",
|
|
3923
|
+
props: formCheckboxProps(),
|
|
3924
|
+
emits: formCheckboxEmits(),
|
|
3925
|
+
setup(__props, { emit }) {
|
|
3926
|
+
const props = __props;
|
|
3927
|
+
const { isChecked, onClickCheckbox } = useFormCheckbox({
|
|
3928
|
+
props,
|
|
3929
|
+
emit
|
|
3930
|
+
});
|
|
3931
|
+
return { __sfc: true, props, emit, isChecked, onClickCheckbox, IarIconCheck };
|
|
3932
|
+
}
|
|
3933
|
+
});
|
|
3934
|
+
var _sfc_render$7 = function render4() {
|
|
3935
|
+
var _vm = this, _c = _vm._self._c, _setup = _vm._self._setupProxy;
|
|
3936
|
+
return _c("div", { staticClass: "plv-iar-mobile-form-checkbox", class: {
|
|
3937
|
+
"is-checked": _setup.isChecked
|
|
3938
|
+
} }, [_c("div", { staticClass: "plv-iar-mobile-form-checkbox__inner", class: {
|
|
3939
|
+
"plv-iar-mobile-form-checkbox__inner__circle": _setup.props.circle
|
|
3940
|
+
}, on: { "click": _setup.onClickCheckbox } }, [_c(_setup.IarIconCheck, { staticClass: "plv-iar-mobile-form-checkbox__inner__icon" })], 1), _c("div", { staticClass: "plv-iar-mobile-form-checkbox__content" }, [_vm._t("default")], 2)]);
|
|
3941
|
+
};
|
|
3942
|
+
var _sfc_staticRenderFns$7 = [];
|
|
3943
|
+
var __component__$7 = /* @__PURE__ */ normalizeComponent(
|
|
3944
|
+
_sfc_main$7,
|
|
3945
|
+
_sfc_render$7,
|
|
3946
|
+
_sfc_staticRenderFns$7
|
|
3947
|
+
);
|
|
3948
|
+
const MobileFormCheckbox = __component__$7.exports;
|
|
3949
|
+
const formProtocolProps = () => ({
|
|
3950
|
+
/** 是否选中 */
|
|
3951
|
+
value: PropUtils.bool.def(false),
|
|
3952
|
+
/** 协议内容 */
|
|
3953
|
+
content: PropUtils.string
|
|
3954
|
+
});
|
|
3955
|
+
const formProtocolEmits = () => ({
|
|
3956
|
+
input: emitFunc()
|
|
3957
|
+
});
|
|
3958
|
+
const useFormProtocol = (options) => {
|
|
3959
|
+
const { props, emit, onProtocolClick } = options;
|
|
3960
|
+
const checkboxChecked = computed(() => props.value);
|
|
3961
|
+
function onCheckboxChange(checked) {
|
|
3962
|
+
emit("input", checked);
|
|
3963
|
+
}
|
|
3964
|
+
const protocolContentRef = ref();
|
|
3965
|
+
const contentHtml = computed(() => props.content);
|
|
3966
|
+
onMounted(() => {
|
|
3967
|
+
const protocolContent = protocolContentRef.value;
|
|
3968
|
+
if (!protocolContent) return;
|
|
3969
|
+
protocolContent.querySelectorAll("a").forEach((a2) => {
|
|
3970
|
+
a2.addEventListener("click", (event) => {
|
|
3971
|
+
const isHttps = a2.href.includes("https://");
|
|
3972
|
+
if (!isHttps) {
|
|
3973
|
+
console.warn("需要使用 http 协议的链接");
|
|
3974
|
+
return;
|
|
3975
|
+
}
|
|
3976
|
+
event.preventDefault();
|
|
3977
|
+
onProtocolClick(event.target);
|
|
3978
|
+
});
|
|
3979
|
+
});
|
|
3980
|
+
});
|
|
3981
|
+
return {
|
|
3982
|
+
checkboxChecked,
|
|
3983
|
+
onCheckboxChange,
|
|
3984
|
+
protocolContentRef,
|
|
3985
|
+
contentHtml
|
|
3986
|
+
};
|
|
3987
|
+
};
|
|
3988
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
3989
|
+
__name: "mobile-form-protocol",
|
|
3990
|
+
props: formProtocolProps(),
|
|
3991
|
+
emits: formProtocolEmits(),
|
|
3992
|
+
setup(__props, { expose, emit }) {
|
|
3993
|
+
const props = __props;
|
|
3994
|
+
const attrs = useAttrs();
|
|
3995
|
+
function openProtocol(el) {
|
|
3996
|
+
window.open(el.href, "_blank");
|
|
3997
|
+
}
|
|
3998
|
+
const {
|
|
3999
|
+
checkboxChecked,
|
|
4000
|
+
onCheckboxChange,
|
|
4001
|
+
protocolContentRef,
|
|
4002
|
+
contentHtml
|
|
4003
|
+
} = useFormProtocol({
|
|
4004
|
+
props,
|
|
4005
|
+
emit,
|
|
4006
|
+
onProtocolClick: (el) => {
|
|
4007
|
+
openProtocol(el);
|
|
4008
|
+
}
|
|
4009
|
+
});
|
|
4010
|
+
expose({
|
|
4011
|
+
openProtocol
|
|
4012
|
+
});
|
|
4013
|
+
return { __sfc: true, props, emit, attrs, openProtocol, checkboxChecked, onCheckboxChange, protocolContentRef, contentHtml, MobileFormCheckbox };
|
|
4014
|
+
}
|
|
4015
|
+
});
|
|
4016
|
+
var _sfc_render$6 = function render5() {
|
|
4017
|
+
var _vm = this, _c = _vm._self._c, _setup = _vm._self._setupProxy;
|
|
4018
|
+
return _c("div", { staticClass: "c-mobile-form-protocol" }, [_vm._t("checkbox-label"), _c(_setup.MobileFormCheckbox, _vm._b({ attrs: { "checked": _setup.checkboxChecked }, on: { "change": _setup.onCheckboxChange } }, "mobile-form-checkbox", _setup.attrs, false), [_c("div", { ref: "protocolContentRef", staticClass: "c-mobile-form-protocol__content", domProps: { "innerHTML": _vm._s(_setup.contentHtml) } })])], 2);
|
|
4019
|
+
};
|
|
4020
|
+
var _sfc_staticRenderFns$6 = [];
|
|
4021
|
+
var __component__$6 = /* @__PURE__ */ normalizeComponent(
|
|
4022
|
+
_sfc_main$6,
|
|
4023
|
+
_sfc_render$6,
|
|
4024
|
+
_sfc_staticRenderFns$6
|
|
4025
|
+
);
|
|
4026
|
+
const IarMobileProtocol = __component__$6.exports;
|
|
4027
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
4028
|
+
__name: "form-item",
|
|
4029
|
+
props: formItemProps(),
|
|
4030
|
+
setup(__props, { expose }) {
|
|
4031
|
+
const props = __props;
|
|
4032
|
+
const {
|
|
4033
|
+
required: required4,
|
|
4034
|
+
labelText,
|
|
4035
|
+
labelModel,
|
|
4036
|
+
labelStyle,
|
|
4037
|
+
itemErrorMessage,
|
|
4038
|
+
contentWidthStyle,
|
|
4039
|
+
formItemIsError,
|
|
4040
|
+
formItemInstance
|
|
4041
|
+
} = useFormItem({
|
|
4042
|
+
props
|
|
4043
|
+
});
|
|
4044
|
+
expose(formItemInstance);
|
|
4045
|
+
return { __sfc: true, props, required: required4, labelText, labelModel, labelStyle, itemErrorMessage, contentWidthStyle, formItemIsError, formItemInstance, isMobile };
|
|
4046
|
+
}
|
|
4047
|
+
});
|
|
4048
|
+
var _sfc_render$5 = function render6() {
|
|
4049
|
+
var _vm = this, _c = _vm._self._c, _setup = _vm._self._setupProxy;
|
|
4050
|
+
return _c("div", { staticClass: "plv-iar-form-item", class: {
|
|
4051
|
+
"plv-iar-form-item--header": _setup.labelModel === "header",
|
|
4052
|
+
"plv-iar-form-item--mobile": _setup.isMobile
|
|
4053
|
+
} }, [_setup.formItemIsError ? _c("div", { staticClass: "plv-iar-form-item__anchor", attrs: { "data-form-item-error": "" } }) : _vm._e(), _setup.labelText ? _c("div", { staticClass: "plv-iar-form-item__label", style: _setup.labelStyle }, [_setup.required ? _c("span", { staticClass: "plv-iar-form-item__label__required" }, [_vm._v(" * ")]) : _vm._e(), _vm._v(" " + _vm._s(_setup.labelText) + " ")]) : _vm._e(), _c("div", { staticClass: "plv-iar-form-item__content", class: {
|
|
4054
|
+
"plv-iar-form-item__content--has-width": !!_setup.contentWidthStyle
|
|
4055
|
+
}, style: {
|
|
4056
|
+
width: _setup.contentWidthStyle
|
|
4057
|
+
} }, [_vm._t("default"), _setup.itemErrorMessage ? _c("div", { staticClass: "plv-iar-form-item__content__error" }, [_vm._v(" " + _vm._s(_setup.itemErrorMessage) + " ")]) : _vm._e()], 2)]);
|
|
4058
|
+
};
|
|
4059
|
+
var _sfc_staticRenderFns$5 = [];
|
|
4060
|
+
var __component__$5 = /* @__PURE__ */ normalizeComponent(
|
|
4061
|
+
_sfc_main$5,
|
|
4062
|
+
_sfc_render$5,
|
|
4063
|
+
_sfc_staticRenderFns$5
|
|
4064
|
+
);
|
|
4065
|
+
const IarFormItem = __component__$5.exports;
|
|
4066
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
4067
|
+
__name: "iar-button",
|
|
4068
|
+
props: iarButtonProps(),
|
|
4069
|
+
emits: iarButtonEmits(),
|
|
4070
|
+
setup(__props, { emit }) {
|
|
4071
|
+
const props = __props;
|
|
4072
|
+
const { onClick } = useIarButton({ props, emit });
|
|
4073
|
+
return { __sfc: true, props, emit, onClick };
|
|
4074
|
+
}
|
|
4075
|
+
});
|
|
4076
|
+
var _sfc_render$4 = function render7() {
|
|
4077
|
+
var _vm = this, _c = _vm._self._c, _setup = _vm._self._setupProxy;
|
|
4078
|
+
return _c("button", { staticClass: "plv-iar-button", class: {
|
|
4079
|
+
["plv-iar-button--type-" + _vm.type]: true,
|
|
4080
|
+
["plv-iar-button--size-" + _vm.size]: true,
|
|
4081
|
+
"is-outline": _vm.outline,
|
|
4082
|
+
"is-disabled": _vm.disabled
|
|
4083
|
+
}, on: { "click": _setup.onClick } }, [_vm._t("default")], 2);
|
|
4084
|
+
};
|
|
4085
|
+
var _sfc_staticRenderFns$4 = [];
|
|
4086
|
+
var __component__$4 = /* @__PURE__ */ normalizeComponent(
|
|
4087
|
+
_sfc_main$4,
|
|
4088
|
+
_sfc_render$4,
|
|
4089
|
+
_sfc_staticRenderFns$4
|
|
4090
|
+
);
|
|
4091
|
+
const IarButton = __component__$4.exports;
|
|
4092
|
+
function isObject(value) {
|
|
4093
|
+
var type4 = typeof value;
|
|
4094
|
+
return value != null && (type4 == "object" || type4 == "function");
|
|
4095
|
+
}
|
|
4096
|
+
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
4097
|
+
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
4098
|
+
var root = freeGlobal || freeSelf || Function("return this")();
|
|
4099
|
+
var now = function() {
|
|
4100
|
+
return root.Date.now();
|
|
4101
|
+
};
|
|
4102
|
+
var reWhitespace = /\s/;
|
|
4103
|
+
function trimmedEndIndex(string3) {
|
|
4104
|
+
var index = string3.length;
|
|
4105
|
+
while (index-- && reWhitespace.test(string3.charAt(index))) {
|
|
4106
|
+
}
|
|
4107
|
+
return index;
|
|
4108
|
+
}
|
|
4109
|
+
var reTrimStart = /^\s+/;
|
|
4110
|
+
function baseTrim(string3) {
|
|
4111
|
+
return string3 ? string3.slice(0, trimmedEndIndex(string3) + 1).replace(reTrimStart, "") : string3;
|
|
4112
|
+
}
|
|
4113
|
+
var Symbol$1 = root.Symbol;
|
|
4114
|
+
var objectProto$1 = Object.prototype;
|
|
4115
|
+
var hasOwnProperty = objectProto$1.hasOwnProperty;
|
|
4116
|
+
var nativeObjectToString$1 = objectProto$1.toString;
|
|
4117
|
+
var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : void 0;
|
|
4118
|
+
function getRawTag(value) {
|
|
4119
|
+
var isOwn = hasOwnProperty.call(value, symToStringTag$1), tag = value[symToStringTag$1];
|
|
4120
|
+
try {
|
|
4121
|
+
value[symToStringTag$1] = void 0;
|
|
4122
|
+
var unmasked = true;
|
|
4123
|
+
} catch (e) {
|
|
4124
|
+
}
|
|
4125
|
+
var result = nativeObjectToString$1.call(value);
|
|
4126
|
+
if (unmasked) {
|
|
4127
|
+
if (isOwn) {
|
|
4128
|
+
value[symToStringTag$1] = tag;
|
|
4129
|
+
} else {
|
|
4130
|
+
delete value[symToStringTag$1];
|
|
4131
|
+
}
|
|
4132
|
+
}
|
|
4133
|
+
return result;
|
|
4134
|
+
}
|
|
4135
|
+
var objectProto = Object.prototype;
|
|
4136
|
+
var nativeObjectToString = objectProto.toString;
|
|
4137
|
+
function objectToString(value) {
|
|
4138
|
+
return nativeObjectToString.call(value);
|
|
4139
|
+
}
|
|
4140
|
+
var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
|
|
4141
|
+
var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : void 0;
|
|
4142
|
+
function baseGetTag(value) {
|
|
4143
|
+
if (value == null) {
|
|
4144
|
+
return value === void 0 ? undefinedTag : nullTag;
|
|
4145
|
+
}
|
|
4146
|
+
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
|
|
4147
|
+
}
|
|
4148
|
+
function isObjectLike(value) {
|
|
4149
|
+
return value != null && typeof value == "object";
|
|
4150
|
+
}
|
|
4151
|
+
var symbolTag = "[object Symbol]";
|
|
4152
|
+
function isSymbol(value) {
|
|
4153
|
+
return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
|
|
4154
|
+
}
|
|
4155
|
+
var NAN = 0 / 0;
|
|
4156
|
+
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
4157
|
+
var reIsBinary = /^0b[01]+$/i;
|
|
4158
|
+
var reIsOctal = /^0o[0-7]+$/i;
|
|
4159
|
+
var freeParseInt = parseInt;
|
|
4160
|
+
function toNumber(value) {
|
|
4161
|
+
if (typeof value == "number") {
|
|
4162
|
+
return value;
|
|
4163
|
+
}
|
|
4164
|
+
if (isSymbol(value)) {
|
|
4165
|
+
return NAN;
|
|
4166
|
+
}
|
|
4167
|
+
if (isObject(value)) {
|
|
4168
|
+
var other = typeof value.valueOf == "function" ? value.valueOf() : value;
|
|
4169
|
+
value = isObject(other) ? other + "" : other;
|
|
4170
|
+
}
|
|
4171
|
+
if (typeof value != "string") {
|
|
4172
|
+
return value === 0 ? value : +value;
|
|
4173
|
+
}
|
|
4174
|
+
value = baseTrim(value);
|
|
4175
|
+
var isBinary = reIsBinary.test(value);
|
|
4176
|
+
return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
|
|
4177
|
+
}
|
|
4178
|
+
var FUNC_ERROR_TEXT = "Expected a function";
|
|
4179
|
+
var nativeMax = Math.max, nativeMin = Math.min;
|
|
4180
|
+
function debounce(func, wait, options) {
|
|
4181
|
+
var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
|
|
4182
|
+
if (typeof func != "function") {
|
|
4183
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
4184
|
+
}
|
|
4185
|
+
wait = toNumber(wait) || 0;
|
|
4186
|
+
if (isObject(options)) {
|
|
4187
|
+
leading = !!options.leading;
|
|
4188
|
+
maxing = "maxWait" in options;
|
|
4189
|
+
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
|
4190
|
+
trailing = "trailing" in options ? !!options.trailing : trailing;
|
|
4191
|
+
}
|
|
4192
|
+
function invokeFunc(time) {
|
|
4193
|
+
var args = lastArgs, thisArg = lastThis;
|
|
4194
|
+
lastArgs = lastThis = void 0;
|
|
4195
|
+
lastInvokeTime = time;
|
|
4196
|
+
result = func.apply(thisArg, args);
|
|
4197
|
+
return result;
|
|
4198
|
+
}
|
|
4199
|
+
function leadingEdge(time) {
|
|
4200
|
+
lastInvokeTime = time;
|
|
4201
|
+
timerId = setTimeout(timerExpired, wait);
|
|
4202
|
+
return leading ? invokeFunc(time) : result;
|
|
4203
|
+
}
|
|
4204
|
+
function remainingWait(time) {
|
|
4205
|
+
var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
|
|
4206
|
+
return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
|
|
4207
|
+
}
|
|
4208
|
+
function shouldInvoke(time) {
|
|
4209
|
+
var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
|
|
4210
|
+
return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
|
|
4211
|
+
}
|
|
4212
|
+
function timerExpired() {
|
|
4213
|
+
var time = now();
|
|
4214
|
+
if (shouldInvoke(time)) {
|
|
4215
|
+
return trailingEdge(time);
|
|
4216
|
+
}
|
|
4217
|
+
timerId = setTimeout(timerExpired, remainingWait(time));
|
|
4218
|
+
}
|
|
4219
|
+
function trailingEdge(time) {
|
|
4220
|
+
timerId = void 0;
|
|
4221
|
+
if (trailing && lastArgs) {
|
|
4222
|
+
return invokeFunc(time);
|
|
4223
|
+
}
|
|
4224
|
+
lastArgs = lastThis = void 0;
|
|
4225
|
+
return result;
|
|
4226
|
+
}
|
|
4227
|
+
function cancel() {
|
|
4228
|
+
if (timerId !== void 0) {
|
|
4229
|
+
clearTimeout(timerId);
|
|
4230
|
+
}
|
|
4231
|
+
lastInvokeTime = 0;
|
|
4232
|
+
lastArgs = lastCallTime = lastThis = timerId = void 0;
|
|
4233
|
+
}
|
|
4234
|
+
function flush() {
|
|
4235
|
+
return timerId === void 0 ? result : trailingEdge(now());
|
|
4236
|
+
}
|
|
4237
|
+
function debounced() {
|
|
4238
|
+
var time = now(), isInvoking = shouldInvoke(time);
|
|
4239
|
+
lastArgs = arguments;
|
|
4240
|
+
lastThis = this;
|
|
4241
|
+
lastCallTime = time;
|
|
4242
|
+
if (isInvoking) {
|
|
4243
|
+
if (timerId === void 0) {
|
|
4244
|
+
return leadingEdge(lastCallTime);
|
|
4245
|
+
}
|
|
4246
|
+
if (maxing) {
|
|
4247
|
+
clearTimeout(timerId);
|
|
4248
|
+
timerId = setTimeout(timerExpired, wait);
|
|
4249
|
+
return invokeFunc(lastCallTime);
|
|
4250
|
+
}
|
|
4251
|
+
}
|
|
4252
|
+
if (timerId === void 0) {
|
|
4253
|
+
timerId = setTimeout(timerExpired, wait);
|
|
4254
|
+
}
|
|
4255
|
+
return result;
|
|
4256
|
+
}
|
|
4257
|
+
debounced.cancel = cancel;
|
|
4258
|
+
debounced.flush = flush;
|
|
4259
|
+
return debounced;
|
|
4260
|
+
}
|
|
4261
|
+
const formSubmitButtonProps = () => ({
|
|
4262
|
+
...iarButtonProps(),
|
|
4263
|
+
text: PropUtils.string.def(""),
|
|
4264
|
+
/** 防抖提交,默认:false */
|
|
4265
|
+
debounceSubmit: PropUtils.bool.def(false)
|
|
4266
|
+
});
|
|
4267
|
+
const useFormSubmitButton = (options) => {
|
|
4268
|
+
const props = options.props;
|
|
4269
|
+
const formProps = useFormWrapPropsInject();
|
|
4270
|
+
const formCtx = useFormWrapInject();
|
|
4271
|
+
const isDisabledByFormCtx = ref(false);
|
|
4272
|
+
async function checkDisabled() {
|
|
4273
|
+
let isDisabled = false;
|
|
4274
|
+
if (!formCtx) {
|
|
4275
|
+
return;
|
|
4276
|
+
}
|
|
4277
|
+
if (unref(formCtx.isSubmiting)) {
|
|
4278
|
+
isDisabled = true;
|
|
4279
|
+
isDisabledByFormCtx.value = isDisabled;
|
|
4280
|
+
return;
|
|
4281
|
+
}
|
|
4282
|
+
try {
|
|
4283
|
+
if (formCtx.validateCurrentForm) {
|
|
4284
|
+
await formCtx.validateCurrentForm({
|
|
4285
|
+
showErrorMessage: false
|
|
4286
|
+
});
|
|
4287
|
+
}
|
|
4288
|
+
} catch (e) {
|
|
4289
|
+
if (unref(formCtx.debug)) {
|
|
4290
|
+
console.error("form-submit-button-error", e);
|
|
4291
|
+
}
|
|
4292
|
+
isDisabled = true;
|
|
4293
|
+
}
|
|
4294
|
+
isDisabledByFormCtx.value = isDisabled;
|
|
4295
|
+
}
|
|
4296
|
+
const buttonIsDisabled = computed(() => {
|
|
4297
|
+
return props.disabled || isDisabledByFormCtx.value;
|
|
4298
|
+
});
|
|
4299
|
+
watch(
|
|
4300
|
+
() => {
|
|
4301
|
+
return [formProps && formProps.formData, formCtx && unref(formCtx.isSubmiting)];
|
|
4302
|
+
},
|
|
4303
|
+
() => checkDisabled(),
|
|
4304
|
+
{
|
|
4305
|
+
immediate: true,
|
|
4306
|
+
deep: true
|
|
4307
|
+
}
|
|
4308
|
+
);
|
|
4309
|
+
const triggerSubmitForm = () => {
|
|
4310
|
+
if (formCtx && formCtx.validateCurrentForm) {
|
|
4311
|
+
formCtx.validateCurrentForm({
|
|
4312
|
+
showErrorMessage: true
|
|
4313
|
+
}).catch((err) => {
|
|
4314
|
+
console.error("validateCurrentForm Err", err);
|
|
4315
|
+
nextTick(() => {
|
|
4316
|
+
const $formErrDom = document.querySelector("[data-form-item-error]") || void 0;
|
|
4317
|
+
$formErrDom && $formErrDom.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
4318
|
+
});
|
|
4319
|
+
});
|
|
4320
|
+
}
|
|
4321
|
+
if (buttonIsDisabled.value) {
|
|
4322
|
+
return;
|
|
4323
|
+
}
|
|
4324
|
+
formCtx && formCtx.submitForm();
|
|
4325
|
+
};
|
|
4326
|
+
const debounceTriggerSubmitForm = debounce(triggerSubmitForm, 500);
|
|
4327
|
+
function onButtonClick() {
|
|
4328
|
+
if (props.debounceSubmit) {
|
|
4329
|
+
debounceTriggerSubmitForm();
|
|
4330
|
+
} else {
|
|
4331
|
+
triggerSubmitForm();
|
|
4332
|
+
}
|
|
4333
|
+
}
|
|
4334
|
+
return {
|
|
4335
|
+
buttonIsDisabled,
|
|
4336
|
+
checkDisabled,
|
|
4337
|
+
onButtonClick
|
|
4338
|
+
};
|
|
4339
|
+
};
|
|
4340
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
4341
|
+
__name: "form-submit-button",
|
|
4342
|
+
props: formSubmitButtonProps(),
|
|
4343
|
+
setup(__props) {
|
|
4344
|
+
const props = __props;
|
|
4345
|
+
const { buttonIsDisabled, onButtonClick } = useFormSubmitButton({
|
|
4346
|
+
props
|
|
4347
|
+
});
|
|
4348
|
+
return { __sfc: true, props, buttonIsDisabled, onButtonClick, IarButton };
|
|
4349
|
+
}
|
|
4350
|
+
});
|
|
4351
|
+
var _sfc_render$3 = function render8() {
|
|
4352
|
+
var _vm = this, _c = _vm._self._c, _setup = _vm._self._setupProxy;
|
|
4353
|
+
return _c(_setup.IarButton, { attrs: { "type": _vm.type, "size": _vm.size, "disabled": _setup.buttonIsDisabled }, on: { "click": _setup.onButtonClick } }, [_vm._v(_vm._s(_vm.text))]);
|
|
4354
|
+
};
|
|
4355
|
+
var _sfc_staticRenderFns$3 = [];
|
|
4356
|
+
var __component__$3 = /* @__PURE__ */ normalizeComponent(
|
|
4357
|
+
_sfc_main$3,
|
|
4358
|
+
_sfc_render$3,
|
|
4359
|
+
_sfc_staticRenderFns$3
|
|
4360
|
+
);
|
|
4361
|
+
const IarFormSubmitButton = __component__$3.exports;
|
|
4362
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
4363
|
+
__name: "form-wrap",
|
|
4364
|
+
props: formWrapProps(),
|
|
4365
|
+
emits: formWrapEmits(),
|
|
4366
|
+
setup(__props, { expose, emit }) {
|
|
4367
|
+
const props = __props;
|
|
4368
|
+
const { validateCurrentForm } = useFormWrap({
|
|
4369
|
+
props,
|
|
4370
|
+
emit
|
|
4371
|
+
});
|
|
4372
|
+
expose({
|
|
4373
|
+
validateCurrentForm
|
|
4374
|
+
});
|
|
4375
|
+
return { __sfc: true, props, emit, validateCurrentForm };
|
|
4376
|
+
}
|
|
4377
|
+
});
|
|
4378
|
+
var _sfc_render$2 = function render9() {
|
|
4379
|
+
var _vm = this, _c = _vm._self._c;
|
|
4380
|
+
_vm._self._setupProxy;
|
|
4381
|
+
return _c("div", { staticClass: "plv-iar-form-wrap" }, [_vm._t("default")], 2);
|
|
4382
|
+
};
|
|
4383
|
+
var _sfc_staticRenderFns$2 = [];
|
|
4384
|
+
var __component__$2 = /* @__PURE__ */ normalizeComponent(
|
|
4385
|
+
_sfc_main$2,
|
|
4386
|
+
_sfc_render$2,
|
|
4387
|
+
_sfc_staticRenderFns$2
|
|
4388
|
+
);
|
|
4389
|
+
const IarFormWrap = __component__$2.exports;
|
|
4390
|
+
const zh = {
|
|
4391
|
+
receiveTitleForm: "填写中奖信息",
|
|
4392
|
+
receiveTitleQrcode: "扫码领奖",
|
|
4393
|
+
receiveTitleLink: "打开链接",
|
|
4394
|
+
receiveDesc: "请填写以下信息,后续会有工作人员与您联系",
|
|
4395
|
+
choiceAddress: "选择地区",
|
|
4396
|
+
addressDetail: "详细地址",
|
|
4397
|
+
addressPlaceholder: "请选择地区",
|
|
4398
|
+
qrcodeTips: "长按识别二维码",
|
|
4399
|
+
deadLine: "您已超过填写联系信息的有效期",
|
|
4400
|
+
checkProtocol: "请勾选隐私声明"
|
|
4401
|
+
};
|
|
4402
|
+
const en = {
|
|
4403
|
+
receiveTitleForm: "Fill in the winning information",
|
|
4404
|
+
receiveTitleQrcode: "Scan the code to receive the award",
|
|
4405
|
+
receiveTitleLink: "Open link",
|
|
4406
|
+
receiveDesc: "Please fill in the following information, and a staff member will contact you later",
|
|
4407
|
+
choiceAddress: "Select Region",
|
|
4408
|
+
addressDetail: "Address detail",
|
|
4409
|
+
addressPlaceholder: "Please select region",
|
|
4410
|
+
qrcodeTips: "Long press to recognize QR code",
|
|
4411
|
+
deadLine: "You have exceeded the validity period for filling in contact information",
|
|
4412
|
+
checkProtocol: "Please tick the privacy statement"
|
|
4413
|
+
};
|
|
4414
|
+
const i18nConfig = {
|
|
4415
|
+
key: "rewardReceive",
|
|
4416
|
+
zh,
|
|
4417
|
+
en
|
|
4418
|
+
};
|
|
4419
|
+
function validatePhoneNumber(phoneNumber, areaCode = "+86") {
|
|
4420
|
+
if (areaCode !== "+86") {
|
|
4421
|
+
return /(^\d{5,20}$)/.test(phoneNumber);
|
|
4422
|
+
}
|
|
4423
|
+
return /^1[3-9]\d{9}$/.test(phoneNumber);
|
|
4424
|
+
}
|
|
4425
|
+
const rewardReceiveProps = () => ({
|
|
4426
|
+
/**
|
|
4427
|
+
* 领取数据
|
|
4428
|
+
*/
|
|
4429
|
+
receiveData: PropUtils.object(),
|
|
4430
|
+
/**
|
|
4431
|
+
* 隐私协议内容
|
|
4432
|
+
*/
|
|
4433
|
+
privacyContent: PropUtils.string,
|
|
4434
|
+
/**
|
|
4435
|
+
* 提交操作
|
|
4436
|
+
*/
|
|
4437
|
+
submitAction: PropUtils.func()
|
|
4438
|
+
});
|
|
4439
|
+
const useRewardReceive = (options) => {
|
|
4440
|
+
const { props } = options;
|
|
4441
|
+
const { toast } = useGlobalInject();
|
|
4442
|
+
const currentReceiveData = ref();
|
|
4443
|
+
const visible = ref(false);
|
|
4444
|
+
const isDeadLine = ref(true);
|
|
4445
|
+
const formData = ref({});
|
|
4446
|
+
const formRules = ref({});
|
|
4447
|
+
const { $t } = useI18n(i18nConfig);
|
|
4448
|
+
function setupReceiveData(data) {
|
|
4449
|
+
currentReceiveData.value = data;
|
|
4450
|
+
if (data.receiveType === "form") {
|
|
4451
|
+
initForm(data.formList);
|
|
4452
|
+
if (data.overTime) {
|
|
4453
|
+
isDeadLine.value = new Date(data.overTime) < /* @__PURE__ */ new Date();
|
|
4454
|
+
} else {
|
|
4455
|
+
isDeadLine.value = false;
|
|
4456
|
+
}
|
|
4457
|
+
}
|
|
4458
|
+
if (data.receiveType === "link" && data.linkUrl) {
|
|
4459
|
+
window.open(data.linkUrl, "_blank");
|
|
4460
|
+
return;
|
|
4461
|
+
}
|
|
4462
|
+
visible.value = true;
|
|
4463
|
+
}
|
|
4464
|
+
watch(
|
|
4465
|
+
() => props.receiveData,
|
|
4466
|
+
() => {
|
|
4467
|
+
if (props.receiveData) {
|
|
4468
|
+
setupReceiveData(props.receiveData);
|
|
4469
|
+
}
|
|
4470
|
+
},
|
|
4471
|
+
{
|
|
4472
|
+
immediate: true
|
|
4473
|
+
}
|
|
4474
|
+
);
|
|
4475
|
+
function initForm(formList = []) {
|
|
4476
|
+
const _formData = {};
|
|
4477
|
+
const _formRules = {};
|
|
4478
|
+
formList.forEach((item, index) => {
|
|
4479
|
+
const key = index.toString();
|
|
4480
|
+
if (item.formType === "address") {
|
|
4481
|
+
_formData.areaPickerValue = [];
|
|
4482
|
+
_formData.areaPickerText = [];
|
|
4483
|
+
}
|
|
4484
|
+
_formData[key] = item.value || "";
|
|
4485
|
+
const currentRules = [];
|
|
4486
|
+
if (item.isRequired) {
|
|
4487
|
+
currentRules.push({ type: "string", message: "请完善信息", required: true });
|
|
4488
|
+
if (item.formType === "address") {
|
|
4489
|
+
_formRules.areaPickerValue = [{ type: "array", message: "请完善信息", required: true }];
|
|
4490
|
+
}
|
|
4491
|
+
}
|
|
4492
|
+
if (item.formType === "phone") {
|
|
4493
|
+
currentRules.push({
|
|
4494
|
+
validator: (rule, value) => {
|
|
4495
|
+
if (validatePhoneNumber(value)) {
|
|
4496
|
+
return [];
|
|
4497
|
+
}
|
|
4498
|
+
return ["请输入正确的手机号码"];
|
|
4499
|
+
}
|
|
4500
|
+
});
|
|
4501
|
+
}
|
|
4502
|
+
_formRules[key] = currentRules;
|
|
4503
|
+
});
|
|
4504
|
+
if (props.privacyContent) {
|
|
4505
|
+
_formData.checkProtocol = false;
|
|
4506
|
+
_formRules.checkProtocol = [
|
|
4507
|
+
{
|
|
4508
|
+
validator: (rule, value) => {
|
|
4509
|
+
if (!value) {
|
|
4510
|
+
return [$t("rewardReceive.checkProtocol")];
|
|
4511
|
+
}
|
|
4512
|
+
return [];
|
|
4513
|
+
}
|
|
4514
|
+
}
|
|
4515
|
+
];
|
|
4516
|
+
}
|
|
4517
|
+
formData.value = _formData;
|
|
4518
|
+
formRules.value = _formRules;
|
|
4519
|
+
}
|
|
4520
|
+
const dialogTitle = computed(() => {
|
|
4521
|
+
var _a;
|
|
4522
|
+
switch ((_a = currentReceiveData.value) == null ? void 0 : _a.receiveType) {
|
|
4523
|
+
case "form":
|
|
4524
|
+
return $t("rewardReceive.receiveTitleForm");
|
|
4525
|
+
case "qrCode":
|
|
4526
|
+
return $t("rewardReceive.receiveTitleQrcode");
|
|
4527
|
+
case "link":
|
|
4528
|
+
return $t("rewardReceive.receiveTitleLink");
|
|
4529
|
+
}
|
|
4530
|
+
});
|
|
4531
|
+
async function submitReceiveForm() {
|
|
4532
|
+
var _a;
|
|
4533
|
+
if (!((_a = currentReceiveData.value) == null ? void 0 : _a.formList)) {
|
|
4534
|
+
return;
|
|
4535
|
+
}
|
|
4536
|
+
const _formValue = {};
|
|
4537
|
+
currentReceiveData.value.formList.forEach((item, index) => {
|
|
4538
|
+
let value = formData.value[index];
|
|
4539
|
+
if (item.formType === "address") {
|
|
4540
|
+
value = `${formData.value.areaPickerText.join("")}${value}`;
|
|
4541
|
+
}
|
|
4542
|
+
_formValue[index] = value;
|
|
4543
|
+
});
|
|
4544
|
+
if (props.submitAction) {
|
|
4545
|
+
await props.submitAction(_formValue);
|
|
4546
|
+
}
|
|
4547
|
+
toast($t("common.submitSuccess"));
|
|
4548
|
+
visible.value = false;
|
|
4549
|
+
}
|
|
4550
|
+
const instance = {
|
|
4551
|
+
setupReceiveData
|
|
4552
|
+
};
|
|
4553
|
+
return {
|
|
4554
|
+
currentReceiveData,
|
|
4555
|
+
visible,
|
|
4556
|
+
isDeadLine,
|
|
4557
|
+
dialogTitle,
|
|
4558
|
+
formData,
|
|
4559
|
+
formRules,
|
|
4560
|
+
instance,
|
|
4561
|
+
submitReceiveForm,
|
|
4562
|
+
$t
|
|
4563
|
+
};
|
|
4564
|
+
};
|
|
4565
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
4566
|
+
__name: "mobile-reward-receive",
|
|
4567
|
+
props: rewardReceiveProps(),
|
|
4568
|
+
setup(__props, { expose }) {
|
|
4569
|
+
const props = __props;
|
|
4570
|
+
const {
|
|
4571
|
+
visible,
|
|
4572
|
+
isDeadLine,
|
|
4573
|
+
dialogTitle,
|
|
4574
|
+
formData,
|
|
4575
|
+
formRules,
|
|
4576
|
+
currentReceiveData,
|
|
4577
|
+
submitReceiveForm,
|
|
4578
|
+
instance,
|
|
4579
|
+
$t
|
|
4580
|
+
} = useRewardReceive({
|
|
4581
|
+
props
|
|
4582
|
+
});
|
|
4583
|
+
expose(instance);
|
|
4584
|
+
return { __sfc: true, props, visible, isDeadLine, dialogTitle, formData, formRules, currentReceiveData, submitReceiveForm, instance, $t, IarIconInfoCircleFilled, ButtonSize, ButtonType, IarMobileAreaPicker, IarMobileInput, IarMobileProtocol, IarFormItem, IarFormSubmitButton, IarFormWrap, MobilePopup };
|
|
4585
|
+
}
|
|
4586
|
+
});
|
|
4587
|
+
var _sfc_render$1 = function render10() {
|
|
4588
|
+
var _vm = this, _c = _vm._self._c, _setup = _vm._self._setupProxy;
|
|
4589
|
+
return _c(_setup.MobilePopup, { staticClass: "plv-iar-mobile-reward-receive", attrs: { "title": _setup.dialogTitle, "background": "linear-gradient(138deg, #FFF8EB 0%, #FFEBEB 99%)" }, model: { value: _setup.visible, callback: function($$v) {
|
|
4590
|
+
_setup.visible = $$v;
|
|
4591
|
+
}, expression: "visible" } }, [_setup.currentReceiveData ? [_setup.currentReceiveData.receiveType === "form" ? [!_setup.currentReceiveData.isReceived && _setup.isDeadLine ? [_c("div", { staticClass: "plv-iar-mobile-reward-receive__deadline" }, [_c(_setup.IarIconInfoCircleFilled, { staticClass: "plv-iar-mobile-reward-receive__deadline__icon" }), _c("span", { staticClass: "plv-iar-mobile-reward-receive__deadlin__tips" }, [_vm._v(_vm._s(_setup.$t("rewardReceive.deadLine")))])], 1)] : [_c("div", { staticClass: "plv-iar-mobile-reward-receive__desc" }, [_vm._v(_vm._s(_setup.$t("rewardReceive.receiveDesc")))]), _c(_setup.IarFormWrap, { attrs: { "label-width": 92, "form-data": _setup.formData, "form-rules": _setup.formRules, "submit-action": _setup.submitReceiveForm } }, [_vm._l(_setup.currentReceiveData.formList, function(item, index) {
|
|
4592
|
+
return [item.formType === "address" ? [!_setup.currentReceiveData.isReceived ? _c(_setup.IarFormItem, { key: `area-picker-${index}`, attrs: { "label": _setup.$t("rewardReceive.choiceAddress"), "form-field": "areaPickerValue" } }, [_c(_setup.IarMobileAreaPicker, { attrs: { "area-picker-text": _setup.formData.areaPickerText, "placeholder": _setup.$t("rewardReceive.addressPlaceholder") }, on: { "update:areaPickerText": function($event) {
|
|
4593
|
+
return _vm.$set(_setup.formData, "areaPickerText", $event);
|
|
4594
|
+
}, "update:area-picker-text": function($event) {
|
|
4595
|
+
return _vm.$set(_setup.formData, "areaPickerText", $event);
|
|
4596
|
+
} }, model: { value: _setup.formData.areaPickerValue, callback: function($$v) {
|
|
4597
|
+
_vm.$set(_setup.formData, "areaPickerValue", $$v);
|
|
4598
|
+
}, expression: "formData.areaPickerValue" } })], 1) : _vm._e(), _c(_setup.IarFormItem, { key: `area-textarea-${index}`, attrs: { "label": _setup.$t("rewardReceive.addressDetail"), "form-field": `${index}` } }, [_c(_setup.IarMobileInput, { attrs: { "placeholder": item.placeholder, "use-textarea": "", "readonly": _setup.currentReceiveData.isReceived }, model: { value: _setup.formData[index], callback: function($$v) {
|
|
4599
|
+
_vm.$set(_setup.formData, index, $$v);
|
|
4600
|
+
}, expression: "formData[index]" } })], 1)] : _c(_setup.IarFormItem, { key: `input-${index}`, attrs: { "label": item.title, "form-field": `${index}` } }, [_c(_setup.IarMobileInput, { attrs: { "placeholder": item.placeholder, "readonly": _setup.currentReceiveData.isReceived }, model: { value: _setup.formData[index], callback: function($$v) {
|
|
4601
|
+
_vm.$set(_setup.formData, index, $$v);
|
|
4602
|
+
}, expression: "formData[index]" } })], 1)];
|
|
4603
|
+
}), !_setup.currentReceiveData.isReceived && _vm.privacyContent ? _c(_setup.IarFormItem, { staticClass: "plv-iar-mobile-reward-receive__protocol", attrs: { "form-field": "checkProtocol" } }, [_c(_setup.IarMobileProtocol, { attrs: { "content": _vm.privacyContent }, model: { value: _setup.formData.checkProtocol, callback: function($$v) {
|
|
4604
|
+
_vm.$set(_setup.formData, "checkProtocol", $$v);
|
|
4605
|
+
}, expression: "formData.checkProtocol" } })], 1) : _vm._e(), _c("div", { staticClass: "plv-iar-mobile-reward-receive__submit" }, [!_setup.currentReceiveData.isReceived ? _c(_setup.IarFormSubmitButton, { attrs: { "size": _setup.ButtonSize.Middle, "type": _setup.ButtonType.Multicolour, "text": _setup.$t("common.confirm") } }) : _vm._e()], 1)], 2)]] : _vm._e(), _setup.currentReceiveData.receiveType === "qrCode" ? _c("div", { staticClass: "plv-iar-mobile-reward-receive__qrcode" }, [_c("div", { staticClass: "plv-iar-mobile-reward-receive__qrcode__inner" }, [_c("img", { attrs: { "src": _setup.currentReceiveData.qrCode } })]), _c("div", { staticClass: "plv-iar-mobile-reward-receive__qrcode__tips" }, [_vm._v(" " + _vm._s(_setup.currentReceiveData.qrCodeTips || _setup.$t("rewardReceive.qrcodeTips")) + " ")])]) : _vm._e()] : _vm._e()], 2);
|
|
4606
|
+
};
|
|
4607
|
+
var _sfc_staticRenderFns$1 = [];
|
|
4608
|
+
var __component__$1 = /* @__PURE__ */ normalizeComponent(
|
|
4609
|
+
_sfc_main$1,
|
|
4610
|
+
_sfc_render$1,
|
|
4611
|
+
_sfc_staticRenderFns$1
|
|
4612
|
+
);
|
|
4613
|
+
const MobileRewardReceivePopup = __component__$1.exports;
|
|
4614
|
+
const iarEvents = {
|
|
4615
|
+
/**
|
|
4616
|
+
* 刷新中奖记录
|
|
4617
|
+
*/
|
|
4618
|
+
RefreshLotteryRecord: "RefreshLotteryRecord"
|
|
4619
|
+
};
|
|
4620
|
+
const lotteryProps = () => ({
|
|
4621
|
+
/** 抽奖实例 */
|
|
4622
|
+
lotteryTarget: PropUtils.object().isRequired,
|
|
4623
|
+
/** 抽奖配置 */
|
|
4624
|
+
lotteryConfig: PropUtils.object().def({})
|
|
4625
|
+
});
|
|
4626
|
+
const LOTTERY_PROVIDE_KEY = Symbol("LOTTERY_PROVIDE_KEY");
|
|
4627
|
+
function getLotteryTargetExport(lotteryTarget) {
|
|
4628
|
+
const PrizeAcceptType = lotteryTarget.PrizeAcceptType;
|
|
4629
|
+
const LotteryCondition = lotteryTarget.LotteryCondition;
|
|
4630
|
+
const LotteryReceiveFormType = lotteryTarget.LotteryReceiveFormType;
|
|
4631
|
+
return {
|
|
4632
|
+
PrizeAcceptType,
|
|
4633
|
+
LotteryCondition,
|
|
4634
|
+
LotteryReceiveFormType
|
|
4635
|
+
};
|
|
4636
|
+
}
|
|
4637
|
+
const useLotteryProvide = (props) => {
|
|
4638
|
+
const lotteryConfig = computed(() => {
|
|
4639
|
+
return props.lotteryConfig;
|
|
4640
|
+
});
|
|
4641
|
+
provide(LOTTERY_PROVIDE_KEY, {
|
|
4642
|
+
getLotteryTarget: () => props.lotteryTarget,
|
|
4643
|
+
lotteryConfig
|
|
4644
|
+
});
|
|
4645
|
+
const lotteryTarget = props.lotteryTarget;
|
|
4646
|
+
return {
|
|
4647
|
+
lotteryTarget,
|
|
4648
|
+
...getLotteryTargetExport(lotteryTarget)
|
|
4649
|
+
};
|
|
4650
|
+
};
|
|
4651
|
+
const lotteryReceiveProps = () => ({
|
|
4652
|
+
...lotteryProps()
|
|
4653
|
+
});
|
|
4654
|
+
const useLotteryReceive = (options) => {
|
|
4655
|
+
const { props } = options;
|
|
4656
|
+
const { getEmitter } = useGlobalInject();
|
|
4657
|
+
const { lotteryTarget, PrizeAcceptType, LotteryReceiveFormType } = useLotteryProvide(props);
|
|
4658
|
+
const receiveData = ref();
|
|
4659
|
+
const lotteryReceiveData = ref();
|
|
4660
|
+
async function setupRecordData(lotteryId) {
|
|
4661
|
+
const _lotteryReceiveData = await lotteryTarget.getLotteryReceive({
|
|
4662
|
+
lotteryId
|
|
4663
|
+
});
|
|
4664
|
+
const formList = [];
|
|
4665
|
+
if (_lotteryReceiveData.formList) {
|
|
4666
|
+
_lotteryReceiveData.formList.forEach((item) => {
|
|
4667
|
+
let formType = "input";
|
|
4668
|
+
switch (item.formType) {
|
|
4669
|
+
case LotteryReceiveFormType.Address:
|
|
4670
|
+
formType = "address";
|
|
4671
|
+
break;
|
|
4672
|
+
case LotteryReceiveFormType.Phone:
|
|
4673
|
+
formType = "phone";
|
|
4674
|
+
break;
|
|
4675
|
+
}
|
|
4676
|
+
formList.push({
|
|
4677
|
+
title: item.field,
|
|
4678
|
+
placeholder: item.tips,
|
|
4679
|
+
value: item.value,
|
|
4680
|
+
formType,
|
|
4681
|
+
isRequired: item.required
|
|
4682
|
+
});
|
|
4683
|
+
});
|
|
4684
|
+
}
|
|
4685
|
+
receiveData.value = {
|
|
4686
|
+
receiveType: _lotteryReceiveData.acceptType,
|
|
4687
|
+
isReceived: _lotteryReceiveData.hasObtain,
|
|
4688
|
+
overTime: _lotteryReceiveData.overTime || void 0,
|
|
4689
|
+
formList,
|
|
4690
|
+
linkUrl: _lotteryReceiveData.prizeUrl || "",
|
|
4691
|
+
qrCode: _lotteryReceiveData.qrCode,
|
|
4692
|
+
qrCodeTips: _lotteryReceiveData.qrCodeTips
|
|
4693
|
+
};
|
|
4694
|
+
lotteryReceiveData.value = _lotteryReceiveData;
|
|
4695
|
+
}
|
|
4696
|
+
const submitLotteryReceive = async (formData) => {
|
|
4697
|
+
if (!lotteryReceiveData.value) {
|
|
4698
|
+
return;
|
|
4699
|
+
}
|
|
4700
|
+
const receiveInfo = [];
|
|
4701
|
+
lotteryReceiveData.value.formList.forEach((item, index) => {
|
|
4702
|
+
let value = formData[index];
|
|
4703
|
+
receiveInfo.push({
|
|
4704
|
+
...item,
|
|
4705
|
+
value
|
|
4706
|
+
});
|
|
4707
|
+
});
|
|
4708
|
+
await lotteryTarget.submitReceive({
|
|
4709
|
+
lotteryId: lotteryReceiveData.value.lotteryId,
|
|
4710
|
+
winnerCode: lotteryReceiveData.value.winnerCode,
|
|
4711
|
+
receiveInfo
|
|
4712
|
+
});
|
|
4713
|
+
getEmitter().emit(iarEvents.RefreshLotteryRecord);
|
|
4714
|
+
};
|
|
4715
|
+
const instance = {
|
|
4716
|
+
setupRecordData
|
|
4717
|
+
};
|
|
4718
|
+
return {
|
|
4719
|
+
setupRecordData,
|
|
4720
|
+
receiveData,
|
|
4721
|
+
PrizeAcceptType,
|
|
4722
|
+
submitLotteryReceive,
|
|
4723
|
+
instance
|
|
4724
|
+
};
|
|
4725
|
+
};
|
|
4726
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4727
|
+
__name: "mobile-lottery-receive",
|
|
4728
|
+
props: lotteryReceiveProps(),
|
|
4729
|
+
setup(__props, { expose }) {
|
|
4730
|
+
const props = __props;
|
|
4731
|
+
const {
|
|
4732
|
+
receiveData,
|
|
4733
|
+
submitLotteryReceive,
|
|
4734
|
+
instance
|
|
4735
|
+
} = useLotteryReceive({
|
|
4736
|
+
props
|
|
4737
|
+
});
|
|
4738
|
+
expose(instance);
|
|
4739
|
+
return { __sfc: true, props, receiveData, submitLotteryReceive, instance, MobileRewardReceivePopup };
|
|
4740
|
+
}
|
|
4741
|
+
});
|
|
4742
|
+
var _sfc_render = function render11() {
|
|
4743
|
+
var _vm = this, _c = _vm._self._c, _setup = _vm._self._setupProxy;
|
|
4744
|
+
return _c(_setup.MobileRewardReceivePopup, { attrs: { "receive-data": _setup.receiveData, "privacy-content": _vm.lotteryConfig.privateContent, "submit-action": _setup.submitLotteryReceive } });
|
|
4745
|
+
};
|
|
4746
|
+
var _sfc_staticRenderFns = [];
|
|
4747
|
+
var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
4748
|
+
_sfc_main,
|
|
4749
|
+
_sfc_render,
|
|
4750
|
+
_sfc_staticRenderFns
|
|
4751
|
+
);
|
|
4752
|
+
const mobileLotteryReceive = __component__.exports;
|
|
4753
|
+
export {
|
|
4754
|
+
mobileLotteryReceive as default
|
|
4755
|
+
};
|