From 85dadabf60634f33d74699e3fd373644f7e240e8 Mon Sep 17 00:00:00 2001 From: xuliangzhan Date: Fri, 9 Aug 2019 15:12:29 +0800 Subject: [PATCH] update --- dist/index.common.js | 4 ++-- dist/index.js | 4 ++-- dist/index.min.js | 2 +- index.js | 4 ++-- package.json | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dist/index.common.js b/dist/index.common.js index 0b4f7c6..108a50f 100644 --- a/dist/index.common.js +++ b/dist/index.common.js @@ -338,7 +338,7 @@ var renderMap = { column = _ref4.column; var data = option.data; var property = column.property, - renderOpts = column.renderOpts; + renderOpts = column.filterRender; var _renderOpts$props2 = renderOpts.props, props = _renderOpts$props2 === void 0 ? {} : _renderOpts$props2; @@ -443,7 +443,7 @@ var renderMap = { row = _ref7.row, column = _ref7.column; var data = option.data; - var renderOpts = column.renderOpts; + var renderOpts = column.filterRender; var _renderOpts$props3 = renderOpts.props, props = _renderOpts$props3 === void 0 ? {} : _renderOpts$props3; diff --git a/dist/index.js b/dist/index.js index 37bde24..d2911f6 100644 --- a/dist/index.js +++ b/dist/index.js @@ -350,7 +350,7 @@ column = _ref4.column; var data = option.data; var property = column.property, - renderOpts = column.renderOpts; + renderOpts = column.filterRender; var _renderOpts$props2 = renderOpts.props, props = _renderOpts$props2 === void 0 ? {} : _renderOpts$props2; @@ -455,7 +455,7 @@ row = _ref7.row, column = _ref7.column; var data = option.data; - var renderOpts = column.renderOpts; + var renderOpts = column.filterRender; var _renderOpts$props3 = renderOpts.props, props = _renderOpts$props3 === void 0 ? {} : _renderOpts$props3; diff --git a/dist/index.min.js b/dist/index.min.js index bc30ae2..a4c0f02 100644 --- a/dist/index.min.js +++ b/dist/index.min.js @@ -1 +1 @@ -!function(e,t){if("function"==typeof define&&define.amd)define("vxe-table-plugin-iview",["exports","xe-utils"],t);else if("undefined"!=typeof exports)t(exports,require("xe-utils"));else{var n={exports:{}};t(n.exports,e.XEUtils),e.VXETablePluginIView=n.exports.default}}(this,function(e,b){"use strict";var t;function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e,t,n){return b.default.toDateString(e,t.format||n)}function c(e,t,n,r){return b.default.map(e,function(e){return p(e,t,r)}).join(n)}function l(e,t,n,r){return(e=p(e,n,r))>=p(t[0],n,r)&&e<=p(t[1],n,r)}function y(e,t){var n=e.$table,r=t.props;return b.default.assign(n.vSize?{size:n.vSize}:{},r)}function m(e,t){var n=e.events,r=t.$table,o=d({},"on-change",function(){return r.updateStatus(t)});return n&&b.default.assign(o,b.default.objectMap(n,function(e){return function(){e.apply(null,[t].concat.apply(t,arguments))}})),o}function n(e,t,n){var r=n.row,o=n.column,a=t.attrs,u=y(n,t);return[e(t.name,{props:u,attrs:a,model:{value:b.default.get(r,o.property),callback:function(e){b.default.set(r,o.property,e)}},on:m(t,n)})]}function g(e,t,n){var r=t.events;return r&&b.default.assign(e,b.default.objectMap(r,function(e){return function(){e.apply(null,[n].concat.apply(n,arguments))}})),e}function r(e,n,r,o){var a=r.column,u=n.name,i=n.attrs,l=y(r,n);return a.filters.map(function(t){return e(u,{props:l,attrs:i,model:{value:t.data,callback:function(e){t.data=e}},on:g(d({},"on-change",function(){M(o,a,!!t.data,t)}),n,r)})})}function M(e,t,n,r){e[t.filterMultiple?"changeMultipleOption":"changeRadioOption"]({},n,r)}function o(e){var t=e.option,n=e.row,r=e.column,o=t.data;return b.default.get(n,r.property)===o}function h(n,e,t){var r=t.label||"label",o=t.value||"value";return b.default.map(e,function(e,t){return n("Option",{props:{value:e[o],label:e[r]},key:t})})}function w(e,t){return[""+(null==t?"":t)]}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,b=(t=b)&&t.__esModule?t:{default:t};var a={Input:{autofocus:"input.ivu-input",renderDefault:n,renderEdit:n,renderFilter:r,filterMethod:o},AutoComplete:{autofocus:"input.ivu-input",renderDefault:n,renderEdit:n,renderFilter:r,filterMethod:o},InputNumber:{autofocus:"input.ivu-input-number-input",renderDefault:n,renderEdit:n,renderFilter:r,filterMethod:o},Select:{renderEdit:function(n,e,t){var r=e.options,o=e.optionGroups,a=e.optionProps,u=void 0===a?{}:a,i=e.optionGroupProps,l=void 0===i?{}:i,d=t.row,p=t.column,c=e.attrs,f=y(t,e);if(o){var s=l.options||"options",v=l.label||"label";return[n("Select",{props:f,attrs:c,model:{value:b.default.get(d,p.property),callback:function(e){b.default.set(d,p.property,e)}},on:m(e,t)},b.default.map(o,function(e,t){return n("OptionGroup",{props:{label:e[v]},key:t},h(n,e[s],u))}))]}return[n("Select",{props:f,attrs:c,model:{value:b.default.get(d,p.property),callback:function(e){b.default.set(d,p.property,e)}},on:m(e,t)},h(n,r,u))]},renderCell:function(e,t,n){var r=t.options,o=t.optionGroups,a=t.props,u=void 0===a?{}:a,i=t.optionProps,l=void 0===i?{}:i,d=t.optionGroupProps,p=void 0===d?{}:d,c=n.row,f=n.column,s=l.label||"label",v=l.value||"value",y=p.options||"options",m=b.default.get(c,f.property);return w(0,null!=m&&""!==m?b.default.map(u.multiple?m:[m],o?function(t){for(var e,n=0;nn&&b.default.each(e,function(e){e.value===a&&(o.push(e.label),t(++n,e.children,r,o))})}(0,o.data,i,l),w(0,l.join(" ".concat(o.separator||"/"," ")))}},DatePicker:{renderEdit:n,renderCell:function(e,t,n){var r=t.props,o=void 0===r?{}:r,a=n.row,u=n.column,i=o.separator,l=b.default.get(a,u.property);switch(o.type){case"week":l=p(l,o,"yyyywWW");break;case"month":l=p(l,o,"yyyy-MM");break;case"year":l=p(l,o,"yyyy");break;case"dates":l=c(l,o,", ","yyyy-MM-dd");break;case"daterange":l=c(l,o," ".concat(i||"-"," "),"yyyy-MM-dd");break;case"datetimerange":l=c(l,o," ".concat(i||"-"," "),"yyyy-MM-dd HH:ss:mm");break;default:l=p(l,o,"yyyy-MM-dd")}return w(0,l)},renderFilter:function(e,n,r,o){var a=r.column,u=n.attrs,i=y(r,n);return a.filters.map(function(t){return e(n.name,{props:i,attrs:u,model:{value:t.data,callback:function(e){t.data=e}},on:g({"on-change":function(e){M(o,a,!!e,t)}},n,r)})})},filterMethod:function(e){var t=e.option,n=e.row,r=e.column,o=t.data,a=r.renderOpts.props,u=void 0===a?{}:a,i=b.default.get(n,r.property);if(o)switch(u.type){case"daterange":return l(i,o,u,"yyyy-MM-dd");case"datetimerange":return l(i,o,u,"yyyy-MM-dd HH:ss:mm");default:return i===o}return!1}},TimePicker:{renderEdit:n},Rate:{renderDefault:n,renderEdit:n,renderFilter:r,filterMethod:o},iSwitch:{renderDefault:n,renderEdit:n,renderFilter:r,filterMethod:o}};function u(e,t,n){if((0,n.getEventTargetNode)(t,document.body,"ivu-select-dropdown").flag)return!1}var i={install:function(e){var t=e.interceptor;e.renderer.mixin(a),t.add("event.clear_filter",u),t.add("event.clear_actived",u)}};"undefined"!=typeof window&&window.VXETable&&window.VXETable.use(i);var f=i;e.default=f}); \ No newline at end of file +!function(e,t){if("function"==typeof define&&define.amd)define("vxe-table-plugin-iview",["exports","xe-utils"],t);else if("undefined"!=typeof exports)t(exports,require("xe-utils"));else{var n={exports:{}};t(n.exports,e.XEUtils),e.VXETablePluginIView=n.exports.default}}(this,function(e,b){"use strict";var t;function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e,t,n){return b.default.toDateString(e,t.format||n)}function f(e,t,n,r){return b.default.map(e,function(e){return p(e,t,r)}).join(n)}function l(e,t,n,r){return(e=p(e,n,r))>=p(t[0],n,r)&&e<=p(t[1],n,r)}function y(e,t){var n=e.$table,r=t.props;return b.default.assign(n.vSize?{size:n.vSize}:{},r)}function m(e,t){var n=e.events,r=t.$table,o=d({},"on-change",function(){return r.updateStatus(t)});return n&&b.default.assign(o,b.default.objectMap(n,function(e){return function(){e.apply(null,[t].concat.apply(t,arguments))}})),o}function n(e,t,n){var r=n.row,o=n.column,a=t.attrs,u=y(n,t);return[e(t.name,{props:u,attrs:a,model:{value:b.default.get(r,o.property),callback:function(e){b.default.set(r,o.property,e)}},on:m(t,n)})]}function g(e,t,n){var r=t.events;return r&&b.default.assign(e,b.default.objectMap(r,function(e){return function(){e.apply(null,[n].concat.apply(n,arguments))}})),e}function r(e,n,r,o){var a=r.column,u=n.name,i=n.attrs,l=y(r,n);return a.filters.map(function(t){return e(u,{props:l,attrs:i,model:{value:t.data,callback:function(e){t.data=e}},on:g(d({},"on-change",function(){M(o,a,!!t.data,t)}),n,r)})})}function M(e,t,n,r){e[t.filterMultiple?"changeMultipleOption":"changeRadioOption"]({},n,r)}function o(e){var t=e.option,n=e.row,r=e.column,o=t.data;return b.default.get(n,r.property)===o}function h(n,e,t){var r=t.label||"label",o=t.value||"value";return b.default.map(e,function(e,t){return n("Option",{props:{value:e[o],label:e[r]},key:t})})}function w(e,t){return[""+(null==t?"":t)]}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,b=(t=b)&&t.__esModule?t:{default:t};var a={Input:{autofocus:"input.ivu-input",renderDefault:n,renderEdit:n,renderFilter:r,filterMethod:o},AutoComplete:{autofocus:"input.ivu-input",renderDefault:n,renderEdit:n,renderFilter:r,filterMethod:o},InputNumber:{autofocus:"input.ivu-input-number-input",renderDefault:n,renderEdit:n,renderFilter:r,filterMethod:o},Select:{renderEdit:function(n,e,t){var r=e.options,o=e.optionGroups,a=e.optionProps,u=void 0===a?{}:a,i=e.optionGroupProps,l=void 0===i?{}:i,d=t.row,p=t.column,f=e.attrs,c=y(t,e);if(o){var s=l.options||"options",v=l.label||"label";return[n("Select",{props:c,attrs:f,model:{value:b.default.get(d,p.property),callback:function(e){b.default.set(d,p.property,e)}},on:m(e,t)},b.default.map(o,function(e,t){return n("OptionGroup",{props:{label:e[v]},key:t},h(n,e[s],u))}))]}return[n("Select",{props:c,attrs:f,model:{value:b.default.get(d,p.property),callback:function(e){b.default.set(d,p.property,e)}},on:m(e,t)},h(n,r,u))]},renderCell:function(e,t,n){var r=t.options,o=t.optionGroups,a=t.props,u=void 0===a?{}:a,i=t.optionProps,l=void 0===i?{}:i,d=t.optionGroupProps,p=void 0===d?{}:d,f=n.row,c=n.column,s=l.label||"label",v=l.value||"value",y=p.options||"options",m=b.default.get(f,c.property);return w(0,null!=m&&""!==m?b.default.map(u.multiple?m:[m],o?function(t){for(var e,n=0;nn&&b.default.each(e,function(e){e.value===a&&(o.push(e.label),t(++n,e.children,r,o))})}(0,o.data,i,l),w(0,l.join(" ".concat(o.separator||"/"," ")))}},DatePicker:{renderEdit:n,renderCell:function(e,t,n){var r=t.props,o=void 0===r?{}:r,a=n.row,u=n.column,i=o.separator,l=b.default.get(a,u.property);switch(o.type){case"week":l=p(l,o,"yyyywWW");break;case"month":l=p(l,o,"yyyy-MM");break;case"year":l=p(l,o,"yyyy");break;case"dates":l=f(l,o,", ","yyyy-MM-dd");break;case"daterange":l=f(l,o," ".concat(i||"-"," "),"yyyy-MM-dd");break;case"datetimerange":l=f(l,o," ".concat(i||"-"," "),"yyyy-MM-dd HH:ss:mm");break;default:l=p(l,o,"yyyy-MM-dd")}return w(0,l)},renderFilter:function(e,n,r,o){var a=r.column,u=n.attrs,i=y(r,n);return a.filters.map(function(t){return e(n.name,{props:i,attrs:u,model:{value:t.data,callback:function(e){t.data=e}},on:g({"on-change":function(e){M(o,a,!!e,t)}},n,r)})})},filterMethod:function(e){var t=e.option,n=e.row,r=e.column,o=t.data,a=r.filterRender.props,u=void 0===a?{}:a,i=b.default.get(n,r.property);if(o)switch(u.type){case"daterange":return l(i,o,u,"yyyy-MM-dd");case"datetimerange":return l(i,o,u,"yyyy-MM-dd HH:ss:mm");default:return i===o}return!1}},TimePicker:{renderEdit:n},Rate:{renderDefault:n,renderEdit:n,renderFilter:r,filterMethod:o},iSwitch:{renderDefault:n,renderEdit:n,renderFilter:r,filterMethod:o}};function u(e,t,n){if((0,n.getEventTargetNode)(t,document.body,"ivu-select-dropdown").flag)return!1}var i={install:function(e){var t=e.interceptor;e.renderer.mixin(a),t.add("event.clear_filter",u),t.add("event.clear_actived",u)}};"undefined"!=typeof window&&window.VXETable&&window.VXETable.use(i);var c=i;e.default=c}); \ No newline at end of file diff --git a/index.js b/index.js index 1891b98..c4be5ab 100644 --- a/index.js +++ b/index.js @@ -272,7 +272,7 @@ const renderMap = { }, filterMethod ({ option, row, column }) { let { data } = option - let { property, renderOpts } = column + let { property, filterRender: renderOpts } = column let { props = {} } = renderOpts let cellValue = XEUtils.get(row, property) if (props.multiple) { @@ -351,7 +351,7 @@ const renderMap = { }, filterMethod ({ option, row, column }) { let { data } = option - let { renderOpts } = column + let { filterRender: renderOpts } = column let { props = {} } = renderOpts let cellValue = XEUtils.get(row, column.property) if (data) { diff --git a/package.json b/package.json index 8749eec..3d067f6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vxe-table-plugin-iview", - "version": "1.3.3", + "version": "1.3.4", "description": "vxe-table renderer plugins for iview.", "scripts": { "lib": "gulp build"