@dilicorp/ui 0.2.37 → 0.2.39

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 (32) hide show
  1. package/dist/atoms/col.d.ts +1 -2
  2. package/dist/components/multi-step/multi-step.d.ts +18 -0
  3. package/dist/components/multi-step/multi-step.js +45 -0
  4. package/dist/components/page-list/filters/filter-async-select-group/filter-async-select.d.ts +28 -0
  5. package/dist/components/page-list/filters/filter-async-select-group/filter-async-select.js +23 -0
  6. package/dist/components/page-list/filters/filter-async-select-group/filter-group.d.ts +21 -0
  7. package/dist/components/page-list/filters/filter-async-select-group/filter-group.js +47 -0
  8. package/dist/components/page-list/filters/filter-async-select-group/index.d.ts +47 -0
  9. package/dist/components/page-list/filters/filter-async-select-group/index.js +6 -0
  10. package/dist/components/page-list/filters/filter-async-select.d.ts +4 -0
  11. package/dist/components/page-list/filters/filter-async-select.js +5 -6
  12. package/dist/components/page-list/filters/filter-datepicker.d.ts +4 -0
  13. package/dist/components/page-list/filters/filter-datepicker.js +5 -6
  14. package/dist/components/page-list/filters/filter-input.d.ts +4 -0
  15. package/dist/components/page-list/filters/filter-input.js +9 -11
  16. package/dist/components/page-list/filters/filter-select-group.d.ts +4 -0
  17. package/dist/components/page-list/filters/filter-select-group.js +5 -6
  18. package/dist/components/page-list/filters/filter-select.d.ts +4 -0
  19. package/dist/components/page-list/filters/filter-select.js +5 -6
  20. package/dist/components/page-list/filters/index.d.ts +1 -0
  21. package/dist/components/page-list/filters/index.js +1 -0
  22. package/dist/components/page-list/page-list-filters.d.ts +7 -3
  23. package/dist/components/page-list/page-list-get-filters.d.ts +7 -2
  24. package/dist/components/page-list/page-list-get-filters.js +12 -8
  25. package/dist/components/page-list/page-list-header.d.ts +9 -0
  26. package/dist/components/page-list/page-list-header.js +5 -0
  27. package/dist/components/page-list/page-list.js +3 -1
  28. package/dist/css/style.min.css +2 -2
  29. package/dist/index.d.ts +2 -0
  30. package/dist/index.js +2 -0
  31. package/dist/molecules/panel/panel.d.ts +1 -1
  32. package/package.json +1 -1
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
- declare type columns = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 'auto' | 'none';
2
+ export declare type columns = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 'auto' | 'none';
3
3
  export declare type ColProps = {
4
4
  size?: columns | columns[] | boolean;
5
5
  } & React.HTMLAttributes<HTMLDivElement>;
6
6
  export declare const Col: React.FC<ColProps>;
