@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
package/dist/react-aria.js
CHANGED
|
@@ -1288,13 +1288,14 @@ class ListBoxItemIdManager {
|
|
|
1288
1288
|
}
|
|
1289
1289
|
}
|
|
1290
1290
|
register(id) {
|
|
1291
|
+
const idStr = id === void 0 ? void 0 : String(id).trim();
|
|
1291
1292
|
let newId;
|
|
1292
|
-
if (!
|
|
1293
|
+
if (!idStr) {
|
|
1293
1294
|
newId = this.generateMissingId();
|
|
1294
|
-
} else if (this._ids.has(
|
|
1295
|
-
newId = this.generateDuplicateId(
|
|
1295
|
+
} else if (this._ids.has(idStr)) {
|
|
1296
|
+
newId = this.generateDuplicateId(idStr);
|
|
1296
1297
|
} else {
|
|
1297
|
-
newId =
|
|
1298
|
+
newId = idStr;
|
|
1298
1299
|
}
|
|
1299
1300
|
this._ids.add(newId);
|
|
1300
1301
|
this.notify();
|
|
@@ -1533,8 +1534,21 @@ function BaseListBoxItem(props) {
|
|
|
1533
1534
|
};
|
|
1534
1535
|
}, [id]);
|
|
1535
1536
|
setControlContextData == null ? void 0 : setControlContextData({
|
|
1536
|
-
|
|
1537
|
-
|
|
1537
|
+
idError: (() => {
|
|
1538
|
+
if (id === void 0) {
|
|
1539
|
+
return "ID must be defined";
|
|
1540
|
+
}
|
|
1541
|
+
if (typeof id !== "string") {
|
|
1542
|
+
return "ID must be a string";
|
|
1543
|
+
}
|
|
1544
|
+
if (!id.trim()) {
|
|
1545
|
+
return "ID must be defined";
|
|
1546
|
+
}
|
|
1547
|
+
if (!isStandalone && id != registeredId) {
|
|
1548
|
+
return "ID must be unique";
|
|
1549
|
+
}
|
|
1550
|
+
return void 0;
|
|
1551
|
+
})()
|
|
1538
1552
|
});
|
|
1539
1553
|
const listboxItem = /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.ListBoxItem, __spreadValues$j({ key: registeredId, id: registeredId }, rest), ({
|
|
1540
1554
|
isHovered,
|
|
@@ -1610,11 +1624,11 @@ function registerListBoxItem(loader, overrides) {
|
|
|
1610
1624
|
props: {
|
|
1611
1625
|
id: {
|
|
1612
1626
|
type: "string",
|
|
1613
|
-
description: "The
|
|
1627
|
+
description: "The ID of the item",
|
|
1614
1628
|
required: true,
|
|
1615
1629
|
validator: (_value, _props, ctx) => {
|
|
1616
|
-
if (ctx == null ? void 0 : ctx.
|
|
1617
|
-
return
|
|
1630
|
+
if (ctx == null ? void 0 : ctx.idError) {
|
|
1631
|
+
return ctx.idError;
|
|
1618
1632
|
}
|
|
1619
1633
|
return true;
|
|
1620
1634
|
}
|