Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit 3e37f28

Browse files
committed
feature(next): added render functions for inputs
1 parent 5512210 commit 3e37f28

File tree

13 files changed

+429
-63
lines changed

13 files changed

+429
-63
lines changed

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ jest.config.js
77
babel.config.js
88
vue.config.js
99
postcss.config.js
10+
tailwind.config.js
1011
.prettierrc
1112
.git
1213
**/.git/

dev/vue/App.vue

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
11
<template>
22
<div id="app">
3-
<dynamic-form :form="form" />
4-
<pre>{{ form }}</pre>
3+
<div class="page container">
4+
<h1 class="title m-4">{{ title }}</h1>
5+
<div class="flex justify-between">
6+
<div class="card p-6">
7+
<dynamic-form :form="form" />
8+
</div>
9+
<div class="card p-6">
10+
<pre>{{ form }}</pre>
11+
</div>
12+
</div>
13+
</div>
514
</div>
615
</template>
716

817
<script lang="ts">
9-
import { defineComponent, reactive } from 'vue';
18+
import { defineComponent, reactive, ref } from 'vue';
1019
import { TextInput, SelectInput, DynamicForm } from '../../src/index';
1120
1221
export default defineComponent({
1322
name: 'app',
1423
setup() {
24+
const title = ref('Vue Dynamic Forms');
1525
const form = reactive<DynamicForm>({
1626
id: 'form',
1727
fields: [
@@ -38,6 +48,7 @@ export default defineComponent({
3848
],
3949
});
4050
return {
51+
title,
4152
form,
4253
};
4354
},

dev/vue/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { createApp } from 'vue';
22

33
import App from './App.vue';
4+
import './styles/main.scss';
45

56
import { createDynamicForms } from '../../src/index';
67

dev/vue/styles/_vendors.scss

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
//@import 'bootstrap/scss/bootstrap.scss';
2-
@import 'bootstrap/scss/bootstrap-grid.scss';
1+
@import 'tailwindcss/base';
32

3+
@import 'tailwindcss/components';
4+
5+
@import 'tailwindcss/utilities';
46
// Customize default theme
57
/* $input-bg: #e9ecef;
68
$input-border-radius: 50px; */
79
// @import '../../src/styles/themes/default.scss';
810

9-
@import '@/styles/themes/material.scss';
11+
@import '@/styles/themes/default.scss';
1012

1113
// Third-party
1214

dev/vue/styles/base.scss

Lines changed: 13 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,21 @@
1-
body {
2-
font-family: 'Avenir', Helvetica, Arial, sans-serif;
3-
-webkit-font-smoothing: antialiased;
4-
-moz-osx-font-smoothing: grayscale;
5-
color: #2c3e50;
6-
margin-top: 60px;
1+
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,600;0,700;1,400&family=Roboto:wght@300;500;700&display=swap');
2+
3+
.card {
4+
@apply max-w-lg w-full rounded-lg shadow-lg;
75
}
86

9-
pre {
10-
font-family: FiraCode, Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono',
11-
monospace;
12-
font-size: 12px;
13-
color: #fefefe;
14-
background: #2c3e50;
15-
border-radius: 4px;
16-
padding: 0.2rem 0.5rem;
17-
overflow: auto;
7+
.container {
8+
@apply mx-auto px-4;
189
}
1910

20-
.btn {
21-
display: inline-block;
22-
font-weight: 400;
23-
color: #212529;
24-
text-align: center;
25-
vertical-align: middle;
26-
cursor: pointer;
27-
user-select: none;
28-
background-color: transparent;
29-
border: 1px solid transparent;
30-
padding: 0.375rem 0.75rem;
31-
font-size: 1rem;
32-
line-height: 1.5;
33-
border-radius: 0.25rem;
34-
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
35-
border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
11+
.page {
12+
@apply pt-16 overflow-hidden min-h-screen;
3613
}
3714

38-
.btn-primary {
39-
color: #fff;
40-
background-color: #007bff;
41-
border-color: #007bff;
15+
.title {
16+
@apply font-serif font-bold text-gray-800 text-2xl;
17+
}
4218

43-
&:hover {
44-
background-color: darken(#007bff, 5);
45-
border-color: darken(#007bff, 5);
46-
}
19+
pre {
20+
@apply bg-gray-900 text-white text-xs p-4 rounded-md;
4721
}

0 commit comments

Comments
 (0)