linear-react-components-ui 1.1.18-beta.16 → 1.1.18-beta.18

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.
Files changed (55) hide show
  1. package/.eslintcache +1 -1
  2. package/lib/assets/styles/calendar.scss +64 -30
  3. package/lib/assets/styles/datepicker.scss +26 -6
  4. package/lib/assets/styles/periodpicker.scss +60 -20
  5. package/lib/assets/styles/sidenav.scss +1 -1
  6. package/lib/assets/styles/tabs.scss +32 -15
  7. package/lib/calendar/DangerCalendar.d.ts +1 -0
  8. package/lib/calendar/InfoCalendar.d.ts +1 -0
  9. package/lib/calendar/PrimaryCalendar.d.ts +1 -0
  10. package/lib/calendar/SuccessCalendar.d.ts +1 -0
  11. package/lib/calendar/WarningCalendar.d.ts +1 -0
  12. package/lib/calendar/base/Day.d.ts +1 -0
  13. package/lib/calendar/base/Day.js +6 -2
  14. package/lib/calendar/base/Month.d.ts +2 -1
  15. package/lib/calendar/base/Month.js +2 -0
  16. package/lib/calendar/base/Week.d.ts +1 -0
  17. package/lib/calendar/base/index.d.ts +1 -0
  18. package/lib/calendar/base/index.js +63 -13
  19. package/lib/calendar/index.d.ts +1 -0
  20. package/lib/calendar/types.d.ts +5 -0
  21. package/lib/dialog/base/Content.js +5 -4
  22. package/lib/dialog/base/Header.js +0 -1
  23. package/lib/dialog/base/index.js +27 -3
  24. package/lib/drawer/Drawer.js +1 -1
  25. package/lib/inputs/date/Dialog.js +5 -4
  26. package/lib/inputs/date/Dropdown.js +15 -7
  27. package/lib/inputs/date/helpers.d.ts +1 -11
  28. package/lib/inputs/date/helpers.js +1 -11
  29. package/lib/inputs/date/index.js +138 -100
  30. package/lib/inputs/date/types.d.ts +7 -6
  31. package/lib/inputs/period/Dialog.d.ts +1 -1
  32. package/lib/inputs/period/Dialog.js +5 -3
  33. package/lib/inputs/period/Dropdown.js +19 -8
  34. package/lib/inputs/period/PeriodList.js +3 -12
  35. package/lib/inputs/period/index.js +238 -82
  36. package/lib/inputs/period/types.d.ts +10 -8
  37. package/lib/inputs/select/ActionButtons.js +3 -2
  38. package/lib/inputs/select/multiple/index.js +10 -4
  39. package/lib/inputs/select/simple/index.js +10 -4
  40. package/lib/inputs/select/types.d.ts +4 -0
  41. package/lib/inputs/types.d.ts +1 -0
  42. package/lib/list/index.js +2 -2
  43. package/lib/tabs/DropdownTabs.js +21 -7
  44. package/lib/tabs/context.d.ts +1 -1
  45. package/lib/tabs/context.js +3 -3
  46. package/lib/tabs/types.d.ts +2 -1
  47. package/lib/toolbar/types.d.ts +2 -1
  48. package/package.json +1 -1
  49. package/lib/inputs/mask/imaskHOC.js +0 -203
  50. package/lib/menus/sidenav/popup_menu_help/index.js +0 -85
  51. package/lib/tabs/DropdownItems.js +0 -62
  52. package/lib/tabs/MenuItems.js +0 -70
  53. package/lib/treeview_old/Header.js +0 -29
  54. package/lib/treeview_old/Node.js +0 -68
  55. package/lib/treeview_old/index.js +0 -43
@@ -25,7 +25,11 @@ const MultipleSelect = props => {
25
25
  value = [],
26
26
  remoteSearch = false,
27
27
  descriptionKey,
28
- showClearButton
28
+ showClearButton,
29
+ customClassForLabel,
30
+ customClassForWrapper,
31
+ customClassForInputContent,
32
+ customClassForSideButtons
29
33
  } = props;
30
34
  const [dataCombo, setDataCombo] = (0, _react.useState)(dataSource);
