@jobber/components 6.103.2-JOB-140609-9051081.26 → 6.103.2
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/Autocomplete/Autocomplete.types.d.ts +1 -12
- package/dist/Autocomplete/index.cjs +13 -1
- package/dist/Autocomplete/index.mjs +13 -1
- package/dist/Checkbox/Checkbox.types.d.ts +9 -2
- package/dist/Checkbox/index.cjs +2 -3
- package/dist/Checkbox/index.mjs +2 -3
- package/dist/Chips/InternalChipDismissible/hooks/index.cjs +2 -2
- package/dist/Chips/InternalChipDismissible/hooks/index.mjs +2 -2
- package/dist/Chips/InternalChipDismissible/index.cjs +2 -2
- package/dist/Chips/InternalChipDismissible/index.mjs +2 -2
- package/dist/Chips/index.cjs +2 -2
- package/dist/Chips/index.mjs +2 -2
- package/dist/DataList/components/DataListSearch/index.cjs +12 -1
- package/dist/DataList/components/DataListSearch/index.mjs +12 -1
- package/dist/DataList/index.cjs +8 -0
- package/dist/DataList/index.mjs +8 -0
- package/dist/DataTable/index.cjs +2 -2
- package/dist/DataTable/index.mjs +2 -2
- package/dist/DatePicker/index.cjs +2 -2
- package/dist/DatePicker/index.mjs +2 -2
- package/dist/FormField/FormFieldTypes.d.ts +1 -217
- package/dist/FormField-cjs.js +6 -1
- package/dist/FormField-es.js +6 -2
- package/dist/InputDate/index.cjs +4 -8
- package/dist/InputDate/index.mjs +4 -8
- package/dist/InputDate/useInputDateActivatorActions.d.ts +2 -2
- package/dist/InputEmail/InputEmail.types.d.ts +21 -16
- package/dist/InputEmail/hooks/useInputEmailActions.d.ts +1 -1
- package/dist/InputEmail/hooks/useInputEmailFormField.d.ts +32 -0
- package/dist/InputEmail/index.cjs +45 -10
- package/dist/InputEmail/index.mjs +45 -10
- package/dist/InputNumber/InputNumber.rebuilt.types.d.ts +2 -23
- package/dist/InputNumber/index.cjs +3 -6
- package/dist/InputNumber/index.mjs +3 -6
- package/dist/InputPhoneNumber/InputPhoneNumber.types.d.ts +26 -15
- package/dist/InputPhoneNumber/hooks/useInputPhoneActions.d.ts +1 -1
- package/dist/InputPhoneNumber/hooks/useInputPhoneFormField.d.ts +71 -0
- package/dist/InputPhoneNumber/index.cjs +35 -20
- package/dist/InputPhoneNumber/index.mjs +35 -20
- package/dist/InputText/InputText.d.ts +2 -2
- package/dist/InputText/InputText.types.d.ts +24 -27
- package/dist/InputText/index.cjs +55 -26
- package/dist/InputText/index.mjs +56 -27
- package/dist/InputText/useInputTextActions.d.ts +1 -1
- package/dist/InputText/useInputTextFormField.d.ts +352 -0
- package/dist/InputTime/InputTime.rebuilt.d.ts +1 -1
- package/dist/InputTime/InputTime.types.d.ts +1 -21
- package/dist/InputTime/index.cjs +25 -30
- package/dist/InputTime/index.d.ts +1 -1
- package/dist/InputTime/index.mjs +27 -32
- package/dist/List/index.cjs +2 -2
- package/dist/List/index.mjs +2 -2
- package/dist/RecurringSelect/index.cjs +2 -2
- package/dist/RecurringSelect/index.mjs +2 -2
- package/dist/Select/Select.rebuilt.d.ts +1 -1
- package/dist/Select/Select.types.d.ts +1 -14
- package/dist/Select/hooks/useSelectActions.d.ts +5 -5
- package/dist/Select/hooks/useSelectFormField.d.ts +34 -0
- package/dist/Select/index.cjs +41 -27
- package/dist/Select/index.d.ts +5 -7
- package/dist/Select/index.mjs +43 -29
- package/dist/_baseEach-cjs.js +12 -12
- package/dist/_baseEach-es.js +1 -1
- package/dist/_baseFlatten-cjs.js +2 -2
- package/dist/_baseFlatten-es.js +1 -1
- package/dist/{_getAllKeys-cjs.js → _baseGet-cjs.js} +181 -181
- package/dist/{_getAllKeys-es.js → _baseGet-es.js} +182 -182
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/omit-cjs.js +14 -14
- package/dist/omit-es.js +1 -1
- package/dist/useScrollToActive-cjs.js +3 -3
- package/dist/useScrollToActive-es.js +1 -1
- package/package.json +2 -2
package/dist/List/index.cjs
CHANGED
|
@@ -8,9 +8,9 @@ require('../identity-cjs.js');
|
|
|
8
8
|
require('../isTypedArray-cjs.js');
|
|
9
9
|
require('../isObjectLike-cjs.js');
|
|
10
10
|
require('../_commonjsHelpers-cjs.js');
|
|
11
|
-
require('../
|
|
12
|
-
require('../isSymbol-cjs.js');
|
|
11
|
+
require('../_baseGet-cjs.js');
|
|
13
12
|
require('../_getTag-cjs.js');
|
|
13
|
+
require('../isSymbol-cjs.js');
|
|
14
14
|
require('../_baseFor-cjs.js');
|
|
15
15
|
require('../_baseAssignValue-cjs.js');
|
|
16
16
|
require('../Typography-cjs.js');
|
package/dist/List/index.mjs
CHANGED
|
@@ -6,9 +6,9 @@ import '../identity-es.js';
|
|
|
6
6
|
import '../isTypedArray-es.js';
|
|
7
7
|
import '../isObjectLike-es.js';
|
|
8
8
|
import '../_commonjsHelpers-es.js';
|
|
9
|
-
import '../
|
|
10
|
-
import '../isSymbol-es.js';
|
|
9
|
+
import '../_baseGet-es.js';
|
|
11
10
|
import '../_getTag-es.js';
|
|
11
|
+
import '../isSymbol-es.js';
|
|
12
12
|
import '../_baseFor-es.js';
|
|
13
13
|
import '../_baseAssignValue-es.js';
|
|
14
14
|
import '../Typography-es.js';
|
|
@@ -9,12 +9,12 @@ require('classnames');
|
|
|
9
9
|
require('../Select/index.cjs');
|
|
10
10
|
require('../omit-cjs.js');
|
|
11
11
|
require('../_commonjsHelpers-cjs.js');
|
|
12
|
-
require('../
|
|
12
|
+
require('../_baseGet-cjs.js');
|
|
13
13
|
require('../isTypedArray-cjs.js');
|
|
14
14
|
require('../isObjectLike-cjs.js');
|
|
15
|
-
require('../isSymbol-cjs.js');
|
|
16
15
|
require('../identity-cjs.js');
|
|
17
16
|
require('../_getTag-cjs.js');
|
|
17
|
+
require('../isSymbol-cjs.js');
|
|
18
18
|
require('../keysIn-cjs.js');
|
|
19
19
|
require('../_baseAssignValue-cjs.js');
|
|
20
20
|
require('../_baseFlatten-cjs.js');
|
|
@@ -7,12 +7,12 @@ import 'classnames';
|
|
|
7
7
|
import '../Select/index.mjs';
|
|
8
8
|
import '../omit-es.js';
|
|
9
9
|
import '../_commonjsHelpers-es.js';
|
|
10
|
-
import '../
|
|
10
|
+
import '../_baseGet-es.js';
|
|
11
11
|
import '../isTypedArray-es.js';
|
|
12
12
|
import '../isObjectLike-es.js';
|
|
13
|
-
import '../isSymbol-es.js';
|
|
14
13
|
import '../identity-es.js';
|
|
15
14
|
import '../_getTag-es.js';
|
|
15
|
+
import '../isSymbol-es.js';
|
|
16
16
|
import '../keysIn-es.js';
|
|
17
17
|
import '../_baseAssignValue-es.js';
|
|
18
18
|
import '../_baseFlatten-es.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { SelectRebuiltProps } from "./Select.types";
|
|
3
|
-
export declare
|
|
3
|
+
export declare function SelectRebuilt(props: SelectRebuiltProps): React.JSX.Element;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { CommonFormFieldProps, FormFieldProps } from "../FormField";
|
|
2
|
-
import type { AriaInputProps, FocusEvents } from "../FormField/FormFieldTypes";
|
|
3
2
|
export interface SelectLegacyProps extends Pick<CommonFormFieldProps, "id" | "align" | "description" | "disabled" | "invalid" | "inline" | "name" | "onValidation" | "placeholder" | "size" | "value" | "onChange">, Pick<FormFieldProps, "autofocus" | "onEnter" | "onBlur" | "onFocus" | "inputRef" | "wrapperRef" | "validations" | "children" | "prefix" | "suffix" | "defaultValue" | "version"> {
|
|
4
3
|
/**
|
|
5
4
|
* Changes the width to roughly the same size as the maximum character length
|
|
@@ -9,24 +8,12 @@ export interface SelectLegacyProps extends Pick<CommonFormFieldProps, "id" | "al
|
|
|
9
8
|
/**
|
|
10
9
|
* Rebuilt version of the Select component without React Hook Form dependency.
|
|
11
10
|
*/
|
|
12
|
-
export interface SelectRebuiltProps extends Omit<SelectLegacyProps, "defaultValue" | "version" | "onChange" | "value" | "validations" | "onValidation"
|
|
11
|
+
export interface SelectRebuiltProps extends Omit<SelectLegacyProps, "defaultValue" | "version" | "onChange" | "value" | "validations" | "onValidation"> {
|
|
13
12
|
defaultValue?: never;
|
|
14
13
|
readonly value?: string | number;
|
|
15
14
|
onChange?(newValue?: string | number): void;
|
|
16
15
|
version: 2;
|
|
17
16
|
error?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Automatically focus the select when mounted.
|
|
20
|
-
*/
|
|
21
|
-
readonly autoFocus?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* @deprecated Use `ref` instead. Note: `ref` support requires React 18+ forwardRef.
|
|
24
|
-
*/
|
|
25
|
-
readonly inputRef?: FormFieldProps["inputRef"];
|
|
26
|
-
/**
|
|
27
|
-
* @deprecated Use `onKeyDown` or `onKeyUp` instead.
|
|
28
|
-
*/
|
|
29
|
-
readonly onEnter?: FormFieldProps["onEnter"];
|
|
30
17
|
/**
|
|
31
18
|
* Opt-in to the customizable select UI (Chromium 123+).
|
|
32
19
|
* When true, the component will apply the custom select styles
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { ChangeEvent
|
|
1
|
+
import type { ChangeEvent } from "react";
|
|
2
2
|
interface UseSelectActionsProps {
|
|
3
3
|
readonly onChange?: (newValue: string | number, event?: ChangeEvent<HTMLSelectElement>) => void;
|
|
4
|
-
readonly onBlur?: (
|
|
5
|
-
readonly onFocus?: (
|
|
4
|
+
readonly onBlur?: () => void;
|
|
5
|
+
readonly onFocus?: () => void;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* Hook with actions on the Select component.
|
|
9
9
|
*/
|
|
10
10
|
export declare function useSelectActions({ onChange, onBlur, onFocus, }: UseSelectActionsProps): {
|
|
11
11
|
handleChange: (event: ChangeEvent<HTMLSelectElement>) => void;
|
|
12
|
-
handleBlur: (
|
|
13
|
-
handleFocus: (
|
|
12
|
+
handleBlur: () => void;
|
|
13
|
+
handleFocus: () => void;
|
|
14
14
|
};
|
|
15
15
|
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ChangeEvent, ReactNode } from "react";
|
|
2
|
+
export interface UseSelectFormFieldProps {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly disabled?: boolean;
|
|
6
|
+
readonly autofocus?: boolean;
|
|
7
|
+
readonly description?: ReactNode;
|
|
8
|
+
readonly inline?: boolean;
|
|
9
|
+
readonly error?: string;
|
|
10
|
+
readonly invalid?: boolean;
|
|
11
|
+
readonly value?: string | number;
|
|
12
|
+
readonly handleChange: (event: ChangeEvent<HTMLSelectElement>) => void;
|
|
13
|
+
readonly handleBlur: () => void;
|
|
14
|
+
readonly handleFocus: () => void;
|
|
15
|
+
}
|
|
16
|
+
export interface UseSelectFormFieldReturn {
|
|
17
|
+
readonly fieldProps: {
|
|
18
|
+
readonly id: string;
|
|
19
|
+
readonly name: string;
|
|
20
|
+
readonly disabled?: boolean;
|
|
21
|
+
readonly autoFocus?: boolean;
|
|
22
|
+
readonly onChange: (event: ChangeEvent<HTMLSelectElement>) => void;
|
|
23
|
+
readonly onBlur: () => void;
|
|
24
|
+
readonly onFocus: () => void;
|
|
25
|
+
readonly value?: string | number;
|
|
26
|
+
readonly "aria-describedby"?: string;
|
|
27
|
+
};
|
|
28
|
+
readonly descriptionIdentifier: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Hook for managing the props of a Select component.
|
|
32
|
+
* Extracted from FormField's useAtlantisFormField.
|
|
33
|
+
*/
|
|
34
|
+
export declare function useSelectFormField({ id, name, disabled, autofocus, description, inline, value, handleChange, handleBlur, handleFocus, }: UseSelectFormFieldProps): UseSelectFormFieldReturn;
|
package/dist/Select/index.cjs
CHANGED
|
@@ -11,12 +11,12 @@ require('framer-motion');
|
|
|
11
11
|
require('@jobber/design');
|
|
12
12
|
require('../Button-cjs.js');
|
|
13
13
|
require('../_commonjsHelpers-cjs.js');
|
|
14
|
-
require('../
|
|
14
|
+
require('../_baseGet-cjs.js');
|
|
15
15
|
require('../isTypedArray-cjs.js');
|
|
16
16
|
require('../isObjectLike-cjs.js');
|
|
17
|
-
require('../isSymbol-cjs.js');
|
|
18
17
|
require('../identity-cjs.js');
|
|
19
18
|
require('../_getTag-cjs.js');
|
|
19
|
+
require('../isSymbol-cjs.js');
|
|
20
20
|
require('../keysIn-cjs.js');
|
|
21
21
|
require('../_baseAssignValue-cjs.js');
|
|
22
22
|
require('../_baseFlatten-cjs.js');
|
|
@@ -42,11 +42,11 @@ function useSelectActions({ onChange, onBlur, onFocus, }) {
|
|
|
42
42
|
const newValue = event.currentTarget.value;
|
|
43
43
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue, event);
|
|
44
44
|
}
|
|
45
|
-
function handleBlur(
|
|
46
|
-
onBlur === null || onBlur === void 0 ? void 0 : onBlur(
|
|
45
|
+
function handleBlur() {
|
|
46
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur();
|
|
47
47
|
}
|
|
48
|
-
function handleFocus(
|
|
49
|
-
onFocus === null || onFocus === void 0 ? void 0 : onFocus(
|
|
48
|
+
function handleFocus() {
|
|
49
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus();
|
|
50
50
|
}
|
|
51
51
|
return {
|
|
52
52
|
handleChange,
|
|
@@ -55,22 +55,27 @@ function useSelectActions({ onChange, onBlur, onFocus, }) {
|
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
/**
|
|
59
|
+
* Hook for managing the props of a Select component.
|
|
60
|
+
* Extracted from FormField's useAtlantisFormField.
|
|
61
|
+
*/
|
|
62
|
+
function useSelectFormField({ id, name, disabled, autofocus, description, inline, value, handleChange, handleBlur, handleFocus, }) {
|
|
63
|
+
const descriptionIdentifier = `descriptionUUID--${id}`;
|
|
64
|
+
const fieldProps = Object.assign({ id,
|
|
65
|
+
name,
|
|
66
|
+
disabled, autoFocus: autofocus, onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, value }, (description &&
|
|
67
|
+
!inline && { "aria-describedby": descriptionIdentifier }));
|
|
68
|
+
return { fieldProps, descriptionIdentifier };
|
|
69
|
+
}
|
|
70
|
+
|
|
58
71
|
var styles = {"select":"-hmXAsAfH9U-","selectPostfix":"_5ST4c1fXDYU-","spinning":"oOACJmrVDf0-"};
|
|
59
72
|
|
|
60
|
-
|
|
61
|
-
var _a;
|
|
62
|
-
|
|
63
|
-
const { inputRef: deprecatedInputRef } = props;
|
|
64
|
-
const internalRef = React.useRef(null);
|
|
65
|
-
const mergedRef = FormField.mergeRefs([
|
|
66
|
-
internalRef,
|
|
67
|
-
deprecatedInputRef,
|
|
68
|
-
forwardedRef,
|
|
69
|
-
]);
|
|
73
|
+
function SelectRebuilt(props) {
|
|
74
|
+
var _a, _b;
|
|
75
|
+
const selectRef = (_a = props.inputRef) !== null && _a !== void 0 ? _a : React.useRef(null);
|
|
70
76
|
const wrapperRef = React.useRef(null);
|
|
71
77
|
const { inputStyle } = FormField.useFormFieldWrapperStyles(Object.assign({}, omit.omit(props, ["version"])));
|
|
72
78
|
const id = useSelectId(props);
|
|
73
|
-
const descriptionIdentifier = `descriptionUUID--${id}`;
|
|
74
79
|
const { name } = FormField.useAtlantisFormFieldName({
|
|
75
80
|
nameProp: props.name,
|
|
76
81
|
id: id,
|
|
@@ -80,14 +85,24 @@ const SelectRebuilt = React.forwardRef(function SelectRebuilt(props, forwardedRe
|
|
|
80
85
|
onBlur: props.onBlur,
|
|
81
86
|
onFocus: props.onFocus,
|
|
82
87
|
});
|
|
83
|
-
|
|
88
|
+
const inputProps = omit.omit(props, [
|
|
89
|
+
"onChange",
|
|
90
|
+
"onBlur",
|
|
91
|
+
"onFocus",
|
|
92
|
+
"size",
|
|
93
|
+
"placeholder",
|
|
94
|
+
"version",
|
|
95
|
+
]);
|
|
96
|
+
const { fieldProps, descriptionIdentifier } = useSelectFormField(Object.assign(Object.assign({}, inputProps), { id,
|
|
97
|
+
name,
|
|
98
|
+
handleChange,
|
|
99
|
+
handleBlur,
|
|
100
|
+
handleFocus }));
|
|
101
|
+
return (React.createElement(FormField.FormFieldWrapper, { disabled: props.disabled, size: props.size, align: props.align, inline: props.inline, autofocus: props.autofocus, name: name, wrapperRef: wrapperRef, error: (_b = props.error) !== null && _b !== void 0 ? _b : "", invalid: props.invalid, identifier: id, descriptionIdentifier: descriptionIdentifier, description: props.description, type: "select", placeholder: props.placeholder, value: props.value, prefix: props.prefix, suffix: props.suffix, clearable: "never", maxLength: props.maxLength },
|
|
84
102
|
React.createElement(React.Fragment, null,
|
|
85
|
-
React.createElement("select", {
|
|
86
|
-
(props.description && !props.inline
|
|
87
|
-
? descriptionIdentifier
|
|
88
|
-
: undefined), "aria-invalid": props.ariaInvalid, "aria-required": props.ariaRequired, ref: mergedRef, className: classnames(inputStyle, props.UNSAFE_experimentalStyles && styles.select) }, props.children),
|
|
103
|
+
React.createElement("select", Object.assign({}, fieldProps, { ref: selectRef, className: classnames(inputStyle, props.UNSAFE_experimentalStyles && styles.select) }), props.children),
|
|
89
104
|
React.createElement(FormField.FormFieldPostFix, { variation: "select", className: styles.selectPostfix }))));
|
|
90
|
-
}
|
|
105
|
+
}
|
|
91
106
|
function useSelectId(props) {
|
|
92
107
|
const generatedId = React.useId();
|
|
93
108
|
return props.id || generatedId;
|
|
@@ -104,15 +119,14 @@ function OptionGroup({ children, label, disabled, UNSAFE_className, UNSAFE_style
|
|
|
104
119
|
function isNewSelectProps(props) {
|
|
105
120
|
return props.version === 2;
|
|
106
121
|
}
|
|
107
|
-
|
|
122
|
+
function Select(props) {
|
|
108
123
|
if (isNewSelectProps(props)) {
|
|
109
|
-
return React.createElement(SelectRebuilt, Object.assign({}, props
|
|
124
|
+
return React.createElement(SelectRebuilt, Object.assign({}, props));
|
|
110
125
|
}
|
|
111
126
|
else {
|
|
112
127
|
return React.createElement(Select$1, Object.assign({}, props));
|
|
113
128
|
}
|
|
114
|
-
}
|
|
115
|
-
const Select = SelectBase;
|
|
129
|
+
}
|
|
116
130
|
Select.Option = SelectOption;
|
|
117
131
|
Select.OptionGroup = OptionGroup;
|
|
118
132
|
|
package/dist/Select/index.d.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Option } from "./Option";
|
|
3
|
-
import { OptionGroup } from "./OptionGroup";
|
|
4
2
|
import { type SelectLegacyProps, type SelectRebuiltProps } from "./Select.types";
|
|
5
3
|
export { Option } from "./Option";
|
|
6
4
|
export type SelectShimProps = SelectLegacyProps | SelectRebuiltProps;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
export declare function Select(props: SelectShimProps): React.JSX.Element;
|
|
6
|
+
export declare namespace Select {
|
|
7
|
+
var Option: typeof import("./Option").Option;
|
|
8
|
+
var OptionGroup: typeof import("./OptionGroup").OptionGroup;
|
|
9
|
+
}
|
|
12
10
|
export type { SelectRebuiltProps, SelectLegacyProps };
|
package/dist/Select/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React__default, {
|
|
1
|
+
import React__default, { useRef, useId } from 'react';
|
|
2
2
|
import { o as omit } from '../omit-es.js';
|
|
3
|
-
import { k as FormField, j as useFormFieldWrapperStyles, b as useAtlantisFormFieldName, f as FormFieldWrapper, l as FormFieldPostFix
|
|
3
|
+
import { k as FormField, j as useFormFieldWrapperStyles, b as useAtlantisFormFieldName, f as FormFieldWrapper, l as FormFieldPostFix } from '../FormField-es.js';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
5
|
import '../tslib.es6-es.js';
|
|
6
6
|
import 'react-hook-form';
|
|
@@ -9,12 +9,12 @@ import 'framer-motion';
|
|
|
9
9
|
import '@jobber/design';
|
|
10
10
|
import '../Button-es.js';
|
|
11
11
|
import '../_commonjsHelpers-es.js';
|
|
12
|
-
import '../
|
|
12
|
+
import '../_baseGet-es.js';
|
|
13
13
|
import '../isTypedArray-es.js';
|
|
14
14
|
import '../isObjectLike-es.js';
|
|
15
|
-
import '../isSymbol-es.js';
|
|
16
15
|
import '../identity-es.js';
|
|
17
16
|
import '../_getTag-es.js';
|
|
17
|
+
import '../isSymbol-es.js';
|
|
18
18
|
import '../keysIn-es.js';
|
|
19
19
|
import '../_baseAssignValue-es.js';
|
|
20
20
|
import '../_baseFlatten-es.js';
|
|
@@ -40,11 +40,11 @@ function useSelectActions({ onChange, onBlur, onFocus, }) {
|
|
|
40
40
|
const newValue = event.currentTarget.value;
|
|
41
41
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue, event);
|
|
42
42
|
}
|
|
43
|
-
function handleBlur(
|
|
44
|
-
onBlur === null || onBlur === void 0 ? void 0 : onBlur(
|
|
43
|
+
function handleBlur() {
|
|
44
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur();
|
|
45
45
|
}
|
|
46
|
-
function handleFocus(
|
|
47
|
-
onFocus === null || onFocus === void 0 ? void 0 : onFocus(
|
|
46
|
+
function handleFocus() {
|
|
47
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus();
|
|
48
48
|
}
|
|
49
49
|
return {
|
|
50
50
|
handleChange,
|
|
@@ -53,22 +53,27 @@ function useSelectActions({ onChange, onBlur, onFocus, }) {
|
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Hook for managing the props of a Select component.
|
|
58
|
+
* Extracted from FormField's useAtlantisFormField.
|
|
59
|
+
*/
|
|
60
|
+
function useSelectFormField({ id, name, disabled, autofocus, description, inline, value, handleChange, handleBlur, handleFocus, }) {
|
|
61
|
+
const descriptionIdentifier = `descriptionUUID--${id}`;
|
|
62
|
+
const fieldProps = Object.assign({ id,
|
|
63
|
+
name,
|
|
64
|
+
disabled, autoFocus: autofocus, onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, value }, (description &&
|
|
65
|
+
!inline && { "aria-describedby": descriptionIdentifier }));
|
|
66
|
+
return { fieldProps, descriptionIdentifier };
|
|
67
|
+
}
|
|
68
|
+
|
|
56
69
|
var styles = {"select":"-hmXAsAfH9U-","selectPostfix":"_5ST4c1fXDYU-","spinning":"oOACJmrVDf0-"};
|
|
57
70
|
|
|
58
|
-
|
|
59
|
-
var _a;
|
|
60
|
-
|
|
61
|
-
const { inputRef: deprecatedInputRef } = props;
|
|
62
|
-
const internalRef = useRef(null);
|
|
63
|
-
const mergedRef = mergeRefs([
|
|
64
|
-
internalRef,
|
|
65
|
-
deprecatedInputRef,
|
|
66
|
-
forwardedRef,
|
|
67
|
-
]);
|
|
71
|
+
function SelectRebuilt(props) {
|
|
72
|
+
var _a, _b;
|
|
73
|
+
const selectRef = (_a = props.inputRef) !== null && _a !== void 0 ? _a : useRef(null);
|
|
68
74
|
const wrapperRef = useRef(null);
|
|
69
75
|
const { inputStyle } = useFormFieldWrapperStyles(Object.assign({}, omit(props, ["version"])));
|
|
70
76
|
const id = useSelectId(props);
|
|
71
|
-
const descriptionIdentifier = `descriptionUUID--${id}`;
|
|
72
77
|
const { name } = useAtlantisFormFieldName({
|
|
73
78
|
nameProp: props.name,
|
|
74
79
|
id: id,
|
|
@@ -78,14 +83,24 @@ const SelectRebuilt = forwardRef(function SelectRebuilt(props, forwardedRef) {
|
|
|
78
83
|
onBlur: props.onBlur,
|
|
79
84
|
onFocus: props.onFocus,
|
|
80
85
|
});
|
|
81
|
-
|
|
86
|
+
const inputProps = omit(props, [
|
|
87
|
+
"onChange",
|
|
88
|
+
"onBlur",
|
|
89
|
+
"onFocus",
|
|
90
|
+
"size",
|
|
91
|
+
"placeholder",
|
|
92
|
+
"version",
|
|
93
|
+
]);
|
|
94
|
+
const { fieldProps, descriptionIdentifier } = useSelectFormField(Object.assign(Object.assign({}, inputProps), { id,
|
|
95
|
+
name,
|
|
96
|
+
handleChange,
|
|
97
|
+
handleBlur,
|
|
98
|
+
handleFocus }));
|
|
99
|
+
return (React__default.createElement(FormFieldWrapper, { disabled: props.disabled, size: props.size, align: props.align, inline: props.inline, autofocus: props.autofocus, name: name, wrapperRef: wrapperRef, error: (_b = props.error) !== null && _b !== void 0 ? _b : "", invalid: props.invalid, identifier: id, descriptionIdentifier: descriptionIdentifier, description: props.description, type: "select", placeholder: props.placeholder, value: props.value, prefix: props.prefix, suffix: props.suffix, clearable: "never", maxLength: props.maxLength },
|
|
82
100
|
React__default.createElement(React__default.Fragment, null,
|
|
83
|
-
React__default.createElement("select", {
|
|
84
|
-
(props.description && !props.inline
|
|
85
|
-
? descriptionIdentifier
|
|
86
|
-
: undefined), "aria-invalid": props.ariaInvalid, "aria-required": props.ariaRequired, ref: mergedRef, className: classnames(inputStyle, props.UNSAFE_experimentalStyles && styles.select) }, props.children),
|
|
101
|
+
React__default.createElement("select", Object.assign({}, fieldProps, { ref: selectRef, className: classnames(inputStyle, props.UNSAFE_experimentalStyles && styles.select) }), props.children),
|
|
87
102
|
React__default.createElement(FormFieldPostFix, { variation: "select", className: styles.selectPostfix }))));
|
|
88
|
-
}
|
|
103
|
+
}
|
|
89
104
|
function useSelectId(props) {
|
|
90
105
|
const generatedId = useId();
|
|
91
106
|
return props.id || generatedId;
|
|
@@ -102,15 +117,14 @@ function OptionGroup({ children, label, disabled, UNSAFE_className, UNSAFE_style
|
|
|
102
117
|
function isNewSelectProps(props) {
|
|
103
118
|
return props.version === 2;
|
|
104
119
|
}
|
|
105
|
-
|
|
120
|
+
function Select(props) {
|
|
106
121
|
if (isNewSelectProps(props)) {
|
|
107
|
-
return React__default.createElement(SelectRebuilt, Object.assign({}, props
|
|
122
|
+
return React__default.createElement(SelectRebuilt, Object.assign({}, props));
|
|
108
123
|
}
|
|
109
124
|
else {
|
|
110
125
|
return React__default.createElement(Select$1, Object.assign({}, props));
|
|
111
126
|
}
|
|
112
|
-
}
|
|
113
|
-
const Select = SelectBase;
|
|
127
|
+
}
|
|
114
128
|
Select.Option = SelectOption;
|
|
115
129
|
Select.OptionGroup = OptionGroup;
|
|
116
130
|
|
package/dist/_baseEach-cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var identity$1 = require('./identity-cjs.js');
|
|
4
4
|
var isObjectLike$1 = require('./isObjectLike-cjs.js');
|
|
5
|
-
var
|
|
5
|
+
var _baseGet = require('./_baseGet-cjs.js');
|
|
6
6
|
var _getTag = require('./_getTag-cjs.js');
|
|
7
7
|
var isTypedArray$1 = require('./isTypedArray-cjs.js');
|
|
8
8
|
var _commonjsHelpers = require('./_commonjsHelpers-cjs.js');
|
|
@@ -351,7 +351,7 @@ function equalByTag$1(object, other, tag, bitmask, customizer, equalFunc, stack)
|
|
|
351
351
|
|
|
352
352
|
var _equalByTag = equalByTag$1;
|
|
353
353
|
|
|
354
|
-
var getAllKeys =
|
|
354
|
+
var getAllKeys = _baseGet._getAllKeys;
|
|
355
355
|
|
|
356
356
|
/** Used to compose bitmasks for value comparisons. */
|
|
357
357
|
var COMPARE_PARTIAL_FLAG$3 = 1;
|
|
@@ -635,7 +635,7 @@ function isStrictComparable$2(value) {
|
|
|
635
635
|
var _isStrictComparable = isStrictComparable$2;
|
|
636
636
|
|
|
637
637
|
var isStrictComparable$1 = _isStrictComparable,
|
|
638
|
-
keys$1 =
|
|
638
|
+
keys$1 = _baseGet.keys_1;
|
|
639
639
|
|
|
640
640
|
/**
|
|
641
641
|
* Gets the property names, values, and compare flags of `object`.
|
|
@@ -704,7 +704,7 @@ function baseMatches$1(source) {
|
|
|
704
704
|
|
|
705
705
|
var _baseMatches = baseMatches$1;
|
|
706
706
|
|
|
707
|
-
var baseGet$1 =
|
|
707
|
+
var baseGet$1 = _baseGet._baseGet;
|
|
708
708
|
|
|
709
709
|
/**
|
|
710
710
|
* Gets the value at `path` of `object`. If the resolved value is
|
|
@@ -755,12 +755,12 @@ function baseHasIn$1(object, key) {
|
|
|
755
755
|
|
|
756
756
|
var _baseHasIn = baseHasIn$1;
|
|
757
757
|
|
|
758
|
-
var castPath =
|
|
758
|
+
var castPath = _baseGet._castPath,
|
|
759
759
|
isArguments = isTypedArray$1.isArguments_1,
|
|
760
760
|
isArray$1 = isTypedArray$1.isArray_1,
|
|
761
761
|
isIndex = identity$1._isIndex,
|
|
762
762
|
isLength = isTypedArray$1.isLength_1,
|
|
763
|
-
toKey$2 =
|
|
763
|
+
toKey$2 = _baseGet._toKey;
|
|
764
764
|
|
|
765
765
|
/**
|
|
766
766
|
* Checks if `path` exists on `object`.
|
|
@@ -833,10 +833,10 @@ var hasIn_1 = hasIn$1;
|
|
|
833
833
|
var baseIsEqual = _baseIsEqual,
|
|
834
834
|
get = get_1,
|
|
835
835
|
hasIn = hasIn_1,
|
|
836
|
-
isKey$1 =
|
|
836
|
+
isKey$1 = _baseGet._isKey,
|
|
837
837
|
isStrictComparable = _isStrictComparable,
|
|
838
838
|
matchesStrictComparable = _matchesStrictComparable,
|
|
839
|
-
toKey$1 =
|
|
839
|
+
toKey$1 = _baseGet._toKey;
|
|
840
840
|
|
|
841
841
|
/** Used to compose bitmasks for value comparisons. */
|
|
842
842
|
var COMPARE_PARTIAL_FLAG = 1,
|
|
@@ -880,7 +880,7 @@ function baseProperty$1(key) {
|
|
|
880
880
|
|
|
881
881
|
var _baseProperty = baseProperty$1;
|
|
882
882
|
|
|
883
|
-
var baseGet =
|
|
883
|
+
var baseGet = _baseGet._baseGet;
|
|
884
884
|
|
|
885
885
|
/**
|
|
886
886
|
* A specialized version of `baseProperty` which supports deep paths.
|
|
@@ -899,8 +899,8 @@ var _basePropertyDeep = basePropertyDeep$1;
|
|
|
899
899
|
|
|
900
900
|
var baseProperty = _baseProperty,
|
|
901
901
|
basePropertyDeep = _basePropertyDeep,
|
|
902
|
-
isKey =
|
|
903
|
-
toKey =
|
|
902
|
+
isKey = _baseGet._isKey,
|
|
903
|
+
toKey = _baseGet._toKey;
|
|
904
904
|
|
|
905
905
|
/**
|
|
906
906
|
* Creates a function that returns the value at `path` of a given object.
|
|
@@ -963,7 +963,7 @@ function baseIteratee(value) {
|
|
|
963
963
|
var _baseIteratee = baseIteratee;
|
|
964
964
|
|
|
965
965
|
var baseFor = _baseFor._baseFor,
|
|
966
|
-
keys =
|
|
966
|
+
keys = _baseGet.keys_1;
|
|
967
967
|
|
|
968
968
|
/**
|
|
969
969
|
* The base implementation of `_.forOwn` without support for iteratee shorthands.
|
package/dist/_baseEach-es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { g as _MapCache, d as _Uint8Array, e as eq_1, c as _Stack, a as _isIndex, i as identity_1 } from './identity-es.js';
|
|
2
2
|
import { b as _Symbol, i as isObjectLike_1, a as isObject_1 } from './isObjectLike-es.js';
|
|
3
|
-
import { e as _getAllKeys, k as keys_1, b as _baseGet, f as _castPath, g as _toKey, h as _isKey } from './
|
|
3
|
+
import { e as _getAllKeys, k as keys_1, b as _baseGet, f as _castPath, g as _toKey, h as _isKey } from './_baseGet-es.js';
|
|
4
4
|
import { a as _getTag } from './_getTag-es.js';
|
|
5
5
|
import { c as isBufferExports, d as isTypedArray_1, a as isArray_1, i as isArguments_1, m as isLength_1, b as isArrayLike_1 } from './isTypedArray-es.js';
|
|
6
6
|
import { g as getDefaultExportFromCjs } from './_commonjsHelpers-es.js';
|
package/dist/_baseFlatten-cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _baseGet = require('./_baseGet-cjs.js');
|
|
4
4
|
var isObjectLike = require('./isObjectLike-cjs.js');
|
|
5
5
|
var isTypedArray = require('./isTypedArray-cjs.js');
|
|
6
6
|
|
|
@@ -25,7 +25,7 @@ function isFlattenable$1(value) {
|
|
|
25
25
|
|
|
26
26
|
var _isFlattenable = isFlattenable$1;
|
|
27
27
|
|
|
28
|
-
var arrayPush =
|
|
28
|
+
var arrayPush = _baseGet._arrayPush,
|
|
29
29
|
isFlattenable = _isFlattenable;
|
|
30
30
|
|
|
31
31
|
/**
|
package/dist/_baseFlatten-es.js
CHANGED