bkui-vue 0.0.1-beta.25 → 0.0.1-beta.28
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/bkui-vue.cjs.js +1368 -296
- package/dist/bkui-vue.esm.js +1369 -298
- package/dist/bkui-vue.umd.js +1368 -296
- package/dist/style.css +585 -72
- package/lib/components.d.ts +1 -0
- package/lib/pagination/index.d.ts +3 -3
- package/lib/pagination/index.js +1 -1
- package/lib/pagination/pagination.d.ts +1 -1
- package/lib/pagination/type.d.ts +1 -1
- package/lib/popover/index.js +1 -1
- package/lib/resize-layout/index.d.ts +336 -0
- package/lib/resize-layout/index.js +1 -0
- package/lib/resize-layout/resize-layout.css +189 -0
- package/lib/resize-layout/resize-layout.d.ts +127 -0
- package/lib/resize-layout/resize-layout.less +233 -0
- package/lib/resize-layout/resize-layout.variable.css +282 -0
- package/lib/select/common.d.ts +23 -27
- package/lib/select/index.d.ts +530 -145
- package/lib/select/index.js +12 -12
- package/lib/select/optionGroup.d.ts +0 -76
- package/lib/select/select.css +156 -46
- package/lib/select/select.d.ts +150 -39
- package/lib/select/select.less +136 -75
- package/lib/select/select.variable.css +156 -46
- package/lib/select/type.d.ts +31 -0
- package/lib/styles/index.d.ts +2 -0
- package/lib/styles/index.js +1 -1
- package/lib/swiper/index.js +1 -1
- package/lib/swiper/swiper.css +14 -14
- package/lib/swiper/swiper.less +93 -77
- package/lib/swiper/swiper.variable.css +14 -14
- package/lib/table/table.css +1 -1
- package/lib/table/table.less +1 -1
- package/lib/table/table.variable.css +1 -1
- package/lib/tag/index.js +1 -1
- package/lib/tag/tag.css +11 -5
- package/lib/tag/tag.less +12 -5
- package/lib/tag/tag.variable.css +11 -5
- package/lib/tag-input/common.d.ts +24 -0
- package/lib/tag-input/index.d.ts +2 -0
- package/lib/tag-input/index.js +1 -0
- package/lib/tag-input/list-tag-render.d.ts +47 -0
- package/lib/tag-input/tag-input.css +208 -0
- package/lib/tag-input/tag-input.d.ts +374 -0
- package/lib/tag-input/tag-input.less +250 -0
- package/lib/tag-input/tag-input.variable.css +301 -0
- package/lib/tag-input/tag-props.d.ts +131 -0
- package/lib/tag-input/tag-render.d.ts +38 -0
- package/lib/tree/index.js +1 -1
- package/lib/tree/tree.css +6 -6
- package/lib/tree/tree.less +7 -6
- package/lib/tree/tree.variable.css +6 -6
- package/package.json +3 -3
package/lib/components.d.ts
CHANGED
@@ -25,6 +25,7 @@ export { default as Steps } from './steps';
|
|
25
25
|
export { default as Switcher } from './switcher';
|
26
26
|
export { default as Table } from './table';
|
27
27
|
export { default as Tag } from './tag';
|
28
|
+
export { default as TagInput } from './tag-input';
|
28
29
|
export { default as Divider } from './divider';
|
29
30
|
export { default as Tab, BKTabPanel as TabPanel } from './tab';
|
30
31
|
export { default as Message } from './message';
|
@@ -162,7 +162,7 @@ declare const BkPagination: {
|
|
162
162
|
"onUpdate:limit"?: (...args: any[]) => any;
|
163
163
|
"onLimit-change"?: (...args: any[]) => any;
|
164
164
|
}, {
|
165
|
-
|
165
|
+
totalPageNum: import("vue").Ref<number>;
|
166
166
|
renderTotal: ({ isFirst, isLast }: {
|
167
167
|
isFirst: any;
|
168
168
|
isLast: any;
|
@@ -277,7 +277,7 @@ declare const BkPagination: {
|
|
277
277
|
"onUpdate:limit"?: (...args: any[]) => any;
|
278
278
|
"onLimit-change"?: (...args: any[]) => any;
|
279
279
|
} & import("vue").ShallowUnwrapRef<{
|
280
|
-
|
280
|
+
totalPageNum: import("vue").Ref<number>;
|
281
281
|
renderTotal: ({ isFirst, isLast }: {
|
282
282
|
isFirst: any;
|
283
283
|
isLast: any;
|
@@ -361,7 +361,7 @@ declare const BkPagination: {
|
|
361
361
|
"onUpdate:limit"?: (...args: any[]) => any;
|
362
362
|
"onLimit-change"?: (...args: any[]) => any;
|
363
363
|
}, {
|
364
|
-
|
364
|
+
totalPageNum: import("vue").Ref<number>;
|
365
365
|
renderTotal: ({ isFirst, isLast }: {
|
366
366
|
isFirst: any;
|
367
367
|
isLast: any;
|
package/lib/pagination/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("../shared"),require("vue"),require("../select"),require("../icon"),require("../popover")):"function"==typeof define&&define.amd?define(["exports","../shared","vue","../select","../icon","../popover"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Shared,e.Vue,e.Select,e["@bkui-vue/icon/icons"],e.Popover)}(this,(function(e,t,n,a,r,i){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=o(a),l=o(i);function c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var s={exports:{}};!function(e){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports}(s);var p=c(s.exports),d={exports:{}},f={exports:{}};!function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports}(f);var v={exports:{}};!function(e){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,i=[],o=!0,u=!1;try{for(n=n.call(e);!(o=(a=n.next()).done)&&(i.push(a.value),!t||i.length!==t);o=!0);}catch(e){u=!0,r=e}finally{try{o||null==n.return||n.return()}finally{if(u)throw r}}return i}},e.exports.__esModule=!0,e.exports.default=e.exports}(v);var m={exports:{}},g={exports:{}};!function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a},e.exports.__esModule=!0,e.exports.default=e.exports}(g),function(e){var t=g.exports;e.exports=function(e,n){if(e){if("string"==typeof e)return t(e,n);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?t(e,n):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}(m);var b={exports:{}};!function(e){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports}(b),function(e){var t=f.exports,n=v.exports,a=m.exports,r=b.exports;e.exports=function(e,i){return t(e)||n(e,i)||a(e,i)||r()},e.exports.__esModule=!0,e.exports.default=e.exports}(d);var x=c(d.exports);var h=function(){var e=n.getCurrentInstance().proxy,t=n.ref(null),a=n.ref(!1),i=n.ref(1),o=n.computed((function(){return 1===i.value})),u=n.computed((function(){return i.value===e.pageNum})),c=0,s=n.computed((function(){for(var t=[],n=1;n<=e.pageNum;n++)t.push(n);return t}));n.watch((function(){return e.modelValue}),(function(t){n.nextTick((function(){t>=1&&t<=e.pageNum?i.value=t:i.value=t<1?1:e.pageNum,c=i.value}))}),{immediate:!0}),n.nextTick((function(){n.watch((function(){return e.pageNum}),(function(e){i.value>e&&(i.value=e)}))}));var p=function(){o.value||(i.value=i.value-1)},d=function(){u.value||(i.value=i.value+1)},f=function(){n.nextTick((function(){t.value.focus();var e=window.getSelection();e.selectAllChildren(t.value),e.collapseToEnd()}))},v=function(){a.value=!0},m=function(){a.value=!1,t.value.textContent="".concat(c),c!==i.value&&(i.value=c)},g=function(t){var n=t.target,a=Number(n.textContent);!a||a<1||a>e.pageNum||a===i.value||(c=a,f())},b=function(e){["Enter","NumpadEnter"].includes(e.code)&&(e.preventDefault(),m(),f())};return{current:i,render:function(){return n.createVNode("div",{class:"bk-pagination-small-list"},[n.createVNode("div",{class:{"bk-pagination-btn-pre":!0,"is-disabled":o.value},onClick:p},[n.createVNode(r.LeftShape,null,null)]),n.createVNode(l.default,{theme:"light",trigger:"click",arrow:!1,boundary:"body",placement:"bottom"},{default:function(){return n.createVNode("div",{class:{"bk-pagination-picker":!0,"is-focused":a.value}},[n.createVNode("span",{ref:t,class:"bk-pagination-editor",contenteditable:!0,spellcheck:"false",onFocus:v,onBlur:m,onInput:g,onKeydown:b},[i.value]),n.createVNode("span",null,[n.createTextVNode("/")]),n.createVNode("span",{class:"bk-pagination-small-list-total"},[e.pageNum])])},content:function(){return n.createVNode("div",{class:"bk-pagination-picker-list"},[s.value.map((function(e){return n.createVNode("div",{class:{item:!0,"is-actived":e===i.value},key:e,onClick:function(){return function(e){c=e,m()}(e)}},[e])}))])}}),n.createVNode("div",{class:{"bk-pagination-btn-next":!0,"is-disabled":u.value},onClick:d},[n.createVNode(r.RightShape,null,null)])])}}},N={modelValue:t.PropTypes.number.def(1),count:t.PropTypes.number.def(0).isRequired,limit:t.PropTypes.number.def(10),limitList:t.PropTypes.arrayOf(Number).def([10,20,50,100]),showLimit:t.PropTypes.bool.def(!0),type:t.PropTypes.oneOf(["default","compact"]).def("default"),location:t.PropTypes.oneOf(["left","right"]).def("right"),align:t.PropTypes.oneOf(["left","center","right"]).def("left"),size:t.PropTypes.size(),small:t.PropTypes.bool.def(!1),showTotalCount:t.PropTypes.bool.def(!0),prevText:t.PropTypes.string,nextText:t.PropTypes.string,disabled:t.PropTypes.bool.def(!1),layout:t.PropTypes.custom((function(e){var t={total:!0,list:!0,limit:!0};return e.some((function(e){return t[e]}))}),"layout 的值只支持 * total、list、limit *").def(["total","list","limit"])},y=n.defineComponent({name:"Pagination",props:N,emits:["update:modelValue","change","update:limit","limit-change"],setup:function(e,t){var i=n.ref(0),o=n.toRefs(e),l=o.count,c=o.limit,s=function(e){var t=e.isFirst,a=e.isLast,r=n.getCurrentInstance().props;return r.showTotalCount?n.createVNode("div",n.mergeProps({class:{"bk-pagination-total":!0,"is-first":t,"is-last":a}},{disabled:r.disabled}),[n.createTextVNode("共计"),n.createVNode("div",{class:"bk-pagination-total-num"},[r.count]),n.createTextVNode("条")]):null},p=function(){var e=n.getCurrentInstance().proxy,t=n.ref(e.modelValue),a=n.computed((function(){return 1===t.value})),i=n.computed((function(){return t.value===e.pageNum})),o=n.ref(!1),u=n.ref(!1),l=n.computed((function(){o.value=!1,u.value=!1;var n=[];if(e.pageNum<=5){for(var a=2;a<=e.pageNum-1;a++)n.push(a);return n}var r=Math.floor(2.5);e.pageNum>5&&(o.value=t.value-r>2,u.value=t.value+r<e.pageNum-1);for(var i=Math.min(e.pageNum-5,Math.max(2,t.value-r)),l=i;l<i+5;l++)n.push(l);return n}));n.watch((function(){return e.modelValue}),(function(a){n.nextTick((function(){a>=1&&a<=e.pageNum?t.value=a:t.value=a<1?1:e.pageNum}))})),n.nextTick((function(){n.watch((function(){return e.pageNum}),(function(e){t.value>e&&(t.value=e)}))}));var c=function(){a.value||(t.value=t.value-1)},s=function(){i.value||(t.value=t.value+1)},p=function(e){e!==t.value&&(t.value=e)},d=function(){t.value=Math.max(1,t.value-5)},f=function(){t.value=Math.min(e.pageNum,t.value+5)};return{current:t,render:function(v){var m=v.isFirst,g=v.isLast;return n.createVNode("div",{class:{"bk-pagination-list":!0,"is-first":m,"is-last":g}},[n.createVNode("div",{class:{"bk-pagination-list-pre":!0,"is-disabled":a.value},onClick:c},[e.prevText||n.createVNode(r.AngleLeft,null,null)]),n.createVNode("div",{class:{"bk-pagination-list-item":!0,"is-active":1===t.value},key:"1",onClick:function(){return p(1)}},[n.createTextVNode("1")]),o.value&&n.createVNode("div",{key:"pre-batch",class:"bk-pagination-list-pre-batch",onClick:d},[n.createVNode(r.Ellipsis,null,null)]),l.value.map((function(e){return n.createVNode("div",{class:{"bk-pagination-list-item":!0,"is-active":t.value===e},key:e,onClick:function(){return p(e)}},[e])})),u.value&&n.createVNode("div",{key:"next-batch",class:"bk-pagination-list-next-batch",onClick:f},[n.createVNode(r.Ellipsis,null,null)]),e.pageNum>1&&n.createVNode("div",{class:{"bk-pagination-list-item":!0,"is-active":t.value===e.pageNum},key:"last",onClick:function(){return p(e.pageNum)}},[e.pageNum]),n.createVNode("div",{class:{"bk-pagination-list-pre":!0,"is-disabled":i.value},onClick:s},[e.nextText||n.createVNode(r.AngleRight,null,null)])])}}}(),d=p.current,f=p.render,v=h(),m=v.current,g=v.render,b=function(){var e=n.getCurrentInstance().proxy,t=n.ref(e.limit);n.watch((function(){return e.limit}),(function(e){t.value=e})),n.watch((function(){return e.limitList}),(function(e){n.nextTick((function(){if(!e.includes(t.value)){var n=x(e,1);t.value=n[0]}}))}),{immediate:!0});var r=function(e){t.value=e};return{limit:t,render:function(i){var o,l,c=i.isFirst,s=i.isLast;return e.showLimit?n.createVNode("div",n.mergeProps({class:{"bk-pagination-limit":!0,"is-first":c,"is-last":s}},{disabled:e.disabled}),[n.createVNode("div",null,[n.createTextVNode("每页")]),n.createVNode(u.default,{class:"bk-pagination-limit-select",clearable:!1,modelValue:t.value,onChange:r,disabled:e.disabled},(l=o=e.limitList.map((function(e,t){return n.createVNode(a.BkOption,{value:e,label:e,key:"".concat(t,"_").concat(e)},null)})),"function"==typeof l||"[object Object]"===Object.prototype.toString.call(l)&&!n.isVNode(l)?o:{default:function(){return[o]}})),n.createVNode("div",null,[n.createTextVNode("条")])]):null}}}(),N=b.limit,y=b.render;return n.watch([l,N,c],(function(e){var t=x(e,2),n=t[0],a=t[1];i.value=Math.ceil(n/a)}),{immediate:!0}),n.watch(d,(function(e){t.emit("update:modelValue",e),t.emit("change",e)})),n.watch(m,(function(e){t.emit("update:modelValue",e),t.emit("change",e)})),n.watch(N,(function(e){t.emit("limit-change",e)})),{pageNum:i,renderTotal:s,renderList:f,renderLimit:y,renderSmallList:g}},render:function(){var e,a=this,r=t.classes((p(e={"bk-pagination":!0},"bk-pagination--".concat(this.size),!0),p(e,"is-align-".concat(this.align),!0),e)),i={total:this.renderTotal,list:this.renderList,limit:this.renderLimit};return n.createVNode("div",{class:r},[this.layout.map((function(e,t){return i[e]({isFirst:0===t,isLast:t===a.layout.length-1})})),this.renderSmallList()])}}),k=t.withInstall(y);e.BkPagination=k,e.default=k,Object.defineProperty(e,"__esModule",{value:!0})}));
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("../shared"),require("vue"),require("../select"),require("../icon"),require("../popover")):"function"==typeof define&&define.amd?define(["exports","../shared","vue","../select","../icon","../popover"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Shared,e.Vue,e.Select,e["@bkui-vue/icon/icons"],e.Popover)}(this,(function(e,t,n,a,r,o){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=i(a),u=i(o);function c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var s={exports:{}};!function(e){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports}(s);var d=c(s.exports),p={exports:{}},f={exports:{}};!function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports}(f);var v={exports:{}};!function(e){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(a=n.next()).done)&&(o.push(a.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw r}}return o}},e.exports.__esModule=!0,e.exports.default=e.exports}(v);var m={exports:{}},g={exports:{}};!function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a},e.exports.__esModule=!0,e.exports.default=e.exports}(g),function(e){var t=g.exports;e.exports=function(e,n){if(e){if("string"==typeof e)return t(e,n);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?t(e,n):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}(m);var b={exports:{}};!function(e){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports}(b),function(e){var t=f.exports,n=v.exports,a=m.exports,r=b.exports;e.exports=function(e,o){return t(e)||n(e,o)||a(e,o)||r()},e.exports.__esModule=!0,e.exports.default=e.exports}(p);var x=c(p.exports);var h=function(){var e=n.getCurrentInstance().proxy,t=n.ref(null),a=n.ref(!1),o=n.ref(1),i=n.computed((function(){return 1===o.value})),l=n.computed((function(){return o.value===e.totalPageNum})),c=0,s=n.computed((function(){for(var t=[],n=1;n<=e.totalPageNum;n++)t.push(n);return t}));n.watch((function(){return e.modelValue}),(function(t){n.nextTick((function(){t>=1&&t<=e.totalPageNum?o.value=t:o.value=t<1?1:e.totalPageNum,c=o.value}))}),{immediate:!0}),n.nextTick((function(){n.watch((function(){return e.totalPageNum}),(function(e){o.value>e&&(o.value=e)}))}));var d=function(){i.value||(o.value=o.value-1)},p=function(){l.value||(o.value=o.value+1)},f=function(){n.nextTick((function(){t.value.focus();var e=window.getSelection();e.selectAllChildren(t.value),e.collapseToEnd()}))},v=function(){a.value=!0},m=function(){a.value=!1,t.value.textContent="".concat(c),c!==o.value&&(o.value=c)},g=function(t){var n=t.target,a=Number(n.textContent);!a||a<1||a>e.totalPageNum||a===o.value||(c=a,f())},b=function(e){["Enter","NumpadEnter"].includes(e.code)&&(e.preventDefault(),m(),f())};return{current:o,render:function(){return n.createVNode("div",{class:"bk-pagination-small-list"},[n.createVNode("div",{class:{"bk-pagination-btn-pre":!0,"is-disabled":i.value},onClick:d},[n.createVNode(r.LeftShape,null,null)]),n.createVNode(u.default,{theme:"light",trigger:"click",arrow:!1,boundary:"body",placement:"bottom"},{default:function(){return n.createVNode("div",{class:{"bk-pagination-picker":!0,"is-focused":a.value}},[n.createVNode("span",{ref:t,class:"bk-pagination-editor",contenteditable:!0,spellcheck:"false",onFocus:v,onBlur:m,onInput:g,onKeydown:b},[o.value]),n.createVNode("span",null,[n.createTextVNode("/")]),n.createVNode("span",{class:"bk-pagination-small-list-total"},[e.totalPageNum])])},content:function(){return n.createVNode("div",{class:"bk-pagination-picker-list"},[s.value.map((function(e){return n.createVNode("div",{class:{item:!0,"is-actived":e===o.value},key:e,onClick:function(){return function(e){c=e,m()}(e)}},[e])}))])}}),n.createVNode("div",{class:{"bk-pagination-btn-next":!0,"is-disabled":l.value},onClick:p},[n.createVNode(r.RightShape,null,null)])])}}},N={modelValue:t.PropTypes.number.def(1),count:t.PropTypes.number.def(0).isRequired,limit:t.PropTypes.number.def(10),limitList:t.PropTypes.arrayOf(Number).def([10,20,50,100]),showLimit:t.PropTypes.bool.def(!0),type:t.PropTypes.oneOf(["default","compact"]).def("default"),location:t.PropTypes.oneOf(["left","right"]).def("right"),align:t.PropTypes.oneOf(["left","center","right"]).def("left"),size:t.PropTypes.size(),small:t.PropTypes.bool.def(!1),showTotalCount:t.PropTypes.bool.def(!0),prevText:t.PropTypes.string,nextText:t.PropTypes.string,disabled:t.PropTypes.bool.def(!1),layout:t.PropTypes.custom((function(e){var t={total:!0,list:!0,limit:!0};return e.some((function(e){return t[e]}))}),"layout 的值只支持 * total、list、limit *").def(["total","list","limit"])},y=n.defineComponent({name:"Pagination",props:N,emits:["update:modelValue","change","update:limit","limit-change"],setup:function(e,t){var o=n.ref(0),i=n.toRefs(e),u=i.count,c=i.limit,s=function(e){var t=e.isFirst,a=e.isLast,r=n.getCurrentInstance().props;return r.showTotalCount?n.createVNode("div",n.mergeProps({class:{"bk-pagination-total":!0,"is-first":t,"is-last":a}},{disabled:r.disabled}),[n.createTextVNode("共计"),n.createVNode("div",{class:"bk-pagination-total-num"},[r.count]),n.createTextVNode("条")]):null},d=function(){var e=n.getCurrentInstance().proxy,t=n.ref(1),a=n.computed((function(){return 1===t.value})),o=n.computed((function(){return t.value===e.totalPageNum})),i=n.ref(!1),l=n.ref(!1),u=n.computed((function(){i.value=!1,l.value=!1;var n=[];if(e.totalPageNum<=5){for(var a=2;a<=e.totalPageNum-1;a++)n.push(a);return n}var r=Math.floor(2.5);e.totalPageNum>5&&(i.value=t.value-r>2,l.value=t.value+r<e.totalPageNum-1);for(var o=Math.min(e.totalPageNum-5,Math.max(2,t.value-r)),u=o;u<o+5;u++)n.push(u);return n}));n.watch((function(){return e.modelValue}),(function(a){n.nextTick((function(){a>=1&&a<=e.totalPageNum?t.value=a:t.value=a<1?1:e.totalPageNum}))})),n.nextTick((function(){n.watch((function(){return e.totalPageNum}),(function(e){t.value>e&&(t.value=e)}))}));var c=function(){a.value||(t.value=t.value-1)},s=function(){o.value||(t.value=t.value+1)},d=function(e){e!==t.value&&(t.value=e)},p=function(){t.value=Math.max(1,t.value-5)},f=function(){t.value=Math.min(e.totalPageNum,t.value+5)};return{current:t,render:function(v){var m=v.isFirst,g=v.isLast;return n.createVNode("div",{class:{"bk-pagination-list":!0,"is-first":m,"is-last":g}},[n.createVNode("div",{class:{"bk-pagination-list-pre":!0,"is-disabled":a.value},onClick:c},[e.prevText||n.createVNode(r.AngleLeft,null,null)]),n.createVNode("div",{class:{"bk-pagination-list-item":!0,"is-active":1===t.value},key:"1",onClick:function(){return d(1)}},[n.createTextVNode("1")]),i.value&&n.createVNode("div",{key:"pre-batch",class:"bk-pagination-list-pre-batch",onClick:p},[n.createVNode(r.Ellipsis,null,null)]),u.value.map((function(e){return n.createVNode("div",{class:{"bk-pagination-list-item":!0,"is-active":t.value===e},key:e,onClick:function(){return d(e)}},[e])})),l.value&&n.createVNode("div",{key:"next-batch",class:"bk-pagination-list-next-batch",onClick:f},[n.createVNode(r.Ellipsis,null,null)]),e.totalPageNum>1&&n.createVNode("div",{class:{"bk-pagination-list-item":!0,"is-active":t.value===e.totalPageNum},key:"last",onClick:function(){return d(e.totalPageNum)}},[e.totalPageNum]),n.createVNode("div",{class:{"bk-pagination-list-pre":!0,"is-disabled":o.value},onClick:s},[e.nextText||n.createVNode(r.AngleRight,null,null)])])}}}(),p=d.current,f=d.render,v=h(),m=v.current,g=v.render,b=function(){var e=n.getCurrentInstance().proxy,t=n.ref(e.limit);n.watch((function(){return e.limit}),(function(e){t.value=e})),n.watch((function(){return e.limitList}),(function(e){n.nextTick((function(){if(!e.includes(t.value)){var n=x(e,1);t.value=n[0]}}))}),{immediate:!0});var r=function(e){t.value=e};return{limit:t,render:function(o){var i,u,c=o.isFirst,s=o.isLast;return e.showLimit?n.createVNode("div",n.mergeProps({class:{"bk-pagination-limit":!0,"is-first":c,"is-last":s}},{disabled:e.disabled}),[n.createVNode("div",null,[n.createTextVNode("每页")]),n.createVNode(l.default,{class:"bk-pagination-limit-select",clearable:!1,modelValue:t.value,onChange:r,disabled:e.disabled},(u=i=e.limitList.map((function(e,t){return n.createVNode(a.BkOption,{value:e,label:e,key:"".concat(t,"_").concat(e)},null)})),"function"==typeof u||"[object Object]"===Object.prototype.toString.call(u)&&!n.isVNode(u)?i:{default:function(){return[i]}})),n.createVNode("div",null,[n.createTextVNode("条")])]):null}}}(),N=b.limit,y=b.render;return n.watch([u,N,c],(function(e){var t=x(e,2),n=t[0],a=t[1],r=Math.ceil(n/a);o.value=r<1?1:r}),{immediate:!0}),n.watch(p,(function(e){t.emit("update:modelValue",e),t.emit("change",e)})),n.watch(m,(function(e){t.emit("update:modelValue",e),t.emit("change",e)})),n.watch(N,(function(e){t.emit("limit-change",e)})),{totalPageNum:o,renderTotal:s,renderList:f,renderLimit:y,renderSmallList:g}},render:function(){var e,a=this,r=t.classes((d(e={"bk-pagination":!0},"bk-pagination--".concat(this.size),!0),d(e,"is-align-".concat(this.align),!0),e)),o={total:this.renderTotal,list:this.small?this.renderSmallList:this.renderList,limit:this.renderLimit};return n.createVNode("div",{class:r},[this.layout.map((function(e,t){return o[e]({isFirst:0===t,isLast:t===a.layout.length-1})}))])}}),k=t.withInstall(y);e.BkPagination=k,e.default=k,Object.defineProperty(e,"__esModule",{value:!0})}));
|
@@ -122,7 +122,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
122
122
|
default: () => string[];
|
123
123
|
};
|
124
124
|
}, {
|
125
|
-
|
125
|
+
totalPageNum: import("vue").Ref<number>;
|
126
126
|
renderTotal: ({ isFirst, isLast }: {
|
127
127
|
isFirst: any;
|
128
128
|
isLast: any;
|
package/lib/pagination/type.d.ts
CHANGED
@@ -2,5 +2,5 @@ import type { ComponentPublicInstance } from 'vue';
|
|
2
2
|
import type { PaginationProps } from './pagination';
|
3
3
|
export declare type IPaginationInstance = ComponentPublicInstance<PaginationProps, {
|
4
4
|
limit: PaginationProps['limit'];
|
5
|
-
|
5
|
+
totalPageNum: number;
|
6
6
|
}>;
|
package/lib/popover/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("../shared"),require("vue")):"function"==typeof define&&define.amd?define(["exports","../shared","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Shared,e.Vue)}(this,(function(e,t,o){"use strict";function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var r={exports:{}};!function(e){e.exports=function(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e},e.exports.__esModule=!0,e.exports.default=e.exports}(r);var a=n(r.exports),i={isShow:t.PropTypes.bool,width:t.PropTypes.oneOfType([t.PropTypes.string,t.PropTypes.number]).def("auto"),height:t.PropTypes.oneOfType([t.PropTypes.string,t.PropTypes.number]).def("auto"),content:t.PropTypes.oneOfType([t.PropTypes.string,t.PropTypes.number]).def(""),transition:t.PropTypes.string.def("fade-in"),placement:t.PropTypes.placement(["auto","auto-start","auto-end","top","top-start","top-end","bottom","bottom-start","bottom-end","right","right-start","right-end","left","left-start","left-end"]).def("top"),theme:t.PropTypes.string.def("light"),handleFirstUpdate:{type:Function,default:function(){}},trigger:t.PropTypes.string.def("hover"),arrow:t.PropTypes.bool.def(!0),modifiers:t.PropTypes.array.def([{name:"offset",options:{offset:[0,8]}}]),boundary:t.PropTypes.oneOfType([t.PropTypes.string.def("parent"),t.PropTypes.instanceOf(HTMLElement)]),fixOnBoundary:t.PropTypes.bool.def(!1)},u=o.defineComponent({name:"Popover",props:i,setup:function(e,n){var r=!1,i=Object.create(null),u=o.toRefs(e),s=u.width,p=u.height,d=u.theme,
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("../shared"),require("vue")):"function"==typeof define&&define.amd?define(["exports","../shared","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Shared,e.Vue)}(this,(function(e,t,o){"use strict";function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var r={exports:{}};!function(e){e.exports=function(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e},e.exports.__esModule=!0,e.exports.default=e.exports}(r);var a=n(r.exports),i={isShow:t.PropTypes.bool,width:t.PropTypes.oneOfType([t.PropTypes.string,t.PropTypes.number]).def("auto"),height:t.PropTypes.oneOfType([t.PropTypes.string,t.PropTypes.number]).def("auto"),content:t.PropTypes.oneOfType([t.PropTypes.string,t.PropTypes.number]).def(""),transition:t.PropTypes.string.def("fade-in"),placement:t.PropTypes.placement(["auto","auto-start","auto-end","top","top-start","top-end","bottom","bottom-start","bottom-end","right","right-start","right-end","left","left-start","left-end"]).def("top"),theme:t.PropTypes.string.def("light"),handleFirstUpdate:{type:Function,default:function(){}},trigger:t.PropTypes.string.def("hover"),arrow:t.PropTypes.bool.def(!0),modifiers:t.PropTypes.array.def([{name:"offset",options:{offset:[0,8]}}]),boundary:t.PropTypes.oneOfType([t.PropTypes.string.def("parent"),t.PropTypes.instanceOf(HTMLElement)]),fixOnBoundary:t.PropTypes.bool.def(!1)},u=o.defineComponent({name:"Popover",props:i,setup:function(e,n){var r=!1,i=Object.create(null),u=o.toRefs(e),s=u.width,p=u.height,d=u.theme,l=u.trigger,f=u.isShow,c=u.placement,v=u.modifiers,m=u.arrow,h=u.content,y=o.ref(),T=o.ref(),b=o.computed((function(){return{width:/^\d+$/.test(String(s.value))?"".concat(s.value,"px"):s.value,height:/^\d+$/.test(String(p.value))?"".concat(p.value,"px"):p.value,zIndex:t.bkZIndexManager.getModalNextIndex()}})),g=["dark","light"],P=o.computed((function(){var e=d.value.split(/\s+/);return e.sort((function(e,t){return Number(g.includes(t))-Number(g.includes(e))})),{systemThemes:e,customThemes:e.filter((function(e){return!g.includes(e)}))}})),w=function(e){var t,o;"manual"===l.value&&r&&(e?null===(t=i.show)||void 0===t||t.call(i):null===(o=i.hide)||void 0===o||o.call(i))};o.watch((function(){return e.isShow}),(function(e){w(e)}),{immediate:!0});var x=function(){n.emit("update:isShow",!1)},O=function(){n.emit("update:isShow",!0)},S=function(){var e=i;e.constructor&&(e.isShow&&e.hide(),e.destroy(),i=Object.create(null))},j=function(){i=new t.BKPopover(y.value,T.value,{theme:P.value.systemThemes.join(" "),placement:c.value,trigger:l.value,modifiers:v.value,onFirstUpdate:e.handleFirstUpdate,afterShow:O,afterHidden:x,appendTo:e.boundary,fixOnBoundary:e.fixOnBoundary}),r=!0,w(f.value)},k=function(){S(),o.nextTick(j)};n.expose({update:k}),o.onMounted(k),o.onBeforeUnmount(S);var N=function(){n.emit("after-enter")},M=function(){n.emit("after-leave")},V=P.value.customThemes.join(" "),_=P.value.customThemes.reduce((function(e,t){return Object.assign(a({},"data-".concat(t,"-theme"),!0),e)}),{}),B="bk-popover-content ".concat(V);return function(){var t,r,a,i,u;return o.createVNode("div",{class:"bk-popover","data-bk-pop-container":!0},[o.createVNode("div",{ref:y,class:"bk-popover-reference"},[null===(r=(t=n.slots).default)||void 0===r?void 0:r.call(t)]),o.createVNode(o.Transition,{name:e.transition,onAfterEnter:N,onAfterLeave:M},{default:function(){return[o.createVNode("div",o.mergeProps({ref:T,class:B,style:b.value},_),[null!==(u=null===(i=(a=n.slots).content)||void 0===i?void 0:i.call(a))&&void 0!==u?u:h.value,m.value&&o.createVNode("div",{class:"arrow","data-popper-arrow":!0},null)])]}})])}}}),s=t.withInstall(u);e.default=s,Object.defineProperty(e,"__esModule",{value:!0})}));
|
@@ -0,0 +1,336 @@
|
|
1
|
+
declare const BkResizeLayout: {
|
2
|
+
new (...args: any[]): {
|
3
|
+
$: import("vue").ComponentInternalInstance;
|
4
|
+
$data: {};
|
5
|
+
$props: Partial<{
|
6
|
+
placement: string;
|
7
|
+
border: boolean;
|
8
|
+
disabled: boolean;
|
9
|
+
max: number;
|
10
|
+
min: number;
|
11
|
+
collapsible: boolean;
|
12
|
+
triggerWidth: number;
|
13
|
+
triggerOffset: number;
|
14
|
+
initialDivide: string | number;
|
15
|
+
immediate: boolean;
|
16
|
+
autoMinimize: number | boolean;
|
17
|
+
}> & Omit<Readonly<import("vue").ExtractPropTypes<{
|
18
|
+
placement: import("vue-types").VueTypeDef<string> & {
|
19
|
+
default: string;
|
20
|
+
};
|
21
|
+
min: import("vue-types").VueTypeValidableDef<number> & {
|
22
|
+
default: number;
|
23
|
+
} & {
|
24
|
+
default: number;
|
25
|
+
};
|
26
|
+
max: import("vue-types").VueTypeValidableDef<number> & {
|
27
|
+
default: number;
|
28
|
+
} & {
|
29
|
+
default: number;
|
30
|
+
};
|
31
|
+
triggerWidth: import("vue-types").VueTypeValidableDef<number> & {
|
32
|
+
default: number;
|
33
|
+
} & {
|
34
|
+
default: number;
|
35
|
+
};
|
36
|
+
triggerOffset: import("vue-types").VueTypeValidableDef<number> & {
|
37
|
+
default: number;
|
38
|
+
} & {
|
39
|
+
default: number;
|
40
|
+
};
|
41
|
+
initialDivide: import("vue-types").VueTypeDef<string | number> & {
|
42
|
+
default: string | number;
|
43
|
+
};
|
44
|
+
immediate: import("vue-types").VueTypeValidableDef<boolean> & {
|
45
|
+
default: boolean;
|
46
|
+
};
|
47
|
+
disabled: import("vue-types").VueTypeValidableDef<boolean> & {
|
48
|
+
default: boolean;
|
49
|
+
};
|
50
|
+
collapsible: import("vue-types").VueTypeValidableDef<boolean> & {
|
51
|
+
default: boolean;
|
52
|
+
};
|
53
|
+
autoMinimize: import("vue-types").VueTypeDef<number | boolean> & {
|
54
|
+
default: number | boolean;
|
55
|
+
};
|
56
|
+
border: import("vue-types").VueTypeValidableDef<boolean> & {
|
57
|
+
default: boolean;
|
58
|
+
} & {
|
59
|
+
default: boolean;
|
60
|
+
};
|
61
|
+
}>> & {
|
62
|
+
"onBefore-resize"?: (...args: any[]) => any;
|
63
|
+
onResizing?: (...args: any[]) => any;
|
64
|
+
"onAfter-resize"?: (...args: any[]) => any;
|
65
|
+
"onCollapse-change"?: (...args: any[]) => any;
|
66
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "placement" | "border" | "disabled" | "max" | "min" | "collapsible" | "triggerWidth" | "triggerOffset" | "initialDivide" | "immediate" | "autoMinimize">;
|
67
|
+
$attrs: {
|
68
|
+
[x: string]: unknown;
|
69
|
+
};
|
70
|
+
$refs: {
|
71
|
+
[x: string]: unknown;
|
72
|
+
};
|
73
|
+
$slots: Readonly<{
|
74
|
+
[name: string]: import("vue").Slot;
|
75
|
+
}>;
|
76
|
+
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>;
|
77
|
+
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>;
|
78
|
+
$emit: (event: "before-resize" | "resizing" | "after-resize" | "collapse-change", ...args: any[]) => void;
|
79
|
+
$el: any;
|
80
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
81
|
+
placement: import("vue-types").VueTypeDef<string> & {
|
82
|
+
default: string;
|
83
|
+
};
|
84
|
+
min: import("vue-types").VueTypeValidableDef<number> & {
|
85
|
+
default: number;
|
86
|
+
} & {
|
87
|
+
default: number;
|
88
|
+
};
|
89
|
+
max: import("vue-types").VueTypeValidableDef<number> & {
|
90
|
+
default: number;
|
91
|
+
} & {
|
92
|
+
default: number;
|
93
|
+
};
|
94
|
+
triggerWidth: import("vue-types").VueTypeValidableDef<number> & {
|
95
|
+
default: number;
|
96
|
+
} & {
|
97
|
+
default: number;
|
98
|
+
};
|
99
|
+
triggerOffset: import("vue-types").VueTypeValidableDef<number> & {
|
100
|
+
default: number;
|
101
|
+
} & {
|
102
|
+
default: number;
|
103
|
+
};
|
104
|
+
initialDivide: import("vue-types").VueTypeDef<string | number> & {
|
105
|
+
default: string | number;
|
106
|
+
};
|
107
|
+
immediate: import("vue-types").VueTypeValidableDef<boolean> & {
|
108
|
+
default: boolean;
|
109
|
+
};
|
110
|
+
disabled: import("vue-types").VueTypeValidableDef<boolean> & {
|
111
|
+
default: boolean;
|
112
|
+
};
|
113
|
+
collapsible: import("vue-types").VueTypeValidableDef<boolean> & {
|
114
|
+
default: boolean;
|
115
|
+
};
|
116
|
+
autoMinimize: import("vue-types").VueTypeDef<number | boolean> & {
|
117
|
+
default: number | boolean;
|
118
|
+
};
|
119
|
+
border: import("vue-types").VueTypeValidableDef<boolean> & {
|
120
|
+
default: boolean;
|
121
|
+
} & {
|
122
|
+
default: boolean;
|
123
|
+
};
|
124
|
+
}>> & {
|
125
|
+
"onBefore-resize"?: (...args: any[]) => any;
|
126
|
+
onResizing?: (...args: any[]) => any;
|
127
|
+
"onAfter-resize"?: (...args: any[]) => any;
|
128
|
+
"onCollapse-change"?: (...args: any[]) => any;
|
129
|
+
}, {
|
130
|
+
collapsed: import("vue").Ref<boolean>;
|
131
|
+
asideContentVisible: import("vue").Ref<boolean>;
|
132
|
+
minimized: import("vue").Ref<boolean>;
|
133
|
+
limitMax: any;
|
134
|
+
state: any;
|
135
|
+
vertical: import("vue").ComputedRef<boolean>;
|
136
|
+
cssPropKey: import("vue").ComputedRef<"height" | "width">;
|
137
|
+
bkResizeLayoutRef: import("vue").Ref<HTMLElement>;
|
138
|
+
resizeProxyRef: import("vue").Ref<HTMLElement>;
|
139
|
+
resizeMaskRef: import("vue").Ref<HTMLElement>;
|
140
|
+
asideRef: import("vue").Ref<HTMLElement>;
|
141
|
+
triggerStyle: import("vue").ComputedRef<{
|
142
|
+
[x: string]: string;
|
143
|
+
}>;
|
144
|
+
asideStyle: import("vue").ComputedRef<{
|
145
|
+
[x: string]: string;
|
146
|
+
}>;
|
147
|
+
handleMousedown: (event: any) => void;
|
148
|
+
setCollapse: (collapse: any) => void;
|
149
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("before-resize" | "resizing" | "after-resize" | "collapse-change")[], string, {
|
150
|
+
placement: string;
|
151
|
+
border: boolean;
|
152
|
+
disabled: boolean;
|
153
|
+
max: number;
|
154
|
+
min: number;
|
155
|
+
collapsible: boolean;
|
156
|
+
triggerWidth: number;
|
157
|
+
triggerOffset: number;
|
158
|
+
initialDivide: string | number;
|
159
|
+
immediate: boolean;
|
160
|
+
autoMinimize: number | boolean;
|
161
|
+
}> & {
|
162
|
+
beforeCreate?: (() => void) | (() => void)[];
|
163
|
+
created?: (() => void) | (() => void)[];
|
164
|
+
beforeMount?: (() => void) | (() => void)[];
|
165
|
+
mounted?: (() => void) | (() => void)[];
|
166
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
167
|
+
updated?: (() => void) | (() => void)[];
|
168
|
+
activated?: (() => void) | (() => void)[];
|
169
|
+
deactivated?: (() => void) | (() => void)[];
|
170
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
171
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
172
|
+
destroyed?: (() => void) | (() => void)[];
|
173
|
+
unmounted?: (() => void) | (() => void)[];
|
174
|
+
renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
175
|
+
renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
176
|
+
errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>, info: string) => boolean | void)[];
|
177
|
+
};
|
178
|
+
$forceUpdate: () => void;
|
179
|
+
$nextTick: typeof import("vue").nextTick;
|
180
|
+
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean>): import("vue").WatchStopHandle;
|
181
|
+
} & Readonly<import("vue").ExtractPropTypes<{
|
182
|
+
placement: import("vue-types").VueTypeDef<string> & {
|
183
|
+
default: string;
|
184
|
+
};
|
185
|
+
min: import("vue-types").VueTypeValidableDef<number> & {
|
186
|
+
default: number;
|
187
|
+
} & {
|
188
|
+
default: number;
|
189
|
+
};
|
190
|
+
max: import("vue-types").VueTypeValidableDef<number> & {
|
191
|
+
default: number;
|
192
|
+
} & {
|
193
|
+
default: number;
|
194
|
+
};
|
195
|
+
triggerWidth: import("vue-types").VueTypeValidableDef<number> & {
|
196
|
+
default: number;
|
197
|
+
} & {
|
198
|
+
default: number;
|
199
|
+
};
|
200
|
+
triggerOffset: import("vue-types").VueTypeValidableDef<number> & {
|
201
|
+
default: number;
|
202
|
+
} & {
|
203
|
+
default: number;
|
204
|
+
};
|
205
|
+
initialDivide: import("vue-types").VueTypeDef<string | number> & {
|
206
|
+
default: string | number;
|
207
|
+
};
|
208
|
+
immediate: import("vue-types").VueTypeValidableDef<boolean> & {
|
209
|
+
default: boolean;
|
210
|
+
};
|
211
|
+
disabled: import("vue-types").VueTypeValidableDef<boolean> & {
|
212
|
+
default: boolean;
|
213
|
+
};
|
214
|
+
collapsible: import("vue-types").VueTypeValidableDef<boolean> & {
|
215
|
+
default: boolean;
|
216
|
+
};
|
217
|
+
autoMinimize: import("vue-types").VueTypeDef<number | boolean> & {
|
218
|
+
default: number | boolean;
|
219
|
+
};
|
220
|
+
border: import("vue-types").VueTypeValidableDef<boolean> & {
|
221
|
+
default: boolean;
|
222
|
+
} & {
|
223
|
+
default: boolean;
|
224
|
+
};
|
225
|
+
}>> & {
|
226
|
+
"onBefore-resize"?: (...args: any[]) => any;
|
227
|
+
onResizing?: (...args: any[]) => any;
|
228
|
+
"onAfter-resize"?: (...args: any[]) => any;
|
229
|
+
"onCollapse-change"?: (...args: any[]) => any;
|
230
|
+
} & import("vue").ShallowUnwrapRef<{
|
231
|
+
collapsed: import("vue").Ref<boolean>;
|
232
|
+
asideContentVisible: import("vue").Ref<boolean>;
|
233
|
+
minimized: import("vue").Ref<boolean>;
|
234
|
+
limitMax: any;
|
235
|
+
state: any;
|
236
|
+
vertical: import("vue").ComputedRef<boolean>;
|
237
|
+
cssPropKey: import("vue").ComputedRef<"height" | "width">;
|
238
|
+
bkResizeLayoutRef: import("vue").Ref<HTMLElement>;
|
239
|
+
resizeProxyRef: import("vue").Ref<HTMLElement>;
|
240
|
+
resizeMaskRef: import("vue").Ref<HTMLElement>;
|
241
|
+
asideRef: import("vue").Ref<HTMLElement>;
|
242
|
+
triggerStyle: import("vue").ComputedRef<{
|
243
|
+
[x: string]: string;
|
244
|
+
}>;
|
245
|
+
asideStyle: import("vue").ComputedRef<{
|
246
|
+
[x: string]: string;
|
247
|
+
}>;
|
248
|
+
handleMousedown: (event: any) => void;
|
249
|
+
setCollapse: (collapse: any) => void;
|
250
|
+
}> & {} & {} & import("vue").ComponentCustomProperties;
|
251
|
+
__isFragment?: never;
|
252
|
+
__isTeleport?: never;
|
253
|
+
__isSuspense?: never;
|
254
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
255
|
+
placement: import("vue-types").VueTypeDef<string> & {
|
256
|
+
default: string;
|
257
|
+
};
|
258
|
+
min: import("vue-types").VueTypeValidableDef<number> & {
|
259
|
+
default: number;
|
260
|
+
} & {
|
261
|
+
default: number;
|
262
|
+
};
|
263
|
+
max: import("vue-types").VueTypeValidableDef<number> & {
|
264
|
+
default: number;
|
265
|
+
} & {
|
266
|
+
default: number;
|
267
|
+
};
|
268
|
+
triggerWidth: import("vue-types").VueTypeValidableDef<number> & {
|
269
|
+
default: number;
|
270
|
+
} & {
|
271
|
+
default: number;
|
272
|
+
};
|
273
|
+
triggerOffset: import("vue-types").VueTypeValidableDef<number> & {
|
274
|
+
default: number;
|
275
|
+
} & {
|
276
|
+
default: number;
|
277
|
+
};
|
278
|
+
initialDivide: import("vue-types").VueTypeDef<string | number> & {
|
279
|
+
default: string | number;
|
280
|
+
};
|
281
|
+
immediate: import("vue-types").VueTypeValidableDef<boolean> & {
|
282
|
+
default: boolean;
|
283
|
+
};
|
284
|
+
disabled: import("vue-types").VueTypeValidableDef<boolean> & {
|
285
|
+
default: boolean;
|
286
|
+
};
|
287
|
+
collapsible: import("vue-types").VueTypeValidableDef<boolean> & {
|
288
|
+
default: boolean;
|
289
|
+
};
|
290
|
+
autoMinimize: import("vue-types").VueTypeDef<number | boolean> & {
|
291
|
+
default: number | boolean;
|
292
|
+
};
|
293
|
+
border: import("vue-types").VueTypeValidableDef<boolean> & {
|
294
|
+
default: boolean;
|
295
|
+
} & {
|
296
|
+
default: boolean;
|
297
|
+
};
|
298
|
+
}>> & {
|
299
|
+
"onBefore-resize"?: (...args: any[]) => any;
|
300
|
+
onResizing?: (...args: any[]) => any;
|
301
|
+
"onAfter-resize"?: (...args: any[]) => any;
|
302
|
+
"onCollapse-change"?: (...args: any[]) => any;
|
303
|
+
}, {
|
304
|
+
collapsed: import("vue").Ref<boolean>;
|
305
|
+
asideContentVisible: import("vue").Ref<boolean>;
|
306
|
+
minimized: import("vue").Ref<boolean>;
|
307
|
+
limitMax: any;
|
308
|
+
state: any;
|
309
|
+
vertical: import("vue").ComputedRef<boolean>;
|
310
|
+
cssPropKey: import("vue").ComputedRef<"height" | "width">;
|
311
|
+
bkResizeLayoutRef: import("vue").Ref<HTMLElement>;
|
312
|
+
resizeProxyRef: import("vue").Ref<HTMLElement>;
|
313
|
+
resizeMaskRef: import("vue").Ref<HTMLElement>;
|
314
|
+
asideRef: import("vue").Ref<HTMLElement>;
|
315
|
+
triggerStyle: import("vue").ComputedRef<{
|
316
|
+
[x: string]: string;
|
317
|
+
}>;
|
318
|
+
asideStyle: import("vue").ComputedRef<{
|
319
|
+
[x: string]: string;
|
320
|
+
}>;
|
321
|
+
handleMousedown: (event: any) => void;
|
322
|
+
setCollapse: (collapse: any) => void;
|
323
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("before-resize" | "resizing" | "after-resize" | "collapse-change")[], "before-resize" | "resizing" | "after-resize" | "collapse-change", {
|
324
|
+
placement: string;
|
325
|
+
border: boolean;
|
326
|
+
disabled: boolean;
|
327
|
+
max: number;
|
328
|
+
min: number;
|
329
|
+
collapsible: boolean;
|
330
|
+
triggerWidth: number;
|
331
|
+
triggerOffset: number;
|
332
|
+
initialDivide: string | number;
|
333
|
+
immediate: boolean;
|
334
|
+
autoMinimize: number | boolean;
|
335
|
+
}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("@vue/runtime-core").Plugin;
|
336
|
+
export default BkResizeLayout;
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("../shared"),require("vue"),require("../icon")):"function"==typeof define&&define.amd?define(["exports","../shared","vue","../icon"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Shared,e.Vue,e["@bkui-vue/icon/icons"])}(this,(function(e,t,a,i){"use strict";function l(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n={exports:{}};!function(e){e.exports=function(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e},e.exports.__esModule=!0,e.exports.default=e.exports}(n);var u=l(n.exports),o=a.defineComponent({name:"ResizeLayout",props:{placement:t.PropTypes.placement().def("left"),min:t.PropTypes.number.def(3),max:t.PropTypes.number.def(1/0),triggerWidth:t.PropTypes.number.def(5),triggerOffset:t.PropTypes.number.def(3),initialDivide:t.PropTypes.oneOfType([String,Number]).def("20%"),immediate:t.PropTypes.bool,disabled:t.PropTypes.bool,collapsible:t.PropTypes.bool,autoMinimize:t.PropTypes.oneOfType([Boolean,Number]).def(!1),border:t.PropTypes.bool.def(!0)},emits:["before-resize","resizing","after-resize","collapse-change"],setup:function(e,t){var i=t.emit,l=a.toRefs(e),n=l.placement,o=l.initialDivide,s=l.triggerOffset,r=l.triggerWidth,c=l.max,v=l.min,d=l.immediate,f=l.autoMinimize,p=a.ref(!1),m=a.ref(!0),b=a.ref(!1),y=a.ref(null),h=a.ref({}),g=a.ref(null),z=a.ref(null),k=a.ref(null),x=a.ref(null),w=a.computed((function(){return["left","right"].includes(n.value)})),M=a.computed((function(){return w.value?"width":"height"})),P=a.computed((function(){var e=o.value;return"number"==typeof e&&(e="".concat(e,"px")),u({},M.value,e)})),R=a.computed((function(){var e;return u(e={},"margin-".concat(n.value),"".concat(s.value-r.value,"px")),u(e,M.value,"".concat(r.value,"px")),e})),T=a.computed((function(){return f.value?"boolean"==typeof f.value?50:f.value:0})),V=new ResizeObserver((function(){var e=g.value.getBoundingClientRect();y.value=w.value?e.width:e.height})),C=function(){if(!f.value)return!1;var e=x.value.getBoundingClientRect();if(b.value=p.value=e[M.value]<=T.value,!b.value)return m.value=!0,!1;L(),a.nextTick((function(){x.value.setAttribute("data-".concat(M.value),P.value[M.value])}))},L=function(){var e=x.value.getBoundingClientRect();N(!p.value),p.value?(x.value.setAttribute("data-".concat(M.value),"".concat(e[M.value],"px")),x.value.style[M.value]="5px"):(m.value=!0,x.value.style[M.value]=x.value.getAttribute("data-".concat(M.value)))},N=function(e){x.value.addEventListener("transitionend",(function t(){m.value=e,x.value.style.transition="",x.value.removeEventListener("transitionend",t)})),x.value.style.transition="".concat(M.value," cubic-bezier(0.4, 0, 0.2, 1) .3s")};return a.onMounted((function(){V.observe(g.value)})),a.onBeforeUnmount((function(){V.unobserve(g.value)})),{collapsed:p,asideContentVisible:m,minimized:b,limitMax:y,state:h,vertical:w,cssPropKey:M,bkResizeLayoutRef:g,resizeProxyRef:z,resizeMaskRef:k,asideRef:x,triggerStyle:R,asideStyle:P,handleMousedown:function(e){i("before-resize",e);var t=x.value.getBoundingClientRect();h.value=Object.freeze({mouse:{clientX:e.clientX,clientY:e.clientY},aside:{width:t.width,height:t.height}}),k.value.style.display="block",k.value.style.cursor=w.value?"col-resize":"row-resize",d.value||function(){switch(z.value.style.visibility="visible",n.value){case"left":z.value.style.inset="0 auto auto ".concat(h.value.aside.width,"px");break;case"right":z.value.style.inset="0 ".concat(h.value.aside.width,"px auto auto");break;case"top":z.value.style.inset="".concat(h.value.aside.height,"px auto auto 0");break;case"bottom":z.value.style.inset="auto auto ".concat(h.value.aside.height,"px 0")}}(),document.onselectstart=function(){return!1},document.ondragstart=function(){return!1};var l=function(e){var t;switch(n.value){case"top":t=e.clientY-h.value.mouse.clientY;break;case"right":t=h.value.mouse.clientX-e.clientX;break;case"bottom":t=h.value.mouse.clientY-e.clientY;break;case"left":t=e.clientX-h.value.mouse.clientX}var a=function(e){return Math.min(c.value,Math.max(v.value,e),y.value-r.value)}(h.value.aside[M.value]+t)+s.value,l="".concat(a,"px");d.value?x.value.style[M.value]=l:z.value.style[n.value]=l,i("resizing",a)};document.addEventListener("mousemove",l),document.addEventListener("mouseup",(function e(){if(z.value.style.visibility="hidden",k.value.style.display="none",document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",e),document.onselectstart=null,document.ondragstart=null,a.nextTick((function(){C(),i("after-resize",parseFloat(z.value.style[n.value]))})),d.value)return!1;x.value.style[M.value]=z.value.style[n.value]}))},setCollapse:function(e){p.value="boolean"==typeof e?e:!p.value,L(),i("collapse-change",p.value)}}},render:function(){var e,t,l,n,u,o,s=["bk-resize-layout","bk-resize-layout-".concat(this.placement),{"bk-resize-layout-collapsed":this.collapsed,"bk-resize-layout-border":this.border}];return a.createVNode("div",{ref:"bkResizeLayoutRef",class:s},[a.createVNode("aside",{class:"bk-resize-layout-aside",ref:"asideRef",style:this.asideStyle},[a.withDirectives(a.createVNode("div",{class:"bk-resize-layout-aside-content"},[null===(t=(e=this.$slots).aside)||void 0===t?void 0:t.call(e)]),[[a.vShow,this.asideContentVisible]]),a.withDirectives(a.createVNode("i",{class:"bk-resize-trigger",style:this.triggerStyle,onMousedown:a.withModifiers(this.handleMousedown,["left"])},null),[[a.vShow,!this.disabled&&(!this.collapsed||this.autoMinimize)]]),a.withDirectives(a.createVNode("i",{class:["bk-resize-proxy",this.placement],ref:"resizeProxyRef"},null),[[a.vShow,!this.collapsed||this.autoMinimize]]),this.collapsible&&((null===(n=(l=this.$slots)["collapse-trigger"])||void 0===n?void 0:n.call(l))||a.createVNode(i.AngleLeft,{class:"bk-resize-collapse",onClick:this.setCollapse},null))]),a.createVNode("main",{class:"bk-resize-layout-main"},[null===(o=(u=this.$slots).main)||void 0===o?void 0:o.call(u)]),a.createVNode("div",{class:"bk-resize-mask",ref:"resizeMaskRef"},null)])}}),s=t.withInstall(o);e.default=s,Object.defineProperty(e,"__esModule",{value:!0})}));
|