@databrainhq/plugin 0.9.9 → 0.9.11

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/README.md CHANGED
@@ -1,26 +1,26 @@
1
- # @databrainhq/plugin
2
-
3
- > Databrain app ui plugin.
4
-
5
- [![NPM](https://img.shields.io/npm/v/@databrainhq/plugin.svg)](https://www.npmjs.com/package/@databrainhq/plugin) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
6
-
7
- ## Install
8
-
9
- ```bash
10
- npm install @databrainhq/plugin
11
- ```
12
-
13
- ## Usage
14
-
15
- ```tsx
16
- import { Dashboard } from '@databrainhq/plugin';
17
- import '@databrainhq/plugin/dist/style.css';
18
-
19
- const Example = () => {
20
- return <Dashboard token={/* Your Guest Token */} />;
21
- };
22
- ```
23
-
24
- ## License
25
-
26
- MIT © [databrainhq](https://github.com/databrainhq)
1
+ # @databrainhq/plugin
2
+
3
+ > Databrain app ui plugin.
4
+
5
+ [![NPM](https://img.shields.io/npm/v/@databrainhq/plugin.svg)](https://www.npmjs.com/package/@databrainhq/plugin) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @databrainhq/plugin
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```tsx
16
+ import { Dashboard } from '@databrainhq/plugin';
17
+ import '@databrainhq/plugin/dist/style.css';
18
+
19
+ const Example = () => {
20
+ return <Dashboard token={/* Your Guest Token */} />;
21
+ };
22
+ ```
23
+
24
+ ## License
25
+
26
+ MIT © [databrainhq](https://github.com/databrainhq)
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ declare type Props = {
3
+ label: string;
4
+ onChange?: (option: {
5
+ startDate: Date | undefined;
6
+ endDate: Date | undefined;
7
+ timeGrainValue: string;
8
+ value: string;
9
+ } | undefined) => void;
10
+ defaultValues?: {
11
+ startDate: Date;
12
+ endDate: Date;
13
+ timeGrainValue: string;
14
+ };
15
+ };
16
+ declare const DateRangePicker: React.FC<Props>;
17
+ export default DateRangePicker;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ declare type Filter = {
3
+ as: any;
4
+ dataType: string;
5
+ name: string;
6
+ isDefault?: boolean | undefined;
7
+ };
8
+ declare type Props = {
9
+ columnList: Filter[];
10
+ setFilterList: React.Dispatch<React.SetStateAction<Filter[]>>;
11
+ filterList: Filter[];
12
+ };
13
+ declare const AddFilter: ({ columnList, filterList, setFilterList }: Props) => JSX.Element;
14
+ export default AddFilter;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { FilterFieldType } from '@/components/FilterField';
3
+ declare type AppliedFilterProps = {
4
+ appliedFilter: FilterFieldType[];
5
+ setAppliedFilters: React.Dispatch<React.SetStateAction<FilterFieldType[]>>;
6
+ onRemove: (filters: FilterFieldType[]) => void;
7
+ };
8
+ export declare const AppliedFilter: ({ appliedFilter, setAppliedFilters, onRemove, }: AppliedFilterProps) => JSX.Element;
9
+ export default AppliedFilter;
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ declare type NumberFieldProps = {
3
+ setAppliedFilters: any;
4
+ column: {
5
+ as: any;
6
+ dataType: string;
7
+ name: string;
8
+ isDefault?: boolean | undefined;
9
+ };
10
+ defaultValues?: {
11
+ min: number;
12
+ max: number;
13
+ };
14
+ };
15
+ declare const NumberFilterField: ({ setAppliedFilters, column, defaultValues, }: NumberFieldProps) => JSX.Element;
16
+ export default NumberFilterField;
@@ -10,5 +10,9 @@ declare type GlobalFiltersProps = {
10
10
  appliedfilters: any;
11
11
  setAppliedFilters: any;
12
12
  };
13
+ export declare const getFormattedFilterValue: (obj: {
14
+ operator: string;
15
+ value: any;
16
+ }) => any;
13
17
  export declare const GlobalFilters: React.FC<GlobalFiltersProps>;
14
18
  export {};
@@ -6,6 +6,7 @@ declare type Option = {
6
6
  label: string;
7
7
  };
8
8
  declare type SelectInput = {
9
+ name?: string;
9
10
  label?: string;
10
11
  value: any;
11
12
  placeHolder?: string;
@@ -16,6 +17,7 @@ declare type SelectInput = {
16
17
  className?: string;
17
18
  containerClass?: string;
18
19
  isSearchEnabled?: boolean;
20
+ icon?: JSX.Element;
19
21
  textSize?: string;
20
22
  labelVariant?: 'floating' | 'static';
21
23
  };
@@ -23,7 +25,7 @@ declare type HookSelectInput = Omit<SelectInput, 'value'> & {
23
25
  control: Control;
24
26
  name: string;
25
27
  };
26
- export declare const Select: ({ label, options, onChange, value, defaultValue, children, placeHolder, className, containerClass, isSearchEnabled, textSize, labelVariant, }: SelectInput) => JSX.Element;
28
+ export declare const Select: ({ name, label, options, onChange, value, defaultValue, children, placeHolder, className, containerClass, isSearchEnabled, textSize, icon, labelVariant, }: SelectInput) => JSX.Element;
27
29
  export declare const HookSelect: ({ control, name, ...rest }: HookSelectInput) => JSX.Element;
28
30
  export declare const SelectWithSubValue: ({ label, options, onChange, value, defaultValue, }: any) => JSX.Element;
29
31
  export declare const DropDown: ({ control, name, options, label, defaultValue, }: HookSelectInput) => JSX.Element;
@@ -33,7 +35,7 @@ declare type MultiSelectProps = {
33
35
  value?: Option['value'][];
34
36
  onChange?: (selected: Option['value'][]) => void;
35
37
  label?: string;
36
- name: string;
38
+ name?: string;
37
39
  className?: string;
38
40
  containerClass?: string;
39
41
  children?: React.ReactNode;
@@ -41,10 +43,12 @@ declare type MultiSelectProps = {
41
43
  onClick?: any;
42
44
  labelVariant?: 'floating' | 'static';
43
45
  isSearchEnabled?: boolean;
46
+ icon?: JSX.Element;
44
47
  };
45
48
  export declare const MultiSelect: React.FC<MultiSelectProps>;
46
49
  declare type HookMultiSelectProps = MultiSelectProps & {
47
50
  control: Control<FieldValues>;
51
+ name: string;
48
52
  };
49
53
  export declare const HookMultiSelect: React.FC<HookMultiSelectProps>;
50
54
  export {};
@@ -8,6 +8,9 @@ declare type Props = {
8
8
  className?: string;
9
9
  isDisabled?: boolean;
10
10
  containerClass?: string;
11
+ onChange?: (value: string) => void;
12
+ labelVariant?: 'floating' | 'static';
13
+ label?: string;
11
14
  };
12
- export declare const TimeGrainField: ({ isShowlabel, timeGrainValue, setTimeGrainValue, register, className, isDisabled, containerClass, }: Props) => JSX.Element;
15
+ export declare const TimeGrainField: ({ isShowlabel, timeGrainValue, setTimeGrainValue, register, className, isDisabled, containerClass, onChange, labelVariant, label, }: Props) => JSX.Element;
13
16
  export {};
@@ -30,3 +30,4 @@ export * from './ChartPopup';
30
30
  export * from './DrillBreadCrumb';
31
31
  export * from './MetricFilterDropDown';
32
32
  export * from './Alert';
33
+ export * from './GlobalFilters/AppliedFilter';