@dilicorp/ui 0.2.29 → 0.2.31

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 (90) hide show
  1. package/dist/atoms/icon.d.ts +1 -2
  2. package/dist/atoms/icon.js +3 -15
  3. package/dist/atoms/input-datepicker.d.ts +0 -1
  4. package/dist/atoms/input-datepicker.js +2 -2
  5. package/dist/atoms/pluxee-icon/base-icon.js +7 -1
  6. package/dist/atoms/pluxee-icon/icon-download.js +2 -2
  7. package/dist/atoms/pluxee-icon/pluxee-icon.d.ts +1 -8
  8. package/dist/atoms/pluxee-icon/pluxee-icon.js +3 -24
  9. package/dist/components/alert-template/alert-provider.js +1 -1
  10. package/dist/components/form-builder/components/button.d.ts +1 -1
  11. package/dist/components/form-builder/components/button.js +1 -2
  12. package/dist/components/form-builder/components/checkbox.d.ts +0 -1
  13. package/dist/components/form-builder/components/checkbox.js +3 -4
  14. package/dist/components/form-builder/components/input-currency.js +2 -15
  15. package/dist/components/form-builder/components/input-mask.js +2 -15
  16. package/dist/components/form-builder/components/input-prefix-suffix.js +2 -15
  17. package/dist/components/form-builder/components/input.d.ts +0 -1
  18. package/dist/components/form-builder/components/input.js +4 -6
  19. package/dist/components/form-builder/components/radio.d.ts +0 -1
  20. package/dist/components/form-builder/components/radio.js +3 -4
  21. package/dist/components/layout/authenticated-layout/authenticated-layout.d.ts +0 -4
  22. package/dist/components/layout/authenticated-layout/authenticated-layout.js +6 -6
  23. package/dist/components/layout/layout.d.ts +0 -4
  24. package/dist/components/page-create/page-create.d.ts +1 -1
  25. package/dist/components/page-create/page-create.js +1 -1
  26. package/dist/components/page-list/filters/filter-async-select.d.ts +25 -0
  27. package/dist/components/page-list/filters/filter-async-select.js +49 -0
  28. package/dist/components/page-list/filters/index.d.ts +1 -0
  29. package/dist/components/page-list/filters/index.js +1 -0
  30. package/dist/components/page-list/page-list.js +2 -6
  31. package/dist/components/side-navigation-bar/side-navigation-bar-item.d.ts +0 -1
  32. package/dist/components/side-navigation-bar/side-navigation-bar-item.js +13 -39
  33. package/dist/components/side-navigation-bar/side-navigation-bar.js +2 -2
  34. package/dist/css/style.min.css +2 -2
  35. package/dist/index.d.ts +2 -5
  36. package/dist/index.js +2 -5
  37. package/dist/molecules/table-column-management.js +4 -8
  38. package/dist/molecules/table.d.ts +2 -0
  39. package/dist/molecules/table.js +3 -3
  40. package/package.json +1 -1
  41. package/.vscode/extensions.json +0 -7
  42. package/.vscode/settings.json +0 -38
  43. package/dist/atoms/pluxee-icon/icon-card-slashed.d.ts +0 -6
  44. package/dist/atoms/pluxee-icon/icon-card-slashed.js +0 -12
  45. package/dist/atoms/pluxee-icon/icon-circle.d.ts +0 -6
  46. package/dist/atoms/pluxee-icon/icon-circle.js +0 -6
  47. package/dist/atoms/pluxee-icon/icon-clock.d.ts +0 -6
  48. package/dist/atoms/pluxee-icon/icon-clock.js +0 -7
  49. package/dist/atoms/pluxee-icon/icon-eye-closed-outline.d.ts +0 -6
  50. package/dist/atoms/pluxee-icon/icon-eye-closed-outline.js +0 -10
  51. package/dist/atoms/pluxee-icon/icon-identification.d.ts +0 -6
  52. package/dist/atoms/pluxee-icon/icon-identification.js +0 -10
  53. package/dist/atoms/pluxee-icon/icon-negotiation.d.ts +0 -6
  54. package/dist/atoms/pluxee-icon/icon-negotiation.js +0 -6
  55. package/dist/atoms/pluxee-icon/icon-play.d.ts +0 -6
  56. package/dist/atoms/pluxee-icon/icon-play.js +0 -6
  57. package/dist/atoms/pluxee-icon/icon-qrcode.d.ts +0 -6
  58. package/dist/atoms/pluxee-icon/icon-qrcode.js +0 -17
  59. package/dist/atoms/pluxee-icon/icon-update-limit.d.ts +0 -6
  60. package/dist/atoms/pluxee-icon/icon-update-limit.js +0 -8
  61. package/dist/atoms/pluxee-icon/icon-user-group.d.ts +0 -6
  62. package/dist/atoms/pluxee-icon/icon-user-group.js +0 -6
  63. package/dist/components/layout/pluxee-logo/pluxee-logo-card.d.ts +0 -8
  64. package/dist/components/layout/pluxee-logo/pluxee-logo-card.js +0 -14
  65. package/dist/molecules/card-summary/card-summary-body.d.ts +0 -12
  66. package/dist/molecules/card-summary/card-summary-body.js +0 -9
  67. package/dist/molecules/card-summary/card-summary-container.d.ts +0 -14
  68. package/dist/molecules/card-summary/card-summary-container.js +0 -19
  69. package/dist/molecules/card-summary/card-summary-footer.d.ts +0 -15
  70. package/dist/molecules/card-summary/card-summary-footer.js +0 -11
  71. package/dist/molecules/card-summary/card-summary-header.d.ts +0 -12
  72. package/dist/molecules/card-summary/card-summary-header.js +0 -11
  73. package/dist/molecules/card-summary/card-summary.d.ts +0 -40
  74. package/dist/molecules/card-summary/card-summary.js +0 -10
  75. package/dist/molecules/modal/modal.d.ts +0 -11
  76. package/dist/molecules/modal/modal.js +0 -15
  77. package/dist/molecules/panel/panel-container.d.ts +0 -12
  78. package/dist/molecules/panel/panel-container.js +0 -9
  79. package/dist/molecules/panel/panel-field.d.ts +0 -12
  80. package/dist/molecules/panel/panel-field.js +0 -12
  81. package/dist/molecules/panel/panel-group.d.ts +0 -14
  82. package/dist/molecules/panel/panel-group.js +0 -9
  83. package/dist/molecules/panel/panel.d.ts +0 -31
  84. package/dist/molecules/panel/panel.js +0 -8
  85. package/dist/molecules/player-video/modal-video.d.ts +0 -24
  86. package/dist/molecules/player-video/modal-video.js +0 -18
  87. package/dist/molecules/player-video/player-video.d.ts +0 -31
  88. package/dist/molecules/player-video/player-video.js +0 -8
  89. package/dist/molecules/player-video/thumb-video.d.ts +0 -12
  90. package/dist/molecules/player-video/thumb-video.js +0 -11
