@plasmicpkgs/react-aria 0.0.55 → 0.0.56
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/dist/.tsbuildinfo +1 -1
- package/dist/ListBoxItemIdManager.d.ts +1 -1
- package/dist/react-aria.esm.js +23 -9
- package/dist/react-aria.esm.js.map +1 -1
- package/dist/react-aria.js +23 -9
- package/dist/react-aria.js.map +1 -1
- package/dist/registerListBoxItem.d.ts +1 -1
- package/package.json +2 -2
- package/skinny/ListBoxItemIdManager.d.ts +1 -1
- package/skinny/registerComboBox.cjs.js +1 -1
- package/skinny/registerComboBox.esm.js +1 -1
- package/skinny/{registerListBox-85f61377.esm.js → registerListBox-3c236462.esm.js} +6 -5
- package/skinny/registerListBox-3c236462.esm.js.map +1 -0
- package/skinny/{registerListBox-96ae5783.cjs.js → registerListBox-da9cf4ed.cjs.js} +6 -5
- package/skinny/registerListBox-da9cf4ed.cjs.js.map +1 -0
- package/skinny/registerListBox.cjs.js +1 -1
- package/skinny/registerListBox.esm.js +1 -1
- package/skinny/registerListBoxItem.cjs.js +18 -5
- package/skinny/registerListBoxItem.cjs.js.map +1 -1
- package/skinny/registerListBoxItem.d.ts +1 -1
- package/skinny/registerListBoxItem.esm.js +18 -5
- package/skinny/registerListBoxItem.esm.js.map +1 -1
- package/skinny/registerSelect.cjs.js +1 -1
- package/skinny/registerSelect.esm.js +1 -1
- package/skinny/registerListBox-85f61377.esm.js.map +0 -1
- package/skinny/registerListBox-96ae5783.cjs.js.map +0 -1
|
@@ -4,7 +4,7 @@ export declare class ListBoxItemIdManager {
|
|
|
4
4
|
private readonly _observers;
|
|
5
5
|
private generateDuplicateId;
|
|
6
6
|
private generateMissingId;
|
|
7
|
-
register(id?:
|
|
7
|
+
register(id?: unknown): string;
|
|
8
8
|
unregister(id: string): void;
|
|
9
9
|
subscribe(observer: Observer): void;
|
|
10
10
|
notify(): void;
|
package/dist/react-aria.esm.js
CHANGED
|
@@ -1280,13 +1280,14 @@ class ListBoxItemIdManager {
|
|
|
1280
1280
|
}
|
|
1281
1281
|
}
|
|
1282
1282
|
register(id) {
|
|
1283
|
+
const idStr = id === void 0 ? void 0 : String(id).trim();
|
|
1283
1284
|
let newId;
|
|
1284
|
-
if (!
|
|
1285
|
+
if (!idStr) {
|
|
1285
1286
|
newId = this.generateMissingId();
|
|
1286
|
-
} else if (this._ids.has(
|
|
1287
|
-
newId = this.generateDuplicateId(
|
|
1287
|
+
} else if (this._ids.has(idStr)) {
|
|
1288
|
+
newId = this.generateDuplicateId(idStr);
|
|
1288
1289
|
} else {
|
|
1289
|
-
newId =
|
|
1290
|
+
newId = idStr;
|
|
1290
1291
|
}
|
|
1291
1292
|
this._ids.add(newId);
|
|
1292
1293
|
this.notify();
|
|
@@ -1525,8 +1526,21 @@ function BaseListBoxItem(props) {
|
|
|
1525
1526
|
};
|
|
1526
1527
|
}, [id]);
|
|
1527
1528
|
setControlContextData == null ? void 0 : setControlContextData({
|
|
1528
|
-
|
|
1529
|
-
|
|
1529
|
+
idError: (() => {
|
|
1530
|
+
if (id === void 0) {
|
|
1531
|
+
return "ID must be defined";
|
|
1532
|
+
}
|
|
1533
|
+
if (typeof id !== "string") {
|
|
1534
|
+
return "ID must be a string";
|
|
1535
|
+
}
|
|
1536
|
+
if (!id.trim()) {
|
|
1537
|
+
return "ID must be defined";
|
|
1538
|
+
}
|
|
1539
|
+
if (!isStandalone && id != registeredId) {
|
|
1540
|
+
return "ID must be unique";
|
|
1541
|
+
}
|
|
1542
|
+
return void 0;
|
|
1543
|
+
})()
|
|
1530
1544
|
});
|
|
1531
1545
|
const listboxItem = /* @__PURE__ */ React.createElement(ListBoxItem, __spreadValues$j({ key: registeredId, id: registeredId }, rest), ({
|
|
1532
1546
|
isHovered,
|
|
@@ -1602,11 +1616,11 @@ function registerListBoxItem(loader, overrides) {
|
|
|
1602
1616
|
props: {
|
|
1603
1617
|
id: {
|
|
1604
1618
|
type: "string",
|
|
1605
|
-
description: "The
|
|
1619
|
+
description: "The ID of the item",
|
|
1606
1620
|
required: true,
|
|
1607
1621
|
validator: (_value, _props, ctx) => {
|
|
1608
|
-
if (ctx == null ? void 0 : ctx.
|
|
1609
|
-
return
|
|
1622
|
+
if (ctx == null ? void 0 : ctx.idError) {
|
|
1623
|
+
return ctx.idError;
|
|
1610
1624
|
}
|
|
1611
1625
|
return true;
|
|
1612
1626
|
}
|