@dataloop-ai/components 0.20.183-ds-v3.0 → 0.20.183-ds-v3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataloop-ai/components",
3
- "version": "0.20.183-ds-v3.0",
3
+ "version": "0.20.183-ds-v3.2",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -512,7 +512,10 @@ export default defineComponent({
512
512
  this.typeState = value
513
513
  this.$emit('set-type', value)
514
514
  },
515
- updateDateInterval(value: DateInterval | null) {
515
+ updateDateInterval(
516
+ value: DateInterval | null,
517
+ skipSidebarUpdate = false
518
+ ) {
516
519
  if (value === null) {
517
520
  this.dateInterval = null
518
521
  } else {
@@ -521,7 +524,7 @@ export default defineComponent({
521
524
  to: new Date(value.to)
522
525
  }
523
526
  // When in multi mode, update sidebar option to custom if user manually selects date
524
- if (this.mode === 'multi') {
527
+ if (this.mode === 'multi' && !skipSidebarUpdate) {
525
528
  this.currentSidebarOption =
526
529
  this.typeState === 'day'
527
530
  ? DAY_SIDEBAR_OPTION.custom
@@ -536,8 +539,11 @@ export default defineComponent({
536
539
  this.activeDateFrom = value?.from || null
537
540
  this.activeDateTo = value?.to || null
538
541
  },
539
- updateDateIntervalWithAutoClose(value: DateInterval) {
540
- this.updateDateInterval(value)
542
+ updateDateIntervalWithAutoClose(
543
+ value: DateInterval,
544
+ skipSidebarUpdate = false
545
+ ) {
546
+ this.updateDateInterval(value, skipSidebarUpdate)
541
547
 
542
548
  if (
543
549
  this.autoClose &&
@@ -564,9 +570,9 @@ export default defineComponent({
564
570
 
565
571
  if (option.key === DAY_SIDEBAR_OPTION.custom_by_month) {
566
572
  this.handleTypeChange('month')
567
- this.updateDateInterval(option.value)
573
+ this.updateDateInterval(option.value, true)
568
574
  } else {
569
- this.updateDateIntervalWithAutoClose(option.value)
575
+ this.updateDateIntervalWithAutoClose(option.value, true)
570
576
  }
571
577
  },
572
578
  handleMonthTypeOptionClick(option: MonthTypeOption) {
@@ -580,9 +586,9 @@ export default defineComponent({
580
586
 
581
587
  if (option.key === MONTH_SIDEBAR_OPTION.custom_by_day) {
582
588
  this.handleTypeChange('day')
583
- this.updateDateInterval(option.value)
589
+ this.updateDateInterval(option.value, true)
584
590
  } else {
585
- this.updateDateIntervalWithAutoClose(option.value)
591
+ this.updateDateIntervalWithAutoClose(option.value, true)
586
592
  }
587
593
  }
588
594
  }
@@ -124,7 +124,9 @@ export default defineComponent({
124
124
 
125
125
  let localScrollTarget: HTMLElement | undefined
126
126
  const rootRef: Ref<HTMLElement | null> = ref(null)
127
- const scrollSizeItem: Ref<number> = ref(40)
127
+ const scrollSizeItem: Ref<number> = ref(
128
+ virtualScrollItemSize.value || 40
129
+ )
128
130
 
129
131
  const isDefined = (v: any) => v !== undefined && v !== null
130
132