@dilicorp/ui 0.0.75 → 0.0.76
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-select-group.d.ts +26 -0
- package/dist/components/page-list/filters/filter-select-group.d.ts.map +1 -0
- package/dist/components/page-list/filters/filter-select-group.js +24 -0
- package/dist/components/page-list/filters/index.d.ts +1 -0
- package/dist/components/page-list/filters/index.d.ts.map +1 -1
- package/dist/components/page-list/filters/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ActionMeta, OnChangeValue } from 'react-select';
|
|
3
|
+
interface Options {
|
|
4
|
+
label: string;
|
|
5
|
+
value: number | string;
|
|
6
|
+
}
|
|
7
|
+
export interface GroupedOptions {
|
|
8
|
+
label: string;
|
|
9
|
+
options: Options[];
|
|
10
|
+
}
|
|
11
|
+
declare type FilterSelectProps = {
|
|
12
|
+
name: string;
|
|
13
|
+
placeholder: string;
|
|
14
|
+
groupedOptions?: GroupedOptions[];
|
|
15
|
+
id?: string;
|
|
16
|
+
value?: string | GroupedOptions | GroupedOptions[];
|
|
17
|
+
isDisabled?: boolean;
|
|
18
|
+
isLoading?: boolean;
|
|
19
|
+
isClearable?: boolean;
|
|
20
|
+
isSearchable?: boolean;
|
|
21
|
+
isMulti?: boolean;
|
|
22
|
+
onChange?: (newValue: OnChangeValue<any, any>, actionMeta: ActionMeta<any>) => void;
|
|
23
|
+
};
|
|
24
|
+
export declare const FilterSelectGroup: React.FC<FilterSelectProps>;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=filter-select-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter-select-group.d.ts","sourceRoot":"","sources":["../../../../src/components/page-list/filters/filter-select-group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAoB,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAErE,UAAU,OAAO;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,EAAE,CAAA;CACnB;AAED,aAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,cAAc,EAAE,CAAA;IACjC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,GAAC,cAAc,GAAC,cAAc,EAAE,CAAA;IAC9C,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;AAED,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA8CzD,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ReactSelect from 'react-select';
|
|
3
|
+
export const FilterSelectGroup = (props) => {
|
|
4
|
+
const { groupedOptions = [], name, id = name, placeholder, isDisabled = false, isLoading = false, isClearable = false, isSearchable = true, 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" },
|
|
20
|
+
Boolean(placeholder) && React.createElement("label", { className: "form-label", htmlFor: name },
|
|
21
|
+
placeholder,
|
|
22
|
+
":"),
|
|
23
|
+
React.createElement(ReactSelect, { placeholder: placeholder, className: "form-builder-select", classNamePrefix: "form-builder", options: groupedOptions, name: name, id: id, isDisabled: isDisabled, isLoading: isLoading, isClearable: isClearable, isSearchable: isSearchable, onChange: handleChange })));
|
|
24
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { FilterInput as Input } from './filter-input';
|
|
2
2
|
export { FilterSelect as Select } from './filter-select';
|
|
3
|
+
export { FilterSelectGroup as SelectGroup } from './filter-select-group';
|
|
3
4
|
export { FilterDatepicker as Datepicker } from './filter-datepicker';
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/page-list/filters/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,EAAE,YAAY,IAAI,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,gBAAgB,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/page-list/filters/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,EAAE,YAAY,IAAI,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,iBAAiB,IAAI,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxE,OAAO,EAAE,gBAAgB,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAA"}
|