@uzum-tech/ui 1.5.4 → 1.5.5

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 (46) hide show
  1. package/dist/index.js +35 -20
  2. package/dist/index.prod.js +3 -3
  3. package/es/_utils/css/index.d.ts +1 -0
  4. package/es/_utils/css/index.js +1 -0
  5. package/es/_utils/css/normalize-size.d.ts +1 -0
  6. package/es/_utils/css/normalize-size.js +6 -0
  7. package/es/_utils/index.d.ts +1 -1
  8. package/es/_utils/index.js +1 -1
  9. package/es/avatar/src/Avatar.js +1 -7
  10. package/es/badge/src/Badge.d.ts +13 -0
  11. package/es/badge/src/Badge.js +5 -4
  12. package/es/badge/src/styles/index.cssr.js +5 -6
  13. package/es/badge/styles/light.d.ts +1 -0
  14. package/es/badge/styles/light.js +2 -1
  15. package/es/date-picker/src/DatePicker.d.ts +3 -0
  16. package/es/date-picker/src/DatePicker.js +2 -2
  17. package/es/date-picker/src/interface.d.ts +1 -0
  18. package/es/date-picker/src/panel/use-calendar.js +5 -2
  19. package/es/date-picker/src/panel/use-dual-calendar.js +6 -3
  20. package/es/date-picker/src/utils.d.ts +1 -1
  21. package/es/date-picker/src/utils.js +3 -2
  22. package/es/version.d.ts +1 -1
  23. package/es/version.js +1 -1
  24. package/lib/_utils/css/index.d.ts +1 -0
  25. package/lib/_utils/css/index.js +3 -1
  26. package/lib/_utils/css/normalize-size.d.ts +1 -0
  27. package/lib/_utils/css/normalize-size.js +10 -0
  28. package/lib/_utils/index.d.ts +1 -1
  29. package/lib/_utils/index.js +2 -1
  30. package/lib/avatar/src/Avatar.js +1 -7
  31. package/lib/badge/src/Badge.d.ts +13 -0
  32. package/lib/badge/src/Badge.js +4 -3
  33. package/lib/badge/src/styles/index.cssr.js +5 -6
  34. package/lib/badge/styles/light.d.ts +1 -0
  35. package/lib/badge/styles/light.js +2 -1
  36. package/lib/date-picker/src/DatePicker.d.ts +3 -0
  37. package/lib/date-picker/src/DatePicker.js +2 -2
  38. package/lib/date-picker/src/interface.d.ts +1 -0
  39. package/lib/date-picker/src/panel/use-calendar.js +5 -2
  40. package/lib/date-picker/src/panel/use-dual-calendar.js +6 -3
  41. package/lib/date-picker/src/utils.d.ts +1 -1
  42. package/lib/date-picker/src/utils.js +3 -2
  43. package/lib/version.d.ts +1 -1
  44. package/lib/version.js +1 -1
  45. package/package.json +1 -1
  46. package/web-types.json +11 -1
package/dist/index.js CHANGED
@@ -765,6 +765,12 @@
765
765
  return color.replace(/#|\(|\)|,|\s/g, "_");
766
766
  }
767
767
 
768
+ const resolveSize = (value, fallback) => {
769
+ if (value === void 0) return fallback;
770
+ value = String(value);
771
+ return /^\d+$/.test(value) ? `${value}px` : value;
772
+ };
773
+
768
774
  function ampCount(selector) {
769
775
  let cnt = 0;
770
776
  for (let i = 0; i < selector.length; ++i) {
@@ -37516,7 +37522,8 @@
37516
37522
  textColorSuccess: textQuaternary,
37517
37523
  textColorError: textQuaternary,
37518
37524
  textColorWarning: textQuaternary,
37519
- borderColor: staticWhite
37525
+ borderColor: staticWhite,
37526
+ dotSize: "12px"
37520
37527
  };
37521
37528
  };
