ftvs-vue2 0.0.15 → 0.0.17

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/lib/cjs/Button.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e=require("./browser-6bf896d2.js"),t={name:"Button",props:{type:{type:String,default:"default",desc:"default | danger"}},emits:{click:function(e){return"点击事件"}},methods:{},mounted:function(){}},n=function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{directives:[{name:"focusable",rawName:"v-focusable"}],class:[e.$style.button,e.$style[e.type]],on:{click:function(t){return e.$emit("click")}}},[e._t("default")],2)};n._withStripped=!0;var a=function(e){e&&(e("data-v-807922ca_0",{source:"",map:void 0,media:void 0}),Object.defineProperty(this,"$style",{value:{button:"packages-Button-button-1dIW",default:"packages-Button-default-Zf6U",danger:"packages-Button-danger-1SaJ"}}))},r=e.normalizeComponent({render:n,staticRenderFns:[]},a,t,undefined,false,undefined,!1,e.createInjector,void 0,void 0);module.exports=r;
1
+ "use strict";var e=require("./browser-f7f8eb3f.js"),t={name:"Button",props:{type:{type:String,default:"default",desc:"default | danger"}},emits:{click:function(e){return"点击事件"}}},n=function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{directives:[{name:"focusable",rawName:"v-focusable"}],class:[e.$style.button,e.$style[e.type]],on:{click:function(t){return e.$emit("click")}}},[e._t("default")],2)};n._withStripped=!0;var a=function(e){e&&(e("data-v-2c27a512_0",{source:"",map:void 0,media:void 0}),Object.defineProperty(this,"$style",{value:{button:"packages-Button-button-1dIW",default:"packages-Button-default-Zf6U",danger:"packages-Button-danger-1SaJ"}}))},r=e.normalizeComponent({render:n,staticRenderFns:[]},a,t,undefined,false,undefined,!1,e.createInjector,void 0,void 0);module.exports=r;
@@ -1 +1 @@
1
- "use strict";var e=require("./index-42a2cd0c.js"),t=require("./Popup.js"),i=require("./ListSelect.js"),n=require("./browser-6bf896d2.js");require("vant"),require("./utils.js"),require("vue"),require("./staticImg.js");var r={name:"FileBag",components:{Popup:t,ListSelect:i},props:{value:{type:Boolean,default:!1,required:!0,desc:"是否展示"},title:{type:String,default:"请选择健康档案",desc:"标题"},codeTitle:{type:String,default:"添加或编辑档案",desc:"二维码标题"}},watch:{value:{handler:function(e){this.show=e,e&&this.inits()},immediate:!0},show:function(e){e||this.$refs.listSelect._tvRest(),this.$emit("input",e)}},emits:{input:function(e){return"内容变化时触发"},change:function(e){return"选中当前项"},list:function(e){return"地址数据返回"}},data:function(){return{list:[],QrPath:"",show:!1}},methods:{change:function(e){this.show=!1,this.$emit("change",e)},inits:function(){var t=this;return e._asyncToGenerator(e.regenerator.mark(function i(){var n,r;return e.regenerator.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.$ftvsApiConfigInfo.fileBagFn){e.next=2;break}return e.next=1,t.$ftvsApiConfigInfo.fileBagFn();case 1:n=e.sent,t.list=n||[],t.$emit("list",t.list);case 2:t.$ftvsApiConfigInfo.qrCodePathFn&&(r=t.$ftvsApiConfigInfo.qrCodePathFn(),t.QrPath=r.weAppHealthRecordPath);case 3:case"end":return e.stop()}},i)}))()}}},s=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("Popup",{class:e.$style.popup,model:{value:e.show,callback:function(t){e.show=t},expression:"show"}},[i("div",{class:e.$style["file-bag"]},[i("ListSelect",{ref:"listSelect",attrs:{list:e.list,qrPath:e.QrPath,title:e.title,codeTitle:e.codeTitle},on:{change:e.change}})],1)])};s._withStripped=!0;var a=function(e){e&&(e("data-v-67218a36_0",{source:"",map:void 0,media:void 0}),Object.defineProperty(this,"$style",{value:{popup:"packages-FileBag-popup-Hc07","file-bag":"packages-FileBag-file-bag-xapd"}}))},o=n.normalizeComponent({render:s,staticRenderFns:[]},a,r,undefined,false,undefined,!1,n.createInjector,void 0,void 0);module.exports=o;
1
+ "use strict";var e=require("./index-c2b22c86.js"),t=require("./Popup.js"),i=require("./ListSelect.js"),n=require("./browser-f7f8eb3f.js");require("vant"),require("./utils.js"),require("vue"),require("./staticImg.js");var r={name:"FileBag",components:{Popup:t,ListSelect:i},props:{value:{type:Boolean,default:!1,required:!0,desc:"是否展示"},title:{type:String,default:"请选择健康档案",desc:"标题"},codeTitle:{type:String,default:"添加或编辑档案",desc:"二维码标题"}},watch:{value:{handler:function(e){this.show=e,e&&this.inits()},immediate:!0},show:function(e){e||this.$refs.listSelect._tvRest(),this.$emit("input",e)}},emits:{input:function(e){return"内容变化时触发"},change:function(e){return"选中当前项"},list:function(e){return"地址数据返回"}},data:function(){return{list:[],QrPath:"",show:!1}},methods:{change:function(e){this.show=!1,this.$emit("change",e)},inits:function(){var t=this;return e._asyncToGenerator(e.regenerator.mark(function i(){var n,r;return e.regenerator.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.$ftvsApiConfigInfo.fileBagFn){e.next=2;break}return e.next=1,t.$ftvsApiConfigInfo.fileBagFn();case 1:n=e.sent,t.list=n||[],t.$emit("list",t.list);case 2:t.$ftvsApiConfigInfo.qrCodePathFn&&(r=t.$ftvsApiConfigInfo.qrCodePathFn(),t.QrPath=r.weAppHealthRecordPath);case 3:case"end":return e.stop()}},i)}))()}}},s=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("Popup",{class:e.$style.popup,model:{value:e.show,callback:function(t){e.show=t},expression:"show"}},[i("div",{class:e.$style["file-bag"]},[i("ListSelect",{ref:"listSelect",attrs:{list:e.list,qrPath:e.QrPath,title:e.title,codeTitle:e.codeTitle},on:{change:e.change}})],1)])};s._withStripped=!0;var a=function(e){e&&(e("data-v-67218a36_0",{source:"",map:void 0,media:void 0}),Object.defineProperty(this,"$style",{value:{popup:"packages-FileBag-popup-Hc07","file-bag":"packages-FileBag-file-bag-xapd"}}))},o=n.normalizeComponent({render:s,staticRenderFns:[]},a,r,undefined,false,undefined,!1,n.createInjector,void 0,void 0);module.exports=o;
@@ -1 +1 @@
1
- "use strict";var e=require("./index-42a2cd0c.js"),t=require("./utils.js"),n=require("./staticImg.js"),i=require("./browser-6bf896d2.js");function s(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}require("vue");var r={name:"ListSelect",props:{value:{type:Object,default:function(){return{}},desc:"当前选中项"},list:{type:Array,required:!0,desc:"属性说明"},title:{type:String,default:"",desc:"标题"},codeTitle:{type:String,default:"",desc:"二维码标题"},qrPath:{type:String,default:"",desc:"二维码链接"}},watch:{qrPath:{handler:function(e){this.initQr(e)},immediate:!0},value:{handler:function(e){var t=this.findObjectIndex(this.list,e);t>-1&&(this.selectIndex=t)},immediate:!0},list:{handler:function(e){e.length&&this.inits()},immediate:!0}},emits:{change:function(e){return"选中当前项"},input:function(e){return"内容变化时触发"},onFocus:function(e){return"获得当前焦点所在项"}},slots:{item:{desc:"列表元素"},hint:{desc:"二维码下方提示"}},data:function(){var e=t.ftvsTvScope.apply(this);return{ftvsTvInit:e.ftvsTvInit,ftvsTvReset:e.ftvsTvReset,qrcodeThis:void 0,QRCode:null,selectIndex:null,staticCodeIcon:n.staticCodeIcon,selected:n.staticSelectedIcon,wxIcon:n.staticWxIcon}},methods:{initQr:function(t){var n=this;return e._asyncToGenerator(e.regenerator.mark(function i(){var r;return e.regenerator.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==n.QRCode){e.next=2;break}return e.next=1,Promise.resolve().then(function(){return s(require("qrcodejs2"))});case 1:n.QRCode=e.sent.default;case 2:if(t){e.next=3;break}return e.abrupt("return");case 3:r={text:t,width:314,height:316,colorDark:"#000000",colorLight:"#ffffff",correctLevel:n.QRCode.CorrectLevel.H},void 0!==n.qrcodeThis?(n.qrcodeThis.clear(),n.qrcodeThis.makeCode(t)):n.qrcodeThis=new n.QRCode(n.$refs.ftvsQrCode,r),n.$nextTick(function(){n.forceRepaint(n.$refs.ftvsQrCode)});case 4:case"end":return e.stop()}},i)}))()},forceRepaint:function(e){e.style.display="none",e.offsetHeight,e.style.display="flex"},findObjectIndex:function(e,t){return e.findIndex(function(e){return Object.keys(t).every(function(n){return e[n]===t[n]})})},_tvRest:function(){this.ftvsTvReset()},change:function(e,t){this.selectIndex=t,this.$emit("input",e),this.$emit("change",{item:e,index:t}),this.ftvsTvReset()},onFocus:function(e,t){this.$emit("onFocus",{item:e,index:t})},inits:function(){var t=this;return e._asyncToGenerator(e.regenerator.mark(function n(){return e.regenerator.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:t.$nextTick(e._asyncToGenerator(e.regenerator.mark(function n(){return e.regenerator.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t.ftvsTvInit({distanceToCenter:!0,scrollEl:t.$refs.left,limitingEl:t.$refs.left},function(){var e=t.$refs.left,n=e?e.querySelectorAll(".".concat(t.$style.item)):null;n&&n.length&&t.$tv.next(n[t.selectIndex||0])});case 1:case"end":return e.stop()}},n)})));case 1:case"end":return n.stop()}},n)}))()}},beforeDestroy:function(){this.ftvsTvReset()},mounted:function(){}},c=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:e.$style.list_select},[e.title?n("div",{class:e.$style.title},[e._v(e._s(e.title))]):e._e(),e._v(" "),n("div",{class:e.$style.content},[e.list.length?n("div",{ref:"left",class:e.$style.left},e._l(e.list,function(t,i){return n("div",{directives:[{name:"focusable",rawName:"v-focusable"}],key:i+"-ftvs-file-bg-list",class:e.$style.item,on:{click:function(n){return e.change(t,i)},onFocus:function(n){return e.onFocus(t,i)}}},[n("div",{class:e.$style.item_l},[e._t("item",function(){return[n("div",[e._v("\n "+e._s(t.memberName)+" "+e._s(t.sexText)+" "+e._s(t.age)+"岁\n ")])]},{item:t,index:i})],2),e._v(" "),i===e.selectIndex?n("img",{class:e.$style.selected,attrs:{src:e.selected}}):e._e()])}),0):e._e(),e._v(" "),n("div",{class:e.$style.right,style:{background:"url('"+e.staticCodeIcon+"')"}},[n("div",{class:e.$style.r_div},[n("div",{class:e.$style.r_title},[e._v(e._s(e.codeTitle))]),e._v(" "),n("div",{ref:"ftvsQrCode",class:e.$style.img_code}),e._v(" "),e._t("hint",function(){return[n("div",{class:e.$style.r_hint},[n("img",{attrs:{src:e.wxIcon}}),e._v("\n 使用微信扫码\n ")])]})],2)])])])};c._withStripped=!0;var a=function(e){e&&(e("data-v-5ffffc7d_0",{source:"",map:void 0,media:void 0}),Object.defineProperty(this,"$style",{value:{list_select:"packages-ListSelect-list_select-83QA",title:"packages-ListSelect-title-eOZz",content:"packages-ListSelect-content-g6tF",left:"packages-ListSelect-left-3xR9",item:"packages-ListSelect-item-1TtQ",item_l:"packages-ListSelect-item_l-2OUN",selected:"packages-ListSelect-selected-1V7w",right:"packages-ListSelect-right-3GvU",r_div:"packages-ListSelect-r_div-2m0w",img_code:"packages-ListSelect-img_code-24n2",r_title:"packages-ListSelect-r_title-12wf",r_hint:"packages-ListSelect-r_hint-189D"}}))},o=i.normalizeComponent({render:c,staticRenderFns:[]},a,r,undefined,false,undefined,!1,i.createInjector,void 0,void 0);module.exports=o;
1
+ "use strict";var e=require("./index-c2b22c86.js"),t=require("./utils.js"),n=require("./staticImg.js"),i=require("./browser-f7f8eb3f.js");function s(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}require("vue");var r={name:"ListSelect",props:{value:{type:Object,default:function(){return{}},desc:"当前选中项"},list:{type:Array,required:!0,desc:"属性说明"},title:{type:String,default:"",desc:"标题"},codeTitle:{type:String,default:"",desc:"二维码标题"},qrPath:{type:String,default:"",desc:"二维码链接"}},watch:{qrPath:{handler:function(e){this.initQr(e)},immediate:!0},value:{handler:function(e){var t=this.findObjectIndex(this.list,e);t>-1&&(this.selectIndex=t)},immediate:!0},list:{handler:function(e){e.length&&this.inits()},immediate:!0}},emits:{change:function(e){return"选中当前项"},input:function(e){return"内容变化时触发"},onFocus:function(e){return"获得当前焦点所在项"}},slots:{item:{desc:"列表元素"},hint:{desc:"二维码下方提示"}},data:function(){var e=t.ftvsTvScope.apply(this);return{ftvsTvInit:e.ftvsTvInit,ftvsTvReset:e.ftvsTvReset,qrcodeThis:void 0,QRCode:null,selectIndex:null,staticCodeIcon:n.staticCodeIcon,selected:n.staticSelectedIcon,wxIcon:n.staticWxIcon}},methods:{initQr:function(t){var n=this;return e._asyncToGenerator(e.regenerator.mark(function i(){var r;return e.regenerator.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==n.QRCode){e.next=2;break}return e.next=1,Promise.resolve().then(function(){return s(require("qrcodejs2"))});case 1:n.QRCode=e.sent.default;case 2:if(t){e.next=3;break}return e.abrupt("return");case 3:r={text:t,width:314,height:316,colorDark:"#000000",colorLight:"#ffffff",correctLevel:n.QRCode.CorrectLevel.H},void 0!==n.qrcodeThis?(n.qrcodeThis.clear(),n.qrcodeThis.makeCode(t)):n.qrcodeThis=new n.QRCode(n.$refs.ftvsQrCode,r),n.$nextTick(function(){n.forceRepaint(n.$refs.ftvsQrCode)});case 4:case"end":return e.stop()}},i)}))()},forceRepaint:function(e){e.style.display="none",e.offsetHeight,e.style.display="flex"},findObjectIndex:function(e,t){return e.findIndex(function(e){return Object.keys(t).every(function(n){return e[n]===t[n]})})},_tvRest:function(){this.ftvsTvReset()},change:function(e,t){this.selectIndex=t,this.$emit("input",e),this.$emit("change",{item:e,index:t}),this.ftvsTvReset()},onFocus:function(e,t){this.$emit("onFocus",{item:e,index:t})},inits:function(){var t=this;return e._asyncToGenerator(e.regenerator.mark(function n(){return e.regenerator.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:t.$nextTick(e._asyncToGenerator(e.regenerator.mark(function n(){return e.regenerator.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t.ftvsTvInit({distanceToCenter:!0,scrollEl:t.$refs.left,limitingEl:t.$refs.left},function(){var e=t.$refs.left,n=e?e.querySelectorAll(".".concat(t.$style.item)):null;n&&n.length&&t.$tv.next(n[t.selectIndex||0])});case 1:case"end":return e.stop()}},n)})));case 1:case"end":return n.stop()}},n)}))()}},beforeDestroy:function(){this.ftvsTvReset()},mounted:function(){}},c=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:e.$style.list_select},[e.title?n("div",{class:e.$style.title},[e._v(e._s(e.title))]):e._e(),e._v(" "),n("div",{class:e.$style.content},[e.list.length?n("div",{ref:"left",class:e.$style.left},e._l(e.list,function(t,i){return n("div",{directives:[{name:"focusable",rawName:"v-focusable"}],key:i+"-ftvs-file-bg-list",class:e.$style.item,on:{click:function(n){return e.change(t,i)},onFocus:function(n){return e.onFocus(t,i)}}},[n("div",{class:e.$style.item_l},[e._t("item",function(){return[n("div",[e._v("\n "+e._s(t.memberName)+" "+e._s(t.sexText)+" "+e._s(t.age)+"岁\n ")])]},{item:t,index:i})],2),e._v(" "),i===e.selectIndex?n("img",{class:e.$style.selected,attrs:{src:e.selected}}):e._e()])}),0):e._e(),e._v(" "),n("div",{class:e.$style.right,style:{background:"url('"+e.staticCodeIcon+"')"}},[n("div",{class:e.$style.r_div},[n("div",{class:e.$style.r_title},[e._v(e._s(e.codeTitle))]),e._v(" "),n("div",{ref:"ftvsQrCode",class:e.$style.img_code}),e._v(" "),e._t("hint",function(){return[n("div",{class:e.$style.r_hint},[n("img",{attrs:{src:e.wxIcon}}),e._v("\n 使用微信扫码\n ")])]})],2)])])])};c._withStripped=!0;var a=function(e){e&&(e("data-v-5ffffc7d_0",{source:"",map:void 0,media:void 0}),Object.defineProperty(this,"$style",{value:{list_select:"packages-ListSelect-list_select-83QA",title:"packages-ListSelect-title-eOZz",content:"packages-ListSelect-content-g6tF",left:"packages-ListSelect-left-3xR9",item:"packages-ListSelect-item-1TtQ",item_l:"packages-ListSelect-item_l-2OUN",selected:"packages-ListSelect-selected-1V7w",right:"packages-ListSelect-right-3GvU",r_div:"packages-ListSelect-r_div-2m0w",img_code:"packages-ListSelect-img_code-24n2",r_title:"packages-ListSelect-r_title-12wf",r_hint:"packages-ListSelect-r_hint-189D"}}))},o=i.normalizeComponent({render:c,staticRenderFns:[]},a,r,undefined,false,undefined,!1,i.createInjector,void 0,void 0);module.exports=o;
package/lib/cjs/Picker.js CHANGED
@@ -1 +1 @@
1
- "use strict";var n=require("./index-42a2cd0c.js"),e=require("vant"),t=require("./utils.js"),o=require("./browser-6bf896d2.js");function s(n){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},s(n)}function i(n,e){var t="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=function(n,e){if(n){if("string"==typeof n)return r(n,e);var t={}.toString.call(n).slice(8,-1);return"Object"===t&&n.constructor&&(t=n.constructor.name),"Map"===t||"Set"===t?Array.from(n):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?r(n,e):void 0}}(n))||e&&n&&"number"==typeof n.length){t&&(n=t);var o=0,s=function(){};return{s:s,n:function(){return o>=n.length?{done:!0}:{done:!1,value:n[o++]}},e:function(n){throw n},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,l=!1;return{s:function(){t=t.call(n)},n:function(){var n=t.next();return u=n.done,n},e:function(n){l=!0,i=n},f:function(){try{u||null==t.return||t.return()}finally{if(l)throw i}}}}function r(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,o=Array(e);t<e;t++)o[t]=n[t];return o}require("vue");var u={name:"Picker",components:{vantPicker:e.Picker,vanLoading:e.Loading},props:{valueKey:{type:String,default:"text",desc:"选项对象中,选项文字对应的键名"},idKey:{type:String,default:"id",desc:"选项对象中,唯一标识符,主要用于异步获取列数据"},deep:{type:Number,default:2,desc:"异步获取树状数据,层级默认为2,从1开始,目前仅支持2级树形结构"},columns:{type:[Array,Function],required:!0,desc:"对象数组,配置每一列显示的数据"}},emits:{confirm:function(n){return"最后一列选项改变时触发,单列:Picker 实例,选中值,选中值对应的索引\n多列:Picker 实例,所有列选中值,当前列对应的索引"}},data:function(){var n=t.ftvsTvScope.apply(this);return{ftvsTvInit:n.ftvsTvInit,ftvsTvReset:n.ftvsTvReset,loading:!1,vantColumns:[],itemHeight:t.ftvsPxToRem(130),isMove:!1,visibleItemCount:6,tvColumns:[],columnsNum:null,nowColumnsIndex:0,columnsType:"singleRow",isTree:!1}},computed:{nowColumns:function(){return this.tvColumns[this.nowColumnsIndex]},isSyncFn:function(){return"function"==typeof this.columns}},watch:{columns:{handler:function(n){var e=this;"function"!=typeof n?n.length&&(this.vantColumns=n,this.$nextTick(function(){e.init()})):this.getSyncFun(n)},immediate:!0,deep:!0}},methods:{setPracticalIndex:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=this.getColumnsIndexes(),t=n||this.nowColumnsIndex;this.tvColumns[t].focusIndex=e[t]||null},selectVal:function(n){var e,t=this,o=n.target;if(!this.loading){var s=o.parentNode,i=s.parentNode,r=null===(e=Array.from(null==i?void 0:i.children))||void 0===e?void 0:e.indexOf(s),u=Number(o.parentNode.parentNode.getAttribute("data-tv-index"));this.nowColumnsIndex=u,this.$set(this.tvColumns[u],"focusIndex",r),this.setNowColumnsFocus(),this.$refs.vantPicker.setColumnIndex(this.nowColumnsIndex,this.nowColumns.focusIndex),this.isTree&&this.resetColumnFocusIndex();var l,a=this.$refs.vantPicker.getValues();l="singleRow"===this.columnsType?a[0]:this.isTree?a.map(function(n){return n&&n[t.valueKey]}):a,this.emitVal(l,a)}},emitVal:function(n,e){var t=this;if("function"==typeof this.columns&&this.nowColumnsIndex+1<this.deep)this.updateVantColumns();else{if(this.nowColumnsIndex+1===this.columnsNum){var o=[];try{o=this.$refs.vantPicker.getColumnValue(this.nowColumnsIndex)}catch(n){}var s={currentOption:o,selectedValuesKeys:n,selectedValues:e,selectedOptions:this.getColumnValues(this.nowColumnsIndex),selectedIndexes:this.getColumnsIndexes()};this.$emit("confirm",s),this.ftvsTvReset()}var i=this.tvColumns[this.nowColumnsIndex+1];i&&i.dom&&this.$nextTick(function(){t.updateColumns(i.dom,t.nowColumnsIndex+1,i.focusIndex)})}},toUp:function(){this.nowColumns.focusIndex>0&&(this.tvColumns[this.nowColumnsIndex].focusIndex--,this.setNowColumnsFocus(),this.move(this.nowColumns.focusIndex))},toLeft:function(){this.nowColumnsIndex>0&&(this.nowColumnsIndex--,this.setPracticalIndex(this.nowColumnsIndex+1),this.setNowColumnsFocus())},toRight:function(){this.nowColumnsIndex<this.tvColumns.length-1&&(this.nowColumnsIndex++,this.setNowColumnsFocus(),this.move(this.nowColumns.focusIndex))},toDown:function(){this.nowColumns.focusIndex<this.nowColumns.focusNum-1&&(this.tvColumns[this.nowColumnsIndex].focusIndex++,this.setNowColumnsFocus(),this.move(this.nowColumns.focusIndex))},getColumnsIndexes:function(){return this.$refs.vantPicker.getIndexes()},getColumnValues:function(n){return this.$refs.vantPicker.getColumnValues(n)},resetColumnFocusIndex:function(){for(var n=this.nowColumnsIndex;n<this.tvColumns.length-1;n++)this.tvColumns[n+1].focusIndex=0},move:function(n){var e=this,t=this.$refs.vantPicker,o=t.children[this.nowColumnsIndex].options,s=t.children[this.nowColumnsIndex].itemHeight,i=function(n,e){var t,o,s;t=e,o=0,s=n.length;for(var i=e=Math.min(Math.max(t,o),s);i<n.length;i++)if(!n[i].disabled)return i;for(var r=e-1;r>=0;r--)if(!n[r].disabled)return r;return 0},r=function(n){return-i(o,n)*s+s*(e.visibleItemCount-1)/2}(n);this.nowColumns.dom.style.webkitTtransitionDuration="0ms",this.nowColumns.dom.style.webkitTransitionProperty="none",this.nowColumns.dom.style.webkitTransform="translate3d(0px, ".concat(r,"px, 0px)"),this.$forceUpdate()},getAndUpdateChildren:function(n,e,t){var o=this,s=function(n){var r,u=i(n);try{for(u.s();!(r=u.n()).done;){var l=r.value;if(l[o.idKey]===e)return t&&o.$set(l,"children",t),l;if(l.children){var a=s(l.children);if(a)return a}}}catch(n){u.e(n)}finally{u.f()}return null},r=s(n);return r&&r.children||[]},updateVantColumns:function(){var e=this;return n._asyncToGenerator(n.regenerator.mark(function t(){var o,s,i;return n.regenerator.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(e.isSyncFn&&e.nowColumnsIndex+1!==e.deep){n.next=1;break}return n.abrupt("return");case 1:if(o=e.$refs.vantPicker.getColumnValues(e.nowColumnsIndex)[e.nowColumns.focusIndex],s=e.getAndUpdateChildren(e.vantColumns,o[e.idKey]),i=[],s.length){n.next=3;break}return e.loading=!0,n.next=2,e.columns({level:e.nowColumnsIndex+1,item:o});case 2:i=n.sent,n.next=4;break;case 3:i=s;case 4:e.getAndUpdateChildren(e.vantColumns,o[e.idKey],i),e.$refs.vantPicker.setColumnValues(e.nowColumnsIndex+1,i),e.$nextTick(function(){e.updateTvColumns()}),e.loading=!1;case 5:case"end":return n.stop()}},t)}))()},setNowColumnsFocus:function(){var n=this.tvColumns[this.nowColumnsIndex];null===n.focusIndex&&(n.focusIndex=this.getColumnsIndexes()[this.nowColumnsIndex]);var e=n.dom.querySelectorAll("li")[n.focusIndex].children[0];this.$tv.next(e),this.isMove=!0},setColumnsType:function(){var n=this.vantColumns[0];"object"===s(n)&&(n.hasOwnProperty("children")||n.hasOwnProperty("values"))&&(n.hasOwnProperty("children")&&(this.isTree=!0),this.columnsType="multiColumn")},againFocus:function(){this.isMove&&(this.ftvsTvInit(),this.setNowColumnsFocus())},updateColumns:function(n,e){this.tvColumns[e].focusNum=n.querySelectorAll("li").length},getSyncFun:function(e){var t=this;return n._asyncToGenerator(n.regenerator.mark(function o(){var s;return n.regenerator.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return t.loading=!0,n.next=1,e({level:0,item:null});case 1:(s=n.sent)&&s[0]&&!s[0].hasOwnProperty("children")?t.vantColumns=s.map(function(n){return n.children=[],n}):t.vantColumns=s,t.setColumnsType(),t.$nextTick(function(){t.init(),t.updateVantColumns()});case 2:case"end":return n.stop()}},o)}))()},updateTvColumns:function(){var n="singleRow"===this.columnsType,e=this.$refs.vantPicker.$el.querySelectorAll("ul");this.columnsNum=n?1:e.length;for(var t=0;t<e.length;t++){var o=e[t];o.setAttribute("data-tv-index",t);var s=this.tvColumns[t]?this.tvColumns[t]:{};s.focusNum!==o.querySelectorAll("li").length&&this.$set(this.tvColumns,t,{focusIndex:s.focusIndex>=0?s.focusIndex:null,focusNum:o.querySelectorAll("li").length,dom:o})}},init:function(){this.ftvsTvInit(),this.setColumnsType(),this.updateTvColumns(),this.setNowColumnsFocus()}},beforeDestroy:function(){this.ftvsTvReset()},mounted:function(){}},l=u,a=function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("div",[t("vantPicker",{ref:"vantPicker",class:n.$style.picker,attrs:{columns:n.vantColumns,"value-key":n.valueKey,"item-height":n.itemHeight},scopedSlots:n._u([{key:"option",fn:function(e){return[t("div",{directives:[{name:"focusable",rawName:"v-focusable"}],class:n.$style.column_item,on:{up:n.toUp,left:n.toLeft,right:n.toRight,down:n.toDown,click:n.selectVal}},[t("span",["string"==typeof e||"number"==typeof e?[n._v("\n "+n._s(e)+"\n ")]:[n._v(n._s(e[n.valueKey]))]],2)])]}}])}),n._v(" "),n.loading?t("div",{class:n.$style.loading},[t("vanLoading",{attrs:{size:"46"}})],1):n._e()],1)};a._withStripped=!0;var c=function(n){n&&(n("data-v-08eb1abc_0",{source:"",map:void 0,media:void 0}),Object.defineProperty(this,"$style",{value:{loading:"packages-Picker-loading-1W4w",picker:"packages-Picker-picker-3oJS",column_item:"packages-Picker-column_item-3Wh4"}}))},m=o.normalizeComponent({render:a,staticRenderFns:[]},c,l,undefined,false,undefined,!1,o.createInjector,void 0,void 0);module.exports=m;
1
+ "use strict";var n=require("./index-c2b22c86.js"),e=require("vant"),t=require("./utils.js"),o=require("./browser-f7f8eb3f.js");function r(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,o=new Array(e);t<e;t++)o[t]=n[t];return o}function s(n){return function(n){if(Array.isArray(n))return r(n)}(n)||function(n){if("undefined"!=typeof Symbol&&null!=n[Symbol.iterator]||null!=n["@@iterator"])return Array.from(n)}(n)||function(n,e){if(n){if("string"==typeof n)return r(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);return"Object"===t&&n.constructor&&(t=n.constructor.name),"Map"===t||"Set"===t?Array.from(n):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?r(n,e):void 0}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(n){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},i(n)}function u(n,e){var t="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=function(n,e){if(n){if("string"==typeof n)return l(n,e);var t={}.toString.call(n).slice(8,-1);return"Object"===t&&n.constructor&&(t=n.constructor.name),"Map"===t||"Set"===t?Array.from(n):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?l(n,e):void 0}}(n))||e&&n&&"number"==typeof n.length){t&&(n=t);var o=0,r=function(){};return{s:r,n:function(){return o>=n.length?{done:!0}:{done:!1,value:n[o++]}},e:function(n){throw n},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,i=!0,u=!1;return{s:function(){t=t.call(n)},n:function(){var n=t.next();return i=n.done,n},e:function(n){u=!0,s=n},f:function(){try{i||null==t.return||t.return()}finally{if(u)throw s}}}}function l(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,o=Array(e);t<e;t++)o[t]=n[t];return o}require("vue");var a={name:"Picker",components:{vantPicker:e.Picker,vanLoading:e.Loading},inject:["popupRoot"],props:{valueKey:{type:String,default:"text",desc:"选项对象中,选项文字对应的键名"},idKey:{type:String,default:"id",desc:"选项对象中,唯一标识符,主要用于异步获取列数据"},deep:{type:Number,default:2,desc:"异步获取树状数据,层级默认为2,从1开始,目前仅支持2级树形结构"},loadingBg:{type:String,default:"transparent",desc:"loading背景色(异步加载时可以用)"},columns:{type:[Array,Function],required:!0,desc:"对象数组,配置每一列显示的数据"}},emits:{confirm:function(n){return"最后一列选项改变时触发,单列:Picker 实例,选中值,选中值对应的索引\n多列:Picker 实例,所有列选中值,当前列对应的索引"}},data:function(){var n=t.ftvsTvScope.apply(this);return{ftvsTvInit:n.ftvsTvInit,ftvsTvReset:n.ftvsTvReset,loadingBgColor:"transparent",loading:!1,vantColumns:[],itemHeight:t.ftvsPxToRem(130),isMove:!1,visibleItemCount:6,tvColumns:[],columnsNum:null,nowColumnsIndex:0,columnsType:"singleRow",isTree:!1}},computed:{nowColumns:function(){return this.tvColumns[this.nowColumnsIndex]},isSyncFn:function(){return"function"==typeof this.columns}},watch:{columns:{handler:function(n){var e=this;"function"!=typeof n?n.length&&(this.vantColumns=n,this.$nextTick(function(){e.init()})):this.getSyncFun(n)},immediate:!0,deep:!0}},methods:{setPracticalIndex:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=this.getColumnsIndexes(),t=n||this.nowColumnsIndex;this.tvColumns[t].focusIndex=e[t]||null},selectVal:function(n){var e,t=this,o=n.target;if(!this.loading){var r=o.parentNode,s=r.parentNode,i=null===(e=Array.from(null==s?void 0:s.children))||void 0===e?void 0:e.indexOf(r),u=Number(o.parentNode.parentNode.getAttribute("data-tv-index"));this.nowColumnsIndex=u,this.$set(this.tvColumns[u],"focusIndex",i),this.setNowColumnsFocus(),this.$refs.vantPicker.setColumnIndex(this.nowColumnsIndex,this.nowColumns.focusIndex),this.isTree&&this.resetColumnFocusIndex();var l,a=this.$refs.vantPicker.getValues();l="singleRow"===this.columnsType?a[0]:this.isTree?a.map(function(n){return n&&n[t.valueKey]}):a,this.emitVal(l,a)}},emitVal:function(n,e){var t=this;if("function"==typeof this.columns&&this.nowColumnsIndex+1<this.deep)return this.loadingBgColor=this.loadingBg,void this.updateVantColumns();if(this.nowColumnsIndex+1===this.columnsNum){var o=[];try{o=this.$refs.vantPicker.getColumnValue(this.nowColumnsIndex)}catch(n){}var r={currentOption:o,selectedValuesKeys:n,selectedValues:e,selectedOptions:this.getColumnValues(this.nowColumnsIndex),selectedIndexes:this.getColumnsIndexes()};this.$emit("confirm",r),this.ftvsTvReset()}var s=this.tvColumns[this.nowColumnsIndex+1];s&&s.dom&&this.$nextTick(function(){t.updateColumns(s.dom,t.nowColumnsIndex+1,s.focusIndex)})},toUp:function(){this.nowColumns.focusIndex>0&&(this.tvColumns[this.nowColumnsIndex].focusIndex--,this.setNowColumnsFocus(),this.move(this.nowColumns.focusIndex))},toLeft:function(){this.nowColumnsIndex>0&&(this.nowColumnsIndex--,this.setPracticalIndex(this.nowColumnsIndex+1),this.setNowColumnsFocus())},toRight:function(){this.nowColumnsIndex<this.tvColumns.length-1&&(this.nowColumnsIndex++,this.setNowColumnsFocus(),this.move(this.nowColumns.focusIndex))},toDown:function(){this.nowColumns.focusIndex<this.nowColumns.focusNum-1&&(this.tvColumns[this.nowColumnsIndex].focusIndex++,this.setNowColumnsFocus(),this.move(this.nowColumns.focusIndex))},getColumnsIndexes:function(){return this.$refs.vantPicker.getIndexes()},getColumnValues:function(n){return this.$refs.vantPicker.getColumnValues(n)},resetColumnFocusIndex:function(){for(var n=this.nowColumnsIndex;n<this.tvColumns.length-1;n++)this.tvColumns[n+1].focusIndex=0},move:function(n){var e=this,t=this.$refs.vantPicker,o=t.children[this.nowColumnsIndex].options,r=t.children[this.nowColumnsIndex].itemHeight,s=function(n,e){var t,o,r;t=e,o=0,r=n.length;for(var s=e=Math.min(Math.max(t,o),r);s<n.length;s++)if(!n[s].disabled)return s;for(var i=e-1;i>=0;i--)if(!n[i].disabled)return i;return 0},i=function(n){return-s(o,n)*r+r*(e.visibleItemCount-1)/2}(n);this.nowColumns.dom.style.webkitTtransitionDuration="0ms",this.nowColumns.dom.style.webkitTransitionProperty="none",this.nowColumns.dom.style.webkitTransform="translate3d(0px, ".concat(i,"px, 0px)"),this.$forceUpdate()},getAndUpdateChildren:function(n,e,t){var o=this,r=function(n){var s,i=u(n);try{for(i.s();!(s=i.n()).done;){var l=s.value;if(l[o.idKey]===e)return t&&o.$set(l,"children",t),l;if(l.children){var a=r(l.children);if(a)return a}}}catch(n){i.e(n)}finally{i.f()}return null},s=r(n);return s&&s.children||[]},updateVantColumns:function(){var e=this;return n._asyncToGenerator(n.regenerator.mark(function t(){var o,r,s,i,u,l;return n.regenerator.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if((o=e).isSyncFn&&o.nowColumnsIndex+1!==o.deep){n.next=1;break}return n.abrupt("return");case 1:if(r=o.$refs.vantPicker.getColumnValues(o.nowColumnsIndex)[o.nowColumns.focusIndex],s=o.getAndUpdateChildren(o.vantColumns,r[o.idKey]),i=[],s.length){n.next=3;break}return o.loading=!0,n.next=2,e.buildTree(o.columns,e.deep,o.nowColumnsIndex+1,r);case 2:i=n.sent,n.next=4;break;case 3:i=s;case 4:for(o.getAndUpdateChildren(o.vantColumns,r[o.idKey],i),u=o.nowColumnsIndex+1;u<o.columnsNum;u++)l=e.getNodesByLevel(i,u),o.$refs.vantPicker.setColumnValues(u,l);o.$nextTick(function(){o.updateTvColumns()}),o.loading=!1;case 5:case"end":return n.stop()}},t)}))()},setNowColumnsFocus:function(){var n=this.tvColumns[this.nowColumnsIndex];null===n.focusIndex&&(n.focusIndex=this.getColumnsIndexes()[this.nowColumnsIndex]);var e=n.dom.querySelectorAll("li")[n.focusIndex].children[0];this.$tv.next(e),this.isMove=!0},setColumnsType:function(){var n=this.vantColumns[0];"object"===i(n)&&(n.hasOwnProperty("children")||n.hasOwnProperty("values"))&&(n.hasOwnProperty("children")&&(this.isTree=!0),this.columnsType="multiColumn")},recoverFocus:function(){this.isMove&&(this.ftvsTvInit(),this.setNowColumnsFocus())},againFocus:function(){},updateColumns:function(n,e){this.tvColumns[e].focusNum=n.querySelectorAll("li").length},getNodesByLevel:function(n,e){var t=[];return function n(o){var r,s=u(o);try{for(s.s();!(r=s.n()).done;){var i=r.value;i.level===e&&t.push(i),i.children&&i.children.length&&n(i.children)}}catch(n){s.e(n)}finally{s.f()}}(n),t},buildTree:function(e,t){var o=arguments,r=this;return n._asyncToGenerator(n.regenerator.mark(function i(){var u,l,a,c,d,m,f;return n.regenerator.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(l=o.length>3&&void 0!==o[3]?o[3]:{},!((u=o.length>2&&void 0!==o[2]?o[2]:0)>=t)){n.next=1;break}return n.abrupt("return",null);case 1:return n.next=2,e({level:u,item:l});case 2:if(a=n.sent,c=a.map(function(n){return n.children=u+1<t?[]:null,n.level=u,n}),c.length){n.next=3;break}return n.abrupt("return",null);case 3:return d=c[0],n.next=4,r.buildTree(e,t,u+1,d);case 4:return(m=n.sent)&&m.length&&d&&(f=d.children).push.apply(f,s(m)),n.abrupt("return",c);case 5:case"end":return n.stop()}},i)}))()},getSyncFun:function(e){var t=this;return n._asyncToGenerator(n.regenerator.mark(function o(){var r;return n.regenerator.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return t.loading=!0,n.next=1,e({level:0,item:null});case 1:if(!(r=n.sent)||!r[0]||r[0].hasOwnProperty("children")){n.next=3;break}return n.next=2,t.buildTree(e,t.deep);case 2:t.vantColumns=n.sent,n.next=4;break;case 3:t.vantColumns=r;case 4:t.setColumnsType(),t.$nextTick(function(){t.init(),t.updateVantColumns()});case 5:case"end":return n.stop()}},o)}))()},updateTvColumns:function(){var n="singleRow"===this.columnsType,e=this.$refs.vantPicker.$el.querySelectorAll("ul");this.columnsNum=n?1:e.length;for(var t=0;t<e.length;t++){var o=e[t];o.setAttribute("data-tv-index",t);var r=this.tvColumns[t]?this.tvColumns[t]:{};r.focusNum!==o.querySelectorAll("li").length&&this.$set(this.tvColumns,t,{focusIndex:r.focusIndex>=0?r.focusIndex:null,focusNum:o.querySelectorAll("li").length,dom:o})}},init:function(){this.ftvsTvInit(),this.setColumnsType(),this.updateTvColumns(),this.setNowColumnsFocus()}},beforeDestroy:function(){this.ftvsTvReset()},mounted:function(){this.popupRoot&&"function"==typeof this.popupRoot.getSlotPicker&&this.popupRoot.getSlotPicker(this)}},c=a,d=function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("div",[t("vantPicker",{ref:"vantPicker",class:n.$style.picker,attrs:{columns:n.vantColumns,"value-key":n.valueKey,"item-height":n.itemHeight},scopedSlots:n._u([{key:"option",fn:function(e){return[t("div",{directives:[{name:"focusable",rawName:"v-focusable"}],class:n.$style.column_item,on:{up:n.toUp,left:n.toLeft,right:n.toRight,down:n.toDown,click:n.selectVal}},[t("span",["string"==typeof e||"number"==typeof e?[n._v("\n "+n._s(e)+"\n ")]:[n._v(n._s(e[n.valueKey]))]],2)])]}}])}),n._v(" "),n.loading?t("div",{class:n.$style.loading,style:{"--loading-bg-color":n.loadingBgColor}},[t("vanLoading",{attrs:{size:"46"}})],1):n._e()],1)};d._withStripped=!0;var m=function(n){n&&(n("data-v-36e5a0a8_0",{source:"",map:void 0,media:void 0}),Object.defineProperty(this,"$style",{value:{loading:"packages-Picker-loading-1W4w",picker:"packages-Picker-picker-3oJS",column_item:"packages-Picker-column_item-3Wh4"}}))},f=o.normalizeComponent({render:d,staticRenderFns:[]},m,c,undefined,false,undefined,!1,o.createInjector,void 0,void 0);module.exports=f;
package/lib/cjs/Popup.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e=require("vant"),o=require("./browser-6bf896d2.js"),t={name:"Popup",components:{vantPopup:e.Popup},props:{value:{type:Boolean,required:!0,desc:"属性说明"},position:{type:String,default:"center",desc:"弹出位置,可选值为 top bottom right left"},closeable:{type:Boolean,default:!1,desc:"是否显示关闭图标"},getContainer:{type:String,desc:"挂载节点, 使用 get-container 属性的组件不能为根节点"},overlay:{type:Boolean,default:!0,desc:"是否显示遮罩层"},duration:{type:[Number,String],default:.3,desc:"动画时长,单位秒"},overlayClass:{type:String,desc:"自定义遮罩层类名"},overlayStyle:{type:Object,default:function(){return{backgroundColor:"#151d2b"}},desc:"自定义遮罩层样式"},closeOnPopstate:{type:Boolean,default:!1,desc:"是否在页面回退时自动关闭"},closeOnClickOverlay:{type:Boolean,default:!1,desc:"是否在点击遮罩层后关闭"}},emits:{clickCloseIcon:function(e){return"点击关闭图标时触发"},click:function(e){return"点击弹出层时触发"},clickOverlay:function(){return"点击遮罩层时触发"},open:function(){return"打开弹出层时触发"},close:function(){return"关闭弹出层时触发"},opened:function(){return"打开弹出层且动画结束后触发"},closed:function(){return"关闭弹出层且动画结束后触发"}},data:function(){return{show:!1}},watch:{value:{handler:function(e){this.show=e},immediate:!0},show:{handler:function(e){this.$emit("input",e)}}},methods:{clickCloseIcon:function(e){this.$emit("clickCloseIcon",e)},click:function(e){this.$emit("click",e)},clickOverlay:function(){this.$emit("clickOverlay")},open:function(){this.$emit("open")},close:function(){this.$emit("close")},opened:function(){this.$emit("opened")},closed:function(){this.$emit("closed")}},mounted:function(){}},n=function(){var e=this,o=e.$createElement;return(e._self._c||o)("vantPopup",{class:e.$style.popup,attrs:{position:e.position,closeable:e.closeable,"get-container":e.getContainer,overlay:e.overlay,"overlay-class":e.overlayClass,"overlay-style":e.overlayStyle,"close-on-popstate":e.closeOnPopstate,"close-on-click-overlay":e.closeOnClickOverlay,duration:e.duration},on:{"click-close-icon":e.clickCloseIcon,click:e.click,"click-overlay":e.clickOverlay,open:e.open,close:e.close,opened:e.opened,closed:e.closed},model:{value:e.show,callback:function(o){e.show=o},expression:"show"}},[e._t("default")],2)};n._withStripped=!0;var c=function(e){e&&(e("data-v-ba0ffae0_0",{source:"",map:void 0,media:void 0}),Object.defineProperty(this,"$style",{value:{popup:"packages-Popup-popup-1uSf"}}))},l=o.normalizeComponent({render:n,staticRenderFns:[]},c,t,undefined,false,undefined,!1,o.createInjector,void 0,void 0);module.exports=l;
1
+ "use strict";var e=require("vant"),o=require("./browser-f7f8eb3f.js"),t={name:"Popup",components:{vantPopup:e.Popup},provide:function(){return{popupRoot:this}},props:{value:{type:Boolean,required:!0,desc:"属性说明"},position:{type:String,default:"center",desc:"弹出位置,可选值为 top bottom right left"},closeable:{type:Boolean,default:!1,desc:"是否显示关闭图标"},getContainer:{type:String,desc:"挂载节点, 使用 get-container 属性的组件不能为根节点"},overlay:{type:Boolean,default:!0,desc:"是否显示遮罩层"},duration:{type:[Number,String],default:.3,desc:"动画时长,单位秒"},overlayClass:{type:String,desc:"自定义遮罩层类名"},overlayStyle:{type:Object,default:function(){return{backgroundColor:"#151d2b"}},desc:"自定义遮罩层样式"},closeOnPopstate:{type:Boolean,default:!1,desc:"是否在页面回退时自动关闭"},closeOnClickOverlay:{type:Boolean,default:!1,desc:"是否在点击遮罩层后关闭"}},emits:{clickCloseIcon:function(e){return"点击关闭图标时触发"},click:function(e){return"点击弹出层时触发"},clickOverlay:function(){return"点击遮罩层时触发"},open:function(){return"打开弹出层时触发"},close:function(){return"关闭弹出层时触发"},opened:function(){return"打开弹出层且动画结束后触发"},closed:function(){return"关闭弹出层且动画结束后触发"}},data:function(){return{show:!1,slotPicker:null}},watch:{value:{handler:function(e){var o,t=this;(this.show=e,e)?this.$nextTick(function(){var e;null===(e=t.slotPicker)||void 0===e||e.recoverFocus()}):null===(o=this.slotPicker)||void 0===o||o.ftvsTvReset()},immediate:!0},show:{handler:function(e){this.$emit("input",e)}}},methods:{getSlotPicker:function(e){this.slotPicker=e},clickCloseIcon:function(e){this.$emit("clickCloseIcon",e)},click:function(e){this.$emit("click",e)},clickOverlay:function(){this.$emit("clickOverlay")},open:function(){this.$emit("open")},close:function(){this.$emit("close")},opened:function(){this.$emit("opened")},closed:function(){this.$emit("closed")}},mounted:function(){}},n=function(){var e=this,o=e.$createElement;return(e._self._c||o)("vantPopup",{class:e.$style.popup,attrs:{position:e.position,closeable:e.closeable,"get-container":e.getContainer,overlay:e.overlay,"overlay-class":e.overlayClass,"overlay-style":e.overlayStyle,"close-on-popstate":e.closeOnPopstate,"close-on-click-overlay":e.closeOnClickOverlay,duration:e.duration},on:{"click-close-icon":e.clickCloseIcon,click:e.click,"click-overlay":e.clickOverlay,open:e.open,close:e.close,opened:e.opened,closed:e.closed},model:{value:e.show,callback:function(o){e.show=o},expression:"show"}},[e._t("default")],2)};n._withStripped=!0;var c=function(e){e&&(e("data-v-70abecec_0",{source:"",map:void 0,media:void 0}),Object.defineProperty(this,"$style",{value:{popup:"packages-Popup-popup-1uSf"}}))},i=o.normalizeComponent({render:n,staticRenderFns:[]},c,t,undefined,false,undefined,!1,o.createInjector,void 0,void 0);module.exports=i;
@@ -1 +1 @@
1
- "use strict";var e=require("./index-42a2cd0c.js"),t=require("vue"),n=require("./Popup.js"),s=require("./ListSelect.js"),r=require("./staticImg.js"),i=require("./browser-6bf896d2.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("vant"),require("./utils.js");var c=a(t),o=function(){var t=e._asyncToGenerator(e.regenerator.mark(function t(){var n;return e.regenerator.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=[],!c.default.prototype.$ftvsApiConfigInfo.selectAddressFn){e.next=1;break}return e.next=1,c.default.prototype.$ftvsApiConfigInfo.selectAddressFn().then(function(e){n=e||[]});case 1:return e.abrupt("return",n);case 2:case"end":return e.stop()}},t)}));return function(){return t.apply(this,arguments)}}(),u={name:"SelectAddress",components:{Popup:n,ListSelect:s},props:{value:{type:Boolean,default:!1,required:!0,desc:"是否展示"},title:{type:String,default:"收货地址",desc:"标题"},codeTitle:{type:String,default:"添加或编辑地址",desc:"二维码标题"}},watch:{value:{handler:function(e){this.show=e,e&&this.inits()},immediate:!0},show:function(e){e||this.$refs.listSelect._tvRest(),this.$emit("input",e)}},emits:{input:function(e){return"内容变化时触发"},change:function(e){return"选中当前项"},list:function(e){return"地址数据返回"}},data:function(){return{nowIndex:null,staticSiteSelectIcon:r.staticSiteSelectIcon,staticSiteUnSelectIcon:r.staticSiteUnSelectIcon,list:[],QrPath:"",show:!1}},getList:function(){return e._asyncToGenerator(e.regenerator.mark(function t(){return e.regenerator.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,o();case 1:return e.abrupt("return",e.sent);case 2:case"end":return e.stop()}},t)}))()},methods:{getList:o,change:function(e){this.show=!1,this.$emit("change",e)},onFocus:function(e){var t=e.index;this.nowIndex=t},inits:function(){var t=this;return e._asyncToGenerator(e.regenerator.mark(function n(){var s;return e.regenerator.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:o().then(function(e){t.list=e,t.$emit("list",t.list)}),t.$ftvsApiConfigInfo.qrCodePathFn&&(s=t.$ftvsApiConfigInfo.qrCodePathFn(),t.QrPath=s.weAppSitePath);case 1:case"end":return e.stop()}},n)}))()}}},d=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("Popup",{class:e.$style.popup,model:{value:e.show,callback:function(t){e.show=t},expression:"show"}},[n("div",{class:e.$style.select_address},[n("ListSelect",{ref:"listSelect",attrs:{list:e.list,qrPath:e.QrPath,title:e.title,codeTitle:e.codeTitle},on:{onFocus:e.onFocus,change:e.change},scopedSlots:e._u([{key:"item",fn:function(t){var s=t.item,r=t.index;return[n("div",{class:[e.$style.item_title]},[n("img",{directives:[{name:"show",rawName:"v-show",value:e.nowIndex===r,expression:"nowIndex === index"}],attrs:{src:e.staticSiteSelectIcon}}),e._v(" "),n("img",{directives:[{name:"show",rawName:"v-show",value:e.nowIndex!==r,expression:"nowIndex !== index"}],attrs:{src:e.staticSiteUnSelectIcon}}),e._v(" "),n("div",[e._v("\n "+e._s(s.detail)+"\n ")])]),e._v(" "),n("div",{class:[e.$style.item_content,e.nowIndex===r&&e.$style.item_active]},[n("span",[e._v(e._s(s.receiver))]),e._v(" "),n("span",[e._v(e._s(s.phoneNo))]),e._v(" "),s.defaultFlag?n("span",{class:e.$style.def_text},[e._v("默认")]):e._e()])]}}])})],1)])};d._withStripped=!0;var l=function(e){e&&(e("data-v-b8cbe966_0",{source:"",map:void 0,media:void 0}),Object.defineProperty(this,"$style",{value:{popup:"packages-SelectAddress-popup-23a2",select_address:"packages-SelectAddress-select_address-3v1d",item_title:"packages-SelectAddress-item_title-1zWy",item_content:"packages-SelectAddress-item_content-kXYo",def_text:"packages-SelectAddress-def_text-2xeo",item_active:"packages-SelectAddress-item_active-3Xn3"}}))},p=i.normalizeComponent({render:d,staticRenderFns:[]},l,u,undefined,false,undefined,!1,i.createInjector,void 0,void 0);module.exports=p;
1
+ "use strict";var e=require("./index-c2b22c86.js"),t=require("vue"),n=require("./Popup.js"),s=require("./ListSelect.js"),i=require("./staticImg.js"),r=require("./browser-f7f8eb3f.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("vant"),require("./utils.js");var c=a(t),o=function(){var t=e._asyncToGenerator(e.regenerator.mark(function t(){var n;return e.regenerator.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=[],!c.default.prototype.$ftvsApiConfigInfo.selectAddressFn){e.next=1;break}return e.next=1,c.default.prototype.$ftvsApiConfigInfo.selectAddressFn().then(function(e){n=e||[]});case 1:return e.abrupt("return",n);case 2:case"end":return e.stop()}},t)}));return function(){return t.apply(this,arguments)}}(),u={name:"SelectAddress",components:{Popup:n,ListSelect:s},props:{value:{type:Boolean,default:!1,required:!0,desc:"是否展示"},title:{type:String,default:"收货地址",desc:"标题"},codeTitle:{type:String,default:"添加或编辑地址",desc:"二维码标题"}},watch:{value:{handler:function(e){this.show=e,e&&this.inits()},immediate:!0},show:function(e){clearInterval(this.timeId),e?this.updateList():this.$refs.listSelect._tvRest(),this.$emit("input",e)}},emits:{input:function(e){return"内容变化时触发"},change:function(e){return"选中当前项"},list:function(e){return"地址数据返回"}},data:function(){return{timeId:null,nowIndex:null,staticSiteSelectIcon:i.staticSiteSelectIcon,staticSiteUnSelectIcon:i.staticSiteUnSelectIcon,list:[],QrPath:"",show:!1}},getList:function(){return e._asyncToGenerator(e.regenerator.mark(function t(){return e.regenerator.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,o();case 1:return e.abrupt("return",e.sent);case 2:case"end":return e.stop()}},t)}))()},methods:{getList:o,change:function(e){this.show=!1,this.$emit("change",e)},onFocus:function(e){var t=e.index;this.nowIndex=t},updateList:function(){var e=this;this.timeId=setInterval(function(){o().then(function(t){e.list=t,e.$emit("list",e.list)})},2e3)},inits:function(){var t=this;return e._asyncToGenerator(e.regenerator.mark(function n(){var s;return e.regenerator.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:o().then(function(e){t.list=e,t.$emit("list",t.list)}),t.$ftvsApiConfigInfo.qrCodePathFn&&(s=t.$ftvsApiConfigInfo.qrCodePathFn(),t.QrPath=s.weAppSitePath);case 1:case"end":return e.stop()}},n)}))()}}},d=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("Popup",{class:e.$style.popup,model:{value:e.show,callback:function(t){e.show=t},expression:"show"}},[n("div",{class:e.$style.select_address},[n("ListSelect",{ref:"listSelect",attrs:{list:e.list,qrPath:e.QrPath,title:e.title,codeTitle:e.codeTitle},on:{onFocus:e.onFocus,change:e.change},scopedSlots:e._u([{key:"item",fn:function(t){var s=t.item,i=t.index;return[n("div",{class:[e.$style.item_title]},[n("img",{directives:[{name:"show",rawName:"v-show",value:e.nowIndex===i,expression:"nowIndex === index"}],attrs:{src:e.staticSiteSelectIcon}}),e._v(" "),n("img",{directives:[{name:"show",rawName:"v-show",value:e.nowIndex!==i,expression:"nowIndex !== index"}],attrs:{src:e.staticSiteUnSelectIcon}}),e._v(" "),n("div",[e._v("\n "+e._s(s.detail)+"\n ")])]),e._v(" "),n("div",{class:[e.$style.item_content,e.nowIndex===i&&e.$style.item_active]},[n("span",[e._v(e._s(s.receiver))]),e._v(" "),n("span",[e._v(e._s(s.phoneNo))]),e._v(" "),s.defaultFlag?n("span",{class:e.$style.def_text},[e._v("默认")]):e._e()])]}}])})],1)])};d._withStripped=!0;var l=function(e){e&&(e("data-v-ad0bc520_0",{source:"",map:void 0,media:void 0}),Object.defineProperty(this,"$style",{value:{popup:"packages-SelectAddress-popup-23a2",select_address:"packages-SelectAddress-select_address-3v1d",item_title:"packages-SelectAddress-item_title-1zWy",item_content:"packages-SelectAddress-item_content-kXYo",def_text:"packages-SelectAddress-def_text-2xeo",item_active:"packages-SelectAddress-item_active-3Xn3"}}))},p=r.normalizeComponent({render:d,staticRenderFns:[]},l,u,undefined,false,undefined,!1,r.createInjector,void 0,void 0);module.exports=p;
package/lib/cjs/index.css CHANGED
@@ -114,70 +114,6 @@
114
114
  color: rgba(0, 0, 0, 0.9);
115
115
  line-height: 42px;
116
116
  }
117
- .packages-FileBag-popup-Hc07 {
118
- background-color: transparent !important;
119
- }
120
- .packages-FileBag-file-bag-xapd {
121
- width: 1640px;
122
- height: 824px;
123
- box-sizing: border-box;
124
- padding: 40px;
125
- background: #363639;
126
- border-radius: 24px;
127
- border: 1px solid rgba(255, 255, 255, 0.5);
128
- }
129
- .packages-SelectAddress-popup-23a2 {
130
- background-color: transparent !important;
131
- }
132
- .packages-SelectAddress-select_address-3v1d {
133
- width: 1640px;
134
- height: 824px;
135
- box-sizing: border-box;
136
- padding: 40px;
137
- background: #363639;
138
- border-radius: 24px;
139
- border: 1px solid rgba(255, 255, 255, 0.5);
140
- }
141
- .packages-SelectAddress-select_address-3v1d .packages-SelectAddress-item_title-1zWy {
142
- display: flex;
143
- align-items: center;
144
- font-family: MiSans-Semibold;
145
- font-weight: 600;
146
- font-size: 32px;
147
- line-height: 42px;
148
- }
149
- .packages-SelectAddress-select_address-3v1d .packages-SelectAddress-item_title-1zWy img {
150
- width: 32px;
151
- height: 32px;
152
- margin-right: 10px;
153
- }
154
- .packages-SelectAddress-select_address-3v1d .packages-SelectAddress-item_content-kXYo {
155
- display: flex;
156
- align-items: center;
157
- font-family: MiSans-regular;
158
- font-weight: 400;
159
- font-size: 32px;
160
- color: rgba(255, 255, 255, 0.6);
161
- line-height: 42px;
162
- padding-left: 42px;
163
- margin-top: 16px;
164
- }
165
- .packages-SelectAddress-select_address-3v1d .packages-SelectAddress-item_content-kXYo span {
166
- margin-right: 20px;
167
- }
168
- .packages-SelectAddress-select_address-3v1d .packages-SelectAddress-item_content-kXYo .packages-SelectAddress-def_text-2xeo {
169
- font-family: MiSans-regular;
170
- font-weight: 400;
171
- font-size: 20px;
172
- color: #ffffff;
173
- line-height: 27px;
174
- padding: 2px 10px;
175
- background: #cc522c;
176
- border-radius: 7px;
177
- }
178
- .packages-SelectAddress-select_address-3v1d .packages-SelectAddress-item_active-3Xn3 {
179
- color: rgba(0, 0, 0, 0.9);
180
- }
181
117
  .packages-Picker-loading-1W4w {
182
118
  overflow: hidden;
183
119
  display: flex;
@@ -185,11 +121,14 @@
185
121
  justify-content: center;
186
122
  width: 100%;
187
123
  height: 100%;
124
+ min-width: 100px;
188
125
  position: absolute;
189
126
  left: 0;
190
127
  top: 0;
128
+ background: var(--loading-bg-color);
191
129
  }
192
130
  .packages-Picker-picker-3oJS {
131
+ min-width: 100px;
193
132
  background-color: transparent !important;
194
133
  }
195
134
  .packages-Picker-picker-3oJS .van-picker__mask,
@@ -245,6 +184,70 @@
245
184
  .packages-Popup-popup-1uSf {
246
185
  background-color: transparent !important;
247
186
  }
187
+ .packages-SelectAddress-popup-23a2 {
188
+ background-color: transparent !important;
189
+ }
190
+ .packages-SelectAddress-select_address-3v1d {
191
+ width: 1640px;
192
+ height: 824px;
193
+ box-sizing: border-box;
194
+ padding: 40px;
195
+ background: #363639;
196
+ border-radius: 24px;
197
+ border: 1px solid rgba(255, 255, 255, 0.5);
198
+ }
199
+ .packages-SelectAddress-select_address-3v1d .packages-SelectAddress-item_title-1zWy {
200
+ display: flex;
201
+ align-items: center;
202
+ font-family: MiSans-Semibold;
203
+ font-weight: 600;
204
+ font-size: 32px;
205
+ line-height: 42px;
206
+ }
207
+ .packages-SelectAddress-select_address-3v1d .packages-SelectAddress-item_title-1zWy img {
208
+ width: 32px;
209
+ height: 32px;
210
+ margin-right: 10px;
211
+ }
212
+ .packages-SelectAddress-select_address-3v1d .packages-SelectAddress-item_content-kXYo {
213
+ display: flex;
214
+ align-items: center;
215
+ font-family: MiSans-regular;
216
+ font-weight: 400;
217
+ font-size: 32px;
218
+ color: rgba(255, 255, 255, 0.6);
219
+ line-height: 42px;
220
+ padding-left: 42px;
221
+ margin-top: 16px;
222
+ }
223
+ .packages-SelectAddress-select_address-3v1d .packages-SelectAddress-item_content-kXYo span {
224
+ margin-right: 20px;
225
+ }
226
+ .packages-SelectAddress-select_address-3v1d .packages-SelectAddress-item_content-kXYo .packages-SelectAddress-def_text-2xeo {
227
+ font-family: MiSans-regular;
228
+ font-weight: 400;
229
+ font-size: 20px;
230
+ color: #ffffff;
231
+ line-height: 27px;
232
+ padding: 2px 10px;
233
+ background: #cc522c;
234
+ border-radius: 7px;
235
+ }
236
+ .packages-SelectAddress-select_address-3v1d .packages-SelectAddress-item_active-3Xn3 {
237
+ color: rgba(0, 0, 0, 0.9);
238
+ }
239
+ .packages-FileBag-popup-Hc07 {
240
+ background-color: transparent !important;
241
+ }
242
+ .packages-FileBag-file-bag-xapd {
243
+ width: 1640px;
244
+ height: 824px;
245
+ box-sizing: border-box;
246
+ padding: 40px;
247
+ background: #363639;
248
+ border-radius: 24px;
249
+ border: 1px solid rgba(255, 255, 255, 0.5);
250
+ }
248
251
  .packages-Button-button-1dIW {
249
252
  display: inline-block;
250
253
  font-family: MiSans-regular;
package/lib/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./Popup.js"),r=require("./Picker.js"),t=require("./SelectAddress.js"),n=require("./ListSelect.js");require("vue");var i=require("./Button.js"),s=require("./FileBag.js");require("vant"),require("./browser-6bf896d2.js"),require("./index-42a2cd0c.js"),require("./utils.js"),require("./staticImg.js"),e.install=function(r){r.component(e.name,e)};var o=e;r.install=function(e){e.component(r.name,r)};var u=r;t.install=function(e){e.component(t.name,t)};var a=t;n.install=function(e){e.component(n.name,n)};var c=n;i.install=function(e){e.component(i.name,i)};var l=i;s.install=function(e){e.component(s.name,s)};var p=s;exports.Button=l,exports.FileBag=p,exports.ListSelect=c,exports.Picker=u,exports.Popup=o,exports.SelectAddress=a;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./Popup.js"),r=require("./Picker.js"),t=require("./SelectAddress.js"),n=require("./ListSelect.js");require("vue");var i=require("./Button.js"),s=require("./FileBag.js");require("vant"),require("./browser-f7f8eb3f.js"),require("./index-c2b22c86.js"),require("./utils.js"),require("./staticImg.js"),e.install=function(r){r.component(e.name,e)};var o=e;r.install=function(e){e.component(r.name,r)};var u=r;t.install=function(e){e.component(t.name,t)};var a=t;n.install=function(e){e.component(n.name,n)};var c=n;i.install=function(e){e.component(i.name,i)};var l=i;s.install=function(e){e.component(s.name,s)};var p=s;exports.Button=l,exports.FileBag=p,exports.ListSelect=c,exports.Picker=u,exports.Popup=o,exports.SelectAddress=a;
package/lib/esm/Button.js CHANGED
@@ -1 +1 @@
1
- import{n as e,c as t}from"./browser-c44022ac.js";var a={name:"Button",props:{type:{type:String,default:"default",desc:"default | danger"}},emits:{click:function(e){return"点击事件"}},methods:{},mounted:function(){}},n=function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{directives:[{name:"focusable",rawName:"v-focusable"}],class:[e.$style.button,e.$style[e.type]],on:{click:function(t){return e.$emit("click")}}},[e._t("default")],2)};n._withStripped=!0;var d=e({render:n,staticRenderFns:[]},function(e){e&&(e("data-v-807922ca_0",{source:"",map:void 0,media:void 0}),Object.defineProperty(this,"$style",{value:{button:"packages-Button-button-1dIW",default:"packages-Button-default-Zf6U",danger:"packages-Button-danger-1SaJ"}}))},a,undefined,false,undefined,!1,t,void 0,void 0);export{d as default};
1
+ import{n as e,c as t}from"./browser-6ab36fa0.js";var a={name:"Button",props:{type:{type:String,default:"default",desc:"default | danger"}},emits:{click:function(e){return"点击事件"}}},n=function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{directives:[{name:"focusable",rawName:"v-focusable"}],class:[e.$style.button,e.$style[e.type]],on:{click:function(t){return e.$emit("click")}}},[e._t("default")],2)};n._withStripped=!0;var r=e({render:n,staticRenderFns:[]},function(e){e&&(e("data-v-2c27a512_0",{source:"",map:void 0,media:void 0}),Object.defineProperty(this,"$style",{value:{button:"packages-Button-button-1dIW",default:"packages-Button-default-Zf6U",danger:"packages-Button-danger-1SaJ"}}))},a,undefined,false,undefined,!1,t,void 0,void 0);export{r as default};
@@ -1 +1 @@
1
- import{_ as t,r as e}from"./index-3a473cdc.js";import i from"./Popup.js";import n from"./ListSelect.js";import{n as s,c as a}from"./browser-c44022ac.js";import"vant";import"./utils.js";import"vue";import"./staticImg.js";var o={name:"FileBag",components:{Popup:i,ListSelect:n},props:{value:{type:Boolean,default:!1,required:!0,desc:"是否展示"},title:{type:String,default:"请选择健康档案",desc:"标题"},codeTitle:{type:String,default:"添加或编辑档案",desc:"二维码标题"}},watch:{value:{handler:function(t){this.show=t,t&&this.inits()},immediate:!0},show:function(t){t||this.$refs.listSelect._tvRest(),this.$emit("input",t)}},emits:{input:function(t){return"内容变化时触发"},change:function(t){return"选中当前项"},list:function(t){return"地址数据返回"}},data:function(){return{list:[],QrPath:"",show:!1}},methods:{change:function(t){this.show=!1,this.$emit("change",t)},inits:function(){var i=this;return t(e.mark(function t(){var n,s;return e.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!i.$ftvsApiConfigInfo.fileBagFn){t.next=2;break}return t.next=1,i.$ftvsApiConfigInfo.fileBagFn();case 1:n=t.sent,i.list=n||[],i.$emit("list",i.list);case 2:i.$ftvsApiConfigInfo.qrCodePathFn&&(s=i.$ftvsApiConfigInfo.qrCodePathFn(),i.QrPath=s.weAppHealthRecordPath);case 3:case"end":return t.stop()}},t)}))()}}},r=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("Popup",{class:t.$style.popup,model:{value:t.show,callback:function(e){t.show=e},expression:"show"}},[i("div",{class:t.$style["file-bag"]},[i("ListSelect",{ref:"listSelect",attrs:{list:t.list,qrPath:t.QrPath,title:t.title,codeTitle:t.codeTitle},on:{change:t.change}})],1)])};r._withStripped=!0;var c=s({render:r,staticRenderFns:[]},function(t){t&&(t("data-v-67218a36_0",{source:"",map:void 0,media:void 0}),Object.defineProperty(this,"$style",{value:{popup:"packages-FileBag-popup-Hc07","file-bag":"packages-FileBag-file-bag-xapd"}}))},o,undefined,false,undefined,!1,a,void 0,void 0);export{c as default};
1
+ import{_ as t,r as e}from"./index-f8fc1682.js";import i from"./Popup.js";import n from"./ListSelect.js";import{n as s,c as a}from"./browser-6ab36fa0.js";import"vant";import"./utils.js";import"vue";import"./staticImg.js";var o={name:"FileBag",components:{Popup:i,ListSelect:n},props:{value:{type:Boolean,default:!1,required:!0,desc:"是否展示"},title:{type:String,default:"请选择健康档案",desc:"标题"},codeTitle:{type:String,default:"添加或编辑档案",desc:"二维码标题"}},watch:{value:{handler:function(t){this.show=t,t&&this.inits()},immediate:!0},show:function(t){t||this.$refs.listSelect._tvRest(),this.$emit("input",t)}},emits:{input:function(t){return"内容变化时触发"},change:function(t){return"选中当前项"},list:function(t){return"地址数据返回"}},data:function(){return{list:[],QrPath:"",show:!1}},methods:{change:function(t){this.show=!1,this.$emit("change",t)},inits:function(){var i=this;return t(e.mark(function t(){var n,s;return e.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!i.$ftvsApiConfigInfo.fileBagFn){t.next=2;break}return t.next=1,i.$ftvsApiConfigInfo.fileBagFn();case 1:n=t.sent,i.list=n||[],i.$emit("list",i.list);case 2:i.$ftvsApiConfigInfo.qrCodePathFn&&(s=i.$ftvsApiConfigInfo.qrCodePathFn(),i.QrPath=s.weAppHealthRecordPath);case 3:case"end":return t.stop()}},t)}))()}}},r=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("Popup",{class:t.$style.popup,model:{value:t.show,callback:function(e){t.show=e},expression:"show"}},[i("div",{class:t.$style["file-bag"]},[i("ListSelect",{ref:"listSelect",attrs:{list:t.list,qrPath:t.QrPath,title:t.title,codeTitle:t.codeTitle},on:{change:t.change}})],1)])};r._withStripped=!0;var c=s({render:r,staticRenderFns:[]},function(t){t&&(t("data-v-67218a36_0",{source:"",map:void 0,media:void 0}),Object.defineProperty(this,"$style",{value:{popup:"packages-FileBag-popup-Hc07","file-bag":"packages-FileBag-file-bag-xapd"}}))},o,undefined,false,undefined,!1,a,void 0,void 0);export{c as default};
@@ -1 +1 @@
1
- import{_ as e,r as t}from"./index-3a473cdc.js";import{ftvsTvScope as s}from"./utils.js";import{staticCodeIcon as i,staticSelectedIcon as n,staticWxIcon as c}from"./staticImg.js";import{n as r,c as l}from"./browser-c44022ac.js";import"vue";var a={name:"ListSelect",props:{value:{type:Object,default:function(){return{}},desc:"当前选中项"},list:{type:Array,required:!0,desc:"属性说明"},title:{type:String,default:"",desc:"标题"},codeTitle:{type:String,default:"",desc:"二维码标题"},qrPath:{type:String,default:"",desc:"二维码链接"}},watch:{qrPath:{handler:function(e){this.initQr(e)},immediate:!0},value:{handler:function(e){var t=this.findObjectIndex(this.list,e);t>-1&&(this.selectIndex=t)},immediate:!0},list:{handler:function(e){e.length&&this.inits()},immediate:!0}},emits:{change:function(e){return"选中当前项"},input:function(e){return"内容变化时触发"},onFocus:function(e){return"获得当前焦点所在项"}},slots:{item:{desc:"列表元素"},hint:{desc:"二维码下方提示"}},data:function(){var e=s.apply(this);return{ftvsTvInit:e.ftvsTvInit,ftvsTvReset:e.ftvsTvReset,qrcodeThis:void 0,QRCode:null,selectIndex:null,staticCodeIcon:i,selected:n,wxIcon:c}},methods:{initQr:function(s){var i=this;return e(t.mark(function e(){var n;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==i.QRCode){e.next=2;break}return e.next=1,import("qrcodejs2");case 1:i.QRCode=e.sent.default;case 2:if(s){e.next=3;break}return e.abrupt("return");case 3:n={text:s,width:314,height:316,colorDark:"#000000",colorLight:"#ffffff",correctLevel:i.QRCode.CorrectLevel.H},void 0!==i.qrcodeThis?(i.qrcodeThis.clear(),i.qrcodeThis.makeCode(s)):i.qrcodeThis=new i.QRCode(i.$refs.ftvsQrCode,n),i.$nextTick(function(){i.forceRepaint(i.$refs.ftvsQrCode)});case 4:case"end":return e.stop()}},e)}))()},forceRepaint:function(e){e.style.display="none",e.offsetHeight,e.style.display="flex"},findObjectIndex:function(e,t){return e.findIndex(function(e){return Object.keys(t).every(function(s){return e[s]===t[s]})})},_tvRest:function(){this.ftvsTvReset()},change:function(e,t){this.selectIndex=t,this.$emit("input",e),this.$emit("change",{item:e,index:t}),this.ftvsTvReset()},onFocus:function(e,t){this.$emit("onFocus",{item:e,index:t})},inits:function(){var s=this;return e(t.mark(function i(){return t.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:s.$nextTick(e(t.mark(function e(){return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:s.ftvsTvInit({distanceToCenter:!0,scrollEl:s.$refs.left,limitingEl:s.$refs.left},function(){var e=s.$refs.left,t=e?e.querySelectorAll(".".concat(s.$style.item)):null;t&&t.length&&s.$tv.next(t[s.selectIndex||0])});case 1:case"end":return e.stop()}},e)})));case 1:case"end":return i.stop()}},i)}))()}},beforeDestroy:function(){this.ftvsTvReset()},mounted:function(){}},o=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{class:e.$style.list_select},[e.title?s("div",{class:e.$style.title},[e._v(e._s(e.title))]):e._e(),e._v(" "),s("div",{class:e.$style.content},[e.list.length?s("div",{ref:"left",class:e.$style.left},e._l(e.list,function(t,i){return s("div",{directives:[{name:"focusable",rawName:"v-focusable"}],key:i+"-ftvs-file-bg-list",class:e.$style.item,on:{click:function(s){return e.change(t,i)},onFocus:function(s){return e.onFocus(t,i)}}},[s("div",{class:e.$style.item_l},[e._t("item",function(){return[s("div",[e._v("\n "+e._s(t.memberName)+" "+e._s(t.sexText)+" "+e._s(t.age)+"岁\n ")])]},{item:t,index:i})],2),e._v(" "),i===e.selectIndex?s("img",{class:e.$style.selected,attrs:{src:e.selected}}):e._e()])}),0):e._e(),e._v(" "),s("div",{class:e.$style.right,style:{background:"url('"+e.staticCodeIcon+"')"}},[s("div",{class:e.$style.r_div},[s("div",{class:e.$style.r_title},[e._v(e._s(e.codeTitle))]),e._v(" "),s("div",{ref:"ftvsQrCode",class:e.$style.img_code}),e._v(" "),e._t("hint",function(){return[s("div",{class:e.$style.r_hint},[s("img",{attrs:{src:e.wxIcon}}),e._v("\n 使用微信扫码\n ")])]})],2)])])])};o._withStripped=!0;var d=r({render:o,staticRenderFns:[]},function(e){e&&(e("data-v-5ffffc7d_0",{source:"",map:void 0,media:void 0}),Object.defineProperty(this,"$style",{value:{list_select:"packages-ListSelect-list_select-83QA",title:"packages-ListSelect-title-eOZz",content:"packages-ListSelect-content-g6tF",left:"packages-ListSelect-left-3xR9",item:"packages-ListSelect-item-1TtQ",item_l:"packages-ListSelect-item_l-2OUN",selected:"packages-ListSelect-selected-1V7w",right:"packages-ListSelect-right-3GvU",r_div:"packages-ListSelect-r_div-2m0w",img_code:"packages-ListSelect-img_code-24n2",r_title:"packages-ListSelect-r_title-12wf",r_hint:"packages-ListSelect-r_hint-189D"}}))},a,undefined,false,undefined,!1,l,void 0,void 0);export{d as default};
1
+ import{_ as e,r as t}from"./index-f8fc1682.js";import{ftvsTvScope as s}from"./utils.js";import{staticCodeIcon as i,staticSelectedIcon as n,staticWxIcon as c}from"./staticImg.js";import{n as r,c as l}from"./browser-6ab36fa0.js";import"vue";var a={name:"ListSelect",props:{value:{type:Object,default:function(){return{}},desc:"当前选中项"},list:{type:Array,required:!0,desc:"属性说明"},title:{type:String,default:"",desc:"标题"},codeTitle:{type:String,default:"",desc:"二维码标题"},qrPath:{type:String,default:"",desc:"二维码链接"}},watch:{qrPath:{handler:function(e){this.initQr(e)},immediate:!0},value:{handler:function(e){var t=this.findObjectIndex(this.list,e);t>-1&&(this.selectIndex=t)},immediate:!0},list:{handler:function(e){e.length&&this.inits()},immediate:!0}},emits:{change:function(e){return"选中当前项"},input:function(e){return"内容变化时触发"},onFocus:function(e){return"获得当前焦点所在项"}},slots:{item:{desc:"列表元素"},hint:{desc:"二维码下方提示"}},data:function(){var e=s.apply(this);return{ftvsTvInit:e.ftvsTvInit,ftvsTvReset:e.ftvsTvReset,qrcodeThis:void 0,QRCode:null,selectIndex:null,staticCodeIcon:i,selected:n,wxIcon:c}},methods:{initQr:function(s){var i=this;return e(t.mark(function e(){var n;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==i.QRCode){e.next=2;break}return e.next=1,import("qrcodejs2");case 1:i.QRCode=e.sent.default;case 2:if(s){e.next=3;break}return e.abrupt("return");case 3:n={text:s,width:314,height:316,colorDark:"#000000",colorLight:"#ffffff",correctLevel:i.QRCode.CorrectLevel.H},void 0!==i.qrcodeThis?(i.qrcodeThis.clear(),i.qrcodeThis.makeCode(s)):i.qrcodeThis=new i.QRCode(i.$refs.ftvsQrCode,n),i.$nextTick(function(){i.forceRepaint(i.$refs.ftvsQrCode)});case 4:case"end":return e.stop()}},e)}))()},forceRepaint:function(e){e.style.display="none",e.offsetHeight,e.style.display="flex"},findObjectIndex:function(e,t){return e.findIndex(function(e){return Object.keys(t).every(function(s){return e[s]===t[s]})})},_tvRest:function(){this.ftvsTvReset()},change:function(e,t){this.selectIndex=t,this.$emit("input",e),this.$emit("change",{item:e,index:t}),this.ftvsTvReset()},onFocus:function(e,t){this.$emit("onFocus",{item:e,index:t})},inits:function(){var s=this;return e(t.mark(function i(){return t.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:s.$nextTick(e(t.mark(function e(){return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:s.ftvsTvInit({distanceToCenter:!0,scrollEl:s.$refs.left,limitingEl:s.$refs.left},function(){var e=s.$refs.left,t=e?e.querySelectorAll(".".concat(s.$style.item)):null;t&&t.length&&s.$tv.next(t[s.selectIndex||0])});case 1:case"end":return e.stop()}},e)})));case 1:case"end":return i.stop()}},i)}))()}},beforeDestroy:function(){this.ftvsTvReset()},mounted:function(){}},o=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{class:e.$style.list_select},[e.title?s("div",{class:e.$style.title},[e._v(e._s(e.title))]):e._e(),e._v(" "),s("div",{class:e.$style.content},[e.list.length?s("div",{ref:"left",class:e.$style.left},e._l(e.list,function(t,i){return s("div",{directives:[{name:"focusable",rawName:"v-focusable"}],key:i+"-ftvs-file-bg-list",class:e.$style.item,on:{click:function(s){return e.change(t,i)},onFocus:function(s){return e.onFocus(t,i)}}},[s("div",{class:e.$style.item_l},[e._t("item",function(){return[s("div",[e._v("\n "+e._s(t.memberName)+" "+e._s(t.sexText)+" "+e._s(t.age)+"岁\n ")])]},{item:t,index:i})],2),e._v(" "),i===e.selectIndex?s("img",{class:e.$style.selected,attrs:{src:e.selected}}):e._e()])}),0):e._e(),e._v(" "),s("div",{class:e.$style.right,style:{background:"url('"+e.staticCodeIcon+"')"}},[s("div",{class:e.$style.r_div},[s("div",{class:e.$style.r_title},[e._v(e._s(e.codeTitle))]),e._v(" "),s("div",{ref:"ftvsQrCode",class:e.$style.img_code}),e._v(" "),e._t("hint",function(){return[s("div",{class:e.$style.r_hint},[s("img",{attrs:{src:e.wxIcon}}),e._v("\n 使用微信扫码\n ")])]})],2)])])])};o._withStripped=!0;var d=r({render:o,staticRenderFns:[]},function(e){e&&(e("data-v-5ffffc7d_0",{source:"",map:void 0,media:void 0}),Object.defineProperty(this,"$style",{value:{list_select:"packages-ListSelect-list_select-83QA",title:"packages-ListSelect-title-eOZz",content:"packages-ListSelect-content-g6tF",left:"packages-ListSelect-left-3xR9",item:"packages-ListSelect-item-1TtQ",item_l:"packages-ListSelect-item_l-2OUN",selected:"packages-ListSelect-selected-1V7w",right:"packages-ListSelect-right-3GvU",r_div:"packages-ListSelect-r_div-2m0w",img_code:"packages-ListSelect-img_code-24n2",r_title:"packages-ListSelect-r_title-12wf",r_hint:"packages-ListSelect-r_hint-189D"}}))},a,undefined,false,undefined,!1,l,void 0,void 0);export{d as default};
package/lib/esm/Picker.js CHANGED
@@ -1 +1 @@
1
- import{_ as n,r as t}from"./index-3a473cdc.js";import{Picker as e,Loading as o}from"vant";import{ftvsTvScope as s,ftvsPxToRem as i}from"./utils.js";import{n as u,c as r}from"./browser-c44022ac.js";import"vue";function l(n){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},l(n)}function a(n,t){var e="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(!e){if(Array.isArray(n)||(e=function(n,t){if(n){if("string"==typeof n)return c(n,t);var e={}.toString.call(n).slice(8,-1);return"Object"===e&&n.constructor&&(e=n.constructor.name),"Map"===e||"Set"===e?Array.from(n):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?c(n,t):void 0}}(n))||t&&n&&"number"==typeof n.length){e&&(n=e);var o=0,s=function(){};return{s:s,n:function(){return o>=n.length?{done:!0}:{done:!1,value:n[o++]}},e:function(n){throw n},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,r=!1;return{s:function(){e=e.call(n)},n:function(){var n=e.next();return u=n.done,n},e:function(n){r=!0,i=n},f:function(){try{u||null==e.return||e.return()}finally{if(r)throw i}}}}function c(n,t){(null==t||t>n.length)&&(t=n.length);for(var e=0,o=Array(t);e<t;e++)o[e]=n[e];return o}var m={name:"Picker",components:{vantPicker:e,vanLoading:o},props:{valueKey:{type:String,default:"text",desc:"选项对象中,选项文字对应的键名"},idKey:{type:String,default:"id",desc:"选项对象中,唯一标识符,主要用于异步获取列数据"},deep:{type:Number,default:2,desc:"异步获取树状数据,层级默认为2,从1开始,目前仅支持2级树形结构"},columns:{type:[Array,Function],required:!0,desc:"对象数组,配置每一列显示的数据"}},emits:{confirm:function(n){return"最后一列选项改变时触发,单列:Picker 实例,选中值,选中值对应的索引\n多列:Picker 实例,所有列选中值,当前列对应的索引"}},data:function(){var n=s.apply(this);return{ftvsTvInit:n.ftvsTvInit,ftvsTvReset:n.ftvsTvReset,loading:!1,vantColumns:[],itemHeight:i(130),isMove:!1,visibleItemCount:6,tvColumns:[],columnsNum:null,nowColumnsIndex:0,columnsType:"singleRow",isTree:!1}},computed:{nowColumns:function(){return this.tvColumns[this.nowColumnsIndex]},isSyncFn:function(){return"function"==typeof this.columns}},watch:{columns:{handler:function(n){var t=this;"function"!=typeof n?n.length&&(this.vantColumns=n,this.$nextTick(function(){t.init()})):this.getSyncFun(n)},immediate:!0,deep:!0}},methods:{setPracticalIndex:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this.getColumnsIndexes(),e=n||this.nowColumnsIndex;this.tvColumns[e].focusIndex=t[e]||null},selectVal:function(n){var t,e=this,o=n.target;if(!this.loading){var s=o.parentNode,i=s.parentNode,u=null===(t=Array.from(null==i?void 0:i.children))||void 0===t?void 0:t.indexOf(s),r=Number(o.parentNode.parentNode.getAttribute("data-tv-index"));this.nowColumnsIndex=r,this.$set(this.tvColumns[r],"focusIndex",u),this.setNowColumnsFocus(),this.$refs.vantPicker.setColumnIndex(this.nowColumnsIndex,this.nowColumns.focusIndex),this.isTree&&this.resetColumnFocusIndex();var l,a=this.$refs.vantPicker.getValues();l="singleRow"===this.columnsType?a[0]:this.isTree?a.map(function(n){return n&&n[e.valueKey]}):a,this.emitVal(l,a)}},emitVal:function(n,t){var e=this;if("function"==typeof this.columns&&this.nowColumnsIndex+1<this.deep)this.updateVantColumns();else{if(this.nowColumnsIndex+1===this.columnsNum){var o=[];try{o=this.$refs.vantPicker.getColumnValue(this.nowColumnsIndex)}catch(n){}var s={currentOption:o,selectedValuesKeys:n,selectedValues:t,selectedOptions:this.getColumnValues(this.nowColumnsIndex),selectedIndexes:this.getColumnsIndexes()};this.$emit("confirm",s),this.ftvsTvReset()}var i=this.tvColumns[this.nowColumnsIndex+1];i&&i.dom&&this.$nextTick(function(){e.updateColumns(i.dom,e.nowColumnsIndex+1,i.focusIndex)})}},toUp:function(){this.nowColumns.focusIndex>0&&(this.tvColumns[this.nowColumnsIndex].focusIndex--,this.setNowColumnsFocus(),this.move(this.nowColumns.focusIndex))},toLeft:function(){this.nowColumnsIndex>0&&(this.nowColumnsIndex--,this.setPracticalIndex(this.nowColumnsIndex+1),this.setNowColumnsFocus())},toRight:function(){this.nowColumnsIndex<this.tvColumns.length-1&&(this.nowColumnsIndex++,this.setNowColumnsFocus(),this.move(this.nowColumns.focusIndex))},toDown:function(){this.nowColumns.focusIndex<this.nowColumns.focusNum-1&&(this.tvColumns[this.nowColumnsIndex].focusIndex++,this.setNowColumnsFocus(),this.move(this.nowColumns.focusIndex))},getColumnsIndexes:function(){return this.$refs.vantPicker.getIndexes()},getColumnValues:function(n){return this.$refs.vantPicker.getColumnValues(n)},resetColumnFocusIndex:function(){for(var n=this.nowColumnsIndex;n<this.tvColumns.length-1;n++)this.tvColumns[n+1].focusIndex=0},move:function(n){var t=this,e=this.$refs.vantPicker,o=e.children[this.nowColumnsIndex].options,s=e.children[this.nowColumnsIndex].itemHeight,i=function(n,t){var e,o,s;e=t,o=0,s=n.length;for(var i=t=Math.min(Math.max(e,o),s);i<n.length;i++)if(!n[i].disabled)return i;for(var u=t-1;u>=0;u--)if(!n[u].disabled)return u;return 0},u=function(n){return-i(o,n)*s+s*(t.visibleItemCount-1)/2}(n);this.nowColumns.dom.style.webkitTtransitionDuration="0ms",this.nowColumns.dom.style.webkitTransitionProperty="none",this.nowColumns.dom.style.webkitTransform="translate3d(0px, ".concat(u,"px, 0px)"),this.$forceUpdate()},getAndUpdateChildren:function(n,t,e){var o=this,s=function(n){var i,u=a(n);try{for(u.s();!(i=u.n()).done;){var r=i.value;if(r[o.idKey]===t)return e&&o.$set(r,"children",e),r;if(r.children){var l=s(r.children);if(l)return l}}}catch(n){u.e(n)}finally{u.f()}return null},i=s(n);return i&&i.children||[]},updateVantColumns:function(){var e=this;return n(t.mark(function n(){var o,s,i;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(e.isSyncFn&&e.nowColumnsIndex+1!==e.deep){n.next=1;break}return n.abrupt("return");case 1:if(o=e.$refs.vantPicker.getColumnValues(e.nowColumnsIndex)[e.nowColumns.focusIndex],s=e.getAndUpdateChildren(e.vantColumns,o[e.idKey]),i=[],s.length){n.next=3;break}return e.loading=!0,n.next=2,e.columns({level:e.nowColumnsIndex+1,item:o});case 2:i=n.sent,n.next=4;break;case 3:i=s;case 4:e.getAndUpdateChildren(e.vantColumns,o[e.idKey],i),e.$refs.vantPicker.setColumnValues(e.nowColumnsIndex+1,i),e.$nextTick(function(){e.updateTvColumns()}),e.loading=!1;case 5:case"end":return n.stop()}},n)}))()},setNowColumnsFocus:function(){var n=this.tvColumns[this.nowColumnsIndex];null===n.focusIndex&&(n.focusIndex=this.getColumnsIndexes()[this.nowColumnsIndex]);var t=n.dom.querySelectorAll("li")[n.focusIndex].children[0];this.$tv.next(t),this.isMove=!0},setColumnsType:function(){var n=this.vantColumns[0];"object"===l(n)&&(n.hasOwnProperty("children")||n.hasOwnProperty("values"))&&(n.hasOwnProperty("children")&&(this.isTree=!0),this.columnsType="multiColumn")},againFocus:function(){this.isMove&&(this.ftvsTvInit(),this.setNowColumnsFocus())},updateColumns:function(n,t){this.tvColumns[t].focusNum=n.querySelectorAll("li").length},getSyncFun:function(e){var o=this;return n(t.mark(function n(){var s;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return o.loading=!0,n.next=1,e({level:0,item:null});case 1:(s=n.sent)&&s[0]&&!s[0].hasOwnProperty("children")?o.vantColumns=s.map(function(n){return n.children=[],n}):o.vantColumns=s,o.setColumnsType(),o.$nextTick(function(){o.init(),o.updateVantColumns()});case 2:case"end":return n.stop()}},n)}))()},updateTvColumns:function(){var n="singleRow"===this.columnsType,t=this.$refs.vantPicker.$el.querySelectorAll("ul");this.columnsNum=n?1:t.length;for(var e=0;e<t.length;e++){var o=t[e];o.setAttribute("data-tv-index",e);var s=this.tvColumns[e]?this.tvColumns[e]:{};s.focusNum!==o.querySelectorAll("li").length&&this.$set(this.tvColumns,e,{focusIndex:s.focusIndex>=0?s.focusIndex:null,focusNum:o.querySelectorAll("li").length,dom:o})}},init:function(){this.ftvsTvInit(),this.setColumnsType(),this.updateTvColumns(),this.setNowColumnsFocus()}},beforeDestroy:function(){this.ftvsTvReset()},mounted:function(){}},d=function(){var n=this,t=n.$createElement,e=n._self._c||t;return e("div",[e("vantPicker",{ref:"vantPicker",class:n.$style.picker,attrs:{columns:n.vantColumns,"value-key":n.valueKey,"item-height":n.itemHeight},scopedSlots:n._u([{key:"option",fn:function(t){return[e("div",{directives:[{name:"focusable",rawName:"v-focusable"}],class:n.$style.column_item,on:{up:n.toUp,left:n.toLeft,right:n.toRight,down:n.toDown,click:n.selectVal}},[e("span",["string"==typeof t||"number"==typeof t?[n._v("\n "+n._s(t)+"\n ")]:[n._v(n._s(t[n.valueKey]))]],2)])]}}])}),n._v(" "),n.loading?e("div",{class:n.$style.loading},[e("vanLoading",{attrs:{size:"46"}})],1):n._e()],1)};d._withStripped=!0;var f=u({render:d,staticRenderFns:[]},function(n){n&&(n("data-v-08eb1abc_0",{source:"",map:void 0,media:void 0}),Object.defineProperty(this,"$style",{value:{loading:"packages-Picker-loading-1W4w",picker:"packages-Picker-picker-3oJS",column_item:"packages-Picker-column_item-3Wh4"}}))},m,undefined,false,undefined,!1,r,void 0,void 0);export{f as default};
1
+ import{_ as n,r as t}from"./index-f8fc1682.js";import{Picker as e,Loading as o}from"vant";import{ftvsTvScope as s,ftvsPxToRem as r}from"./utils.js";import{n as i,c as u}from"./browser-6ab36fa0.js";import"vue";function l(n,t){(null==t||t>n.length)&&(t=n.length);for(var e=0,o=new Array(t);e<t;e++)o[e]=n[e];return o}function a(n){return function(n){if(Array.isArray(n))return l(n)}(n)||function(n){if("undefined"!=typeof Symbol&&null!=n[Symbol.iterator]||null!=n["@@iterator"])return Array.from(n)}(n)||function(n,t){if(n){if("string"==typeof n)return l(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);return"Object"===e&&n.constructor&&(e=n.constructor.name),"Map"===e||"Set"===e?Array.from(n):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?l(n,t):void 0}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(n){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},c(n)}function d(n,t){var e="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(!e){if(Array.isArray(n)||(e=function(n,t){if(n){if("string"==typeof n)return m(n,t);var e={}.toString.call(n).slice(8,-1);return"Object"===e&&n.constructor&&(e=n.constructor.name),"Map"===e||"Set"===e?Array.from(n):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?m(n,t):void 0}}(n))||t&&n&&"number"==typeof n.length){e&&(n=e);var o=0,s=function(){};return{s:s,n:function(){return o>=n.length?{done:!0}:{done:!1,value:n[o++]}},e:function(n){throw n},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,u=!1;return{s:function(){e=e.call(n)},n:function(){var n=e.next();return i=n.done,n},e:function(n){u=!0,r=n},f:function(){try{i||null==e.return||e.return()}finally{if(u)throw r}}}}function m(n,t){(null==t||t>n.length)&&(t=n.length);for(var e=0,o=Array(t);e<t;e++)o[e]=n[e];return o}var f={name:"Picker",components:{vantPicker:e,vanLoading:o},inject:["popupRoot"],props:{valueKey:{type:String,default:"text",desc:"选项对象中,选项文字对应的键名"},idKey:{type:String,default:"id",desc:"选项对象中,唯一标识符,主要用于异步获取列数据"},deep:{type:Number,default:2,desc:"异步获取树状数据,层级默认为2,从1开始,目前仅支持2级树形结构"},loadingBg:{type:String,default:"transparent",desc:"loading背景色(异步加载时可以用)"},columns:{type:[Array,Function],required:!0,desc:"对象数组,配置每一列显示的数据"}},emits:{confirm:function(n){return"最后一列选项改变时触发,单列:Picker 实例,选中值,选中值对应的索引\n多列:Picker 实例,所有列选中值,当前列对应的索引"}},data:function(){var n=s.apply(this);return{ftvsTvInit:n.ftvsTvInit,ftvsTvReset:n.ftvsTvReset,loadingBgColor:"transparent",loading:!1,vantColumns:[],itemHeight:r(130),isMove:!1,visibleItemCount:6,tvColumns:[],columnsNum:null,nowColumnsIndex:0,columnsType:"singleRow",isTree:!1}},computed:{nowColumns:function(){return this.tvColumns[this.nowColumnsIndex]},isSyncFn:function(){return"function"==typeof this.columns}},watch:{columns:{handler:function(n){var t=this;"function"!=typeof n?n.length&&(this.vantColumns=n,this.$nextTick(function(){t.init()})):this.getSyncFun(n)},immediate:!0,deep:!0}},methods:{setPracticalIndex:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this.getColumnsIndexes(),e=n||this.nowColumnsIndex;this.tvColumns[e].focusIndex=t[e]||null},selectVal:function(n){var t,e=this,o=n.target;if(!this.loading){var s=o.parentNode,r=s.parentNode,i=null===(t=Array.from(null==r?void 0:r.children))||void 0===t?void 0:t.indexOf(s),u=Number(o.parentNode.parentNode.getAttribute("data-tv-index"));this.nowColumnsIndex=u,this.$set(this.tvColumns[u],"focusIndex",i),this.setNowColumnsFocus(),this.$refs.vantPicker.setColumnIndex(this.nowColumnsIndex,this.nowColumns.focusIndex),this.isTree&&this.resetColumnFocusIndex();var l,a=this.$refs.vantPicker.getValues();l="singleRow"===this.columnsType?a[0]:this.isTree?a.map(function(n){return n&&n[e.valueKey]}):a,this.emitVal(l,a)}},emitVal:function(n,t){var e=this;if("function"==typeof this.columns&&this.nowColumnsIndex+1<this.deep)return this.loadingBgColor=this.loadingBg,void this.updateVantColumns();if(this.nowColumnsIndex+1===this.columnsNum){var o=[];try{o=this.$refs.vantPicker.getColumnValue(this.nowColumnsIndex)}catch(n){}var s={currentOption:o,selectedValuesKeys:n,selectedValues:t,selectedOptions:this.getColumnValues(this.nowColumnsIndex),selectedIndexes:this.getColumnsIndexes()};this.$emit("confirm",s),this.ftvsTvReset()}var r=this.tvColumns[this.nowColumnsIndex+1];r&&r.dom&&this.$nextTick(function(){e.updateColumns(r.dom,e.nowColumnsIndex+1,r.focusIndex)})},toUp:function(){this.nowColumns.focusIndex>0&&(this.tvColumns[this.nowColumnsIndex].focusIndex--,this.setNowColumnsFocus(),this.move(this.nowColumns.focusIndex))},toLeft:function(){this.nowColumnsIndex>0&&(this.nowColumnsIndex--,this.setPracticalIndex(this.nowColumnsIndex+1),this.setNowColumnsFocus())},toRight:function(){this.nowColumnsIndex<this.tvColumns.length-1&&(this.nowColumnsIndex++,this.setNowColumnsFocus(),this.move(this.nowColumns.focusIndex))},toDown:function(){this.nowColumns.focusIndex<this.nowColumns.focusNum-1&&(this.tvColumns[this.nowColumnsIndex].focusIndex++,this.setNowColumnsFocus(),this.move(this.nowColumns.focusIndex))},getColumnsIndexes:function(){return this.$refs.vantPicker.getIndexes()},getColumnValues:function(n){return this.$refs.vantPicker.getColumnValues(n)},resetColumnFocusIndex:function(){for(var n=this.nowColumnsIndex;n<this.tvColumns.length-1;n++)this.tvColumns[n+1].focusIndex=0},move:function(n){var t=this,e=this.$refs.vantPicker,o=e.children[this.nowColumnsIndex].options,s=e.children[this.nowColumnsIndex].itemHeight,r=function(n,t){var e,o,s;e=t,o=0,s=n.length;for(var r=t=Math.min(Math.max(e,o),s);r<n.length;r++)if(!n[r].disabled)return r;for(var i=t-1;i>=0;i--)if(!n[i].disabled)return i;return 0},i=function(n){return-r(o,n)*s+s*(t.visibleItemCount-1)/2}(n);this.nowColumns.dom.style.webkitTtransitionDuration="0ms",this.nowColumns.dom.style.webkitTransitionProperty="none",this.nowColumns.dom.style.webkitTransform="translate3d(0px, ".concat(i,"px, 0px)"),this.$forceUpdate()},getAndUpdateChildren:function(n,t,e){var o=this,s=function(n){var r,i=d(n);try{for(i.s();!(r=i.n()).done;){var u=r.value;if(u[o.idKey]===t)return e&&o.$set(u,"children",e),u;if(u.children){var l=s(u.children);if(l)return l}}}catch(n){i.e(n)}finally{i.f()}return null},r=s(n);return r&&r.children||[]},updateVantColumns:function(){var e=this;return n(t.mark(function n(){var o,s,r,i,u,l;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if((o=e).isSyncFn&&o.nowColumnsIndex+1!==o.deep){n.next=1;break}return n.abrupt("return");case 1:if(s=o.$refs.vantPicker.getColumnValues(o.nowColumnsIndex)[o.nowColumns.focusIndex],r=o.getAndUpdateChildren(o.vantColumns,s[o.idKey]),i=[],r.length){n.next=3;break}return o.loading=!0,n.next=2,e.buildTree(o.columns,e.deep,o.nowColumnsIndex+1,s);case 2:i=n.sent,n.next=4;break;case 3:i=r;case 4:for(o.getAndUpdateChildren(o.vantColumns,s[o.idKey],i),u=o.nowColumnsIndex+1;u<o.columnsNum;u++)l=e.getNodesByLevel(i,u),o.$refs.vantPicker.setColumnValues(u,l);o.$nextTick(function(){o.updateTvColumns()}),o.loading=!1;case 5:case"end":return n.stop()}},n)}))()},setNowColumnsFocus:function(){var n=this.tvColumns[this.nowColumnsIndex];null===n.focusIndex&&(n.focusIndex=this.getColumnsIndexes()[this.nowColumnsIndex]);var t=n.dom.querySelectorAll("li")[n.focusIndex].children[0];this.$tv.next(t),this.isMove=!0},setColumnsType:function(){var n=this.vantColumns[0];"object"===c(n)&&(n.hasOwnProperty("children")||n.hasOwnProperty("values"))&&(n.hasOwnProperty("children")&&(this.isTree=!0),this.columnsType="multiColumn")},recoverFocus:function(){this.isMove&&(this.ftvsTvInit(),this.setNowColumnsFocus())},againFocus:function(){},updateColumns:function(n,t){this.tvColumns[t].focusNum=n.querySelectorAll("li").length},getNodesByLevel:function(n,t){var e=[];return function n(o){var s,r=d(o);try{for(r.s();!(s=r.n()).done;){var i=s.value;i.level===t&&e.push(i),i.children&&i.children.length&&n(i.children)}}catch(n){r.e(n)}finally{r.f()}}(n),e},buildTree:function(e,o){var s=arguments,r=this;return n(t.mark(function n(){var i,u,l,c,d,m,f;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(u=s.length>3&&void 0!==s[3]?s[3]:{},!((i=s.length>2&&void 0!==s[2]?s[2]:0)>=o)){n.next=1;break}return n.abrupt("return",null);case 1:return n.next=2,e({level:i,item:u});case 2:if(l=n.sent,c=l.map(function(n){return n.children=i+1<o?[]:null,n.level=i,n}),c.length){n.next=3;break}return n.abrupt("return",null);case 3:return d=c[0],n.next=4,r.buildTree(e,o,i+1,d);case 4:return(m=n.sent)&&m.length&&d&&(f=d.children).push.apply(f,a(m)),n.abrupt("return",c);case 5:case"end":return n.stop()}},n)}))()},getSyncFun:function(e){var o=this;return n(t.mark(function n(){var s;return t.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return o.loading=!0,n.next=1,e({level:0,item:null});case 1:if(!(s=n.sent)||!s[0]||s[0].hasOwnProperty("children")){n.next=3;break}return n.next=2,o.buildTree(e,o.deep);case 2:o.vantColumns=n.sent,n.next=4;break;case 3:o.vantColumns=s;case 4:o.setColumnsType(),o.$nextTick(function(){o.init(),o.updateVantColumns()});case 5:case"end":return n.stop()}},n)}))()},updateTvColumns:function(){var n="singleRow"===this.columnsType,t=this.$refs.vantPicker.$el.querySelectorAll("ul");this.columnsNum=n?1:t.length;for(var e=0;e<t.length;e++){var o=t[e];o.setAttribute("data-tv-index",e);var s=this.tvColumns[e]?this.tvColumns[e]:{};s.focusNum!==o.querySelectorAll("li").length&&this.$set(this.tvColumns,e,{focusIndex:s.focusIndex>=0?s.focusIndex:null,focusNum:o.querySelectorAll("li").length,dom:o})}},init:function(){this.ftvsTvInit(),this.setColumnsType(),this.updateTvColumns(),this.setNowColumnsFocus()}},beforeDestroy:function(){this.ftvsTvReset()},mounted:function(){this.popupRoot&&"function"==typeof this.popupRoot.getSlotPicker&&this.popupRoot.getSlotPicker(this)}},h=function(){var n=this,t=n.$createElement,e=n._self._c||t;return e("div",[e("vantPicker",{ref:"vantPicker",class:n.$style.picker,attrs:{columns:n.vantColumns,"value-key":n.valueKey,"item-height":n.itemHeight},scopedSlots:n._u([{key:"option",fn:function(t){return[e("div",{directives:[{name:"focusable",rawName:"v-focusable"}],class:n.$style.column_item,on:{up:n.toUp,left:n.toLeft,right:n.toRight,down:n.toDown,click:n.selectVal}},[e("span",["string"==typeof t||"number"==typeof t?[n._v("\n "+n._s(t)+"\n ")]:[n._v(n._s(t[n.valueKey]))]],2)])]}}])}),n._v(" "),n.loading?e("div",{class:n.$style.loading,style:{"--loading-bg-color":n.loadingBgColor}},[e("vanLoading",{attrs:{size:"46"}})],1):n._e()],1)};h._withStripped=!0;var v=i({render:h,staticRenderFns:[]},function(n){n&&(n("data-v-36e5a0a8_0",{source:"",map:void 0,media:void 0}),Object.defineProperty(this,"$style",{value:{loading:"packages-Picker-loading-1W4w",picker:"packages-Picker-picker-3oJS",column_item:"packages-Picker-column_item-3Wh4"}}))},f,undefined,false,undefined,!1,u,void 0,void 0);export{v as default};
package/lib/esm/Popup.js CHANGED
@@ -1 +1 @@
1
- import{Popup as e}from"vant";import{n as o,c as t}from"./browser-c44022ac.js";var n={name:"Popup",components:{vantPopup:e},props:{value:{type:Boolean,required:!0,desc:"属性说明"},position:{type:String,default:"center",desc:"弹出位置,可选值为 top bottom right left"},closeable:{type:Boolean,default:!1,desc:"是否显示关闭图标"},getContainer:{type:String,desc:"挂载节点, 使用 get-container 属性的组件不能为根节点"},overlay:{type:Boolean,default:!0,desc:"是否显示遮罩层"},duration:{type:[Number,String],default:.3,desc:"动画时长,单位秒"},overlayClass:{type:String,desc:"自定义遮罩层类名"},overlayStyle:{type:Object,default:function(){return{backgroundColor:"#151d2b"}},desc:"自定义遮罩层样式"},closeOnPopstate:{type:Boolean,default:!1,desc:"是否在页面回退时自动关闭"},closeOnClickOverlay:{type:Boolean,default:!1,desc:"是否在点击遮罩层后关闭"}},emits:{clickCloseIcon:function(e){return"点击关闭图标时触发"},click:function(e){return"点击弹出层时触发"},clickOverlay:function(){return"点击遮罩层时触发"},open:function(){return"打开弹出层时触发"},close:function(){return"关闭弹出层时触发"},opened:function(){return"打开弹出层且动画结束后触发"},closed:function(){return"关闭弹出层且动画结束后触发"}},data:function(){return{show:!1}},watch:{value:{handler:function(e){this.show=e},immediate:!0},show:{handler:function(e){this.$emit("input",e)}}},methods:{clickCloseIcon:function(e){this.$emit("clickCloseIcon",e)},click:function(e){this.$emit("click",e)},clickOverlay:function(){this.$emit("clickOverlay")},open:function(){this.$emit("open")},close:function(){this.$emit("close")},opened:function(){this.$emit("opened")},closed:function(){this.$emit("closed")}},mounted:function(){}},c=function(){var e=this,o=e.$createElement;return(e._self._c||o)("vantPopup",{class:e.$style.popup,attrs:{position:e.position,closeable:e.closeable,"get-container":e.getContainer,overlay:e.overlay,"overlay-class":e.overlayClass,"overlay-style":e.overlayStyle,"close-on-popstate":e.closeOnPopstate,"close-on-click-overlay":e.closeOnClickOverlay,duration:e.duration},on:{"click-close-icon":e.clickCloseIcon,click:e.click,"click-overlay":e.clickOverlay,open:e.open,close:e.close,opened:e.opened,closed:e.closed},model:{value:e.show,callback:function(o){e.show=o},expression:"show"}},[e._t("default")],2)};c._withStripped=!0;var l=o({render:c,staticRenderFns:[]},function(e){e&&(e("data-v-ba0ffae0_0",{source:"",map:void 0,media:void 0}),Object.defineProperty(this,"$style",{value:{popup:"packages-Popup-popup-1uSf"}}))},n,undefined,false,undefined,!1,t,void 0,void 0);export{l as default};
1
+ import{Popup as e}from"vant";import{n as o,c as t}from"./browser-6ab36fa0.js";var n={name:"Popup",components:{vantPopup:e},provide:function(){return{popupRoot:this}},props:{value:{type:Boolean,required:!0,desc:"属性说明"},position:{type:String,default:"center",desc:"弹出位置,可选值为 top bottom right left"},closeable:{type:Boolean,default:!1,desc:"是否显示关闭图标"},getContainer:{type:String,desc:"挂载节点, 使用 get-container 属性的组件不能为根节点"},overlay:{type:Boolean,default:!0,desc:"是否显示遮罩层"},duration:{type:[Number,String],default:.3,desc:"动画时长,单位秒"},overlayClass:{type:String,desc:"自定义遮罩层类名"},overlayStyle:{type:Object,default:function(){return{backgroundColor:"#151d2b"}},desc:"自定义遮罩层样式"},closeOnPopstate:{type:Boolean,default:!1,desc:"是否在页面回退时自动关闭"},closeOnClickOverlay:{type:Boolean,default:!1,desc:"是否在点击遮罩层后关闭"}},emits:{clickCloseIcon:function(e){return"点击关闭图标时触发"},click:function(e){return"点击弹出层时触发"},clickOverlay:function(){return"点击遮罩层时触发"},open:function(){return"打开弹出层时触发"},close:function(){return"关闭弹出层时触发"},opened:function(){return"打开弹出层且动画结束后触发"},closed:function(){return"关闭弹出层且动画结束后触发"}},data:function(){return{show:!1,slotPicker:null}},watch:{value:{handler:function(e){var o,t=this;(this.show=e,e)?this.$nextTick(function(){var e;null===(e=t.slotPicker)||void 0===e||e.recoverFocus()}):null===(o=this.slotPicker)||void 0===o||o.ftvsTvReset()},immediate:!0},show:{handler:function(e){this.$emit("input",e)}}},methods:{getSlotPicker:function(e){this.slotPicker=e},clickCloseIcon:function(e){this.$emit("clickCloseIcon",e)},click:function(e){this.$emit("click",e)},clickOverlay:function(){this.$emit("clickOverlay")},open:function(){this.$emit("open")},close:function(){this.$emit("close")},opened:function(){this.$emit("opened")},closed:function(){this.$emit("closed")}},mounted:function(){}},c=function(){var e=this,o=e.$createElement;return(e._self._c||o)("vantPopup",{class:e.$style.popup,attrs:{position:e.position,closeable:e.closeable,"get-container":e.getContainer,overlay:e.overlay,"overlay-class":e.overlayClass,"overlay-style":e.overlayStyle,"close-on-popstate":e.closeOnPopstate,"close-on-click-overlay":e.closeOnClickOverlay,duration:e.duration},on:{"click-close-icon":e.clickCloseIcon,click:e.click,"click-overlay":e.clickOverlay,open:e.open,close:e.close,opened:e.opened,closed:e.closed},model:{value:e.show,callback:function(o){e.show=o},expression:"show"}},[e._t("default")],2)};c._withStripped=!0;var i=o({render:c,staticRenderFns:[]},function(e){e&&(e("data-v-70abecec_0",{source:"",map:void 0,media:void 0}),Object.defineProperty(this,"$style",{value:{popup:"packages-Popup-popup-1uSf"}}))},n,undefined,false,undefined,!1,t,void 0,void 0);export{i as default};
@@ -1 +1 @@
1
- import{_ as e,r as t}from"./index-3a473cdc.js";import n from"vue";import s from"./Popup.js";import i from"./ListSelect.js";import{staticSiteSelectIcon as r,staticSiteUnSelectIcon as o}from"./staticImg.js";import{n as a,c}from"./browser-c44022ac.js";import"vant";import"./utils.js";var d=function(){var s=e(t.mark(function e(){var s;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(s=[],!n.prototype.$ftvsApiConfigInfo.selectAddressFn){e.next=1;break}return e.next=1,n.prototype.$ftvsApiConfigInfo.selectAddressFn().then(function(e){s=e||[]});case 1:return e.abrupt("return",s);case 2:case"end":return e.stop()}},e)}));return function(){return s.apply(this,arguments)}}(),u={name:"SelectAddress",components:{Popup:s,ListSelect:i},props:{value:{type:Boolean,default:!1,required:!0,desc:"是否展示"},title:{type:String,default:"收货地址",desc:"标题"},codeTitle:{type:String,default:"添加或编辑地址",desc:"二维码标题"}},watch:{value:{handler:function(e){this.show=e,e&&this.inits()},immediate:!0},show:function(e){e||this.$refs.listSelect._tvRest(),this.$emit("input",e)}},emits:{input:function(e){return"内容变化时触发"},change:function(e){return"选中当前项"},list:function(e){return"地址数据返回"}},data:function(){return{nowIndex:null,staticSiteSelectIcon:r,staticSiteUnSelectIcon:o,list:[],QrPath:"",show:!1}},getList:function(){return e(t.mark(function e(){return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,d();case 1:return e.abrupt("return",e.sent);case 2:case"end":return e.stop()}},e)}))()},methods:{getList:d,change:function(e){this.show=!1,this.$emit("change",e)},onFocus:function(e){var t=e.index;this.nowIndex=t},inits:function(){var n=this;return e(t.mark(function e(){var s;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:d().then(function(e){n.list=e,n.$emit("list",n.list)}),n.$ftvsApiConfigInfo.qrCodePathFn&&(s=n.$ftvsApiConfigInfo.qrCodePathFn(),n.QrPath=s.weAppSitePath);case 1:case"end":return e.stop()}},e)}))()}}},l=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("Popup",{class:e.$style.popup,model:{value:e.show,callback:function(t){e.show=t},expression:"show"}},[n("div",{class:e.$style.select_address},[n("ListSelect",{ref:"listSelect",attrs:{list:e.list,qrPath:e.QrPath,title:e.title,codeTitle:e.codeTitle},on:{onFocus:e.onFocus,change:e.change},scopedSlots:e._u([{key:"item",fn:function(t){var s=t.item,i=t.index;return[n("div",{class:[e.$style.item_title]},[n("img",{directives:[{name:"show",rawName:"v-show",value:e.nowIndex===i,expression:"nowIndex === index"}],attrs:{src:e.staticSiteSelectIcon}}),e._v(" "),n("img",{directives:[{name:"show",rawName:"v-show",value:e.nowIndex!==i,expression:"nowIndex !== index"}],attrs:{src:e.staticSiteUnSelectIcon}}),e._v(" "),n("div",[e._v("\n "+e._s(s.detail)+"\n ")])]),e._v(" "),n("div",{class:[e.$style.item_content,e.nowIndex===i&&e.$style.item_active]},[n("span",[e._v(e._s(s.receiver))]),e._v(" "),n("span",[e._v(e._s(s.phoneNo))]),e._v(" "),s.defaultFlag?n("span",{class:e.$style.def_text},[e._v("默认")]):e._e()])]}}])})],1)])};l._withStripped=!0;var p=a({render:l,staticRenderFns:[]},function(e){e&&(e("data-v-b8cbe966_0",{source:"",map:void 0,media:void 0}),Object.defineProperty(this,"$style",{value:{popup:"packages-SelectAddress-popup-23a2",select_address:"packages-SelectAddress-select_address-3v1d",item_title:"packages-SelectAddress-item_title-1zWy",item_content:"packages-SelectAddress-item_content-kXYo",def_text:"packages-SelectAddress-def_text-2xeo",item_active:"packages-SelectAddress-item_active-3Xn3"}}))},u,undefined,false,undefined,!1,c,void 0,void 0);export{p as default};
1
+ import{_ as e,r as t}from"./index-f8fc1682.js";import n from"vue";import s from"./Popup.js";import i from"./ListSelect.js";import{staticSiteSelectIcon as r,staticSiteUnSelectIcon as a}from"./staticImg.js";import{n as o,c}from"./browser-6ab36fa0.js";import"vant";import"./utils.js";var d=function(){var s=e(t.mark(function e(){var s;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(s=[],!n.prototype.$ftvsApiConfigInfo.selectAddressFn){e.next=1;break}return e.next=1,n.prototype.$ftvsApiConfigInfo.selectAddressFn().then(function(e){s=e||[]});case 1:return e.abrupt("return",s);case 2:case"end":return e.stop()}},e)}));return function(){return s.apply(this,arguments)}}(),l={name:"SelectAddress",components:{Popup:s,ListSelect:i},props:{value:{type:Boolean,default:!1,required:!0,desc:"是否展示"},title:{type:String,default:"收货地址",desc:"标题"},codeTitle:{type:String,default:"添加或编辑地址",desc:"二维码标题"}},watch:{value:{handler:function(e){this.show=e,e&&this.inits()},immediate:!0},show:function(e){clearInterval(this.timeId),e?this.updateList():this.$refs.listSelect._tvRest(),this.$emit("input",e)}},emits:{input:function(e){return"内容变化时触发"},change:function(e){return"选中当前项"},list:function(e){return"地址数据返回"}},data:function(){return{timeId:null,nowIndex:null,staticSiteSelectIcon:r,staticSiteUnSelectIcon:a,list:[],QrPath:"",show:!1}},getList:function(){return e(t.mark(function e(){return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,d();case 1:return e.abrupt("return",e.sent);case 2:case"end":return e.stop()}},e)}))()},methods:{getList:d,change:function(e){this.show=!1,this.$emit("change",e)},onFocus:function(e){var t=e.index;this.nowIndex=t},updateList:function(){var e=this;this.timeId=setInterval(function(){d().then(function(t){e.list=t,e.$emit("list",e.list)})},2e3)},inits:function(){var n=this;return e(t.mark(function e(){var s;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:d().then(function(e){n.list=e,n.$emit("list",n.list)}),n.$ftvsApiConfigInfo.qrCodePathFn&&(s=n.$ftvsApiConfigInfo.qrCodePathFn(),n.QrPath=s.weAppSitePath);case 1:case"end":return e.stop()}},e)}))()}}},u=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("Popup",{class:e.$style.popup,model:{value:e.show,callback:function(t){e.show=t},expression:"show"}},[n("div",{class:e.$style.select_address},[n("ListSelect",{ref:"listSelect",attrs:{list:e.list,qrPath:e.QrPath,title:e.title,codeTitle:e.codeTitle},on:{onFocus:e.onFocus,change:e.change},scopedSlots:e._u([{key:"item",fn:function(t){var s=t.item,i=t.index;return[n("div",{class:[e.$style.item_title]},[n("img",{directives:[{name:"show",rawName:"v-show",value:e.nowIndex===i,expression:"nowIndex === index"}],attrs:{src:e.staticSiteSelectIcon}}),e._v(" "),n("img",{directives:[{name:"show",rawName:"v-show",value:e.nowIndex!==i,expression:"nowIndex !== index"}],attrs:{src:e.staticSiteUnSelectIcon}}),e._v(" "),n("div",[e._v("\n "+e._s(s.detail)+"\n ")])]),e._v(" "),n("div",{class:[e.$style.item_content,e.nowIndex===i&&e.$style.item_active]},[n("span",[e._v(e._s(s.receiver))]),e._v(" "),n("span",[e._v(e._s(s.phoneNo))]),e._v(" "),s.defaultFlag?n("span",{class:e.$style.def_text},[e._v("默认")]):e._e()])]}}])})],1)])};u._withStripped=!0;var p=o({render:u,staticRenderFns:[]},function(e){e&&(e("data-v-ad0bc520_0",{source:"",map:void 0,media:void 0}),Object.defineProperty(this,"$style",{value:{popup:"packages-SelectAddress-popup-23a2",select_address:"packages-SelectAddress-select_address-3v1d",item_title:"packages-SelectAddress-item_title-1zWy",item_content:"packages-SelectAddress-item_content-kXYo",def_text:"packages-SelectAddress-def_text-2xeo",item_active:"packages-SelectAddress-item_active-3Xn3"}}))},l,undefined,false,undefined,!1,c,void 0,void 0);export{p as default};
package/lib/esm/index.css CHANGED
@@ -114,70 +114,6 @@
114
114
  color: rgba(0, 0, 0, 0.9);
