Files
supplier-dispatch-h5/node_modules/.cache/babel-loader/f035d005d00365f71d48cea96f1d7aa164dc74a5400927665d1e036371adcc98.json
2023-08-11 10:45:20 +08:00

1 line
6.2 KiB
JSON

{"ast":null,"code":"import _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\n// Utils\nimport { createNamespace, isDef } from '../utils';\nimport { inherit } from '../utils/functional'; // Components\n\nimport Cell from '../cell'; // Types\n\nvar _createNamespace = createNamespace('coupon-cell'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1],\n t = _createNamespace[2];\nfunction formatValue(props) {\n var coupons = props.coupons,\n chosenCoupon = props.chosenCoupon,\n currency = props.currency;\n var coupon = coupons[+chosenCoupon];\n if (coupon) {\n var value = 0;\n if (isDef(coupon.value)) {\n value = coupon.value;\n } else if (isDef(coupon.denominations)) {\n value = coupon.denominations;\n }\n return \"-\" + currency + \" \" + (value / 100).toFixed(2);\n }\n return coupons.length === 0 ? t('tips') : t('count', coupons.length);\n}\nfunction CouponCell(h, props, slots, ctx) {\n var selected = props.coupons[+props.chosenCoupon];\n var value = formatValue(props);\n return h(Cell, _mergeJSXProps([{\n \"class\": bem(),\n \"attrs\": {\n \"value\": value,\n \"title\": props.title || t('title'),\n \"border\": props.border,\n \"isLink\": props.editable,\n \"valueClass\": bem('value', {\n selected: selected\n })\n }\n }, inherit(ctx, true)]));\n}\nCouponCell.model = {\n prop: 'chosenCoupon'\n};\nCouponCell.props = {\n title: String,\n coupons: {\n type: Array,\n default: function _default() {\n return [];\n }\n },\n currency: {\n type: String,\n default: '¥'\n },\n border: {\n type: Boolean,\n default: true\n },\n editable: {\n type: Boolean,\n default: true\n },\n chosenCoupon: {\n type: [Number, String],\n default: -1\n }\n};\nexport default createComponent(CouponCell);","map":{"version":3,"names":["_mergeJSXProps","createNamespace","isDef","inherit","Cell","_createNamespace","createComponent","bem","t","formatValue","props","coupons","chosenCoupon","currency","coupon","value","denominations","toFixed","length","CouponCell","h","slots","ctx","selected","title","border","editable","model","prop","String","type","Array","default","_default","Boolean","Number"],"sources":["E:/work/sino/sino-h5/node_modules/vant/es/coupon-cell/index.js"],"sourcesContent":["import _mergeJSXProps from \"@vue/babel-helper-vue-jsx-merge-props\";\n// Utils\nimport { createNamespace, isDef } from '../utils';\nimport { inherit } from '../utils/functional'; // Components\n\nimport Cell from '../cell'; // Types\n\nvar _createNamespace = createNamespace('coupon-cell'),\n createComponent = _createNamespace[0],\n bem = _createNamespace[1],\n t = _createNamespace[2];\n\nfunction formatValue(props) {\n var coupons = props.coupons,\n chosenCoupon = props.chosenCoupon,\n currency = props.currency;\n var coupon = coupons[+chosenCoupon];\n\n if (coupon) {\n var value = 0;\n\n if (isDef(coupon.value)) {\n value = coupon.value;\n } else if (isDef(coupon.denominations)) {\n value = coupon.denominations;\n }\n\n return \"-\" + currency + \" \" + (value / 100).toFixed(2);\n }\n\n return coupons.length === 0 ? t('tips') : t('count', coupons.length);\n}\n\nfunction CouponCell(h, props, slots, ctx) {\n var selected = props.coupons[+props.chosenCoupon];\n var value = formatValue(props);\n return h(Cell, _mergeJSXProps([{\n \"class\": bem(),\n \"attrs\": {\n \"value\": value,\n \"title\": props.title || t('title'),\n \"border\": props.border,\n \"isLink\": props.editable,\n \"valueClass\": bem('value', {\n selected: selected\n })\n }\n }, inherit(ctx, true)]));\n}\n\nCouponCell.model = {\n prop: 'chosenCoupon'\n};\nCouponCell.props = {\n title: String,\n coupons: {\n type: Array,\n default: function _default() {\n return [];\n }\n },\n currency: {\n type: String,\n default: '¥'\n },\n border: {\n type: Boolean,\n default: true\n },\n editable: {\n type: Boolean,\n default: true\n },\n chosenCoupon: {\n type: [Number, String],\n default: -1\n }\n};\nexport default createComponent(CouponCell);"],"mappings":"AAAA,OAAOA,cAAc,MAAM,uCAAuC;AAClE;AACA,SAASC,eAAe,EAAEC,KAAK,QAAQ,UAAU;AACjD,SAASC,OAAO,QAAQ,qBAAqB,CAAC,CAAC;;AAE/C,OAAOC,IAAI,MAAM,SAAS,C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