@uzum-tech/ui 2.0.5 → 2.0.7

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 (136) hide show
  1. package/dist/index.js +1183 -573
  2. package/dist/index.mjs +1183 -573
  3. package/dist/index.prod.js +2 -2
  4. package/dist/index.prod.mjs +2 -2
  5. package/es/_internal/icons/DragHandleRound.mjs +16 -0
  6. package/es/_internal/icons/index.d.ts +1 -1
  7. package/es/_internal/icons/index.mjs +1 -1
  8. package/es/components.d.ts +99 -30
  9. package/es/data-table/src/DataTable.d.ts +24 -0
  10. package/es/data-table/src/DataTable.mjs +31 -0
  11. package/es/data-table/src/HeaderButton/FilterButton.d.ts +6 -0
  12. package/es/data-table/src/HeaderButton/FilterMenu.d.ts +6 -0
  13. package/es/data-table/src/TableParts/Body.d.ts +17 -9
  14. package/es/data-table/src/TableParts/Body.mjs +81 -274
  15. package/es/data-table/src/TableParts/BodyEmpty.d.ts +3 -0
  16. package/es/data-table/src/TableParts/BodyEmpty.mjs +22 -0
  17. package/es/data-table/src/TableParts/BodyRow.d.ts +3 -0
  18. package/es/data-table/src/TableParts/BodyRow.mjs +257 -0
  19. package/es/data-table/src/TableParts/BodySkeleton.mjs +5 -2
  20. package/es/data-table/src/TableParts/Header.d.ts +6 -0
  21. package/es/data-table/src/TableParts/Header.mjs +5 -1
  22. package/es/data-table/src/TableParts/VirtualListItemWrapper.d.ts +36 -0
  23. package/es/data-table/src/TableParts/VirtualListItemWrapper.mjs +46 -0
  24. package/es/data-table/src/interface.d.ts +161 -2
  25. package/es/data-table/src/styles/index.cssr.mjs +26 -3
  26. package/es/data-table/src/use-group-header.d.ts +3 -3
  27. package/es/data-table/src/use-row-drag.d.ts +2 -0
  28. package/es/data-table/src/use-row-drag.mjs +241 -0
  29. package/es/data-table/src/use-sorter.d.ts +4 -8
  30. package/es/data-table/src/use-sorter.mjs +14 -2
  31. package/es/data-table/src/use-table-data.d.ts +11 -14
  32. package/es/data-table/src/use-table-data.mjs +4 -2
  33. package/es/data-table/src/use-table-storage.d.ts +2 -2
  34. package/es/data-table/src/use-table-storage.mjs +1 -1
  35. package/es/data-table/src/utils/column-utils.d.ts +3 -2
  36. package/es/data-table/src/utils/column-utils.mjs +9 -1
  37. package/es/data-table/src/utils/csv-utils.mjs +1 -1
  38. package/es/data-table/src/utils/flatten-rows.d.ts +2 -0
  39. package/es/data-table/src/utils/flatten-rows.mjs +33 -0
  40. package/es/data-table/src/utils/index.d.ts +1 -0
  41. package/es/data-table/src/utils/index.mjs +1 -0
  42. package/es/data-table/src/utils/resize-orchestrator-utils.d.ts +3 -5
  43. package/es/data-table/src/utils/width-utils.d.ts +2 -2
  44. package/es/data-table/styles/light.d.ts +6 -0
  45. package/es/data-table/styles/light.mjs +3 -0
  46. package/es/mapping-card/src/MappingCard.d.ts +8 -0
  47. package/es/mapping-card/src/MappingCard.mjs +3 -1
  48. package/es/mapping-card/src/MappingCardParts/Header.mjs +31 -10
  49. package/es/mapping-card/src/interface.d.ts +8 -0
  50. package/es/mapping-card/src/interface.mjs +4 -0
  51. package/es/mapping-card/src/styles/index.cssr.mjs +8 -1
  52. package/es/tree/src/Tree.d.ts +49 -24
  53. package/es/tree/src/Tree.mjs +18 -13
  54. package/es/tree/src/TreeNodeCheckbox.d.ts +4 -0
  55. package/es/tree/src/TreeNodeSwitcher.mjs +24 -26
  56. package/es/tree/src/styles/index.cssr.mjs +11 -8
  57. package/es/tree/styles/light.d.ts +4 -0
  58. package/es/tree/styles/light.mjs +2 -0
  59. package/es/tree-select/index.d.ts +1 -1
  60. package/es/tree-select/src/TreeSelect.d.ts +43 -16
  61. package/es/tree-select/src/TreeSelect.mjs +65 -35
  62. package/es/tree-select/src/interface.d.ts +6 -1
  63. package/es/tree-select/src/scroll-option-end.d.ts +3 -0
  64. package/es/tree-select/src/scroll-option-end.mjs +28 -0
  65. package/es/tree-select/styles/light.d.ts +2 -0
  66. package/es/version.d.ts +1 -1
  67. package/es/version.mjs +1 -1
  68. package/lib/_internal/icons/DragHandleRound.js +10 -0
  69. package/lib/_internal/icons/index.d.ts +1 -1
  70. package/lib/_internal/icons/index.js +4 -4
  71. package/lib/components.d.ts +99 -30
  72. package/lib/data-table/src/DataTable.d.ts +24 -0
  73. package/lib/data-table/src/DataTable.js +19 -1
  74. package/lib/data-table/src/HeaderButton/FilterButton.d.ts +6 -0
  75. package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +6 -0
  76. package/lib/data-table/src/TableParts/Body.d.ts +18 -10
  77. package/lib/data-table/src/TableParts/Body.js +65 -237
  78. package/lib/data-table/src/TableParts/BodyEmpty.d.ts +3 -0
  79. package/lib/data-table/src/TableParts/BodyEmpty.js +15 -0
  80. package/lib/data-table/src/TableParts/BodyRow.d.ts +3 -0
  81. package/lib/data-table/src/TableParts/BodyRow.js +210 -0
  82. package/lib/data-table/src/TableParts/BodySkeleton.js +8 -2
  83. package/lib/data-table/src/TableParts/Header.d.ts +6 -0
  84. package/lib/data-table/src/TableParts/Header.js +6 -0
  85. package/lib/data-table/src/TableParts/VirtualListItemWrapper.d.ts +36 -0
  86. package/lib/data-table/src/TableParts/VirtualListItemWrapper.js +29 -0
  87. package/lib/data-table/src/interface.d.ts +161 -2
  88. package/lib/data-table/src/styles/index.cssr.js +26 -3
  89. package/lib/data-table/src/use-group-header.d.ts +3 -3
  90. package/lib/data-table/src/use-row-drag.d.ts +2 -0
  91. package/lib/data-table/src/use-row-drag.js +270 -0
  92. package/lib/data-table/src/use-sorter.d.ts +4 -8
  93. package/lib/data-table/src/use-sorter.js +14 -0
  94. package/lib/data-table/src/use-table-data.d.ts +11 -14
  95. package/lib/data-table/src/use-table-data.js +5 -1
  96. package/lib/data-table/src/use-table-storage.d.ts +2 -2
  97. package/lib/data-table/src/use-table-storage.js +1 -0
  98. package/lib/data-table/src/utils/column-utils.d.ts +3 -2
  99. package/lib/data-table/src/utils/column-utils.js +11 -2
  100. package/lib/data-table/src/utils/csv-utils.js +1 -0
  101. package/lib/data-table/src/utils/flatten-rows.d.ts +2 -0
  102. package/lib/data-table/src/utils/flatten-rows.js +35 -0
  103. package/lib/data-table/src/utils/index.d.ts +1 -0
  104. package/lib/data-table/src/utils/index.js +1 -0
  105. package/lib/data-table/src/utils/resize-orchestrator-utils.d.ts +3 -5
  106. package/lib/data-table/src/utils/width-utils.d.ts +2 -2
  107. package/lib/data-table/styles/light.d.ts +6 -0
  108. package/lib/data-table/styles/light.js +3 -0
  109. package/lib/mapping-card/src/MappingCard.d.ts +8 -0
  110. package/lib/mapping-card/src/MappingCard.js +5 -1
  111. package/lib/mapping-card/src/MappingCardParts/Header.js +29 -5
  112. package/lib/mapping-card/src/interface.d.ts +8 -0
  113. package/lib/mapping-card/src/interface.js +4 -0
  114. package/lib/mapping-card/src/styles/index.cssr.js +8 -1
  115. package/lib/tree/src/Tree.d.ts +49 -24
  116. package/lib/tree/src/Tree.js +16 -15
  117. package/lib/tree/src/TreeNodeCheckbox.d.ts +4 -0
  118. package/lib/tree/src/TreeNodeSwitcher.js +11 -14
  119. package/lib/tree/src/styles/index.cssr.js +11 -8
  120. package/lib/tree/styles/light.d.ts +4 -0
  121. package/lib/tree/styles/light.js +2 -0
  122. package/lib/tree-select/index.d.ts +1 -1
  123. package/lib/tree-select/src/TreeSelect.d.ts +43 -16
  124. package/lib/tree-select/src/TreeSelect.js +66 -40
  125. package/lib/tree-select/src/interface.d.ts +6 -1
  126. package/lib/tree-select/src/scroll-option-end.d.ts +3 -0
  127. package/lib/tree-select/src/scroll-option-end.js +30 -0
  128. package/lib/tree-select/styles/light.d.ts +2 -0
  129. package/lib/version.d.ts +1 -1
  130. package/lib/version.js +1 -1
  131. package/package.json +2 -2
  132. package/web-types.json +21 -1
  133. package/es/_internal/icons/Switcher.mjs +0 -12
  134. package/lib/_internal/icons/Switcher.js +0 -10
  135. /package/es/_internal/icons/{Switcher.d.ts → DragHandleRound.d.ts} +0 -0
  136. /package/lib/_internal/icons/{Switcher.d.ts → DragHandleRound.d.ts} +0 -0