115
115
  line-height: 42px;
116
116
  }
117
- .packages-FileBag-popup-Hc07 {
118
- background-color: transparent !important;
119
- }
120
- .packages-FileBag-file-bag-xapd {
121
- width: 1640px;
122
- height: 824px;
123
- box-sizing: border-box;
124
- padding: 40px;
125
- background: #363639;
126
- border-radius: 24px;
127
- border: 1px solid rgba(255, 255, 255, 0.5);
128
- }
129
- .packages-SelectAddress-popup-23a2 {
130
- background-color: transparent !important;
131
- }
132
- .packages-SelectAddress-select_address-3v1d {
133
- width: 1640px;
134
- height: 824px;
135
- box-sizing: border-box;
136
- padding: 40px;
137
- background: #363639;
138
- border-radius: 24px;
139
- border: 1px solid rgba(255, 255, 255, 0.5);
140
- }
141
- .packages-SelectAddress-select_address-3v1d .packages-SelectAddress-item_title-1zWy {
142
- display: flex;
143
- align-items: center;
144
- font-family: MiSans-Semibold;
145
- font-weight: 600;
146
- font-size: 32px;
147
- line-height: 42px;
148
- }
149
- .packages-SelectAddress-select_address-3v1d .packages-SelectAddress-item_title-1zWy img {
150
- width: 32px;
151
- height: 32px;
152
- margin-right: 10px;
153
- }
154
- .packages-SelectAddress-select_address-3v1d .packages-SelectAddress-item_content-kXYo {
155
- display: flex;
156
- align-items: center;
157
- font-family: MiSans-regular;
158
- font-weight: 400;
159
- font-size: 32px;
160
- color: rgba(255, 255, 255, 0.6);
161
- line-height: 42px;
162
- padding-left: 42px;
163
- margin-top: 16px;
164
- }
165
- .packages-SelectAddress-select_address-3v1d .packages-SelectAddress-item_content-kXYo span {
166
- margin-right: 20px;
167
- }
168
- .packages-SelectAddress-select_address-3v1d .packages-SelectAddress-item_content-kXYo .packages-SelectAddress-def_text-2xeo {
169
- font-family: MiSans-regular;
170
- font-weight: 400;
171
- font-size: 20px;
172
- color: #ffffff;
173
- line-height: 27px;
174
- padding: 2px 10px;
175
- background: #cc522c;
176
- border-radius: 7px;
177
- }
178
- .packages-SelectAddress-select_address-3v1d .packages-SelectAddress-item_active-3Xn3 {
179
- color: rgba(0, 0, 0, 0.9);
180
- }
181
117
  .packages-Picker-loading-1W4w {
182
118
  overflow: hidden;
183
119
  display: flex;
@@ -185,11 +121,14 @@
185
121
  justify-content: center;
186
122
  width: 100%;
187
123
  height: 100%;
124
+ min-width: 100px;
188
125
  position: absolute;
189
126
  left: 0;
190
127
  top: 0;
128
+ background: var(--loading-bg-color);
191
129
  }
