@dataloop-ai/components 0.17.9 → 0.17.10

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.9",
3
+ "version": "0.17.10",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -118,7 +118,7 @@
118
118
  :class="[
119
119
  ...adornmentClasses,
120
120
  `adornment-container--pos-right${
121
- disableDropdownIconPadding
121
+ withoutDropdownIconPadding
122
122
  ? ' adornment-container--pos-right-without_padding'
123
123
  : ''
124
124
  }`
@@ -83,25 +83,84 @@ export class Stepper {
83
83
  }
84
84
  }
85
85
 
86
- public completeStep() {
87
- if (!this.currentStep) return
88
- this.currentStep.completed = true
89
- this.moveToNextStep()
90
- }
86
+ /**
87
+ *
88
+ * @param options { step?: number; preventNext?: boolean }
89
+ * @param options.step The steps to complete
90
+ * @param options.preventNext Prevents the stepper from moving to the next step
91
+ * @returns
92
+ */
93
+ public completeStep(options: { step?: Step; preventNext?: boolean } = {}) {
94
+ const { step, preventNext } = options
95
+ const stepToComplete = step ?? this.currentStep
96
+
97
+ if (!stepToComplete) {
98
+ return
99
+ }
91
100
 
92
- public failStep(msg?: string) {
93
- if (!this.currentStep) return
94
- this.currentStep.error = msg || ''
101
+ stepToComplete.completed = true
102
+
103
+ if (!preventNext) {
104
+ this.moveToNextStep()
105
+ }
95
106
  }
96
107
 
97
- public setStepWarning(msg?: string) {
98
- if (!this.currentStep) return
99
- this.currentStep.warning = msg || ''
100
- this.moveToNextStep()
108
+ /**
109
+ * @param message The error message
110
+ * @param options { step?: number; preventNext?: boolean }
111
+ * @param options.step The steps to Fail
112
+ * @returns
113
+ */
114
+ public failStep(message?: string, options: { step?: Step } = {}) {
115
+ const { step } = options
116
+ const stepToFail = step ?? this.currentStep
117
+
118
+ if (stepToFail) {
119
+ return
120
+ }
121
+
122
+ this.currentStep.error = message ?? ''
123
+ }
124
+
125
+ /**
126
+ * @param message The warning message
127
+ * @param options { step?: number; preventNext?: boolean }
128
+ * @param options.step The steps to Warn
129
+ * @param options.preventNext Prevents the stepper from moving to the next step
130
+ * @returns
131
+ */
132
+ public setStepWarning(
133
+ message?: string,
134
+ options: { step?: Step; preventNext?: boolean } = {}
135
+ ) {
136
+ const { step, preventNext } = options
137
+ const stepToWarn = step ?? this.currentStep
138
+
139
+ if (stepToWarn) {
140
+ return
141
+ }
142
+
143
+ this.currentStep.warning = message ?? ''
144
+
145
+ if (!preventNext) {
146
+ this.moveToNextStep()
147
+ }
101
148
  }
102
149
 
103
- public resetStep() {
104
- if (!this.currentStep) return
150
+ /**
151
+ *
152
+ * @param options { step?: number; preventNext?: boolean }
153
+ * @param options.step The steps to reset
154
+ * @returns
155
+ */
156
+ public resetStep(options: { step?: Step } = {}) {
157
+ const { step } = options
158
+ const stepToReset = step ?? this.currentStep
159
+
160
+ if (stepToReset) {
161
+ return
162
+ }
163
+
105
164
  this.currentStep.reset()
106
165
  }
107
166
  }