ftvs-vue2 0.0.14 → 0.0.16
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 +1 -1
- package/lib/cjs/FileBag.js +1 -1
- package/lib/cjs/ListSelect.js +1 -1
- package/lib/cjs/Picker.js +1 -1
- package/lib/cjs/Popup.js +1 -1
- package/lib/cjs/SelectAddress.js +1 -1
- package/lib/cjs/index.css +14 -14
- package/lib/cjs/index.js +1 -1
- package/lib/esm/Button.js +1 -1
- package/lib/esm/FileBag.js +1 -1
- package/lib/esm/ListSelect.js +1 -1
- package/lib/esm/Picker.js +1 -1
- package/lib/esm/Popup.js +1 -1
- package/lib/esm/SelectAddress.js +1 -1
- package/lib/esm/index.css +14 -14
- package/lib/esm/index.js +1 -1
- package/package.json +1 -1
- /package/lib/cjs/{browser-b5f834f1.js → browser-9d1bb7a0.js} +0 -0
- /package/lib/cjs/{index-ca115bd4.js → index-c12cab58.js} +0 -0
- /package/lib/esm/{browser-c059c4fe.js → browser-89a6647c.js} +0 -0
- /package/lib/esm/{index-b608a814.js → index-f82bfe29.js} +0 -0
package/lib/cjs/Button.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./browser-
|
|
1
|
+
"use strict";var e=require("./browser-9d1bb7a0.js"),t={name:"Button",props:{type:{type:String,default:"default",desc:"default | danger"}},emits:{click:function(e){return"点击事件"}}},a=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)};a._withStripped=!0;var n=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:a,staticRenderFns:[]},n,t,undefined,false,undefined,!1,e.createInjector,void 0,void 0);module.exports=r;
|
package/lib/cjs/FileBag.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./index-
|
|
1
|
+
"use strict";var e=require("./index-c12cab58.js"),t=require("./Popup.js"),i=require("./ListSelect.js"),n=require("./browser-9d1bb7a0.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;
|
package/lib/cjs/ListSelect.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./index-
|
|
1
|
+
"use strict";var e=require("./index-c12cab58.js"),t=require("./utils.js"),n=require("./staticImg.js"),i=require("./browser-9d1bb7a0.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-
|
|
1
|
+
"use strict";var n=require("./index-c12cab58.js"),e=require("vant"),t=require("./utils.js"),o=require("./browser-9d1bb7a0.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 u(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)?u(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,r=!0,l=!1;return{s:function(){t=t.call(n)},n:function(){var n=t.next();return r=n.done,n},e:function(n){l=!0,i=n},f:function(){try{r||null==t.return||t.return()}finally{if(l)throw i}}}}function u(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 r={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级树形结构"},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,u=null===(e=Array.from(null==i?void 0:i.children))||void 0===e?void 0:e.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,c=this.$refs.vantPicker.getValues();l="singleRow"===this.columnsType?c[0]:this.isTree?c.map(function(n){return n&&n[t.valueKey]}):c,this.emitVal(l,c)}},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 u=e-1;u>=0;u--)if(!n[u].disabled)return u;return 0},u=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(u,"px, 0px)"),this.$forceUpdate()},getAndUpdateChildren:function(n,e,t){var o=this,s=function(n){var u,r=i(n);try{for(r.s();!(u=r.n()).done;){var l=u.value;if(l[o.idKey]===e)return t&&o.$set(l,"children",t),l;if(l.children){var c=s(l.children);if(c)return c}}}catch(n){r.e(n)}finally{r.f()}return null},u=s(n);return u&&u.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")},recoverFocus:function(){this.isMove&&(this.ftvsTvInit(),this.setNowColumnsFocus())},againFocus:function(){},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(){this.popupRoot&&"function"==typeof this.popupRoot.getSlotPicker&&this.popupRoot.getSlotPicker(this)}},l=r,c=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)};c._withStripped=!0;var a=function(n){n&&(n("data-v-c30b0b32_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:c,staticRenderFns:[]},a,l,undefined,false,undefined,!1,o.createInjector,void 0,void 0);module.exports=m;
|
package/lib/cjs/Popup.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("vant"),o=require("./browser-
|
|
1
|
+
"use strict";var e=require("vant"),o=require("./browser-9d1bb7a0.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=this;this.show=e,e&&this.$nextTick(function(){var e;null===(e=o.slotPicker)||void 0===e||e.recoverFocus()})},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-a5054222_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;
|
package/lib/cjs/SelectAddress.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./index-
|
|
1
|
+
"use strict";var e=require("./index-c12cab58.js"),t=require("vue"),n=require("./Popup.js"),s=require("./ListSelect.js"),r=require("./staticImg.js"),i=require("./browser-9d1bb7a0.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;
|
package/lib/cjs/index.css
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
.packages-
|
|
1
|
+
.packages-Popup-popup-1uSf {
|
|
2
2
|
background-color: transparent !important;
|
|
3
3
|
}
|
|
4
|
-
.packages-FileBag-file-bag-xapd {
|
|
5
|
-
width: 1640px;
|
|
6
|
-
height: 824px;
|
|
7
|
-
box-sizing: border-box;
|
|
8
|
-
padding: 40px;
|
|
9
|
-
background: #363639;
|
|
10
|
-
border-radius: 24px;
|
|
11
|
-
border: 1px solid rgba(255, 255, 255, 0.5);
|
|
12
|
-
}
|
|
13
4
|
.packages-SelectAddress-popup-23a2 {
|
|
14
5
|
background-color: transparent !important;
|
|
15
6
|
}
|
|
@@ -62,6 +53,18 @@
|
|
|
62
53
|
.packages-SelectAddress-select_address-3v1d .packages-SelectAddress-item_active-3Xn3 {
|
|
63
54
|
color: rgba(0, 0, 0, 0.9);
|
|
64
55
|
}
|
|
56
|
+
.packages-FileBag-popup-Hc07 {
|
|
57
|
+
background-color: transparent !important;
|
|
58
|
+
}
|
|
59
|
+
.packages-FileBag-file-bag-xapd {
|
|
60
|
+
width: 1640px;
|
|
61
|
+
height: 824px;
|
|
62
|
+
box-sizing: border-box;
|
|
63
|
+
padding: 40px;
|
|
64
|
+
background: #363639;
|
|
65
|
+
border-radius: 24px;
|
|
66
|
+
border: 1px solid rgba(255, 255, 255, 0.5);
|
|
67
|
+
}
|
|
65
68
|
.packages-Picker-loading-1W4w {
|
|
66
69
|
overflow: hidden;
|
|
67
70
|
display: flex;
|
|
@@ -92,7 +95,7 @@
|
|
|
92
95
|
color: rgba(0, 0, 0, 0.9);
|
|
93
96
|
}
|
|
94
97
|
.packages-Picker-picker-3oJS .packages-Picker-column_item-3Wh4 {
|
|
95
|
-
width:
|
|
98
|
+
width: 320px;
|
|
96
99
|
height: 110px;
|
|
97
100
|
border-radius: 55px;
|
|
98
101
|
font-family: MiSans-Medium;
|
|
@@ -126,9 +129,6 @@
|
|
|
126
129
|
line-height: 36px;
|
|
127
130
|
max-height: 72px;
|
|
128
131
|
}
|
|
129
|
-
.packages-Popup-popup-1uSf {
|
|
130
|
-
background-color: transparent !important;
|
|
131
|
-
}
|
|
132
132
|
.packages-ListSelect-list_select-83QA .packages-ListSelect-title-eOZz {
|
|
133
133
|
font-family: MiSans-Semibold;
|
|
134
134
|
font-weight: 600;
|
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-
|
|
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-9d1bb7a0.js"),require("./index-c12cab58.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 a=r;t.install=function(e){e.component(t.name,t)};var u=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=a,exports.Popup=o,exports.SelectAddress=u;
|
package/lib/esm/Button.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,c as t}from"./browser-
|
|
1
|
+
import{n as e,c as t}from"./browser-89a6647c.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};
|
package/lib/esm/FileBag.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,r as e}from"./index-
|
|
1
|
+
import{_ as t,r as e}from"./index-f82bfe29.js";import i from"./Popup.js";import n from"./ListSelect.js";import{n as s,c as a}from"./browser-89a6647c.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};
|
package/lib/esm/ListSelect.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,r as t}from"./index-
|
|
1
|
+
import{_ as e,r as t}from"./index-f82bfe29.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-89a6647c.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-
|
|
1
|
+
import{_ as n,r as t}from"./index-f82bfe29.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-89a6647c.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 c(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 a(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)?a(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 a(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},inject:["popupRoot"],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,c=this.$refs.vantPicker.getValues();l="singleRow"===this.columnsType?c[0]:this.isTree?c.map(function(n){return n&&n[e.valueKey]}):c,this.emitVal(l,c)}},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=c(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")},recoverFocus:function(){this.isMove&&(this.ftvsTvInit(),this.setNowColumnsFocus())},againFocus:function(){},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(){this.popupRoot&&"function"==typeof this.popupRoot.getSlotPicker&&this.popupRoot.getSlotPicker(this)}},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-c30b0b32_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};
|
package/lib/esm/Popup.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Popup as e}from"vant";import{n as o,c as t}from"./browser-
|
|
1
|
+
import{Popup as e}from"vant";import{n as o,c as t}from"./browser-89a6647c.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=this;this.show=e,e&&this.$nextTick(function(){var e;null===(e=o.slotPicker)||void 0===e||e.recoverFocus()})},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-a5054222_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};
|
package/lib/esm/SelectAddress.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,r as t}from"./index-
|
|
1
|
+
import{_ as e,r as t}from"./index-f82bfe29.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-89a6647c.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};
|
package/lib/esm/index.css
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
.packages-
|
|
1
|
+
.packages-Popup-popup-1uSf {
|
|
2
2
|
background-color: transparent !important;
|
|
3
3
|
}
|
|
4
|
-
.packages-FileBag-file-bag-xapd {
|
|
5
|
-
width: 1640px;
|
|
6
|
-
height: 824px;
|
|
7
|
-
box-sizing: border-box;
|
|
8
|
-
padding: 40px;
|
|
9
|
-
background: #363639;
|
|
10
|
-
border-radius: 24px;
|
|
11
|
-
border: 1px solid rgba(255, 255, 255, 0.5);
|
|
12
|
-
}
|
|
13
4
|
.packages-SelectAddress-popup-23a2 {
|
|
14
5
|
background-color: transparent !important;
|
|
15
6
|
}
|
|
@@ -62,6 +53,18 @@
|
|
|
62
53
|
.packages-SelectAddress-select_address-3v1d .packages-SelectAddress-item_active-3Xn3 {
|
|
63
54
|
color: rgba(0, 0, 0, 0.9);
|
|
64
55
|
}
|
|
56
|
+
.packages-FileBag-popup-Hc07 {
|
|
57
|
+
background-color: transparent !important;
|
|
58
|
+
}
|
|
59
|
+
.packages-FileBag-file-bag-xapd {
|
|
60
|
+
width: 1640px;
|
|
61
|
+
height: 824px;
|
|
62
|
+
box-sizing: border-box;
|
|
63
|
+
padding: 40px;
|
|
64
|
+
background: #363639;
|
|
65
|
+
border-radius: 24px;
|
|
66
|
+
border: 1px solid rgba(255, 255, 255, 0.5);
|
|
67
|
+
}
|
|
65
68
|
.packages-Picker-loading-1W4w {
|
|
66
69
|
overflow: hidden;
|
|
67
70
|
display: flex;
|
|
@@ -92,7 +95,7 @@
|
|
|
92
95
|
color: rgba(0, 0, 0, 0.9);
|
|
93
96
|
}
|
|
94
97
|
.packages-Picker-picker-3oJS .packages-Picker-column_item-3Wh4 {
|
|
95
|
-
width:
|
|
98
|
+
width: 320px;
|
|
96
99
|
height: 110px;
|
|
97
100
|
border-radius: 55px;
|
|
98
101
|
font-family: MiSans-Medium;
|
|
@@ -126,9 +129,6 @@
|
|
|
126
129
|
line-height: 36px;
|
|
127
130
|
max-height: 72px;
|
|
128
131
|
}
|
|
129
|
-
.packages-Popup-popup-1uSf {
|
|
130
|
-
background-color: transparent !important;
|
|
131
|
-
}
|
|
132
132
|
.packages-ListSelect-list_select-83QA .packages-ListSelect-title-eOZz {
|
|
133
133
|
font-family: MiSans-Semibold;
|
|
134
134
|
font-weight: 600;
|
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-
|
|
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-89a6647c.js";import"./index-f82bfe29.js";import"./utils.js";import"./staticImg.js";o.install=function(t){t.component(o.name,o)};var e=o;t.install=function(o){o.component(t.name,t)};var a=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,a as Picker,e as Popup,s as SelectAddress};
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"ftvs-vue2","version":"0.0.
|
|
1
|
+
{"name":"ftvs-vue2","version":"0.0.16","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/"}}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|