192
130
  .packages-Picker-picker-3oJS {
131
+ min-width: 100px;
193
132
  background-color: transparent !important;
194
133
  }
195
134
  .packages-Picker-picker-3oJS .van-picker__mask,
@@ -245,6 +184,70 @@
245
184
  .packages-Popup-popup-1uSf {
246
185
  background-color: transparent !important;
247
186
  }
187
+ .packages-SelectAddress-popup-23a2 {
188
+ background-color: transparent !important;
189
+ }
190
+ .packages-SelectAddress-select_address-3v1d {
191
+ width: 1640px;
192
+ height: 824px;
193
+ box-sizing: border-box;
194
+ padding: 40px;
195
+ background: #363639;
196
+ border-radius: 24px;
197
+ border: 1px solid rgba(255, 255, 255, 0.5);
198
+ }
199
+ .packages-SelectAddress-select_address-3v1d .packages-SelectAddress-item_title-1zWy {
200
+ display: flex;
201
+ align-items: center;
202
+ font-family: MiSans-Semibold;
203
+ font-weight: 600;
204
+ font-size: 32px;
205
+ line-height: 42px;
206
+ }
207
+ .packages-SelectAddress-select_address-3v1d .packages-SelectAddress-item_title-1zWy img {
208
+ width: 32px;
209
+ height: 32px;
210
+ margin-right: 10px;
211
+ }
212
+ .packages-SelectAddress-select_address-3v1d .packages-SelectAddress-item_content-kXYo {
213
+ display: flex;
214
+ align-items: center;
215
+ font-family: MiSans-regular;
216
+ font-weight: 400;
217
+ font-size: 32px;
218
+ color: rgba(255, 255, 255, 0.6);
219
+ line-height: 42px;
220
+ padding-left: 42px;
221
+ margin-top: 16px;
222
+ }
223
+ .packages-SelectAddress-select_address-3v1d .packages-SelectAddress-item_content-kXYo span {
224
+ margin-right: 20px;
225
+ }
226
+ .packages-SelectAddress-select_address-3v1d .packages-SelectAddress-item_content-kXYo .packages-SelectAddress-def_text-2xeo {
227
+ font-family: MiSans-regular;
228
+ font-weight: 400;
229
+ font-size: 20px;
230
+ color: #ffffff;
231
+ line-height: 27px;
232
+ padding: 2px 10px;
233
+ background: #cc522c;
234
+ border-radius: 7px;
235
+ }
236
+ .packages-SelectAddress-select_address-3v1d .packages-SelectAddress-item_active-3Xn3 {
237
+ color: rgba(0, 0, 0, 0.9);
238
+ }
239
+ .packages-FileBag-popup-Hc07 {
240
+ background-color: transparent !important;
241
+ }
242
+ .packages-FileBag-file-bag-xapd {
243
+ width: 1640px;
244
+ height: 824px;
245
+ box-sizing: border-box;
246
+ padding: 40px;
247
+ background: #363639;
248
+ border-radius: 24px;
249
+ border: 1px solid rgba(255, 255, 255, 0.5);
250
+ }
248
251
  .packages-Button-button-1dIW {
249
252
  display: inline-block;
250
253
  font-family: MiSans-regular;
package/lib/esm/index.js CHANGED
@@ -1 +1 @@
1
- import o from"./Popup.js";import t from"./Picker.js";import n from"./SelectAddress.js";import m from"./ListSelect.js";import"vue";import i from"./Button.js";import r from"./FileBag.js";import"vant";import"./browser-c44022ac.js";import"./index-3a473cdc.js";import"./utils.js";import"./staticImg.js";o.install=function(t){t.component(o.name,o)};var a=o;t.install=function(o){o.component(t.name,t)};var e=t;n.install=function(o){o.component(n.name,n)};var s=n;m.install=function(o){o.component(m.name,m)};var p=m;i.install=function(o){o.component(i.name,i)};var c=i;r.install=function(o){o.component(r.name,r)};var l=r;export{c as Button,l as FileBag,p as ListSelect,e as Picker,a as Popup,s as SelectAddress};
1
+ import o from"./Popup.js";import t from"./Picker.js";import n from"./SelectAddress.js";import m from"./ListSelect.js";import"vue";import i from"./Button.js";import r from"./FileBag.js";import"vant";import"./browser-6ab36fa0.js";import"./index-f8fc1682.js";import"./utils.js";import"./staticImg.js";o.install=function(t){t.component(o.name,o)};var a=o;t.install=function(o){o.component(t.name,t)};var e=t;n.install=function(o){o.component(n.name,n)};var s=n;m.install=function(o){o.component(m.name,m)};var p=m;i.install=function(o){o.component(i.name,i)};var c=i;r.install=function(o){o.component(r.name,r)};var l=r;export{c as Button,l as FileBag,p as ListSelect,e as Picker,a as Popup,s as SelectAddress};
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"ftvs-vue2","version":"0.0.15","description":"未来电视vue2版本ui库","main":"./lib/cjs/index.js","module":"./lib/esm/index.js","license":"MIT","dependencies":{},"peerDependencies":{"qrcodejs2":"^0.0.2","vant":"^2.12.6"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"}}
1
+ {"name":"ftvs-vue2","version":"0.0.17","description":"未来电视vue2版本ui库","main":"./lib/cjs/index.js","module":"./lib/esm/index.js","license":"MIT","dependencies":{},"peerDependencies":{"qrcodejs2":"^0.0.2","vant":"^2.12.6"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"}}