bkui-vue 0.0.1-beta.55 → 0.0.1-beta.58

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.
Files changed (104) hide show
  1. package/dist/index.cjs.js +27 -27
  2. package/dist/index.esm.js +1302 -718
  3. package/dist/index.umd.js +27 -27
  4. package/dist/style.css +1 -1
  5. package/lib/badge/badge.css +5 -5
  6. package/lib/badge/badge.d.ts +28 -7
  7. package/lib/badge/badge.less +5 -6
  8. package/lib/badge/badge.variable.css +5 -5
  9. package/lib/badge/index.d.ts +68 -18
  10. package/lib/badge/index.js +1 -1
  11. package/lib/breadcrumb/breadcrumb.css +8 -0
  12. package/lib/breadcrumb/breadcrumb.variable.css +8 -0
  13. package/lib/card/card.css +53 -1
  14. package/lib/card/card.d.ts +47 -6
  15. package/lib/card/card.less +47 -3
  16. package/lib/card/card.variable.css +53 -1
  17. package/lib/card/index.d.ts +113 -17
  18. package/lib/card/index.js +1 -1
  19. package/lib/code-diff/index.js +1 -1
  20. package/lib/components.d.ts +1 -0
  21. package/lib/components.js +1 -1
  22. package/lib/container/col.d.ts +51 -0
  23. package/lib/container/container.css +48 -0
  24. package/lib/container/container.d.ts +83 -0
  25. package/lib/container/container.less +20 -0
  26. package/lib/container/container.variable.css +142 -0
  27. package/lib/container/index.d.ts +223 -0
  28. package/lib/container/index.js +1 -0
  29. package/lib/container/row.d.ts +4 -0
  30. package/lib/date-picker/date-picker.d.ts +4 -4
  31. package/lib/date-picker/index.d.ts +14 -14
  32. package/lib/dialog/dialog.css +8 -0
  33. package/lib/dialog/dialog.d.ts +170 -97
  34. package/lib/dialog/dialog.less +8 -0
  35. package/lib/dialog/dialog.variable.css +8 -0
  36. package/lib/dialog/index.d.ts +373 -206
  37. package/lib/dialog/index.js +1 -1
  38. package/lib/form/form-item.d.ts +2 -2
  39. package/lib/form/form.css +4 -1
  40. package/lib/form/form.less +4 -1
  41. package/lib/form/form.variable.css +4 -1
  42. package/lib/form/index.d.ts +2 -2
  43. package/lib/icon/close-line.d.ts +4 -0
  44. package/lib/icon/{funnel.js → close-line.js} +1 -1
  45. package/lib/icon/data-shape.d.ts +4 -0
  46. package/lib/icon/data-shape.js +1 -0
  47. package/lib/icon/edit-line.d.ts +4 -0
  48. package/lib/icon/edit-line.js +1 -0
  49. package/lib/icon/help-document-fill.js +1 -1
  50. package/lib/icon/help-fill.js +1 -0
  51. package/lib/icon/index.d.ts +3 -0
  52. package/lib/icon/index.js +1 -1
  53. package/lib/input/index.d.ts +27 -27
  54. package/lib/input/index.js +1 -1
  55. package/lib/input/input.css +9 -0
  56. package/lib/input/input.d.ts +8 -8
  57. package/lib/input/input.less +1 -0
  58. package/lib/input/input.variable.css +9 -0
  59. package/lib/loading/loading.css +8 -0
  60. package/lib/loading/loading.variable.css +8 -0
  61. package/lib/menu/menu.css +8 -0
  62. package/lib/menu/menu.variable.css +8 -0
  63. package/lib/modal/index.d.ts +177 -165
  64. package/lib/modal/index.js +1 -1
  65. package/lib/modal/modal.d.ts +70 -65
  66. package/lib/modal/props.mixin.d.ts +34 -31
  67. package/lib/navigation/navigation.d.ts +1 -1
  68. package/lib/pagination/index.d.ts +7 -7
  69. package/lib/pagination/pagination.d.ts +2 -2
  70. package/lib/progress/progress.css +8 -0
  71. package/lib/progress/progress.variable.css +8 -0
  72. package/lib/rate/star.d.ts +1 -1
  73. package/lib/select/index.d.ts +8 -8
  74. package/lib/select/select.d.ts +2 -2
  75. package/lib/sideslider/index.d.ts +143 -134
  76. package/lib/sideslider/sideslider.d.ts +70 -65
  77. package/lib/slider/slider.d.ts +1 -1
  78. package/lib/styles/index.d.ts +1 -0
  79. package/lib/styles/mixins/clearfix.css +8 -0
  80. package/lib/styles/mixins/clearfix.less +10 -0
  81. package/lib/styles/mixins/clearfix.variable.css +8 -0
  82. package/lib/styles/mixins/mixins.css +8 -0
  83. package/lib/styles/mixins/mixins.less +1 -0
  84. package/lib/styles/mixins/mixins.variable.css +8 -0
  85. package/lib/switcher/switcher.css +8 -0
  86. package/lib/switcher/switcher.variable.css +8 -0
  87. package/lib/tab/index.d.ts +1 -1
  88. package/lib/tab/tab-panel.d.ts +1 -1
  89. package/lib/table/index.d.ts +54 -1
  90. package/lib/table/index.js +1 -1
  91. package/lib/table/plugins/settings.css +110 -0
  92. package/lib/table/plugins/settings.less +130 -0
  93. package/lib/table/plugins/settings.variable.css +204 -0
  94. package/lib/table/props.d.ts +42 -1
  95. package/lib/table/render.d.ts +12 -2
  96. package/lib/table/table.css +131 -2
  97. package/lib/table/table.d.ts +25 -0
  98. package/lib/table/table.less +29 -1
  99. package/lib/table/table.variable.css +131 -2
  100. package/lib/table/use-common.d.ts +8 -5
  101. package/lib/tag-input/tag-input.d.ts +2 -2
  102. package/lib/tree/index.js +1 -1
  103. package/lib/virtual-render/index.js +1 -1
  104. package/package.json +11 -4
@@ -182,6 +182,116 @@
182
182
  .bk-head-cell-sort .sort-action.sort-desc {
183
183
  align-items: flex-start;
184
184
  }