@@ -19,6 +19,7 @@ const Tree_1 = require("../../tree/src/Tree");
19
19
  const utils_1 = require("../../tree/src/utils");
20
20
  const styles_1 = require("../styles");
21
21
  const interface_1 = require("./interface");
22
+ const scroll_option_end_1 = require("./scroll-option-end");
22
23
  const index_cssr_1 = __importDefault(require("./styles/index.cssr"));
23
24
  const utils_2 = require("./utils");
24
25
  exports.treeSelectProps = Object.assign(Object.assign(Object.assign(Object.assign({}, _mixins_1.useTheme.props), { bordered: {
@@ -54,7 +55,7 @@ exports.treeSelectProps = Object.assign(Object.assign(Object.assign(Object.assig
54
55
  }, size: String, value: [String, Number, Array], to: _utils_1.useAdjustedTo.propTo, menuProps: Object, virtualScroll: {
55
56
  type: Boolean,
56
57
  default: true
57
- }, status: String, renderTag: Function }), Tree_1.treeSharedProps), { renderLabel: Function, renderPrefix: Function, renderSuffix: Function, nodeProps: Function, onBlur: Function, onFocus: Function, onLoad: Function, onUpdateShow: [Function, Array], onUpdateValue: [Function, Array], 'onUpdate:value': [Function, Array], 'onUpdate:show': [Function, Array],
58
+ }, status: String, renderTag: Function }), Tree_1.treeSharedProps), { renderLabel: Function, renderPrefix: Function, renderSuffix: Function, nodeProps: Function, onBlur: Function, onFocus: Function, onScroll: [Function, Array], onScrollOptionEnd: [Function, Array], onLoad: Function, onUpdateShow: [Function, Array], onUpdateValue: [Function, Array], 'onUpdate:value': [Function, Array], 'onUpdate:show': [Function, Array],
58
59
  /**
59
60
  * @deprecated
60
61
  */
@@ -117,6 +118,7 @@ exports.default = (0, vue_1.defineComponent)({
117
118
  const controlledExpandedKeysRef = (0, vue_1.toRef)(props, 'expandedKeys');
118
119
  const mergedExpandedKeysRef = (0, vooks_1.useMergedState)(controlledExpandedKeysRef, uncontrolledExpandedKeysRef);
119
120
  const focusedRef = (0, vue_1.ref)(false);
121
+ let visibleRootEndKeys = new Set();
120
122
  const mergedPlaceholderRef = (0, vue_1.computed)(() => {
121
123
  const { placeholder } = props;
122
124
  if (placeholder !== undefined)
@@ -232,17 +234,17 @@ exports.default = (0, vue_1.defineComponent)({
232
234
  }
233
235
  uncontrolledExpandedKeysRef.value = keys;
234
236
  }
235
- function doFocus(e) {
237
+ function doFocus(event) {
236
238
  const { onFocus } = props;
237
239
  if (onFocus)
238
- onFocus(e);
240
+ onFocus(event);
239
241
  triggerFormFocus();
240
242
  }
241
- function doBlur(e) {
243
+ function doBlur(event) {
242
244
  closeMenu();
243
245
  const { onBlur } = props;
244
246
  if (onBlur)
245
- onBlur(e);
247
+ onBlur(event);
246
248
  triggerFormBlur();
247
249
  }
248
250
  function closeMenu() {
@@ -259,11 +261,12 @@ exports.default = (0, vue_1.defineComponent)({
259
261
  }
260
262
  function handleMenuLeave() {
261
263
  patternRef.value = '';
264
+ visibleRootEndKeys = new Set();
262
265
  }
263
- function handleMenuClickoutside(e) {
266
+ function handleMenuClickoutside(event) {
264
267
  var _a;
265
268
  if (mergedShowRef.value) {
266
- if (!((_a = triggerInstRef.value) === null || _a === void 0 ? void 0 : _a.$el.contains((0, seemly_1.getPreciseEventTarget)(e)))) {
269
+ if (!((_a = triggerInstRef.value) === null || _a === void 0 ? void 0 : _a.$el.contains((0, seemly_1.getPreciseEventTarget)(event)))) {
267
270
  // outside select, don't need to return focus
268
271
  closeMenu();
269
272
  }
@@ -316,40 +319,40 @@ exports.default = (0, vue_1.defineComponent)({
316
319
  doUpdateIndeterminateKeys(keys, getOptionsByKeys(keys));
317
320
  }
318
321
  }
319
- function handleTriggerFocus(e) {
322
+ function handleTriggerFocus(event) {
320
323
  var _a;
321
- if ((_a = menuElRef.value) === null || _a === void 0 ? void 0 : _a.contains(e.relatedTarget))
324
+ if ((_a = menuElRef.value) === null || _a === void 0 ? void 0 : _a.contains(event.relatedTarget))
322
325
  return;
323
326
  focusedRef.value = true;
324
- doFocus(e);
327
+ doFocus(event);
325
328
  }
326
- function handleTriggerBlur(e) {
329
+ function handleTriggerBlur(event) {
327
330
  var _a;
328
- if ((_a = menuElRef.value) === null || _a === void 0 ? void 0 : _a.contains(e.relatedTarget))
331
+ if ((_a = menuElRef.value) === null || _a === void 0 ? void 0 : _a.contains(event.relatedTarget))
329
332
  return;
330
333
  focusedRef.value = false;
331
- doBlur(e);
334
+ doBlur(event);
332
335
  }
333
- function handleMenuFocusin(e) {
336
+ function handleMenuFocusin(event) {
334
337
  var _a, _b, _c;
335
- if (((_a = menuElRef.value) === null || _a === void 0 ? void 0 : _a.contains(e.relatedTarget))
336
- || ((_c = (_b = triggerInstRef.value) === null || _b === void 0 ? void 0 : _b.$el) === null || _c === void 0 ? void 0 : _c.contains(e.relatedTarget))) {
338
+ if (((_a = menuElRef.value) === null || _a === void 0 ? void 0 : _a.contains(event.relatedTarget))
339
+ || ((_c = (_b = triggerInstRef.value) === null || _b === void 0 ? void 0 : _b.$el) === null || _c === void 0 ? void 0 : _c.contains(event.relatedTarget))) {
337
340
  return;
338
341
  }
339
342
  focusedRef.value = true;
340
- doFocus(e);
343
+ doFocus(event);
341
344
  }
342
- function handleMenuFocusout(e) {
345
+ function handleMenuFocusout(event) {
343
346
  var _a, _b, _c;
344
- if (((_a = menuElRef.value) === null || _a === void 0 ? void 0 : _a.contains(e.relatedTarget))
345
- || ((_c = (_b = triggerInstRef.value) === null || _b === void 0 ? void 0 : _b.$el) === null || _c === void 0 ? void 0 : _c.contains(e.relatedTarget))) {
347
+ if (((_a = menuElRef.value) === null || _a === void 0 ? void 0 : _a.contains(event.relatedTarget))
348
+ || ((_c = (_b = triggerInstRef.value) === null || _b === void 0 ? void 0 : _b.$el) === null || _c === void 0 ? void 0 : _c.contains(event.relatedTarget))) {
346
349
  return;
347
350
  }
348
351
  focusedRef.value = false;
349
- doBlur(e);
352
+ doBlur(event);
350
353
  }
351
- function handleClear(e) {
352
- e.stopPropagation();
354
+ function handleClear(event) {
355
+ event.stopPropagation();
353
356
  const { multiple } = props;
354
357
  if (!multiple && props.filterable) {
355
358
  closeMenu();
@@ -399,20 +402,20 @@ exports.default = (0, vue_1.defineComponent)({
399
402
  }
400
403
  }
401
404
  }
402
- function handlePatternInput(e) {
403
- const { value } = e.target;
405
+ function handlePatternInput(event) {
406
+ const { value } = event.target;
404
407
  patternRef.value = value;
405
408
  }
406
- function treeHandleKeydown(e) {
409
+ function treeHandleKeydown(event) {
407
410
  const { value: treeInst } = treeInstRef;
408
411
  if (treeInst) {
409
- treeInst.handleKeydown(e);
412
+ treeInst.handleKeydown(event);
410
413
  }
411
414
  }
412
- function handleKeydown(e) {
413
- if (e.key === 'Enter') {
415
+ function handleKeydown(event) {
416
+ if (event.key === 'Enter') {
414
417
  if (mergedShowRef.value) {
415
- treeHandleKeydown(e);
418
+ treeHandleKeydown(event);
416
419
  if (!props.multiple) {
417
420
  closeMenu();
418
421
  focusSelection();
@@ -421,20 +424,20 @@ exports.default = (0, vue_1.defineComponent)({
421
424
  else {
422
425
  openMenu();
423
426
  }
424
- e.preventDefault();
427
+ event.preventDefault();
425
428
  }
426
- else if (e.key === 'Escape') {
429
+ else if (event.key === 'Escape') {
427
430
  if (mergedShowRef.value) {
428
- (0, _utils_1.markEventEffectPerformed)(e);
431
+ (0, _utils_1.markEventEffectPerformed)(event);
429
432
  closeMenu();
430
433
  focusSelection();
431
434
  }
432
435
  }
433
436
  else {
434
437
  if (mergedShowRef.value) {
435
- treeHandleKeydown(e);
438
+ treeHandleKeydown(event);
436
439
  }
437
- else if (e.key === 'ArrowDown') {
440
+ else if (event.key === 'ArrowDown') {
438
441
  openMenu();
439
442
  }
440
443
  }
@@ -443,11 +446,33 @@ exports.default = (0, vue_1.defineComponent)({
443
446
  closeMenu();
444
447
  focusSelection();
445
448
  }
446
- function handleMenuMousedown(e) {
449
+ function handleMenuMousedown(event) {
447
450
  // If there's an action slot later, we need to check if mousedown happens
448
451
  // in action panel
449
- if (!(0, seemly_1.happensIn)(e, 'action'))
450
- e.preventDefault();
452
+ if (!(0, seemly_1.happensIn)(event, 'action'))
453
+ event.preventDefault();
454
+ }
455
+ function doScroll(event) {
456
+ const { onScroll } = props;
457
+ if (onScroll)
458
+ (0, _utils_1.call)(onScroll, event);
459
+ }
460
+ function doScrollOptionEnd(option, event) {
461
+ props.onScrollOptionEnd && (0, _utils_1.call)(props.onScrollOptionEnd, option, event);
462
+ }
463
+ function handleTreeScroll(event) {
464
+ doScroll(event);
465
+ if (!props.onScrollOptionEnd)
466
+ return;
467
+ const scrollElement = (event.currentTarget
468
+ || event.target);
469
+ if (!scrollElement)
470
+ return;
471
+ const { reachedOptions, visibleKeys } = (0, scroll_option_end_1.scanReachedRootOptions)(scrollElement, dataTreeMateRef.value.treeNodes, mergedExpandedKeysRef.value, visibleRootEndKeys);
472
+ visibleRootEndKeys = visibleKeys;
473
+ for (const reachedOption of reachedOptions) {
474
+ doScrollOptionEnd(reachedOption, event);
475
+ }
451
476
  }
452
477
  const selectionRenderTagRef = (0, vue_1.computed)(() => {
453
478
  const { renderTag } = props;
@@ -556,7 +581,8 @@ exports.default = (0, vue_1.defineComponent)({
556
581
  handlePatternInput,
557
582
  handleKeydown,
558
583
  handleTabOut,
559
- handleMenuMousedown, mergedTheme: themeRef, cssVars: inlineThemeDisabled ? undefined : cssVarsRef, themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass, onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender });
584
+ handleMenuMousedown,
585
+ handleTreeScroll, mergedTheme: themeRef, cssVars: inlineThemeDisabled ? undefined : cssVarsRef, themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass, onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender });
560
586
  },
561
587
  render() {
562
588
  const { mergedTheme, mergedClsPrefix, $slots } = this;
@@ -586,7 +612,7 @@ exports.default = (0, vue_1.defineComponent)({
586
612
  ], tabindex: 0, onMousedown: this.handleMenuMousedown, onKeydown: this.handleKeydown, onFocusin: this.handleMenuFocusin, onFocusout: this.handleMenuFocusout }),
587
613
  (0, vue_1.h)(tree_1.UTree, { ref: "treeInstRef", blockLine: true, allowCheckingNotLoaded: this.allowCheckingNotLoaded, showIrrelevantNodes: false, animated: false, pattern: this.pattern, filter: this.mergedFilter, data: options, cancelable: multiple, labelField: this.labelField, keyField: this.keyField, disabledField: this.disabledField, childrenField: this.childrenField, theme: mergedTheme.peers.Tree, themeOverrides: mergedTheme.peerOverrides.Tree, defaultExpandAll: this.defaultExpandAll, defaultExpandedKeys: this.defaultExpandedKeys, expandedKeys: this.mergedExpandedKeys, checkedKeys: this.treeCheckedKeys, selectedKeys: this.treeSelectedKeys, checkable: checkable, checkStrategy: this.checkStrategy, cascade: this.mergedCascade, leafOnly: this.leafOnly, multiple: this.multiple, renderLabel: this.renderLabel, renderPrefix: this.renderPrefix, renderSuffix: this.renderSuffix, renderSwitcherIcon: this.renderSwitcherIcon, nodeProps: this.nodeProps, virtualScroll: this.consistentMenuWidth && this.virtualScroll, internalTreeSelect: true, internalUnifySelectCheck: true, internalScrollable: true, internalScrollablePadding: this.menuPadding, internalFocusable: false, internalCheckboxFocusable: false, internalRenderEmpty: () => ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-tree-select-menu__empty` }, (0, _utils_1.resolveSlot)($slots.empty, () => [
588
614
  (0, vue_1.h)(empty_1.UEmpty, { theme: mergedTheme.peers.Empty, themeOverrides: mergedTheme.peerOverrides.Empty })
589
- ]))), onLoad: this.onLoad, onUpdateCheckedKeys: this.handleUpdateCheckedKeys, onUpdateIndeterminateKeys: this.handleUpdateIndeterminateKeys, onUpdateExpandedKeys: this.doUpdateExpandedKeys }),
615
+ ]))), onLoad: this.onLoad, onUpdateCheckedKeys: this.handleUpdateCheckedKeys, onUpdateIndeterminateKeys: this.handleUpdateIndeterminateKeys, onUpdateExpandedKeys: this.doUpdateExpandedKeys, onScroll: this.handleTreeScroll }),
590
616
  (0, _utils_1.resolveWrappedSlot)($slots.action, (children) => {
591
617
  return children ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-tree-select-menu__action`, "data-action": true }, children)) : null;
592
618
  }),
@@ -1,4 +1,4 @@
1
- import type { TreeMate, TreeNode } from 'treemate';
1
+ import type { Key, TreeMate, TreeNode } from 'treemate';
2
2
  import type { HTMLAttributes, Ref, VNodeChild } from 'vue';
3
3
  import type { TreeOption, TreeOptionBase } from '../../tree/src/interface';
4
4
  export type TreeSelectOption = Omit<TreeOptionBase, 'checkboxDisabled' | 'isLeaf' | 'children'> & {
@@ -28,6 +28,11 @@ export type OnUpdateValueImpl = (value: string | number | (string | number) | st
28
28
  }) => void;
29
29
  export type OnUpdateIndeterminateKeysImpl = (value: string | number | (string | number) | string[] | number[] | Array<string | number> | null, option: TreeSelectOption | null | Array<TreeSelectOption | null>) => void;
30
30
  export type Value = string | number | Array<string | number> | null;
31
+ export type OnScrollOptionEnd = (option: TreeSelectOption, event: Event) => void;
32
+ export interface ScrollOptionEndScanResult {
33
+ reachedOptions: TreeSelectOption[];
34
+ visibleKeys: Set<Key>;
35
+ }
31
36
  export interface TreeSelectInjection {
32
37
  pendingNodeKeyRef: Ref<string | number | null>;
33
38
  dataTreeMate: Ref<TreeMate<TreeOption>>;
@@ -0,0 +1,3 @@
1
+ import type { Key } from '../../tree/src/interface';
2
+ import type { ScrollOptionEndScanResult, TreeSelectTmNode } from './interface';
3
+ export declare function scanReachedRootOptions(scrollElement: HTMLElement, rootNodes: TreeSelectTmNode[], expandedKeys: Key[] | undefined, previousVisibleKeys: Set<Key>): ScrollOptionEndScanResult;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.scanReachedRootOptions = scanReachedRootOptions;
4
+ const _utils_1 = require("../../_utils");
5
+ function isVerticallyVisibleWithin(element, containerRect) {
6
+ const elementRect = element.getBoundingClientRect();
7
+ return (elementRect.top < containerRect.bottom
8
+ && elementRect.bottom > containerRect.top);
9
+ }
10
+ function scanReachedRootOptions(scrollElement, rootNodes, expandedKeys, previousVisibleKeys) {
11
+ const containerRect = scrollElement.getBoundingClientRect();
12
+ const visibleKeys = new Set();
13
+ const reachedOptions = [];
14
+ for (const rootNode of rootNodes) {
15
+ const { children } = rootNode;
16
+ if (!(children === null || children === void 0 ? void 0 : children.length) || !(expandedKeys === null || expandedKeys === void 0 ? void 0 : expandedKeys.includes(rootNode.key)))
17
+ continue;
18
+ const lastChild = children[children.length - 1];
19
+ const lastChildElement = scrollElement.querySelector(`[data-key="${(0, _utils_1.createDataKey)(lastChild.key)}"]`);
20
+ const isHiddenOrMissing = !lastChildElement
21
+ || !isVerticallyVisibleWithin(lastChildElement, containerRect);
22
+ if (isHiddenOrMissing)
23
+ continue;
24
+ visibleKeys.add(rootNode.key);
25
+ if (!previousVisibleKeys.has(rootNode.key)) {
26
+ reachedOptions.push(rootNode.rawNode);
27
+ }
28
+ }
29
+ return { reachedOptions, visibleKeys };
30
+ }
@@ -30,6 +30,8 @@ declare const treeSelectLight: import("../../_mixins/use-theme").Theme<"TreeSele
30
30
  nodeColorPressed: string;
31
31
  nodeColorActive: string;
32
32
  arrowColor: string;
33
+ switcherColor: string;
34
+ switcherSize: string;
33
35
  nodeTextColor: string;
34
36
  nodeTextColorDisabled: string;
35
37
  loadingColor: string;
package/lib/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "2.0.5";
1
+ declare const _default: "2.0.7";
2
2
  export default _default;
package/lib/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = '2.0.5';
3
+ exports.default = '2.0.7';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uzum-tech/ui",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "description": "A Vue 3 Component Library. Fairly Complete, Theme Customizable, Uses TypeScript, Fast",
5
5
  "author": {
6
6
  "name": "KapitalLab",
@@ -59,7 +59,7 @@
59
59
  "build:themes": "tsc -b --force themes/tusimple/tsconfig.esm.json && tsc -b --force themes/tusimple/tsconfig.cjs.json",
60
60
  "build:site": "bash ./scripts/pre-build-site/pre-build-site.sh && NODE_ENV=production NODE_OPTIONS=--max-old-space-size=4096 vite build && bash ./scripts/post-build-site/post-build-site.sh",
61
61
  "clean": "rimraf site lib es dist node_modules/@uzum-tech/ui themes/tusimple/es themes/tusimple/lib",
62
- "release:package": "pnpm run test && pnpm run build:package && npm publish --no-git-checks",
62
+ "release:package": "npm login && pnpm install && pnpm run test && pnpm run build:package && npm publish --no-git-checks",
63
63
  "release:changelog": "tsx scripts/release-changelog.ts",
64
64
  "lint": "pnpm run lint:code && pnpm run lint:type",
65
65
  "lint:type": "pnpm run lint:src-type && pnpm run lint:demo-type",
package/web-types.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "framework": "vue",
4
4
  "name": "@uzum-tech/ui",
5
- "version": "2.0.5",
5
+ "version": "2.0.7",
6
6
  "js-types-syntax": "typescript",
7
7
  "contributions": {
8
8
  "html": {
@@ -15890,6 +15890,26 @@
15890
15890
  "since": "2.27.0"
15891
15891
  }
15892
15892
  },
15893
+ {
15894
+ "name": "scroll",
15895
+ "doc-url": "https://uzum-ui.kapitalbank.uz/en-US/os-theme/components/tree-select",
15896
+ "type": "(e: Event) => void",
15897
+ "description": "Callback fired on every scroll of the options menu. Useful for loading options asynchronously.",
15898
+ "default": "undefined",
15899
+ "description-sections": {
15900
+ "since": "2.0.7"
15901
+ }
15902
+ },
15903
+ {
15904
+ "name": "scroll-option-end",
15905
+ "doc-url": "https://uzum-ui.kapitalbank.uz/en-US/os-theme/components/tree-select",
15906
+ "type": "(option: TreeSelectOption, e: Event) => void",
15907
+ "description": "Callback fired when the last child of a top-level (root) expanded branch becomes visible in the menu. Called per root branch with that root's option.",
15908
+ "default": "undefined",
15909
+ "description-sections": {
15910
+ "since": "2.0.7"
15911
+ }
15912
+ },
15893
15913
  {
15894
15914
  "name": "update:expanded-keys",
15895
15915
  "doc-url": "https://uzum-ui.kapitalbank.uz/en-US/os-theme/components/tree-select",
@@ -1,12 +0,0 @@
1
- import { defineComponent, h } from 'vue';
2
- export default defineComponent({
3
- name: 'Switcher',
4
- render() {
5
- return h("svg", {
6
- xmlns: "http://www.w3.org/2000/svg",
7
- viewBox: "0 0 32 32"
8
- }, h("path", {
9
- d: "M12 8l10 8l-10 8z"
10
- }));
11
- }
12
- });
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const vue_1 = require("vue");
4
- exports.default = (0, vue_1.defineComponent)({
5
- name: 'Switcher',
6
- render() {
7
- return ((0, vue_1.h)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32" },
8
- (0, vue_1.h)("path", { d: "M12 8l10 8l-10 8z" })));
9
- }
10
- });