linear-react-components-ui 1.0.0 → 1.0.1

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.
@@ -1,6 +1,7 @@
1
1
  import { IDrawerProps } from './types.js';
2
2
  import 'react';
3
3
  import '../@types/PermissionAttr.js';
4
+ import '../@types/Position.js';
4
5
 
5
6
  declare const Content: ({ children, style }: IDrawerProps) => JSX.Element;
6
7
 
@@ -1,6 +1,7 @@
1
1
  import React__default from 'react';
2
2
  import { IDrawerProps } from './types.js';
3
3
  import '../@types/PermissionAttr.js';
4
+ import '../@types/Position.js';
4
5
 
5
6
  declare const BaseDrawer: ({ position, customClass, children, style, customClassForContent, targetId, closeOnEsc, overlay, permissionAttr, skeletonize, handlerClose, customClassForDrawer, content, title, ...rest }: IDrawerProps) => React__default.ReactPortal;
6
7
 
@@ -26,17 +26,20 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
26
26
  var BaseDrawer = function BaseDrawer(_ref) {
27
27
  var _ref$position = _ref.position,
28
28
  position = _ref$position === void 0 ? 'left' : _ref$position,
29
- customClass = _ref.customClass,
29
+ _ref$customClass = _ref.customClass,
30
+ customClass = _ref$customClass === void 0 ? '' : _ref$customClass,
30
31
  children = _ref.children,
31
32
  style = _ref.style,
32
- customClassForContent = _ref.customClassForContent,
33
+ _ref$customClassForCo = _ref.customClassForContent,
34
+ customClassForContent = _ref$customClassForCo === void 0 ? '' : _ref$customClassForCo,
33
35
  targetId = _ref.targetId,
34
36
  closeOnEsc = _ref.closeOnEsc,
35
37
  overlay = _ref.overlay,
36
38
  permissionAttr = _ref.permissionAttr,
37
39
  skeletonize = _ref.skeletonize,
38
40
  handlerClose = _ref.handlerClose,
39
- customClassForDrawer = _ref.customClassForDrawer,
41
+ _ref$customClassForDr = _ref.customClassForDrawer,
42
+ customClassForDrawer = _ref$customClassForDr === void 0 ? '' : _ref$customClassForDr,
40
43
  content = _ref.content,
41
44
  title = _ref.title,
42
45
  rest = _objectWithoutProperties(_ref, _excluded);
@@ -1,6 +1,7 @@
1
1
  import { IDrawerHeaderProps } from './types.js';
2
2
  import 'react';
3
3
  import '../@types/PermissionAttr.js';
4
+ import '../@types/Position.js';
4
5
 
5
6
  declare const Header: ({ showCloseButton, title, subTitle, icon, titleIcon, customClass, titleContent, subTitleContent, titleRightContent, }: IDrawerHeaderProps) => JSX.Element;
6
7
 
@@ -1,6 +1,7 @@
1
1
  import React__default from 'react';
2
2
  import { IDrawerContext } from './types.js';
3
3
  import '../@types/PermissionAttr.js';
4
+ import '../@types/Position.js';
4
5
 
5
6
  declare const DrawerContext: React__default.Context<IDrawerContext>;
6
7
 
@@ -3,6 +3,7 @@ export { default as DrawerHeader } from './Header.js';
3
3
  export { default as DrawerContent } from './Content.js';
4
4
  import 'react';
5
5
  import '../@types/PermissionAttr.js';
6
+ import '../@types/Position.js';
6
7
 
7
8
  declare const _default: (props: IDrawerProps) => JSX.Element;
8
9
 
@@ -1,5 +1,6 @@
1
1
  import React__default, { ReactNode, ReactElement } from 'react';
2
2
  import { PermissionAttr } from '../@types/PermissionAttr.js';
3
+ import { Position } from '../@types/Position.js';
3
4
 
4
5
  interface IDrawerProps extends React__default.HTMLAttributes<HTMLDivElement> {
5
6
  overlay?: boolean;
@@ -7,7 +8,7 @@ interface IDrawerProps extends React__default.HTMLAttributes<HTMLDivElement> {
7
8
  customClass?: string;
8
9
  customClassForContent?: string;
9
10
  customClassForDrawer?: string;
10
- position?: string;
11
+ position?: Exclude<Position, 'center'>;
11
12
  handlerClose?: () => void;
12
13
  closeOnEsc?: boolean;
13
14
  targetId?: string;
@@ -2,9 +2,10 @@ import React__default from 'react';
2
2
  import { IInputHOCProps } from './types.js';
3
3
  import '../@types/PermissionAttr.js';
4
4
  import '../@types/DataCombo.js';
5
- import './select/types.js';
6
5
  import './base/types.js';
7
6
  import '../@types/Period.js';
7
+ import '../drawer/types.js';
8
+ import '../@types/Position.js';
8
9
 
9
10
  declare const InputHOC: <ComponentProps extends IInputHOCProps>(WrappedComponent: React__default.ComponentType<ComponentProps>) => (props: ComponentProps) => JSX.Element;
10
11
 
@@ -3,9 +3,10 @@ import { IMaskHOCProps } from '../types.js';
3
3
  import 'react';
4
4
  import '../../@types/PermissionAttr.js';
5
5
  import '../../@types/DataCombo.js';
6
- import '../select/types.js';
7
6
  import '../base/types.js';
8
7
  import '../../@types/Period.js';
8
+ import '../../drawer/types.js';
9
+ import '../../@types/Position.js';
9
10
 
10
11
  declare function extractNonMaskProps(props: IMaskHOCProps, maskProps: AnyMaskedOptions): any;
11
12
  declare function CPFValidation(cpf?: string, returnMessage?: (msg: string) => void): void | "CPF inválido";
@@ -2,9 +2,10 @@ import React__default from 'react';
2
2
  import { IMaskHOCProps } from '../types.js';
3
3
  import '../../@types/PermissionAttr.js';
4
4
  import '../../@types/DataCombo.js';
5
- import '../select/types.js';
6
5
  import '../base/types.js';
7
6
  import '../../@types/Period.js';
7
+ import '../../drawer/types.js';
8
+ import '../../@types/Position.js';
8
9
 
9
10
  declare const IMaskHOC: <ComponentProps extends IMaskHOCProps>(ComposedComponent: React__default.ComponentType<ComponentProps>) => {
10
11
  (props: ComponentProps): JSX.Element;
@@ -5,7 +5,8 @@ import 'react';
5
5
  import '../../@types/Period.js';
6
6
  import '../types.js';
7
7
  import '../../@types/DataCombo.js';
8
- import '../select/types.js';
8
+ import '../../drawer/types.js';
9
+ import '../../@types/Position.js';
9
10
 
10
11
  declare const BaseNumber: (props: IBaseNumberProps) => JSX.Element;
11
12
 
@@ -5,7 +5,8 @@ import 'react';
5
5
  import '../../@types/Period.js';
6
6
  import '../types.js';
7
7
  import '../../@types/DataCombo.js';
8
- import '../select/types.js';
8
+ import '../../drawer/types.js';
9
+ import '../../@types/Position.js';
9
10
 
10
11
  declare const CurrencyField: (props: ICurrencyProps) => JSX.Element;
11
12
 
@@ -5,7 +5,8 @@ import 'react';
5
5
  import '../../@types/Period.js';
6
6
  import '../types.js';
7
7
  import '../../@types/DataCombo.js';
8
- import '../select/types.js';
8
+ import '../../drawer/types.js';
9
+ import '../../@types/Position.js';
9
10
 
10
11
  declare const DecimalField: (props: IBaseNumberProps) => JSX.Element;
11
12
 
@@ -7,7 +7,8 @@ import 'react';
7
7
  import '../../@types/Period.js';
8
8
  import '../types.js';
9
9
  import '../../@types/DataCombo.js';
10
- import '../select/types.js';
10
+ import '../../drawer/types.js';
11
+ import '../../@types/Position.js';
11
12
 
12
13
  declare const NumberField: (props: INumberFieldProps) => JSX.Element;
13
14
 
@@ -4,7 +4,8 @@ import { IMaskHOCProps } from '../types.js';
4
4
  import 'react';
5
5
  import '../../@types/Period.js';
6
6
  import '../../@types/DataCombo.js';
7
- import '../select/types.js';
7
+ import '../../drawer/types.js';
8
+ import '../../@types/Position.js';
8
9
 
9
10
  interface INumberFieldProps extends IMaskHOCProps {
10
11
  value?: string;
@@ -2,9 +2,10 @@ import { ISearchProps } from '../types.js';
2
2
  import 'react';
3
3
  import '../../@types/PermissionAttr.js';
4
4
  import '../../@types/DataCombo.js';
5
- import '../select/types.js';
6
5
  import '../base/types.js';
7
6
  import '../../@types/Period.js';
7
+ import '../../drawer/types.js';
8
+ import '../../@types/Position.js';
8
9
 
9
10
  declare const SearchField: (props: ISearchProps) => JSX.Element | null;
10
11
 
@@ -11,6 +11,7 @@ var _buttons = _interopRequireDefault(require("../../buttons"));
11
11
  var _icons = _interopRequireDefault(require("../../icons"));
12
12
  require("../../assets/styles/search.scss");
13
13
  var _drawer = _interopRequireWildcard(require("../../drawer"));
14
+ var _excluded = ["headerTitle", "content", "onStateChange"];
14
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
16
  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); }
16
17
  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,6 +20,8 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
19
20
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
20
21
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
21
22
  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); }
23
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
24
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
22
25
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
23
26
  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."); }
24
27
  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); }
