@dataloop-ai/components 0.18.142 → 0.18.144

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.18.142",
3
+ "version": "0.18.144",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -216,7 +216,7 @@ export default defineComponent({
216
216
  }
217
217
  },
218
218
  contentStyle(): Record<string, any> {
219
- return {
219
+ const styles: Record<string, any> = {
220
220
  'padding-top':
221
221
  this.hasHeader && this.headerHeight
222
222
  ? this.headerHeight
@@ -226,6 +226,15 @@ export default defineComponent({
226
226
  ? this.footerHeight
227
227
  : 0 + 'px'
228
228
  }
229
+
230
+ if (this.isEmpty) {
231
+ styles['display'] = 'flex'
232
+ styles['justify-content'] = 'center'
233
+ styles['height'] = '100%'
234
+ styles['max-height'] = '100%'
235
+ }
236
+
237
+ return styles
229
238
  },
230
239
  position(): 'left' | 'right' {
231
240
  return this.direction === 'right' ? 'left' : 'right'
@@ -196,7 +196,11 @@ export default defineComponent({
196
196
  if (this.disabled) return
197
197
  const valueToUse = value
198
198
  if (value && moment(value.from).isSame(value.to)) {
199
- valueToUse.to = moment(value.from).endOf('day').toDate()
199
+ if (this.type === 'day')
200
+ valueToUse.to = moment(value.from).endOf('day').toDate()
201
+ else {
202
+ valueToUse.to = moment(value.from).endOf('month').toDate()
203
+ }
200
204
  }
201
205
  this.$emit('update:model-value', valueToUse)
202
206
  this.$emit('change', valueToUse)
@@ -225,17 +225,17 @@ export default defineComponent({
225
225
  const lastMonth = CustomDate.subtract(1, 'months')
226
226
  .startOf('month')
227
227
  .toDate()
228
-
228
+ const today = CustomDate.endOf('day').toDate()
229
229
  return [
230
230
  {
231
231
  title: 'this month',
232
232
  key: MONTH_SIDEBAR_OPTION.this_month,
233
- value: { from: thisMonth, to: thisMonth }
233
+ value: { from: thisMonth, to: today }
234
234
  },
235
235
  {
236
236
  title: 'last month',
237
237
  key: MONTH_SIDEBAR_OPTION.last_month,
238
- value: { from: lastMonth, to: lastMonth }
238
+ value: { from: lastMonth, to: thisMonth }
239
239
  },
240
240
  {
241
241
  title: 'last 3 months',
@@ -469,9 +469,10 @@ export default defineComponent({
469
469
 
470
470
  if (option.key === DAY_SIDEBAR_OPTION.custom_by_month) {
471
471
  this.handleTypeChange('month')
472
+ this.updateDateInterval(option.value)
473
+ } else {
474
+ this.updateDateIntervalWithAutoClose(option.value)
472
475
  }
473
-
474
- this.updateDateInterval(option.value)
475
476
  },
476
477
  handleMonthTypeOptionClick(option: MonthTypeOption) {
477
478
  this.currentSidebarOption = option.key as MONTH_SIDEBAR_OPTION
@@ -483,9 +484,10 @@ export default defineComponent({
483
484
 
484
485
  if (option.key === MONTH_SIDEBAR_OPTION.custom_by_day) {
485
486
  this.handleTypeChange('day')
487
+ this.updateDateInterval(option.value)
488
+ } else {
489
+ this.updateDateIntervalWithAutoClose(option.value)
486
490
  }
487
-
488
- this.updateDateInterval(option.value)
489
491
  }
490
492
  }
491
493
  })
@@ -1,5 +1,31 @@
1
1
  <template>
2
2
  <div style="width: 700px">
3
+ <div style="height: 1000px">
4
+ <dl-panel-container
5
+ v-model="collapseP1"
6
+ :direction="direction"
7
+ :resizable="resizable"
8
+ :collapsable="collapsable"
9
+ width="500px"
10
+ style="height: 100%"
11
+ >
12
+ <dl-panel
13
+ resizable
14
+ collapsable
15
+ >
16
+ <div>
17
+ <h3>RESIZABLE & COLLAPSABLE</h3>
18
+ <p>
19
+ Lorem ipsum dolor sit amet consectetur adipisicing
20
+ elit. Excepturi, rerum harum aut sunt recusandae
21
+ obcaecati necessitatibus. Alias nulla aliquid,
22
+ dolorem qui, nesciunt hic iste ratione voluptates
23
+ magni optio quae. Vero!
24
+ </p>
25
+ </div>
26
+ </dl-panel>
27
+ </dl-panel-container>
28
+ </div>
3
29
  <div class="dl-panel-container-demo">
4
30
  <dl-panel-container
5
31
  v-model="collapseP1"