@uzum-tech/ui 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -45442,6 +45442,7 @@
45442
45442
  onSelect: [Function, Array],
45443
45443
  onBlur: [Function, Array],
45444
45444
  onFocus: [Function, Array],
45445
+ onScroll: [Function, Array],
45445
45446
  // deprecated
45446
45447
  onInput: [Function, Array]
45447
45448
  };
@@ -45539,6 +45540,11 @@
45539
45540
  call(onFocus, e);
45540
45541
  nTriggerFormFocus();
45541
45542
  }
45543
+ function doScroll(e) {
45544
+ const { onScroll } = props;
45545
+ if (onScroll)
45546
+ call(onScroll, e);
45547
+ }
45542
45548
  function handleCompositionStart() {
45543
45549
  isComposingRef.value = true;
45544
45550
  }
@@ -45587,6 +45593,9 @@
45587
45593
  canBeActivatedRef.value = true;
45588
45594
  doFocus(e);
45589
45595
  }
45596
+ function handleMenuScroll(e) {
45597
+ doScroll(e);
45598
+ }
45590
45599
  function handleBlur(e) {
45591
45600
  canBeActivatedRef.value = false;
45592
45601
  doBlur(e);
@@ -45645,6 +45654,7 @@
45645
45654
  mergedStatus: mergedStatusRef,
45646
45655
  handleClear,
45647
45656
  handleFocus,
45657
+ handleMenuScroll,
45648
45658
  handleBlur,
45649
45659
  handleInput,
45650
45660
  handleToggle,
@@ -45761,7 +45771,8 @@
45761
45771
  renderLabel: this.renderLabel,
45762
45772
  renderOption: this.renderOption,
45763
45773
  size: "medium",
45764
- onToggle: this.handleToggle
45774
+ onToggle: this.handleToggle,
45775
+ onScroll: this.handleMenuScroll
45765
45776
  }
45766
45777
  ),
45767
45778
  [
@@ -48693,6 +48704,23 @@
48693
48704
  function pluckValueFromRange(value, type) {
48694
48705
  return Array.isArray(value) ? value[type === "start" ? 0 : 1] : null;
48695
48706
  }
48707
+ function isDateItem(item) {
48708
+ return !!item;
48709
+ }
48710
+ function getMsByDateCommonItem(item) {
48711
+ if (!isDateItem(item)) return 0;
48712
+ const {
48713
+ dateObject: {
48714
+ year,
48715
+ month,
48716
+ date
48717
+ }
48718
+ } = item;
48719
+ const resultDate = /* @__PURE__ */new Date();
48720
+ resultDate.setFullYear(year, month || 0, date || 1);
48721
+ resultDate.setHours(0, 0, 0);
48722
+ return resultDate.getTime();
48723
+ }
48696
48724
 
48697
48725
  const self$10 = vars => {
48698
48726
  const {
@@ -73844,13 +73872,25 @@
73844
73872
  const isWithoutDay = vue.computed(() => withoutDayTypes.includes(type));
73845
73873
  const isMonth = vue.computed(() => monthTypes.includes(type));
73846
73874
  const isYear = vue.computed(() => type === "year");
73875
+ const updateMonth = (item) => {
73876
+ const dateItem = item;
73877
+ calendar.handleDateClick({
73878
+ ...dateItem,
73879
+ dateObject: {
73880
+ ...dateItem.dateObject,
73881
+ month: dateItem.dateObject.month || 0,
73882
+ date: 1
73883
+ },
73884
+ ts: getMsByDateCommonItem(dateItem)
73885
+ });
73886
+ };
73847
73887
  const handleMonthClick = (value, _doUpdate, item) => {
73848
73888
  calendar.onUpdateCalendarValue(value);
73849
- isMonth.value && calendar.handleDateClick(item);
73889
+ isMonth.value && updateMonth(item);
73850
73890
  };
73851
73891
  const handleYearClick = (value, _doUpdate, item) => {
73852
73892
  calendar.onUpdateCalendarValue(value);
73853
- isYear.value && calendar.handleDateClick(item);
73893
+ isYear.value && updateMonth(item);
73854
73894
  };
73855
73895
  return {
73856
73896
  ...calendar,
@@ -73980,7 +74020,7 @@
73980
74020
  const isWithoutDay = vue.computed(() => withoutDayTypes.includes(type));
73981
74021
  const isMonthRange = vue.computed(() => monthRanges.includes(type));
73982
74022
  const isYearRange = vue.computed(() => type === "yearrange");
73983
- const monthToDateItem = (value, item, isEnd = false) => {
74023
+ const monthToDateItem = (item, isEnd = false) => {
73984
74024
  const { dateObject, ...monthItem } = item;
73985
74025
  return {
73986
74026
  ...monthItem,
@@ -73994,30 +74034,30 @@
73994
74034
  startOfSpan: false,
73995
74035
  endOfSpan: isEnd,
73996
74036
  selected: isEnd,
73997
- ts: value,
74037
+ ts: getMsByDateCommonItem(item),
73998
74038
  type: "date"
73999
74039
  };
74000
74040
  };
74001
- const setMonthRange = (value, item, isEnd = false) => {
74002
- const monthItem = monthToDateItem(value, item, isEnd);
74041
+ const setMonthRange = (item, isEnd = false) => {
74042
+ const monthItem = monthToDateItem(item, isEnd);
74003
74043
  calendar.handleDateMouseEnter(monthItem);
74004
74044
  calendar.handleDateClick(monthItem);
74005
74045
  };
74006
74046
  const handleMonthStartClick = (value, _doUpdate, item) => {
74007
74047
  calendar.onUpdateStartCalendarValue(value);
74008
- isMonthRange.value && setMonthRange(value, item);
74048
+ isMonthRange.value && setMonthRange(item);
74009
74049
  };
74010
74050
  const handleMonthEndClick = (value, _doUpdate, item) => {
74011
74051
  calendar.onUpdateEndCalendarValue(value);
74012
- isMonthRange.value && setMonthRange(value, item, true);
74052
+ isMonthRange.value && setMonthRange(item, true);
74013
74053
  };
74014
74054
  const handleYearStartClick = (value, _doUpdate, item) => {
74015
74055
  calendar.onUpdateStartCalendarValue(value);
74016
- isYearRange.value && setMonthRange(value, item);
74056
+ isYearRange.value && setMonthRange(item);
74017
74057
  };
74018
74058
  const handleYearEndClick = (value, _doUpdate, item) => {
74019
74059
  calendar.onUpdateEndCalendarValue(value);
74020
- isYearRange.value && setMonthRange(value, item, true);
74060
+ isYearRange.value && setMonthRange(item, true);
74021
74061
  };
74022
74062
  return {
74023
74063
  ...calendar,
@@ -106722,7 +106762,7 @@
106722
106762
  watermarkProps: watermarkProps
106723
106763
  });
106724
106764
 
106725
- var version = "1.2.0";
106765
+ var version = "1.2.2";
106726
106766
 
106727
106767
  function create({
106728
106768
  componentPrefix = "U",