@northlight/ui 2.24.5 → 2.25.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/dist/es/northlight.d.ts +8 -1
- package/dist/es/northlight.js +15 -3
- package/dist/es/northlight.js.map +1 -1
- package/dist/umd/northlight.cjs +15 -3
- package/dist/umd/northlight.cjs.map +1 -1
- package/dist/umd/northlight.min.cjs +3 -3
- package/dist/umd/northlight.min.cjs.map +1 -1
- package/package.json +2 -2
package/dist/es/northlight.d.ts
CHANGED
|
@@ -877,6 +877,7 @@ interface DateRangePickerProps extends Omit<AriaDateRangePickerProps<DateValue>,
|
|
|
877
877
|
maxValue?: string | undefined;
|
|
878
878
|
fiscalStartMonth?: number;
|
|
879
879
|
fiscalStartDay?: number;
|
|
880
|
+
renderInPortal?: boolean;
|
|
880
881
|
}
|
|
881
882
|
interface DatePickerFieldProps extends Omit<InputProps, 'onChange'>, InputFieldProps {
|
|
882
883
|
name: string;
|
|
@@ -4181,6 +4182,12 @@ interface CreatableSelectDropdownProps<T extends string = string> {
|
|
|
4181
4182
|
* Value of the initially selected option.
|
|
4182
4183
|
*/
|
|
4183
4184
|
initialValue?: T;
|
|
4185
|
+
/**
|
|
4186
|
+
*
|
|
4187
|
+
Default placement of the menu in relation to the control. 'auto'
|
|
4188
|
+
will flip when there isn't enough space below the control. Defaults to "bottom".
|
|
4189
|
+
*/
|
|
4190
|
+
menuPlacement?: 'top' | 'bottom' | 'auto';
|
|
4184
4191
|
}
|
|
4185
4192
|
|
|
4186
4193
|
/**
|
|
@@ -4251,7 +4258,7 @@ interface CreatableSelectDropdownProps<T extends string = string> {
|
|
|
4251
4258
|
* }
|
|
4252
4259
|
* ?)
|
|
4253
4260
|
*/
|
|
4254
|
-
declare const CreatableSelectDropdown: <T extends string = string>({ standardOptions, initialPlaceholder, addOptionPlaceholder, creationOption, onOptionChange, width, variant, initialValue, }: CreatableSelectDropdownProps<T>) => JSX.Element;
|
|
4261
|
+
declare const CreatableSelectDropdown: <T extends string = string>({ standardOptions, initialPlaceholder, addOptionPlaceholder, creationOption, onOptionChange, width, variant, initialValue, menuPlacement, }: CreatableSelectDropdownProps<T>) => JSX.Element;
|
|
4255
4262
|
|
|
4256
4263
|
declare const useDebounce: <T>(value: T, delay: number) => T;
|
|
4257
4264
|
|
package/dist/es/northlight.js
CHANGED
|
@@ -7233,6 +7233,15 @@ const parseValue = (value) => {
|
|
|
7233
7233
|
return null;
|
|
7234
7234
|
return { start: parseDate(value.startDate), end: parseDate(value.endDate) };
|
|
7235
7235
|
};
|
|
7236
|
+
const PortalWrapper = ({
|
|
7237
|
+
renderInPortal,
|
|
7238
|
+
children
|
|
7239
|
+
}) => {
|
|
7240
|
+
if (renderInPortal) {
|
|
7241
|
+
return /* @__PURE__ */ React.createElement(Portal, null, children);
|
|
7242
|
+
}
|
|
7243
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, children);
|
|
7244
|
+
};
|
|
7236
7245
|
const DateRangePicker = (props) => {
|
|
7237
7246
|
const {
|
|
7238
7247
|
isDisabled,
|
|
@@ -7246,7 +7255,8 @@ const DateRangePicker = (props) => {
|
|
|
7246
7255
|
onChange: onChangeCallback = identity,
|
|
7247
7256
|
value,
|
|
7248
7257
|
minValue = "1994-03-08",
|
|
7249
|
-
maxValue
|
|
7258
|
+
maxValue,
|
|
7259
|
+
renderInPortal = false
|
|
7250
7260
|
} = props;
|
|
7251
7261
|
const ref = useRef();
|
|
7252
7262
|
const { group } = useMultiStyleConfig("DatePicker");
|
|
@@ -7317,7 +7327,7 @@ const DateRangePicker = (props) => {
|
|
|
7317
7327
|
icon: /* @__PURE__ */ React.createElement(Icon$1, { as: XCloseSolid })
|
|
7318
7328
|
}
|
|
7319
7329
|
))),
|
|
7320
|
-
/* @__PURE__ */ React.createElement(
|
|
7330
|
+
/* @__PURE__ */ React.createElement(PortalWrapper, { renderInPortal }, state.isOpen && /* @__PURE__ */ React.createElement(PopoverContent, __spreadProps$d(__spreadValues$1o({}, dialogProps), { ref, w: "max-content" }), /* @__PURE__ */ React.createElement(FocusScope, { contain: true, restoreFocus: true }, /* @__PURE__ */ React.createElement(
|
|
7321
7331
|
RangeCalendar,
|
|
7322
7332
|
__spreadProps$d(__spreadValues$1o({}, calendarProps), {
|
|
7323
7333
|
resetDate,
|
|
@@ -13889,7 +13899,8 @@ const CreatableSelectDropdown = ({
|
|
|
13889
13899
|
onOptionChange,
|
|
13890
13900
|
width = "100%",
|
|
13891
13901
|
variant = "outline",
|
|
13892
|
-
initialValue
|
|
13902
|
+
initialValue,
|
|
13903
|
+
menuPlacement = "bottom"
|
|
13893
13904
|
}) => {
|
|
13894
13905
|
const initialSelectedOption = useMemo(
|
|
13895
13906
|
() => {
|
|
@@ -13962,6 +13973,7 @@ const CreatableSelectDropdown = ({
|
|
|
13962
13973
|
return /* @__PURE__ */ React.createElement(Box, { ref }, /* @__PURE__ */ React.createElement(
|
|
13963
13974
|
CreatableSelect,
|
|
13964
13975
|
{
|
|
13976
|
+
menuPlacement,
|
|
13965
13977
|
chakraStyles: __spreadProps(__spreadValues({}, customSelectStyles), {
|
|
13966
13978
|
container: (provided) => __spreadProps(__spreadValues({}, provided), {
|
|
13967
13979
|
width
|