@@ -28,7 +31,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
28
31
  var SearchField = function SearchField(props) {
29
32
  var _props$resetButton = props.resetButton,
30
33
  resetButton = _props$resetButton === void 0 ? true : _props$resetButton,
31
- advancedFilterProps = props.advancedFilterProps,
34
+ _props$advancedFilter = props.advancedFilterProps,
35
+ advancedFilterProps = _props$advancedFilter === void 0 ? {} : _props$advancedFilter,
32
36
  value = props.value;
33
37
  var _useState = (0, _react.useState)(false),
34
38
  _useState2 = _slicedToArray(_useState, 2),
@@ -42,6 +46,10 @@ var SearchField = function SearchField(props) {
42
46
  _useState6 = _slicedToArray(_useState5, 2),
43
47
  onDenied = _useState6[0],
44
48
  setOnDenied = _useState6[1];
49
+ var headerTitle = advancedFilterProps.headerTitle,
50
+ content = advancedFilterProps.content,
51
+ onStateChange = advancedFilterProps.onStateChange,
52
+ advancedFilterPropsRest = _objectWithoutProperties(advancedFilterProps, _excluded);
45
53
  var onReset = function onReset(event) {
46
54
  if (props.onReset) props.onReset(event);
47
55
  setValorCampo('');
@@ -58,10 +66,8 @@ var SearchField = function SearchField(props) {
58
66
  var shouldBeReadOnly = function shouldBeReadOnly() {
59
67
  return props.readOnly || onDenied && onDenied.readOnly;
60
68
  };
61
- var hideContent = onDenied && onDenied.hideContent;
69
+ var hideContent = onDenied === null || onDenied === void 0 ? void 0 : onDenied.hideContent;
62
70
  var buttonProps = function buttonProps() {
63
- var _ref = advancedFilterProps || {},
64
- onStateChange = _ref.onStateChange;
65
71
  var disableCallbacks = shouldBeReadOnly() || shouldDisable() || hideContent;
66
72
  var propsButton = {
67
73
  icon: /*#__PURE__*/_react.default.createElement(_icons.default, {
@@ -91,7 +97,7 @@ var SearchField = function SearchField(props) {
91
97
  return propsButton;
92
98
  };
93
99
  var rightElements = function rightElements() {
94
- var enableFilterButton = advancedFilterProps !== undefined;
100
+ var enableFilterButton = Object.keys(advancedFilterProps).length > 0;
95
101
  var elements = [/*#__PURE__*/_react.default.createElement(_icons.default, {
96
102
  name: "search",
97
103
  color: "#a9a8a8",
@@ -113,15 +119,11 @@ var SearchField = function SearchField(props) {
113
119
  if (resetButton && valorCampo.trim() !== '') elements = [resetButtonIcon].concat(_toConsumableArray(elements));
114
120
  return elements;
115
121
  };
116
- var _ref2 = advancedFilterProps || {},
117
- headerTitle = _ref2.headerTitle,
118
- content = _ref2.content,
119
- onStateChange = _ref2.onStateChange;
120
122
  (0, _react.useEffect)(function () {
121
123
  if (value !== undefined && value !== valorCampo) {
122
124
  setValorCampo(value);
123
125
  }
124
- }, []);
126
+ }, [value]);
125
127
  if (onDenied && onDenied.unvisible) {
126
128
  return null;
127
129
  }
@@ -2,9 +2,10 @@ import { IActionButtonsSelectProps } from '../types.js';
2
2
  import 'react';
3
3
  import '../../@types/PermissionAttr.js';
4
4
  import '../../@types/DataCombo.js';
5
- import './types.js';
6
5
  import '../base/types.js';
7
6
  import '../../@types/Period.js';
7
+ import '../../drawer/types.js';
8
+ import '../../@types/Position.js';
8
9
 
9
10
  declare const ActionButtons: (props: IActionButtonsSelectProps) => JSX.Element;
10
11
 
@@ -2,9 +2,10 @@ import { IDropdownSelectProps } from '../types.js';
2
2
  import 'react';
3
3
  import '../../@types/PermissionAttr.js';
4
4
  import '../../@types/DataCombo.js';
5
- import './types.js';
6
5
  import '../base/types.js';
7
6
  import '../../@types/Period.js';
7
+ import '../../drawer/types.js';
8
+ import '../../@types/Position.js';
8
9
 
9
10
  declare const Dropdown: (props: IDropdownSelectProps) => JSX.Element;
10
11
 
@@ -2,9 +2,10 @@ import { DataCombo } from '../../@types/DataCombo.js';
2
2
  import { IDropdownSelectProps } from '../types.js';
3
3
  import 'react';
4
4
  import '../../@types/PermissionAttr.js';
5
- import './types.js';
6
5
  import '../base/types.js';
7
6
  import '../../@types/Period.js';
7
+ import '../../drawer/types.js';
8
+ import '../../@types/Position.js';
8
9
 
9
10
  declare const contentClass: (props: IDropdownSelectProps) => string;
10
11
  declare const getDropdownItemCssClass: (selected: boolean, disabled: boolean, striped: boolean) => string;
@@ -1,8 +1,8 @@
1
1
  import { ISelectFieldProps } from './types.js';
2
- import 'react';
3
2
  import '../../@types/DataCombo.js';
4
3
  import '../../@types/PermissionAttr.js';
5
4
  import '../base/types.js';
5
+ import 'react';
6
6
  import '../../@types/Period.js';
7
7
 
8
8
  declare const SelectField: (props: ISelectFieldProps) => JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import { ISelectedsMultipleProps } from '../types.js';
2
- import 'react';
3
2
  import '../../../@types/DataCombo.js';
4
3
  import '../../../@types/PermissionAttr.js';
5
4
  import '../../base/types.js';
5
+ import 'react';
6
6
  import '../../../@types/Period.js';
7
7
 
8
8
  declare const Selecteds: ({ currents, descriptionKey, idKey, handleOnUnselect, }: ISelectedsMultipleProps) => JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import { IMultipleSelectProps } from '../types.js';
2
- import 'react';
3
2
  import '../../../@types/DataCombo.js';
4
3
  import '../../../@types/PermissionAttr.js';
5
4
  import '../../base/types.js';
5
+ import 'react';
6
6
  import '../../../@types/Period.js';
7
7
 
8
8
  declare const MultipleSelect: (props: IMultipleSelectProps) => JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import { ISimpleSelectProps } from '../types.js';
2
- import 'react';
3
2
  import '../../../@types/DataCombo.js';
4
3
  import '../../../@types/PermissionAttr.js';
5
4
  import '../../base/types.js';
5
+ import 'react';
6
6
  import '../../../@types/Period.js';
7
7
 
8
8
  declare const SimpleSelect: (props: ISimpleSelectProps) => JSX.Element;
@@ -1,7 +1,7 @@
1
- import { ReactNode } from 'react';
2
1
  import { DataCombo } from '../../@types/DataCombo.js';
3
2
  import { PermissionAttr } from '../../@types/PermissionAttr.js';
4
3
  import { CustomInputEvent } from '../base/types.js';
4
+ import 'react';
5
5
  import '../../@types/Period.js';
6
6
 
7
7
  interface ISimpleSelectProps {
@@ -89,10 +89,5 @@ interface ISelectedsMultipleProps {
89
89
  currents: DataCombo[];
90
90
  handleOnUnselect: (id: string) => void;
91
91
  }
92
- interface IAdvancedFilterProps {
93
- onStateChange?: (bol?: boolean) => void;
94
- headerTitle?: string;
95
- content?: ReactNode | ReactNode[];
96
- }
97
92
 
98
- export { IAdvancedFilterProps, IMultipleSelectProps, ISelectFieldProps, ISelectedsMultipleProps, ISimpleSelectProps };
93
+ export { IMultipleSelectProps, ISelectFieldProps, ISelectedsMultipleProps, ISimpleSelectProps };
@@ -1,10 +1,16 @@
1
- import { MouseEvent, MutableRefObject, CSSProperties, ReactNode, KeyboardEvent, ReactElement } from 'react';
1
+ import { ReactNode, MouseEvent, MutableRefObject, CSSProperties, KeyboardEvent, ReactElement } from 'react';
2
2
  import { PermissionAttr, OnDenied } from '../@types/PermissionAttr.js';
3
3
  import { DataCombo } from '../@types/DataCombo.js';
4
- import { IAdvancedFilterProps } from './select/types.js';
5
4
  import { IBaseProps, CustomInputEvent } from './base/types.js';
5
+ import { IDrawerProps } from '../drawer/types.js';
6
6
  import '../@types/Period.js';
7
+ import '../@types/Position.js';
7
8
 
9
+ interface IAdvancedFilterProps extends Omit<IDrawerProps, 'content'> {
10
+ onStateChange?: (value?: boolean) => void;
11
+ headerTitle?: string;
12
+ content?: ReactNode | ReactNode[];
13
+ }
8
14
  interface ISearchProps extends IBaseProps {
9
15
  resetButton?: boolean;
10
16
  onReset?: (event?: CustomInputEvent) => void;
@@ -139,4 +145,4 @@ interface IButtonsProps {
139
145
  disabled?: boolean;
140
146
  }
141
147
 
142
- export { IActionButtonsSelectProps, IButtonsProps, IDropdownProps, IDropdownSelectProps, IInputHOCProps, IMaskHOCProps, ISearchProps };
148
+ export { IActionButtonsSelectProps, IAdvancedFilterProps, IButtonsProps, IDropdownProps, IDropdownSelectProps, IInputHOCProps, IMaskHOCProps, ISearchProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linear-react-components-ui",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Linear Sistemas ReactJs Components",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.cjs",