Skip to content

Commit 79a1240

Browse files
authored
Add autocomplete property (#285)
* Add autocomplete property * Default value for autocomplete * Use simpler type for autocomplete
1 parent bce8477 commit 79a1240

File tree

9 files changed

+47
-30
lines changed

9 files changed

+47
-30
lines changed

docs/components/typography/blockquote/FwbBlockquoteAlignExample.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<template>
2-
<div class="vp-raw flex flex-col gap-6">
2+
<div class="vp-raw flex flex-col gap-6">
33
<fwb-blockquote class="text-left">
4-
"Flowbite is just awesome. Perfect choice for your next SaaS application.Perfect choice for your next SaaS
5-
application."
4+
"Flowbite is just awesome. Perfect choice for your next SaaS application.Perfect choice for your next SaaS
5+
application."
66
</fwb-blockquote>
77
<fwb-blockquote class="text-center">
8-
"Flowbite is just awesome. Perfect choice for your next SaaS application.Perfect choice for your next SaaS
9-
application."
8+
"Flowbite is just awesome. Perfect choice for your next SaaS application.Perfect choice for your next SaaS
9+
application."
1010
</fwb-blockquote>
1111
<fwb-blockquote class="text-right">
12-
"Flowbite is just awesome. Perfect choice for your next SaaS application.Perfect choice for your next SaaS
13-
application."
12+
"Flowbite is just awesome. Perfect choice for your next SaaS application.Perfect choice for your next SaaS
13+
application."
1414
</fwb-blockquote>
15-
</div>
15+
</div>
1616
</template>
1717

1818
<script setup>

docs/components/typography/blockquote/FwbBlockquoteExample.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<template>
2-
<div class="vp-raw">
2+
<div class="vp-raw">
33
<fwb-blockquote>
4-
"Flowbite is just awesome. Perfect choice for your next SaaS application.Perfect choice for your next SaaS application."
4+
"Flowbite is just awesome. Perfect choice for your next SaaS application.Perfect choice for your next SaaS application."
55
</fwb-blockquote>
6-
</div>
6+
</div>
77
</template>
88

99
<script setup>

docs/components/typography/blockquote/FwbBlockquoteSizeExample.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<template>
2-
<div class="vp-raw flex flex-col gap-6">
2+
<div class="vp-raw flex flex-col gap-6">
33
<fwb-blockquote class="text-lg">
4-
"Flowbite is just awesome. Perfect choice for your next SaaS application.Perfect choice for your next SaaS application."
4+
"Flowbite is just awesome. Perfect choice for your next SaaS application.Perfect choice for your next SaaS application."
55
</fwb-blockquote>
66
<fwb-blockquote class="text-xl">
7-
"Flowbite is just awesome. Perfect choice for your next SaaS application.Perfect choice for your next SaaS application."
7+
"Flowbite is just awesome. Perfect choice for your next SaaS application.Perfect choice for your next SaaS application."
88
</fwb-blockquote>
99
<fwb-blockquote class="text-2xl">
10-
"Flowbite is just awesome. Perfect choice for your next SaaS application.Perfect choice for your next SaaS application."
10+
"Flowbite is just awesome. Perfect choice for your next SaaS application.Perfect choice for your next SaaS application."
1111
</fwb-blockquote>
12-
</div>
12+
</div>
1313
</template>
1414

1515
<script setup>

docs/components/typography/blockquote/FwbBlockquoteSolidExample.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<template>
2-
<div class="vp-raw flex">
2+
<div class="vp-raw flex">
33
<fwb-blockquote type="solid">
4-
"Flowbite is just awesome. Perfect choice for your next SaaS application.Perfect choice for your next SaaS application."
4+
"Flowbite is just awesome. Perfect choice for your next SaaS application.Perfect choice for your next SaaS application."
55
</fwb-blockquote>
6-
</div>
6+
</div>
77
</template>
88

99
<script setup>

src/components/FwbInput/FwbInput.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
:disabled="disabled"
1818
:type="type"
1919
:required="required"
20+
:autocomplete="autocomplete"
2021
:class="[inputClasses, $slots.prefix ? 'pl-10' : '']"
2122
>
2223
<div
@@ -47,6 +48,7 @@ import { useVModel } from '@vueuse/core'
4748
import { twMerge } from 'tailwind-merge'
4849
import { useInputClasses } from './composables/useInputClasses'
4950
import {
51+
type CommonAutoFill,
5052
type InputSize,
5153
type InputType,
5254
type ValidationStatus,
@@ -60,6 +62,7 @@ interface InputProps {
6062
required?: boolean
6163
size?: InputSize
6264
type?: InputType
65+
autocomplete?: CommonAutoFill
6366
validationStatus?: ValidationStatus
6467
}
6568
@@ -70,6 +73,7 @@ const props = withDefaults(defineProps<InputProps>(), {
7073
required: false,
7174
size: 'md',
7275
type: 'text',
76+
autocomplete: 'off',
7377
validationStatus: undefined,
7478
})
7579

src/components/FwbInput/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ export type InputSize = 'sm' | 'md' | 'lg'
22

33
export type InputType = 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week'
44

5+
// A simplified version of AutFill, which is to complex for TypeScript to handle
6+
export type CommonAutoFill = 'on' | 'off' | 'email' | 'tel' | 'name' | 'username' | 'current-password' | 'country' | 'postal-code' | 'language' | 'bday'
7+
58
export const validationStatusMap = {
69
Success: 'success',
710
Error: 'error',

src/components/FwbSelect/FwbSelect.vue

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
v-model="model"
1212
:disabled="disabled"
1313
:class="selectClasses"
14+
:autocomplete="autocomplete"
1415
>
1516
<option
1617
disabled
@@ -48,17 +49,18 @@ import { computed, toRefs } from 'vue'
4849
import { useVModel } from '@vueuse/core'
4950
import { twMerge } from 'tailwind-merge'
5051
import { useSelectClasses } from './composables/useSelectClasses'
51-
import type { InputSize } from './../FwbInput/types'
52+
import type { CommonAutoFill, InputSize } from './../FwbInput/types'
5253
import { type OptionsType, type ValidationStatus, validationStatusMap } from './types'
5354
5455
interface InputProps {
55-
modelValue?: string;
56-
label?: string;
57-
options?: OptionsType[];
58-
placeholder?: string;
59-
disabled?: boolean;
60-
underline?: boolean;
61-
size?: InputSize;
56+
modelValue?: string
57+
label?: string
58+
options?: OptionsType[]
59+
placeholder?: string
60+
disabled?: boolean
61+
underline?: boolean
62+
size?: InputSize
63+
autocomplete?: CommonAutoFill
6264
validationStatus?: ValidationStatus
6365
}
6466
const props = withDefaults(defineProps<InputProps>(), {
@@ -69,6 +71,7 @@ const props = withDefaults(defineProps<InputProps>(), {
6971
disabled: false,
7072
underline: false,
7173
size: 'md',
74+
autocomplete: 'off',
7275
validationStatus: undefined,
7376
})
7477
const emit = defineEmits(['update:modelValue'])

src/components/FwbTextarea/FwbTextarea.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
:class="textareaClasses"
99
:rows="rows"
1010
:placeholder="placeholder"
11+
:autocomplete="autocomplete"
1112
/>
1213
<span
1314
v-if="$slots.footer"
@@ -21,6 +22,7 @@
2122

2223
<script setup lang="ts">
2324
import { computed } from 'vue'
25+
import type { CommonAutoFill } from './../FwbInput/types'
2426
import { useTextareaClasses } from './composables/useTextareaClasses'
2527
2628
interface TextareaProps {
@@ -29,6 +31,7 @@ interface TextareaProps {
2931
rows?: number
3032
custom?: boolean
3133
placeholder?: string
34+
autocomplete?: CommonAutoFill
3235
}
3336
3437
defineOptions({
@@ -41,6 +44,7 @@ const props = withDefaults(defineProps<TextareaProps>(), {
4144
rows: 4,
4245
custom: false,
4346
placeholder: 'Write your message here...',
47+
autocomplete: 'off',
4448
})
4549
4650
const emit = defineEmits(['update:modelValue'])

src/components/Typography/FwbBlockquote.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<template>
2-
<blockquote :class="blockquoteClasses" :cite="cite">
3-
<slot></slot>
4-
</blockquote>
2+
<blockquote
3+
:class="blockquoteClasses"
4+
:cite="cite"
5+
>
6+
<slot />
7+
</blockquote>
58
</template>
69

710
<script lang="ts" setup>

0 commit comments

Comments
 (0)