@seatsio/seatsio-vue 4.13.0 → 4.15.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,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
- workspaceKey="<yourPublicWorkspaceKey>"
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 @&lt;eventListener&gt;
92
114
  // For more information, see https://vuejs.org/guide/essentials/event-handling.html
93
115
  <SeatsioSeatingChart
94
- workspaceKey="<yourPublicWorkspaceKey>"
116
+ workspace-key="<yourPublicWorkspaceKey>"
95
117
  event="<yourEventKey>"
96
- @renderStarted="onRenderStarted"
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
- workspaceKey="<yourPublicWorkspaceKey>"
144
+ workspace-key="<yourPublicWorkspaceKey>"
123
145
  event="<yourEventKey>"
124
- @chartRendered="onChartRendered"
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
- workspaceKey="<yourPublicWorkspaceKey>"
165
+ workspace-key="<yourPublicWorkspaceKey>"
144
166
  event="<yourEventKey>"
145
167
  region="eu"
146
- :objectColor="objectColor"
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
- secretKey="<yourWorkspaceSecretKey>"
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
- secretKey="<yourWorkspaceSecretKey>"
200
+ secret-key="<yourWorkspaceSecretKey>"
179
201
  region="eu"
180
- @chartCreated="onChartCreated"
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
- secretKey="<yourWorkspaceSecretKey>"
190
- chartKey="<yourChartKey>"
211
+ secret-key="<yourWorkspaceSecretKey>"
212
+ chart-key="<yourChartKey>"
191
213
  region="eu"
192
214
  />
193
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.13.0",
3
+ "version": "4.15.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,35 +13,40 @@
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
- "@babel/core": "^7.28.4",
19
- "@babel/preset-env": "^7.28.3",
20
- "@rollup/plugin-alias": "^5.1.1",
21
- "@rollup/plugin-babel": "^6.0.4",
22
- "@rollup/plugin-commonjs": "^28.0.6",
23
- "@rollup/plugin-node-resolve": "^16.0.1",
24
- "@rollup/plugin-replace": "^6.0.2",
25
- "@vue/cli-plugin-babel": "^5.0.9",
26
- "@vue/cli-plugin-typescript": "~5.0.9",
27
- "@vue/cli-service": "^5.0.9",
28
- "@vue/tsconfig": "^0.8.1",
29
- "cross-env": "^10.1.0",
30
- "minimist": "^1.2.8",
31
- "rimraf": "^6.0.1",
32
- "rollup": "^2.79.2",
33
- "rollup-plugin-terser": "^7.0.2",
34
- "rollup-plugin-typescript2": "^0.36.0",
35
- "rollup-plugin-vue": "^6.0.0",
36
- "semver": "7.7.2",
20
+ "@babel/core": "7.28.5",
21
+ "@babel/preset-env": "7.28.5",
22
+ "@rollup/plugin-babel": "6.1.0",
23
+ "@rollup/plugin-commonjs": "29.0.0",
24
+ "@rollup/plugin-node-resolve": "16.0.3",
25
+ "@rollup/plugin-replace": "6.0.3",
26
+ "@vitejs/plugin-vue": "6.0.1",
27
+ "@vue/cli-plugin-babel": "5.0.9",
28
+ "@vue/cli-plugin-typescript": "5.0.9",
29
+ "@vue/cli-service": "5.0.9",
30
+ "@vue/test-utils": "2.4.6",
31
+ "@vue/tsconfig": "0.8.1",
32
+ "cross-env": "10.1.0",
33
+ "happy-dom": "20.0.10",
34
+ "minimist": "1.2.8",
35
+ "rimraf": "6.1.0",
36
+ "rollup": "2.79.2",
37
+ "rollup-plugin-terser": "7.0.2",
38
+ "rollup-plugin-typescript2": "0.36.0",
39
+ "rollup-plugin-vue": "6.0.0",
40
+ "semver": "7.7.3",
37
41
  "typescript": "~5.9.3",
42
+ "vitest": "4.0.6",
38
43
  "vue": "3.5.22",
39
- "zx": "8.8.4"
44
+ "zx": "8.8.5"
40
45
  },
41
46
  "peerDependencies": {
42
47
  "vue": "^3.2.47"
43
48
  },
44
49
  "license": "MIT",
45
- "sideEffects": false
50
+ "sideEffects": false,
51
+ "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
46
52
  }