@opengis/form 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -0
- package/index.css +1 -0
- package/index.js +3286 -0
- package/index.umd.cjs +6 -0
- package/package.json +28 -0
- package/vite.svg +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Vue 3 + TypeScript + Vite
|
|
2
|
+
|
|
3
|
+
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
|
|
4
|
+
|
|
5
|
+
Learn more about the recommended Project Setup and IDE Support in the [Vue Docs TypeScript Guide](https://vuejs.org/guide/typescript/overview.html#project-setup).
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- Schema-based filter rendering (radio, checkbox)
|
|
10
|
+
- Slot-based extensibility for custom filters
|
|
11
|
+
- Built-in clear/reset support
|
|
12
|
+
- Emits `change` and `clear` events
|
|
13
|
+
- Popover support with positioning logic
|
|
14
|
+
- Show more / limit options logic
|
|
15
|
+
- Written in TypeScript
|
|
16
|
+
- Fully styleable with Tailwind CSS
|
|
17
|
+
- Mobile-friendly and responsive
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Documentation
|
|
22
|
+
|
|
23
|
+
Check out the documentation and live demo here: [Live Demo & Docs](https://form.opengis.info)
|
|
24
|
+
|
|
25
|
+
## Install & Usage
|
|
26
|
+
|
|
27
|
+
### Install
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm i @opengis/form
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Usage
|
|
34
|
+
|
|
35
|
+
```vue
|
|
36
|
+
<template>
|
|
37
|
+
<VsForm :schema="schema" @change="console.log($event.data)" />
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script setup lang="ts">
|
|
41
|
+
|
|
42
|
+
import {ref} from 'vue'
|
|
43
|
+
import VsForm from "@opengis/form";
|
|
44
|
+
|
|
45
|
+
const schema = [
|
|
46
|
+
{ name: 'name', label: 'Name', type: 'text', col: 6, conditions: ['number', '==', 2], },
|
|
47
|
+
{ name: 'date', label: 'Date', type: 'date', col: 6, time: true, },
|
|
48
|
+
{ name: 'file', label: 'File', type: 'file', multiple: true, },
|
|
49
|
+
{ name: 'number', label: 'Number', type: 'number', col: 6, }
|
|
50
|
+
];
|
|
51
|
+
</script>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Register
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
// main.ts
|
|
58
|
+
import VsFilter from '@opengis/form';
|
|
59
|
+
app.use(VsForm); // Register: VsForm, TextInput, ...
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Style
|
|
63
|
+
|
|
64
|
+
```html
|
|
65
|
+
<script src="https://cdn.tailwindcss.com"></script>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Contributions
|
|
71
|
+
|
|
72
|
+
We welcome contributions!
|
|
73
|
+
Feel free to open issues, suggest features, or submit pull requests.
|
package/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.slide-fade-enter-active[data-v-34f848b8],.slide-fade-leave-active[data-v-34f848b8]{transition:all .3s ease}.slide-fade-enter-from[data-v-34f848b8],.slide-fade-leave-to[data-v-34f848b8]{max-height:0;opacity:0;transform:translateY(-10px)}.slide-fade-enter-to[data-v-34f848b8],.slide-fade-leave-from[data-v-34f848b8]{max-height:1000px;opacity:1;transform:translateY(0)}.slide-fade-enter-active[data-v-896e4c89],.slide-fade-leave-active[data-v-896e4c89]{transition:all .3s ease}.slide-fade-enter-from[data-v-896e4c89],.slide-fade-leave-to[data-v-896e4c89]{max-height:0;opacity:0;transform:translateY(-10px)}.slide-fade-enter-to[data-v-896e4c89],.slide-fade-leave-from[data-v-896e4c89]{max-height:1000px;opacity:1;transform:translateY(0)}.grid[data-v-06e7be2f]{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:1rem}.item-file:hover>div[data-v-147e810a]{display:flex!important;background-color:#00000080}
|