@seatsio/seatsio-vue 4.13.0 → 4.14.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 +35 -13
- package/dist/seatsio-vue.js +40 -1
- package/dist/utils/propNormalizer.d.ts +11 -0
- package/package.json +11 -4
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ import { SeatsioSeatingChart } from '@seatsio/seatsio-vue';
|
|
|
31
31
|
|
|
32
32
|
<div style="height: 500px">
|
|
33
33
|
<SeatsioSeatingChart
|
|
34
|
-
|
|
34
|
+
workspace-key="<yourPublicWorkspaceKey>"
|
|
35
35
|
event="<yourEventKey>"
|
|
36
36
|
region="eu"
|
|
37
37
|
/>
|
|
@@ -40,6 +40,28 @@ import { SeatsioSeatingChart } from '@seatsio/seatsio-vue';
|
|
|
40
40
|
|
|
41
41
|
The chart uses 100 % of the width and height of the DOM element (e.g. a div) in which you render it. Play with the size of that element to change the chart size.
|
|
42
42
|
|
|
43
|
+
### Prop naming convention
|
|
44
|
+
|
|
45
|
+
Following Vue.js conventions, all component props can be passed using either kebab-case or camelCase. Both formats are fully supported:
|
|
46
|
+
|
|
47
|
+
```vue
|
|
48
|
+
<!-- Using kebab-case (Vue convention) -->
|
|
49
|
+
<SeatsioSeatingChart
|
|
50
|
+
workspace-key="<yourPublicWorkspaceKey>"
|
|
51
|
+
event="<yourEventKey>"
|
|
52
|
+
region="eu"
|
|
53
|
+
/>
|
|
54
|
+
|
|
55
|
+
<!-- Using camelCase -->
|
|
56
|
+
<SeatsioSeatingChart
|
|
57
|
+
workspaceKey="<yourPublicWorkspaceKey>"
|
|
58
|
+
event="<yourEventKey>"
|
|
59
|
+
region="eu"
|
|
60
|
+
/>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Both examples work identically. For consistency with other Vue components, kebab-case is recommended when using props in templates.
|
|
64
|
+
|
|
43
65
|
### Pricing
|
|
44
66
|
|
|
45
67
|
```vue
|
|
@@ -57,7 +79,7 @@ const pricing: Pricing = {
|
|
|
57
79
|
|
|
58
80
|
<div style="height: 500px">
|
|
59
81
|
<SeatsioSeatingChart
|
|
60
|
-
|
|
82
|
+
workspace-key="<yourPublicWorkspaceKey>"
|
|
61
83
|
event="<yourEventKey>"
|
|
62
84
|
region="eu"
|
|
63
85
|
:pricing="pricing"
|
|
@@ -91,9 +113,9 @@ export default {
|
|
|
91
113
|
// Notice how the event handler is defined with @<eventListener>
|
|
92
114
|
// For more information, see https://vuejs.org/guide/essentials/event-handling.html
|
|
93
115
|
<SeatsioSeatingChart
|
|
94
|
-
|
|
116
|
+
workspace-key="<yourPublicWorkspaceKey>"
|
|
95
117
|
event="<yourEventKey>"
|
|
96
|
-
@
|
|
118
|
+
@render-started="onRenderStarted"
|
|
97
119
|
region="eu"
|
|
98
120
|
/>
|
|
99
121
|
```
|
|
@@ -119,9 +141,9 @@ export default {
|
|
|
119
141
|
}
|
|
120
142
|
|
|
121
143
|
<SeatsioSeatingChart
|
|
122
|
-
|
|
144
|
+
workspace-key="<yourPublicWorkspaceKey>"
|
|
123
145
|
event="<yourEventKey>"
|
|
124
|
-
@
|
|
146
|
+
@chart-rendered="onChartRendered"
|
|
125
147
|
region="eu"
|
|
126
148
|
/>
|
|
127
149
|
```
|
|
@@ -140,10 +162,10 @@ export default {
|
|
|
140
162
|
}
|
|
141
163
|
|
|
142
164
|
<SeatsioSeatingChart
|
|
143
|
-
|
|
165
|
+
workspace-key="<yourPublicWorkspaceKey>"
|
|
144
166
|
event="<yourEventKey>"
|
|
145
167
|
region="eu"
|
|
146
|
-
:
|
|
168
|
+
:object-color="objectColor"
|
|
147
169
|
/>
|
|
148
170
|
```
|
|
149
171
|
|
|
@@ -156,7 +178,7 @@ import { SeatsioEventManager } from '@seatsio/seatsio-vue';
|
|
|
156
178
|
|
|
157
179
|
<div style="height: 500px">
|
|
158
180
|
<SeatsioEventManager
|
|
159
|
-
|
|
181
|
+
secret-key="<yourWorkspaceSecretKey>"
|
|
160
182
|
event="<yourEventKey>"
|
|
161
183
|
mode="<manageObjectStatuses or another mode>"
|
|
162
184
|
region="eu"
|
|
@@ -175,9 +197,9 @@ import { SeatsioDesigner } from '@seatsio/seatsio-vue';
|
|
|
175
197
|
|
|
176
198
|
<div style="height: 500px">
|
|
177
199
|
<SeatsioDesigner
|
|
178
|
-
|
|
200
|
+
secret-key="<yourWorkspaceSecretKey>"
|
|
179
201
|
region="eu"
|
|
180
|
-
@
|
|
202
|
+
@chart-created="onChartCreated"
|
|
181
203
|
/>
|
|
182
204
|
</div>
|
|
183
205
|
```
|
|
@@ -186,8 +208,8 @@ To be able to edit a chart from an embedded designer, you need to specify the ch
|
|
|
186
208
|
|
|
187
209
|
```vue
|
|
188
210
|
<SeatsioDesigner
|
|
189
|
-
|
|
190
|
-
|
|
211
|
+
secret-key="<yourWorkspaceSecretKey>"
|
|
212
|
+
chart-key="<yourChartKey>"
|
|
191
213
|
region="eu"
|
|
192
214
|
/>
|
|
193
215
|
```
|
package/dist/seatsio-vue.js
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createElementBlock } from 'vue';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @vue/shared v3.5.22
|
|
5
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
6
|
+
* @license MIT
|
|
7
|
+
**/
|
|
8
|
+
const cacheStringFunction = (fn) => {
|
|
9
|
+
const cache = /* @__PURE__ */ Object.create(null);
|
|
10
|
+
return ((str) => {
|
|
11
|
+
const hit = cache[str];
|
|
12
|
+
return hit || (cache[str] = fn(str));
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
const camelizeRE = /-\w/g;
|
|
16
|
+
const camelize = cacheStringFunction(
|
|
17
|
+
(str) => {
|
|
18
|
+
return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Normalizes component attributes by converting kebab-case keys to camelCase
|
|
24
|
+
* This enables Vue components to accept props in both kebab-case (Vue convention)
|
|
25
|
+
* and camelCase formats
|
|
26
|
+
* @param attrs - The attributes object to normalize
|
|
27
|
+
* @returns A new object with all keys converted to camelCase
|
|
28
|
+
* @example
|
|
29
|
+
* normalizeAttrs({'workspace-key': 'foo', eventLocation: 'bar'})
|
|
30
|
+
* // returns {workspaceKey: 'foo', eventLocation: 'bar'}
|
|
31
|
+
*/
|
|
32
|
+
function normalizeAttrs(attrs) {
|
|
33
|
+
const normalized = {};
|
|
34
|
+
for (const key in attrs) {
|
|
35
|
+
const camelKey = camelize(key);
|
|
36
|
+
normalized[camelKey] = attrs[key];
|
|
37
|
+
}
|
|
38
|
+
return normalized;
|
|
39
|
+
}
|
|
40
|
+
|
|
3
41
|
var script$3 = defineComponent({
|
|
4
42
|
mounted() {
|
|
5
43
|
this.createAndRenderChart();
|
|
@@ -43,9 +81,10 @@ var script$3 = defineComponent({
|
|
|
43
81
|
}
|
|
44
82
|
},
|
|
45
83
|
propsAndAttrs: function () {
|
|
84
|
+
const normalizedAttrs = normalizeAttrs(this.$attrs);
|
|
46
85
|
let allPropsAndAttrs = {
|
|
47
86
|
...this.$props,
|
|
48
|
-
...
|
|
87
|
+
...normalizedAttrs
|
|
49
88
|
};
|
|
50
89
|
// @ts-ignore
|
|
51
90
|
let {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalizes component attributes by converting kebab-case keys to camelCase
|
|
3
|
+
* This enables Vue components to accept props in both kebab-case (Vue convention)
|
|
4
|
+
* and camelCase formats
|
|
5
|
+
* @param attrs - The attributes object to normalize
|
|
6
|
+
* @returns A new object with all keys converted to camelCase
|
|
7
|
+
* @example
|
|
8
|
+
* normalizeAttrs({'workspace-key': 'foo', eventLocation: 'bar'})
|
|
9
|
+
* // returns {workspaceKey: 'foo', eventLocation: 'bar'}
|
|
10
|
+
*/
|
|
11
|
+
export declare function normalizeAttrs(attrs: Record<string, any>): Record<string, any>;
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seatsio/seatsio-vue",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.14.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"serve": "vue-cli-service serve dev/serve.ts",
|
|
6
6
|
"build": "cross-env NODE_ENV=production && rollup --config build/rollup.config.js --format es",
|
|
7
|
-
"prebuild": "rimraf ./dist"
|
|
7
|
+
"prebuild": "rimraf ./dist",
|
|
8
|
+
"test": "vitest"
|
|
8
9
|
},
|
|
9
10
|
"main": "dist/seatsio-vue.js",
|
|
10
11
|
"types": "dist/index.d.ts",
|
|
@@ -12,7 +13,8 @@
|
|
|
12
13
|
"dist"
|
|
13
14
|
],
|
|
14
15
|
"dependencies": {
|
|
15
|
-
"@seatsio/seatsio-types": "6.4.0"
|
|
16
|
+
"@seatsio/seatsio-types": "6.4.0",
|
|
17
|
+
"@vue/shared": "^3.5.22"
|
|
16
18
|
},
|
|
17
19
|
"devDependencies": {
|
|
18
20
|
"@babel/core": "^7.28.4",
|
|
@@ -22,11 +24,14 @@
|
|
|
22
24
|
"@rollup/plugin-commonjs": "^28.0.6",
|
|
23
25
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
24
26
|
"@rollup/plugin-replace": "^6.0.2",
|
|
27
|
+
"@vitejs/plugin-vue": "^6.0.1",
|
|
25
28
|
"@vue/cli-plugin-babel": "^5.0.9",
|
|
26
29
|
"@vue/cli-plugin-typescript": "~5.0.9",
|
|
27
30
|
"@vue/cli-service": "^5.0.9",
|
|
31
|
+
"@vue/test-utils": "^2.4.6",
|
|
28
32
|
"@vue/tsconfig": "^0.8.1",
|
|
29
33
|
"cross-env": "^10.1.0",
|
|
34
|
+
"happy-dom": "^20.0.2",
|
|
30
35
|
"minimist": "^1.2.8",
|
|
31
36
|
"rimraf": "^6.0.1",
|
|
32
37
|
"rollup": "^2.79.2",
|
|
@@ -35,6 +40,7 @@
|
|
|
35
40
|
"rollup-plugin-vue": "^6.0.0",
|
|
36
41
|
"semver": "7.7.2",
|
|
37
42
|
"typescript": "~5.9.3",
|
|
43
|
+
"vitest": "^3.2.4",
|
|
38
44
|
"vue": "3.5.22",
|
|
39
45
|
"zx": "8.8.4"
|
|
40
46
|
},
|
|
@@ -42,5 +48,6 @@
|
|
|
42
48
|
"vue": "^3.2.47"
|
|
43
49
|
},
|
|
44
50
|
"license": "MIT",
|
|
45
|
-
"sideEffects": false
|
|
51
|
+
"sideEffects": false,
|
|
52
|
+
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
46
53
|
}
|