@beeq/vue 1.8.0-beta.8 → 1.8.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/.babelrc +10 -0
- package/README.md +69 -21
- package/eslint.config.js +41 -0
- package/package.json +19 -20
- package/project.json +28 -0
- package/src/components.ts +728 -0
- package/src/{index.d.ts → index.ts} +1 -1
- package/tsconfig.json +14 -0
- package/tsconfig.lib.json +11 -0
- package/src/components.d.ts +0 -43
- package/src/components.js +0 -517
- package/src/components.js.map +0 -1
- package/src/index.js +0 -4
- package/src/index.js.map +0 -1
- package/src/plugin.d.ts +0 -2
- package/src/plugin.js +0 -19
- package/src/plugin.js.map +0 -1
- package/src/vue-component-lib/utils.d.ts +0 -16
- package/src/vue-component-lib/utils.js +0 -196
- package/src/vue-component-lib/utils.js.map +0 -1
package/.babelrc
ADDED
package/README.md
CHANGED
|
@@ -2,35 +2,93 @@
|
|
|
2
2
|
|
|
3
3
|
A lightweight utility that wraps BEEQ custom elements ("web components") so they can be seamlessly integrated into Vue applications.
|
|
4
4
|
|
|
5
|
+
## Why is this necessary?
|
|
6
|
+
|
|
7
|
+
BEEQ can generate Vue component wrappers for your web components. This allows BEEQ components to be used within a Vue 3 application. The benefits of using BEEQ's component wrappers over the standard web components include:
|
|
8
|
+
|
|
9
|
+
- Type checking with your components.
|
|
10
|
+
- Integration with the router link and Vue router.
|
|
11
|
+
- Optionally, form control web components can be used with `v-model`.
|
|
12
|
+
|
|
13
|
+
(*Adapted from the [Stencil official documentation](https://stenciljs.com/docs/vue)*)
|
|
14
|
+
|
|
5
15
|
## Package installation
|
|
6
16
|
|
|
17
|
+
> [!TIP]
|
|
18
|
+
> Please always refer to the [official BEEQ documentation](https://www.beeq.design/3d466e231/p/359a26-for-developers/b/53475d) for more information about the installation.
|
|
19
|
+
|
|
7
20
|
- install the package
|
|
8
21
|
|
|
9
22
|
```
|
|
10
|
-
npm install @beeq/vue
|
|
23
|
+
npm install @beeq/{core,vue}
|
|
11
24
|
```
|
|
12
25
|
|
|
13
|
-
|
|
26
|
+
> [!NOTE]
|
|
27
|
+
> Make sure that you have installed the `@beeq/core` package.
|
|
14
28
|
|
|
29
|
+
### Add BEEQ styles and assets
|
|
30
|
+
|
|
31
|
+
Import BEEQ styles into your application's main style file:
|
|
32
|
+
|
|
33
|
+
```css
|
|
34
|
+
@import "@beeq/core/dist/beeq/beeq.css";
|
|
15
35
|
```
|
|
16
|
-
|
|
36
|
+
|
|
37
|
+
> [!TIP]
|
|
38
|
+
> BEEQ uses SVG icons and these assets are shipped in a separate folder. You can use the `setBasePath` method to set the path to the icons. Make sure that your project bundle the icons in a way that they are accessible from the browser.
|
|
39
|
+
|
|
40
|
+
You can move the icons from the node_modules folder to your assets folder and set the path like this:
|
|
41
|
+
|
|
42
|
+
```js
|
|
43
|
+
// vite.config.js
|
|
44
|
+
import { defineConfig } from "vite";
|
|
45
|
+
import vue from "@vitejs/plugin-vue";
|
|
46
|
+
import vueJsx from "@vitejs/plugin-vue-jsx";
|
|
47
|
+
import { viteStaticCopy } from "vite-plugin-static-copy";
|
|
48
|
+
|
|
49
|
+
export default defineConfig({
|
|
50
|
+
plugins: [
|
|
51
|
+
vue({
|
|
52
|
+
template: {
|
|
53
|
+
compilerOptions: {
|
|
54
|
+
// treat all BEEQ tags as custom elements
|
|
55
|
+
isCustomElement: (tag) => tag.includes("bq-"),
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
}),
|
|
59
|
+
vueJsx(),
|
|
60
|
+
viteStaticCopy({
|
|
61
|
+
targets: [
|
|
62
|
+
{
|
|
63
|
+
src: "./node_modules/@beeq/core/dist/beeq/svg/*",
|
|
64
|
+
dest: "assets/svg",
|
|
65
|
+
},
|
|
66
|
+
// other assets
|
|
67
|
+
],
|
|
68
|
+
}),
|
|
69
|
+
],
|
|
70
|
+
// other configurations
|
|
71
|
+
});
|
|
17
72
|
```
|
|
18
73
|
|
|
19
|
-
|
|
74
|
+
```js
|
|
75
|
+
// main.ts
|
|
76
|
+
import { setBasePath } from '@beeq/core';
|
|
20
77
|
|
|
21
|
-
|
|
22
|
-
npm install @beeq/{core,vue}
|
|
78
|
+
setBasePath('icons/svg');
|
|
23
79
|
```
|
|
24
80
|
|
|
25
|
-
|
|
81
|
+
But you can also use a different icons library or a CDN:
|
|
26
82
|
|
|
27
|
-
|
|
83
|
+
```js
|
|
84
|
+
import { setBasePath } from '@beeq/core';
|
|
28
85
|
|
|
29
|
-
|
|
30
|
-
|
|
86
|
+
// Using heroicons library
|
|
87
|
+
setBasePath('https://cdn.jsdelivr.net/npm/heroicons@2.1.5/24/outline');
|
|
31
88
|
```
|
|
32
89
|
|
|
33
|
-
>
|
|
90
|
+
> [!CAUTION]
|
|
91
|
+
> When using a different icons library, make sure you use the correct icon names provided by the library or the CDN.
|
|
34
92
|
|
|
35
93
|
## Usage
|
|
36
94
|
|
|
@@ -52,13 +110,3 @@ const name = ref('John Doe');
|
|
|
52
110
|
</bq-input>
|
|
53
111
|
</template>
|
|
54
112
|
```
|
|
55
|
-
|
|
56
|
-
## Why is this necessary?
|
|
57
|
-
|
|
58
|
-
BEEQ can generate Vue component wrappers for your web components. This allows BEEQ components to be used within a Vue 3 application. The benefits of using BEEQ's component wrappers over the standard web components include:
|
|
59
|
-
|
|
60
|
-
- Type checking with your components.
|
|
61
|
-
- Integration with the router link and Vue router.
|
|
62
|
-
- Optionally, form control web components can be used with `v-model`.
|
|
63
|
-
|
|
64
|
-
(*Adapted from the [Stencil official documentation](https://stenciljs.com/docs/vue)*)
|
package/eslint.config.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const nxESLint = require('@nx/eslint-plugin');
|
|
2
|
+
const jsoncParser = require('jsonc-eslint-parser');
|
|
3
|
+
const tsESLint = require('typescript-eslint');
|
|
4
|
+
|
|
5
|
+
/** @type { import("eslint").Linter.Config[] } */
|
|
6
|
+
module.exports = [
|
|
7
|
+
...tsESLint.configs.recommended,
|
|
8
|
+
{
|
|
9
|
+
ignores: ['**/src/components.ts'],
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
rules: {
|
|
13
|
+
'@typescript-eslint/ban-ts-comment': 'off',
|
|
14
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
15
|
+
'prefer-const': 'off',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
files: ['**/package.json', '**/project.json'],
|
|
20
|
+
languageOptions: {
|
|
21
|
+
parser: jsoncParser,
|
|
22
|
+
},
|
|
23
|
+
plugins: {
|
|
24
|
+
'@nx': nxESLint,
|
|
25
|
+
},
|
|
26
|
+
rules: {
|
|
27
|
+
'@nx/dependency-checks': [
|
|
28
|
+
'error',
|
|
29
|
+
{
|
|
30
|
+
ignoredDependencies: ['@beeq/core', '@stencil/vue-output-target', 'tslib', 'vue'],
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
files: ['**/*.js'],
|
|
37
|
+
rules: {
|
|
38
|
+
'@typescript-eslint/no-require-imports': 'off',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
];
|
package/package.json
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
2
|
+
"name": "@beeq/vue",
|
|
3
|
+
"version": "1.8.0",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"description": "Vue specific wrapper for BEEQ Design System components",
|
|
6
|
+
"main": "./src/index.js",
|
|
7
|
+
"types": "./src/index.d.ts",
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"@beeq/core": "^1.8.0",
|
|
10
|
+
"@stencil/vue-output-target": "^0.9.0",
|
|
11
|
+
"tslib": "^2.6.3"
|
|
12
|
+
},
|
|
13
|
+
"peerDependencies": {
|
|
14
|
+
"vue": ">=3.3.0"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/Endava/BEEQ"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/project.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "beeq-vue",
|
|
3
|
+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
+
"sourceRoot": "packages/beeq-vue/src",
|
|
5
|
+
"projectType": "library",
|
|
6
|
+
"tags": ["wrapper", "vue", "publishable"],
|
|
7
|
+
"implicitDependencies": ["beeq"],
|
|
8
|
+
"targets": {
|
|
9
|
+
"build": {
|
|
10
|
+
"executor": "@nx/js:tsc",
|
|
11
|
+
"outputs": ["{options.outputPath}"],
|
|
12
|
+
"options": {
|
|
13
|
+
"clean": true,
|
|
14
|
+
"outputPath": "dist/beeq-vue",
|
|
15
|
+
"main": "packages/beeq-vue/src/index.ts",
|
|
16
|
+
"tsConfig": "packages/beeq-vue/tsconfig.lib.json",
|
|
17
|
+
"assets": ["packages/beeq-vue/README.md"]
|
|
18
|
+
},
|
|
19
|
+
"dependsOn": [{ "dependencies": true, "target": "build" }]
|
|
20
|
+
},
|
|
21
|
+
"lint": {
|
|
22
|
+
"executor": "@nx/eslint:lint",
|
|
23
|
+
"options": {
|
|
24
|
+
"lintFilePatterns": ["{projectRoot}/**/*.ts", "{projectRoot}/package.json", "{projectRoot}/project.json"]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|