linear-react-components-ui 1.0.10-beta.1 → 1.0.10-beta.3
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/lib/@types/Align.d.ts +2 -1
- package/lib/dialog/Alert.d.ts +1 -0
- package/lib/dialog/Custom.d.ts +1 -0
- package/lib/dialog/Error.d.ts +1 -0
- package/lib/dialog/Information.d.ts +1 -0
- package/lib/dialog/Question.d.ts +1 -0
- package/lib/dialog/Warning.d.ts +1 -0
- package/lib/dialog/base/Content.d.ts +1 -0
- package/lib/dialog/base/Footer.d.ts +1 -0
- package/lib/dialog/base/Header.d.ts +1 -0
- package/lib/dialog/base/index.d.ts +1 -0
- package/lib/dialog/form/index.d.ts +1 -0
- package/lib/dialog/index.d.ts +1 -0
- package/lib/dialog/types.d.ts +2 -1
- package/lib/icons/helper.d.ts +0 -12
- package/lib/icons/helper.js +0 -12
- package/lib/index.d.ts +1 -0
- package/lib/inputs/base/InputTextBase.d.ts +1 -0
- package/lib/inputs/base/InputTextBase.js +4 -1
- package/lib/inputs/base/helpers.d.ts +2 -1
- package/lib/inputs/base/types.d.ts +2 -1
- package/lib/inputs/date/Dialog.d.ts +1 -0
- package/lib/inputs/date/Dropdown.d.ts +1 -0
- package/lib/inputs/date/helpers.d.ts +1 -0
- package/lib/inputs/date/index.d.ts +1 -0
- package/lib/inputs/date/types.d.ts +1 -0
- package/lib/inputs/file/DefaultFile.d.ts +1 -0
- package/lib/inputs/file/DragDropFile.d.ts +1 -0
- package/lib/inputs/file/File.d.ts +1 -0
- package/lib/inputs/file/FileButtonSettings.d.ts +1 -0
- package/lib/inputs/file/helpers.d.ts +1 -0
- package/lib/inputs/file/index.d.ts +1 -0
- package/lib/inputs/file/types.d.ts +1 -0
- package/lib/inputs/inputHOC.d.ts +1 -0
- package/lib/inputs/mask/BaseMask.d.ts +1 -0
- package/lib/inputs/mask/Cnpj.d.ts +1 -0
- package/lib/inputs/mask/Cpf.d.ts +1 -0
- package/lib/inputs/mask/Phone.d.ts +1 -0
- package/lib/inputs/mask/ZipCode.d.ts +1 -0
- package/lib/inputs/mask/helpers.d.ts +1 -0
- package/lib/inputs/mask/imaskHOC.d.ts +1 -0
- package/lib/inputs/mask/index.d.ts +1 -0
- package/lib/inputs/mask/types.d.ts +2 -1
- package/lib/inputs/multiSelect/ActionButtons.d.ts +1 -0
- package/lib/inputs/multiSelect/Dropdown.d.ts +1 -0
- package/lib/inputs/multiSelect/index.d.ts +1 -0
- package/lib/inputs/multiSelect/types.d.ts +1 -0
- package/lib/inputs/number/BaseNumber.d.ts +1 -0
- package/lib/inputs/number/Currency.d.ts +1 -0
- package/lib/inputs/number/Decimal.d.ts +1 -0
- package/lib/inputs/number/index.d.ts +1 -0
- package/lib/inputs/number/types.d.ts +1 -1
- package/lib/inputs/period/Dialog.d.ts +1 -0
- package/lib/inputs/period/Dropdown.d.ts +1 -0
- package/lib/inputs/period/PeriodList.d.ts +1 -0
- package/lib/inputs/period/helper.d.ts +1 -0
- package/lib/inputs/period/index.d.ts +1 -0
- package/lib/inputs/period/types.d.ts +1 -0
- package/lib/inputs/search/index.d.ts +1 -0
- package/lib/inputs/select/ActionButtons.d.ts +1 -0
- package/lib/inputs/select/Dropdown.d.ts +1 -0
- package/lib/inputs/select/helper.d.ts +1 -0
- package/lib/inputs/select/index.d.ts +1 -0
- package/lib/inputs/select/multiple/Selecteds.d.ts +1 -0
- package/lib/inputs/select/multiple/index.d.ts +1 -0
- package/lib/inputs/select/simple/index.d.ts +1 -0
- package/lib/inputs/select/simple/index.js +32 -30
- package/lib/inputs/select/types.d.ts +2 -1
- package/lib/inputs/text/index.d.ts +1 -0
- package/lib/inputs/text/types.d.ts +1 -1
- package/lib/inputs/textarea/index.d.ts +1 -0
- package/lib/inputs/textarea/types.d.ts +1 -0
- package/lib/inputs/types.d.ts +3 -2
- package/package.json +1 -1
package/lib/@types/Align.d.ts
CHANGED
package/lib/dialog/Alert.d.ts
CHANGED
package/lib/dialog/Custom.d.ts
CHANGED
package/lib/dialog/Error.d.ts
CHANGED
package/lib/dialog/Question.d.ts
CHANGED
package/lib/dialog/Warning.d.ts
CHANGED
package/lib/dialog/index.d.ts
CHANGED
package/lib/dialog/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode, CSSProperties, ReactElement } from 'react';
|
|
2
|
+
import { TextAlign } from '../@types/Align.js';
|
|
2
3
|
|
|
3
4
|
interface IContentProps {
|
|
4
5
|
children: ReactNode | ReactNode[];
|
|
@@ -23,7 +24,7 @@ interface IBaseProps {
|
|
|
23
24
|
closeOnEsc?: boolean;
|
|
24
25
|
closeOnOutsideClick?: boolean;
|
|
25
26
|
overlay?: boolean;
|
|
26
|
-
textAlign?:
|
|
27
|
+
textAlign?: TextAlign;
|
|
27
28
|
zIndex?: string;
|
|
28
29
|
}
|
|
29
30
|
interface IFormProps {
|
package/lib/icons/helper.d.ts
CHANGED
|
@@ -563,18 +563,6 @@ declare const _default: {
|
|
|
563
563
|
viewbox: string;
|
|
564
564
|
paths: string[];
|
|
565
565
|
};
|
|
566
|
-
cash3: {
|
|
567
|
-
viewbox: string;
|
|
568
|
-
paths: string[];
|
|
569
|
-
};
|
|
570
|
-
wallet: {
|
|
571
|
-
viewbox: string;
|
|
572
|
-
paths: string[];
|
|
573
|
-
};
|
|
574
|
-
stackEmpty: {
|
|
575
|
-
viewbox: string;
|
|
576
|
-
paths: string[];
|
|
577
|
-
};
|
|
578
566
|
};
|
|
579
567
|
|
|
580
568
|
export { _default as default };
|
package/lib/icons/helper.js
CHANGED
|
@@ -568,18 +568,6 @@ var _default = {
|
|
|
568
568
|
records: {
|
|
569
569
|
viewbox: '0 0 16 16',
|
|
570
570
|
paths: ['M13.75 4h-0.75v-0.75c0-0.689-0.561-1.25-1.25-1.25h-0.75v-0.75c0-0.689-0.561-1.25-1.25-1.25h-7.5c-0.689 0-1.25 0.561-1.25 1.25v9.5c0 0.689 0.561 1.25 1.25 1.25h0.75v0.75c0 0.689 0.561 1.25 1.25 1.25h0.75v0.75c0 0.689 0.561 1.25 1.25 1.25h7.5c0.689 0 1.25-0.561 1.25-1.25v-9.5c0-0.689-0.561-1.25-1.25-1.25zM2.25 11c-0.138 0-0.25-0.113-0.25-0.25v-9.5c0-0.137 0.112-0.25 0.25-0.25h7.5c0.137 0 0.25 0.113 0.25 0.25v0.75h-5.75c-0.689 0-1.25 0.561-1.25 1.25v7.75h-0.75zM4.25 13c-0.138 0-0.25-0.113-0.25-0.25v-9.5c0-0.138 0.112-0.25 0.25-0.25h7.5c0.137 0 0.25 0.112 0.25 0.25v0.75h-5.75c-0.689 0-1.25 0.561-1.25 1.25v7.75h-0.75zM14 14.75c0 0.137-0.113 0.25-0.25 0.25h-7.5c-0.138 0-0.25-0.113-0.25-0.25v-9.5c0-0.138 0.112-0.25 0.25-0.25h7.5c0.137 0 0.25 0.112 0.25 0.25v9.5z']
|
|
571
|
-
},
|
|
572
|
-
cash3: {
|
|
573
|
-
viewbox: '0 0 17 16',
|
|
574
|
-
paths: ['9h1v1h-1v-1z', 'M0 6v9h17v-9h-17zM3 14h-2v-2h1v1h1v1zM3 8h-1v1h-1v-2h2v1zM10.5 10c0.276 0 0.5 0.224 0.5 0.5v2c0 0.276-0.224 0.5-0.5 0.5h-1.5v0.5c0 0.276-0.224 0.5-0.5 0.5s-0.5-0.224-0.5-0.5v-0.5h-1.5c-0.276 0-0.5-0.224-0.5-0.5s0.224-0.5 0.5-0.5h1.5v-1h-1.5c-0.276 0-0.5-0.224-0.5-0.5v-2c0-0.276 0.224-0.5 0.5-0.5h1.5v-0.5c0-0.276 0.224-0.5 0.5-0.5s0.5 0.224 0.5 0.5v0.5h1.5c0.276 0 0.5 0.224 0.5 0.5s-0.224 0.5-0.5 0.5h-1.5v1h1.5zM16 14h-2v-1h1v-1h1v2zM16 9h-1v-1h-1v-1h2v2z', 'M9 11h1v1h-1v-1z', 'M1 4h15v1.5h-15v-1.5z', 'M2 2h13v1.5h-13v-1.5z']
|
|
575
|
-
},
|
|
576
|
-
wallet: {
|
|
577
|
-
viewbox: '0 0 17 16',
|
|
578
|
-
paths: ['M15 2h-13c-1.105 0-2 0.895-2 2v10c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1v-1h1c0.55 0 1-0.45 1-1v-9c0-0.55-0.45-1-1-1zM1 6h0.5v1h-0.5v-1zM1 8h0.5v1h-0.5v-1zM1 10h0.5v1h-0.5v-1zM1 12h0.5v1h-0.5v-1zM2 14h-1v-0.5h1v0.5zM2 5.5h-1v-0.5h1v0.5zM4 14h-1v-0.5h1v0.5zM4 5.5h-1v-0.5h1v0.5zM6 14h-1v-0.5h1v0.5zM6 5.5h-1v-0.5h1v0.5zM8 14h-1v-0.5h1v0.5zM8 5.5h-1v-0.5h1v0.5zM10 14h-1v-0.5h1v0.5zM12 14h-1v-0.5h1v0.5zM15 7h-4v3h4v1.998c-0.001 0.001-0.001 0.001-0.002 0.002h-0.998v-1h-4v-5h4v-1c0-0.55-0.45-1-1-1h-12c0-0.551 0.449-1 1-1h12.998c0.001 0.001 0.001 0.001 0.002 0.002v3.998zM13 8.5c0 0.276-0.224 0.5-0.5 0.5s-0.5-0.224-0.5-0.5 0.224-0.5 0.5-0.5 0.5 0.224 0.5 0.5z']
|
|
579
|
-
},
|
|
580
|
-
stackEmpty: {
|
|
581
|
-
viewbox: '0 0 16 16',
|
|
582
|
-
paths: ['M16 13v-12h-11v1.155l-2.619 0.368 0.17 1.211-2.551 0.732 3.308 11.535 10.189-2.921 0.558-0.079h1.945zM6 2h9v10h-9v-10zM5 3.070v9.93h2.543l-2.721 0.382-1.418-10.088 1.595-0.224zM3.929 14.879l-2.808-9.793 1.558-0.447 1.373 9.766 2.997-0.421-3.119 0.894z']
|
|
583
571
|
}
|
|
584
572
|
};
|
|
585
573
|
exports.default = _default;
|
package/lib/index.d.ts
CHANGED
|
@@ -151,7 +151,10 @@ var InputTextBase = function InputTextBase(props) {
|
|
|
151
151
|
className: "input-base-component ".concat(skeletonize ? '-skeletonized' : '', " ").concat(customClass),
|
|
152
152
|
ref: inputBaseRef
|
|
153
153
|
}, label && /*#__PURE__*/_react.default.createElement("div", {
|
|
154
|
-
className: "labelcontainer"
|
|
154
|
+
className: "labelcontainer",
|
|
155
|
+
style: {
|
|
156
|
+
textAlign: textAlign
|
|
157
|
+
}
|
|
155
158
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
156
159
|
style: styleForLabel,
|
|
157
160
|
className: "label ".concat(customClassForLabel, " ").concat(labelUppercase && ' -uppercase')
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { IBaseProps } from './types.js';
|
|
2
|
+
import { TextAlign } from '../../@types/Align.js';
|
|
2
3
|
import 'react';
|
|
3
4
|
import '../../@types/Period.js';
|
|
4
5
|
import '../../@types/PermissionAttr.js';
|
|
5
6
|
|
|
6
7
|
declare const getInputClass: ({ textAlign, readOnly, readOnlyClass }: {
|
|
7
|
-
textAlign?:
|
|
8
|
+
textAlign?: TextAlign | undefined;
|
|
8
9
|
readOnly?: boolean | undefined;
|
|
9
10
|
readOnlyClass?: string | undefined;
|
|
10
11
|
}) => string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { KeyboardEvent, DragEvent, MutableRefObject, RefObject, CSSProperties } from 'react';
|
|
2
|
+
import { TextAlign } from '../../@types/Align.js';
|
|
2
3
|
import { Period } from '../../@types/Period.js';
|
|
3
4
|
import { PermissionAttr, OnDenied } from '../../@types/PermissionAttr.js';
|
|
4
5
|
|
|
@@ -57,7 +58,7 @@ interface IBaseProps {
|
|
|
57
58
|
inputRef?: MutableRefObject<HTMLInputElement | HTMLTextAreaElement | null> | ((ref: HTMLInputElement | HTMLTextAreaElement | null) => void);
|
|
58
59
|
inputBaseRef?: RefObject<HTMLDivElement> | ((ref: HTMLDivElement) => void);
|
|
59
60
|
hint?: string;
|
|
60
|
-
textAlign?:
|
|
61
|
+
textAlign?: TextAlign;
|
|
61
62
|
rounded?: boolean;
|
|
62
63
|
errorMessages?: string[] | undefined;
|
|
63
64
|
visible?: boolean;
|
|
@@ -3,6 +3,7 @@ import 'react';
|
|
|
3
3
|
import '../../@types/ColorStyles.js';
|
|
4
4
|
import '../../@types/PermissionAttr.js';
|
|
5
5
|
import '../base/types.js';
|
|
6
|
+
import '../../@types/Align.js';
|
|
6
7
|
import '../../@types/Period.js';
|
|
7
8
|
|
|
8
9
|
declare const Dialog: ({ handlerClose, children, dialogSize }: IDateDialogProps) => JSX.Element;
|
|
@@ -3,6 +3,7 @@ import { IDateDropdownProps } from './types.js';
|
|
|
3
3
|
import '../../@types/ColorStyles.js';
|
|
4
4
|
import '../../@types/PermissionAttr.js';
|
|
5
5
|
import '../base/types.js';
|
|
6
|
+
import '../../@types/Align.js';
|
|
6
7
|
import '../../@types/Period.js';
|
|
7
8
|
|
|
8
9
|
declare const Dropdown: (props: IDateDropdownProps) => React.ReactPortal;
|
|
@@ -3,6 +3,7 @@ import 'react';
|
|
|
3
3
|
import '../../@types/ColorStyles.js';
|
|
4
4
|
import '../../@types/PermissionAttr.js';
|
|
5
5
|
import '../base/types.js';
|
|
6
|
+
import '../../@types/Align.js';
|
|
6
7
|
import '../../@types/Period.js';
|
|
7
8
|
|
|
8
9
|
declare const DatePicker: (props: IDatePickerProps) => JSX.Element | null;
|
|
@@ -2,6 +2,7 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { ColorStyles } from '../../@types/ColorStyles.js';
|
|
3
3
|
import { PermissionAttr } from '../../@types/PermissionAttr.js';
|
|
4
4
|
import { CustomInputEvent } from '../base/types.js';
|
|
5
|
+
import '../../@types/Align.js';
|
|
5
6
|
import '../../@types/Period.js';
|
|
6
7
|
|
|
7
8
|
interface IDatePickerProps {
|
package/lib/inputs/inputHOC.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { IInputHOCProps } from './types.js';
|
|
|
3
3
|
import '../@types/PermissionAttr.js';
|
|
4
4
|
import '../@types/DataCombo.js';
|
|
5
5
|
import './base/types.js';
|
|
6
|
+
import '../@types/Align.js';
|
|
6
7
|
import '../@types/Period.js';
|
|
7
8
|
import '../drawer/types.js';
|
|
8
9
|
import '../@types/Position.js';
|
package/lib/inputs/mask/Cpf.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { IMaskHOCProps } from '../types.js';
|
|
|
3
3
|
import '../../@types/PermissionAttr.js';
|
|
4
4
|
import '../../@types/DataCombo.js';
|
|
5
5
|
import '../base/types.js';
|
|
6
|
+
import '../../@types/Align.js';
|
|
6
7
|
import '../../@types/Period.js';
|
|
7
8
|
import '../../drawer/types.js';
|
|
8
9
|
import '../../@types/Position.js';
|
|
@@ -5,6 +5,7 @@ export { default as PhoneField } from './Phone.js';
|
|
|
5
5
|
export { default as ZipCodeField } from './ZipCode.js';
|
|
6
6
|
import './types.js';
|
|
7
7
|
import 'react';
|
|
8
|
+
import '../../@types/Align.js';
|
|
8
9
|
import '../../@types/PermissionAttr.js';
|
|
9
10
|
import '../base/types.js';
|
|
10
11
|
import '../../@types/Period.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { KeyboardEvent, MutableRefObject } from 'react';
|
|
2
|
+
import { TextAlign } from '../../@types/Align.js';
|
|
2
3
|
import { OnDenied, PermissionAttr } from '../../@types/PermissionAttr.js';
|
|
3
4
|
import { CustomInputEvent } from '../base/types.js';
|
|
4
5
|
import '../../@types/Period.js';
|
|
@@ -26,7 +27,7 @@ interface IBaseMaskProps {
|
|
|
26
27
|
permissionAttr?: PermissionAttr;
|
|
27
28
|
errorMessages?: string[];
|
|
28
29
|
rounded?: boolean;
|
|
29
|
-
textAlign?:
|
|
30
|
+
textAlign?: TextAlign;
|
|
30
31
|
customClassForInputContent?: string;
|
|
31
32
|
label?: string;
|
|
32
33
|
name?: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ChangeEvent, RefObject } from 'react';
|
|
2
2
|
import { DataCombo } from '../../@types/DataCombo.js';
|
|
3
3
|
import { CustomInputEvent } from '../base/types.js';
|
|
4
|
+
import '../../@types/Align.js';
|
|
4
5
|
import '../../@types/Period.js';
|
|
5
6
|
import '../../@types/PermissionAttr.js';
|
|
6
7
|
|
|
@@ -2,6 +2,7 @@ import { PermissionAttr } from '../../@types/PermissionAttr.js';
|
|
|
2
2
|
import { CustomInputEvent } from '../base/types.js';
|
|
3
3
|
import { IMaskHOCProps } from '../types.js';
|
|
4
4
|
import 'react';
|
|
5
|
+
import '../../@types/Align.js';
|
|
5
6
|
import '../../@types/Period.js';
|
|
6
7
|
import '../../@types/DataCombo.js';
|
|
7
8
|
import '../../drawer/types.js';
|
|
@@ -9,7 +10,6 @@ import '../../@types/Position.js';
|
|
|
9
10
|
|
|
10
11
|
interface INumberFieldProps extends IMaskHOCProps {
|
|
11
12
|
value?: string;
|
|
12
|
-
textAlign?: string;
|
|
13
13
|
permissionAttr?: PermissionAttr;
|
|
14
14
|
disabled?: boolean;
|
|
15
15
|
onChange?: (e?: CustomInputEvent, maskValue?: string, date?: string | {
|
|
@@ -5,6 +5,7 @@ import '../../@types/ColorStyles.js';
|
|
|
5
5
|
import '../../@types/Period.js';
|
|
6
6
|
import '../../@types/PermissionAttr.js';
|
|
7
7
|
import '../base/types.js';
|
|
8
|
+
import '../../@types/Align.js';
|
|
8
9
|
|
|
9
10
|
declare const Dialog: ({ handlerClose, children, dialogSize }: IDialogProps) => JSX.Element;
|
|
10
11
|
|
|
@@ -5,6 +5,7 @@ import '../../@types/ColorStyles.js';
|
|
|
5
5
|
import '../../@types/Period.js';
|
|
6
6
|
import '../../@types/PermissionAttr.js';
|
|
7
7
|
import '../base/types.js';
|
|
8
|
+
import '../../@types/Align.js';
|
|
8
9
|
|
|
9
10
|
declare const PeriodList: ({ selected, handleOnSelect }: IPeriodListProps) => JSX.Element;
|
|
10
11
|
|
|
@@ -5,6 +5,7 @@ import '../../@types/ColorStyles.js';
|
|
|
5
5
|
import '../../@types/Period.js';
|
|
6
6
|
import '../../@types/PermissionAttr.js';
|
|
7
7
|
import '../base/types.js';
|
|
8
|
+
import '../../@types/Align.js';
|
|
8
9
|
|
|
9
10
|
declare const getCalendarDropdownStyle: ({ topPosition, leftPosition, width }: {
|
|
10
11
|
topPosition: number | string;
|
|
@@ -4,6 +4,7 @@ import { ColorStyles } from '../../@types/ColorStyles.js';
|
|
|
4
4
|
import { Period } from '../../@types/Period.js';
|
|
5
5
|
import { PermissionAttr } from '../../@types/PermissionAttr.js';
|
|
6
6
|
import { CustomInputEvent } from '../base/types.js';
|
|
7
|
+
import '../../@types/Align.js';
|
|
7
8
|
|
|
8
9
|
type DateTypes = 'today' | 'week' | 'lastweek' | 'last15' | 'month' | 'lastmonth';
|
|
9
10
|
interface IPeriodOptions {
|
|
@@ -3,6 +3,7 @@ import { IDropdownSelectProps } from '../types.js';
|
|
|
3
3
|
import 'react';
|
|
4
4
|
import '../../@types/PermissionAttr.js';
|
|
5
5
|
import '../base/types.js';
|
|
6
|
+
import '../../@types/Align.js';
|
|
6
7
|
import '../../@types/Period.js';
|
|
7
8
|
import '../../drawer/types.js';
|
|
8
9
|
import '../../@types/Position.js';
|
|
@@ -17,21 +17,20 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
17
17
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
19
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
20
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
21
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
22
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
23
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
24
20
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
25
21
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
26
22
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
27
23
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
28
24
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
29
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
30
25
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
31
26
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
27
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
28
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
29
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
32
30
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
31
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
32
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
33
33
|
var SimpleSelect = function SimpleSelect(props) {
|
|
34
|
-
var _ref;
|
|
35
34
|
var value = props.value,
|
|
36
35
|
_props$descriptionKey = props.descriptionKey,
|
|
37
36
|
descriptionKey = _props$descriptionKey === void 0 ? '' : _props$descriptionKey,
|
|
@@ -55,8 +54,7 @@ var SimpleSelect = function SimpleSelect(props) {
|
|
|
55
54
|
searchOnDropdown = _props$searchOnDropdo === void 0 ? false : _props$searchOnDropdo,
|
|
56
55
|
_props$allOptions = props.allOptions,
|
|
57
56
|
allOptions = _props$allOptions === void 0 ? undefined : _props$allOptions;
|
|
58
|
-
var
|
|
59
|
-
var _useState = (0, _react.useState)(dataSourceWithAllOptions),
|
|
57
|
+
var _useState = (0, _react.useState)(dataSource),
|
|
60
58
|
_useState2 = _slicedToArray(_useState, 2),
|
|
61
59
|
dataCombo = _useState2[0],
|
|
62
60
|
setDataCombo = _useState2[1];
|
|
@@ -101,9 +99,8 @@ var SimpleSelect = function SimpleSelect(props) {
|
|
|
101
99
|
if (selectWrapper.current) setDropdownWidth(selectWrapper.current.clientWidth);
|
|
102
100
|
};
|
|
103
101
|
var onClickOutside = function onClickOutside(event) {
|
|
104
|
-
var _selectWrapper$curren, _dropdownRef$current;
|
|
105
102
|
var target = event.target;
|
|
106
|
-
if (target !== selectWrapper.current &&
|
|
103
|
+
if (target !== selectWrapper.current && selectWrapper.current && !selectWrapper.current.contains(target) && dropdownRef.current && !dropdownRef.current.contains(target)) {
|
|
107
104
|
setOpened(false);
|
|
108
105
|
}
|
|
109
106
|
};
|
|
@@ -135,7 +132,7 @@ var SimpleSelect = function SimpleSelect(props) {
|
|
|
135
132
|
var dataComboFilter = (0, _helper.getFilteredSimpleDataCombo)({
|
|
136
133
|
inputText: valueFilter,
|
|
137
134
|
descriptionKey: descriptionKey,
|
|
138
|
-
dataSource:
|
|
135
|
+
dataSource: dataSource
|
|
139
136
|
});
|
|
140
137
|
if (dataComboFilter && dataComboFilter.length > 0) selectedFilter = dataComboFilter[0];
|
|
141
138
|
setDataCombo(dataComboFilter);
|
|
@@ -156,7 +153,7 @@ var SimpleSelect = function SimpleSelect(props) {
|
|
|
156
153
|
setOpened(!opened);
|
|
157
154
|
if (selectWrapper.current) setDropdownWidth(selectWrapper.current.clientWidth);
|
|
158
155
|
};
|
|
159
|
-
var
|
|
156
|
+
var _onFocus = function onFocus() {
|
|
160
157
|
setOpened(openDropdownOnFocus);
|
|
161
158
|
if (selectWrapper) {
|
|
162
159
|
var dropdownWidthFocus = selectWrapper.current ? selectWrapper.current.clientWidth : 0;
|
|
@@ -181,15 +178,15 @@ var SimpleSelect = function SimpleSelect(props) {
|
|
|
181
178
|
onSelect(selected);
|
|
182
179
|
} else if ([constants.keyCodes.ARROW_UP, constants.keyCodes.ARROW_DOWN].includes(e.keyCode)) {
|
|
183
180
|
if (!opened) setOpened(true);
|
|
184
|
-
var index =
|
|
181
|
+
var index = dataSource.length > 0 ? dataSource.findIndex(function (d) {
|
|
185
182
|
return selected && d[idKey] === selected[idKey];
|
|
186
183
|
}) : 0;
|
|
187
184
|
if (e.keyCode === constants.keyCodes.ARROW_DOWN) {
|
|
188
|
-
index =
|
|
185
|
+
index = dataSource && index === dataSource.length - 1 ? 0 : index + 1;
|
|
189
186
|
} else {
|
|
190
|
-
index =
|
|
187
|
+
index = dataSource && index === 0 ? (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) - 1 : index - 1;
|
|
191
188
|
}
|
|
192
|
-
setSelected(
|
|
189
|
+
setSelected(dataSource[index]);
|
|
193
190
|
}
|
|
194
191
|
}
|
|
195
192
|
if (!isTyping) setIsTyping(true);
|
|
@@ -224,34 +221,38 @@ var SimpleSelect = function SimpleSelect(props) {
|
|
|
224
221
|
}
|
|
225
222
|
}, [gridLayout]);
|
|
226
223
|
(0, _react.useEffect)(function () {
|
|
227
|
-
if (value !== valueFromProps &&
|
|
224
|
+
if (value !== valueFromProps && dataSource.length > 0) {
|
|
228
225
|
var newCurrent = null;
|
|
229
226
|
if (value) {
|
|
230
|
-
newCurrent =
|
|
227
|
+
newCurrent = dataSource.find(function (i) {
|
|
231
228
|
return value && i[idKey].toString().toLowerCase() === value.toString().toLowerCase();
|
|
232
229
|
});
|
|
233
230
|
setValueFromProps(value);
|
|
234
|
-
} else if (
|
|
235
|
-
newCurrent =
|
|
231
|
+
} else if (dataSource.length > 0 && selectFirstOnEnter) {
|
|
232
|
+
newCurrent = dataSource[0];
|
|
236
233
|
}
|
|
237
234
|
setSelected(newCurrent);
|
|
238
235
|
setInputText(newCurrent ? newCurrent[descriptionKey] : '');
|
|
239
236
|
}
|
|
240
|
-
}, [
|
|
237
|
+
}, [dataSource.length, value]);
|
|
241
238
|
(0, _react.useEffect)(function () {
|
|
242
|
-
if (!_lodash.default.isEqual(dataCombo,
|
|
243
|
-
var dataComboFilteredSimple = undigitable || remoteSearch || !isTyping ?
|
|
239
|
+
if (!_lodash.default.isEqual(dataCombo, dataSource)) {
|
|
240
|
+
var dataComboFilteredSimple = undigitable || remoteSearch || !isTyping ? dataSource : (0, _helper.getFilteredSimpleDataCombo)({
|
|
244
241
|
inputText: inputText,
|
|
245
|
-
dataSource:
|
|
242
|
+
dataSource: dataSource,
|
|
246
243
|
descriptionKey: descriptionKey
|
|
247
244
|
});
|
|
248
245
|
setDataCombo(dataComboFilteredSimple);
|
|
249
|
-
if (
|
|
250
|
-
var data =
|
|
246
|
+
if (dataSource.length > 0 && remoteSearch) {
|
|
247
|
+
var data = dataSource[0];
|
|
251
248
|
setSelected(data);
|
|
252
249
|
}
|
|
253
250
|
}
|
|
254
|
-
|
|
251
|
+
if (allOptions) {
|
|
252
|
+
var _ref;
|
|
253
|
+
setDataCombo([(_ref = {}, _defineProperty(_ref, idKey, allOptions.idValue), _defineProperty(_ref, descriptionKey, allOptions.label), _ref)].concat(_toConsumableArray(dataSource)));
|
|
254
|
+
}
|
|
255
|
+
}, [dataSource]);
|
|
255
256
|
return /*#__PURE__*/_react.default.createElement("span", {
|
|
256
257
|
id: componentId,
|
|
257
258
|
ref: componentRef,
|
|
@@ -259,8 +260,9 @@ var SimpleSelect = function SimpleSelect(props) {
|
|
|
259
260
|
}, /*#__PURE__*/_react.default.createElement(_InputTextBase.default, _extends({}, props, {
|
|
260
261
|
readOnly: undigitable || shouldBeReadOnly(),
|
|
261
262
|
value: inputText,
|
|
262
|
-
onFocus: onFocus
|
|
263
|
-
|
|
263
|
+
onFocus: function onFocus() {
|
|
264
|
+
_onFocus();
|
|
265
|
+
},
|
|
264
266
|
onChange: function onChange(e) {
|
|
265
267
|
if (e) onFilter(e.target.value);
|
|
266
268
|
},
|
|
@@ -301,7 +303,7 @@ var SimpleSelect = function SimpleSelect(props) {
|
|
|
301
303
|
handleOnBlur: function handleOnBlur() {
|
|
302
304
|
return onBlur;
|
|
303
305
|
},
|
|
304
|
-
handleOnFocus:
|
|
306
|
+
handleOnFocus: _onFocus,
|
|
305
307
|
opened: opened,
|
|
306
308
|
dataCombo: dataCombo,
|
|
307
309
|
dropdownWidth: dropdownWidth || 0
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TextAlign } from '../../@types/Align.js';
|
|
1
2
|
import { DataCombo } from '../../@types/DataCombo.js';
|
|
2
3
|
import { PermissionAttr } from '../../@types/PermissionAttr.js';
|
|
3
4
|
import { CustomInputEvent } from '../base/types.js';
|
|
@@ -13,7 +14,7 @@ interface ISimpleSelectProps {
|
|
|
13
14
|
placeHolder?: string;
|
|
14
15
|
hint?: string;
|
|
15
16
|
value?: string | number | boolean | number[];
|
|
16
|
-
textAlign?:
|
|
17
|
+
textAlign?: TextAlign;
|
|
17
18
|
errorMessages?: string[];
|
|
18
19
|
showClearButton?: boolean;
|
|
19
20
|
searchOnDropdown?: boolean;
|
|
@@ -3,6 +3,7 @@ import { PermissionAttr } from '../../@types/PermissionAttr.js';
|
|
|
3
3
|
import { IBaseProps, CustomInputEvent } from '../base/types.js';
|
|
4
4
|
import { WithTooltipProps } from '../../internals/types.js';
|
|
5
5
|
import 'react';
|
|
6
|
+
import '../../@types/Align.js';
|
|
6
7
|
import '../../@types/Position.js';
|
|
7
8
|
|
|
8
9
|
type CommonProperties = Pick<WithTooltipProps, 'tooltip' | 'tooltipPosition' | 'tooltipWidth'>;
|
|
@@ -18,7 +19,6 @@ interface ITextField extends IBaseProps, CommonProperties {
|
|
|
18
19
|
leftElements?: JSX.Element | JSX.Element[];
|
|
19
20
|
rightElements?: JSX.Element | JSX.Element[];
|
|
20
21
|
permissionAttr?: PermissionAttr;
|
|
21
|
-
textAlign?: string;
|
|
22
22
|
gridLayout?: string;
|
|
23
23
|
}
|
|
24
24
|
|
package/lib/inputs/types.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { PermissionAttr, OnDenied } from '../@types/PermissionAttr.js';
|
|
|
3
3
|
import { DataCombo } from '../@types/DataCombo.js';
|
|
4
4
|
import { IBaseProps, CustomInputEvent } from './base/types.js';
|
|
5
5
|
import { IDrawerProps } from '../drawer/types.js';
|
|
6
|
+
import { TextAlign } from '../@types/Align.js';
|
|
6
7
|
import '../@types/Period.js';
|
|
7
8
|
import '../@types/Position.js';
|
|
8
9
|
|
|
@@ -16,7 +17,7 @@ interface ISearchProps extends IBaseProps {
|
|
|
16
17
|
onReset?: (event?: CustomInputEvent) => void;
|
|
17
18
|
onChange?: (event?: CustomInputEvent) => void;
|
|
18
19
|
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
19
|
-
textAlign?:
|
|
20
|
+
textAlign?: TextAlign;
|
|
20
21
|
disabled?: boolean;
|
|
21
22
|
readOnly?: boolean;
|
|
22
23
|
value?: string;
|
|
@@ -87,7 +88,7 @@ interface IMaskHOCProps {
|
|
|
87
88
|
customClass?: string;
|
|
88
89
|
customClassForInputContent?: string;
|
|
89
90
|
customClassForLabel?: string;
|
|
90
|
-
textAlign?:
|
|
91
|
+
textAlign?: TextAlign;
|
|
91
92
|
onBlur?: (e: CustomInputEvent) => void;
|
|
92
93
|
leftElements?: JSX.Element | JSX.Element[];
|
|
93
94
|
rounded?: boolean;
|