@beeq/vue 1.0.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 +64 -0
- package/package.json +25 -0
- package/src/components.d.ts +39 -0
- package/src/components.js +399 -0
- package/src/components.js.map +1 -0
- package/src/index.d.ts +2 -0
- package/src/index.js +5 -0
- package/src/index.js.map +1 -0
- package/src/plugin.d.ts +2 -0
- package/src/plugin.js +9 -0
- package/src/plugin.js.map +1 -0
- package/src/vue-component-lib/utils.d.ts +16 -0
- package/src/vue-component-lib/utils.js +170 -0
- package/src/vue-component-lib/utils.js.map +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Vue.js Wrapper for BEEQ
|
|
2
|
+
|
|
3
|
+
A lightweight utility that wraps BEEQ custom elements ("web components") so they can be seamlessly integrated into Vue applications.
|
|
4
|
+
|
|
5
|
+
## Package installation
|
|
6
|
+
|
|
7
|
+
- install the package
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
npm install @bee-q/vue
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
- update the package
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
npm install @bee-q/vue@latest
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
if `@bee-q/core` package is installed you should update both
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
npm install @bee-q/{core,vue}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Add BEEQ styles and assets
|
|
26
|
+
|
|
27
|
+
Make sure that BEEQ main style is imported into your application's main style file:
|
|
28
|
+
|
|
29
|
+
```css
|
|
30
|
+
@import "@bee-q/core/dist/bee-q/bee-q";
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
> ❗️The icons SVG are shipped in a separate folder. Depending on your stack, your project will need to include `node_modules/@bee-q/core/dist/bee-q/svg` in the build in such a way that it respond to: `http://<domain>/svg`
|
|
34
|
+
|
|
35
|
+
## Usage
|
|
36
|
+
|
|
37
|
+
```jsx
|
|
38
|
+
<script setup lang="ts">
|
|
39
|
+
const name = ref('John Doe');
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<template>
|
|
43
|
+
<h1>Hello {{ name }}</h1>
|
|
44
|
+
<bq-input
|
|
45
|
+
name="name"
|
|
46
|
+
placeholder="Please type your name..."
|
|
47
|
+
v-model="name"
|
|
48
|
+
@bqClear="name = ''"
|
|
49
|
+
>
|
|
50
|
+
<label slot="label">Your name</label>
|
|
51
|
+
<bq-icon name="user" slot="prefix"></bq-icon>
|
|
52
|
+
</bq-input>
|
|
53
|
+
</template>
|
|
54
|
+
```
|
|
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/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@beeq/vue",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"description": "Vue specific wrapper for BEEQ Design System components",
|
|
6
|
+
"main": "./src/index.js",
|
|
7
|
+
"module": "./src/index.js",
|
|
8
|
+
"types": "./src/index.d.ts",
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@beeq/core": "*",
|
|
11
|
+
"tslib": "^2.3.0"
|
|
12
|
+
},
|
|
13
|
+
"peerDependencies": {
|
|
14
|
+
"vue": ">=3.3.0"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/Endava/BEEQ"
|
|
19
|
+
},
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public",
|
|
22
|
+
"registry": "https://registry.npmjs.org"
|
|
23
|
+
},
|
|
24
|
+
"type": "module"
|
|
25
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { JSX } from '@beeq/core';
|
|
2
|
+
export declare const BqAccordion: (props: JSX.BqAccordion & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
3
|
+
export declare const BqAccordionGroup: (props: JSX.BqAccordionGroup & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
4
|
+
export declare const BqAlert: (props: JSX.BqAlert & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
5
|
+
export declare const BqAvatar: (props: JSX.BqAvatar & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
6
|
+
export declare const BqBadge: (props: JSX.BqBadge & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
7
|
+
export declare const BqBreadcrumb: (props: JSX.BqBreadcrumb & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
8
|
+
export declare const BqBreadcrumbItem: (props: JSX.BqBreadcrumbItem & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
9
|
+
export declare const BqButton: (props: JSX.BqButton & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
10
|
+
export declare const BqCard: (props: JSX.BqCard & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
11
|
+
export declare const BqCheckbox: (props: JSX.BqCheckbox & import("./vue-component-lib/utils").InputProps<boolean> & {}) => any;
|
|
12
|
+
export declare const BqDialog: (props: JSX.BqDialog & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
13
|
+
export declare const BqDivider: (props: JSX.BqDivider & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
14
|
+
export declare const BqDropdown: (props: JSX.BqDropdown & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
15
|
+
export declare const BqEmptyState: (props: JSX.BqEmptyState & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
16
|
+
export declare const BqIcon: (props: JSX.BqIcon & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
17
|
+
export declare const BqInput: (props: JSX.BqInput & import("./vue-component-lib/utils").InputProps<import("@beeq/core").TInputValue> & {}) => any;
|
|
18
|
+
export declare const BqNotification: (props: JSX.BqNotification & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
19
|
+
export declare const BqOption: (props: JSX.BqOption & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
20
|
+
export declare const BqOptionGroup: (props: JSX.BqOptionGroup & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
21
|
+
export declare const BqOptionList: (props: JSX.BqOptionList & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
22
|
+
export declare const BqPanel: (props: JSX.BqPanel & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
23
|
+
export declare const BqRadio: (props: JSX.BqRadio & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
24
|
+
export declare const BqRadioGroup: (props: JSX.BqRadioGroup & import("./vue-component-lib/utils").InputProps<string> & {}) => any;
|
|
25
|
+
export declare const BqSelect: (props: JSX.BqSelect & import("./vue-component-lib/utils").InputProps<import("@beeq/core").TInputValue> & {}) => any;
|
|
26
|
+
export declare const BqSideMenu: (props: JSX.BqSideMenu & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
27
|
+
export declare const BqSideMenuItem: (props: JSX.BqSideMenuItem & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
28
|
+
export declare const BqSlider: (props: JSX.BqSlider & import("./vue-component-lib/utils").InputProps<string | number | number[]> & {}) => any;
|
|
29
|
+
export declare const BqSpinner: (props: JSX.BqSpinner & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
30
|
+
export declare const BqStatus: (props: JSX.BqStatus & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
31
|
+
export declare const BqStepItem: (props: JSX.BqStepItem & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
32
|
+
export declare const BqSteps: (props: JSX.BqSteps & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
33
|
+
export declare const BqSwitch: (props: JSX.BqSwitch & import("./vue-component-lib/utils").InputProps<boolean> & {}) => any;
|
|
34
|
+
export declare const BqTab: (props: JSX.BqTab & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
35
|
+
export declare const BqTabGroup: (props: JSX.BqTabGroup & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
36
|
+
export declare const BqTag: (props: JSX.BqTag & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
37
|
+
export declare const BqTextarea: (props: JSX.BqTextarea & import("./vue-component-lib/utils").InputProps<string> & {}) => any;
|
|
38
|
+
export declare const BqToast: (props: JSX.BqToast & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
39
|
+
export declare const BqTooltip: (props: JSX.BqTooltip & import("./vue-component-lib/utils").InputProps<string | number | boolean> & {}) => any;
|
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* auto-generated vue proxies */
|
|
4
|
+
import { defineContainer } from './vue-component-lib/utils';
|
|
5
|
+
export const BqAccordion = /*@__PURE__*/ defineContainer('bq-accordion', undefined, [
|
|
6
|
+
'appearance',
|
|
7
|
+
'disabled',
|
|
8
|
+
'expanded',
|
|
9
|
+
'rotate',
|
|
10
|
+
'size',
|
|
11
|
+
'bqClick',
|
|
12
|
+
'bqFocus',
|
|
13
|
+
'bqBlur'
|
|
14
|
+
]);
|
|
15
|
+
export const BqAccordionGroup = /*@__PURE__*/ defineContainer('bq-accordion-group', undefined, [
|
|
16
|
+
'expandAll',
|
|
17
|
+
'multiple'
|
|
18
|
+
]);
|
|
19
|
+
export const BqAlert = /*@__PURE__*/ defineContainer('bq-alert', undefined, [
|
|
20
|
+
'autoDismiss',
|
|
21
|
+
'border',
|
|
22
|
+
'disableClose',
|
|
23
|
+
'hideIcon',
|
|
24
|
+
'open',
|
|
25
|
+
'time',
|
|
26
|
+
'type',
|
|
27
|
+
'sticky',
|
|
28
|
+
'bqHide',
|
|
29
|
+
'bqShow',
|
|
30
|
+
'bqAfterOpen',
|
|
31
|
+
'bqAfterClose'
|
|
32
|
+
]);
|
|
33
|
+
export const BqAvatar = /*@__PURE__*/ defineContainer('bq-avatar', undefined, [
|
|
34
|
+
'altText',
|
|
35
|
+
'image',
|
|
36
|
+
'label',
|
|
37
|
+
'initials',
|
|
38
|
+
'shape',
|
|
39
|
+
'size'
|
|
40
|
+
]);
|
|
41
|
+
export const BqBadge = /*@__PURE__*/ defineContainer('bq-badge', undefined, [
|
|
42
|
+
'backgroundColor',
|
|
43
|
+
'textColor',
|
|
44
|
+
'size'
|
|
45
|
+
]);
|
|
46
|
+
export const BqBreadcrumb = /*@__PURE__*/ defineContainer('bq-breadcrumb', undefined, [
|
|
47
|
+
'ariaLabel',
|
|
48
|
+
'bqBreadcrumbBlur',
|
|
49
|
+
'bqBreadcrumbFocus',
|
|
50
|
+
'bqBreadcrumbClick'
|
|
51
|
+
]);
|
|
52
|
+
export const BqBreadcrumbItem = /*@__PURE__*/ defineContainer('bq-breadcrumb-item', undefined, [
|
|
53
|
+
'ariaLabel',
|
|
54
|
+
'isLastItem',
|
|
55
|
+
'href',
|
|
56
|
+
'target',
|
|
57
|
+
'rel',
|
|
58
|
+
'bqBlur',
|
|
59
|
+
'bqFocus',
|
|
60
|
+
'bqClick'
|
|
61
|
+
]);
|
|
62
|
+
export const BqButton = /*@__PURE__*/ defineContainer('bq-button', undefined, [
|
|
63
|
+
'appearance',
|
|
64
|
+
'block',
|
|
65
|
+
'border',
|
|
66
|
+
'disabled',
|
|
67
|
+
'download',
|
|
68
|
+
'href',
|
|
69
|
+
'justifyContent',
|
|
70
|
+
'loading',
|
|
71
|
+
'size',
|
|
72
|
+
'target',
|
|
73
|
+
'type',
|
|
74
|
+
'variant',
|
|
75
|
+
'bqBlur',
|
|
76
|
+
'bqFocus',
|
|
77
|
+
'bqClick'
|
|
78
|
+
]);
|
|
79
|
+
export const BqCard = /*@__PURE__*/ defineContainer('bq-card', undefined, [
|
|
80
|
+
'type',
|
|
81
|
+
'border'
|
|
82
|
+
]);
|
|
83
|
+
export const BqCheckbox = /*@__PURE__*/ defineContainer('bq-checkbox', undefined, [
|
|
84
|
+
'backgroundOnHover',
|
|
85
|
+
'formId',
|
|
86
|
+
'checked',
|
|
87
|
+
'disabled',
|
|
88
|
+
'indeterminate',
|
|
89
|
+
'name',
|
|
90
|
+
'required',
|
|
91
|
+
'value',
|
|
92
|
+
'bqChange',
|
|
93
|
+
'bqFocus',
|
|
94
|
+
'bqBlur'
|
|
95
|
+
], 'checked', 'bqChange');
|
|
96
|
+
export const BqDialog = /*@__PURE__*/ defineContainer('bq-dialog', undefined, [
|
|
97
|
+
'border',
|
|
98
|
+
'disableBackdrop',
|
|
99
|
+
'disableCloseEscKeydown',
|
|
100
|
+
'disableCloseClickOutside',
|
|
101
|
+
'footerAppearance',
|
|
102
|
+
'hideCloseButton',
|
|
103
|
+
'open',
|
|
104
|
+
'size',
|
|
105
|
+
'bqCancel',
|
|
106
|
+
'bqClose',
|
|
107
|
+
'bqOpen',
|
|
108
|
+
'bqAfterOpen',
|
|
109
|
+
'bqAfterClose'
|
|
110
|
+
]);
|
|
111
|
+
export const BqDivider = /*@__PURE__*/ defineContainer('bq-divider', undefined, [
|
|
112
|
+
'dashed',
|
|
113
|
+
'orientation',
|
|
114
|
+
'strokeColor',
|
|
115
|
+
'titleAlignment',
|
|
116
|
+
'strokeDashWidth',
|
|
117
|
+
'strokeDashGap',
|
|
118
|
+
'strokeThickness',
|
|
119
|
+
'strokeBasis',
|
|
120
|
+
'strokeLinecap'
|
|
121
|
+
]);
|
|
122
|
+
export const BqDropdown = /*@__PURE__*/ defineContainer('bq-dropdown', undefined, [
|
|
123
|
+
'disabled',
|
|
124
|
+
'distance',
|
|
125
|
+
'keepOpenOnSelect',
|
|
126
|
+
'placement',
|
|
127
|
+
'open',
|
|
128
|
+
'panelHeight',
|
|
129
|
+
'sameWidth',
|
|
130
|
+
'skidding',
|
|
131
|
+
'strategy',
|
|
132
|
+
'bqOpen'
|
|
133
|
+
]);
|
|
134
|
+
export const BqEmptyState = /*@__PURE__*/ defineContainer('bq-empty-state', undefined, [
|
|
135
|
+
'size'
|
|
136
|
+
]);
|
|
137
|
+
export const BqIcon = /*@__PURE__*/ defineContainer('bq-icon', undefined, [
|
|
138
|
+
'color',
|
|
139
|
+
'name',
|
|
140
|
+
'size',
|
|
141
|
+
'src',
|
|
142
|
+
'weight',
|
|
143
|
+
'svgLoaded'
|
|
144
|
+
]);
|
|
145
|
+
export const BqInput = /*@__PURE__*/ defineContainer('bq-input', undefined, [
|
|
146
|
+
'autocapitalize',
|
|
147
|
+
'autocomplete',
|
|
148
|
+
'autocorrect',
|
|
149
|
+
'autofocus',
|
|
150
|
+
'clearButtonLabel',
|
|
151
|
+
'debounceTime',
|
|
152
|
+
'disabled',
|
|
153
|
+
'disableClear',
|
|
154
|
+
'form',
|
|
155
|
+
'inputmode',
|
|
156
|
+
'max',
|
|
157
|
+
'maxlength',
|
|
158
|
+
'min',
|
|
159
|
+
'minlength',
|
|
160
|
+
'name',
|
|
161
|
+
'pattern',
|
|
162
|
+
'placeholder',
|
|
163
|
+
'readonly',
|
|
164
|
+
'required',
|
|
165
|
+
'step',
|
|
166
|
+
'type',
|
|
167
|
+
'validationStatus',
|
|
168
|
+
'value',
|
|
169
|
+
'bqBlur',
|
|
170
|
+
'bqChange',
|
|
171
|
+
'bqClear',
|
|
172
|
+
'bqFocus',
|
|
173
|
+
'bqInput'
|
|
174
|
+
], 'value', 'bqChange');
|
|
175
|
+
export const BqNotification = /*@__PURE__*/ defineContainer('bq-notification', undefined, [
|
|
176
|
+
'autoDismiss',
|
|
177
|
+
'border',
|
|
178
|
+
'disableClose',
|
|
179
|
+
'hideIcon',
|
|
180
|
+
'open',
|
|
181
|
+
'time',
|
|
182
|
+
'type',
|
|
183
|
+
'bqHide',
|
|
184
|
+
'bqShow',
|
|
185
|
+
'bqAfterOpen',
|
|
186
|
+
'bqAfterClose'
|
|
187
|
+
]);
|
|
188
|
+
export const BqOption = /*@__PURE__*/ defineContainer('bq-option', undefined, [
|
|
189
|
+
'disabled',
|
|
190
|
+
'value',
|
|
191
|
+
'selected',
|
|
192
|
+
'bqBlur',
|
|
193
|
+
'bqFocus',
|
|
194
|
+
'bqClick',
|
|
195
|
+
'bqEnter'
|
|
196
|
+
]);
|
|
197
|
+
export const BqOptionGroup = /*@__PURE__*/ defineContainer('bq-option-group', undefined);
|
|
198
|
+
export const BqOptionList = /*@__PURE__*/ defineContainer('bq-option-list', undefined, [
|
|
199
|
+
'ariaLabel',
|
|
200
|
+
'bqSelect'
|
|
201
|
+
]);
|
|
202
|
+
export const BqPanel = /*@__PURE__*/ defineContainer('bq-panel', undefined, [
|
|
203
|
+
'distance',
|
|
204
|
+
'placement',
|
|
205
|
+
'open',
|
|
206
|
+
'sameWidth',
|
|
207
|
+
'skidding',
|
|
208
|
+
'strategy'
|
|
209
|
+
]);
|
|
210
|
+
export const BqRadio = /*@__PURE__*/ defineContainer('bq-radio', undefined, [
|
|
211
|
+
'checked',
|
|
212
|
+
'disabled',
|
|
213
|
+
'backgroundOnHover',
|
|
214
|
+
'formId',
|
|
215
|
+
'name',
|
|
216
|
+
'required',
|
|
217
|
+
'value',
|
|
218
|
+
'bqClick',
|
|
219
|
+
'bqFocus',
|
|
220
|
+
'bqBlur',
|
|
221
|
+
'bqKeyDown'
|
|
222
|
+
]);
|
|
223
|
+
export const BqRadioGroup = /*@__PURE__*/ defineContainer('bq-radio-group', undefined, [
|
|
224
|
+
'backgroundOnHover',
|
|
225
|
+
'name',
|
|
226
|
+
'value',
|
|
227
|
+
'disabled',
|
|
228
|
+
'fieldset',
|
|
229
|
+
'orientation',
|
|
230
|
+
'debounceTime',
|
|
231
|
+
'bqChange'
|
|
232
|
+
], 'value', 'bqChange');
|
|
233
|
+
export const BqSelect = /*@__PURE__*/ defineContainer('bq-select', undefined, [
|
|
234
|
+
'autofocus',
|
|
235
|
+
'clearButtonLabel',
|
|
236
|
+
'disabled',
|
|
237
|
+
'disableClear',
|
|
238
|
+
'distance',
|
|
239
|
+
'form',
|
|
240
|
+
'keepOpenOnSelect',
|
|
241
|
+
'name',
|
|
242
|
+
'open',
|
|
243
|
+
'panelHeight',
|
|
244
|
+
'placeholder',
|
|
245
|
+
'placement',
|
|
246
|
+
'readonly',
|
|
247
|
+
'required',
|
|
248
|
+
'sameWidth',
|
|
249
|
+
'skidding',
|
|
250
|
+
'strategy',
|
|
251
|
+
'validationStatus',
|
|
252
|
+
'value',
|
|
253
|
+
'bqBlur',
|
|
254
|
+
'bqClear',
|
|
255
|
+
'bqFocus',
|
|
256
|
+
'bqSelect'
|
|
257
|
+
], 'value', 'bqChange');
|
|
258
|
+
export const BqSideMenu = /*@__PURE__*/ defineContainer('bq-side-menu', undefined, [
|
|
259
|
+
'appearance',
|
|
260
|
+
'collapse',
|
|
261
|
+
'size',
|
|
262
|
+
'bqCollapse',
|
|
263
|
+
'bqSelect'
|
|
264
|
+
]);
|
|
265
|
+
export const BqSideMenuItem = /*@__PURE__*/ defineContainer('bq-side-menu-item', undefined, [
|
|
266
|
+
'active',
|
|
267
|
+
'collapse',
|
|
268
|
+
'disabled',
|
|
269
|
+
'bqBlur',
|
|
270
|
+
'bqFocus',
|
|
271
|
+
'bqClick'
|
|
272
|
+
]);
|
|
273
|
+
export const BqSlider = /*@__PURE__*/ defineContainer('bq-slider', undefined, [
|
|
274
|
+
'disabled',
|
|
275
|
+
'debounceTime',
|
|
276
|
+
'gap',
|
|
277
|
+
'min',
|
|
278
|
+
'max',
|
|
279
|
+
'step',
|
|
280
|
+
'type',
|
|
281
|
+
'valueIndicator',
|
|
282
|
+
'value',
|
|
283
|
+
'bqChange',
|
|
284
|
+
'bqBlur',
|
|
285
|
+
'bqFocus'
|
|
286
|
+
], 'value', 'bqChange');
|
|
287
|
+
export const BqSpinner = /*@__PURE__*/ defineContainer('bq-spinner', undefined, [
|
|
288
|
+
'animation',
|
|
289
|
+
'textPosition',
|
|
290
|
+
'size'
|
|
291
|
+
]);
|
|
292
|
+
export const BqStatus = /*@__PURE__*/ defineContainer('bq-status', undefined, [
|
|
293
|
+
'type'
|
|
294
|
+
]);
|
|
295
|
+
export const BqStepItem = /*@__PURE__*/ defineContainer('bq-step-item', undefined, [
|
|
296
|
+
'size',
|
|
297
|
+
'status',
|
|
298
|
+
'type',
|
|
299
|
+
'bqClick'
|
|
300
|
+
]);
|
|
301
|
+
export const BqSteps = /*@__PURE__*/ defineContainer('bq-steps', undefined, [
|
|
302
|
+
'dividerColor',
|
|
303
|
+
'size',
|
|
304
|
+
'type'
|
|
305
|
+
]);
|
|
306
|
+
export const BqSwitch = /*@__PURE__*/ defineContainer('bq-switch', undefined, [
|
|
307
|
+
'backgroundOnHover',
|
|
308
|
+
'checked',
|
|
309
|
+
'disabled',
|
|
310
|
+
'fullWidth',
|
|
311
|
+
'innerLabel',
|
|
312
|
+
'justifyContent',
|
|
313
|
+
'name',
|
|
314
|
+
'required',
|
|
315
|
+
'reverseOrder',
|
|
316
|
+
'value',
|
|
317
|
+
'bqChange',
|
|
318
|
+
'bqFocus',
|
|
319
|
+
'bqBlur'
|
|
320
|
+
], 'checked', 'bqChange');
|
|
321
|
+
export const BqTab = /*@__PURE__*/ defineContainer('bq-tab', undefined, [
|
|
322
|
+
'active',
|
|
323
|
+
'disabled',
|
|
324
|
+
'size',
|
|
325
|
+
'tabId',
|
|
326
|
+
'controls',
|
|
327
|
+
'bqClick',
|
|
328
|
+
'bqFocus',
|
|
329
|
+
'bqBlur',
|
|
330
|
+
'bqKeyDown'
|
|
331
|
+
]);
|
|
332
|
+
export const BqTabGroup = /*@__PURE__*/ defineContainer('bq-tab-group', undefined, [
|
|
333
|
+
'value',
|
|
334
|
+
'size',
|
|
335
|
+
'debounceTime',
|
|
336
|
+
'disableDivider',
|
|
337
|
+
'bqChange'
|
|
338
|
+
]);
|
|
339
|
+
export const BqTag = /*@__PURE__*/ defineContainer('bq-tag', undefined, [
|
|
340
|
+
'border',
|
|
341
|
+
'clickable',
|
|
342
|
+
'color',
|
|
343
|
+
'disabled',
|
|
344
|
+
'hidden',
|
|
345
|
+
'removable',
|
|
346
|
+
'selected',
|
|
347
|
+
'size',
|
|
348
|
+
'variant',
|
|
349
|
+
'bqClose',
|
|
350
|
+
'bqOpen',
|
|
351
|
+
'bqBlur',
|
|
352
|
+
'bqClick',
|
|
353
|
+
'bqFocus'
|
|
354
|
+
]);
|
|
355
|
+
export const BqTextarea = /*@__PURE__*/ defineContainer('bq-textarea', undefined, [
|
|
356
|
+
'autocapitalize',
|
|
357
|
+
'autocomplete',
|
|
358
|
+
'autocorrect',
|
|
359
|
+
'autofocus',
|
|
360
|
+
'autoGrow',
|
|
361
|
+
'debounceTime',
|
|
362
|
+
'disabled',
|
|
363
|
+
'disableResize',
|
|
364
|
+
'form',
|
|
365
|
+
'maxlength',
|
|
366
|
+
'name',
|
|
367
|
+
'placeholder',
|
|
368
|
+
'readonly',
|
|
369
|
+
'required',
|
|
370
|
+
'rows',
|
|
371
|
+
'spellcheck',
|
|
372
|
+
'validationStatus',
|
|
373
|
+
'value',
|
|
374
|
+
'wrap',
|
|
375
|
+
'bqBlur',
|
|
376
|
+
'bqChange',
|
|
377
|
+
'bqClear',
|
|
378
|
+
'bqFocus',
|
|
379
|
+
'bqInput'
|
|
380
|
+
], 'value', 'bqChange');
|
|
381
|
+
export const BqToast = /*@__PURE__*/ defineContainer('bq-toast', undefined, [
|
|
382
|
+
'border',
|
|
383
|
+
'type',
|
|
384
|
+
'placement',
|
|
385
|
+
'hideIcon',
|
|
386
|
+
'open',
|
|
387
|
+
'time',
|
|
388
|
+
'bqHide',
|
|
389
|
+
'bqShow'
|
|
390
|
+
]);
|
|
391
|
+
export const BqTooltip = /*@__PURE__*/ defineContainer('bq-tooltip', undefined, [
|
|
392
|
+
'distance',
|
|
393
|
+
'hideArrow',
|
|
394
|
+
'placement',
|
|
395
|
+
'sameWidth',
|
|
396
|
+
'displayOn',
|
|
397
|
+
'visible'
|
|
398
|
+
]);
|
|
399
|
+
//# sourceMappingURL=components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.js","sourceRoot":"","sources":["../../../packages/beeq-vue/src/components.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,oBAAoB;AACpB,gCAAgC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAO5D,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC,eAAe,CAAkB,cAAc,EAAE,SAAS,EAAE;IACnG,YAAY;IACZ,UAAU;IACV,UAAU;IACV,QAAQ;IACR,MAAM;IACN,SAAS;IACT,SAAS;IACT,QAAQ;CACT,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC,eAAe,CAAuB,oBAAoB,EAAE,SAAS,EAAE;IACnH,WAAW;IACX,UAAU;CACX,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC,eAAe,CAAc,UAAU,EAAE,SAAS,EAAE;IACvF,aAAa;IACb,QAAQ;IACR,cAAc;IACd,UAAU;IACV,MAAM;IACN,MAAM;IACN,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,aAAa;IACb,cAAc;CACf,CAAC,CAAC;AAGH,MAA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H,MAAM,CAAC,MAAM,KAAK,GAAG,aAAa,CAAC,eAAe,CAAY,QAAQ,EAAE,SAAS,EAAE;IACjF,QAAQ;IACR,WAAW;IACX,OAAO;IACP,UAAU;IACV,QAAQ;IACR,WAAW;IACX,UAAU;IACV,MAAM;IACN,SAAS;IACT,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,SAAS;CACV,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CAAC,eAAe,CAA0C,aAAa,EAAE,SAAS,EAAE;IACzH,gBAAgB;IAChB,cAAc;IACd,aAAa;IACb,WAAW;IACX,UAAU;IACV,cAAc;IACd,UAAU;IACV,eAAe;IACf,MAAM;IACN,WAAW;IACX,MAAM;IACN,aAAa;IACb,UAAU;IACV,UAAU;IACV,MAAM;IACN,YAAY;IACZ,kBAAkB;IAClB,OAAO;IACP,MAAM;IACN,QAAQ;IACR,UAAU;IACV,SAAS;IACT,SAAS;IACT,SAAS;CACV,EACD,OAAO,EAAE,UAAU,CAAC,CAAC;AAGrB,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC,eAAe,CAAc,UAAU,EAAE,SAAS,EAAE;IACvF,QAAQ;IACR,MAAM;IACN,WAAW;IACX,UAAU;IACV,MAAM;IACN,MAAM;IACN,QAAQ;IACR,QAAQ;CACT,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,SAAS,GAAG,aAAa,CAAC,eAAe,CAAgB,YAAY,EAAE,SAAS,EAAE;IAC7F,UAAU;IACV,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,SAAS;CACV,CAAC,CAAC"}
|
package/src/index.d.ts
ADDED
package/src/index.js
ADDED
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/beeq-vue/src/index.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,cAAc;AACd,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
|
package/src/plugin.d.ts
ADDED
package/src/plugin.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../packages/beeq-vue/src/plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9E,MAAM,CAAC,MAAM,OAAO,GAAW;IAC7B,KAAK,CAAC,OAAO;QACX,cAAc,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;YACzB,oBAAoB,EAAE,CAAC;QACzB,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface InputProps<T> {
|
|
2
|
+
modelValue?: T;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Create a callback to define a Vue component wrapper around a Web Component.
|
|
6
|
+
*
|
|
7
|
+
* @prop name - The component tag name (i.e. `ion-button`)
|
|
8
|
+
* @prop componentProps - An array of properties on the
|
|
9
|
+
* component. These usually match up with the @Prop definitions
|
|
10
|
+
* in each component's TSX file.
|
|
11
|
+
* @prop customElement - An option custom element instance to pass
|
|
12
|
+
* to customElements.define. Only set if `includeImportCustomElements: true` in your config.
|
|
13
|
+
* @prop modelProp - The prop that v-model binds to (i.e. value)
|
|
14
|
+
* @prop modelUpdateEvent - The event that is fired from your Web Component when the value changes (i.e. ionChange)
|
|
15
|
+
*/
|
|
16
|
+
export declare const defineContainer: <Props, VModelType = string | number | boolean>(name: string, defineCustomElement: any, componentProps?: string[], modelProp?: string, modelUpdateEvent?: string) => (props: Props & InputProps<VModelType> & {}) => any;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
// It's easier and safer for Volar to disable typechecking and let the return type inference do its job.
|
|
3
|
+
import { defineComponent, getCurrentInstance, h, inject, ref, withDirectives } from 'vue';
|
|
4
|
+
const UPDATE_VALUE_EVENT = 'update:modelValue';
|
|
5
|
+
const MODEL_VALUE = 'modelValue';
|
|
6
|
+
const ROUTER_LINK_VALUE = 'routerLink';
|
|
7
|
+
const NAV_MANAGER = 'navManager';
|
|
8
|
+
const ROUTER_PROP_PREFIX = 'router';
|
|
9
|
+
const ARIA_PROP_PREFIX = 'aria';
|
|
10
|
+
/**
|
|
11
|
+
* Starting in Vue 3.1.0, all properties are
|
|
12
|
+
* added as keys to the props object, even if
|
|
13
|
+
* they are not being used. In order to correctly
|
|
14
|
+
* account for both value props and v-model props,
|
|
15
|
+
* we need to check if the key exists for Vue <3.1.0
|
|
16
|
+
* and then check if it is not undefined for Vue >= 3.1.0.
|
|
17
|
+
* See https://github.com/vuejs/vue-next/issues/3889
|
|
18
|
+
*/
|
|
19
|
+
const EMPTY_PROP = Symbol();
|
|
20
|
+
const DEFAULT_EMPTY_PROP = { default: EMPTY_PROP };
|
|
21
|
+
const getComponentClasses = (classes) => {
|
|
22
|
+
return (classes === null || classes === void 0 ? void 0 : classes.split(' ')) || [];
|
|
23
|
+
};
|
|
24
|
+
const getElementClasses = (ref, componentClasses, defaultClasses = []) => {
|
|
25
|
+
var _a;
|
|
26
|
+
return [...Array.from(((_a = ref.value) === null || _a === void 0 ? void 0 : _a.classList) || []), ...defaultClasses].filter((c, i, self) => !componentClasses.has(c) && self.indexOf(c) === i);
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Create a callback to define a Vue component wrapper around a Web Component.
|
|
30
|
+
*
|
|
31
|
+
* @prop name - The component tag name (i.e. `ion-button`)
|
|
32
|
+
* @prop componentProps - An array of properties on the
|
|
33
|
+
* component. These usually match up with the @Prop definitions
|
|
34
|
+
* in each component's TSX file.
|
|
35
|
+
* @prop customElement - An option custom element instance to pass
|
|
36
|
+
* to customElements.define. Only set if `includeImportCustomElements: true` in your config.
|
|
37
|
+
* @prop modelProp - The prop that v-model binds to (i.e. value)
|
|
38
|
+
* @prop modelUpdateEvent - The event that is fired from your Web Component when the value changes (i.e. ionChange)
|
|
39
|
+
*/
|
|
40
|
+
export const defineContainer = (name, defineCustomElement, componentProps = [], modelProp, modelUpdateEvent) => {
|
|
41
|
+
/**
|
|
42
|
+
* Create a Vue component wrapper around a Web Component.
|
|
43
|
+
* Note: The `props` here are not all properties on a component.
|
|
44
|
+
* They refer to whatever properties are set on an instance of a component.
|
|
45
|
+
*/
|
|
46
|
+
if (defineCustomElement !== undefined) {
|
|
47
|
+
defineCustomElement();
|
|
48
|
+
}
|
|
49
|
+
const Container = defineComponent((props, { attrs, slots, emit }) => {
|
|
50
|
+
var _a;
|
|
51
|
+
let modelPropValue = props[modelProp];
|
|
52
|
+
const containerRef = ref();
|
|
53
|
+
const classes = new Set(getComponentClasses(attrs.class));
|
|
54
|
+
/**
|
|
55
|
+
* This directive is responsible for updating any reactive
|
|
56
|
+
* reference associated with v-model on the component.
|
|
57
|
+
* This code must be run inside of the "created" callback.
|
|
58
|
+
* Since the following listener callbacks as well as any potential
|
|
59
|
+
* event callback defined in the developer's app are set on
|
|
60
|
+
* the same element, we need to make sure the following callbacks
|
|
61
|
+
* are set first so they fire first. If the developer's callback fires first
|
|
62
|
+
* then the reactive reference will not have been updated yet.
|
|
63
|
+
*/
|
|
64
|
+
const vModelDirective = {
|
|
65
|
+
created: (el) => {
|
|
66
|
+
const eventsNames = Array.isArray(modelUpdateEvent) ? modelUpdateEvent : [modelUpdateEvent];
|
|
67
|
+
eventsNames.forEach((eventName) => {
|
|
68
|
+
el.addEventListener(eventName.toLowerCase(), (e) => {
|
|
69
|
+
modelPropValue = (e === null || e === void 0 ? void 0 : e.target)[modelProp];
|
|
70
|
+
emit(UPDATE_VALUE_EVENT, modelPropValue);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
const currentInstance = getCurrentInstance();
|
|
76
|
+
const hasRouter = (_a = currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.appContext) === null || _a === void 0 ? void 0 : _a.provides[NAV_MANAGER];
|
|
77
|
+
const navManager = hasRouter ? inject(NAV_MANAGER) : undefined;
|
|
78
|
+
const handleRouterLink = (ev) => {
|
|
79
|
+
const { routerLink } = props;
|
|
80
|
+
if (routerLink === EMPTY_PROP)
|
|
81
|
+
return;
|
|
82
|
+
if (navManager !== undefined) {
|
|
83
|
+
let navigationPayload = { event: ev };
|
|
84
|
+
for (const key in props) {
|
|
85
|
+
const value = props[key];
|
|
86
|
+
if (props.hasOwnProperty(key) && key.startsWith(ROUTER_PROP_PREFIX) && value !== EMPTY_PROP) {
|
|
87
|
+
navigationPayload[key] = value;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
navManager.navigate(navigationPayload);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
console.warn('Tried to navigate, but no router was found. Make sure you have mounted Vue Router.');
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
return () => {
|
|
97
|
+
modelPropValue = props[modelProp];
|
|
98
|
+
getComponentClasses(attrs.class).forEach((value) => {
|
|
99
|
+
classes.add(value);
|
|
100
|
+
});
|
|
101
|
+
const oldClick = props.onClick;
|
|
102
|
+
const handleClick = (ev) => {
|
|
103
|
+
if (oldClick !== undefined) {
|
|
104
|
+
oldClick(ev);
|
|
105
|
+
}
|
|
106
|
+
if (!ev.defaultPrevented) {
|
|
107
|
+
handleRouterLink(ev);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
let propsToAdd = {
|
|
111
|
+
ref: containerRef,
|
|
112
|
+
class: getElementClasses(containerRef, classes),
|
|
113
|
+
onClick: handleClick,
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* We can use Object.entries here
|
|
117
|
+
* to avoid the hasOwnProperty check,
|
|
118
|
+
* but that would require 2 iterations
|
|
119
|
+
* where as this only requires 1.
|
|
120
|
+
*/
|
|
121
|
+
for (const key in props) {
|
|
122
|
+
const value = props[key];
|
|
123
|
+
if ((props.hasOwnProperty(key) && value !== EMPTY_PROP) || key.startsWith(ARIA_PROP_PREFIX)) {
|
|
124
|
+
propsToAdd[key] = value;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (modelProp) {
|
|
128
|
+
/**
|
|
129
|
+
* If form value property was set using v-model
|
|
130
|
+
* then we should use that value.
|
|
131
|
+
* Otherwise, check to see if form value property
|
|
132
|
+
* was set as a static value (i.e. no v-model).
|
|
133
|
+
*/
|
|
134
|
+
if (props[MODEL_VALUE] !== EMPTY_PROP) {
|
|
135
|
+
propsToAdd = {
|
|
136
|
+
...propsToAdd,
|
|
137
|
+
[modelProp]: props[MODEL_VALUE],
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
else if (modelPropValue !== EMPTY_PROP) {
|
|
141
|
+
propsToAdd = {
|
|
142
|
+
...propsToAdd,
|
|
143
|
+
[modelProp]: modelPropValue,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* vModelDirective is only needed on components that support v-model.
|
|
149
|
+
* As a result, we conditionally call withDirectives with v-model components.
|
|
150
|
+
*/
|
|
151
|
+
const node = h(name, propsToAdd, slots.default && slots.default());
|
|
152
|
+
return modelProp === undefined ? node : withDirectives(node, [[vModelDirective]]);
|
|
153
|
+
};
|
|
154
|
+
});
|
|
155
|
+
if (typeof Container !== 'function') {
|
|
156
|
+
Container.name = name;
|
|
157
|
+
Container.props = {
|
|
158
|
+
[ROUTER_LINK_VALUE]: DEFAULT_EMPTY_PROP,
|
|
159
|
+
};
|
|
160
|
+
componentProps.forEach((componentProp) => {
|
|
161
|
+
Container.props[componentProp] = DEFAULT_EMPTY_PROP;
|
|
162
|
+
});
|
|
163
|
+
if (modelProp) {
|
|
164
|
+
Container.props[MODEL_VALUE] = DEFAULT_EMPTY_PROP;
|
|
165
|
+
Container.emits = [UPDATE_VALUE_EVENT];
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return Container;
|
|
169
|
+
};
|
|
170
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