7
- export {};
8
7
  //# sourceMappingURL=col.d.ts.map
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ declare type RenderFooterProps = {
3
+ prevStep: () => void;
4
+ nextStep: () => void;
5
+ };
6
+ export declare type StepSchema = {
7
+ id: number;
8
+ header: string | React.ReactNode;
9
+ content: React.ReactNode;
10
+ renderFooter: ({ prevStep, nextStep }: RenderFooterProps) => React.ReactNode;
11
+ };
12
+ declare type MultiStepProps = {
13
+ steps: StepSchema[];
14
+ headerNavigationIsDisabled?: boolean;
15
+ };
16
+ export declare const MultiStep: React.FC<MultiStepProps>;
17
+ export {};
18
+ //# sourceMappingURL=multi-step.d.ts.map
@@ -0,0 +1,45 @@
1
+ import React, { useCallback, useMemo, useState } from 'react';
2
+ export const MultiStep = ({ steps, headerNavigationIsDisabled }) => {
3
+ const [currentStep, setCurrentStep] = useState(0);
4
+ const activeStep = useMemo(() => {
5
+ return steps[currentStep];
6
+ }, [steps, currentStep]);
7
+ const handleNextStep = useCallback(() => {
8
+ setCurrentStep(prevValue => prevValue + 1);
9
+ }, []);
10
+ const handlePrevStep = useCallback(() => {
11
+ setCurrentStep(prevValue => prevValue - 1);
12
+ }, []);
13
+ const handleGoToStep = useCallback((step) => {
14
+ setCurrentStep(step);
15
+ }, []);
16
+ const isFirstStep = useMemo(() => {
17
+ return currentStep === 0;
18
+ }, []);
19
+ const isLastStep = useMemo(() => {
20
+ return currentStep === steps.length - 1;
21
+ }, [currentStep]);
22
+ return (React.createElement("div", null,
23
+ React.createElement("div", { className: "header" }, steps.map(step => {
24
+ return (React.createElement(React.Fragment, { key: step.id },
25
+ step.id > 0
26
+ ? (React.createElement("div", { className: `smart-line ${step.id > currentStep ? 'smart-line-next' : 'smart-line-concluded'}` }))
27
+ : null,
28
+ React.createElement("div", { className: `header-item
29
+ ${currentStep === step.id ? 'current-item' : null}
30
+ ${currentStep > step.id ? 'complete-item' : null}
31
+ ${!headerNavigationIsDisabled ? 'clickable' : null}
32
+ `, onClick: () => {
33
+ if (!headerNavigationIsDisabled) {
34
+ handleGoToStep(step.id);
35
+ }
36
+ } }, typeof step.header === 'string'
37
+ ? React.createElement("span", null, step.header)
38
+ : step.header)));
39
+ })),
40
+ React.createElement("div", { className: "content" }, activeStep.content),
41
+ activeStep.renderFooter({
42
+ prevStep: isFirstStep ? () => { } : handlePrevStep,
43
+ nextStep: isLastStep ? () => { } : handleNextStep
44
+ })));
45
+ };
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import { ActionMeta, OnChangeValue } from 'react-select';
3
+ import { columns } from '../../../../atoms/col';
4
+ declare type Option = {
5
+ label: string | number;
6
+ value: string | number;
7
+ };
8
+ declare type FilterAsyncSelectProps = {
9
+ label?: string;
10
+ message?: string;
11
+ name?: string;
12
+ placeholder: string;
13
+ defaultOptions?: Option[];
14
+ id?: string;
15
+ value?: string | Option | Option[];
16
+ isDisabled?: boolean;
17
+ isLoading?: boolean;
18
+ isClearable?: boolean;
19
+ isSearchable?: boolean;
20
+ isMulti?: boolean;
21
+ cacheOptions?: boolean;
22
+ size?: columns;
23
+ loadOptions?: (newValue: string) => void;
24
+ onChange?: (newValue: OnChangeValue<any, any>, actionMeta: ActionMeta<any>) => void;
25
+ };
26
+ export declare const FilterAsyncSelect: React.FC<FilterAsyncSelectProps>;
27
+ export {};
28
+ //# sourceMappingURL=filter-async-select.d.ts.map
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import AsyncSelect from 'react-select/async';
3
+ export const FilterAsyncSelect = (props) => {
4
+ const { label, message, defaultOptions = [], name = '', id = name, value = undefined, placeholder, isDisabled = false, isLoading = false, isClearable = false, isSearchable = true, isMulti = false, cacheOptions = false, loadOptions, onChange } = props;
5
+ const handleChange = React.useCallback((event, action) => {
6
+ if (onChange) {
7
+ onChange({
8
+ target: {
9
+ name,
10
+ value: event
11
+ },
12
+ currentTarget: {
13
+ name,
14
+ value: JSON.stringify(event)
15
+ }
16
+ }, action);
17
+ }
18
+ }, []);
19
+ return (React.createElement("div", { className: "form-group label-margin" },
20
+ Boolean(label) && React.createElement("label", { className: "form-label new-label", htmlFor: name }, label),
21
+ React.createElement(AsyncSelect, { placeholder: placeholder, className: "form-builder-select", classNamePrefix: "form-builder", defaultOptions: defaultOptions, name: name, id: id, defaultValue: value, value: value, isDisabled: isDisabled, isLoading: isLoading, isClearable: isClearable, isSearchable: isSearchable, isMulti: isMulti, cacheOptions: cacheOptions, loadOptions: loadOptions, onChange: handleChange }),
22
+ Boolean(message) && React.createElement("label", { className: "form-label new-message", htmlFor: name }, message)));
23
+ };
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { columns } from '../../../../atoms/col';
3
+ declare type BaseValueProps = string | number;
4
+ declare type BaseOptionType = {
5
+ label: BaseValueProps;
6
+ value: BaseValueProps;
7
+ };
8
+ declare type ValueProps = BaseOptionType | undefined;
9
+ declare type FilterGroupProps = {
10
+ label?: string;
11
+ message?: string;
12
+ name: string;
13
+ value?: BaseValueProps;
14
+ defaultOptions?: ValueProps[];
15
+ children?: React.ReactElement[];
16
+ size?: columns;
17
+ onChange?: (selected: ValueProps) => void;
18
+ };
19
+ export declare const FilterGroupSelect: React.FC<FilterGroupProps>;
20
+ export {};
21
+ //# sourceMappingURL=filter-group.d.ts.map
@@ -0,0 +1,47 @@
1
+ import React from 'react';
2
+ import { Col } from '../../../../atoms/col';
3
+ import { Row } from '../../../../atoms/row';
4
+ export const FilterGroupSelect = (props) => {
5
+ const { label, message, name, value, children, defaultOptions, onChange } = props;
6
+ const inputRef = React.useRef(null);
7
+ const [internalValue, setInternalValue] = React.useState(defaultOptions === null || defaultOptions === void 0 ? void 0 : defaultOptions.find(option => (option === null || option === void 0 ? void 0 : option.value) === value));
8
+ const [internalOptions, setInternalOptions] = React.useState(defaultOptions || []);
9
+ const prepareFields = React.useCallback(({ key, field, value, defaultOptions }) => {
10
+ const { size } = field === null || field === void 0 ? void 0 : field.props;
11
+ const clone = React.cloneElement(field, {
12
+ key,
13
+ size,
14
+ value,
15
+ defaultOptions,
16
+ onChange: (newValue) => {
17
+ var _a, _b;
18
+ const value = (_a = newValue === null || newValue === void 0 ? void 0 : newValue.target) === null || _a === void 0 ? void 0 : _a.value;
19
+ (_b = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _b === void 0 ? void 0 : _b.setAttribute('value', value === null || value === void 0 ? void 0 : value.value);
20
+ setInternalValue(value);
21
+ setInternalOptions((curr) => [
22
+ ...curr === null || curr === void 0 ? void 0 : curr.filter((option) => {
23
+ const finalValue = (option === null || option === void 0 ? void 0 : option.value) || option;
24
+ return finalValue !== (value === null || value === void 0 ? void 0 : value.value);
25
+ }),
26
+ value
27
+ ]);
28
+ if (onChange)
29
+ onChange(value);
30
+ }
31
+ });
32
+ return clone;
33
+ }, [inputRef]);
34
+ return (React.createElement("div", { className: "form-input-group label-margin" },
35
+ Boolean(label) && React.createElement("label", { className: "form-label new-label", htmlFor: name }, label),
36
+ React.createElement("input", { name: name, type: "text", ref: inputRef, hidden: true }),
37
+ React.createElement(Row, null, children === null || children === void 0 ? void 0 : children.map((field, index) => {
38
+ const { size } = field === null || field === void 0 ? void 0 : field.props;
39
+ return (React.createElement(Col, { size: size || [12, 6, 4, 3], key: `${index}-${name}`, className: "mb-3" }, prepareFields({
40
+ field,
41
+ value: internalValue,
42
+ defaultOptions: internalOptions,
43
+ key: `${index}-${name}`
44
+ })));
45
+ })),
46
+ Boolean(message) && React.createElement("label", { className: "form-label new-message", htmlFor: name }, message)));
47
+ };
@@ -0,0 +1,47 @@
1
+ /// <reference types="react" />
2
+ export declare const Group: {
3
+ Wrapper: import("react").FC<{
4
+ label?: string | undefined;
5
+ message?: string | undefined;
6
+ name: string;
7
+ value?: (string | number) | undefined;
8
+ defaultOptions?: ({
9
+ label: string | number;
10
+ value: string | number;
11
+ } | undefined)[] | undefined;
12
+ children?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>[] | undefined;
13
+ size?: import("../../../..").columns | undefined;
14
+ onChange?: ((selected: {
15
+ label: string | number;
16
+ value: string | number;
17
+ } | undefined) => void) | undefined;
18
+ }>;
19
+ Select: import("react").FC<{
20
+ label?: string | undefined;
21
+ message?: string | undefined;
22
+ name?: string | undefined;
23
+ placeholder: string;
24
+ defaultOptions?: {
25
+ label: string | number;
26
+ value: string | number;
27
+ }[] | undefined;
28
+ id?: string | undefined;
29
+ value?: string | {
30
+ label: string | number;
31
+ value: string | number;
32
+ } | {
33
+ label: string | number;
34
+ value: string | number;
35
+ }[] | undefined;
36
+ isDisabled?: boolean | undefined;
37
+ isLoading?: boolean | undefined;
38
+ isClearable?: boolean | undefined;
39
+ isSearchable?: boolean | undefined;
40
+ isMulti?: boolean | undefined;
41
+ cacheOptions?: boolean | undefined;
42
+ size?: import("../../../..").columns | undefined;
43
+ loadOptions?: ((newValue: string) => void) | undefined;
44
+ onChange?: ((newValue: any, actionMeta: import("react-select").ActionMeta<any>) => void) | undefined;
45
+ }>;
46
+ };
47
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { FilterGroupSelect as Wrapper } from './filter-group';
2
+ import { FilterAsyncSelect as Select } from './filter-async-select';
3
+ export const Group = {
4
+ Wrapper,
5
+ Select
6
+ };
@@ -1,10 +1,13 @@
1
1
  import React from 'react';
2
2
  import { ActionMeta, OnChangeValue } from 'react-select';
3
+ import { columns } from '../../../atoms/col';
3
4
  declare type Option = {
4
5
  label: string | number;
5
6
  value: string | number;
6
7
  };
7
8
  declare type FilterAsyncSelectProps = {
9
+ label?: string;
10
+ message?: string;
8
11
  name: string;
9
12
  placeholder: string;
10
13
  options?: Option[];
@@ -17,6 +20,7 @@ declare type FilterAsyncSelectProps = {
17
20
  isSearchable?: boolean;
18
21
  isMulti?: boolean;
19
22
  cacheOptions?: boolean;
23
+ size?: columns;
20
24
  loadOptions?: (newValue: string) => void;
21
25
  onChange?: (newValue: OnChangeValue<any, any>, actionMeta: ActionMeta<any>) => void;
22
26
  };
@@ -25,7 +25,7 @@ const getValue = (value, options) => {
25
25
  return getValueInOption(options, (value.value).toString());
26
26
  };
27
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;
28
+ const { label, message, options = [], defaultOptions = [], name, id = name, value = undefined, placeholder, isDisabled = false, isLoading = false, isClearable = false, isSearchable = true, isMulti = false, cacheOptions = false, loadOptions, onChange } = props;
29
29
  const newValue = getValue(value, options);
30
30
  const handleChange = React.useCallback((event, action) => {
31
31
  if (onChange) {
@@ -41,9 +41,8 @@ export const FilterAsyncSelect = (props) => {
41
41
  }, action);
42
42
  }
43
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 })));
44
+ return (React.createElement("div", { className: "form-group label-margin" },
45
+ Boolean(label) && React.createElement("label", { className: "form-label new-label", htmlFor: name }, label),
46
+ 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 }),
47
+ Boolean(message) && React.createElement("label", { className: "form-label new-message", htmlFor: name }, message)));
49
48
  };
