Skip to content

Commit 8d7c310

Browse files
authored
Vue3 form field components
1 parent accbae2 commit 8d7c310

File tree

7 files changed

+24
-24
lines changed

7 files changed

+24
-24
lines changed

input/Button.vue

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,19 @@ let props = defineProps(['text', 'class'])
1010
button {
1111
float: right;
1212
margin-top: 20px;
13-
padding: 16px 35px;
14-
color: #fff;
1513
background: var(--wow-accent);
1614
border-radius: var(--wow-border-radius);
17-
border: 0px;
18-
font-size: 16px;
19-
font-weight: 500;
15+
font-size: var(--wow-font-size) !important;
16+
padding: var(--wow-font-size) calc(var(--wow-font-size) * 3) !important;
17+
border-radius: calc(var(--wow-font-size) / 2);
18+
border: 1px solid var(--wow-accent);
19+
font-weight: 600 !important;
20+
color: #fff;
2021
cursor: pointer;
2122
transition: all 0.6s;
2223
}
2324
2425
button:hover {
25-
filter: brightness(1.5);
26+
filter: brightness(1.3);
2627
}
2728
</style>

input/README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# Vue3 input components
22

3-
Vue3 form inputs components (select, phone prefix, checkbox, radio, input, textarea, password with validation).
3+
Vue3 form field components with search and passowrd validation.
44

55
## Inputs (light/dark mode)
66

77
- Input
8-
- Select
98
- Textarea
9+
- Select (search)
1010
- Password (validation)
1111
- Radiobox (select one)
1212
- Checkbox (multiple, single)
13-
- Phone prefix (flags, country, code)
13+
- Phone prefix (flags emoji, country name, country code)
1414

1515
## Import fonts
1616

@@ -26,13 +26,17 @@ html, input, select, textarea, option, label, div {
2626
label i {
2727
float: right;
2828
}
29+
30+
h1.full {
31+
text-align: left;
32+
}
2933
```
3034

3135
## Demo page
3236

3337
<https://github.com/atomjoy/vue3-input/blob/main/input/example/DemoPageView.vue>
3438

35-
## RWD style, dark mode
39+
## RWD settings and dark mode style
3640

3741
Style in input-root.css
3842

input/Select.vue

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ function openSelect() {
4444
let all = document.querySelectorAll('.custom-select-open')
4545
all.forEach((el) => {
4646
let data = el.dataset.uid ?? null
47-
console.log(data)
4847
if (data != uid.value) {
4948
el.click()
5049
}
@@ -93,14 +92,6 @@ function updateClick(option = null) {
9392
emit('update:modelValue', modelValue.value)
9493
}
9594
96-
function renameKeys(obj = { id: '1', name: 'Alex' }, newKeys = { id: 'key', name: 'value' }) {
97-
const keyValues = Object.keys(obj).map((key) => {
98-
const newKey = newKeys[key] || key
99-
return { [newKey]: obj[key] }
100-
})
101-
return Object.assign({}, ...keyValues)
102-
}
103-
10495
function filterOptions(e) {
10596
filtered_options.value = options?.value?.filter((o) => {
10697
if (o?.value) {

input/css/input-root.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686

8787
@media (max-width: 1280px) {
8888
:root {
89-
--wow-font-size: 14px;
89+
--wow-font-size: 15px;
9090
}
9191
}
9292

input/example/DemoPageView.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,8 @@ function onSubmit(e) {
5959
</script>
6060

6161
<template>
62-
<TopMenu />
63-
64-
<p class="color">Home page</p>
65-
6662
<form @submit.prevent="onSubmit" style="margin: 50px auto; width: 90%; max-width: 530px; padding: 30px">
63+
<h1>Form example</h1>
6764
<Input :focus="'true'" type="text" name="name" v-model="input" placeholder="Name" label="Name" @keydown="validate" />
6865

6966
<Password type="password" name="password" v-model="password" placeholder="Password" label="Password" @valid="validPass" @invalid="invalidPass" />
-19.3 KB
Loading

input/js/renameKeys.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default function renameKeys(obj = { id: '1', name: 'Alex' }, newKeys = { id: 'key', name: 'value' }) {
2+
const keyValues = Object.keys(obj).map((key) => {
3+
const newKey = newKeys[key] || key
4+
return { [newKey]: obj[key] }
5+
})
6+
return Object.assign({}, ...keyValues)
7+
}

0 commit comments

Comments
 (0)