@dataloop-ai/components 0.20.37 → 0.20.38

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.37",
3
+ "version": "0.20.38",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -141,6 +141,10 @@ export default defineComponent({
141
141
  type: Number,
142
142
  default: 100
143
143
  },
144
+ defaultValue: {
145
+ type: Number,
146
+ default: null
147
+ },
144
148
  readonly: {
145
149
  type: Boolean,
146
150
  default: false
@@ -178,8 +182,16 @@ export default defineComponent({
178
182
  },
179
183
  emits: ['update:model-value', 'change', 'input-focus', 'input-blur'],
180
184
  setup(props, { emit }) {
181
- const { modelValue, min, max, textColor, width, thumbSize, color } =
182
- toRefs(props)
185
+ const {
186
+ modelValue,
187
+ min,
188
+ max,
189
+ textColor,
190
+ width,
191
+ thumbSize,
192
+ color,
193
+ defaultValue
194
+ } = toRefs(props)
183
195
  const initialValue = ref(
184
196
  modelValue.value === null
185
197
  ? min.value
@@ -216,7 +228,7 @@ export default defineComponent({
216
228
  }
217
229
 
218
230
  const handleResetButtonClick = () => {
219
- onChange(initialValue.value)
231
+ onChange(defaultValue.value ?? initialValue.value)
220
232
  }
221
233
 
222
234
  watch(