first commit
This commit is contained in:
1
unpackage/dist/build/mp-weixin/uni_modules/uview-plus/libs/function/colorGradient.js
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/uview-plus/libs/function/colorGradient.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";function t(t="rgb(0, 0, 0)",n="rgb(255, 255, 255)",o=10){const l=e(t,!1),f=l[0],s=l[1],i=l[2],c=e(n,!1),g=(c[0]-f)/o,a=(c[1]-s)/o,u=(c[2]-i)/o,h=[];for(let e=0;e<o;e++){let l=r(`rgb(${Math.round(g*e+f)},${Math.round(a*e+s)},${Math.round(u*e+i)})`);0===e&&(l=r(t)),e===o-1&&(l=r(n)),h.push(l)}return h}function e(t,e=!0){if((t=String(t).toLowerCase())&&/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t)){if(4===t.length){let e="#";for(let r=1;r<4;r+=1)e+=t.slice(r,r+1).concat(t.slice(r,r+1));t=e}const r=[];for(let e=1;e<7;e+=2)r.push(parseInt(`0x${t.slice(e,e+2)}`));return e?`rgb(${r[0]},${r[1]},${r[2]})`:r}if(/^(rgb|RGB)/.test(t)){return t.replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",").map((t=>Number(t)))}return t}function r(t){const e=t;if(/^(rgb|RGB)/.test(e)){const t=e.replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",");let r="#";for(let e=0;e<t.length;e++){let n=Number(t[e]).toString(16);n=1==String(n).length?`0${n}`:n,"0"===n&&(n+=n),r+=n}return 7!==r.length&&(r=e),r}if(!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(e))return e;{const t=e.replace(/#/,"").split("");if(6===t.length)return e;if(3===t.length){let e="#";for(let r=0;r<t.length;r+=1)e+=t[r]+t[r];return e}}}const n={colorGradient:t,hexToRgb:e,rgbToHex:r,colorToRgba:function(t,e){t=r(t);let n=String(t).toLowerCase();if(n&&/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(n)){if(4===n.length){let t="#";for(let e=1;e<4;e+=1)t+=n.slice(e,e+1).concat(n.slice(e,e+1));n=t}const t=[];for(let e=1;e<7;e+=2)t.push(parseInt(`0x${n.slice(e,e+2)}`));return`rgba(${t.join(",")},${e})`}return n}};exports.colorGradient=n,exports.colorGradient$1=t;
|
||||
1
unpackage/dist/build/mp-weixin/uni_modules/uview-plus/libs/function/debounce.js
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/uview-plus/libs/function/debounce.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";let e=null;exports.debounce=function(t,n=500,o=!1){if(null!==e&&clearTimeout(e),o){const o=!e;e=setTimeout((()=>{e=null}),n),o&&"function"==typeof t&&t()}else e=setTimeout((()=>{"function"==typeof t&&t()}),n)};
|
||||
1
unpackage/dist/build/mp-weixin/uni_modules/uview-plus/libs/function/digit.js
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/uview-plus/libs/function/digit.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";function t(t,n=15){return+parseFloat(Number(t).toPrecision(n))}function n(t){const n=t.toString().split(/[eE]/),r=(n[0].split(".")[1]||"").length-+(n[1]||0);return r>0?r:0}function r(r){if(-1===r.toString().indexOf("e"))return Number(r.toString().replace(".",""));const e=n(r);return e>0?t(Number(r)*Math.pow(10,e)):Number(r)}function e(t){(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER)&&console.warn(`${t} 超出了精度限制,结果可能不正确`)}function o(t,n){const[r,e,...o]=t;let u=n(r,e);return o.forEach((t=>{u=n(u,t)})),u}function u(...t){if(t.length>2)return o(t,u);const[i,c]=t,s=r(i),f=r(c),a=n(i)+n(c),h=s*f;return e(h),h/Math.pow(10,a)}function i(...c){if(c.length>2)return o(c,i);const[s,f]=c,a=r(s),h=r(f);return e(a),e(h),u(a/h,t(Math.pow(10,n(f)-n(s))))}exports.round=function(t,n){const r=Math.pow(10,n);let e=i(Math.round(Math.abs(u(t,r))),r);return t<0&&0!==e&&(e=u(e,-1)),e};
|
||||
1
unpackage/dist/build/mp-weixin/uni_modules/uview-plus/libs/function/index.js
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/uview-plus/libs/function/index.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
unpackage/dist/build/mp-weixin/uni_modules/uview-plus/libs/function/platform.js
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/uview-plus/libs/function/platform.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";let e="none";e="vue3",e="mp",e="weixin";exports.platform="weixin";
|
||||
1
unpackage/dist/build/mp-weixin/uni_modules/uview-plus/libs/function/test.js
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/uview-plus/libs/function/test.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";function t(t){return/^[\+-]?(\d+\.?\d*|\.\d+|\d\.\d+e\+\d+)$/.test(t)}function n(t){switch(typeof t){case"undefined":return!0;case"string":if(0==t.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g,"").length)return!0;break;case"boolean":if(!t)return!0;break;case"number":if(0===t||isNaN(t))return!0;break;case"object":if(null===t||0===t.length)return!0;for(const n in t)return!1;return!0}return!1}function e(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function r(t){return"[object Object]"===Object.prototype.toString.call(t)}function u(t){return"function"==typeof t}const o={email:function(t){return/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(t)},mobile:function(t){return/^1[23456789]\d{9}$/.test(t)},url:function(t){return/^((https|http|ftp|rtsp|mms):\/\/)(([0-9a-zA-Z_!~*'().&=+$%-]+: )?[0-9a-zA-Z_!~*'().&=+$%-]+@)?(([0-9]{1,3}.){3}[0-9]{1,3}|([0-9a-zA-Z_!~*'()-]+.)*([0-9a-zA-Z][0-9a-zA-Z-]{0,61})?[0-9a-zA-Z].[a-zA-Z]{2,6})(:[0-9]{1,4})?((\/?)|(\/[0-9a-zA-Z_!~*'().;?:@&=+$,%#-]+)+\/?)$/.test(t)},date:function(n){return!!n&&(t(n)&&(n=+n),!/Invalid|NaN/.test(new Date(n).toString()))},dateISO:function(t){return/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(t)},number:t,digits:function(t){return/^\d+$/.test(t)},idCard:function(t){return/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(t)},carNo:function(t){const n=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/,e=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;return 7===t.length?e.test(t):8===t.length&&n.test(t)},amount:function(t){return/^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(t)},chinese:function(t){return/^[\u4e00-\u9fa5]+$/gi.test(t)},letter:function(t){return/^[a-zA-Z]*$/.test(t)},enOrNum:function(t){return/^[0-9a-zA-Z]*$/g.test(t)},contains:function(t,n){return t.indexOf(n)>=0},range:function(t,n){return t>=n[0]&&t<=n[1]},rangeLength:function(t,n){return t.length>=n[0]&&t.length<=n[1]},empty:n,isEmpty:n,jsonString:function(t){if("string"==typeof t)try{const n=JSON.parse(t);return!("object"!=typeof n||!n)}catch(n){return!1}return!1},landline:function(t){return/^\d{3,4}-\d{7,8}(-\d{3,4})?$/.test(t)},object:r,array:e,code:function(t,n=6){return new RegExp(`^\\d{${n}}$`).test(t)},func:u,promise:function(t){return r(t)&&u(t.then)&&u(t.catch)},video:function(t){return/\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv|m3u8)/i.test(t)},image:function(t){const n=t.split("?")[0];return/\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i.test(n)},regExp:function(t){return t&&"[object RegExp]"===Object.prototype.toString.call(t)},string:function(t){return"string"==typeof t}};exports.array=e,exports.empty=n,exports.number=t,exports.test=o;
|
||||
1
unpackage/dist/build/mp-weixin/uni_modules/uview-plus/libs/function/throttle.js
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/uview-plus/libs/function/throttle.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";let t;exports.throttle=function(e,o=500,i=!0){i?t||(t=!0,"function"==typeof e&&e(),setTimeout((()=>{t=!1}),o)):t||(t=!0,setTimeout((()=>{t=!1,"function"==typeof e&&e()}),o))};
|
||||
Reference in New Issue
Block a user