31
35
  const [currents, setCurrents] = (0, _react.useState)([]);
@@ -234,8 +238,9 @@ const MultipleSelect = props => {
234
238
  },
235
239
  onClick: onFocus,
236
240
  onKeyDown: onInputKeyDown,
237
- customClassForWrapper: "selectwrapper ".concat((props.readOnly || shouldDisable() || shouldBeReadOnly()) && ' -undigitable'),
238
- customClassForInputContent: "multiselect",
241
+ customClassForLabel: customClassForLabel,
242
+ customClassForWrapper: "selectwrapper ".concat((props.readOnly || shouldDisable() || shouldBeReadOnly()) && ' -undigitable', " ").concat(customClassForWrapper),
243
+ customClassForInputContent: "multiselect ".concat(customClassForInputContent),
239
244
  inputBaseRef: r => {
240
245
  selectWrapper.current = r;
241
246
  },
@@ -248,7 +253,8 @@ const MultipleSelect = props => {
248
253
  if (shouldDisable()) return null;
249
254
  return onClearClick();
250
255
  },
251
- handlerOpenClose: onOpenClose
256
+ handlerOpenClose: onOpenClose,
257
+ customClassForSideButtons: customClassForSideButtons
252
258
  })
253
259
  }), /*#__PURE__*/_react.default.createElement(_Selecteds.default, _extends({}, props, {
254
260
  currents: currents,
@@ -34,7 +34,11 @@ const SimpleSelect = props => {
34
34
  searchOnDropdown = false,
35
35
  allOptions = undefined,
36
36
  showClearButton = false,
37
- searchNotFoundText
37
+ searchNotFoundText,
38
+ customClassForWrapper,
39
+ customClassForInputContent,
40
+ customClassForLabel,
41
+ customClassForSideButtons
38
42
  } = props;
39
43
  const descriptionKeyIsString = typeof descriptionKey === 'string';
40
44
  const dataSourceWithAllOptions = allOptions ? [{
@@ -268,8 +272,9 @@ const SimpleSelect = props => {
268
272
  },
269
273
  onClick: onFocus,
270
274
  onKeyDown: onInputKeyDown,
271
- customClassForWrapper: "selectwrapper ".concat((undigitable || searchOnDropdown || shouldBeReadOnly()) && ' -undigitable'),
272
- customClassForInputContent: "multiselect",
275
+ customClassForLabel: customClassForLabel,
276
+ customClassForWrapper: "selectwrapper ".concat((undigitable || searchOnDropdown || shouldBeReadOnly()) && ' -undigitable', " ").concat(customClassForWrapper),
277
+ customClassForInputContent: "multiselect ".concat(customClassForInputContent),
273
278
  inputBaseRef: r => {
274
279
  selectWrapper.current = r;
275
280
  },
@@ -282,7 +287,8 @@ const SimpleSelect = props => {
282
287
  if (shouldDisable()) return null;
283
288
  return onClearClick();
284
289
  },
285
- handlerOpenClose: onOpenClose
290
+ handlerOpenClose: onOpenClose,
291
+ customClassForSideButtons: customClassForSideButtons
286
292
  })
287
293
  })), opened && /*#__PURE__*/_react.default.createElement(_Dropdown.default, _extends({}, props, {
288
294
  opened: opened,
@@ -50,6 +50,10 @@ interface ISimpleSelectProps {
50
50
  onFocus?: () => void;
51
51
  allOptions?: AllOptions;
52
52
  inputRef?: MutableRefObject<HTMLInputElement | HTMLTextAreaElement | null> | ((ref: HTMLInputElement | HTMLTextAreaElement | null) => void);
53
+ customClassForWrapper?: string;
54
+ customClassForInputContent?: string;
55
+ customClassForLabel?: string;
56
+ customClassForSideButtons?: string;
53
57
  }
54
58
  interface ISelectFieldProps extends Omit<ISimpleSelectProps, 'idKey' | 'value' | 'descriptionKey'> {
55
59
  multiple?: boolean;
@@ -137,6 +137,7 @@ interface IActionButtonsSelectProps {
137
137
  dropDownOpened: boolean;
138
138
  showClearButton?: boolean;
139
139
  disabled?: boolean;
140
+ customClassForSideButtons?: string;
140
141
  }
141
142
  interface IButtonsProps {
142
143
  onClick?: (e: MouseEvent<HTMLButtonElement>) => void;
package/lib/list/index.js CHANGED
@@ -36,7 +36,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
36
36
  const List = props => {
37
37
  const {
38
38
  children,
39
- customClass,
39
+ customClass = '',
40
40
  condensed,
41
41
  transparent,
42
42
  style,
@@ -175,7 +175,7 @@ const List = props => {
175
175
  "data-testid": "list-component",
176
176
  style: style,
177
177
  ref: listRef,
178
- className: "list-component ".concat(condensed && '-condensed', "\n ").concat(customClass, " ").concat(!transparent && '-listbackground')
178
+ className: "list-component ".concat(condensed && '-condensed', " ").concat(!transparent && '-listbackground', " ").concat(customClass)
179
179
  }, newChildren));
180
180
  };
181
181
  var _default = exports.default = List;
@@ -4,11 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+ var _lodash = _interopRequireDefault(require("lodash"));
7
8
  var _react = _interopRequireDefault(require("react"));
8
9
  var _buttons = _interopRequireDefault(require("../buttons"));
9
10
  var _list = _interopRequireWildcard(require("../list"));
10
11
  var _useTabs = require("./useTabs");
11
- var _lodash = _interopRequireDefault(require("lodash"));
12
+ var _2 = require("..");
12
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
13
14
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -26,16 +27,25 @@ const DropdownTab = _ref => {
26
27
  } = _ref;
27
28
  const {
28
29
  selectTab,
29
- removeTab
30
+ removeTab,
31
+ selectedTabId
30
32
  } = (0, _useTabs.useTabs)();
31
33
  return /*#__PURE__*/_react.default.createElement(_list.ListItem, {
32
- key: id
34
+ key: id,
35
+ onClick: () => selectTab(id)
33
36
  }, /*#__PURE__*/_react.default.createElement("div", {
34
37
  className: "menuitem"
35
- }, /*#__PURE__*/_react.default.createElement(_buttons.default, {
38
+ }, selectedTabId === id ? /*#__PURE__*/_react.default.createElement(_2.Icon, {
39
+ name: "checkmark",
40
+ color: "#A10D0D"
41
+ }) : /*#__PURE__*/_react.default.createElement("div", {
42
+ style: {
43
+ width: 16,
44
+ height: 16
45
+ }
46
+ }), /*#__PURE__*/_react.default.createElement(_buttons.default, {
36
47
  className: "btn menubutton",
37
48
  boxShadow: false,
38
- onClick: () => selectTab(id),
39
49
  iconAlign: iconAlign,
40
50
  iconName: iconName,
41
51
  icon: icon,
@@ -53,16 +63,20 @@ const DropdownTabs = _ref2 => {
53
63
  tabs = [],
54
64
  tabMenuSize = 'medium'
55
65
  } = _ref2;
66
+ const {
67
+ selectedTabId
68
+ } = (0, _useTabs.useTabs)();
69
+ const hasSelectedTab = tabs.some(tab => tab.id === selectedTabId);
56
70
  const hasTabs = tabs.length > 0;
57
71
  const uniqueTabs = _lodash.default.uniqBy(tabs, 'id');
58
- if (tabs.length === 0) return null;
72
+ if (!hasTabs) return null;
59
73
  return /*#__PURE__*/_react.default.createElement(_buttons.default, {
60
74
  dropdown: true,
61
75
  dropdownAlign: "right",
62
76
  transparent: true,
63
77
  boxShadow: false,
64
78
  size: "large",
65
- customClass: "dropdownbutton ".concat(hasTabs ? 'show' : '')
79
+ customClass: "dropdownbutton ".concat(hasTabs ? 'show' : '', " ").concat(hasSelectedTab ? 'has-selected' : '')
66
80
  }, /*#__PURE__*/_react.default.createElement(_list.default, {
67
81
  customClass: "dropdown-hide-tabs"
68
82
  }, uniqueTabs.map(tab => /*#__PURE__*/_react.default.createElement(DropdownTab, _extends({
@@ -7,6 +7,6 @@ import '../@types/Icon.js';
7
7
  import '../icons/helper.js';
8
8
 
9
9
  declare const TabsContext: React__default.Context<TabsContextType>;
10
- declare function TabsProvider({ children, tabs: tabsProp, container, selectedTab, onTabChange, onTabClose, tabsWidth: tabsWidthProp, firstTabIdent, }: TabsProviderProps): JSX.Element;
10
+ declare function TabsProvider({ children, tabs: tabsProp, container, selectedTab, onTabChange, onTabClose, tabsWidth: tabsWidthProp, firstTabIdent, keepTabOriginalPosition, }: TabsProviderProps): JSX.Element;
11
11
 
12
12
  export { TabsContext, TabsProvider };
@@ -22,7 +22,8 @@ function TabsProvider(_ref) {
22
22
  onTabChange,
23
23
  onTabClose,
24
24
  tabsWidth: tabsWidthProp,
25
- firstTabIdent = false
25
+ firstTabIdent = false,
26
+ keepTabOriginalPosition = true
26
27
  } = _ref;
27
28
  const [selectedTabId, setSelectedTabId] = _react.default.useState(selectedTab);
28
29
  const [containerWidth, setContainerWidth] = (0, _react.useState)(() => {
@@ -64,7 +65,7 @@ function TabsProvider(_ref) {
64
65
  }
65
66
  }, [setTabs, menuTabs, tabs, dropdownTabs]);
66
67
  const selectTab = (0, _react.useCallback)(tabId => {
67
- updateTabs(tabId);
68
+ if (!keepTabOriginalPosition) updateTabs(tabId);
68
69
  setSelectedTabId(tabId);
69
70
  if (onTabChange) {
70
71
  onTabChange(tabId);
@@ -120,7 +121,6 @@ function TabsProvider(_ref) {
120
121
  dropdownTabs,
121
122
  containerWidth,
122
123
  tabsCount,
123
- updateTabs,
124
124
  selectTab,
125
125
  selectedTabId,
126
126
  removeTab,
@@ -11,7 +11,6 @@ type TabsContextType = {
11
11
  dropdownTabs: TabProps[];
12
12
  selectedTabId: string | number | null;
13
13
  selectTab: (tabId: string | number) => void;
14
- updateTabs: (tabId: string | number) => void;
15
14
  removeTab: (tabId: string | number) => void;
16
15
  containerWidth: number;
17
16
  tabsCount: number;
@@ -26,6 +25,7 @@ interface TabsProviderProps {
26
25
  onTabChange?: (tabId: string | number) => void;
27
26
  onTabClose?: (tabId: string) => void;
28
27
  firstTabIdent?: boolean;
28
+ keepTabOriginalPosition?: boolean;
29
29
  }
30
30
  interface ITabsPros {
31
31
  style?: CSSProperties;
@@ -41,6 +41,7 @@ interface ITabsPros {
41
41
  handlerCloseTab?: (id?: string, idx?: string) => void;
42
42
  customClassForToolBar?: string;
43
43
  tabsWidth?: string | number;
44
+ keepTabOriginalPositon?: boolean;
44
45
  }
45
46
  interface TabProps {
46
47
  id: string | number;
@@ -1,4 +1,4 @@
1
- import { ReactNode, CSSProperties, ReactElement } from 'react';
1
+ import { ReactNode, CSSProperties, ReactElement, MutableRefObject } from 'react';
2
2
  import { ButtonTypes } from '../@types/ButtonTypes.js';
3
3
  import { Position } from '../@types/Position.js';
4
4
  import { Size } from '../@types/Size.js';
@@ -28,6 +28,7 @@ interface IButtonBarProps {
28
28
  boxShadow?: boolean;
29
29
  id?: string;
30
30
  onNodeElementClick?: (node: NodeItem) => void;
31
+ buttonRef?: MutableRefObject<HTMLButtonElement | null> | ((ref: HTMLButtonElement | null) => void);
31
32
  }
32
33
  interface ILabelBarProps {
33
34
  iconName?: IconNames;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linear-react-components-ui",
3
- "version": "1.1.18-beta.16",
3
+ "version": "1.1.18-beta.18",
4
4
  "description": "Linear Sistemas ReactJs Components",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.cjs",
@@ -1,203 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _imask = _interopRequireDefault(require("imask"));
9
- var helpers = _interopRequireWildcard(require("./helpers"));
10
- var _permissionValidations = require("../../permissionValidations");
11
- var _format_number = require("../number/format_number");
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
- 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); }
16
- const options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible, _permissionValidations.OPTIONS_ON_DENIED.readOnly, _permissionValidations.OPTIONS_ON_DENIED.hideContent];
17
- const IMaskHOC = ComposedComponent => {
18
- const MaskedComponent = props => {
19
- const {
20
- permissionAttr,
21
- skeletonize,
22
- inputRef,
23
- placeholderChar = '_',
24
- lazy = false,
25
- pattern = '',
26
- radix = ' ',
27
- thousandsSeparator = '',
28
- mapToRadix = [],
29
- scale = 2,
30
- signed = false,
31
- normalizeZeros = true,
32
- padFractionalZeros = true,
33
- mask,
34
- commit = () => {},
35
- parse,
36
- format,
37
- definitions,
38
- groups,
39
- min,
40
- max,
41
- dispatch,
42
- value = '',
43
- onChange,
44
- isDateField = false,
45
- autoCompleteMask
46
- } = props;
47
- const maskOptions = {
48
- placeholderChar: placeholderChar === '' ? ' ' : placeholderChar,
49
- lazy,
50
- pattern,
51
- radix,
52
- thousandsSeparator,
53
- mapToRadix,
54
- scale,
55
- signed,
56
- normalizeZeros,
57
- padFractionalZeros,
58
- mask,
59
- commit,
60
- parse,
61
- format,
62
- definitions,
63
- groups,
64
- min,
65
- max,
66
- dispatch
67
- };
68
- const [onDenied] = (0, _react.useState)((0, _permissionValidations.actionsOnPermissionDenied)(options, permissionAttr));
69
- const elementRef = (0, _react.useRef)(null);
70
- const maskRef = (0, _react.useRef)(null);
71
- const {
72
- hideContent,
73
- unvisible,
74
- disabled,
75
- readOnly
76
- } = onDenied;
77
- const dontInitMask = hideContent || unvisible || skeletonize;
78
- const disableCallbacks = disabled || readOnly;
79
- const setValue = newValue => {
80
- if (maskRef.current) {
81
- if (props.unmask) maskRef.current.unmaskedValue = newValue.toString();
82
- maskRef.current.value = String(newValue);
83
- }
84
- };
85
- const onAccept = (0, _react.useCallback)(() => {
86
- if (onChange && !disableCallbacks && maskRef.current) {
87
- const {
88
- unmaskedValue,
89
- el
90
- } = maskRef.current;
91
- const name = el.name || el.input && el.input.name;
92
- onChange({
93
- target: {
94
- value: unmaskedValue,
95
- name
96
- }
97
- }, props.unmask ? unmaskedValue : maskRef.current.value);
98
- }
99
- }, [onChange]);
100
- const onComplete = (0, _react.useCallback)(() => {
101
- if (props.onComplete && !disableCallbacks && maskRef.current) {
102
- const {
103
- unmaskedValue,
104
- el
105
- } = maskRef.current;
106
- const name = el.name || el.input && el.input.name;
107
- props.onComplete({
108
- target: {
109
- value: unmaskedValue,
110
- name
111
- }
112
- }, props.unmask ? unmaskedValue : maskRef.current.value);
113
- }
114
- }, [props.onComplete]);
115
- const autoCompleteMaskValue = (0, _react.useCallback)(eventTargetValue => {
116
- if (autoCompleteMask && eventTargetValue.length && maskRef.current && elementRef.current) {
117
- const sizeMask = maskRef.current.mask.toString().replace(/\D+/g, '').length;
118
- if (sizeMask > eventTargetValue.length) {
119
- switch (autoCompleteMask) {
120
- case 'left':
121
- setValue(eventTargetValue.padStart(sizeMask, '0'));
122
- break;
123
- case 'right':
124
- setValue(eventTargetValue.padEnd(sizeMask, '0'));
125
- break;
126
- default:
127
- setValue(eventTargetValue);
128
- break;
129
- }
130
- }
131
- }
132
- }, [autoCompleteMask, maskRef.current, elementRef.current]);
133
- const getMask = () => {
134
- const element = elementRef.current;
135
- if (element) {
136
- const maskCurrent = maskRef.current;
137
- if (!maskCurrent) {
138
- maskRef.current = (0, _imask.default)(element, maskOptions);
139
- if (value && typeof value !== 'number' && value.trim() !== '' || value && typeof value === 'number') onAccept();
140
- setValue(value);
141
- } else {
142
- maskCurrent.updateOptions(maskOptions);
143
- }
144
- }
145
- };
146
- const destroyMask = () => {
147
- if (maskRef.current) {
148
- maskRef.current.destroy();
149
- maskRef.current = null;
150
- }
151
- };
152
- (0, _react.useEffect)(() => {
153
- if (props.handlerSetOnDenied) props.handlerSetOnDenied(onDenied);
154
- if (!props.mask || dontInitMask) return;
155
- getMask();
156
- }, [maskOptions]);
157
- (0, _react.useEffect)(() => {
158
- if (!maskRef.current) return;
159
- const maskCurrent = maskRef.current;
160
- maskCurrent.on('accept', onAccept);
161
- maskCurrent.on('complete', onComplete);
162
-
163
- // eslint-disable-next-line consistent-return
164
- return () => {
165
- maskCurrent.off('accept', onAccept);
166
- maskCurrent.off('complete', onComplete);
167
- };
168
- }, [onAccept, onComplete]);
169
- (0, _react.useEffect)(() => {
170
- if (maskOptions.mask && !dontInitMask) {
171
- if (maskRef.current) {
172
- const formattedValue = isDateField ? value : (0, _format_number.numberToPtBR)(value) || '';
173
- setValue(formattedValue);
174
- } else {
175
- getMask();
176
- }
177
- } else if (!dontInitMask) {
178
- destroyMask();
179
- if (value && elementRef.current) elementRef.current.value = value;
180
- }
181
- }, [value, isDateField]);
182
- (0, _react.useEffect)(() => destroyMask, []);
183
- return /*#__PURE__*/_react.default.createElement(ComposedComponent, _extends({}, helpers.extractNonMaskProps(props, maskOptions), {
184
- onDeniedActions: onDenied,
185
- defaultValue: value,
186
- onBlur: e => {
187
- autoCompleteMaskValue(e.target.value);
188
- if (props.onBlur) props.onBlur(e);
189
- },
190
- onChange: e => setValue(e.target.value),
191
- inputRef: el => {
192
- elementRef.current = el;
193
- if (inputRef) {
194
- if (typeof inputRef === 'object') inputRef.current = el;else inputRef(el);
195
- }
196
- }
197
- }));
198
- };
199
- const nestedComponentName = ComposedComponent.displayName || ComposedComponent.name || 'Component';
200
- MaskedComponent.displayName = "IMask(".concat(nestedComponentName, ")");
201
- return MaskedComponent;
202
- };
203
- var _default = exports.default = IMaskHOC;
@@ -1,85 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _reactDom = _interopRequireDefault(require("react-dom"));
9
- var _list = _interopRequireWildcard(require("../../../list"));
10
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
- const body = document.getElementsByTagName('body')[0];
14
- const PopupMenuHelp = props => {
15
- const {
16
- style,
17
- copyright,
18
- handlerClose,
19
- version,
20
- helpList = [],
21
- helpRef
22
- } = props;
23
- const searchFieldRef = (0, _react.useRef)(null);
24
- const popupRef = (0, _react.useRef)(document.createElement('div'));
25
- Object.assign(popupRef.current, {
26
- className: 'helpmenu',
27
- style
28
- });
29
- const closeOnEsc = e => {
30
- if (e.key === 'Escape') {
31
- handlerClose();
32
- e.stopPropagation();
33
- }
34
- };
35
- (0, _react.useEffect)(() => {
36
- body.appendChild(popupRef.current);
37
- if (searchFieldRef && searchFieldRef.current) searchFieldRef.current.focus();
38
- document.body.addEventListener('keydown', closeOnEsc);
39
- return () => {
40
- body.removeChild(popupRef.current);
41
- document.body.removeEventListener('keydown', closeOnEsc);
42
- };
43
- }, []);
44
- (0, _react.useEffect)(() => {
45
- Object.assign(popupRef.current, {
46
- style
47
- });
48
- }, [style]);
49
- const getPopupContent = () => /*#__PURE__*/_react.default.createElement("div", {
50
- className: "popup-help",
51
- ref: helpRef
52
- }, /*#__PURE__*/_react.default.createElement(_list.default, {
53
- condensed: true,
54
- selectable: true,
55
- onSelectItem: handlerClose,
56
- selectOnEnter: true,
57
- style: {
58
- border: 'none',
59
- boxShadow: 'hidden',
60
- overflow: 'none'
61
- }
62
- }, /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_list.ListHeader, {
63
- customClass: "helpheader",
64
- title: "Ajuda"
65
- }), helpList.map(item => /*#__PURE__*/_react.default.createElement(_list.ListItem, {
66
- separator: true,
67
- selectOnEnter: true,
68
- key: item.id,
69
- itemId: item.id,
70
- url: item.url,
71
- text: item.title
72
- })))), /*#__PURE__*/_react.default.createElement("div", {
73
- className: "infomartion",
74
- style: {
75
- padding: '10px 0px 0px 7px',
76
- backgroundColor: 'white'
77
- }
78
- }, /*#__PURE__*/_react.default.createElement("p", {
79
- className: "help-information"
80
- }, /*#__PURE__*/_react.default.createElement("b", null, "Vers\xE3o:"), version), /*#__PURE__*/_react.default.createElement("p", {
81
- className: "help-information"
82
- }, copyright)));
83
- return /*#__PURE__*/_reactDom.default.createPortal(getPopupContent(), popupRef.current);
84
- };
85
- var _default = exports.default = PopupMenuHelp;
@@ -1,62 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _buttons = _interopRequireDefault(require("../buttons"));
9
- var _list = _interopRequireWildcard(require("../list"));
10
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
11
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
- const DropdownItems = _ref => {
14
- let {
15
- handlerClick,
16
- handlerRemovePanel,
17
- dropdownPanels = [],
18
- tabMenuSize = 'medium'
19
- } = _ref;
20
- return dropdownPanels.length > 0 ? /*#__PURE__*/_react.default.createElement(_buttons.default, {
21
- dropdown: true,
22
- dropdownAlign: "right",
23
- transparent: true,
24
- boxShadow: false,
25
- size: "large",
26
- customClass: "dropdownbutton"
27
- }, /*#__PURE__*/_react.default.createElement(_list.default, {
28
- customClass: "dropdown-hide-tabs"
29
- }, dropdownPanels.map((panel, index) => {
30
- const {
31
- id,
32
- title,
33
- closeable,
34
- iconAlign,
35
- icon,
36
- iconName,
37
- disabled
38
- } = panel.props;
39
- return /*#__PURE__*/_react.default.createElement(_list.ListItem, {
40
- key: id
41
- }, /*#__PURE__*/_react.default.createElement("div", {
42
- className: "menuitem"
43
- }, /*#__PURE__*/_react.default.createElement(_buttons.default, {
44
- className: "btn menubutton",
45
- boxShadow: false,
46
- onClick: () => handlerClick === null || handlerClick === void 0 ? void 0 : handlerClick(id),
47
- iconAlign: iconAlign,
48
- iconName: iconName,
49
- icon: icon,
50
- disabled: disabled,
51
- label: title,
52
- size: tabMenuSize,
53
- transparent: true
54
- }), closeable && /*#__PURE__*/_react.default.createElement("button", {
55
- className: "closepanel",
56
- onClick: () => {
57
- handlerRemovePanel === null || handlerRemovePanel === void 0 ? void 0 : handlerRemovePanel(id, index, true);
58
- }
59
- })));
60
- }))) : null;
61
- };
62
- var _default = exports.default = DropdownItems;