@xplortech/apollo-data-vue 0.0.3-draft.64d0fa1
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/LICENSE +21 -0
- package/dist/components.d.ts +4 -0
- package/dist/components.js +12 -0
- package/dist/components.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +2 -0
- package/dist/plugin.js +7 -0
- package/dist/plugin.js.map +1 -0
- package/package.json +46 -0
- package/readme.md +111 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type StencilVueComponent } from '@stencil/vue-output-target/runtime';
|
|
2
|
+
import type { JSX } from '@xplortech/apollo-data';
|
|
3
|
+
export declare const ApolloDataBarChart: StencilVueComponent<JSX.ApolloDataBarChart>;
|
|
4
|
+
export declare const ApolloDataDonutChart: StencilVueComponent<JSX.ApolloDataDonutChart>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineContainer } from '@stencil/vue-output-target/runtime';
|
|
2
|
+
import { defineCustomElements } from '@xplortech/apollo-data/loader';
|
|
3
|
+
defineCustomElements();
|
|
4
|
+
export const ApolloDataBarChart = defineContainer('apollo-data-bar-chart', undefined, [
|
|
5
|
+
'adData',
|
|
6
|
+
'adSpec'
|
|
7
|
+
]);
|
|
8
|
+
export const ApolloDataDonutChart = defineContainer('apollo-data-donut-chart', undefined, [
|
|
9
|
+
'adData',
|
|
10
|
+
'adSpec'
|
|
11
|
+
]);
|
|
12
|
+
//# sourceMappingURL=components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.js","sourceRoot":"","sources":["../lib/components.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAA4B,MAAM,oCAAoC,CAAC;AAI/F,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,oBAAoB,EAAE,CAAC;AAEvB,MAAM,CAAC,MAAM,kBAAkB,GAA8D,eAAe,CAAyB,uBAAuB,EAAE,SAAS,EAAE;IACvK,QAAQ;IACR,QAAQ;CACT,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,oBAAoB,GAAgE,eAAe,CAA2B,yBAAyB,EAAE,SAAS,EAAE;IAC/K,QAAQ;IACR,QAAQ;CACT,CAAC,CAAC"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
|
package/dist/plugin.d.ts
ADDED
package/dist/plugin.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../lib/plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,MAAM,CAAC,MAAM,gBAAgB,GAAW;IACtC,OAAO;QACL,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;CACF,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xplortech/apollo-data-vue",
|
|
3
|
+
"version": "0.0.3-draft.64d0fa1",
|
|
4
|
+
"description": "Apollo Data Vue",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"author": "Xplor Technologies",
|
|
8
|
+
"homepage": "https://github.com/xplor/apollo/tree/main/packages/apollo-data-vue#readme",
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/xplor/apollo/issues"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"url": "git+https://github.com/xplor/apollo.git"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"apollo",
|
|
17
|
+
"apollo-data",
|
|
18
|
+
"apollo-data-react",
|
|
19
|
+
"apollo-data-visualization",
|
|
20
|
+
"apollo-data-charts",
|
|
21
|
+
"xplor"
|
|
22
|
+
],
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=18"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public",
|
|
28
|
+
"provenance": false
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"test": "node ./__tests__/apollo-data-vue.test.js",
|
|
32
|
+
"build": "npm run tsc",
|
|
33
|
+
"tsc": "tsc -p . --outDir ./dist"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist"
|
|
37
|
+
],
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@stencil/vue-output-target": "^0.11.8",
|
|
40
|
+
"@xplortech/apollo-data": "0.0.3-draft.64d0fa1"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"typescript": "^5.5.3",
|
|
44
|
+
"vue": "^3.5.22"
|
|
45
|
+
}
|
|
46
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
[](https://stenciljs.com)
|
|
2
|
+
|
|
3
|
+
# Stencil Component Starter
|
|
4
|
+
|
|
5
|
+
> This is a starter project for building a standalone Web Components using Stencil.
|
|
6
|
+
|
|
7
|
+
Stencil is a compiler for building fast web apps using Web Components.
|
|
8
|
+
|
|
9
|
+
Stencil combines the best concepts of the most popular frontend frameworks into a compile-time rather than runtime tool. Stencil takes TypeScript, JSX, a tiny virtual DOM layer, efficient one-way data binding, an asynchronous rendering pipeline (similar to React Fiber), and lazy-loading out of the box, and generates 100% standards-based Web Components that run in any browser supporting the Custom Elements specification.
|
|
10
|
+
|
|
11
|
+
Stencil components are just Web Components, so they work in any major framework or with no framework at all.
|
|
12
|
+
|
|
13
|
+
## Getting Started
|
|
14
|
+
|
|
15
|
+
To start building a new web component using Stencil, clone this repo to a new directory:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
git clone https://github.com/stenciljs/component-starter.git my-component
|
|
19
|
+
cd my-component
|
|
20
|
+
git remote rm origin
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
and run:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install
|
|
27
|
+
npm start
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
To build the component for production, run:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm run build
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
To run the unit tests for the components, run:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npm test
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Need help? Check out our docs [here](https://stenciljs.com/docs/my-first-component).
|
|
43
|
+
|
|
44
|
+
## Naming Components
|
|
45
|
+
|
|
46
|
+
When creating new component tags, we recommend _not_ using `stencil` in the component name (ex: `<stencil-datepicker>`). This is because the generated component has little to nothing to do with Stencil; it's just a web component!
|
|
47
|
+
|
|
48
|
+
Instead, use a prefix that fits your company or any name for a group of related components. For example, all of the [Ionic-generated](https://ionicframework.com/) web components use the prefix `ion`.
|
|
49
|
+
|
|
50
|
+
## Using this component
|
|
51
|
+
|
|
52
|
+
There are two strategies we recommend for using web components built with Stencil.
|
|
53
|
+
|
|
54
|
+
The first step for all two of these strategies is to [publish to NPM](https://docs.npmjs.com/getting-started/publishing-npm-packages).
|
|
55
|
+
|
|
56
|
+
You can read more about these different approaches in the [Stencil docs](https://stenciljs.com/docs/publishing).
|
|
57
|
+
|
|
58
|
+
### Lazy Loading
|
|
59
|
+
|
|
60
|
+
If your Stencil project is built with the [`dist`](https://stenciljs.com/docs/distribution) output target, you can import a small bootstrap script that registers all components and allows you to load individual component scripts lazily.
|
|
61
|
+
|
|
62
|
+
For example, given your Stencil project namespace is called `my-design-system`, to use `my-component` on any website, inject this into your HTML:
|
|
63
|
+
|
|
64
|
+
```html
|
|
65
|
+
<script type="module" src="https://unpkg.com/my-design-system"></script>
|
|
66
|
+
<!--
|
|
67
|
+
To avoid unpkg.com redirects to the actual file, you can also directly import:
|
|
68
|
+
https://unpkg.com/foobar-design-system@0.0.1/dist/foobar-design-system/foobar-design-system.esm.js
|
|
69
|
+
-->
|
|
70
|
+
<my-component first="Stencil" middle="'Don't call me a framework'" last="JS"></my-component>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
This will only load the necessary scripts needed to render `<my-component />`. Once more components of this package are used, they will automatically be loaded lazily.
|
|
74
|
+
|
|
75
|
+
You can also import the script as part of your `node_modules` in your applications entry file:
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
import 'foobar-design-system/dist/foobar-design-system/foobar-design-system.esm.js';
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Check out this [Live Demo](https://stackblitz.com/edit/vitejs-vite-y6v26a?file=src%2Fmain.tsx).
|
|
82
|
+
|
|
83
|
+
### Standalone
|
|
84
|
+
|
|
85
|
+
If you are using a Stencil component library with `dist-custom-elements`, we recommend importing Stencil components individually in those files where they are needed.
|
|
86
|
+
|
|
87
|
+
To export Stencil components as standalone components make sure you have the [`dist-custom-elements`](https://stenciljs.com/docs/custom-elements) output target defined in your `stencil.config.ts`.
|
|
88
|
+
|
|
89
|
+
For example, given you'd like to use `<my-component />` as part of a React component, you can import the component directly via:
|
|
90
|
+
|
|
91
|
+
```tsx
|
|
92
|
+
import 'foobar-design-system/my-component';
|
|
93
|
+
|
|
94
|
+
function App() {
|
|
95
|
+
return (
|
|
96
|
+
<>
|
|
97
|
+
<div>
|
|
98
|
+
<my-component
|
|
99
|
+
first="Stencil"
|
|
100
|
+
middle="'Don't call me a framework'"
|
|
101
|
+
last="JS"
|
|
102
|
+
></my-component>
|
|
103
|
+
</div>
|
|
104
|
+
</>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export default App;
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Check out this [Live Demo](https://stackblitz.com/edit/vitejs-vite-b6zuds?file=src%2FApp.tsx).
|