185
+ .bk-table-settings[data-bk-table-settings-theme="true"] {
186
+ padding: 0;
187
+ }
188
+ .bk-table-settings[data-bk-table-settings-theme="true"] .setting-content {
189
+ width: 515px;
190
+ opacity: 1;
191
+ border: 1px solid #dcdee5;
192
+ border-radius: 2px;
193
+ }
194
+ .bk-table-settings[data-bk-table-settings-theme="true"] .setting-content .setting-head {
195
+ display: flex;
196
+ padding: 0 24px;
197
+ margin: 0;
198
+ line-height: 32px;
199
+ font-size: 16px;
200
+ font-weight: 400;
201
+ color: #313238;
202
+ position: relative;
203
+ }
204
+ .bk-table-settings[data-bk-table-settings-theme="true"] .setting-content .setting-head .icon-close-action {
205
+ position: absolute;
206
+ right: 15px;
207
+ top: 10px;
208
+ cursor: pointer;
209
+ }
210
+ .bk-table-settings[data-bk-table-settings-theme="true"] .setting-content .setting-body {
211
+ padding: 0 24px;
212
+ }
213
+ .bk-table-settings[data-bk-table-settings-theme="true"] .setting-content .setting-body .setting-body-title {
214
+ display: flex;
215
+ justify-content: space-between;
216
+ font-size: 14px;
217
+ color: #63656e;
218
+ line-height: 19px;
219
+ }
220
+ .bk-table-settings[data-bk-table-settings-theme="true"] .setting-content .setting-body .setting-body-title .limit {
221
+ color: #c4c6cc;
222
+ }
223
+ .bk-table-settings[data-bk-table-settings-theme="true"] .setting-content .setting-body .setting-body-title .check-all {
224
+ color: #3a84ff;
225
+ cursor: pointer;
226
+ }
227
+ .bk-table-settings[data-bk-table-settings-theme="true"] .setting-content .setting-body .setting-body-fields {
228
+ max-height: 150px;
229
+ display: flex;
230
+ align-items: flex-start;
231
+ flex-wrap: wrap;
232
+ }
233
+ .bk-table-settings[data-bk-table-settings-theme="true"] .setting-content .setting-body .setting-body-fields .field-item {
234
+ width: 150px;
235
+ line-height: 42px;
236
+ height: 42px;
237
+ }
238
+ .bk-table-settings[data-bk-table-settings-theme="true"] .setting-content .setting-body .setting-body-fields .field-item > label {
239
+ overflow: hidden;
240
+ text-overflow: ellipsis;
241
+ white-space: nowrap;
242
+ }
243
+ .bk-table-settings[data-bk-table-settings-theme="true"] .setting-content .setting-body .setting-body-line-height {
244
+ border-top: solid 1px #f0f1f5;
245
+ height: 76px;
246
+ font-size: 14px;
247
+ display: flex;
248
+ align-items: center;
249
+ }
250
+ .bk-table-settings[data-bk-table-settings-theme="true"] .setting-content .setting-body .setting-body-line-height .line-size {
251
+ display: flex;
252
+ justify-content: center;
253
+ align-items: center;
254
+ width: 68px;
255
+ height: 26px;
256
+ cursor: pointer;
257
+ color: #63656e;
258
+ border: 1px solid #c4c6cc;
259
+ }
260
+ .bk-table-settings[data-bk-table-settings-theme="true"] .setting-content .setting-body .setting-body-line-height .line-size.active {
261
+ background: #e1ecff;
262
+ color: #3a84ff;
263
+ border: 1px solid #a3c5fd;
264
+ }
265
+ .bk-table-settings[data-bk-table-settings-theme="true"] .setting-content .setting-body .setting-body-line-height .line-size:not(.active) {
266
+ border-left: none;
267
+ border-right: none;
268
+ }
269
+ .bk-table-settings[data-bk-table-settings-theme="true"] .setting-content .setting-body .setting-body-line-height .line-size:first-child {
270
+ border-top-left-radius: 2px;
271
+ border-bottom-left-radius: 2px;
272
+ border-left: 1px solid #c4c6cc;
273
+ border-right: 1px solid #c4c6cc;
274
+ }
275
+ .bk-table-settings[data-bk-table-settings-theme="true"] .setting-content .setting-body .setting-body-line-height .line-size:first-child.is-default {
276
+ border-right: none;
277
+ }
278
+ .bk-table-settings[data-bk-table-settings-theme="true"] .setting-content .setting-body .setting-body-line-height .line-size:last-child {
279
+ border-top-right-radius: 2px;
280
+ border-bottom-right-radius: 2px;
281
+ border-right: 1px solid #c4c6cc;
282
+ border-left: 1px solid #c4c6cc;
283
+ }
284
+ .bk-table-settings[data-bk-table-settings-theme="true"] .setting-content .setting-body .setting-body-line-height .line-size:last-child.is-default {
285
+ border-left: none;
286
+ }
287
+ .bk-table-settings[data-bk-table-settings-theme="true"] .setting-content .setting-footer {
288
+ height: 56px;
289
+ padding: 0 24px;
290
+ background-color: #fafbfd;
291
+ display: flex;
292
+ justify-content: flex-end;
293
+ align-items: center;
294
+ }
185
295
  .bk-table {
186
296
  height: auto;
187
297
  overflow: hidden;
@@ -237,10 +347,29 @@
237
347
  display: inline-block;
238
348
  width: 100%;
239
349
  }
