@dataloop-ai/components 0.20.183-ds-v3.2 → 0.20.184

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.2",
3
+ "version": "0.20.184",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -69,6 +69,7 @@ body {
69
69
  --dl-color-link: #20abfa;
70
70
  --dl-color-cell-background: #fffae2;
71
71
  --dl-color-disabled-slider: #b3b3b3;
72
+ --dl-color-text-800: #101019;
72
73
  --q-color-positive: #38d079;
73
74
  --q-color-warning: #e1b75b;
74
75
 
@@ -139,6 +140,7 @@ body {
139
140
  --dl-color-link: #53b2e8;
140
141
  --dl-color-cell-background: #fffae2;
141
142
  --dl-color-disabled-slider: #64686d;
143
+ --dl-color-text-800: #ffffff;
142
144
  --q-color-positive: #3FC97F;
143
145
  --q-color-warning: #f8d29a;
144
146
 
@@ -1,71 +1,104 @@
1
1
  <template>
2
2
  <div :id="uuid" class="dl-date-time-range">
3
- <template v-if="isInputMode">
4
- <date-input
5
- :text="dateInputText"
6
- :input-style="dateInputStyle"
3
+ <date-input
4
+ :text="dateInputText"
5
+ :input-style="dateInputStyle"
6
+ :disabled="disabled"
7
+ :width="width"
8
+ >
9
+ <dl-menu
10
+ ref="dateTimeRangeMenu"
11
+ anchor="bottom middle"
12
+ self="top middle"
13
+ :offset="[0, 5]"
7
14
  :disabled="disabled"
8
- :width="width"
9
15
  >
10
- <dl-menu
11
- ref="dateTimeRangeMenu"
12
- anchor="bottom middle"
13
- self="top middle"
14
- :offset="[0, 5]"
15
- :disabled="disabled"
16
- >
17
- <date-time-range-content
18
- v-bind="dateTimeRangeContentProps"
19
- @day-type-option-click="handleDayTypeOptionClick"
20
- @month-type-option-click="handleMonthTypeOptionClick"
21
- @update-date-interval="updateDateInterval"
22
- @update-date-interval-with-auto-close="
23
- updateDateIntervalWithAutoClose
24
- "
25
- @update-from-to-date="updateFromToDate"
26
- @clear="handleClearAction"
27
- />
28
- </dl-menu>
29
- </date-input>
30
- </template>
31
- <template v-else>
32
- <date-time-range-content
33
- v-bind="dateTimeRangeContentProps"
34
- @day-type-option-click="handleDayTypeOptionClick"
35
- @month-type-option-click="handleMonthTypeOptionClick"
36
- @update-date-interval="updateDateInterval"
37
- @update-date-interval-with-auto-close="
38
- updateDateIntervalWithAutoClose
39
- "
40
- @update-from-to-date="updateFromToDate"
41
- @clear="handleClearAction"
42
- />
43
- </template>
16
+ <div class="dl-date-time-range--card">
17
+ <div
18
+ v-if="mode === 'multi'"
19
+ class="dl-date-time-range--card_sidebar"
20
+ >
21
+ <card-sidebar
22
+ v-if="typeState === 'day'"
23
+ :options="sidebarDayOptions"
24
+ :current-option="currentSidebarOption"
25
+ @click="handleDayTypeOptionClick"
26
+ />
27
+ <card-sidebar
28
+ v-else
29
+ :options="sidebarMonthOptions"
30
+ :current-option="currentSidebarOption"
31
+ @click="handleMonthTypeOptionClick"
32
+ />
33
+ </div>
34
+ <div
35
+ class="dl-date-time-range--card_content"
36
+ :style="cardContentStyles"
37
+ >
38
+ <dl-date-picker
39
+ :model-value="dateInterval"
40
+ :type="typeState"
41
+ :available-range="availableRange"
42
+ :disabled="isInputDisabled"
43
+ :normalize-calendars="normalizeCalendars"
44
+ :active-date-from="activeDateFrom"
45
+ :active-date-to="activeDateTo"
46
+ @update:model-value="
47
+ updateDateIntervalWithAutoClose
48
+ "
49
+ @update:from-to-date="updateFromToDate"
50
+ />
51
+ <dl-time-picker
52
+ v-if="showTime && typeState === 'day'"
53
+ :disabled="isInputDisabled"
54
+ :model-value="dateInterval"
55
+ @update:model-value="updateDateInterval"
56
+ />
57
+
58
+ <dl-button
59
+ size="s"
60
+ outlined
61
+ class="dl-date-time-range--button"
62
+ @click="handleClearAction"
63
+ >
64
+ <span style="text-transform: capitalize">
65
+ Clear
66
+ </span>
67
+ </dl-button>
68
+ </div>
69
+ </div>
70
+ </dl-menu>
71
+ </date-input>
44
72
  </div>
45
73
  </template>
46
74
  <script lang="ts">
75
+ import { DlTimePicker } from '../DlTimePicker'
47
76
  import { DateInterval } from '../types'
77
+ import CardSidebar from './CardSidebar.vue'
48
78
  import {
49
79
  DayTypeOption,
50
80
  DAY_SIDEBAR_OPTION,
51
81
  MonthTypeOption,
52
- MONTH_SIDEBAR_OPTION,
53
- DATETIME_RANGE_VIEW_MODE
82
+ MONTH_SIDEBAR_OPTION
54
83
  } from './types'
55
84
  import { CustomDate } from '../DlDatePicker/models/CustomDate'
85
+ import DlDatePicker from '../DlDatePicker/DlDatePicker.vue'
56
86
  import { CalendarDate } from '../DlDatePicker/models/CalendarDate'
57
87
  import DateInput from './DateInput.vue'
58
- import DateTimeRangeContent from './DateTimeRangeContent.vue'
59
88
  import { DlMenu } from '../../../essential'
89
+ import { DlButton } from '../../../basic'
60
90
  import { defineComponent, PropType } from 'vue-demi'
61
91
  import { isInRange } from '../DlDatePicker/utils'
62
92
  import { v4 } from 'uuid'
63
93
 
64
94
  export default defineComponent({
65
95
  components: {
96
+ CardSidebar,
97
+ DlDatePicker,
98
+ DlTimePicker,
66
99
  DateInput,
67
- DateTimeRangeContent,
68
- DlMenu
100
+ DlMenu,
101
+ DlButton
69
102
  },
70
103
  model: {
71
104
  prop: 'modelValue',
@@ -119,14 +152,6 @@ export default defineComponent({
119
152
  shouldClearSelectFirstOption: {
120
153
  type: Boolean,
121
154
  default: false
122
- },
123
- viewMode: {
124
- type: String as PropType<DATETIME_RANGE_VIEW_MODE>,
125
- default: DATETIME_RANGE_VIEW_MODE.input
126
- },
127
- hideClearButton: {
128
- type: Boolean,
129
- default: false
130
155
  }
131
156
  },
132
157
  emits: ['update:model-value', 'set-type', 'change'],
@@ -412,27 +437,6 @@ export default defineComponent({
412
437
  return {
413
438
  '--card-content-width': this.datePickerCardWidth
414
439
  }
415
- },
416
- isInputMode(): boolean {
417
- return this.viewMode === DATETIME_RANGE_VIEW_MODE.input
418
- },
419
- dateTimeRangeContentProps(): Record<string, any> {
420
- return {
421
- mode: this.mode,
422
- typeState: this.typeState,
423
- sidebarDayOptions: this.sidebarDayOptions,
424
- sidebarMonthOptions: this.sidebarMonthOptions,
425
- currentSidebarOption: this.currentSidebarOption,
426
- dateInterval: this.dateInterval,
427
- availableRange: this.availableRange,
428
- isInputDisabled: this.isInputDisabled,
429
- normalizeCalendars: this.normalizeCalendars,
430
- activeDateFrom: this.activeDateFrom,
431
- activeDateTo: this.activeDateTo,
432
- showTime: this.showTime,
433
- cardContentStyles: this.cardContentStyles,
434
- hideClearButton: this.hideClearButton
435
- }
436
440
  }
437
441
  },
438
442
  watch: {
@@ -512,10 +516,7 @@ export default defineComponent({
512
516
  this.typeState = value
513
517
  this.$emit('set-type', value)
514
518
  },
515
- updateDateInterval(
516
- value: DateInterval | null,
517
- skipSidebarUpdate = false
518
- ) {
519
+ updateDateInterval(value: DateInterval | null) {
519
520
  if (value === null) {
520
521
  this.dateInterval = null
521
522
  } else {
@@ -523,14 +524,6 @@ export default defineComponent({
523
524
  from: value.from,
524
525
  to: new Date(value.to)
525
526
  }
526
- // When in multi mode, update sidebar option to custom if user manually selects date
527
- if (this.mode === 'multi' && !skipSidebarUpdate) {
528
- this.currentSidebarOption =
529
- this.typeState === 'day'
530
- ? DAY_SIDEBAR_OPTION.custom
531
- : MONTH_SIDEBAR_OPTION.custom
532
- this.isInputDisabled = false
533
- }
534
527
  }
535
528
  this.$emit('update:model-value', value)
536
529
  this.$emit('change', value)
@@ -539,24 +532,16 @@ export default defineComponent({
539
532
  this.activeDateFrom = value?.from || null
540
533
  this.activeDateTo = value?.to || null
541
534
  },
542
- updateDateIntervalWithAutoClose(
543
- value: DateInterval,
544
- skipSidebarUpdate = false
545
- ) {
546
- this.updateDateInterval(value, skipSidebarUpdate)
535
+ updateDateIntervalWithAutoClose(value: DateInterval) {
536
+ this.updateDateInterval(value)
547
537
 
548
- if (
549
- this.autoClose &&
550
- this.viewMode === DATETIME_RANGE_VIEW_MODE.input
551
- ) {
538
+ if (this.autoClose) {
552
539
  const dateTimeRangeMenu = this.$refs[
553
540
  'dateTimeRangeMenu'
554
541
  ] as unknown as {
555
542
  hide: () => void
556
543
  }
557
- if (dateTimeRangeMenu) {
558
- dateTimeRangeMenu.hide()
559
- }
544
+ dateTimeRangeMenu.hide()
560
545
  }
561
546
  },
562
547
  handleDayTypeOptionClick(option: DayTypeOption) {
@@ -570,9 +555,9 @@ export default defineComponent({
570
555
 
571
556
  if (option.key === DAY_SIDEBAR_OPTION.custom_by_month) {
572
557
  this.handleTypeChange('month')
573
- this.updateDateInterval(option.value, true)
558
+ this.updateDateInterval(option.value)
574
559
  } else {
575
- this.updateDateIntervalWithAutoClose(option.value, true)
560
+ this.updateDateIntervalWithAutoClose(option.value)
576
561
  }
577
562
  },
578
563
  handleMonthTypeOptionClick(option: MonthTypeOption) {
@@ -586,9 +571,9 @@ export default defineComponent({
586
571
 
587
572
  if (option.key === MONTH_SIDEBAR_OPTION.custom_by_day) {
588
573
  this.handleTypeChange('day')
589
- this.updateDateInterval(option.value, true)
574
+ this.updateDateInterval(option.value)
590
575
  } else {
591
- this.updateDateIntervalWithAutoClose(option.value, true)
576
+ this.updateDateIntervalWithAutoClose(option.value)
592
577
  }
593
578
  }
594
579
  }
@@ -598,5 +583,25 @@ export default defineComponent({
598
583
  .dl-date-time-range {
599
584
  display: flex;
600
585
  justify-content: center;
586
+
587
+ &--card {
588
+ background-color: var(--dl-color-bg);
589
+ z-index: 1;
590
+ display: flex;
591
+ border-radius: 2px;
592
+ border-radius: 2px;
593
+ }
594
+
595
+ &--card_content {
596
+ width: var(--card-content-width);
597
+ }
598
+
599
+ &--button {
600
+ display: flex;
601
+ margin-left: auto;
602
+ width: fit-content;
603
+ margin-right: 16px;
604
+ margin-bottom: 16px;
605
+ }
601
606
  }
602
607
  </style>
@@ -40,8 +40,3 @@ export type MonthTypeOption = {
40
40
  value?: DateInterval
41
41
  disabled?: boolean
42
42
  }
43
-
44
- export enum DATETIME_RANGE_VIEW_MODE {
45
- input = 'input',
46
- inline = 'inline'
47
- }
@@ -1470,9 +1470,6 @@ export default defineComponent({
1470
1470
  &--s {
1471
1471
  height: 18px;
1472
1472
  }
1473
- &--m {
1474
- height: 26px;
1475
- }
1476
1473
  }
1477
1474
 
1478
1475
  &__input {
@@ -1521,7 +1518,6 @@ export default defineComponent({
1521
1518
  }
1522
1519
 
1523
1520
  &--m {
1524
- height: 12px;
1525
1521
  line-height: 12px;
1526
1522
  padding-top: 7px;
1527
1523
  padding-bottom: 7px;
@@ -158,18 +158,6 @@ export default defineComponent({
158
158
  },
159
159
  onSearchButtonPress(): void {
160
160
  this.$emit('search', this.modelValue)
161
- },
162
- focus(): void {
163
- const inputComponent = this.$refs.input as InstanceType<
164
- typeof DlInput
165
- >
166
- inputComponent?.focus()
167
- },
168
- blur(): void {
169
- const inputComponent = this.$refs.input as InstanceType<
170
- typeof DlInput
171
- >
172
- inputComponent?.blur()
173
161
  }
174
162
  }
175
163
  })
@@ -53,7 +53,7 @@
53
53
  </div>
54
54
  </div>
55
55
  <dl-tooltip
56
- v-if="!focused && !noTooltip"
56
+ v-if="!focused"
57
57
  border="1px solid var(--dl-color-separator)"
58
58
  background-color="dl-color-panel-background"
59
59
  color="dl-color-darker"
@@ -248,10 +248,6 @@ export default defineComponent({
248
248
  type: String,
249
249
  default: '28px'
250
250
  },
251
- noTooltip: {
252
- type: Boolean,
253
- default: false
254
- },
255
251
  omitSuggestions: {
256
252
  type: Array as PropType<string[]>,
257
253
  default: () => [] as string[]
@@ -279,7 +275,6 @@ export default defineComponent({
279
275
  'blur',
280
276
  'input',
281
277
  'search',
282
- 'status',
283
278
  'error',
284
279
  'clear'
285
280
  ],
@@ -302,7 +297,6 @@ export default defineComponent({
302
297
  defaultIcon,
303
298
  defaultIconColor,
304
299
  schema,
305
- noTooltip,
306
300
  omitSuggestions,
307
301
  operatorsOverride,
308
302
  height,
@@ -1041,35 +1035,24 @@ export default defineComponent({
1041
1035
  return status.value
1042
1036
  }
1043
1037
 
1044
- let newStatus: {
1045
- type: string
1046
- message: string
1047
- }
1048
-
1049
1038
  if (!error.value && searchQuery.value !== '') {
1050
- newStatus = {
1039
+ return {
1051
1040
  type: 'success',
1052
1041
  message: ''
1053
1042
  }
1054
1043
  }
1055
1044
 
1056
- else if (error.value === 'warning') {
1057
- newStatus = {
1045
+ if (error.value === 'warning') {
1046
+ return {
1058
1047
  type: 'warning',
1059
1048
  message: 'The query is not supported technically.'
1060
1049
  }
1061
1050
  }
1062
1051
 
1063
- else {
1064
- newStatus = {
1065
- type: 'error',
1066
- message: error.value
1067
- }
1052
+ return {
1053
+ type: 'error',
1054
+ message: error.value
1068
1055
  }
1069
-
1070
- emit('status', newStatus)
1071
-
1072
- return newStatus
1073
1056
  })
1074
1057
 
1075
1058
  const inputPlaceholder = computed<string>(() => {