@dilicorp/ui 0.0.75 → 0.0.77

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.
@@ -3,6 +3,7 @@ export declare type IconProps = {
3
3
  icon: string;
4
4
  brand?: boolean;
5
5
  className?: string;
6
+ id?: string;
6
7
  };
7
- export declare const Icon: ({ icon, brand, className }: IconProps) => JSX.Element;
8
+ export declare const Icon: ({ icon, brand, className, id }: IconProps) => JSX.Element;
8
9
  //# sourceMappingURL=icon.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/atoms/icon.tsx"],"names":[],"mappings":";AAOA,oBAAY,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,IAAI,+BAAqC,SAAS,gBAK9D,CAAA"}
1
+ {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/atoms/icon.tsx"],"names":[],"mappings":";AAOA,oBAAY,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,eAAO,MAAM,IAAI,mCAAyC,SAAS,gBAKlE,CAAA"}
@@ -3,8 +3,8 @@ import * as fab from '@fortawesome/free-brands-svg-icons';
3
3
  import * as fa from '@fortawesome/free-solid-svg-icons';
4
4
  import stringHelper from '../utils/string-helper';
5
5
  import React from 'react';
6
- export const Icon = ({ icon, brand, className = '' }) => {
6
+ export const Icon = ({ icon, brand, className = '', id }) => {
7
7
  const sanitize = stringHelper.toCamelCase(icon);
8
8
  const ico = brand ? fab[sanitize] : fa[sanitize];
9
- return React.createElement(FontAwesomeIcon, { icon: ico, className: className });
9
+ return React.createElement(FontAwesomeIcon, { id: id, icon: ico, className: className });
10
10
  };
@@ -1 +1 @@
1
- {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/atoms/link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,oBAAY,SAAS,GAAG,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,GAAG,EAAE,CAAA;AAEtH,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAwBpC,CAAA"}
1
+ {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/atoms/link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,oBAAY,SAAS,GAAG,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,GAAG,EAAE,CAAA;AAEtH,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAyBpC,CAAA"}
@@ -17,7 +17,8 @@ export const Link = (props) => {
17
17
  const validOptions = {
18
18
  className: attrs.className,
19
19
  title: attrs.title,
20
- download: attrs.download
20
+ download: attrs.download,
21
+ id: attrs.id
21
22
  };
22
23
  const isLink = validationsHelper.isUrl(href);
23
24
  if (isLink) {
@@ -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"}
@@ -1,3 +1,4 @@
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';
@@ -72,7 +72,7 @@ export const SideNavigationBar = memo((props) => {
72
72
  React.createElement("div", { className: "logo" },
73
73
  Boolean(logoThumb) && React.createElement("div", { className: "logo-thumb" }, logoThumb),
74
74
  logoName && React.createElement("div", { className: "logo-name" }, logoName)),
75
- React.createElement(Icon, { icon: "fa-bars", className: "btn-sidebar" })),
75
+ React.createElement(Icon, { id: "btn-side-bar-toogle", icon: "fa-bars", className: "btn-sidebar" })),
76
76
  React.createElement("ul", { className: "nav-list" },
77
77
  items.map((item, index) => (React.createElement(SideNavigationBarItem, Object.assign({ key: `side-navigation-bar-item-${index}` }, Object.assign(Object.assign({}, item), { index }))))),
78
78
  !!(logout === null || logout === void 0 ? void 0 : logout.href) && (React.createElement(SideNavigationBarItem, Object.assign({}, {
@@ -81,6 +81,6 @@ export const SideNavigationBar = memo((props) => {
81
81
  label: logout.label || 'Logout',
82
82
  href: logout.href
83
83
  }))))),
84
- React.createElement(Icon, { icon: "fa-bars", className: "btn-sidebar-mobile" })));
84
+ React.createElement(Icon, { id: "btn-side-bar-mobile-toogle", icon: "fa-bars", className: "btn-sidebar-mobile" })));
85
85
  });
86
86
  SideNavigationBar.displayName = 'SideNavigationBar';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dilicorp/ui",
3
- "version": "0.0.75",
3
+ "version": "0.0.77",
4
4
  "description": "A simple UI design for Dilicorp",
5
5
  "repository": {
6
6
  "type": "git",