@@ -6,7 +6,6 @@ export declare type IconProps = {
6
6
  className?: string;
7
7
  id?: string;
8
8
  size?: 'lg' | 'md' | 'sm';
9
- title?: string;
10
9
  };
11
- export declare const Icon: ({ pluxee, icon, brand, className, id, size, ...props }: IconProps) => JSX.Element;
10
+ export declare const Icon: ({ icon, brand, pluxee, className, id, size }: IconProps) => JSX.Element;
12
11
  //# sourceMappingURL=icon.d.ts.map
@@ -1,26 +1,14 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
1
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
13
2
  import * as fab from '@fortawesome/free-brands-svg-icons';
14
3
  import * as fa from '@fortawesome/free-solid-svg-icons';
15
4
  import stringHelper from '../utils/string-helper';
16
5
  import React from 'react';
17
6
  import { PluxeeIcon } from './pluxee-icon/pluxee-icon';
18
- export const Icon = (_a) => {
19
- var { pluxee, icon, brand, className = '', id, size } = _a, props = __rest(_a, ["pluxee", "icon", "brand", "className", "id", "size"]);
7
+ export const Icon = ({ icon, brand, pluxee, className = '', id, size }) => {
20
8
  if (pluxee) {
21
- return (React.createElement(PluxeeIcon, Object.assign({ icon: icon, size: size }, props)));
9
+ return React.createElement(PluxeeIcon, { icon: icon, size: size });
22
10
  }
23
11
  const sanitize = stringHelper.toCamelCase(icon);
24
12
  const ico = brand ? fab[sanitize] : fa[sanitize];
25
- return (React.createElement(FontAwesomeIcon, Object.assign({ id: id, icon: ico, className: className }, props)));
13
+ return React.createElement(FontAwesomeIcon, { id: id, icon: ico, className: className });
26
14
  };
@@ -13,7 +13,6 @@ export declare type InputDatepickerProps = {
13
13
  minDate?: Date | null;
14
14
  maxDate?: Date | null;
15
15
  currentValue?: string;
16
- disabled?: boolean;
17
16
  };
18
17
  export declare const InputDatepicker: (props: InputDatepickerProps) => JSX.Element;
19
18
  //# sourceMappingURL=input-datepicker.d.ts.map
@@ -11,7 +11,7 @@ registerLocale('es-CO', es);
11
11
  registerLocale('en-US', en);
12
12
  // example use https://reactdatepicker.com
13
13
  export const InputDatepicker = (props) => {
14
- const { name, id = name, value, onChange, onBlur, locale = 'pt-BR', dateFormat = 'dd/MM/yyyy', placeholder = 'DD/MM/YYYY', minDate, maxDate, currentValue, disabled } = props;
14
+ const { name, id = name, value, onChange, onBlur, locale = 'pt-BR', dateFormat = 'dd/MM/yyyy', placeholder = 'DD/MM/YYYY', minDate, maxDate, currentValue } = props;
15
15
  const [date, setDate] = React.useState(dateHelper.stringToDate(currentValue || value));
16
16
  const handleDateSelect = (currentDate) => {
17
17
  if (onChange) {
@@ -29,5 +29,5 @@ export const InputDatepicker = (props) => {
29
29
  return (React.createElement(ReactDatePicker, { name: name, id: id, "data-testid": id, locale: locale, dateFormat: dateFormat, className: "form-control", selected: date, onChange: handleDateSelect, placeholderText: placeholder, autoComplete: "off",
30
30
  // showMonthDropdown
31
31
  // useShortMonthInDropdown
32
- minDate: minDate, maxDate: maxDate, showYearDropdown: true, yearDropdownItemNumber: 5, scrollableYearDropdown: true, tabIndex: 2, onBlur: handleBlur, customInput: React.createElement(MaskedTextInput, { type: "text", mask: mask }), disabled: disabled }));
32
+ minDate: minDate, maxDate: maxDate, showYearDropdown: true, yearDropdownItemNumber: 5, scrollableYearDropdown: true, tabIndex: 2, onBlur: handleBlur, customInput: React.createElement(MaskedTextInput, { type: "text", mask: mask }) }));
33
33
  };
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import uuidHelper from '../../utils/uuid-helper';
2
3
  const sizeInfo = {
3
4
  lg: 32,
4
5
  md: 24,
@@ -6,5 +7,10 @@ const sizeInfo = {
6
7
  };
7
8
  export const BaseIcon = ({ children, size }) => {
8
9
  const sizeNumber = sizeInfo[size];
9
- return (React.createElement("svg", { style: { color: 'inherit' }, width: sizeNumber, height: sizeNumber, viewBox: '0 0 32 32', fill: "none", xmlns: "http://www.w3.org/2000/svg" }, children));
10
+ const id = uuidHelper.generateUUID();
11
+ return (React.createElement("svg", { style: { color: 'inherit' }, width: sizeNumber, height: sizeNumber, viewBox: '0 0 32 32', fill: "none", xmlns: "http://www.w3.org/2000/svg" },
12
+ React.createElement("g", { clipPath: `url(#${id})` }, children),
13
+ React.createElement("defs", null,
14
+ React.createElement("clipPath", { id: id },
15
+ React.createElement("rect", { width: "32", height: "32", fill: "white" })))));
10
16
  };
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  export const IconDownload = () => {
3
3
  return (React.createElement(React.Fragment, null,
4
- React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M2 19V30H30V19H27V27H5V19H2Z", fill: "currentColor" }),
5
- React.createElement("path", { d: "M17.5 17.2576L17.5 3H14.5L14.5 17.2576L10.1212 12.8788L7.9999 15.0001L16 23.0002L24.0001 15.0001L21.8788 12.8788L17.5 17.2576Z", fill: "currentColor" })));
4
+ React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M2.0625 19V30H30.0625V19H27.0625V27H5.0625V19H2.0625Z", fill: "currentColor" }),
5
+ React.createElement("path", { d: "M16.0625 1.99976L24.0626 9.99986L21.9413 12.1212L17.5625 7.74238L17.5625 23H14.5625L14.5625 7.74241L10.1837 12.1212L8.0624 9.99986L16.0625 1.99976Z", fill: "currentColor" })));
6
6
  };
