@dataloop-ai/components 0.16.21 → 0.16.23

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.16.21",
3
+ "version": "0.16.23",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -220,7 +220,7 @@ export default defineComponent({
220
220
  .close-btn {
221
221
  padding-right: 16px;
222
222
  padding-left: 10px;
223
- align-items: start;
223
+ align-items: var(--dl-alert-align-button, start);
224
224
  }
225
225
 
226
226
  .icon-dl-close:hover {
@@ -101,6 +101,7 @@ import {
101
101
  import type { Chart, ChartMeta, ChartDataset, ActiveElement } from 'chart.js'
102
102
  import { unionBy, orderBy, merge, isEqual } from 'lodash'
103
103
  import { useThemeVariables } from '../../../../../hooks/use-theme'
104
+ import { getMaxDatasetValue } from '../../utils'
104
105
 
105
106
  ChartJS.register(
106
107
  Title,
@@ -365,7 +366,17 @@ export default defineComponent({
365
366
  const chartOptions = reactive(
366
367
  updateKey(
367
368
  merge(
368
- { onResize, onHover },
369
+ {
370
+ onResize,
371
+ onHover,
372
+ scales: {
373
+ y: {
374
+ suggestedMax: getMaxDatasetValue(
375
+ chartData.value.datasets
376
+ )
377
+ }
378
+ }
379
+ },
369
380
  defaultColumnChartProps.options,
370
381
  props.options
371
382
  ),
@@ -125,6 +125,7 @@ export const defaultColumnChartProps = {
125
125
  },
126
126
  scales: {
127
127
  y: {
128
+ suggestedMin: 0,
128
129
  title: {
129
130
  color: '--dl-color-medium',
130
131
  display: true,
@@ -151,3 +151,10 @@ export function getElementsAtEvent(chart: Chart, event: MouseEvent) {
151
151
  false
152
152
  )
153
153
  }
154
+
155
+ export const getMaxDatasetValue = (chartDataset: [{ data: number[] }]) => {
156
+ return Math.max.apply(
157
+ null,
158
+ chartDataset.map((data) => [...data.data]).flat(1)
159
+ )
160
+ }
@@ -314,11 +314,6 @@ export default defineComponent({
314
314
  --dl-color-info: var(--dl-color-alert-info);
315
315
  --dl-color-info-background: var(--dl-color-alert-info-background);
316
316
  --dl-color-darker: var(--dl-color-alert-text);
317
-
318
- .alert {
319
- .close-btn {
320
- align-items: center !important;
321
- }
322
- }
317
+ --dl-alert-align-button: center;
323
318
  }
324
319
  </style>
@@ -85,7 +85,7 @@ export default defineComponent({
85
85
  }
86
86
  },
87
87
  inlineStyles(): string {
88
- return this.inline ? 'display: inline' : ''
88
+ return this.inline ? 'display: inline' : 'display: flex;'
89
89
  },
90
90
  // needed to allow external source of icons that do not use class based
91
91
  externalIcon(): boolean {