@@ -1,6 +1,9 @@
1
1
  import React from 'react';
2
2
  import { SupportedDateFormat, SupportedLanguages } from '../../../atoms/input-datepicker';
3
+ import { columns } from '../../../atoms/col';
3
4
  declare type FilterDatepickerProps = {
5
+ label?: string;
6
+ message?: string;
4
7
  name: string;
5
8
  id?: string;
6
9
  value?: string;
@@ -12,6 +15,7 @@ declare type FilterDatepickerProps = {
12
15
  onChange?: (name: string, value: string) => void;
13
16
  onBlur?: (name: string, value: string) => void;
14
17
  currentValue?: string;
18
+ size?: columns;
15
19
  };
16
20
  export declare const FilterDatepicker: React.FC<FilterDatepickerProps>;
17
21
  export {};
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { InputDatepicker } from '../../../atoms/input-datepicker';
3
3
  export const FilterDatepicker = (props) => {
4
- const { name, id = name, value = '', placeholder, minDate, maxDate, onChange, onBlur, currentValue } = props;
4
+ const { label, message, name, id = name, value = '', minDate, maxDate, onChange, onBlur, currentValue } = props;
5
5
  const handleChange = (name, value) => {
6
6
  if (onChange) {
7
7
  onChange(name, value);
@@ -12,9 +12,8 @@ export const FilterDatepicker = (props) => {
12
12
  onBlur(name, value);
13
13
  }
14
14
  };
15
- return (React.createElement("div", { className: "form-group" },
16
- Boolean(placeholder) && React.createElement("label", { className: "form-label", htmlFor: name },
17
- placeholder,
18
- ":"),
19
- React.createElement(InputDatepicker, { ...props, value: value || currentValue || '', id: id, minDate: minDate, maxDate: maxDate, onChange: handleChange, onBlur: handleBlur })));
15
+ return (React.createElement("div", { className: "form-group label-margin" },
16
+ Boolean(label) && React.createElement("label", { className: "form-label new-label", htmlFor: name }, label),
17
+ React.createElement(InputDatepicker, { ...props, value: value || currentValue || '', id: id, minDate: minDate, maxDate: maxDate, onChange: handleChange, onBlur: handleBlur }),
18
+ Boolean(message) && React.createElement("label", { className: "form-label new-message", htmlFor: name }, message)));
20
19
  };
@@ -1,9 +1,13 @@
1
1
  import React from 'react';
2
+ import { columns } from '../../../atoms/col';
2
3
  declare type FilterInputProps = (React.InputHTMLAttributes<HTMLInputElement>) & {
4
+ label?: string;
5
+ message?: string;
3
6
  name: string;
4
7
  placeholder: string;
5
8
  mask?: string | Array<string | RegExp>;
6
9
  multiple?: boolean;
10
+ size?: columns;
7
11
  };
8
12
  export declare const FilterInput: React.FC<FilterInputProps>;
9
13
  export {};
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import classNames from 'classnames';
3
3
  import InputMask from 'react-input-mask';
4
4
  export const FilterInput = (props) => {
5
- const { name, className, id = name, mask, value, placeholder, ...elements } = props;
5
+ const { label, message, name, className, id = name, mask, value, placeholder, ...elements } = props;
6
6
  const validOptions = {
7
7
  alt: elements.alt,
8
8
  autoComplete: elements.autoComplete,
@@ -23,15 +23,13 @@ export const FilterInput = (props) => {
23
23
  onChange: props.onChange
24
24
  };
25
25
  if (mask) {
26
- return (React.createElement("div", { className: "form-group" },
27
- Boolean(placeholder) && React.createElement("label", { className: "form-label", htmlFor: name },
28
- placeholder,
29
- ":"),
30
- React.createElement(InputMask, { mask: mask, ...attrs })));
26
+ return (React.createElement("div", { className: "form-group label-margin" },
27
+ Boolean(label) && React.createElement("label", { className: "form-label new-label", htmlFor: name }, label),
28
+ React.createElement(InputMask, { mask: mask, ...attrs }),
29
+ Boolean(message) && React.createElement("label", { className: "form-label new-message", htmlFor: name }, message)));
31
30
  }
32
- return (React.createElement("div", { className: "form-group" },
33
- Boolean(placeholder) && React.createElement("label", { className: "form-label", htmlFor: name },
34
- placeholder,
35
- ":"),
36
- React.createElement("input", { ...attrs })));
31
+ return (React.createElement("div", { className: "form-group label-margin" },
32
+ Boolean(label) && React.createElement("label", { className: "form-label new-label", htmlFor: name }, label),
33
+ React.createElement("input", { ...attrs }),
34
+ Boolean(message) && React.createElement("label", { className: "form-label new-message", htmlFor: name }, message)));
37
35
  };
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { ActionMeta, OnChangeValue } from 'react-select';
3
+ import { columns } from '../../../atoms/col';
3
4
  interface Options {
4
5
  label: string;
5
6
  value: number | string;
@@ -9,6 +10,8 @@ export interface GroupedOptions {
9
10
  options: Options[];
10
11
  }
11
12
  declare type FilterSelectProps = {
13
+ label?: string;
14
+ message?: string;
12
15
  name: string;
13
16
  placeholder: string;
14
17
  groupedOptions?: GroupedOptions[];
@@ -19,6 +22,7 @@ declare type FilterSelectProps = {
19
22
  isClearable?: boolean;
20
23
  isSearchable?: boolean;
21
24
  isMulti?: boolean;
25
+ size?: columns;
22
26
  onChange?: (newValue: OnChangeValue<any, any>, actionMeta: ActionMeta<any>) => void;
23
27
  };
24
28
  export declare const FilterSelectGroup: React.FC<FilterSelectProps>;
@@ -27,7 +27,7 @@ const getValue = (value, options) => {
27
27
  return getValueInOption(options, (value.value).toString());
28
28
  };
29
29
  export const FilterSelectGroup = (props) => {
30
- const { groupedOptions = [], name, id = name, placeholder, isDisabled = false, isLoading = false, isClearable = false, isSearchable = true, value = undefined, onChange } = props;
30
+ const { label, message, groupedOptions = [], name, id = name, placeholder, isDisabled = false, isLoading = false, isClearable = false, isSearchable = true, value = undefined, onChange } = props;
31
31
  const newValue = getValue(value, groupedOptions);
32
32
  const handleChange = React.useCallback((event, action) => {
33
33
  if (onChange) {
@@ -43,9 +43,8 @@ export const FilterSelectGroup = (props) => {
43
43
  }, action);
44
44
  }
45
45
  }, []);
46
- return (React.createElement("div", { className: "form-group" },
47
- Boolean(placeholder) && React.createElement("label", { className: "form-label", htmlFor: name },
48
- placeholder,
49
- ":"),
50
- React.createElement(ReactSelect, { placeholder: placeholder, className: "form-builder-select", classNamePrefix: "form-builder", options: groupedOptions, name: name, id: id, defaultValue: newValue, isDisabled: isDisabled, isLoading: isLoading, isClearable: isClearable, isSearchable: isSearchable, onChange: handleChange })));
46
+ return (React.createElement("div", { className: "form-group label-margin" },
47
+ Boolean(label) && React.createElement("label", { className: "form-label new-label", htmlFor: name }, label),
48
+ React.createElement(ReactSelect, { placeholder: placeholder, className: "form-builder-select", classNamePrefix: "form-builder", options: groupedOptions, name: name, id: id, defaultValue: newValue, isDisabled: isDisabled, isLoading: isLoading, isClearable: isClearable, isSearchable: isSearchable, onChange: handleChange }),
49
+ Boolean(message) && React.createElement("label", { className: "form-label new-message", htmlFor: name }, message)));
51
50
  };
@@ -1,10 +1,13 @@
1
1
  import React from 'react';
2
2
  import { ActionMeta, OnChangeValue } from 'react-select';
3
+ import { columns } from '../../../atoms/col';
3
4
  declare type Option = {
4
5
  label: string | number;
5
6
  value: string | number;
6
7
  };
7
8
  declare type FilterSelectProps = {
9
+ label?: string;
10
+ message?: string;
8
11
  name: string;
9
12
  placeholder: string;
10
13
  options?: Option[];
@@ -15,6 +18,7 @@ declare type FilterSelectProps = {
15
18
  isClearable?: boolean;
16
19
  isSearchable?: boolean;
17
20
  isMulti?: boolean;
21
+ size?: columns;
18
22
  onChange?: (newValue: OnChangeValue<any, any>, actionMeta: ActionMeta<any>) => void;
19
23
  };
20
24
  export declare const FilterSelect: React.FC<FilterSelectProps>;
@@ -25,7 +25,7 @@ const getValue = (value, options) => {
25
25
  return getValueInOption(options, (value.value).toString());
26
26
  };
27
27
  export const FilterSelect = (props) => {
28
- const { options = [], name, id = name, value = undefined, placeholder, isDisabled = false, isLoading = false, isClearable = false, isSearchable = true, isMulti = false, onChange } = props;
28
+ const { label, message, options = [], name, id = name, value = undefined, placeholder, isDisabled = false, isLoading = false, isClearable = false, isSearchable = true, isMulti = false, onChange } = props;
29
29
  const newValue = getValue(value, options);
30
30
  const handleChange = React.useCallback((event, action) => {
31
31
  if (onChange) {
@@ -41,9 +41,8 @@ export const FilterSelect = (props) => {
41
41
  }, action);
42
42
  }
43
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(ReactSelect, { placeholder: placeholder, className: "form-builder-select", classNamePrefix: "form-builder", options: options, name: name, id: id, defaultValue: newValue, isDisabled: isDisabled, isLoading: isLoading, isClearable: isClearable, isSearchable: isSearchable, isMulti: isMulti, onChange: handleChange })));
44
+ return (React.createElement("div", { className: "form-group label-margin" },
45
+ Boolean(label) && React.createElement("label", { className: "form-label new-label", htmlFor: name }, label),
46
+ React.createElement(ReactSelect, { placeholder: placeholder, className: "form-builder-select", classNamePrefix: "form-builder", options: options, name: name, id: id, defaultValue: newValue, isDisabled: isDisabled, isLoading: isLoading, isClearable: isClearable, isSearchable: isSearchable, isMulti: isMulti, onChange: handleChange }),
47
+ Boolean(message) && React.createElement("label", { className: "form-label new-message", htmlFor: name }, message)));
49
48
  };
@@ -1,3 +1,4 @@
1
+ export { Group as FilterAsyncGroup } from './filter-async-select-group';
1
2
  export { FilterInput as Input } from './filter-input';
2
3
  export { FilterSelect as Select } from './filter-select';
3
4
  export { FilterAsyncSelect as AsyncSelect } from './filter-async-select';
@@ -1,3 +1,4 @@
1
+ export { Group as FilterAsyncGroup } from './filter-async-select-group';
1
2
  export { FilterInput as Input } from './filter-input';
2
3
  export { FilterSelect as Select } from './filter-select';
3
4
  export { FilterAsyncSelect as AsyncSelect } from './filter-async-select';
@@ -1,10 +1,14 @@
1
1
  import React from 'react';
2
- declare type Props = {
2
+ import { columns } from '../../atoms/col';
3
+ export declare type PageListFiltersProps = {
3
4
  children: React.ReactNode;
5
+ filterSize?: columns;
6
+ filterClassName?: string;
7
+ numFiltersVisible?: number;
8
+ filterLabel?: boolean;
4
9
  };
5
10
  export declare const PageListFilters: {
6
- ({ children }: Props): JSX.Element;
11
+ ({ children }: PageListFiltersProps): JSX.Element;
7
12
  displayName: string;
8
13
  };
9
- export {};
10
14
  //# sourceMappingURL=page-list-filters.d.ts.map
@@ -1,14 +1,19 @@
1
1
  import React from 'react';
2
+ import { columns } from '../../atoms/col';
3
+ import { PageListFiltersProps } from './page-list-filters';
2
4
  declare type PageListGetFiltersProps = {
3
5
  children?: React.ReactNode;
4
- filterList: any;
6
+ filterList: {
7
+ props: PageListFiltersProps;
8
+ };
5
9
  search: any;
6
10
  filter?: {
7
11
  filterLabel?: string;
8
12
  submitLabel?: string;
9
13
  clearLabel?: string;
14
+ numFiltersVisible?: number;
15
+ filterSize?: columns;
10
16
  };
11
- numFiltersVisible?: number;
12
17
  };
13
18
  export declare type ConfigItemProps = {
14
19
  label: string;
@@ -17,12 +17,13 @@ const setValue = (element, value) => {
17
17
  };
18
18
  };
19
19
  export const PageListGetFilters = (props) => {
20
- const { children, numFiltersVisible = 2, filterList, search, filter = {
20
+ const { children, filterList, search, filter = {
21
21
  filterLabel: 'Filters',
22
22
  submitLabel: 'Filter',
23
23
  clearLabel: 'Clear'
24
24
  } } = props;
25
- const filters = filterList === null || filterList === void 0 ? void 0 : filterList.props.children;
25
+ const { children: filterChildren, filterLabel, filterSize, filterClassName, numFiltersVisible = 2 } = filterList === null || filterList === void 0 ? void 0 : filterList.props;
26
+ const filters = filterChildren;
26
27
  if (!filterList)
27
28
  return null;
28
29
  const visible = Array.isArray(filters) ? filters.slice(0, numFiltersVisible) : [filters];
@@ -33,10 +34,13 @@ export const PageListGetFilters = (props) => {
33
34
  return (React.createElement(React.Fragment, null,
34
35
  React.createElement(FilterForm, { search: search },
35
36
  React.createElement(Row, null,
36
- visible.map((element, index) => (React.createElement(Col, { size: [12, 6, 4, 3], key: JSON.stringify({ index, props: element === null || element === void 0 ? void 0 : element.props }), className: "mb-3" }, setValue(element, search[element.props.name])))),
37
- React.createElement(Col, { className: "" },
38
- React.createElement("div", { className: "form-group", id: "btns-filter" },
39
- React.createElement("label", { className: "form-label", htmlFor: "btns-filter" }, "\u00A0"),
37
+ visible.map((element, index) => {
38
+ var _a, _b;
39
+ return (React.createElement(Col, { size: ((_a = element === null || element === void 0 ? void 0 : element.props) === null || _a === void 0 ? void 0 : _a.size) || [12, 6, 4, 3], key: `${index}-${(_b = element === null || element === void 0 ? void 0 : element.props) === null || _b === void 0 ? void 0 : _b.name}`, className: "mb-3" }, setValue(element, search[element.props.name])));
40
+ }),
41
+ React.createElement(Col, { className: filterClassName, size: filterSize },
42
+ React.createElement("div", { className: "form-group label-margin", id: "btns-filter" },
43
+ Boolean(filterLabel) && React.createElement("label", { className: "form-label new-label", htmlFor: "btns-filter" }, "\u00A0"),
40
44
  React.createElement("div", null,
41
45
  React.createElement(ButtonFilter, { submitLabel: filter.submitLabel, className: "me-3" }),
42
46
  React.createElement(ButtonFilterClear, { clearLabel: filter.clearLabel, className: "me-3", search: search }),
@@ -47,8 +51,8 @@ export const PageListGetFilters = (props) => {
47
51
  React.createElement(Button, { color: "primary", onClick: () => setShowFilter(prev => !prev), small: true },
48
52
  React.createElement(Icon, { icon: "fa-delete", pluxee: true }))),
49
53
  React.createElement("div", { className: "content-aside-filter" }, hidden.map((element, index) => {
50
- var _a;
51
- return (React.createElement("div", { key: `visible-child-${JSON.stringify({ index: index + numFiltersVisible, props: element === null || element === void 0 ? void 0 : element.props })}`, className: hidden.length === (index + 1) ? '' : 'mb-3' }, ((_a = element.props) === null || _a === void 0 ? void 0 : _a.name) && setValue(element, search[element.props.name])));
54
+ var _a, _b;
55
+ return (React.createElement("div", { key: `visible-child-${index + numFiltersVisible}-${(_a = element === null || element === void 0 ? void 0 : element.props) === null || _a === void 0 ? void 0 : _a.name}`, className: hidden.length === (index + 1) ? '' : 'mb-3' }, ((_b = element.props) === null || _b === void 0 ? void 0 : _b.name) && setValue(element, search[element.props.name])));
52
56
  })),
53
57
  React.createElement("div", { className: `pt-3 text-center ${showFilter ? 'd-block' : 'd-none'}` },
54
58
  React.createElement(ButtonFilter, { submitLabel: filter.submitLabel, className: "me-3" }),
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ export declare type PageListHeaderProps = {
3
+ children: React.ReactNode;
4
+ };
5
+ export declare const PageListHeader: {
6
+ ({ children }: PageListHeaderProps): JSX.Element;
7
+ displayName: string;
8
+ };
9
+ //# sourceMappingURL=page-list-header.d.ts.map
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export const PageListHeader = ({ children }) => {
3
+ return (React.createElement(React.Fragment, null, children));
4
+ };
5
+ PageListHeader.displayName = 'PageListHeader';
@@ -16,9 +16,10 @@ export const PageList = (props) => {
16
16
  const totalRecords = (meta === null || meta === void 0 ? void 0 : meta.to) ? (meta.to - meta.from) + 1 : 0;
17
17
  const history = useLocation();
18
18
  const search = uriHelper.parse(history.search);
19
+ const header = Array.isArray(children) ? children.find(child => { var _a; return typeof child.type !== 'string' && ((_a = child.type) === null || _a === void 0 ? void 0 : _a.displayName) === 'PageListHeader'; }) : null;
19
20
  const filterList = Array.isArray(children) ? children.find(child => { var _a; return typeof child.type !== 'string' && ((_a = child.type) === null || _a === void 0 ? void 0 : _a.displayName) === 'PageListFilters'; }) : null;
20
21
  const configList = Array.isArray(children) ? children.find(child => { var _a; return typeof child.type !== 'string' && ((_a = child.type) === null || _a === void 0 ? void 0 : _a.displayName) === 'PageListConfigDropdown'; }) : null;
21
- const restList = Array.isArray(children) ? children === null || children === void 0 ? void 0 : children.filter(child => child !== filterList && child !== configList) : children;
22
+ const restList = Array.isArray(children) ? children === null || children === void 0 ? void 0 : children.filter(child => child !== filterList && child !== configList && child !== header) : children;
22
23
  if (loading) {
23
24
  return (React.createElement("div", { className: "my-5" },
24
25
  React.createElement(Spinner, null)));
@@ -41,6 +42,7 @@ export const PageList = (props) => {
41
42
  addButton.label,
42
43
  React.createElement(Icon, { icon: "fa-plus", pluxee: true, className: "ms-1" }))),
43
44
  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 })))))),
45
+ Boolean(header) && header,
44
46
  !!customizeFilter && customizeFilter,
45
47
  !customizeFilter && filterList && (React.createElement(PageListGetFilters, { filterList: filterList, search: search, filter: filter, key: JSON.stringify(history) }, configList)),
46
48
  React.createElement("div", null, restList),