@dilicorp/ui 0.0.49 → 0.0.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/page-list/filters/filter-input.d.ts +1 -1
- package/dist/components/page-list/filters/filter-input.d.ts.map +1 -1
- package/dist/components/page-list/filters/filter-input.js +3 -4
- package/dist/components/page-list/filters/filter-select.d.ts +2 -0
- package/dist/components/page-list/filters/filter-select.d.ts.map +1 -1
- package/dist/components/page-list/filters/filter-select.js +16 -2
- package/dist/components/page-list/page-list-filters.d.ts +5 -2
- package/dist/components/page-list/page-list-filters.d.ts.map +1 -1
- package/dist/components/page-list/page-list-get-filters.d.ts.map +1 -1
- package/dist/components/page-list/page-list-get-filters.js +2 -2
- package/dist/components/page-list/page-list.d.ts +1 -1
- package/dist/components/page-list/page-list.d.ts.map +1 -1
- package/dist/components/page-list/page-list.js +2 -1
- package/package.json +2 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare type FilterInputProps = React.InputHTMLAttributes<HTMLInputElement> & {
|
|
2
|
+
declare type FilterInputProps = (React.InputHTMLAttributes<HTMLInputElement>) & {
|
|
3
3
|
name: string;
|
|
4
4
|
placeholder: string;
|
|
5
5
|
mask?: string | Array<string | RegExp>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-input.d.ts","sourceRoot":"","sources":["../../../../src/components/page-list/filters/filter-input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,aAAK,gBAAgB,GAAG,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,GAAG;
|
|
1
|
+
{"version":3,"file":"filter-input.d.ts","sourceRoot":"","sources":["../../../../src/components/page-list/filters/filter-input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,aAAK,gBAAgB,GAAG,CACtB,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC,GAAG;IAC/C,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,GAAC,KAAK,CAAC,MAAM,GAAC,MAAM,CAAC,CAAA;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAmDlD,CAAA"}
|
|
@@ -13,7 +13,7 @@ import React from 'react';
|
|
|
13
13
|
import classNames from 'classnames';
|
|
14
14
|
import InputMask from 'react-input-mask';
|
|
15
15
|
export const FilterInput = (props) => {
|
|
16
|
-
const { name, className, id = name,
|
|
16
|
+
const { name, className, id = name, mask, value, placeholder } = props, elements = __rest(props, ["name", "className", "id", "mask", "value", "placeholder"]);
|
|
17
17
|
const validOptions = {
|
|
18
18
|
alt: elements.alt,
|
|
19
19
|
autoComplete: elements.autoComplete,
|
|
@@ -25,7 +25,7 @@ export const FilterInput = (props) => {
|
|
|
25
25
|
required: elements.required
|
|
26
26
|
};
|
|
27
27
|
const classes = classNames(className, 'form-control');
|
|
28
|
-
const attrs = Object.assign(Object.assign({}, validOptions), { className: classes, name: name, id: id, defaultValue: value });
|
|
28
|
+
const attrs = Object.assign(Object.assign({}, validOptions), { className: classes, name: name, id: id, defaultValue: value, onChange: props.onChange });
|
|
29
29
|
if (mask) {
|
|
30
30
|
return (React.createElement("div", { className: "form-group" },
|
|
31
31
|
Boolean(placeholder) && React.createElement("label", { className: "form-label", htmlFor: name },
|
|
@@ -33,10 +33,9 @@ export const FilterInput = (props) => {
|
|
|
33
33
|
":"),
|
|
34
34
|
React.createElement(InputMask, Object.assign({ mask: mask }, attrs))));
|
|
35
35
|
}
|
|
36
|
-
const Tag = multiple ? 'textarea' : 'input';
|
|
37
36
|
return (React.createElement("div", { className: "form-group" },
|
|
38
37
|
Boolean(placeholder) && React.createElement("label", { className: "form-label", htmlFor: name },
|
|
39
38
|
placeholder,
|
|
40
39
|
":"),
|
|
41
|
-
React.createElement(
|
|
40
|
+
React.createElement("input", Object.assign({}, attrs))));
|
|
42
41
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { ActionMeta, OnChangeValue } from 'react-select';
|
|
2
3
|
declare type Option = {
|
|
3
4
|
label: string | number;
|
|
4
5
|
value: string | number;
|
|
@@ -14,6 +15,7 @@ declare type FilterSelectProps = {
|
|
|
14
15
|
isClearable?: boolean;
|
|
15
16
|
isSearchable?: boolean;
|
|
16
17
|
isMulti?: boolean;
|
|
18
|
+
onChange?: (newValue: OnChangeValue<any, any>, actionMeta: ActionMeta<any>) => void;
|
|
17
19
|
};
|
|
18
20
|
export declare const FilterSelect: React.FC<FilterSelectProps>;
|
|
19
21
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-select.d.ts","sourceRoot":"","sources":["../../../../src/components/page-list/filters/filter-select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"filter-select.d.ts","sourceRoot":"","sources":["../../../../src/components/page-list/filters/filter-select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAoB,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAErE,aAAK,MAAM,GAAG;IACZ,KAAK,EAAE,MAAM,GAAC,MAAM,CAAA;IACpB,KAAK,EAAE,MAAM,GAAC,MAAM,CAAA;CACrB,CAAA;AAID,aAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,GAAC,MAAM,GAAC,MAAM,EAAE,CAAA;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,UAAU,EAAE,UAAU,CAAC,GAAG,CAAC,KAAK,IAAI,CAAA;CACpF,CAAA;AA6BD,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAoDpD,CAAA"}
|
|
@@ -25,11 +25,25 @@ 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 } = props;
|
|
28
|
+
const { 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
|
+
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
|
+
}, []);
|
|
30
44
|
return (React.createElement("div", { className: "form-group" },
|
|
31
45
|
Boolean(placeholder) && React.createElement("label", { className: "form-label", htmlFor: name },
|
|
32
46
|
placeholder,
|
|
33
47
|
":"),
|
|
34
|
-
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 })));
|
|
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 })));
|
|
35
49
|
};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare type
|
|
2
|
+
declare type Props = {
|
|
3
3
|
children: React.ReactNode;
|
|
4
4
|
};
|
|
5
|
-
export declare const PageListFilters:
|
|
5
|
+
export declare const PageListFilters: {
|
|
6
|
+
({ children }: Props): JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
6
9
|
export {};
|
|
7
10
|
//# sourceMappingURL=page-list-filters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-list-filters.d.ts","sourceRoot":"","sources":["../../../src/components/page-list/page-list-filters.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,aAAK,
|
|
1
|
+
{"version":3,"file":"page-list-filters.d.ts","sourceRoot":"","sources":["../../../src/components/page-list/page-list-filters.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,aAAK,KAAK,GAAG;IACX,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,eAAe;mBAAkB,KAAK;;CAMlD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-list-get-filters.d.ts","sourceRoot":"","sources":["../../../src/components/page-list/page-list-get-filters.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAUzB,aAAK,uBAAuB,GAAG;IAC7B,UAAU,EAAE,GAAG,CAAA;IACf,MAAM,EAAE,GAAG,CAAA;IACX,MAAM,CAAC,EAAE;QACP,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,UAAU,CAAC,EAAE,MAAM,CAAA;KACpB,CAAA;IACD,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAA;AAYD,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,
|
|
1
|
+
{"version":3,"file":"page-list-get-filters.d.ts","sourceRoot":"","sources":["../../../src/components/page-list/page-list-get-filters.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAUzB,aAAK,uBAAuB,GAAG;IAC7B,UAAU,EAAE,GAAG,CAAA;IACf,MAAM,EAAE,GAAG,CAAA;IACX,MAAM,CAAC,EAAE;QACP,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,UAAU,CAAC,EAAE,MAAM,CAAA;KACpB,CAAA;IACD,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAA;AAYD,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAqEhE,CAAA"}
|
|
@@ -24,7 +24,7 @@ export const PageListGetFilters = (props) => {
|
|
|
24
24
|
const [showFilter, setShowFilter] = React.useState(false);
|
|
25
25
|
return (React.createElement(FilterForm, { search: search },
|
|
26
26
|
React.createElement(Row, null,
|
|
27
|
-
visible.map((element, index) => (React.createElement(Col, { size: [12, 6, 4, 3], key: index, className: "mb-3" }, setValue(element, search[element.props.name])))),
|
|
27
|
+
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])))),
|
|
28
28
|
React.createElement(Col, null,
|
|
29
29
|
React.createElement("div", { className: "form-group", id: "btns-filter" },
|
|
30
30
|
React.createElement("label", { className: "form-label", htmlFor: "btns-filter" }, "\u00A0"),
|
|
@@ -36,7 +36,7 @@ export const PageListGetFilters = (props) => {
|
|
|
36
36
|
React.createElement("div", { className: "mb-3 text-right" },
|
|
37
37
|
React.createElement(Button, { color: "primary", outline: showFilter, onClick: () => setShowFilter(prev => !prev), small: true },
|
|
38
38
|
React.createElement(Icon, { icon: "faTimes" }))),
|
|
39
|
-
React.createElement("div", { className: "content-aside-filter" }, hidden.map((element, index) => (React.createElement("div", { key: `visible-child-${index +
|
|
39
|
+
React.createElement("div", { className: "content-aside-filter" }, hidden.map((element, index) => (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' }, setValue(element, search[element.props.name]))))),
|
|
40
40
|
React.createElement("div", { className: `pt-3 text-center ${showFilter ? 'd-block' : 'd-none'}` },
|
|
41
41
|
React.createElement(ButtonFilter, { submitLabel: filter.submitLabel, className: "me-3" }),
|
|
42
42
|
React.createElement(ButtonFilterClear, { clearLabel: filter.clearLabel, search: search }))))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-list.d.ts","sourceRoot":"","sources":["../../../src/components/page-list/page-list.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAO1E,aAAK,QAAQ,GAAG;IACd,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,aAAK,YAAY,GAAG;IAClB,IAAI,EAAE,MAAM,GAAG;QACb,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,WAAW,CAAC,EAAE,MAAM,CAAA;KACrB,CAAC;IACF,KAAK,EAAE,aAAa,GAAC,GAAG,CAAA;CACzB,CAAA;AAED,aAAK,aAAa,GAAG;IACnB,QAAQ,EAAE,YAAY,GAAC,YAAY,EAAE,CAAA;CAC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AAC,EAAE;QACP,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,UAAU,CAAC,EAAE,MAAM,CAAA;KACpB,CAAA;IACD,IAAI,CAAC,EAAE;QACL,YAAY,EAAE,MAAM,CAAA;QACpB,QAAQ,EAAE,MAAM,CAAA;QAChB,KAAK,EAAE,MAAM,CAAA;QACb,EAAE,EAAE,MAAM,CAAA;QACV,IAAI,EAAE,MAAM,CAAA;KACb,CAAA;IACD,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA4E5C,CAAA"}
|
|
@@ -31,7 +31,8 @@ export const PageList = (props) => {
|
|
|
31
31
|
Boolean(addButton) && (React.createElement(Button, { tag: Link, href: addButton === null || addButton === void 0 ? void 0 : addButton.uri },
|
|
32
32
|
React.createElement(Icon, { icon: "faPlus", className: "me-1" }), addButton === null || addButton === void 0 ? void 0 :
|
|
33
33
|
addButton.label)))),
|
|
34
|
-
customizeFilter
|
|
34
|
+
!!customizeFilter && customizeFilter,
|
|
35
|
+
!customizeFilter && filterList && (React.createElement(PageListGetFilters, { filterList: filterList, search: search, filter: filter, key: JSON.stringify(history) })),
|
|
35
36
|
React.createElement("div", null, restList),
|
|
36
37
|
meta && React.createElement(Paginate, { activePage: meta.current_page, perPage: meta.per_page, totalItems: meta.total, currentCount: totalRecords, translate: metaTranslate })));
|
|
37
38
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dilicorp/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.51",
|
|
4
4
|
"description": "A simple UI design for Dilicorp",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -63,6 +63,7 @@
|
|
|
63
63
|
"@fortawesome/free-brands-svg-icons": "^5.15.4",
|
|
64
64
|
"@fortawesome/free-solid-svg-icons": "^5.15.4",
|
|
65
65
|
"@fortawesome/react-fontawesome": "^0.1.16",
|
|
66
|
+
"flatted": "^3.2.7",
|
|
66
67
|
"formik": "^2.2.9",
|
|
67
68
|
"react-alert": "^7.0.3",
|
|
68
69
|
"react-datepicker": "^4.3.0",
|