lime-elements-vue 1.0.8 → 1.1.0
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 +95 -90
- package/dist/index.cjs.js +1965 -23
- package/dist/index.d.ts +6558 -7
- package/dist/index.esm.js +128513 -0
- package/package.json +43 -20
- package/LICENSE +0 -22
- package/dist/components.d.ts +0 -72
- package/dist/components.js +0 -766
- package/dist/index.js +0 -14
package/README.md
CHANGED
|
@@ -1,129 +1,134 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Lime Elements Vue
|
|
2
2
|
|
|
3
|
-
Vue 3 wrapper for [
|
|
3
|
+
Vue 3 wrapper for [Lime Elements](https://github.com/Lundalogik/lime-elements) web components.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install lime-elements-vue
|
|
8
|
+
npm install @limetech/lime-elements-vue
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
|
-
### 1. Configure Vite (Required)
|
|
14
|
-
|
|
15
|
-
Add this to your `vite.config.ts`:
|
|
16
|
-
|
|
17
13
|
```typescript
|
|
18
|
-
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
// Tell Vue that all tags with a hyphen are custom elements
|
|
28
|
-
isCustomElement: (tag) => tag.includes('-')
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}),
|
|
32
|
-
// Copy lime-elements assets to your public folder
|
|
33
|
-
viteStaticCopy({
|
|
34
|
-
targets: [
|
|
35
|
-
{
|
|
36
|
-
src: 'node_modules/@limetech/lime-elements/dist',
|
|
37
|
-
dest: 'lime-elements'
|
|
38
|
-
}
|
|
39
|
-
]
|
|
40
|
-
})
|
|
41
|
-
],
|
|
42
|
-
optimizeDeps: {
|
|
43
|
-
// Don't pre-bundle lime-elements to allow dynamic imports to work
|
|
44
|
-
exclude: ['@limetech/lime-elements']
|
|
45
|
-
}
|
|
46
|
-
})
|
|
14
|
+
// main.ts
|
|
15
|
+
import { createApp } from 'vue';
|
|
16
|
+
import App from './App.vue';
|
|
17
|
+
import { LimeElementsVue } from '@limetech/lime-elements-vue';
|
|
18
|
+
import '@limetech/lime-elements-vue/css/lime-elements.css';
|
|
19
|
+
|
|
20
|
+
const app = createApp(App);
|
|
21
|
+
app.use(LimeElementsVue);
|
|
22
|
+
app.mount('#app');
|
|
47
23
|
```
|
|
48
24
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
npm install -D vite-plugin-static-copy
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### 2. Register the plugin globally
|
|
56
|
-
|
|
57
|
-
```typescript
|
|
58
|
-
import { createApp } from 'vue'
|
|
59
|
-
import { LimeElementsVue } from 'lime-elements-vue'
|
|
60
|
-
import App from './App.vue'
|
|
61
|
-
|
|
62
|
-
const app = createApp(App)
|
|
63
|
-
// Point to the copied assets
|
|
64
|
-
app.use(LimeElementsVue, {
|
|
65
|
-
resourcesUrl: '/lime-elements/dist/'
|
|
66
|
-
})
|
|
67
|
-
app.mount('#app')
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
### 3. Use components in your templates
|
|
25
|
+
Then in your components:
|
|
71
26
|
|
|
72
27
|
```vue
|
|
73
28
|
<template>
|
|
74
|
-
|
|
75
|
-
<limel-
|
|
76
|
-
<limel-input-field v-model="value" label="Enter text" />
|
|
77
|
-
</div>
|
|
29
|
+
<limel-button label="Click me" :primary="true" @click="handleClick" />
|
|
30
|
+
<limel-checkbox label="Check me" :checked="checked" @change="handleChange" />
|
|
78
31
|
</template>
|
|
32
|
+
```
|
|
79
33
|
|
|
80
|
-
|
|
81
|
-
import { ref } from 'vue'
|
|
34
|
+
### Vite Configuration
|
|
82
35
|
|
|
83
|
-
|
|
36
|
+
Add custom elements support to your Vite config:
|
|
84
37
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
38
|
+
```typescript
|
|
39
|
+
// vite.config.ts
|
|
40
|
+
import vue from '@vitejs/plugin-vue';
|
|
41
|
+
|
|
42
|
+
export default defineConfig({
|
|
43
|
+
plugins: [
|
|
44
|
+
vue({
|
|
45
|
+
template: {
|
|
46
|
+
compilerOptions: {
|
|
47
|
+
isCustomElement: (tag) => tag.startsWith('limel-'),
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
}),
|
|
51
|
+
],
|
|
52
|
+
});
|
|
89
53
|
```
|
|
90
54
|
|
|
91
|
-
## Development
|
|
55
|
+
## Development
|
|
92
56
|
|
|
93
|
-
|
|
57
|
+
### Prerequisites
|
|
94
58
|
|
|
95
|
-
|
|
59
|
+
- Node.js 18+
|
|
60
|
+
- npm 8+
|
|
61
|
+
- Python 3.8+ (for orchestration script)
|
|
96
62
|
|
|
97
|
-
|
|
63
|
+
### Setup
|
|
98
64
|
|
|
99
|
-
|
|
65
|
+
```bash
|
|
66
|
+
# Clone with submodules
|
|
67
|
+
git clone --recurse-submodules https://github.com/Lundalogik/lime-elements-vue.git
|
|
68
|
+
cd lime-elements-vue
|
|
100
69
|
|
|
101
|
-
|
|
70
|
+
# Or if already cloned
|
|
71
|
+
git submodule update --init --recursive
|
|
102
72
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
})
|
|
73
|
+
# Install dependencies
|
|
74
|
+
npm install
|
|
75
|
+
cd demo && npm install && cd ..
|
|
107
76
|
```
|
|
108
77
|
|
|
109
|
-
|
|
78
|
+
### Build
|
|
110
79
|
|
|
111
|
-
|
|
80
|
+
```bash
|
|
81
|
+
# Full build
|
|
82
|
+
./build.sh
|
|
112
83
|
|
|
113
|
-
|
|
84
|
+
# Or using Python orchestrator
|
|
85
|
+
python run.py build
|
|
86
|
+
```
|
|
114
87
|
|
|
115
|
-
###
|
|
88
|
+
### Development
|
|
116
89
|
|
|
117
|
-
|
|
90
|
+
```bash
|
|
91
|
+
# Start demo app
|
|
92
|
+
python run.py dev
|
|
93
|
+
|
|
94
|
+
# Or manually
|
|
95
|
+
cd demo && npm run dev
|
|
96
|
+
```
|
|
118
97
|
|
|
119
|
-
|
|
120
|
-
2. Ensure `optimizeDeps.exclude: ['@limetech/lime-elements']` is set
|
|
121
|
-
3. Make sure `isCustomElement: (tag) => tag.includes('-')` is configured
|
|
98
|
+
### Commands (run.py)
|
|
122
99
|
|
|
123
|
-
|
|
100
|
+
| Command | Description |
|
|
101
|
+
| --------- | ------------------------------------------ |
|
|
102
|
+
| `setup` | Install all dependencies |
|
|
103
|
+
| `build` | Full build process |
|
|
104
|
+
| `dev` | Start demo in dev mode |
|
|
105
|
+
| `clean` | Clean all build artifacts |
|
|
106
|
+
| `publish` | Publish to NPM (dry-run) |
|
|
107
|
+
| `all` | Setup + Build |
|
|
108
|
+
| `test` | Build and start demo |
|
|
124
109
|
|
|
125
|
-
|
|
110
|
+
## Project Structure
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
lime-elements-vue-transpiled/
|
|
114
|
+
├── lime-elements/ # Git submodule (source components)
|
|
115
|
+
├── src/
|
|
116
|
+
│ ├── index.ts # Main entry point
|
|
117
|
+
│ └── components.ts # Generated Vue proxies
|
|
118
|
+
├── config/
|
|
119
|
+
│ └── stencil.config.vue.ts
|
|
120
|
+
├── scripts/
|
|
121
|
+
│ └── post-process.js
|
|
122
|
+
├── dist/ # Build output
|
|
123
|
+
│ ├── index.esm.js
|
|
124
|
+
│ ├── index.cjs.js
|
|
125
|
+
│ └── css/
|
|
126
|
+
├── demo/ # Vue 3 demo app
|
|
127
|
+
├── build.sh
|
|
128
|
+
├── run.py
|
|
129
|
+
└── package.json
|
|
130
|
+
```
|
|
126
131
|
|
|
127
132
|
## License
|
|
128
133
|
|
|
129
|
-
|
|
134
|
+
Apache-2.0
|