37522
37529
  const badgeLight = {
@@ -47312,11 +47319,6 @@
47312
47319
  const getBackgroundColor = (color2) => {
47313
47320
  return props.disabled || size === "small" ? "rgba(0,0,0,0)" : color2;
47314
47321
  };
47315
- const resolveSize = (value, fallback) => {
47316
- if (value === void 0) return fallback;
47317
- value = String(value);
47318
- return /^\d+$/.test(value) ? `${value}px` : value;
47319
- };
47320
47322
  return {
47321
47323
  "--u-font-size": fontSize,
47322
47324
  "--u-font-weight": fontWeight,
@@ -47906,13 +47908,14 @@
47906
47908
  transformOrigin: "left bottom",
47907
47909
  originalTransform: "translateX(0)"
47908
47910
  })])]), cM("dot", [cB("badge-sup", `
47909
- height: 8px;
47910
- width: 8px;
47911
+ height: var(--u-dot-size);
47912
+ width: var(--u-dot-size);
47913
+ justify-content: center;
47914
+ overflow: hidden;
47911
47915
  padding: 0;
47912
- min-width: 8px;
47913
47916
  left: 100%;
47914
47917
  bottom: calc(100% - 4px);
47915
- `, [c$1("::before", "border-radius: 4px;")])]), cB("badge-sup", `
47918
+ `, [c$1("::before", "border-radius: 4px;"), c$1("img", "width: 100%")])]), cB("badge-sup", `
47916
47919
  background: var(--u-color);
47917
47920
  transition:
47918
47921
  background-color .3s var(--u-bezier),
@@ -47963,8 +47966,6 @@
47963
47966
  border-radius: 100px;
47964
47967
  `), cM("dot", [cB("badge-sup", `
47965
47968
  transform: none;
47966
- width: 12px;
47967
- height: 12px;
47968
47969
  transform: none;
47969
47970
  left: auto;
47970
47971
  right: 0;
@@ -47988,6 +47989,7 @@
47988
47989
  processing: Boolean,
47989
47990
  color: String,
47990
47991
  textColor: String,
47992
+ dotSize: [String, Number],
47991
47993
  offset: Array
47992
47994
  };
47993
47995
  var UBadge = vue.defineComponent({
@@ -48025,7 +48027,8 @@
48025
48027
  [createKey("color", type)]: color,
48026
48028
  [createKey("textColor", type)]: textColor,
48027
48029
  fontSize,
48028
- borderColor
48030
+ borderColor,
48031
+ dotSize
48029
48032
  }
48030
48033
  } = themeRef.value;
48031
48034
  return {
@@ -48035,7 +48038,8 @@
48035
48038
  "--u-bezier": cubicBezierEaseInOut,
48036
48039
  "--u-ripple-bezier": cubicBezierEaseOut,
48037
48040
  "--u-text-color": propTextColor || textColor,
48038
- "--u-border-color": borderColor
48041
+ "--u-border-color": borderColor,
48042
+ "--u-dot-size": resolveSize(props.dotSize, dotSize)
48039
48043
  };
48040
48044
  });
48041
48045
  const themeClassHandle = inlineThemeDisabled ? useThemeClass(
@@ -53664,10 +53668,11 @@
53664
53668
  }
53665
53669
  return calendarQuarters;
53666
53670
  }
53667
- function yearArray(valueTs, currentTs) {
53671
+ function yearArray(valueTs, currentTs, maxDate) {
53668
53672
  const calendarYears = [];
53669
53673
  const time1900 = new Date(START_YEAR, 0, 1);
53670
- let count = END_YEAR - START_YEAR + 1;
53674
+ const endYear = maxDate ? new Date(maxDate).getFullYear() : END_YEAR;
53675
+ let count = endYear - START_YEAR + 1;
53671
53676
  while (count--) {
53672
53677
  calendarYears.push(yearItem(getTime(addYears(time1900, count)), valueTs, currentTs));
53673
53678
  }
@@ -95010,6 +95015,7 @@
95010
95015
  const {
95011
95016
  isValueInvalidRef,
95012
95017
  isDateDisabledRef,
95018
+ maxDateRef,
95013
95019
  isDateInvalidRef,
95014
95020
  isTimeInvalidRef,
95015
95021
  isDateTimeInvalidRef,
@@ -95050,7 +95056,7 @@
95050
95056
  const {
95051
95057
  value
95052
95058
  } = props;
95053
- return yearArray(Array.isArray(value) ? null : value, nowRef.value);
95059
+ return yearArray(Array.isArray(value) ? null : value, nowRef.value, maxDateRef.value);
95054
95060
  });
95055
95061
  const quarterArrayRef = vue.computed(() => {
95056
95062
  const {
@@ -95095,6 +95101,9 @@
95095
95101
  return getTime(startOfDay(value));
95096
95102
  }
95097
95103
  function mergedIsDateDisabled(ts) {
95104
+ if (maxDateRef.value && ts > maxDateRef.value) {
95105
+ return true;
95106
+ }
95098
95107
  const {
95099
95108
  isDateDisabled: {
95100
95109
  value: isDateDisabled
@@ -95905,6 +95914,7 @@
95905
95914
  function useDualCalendar(props, type) {
95906
95915
  const {
95907
95916
  isDateDisabledRef,
95917
+ maxDateRef,
95908
95918
  isStartHourDisabledRef,
95909
95919
  isEndHourDisabledRef,
95910
95920
  isStartMinuteDisabledRef,
@@ -96014,10 +96024,10 @@
96014
96024
  return shortcuts || rangesRef.value;
96015
96025
  });
96016
96026
  const startYearArrayRef = vue.computed(() => {
96017
- return yearArray(pluckValueFromRange(props.value, "start"), nowRef.value);
96027
+ return yearArray(pluckValueFromRange(props.value, "start"), nowRef.value, maxDateRef.value);
96018
96028
  });
96019
96029
  const endYearArrayRef = vue.computed(() => {
96020
- return yearArray(pluckValueFromRange(props.value, "end"), nowRef.value);
96030
+ return yearArray(pluckValueFromRange(props.value, "end"), nowRef.value, maxDateRef.value);
96021
96031
  });
96022
96032
  const startQuarterArrayRef = vue.computed(() => {
96023
96033
  const startValue = pluckValueFromRange(props.value, "start");
@@ -96109,6 +96119,9 @@
96109
96119
  adjustCalendarTimes(false);
96110
96120
  }
96111
96121
  function mergedIsDateDisabled(ts) {
96122
+ if (maxDateRef.value && ts > maxDateRef.value) {
96123
+ return true;
96124
+ }
96112
96125
  const isDateDisabled = isDateDisabledRef.value;
96113
96126
  if (!isDateDisabled) return false;
96114
96127
  if (!Array.isArray(props.value)) return isDateDisabled(ts, "start", null);
@@ -97569,6 +97582,7 @@
97569
97582
  shortcuts: Object,
97570
97583
  defaultShortcuts: Boolean,
97571
97584
  isDateDisabled: Function,
97585
+ maxDate: Number,
97572
97586
  isTimeDisabled: Function,
97573
97587
  show: {
97574
97588
  type: Boolean,
@@ -98149,6 +98163,7 @@
98149
98163
  dateLocaleRef,
98150
98164
  firstDayOfWeekRef: vue.toRef(props, "firstDayOfWeek"),
98151
98165
  isDateDisabledRef: vue.toRef(props, "isDateDisabled"),
98166
+ maxDateRef: vue.toRef(props, "maxDate"),
98152
98167
  rangesRef: vue.toRef(props, "ranges"),
98153
98168
  timePickerPropsRef: vue.toRef(props, "timePickerProps"),
98154
98169
  closeOnSelectRef: vue.toRef(props, "closeOnSelect"),
@@ -127000,7 +127015,7 @@
127000
127015
  watermarkProps: watermarkProps
127001
127016
  });
127002
127017
 
127003
- var version = "1.5.4";
127018
+ var version = "1.5.5";
127004
127019
 
127005
127020
  function create({
127006
127021
  componentPrefix = "U",