240
- .bk-table .bk-table-head table tbody tr:hover td,
241
- .bk-table .bk-table-body table tbody tr:hover td {
350
+ .bk-table .bk-table-head table tbody tr:hover td:not(.empty-cell),
351
+ .bk-table .bk-table-body table tbody tr:hover td:not(.empty-cell) {
242
352
  background: #f5f7fa;
243
353
  }
354
+ .bk-table .bk-table-head {
355
+ position: relative;
356
+ }
357
+ .bk-table .bk-table-head .table-head-settings .bk-popover-reference {
358
+ cursor: pointer;
359
+ width: calc(var(--row-height));
360
+ font-size: 18px;
361
+ position: absolute;
362
+ right: 1px;
363
+ top: 0;
364
+ bottom: 1px;
365
+ background: #f0f1f5;
366
+ border-left: 1px solid #dcdee5;
367
+ border-right: 1px solid #dcdee5;
368
+ border-radius: 0px 2px 0px 0px;
369
+ display: flex;
370
+ justify-content: center;
371
+ align-items: center;
372
+ }
244
373
  .bk-table .bk-table-footer {
245
374
  line-height: 40px;
246
375
  border-top: 1px solid #dcdee5;
@@ -1,17 +1,20 @@
1
- export declare const useClass: (props: any, root?: any) => {
1
+ import { TablePropTypes } from './props';
2
+ export declare const useClass: (props: TablePropTypes, root?: any) => {
2
3
  tableClass: import("vue").ComputedRef<string>;
3
4
  headClass: string;
4
5
  contentClass: string;
5
- footerClass: string;
6
+ footerClass: import("vue").ComputedRef<string>;
6
7
  wrapperStyle: import("vue").ComputedRef<{
7
8
  minHeight: string | number;
8
9
  }>;
9
10
  contentStyle: import("vue").ComputedRef<{
10
- maxHeight: string;
11
11
  display: string;
12
- } | {
12
+ 'max-height': string;
13
+ 'min-height': string;
13
14
  height: string;
14
- display: string;
15
15
  }>;
16
+ headStyle: {
17
+ '--row-height': string;
18
+ };
16
19
  resetTableHeight: (rootEl: HTMLElement) => void;
17
20
  };
@@ -339,10 +339,10 @@ declare const _default: import("vue").DefineComponent<{
339
339
  }[];
340
340
  separator: string;
341
341
  disabled: boolean;
342
- modelValue: string[];
343
- trigger: string;
344
342
  clearable: boolean;
345
343
  showClearOnlyHover: boolean;
344
+ modelValue: string[];
345
+ trigger: string;
346
346
  searchKey: string | string[];
347
347
  displayKey: string;
348
348
  tooltipKey: string;
package/lib/tree/index.js CHANGED
@@ -1 +1 @@
1
- !function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n(require("../shared"),require("vue"),require("../icon/"),require("../virtual-render"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../icon/","../virtual-render"],n);else{var t="object"==typeof exports?n(require("../shared"),require("vue"),require("../icon/"),require("../virtual-render")):n(e["../shared"],e.vue,e["../icon/"],e["../virtual-render"]);for(var r in t)("object"==typeof exports?exports:e)[r]=t[r]}}(self,((e,n,t,r)=>(()=>{var o={8022:(e,n,t)=>{var r=t(4481),o=t(6426),i=o;i.v1=r,i.v4=o,e.exports=i},8725:e=>{for(var n=[],t=0;t<256;++t)n[t]=(t+256).toString(16).substr(1);e.exports=function(e,t){var r=t||0,o=n;return[o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]]].join("")}},9157:e=>{var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var t=new Uint8Array(16);e.exports=function(){return n(t),t}}else{var r=new Array(16);e.exports=function(){for(var e,n=0;n<16;n++)0==(3&n)&&(e=4294967296*Math.random()),r[n]=e>>>((3&n)<<3)&255;return r}}},4481:(e,n,t)=>{var r,o,i=t(9157),a=t(8725),l=0,u=0;e.exports=function(e,n,t){var c=n&&t||0,s=n||[],f=(e=e||{}).node||r,d=void 0!==e.clockseq?e.clockseq:o;if(null==f||null==d){var p=i();null==f&&(f=r=[1|p[0],p[1],p[2],p[3],p[4],p[5]]),null==d&&(d=o=16383&(p[6]<<8|p[7]))}var v=void 0!==e.msecs?e.msecs:(new Date).getTime(),y=void 0!==e.nsecs?e.nsecs:u+1,h=v-l+(y-u)/1e4;if(h<0&&void 0===e.clockseq&&(d=d+1&16383),(h<0||v>l)&&void 0===e.nsecs&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");l=v,u=y,o=d;var _=(1e4*(268435455&(v+=122192928e5))+y)%4294967296;s[c++]=_>>>24&255,s[c++]=_>>>16&255,s[c++]=_>>>8&255,s[c++]=255&_;var m=v/4294967296*1e4&268435455;s[c++]=m>>>8&255,s[c++]=255&m,s[c++]=m>>>24&15|16,s[c++]=m>>>16&255,s[c++]=d>>>8|128,s[c++]=255&d;for(var g=0;g<6;++g)s[c+g]=f[g];return n||a(s)}},6426:(e,n,t)=>{var r=t(9157),o=t(8725);e.exports=function(e,n,t){var i=n&&t||0;"string"==typeof e&&(n="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||r)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,n)for(var l=0;l<16;++l)n[i+l]=a[l];return n||o(a)}},7685:e=>{"use strict";e.exports=t},4212:n=>{"use strict";n.exports=e},3511:e=>{"use strict";e.exports=r},748:e=>{"use strict";e.exports=n}},i={};function a(e){var n=i[e];if(void 0!==n)return n.exports;var t=i[e]={exports:{}};return o[e](t,t.exports,a),t.exports}a.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return a.d(n,{a:n}),n},a.d=(e,n)=>{for(var t in n)a.o(n,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},a.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};return(()=>{"use strict";a.r(l),a.d(l,{default:()=>T});var e=a(4212);function n(e){return n="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},n(e)}function t(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var r=a(748),o=a(7685),i=a(3511),u=a.n(i),c={data:e.PropTypes.arrayOf(e.PropTypes.any).def([]),label:e.PropTypes.oneOfType([e.PropTypes.func.def(void 0),e.PropTypes.string.def("label")]),children:e.PropTypes.string.def("children"),indent:e.PropTypes.number.def(18),lineHeight:e.PropTypes.number.def(32),levelLine:e.PropTypes.oneOfType([e.PropTypes.bool.def(!1),e.PropTypes.func.def(void 0),e.PropTypes.string.def("1px dashed #c3cdd7")]).def(!1),virtualRender:e.PropTypes.bool.def(!1),prefixIcon:e.PropTypes.oneOfType([e.PropTypes.func.def((function(){})),e.PropTypes.bool.def(!1)]).def(!0),async:e.PropTypes.shape({callback:e.PropTypes.func.def(null),cache:e.PropTypes.bool.def(!0)}),offsetLeft:e.PropTypes.number.def(5)};function s(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function f(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(e){if("string"==typeof e)return s(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?s(e,n):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var d=a(8022),p=void 0,v="1px dashed #c3cdd7",y=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=e.data,a=e.children,l=[],u=0,c=new Map;function s(e,n,t,r){var i=(o||[]).find((function(n){return n.__uuid===e}));return i?i[r]:n[t]}function f(e,n){return s(e,n,"isOpen","__isOpen")}function p(e,n){return s(e,n,"checked","__checked")}function v(e){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=e.length,y=0;y<s;y++){var h=e[y];if(Array.isArray(h))v(h,r,o,i);else if("object"===n(h)&&null!==h){var _=h.__uuid||(0,d.v4)(),m=null!==i?"".concat(i,"-").concat(y):"".concat(y),g=!!(h[a]||[]).length,b=t({__depth:r,__index:y,__uuid:_,__parentId:o,__hasChild:g,__path:m,__isRoot:null===o,__order:u,__isOpen:f(_,h)&&g,__checked:p(_,h)},a,null);Object.assign(h,{__uuid:_}),c.set(_,b),u+=1,l.push(Object.assign(Object.assign({},h),t({},a,null))),Object.prototype.hasOwnProperty.call(h,a)&&v(h[a]||[],r+1,_,m)}}}return v(r||i),[l,c]},h=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],a=e[n];return"boolean"==typeof a?a?r:o:_(t,e,n,i)},_=function(e,t,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=t[r];if("string"==typeof i)return"object"===n(e)&&null!==e?(Object.prototype.hasOwnProperty.call(e,i)||console.error("cannot find node label with key ".concat(i)),e[i]):i;if("function"==typeof i){var a=i.apply(p,[e].concat(f(o)));return"string"==typeof a?a:void console.error("props label with function return value is not string, please check and return string")}},m=function(e,n){return _(e,n,"label")},g=function(e,n){return e.get(n)||{}},b=function(e,n,t){var r;return null===(r=g(e,n))||void 0===r?void 0:r[t]},x=function(e,n){return{"--level-line":h(n,"levelLine",e,v,null,["tree"]),"--lineHeight":"".concat(n.lineHeight,"px"),"--indent":"".concat(n.indent,"px"),"--offset-left":"".concat(n.offsetLeft,"px")}},N=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.schema,o=b(r,e.__uuid,"__depth");return Object.assign({"--depth":o},"function"==typeof n.levelLine?{"--level-line":h(n,"levelLine",e,v,null,["node"])}:{})},O=function(e,n,t){var r=g(n,e.__uuid)||{};return{"is-root":r.__isRoot,"bk-tree-node":!0,"is-open":r.__isOpen,"is-virtual-render":t.virtualRender,"level-line":t.levelLine}},j=function(n,r){return t({"is-checked":(g(r,n.__uuid)||{}).__checked},(0,e.resolveClassName)("node-row"),!0)},P=function(e,n,t,r){var o=e.split("-").reduce((function(e,n){var r=Number(n);return Array.isArray(e)?e[r]:e[t][r]}),n);Object.assign(o,r||{})};const C=(0,r.defineComponent)({name:"Tree",props:c,emits:["check"],setup:function(i,a){var l=y(i),u=[],c=(0,r.reactive)({data:l[0],schema:l[1],levelLineSchema:{}});(0,r.watch)((function(){return[i.data]}),(function(e){var n=y(i,e,s.value);c.data=n[0],c.schema=n[1]}),{deep:!0});var s=(0,r.computed)((function(){return Array.from(c.schema.values())})),f=function(e){return c.schema.get(e)},d=function(e,n){var t;return null===(t=f(e.__uuid))||void 0===t?void 0:t[n]},p=function(e,n,r){return c.schema.set(e.__uuid,Object.assign(Object.assign({},f(e.__uuid)),t({},n,r)))},v=function(e){return d(e,"__path")},h=function(e){return d(e,"__isRoot")},_=function(e){return d(e,"__isOpen")},m=function(e){return d(e,"__hasChild")},g=(0,r.computed)((function(){return c.data.filter((function(e){return C(e)}))})),b=function(e){var t;return"object"===n(e)?_(e):"string"==typeof e&&(null===(t=f(e))||void 0===t?void 0:t.__isOpen)},x=function(n){return b(n)?(0,r.createVNode)(o.FolderShapeOpen,{class:(0,e.resolveClassName)("tree-icon")},null):(0,r.createVNode)(o.Folder,{class:(0,e.resolveClassName)("tree-icon")},null)},N=function(e){if("string"==typeof e)return e;if("object"===n(e)&&null!==e){if(e.__v_isVNode)return e;var t=e.node,o=e.className,i=e.text,a=e.style;return(0,r.h)(t,{class:o,style:a},i)}return null},O=function(e,r){if("object"===n(e)&&null!==e){p(r,"__isOpen",!0);var o=Array.isArray(e)?e:[e];!function(e,n,r,o,i){P(e,n,r,t({},o,i))}(v(r),i.data,i.children,i.children,o)}},j=function(e){if(e.async){var n=i.async||{},t=n.callback,r=void 0===t?null:t,o=n.cache,a=void 0===o||o;if("function"==typeof r){if(e.cached)return;Object.assign(e,{loading:!0}),r(e,(function(n){return O(n,e)})).then((function(n){return O(n,e)})).catch((function(e){return console.error("load remote data error:",e)})).finally((function(){P(v(e),i.data,i.children,Object.assign({loading:!1},a?{cached:!0}:{}))}))}else console.error("async need to set prop: asyncLoad with function wich will return promise object")}m(e)&&function(e){var n=!b(e);p(e,"__isOpen",n),n||g.value.filter((function(n){return String.prototype.startsWith.call(v(n),v(e))})).forEach((function(e){return p(e,"__isOpen",n)}))}(e)},C=function(e){return h(e)||b(e)||b(d(e,"__parentId"))},T=(0,r.ref)(),w=function(){var n;if(null===(n=T.value)||void 0===n?void 0:n.$el){var t=".".concat((0,e.resolveClassName)("tree-node")),r=".".concat((0,e.resolveClassName)("node-content"));Array.prototype.forEach.call(T.value.$el.querySelectorAll(t),(function(e){var n=e.querySelectorAll("".concat(r," span")),t=Array.prototype.slice.call(n,-1)[0];if(t){var o=e.offsetWidth-t.offsetLeft;t.style.setProperty("max-width","".concat(o,"px"))}}))}};return(0,r.onMounted)((function(){w()})),(0,r.onUpdated)((function(){w()})),{renderData:g,flatData:c,root:T,hanldeTreeNodeClick:j,handleNodeContentClick:function(e){u.includes(e.__uuid)||(u.forEach((function(e){return p({__uuid:e},"__checked",!1)})),u.length=0,p(e,"__checked",!0),u.push(e.__uuid),_(e)||j(e),a.emit("check",e,f(e.__uuid)))},handleNodeActionClick:function(e,n){e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),j(n)},getActionIcon:function(e){var n=null;return"function"==typeof i.prefixIcon&&"default"!==(n=i.prefixIcon(h(e),m(e)||e.async,b(e),"action",e))?N(n):("default"===n||"boolean"==typeof i.prefixIcon&&i.prefixIcon)&&(m(e)||e.async)?b(e)?(0,r.createVNode)(o.DownShape,null,null):(0,r.createVNode)(o.RightShape,null,null):null},getRootIcon:x,getVirtualLines:function(e){if(!i.levelLine)return null;var n=d(e,"__depth")+1;return new Array(n).fill("").map((function(e,n){return n})).filter((function(n){return function(e,n){if(h(n))return!1;var t=v(n),r="".concat(t).split("-").slice(0,e+1);if(r.join("-")===t)return!0;var o=r.pop(),i=parseInt(o,10);r.push("".concat(i+1));var a=r.join("-");return s.value.some((function(e){return e.__path===a}))}(n,e)})).filter((function(e){return e>0})).map((function(e){return(0,r.createVNode)("span",{class:"node-virtual-line",style:(t=n-e,{"--depth":t})},null);var t}))},getNodePrefixIcon:function(n){var t=null;return"function"==typeof i.prefixIcon&&"default"!==(t=i.prefixIcon(h(n),m(n)||n.async,b(n),"node_type",n))?N(t):"default"===t||"boolean"==typeof i.prefixIcon&&i.prefixIcon?h(n)||m(n)?x(n):(0,r.createVNode)(o.TextFile,{class:(0,e.resolveClassName)("tree-icon")},null):null},getLoadingIcon:function(e){return e.loading?(0,r.createVNode)(o.Spinner,null,null):""}}},render:function(){var n=this,t=this.$props,o=function(o){return(0,r.createVNode)("div",{class:j(o,n.flatData.schema)},[(0,r.createVNode)("div",{class:O(o,n.flatData.schema,t),style:N(o,t,n.flatData),onClick:function(){return n.handleNodeContentClick(o)}},[(0,r.createVNode)("span",{class:(0,e.resolveClassName)("node-action"),onClick:function(e){return n.handleNodeActionClick(e,o)}},[n.getActionIcon(o)]),(0,r.createVNode)("span",{class:(0,e.resolveClassName)("node-content")},[[n.getNodePrefixIcon(o),n.getLoadingIcon(o)],(0,r.createVNode)("span",{class:(0,e.resolveClassName)("node-text")},[m(o,t)])]),n.getVirtualLines(o)])])};return(0,r.createVNode)(u(),{class:(0,e.resolveClassName)("tree"),style:x(null,t),list:this.renderData,lineHeight:t.lineHeight,enabled:t.virtualRender,contentClassName:(0,e.resolveClassName)("container"),throttleDelay:0,ref:"root"},{default:function(e){return(e.data||[]).map(o)}})}}),T=(0,e.withInstall)(C)})(),l})()));
1
+ !function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n(require("../shared"),require("vue"),require("../icon/"),require("../virtual-render"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../icon/","../virtual-render"],n);else{var t="object"==typeof exports?n(require("../shared"),require("vue"),require("../icon/"),require("../virtual-render")):n(e["../shared"],e.vue,e["../icon/"],e["../virtual-render"]);for(var r in t)("object"==typeof exports?exports:e)[r]=t[r]}}(self,((e,n,t,r)=>(()=>{var o={8022:(e,n,t)=>{var r=t(4481),o=t(6426),i=o;i.v1=r,i.v4=o,e.exports=i},8725:e=>{for(var n=[],t=0;t<256;++t)n[t]=(t+256).toString(16).substr(1);e.exports=function(e,t){var r=t||0,o=n;return[o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]]].join("")}},9157:e=>{var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var t=new Uint8Array(16);e.exports=function(){return n(t),t}}else{var r=new Array(16);e.exports=function(){for(var e,n=0;n<16;n++)0==(3&n)&&(e=4294967296*Math.random()),r[n]=e>>>((3&n)<<3)&255;return r}}},4481:(e,n,t)=>{var r,o,i=t(9157),a=t(8725),l=0,u=0;e.exports=function(e,n,t){var c=n&&t||0,s=n||[],f=(e=e||{}).node||r,d=void 0!==e.clockseq?e.clockseq:o;if(null==f||null==d){var p=i();null==f&&(f=r=[1|p[0],p[1],p[2],p[3],p[4],p[5]]),null==d&&(d=o=16383&(p[6]<<8|p[7]))}var v=void 0!==e.msecs?e.msecs:(new Date).getTime(),y=void 0!==e.nsecs?e.nsecs:u+1,h=v-l+(y-u)/1e4;if(h<0&&void 0===e.clockseq&&(d=d+1&16383),(h<0||v>l)&&void 0===e.nsecs&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");l=v,u=y,o=d;var _=(1e4*(268435455&(v+=122192928e5))+y)%4294967296;s[c++]=_>>>24&255,s[c++]=_>>>16&255,s[c++]=_>>>8&255,s[c++]=255&_;var m=v/4294967296*1e4&268435455;s[c++]=m>>>8&255,s[c++]=255&m,s[c++]=m>>>24&15|16,s[c++]=m>>>16&255,s[c++]=d>>>8|128,s[c++]=255&d;for(var g=0;g<6;++g)s[c+g]=f[g];return n||a(s)}},6426:(e,n,t)=>{var r=t(9157),o=t(8725);e.exports=function(e,n,t){var i=n&&t||0;"string"==typeof e&&(n="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||r)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,n)for(var l=0;l<16;++l)n[i+l]=a[l];return n||o(a)}},7685:e=>{"use strict";e.exports=t},4212:n=>{"use strict";n.exports=e},3511:e=>{"use strict";e.exports=r},748:e=>{"use strict";e.exports=n}},i={};function a(e){var n=i[e];if(void 0!==n)return n.exports;var t=i[e]={exports:{}};return o[e](t,t.exports,a),t.exports}a.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return a.d(n,{a:n}),n},a.d=(e,n)=>{for(var t in n)a.o(n,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},a.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};return(()=>{"use strict";a.r(l),a.d(l,{default:()=>T});var e=a(4212);function n(e){return n="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},n(e)}function t(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var r=a(748),o=a(7685),i=a(3511),u=a.n(i),c={data:e.PropTypes.arrayOf(e.PropTypes.any).def([]),label:e.PropTypes.oneOfType([e.PropTypes.func.def(void 0),e.PropTypes.string.def("label")]),children:e.PropTypes.string.def("children"),indent:e.PropTypes.number.def(18),lineHeight:e.PropTypes.number.def(32),levelLine:e.PropTypes.oneOfType([e.PropTypes.bool.def(!1),e.PropTypes.func.def(void 0),e.PropTypes.string.def("1px dashed #c3cdd7")]).def(!1),virtualRender:e.PropTypes.bool.def(!1),prefixIcon:e.PropTypes.oneOfType([e.PropTypes.func.def((function(){})),e.PropTypes.bool.def(!1)]).def(!0),async:e.PropTypes.shape({callback:e.PropTypes.func.def(null),cache:e.PropTypes.bool.def(!0)}),offsetLeft:e.PropTypes.number.def(5)};function s(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function f(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(e){if("string"==typeof e)return s(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?s(e,n):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var d=a(8022),p=void 0,v="1px dashed #c3cdd7",y=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=e.data,a=e.children,l=[],u=0,c=new Map;function s(e,n,t,r){var i=(o||[]).find((function(n){return n.__uuid===e}));return i?i[r]:n[t]}function f(e,n){return s(e,n,"isOpen","__isOpen")}function p(e,n){return s(e,n,"checked","__checked")}function v(e){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=e.length,y=0;y<s;y++){var h=e[y];if(Array.isArray(h))v(h,r,o,i);else if("object"===n(h)&&null!==h){var _=h.__uuid||(0,d.v4)(),m=null!==i?"".concat(i,"-").concat(y):"".concat(y),g=!!(h[a]||[]).length,b=t({__depth:r,__index:y,__uuid:_,__parentId:o,__hasChild:g,__path:m,__isRoot:null===o,__order:u,__isOpen:f(_,h)&&g,__checked:p(_,h)},a,null);Object.assign(h,{__uuid:_}),c.set(_,b),u+=1,l.push(Object.assign(Object.assign({},h),t({},a,null))),Object.prototype.hasOwnProperty.call(h,a)&&v(h[a]||[],r+1,_,m)}}}return v(r||i),[l,c]},h=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],a=e[n];return"boolean"==typeof a?a?r:o:_(t,e,n,i)},_=function(e,t,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=t[r];if("string"==typeof i)return"object"===n(e)&&null!==e?(Object.prototype.hasOwnProperty.call(e,i)||console.error("cannot find node label with key ".concat(i)),e[i]):i;if("function"==typeof i){var a=i.apply(p,[e].concat(f(o)));return"string"==typeof a?a:void console.error("props label with function return value is not string, please check and return string")}},m=function(e,n){return _(e,n,"label")},g=function(e,n){return e.get(n)||{}},b=function(e,n,t){var r;return null===(r=g(e,n))||void 0===r?void 0:r[t]},x=function(e,n){return{"--level-line":h(n,"levelLine",e,v,null,["tree"]),"--lineHeight":"".concat(n.lineHeight,"px"),"--indent":"".concat(n.indent,"px"),"--offset-left":"".concat(n.offsetLeft,"px")}},N=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.schema,o=b(r,e.__uuid,"__depth");return Object.assign({"--depth":o},"function"==typeof n.levelLine?{"--level-line":h(n,"levelLine",e,v,null,["node"])}:{})},O=function(e,n,t){var r=g(n,e.__uuid)||{};return{"is-root":r.__isRoot,"bk-tree-node":!0,"is-open":r.__isOpen,"is-virtual-render":t.virtualRender,"level-line":t.levelLine}},j=function(n,r){return t({"is-checked":(g(r,n.__uuid)||{}).__checked},(0,e.resolveClassName)("node-row"),!0)},P=function(e,n,t,r){var o=e.split("-").reduce((function(e,n){var r=Number(n);return Array.isArray(e)?e[r]:e[t][r]}),n);Object.assign(o,r||{})};const C=(0,r.defineComponent)({name:"Tree",props:c,emits:["check"],setup:function(i,a){var l=y(i),u=[],c=(0,r.reactive)({data:l[0],schema:l[1],levelLineSchema:{}});(0,r.watch)((function(){return[i.data]}),(function(e){var n=y(i,e,s.value);c.data=n[0],c.schema=n[1]}),{deep:!0});var s=(0,r.computed)((function(){return Array.from(c.schema.values())})),f=function(e){return c.schema.get(e)},d=function(e,n){var t;return null===(t=f(e.__uuid))||void 0===t?void 0:t[n]},p=function(e,n,r){return c.schema.set(e.__uuid,Object.assign(Object.assign({},f(e.__uuid)),t({},n,r)))},v=function(e){return d(e,"__path")},h=function(e){return d(e,"__isRoot")},_=function(e){return d(e,"__isOpen")},m=function(e){return d(e,"__hasChild")},g=(0,r.computed)((function(){return c.data.filter((function(e){return C(e)}))})),b=function(e){var t;return"object"===n(e)?_(e):"string"==typeof e&&(null===(t=f(e))||void 0===t?void 0:t.__isOpen)},x=function(n){return b(n)?(0,r.createVNode)(o.FolderShapeOpen,{class:(0,e.resolveClassName)("tree-icon")},null):(0,r.createVNode)(o.Folder,{class:(0,e.resolveClassName)("tree-icon")},null)},N=function(e){if("string"==typeof e)return e;if("object"===n(e)&&null!==e){if(e.__v_isVNode)return e;var t=e.node,o=e.className,i=e.text,a=e.style;return(0,r.h)(t,{class:o,style:a},i)}return null},O=function(e,r){if("object"===n(e)&&null!==e){p(r,"__isOpen",!0);var o=Array.isArray(e)?e:[e];!function(e,n,r,o,i){P(e,n,r,t({},o,i))}(v(r),i.data,i.children,i.children,o)}},j=function(e){if(e.async){var n=i.async||{},t=n.callback,r=void 0===t?null:t,o=n.cache,a=void 0===o||o;"function"==typeof r?e.cached||(Object.assign(e,{loading:!0}),r(e,(function(n){return O(n,e)})).then((function(n){return O(n,e)})).catch((function(e){return console.error("load remote data error:",e)})).finally((function(){P(v(e),i.data,i.children,Object.assign({loading:!1},a?{cached:!0}:{}))}))):console.error("async need to set prop: asyncLoad with function wich will return promise object")}m(e)&&function(e){var n=!b(e);p(e,"__isOpen",n),n||g.value.filter((function(n){return String.prototype.startsWith.call(v(n),v(e))})).forEach((function(e){return p(e,"__isOpen",n)}))}(e)},C=function(e){return h(e)||b(e)||b(d(e,"__parentId"))},T=(0,r.ref)(),w=function(){var n;if(null===(n=T.value)||void 0===n?void 0:n.$el){var t=".".concat((0,e.resolveClassName)("tree-node")),r=".".concat((0,e.resolveClassName)("node-content"));Array.prototype.forEach.call(T.value.$el.querySelectorAll(t),(function(e){var n=e.querySelectorAll("".concat(r," span")),t=Array.prototype.slice.call(n,-1)[0];if(t){var o=e.offsetWidth-t.offsetLeft;t.style.setProperty("max-width","".concat(o,"px"))}}))}};return(0,r.onMounted)((function(){w()})),(0,r.onUpdated)((function(){w()})),{renderData:g,flatData:c,root:T,hanldeTreeNodeClick:j,handleNodeContentClick:function(e){u.includes(e.__uuid)||(u.forEach((function(e){return p({__uuid:e},"__checked",!1)})),u.length=0,p(e,"__checked",!0),u.push(e.__uuid),_(e)||j(e),a.emit("check",e,f(e.__uuid)))},handleNodeActionClick:function(e,n){e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),j(n)},getActionIcon:function(e){var n=null;return"function"==typeof i.prefixIcon&&"default"!==(n=i.prefixIcon(h(e),m(e)||e.async,b(e),"action",e))?N(n):("default"===n||"boolean"==typeof i.prefixIcon&&i.prefixIcon)&&(m(e)||e.async)?b(e)?(0,r.createVNode)(o.DownShape,null,null):(0,r.createVNode)(o.RightShape,null,null):null},getRootIcon:x,getVirtualLines:function(e){if(!i.levelLine)return null;var n=d(e,"__depth")+1;return new Array(n).fill("").map((function(e,n){return n})).filter((function(n){return function(e,n){if(h(n))return!1;var t=v(n),r="".concat(t).split("-").slice(0,e+1);if(r.join("-")===t)return!0;var o=r.pop(),i=parseInt(o,10);r.push("".concat(i+1));var a=r.join("-");return s.value.some((function(e){return e.__path===a}))}(n,e)})).filter((function(e){return e>0})).map((function(e){return(0,r.createVNode)("span",{class:"node-virtual-line",style:(t=n-e,{"--depth":t})},null);var t}))},getNodePrefixIcon:function(n){var t=null;return"function"==typeof i.prefixIcon&&"default"!==(t=i.prefixIcon(h(n),m(n)||n.async,b(n),"node_type",n))?N(t):"default"===t||"boolean"==typeof i.prefixIcon&&i.prefixIcon?h(n)||m(n)?x(n):(0,r.createVNode)(o.TextFile,{class:(0,e.resolveClassName)("tree-icon")},null):null},getLoadingIcon:function(e){return e.loading?(0,r.createVNode)(o.Spinner,null,null):""}}},render:function(){var n=this,t=this.$props,o=function(o){var i,a,l,u,c;return(0,r.createVNode)("div",{class:j(o,n.flatData.schema)},[(0,r.createVNode)("div",{class:O(o,n.flatData.schema,t),style:N(o,t,n.flatData),onClick:function(){return n.handleNodeContentClick(o)}},[(0,r.createVNode)("span",{class:(0,e.resolveClassName)("node-action"),onClick:function(e){return n.handleNodeActionClick(e,o)}},[n.getActionIcon(o)]),(0,r.createVNode)("span",{class:(0,e.resolveClassName)("node-content")},[[n.getNodePrefixIcon(o),n.getLoadingIcon(o)],(0,r.createVNode)("span",{class:(0,e.resolveClassName)("node-text")},[null!==(l=null===(a=(i=n.$slots).node)||void 0===a?void 0:a.call(i,o))&&void 0!==l?l:[m(o,t),null===(c=(u=n.$slots).nodeAppend)||void 0===c?void 0:c.call(u,o)]])]),n.getVirtualLines(o)])])};return(0,r.createVNode)(u(),{class:(0,e.resolveClassName)("tree"),style:x(null,t),list:this.renderData,lineHeight:t.lineHeight,enabled:t.virtualRender,contentClassName:(0,e.resolveClassName)("container"),throttleDelay:0,ref:"root"},{default:function(e){return(e.data||[]).map(o)}})}}),T=(0,e.withInstall)(C)})(),l})()));
@@ -1 +1 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("lodash"));else if("function"==typeof define&&define.amd)define(["../shared","vue","lodash"],t);else{var o="object"==typeof exports?t(require("../shared"),require("vue"),require("lodash")):t(e["../shared"],e.vue,e.lodash);for(var n in o)("object"==typeof exports?exports:e)[n]=o[n]}}(self,((e,t,o)=>(()=>{"use strict";var n={4212:t=>{t.exports=e},467:e=>{e.exports=o},748:e=>{e.exports=t}},r={};function l(e){var t=r[e];if(void 0!==t)return t.exports;var o=r[e]={exports:{}};return n[e](o,o.exports,l),o.exports}l.d=(e,t)=>{for(var o in t)l.o(t,o)&&!l.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{l.r(i),l.d(i,{default:()=>g});var e=l(4212);function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}function o(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,o){if(e){if("string"==typeof e)return t(e,o);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(e,o):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e){return n="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},n(e)}var r=l(748),a={onContentScroll:Function},s=Object.assign({list:e.PropTypes.array.def([]),enabled:e.PropTypes.bool.def(!0),lineHeight:e.PropTypes.oneOfType([e.PropTypes.number,e.PropTypes.func]).def(30),minHeight:e.PropTypes.number.def(30),height:e.PropTypes.oneOfType([e.PropTypes.string.def("100%"),e.PropTypes.number]).def("100%"),width:e.PropTypes.oneOfType([e.PropTypes.string.def("100%"),e.PropTypes.number]).def("100%"),className:e.PropTypes.oneOfType([e.PropTypes.arrayOf(e.PropTypes.string),e.PropTypes.object,e.PropTypes.arrayOf(e.PropTypes.object),e.PropTypes.string]).def(""),contentClassName:e.PropTypes.oneOfType([e.PropTypes.arrayOf(e.PropTypes.string),e.PropTypes.object,e.PropTypes.arrayOf(e.PropTypes.object),e.PropTypes.string]).def(""),contentStyle:e.PropTypes.object.def({}),scrollXName:e.PropTypes.string.def("bk-scroll-x"),scrollYName:e.PropTypes.string.def("bk-scroll-y"),groupItemCount:e.PropTypes.number.def(1),preloadItemCount:e.PropTypes.number.def(1),renderAs:e.PropTypes.string.def("div"),contentAs:e.PropTypes.string.def("div"),scrollOffsetTop:e.PropTypes.number.def(0),scrollPosition:e.PropTypes.string.def("content"),abosuteHeight:e.PropTypes.oneOfType([e.PropTypes.string.def("auto"),e.PropTypes.number]).def("auto"),throttleDelay:e.PropTypes.number.def(60)},a),u=l(467),c=void 0;function p(e,t,o,n){for(var r=0,l=0,i=0,a=0;r<e;r++){if(l+(a=n(r,[r*o,(r+1)*o]))>t){i=t-l;break}l+=a}return{startIndex:r,height:l,diffHeight:i}}function f(e,t,o,n,r){if(n){var l=n.scrollTop,i=o.scrollTop,a=o.count,s=o.groupItemCount,u=o.startIndex,c=o.endIndex,f=n.offsetHeight,d=0,y=0,v=0;if("number"==typeof e&&(d=Math.floor(l/e),y=Math.ceil(f/e)+d,v=l%e),"function"==typeof e){var m=p(a,l,s,e);d=m.startIndex>0?m.startIndex:0,v=m.diffHeight,y=p(a,f,s,e).startIndex+d+1}l===i&&d===u&&y===c||"function"==typeof t&&t(r,d,y,l,v)}}function d(e,t,o){var n=o.value,r=n.lineHeight,l=void 0===r?30:r,i=n.handleScrollCallback,a=n.pagination,s=void 0===a?{}:a,u=s.startIndex,c=s.endIndex,p=s.groupItemCount,d=s.count;f(l,i,{scrollTop:s.scrollTop,startIndex:u,endIndex:c,groupItemCount:p,count:d},t,e)}var y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60;return(0,u.throttle)((function(e,t,o){return d(e,t,o)}),e)},v=null,m=function(e,t,o){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:60;v||(v=y(n)),"function"==typeof v&&v.call(c,e,t,o)};const b={mounted:function(e,t){var o=e.parentNode,n=t.value.throttleDelay;o.addEventListener("scroll",(function(e){m(e,o,t,n)}))},updated:function(e,t){var o=e.parentNode,n=t.value.throttleDelay;m(null,o,t,n)},unbind:function(e){if(e){var t=e.parentNode;if(!t)return;t.removeEventListener("scroll",y)}}},h=(0,r.defineComponent)({name:"VirtualRender",directives:{bkVirtualRender:b},props:s,emits:["content-scroll"],setup:function(e,t){var l=this,i=e.renderAs,a=e.contentAs,s=function(e){return"string"==typeof e?[e]:"object"!==n(e)||Array.isArray(e)?e:[e]};if(!e.enabled)return function(){var o,n,l,u,c,p,f,d,y;return(0,r.h)(i,{class:s(e.className)},[null!==(l=null===(n=(o=t.slots).beforeContent)||void 0===n?void 0:n.call(o))&&void 0!==l?l:"",(0,r.h)(a,{class:s(e.contentClassName),style:e.contentStyle},[null!==(p=null===(c=(u=t.slots).default)||void 0===c?void 0:c.call(u,{data:e.list}))&&void 0!==p?p:""]),null!==(y=null===(d=(f=t.slots).afterContent)||void 0===d?void 0:d.call(f))&&void 0!==y?y:""])};var u=(0,r.ref)(null),c=(0,r.reactive)({startIndex:0,endIndex:0,scrollTop:1,translateY:0,count:0,groupItemCount:e.groupItemCount}),p=function(e,o,n,r,l){c.startIndex=o,c.endIndex=n,c.scrollTop=r,c.translateY=l,t.emit("content-scroll",[e,c])};(0,r.onMounted)((function(){(0,r.nextTick)((function(){m(e.list),b()}))})),(0,r.watch)((function(){return e.list}),(function(){d(),b()}),{deep:!0}),(0,r.watch)((function(){return e.lineHeight}),(function(){d(),b()}));var d=function(){m(e.list)},y=(0,r.ref)(0),v=(0,r.ref)(0),m=function(t){if(y.value=Math.ceil((t||[]).length/e.groupItemCount),c.count=y.value,c.startIndex=0,c.endIndex=0,c.translateY=0,c.scrollTop=0,"string"==typeof e.abosuteHeight&&"auto"===e.abosuteHeight)if("function"==typeof e.lineHeight){v.value=0;for(var o=0,n=0;n<y.value;n++){var r=e.lineHeight.call(l,n,t.slice(n*e.groupItemCount,e.groupItemCount));o+="number"==typeof r?r:0}v.value=o}else v.value=e.lineHeight*y.value;else v.value=e.abosuteHeight},b=function(){var t,o=null===(t=u.value)||void 0===t?void 0:t.parentNode;f(e.lineHeight,p,c,o,null)},h=(0,r.computed)((function(){return(e.list||[]).map((function(e,t){return Object.assign(Object.assign({},e),{$index:t})}))})),g=(0,r.computed)((function(){return h.value.slice(c.startIndex*e.groupItemCount,(c.endIndex+e.preloadItemCount)*e.groupItemCount)})),T=(0,r.computed)((function(){return"content"===e.scrollPosition?{top:"".concat(c.scrollTop+e.scrollOffsetTop,"px"),transform:"translateY(-".concat(c.translateY,"px)")}:{}})),P=(0,r.computed)((function(){return Object.assign({height:"number"==typeof e.height?"".concat(e.height,"px"):e.height,width:"number"==typeof e.width?"".concat(e.width,"px"):e.width,display:"inline-block"},"container"===e.scrollPosition?T.value:{})})),x=(0,r.computed)((function(){var t="number"==typeof e.abosuteHeight&&0===e.abosuteHeight;return{height:"".concat(v.value<e.minHeight?e.minHeight:v.value,"px"),display:t?"none":"block"}})),I=(0,r.computed)((function(){return["bk-virtual-render",e.scrollXName,e.scrollYName].concat(o(s(e.className)),["container"===e.scrollPosition?"bk-virtual-content":""])})),C=(0,r.computed)((function(){return["content"===e.scrollPosition?"bk-virtual-content":""].concat(o(s(e.contentClassName)))})),O=(0,r.resolveDirective)("bkVirtualRender"),j={lineHeight:e.lineHeight,handleScrollCallback:p,pagination:c,throttleDelay:e.throttleDelay};return function(){var o,n,l,s,c,p,f,d,y;return(0,r.h)(i||"div",{ref:u,class:I.value,style:P.value},[null!==(l=null===(n=(o=t.slots).beforeContent)||void 0===n?void 0:n.call(o))&&void 0!==l?l:"",(0,r.withDirectives)((0,r.h)(a||"div",{class:C.value,style:Object.assign(Object.assign({},T.value),e.contentStyle)},[null!==(p=null===(c=(s=t.slots).default)||void 0===c?void 0:c.call(s,{data:g.value}))&&void 0!==p?p:""]),[[O,j]]),null!==(y=null===(d=(f=t.slots).afterContent)||void 0===d?void 0:d.call(f))&&void 0!==y?y:"",(0,r.h)("div",{class:["bk-virtual-section"],style:x.value})])}}}),g=(0,e.withInstall)(h)})(),i})()));
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("lodash"));else if("function"==typeof define&&define.amd)define(["../shared","vue","lodash"],t);else{var o="object"==typeof exports?t(require("../shared"),require("vue"),require("lodash")):t(e["../shared"],e.vue,e.lodash);for(var n in o)("object"==typeof exports?exports:e)[n]=o[n]}}(self,((e,t,o)=>(()=>{"use strict";var n={4212:t=>{t.exports=e},467:e=>{e.exports=o},748:e=>{e.exports=t}},r={};function l(e){var t=r[e];if(void 0!==t)return t.exports;var o=r[e]={exports:{}};return n[e](o,o.exports,l),o.exports}l.d=(e,t)=>{for(var o in t)l.o(t,o)&&!l.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{l.r(i),l.d(i,{default:()=>g});var e=l(4212);function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}function o(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,o){if(e){if("string"==typeof e)return t(e,o);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(e,o):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e){return n="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},n(e)}var r=l(748),a={onContentScroll:Function},s=Object.assign({list:e.PropTypes.array.def([]),enabled:e.PropTypes.bool.def(!0),lineHeight:e.PropTypes.oneOfType([e.PropTypes.number,e.PropTypes.func]).def(30),minHeight:e.PropTypes.number.def(30),height:e.PropTypes.oneOfType([e.PropTypes.string.def("100%"),e.PropTypes.number]).def("100%"),width:e.PropTypes.oneOfType([e.PropTypes.string.def("100%"),e.PropTypes.number]).def("100%"),className:e.PropTypes.oneOfType([e.PropTypes.arrayOf(e.PropTypes.string),e.PropTypes.object,e.PropTypes.arrayOf(e.PropTypes.object),e.PropTypes.string]).def(""),contentClassName:e.PropTypes.oneOfType([e.PropTypes.arrayOf(e.PropTypes.string),e.PropTypes.object,e.PropTypes.arrayOf(e.PropTypes.object),e.PropTypes.string]).def(""),contentStyle:e.PropTypes.object.def({}),scrollXName:e.PropTypes.string.def("bk-scroll-x"),scrollYName:e.PropTypes.string.def("bk-scroll-y"),groupItemCount:e.PropTypes.number.def(1),preloadItemCount:e.PropTypes.number.def(1),renderAs:e.PropTypes.string.def("div"),contentAs:e.PropTypes.string.def("div"),scrollOffsetTop:e.PropTypes.number.def(0),scrollPosition:e.PropTypes.string.def("content"),abosuteHeight:e.PropTypes.oneOfType([e.PropTypes.string.def("auto"),e.PropTypes.number]).def("auto"),throttleDelay:e.PropTypes.number.def(60)},a),u=l(467),c=void 0;function p(e,t,o,n){for(var r=0,l=0,i=0,a=0;r<e;r++){if(l+(a=n(r,[r*o,(r+1)*o,"virtual"]))>t){i=t-l;break}l+=a}return{startIndex:r,height:l,diffHeight:i}}function f(e,t,o,n,r){if(n){var l=n.scrollTop,i=o.scrollTop,a=o.count,s=o.groupItemCount,u=o.startIndex,c=o.endIndex,f=n.offsetHeight,d=0,y=0,v=0;if("number"==typeof e&&(d=Math.floor(l/e),y=Math.ceil(f/e)+d,v=l%e),"function"==typeof e){var m=p(a,l,s,e);d=m.startIndex>0?m.startIndex:0,v=m.diffHeight,y=p(a,f,s,e).startIndex+d+1}l===i&&d===u&&y===c||"function"==typeof t&&t(r,d,y,l,v)}}function d(e,t,o){var n=o.value,r=n.lineHeight,l=void 0===r?30:r,i=n.handleScrollCallback,a=n.pagination,s=void 0===a?{}:a,u=s.startIndex,c=s.endIndex,p=s.groupItemCount,d=s.count;f(l,i,{scrollTop:s.scrollTop,startIndex:u,endIndex:c,groupItemCount:p,count:d},t,e)}var y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60;return(0,u.throttle)((function(e,t,o){return d(e,t,o)}),e)},v=null,m=function(e,t,o){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:60;v||(v=y(n)),"function"==typeof v&&v.call(c,e,t,o)};const b={mounted:function(e,t){var o=e.parentNode,n=t.value.throttleDelay;o.addEventListener("scroll",(function(e){m(e,o,t,n)}))},updated:function(e,t){var o=e.parentNode,n=t.value.throttleDelay;m(null,o,t,n)},unbind:function(e){if(e){var t=e.parentNode;if(!t)return;t.removeEventListener("scroll",y)}}},h=(0,r.defineComponent)({name:"VirtualRender",directives:{bkVirtualRender:b},props:s,emits:["content-scroll"],setup:function(e,t){var l=this,i=e.renderAs,a=e.contentAs,s=function(e){return"string"==typeof e?[e]:"object"!==n(e)||Array.isArray(e)?e:[e]};if(!e.enabled)return function(){var o,n,l,u,c,p,f,d,y;return(0,r.h)(i,{class:s(e.className)},[null!==(l=null===(n=(o=t.slots).beforeContent)||void 0===n?void 0:n.call(o))&&void 0!==l?l:"",(0,r.h)(a,{class:s(e.contentClassName),style:e.contentStyle},[null!==(p=null===(c=(u=t.slots).default)||void 0===c?void 0:c.call(u,{data:e.list}))&&void 0!==p?p:""]),null!==(y=null===(d=(f=t.slots).afterContent)||void 0===d?void 0:d.call(f))&&void 0!==y?y:""])};var u=(0,r.ref)(null),c=(0,r.reactive)({startIndex:0,endIndex:0,scrollTop:1,translateY:0,count:0,groupItemCount:e.groupItemCount}),p=function(e,o,n,r,l){c.startIndex=o,c.endIndex=n,c.scrollTop=r,c.translateY=l,t.emit("content-scroll",[e,c])};(0,r.onMounted)((function(){(0,r.nextTick)((function(){m(e.list),b()}))})),(0,r.watch)((function(){return e.list}),(function(){d(),b()}),{deep:!0}),(0,r.watch)((function(){return e.lineHeight}),(function(){d(),b()}));var d=function(){m(e.list)},y=(0,r.ref)(0),v=(0,r.ref)(0),m=function(t){if(y.value=Math.ceil((t||[]).length/e.groupItemCount),c.count=y.value,c.startIndex=0,c.endIndex=0,c.translateY=0,c.scrollTop=0,"string"==typeof e.abosuteHeight&&"auto"===e.abosuteHeight)if("function"==typeof e.lineHeight){v.value=0;for(var o=0,n=0;n<y.value;n++){var r=e.lineHeight.call(l,n,t.slice(n*e.groupItemCount,e.groupItemCount));o+="number"==typeof r?r:0}v.value=o}else v.value=e.lineHeight*y.value;else v.value=e.abosuteHeight},b=function(){var t,o=null===(t=u.value)||void 0===t?void 0:t.parentNode;f(e.lineHeight,p,c,o,null)},h=(0,r.computed)((function(){return(e.list||[]).map((function(e,t){return Object.assign(Object.assign({},e),{$index:t})}))})),g=(0,r.computed)((function(){return h.value.slice(c.startIndex*e.groupItemCount,(c.endIndex+e.preloadItemCount)*e.groupItemCount)})),T=(0,r.computed)((function(){return"content"===e.scrollPosition?{top:"".concat(c.scrollTop+e.scrollOffsetTop,"px"),transform:"translateY(-".concat(c.translateY,"px)")}:{}})),P=(0,r.computed)((function(){return Object.assign({height:"number"==typeof e.height?"".concat(e.height,"px"):e.height,width:"number"==typeof e.width?"".concat(e.width,"px"):e.width,display:"inline-block"},"container"===e.scrollPosition?T.value:{})})),x=(0,r.computed)((function(){var t="number"==typeof e.abosuteHeight&&0===e.abosuteHeight;return{height:"".concat(v.value<e.minHeight?e.minHeight:v.value,"px"),display:t?"none":"block"}})),I=(0,r.computed)((function(){return["bk-virtual-render",e.scrollXName,e.scrollYName].concat(o(s(e.className)),["container"===e.scrollPosition?"bk-virtual-content":""])})),C=(0,r.computed)((function(){return["content"===e.scrollPosition?"bk-virtual-content":""].concat(o(s(e.contentClassName)))})),O=(0,r.resolveDirective)("bkVirtualRender"),j={lineHeight:e.lineHeight,handleScrollCallback:p,pagination:c,throttleDelay:e.throttleDelay};return t.expose({reset:function(){d(),b()}}),function(){var o,n,l,s,c,p,f,d,y;return(0,r.h)(i||"div",{ref:u,class:I.value,style:P.value},[null!==(l=null===(n=(o=t.slots).beforeContent)||void 0===n?void 0:n.call(o))&&void 0!==l?l:"",(0,r.withDirectives)((0,r.h)(a||"div",{class:C.value,style:Object.assign(Object.assign({},T.value),e.contentStyle)},[null!==(p=null===(c=(s=t.slots).default)||void 0===c?void 0:c.call(s,{data:g.value}))&&void 0!==p?p:""]),[[O,j]]),null!==(y=null===(d=(f=t.slots).afterContent)||void 0===d?void 0:d.call(f))&&void 0!==y?y:"",(0,r.h)("div",{class:["bk-virtual-section"],style:x.value})])}}}),g=(0,e.withInstall)(h)})(),i})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkui-vue",
3
- "version": "0.0.1-beta.55",
3
+ "version": "0.0.1-beta.58",
4
4
  "workspaces": {
5
5
  "packages": [
6
6
  "packages/!(**.bak)*",
@@ -18,7 +18,6 @@
18
18
  "build:site": "vite build site --mode development",
19
19
  "build:dist": "rimraf dist && lerna run --stream --scope cli dist",
20
20
  "build:lib": "rimraf lib && lerna run --stream --scope cli lib",
21
- "lib:dev": "rimraf lib && node --inspect-brk ./node_modules/.bin/ts-node --project=./scripts/cli/tsconfig.json ./scripts/cli/index.ts lib",
22
21
  "help:release": "lerna run --stream --scope cli release",
23
22
  "release": "run-s build help:release",
24
23
  "analyze:lib": "rimraf lib && lerna run --stream --scope cli lib -- -a",
@@ -112,8 +111,16 @@
112
111
  "module": "lib/index.js",
113
112
  "typings": "lib/index.d.ts",
114
113
  "lint-staged": {
115
- "*.(vue|ts|tsx|js)": [
116
- "eslint --ext .js,.tsx,.ts,.vue --cache --fix",
114
+ "scripts/**/*.(vue|ts|tsx|js)": [
115
+ "eslint ./scripts --ext .js,.tsx,.ts --cache --fix",
116
+ "git add"
117
+ ],
118
+ "site/**/*.(vue|ts|tsx|js)": [
119
+ "eslint ./site --ext .js,.tsx,.ts,.vue --cache --fix",
120
+ "git add"
121
+ ],
122
+ "packages/**/*.(vue|ts|tsx|js)": [
123
+ "eslint ./packages --ext .js,.tsx,.ts --cache --fix",
117
124
  "git add"
118
125
  ],
119
126
  "*.(vue|scss|css|sass)": [