@dataloop-ai/components 0.18.66 → 0.18.68

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.66",
3
+ "version": "0.18.68",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -130,7 +130,7 @@ export default defineComponent({
130
130
  * The size of the button, it can be s,m,l or xl
131
131
  */
132
132
  margin: { type: String, default: '0 auto' },
133
- size: { type: String! as PropType<ButtonSizes | string>, default: 'm' },
133
+ size: { type: String! as PropType<ButtonSizes>, default: 'm' },
134
134
  /**
135
135
  * The assigned color will fill the entirety of the button
136
136
  */
@@ -1,7 +1,7 @@
1
1
  import { getColor } from '../../../utils'
2
2
  import { getLighterGradient } from '../../../utils/getLighterGradient'
3
3
 
4
- export type ButtonSizes = 's' | 'm' | 'l' | 'xl'
4
+ export type ButtonSizes = 's' | 'm' | 'l' | ('xl' & string)
5
5
 
6
6
  const paddings = {
7
7
  s: '7px 16px',
@@ -210,7 +210,13 @@
210
210
  </template>
211
211
 
212
212
  <script lang="ts">
213
- import { defineComponent, getCurrentInstance, PropType, ref } from 'vue-demi'
213
+ import {
214
+ computed,
215
+ defineComponent,
216
+ getCurrentInstance,
217
+ PropType,
218
+ ref
219
+ } from 'vue-demi'
214
220
  import DlBrush from '../../components/DlBrush.vue'
215
221
  import { DlTooltip } from '../../../../shared'
216
222
  import {
@@ -231,6 +237,7 @@ import {
231
237
  flattenConfusionMatrix
232
238
  } from './utils'
233
239
  import { debounce, isObject } from 'lodash'
240
+ import { stateManager } from '../../../../../StateManager'
234
241
  export default defineComponent({
235
242
  components: {
236
243
  DlBrush,
@@ -321,10 +328,12 @@ export default defineComponent({
321
328
  return [0, offsetHeight]
322
329
  }
323
330
 
324
- const debouncedCalculateXAxisElOffset = debounce(
325
- calculateXAxisElOffset,
326
- 100
327
- )
331
+ const debouncedCalculateXAxisElOffset = computed(() => {
332
+ if (stateManager.disableDebounce) {
333
+ return calculateXAxisElOffset
334
+ }
335
+ return debounce(calculateXAxisElOffset, 100)
336
+ })
328
337
 
329
338
  return {
330
339
  resizeObserver,
@@ -129,6 +129,7 @@ import { DlToast } from '../../DlToast'
129
129
  import '../styles/themes.css'
130
130
  import '../styles/themes-base16.css'
131
131
  import { debounce } from 'lodash'
132
+ import { stateManager } from '../../../../StateManager'
132
133
 
133
134
  export default defineComponent({
134
135
  name: 'CodeEditor',
@@ -389,7 +390,12 @@ export default defineComponent({
389
390
  lineNum.value = localLineNum
390
391
  }
391
392
 
392
- const debouncedGetLinesCount = debounce(getLinesCount, 100)
393
+ const debouncedGetLinesCount = computed(() => {
394
+ if (stateManager.disableDebounce) {
395
+ return getLinesCount
396
+ }
397
+ return debounce(getLinesCount, 100)
398
+ })
393
399
 
394
400
  onMounted(() => {
395
401
  emit('lang', props.languages[0][0])