Skip to content

Commit

Permalink
update components
Browse files Browse the repository at this point in the history
  • Loading branch information
SiamNgu committed Oct 25, 2024
1 parent eb0c982 commit 78215ce
Show file tree
Hide file tree
Showing 10 changed files with 153 additions and 315 deletions.
3 changes: 3 additions & 0 deletions components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ declare module 'vue' {
Address: typeof import('./src/components/address/index.vue')['default']
Appointment: typeof import('./src/components/appointment/index.vue')['default']
Audio_recorder: typeof import('./src/components/audio_recorder/index.vue')['default']
Button: typeof import('primevue/button')['default']
Captcha: typeof import('./src/components/captcha/index.vue')['default']
Checkboxes: typeof import('./src/components/checkboxes/index.vue')['default']
Code_javascript: typeof import('./src/components/code_javascript/index.vue')['default']
Expand All @@ -30,6 +31,7 @@ declare module 'vue' {
Html_block: typeof import('./src/components/html_block/index.vue')['default']
Icon_display: typeof import('./src/components/icon_display/index.vue')['default']
Image_choice: typeof import('./src/components/image_choice/index.vue')['default']
InputText: typeof import('primevue/inputtext')['default']
Likert_scale: typeof import('./src/components/likert_scale/index.vue')['default']
List: typeof import('./src/components/list/index.vue')['default']
Locale_selector: typeof import('./src/components/locale_selector/index.vue')['default']
Expand All @@ -51,6 +53,7 @@ declare module 'vue' {
Signature: typeof import('./src/components/signature/index.vue')['default']
Slider: typeof import('./src/components/slider/index.vue')['default']
Term_of_service: typeof import('./src/components/term_of_service/index.vue')['default']
Textarea: typeof import('primevue/textarea')['default']
Time_picker: typeof import('./src/components/time_picker/index.vue')['default']
Website: typeof import('./src/components/website/index.vue')['default']
}
Expand Down
31 changes: 1 addition & 30 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -474,36 +474,7 @@
"label": "Data Table",
"component": "data_table",
"description": "Edit data directly within the table.",
"choices": [
{ "value": "name", "label": "Name" },
{
"value": "age",
"label": "Age"
}
],
"data": [
{
"name": "John Doe",
"age": 28,
"email": "[email protected]"
},
{
"name": "Jane Smith",
"age": 34,
"email": "[email protected]"
}
],
"options": {
"pagination": true,
"pageSize": 10,
"sortable": true,
"filterable": true,
"editable": true
},
"validations": [
{ "rule": "required" },
{ "rule": "email", "params": ["email"] }
]
"fields": ["key", "label"]
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"version": "0.2.4",
"author": "formsible.com",
"type": "module",
"files": [
"dist"
],
"main": "dist/element.umd.js",
"module": "dist/index.es.js",
"exports": {
Expand Down
61 changes: 22 additions & 39 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

68 changes: 0 additions & 68 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@

<div class="w-1/2 overflow-auto p-4">
<h2 class="text-xl font-bold mb-4">Preview</h2>
<pre>{{ formComponents[currentComponentIndex] }}</pre>
<Transition
mode="out-in"
enterActiveClass="transition duration-100 delay-100"
Expand Down Expand Up @@ -106,9 +105,6 @@
placeholder="Error Message"
class="w-full mb-2 p-2 border rounded"
/>
<pre>{{
formComponents[currentComponentIndex].inputProps
}}</pre>
</div>
</div>
</div>
Expand All @@ -128,8 +124,6 @@ import {
} from 'vue'
import AppBar from './AppBar.vue'
import type { ElementManifest } from './types'
import { useTheme } from './utils/apply-theme'
import type { ThemeData } from './types/theme'
const state = reactive<Record<string, unknown>>({})
interface IComponent {
Expand Down Expand Up @@ -208,67 +202,5 @@ onMounted(async () => {
if (formComponents.value.length > 0) {
selectedComponent.value = formComponents.value[0]
}
const themeData: Ref<ThemeData> = ref({
tailwind: {
container: {
padding: 'p-4',
baseBackground: 'bg-white',
baseTextColor: 'text-black',
baseFontSize: 'text-base',
},
button: {
padding: 'py-2 px-4',
baseBackground: 'bg-blue-500',
baseTextColor: 'text-white',
borderRadius: 'rounded-lg',
},
input: {
baseBorder: 'border',
basePadding: 'p-2',
borderColor: 'border-gray-300',
borderRadius: 'rounded-md',
},
},
variables: {
container: {
backgroundColor: '#ffffff',
textColor: '#000000',
fontSize: '16px',
},
button: {
backgroundColor: '#3b82f6',
textColor: '#ffffff',
borderRadius: '0.5rem',
},
input: {
borderColor: '#d1d5db',
borderRadius: '0.375rem',
backgroundColor: '#ffffff',
textColor: '#000000',
},
error: {
textColor: '#ef4444',
},
},
values: {
container: {
backgroundColor: '#ffffff',
textColor: '#000000',
fontSize: '16px',
},
button: {
backgroundColor: '#3b82f6',
textColor: '#ffffff',
borderRadius: '0.5rem',
},
input: {
borderColor: '#d1d5db',
borderRadius: '0.375rem',
},
},
})
useTheme(themeData)
})
</script>
Loading

0 comments on commit 78215ce

Please sign in to comment.