GitHub

@@ -186,31 +186,31 @@ defineExpose({

186186

</script>

187187188188

<template>

189-

<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">

190-

<div v-if="(icon || !!slots.leading) || (title || !!slots.title) || (description || !!slots.description) || !!slots.header" :class="ui.header({ class: props.ui?.header })">

189+

<Primitive :as="as" data-slot="root" :class="ui.root({ class: [props.ui?.root, props.class] })">

190+

<div v-if="(icon || !!slots.leading) || (title || !!slots.title) || (description || !!slots.description) || !!slots.header" data-slot="header" :class="ui.header({ class: props.ui?.header })">

191191

<slot name="header">

192-

<div v-if="icon || !!slots.leading" :class="ui.leading({ class: props.ui?.leading })">

192+

<div v-if="icon || !!slots.leading" data-slot="leading" :class="ui.leading({ class: props.ui?.leading })">

193193

<slot name="leading" :ui="ui">

194-

<UIcon v-if="icon" :name="icon" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />

194+

<UIcon v-if="icon" :name="icon" data-slot="leadingIcon" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />

195195

</slot>

196196

</div>

197197198-

<div v-if="title || !!slots.title" :class="ui.title({ class: props.ui?.title })">

198+

<div v-if="title || !!slots.title" data-slot="title" :class="ui.title({ class: props.ui?.title })">

199199

<slot name="title">

200200

{{ title }}

201201

</slot>

202202

</div>

203203204-

<div v-if="description || !!slots.description" :class="ui.description({ class: props.ui?.description })">

204+

<div v-if="description || !!slots.description" data-slot="description" :class="ui.description({ class: props.ui?.description })">

205205

<slot name="description">

206206

{{ description }}

207207

</slot>

208208

</div>

209209

</slot>

210210

</div>

211211212-

<div :class="ui.body({ class: props.ui?.body })">

213-

<div v-if="providers?.length || !!slots.providers" :class="ui.providers({ class: props.ui?.providers })">

212+

<div data-slot="body" :class="ui.body({ class: props.ui?.body })">

213+

<div v-if="providers?.length || !!slots.providers" data-slot="providers" :class="ui.providers({ class: props.ui?.providers })">

214214

<slot name="providers">

215215

<UButton

216216

v-for="(provider, index) in providers"

@@ -226,6 +226,7 @@ defineExpose({

226226

<USeparator

227227

v-if="providers?.length && fields?.length"

228228

v-bind="typeof separator === 'object' ? separator : { label: separator }"

229+

data-slot="separator"

229230

:class="ui.separator({ class: props.ui?.separator })"

230231

/>

231232

@@ -238,6 +239,7 @@ defineExpose({

238239

:validate-on="validateOn"

239240

:disabled="disabled"

240241

:loading-auto="loadingAuto"

242+

data-slot="form"

241243

:class="ui.form({ class: props.ui?.form })"

242244

v-bind="$attrs"

243245

@submit="onSubmit"

@@ -251,19 +253,22 @@ defineExpose({

251253

<UCheckbox

252254

v-if="field.type === 'checkbox'"

253255

v-model="state[field.name]"

256+

data-slot="checkbox"

254257

:class="ui.checkbox({ class: props.ui?.checkbox })"

255258

v-bind="(omitFieldProps(field))"

256259

/>

257260

<USelectMenu

258261

v-else-if="field.type === 'select'"

259262

v-model="state[field.name]"

263+

data-slot="select"

260264

:class="ui.select({ class: props.ui?.select })"

261265

v-bind="(omitFieldProps(field) as AuthFormSelectField)"

262266

/>

263267

<UPinInput

264268

v-else-if="field.type === 'otp'"

265269

:id="field.name"

266270

v-model="state[field.name]"

271+

data-slot="otp"

267272

:class="ui.otp({ class: props.ui?.otp })"

268273

v-bind="(Object.assign({}, omitFieldProps(field), typeof (field as AuthFormOtpField).otp === 'object' ? (field as AuthFormOtpField).otp : {}) as any)"

269274

otp

@@ -272,6 +277,7 @@ defineExpose({

272277

v-else-if="field.type === 'password'"

273278

ref="passwordRef"

274279

v-model="state[field.name]"

280+

data-slot="password"

275281

:class="ui.password({ class: props.ui?.password })"

276282

v-bind="(omitFieldProps(field) as AuthFormInputField<'password'>)"

277283

:type="passwordVisibility ? 'text' : 'password'"

@@ -292,6 +298,7 @@ defineExpose({

292298

<UInput

293299

v-else

294300

v-model="state[field.name]"

301+

data-slot="input"

295302

:class="ui.input({ class: props.ui?.input })"

296303

v-bind="(omitFieldProps(field) as AuthFormInputField)"

297304

/>

@@ -329,7 +336,7 @@ defineExpose({

329336

</UForm>

330337

</div>

331338332-

<div v-if="!!slots.footer" :class="ui.footer({ class: props.ui?.footer })">

339+

<div v-if="!!slots.footer" data-slot="footer" :class="ui.footer({ class: props.ui?.footer })">

333340

<slot name="footer" />

334341

</div>

335342

</Primitive>

Read the original on github.com ↗