@vxe-ui/plugin-render-antd 4.0.0 → 4.0.2
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/dist/index.common.js +668 -0
- package/dist/index.umd.js +681 -0
- package/dist/index.umd.min.js +1 -0
- package/dist/style.css +75 -0
- package/dist/style.min.css +1 -0
- package/index.ts +14 -70
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"function"==typeof define&&define.amd?define("@vxe-ui/plugin-render-antd",["exports","vue","xe-utils"],t):"undefined"!=typeof exports?t(exports,require("vue"),require("xe-utils")):(t(t={},e.Vue,e.XEUtils),e.VXETablePluginExportXLSX=t)}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:this,function(e,f,c){var n;function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function p(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(Object(n),!0).forEach(function(e){u(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function u(e,t,n){return(t=function(e){e=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string");return"symbol"==r(e)?e:e+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e){return null==e||""===e}function m(e){return"on"+e.substring(0,1).toLocaleUpperCase()+e.substring(1)}function i(e){var t="value";return t="ASwitch"===e.name?"checked":t}function a(e){return e&&"".concat(e).replace("YYYY","yyyy").replace("DD","dd")}function d(e,t,n,r){return c.default.assign({},r,e.props,u({},i(e),n))}function v(e,t,n,r){return c.default.assign({},r,e.props,u({},i(e),n))}function l(e){return""+(s(e)?"":e)}function h(e,t,n){e=e.placeholder;return[(0,f.h)("span",{class:"vxe-cell--label"},e&&s(n)?[(0,f.h)("span",{class:"vxe-cell--placeholder"},l(e))]:l(n))]}function g(e,o,t,r){var n,u=e.events,i=(n="update:value",n="ASwitch"===e.name?"update:checked":n),a="change",l=a===i,d={};return c.default.objectEach(u,function(r,e){d[m(e)]=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];r.apply(void 0,[o].concat(t))}}),t&&(d[m(i)]=function(e){t(e),u&&u[i]&&u[i](o,e),l&&r&&r(e)}),!l&&r&&(d[m(a)]=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];r.apply(void 0,t),u&&u[a]&&u[a].apply(u,[o].concat(t))}),d}function b(e,t){var n=t.$table,r=t.row,o=t.column;return g(e,t,function(e){c.default.set(r,o.field,e)},function(){n.updateStatus(t)})}function y(e,t,n,r){return g(e,t,function(e){n.data=e},r)}function C(e,t){var n=t.$form,r=t.data,o=t.field;return g(e,t,function(e){c.default.set(r,o,e)},function(){n.updateStatus(t)})}function w(n){return function(e,t){return h(e,0,N(e,t,n))}}function Y(e,t){var n=e.options,r=void 0===n?[]:n,o=e.optionGroups,n=e.props,n=void 0===n?{}:n,u=e.optionProps,u=void 0===u?{}:u,e=e.optionGroupProps,i=t.row,t=t.column,a=u.label||"label",l=u.value||"value",d=(void 0===e?{}:e).options||"options",u=c.default.get(i,t.field);return s(u)?"":c.default.map("multiple"===n.mode?u:[u],o?function(t){for(var e,n=0;n<o.length&&!(e=c.default.find(o[n][d],function(e){return e[l]===t}));n++);return e?e[a]:t}:function(t){var e=c.default.find(r,function(e){return e[l]===t});return e?e[a]:t}).join(", ")}function x(e,t){var e=e.props,e=void 0===e?{}:e,n=t.row,t=t.column,n=c.default.get(n,t.field),t=[];return function t(n,e,r,o){var u=r[n];e&&r.length>n&&c.default.each(e,function(e){e.value===u&&(o.push(e.label),t(++n,e.children,r,o))})}(0,e.options,n||[],t),(!1===e.showAllLevels?t.slice(t.length-1,t.length):t).join(" ".concat(e.separator||"/"," "))}function A(e,t){var e=e.props,n=void 0===e?{}:e,e=t.row,t=t.column,e=c.default.get(e,t.field);return e=e&&c.default.map(e,function(e){return e&&e.format?e.format(n.format||"YYYY-MM-DD"):c.default.toDateString(e,a(n.format||"YYYY-MM-DD"))}).join(" ~ ")}function V(e,t){var e=e.props,e=void 0===e?{}:e,n=e.treeData,e=e.treeCheckable,r=t.row,t=t.column,r=c.default.get(r,t.field);return s(r)?r:c.default.map(e?r:[r],function(t){var e=c.default.findTree(n,function(e){return e.value===t},{children:"children"});return e?e.item.title:t}).join(", ")}function N(e,t,n){var e=e.props,e=void 0===e?{}:e,r=t.row,t=t.column,r=c.default.get(r,t.field);try{r=r&&(r.format?r.format(e.format||n):c.default.toDateString(r,a(e.format||n)))}catch(e){}return r}function M(i){return function(e,t){var n=t.row,r=t.column,o=e.name,u=e.attrs,n=c.default.get(n,r.field);return[(0,f.h)((0,f.resolveComponent)(o),p(p(p({},u),d(e,0,n,i)),b(e,t)))]}}function D(e,t){var n=e.attrs;return[(0,f.h)((0,f.resolveComponent)("a-button"),p(p(p({},n),d(e,0,null)),g(e,t)),O(e.content))]}function T(e,t){e=e.children;return e?e.map(function(e){return D(e,t)[0]}):[]}function E(a){return function(r,o){var e=o.column,u=r.name,i=r.attrs;return[(0,f.h)("div",{class:"vxe-table--filter-antd-wrapper"},e.filters.map(function(e,t){var n=e.data;return(0,f.h)((0,f.resolveComponent)(u),p(p(p({key:t},i),d(r,0,n,a)),y(r,o,e,function(){I(o,!!e.data,e)})))}))]}}function I(e,t,n){e.$panel.changeOption(null,t,n)}function G(e){var t=e.option,n=e.row,e=e.column,t=t.data,n=c.default.get(n,e.field);return-1<c.default.toValueString(n).indexOf(t)}function P(e){var t=e.option,n=e.row,e=e.column,t=t.data;return c.default.get(n,e.field)===t}function O(e){return[l(e)]}function j(i){return function(e,t){var n=t.data,r=t.field,o=e.name,u=e.attrs,n=c.default.get(n,r);return[(0,f.h)((0,f.resolveComponent)(o),p(p(p({},u),v(e,0,n,i)),C(e,t)))]}}function U(e,t){var n=e.attrs,r=v(e,0,null);return[(0,f.h)((0,f.resolveComponent)("a-button"),p(p(p({},n),r),C(e,t)),{default:function(){return O(e.content||r.content)}})]}function q(e,t){e=e.children;return e?e.map(function(e){return U(e,t)[0]}):[]}function S(o){return function(e){var t=e.row,n=e.column,r=e.options;return r&&r.original?c.default.get(t,n.field):N(n.editRender||n.cellRender,e,o)}}function k(o){return function(e){var t=e.row,n=e.column,r=e.options;return r&&r.original?c.default.get(t,n.field):o(n.editRender||n.cellRender,e)}}function W(){return function(e,t){var n=e.name,r=e.options,o=void 0===r?[]:r,r=e.optionProps,r=void 0===r?{}:r,u=t.data,i=t.field,a=e.attrs,l=r.label||"label",d=r.value||"value",r=c.default.get(u,i);return[(0,f.h)((0,f.resolveComponent)("".concat(n,"Group")),p(p(p({},a),v(e,0,r)),C(e,t)),{default:function(){return o.map(function(e,t){return(0,f.h)((0,f.resolveComponent)(n),{key:t,value:e[d],disabled:e.disabled},{default:function(){return O(e[l])}})})}})]}}function F(e,t,n){for(var r,o=e.target;o&&o.nodeType&&o!==document;){if(n&&o.className&&o.className.split&&-1<o.className.split(" ").indexOf(n))r=o;else if(o===t)return{flag:!n||!!r,container:t,targetElem:r};o=o.parentNode}return{flag:!1}}function R(e){var e=e.$event,t=document.body;if(F(e,t,"ant-select-dropdown").flag||F(e,t,"ant-cascader-menus").flag||F(e,t,"ant-picker-dropdown").flag||F(e,t,"ant-calendar-picker-container").flag||F(e,t,"ant-time-picker-panel").flag)return!1}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.VxeUIPluginRenderAntd=void 0,c=(t=c)&&t.__esModule?t:{default:t};var t=e.VxeUIPluginRenderAntd={install:function(e,t){n=e,t&&t.Antd,/^(4)\./.test(n.uiVersion)||console.error("[plugin-render-antd 4.x] Version 4.x is required"),n.renderer.mixin({AAutoComplete:{autofocus:"input.ant-input",renderDefault:M(),renderEdit:M(),renderFilter:E(),defaultFilterMethod:P,renderItemContent:j()},AInput:{autofocus:"input.ant-input",renderDefault:M(),renderEdit:M(),renderFilter:E(),defaultFilterMethod:G,renderItemContent:j()},AInputNumber:{autofocus:"input.ant-input-number-input",renderDefault:M(),renderEdit:M(),renderFilter:E(),defaultFilterMethod:G,renderItemContent:j()},ASelect:{renderEdit:function(e,t){var n=e.options,r=e.optionGroups,o=t.row,u=t.column,i=e.attrs,o=d(e,0,c.default.get(o,u.field)),u=b(e,t);return r?[(0,f.h)((0,f.resolveComponent)("a-select"),p(p(p({},o),i),{},{options:r},u))]:[(0,f.h)((0,f.resolveComponent)("a-select"),p(p(p({},o),i),{},{options:o.options||n},u))]},renderCell:function(e,t){return h(e,0,Y(e,t))},renderFilter:function(o,u){var e=o.options,i=void 0===e?[]:e,e=o.optionGroups,t=o.optionGroupProps,a=(void 0===t?{}:t).options||"options",t=u.column,l=o.attrs;return[(0,f.h)("div",{class:"vxe-table--filter-antd-wrapper"},e?t.filters.map(function(e,t){var n=e.data,r=d(o,0,n);return(0,f.h)((0,f.resolveComponent)("a-select"),p(p(p({key:t},l),r),{},{options:a},y(o,u,e,function(){I(u,"multiple"===r.mode?e.data&&0<e.data.length:!c.default.eqNull(e.data),e)})))}):t.filters.map(function(e,t){var n=e.data,r=d(o,0,n);return(0,f.h)((0,f.resolveComponent)("a-select"),p(p(p({key:t},l),r),{},{options:r.options||i},y(o,u,e,function(){I(u,"multiple"===r.mode?e.data&&0<e.data.length:!c.default.eqNull(e.data),e)})))}))]},defaultFilterMethod:function(e){var t=e.option,n=e.row,e=e.column,t=t.data,r=e.field,e=e.filterRender.props,e=void 0===e?{}:e,n=c.default.get(n,r);return"multiple"===e.mode?c.default.isArray(n)?c.default.includeArrays(n,t):-1<t.indexOf(n):n==t},renderItemContent:function(e,t){var n=e.options,n=void 0===n?[]:n,r=e.optionGroups,o=t.data,u=t.field,i=e.attrs,o=v(e,0,c.default.get(o,u)),u=C(e,t);return r?[(0,f.h)((0,f.resolveComponent)("a-select"),p(p(p({},i),o),{},{options:r},u))]:[(0,f.h)((0,f.resolveComponent)("a-select"),p(p(p({},i),o),{},{options:o.options||n},u))]},exportMethod:k(Y)},ACascader:{renderEdit:M(),renderCell:function(e,t){return h(e,0,x(e,t))},renderItemContent:j(),exportMethod:k(x)},ADatePicker:{renderEdit:M(),renderCell:w("YYYY-MM-DD"),renderItemContent:j(),exportMethod:S("YYYY-MM-DD")},AMonthPicker:{renderEdit:M(),renderCell:w("YYYY-MM"),renderItemContent:j(),exportMethod:S("YYYY-MM")},ARangePicker:{renderEdit:M(),renderCell:function(e,t){return h(e,0,A(e,t))},renderItemContent:j(),exportMethod:k(A)},AWeekPicker:{renderEdit:M(),renderCell:w("YYYY-WW周"),renderItemContent:j(),exportMethod:S("YYYY-WW周")},ATimePicker:{renderEdit:M(),renderCell:w("HH:mm:ss"),renderItemContent:j(),exportMethod:S("HH:mm:ss")},ATreeSelect:{renderEdit:M(),renderCell:function(e,t){return h(e,0,V(e,t))},renderItemContent:j(),exportMethod:k(V)},ARate:{renderDefault:M(),renderEdit:M(),renderFilter:E(),defaultFilterMethod:P,renderItemContent:j()},ASwitch:{renderDefault:M(),renderEdit:M(),renderFilter:function(r,o){var e=o.column,u=r.name,i=r.attrs;return[(0,f.h)("div",{class:"vxe-table--filter-antd-wrapper"},e.filters.map(function(e,t){var n=e.data;return(0,f.h)(u,p(p(p({key:t},i),d(r,0,n)),y(r,o,e,function(){I(o,c.default.isBoolean(e.data),e)})))}))]},defaultFilterMethod:P,renderItemContent:j()},ARadio:{renderItemContent:W()},ACheckbox:{renderItemContent:W()},AButton:{renderEdit:D,renderDefault:D,renderItemContent:U},AButtons:{renderEdit:T,renderDefault:T,renderItemContent:q}}),n.interceptor.add("event.clearFilter",R),n.interceptor.add("event.clearEdit",R),n.interceptor.add("event.clearAreas",R),n.interceptor.add("event.clearActived",R)}};"undefined"!=typeof window&&window.VxeUI&&window.VxeUI.use&&window.VxeUI.use(t),e.default=t});
|
package/dist/style.css
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
.vxe-table.cell--highlight .vxe-cell > .ant-time-picker .ant-time-picker-input,
|
|
2
|
+
.vxe-table.cell--highlight .vxe-tree-cell > .ant-time-picker .ant-time-picker-input, .vxe-table.cell--highlight .vxe-cell > .ant-calendar-picker .ant-calendar-picker-input,
|
|
3
|
+
.vxe-table.cell--highlight .vxe-tree-cell > .ant-calendar-picker .ant-calendar-picker-input, .vxe-table.cell--highlight .vxe-cell > .ant-cascader-picker .ant-input,
|
|
4
|
+
.vxe-table.cell--highlight .vxe-tree-cell > .ant-cascader-picker .ant-input, .vxe-table.cell--highlight .vxe-cell > .ant-select .ant-select-selection,
|
|
5
|
+
.vxe-table.cell--highlight .vxe-tree-cell > .ant-select .ant-select-selection, .vxe-table.cell--highlight .vxe-cell > .ant-input-number .ant-input-number-handler-wrap,
|
|
6
|
+
.vxe-table.cell--highlight .vxe-cell > .ant-input-number .ant-input-number-handler-down,
|
|
7
|
+
.vxe-table.cell--highlight .vxe-tree-cell > .ant-input-number .ant-input-number-handler-wrap,
|
|
8
|
+
.vxe-table.cell--highlight .vxe-tree-cell > .ant-input-number .ant-input-number-handler-down, .vxe-table.cell--highlight .vxe-cell > .ant-select .ant-input,
|
|
9
|
+
.vxe-table.cell--highlight .vxe-tree-cell > .ant-select .ant-input, .vxe-table.cell--highlight .vxe-cell > .ant-input, .vxe-table.cell--highlight .vxe-cell > .ant-input-number,
|
|
10
|
+
.vxe-table.cell--highlight .vxe-tree-cell > .ant-input,
|
|
11
|
+
.vxe-table.cell--highlight .vxe-tree-cell > .ant-input-number {
|
|
12
|
+
border: 0;
|
|
13
|
+
box-shadow: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.vxe-cell > .ant-input,
|
|
17
|
+
.vxe-tree-cell > .ant-input, .vxe-form .vxe-form--item-content > .ant-input, .vxe-cell > .ant-input-number,
|
|
18
|
+
.vxe-tree-cell > .ant-input-number, .vxe-form .vxe-form--item-content > .ant-input-number, .vxe-cell > .ant-select,
|
|
19
|
+
.vxe-tree-cell > .ant-select, .vxe-form .vxe-form--item-content > .ant-select, .vxe-cell > .ant-cascader-picker,
|
|
20
|
+
.vxe-tree-cell > .ant-cascader-picker, .vxe-form .vxe-form--item-content > .ant-cascader-picker, .vxe-cell > .ant-calendar-picker,
|
|
21
|
+
.vxe-tree-cell > .ant-calendar-picker, .vxe-form .vxe-form--item-content > .ant-calendar-picker, .vxe-cell > .ant-time-picker,
|
|
22
|
+
.vxe-tree-cell > .ant-time-picker, .vxe-form .vxe-form--item-content > .ant-time-picker {
|
|
23
|
+
width: 100%;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.vxe-table--filter-antd-wrapper {
|
|
27
|
+
padding: 0.8em 1em;
|
|
28
|
+
}
|
|
29
|
+
.vxe-table--filter-antd-wrapper > .ant-input, .vxe-table--filter-antd-wrapper > .ant-input-number, .vxe-table--filter-antd-wrapper > .ant-select, .vxe-table--filter-antd-wrapper > .ant-rate {
|
|
30
|
+
width: 180px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.vxe-cell > .ant-rate,
|
|
34
|
+
.vxe-tree-cell > .ant-rate {
|
|
35
|
+
vertical-align: bottom;
|
|
36
|
+
}
|
|
37
|
+
.vxe-cell > .ant-rate .anticon-star,
|
|
38
|
+
.vxe-tree-cell > .ant-rate .anticon-star {
|
|
39
|
+
display: block;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.col--valid-error > .vxe-cell > .ant-input, .col--valid-error > .vxe-cell > .ant-select .ant-input, .col--valid-error > .vxe-cell > .ant-select .ant-select-selection, .col--valid-error > .vxe-cell > .ant-input-number, .col--valid-error > .vxe-cell > .ant-cascader-picker .ant-cascader-input, .col--valid-error > .vxe-cell > .ant-calendar-picker .ant-calendar-picker-input, .col--valid-error > .vxe-tree-cell > .ant-input, .col--valid-error > .vxe-tree-cell > .ant-select .ant-input, .col--valid-error > .vxe-tree-cell > .ant-select .ant-select-selection, .col--valid-error > .vxe-tree-cell > .ant-input-number, .col--valid-error > .vxe-tree-cell > .ant-cascader-picker .ant-cascader-input, .col--valid-error > .vxe-tree-cell > .ant-calendar-picker .ant-calendar-picker-input {
|
|
43
|
+
border-color: #f56c6c;
|
|
44
|
+
box-shadow: none;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.vxe-table.cell--highlight .vxe-cell > .ant-input, .vxe-table.cell--highlight .vxe-cell > .ant-input-number,
|
|
48
|
+
.vxe-table.cell--highlight .vxe-tree-cell > .ant-input,
|
|
49
|
+
.vxe-table.cell--highlight .vxe-tree-cell > .ant-input-number {
|
|
50
|
+
padding: 0;
|
|
51
|
+
}
|
|
52
|
+
.vxe-table.cell--highlight .vxe-cell > .ant-select .ant-input,
|
|
53
|
+
.vxe-table.cell--highlight .vxe-tree-cell > .ant-select .ant-input {
|
|
54
|
+
padding: 0;
|
|
55
|
+
}
|
|
56
|
+
.vxe-table.cell--highlight .vxe-cell > .ant-input-number .ant-input-number-input,
|
|
57
|
+
.vxe-table.cell--highlight .vxe-tree-cell > .ant-input-number .ant-input-number-input {
|
|
58
|
+
padding: 0;
|
|
59
|
+
}
|
|
60
|
+
.vxe-table.cell--highlight .vxe-cell > .ant-select .ant-select-selection .ant-select-selection__rendered,
|
|
61
|
+
.vxe-table.cell--highlight .vxe-tree-cell > .ant-select .ant-select-selection .ant-select-selection__rendered {
|
|
62
|
+
margin: 0;
|
|
63
|
+
}
|
|
64
|
+
.vxe-table.cell--highlight .vxe-cell > .ant-cascader-picker .ant-cascader-picker-label,
|
|
65
|
+
.vxe-table.cell--highlight .vxe-tree-cell > .ant-cascader-picker .ant-cascader-picker-label {
|
|
66
|
+
padding: 0;
|
|
67
|
+
}
|
|
68
|
+
.vxe-table.cell--highlight .vxe-cell > .ant-calendar-picker .ant-calendar-picker-input,
|
|
69
|
+
.vxe-table.cell--highlight .vxe-tree-cell > .ant-calendar-picker .ant-calendar-picker-input {
|
|
70
|
+
padding: 0;
|
|
71
|
+
}
|
|
72
|
+
.vxe-table.cell--highlight .vxe-cell > .ant-time-picker .ant-time-picker-input,
|
|
73
|
+
.vxe-table.cell--highlight .vxe-tree-cell > .ant-time-picker .ant-time-picker-input {
|
|
74
|
+
padding: 0;
|
|
75
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.vxe-table.cell--highlight .vxe-cell>.ant-calendar-picker .ant-calendar-picker-input,.vxe-table.cell--highlight .vxe-cell>.ant-cascader-picker .ant-input,.vxe-table.cell--highlight .vxe-cell>.ant-input,.vxe-table.cell--highlight .vxe-cell>.ant-input-number,.vxe-table.cell--highlight .vxe-cell>.ant-input-number .ant-input-number-handler-down,.vxe-table.cell--highlight .vxe-cell>.ant-input-number .ant-input-number-handler-wrap,.vxe-table.cell--highlight .vxe-cell>.ant-select .ant-input,.vxe-table.cell--highlight .vxe-cell>.ant-select .ant-select-selection,.vxe-table.cell--highlight .vxe-cell>.ant-time-picker .ant-time-picker-input,.vxe-table.cell--highlight .vxe-tree-cell>.ant-calendar-picker .ant-calendar-picker-input,.vxe-table.cell--highlight .vxe-tree-cell>.ant-cascader-picker .ant-input,.vxe-table.cell--highlight .vxe-tree-cell>.ant-input,.vxe-table.cell--highlight .vxe-tree-cell>.ant-input-number,.vxe-table.cell--highlight .vxe-tree-cell>.ant-input-number .ant-input-number-handler-down,.vxe-table.cell--highlight .vxe-tree-cell>.ant-input-number .ant-input-number-handler-wrap,.vxe-table.cell--highlight .vxe-tree-cell>.ant-select .ant-input,.vxe-table.cell--highlight .vxe-tree-cell>.ant-select .ant-select-selection,.vxe-table.cell--highlight .vxe-tree-cell>.ant-time-picker .ant-time-picker-input{border:0;box-shadow:none}.vxe-cell>.ant-calendar-picker,.vxe-cell>.ant-cascader-picker,.vxe-cell>.ant-input,.vxe-cell>.ant-input-number,.vxe-cell>.ant-select,.vxe-cell>.ant-time-picker,.vxe-form .vxe-form--item-content>.ant-calendar-picker,.vxe-form .vxe-form--item-content>.ant-cascader-picker,.vxe-form .vxe-form--item-content>.ant-input,.vxe-form .vxe-form--item-content>.ant-input-number,.vxe-form .vxe-form--item-content>.ant-select,.vxe-form .vxe-form--item-content>.ant-time-picker,.vxe-tree-cell>.ant-calendar-picker,.vxe-tree-cell>.ant-cascader-picker,.vxe-tree-cell>.ant-input,.vxe-tree-cell>.ant-input-number,.vxe-tree-cell>.ant-select,.vxe-tree-cell>.ant-time-picker{width:100%}.vxe-table--filter-antd-wrapper{padding:.8em 1em}.vxe-table--filter-antd-wrapper>.ant-input,.vxe-table--filter-antd-wrapper>.ant-input-number,.vxe-table--filter-antd-wrapper>.ant-rate,.vxe-table--filter-antd-wrapper>.ant-select{width:180px}.vxe-cell>.ant-rate,.vxe-tree-cell>.ant-rate{vertical-align:bottom}.vxe-cell>.ant-rate .anticon-star,.vxe-tree-cell>.ant-rate .anticon-star{display:block}.col--valid-error>.vxe-cell>.ant-calendar-picker .ant-calendar-picker-input,.col--valid-error>.vxe-cell>.ant-cascader-picker .ant-cascader-input,.col--valid-error>.vxe-cell>.ant-input,.col--valid-error>.vxe-cell>.ant-input-number,.col--valid-error>.vxe-cell>.ant-select .ant-input,.col--valid-error>.vxe-cell>.ant-select .ant-select-selection,.col--valid-error>.vxe-tree-cell>.ant-calendar-picker .ant-calendar-picker-input,.col--valid-error>.vxe-tree-cell>.ant-cascader-picker .ant-cascader-input,.col--valid-error>.vxe-tree-cell>.ant-input,.col--valid-error>.vxe-tree-cell>.ant-input-number,.col--valid-error>.vxe-tree-cell>.ant-select .ant-input,.col--valid-error>.vxe-tree-cell>.ant-select .ant-select-selection{border-color:#f56c6c;box-shadow:none}.vxe-table.cell--highlight .vxe-cell>.ant-input,.vxe-table.cell--highlight .vxe-cell>.ant-input-number,.vxe-table.cell--highlight .vxe-tree-cell>.ant-input,.vxe-table.cell--highlight .vxe-tree-cell>.ant-input-number{padding:0}.vxe-table.cell--highlight .vxe-cell>.ant-select .ant-input,.vxe-table.cell--highlight .vxe-tree-cell>.ant-select .ant-input{padding:0}.vxe-table.cell--highlight .vxe-cell>.ant-input-number .ant-input-number-input,.vxe-table.cell--highlight .vxe-tree-cell>.ant-input-number .ant-input-number-input{padding:0}.vxe-table.cell--highlight .vxe-cell>.ant-select .ant-select-selection .ant-select-selection__rendered,.vxe-table.cell--highlight .vxe-tree-cell>.ant-select .ant-select-selection .ant-select-selection__rendered{margin:0}.vxe-table.cell--highlight .vxe-cell>.ant-cascader-picker .ant-cascader-picker-label,.vxe-table.cell--highlight .vxe-tree-cell>.ant-cascader-picker .ant-cascader-picker-label{padding:0}.vxe-table.cell--highlight .vxe-cell>.ant-calendar-picker .ant-calendar-picker-input,.vxe-table.cell--highlight .vxe-tree-cell>.ant-calendar-picker .ant-calendar-picker-input{padding:0}.vxe-table.cell--highlight .vxe-cell>.ant-time-picker .ant-time-picker-input,.vxe-table.cell--highlight .vxe-tree-cell>.ant-time-picker .ant-time-picker-input{padding:0}
|
package/index.ts
CHANGED
|
@@ -220,9 +220,11 @@ function getDatePickerCellValue (renderOpts: VxeGlobalRendererHandles.RenderOpti
|
|
|
220
220
|
const { props = {} } = renderOpts
|
|
221
221
|
const { row, column } = params
|
|
222
222
|
let cellValue = XEUtils.get(row, column.field)
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
223
|
+
try {
|
|
224
|
+
if (cellValue) {
|
|
225
|
+
cellValue = cellValue.format ? cellValue.format(props.format || defaultFormat) : XEUtils.toDateString(cellValue, dateFormatToVxeFormat(props.format || defaultFormat))
|
|
226
|
+
}
|
|
227
|
+
} catch (e) {}
|
|
226
228
|
return cellValue
|
|
227
229
|
}
|
|
228
230
|
|
|
@@ -315,20 +317,6 @@ function cellText (cellValue: any): string[] {
|
|
|
315
317
|
return [formatText(cellValue)]
|
|
316
318
|
}
|
|
317
319
|
|
|
318
|
-
function renderOptions (options: any[], optionProps: VxeGlobalRendererHandles.RenderOptionProps) {
|
|
319
|
-
const labelProp = optionProps.label || 'label'
|
|
320
|
-
const valueProp = optionProps.value || 'value'
|
|
321
|
-
return XEUtils.map(options, (item, oIndex) => {
|
|
322
|
-
return h(resolveComponent('a-select-option') as ComponentOptions, {
|
|
323
|
-
key: oIndex,
|
|
324
|
-
value: item[valueProp],
|
|
325
|
-
disabled: item.disabled
|
|
326
|
-
}, {
|
|
327
|
-
default: () => cellText(item[labelProp])
|
|
328
|
-
})
|
|
329
|
-
})
|
|
330
|
-
}
|
|
331
|
-
|
|
332
320
|
function createFormItemRender (defaultProps?: { [key: string]: any }) {
|
|
333
321
|
return function (renderOpts: VxeGlobalRendererHandles.RenderItemContentOptions & { name: string }, params: FormItemContentRenderParams) {
|
|
334
322
|
const { data, field } = params
|
|
@@ -488,33 +476,19 @@ export const VxeUIPluginRenderAntd = {
|
|
|
488
476
|
},
|
|
489
477
|
ASelect: {
|
|
490
478
|
renderEdit (renderOpts, params) {
|
|
491
|
-
const { options
|
|
479
|
+
const { options, optionGroups } = renderOpts
|
|
492
480
|
const { row, column } = params
|
|
493
481
|
const { attrs } = renderOpts
|
|
494
482
|
const cellValue = XEUtils.get(row, column.field)
|
|
495
483
|
const props = getCellEditFilterProps(renderOpts, params, cellValue)
|
|
496
484
|
const ons = getEditOns(renderOpts, params)
|
|
497
485
|
if (optionGroups) {
|
|
498
|
-
const groupOptions = optionGroupProps.options || 'options'
|
|
499
|
-
const groupLabel = optionGroupProps.label || 'label'
|
|
500
486
|
return [
|
|
501
487
|
h(resolveComponent('a-select') as ComponentOptions, {
|
|
502
488
|
...props,
|
|
503
489
|
...attrs,
|
|
490
|
+
options: optionGroups,
|
|
504
491
|
...ons
|
|
505
|
-
}, {
|
|
506
|
-
default: () => {
|
|
507
|
-
return XEUtils.map(optionGroups, (group, gIndex) => {
|
|
508
|
-
return h(resolveComponent('a-select-opt-group') as ComponentOptions, {
|
|
509
|
-
key: gIndex
|
|
510
|
-
}, {
|
|
511
|
-
label: () => {
|
|
512
|
-
return h('span', {}, group[groupLabel])
|
|
513
|
-
},
|
|
514
|
-
default: () => renderOptions(group[groupOptions], optionProps)
|
|
515
|
-
})
|
|
516
|
-
})
|
|
517
|
-
}
|
|
518
492
|
})
|
|
519
493
|
]
|
|
520
494
|
}
|
|
@@ -522,9 +496,8 @@ export const VxeUIPluginRenderAntd = {
|
|
|
522
496
|
h(resolveComponent('a-select') as ComponentOptions, {
|
|
523
497
|
...props,
|
|
524
498
|
...attrs,
|
|
499
|
+
options: props.options || options,
|
|
525
500
|
...ons
|
|
526
|
-
}, {
|
|
527
|
-
default: () => renderOptions(options, optionProps)
|
|
528
501
|
})
|
|
529
502
|
]
|
|
530
503
|
},
|
|
@@ -532,9 +505,8 @@ export const VxeUIPluginRenderAntd = {
|
|
|
532
505
|
return getCellLabelVNs(renderOpts, params, getSelectCellValue(renderOpts, params))
|
|
533
506
|
},
|
|
534
507
|
renderFilter (renderOpts, params) {
|
|
535
|
-
const { options = [], optionGroups,
|
|
508
|
+
const { options = [], optionGroups, optionGroupProps = {} } = renderOpts
|
|
536
509
|
const groupOptions = optionGroupProps.options || 'options'
|
|
537
|
-
const groupLabel = optionGroupProps.label || 'label'
|
|
538
510
|
const { column } = params
|
|
539
511
|
const { attrs } = renderOpts
|
|
540
512
|
return [
|
|
@@ -548,23 +520,11 @@ export const VxeUIPluginRenderAntd = {
|
|
|
548
520
|
key: oIndex,
|
|
549
521
|
...attrs,
|
|
550
522
|
...props,
|
|
523
|
+
options: groupOptions,
|
|
551
524
|
...getFilterOns(renderOpts, params, option, () => {
|
|
552
525
|
// 处理 change 事件相关逻辑
|
|
553
526
|
handleConfirmFilter(params, props.mode === 'multiple' ? (option.data && option.data.length > 0) : !XEUtils.eqNull(option.data), option)
|
|
554
527
|
})
|
|
555
|
-
}, {
|
|
556
|
-
default: () => {
|
|
557
|
-
return XEUtils.map(optionGroups, (group, gIndex) => {
|
|
558
|
-
return h(resolveComponent('a-select-opt-group') as ComponentOptions, {
|
|
559
|
-
key: gIndex
|
|
560
|
-
}, {
|
|
561
|
-
label: () => {
|
|
562
|
-
return h('span', {}, group[groupLabel])
|
|
563
|
-
},
|
|
564
|
-
default: () => renderOptions(group[groupOptions], optionProps)
|
|
565
|
-
})
|
|
566
|
-
})
|
|
567
|
-
}
|
|
568
528
|
})
|
|
569
529
|
})
|
|
570
530
|
: column.filters.map((option, oIndex) => {
|
|
@@ -574,12 +534,11 @@ export const VxeUIPluginRenderAntd = {
|
|
|
574
534
|
key: oIndex,
|
|
575
535
|
...attrs,
|
|
576
536
|
...props,
|
|
537
|
+
options: props.options || options,
|
|
577
538
|
...getFilterOns(renderOpts, params, option, () => {
|
|
578
539
|
// 处理 change 事件相关逻辑
|
|
579
540
|
handleConfirmFilter(params, props.mode === 'multiple' ? (option.data && option.data.length > 0) : !XEUtils.eqNull(option.data), option)
|
|
580
541
|
})
|
|
581
|
-
}, {
|
|
582
|
-
default: () => renderOptions(options, optionProps)
|
|
583
542
|
})
|
|
584
543
|
}))
|
|
585
544
|
]
|
|
@@ -600,33 +559,19 @@ export const VxeUIPluginRenderAntd = {
|
|
|
600
559
|
return cellValue == data
|
|
601
560
|
},
|
|
602
561
|
renderItemContent (renderOpts, params) {
|
|
603
|
-
const { options = [], optionGroups
|
|
562
|
+
const { options = [], optionGroups } = renderOpts
|
|
604
563
|
const { data, field } = params
|
|
605
564
|
const { attrs } = renderOpts
|
|
606
565
|
const itemValue = XEUtils.get(data, field)
|
|
607
566
|
const props = getItemProps(renderOpts, params, itemValue)
|
|
608
567
|
const ons = getItemOns(renderOpts, params)
|
|
609
568
|
if (optionGroups) {
|
|
610
|
-
const groupOptions = optionGroupProps.options || 'options'
|
|
611
|
-
const groupLabel = optionGroupProps.label || 'label'
|
|
612
569
|
return [
|
|
613
570
|
h(resolveComponent('a-select') as ComponentOptions, {
|
|
614
571
|
...attrs,
|
|
615
572
|
...props,
|
|
573
|
+
options: optionGroups,
|
|
616
574
|
...ons
|
|
617
|
-
}, {
|
|
618
|
-
default: () => {
|
|
619
|
-
return XEUtils.map(optionGroups, (group, gIndex) => {
|
|
620
|
-
return h(resolveComponent('a-select-opt-group') as ComponentOptions, {
|
|
621
|
-
key: gIndex
|
|
622
|
-
}, {
|
|
623
|
-
label: () => {
|
|
624
|
-
return h('span', {}, group[groupLabel])
|
|
625
|
-
},
|
|
626
|
-
default: () => renderOptions(group[groupOptions], optionProps)
|
|
627
|
-
})
|
|
628
|
-
})
|
|
629
|
-
}
|
|
630
575
|
})
|
|
631
576
|
]
|
|
632
577
|
}
|
|
@@ -634,9 +579,8 @@ export const VxeUIPluginRenderAntd = {
|
|
|
634
579
|
h(resolveComponent('a-select') as ComponentOptions, {
|
|
635
580
|
...attrs,
|
|
636
581
|
...props,
|
|
582
|
+
options: props.options || options,
|
|
637
583
|
...ons
|
|
638
|
-
}, {
|
|
639
|
-
default: () => renderOptions(options, optionProps)
|
|
640
584
|
})
|
|
641
585
|
]
|
|
642
586
|
},
|