@adsgency_npm/adsgency-ads-ui 0.1.0-alpha.15 → 0.1.0-alpha.16
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/index.cjs +18 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +18 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -208,7 +208,8 @@ var adsDefaultMessages = {
|
|
|
208
208
|
optional: "Optional"
|
|
209
209
|
},
|
|
210
210
|
select: {
|
|
211
|
-
clear: "Clear selection"
|
|
211
|
+
clear: "Clear selection",
|
|
212
|
+
noOptionsAvailable: "No options available"
|
|
212
213
|
},
|
|
213
214
|
toast: {
|
|
214
215
|
notifications: "Notifications"
|
|
@@ -258,7 +259,8 @@ var adsDefaultMessages = {
|
|
|
258
259
|
optional: "\u53EF\u9009"
|
|
259
260
|
},
|
|
260
261
|
select: {
|
|
261
|
-
clear: "\u6E05\u9664\u9009\u62E9"
|
|
262
|
+
clear: "\u6E05\u9664\u9009\u62E9",
|
|
263
|
+
noOptionsAvailable: "\u6682\u65E0\u53EF\u9009\u9879"
|
|
262
264
|
},
|
|
263
265
|
toast: {
|
|
264
266
|
notifications: "\u901A\u77E5"
|
|
@@ -3465,6 +3467,7 @@ function AdsSelect({
|
|
|
3465
3467
|
defaultValue,
|
|
3466
3468
|
descriptionPlacement = "below",
|
|
3467
3469
|
disabled,
|
|
3470
|
+
emptyText,
|
|
3468
3471
|
errorText,
|
|
3469
3472
|
helperText,
|
|
3470
3473
|
id,
|
|
@@ -3491,6 +3494,8 @@ function AdsSelect({
|
|
|
3491
3494
|
id
|
|
3492
3495
|
});
|
|
3493
3496
|
const resolvedClearButtonLabel = clearButtonLabel ?? messages.select.clear;
|
|
3497
|
+
const resolvedEmptyText = emptyText ?? messages.select.noOptionsAvailable;
|
|
3498
|
+
const hasOptions = React36.Children.toArray(children).length > 0;
|
|
3494
3499
|
const handleValueChange = React36.useCallback(
|
|
3495
3500
|
(nextValue) => {
|
|
3496
3501
|
if (!isControlled) {
|
|
@@ -3554,7 +3559,17 @@ function AdsSelect({
|
|
|
3554
3559
|
SelectContent,
|
|
3555
3560
|
{
|
|
3556
3561
|
className: cn(selectContentBaseClassName, contentClassName3),
|
|
3557
|
-
children
|
|
3562
|
+
children: hasOptions ? children : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3563
|
+
"div",
|
|
3564
|
+
{
|
|
3565
|
+
"aria-live": "polite",
|
|
3566
|
+
className: cn(
|
|
3567
|
+
"flex min-h-8 items-center justify-center px-3 py-2 text-sm",
|
|
3568
|
+
adsTextColorClassName.muted
|
|
3569
|
+
),
|
|
3570
|
+
children: resolvedEmptyText
|
|
3571
|
+
}
|
|
3572
|
+
)
|
|
3558
3573
|
}
|
|
3559
3574
|
)
|
|
3560
3575
|
]
|