@radix-ui/react-select 1.2.2 → 2.0.0-rc.10
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.d.mts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -6
package/dist/index.d.mts
CHANGED
|
@@ -35,8 +35,12 @@ export interface SelectIconProps extends PrimitiveSpanProps {
|
|
|
35
35
|
}
|
|
36
36
|
export const SelectIcon: React.ForwardRefExoticComponent<SelectIconProps & React.RefAttributes<HTMLSpanElement>>;
|
|
37
37
|
type PortalProps = React.ComponentPropsWithoutRef<typeof _Portal1>;
|
|
38
|
-
export interface SelectPortalProps
|
|
38
|
+
export interface SelectPortalProps {
|
|
39
39
|
children?: React.ReactNode;
|
|
40
|
+
/**
|
|
41
|
+
* Specify a container element to portal the content into.
|
|
42
|
+
*/
|
|
43
|
+
container?: PortalProps['container'];
|
|
40
44
|
}
|
|
41
45
|
export const SelectPortal: React.FC<SelectPortalProps>;
|
|
42
46
|
export interface SelectContentProps extends SelectContentImplProps {
|
package/dist/index.d.ts
CHANGED
|
@@ -35,8 +35,12 @@ export interface SelectIconProps extends PrimitiveSpanProps {
|
|
|
35
35
|
}
|
|
36
36
|
export const SelectIcon: React.ForwardRefExoticComponent<SelectIconProps & React.RefAttributes<HTMLSpanElement>>;
|
|
37
37
|
type PortalProps = React.ComponentPropsWithoutRef<typeof _Portal1>;
|
|
38
|
-
export interface SelectPortalProps
|
|
38
|
+
export interface SelectPortalProps {
|
|
39
39
|
children?: React.ReactNode;
|
|
40
|
+
/**
|
|
41
|
+
* Specify a container element to portal the content into.
|
|
42
|
+
*/
|
|
43
|
+
container?: PortalProps['container'];
|
|
40
44
|
}
|
|
41
45
|
export const SelectPortal: React.FC<SelectPortalProps>;
|
|
42
46
|
export inter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","sources":["packages/react/select/src/packages/react/select/src/Select.tsx","packages/react/select/src/packages/react/select/src/index.ts","packages/react/select/src/index.ts"],"sourcesContent":[null,null,"export {\n createSelectScope,\n //\n Select,\n SelectTrigger,\n SelectValue,\n SelectIcon,\n SelectPortal,\n SelectContent,\n SelectViewport,\n SelectGroup,\n SelectLabel,\n SelectItem,\n SelectItemText,\n SelectItemIndicator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n SelectSeparator,\n SelectArrow,\n //\n Root,\n Trigger,\n Value,\n Icon,\n Portal,\n Content,\n Viewport,\n Group,\n Label,\n Item,\n ItemText,\n ItemIndicator,\n ScrollUpButton,\n ScrollDownButton,\n Separator,\n Arrow,\n} from './Select';\nexport type {\n SelectProps,\n SelectTriggerProps,\n SelectValueProps,\n SelectIconProps,\n SelectPortalProps,\n SelectContentProps,\n SelectViewportProps,\n SelectGroupProps,\n SelectLabelProps,\n SelectItemProps,\n SelectItemTextProps,\n SelectItemIndicatorProps,\n SelectScrollUpButtonProps,\n SelectScrollDownButtonProps,\n SelectSeparatorProps,\n SelectArrowProps,\n} from './Select';\n"],"names":[],"version":3,"file":"index.d.ts.map"}
|
package/dist/index.js
CHANGED
|
@@ -223,7 +223,7 @@ const $1345bda09ffc1bc6$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ $cg2C9$react.forw
|
|
|
223
223
|
"data-state": context.open ? 'open' : 'closed',
|
|
224
224
|
disabled: isDisabled,
|
|
225
225
|
"data-disabled": isDisabled ? '' : undefined,
|
|
226
|
-
"data-placeholder": context.value
|
|
226
|
+
"data-placeholder": $1345bda09ffc1bc6$var$shouldShowPlaceholder(context.value) ? '' : undefined
|
|
227
227
|
}, triggerProps, {
|
|
228
228
|
ref: composedRefs // Enable compatibility with native label or custom `Label` "click" for Safari:
|
|
229
229
|
,
|
|
@@ -271,7 +271,7 @@ const $1345bda09ffc1bc6$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ $cg2C9$react.forw
|
|
|
271
271
|
* -----------------------------------------------------------------------------------------------*/ const $1345bda09ffc1bc6$var$VALUE_NAME = 'SelectValue';
|
|
272
272
|
const $1345bda09ffc1bc6$export$e288731fd71264f0 = /*#__PURE__*/ $cg2C9$react.forwardRef((props, forwardedRef)=>{
|
|
273
273
|
// We ignore `className` and `style` as this part shouldn't be styled.
|
|
274
|
-
const { __scopeSelect: __scopeSelect , className: className , style: style , children: children , placeholder: placeholder , ...valueProps } = props;
|
|
274
|
+
const { __scopeSelect: __scopeSelect , className: className , style: style , children: children , placeholder: placeholder = '' , ...valueProps } = props;
|
|
275
275
|
const context = $1345bda09ffc1bc6$var$useSelectContext($1345bda09ffc1bc6$var$VALUE_NAME, __scopeSelect);
|
|
276
276
|
const { onValueNodeHasChildrenChange: onValueNodeHasChildrenChange } = context;
|
|
277
277
|
const hasChildren = children !== undefined;
|
|
@@ -288,7 +288,7 @@ const $1345bda09ffc1bc6$export$e288731fd71264f0 = /*#__PURE__*/ $cg2C9$react.for
|
|
|
288
288
|
style: {
|
|
289
289
|
pointerEvents: 'none'
|
|
290
290
|
}
|
|
291
|
-
}), context.value
|
|
291
|
+
}), $1345bda09ffc1bc6$var$shouldShowPlaceholder(context.value) ? /*#__PURE__*/ $cg2C9$react.createElement($cg2C9$react.Fragment, null, placeholder) : children);
|
|
292
292
|
});
|
|
293
293
|
/*#__PURE__*/ Object.assign($1345bda09ffc1bc6$export$e288731fd71264f0, {
|
|
294
294
|
displayName: $1345bda09ffc1bc6$var$VALUE_NAME
|
|
@@ -902,6 +902,7 @@ const $1345bda09ffc1bc6$export$13ef48a934230896 = /*#__PURE__*/ $cg2C9$react.for
|
|
|
902
902
|
context.onOpenChange(false);
|
|
903
903
|
}
|
|
904
904
|
};
|
|
905
|
+
if (value === '') throw new Error('A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.');
|
|
905
906
|
return /*#__PURE__*/ $cg2C9$react.createElement($1345bda09ffc1bc6$var$SelectItemContextProvider, {
|
|
906
907
|
scope: __scopeSelect,
|
|
907
908
|
value: value,
|
|
@@ -1177,7 +1178,10 @@ const $1345bda09ffc1bc6$export$314f4cb8f8099628 = /*#__PURE__*/ $cg2C9$react.for
|
|
|
1177
1178
|
/*#__PURE__*/ Object.assign($1345bda09ffc1bc6$export$314f4cb8f8099628, {
|
|
1178
1179
|
displayName: $1345bda09ffc1bc6$var$ARROW_NAME
|
|
1179
1180
|
});
|
|
1180
|
-
/* -----------------------------------------------------------------------------------------------*/
|
|
1181
|
+
/* -----------------------------------------------------------------------------------------------*/ function $1345bda09ffc1bc6$var$shouldShowPlaceholder(value) {
|
|
1182
|
+
return value === '' || value === undefined;
|
|
1183
|
+
}
|
|
1184
|
+
const $1345bda09ffc1bc6$var$BubbleSelect = /*#__PURE__*/ $cg2C9$react.forwardRef((props, forwardedRef)=>{
|
|
1181
1185
|
const { value: value , ...selectProps } = props;
|
|
1182
1186
|
const ref = $cg2C9$react.useRef(null);
|
|
1183
1187
|
const composedRefs = $cg2C9$radixuireactcomposerefs.useComposedRefs(forwardedRef, ref);
|