@seatsio/seatsio-vue 4.12.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 CHANGED
@@ -31,7 +31,7 @@ import { SeatsioSeatingChart } from '@seatsio/seatsio-vue';
31
31
 
32
32
  <div style="height: 500px">
33
33
  <SeatsioSeatingChart
34
- workspaceKey="<yourPublicWorkspaceKey>"
34
+ workspace-key="<yourPublicWorkspaceKey>"
35
35
  event="<yourEventKey>"
36
36
  region="eu"
37
37
  />
@@ -40,21 +40,46 @@ 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
46
68
  import { SeatsioSeatingChart } from '@seatsio/seatsio-vue';
47
69
  import { Pricing } from "@seatsio/seatsio-types";
48
70
 
49
- const pricing: Pricing = [
50
- { category: 1, price: 30 },
51
- { category: 2, price: 40 },
52
- { category: 3, price: 50 }
53
- ]
71
+ const pricing: Pricing = {
72
+ prices: [
73
+ { category: 1, price: 30 },
74
+ { category: 2, price: 40 },
75
+ { category: 3, price: 50 }
76
+ ],
77
+ priceFormatter: price => ('$' + price)
78
+ }
54
79
 
55
80
  <div style="height: 500px">
56
81
  <SeatsioSeatingChart
57
- workspaceKey="<yourPublicWorkspaceKey>"
82
+ workspace-key="<yourPublicWorkspaceKey>"
58
83
  event="<yourEventKey>"
59
84
  region="eu"
60
85
  :pricing="pricing"
@@ -88,9 +113,9 @@ export default {
88
113
  // Notice how the event handler is defined with @&lt;eventListener&gt;
89
114
  // For more information, see https://vuejs.org/guide/essentials/event-handling.html
90
115
  <SeatsioSeatingChart
91
- workspaceKey="<yourPublicWorkspaceKey>"
116
+ workspace-key="<yourPublicWorkspaceKey>"
92
117
  event="<yourEventKey>"
93
- @renderStarted="onRenderStarted"
118
+ @render-started="onRenderStarted"
94
119
  region="eu"
95
120
  />
96
121
  ```
@@ -116,9 +141,9 @@ export default {
116
141
  }
117
142
 
118
143
  <SeatsioSeatingChart
119
- workspaceKey="<yourPublicWorkspaceKey>"
144
+ workspace-key="<yourPublicWorkspaceKey>"
120
145
  event="<yourEventKey>"
121
- @chartRendered="onChartRendered"
146
+ @chart-rendered="onChartRendered"
122
147
  region="eu"
123
148
  />
124
149
  ```
@@ -137,10 +162,10 @@ export default {
137
162
  }
138
163
 
139
164
  <SeatsioSeatingChart
140
- workspaceKey="<yourPublicWorkspaceKey>"
165
+ workspace-key="<yourPublicWorkspaceKey>"
141
166
  event="<yourEventKey>"
142
167
  region="eu"
143
- :objectColor="objectColor"
168
+ :object-color="objectColor"
144
169
  />
145
170
  ```
146
171
 
@@ -153,7 +178,7 @@ import { SeatsioEventManager } from '@seatsio/seatsio-vue';
153
178
 
154
179
  <div style="height: 500px">
155
180
  <SeatsioEventManager
156
- secretKey="<yourWorkspaceSecretKey>"
181
+ secret-key="<yourWorkspaceSecretKey>"
157
182
  event="<yourEventKey>"
158
183
  mode="<manageObjectStatuses or another mode>"
159
184
  region="eu"
@@ -172,9 +197,9 @@ import { SeatsioDesigner } from '@seatsio/seatsio-vue';
172
197
 
173
198
  <div style="height: 500px">
174
199
  <SeatsioDesigner
175
- secretKey="<yourWorkspaceSecretKey>"
200
+ secret-key="<yourWorkspaceSecretKey>"
176
201
  region="eu"
177
- @chartCreated="onChartCreated"
202
+ @chart-created="onChartCreated"
178
203
  />
179
204
  </div>
180
205
  ```
@@ -183,8 +208,8 @@ To be able to edit a chart from an embedded designer, you need to specify the ch
183
208
 
184
209
  ```vue
185
210
  <SeatsioDesigner
186
- secretKey="<yourWorkspaceSecretKey>"
187
- chartKey="<yourChartKey>"
211
+ secret-key="<yourWorkspaceSecretKey>"
212
+ chart-key="<yourChartKey>"
188
213
  region="eu"
189
214
  />
190
215
  ```
@@ -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
- ...this.$attrs
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.12.0",
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
  }