@dataloop-ai/components 0.17.50 → 0.17.52

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.17.50",
3
+ "version": "0.17.52",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -312,9 +312,12 @@ export default defineComponent({
312
312
  filled: this.filled,
313
313
  color: this.color
314
314
  }),
315
- '--dl-button-text-color-pressed':
316
- 'var(--dl-button-text-color)',
317
- '--dl-button-bg-pressed': 'var(--dl-button-bg)',
315
+ '--dl-button-text-color-pressed': this.shaded
316
+ ? 'var(--dl-color-text-buttons)'
317
+ : 'var(--dl-button-text-color)',
318
+ '--dl-button-bg-pressed': this.shaded
319
+ ? 'var(--dl-color-secondary)'
320
+ : 'var(--dl-button-bg)',
318
321
  '--dl-button-border-pressed': 'var(--dl-button-border)'
319
322
  }
320
323
  }
@@ -90,6 +90,18 @@ export class Step {
90
90
  set(this._state, 'sidebarNavigation', value)
91
91
  }
92
92
 
93
+ public clearError() {
94
+ set(this._state, 'error', '')
95
+ }
96
+
97
+ public clearWarning() {
98
+ set(this._state, 'warning', '')
99
+ }
100
+
101
+ public clearCompleted() {
102
+ set(this._state, 'completed', false)
103
+ }
104
+
93
105
  public reset() {
94
106
  for (const key of Object.keys(this._initialState)) {
95
107
  if (key !== 'active') {
@@ -163,4 +163,38 @@ export class Stepper {
163
163
 
164
164
  stepToReset.reset()
165
165
  }
166
+
167
+ /**
168
+ *
169
+ * @param options { step?: number; error?: boolean, warning?: boolean, completed?: boolean }
170
+ * @param options.step The step to clear its state
171
+ * @returns
172
+ */
173
+ public clearStepState(
174
+ options: {
175
+ step?: Step
176
+ error?: boolean
177
+ warning?: boolean
178
+ completed?: boolean
179
+ } = {}
180
+ ) {
181
+ const { step, error, warning, completed } = options
182
+ const stepToClear = step ?? this.currentStep
183
+
184
+ if (!stepToClear) {
185
+ return
186
+ }
187
+
188
+ if (error) {
189
+ stepToClear.clearError()
190
+ }
191
+
192
+ if (warning) {
193
+ stepToClear.clearWarning()
194
+ }
195
+
196
+ if (completed) {
197
+ stepToClear.clearCompleted()
198
+ }
199
+ }
166
200
  }