@dataloop-ai/components 0.18.67 → 0.18.69
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 +1 -1
- package/src/components/compound/DlCharts/charts/DlConfusionMatrix/DlConfusionMatrix.vue +14 -5
- package/src/components/compound/DlCodeEditor/components/CodeEditor.vue +10 -4
- package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchInput.vue +8 -5
- package/src/components/compound/DlSelect/components/DlSelectOption.vue +4 -0
- package/src/components/compound/DlSlider/DlSlider.vue +3 -3
- package/src/components/compound/DlSlider/components/DlSliderInput.vue +11 -2
- package/src/components/essential/DlSwitch/DlSwitch.vue +1 -0
- package/src/demos/DlSliderDemo.vue +2 -2
package/package.json
CHANGED
|
@@ -210,7 +210,13 @@
|
|
|
210
210
|
</template>
|
|
211
211
|
|
|
212
212
|
<script lang="ts">
|
|
213
|
-
import {
|
|
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 =
|
|
325
|
-
|
|
326
|
-
|
|
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 =
|
|
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])
|
|
@@ -404,7 +410,7 @@ export default defineComponent({
|
|
|
404
410
|
if (scrolling.value) {
|
|
405
411
|
scrolling.value = false
|
|
406
412
|
} else {
|
|
407
|
-
debouncedGetLinesCount()
|
|
413
|
+
debouncedGetLinesCount.value()
|
|
408
414
|
}
|
|
409
415
|
}
|
|
410
416
|
hljs.highlightElement(code.value)
|
|
@@ -437,7 +443,7 @@ export default defineComponent({
|
|
|
437
443
|
if (scrolling.value) {
|
|
438
444
|
scrolling.value = false
|
|
439
445
|
} else {
|
|
440
|
-
debouncedGetLinesCount()
|
|
446
|
+
debouncedGetLinesCount.value()
|
|
441
447
|
}
|
|
442
448
|
}
|
|
443
449
|
})
|
|
@@ -448,7 +454,7 @@ export default defineComponent({
|
|
|
448
454
|
if (scrolling.value) {
|
|
449
455
|
scrolling.value = false
|
|
450
456
|
} else {
|
|
451
|
-
debouncedGetLinesCount()
|
|
457
|
+
debouncedGetLinesCount.value()
|
|
452
458
|
}
|
|
453
459
|
}
|
|
454
460
|
})
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
</div>
|
|
129
129
|
</template>
|
|
130
130
|
<script lang="ts">
|
|
131
|
-
import { defineComponent, ref, PropType, nextTick } from 'vue-demi'
|
|
131
|
+
import { defineComponent, ref, PropType, nextTick, computed } from 'vue-demi'
|
|
132
132
|
import { DlButton } from '../../../../basic'
|
|
133
133
|
import { DlDatePicker } from '../../../DlDateTime'
|
|
134
134
|
import { DlMenu, DlIcon } from '../../../../essential'
|
|
@@ -147,6 +147,7 @@ import {
|
|
|
147
147
|
isEligibleToChange
|
|
148
148
|
} from '../utils'
|
|
149
149
|
import { v4 } from 'uuid'
|
|
150
|
+
import { stateManager } from '../../../../../StateManager'
|
|
150
151
|
|
|
151
152
|
export default defineComponent({
|
|
152
153
|
components: {
|
|
@@ -310,10 +311,12 @@ export default defineComponent({
|
|
|
310
311
|
emit('update:model-value', stringValue)
|
|
311
312
|
}
|
|
312
313
|
|
|
313
|
-
const debouncedSetModal =
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
314
|
+
const debouncedSetModal = computed(() => {
|
|
315
|
+
if (stateManager.disableDebounce) {
|
|
316
|
+
return () => (suggestionModal.value = true)
|
|
317
|
+
}
|
|
318
|
+
return debounce(() => (suggestionModal.value = true), 100)
|
|
319
|
+
})
|
|
317
320
|
|
|
318
321
|
return {
|
|
319
322
|
uuid: v4(),
|
|
@@ -104,6 +104,7 @@ import { DlIcon, DlCheckbox } from '../../../essential'
|
|
|
104
104
|
import { DlItemSection } from '../../../shared'
|
|
105
105
|
import { v4 } from 'uuid'
|
|
106
106
|
import { debounce } from 'lodash'
|
|
107
|
+
import { stateManager } from '../../../../StateManager'
|
|
107
108
|
|
|
108
109
|
const ValueTypes = [Array, Boolean, String, Number, Object, Function]
|
|
109
110
|
|
|
@@ -168,6 +169,9 @@ export default defineComponent({
|
|
|
168
169
|
return this.totalItems ? 'indeterminate' : undefined
|
|
169
170
|
},
|
|
170
171
|
handleChildren(): any {
|
|
172
|
+
if (stateManager.disableDebounce) {
|
|
173
|
+
return this.toggleChildren.bind(this)
|
|
174
|
+
}
|
|
171
175
|
return debounce(this.toggleChildren.bind(this), 50)
|
|
172
176
|
},
|
|
173
177
|
hasChildren(): boolean {
|
|
@@ -232,12 +232,12 @@ export default defineComponent({
|
|
|
232
232
|
},
|
|
233
233
|
methods: {
|
|
234
234
|
handleChange(value: number) {
|
|
235
|
+
if (this.sliderValue === value) return
|
|
236
|
+
|
|
235
237
|
this.$emit('change', value)
|
|
238
|
+
this.sliderValue = value
|
|
236
239
|
},
|
|
237
240
|
handleResetButtonClick() {
|
|
238
|
-
if (this.value === this.initialValue) return
|
|
239
|
-
|
|
240
|
-
this.sliderValue = this.initialValue
|
|
241
241
|
this.handleChange(this.initialValue)
|
|
242
242
|
}
|
|
243
243
|
}
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
|
|
15
15
|
<script lang="ts">
|
|
16
16
|
import { debounce } from 'lodash'
|
|
17
|
-
import { defineComponent, toRef } from 'vue-demi'
|
|
17
|
+
import { computed, defineComponent, ref, toRef } from 'vue-demi'
|
|
18
|
+
import { stateManager } from '../../../../StateManager'
|
|
18
19
|
import { getInputValue } from '../utils'
|
|
19
20
|
|
|
20
21
|
export default defineComponent({
|
|
@@ -48,6 +49,7 @@ export default defineComponent({
|
|
|
48
49
|
emits: ['update:model-value', 'change'],
|
|
49
50
|
setup(props, { emit }) {
|
|
50
51
|
const modelRef = toRef(props, 'modelValue')
|
|
52
|
+
const sliderInput = ref<HTMLInputElement>(null)
|
|
51
53
|
|
|
52
54
|
const handleChange = (evt: any) => {
|
|
53
55
|
const val = evt.target.value
|
|
@@ -57,11 +59,18 @@ export default defineComponent({
|
|
|
57
59
|
|
|
58
60
|
emit('change', Number(value))
|
|
59
61
|
emit('update:model-value', Number(value))
|
|
62
|
+
if (sliderInput.value) sliderInput.value.value = value
|
|
60
63
|
}
|
|
61
64
|
|
|
62
|
-
const debouncedHandleChange =
|
|
65
|
+
const debouncedHandleChange = computed(() => {
|
|
66
|
+
if (stateManager.disableDebounce) {
|
|
67
|
+
return handleChange
|
|
68
|
+
}
|
|
69
|
+
return debounce(handleChange, 100)
|
|
70
|
+
})
|
|
63
71
|
|
|
64
72
|
return {
|
|
73
|
+
sliderInput,
|
|
65
74
|
modelRef,
|
|
66
75
|
handleChange: debouncedHandleChange
|
|
67
76
|
}
|
|
@@ -45,12 +45,12 @@ export default defineComponent({
|
|
|
45
45
|
},
|
|
46
46
|
watch: {
|
|
47
47
|
value(newValue, oldValue) {
|
|
48
|
-
console.log(`@@@ value
|
|
48
|
+
console.log(`@@@ model value update ${oldValue} to ${newValue}`)
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
methods: {
|
|
52
52
|
handleChange(value: number) {
|
|
53
|
-
console.log(`@@@
|
|
53
|
+
console.log(`@@@ handling change ${value}`)
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
56
|
template: 'dl-slider-demo'
|