@xqmsg/ui-core 0.22.2 → 0.22.4
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/components/form/index.d.ts +2 -2
- package/dist/components/form/section/index.d.ts +2 -1
- package/dist/components/input/index.d.ts +1 -1
- package/dist/components/table/index.d.ts +2 -1
- package/dist/ui-core.cjs.development.js +10 -9
- package/dist/ui-core.cjs.development.js.map +1 -1
- package/dist/ui-core.cjs.production.min.js +1 -1
- package/dist/ui-core.cjs.production.min.js.map +1 -1
- package/dist/ui-core.esm.js +10 -9
- package/dist/ui-core.esm.js.map +1 -1
- package/package.json +4 -3
- package/src/components/banner/index.tsx +1 -1
- package/src/components/input/StackedPilledInput/index.tsx +21 -5
- package/src/components/input/StackedSwitch/index.tsx +1 -2
- package/src/components/input/components/label/index.tsx +1 -1
- package/src/components/input/index.tsx +5 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
import { FieldValues } from 'react-hook-form';
|
|
3
3
|
import { FormHandler } from '../../components/form/hooks/useFormHandler';
|
|
4
4
|
export interface FormProps<T extends FieldValues> {
|
|
@@ -9,4 +9,4 @@ export interface FormProps<T extends FieldValues> {
|
|
|
9
9
|
* `react-hook-form`. The `Form` component is provided a `formHandler` and is used to wrap a container
|
|
10
10
|
* that contains a `FormSection` component.
|
|
11
11
|
*/
|
|
12
|
-
export declare function Form<T extends FieldValues>({ formHandler, children, }: PropsWithChildren<FormProps<T>>): JSX.Element;
|
|
12
|
+
export declare function Form<T extends FieldValues>({ formHandler, children, }: PropsWithChildren<FormProps<T>>): React.JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { FieldValues, UseFormReturn } from 'react-hook-form';
|
|
2
3
|
import { FormStructure } from '../FormTypes';
|
|
3
4
|
/**
|
|
@@ -24,4 +25,4 @@ export interface FormSectionProps<T extends string | number | symbol, U extends
|
|
|
24
25
|
*
|
|
25
26
|
* @returns a list of input's for a specific form section.
|
|
26
27
|
*/
|
|
27
|
-
export declare function FormSection<T extends string | number | symbol, U extends FieldValues>({ formStructure, section, form, className, columns, spacing, }: FormSectionProps<T, U>): JSX.Element;
|
|
28
|
+
export declare function FormSection<T extends string | number | symbol, U extends FieldValues>({ formStructure, section, form, className, columns, spacing, }: FormSectionProps<T, U>): React.JSX.Element;
|
|
@@ -28,4 +28,4 @@ export interface InputProps<T extends FieldValues> extends ValidationProps {
|
|
|
28
28
|
* A functional React component utilized to render the `Input` component. Utilizes a switch statement
|
|
29
29
|
* to render the correct input based on the `inputType`.
|
|
30
30
|
*/
|
|
31
|
-
export declare function Input<T extends FieldValues>({ inputType, label, ariaLabel, className, placeholder, name, helperText, options, tooltipText, isInvalid, errorText, isRequired, maxLength, defaultValue, fullOptions, control, disabled, rightElement, leftElement, allowDefault, onChange, setValue, setError, clearErrors, }: InputProps<T>): JSX.Element;
|
|
31
|
+
export declare function Input<T extends FieldValues>({ inputType, label, ariaLabel, className, placeholder, name, helperText, options, tooltipText, isInvalid, errorText, isRequired, maxLength, defaultValue, fullOptions, control, disabled, rightElement, leftElement, allowDefault, onChange, setValue, setError, clearErrors, }: InputProps<T>): React.JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { ReadonlyTableColumns, TableBody, TableColumns, TableHeaders } from './TableTypes';
|
|
2
3
|
export interface TableProps<T extends ReadonlyTableColumns> {
|
|
3
4
|
columns: TableColumns;
|
|
@@ -10,4 +11,4 @@ export interface TableProps<T extends ReadonlyTableColumns> {
|
|
|
10
11
|
/**
|
|
11
12
|
* A React component utilized to render the `Table` component
|
|
12
13
|
*/
|
|
13
|
-
export declare function Table<T extends ReadonlyTableColumns>({ columns, headers, body, loading, loadMore, }: TableProps<T>): JSX.Element;
|
|
14
|
+
export declare function Table<T extends ReadonlyTableColumns>({ columns, headers, body, loading, loadMore, }: TableProps<T>): React.JSX.Element;
|
|
@@ -221,7 +221,8 @@ var Banner = function Banner(_ref) {
|
|
|
221
221
|
}
|
|
222
222
|
}, [variant]);
|
|
223
223
|
return /*#__PURE__*/React__default.createElement(react.Alert, {
|
|
224
|
-
variant: variant
|
|
224
|
+
variant: variant,
|
|
225
|
+
borderRadius: "4px"
|
|
225
226
|
}, /*#__PURE__*/React__default.createElement(react.AlertDescription, null, /*#__PURE__*/React__default.createElement(react.Flex, {
|
|
226
227
|
flexDirection: type === 'condensed' ? 'row' : 'column',
|
|
227
228
|
alignItems: type === 'condensed' ? 'center' : '',
|
|
@@ -1567,7 +1568,7 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1567
1568
|
setLatestFormValueToArray([]);
|
|
1568
1569
|
}
|
|
1569
1570
|
if (watchedValue !== undefined && watchedValue != null && watchedValue.length) {
|
|
1570
|
-
setLatestFormValueToArray(watchedValue.split(',').filter(Boolean));
|
|
1571
|
+
setLatestFormValueToArray(watchedValue.split(';').join(',').split(',').filter(Boolean));
|
|
1571
1572
|
if (latestTokenElement) {
|
|
1572
1573
|
latestTokenElement.scrollIntoView({
|
|
1573
1574
|
block: 'end',
|
|
@@ -1582,7 +1583,7 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1582
1583
|
e.stopPropagation();
|
|
1583
1584
|
e.preventDefault();
|
|
1584
1585
|
}
|
|
1585
|
-
if ((e.key === '
|
|
1586
|
+
if ((e.key === 'Enter' || e.key === ',' || e.key === ';' || e.key === 'Tab') && localValue.trim().length) {
|
|
1586
1587
|
if (e.key === 'Enter' && !localValue.trim().length && tokenIndex !== null) {
|
|
1587
1588
|
setLocalValue(lastestFormValueToArray[tokenIndex]);
|
|
1588
1589
|
var _filteredUniqueValues = Array.from(new Set(lastestFormValueToArray.filter(function (value) {
|
|
@@ -1594,7 +1595,7 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1594
1595
|
});
|
|
1595
1596
|
return setTokenIndex(null);
|
|
1596
1597
|
}
|
|
1597
|
-
var filteredUniqueValues = Array.from(new Set([].concat(lastestFormValueToArray, localValue.trim().split(','))));
|
|
1598
|
+
var filteredUniqueValues = Array.from(new Set([].concat(lastestFormValueToArray, localValue.trim().split(';').join(',').split(','))));
|
|
1598
1599
|
setLocalValue('');
|
|
1599
1600
|
return setValue(name, filteredUniqueValues.toString(), {
|
|
1600
1601
|
shouldValidate: true,
|
|
@@ -1752,7 +1753,7 @@ var StackedPilledInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
|
|
|
1752
1753
|
},
|
|
1753
1754
|
value: localValue,
|
|
1754
1755
|
onChange: function onChange(e) {
|
|
1755
|
-
return tokenIndex === null && setLocalValue(e.target.value.trim().replace(',', '').length ? e.target.value : '');
|
|
1756
|
+
return tokenIndex === null && setLocalValue(e.target.value.trim().replace(',', '').replace(';', '').length ? e.target.value : '');
|
|
1756
1757
|
},
|
|
1757
1758
|
ref: inputRef,
|
|
1758
1759
|
onFocus: function onFocus() {
|
|
@@ -1774,8 +1775,7 @@ var StackedSwitch = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref
|
|
|
1774
1775
|
value = _ref2.value;
|
|
1775
1776
|
if (value === null) return null;
|
|
1776
1777
|
return /*#__PURE__*/React__default.createElement(react.Switch, {
|
|
1777
|
-
h: "
|
|
1778
|
-
mx: "4px",
|
|
1778
|
+
h: "21px",
|
|
1779
1779
|
_focus: {
|
|
1780
1780
|
border: '2px solid',
|
|
1781
1781
|
borderColor: colors.border.focus
|
|
@@ -1798,7 +1798,8 @@ var Label$1 = function Label(_ref) {
|
|
|
1798
1798
|
isRequired = _ref.isRequired,
|
|
1799
1799
|
label = _ref.label;
|
|
1800
1800
|
return /*#__PURE__*/React__default.createElement(react.FormLabel, {
|
|
1801
|
-
display: "flex"
|
|
1801
|
+
display: "flex",
|
|
1802
|
+
ml: "0"
|
|
1802
1803
|
}, label, isRequired && /*#__PURE__*/React__default.createElement(react.Box, {
|
|
1803
1804
|
ml: 1,
|
|
1804
1805
|
color: colors.label.error
|
|
@@ -1995,7 +1996,7 @@ function Input(_ref) {
|
|
|
1995
1996
|
id: name,
|
|
1996
1997
|
isInvalid: isInvalid,
|
|
1997
1998
|
position: "relative",
|
|
1998
|
-
py: label || helperText || isInvalid ? 5 : 0
|
|
1999
|
+
py: inputType !== 'checkbox' && label || helperText || isInvalid ? 5 : 0
|
|
1999
2000
|
}, label && inputType !== 'checkbox' && /*#__PURE__*/React__default.createElement(Label$1, {
|
|
2000
2001
|
tooltipText: tooltipText,
|
|
2001
2002
|
label: label,
|