first commit
This commit is contained in:
1
unpackage/dist/build/mp-weixin/uni_modules/tdesign-uniapp/components/common/bus.js
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/tdesign-uniapp/components/common/bus.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";exports.Bus=class{constructor(){this.listeners=new Map,this.emitted=new Map,this.onceListeners=new Map}on(e,t){const s=this.listeners.get(e)||[];s.push(t),this.listeners.set(e,s),this.emitted.has(e)&&t(...this.emitted.get(e))}once(e,t){if(this.emitted.has(e))return void t(...this.emitted.get(e));const s=(...i)=>{t(...i),this.off(e,s)},i=this.onceListeners.get(e)||new Map;i.set(t,s),this.onceListeners.set(e,i),this.on(e,s)}emit(e,...t){this.emitted.set(e,t);[...this.listeners.get(e)||[]].forEach((e=>e(...t)))}off(e,t){if(t){const s=this.onceListeners.get(e);if(s&&s.has(t)){const i=s.get(t);return this._removeListener(e,i),void s.delete(t)}this._removeListener(e,t)}else this.listeners.delete(e),this.onceListeners.delete(e),this.emitted.delete(e)}_removeListener(e,t){const s=this.listeners.get(e);if(!s)return;const i=s.indexOf(t);i>-1&&(s.splice(i,1),0===s.length&&this.listeners.delete(e))}};
|
||||
1
unpackage/dist/build/mp-weixin/uni_modules/tdesign-uniapp/components/common/config.js
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/tdesign-uniapp/components/common/config.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";exports.prefix="t";
|
||||
@@ -0,0 +1 @@
|
||||
"use strict";function t(t){return t.replace(/^(\w)/,((t,e)=>`data${e.toUpperCase()}`))}function e(e){Object.keys(e).forEach((r=>{this[t(r)]=e[r]}))}exports.getFunctionalMixin=function(r){return{data(){return{...(e=this,a=r,Object.keys(a).reduce(((r,a)=>(r[t(a)]=e[a],r)),{}))};var e,a},watch:{...(a=r,Object.keys(a).reduce(((e,r)=>(e[r]={handler(e){this[t(r)]=e}},e)),{}))},methods:{setData(t){e.call(this,t)}}};var a};
|
||||
@@ -0,0 +1 @@
|
||||
"use strict";
|
||||
@@ -0,0 +1 @@
|
||||
"use strict";exports.RELATION_MAP={CollapsePanel:"Collapse",TabPanel:"Tabs",StepItem:"Steps",TabBarItem:"TabBar",SideBarItem:"SideBar",GridItem:"Grid",DropdownItem:"DropdownMenu",Radio:"RadioGroup",Checkbox:"CheckboxGroup",Cell:"CellGroup",Avatar:"AvatarGroup",PickerItem:"Picker",IndexesAnchor:"Indexes",SwiperNav:"Swiper",Col:"Row",BackTop:"PullDownRefresh",FormItem:"Form",FormKey:"FormKey"};
|
||||
@@ -0,0 +1 @@
|
||||
"use strict";exports.ChildrenMixin=function(n,i={}){const t=i.indexKey||"index";return{inject:{[n]:{default:null}},data:()=>({}),computed:{[t](){const i=this;return i.bindRelation(),i[n]?i[n].children.indexOf(this):null}},watch:{disableBindRelation(n){n||this.bindRelation()}},created(){this.bindRelation()},mounted(){},beforeUnmount(){this.onBeforeMount()},methods:{bindRelation(){var i,t,e;if(!this[n]||this[n].children&&-1!==this[n].children.indexOf(this))return;const l=[...this[n].children||[],this];this[n].children=l,null==(i=this.innerAfterLinked)||i.call(this,this),null==(e=(t=this[n]).innerAfterLinked)||e.call(t,this)},onBeforeMount(){var i,t,e,l;const r=this;r[n]&&(r[n].children=r[n].children.filter((n=>n!==r)),null==(t=(i=this[n]).innerAfterUnLinked)||t.call(i,this),null==(e=this.innerAfterUnLinked)||e.call(this,this),null==(l=null==r?void 0:r.destroyCallback)||l.call(r))}}}},exports.ParentMixin=function(n){return{provide(){return{[n]:this}},data:()=>({})}};
|
||||
@@ -0,0 +1 @@
|
||||
"use strict";exports.getRegExp=function(){const t=Array.prototype.slice.call(arguments);return t.unshift(RegExp),new(Function.prototype.bind.apply(RegExp,t))};
|
||||
1
unpackage/dist/build/mp-weixin/uni_modules/tdesign-uniapp/components/common/src/control.js
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/tdesign-uniapp/components/common/src/control.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";
|
||||
1
unpackage/dist/build/mp-weixin/uni_modules/tdesign-uniapp/components/common/src/flatTool.js
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/tdesign-uniapp/components/common/src/flatTool.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";
|
||||
1
unpackage/dist/build/mp-weixin/uni_modules/tdesign-uniapp/components/common/src/index.js
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/tdesign-uniapp/components/common/src/index.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";require("./instantiationDecorator.js");
|
||||
@@ -0,0 +1 @@
|
||||
"use strict";const e=require("../validator.js"),t=require("../version.js"),o=require("../utils.js"),s=e=>`data${e.replace(/^(\w)/,((e,t)=>t.toUpperCase()))}`,r=e=>`default${e.replace(/^(\w)/,((e,t)=>t.toUpperCase()))}`,i=[{key:"ariaHidden",type:Boolean},{key:"ariaRole",type:String},{key:"ariaLabel",type:String},{key:"ariaLabelledby",type:String},{key:"ariaDescribedby",type:String},{key:"ariaBusy",type:Boolean}],n=(e,t=!1)=>!(e===Boolean&&!t)&&(e===String?"":void 0),a={...i.reduce(((e,t)=>({...e,[t.key]:{type:t.type,default:n(t.type)}})),{}),customStyle:{type:[String,Object],default:""}};function l(e){if(!e.externalClasses)return{};const{externalClasses:t}=e;return(Array.isArray(t)?t:[t]).reduce(((e,t)=>({...e,[o.toCamel(t)]:{type:String,default:""}})),{})}exports.uniComponent=function(i){const{newProps:p,emits:y}=function(e,t){const s={},i=[],a=/^on[A-Z][a-z]/,l=Object.values(t).map((e=>e.key)),p=l.map((e=>r(e)));return Object.keys(e).forEach((t=>{const r=e[t].type||e[t];if(a.test(t)&&e[t].type===Function){const e=t.replace(/^on/,""),s=e.charAt(0).toLowerCase()+e.slice(1);i.push(o.hyphenate(s),s)}else if(l.indexOf(t)>-1||p.indexOf(t)>-1){const e=Array.isArray(r)?r:[r];s[t]={type:[null,...e],default:null}}else[Boolean,String].indexOf(e[t].type)>-1&&void 0===e[t].default?s[t]={...e[t],default:n(e[t].type,!0)}:s[t]={..."object"==typeof e[t]?e[t]:{},type:(y=r,Array.isArray(y)?(y.sort(((e,t)=>e===Boolean?-1:t===Boolean?1:0)),y):y)};var y})),{newProps:s,emits:i}}(i.props||{},i.controlledProps||{});var c;i.props={...l(i),...p,...a},i.emits=Array.from(new Set([...i.emits||[],...(c=i.controlledProps||{},Object.values(c).map((e=>`update:${e.key}`))),...y])),i.options={...i.options||{},multipleSlots:!0},t.canUseVirtualHost()&&null==i.options.virtualHost&&(i.options.virtualHost=!0),i.options.styleIsolation||(i.options.styleIsolation="shared"),i.name&&(i.name=o.toPascal(i.name));const u=function(t){!t.properties&&t.props&&(t.properties=t.props),t.properties&&Object.keys(t.properties).forEach((o=>{let s=t.properties[o];e.isPlainObject(s)||(s={type:s}),t.properties[o]=s})),t.methods||(t.methods={}),t.lifetimes||(t.lifetimes={});const o=t.created,{controlledProps:i=[]}=t;return t.created=function(...e){o&&o.apply(this,e),i.forEach((({key:e})=>{const t=r(e),o=s(e);this[o]=this[e],null==this[e]&&(this._selfControlled=!0),null==this[e]&&null!=this[t]&&(this[o]=this[t])}))},t.methods._trigger=function(e,t,o){const r=i.find((t=>t.event===e));if(r){const{key:e}=r;this._selfControlled&&(this[s(e)]=t[e]),this.$emit(`update:${e}`,t[e],o)}this.$emit(e,t,o)},t}(i);return u};
|
||||
@@ -0,0 +1 @@
|
||||
"use strict";
|
||||
1
unpackage/dist/build/mp-weixin/uni_modules/tdesign-uniapp/components/common/utils.js
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/tdesign-uniapp/components/common/utils.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";const e=require("../../../../common/vendor.js"),t=require("./config.js"),r=require("./validator.js"),n=require("./wechat.js"),o=n.getWindowInfo(),s=n.getAppBaseInfo(),c=n.getDeviceInfo();function a(...e){for(let t=0;t<e.length;t+=1)if(null!==e[t]&&void 0!==e[t])return e[t];return e[e.length-1]}const i=function(...e){const t={}.hasOwnProperty,r=[];return e.forEach((e=>{if(!e)return;const n=typeof e;if("string"===n||"number"===n)r.push(e);else if(Array.isArray(e)&&e.length){const t=i(...e);t&&r.push(t)}else if("object"===n)for(const o in e)t.call(e,o)&&e[o]&&r.push(o)})),r.join(" ")};null==c||c.environment,["mac","windows"].includes(null==c?void 0:c.platform);exports.addUnit=function(e){if(r.isDef(e))return e=String(e),r.isNumeric(e)?`${e}px`:e},exports.appBaseInfo=s,exports.calcIcon=(e,t)=>e&&(r.isBoolean(e)&&t||r.isString(e))?{name:r.isBoolean(e)?t:e}:r.isObject(e)?e:null,exports.classNames=i,exports.coalesce=a,exports.getCharacterLength=(e,t,r)=>{const n=String(a(t,""));if(0===n.length)return{length:0,characters:""};if("maxcharacter"===e){let e=0;for(let t=0;t<n.length;t+=1){let o=0;if(o=n.charCodeAt(t)>127||94===n.charCodeAt(t)?2:1,e+o>r)return{length:e,characters:n.slice(0,t)};e+=o}return{length:e,characters:n}}if("maxlength"===e){const e=n.length>r?r:n.length;return{length:e,characters:n.slice(0,e)}}return{length:n.length,characters:n}},exports.getCurrentPage=function(){const e=getCurrentPages();return e[e.length-1]},exports.getRect=function(t,r,n=!1,o=!1){return new Promise(((o,s)=>{e.index.createSelectorQuery().in(t)[n?"selectAll":"select"](r).boundingClientRect((e=>{e?o(e):s(e)})).exec()}))},exports.hyphenate=function(e){return e.replace(/\B([A-Z])/g,"-$1").toLowerCase()},exports.nextTick=()=>new Promise((e=>{setTimeout((()=>{e()}),33)})),exports.setIcon=(e,t,r)=>t?"string"==typeof t?{[`${e}Name`]:t,[`${e}Data`]:{}}:"object"==typeof t?{[`${e}Name`]:"",[`${e}Data`]:t}:{[`${e}Name`]:r,[`${e}Data`]:{}}:{[`${e}Name`]:"",[`${e}Data`]:{}},exports.styles=function(e){return Object.keys(e).map((t=>`${t}: ${e[t]}`)).join("; ")},exports.systemInfo=o,exports.toCamel=e=>e.replace(/-(\w)/g,((e,t)=>t.toUpperCase())),exports.toPascal=e=>e.split("-").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(""),exports.uniqueFactory=e=>{let r=0;return()=>{const n=`${t.prefix}_${e}_${r}`;return r+=1,n}},exports.unitConvert=e=>"string"==typeof e?e.includes("rpx")?parseInt(e,10)*a(null==o?void 0:o.screenWidth,750)/750:parseInt(e,10):a(e,0);
|
||||
1
unpackage/dist/build/mp-weixin/uni_modules/tdesign-uniapp/components/common/utils.wxs.js
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/tdesign-uniapp/components/common/utils.wxs.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";const t=require("./runtime/wxs-polyfill.js");function n(t){return Array.isArray(t)}function r(t){const n=typeof t;return null!==t&&("object"===n||"function"===n)}const e={addUnit:function(n){const r=t.getRegExp("^-?\\d+(.\\d+)?$");if(null!=n)return r.test(`${n}`)?`${n}px`:n},isString:function(t){return"string"==typeof t},isArray:n,isObject:r,isBoolean:function(t){return"boolean"==typeof t},isNoEmptyObj:function(t){return r(t)&&"{}"!==JSON.stringify(t)},includes:function(t,r){if(!t||!n(t))return!1;let e=0;const o=t.length;for(;e<o;e++)if(t[e]===r)return!0;return!1},cls:function(t,n){const r=[t];let e=0;for(let o=n.length;e<o;e++){const o=n[e];if(o&&Array.isArray(o)){const o=n[e][0];n[e][1]&&r.push(`${t}--${o}`)}else"string"!=typeof o&&"number"!=typeof o||o&&r.push(`${t}--${o}`)}return r.join(" ")},getBadgeAriaLabel:function(t){const n=t.maxCount||99;if(t.dot)return"有新的消息";if("..."===t.count)return"有很多消息";if(isNaN(t.count))return t.count;const r=`有${n}+条消息`,e=`有${t.count}条消息`;return Number(t.count)>n?r:e},_style:function e(o){return n(o)?o.filter((t=>null!=t&&""!==t)).map((t=>{return n(t)||r(t)?e(t):(i=";",(o=t).slice(-i.length)===i?o:o+i);var o,i})).join(" "):r(o)?(i=o,JSON.stringify(i).replace(t.getRegExp('{|}|"',"g"),"").split(",").map((t=>t.split(":")[0]))).filter((t=>null!=o[t]&&""!==o[t])).map((n=>{return[(r=n,r.replace(t.getRegExp("[A-Z]","g"),(t=>`-${t}`)).toLowerCase()),[o[n]]].join(":");var r})).join(";"):o;var i},isValidIconName:function(n){return t.getRegExp("^[A-Za-z0-9-_]+$").test(n)}};exports.tools=e;
|
||||
1
unpackage/dist/build/mp-weixin/uni_modules/tdesign-uniapp/components/common/validator.js
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/tdesign-uniapp/components/common/validator.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";exports.isBoolean=function(t){return"boolean"==typeof t},exports.isDef=function(t){return!(t=>void 0===t)(t)&&!(t=>null===t)(t)},exports.isNumeric=function(t){return!Number.isNaN(Number(t))},exports.isObject=function(t){const e=typeof t;return null!==t&&("object"===e||"function"===e)},exports.isPlainObject=function(t){return null!==t&&"object"==typeof t&&"[object Object]"===Object.prototype.toString.call(t)},exports.isString=t=>"string"==typeof t;
|
||||
1
unpackage/dist/build/mp-weixin/uni_modules/tdesign-uniapp/components/common/version.js
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/tdesign-uniapp/components/common/version.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";const t=require("./wechat.js");let e;function n(t,e){t=t.split("."),e=e.split(".");const n=Math.max(t.length,e.length);for(;t.length<n;)t.push("0");for(;e.length<n;)e.push("0");for(let r=0;r<n;r+=1){const n=parseInt(t[r],10),s=parseInt(e[r],10);if(n>s)return 1;if(n<s)return-1}return 0}function r(r){return n((null==e&&(e=t.getAppBaseInfo()),e).SDKVersion,r)>=0}exports.canUseVirtualHost=function(){let t=!1;return t=r("2.19.2"),t},exports.compareVersion=n;
|
||||
1
unpackage/dist/build/mp-weixin/uni_modules/tdesign-uniapp/components/common/wechat.js
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/tdesign-uniapp/components/common/wechat.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";const e=require("../../../../common/vendor.js");exports.getAppBaseInfo=()=>e.index.getAppBaseInfo&&e.index.getAppBaseInfo()||e.index.getSystemInfoSync(),exports.getDeviceInfo=()=>e.index.getDeviceInfo&&e.index.getDeviceInfo()||e.index.getSystemInfoSync(),exports.getObserver=(n,o)=>new Promise((t=>{e.index.createIntersectionObserver(n,{nativeMode:!0}).relativeToViewport().observe(o,(e=>{t(e)}))})),exports.getWindowInfo=()=>e.index.getWindowInfo&&e.index.getWindowInfo()||e.index.getSystemInfoSync();
|
||||
Reference in New Issue
Block a user