7
7
  IconDownload.displayName = 'IconDownload';
@@ -1,16 +1,9 @@
1
1
  /// <reference types="react" />
2
- export declare const IconsList: {
3
- key: string;
4
- Element: {
5
- (): JSX.Element;
6
- displayName: string;
7
- };
8
- }[];
9
2
  export declare type PluxeeIconColors = 'primary' | 'primary-contrast' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'white';
10
3
  declare type PluxeeIconProps = {
11
4
  icon: string;
12
5
  size?: 'lg' | 'md' | 'sm';
13
6
  };
14
- export declare const PluxeeIcon: ({ icon, size }: PluxeeIconProps) => JSX.Element;
7
+ export declare const PluxeeIcon: ({ icon, size }: PluxeeIconProps) => JSX.Element | null;
15
8
  export {};
16
9
  //# sourceMappingURL=pluxee-icon.d.ts.map
@@ -27,18 +27,7 @@ import { IconSearch } from './icon-search';
27
27
  import { IconPlus } from './icon-plus';
28
28
  import { Iconlogout } from './icon-logout';
29
29
  import { IconChevronDown } from './icon-chevron-down';
30
- import { IconCardSlashed } from './icon-card-slashed';
31
- import { IconClock } from './icon-clock';
32
- import { IconUpdateLimit } from './icon-update-limit';
33
- import { IconUserGroup } from './icon-user-group';
34
- import { IconEyeClosedOutline } from './icon-eye-closed-outline';
35
- import { IconNegotiation } from './icon-negotiation';
36
- import { IconQrcode } from './icon-qrcode';
37
- import { IconIdentification } from './icon-identification';
38
- import { Icon } from '../icon';
39
- import { IconPlay } from './icon-play';
40
- import { IconCircle } from './icon-circle';
41
- export const IconsList = [
30
+ const IconsList = [
42
31
  { key: 'fa-double-chevron-left', Element: IconDoubleChevronLeft },
43
32
  { key: 'fa-double-chevron-right', Element: IconDoubleChevronRight },
44
33
  { key: 'fa-home', Element: IconHome },
@@ -70,7 +59,6 @@ export const IconsList = [
70
59
  { key: 'fa-pen', Element: IconPen },
71
60
  { key: 'fa-pencil-alt', Element: IconPen },
72
61
  { key: 'fa-eye-open-outline', Element: IconEyeOpenOutline },
73
- { key: 'fa-eye-closed-outline', Element: IconEyeClosedOutline },
74
62
  { key: 'fa-eye', Element: IconEyeOpenOutline },
75
63
  { key: 'fa-lock', Element: IconLock },
76
64
  { key: 'fa-unlock', Element: IconUnlock },
@@ -81,21 +69,12 @@ export const IconsList = [
81
69
  { key: 'fa-search', Element: IconSearch },
82
70
  { key: 'fa-plus', Element: IconPlus },
83
71
  { key: 'fa-logout', Element: Iconlogout },
84
- { key: 'fa-chevron-down', Element: IconChevronDown },
85
- { key: 'fa-card-slashed', Element: IconCardSlashed },
86
- { key: 'fa-clock-circle', Element: IconClock },
87
- { key: 'fa-update-limit', Element: IconUpdateLimit },
88
- { key: 'fa-user-group', Element: IconUserGroup },
89
- { key: 'fa-negotiation', Element: IconNegotiation },
90
- { key: 'fa-qrcode', Element: IconQrcode },
91
- { key: 'fa-identification', Element: IconIdentification },
92
- { key: 'fa-play', Element: IconPlay },
93
- { key: 'fa-circle', Element: IconCircle }
72
+ { key: 'fa-chevron-down', Element: IconChevronDown }
94
73
  ];
95
74
  export const PluxeeIcon = ({ icon, size = 'md' }) => {
96
75
  const item = IconsList.find(item => item.key === icon);
97
76
  if (!item)
98
- return React.createElement(Icon, { size: size, icon: icon });
77
+ return null;
99
78
  const { Element } = item;
100
79
  return (React.createElement(BaseIcon, { size: size },
101
80
  React.createElement(Element, null)));
@@ -14,7 +14,7 @@ import { positions, Provider } from 'react-alert';
14
14
  import { AlertTemplate } from './alert-template';
15
15
  const options = {
16
16
  position: positions.MIDDLE,
17
- timeout: 10000
17
+ timeout: 5000
18
18
  };
19
19
  export const AlertProvider = (_a) => {
20
20
  var { children } = _a, props = __rest(_a, ["children"]);
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { FormikProps } from 'formik';
3
- declare type Props = React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> & {
3
+ declare type Props = React.HTMLAttributes<HTMLButtonElement> & {
4
4
  type?: 'submit' | 'reset' | 'button';
5
5
  actions: FormikProps<any>;
6
6
  color?: 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
@@ -12,10 +12,9 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  import React from 'react';
13
13
  import { Button } from '../../../atoms/button';
14
14
  export default function Input(props) {
15
- var _a;
16
15
  const { type = 'button', actions, color = 'primary', label, labelLoading = label, className, id } = props, elements = __rest(props, ["type", "actions", "color", "label", "labelLoading", "className", "id"]);
17
16
  return (React.createElement("div", null,
18
- React.createElement(Button, Object.assign({}, elements, { className: className, type: type, color: color, disabled: actions.isSubmitting ? true : (_a = elements.disabled) !== null && _a !== void 0 ? _a : false }, (id && { 'data-testid': id })), actions.isSubmitting
17
+ React.createElement(Button, Object.assign({}, elements, { className: className, type: type, color: color }, (id && { 'data-testid': id })), actions.isSubmitting
19
18
  ? labelLoading
20
19
  : label)));
21
20
  }
@@ -9,7 +9,6 @@ declare type Props = React.InputHTMLAttributes<HTMLInputElement> & {
9
9
  actions: FormikProps<any>;
10
10
  value?: string;
11
11
  options: Option[];
12
- fastField?: boolean;
13
12
  };
14
13
  export default function Checkbox(props: Props): JSX.Element[] | null;
15
14
  export {};
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import { FastField, Field } from 'formik';
2
+ import { FastField } from 'formik';
3
3
  export default function Checkbox(props) {
4
- const { name, actions, value = [], options, id = name, tabIndex = 0, disabled, fastField = true } = props;
4
+ const { name, actions, value = [], options, id = name, tabIndex = 0, disabled } = props;
5
5
  if (!options.length)
6
6
  return null;
7
7
  const curValue = actions.values[name] || value || [];
@@ -21,8 +21,7 @@ export default function Checkbox(props) {
21
21
  : [...values, value]);
22
22
  }
23
23
  };
24
- const Tag = fastField ? FastField : Field;
25
24
  return options.map((option, index) => (React.createElement("div", { className: "form-check", key: `${name}-${index}` },
26
- React.createElement(Tag, Object.assign({ value: option.value, name: name, id: `${id}-${index}`, "data-testid": `${id}-${index}`, checked: isChecked(option) }, { disabled }, { className: "form-check-input", type: "checkbox", tabIndex: tabIndex, onChange: handleChange })),
25
+ React.createElement(FastField, Object.assign({ value: option.value, name: name, id: `${id}-${index}`, "data-testid": `${id}-${index}`, checked: isChecked(option) }, { disabled }, { className: "form-check-input", type: "checkbox", tabIndex: tabIndex, onChange: handleChange })),
27
26
  React.createElement("label", { className: "form-check-label", htmlFor: `${id}-${index}` }, option.label))));
28
27
  }
@@ -1,15 +1,4 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import { FastField, Field } from 'formik';
1
+ import { FastField } from 'formik';
13
2
  import React from 'react';
14
3
  import numberHelper from '../../../utils/number-helper';
15
4
  export const InputCurrency = ({ attrs, handleChange, currency, name }) => {
@@ -24,7 +13,5 @@ export const InputCurrency = ({ attrs, handleChange, currency, name }) => {
24
13
  }
25
14
  });
26
15
  };
27
- const { fastField = true } = attrs, restAttrs = __rest(attrs, ["fastField"]);
28
- const Tag = fastField ? FastField : Field;
29
- return (React.createElement(Tag, { name: name }, ({ field }) => React.createElement("input", Object.assign({}, field, restAttrs, { onChange: handleChangeCurrency, min: "0", maxLength: maxLength }))));
16
+ return (React.createElement(FastField, { name: name }, ({ field }) => React.createElement("input", Object.assign({}, field, attrs, { onChange: handleChangeCurrency, min: "0", maxLength: maxLength }))));
30
17
  };
@@ -1,19 +1,6 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import { FastField, Field } from 'formik';
1
+ import { FastField } from 'formik';
13
2
  import React from 'react';
14
3
  import ReactInputMask from 'react-input-mask';
15
4
  export const InputMask = ({ attrs, mask, name }) => {
16
- const { fastField = true } = attrs, restAttrs = __rest(attrs, ["fastField"]);
17
- const Tag = fastField ? FastField : Field;
18
- return (React.createElement(Tag, { name: name }, ({ field }) => React.createElement(ReactInputMask, Object.assign({}, field, restAttrs, { mask: mask }))));
5
+ return (React.createElement(FastField, { name: name }, ({ field }) => React.createElement(ReactInputMask, Object.assign({}, field, attrs, { mask: mask }))));
19
6
  };
@@ -1,23 +1,10 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
1
  import React from 'react';
13
- import { FastField, Field } from 'formik';
2
+ import { FastField } from 'formik';
14
3
  export const InputPrefixSuffix = ({ attrs, suffix, prefix }) => {
15
4
  var _a;
16
- const { fastField = true } = attrs, restAttrs = __rest(attrs, ["fastField"]);
17
- const Tag = fastField ? FastField : Field;
18
5
  return (React.createElement("div", { className: "position-relative" },
19
6
  prefix && React.createElement("div", { className: "input-prefix" }, typeof prefix === 'string' ? React.createElement("span", null, prefix) : prefix),
20
- React.createElement(Tag, Object.assign({}, restAttrs, { readOnly: true, onFocus: (event) => {
7
+ React.createElement(FastField, Object.assign({}, attrs, { readOnly: true, onFocus: (event) => {
21
8
  event.currentTarget.readOnly = false;
22
9
  } }, ((prefix && typeof prefix === 'string') && {
23
10
  style: {
@@ -12,7 +12,6 @@ export interface FormBuildItemInput extends Omit<FormBuilderBasicsItem, 'prefix'
12
12
  };
13
13
  suffix?: string | React.ReactNode;
14
14
  prefix?: string | React.ReactNode;
15
- fastField?: boolean;
16
15
  }
17
16
  declare type Props = Omit<FormBuildItemInput, 'component'> & {
18
17
  actions: FormikProps<any>;
@@ -10,13 +10,13 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import React from 'react';
13
- import { FastField, Field } from 'formik';
13
+ import { FastField } from 'formik';
14
14
  import classNames from 'classnames';
15
15
  import { InputCurrency } from './input-currency';
16
16
  import { InputMask } from './input-mask';
17
17
  import { InputPrefixSuffix } from './input-prefix-suffix';
18
18
  export default function Input(props) {
19
- const { name, id = name, type = 'text', tabIndex = 0, actions, mask, multiple = false, currency, className, prefix, suffix, fastField = true } = props, elements = __rest(props, ["name", "id", "type", "tabIndex", "actions", "mask", "multiple", "currency", "className", "prefix", "suffix", "fastField"]);
19
+ const { name, id = name, type = 'text', tabIndex = 0, actions, mask, multiple = false, currency, className, prefix, suffix } = props, elements = __rest(props, ["name", "id", "type", "tabIndex", "actions", "mask", "multiple", "currency", "className", "prefix", "suffix"]);
20
20
  const validOptions = {
21
21
  alt: elements.alt,
22
22
  autoComplete: elements.autoComplete,
@@ -57,17 +57,15 @@ export default function Input(props) {
57
57
  };
58
58
  const curValue = actions.values[name];
59
59
  const classes = classNames(className, 'form-control');
60
- const attrsInput = Object.assign(Object.assign({}, validOptions), { value: curValue, className: classes, name,
60
+ const attrs = Object.assign(Object.assign({}, validOptions), { value: curValue, className: classes, name,
61
61
  id, 'data-testid': id, type: type === 'number' ? 'text' : type, tabIndex, autoComplete: 'none', onChange: handleChange });
62
- const attrs = Object.assign(Object.assign({}, attrsInput), { fastField });
63
62
  if (currency)
64
63
  return React.createElement(InputCurrency, Object.assign({}, { name, attrs, currency, handleChange }));
65
64
  if (mask)
66
65
  return React.createElement(InputMask, Object.assign({}, { name, attrs, mask }));
67
66
  if (prefix || suffix)
68
67
  return React.createElement(InputPrefixSuffix, Object.assign({}, { attrs, suffix, prefix }));
69
- const Tag = fastField ? FastField : Field;
70
- return (React.createElement(Tag, Object.assign({}, attrsInput, { as: multiple ? 'textarea' : 'input', readOnly: true, onFocus: (event) => {
68
+ return (React.createElement(FastField, Object.assign({}, attrs, { as: multiple ? 'textarea' : 'input', readOnly: true, onFocus: (event) => {
71
69
  event.currentTarget.readOnly = false;
72
70
  } })));
73
71
  }
@@ -9,7 +9,6 @@ declare type Props = React.InputHTMLAttributes<HTMLInputElement> & {
9
9
  actions: FormikProps<any>;
10
10
  value?: string;
11
11
  options: Option[];
12
- fastField?: boolean;
13
12
  };
14
13
  export default function Radio(props: Props): JSX.Element[] | null;
15
14
  export {};
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import { FastField, Field } from 'formik';
2
+ import { FastField } from 'formik';
3
3
  export default function Radio(props) {
4
- const { name, actions, value, options, id = name, tabIndex = 0, disabled, fastField = true } = props;
4
+ const { name, actions, value, options, id = name, tabIndex = 0, disabled } = props;
5
5
  if (!options.length)
6
6
  return null;
7
7
  const curValue = actions.values[name] || value;
@@ -18,8 +18,7 @@ export default function Radio(props) {
18
18
  actions.setFieldValue(name, event.currentTarget.value);
19
19
  }
20
20
  };
21
- const Tag = fastField ? FastField : Field;
22
21
  return options.map((option, index) => (React.createElement("div", { className: "form-check", key: `${name}-${index}` },
23
- React.createElement(Tag, Object.assign({ value: option.value, name: name, id: `${id}-${index}`, "data-testid": `${id}-${index}` }, isChecked(option), { disabled }, { type: "radio", tabIndex: tabIndex, className: "form-check-input", onChange: handleChange })),
22
+ React.createElement(FastField, Object.assign({ value: option.value, name: name, id: `${id}-${index}`, "data-testid": `${id}-${index}` }, isChecked(option), { disabled }, { type: "radio", tabIndex: tabIndex, className: "form-check-input", onChange: handleChange })),
24
23
  React.createElement("label", { className: "form-check-label", htmlFor: `${id}-${index}` }, option.label))));
25
24
  }
@@ -6,10 +6,6 @@ declare type Props = {
6
6
  menuItems: SideNavigationBarItemProps[];
7
7
  navItems?: React.ReactNode[];
8
8
  dropdown: DropdownProps;
9
- logout?: {
10
- href: string;
11
- label: string;
12
- };
13
9
  };
14
10
  export declare const AuthenticatedLayout: React.FC<Props>;
15
11
  export {};
@@ -2,10 +2,7 @@ import React from 'react';
2
2
  import { SideNavigationBar } from '../../side-navigation-bar/side-navigation-bar';
3
3
  import { Navbar } from '../../navbar/navbar';
4
4
  import { PluxeeLogo } from '../pluxee-logo/pluxee-logo';
5
- export const AuthenticatedLayout = ({ children, menuItems, navItems, dropdown, logout = {
6
- label: 'logout',
7
- href: '/logout'
8
- } }) => {
5
+ export const AuthenticatedLayout = ({ children, menuItems, navItems, dropdown }) => {
9
6
  return (React.createElement("div", { className: "hv-md-100" },
10
7
  React.createElement("header", { className: "main-header" },
11
8
  React.createElement("div", { className: "logo-container" },
@@ -20,8 +17,11 @@ export const AuthenticatedLayout = ({ children, menuItems, navItems, dropdown, l
20
17
  React.createElement("div", { className: "nav-container" },
21
18
  React.createElement(Navbar, { showUserIcon: false, dropdown: dropdown, items: navItems }))),
22
19
  React.createElement("main", { className: "d-flex" },
23
- React.createElement("div", { style: { minHeight: '100%' } },
24
- React.createElement(SideNavigationBar, { active: false, items: menuItems, logout: logout })),
20
+ React.createElement("div", null,
21
+ React.createElement(SideNavigationBar, { active: false, items: menuItems, logout: {
22
+ label: 'logout',
23
+ href: '/logout'
24
+ } })),
25
25
  React.createElement("div", { className: "w-100 overflow-y-auto" }, children))));
26
26
  };
27
27
  AuthenticatedLayout.displayName = 'AuthenticatedLayout';
@@ -5,10 +5,6 @@ export declare const Layout: {
5
5
  menuItems: import("../side-navigation-bar/side-navigation-bar-item").SideNavigationBarItemProps[];
6
6
  navItems?: import("react").ReactNode[] | undefined;
7
7
  dropdown: import("../..").DropdownProps;
8
- logout?: {
9
- href: string;
10
- label: string;
11
- } | undefined;
12
8
  }>;
13
9
  Content: {
14
10
  ({ children }: {
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { FormBuilderGroup } from '../form-builder/form-builder.types';
3
3
  import { DropdownItemProps } from '../../molecules/dropdown/dropdown-item';
4
- import { ModalProps } from '../../molecules/modal/modal';
4
+ import { ModalProps } from '../modal/modal';
5
5
  import { FormikHelpers } from 'formik';
6
6
  declare type ExtraButtons = {
7
7
  label: string;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Modal } from '../../molecules/modal/modal';
2
+ import { Modal } from '../modal/modal';
3
3
  import { Button, Col, Dropdown, FormBuilder, Icon, Link, Row, Typography } from '../../';
4
4
  export const PageCreate = (props) => {
5
5
  const { title, extraButtons = [], cancelButton, onSubmit, data, modal } = props;
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import { ActionMeta, OnChangeValue } from 'react-select';
3
+ declare type Option = {
4
+ label: string | number;
5
+ value: string | number;
6
+ };
7
+ declare type FilterAsyncSelectProps = {
8
+ name: string;
9
+ placeholder: string;
10
+ options?: Option[];
11
+ defaultOptions?: Option[];
12
+ id?: string;
13
+ value?: string | Option | Option[];
14
+ isDisabled?: boolean;
15
+ isLoading?: boolean;
16
+ isClearable?: boolean;
17
+ isSearchable?: boolean;
18
+ isMulti?: boolean;
19
+ cacheOptions?: boolean;
20
+ loadOptions?: (newValue: string) => void;
21
+ onChange?: (newValue: OnChangeValue<any, any>, actionMeta: ActionMeta<any>) => void;
22
+ };
23
+ export declare const FilterAsyncSelect: React.FC<FilterAsyncSelectProps>;
24
+ export {};
25
+ //# sourceMappingURL=filter-async-select.d.ts.map
@@ -0,0 +1,49 @@
1
+ import React from 'react';
2
+ import AsyncSelect from 'react-select/async';
3
+ const getValueInOption = (options, value) => {
4
+ return options.find(({ value: currValue }) => typeof currValue === 'number'
5
+ ? currValue === Number(value)
6
+ : currValue === value);
7
+ };
8
+ const getValue = (value, options) => {
9
+ if (!value)
10
+ return undefined;
11
+ const isArray = typeof value === 'object' && Array.isArray(value);
12
+ const isObject = !isArray && typeof value === 'object';
13
+ if (!isObject && !isObject) {
14
+ return getValueInOption(options, (value).toString());
15
+ }
16
+ if (isArray) {
17
+ const selected = [];
18
+ value.forEach(val => {
19
+ const data = getValueInOption(options, (val.value).toString());
20
+ if (data)
21
+ selected.push(data);
22
+ });
23
+ return selected;
24
+ }
25
+ return getValueInOption(options, (value.value).toString());
26
+ };
27
+ export const FilterAsyncSelect = (props) => {
28
+ const { options = [], defaultOptions = [], name, id = name, value = undefined, placeholder, isDisabled = false, isLoading = false, isClearable = false, isSearchable = true, isMulti = false, cacheOptions = false, loadOptions, onChange } = props;
29
+ const newValue = getValue(value, options);
30
+ const handleChange = React.useCallback((event, action) => {
31
+ if (onChange) {
32
+ onChange({
33
+ target: {
34
+ name,
35
+ value: event
36
+ },
37
+ currentTarget: {
38
+ name,
39
+ value: JSON.stringify(event)
40
+ }
41
+ }, action);
42
+ }
43
+ }, []);
44
+ return (React.createElement("div", { className: "form-group" },
45
+ Boolean(placeholder) && React.createElement("label", { className: "form-label", htmlFor: name },
46
+ placeholder,
47
+ ":"),
48
+ React.createElement(AsyncSelect, { placeholder: placeholder, className: "form-builder-select", classNamePrefix: "form-builder", options: options, defaultOptions: defaultOptions, name: name, id: id, defaultValue: newValue, isDisabled: isDisabled, isLoading: isLoading, isClearable: isClearable, isSearchable: isSearchable, isMulti: isMulti, cacheOptions: cacheOptions, loadOptions: loadOptions, onChange: handleChange })));
49
+ };
@@ -1,5 +1,6 @@
1
1
  export { FilterInput as Input } from './filter-input';
2
2
  export { FilterSelect as Select } from './filter-select';
3
+ export { FilterAsyncSelect as AsyncSelect } from './filter-async-select';
3
4
  export { FilterSelectGroup as SelectGroup } from './filter-select-group';
4
5
  export { FilterDatepicker as Datepicker } from './filter-datepicker';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,5 @@
1
1
  export { FilterInput as Input } from './filter-input';
2
2
  export { FilterSelect as Select } from './filter-select';
3
+ export { FilterAsyncSelect as AsyncSelect } from './filter-async-select';
3
4
  export { FilterSelectGroup as SelectGroup } from './filter-select-group';
4
5
  export { FilterDatepicker as Datepicker } from './filter-datepicker';
@@ -23,12 +23,8 @@ export const PageList = (props) => {
23
23
  return (React.createElement("div", { className: "my-5" },
24
24
  React.createElement(Spinner, null)));
25
25
  }
26
- const showTitleContainer = Boolean(title) ||
27
- Boolean(extraButtonsInline.length) ||
28
- Boolean(addButton) ||
29
- Boolean((Array.isArray(extraButtons) ? extraButtons : extraButtons.items).length);
30
26
  return (React.createElement(React.Fragment, null,
31
- showTitleContainer && (React.createElement(Row, { className: "page-title-container mb-3" },
27
+ React.createElement(Row, { className: "page-title-container mb-3" },
32
28
  title && (React.createElement(Col, { className: "d-flex align-items-center" },
33
29
  React.createElement(Typography, { className: "mb-0", variant: "h4", tag: "h1" }, title))),
34
30
  React.createElement(Col, { className: "ms-auto" },
@@ -40,7 +36,7 @@ export const PageList = (props) => {
40
36
  Boolean(addButton) && (React.createElement(Button, { tag: Link, href: addButton === null || addButton === void 0 ? void 0 : addButton.uri }, addButton === null || addButton === void 0 ? void 0 :
41
37
  addButton.label,
42
38
  React.createElement(Icon, { icon: "fa-plus", pluxee: true, className: "ms-1" }))),
43
- Boolean((Array.isArray(extraButtons) ? extraButtons : extraButtons.items).length) && (React.createElement(Dropdown, { outline: true, color: "primary", align: "right", label: Array.isArray(extraButtons) ? React.createElement(Icon, { icon: "faEllipsisH" }) : extraButtons.label, items: Array.isArray(extraButtons) ? extraButtons : extraButtons.items })))))),
39
+ Boolean((Array.isArray(extraButtons) ? extraButtons : extraButtons.items).length) && (React.createElement(Dropdown, { outline: true, color: "primary", align: "right", label: Array.isArray(extraButtons) ? React.createElement(Icon, { icon: "faEllipsisH" }) : extraButtons.label, items: Array.isArray(extraButtons) ? extraButtons : extraButtons.items }))))),
44
40
  !!customizeFilter && customizeFilter,
45
41
  !customizeFilter && filterList && (React.createElement(PageListGetFilters, { filterList: filterList, search: search, filter: filter, key: JSON.stringify(history) }, configList)),
46
42
  React.createElement("div", null, restList),
@@ -8,7 +8,6 @@ export declare type SideNavigationBarItemProps = LinkProps & {
8
8
  items?: SideNavigationBarItemProps[];
9
9
  dataLink?: boolean;
10
10
  pathname?: string;
11
- iconSize?: 'lg' | 'md' | 'sm';
12
11
  };
13
12
  export declare const SideNavigationBarItem: React.FC<SideNavigationBarItemProps>;
14
13
  //# sourceMappingURL=side-navigation-bar-item.d.ts.map