test-bentoweb-ui 1.0.46 → 1.0.50
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 +181 -29
- package/dist/bentoweb-ui.css +1 -5
- package/dist/bentoweb-ui.es.js +15633 -9921
- package/dist/bentoweb-ui.umd.js +42 -15
- package/dist/images/toylaxy-banner.jpg +0 -0
- package/package.json +2 -1
package/README.md
CHANGED
@@ -1,29 +1,181 @@
|
|
1
|
-
# bentoweb-ui
|
2
|
-
|
3
|
-
This template should help get you started developing with Vue 3 in Vite.
|
4
|
-
|
5
|
-
## Recommended IDE Setup
|
6
|
-
|
7
|
-
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
|
8
|
-
|
9
|
-
## Customize configuration
|
10
|
-
|
11
|
-
See [Vite Configuration Reference](https://vitejs.dev/config/).
|
12
|
-
|
13
|
-
## Project Setup
|
14
|
-
|
15
|
-
```sh
|
16
|
-
npm install
|
17
|
-
```
|
18
|
-
|
19
|
-
### Compile and Hot-Reload for Development
|
20
|
-
|
21
|
-
```sh
|
22
|
-
npm run dev
|
23
|
-
```
|
24
|
-
|
25
|
-
### Compile and Minify for Production
|
26
|
-
|
27
|
-
```sh
|
28
|
-
npm run build
|
29
|
-
```
|
1
|
+
# bentoweb-ui
|
2
|
+
|
3
|
+
This template should help get you started developing with Vue 3 in Vite.
|
4
|
+
|
5
|
+
## Recommended IDE Setup
|
6
|
+
|
7
|
+
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
|
8
|
+
|
9
|
+
## Customize configuration
|
10
|
+
|
11
|
+
See [Vite Configuration Reference](https://vitejs.dev/config/).
|
12
|
+
|
13
|
+
## Project Setup
|
14
|
+
|
15
|
+
```sh
|
16
|
+
npm install
|
17
|
+
```
|
18
|
+
|
19
|
+
### Compile and Hot-Reload for Development
|
20
|
+
|
21
|
+
```sh
|
22
|
+
npm run dev
|
23
|
+
```
|
24
|
+
|
25
|
+
### Compile and Minify for Production
|
26
|
+
|
27
|
+
```sh
|
28
|
+
npm run build
|
29
|
+
```
|
30
|
+
|
31
|
+
# Bento UI Components
|
32
|
+
|
33
|
+
## Swiper Components
|
34
|
+
|
35
|
+
The Swiper components have been updated to use the official Swiper Element (WebComponent) instead of the deprecated vue-awesome-swiper.
|
36
|
+
|
37
|
+
### SwiperBanner Usage
|
38
|
+
|
39
|
+
```vue
|
40
|
+
<template>
|
41
|
+
<SwiperBanner :BannerImage="bannerImages" size="xl" />
|
42
|
+
</template>
|
43
|
+
|
44
|
+
<script>
|
45
|
+
import { SwiperBanner } from 'test-bentoweb-ui';
|
46
|
+
|
47
|
+
export default {
|
48
|
+
components: {
|
49
|
+
SwiperBanner
|
50
|
+
},
|
51
|
+
data() {
|
52
|
+
return {
|
53
|
+
bannerImages: [
|
54
|
+
{
|
55
|
+
src: '/images/platform-btw.jpg',
|
56
|
+
link: '/platform'
|
57
|
+
},
|
58
|
+
{
|
59
|
+
src: '/images/t-shirt.jpg',
|
60
|
+
link: '/products'
|
61
|
+
},
|
62
|
+
{
|
63
|
+
src: 'https://example.com/external-image.jpg',
|
64
|
+
link: '/external'
|
65
|
+
}
|
66
|
+
]
|
67
|
+
}
|
68
|
+
}
|
69
|
+
}
|
70
|
+
</script>
|
71
|
+
```
|
72
|
+
|
73
|
+
#### Props
|
74
|
+
|
75
|
+
| Prop | Type | Default | Description |
|
76
|
+
|------|------|---------|-------------|
|
77
|
+
| BannerImage | Array | required | Array of objects with `src` and `link` properties |
|
78
|
+
| size | String | 'xl' | Size of the banner. Options: 'xl' (full banner with pagination) or 'm' (interactive style) |
|
79
|
+
|
80
|
+
The `src` property can be:
|
81
|
+
- A path relative to the public directory (e.g., `/images/example.jpg`)
|
82
|
+
- An absolute URL (e.g., `https://example.com/image.jpg`)
|
83
|
+
|
84
|
+
The `link` property can be:
|
85
|
+
- A Vue Router path for internal navigation (e.g., `/products`)
|
86
|
+
- An external URL (e.g., `https://example.com`) which will open in a new tab
|
87
|
+
|
88
|
+
### Swiper Element Attributes
|
89
|
+
|
90
|
+
When using Swiper Element (WebComponent), attributes must be passed as strings rather than bound objects:
|
91
|
+
|
92
|
+
```vue
|
93
|
+
<!-- Correct -->
|
94
|
+
<swiper-container
|
95
|
+
slides-per-view="1"
|
96
|
+
pagination="true"
|
97
|
+
pagination-clickable="true"
|
98
|
+
autoplay-delay="2500"
|
99
|
+
breakpoints='{"768": {"slidesPerView": 2}}'
|
100
|
+
>
|
101
|
+
</swiper-container>
|
102
|
+
|
103
|
+
<!-- Incorrect - will display as [object Object] -->
|
104
|
+
<swiper-container
|
105
|
+
:pagination="{ clickable: true }"
|
106
|
+
:autoplay="{ delay: 2500 }"
|
107
|
+
>
|
108
|
+
</swiper-container>
|
109
|
+
```
|
110
|
+
|
111
|
+
For complex options like breakpoints, use a JSON string.
|
112
|
+
|
113
|
+
### CSS Styling
|
114
|
+
|
115
|
+
Swiper Element uses Shadow DOM, so CSS selectors need to use `::part()` to target internal elements. The element name must be included in the selector:
|
116
|
+
|
117
|
+
```css
|
118
|
+
/* Correct way to target Shadow DOM parts */
|
119
|
+
swiper-container.banner-full::part(pagination) {
|
120
|
+
text-align: left;
|
121
|
+
padding-left: 0.9375rem;
|
122
|
+
}
|
123
|
+
|
124
|
+
swiper-container.banner-full::part(bullet) {
|
125
|
+
background-color: white;
|
126
|
+
width: 0.4375rem;
|
127
|
+
height: 0.4375rem;
|
128
|
+
}
|
129
|
+
|
130
|
+
swiper-container.banner-full::part(bullet-active) {
|
131
|
+
width: 0.9375rem;
|
132
|
+
border-radius: 0.3125rem;
|
133
|
+
}
|
134
|
+
|
135
|
+
/* This won't work */
|
136
|
+
.banner-full ::part(bullet) {
|
137
|
+
background-color: white;
|
138
|
+
}
|
139
|
+
```
|
140
|
+
|
141
|
+
Available parts include: `container`, `wrapper`, `slide`, `pagination`, `bullet`, `bullet-active`, and more. See the [Swiper Element documentation](https://swiperjs.com/element#parts) for a complete list.
|
142
|
+
|
143
|
+
### SwiperInteractive Usage (Deprecated)
|
144
|
+
|
145
|
+
The SwiperInteractive component is now deprecated. Please use the SwiperBanner component with `size="m"` instead:
|
146
|
+
|
147
|
+
```vue
|
148
|
+
<template>
|
149
|
+
<SwiperBanner :BannerImage="interactiveImages" size="m" />
|
150
|
+
</template>
|
151
|
+
|
152
|
+
<script>
|
153
|
+
import { SwiperBanner } from 'test-bentoweb-ui';
|
154
|
+
|
155
|
+
export default {
|
156
|
+
components: {
|
157
|
+
SwiperBanner
|
158
|
+
},
|
159
|
+
data() {
|
160
|
+
return {
|
161
|
+
interactiveImages: [
|
162
|
+
{
|
163
|
+
src: '/images/platform-btw.jpg',
|
164
|
+
link: '/platform'
|
165
|
+
},
|
166
|
+
{
|
167
|
+
src: '/images/t-shirt.jpg',
|
168
|
+
link: '/products'
|
169
|
+
},
|
170
|
+
{
|
171
|
+
src: '/images/vdo.jpg',
|
172
|
+
link: '/videos'
|
173
|
+
}
|
174
|
+
]
|
175
|
+
}
|
176
|
+
}
|
177
|
+
}
|
178
|
+
</script>
|
179
|
+
```
|
180
|
+
|
181
|
+
The same path handling rules apply as for the standard SwiperBanner usage. Make sure your Vue Router is properly configured to handle these routes.
|