@seatlayer/js 0.56.0 → 0.58.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 +28 -0
- package/dist/{channelsMode-CFxx1jp3.d.cts → channelsMode-2z9HBOAX.d.cts} +35 -0
- package/dist/{channelsMode-CFxx1jp3.d.ts → channelsMode-2z9HBOAX.d.ts} +35 -0
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +20 -15
- package/dist/index.d.ts +20 -15
- package/dist/index.js +4 -4
- package/dist/manager.cjs +138 -108
- package/dist/manager.d.cts +2 -2
- package/dist/manager.d.ts +2 -2
- package/dist/manager.js +141 -111
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -225,6 +225,7 @@ designer.mount();
|
|
|
225
225
|
`new SeatingChart(options)` — options: `container` (selector or element, required),
|
|
226
226
|
`event` (key, required), `apiBase?`, `maxSelection?` (default 10),
|
|
227
227
|
`selectedObjects?`, `selectableObjects?`, `numberOfPlacesToSelect?`,
|
|
228
|
+
`selectionValidators?`,
|
|
228
229
|
`onSelectionChange?`, `onSelectionValidityChange?`, `onHold?`,
|
|
229
230
|
`onHoldRestored?`, `onError?`.
|
|
230
231
|
|
|
@@ -232,6 +233,33 @@ Selection methods: `getSelection()`, `selectObjects()`, `deselectObjects()`,
|
|
|
232
233
|
`clearSelection()`, `selectCategories()`, `deselectCategories()`,
|
|
233
234
|
`setSelectableObjects()`, `setMaxSelection()`, `getSelectionValidity()`.
|
|
234
235
|
|
|
236
|
+
Selection validators are local buyer guidance and a pre-hold guard. They do not
|
|
237
|
+
replace the server's authoritative availability, ticket-option, or companion
|
|
238
|
+
checks:
|
|
239
|
+
|
|
240
|
+
```js
|
|
241
|
+
new SeatPicker({
|
|
242
|
+
container: '#seats',
|
|
243
|
+
event: 'ev_xxx',
|
|
244
|
+
selectionValidators: [
|
|
245
|
+
{ type: 'minimumSelectedPlaces', minimum: 2 },
|
|
246
|
+
{ type: 'consecutiveSeats' },
|
|
247
|
+
{ type: 'noOrphanSeats' },
|
|
248
|
+
],
|
|
249
|
+
onSelectionValidityChange: ({ isValid, violations }) => {
|
|
250
|
+
checkoutButton.disabled = !isValid;
|
|
251
|
+
warning.textContent = violations.join(', ');
|
|
252
|
+
},
|
|
253
|
+
});
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
`consecutiveSeats` means one uninterrupted run in the same row and category.
|
|
257
|
+
`noOrphanSeats` rejects a choice that strands one free seat between unavailable
|
|
258
|
+
neighbours. The full `SeatPicker` disables checkout and shows localized advice;
|
|
259
|
+
bare `SeatingChart.hold()` rejects an invalid selection with
|
|
260
|
+
`code: 'selection_invalid'`. Exact-count failures keep the existing
|
|
261
|
+
`selection_count_mismatch` code.
|
|
262
|
+
|
|
235
263
|
Lifecycle/hold methods: `render()`, `hold()`, `bestAvailable(qty, categoryKey?)`,
|
|
236
264
|
`resumeHold(holdId)`, `getCurrentHold()`, `releaseLabels(labels)`, `release()`,
|
|
237
265
|
`destroy()`.
|
|
@@ -1182,6 +1182,15 @@ interface SeatManagerOptions {
|
|
|
1182
1182
|
tokenExpiresAt?: number;
|
|
1183
1183
|
/** Initial mode. Default 'view'. */
|
|
1184
1184
|
mode?: SeatManagerMode;
|
|
1185
|
+
/**
|
|
1186
|
+
* Which tools the cockpit offers. Default: every tool the token's
|
|
1187
|
+
* capabilities permit. Listing a tool never grants it — capabilities still
|
|
1188
|
+
* gate Categories, Tables and Channels — this only HIDES tools a host has no
|
|
1189
|
+
* use for (a dashboard that does not consume `onSelectionChange` should not
|
|
1190
|
+
* show a Select tab that leads nowhere). Monitor ('view') is always kept:
|
|
1191
|
+
* it is the fail-closed fallback for every refused mode.
|
|
1192
|
+
*/
|
|
1193
|
+
tools?: SeatManagerMode[];
|
|
1185
1194
|
/** Public labels to preselect after live inventory has loaded in Select mode. */
|
|
1186
1195
|
selectedObjects?: string[];
|
|
1187
1196
|
/**
|
|
@@ -1695,7 +1704,31 @@ declare class SeatManager {
|
|
|
1695
1704
|
private filterableSections;
|
|
1696
1705
|
private applyFilteredSectionCanvas;
|
|
1697
1706
|
private buildSectionOptions;
|
|
1707
|
+
/**
|
|
1708
|
+
* A tool is offered when the token's capability permits it AND the host has
|
|
1709
|
+
* not hidden it through `options.tools`. No channel-view capability ⇒ the
|
|
1710
|
+
* pill is not rendered at all: a hidden control is honest about authority;
|
|
1711
|
+
* a disabled one advertises it. Authority, not readiness — the Channels
|
|
1712
|
+
* pill must never wait on the lazy module. Monitor is always available; it
|
|
1713
|
+
* is where every refused mode lands.
|
|
1714
|
+
*/
|
|
1715
|
+
private toolAvailable;
|
|
1716
|
+
/**
|
|
1717
|
+
* Re-run the availability gate against freshly-loaded facts. `options.mode`
|
|
1718
|
+
* and a deep link are both accepted before the chart exists, so this is where
|
|
1719
|
+
* a now-impossible tool is exchanged for Monitor.
|
|
1720
|
+
*/
|
|
1721
|
+
private settleMode;
|
|
1722
|
+
/** Every table object on the chart, across floors. */
|
|
1723
|
+
private tables;
|
|
1698
1724
|
private paintModeTabs;
|
|
1725
|
+
/**
|
|
1726
|
+
* Every rail opens the same way: what the tool is called, whether it changes
|
|
1727
|
+
* anything (and for whom), and one plain sentence on how to use it. An
|
|
1728
|
+
* operator switching tabs should never have to guess whether a click here
|
|
1729
|
+
* touches live inventory.
|
|
1730
|
+
*/
|
|
1731
|
+
private railHeader;
|
|
1699
1732
|
private paintFollowLiveButton;
|
|
1700
1733
|
private paintHeatButton;
|
|
1701
1734
|
private paintMomentumHelp;
|
|
@@ -1715,6 +1748,8 @@ declare class SeatManager {
|
|
|
1715
1748
|
private renderSelectRail;
|
|
1716
1749
|
private paintSelectSelection;
|
|
1717
1750
|
private renderFilterSectionsRail;
|
|
1751
|
+
/** Seats in a chart category that the operator may act on in this mode. */
|
|
1752
|
+
private categorySeats;
|
|
1718
1753
|
private renderCategoriesRail;
|
|
1719
1754
|
private paintCategorySelection;
|
|
1720
1755
|
private renderTablesRail;
|
|
@@ -1182,6 +1182,15 @@ interface SeatManagerOptions {
|
|
|
1182
1182
|
tokenExpiresAt?: number;
|
|
1183
1183
|
/** Initial mode. Default 'view'. */
|
|
1184
1184
|
mode?: SeatManagerMode;
|
|
1185
|
+
/**
|
|
1186
|
+
* Which tools the cockpit offers. Default: every tool the token's
|
|
1187
|
+
* capabilities permit. Listing a tool never grants it — capabilities still
|
|
1188
|
+
* gate Categories, Tables and Channels — this only HIDES tools a host has no
|
|
1189
|
+
* use for (a dashboard that does not consume `onSelectionChange` should not
|
|
1190
|
+
* show a Select tab that leads nowhere). Monitor ('view') is always kept:
|
|
1191
|
+
* it is the fail-closed fallback for every refused mode.
|
|
1192
|
+
*/
|
|
1193
|
+
tools?: SeatManagerMode[];
|
|
1185
1194
|
/** Public labels to preselect after live inventory has loaded in Select mode. */
|
|
1186
1195
|
selectedObjects?: string[];
|
|
1187
1196
|
/**
|
|
@@ -1695,7 +1704,31 @@ declare class SeatManager {
|
|
|
1695
1704
|
private filterableSections;
|
|
1696
1705
|
private applyFilteredSectionCanvas;
|
|
1697
1706
|
private buildSectionOptions;
|
|
1707
|
+
/**
|
|
1708
|
+
* A tool is offered when the token's capability permits it AND the host has
|
|
1709
|
+
* not hidden it through `options.tools`. No channel-view capability ⇒ the
|
|
1710
|
+
* pill is not rendered at all: a hidden control is honest about authority;
|
|
1711
|
+
* a disabled one advertises it. Authority, not readiness — the Channels
|
|
1712
|
+
* pill must never wait on the lazy module. Monitor is always available; it
|
|
1713
|
+
* is where every refused mode lands.
|
|
1714
|
+
*/
|
|
1715
|
+
private toolAvailable;
|
|
1716
|
+
/**
|
|
1717
|
+
* Re-run the availability gate against freshly-loaded facts. `options.mode`
|
|
1718
|
+
* and a deep link are both accepted before the chart exists, so this is where
|
|
1719
|
+
* a now-impossible tool is exchanged for Monitor.
|
|
1720
|
+
*/
|
|
1721
|
+
private settleMode;
|
|
1722
|
+
/** Every table object on the chart, across floors. */
|
|
1723
|
+
private tables;
|
|
1698
1724
|
private paintModeTabs;
|
|
1725
|
+
/**
|
|
1726
|
+
* Every rail opens the same way: what the tool is called, whether it changes
|
|
1727
|
+
* anything (and for whom), and one plain sentence on how to use it. An
|
|
1728
|
+
* operator switching tabs should never have to guess whether a click here
|
|
1729
|
+
* touches live inventory.
|
|
1730
|
+
*/
|
|
1731
|
+
private railHeader;
|
|
1699
1732
|
private paintFollowLiveButton;
|
|
1700
1733
|
private paintHeatButton;
|
|
1701
1734
|
private paintMomentumHelp;
|
|
@@ -1715,6 +1748,8 @@ declare class SeatManager {
|
|
|
1715
1748
|
private renderSelectRail;
|
|
1716
1749
|
private paintSelectSelection;
|
|
1717
1750
|
private renderFilterSectionsRail;
|
|
1751
|
+
/** Seats in a chart category that the operator may act on in this mode. */
|
|
1752
|
+
private categorySeats;
|
|
1718
1753
|
private renderCategoriesRail;
|
|
1719
1754
|
private paintCategorySelection;
|
|
1720
1755
|
private renderTablesRail;
|