@devtron-labs/devtron-fe-common-lib 0.6.3 → 0.6.4-beta-1

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 (28) hide show
  1. package/dist/Common/Hooks/useUrlFilters/types.d.ts +1 -0
  2. package/dist/Common/Hooks/useUrlFilters/useUrlFilters.d.ts +1 -1
  3. package/dist/Common/Hooks/useUrlFilters/utils.d.ts +1 -0
  4. package/dist/Common/SortableTableHeaderCell/SortableTableHeaderCell.d.ts +18 -1
  5. package/dist/Common/SortableTableHeaderCell/constants.d.ts +2 -0
  6. package/dist/Common/SortableTableHeaderCell/index.d.ts +1 -0
  7. package/dist/Common/SortableTableHeaderCell/types.d.ts +49 -16
  8. package/dist/Common/SortableTableHeaderCell/useResizableTableConfig.d.ts +6 -0
  9. package/dist/Shared/Components/SelectPicker/type.d.ts +1 -1
  10. package/dist/assets/index.css +1 -1
  11. package/dist/{cssMode-D7UJNzFf.js → cssMode-BZmMhZO4.js} +1 -1
  12. package/dist/{freemarker2-B9TV79rn.js → freemarker2-Dg4LON6e.js} +1 -1
  13. package/dist/{handlebars-R9-MToAx.js → handlebars-C02i9dqm.js} +1 -1
  14. package/dist/{html-izC5sZFT.js → html-BXqpJgiX.js} +1 -1
  15. package/dist/{htmlMode-BnGQPUNP.js → htmlMode-S00XxqHa.js} +1 -1
  16. package/dist/{index-mQBrLW_P.js → index-Dgi-Oljz.js} +10599 -10544
  17. package/dist/index.js +26 -25
  18. package/dist/{javascript-bwYez1s6.js → javascript-CC9AXXzB.js} +1 -1
  19. package/dist/{jsonMode-BnuobPu6.js → jsonMode-DyjnH0Nq.js} +1 -1
  20. package/dist/{liquid-DhKncEIb.js → liquid-BWyc-pKR.js} +1 -1
  21. package/dist/{mdx-UaB8vbXI.js → mdx-CC_Wk6C8.js} +1 -1
  22. package/dist/{python-COqivIk3.js → python-DAEiqIkD.js} +1 -1
  23. package/dist/{razor-CBZPPrOW.js → razor-BZ3YRVOO.js} +1 -1
  24. package/dist/{tsMode-DR4P1U0G.js → tsMode-3p--9U7n.js} +1 -1
  25. package/dist/{typescript-Ulf2zjMt.js → typescript-BnRXR0Wa.js} +1 -1
  26. package/dist/{xml-BgcDeobr.js → xml-ihdlUEvC.js} +1 -1
  27. package/dist/{yaml-CpVBLbDq.js → yaml-PrSP5enT.js} +1 -1
  28. package/package.json +1 -1
@@ -8,6 +8,7 @@ export interface UseUrlFiltersProps<T, K> {
8
8
  * Callback function for parsing the search params
9
9
  */
10
10
  parseSearchParams?: (searchParams: URLSearchParams) => K;
11
+ localStorageKey?: `${string}__${string}`;
11
12
  }
12
13
  export type UseUrlFiltersReturnType<T, K = unknown> = K & {
13
14
  /**
@@ -16,5 +16,5 @@ import { UseUrlFiltersProps, UseUrlFiltersReturnType } from './types';
16
16
  * ```
17
17
  *
18
18
  */
19
- declare const useUrlFilters: <T = string, K = unknown>({ initialSortKey, parseSearchParams, }?: UseUrlFiltersProps<T, K>) => UseUrlFiltersReturnType<T, K>;
19
+ declare const useUrlFilters: <T = string, K = unknown>({ initialSortKey, parseSearchParams, localStorageKey, }?: UseUrlFiltersProps<T, K>) => UseUrlFiltersReturnType<T, K>;
20
20
  export default useUrlFilters;
@@ -0,0 +1 @@
1
+ export declare const setItemInLocalStorageIfKeyExists: (localStorageKey: string, value: string) => void;
@@ -12,6 +12,23 @@ import { SortableTableHeaderCellProps } from './types';
12
12
  * disabled={isDisabled}
13
13
  * />
14
14
  * ```
15
+ *
16
+ * @example Non-sortable cell
17
+ * ```tsx
18
+ * <SortableTableHeaderCell
19
+ * isSortable={false}
20
+ * title="Header Cell"
21
+ * />
22
+ * ```
23
+ *
24
+ * * @example Resizable cell (Layout to be controlled externally using useResizableTableConfig)
25
+ * ```tsx
26
+ * <SortableTableHeaderCell
27
+ * isSortable={false}
28
+ * isResizable
29
+ * title="Header Cell"
30
+ * />
31
+ * ```
15
32
  */
16
- declare const SortableTableHeaderCell: ({ isSorted, triggerSorting, sortOrder, title, disabled, isSortable, showTippyOnTruncate, }: SortableTableHeaderCellProps) => JSX.Element;
33
+ declare const SortableTableHeaderCell: ({ isSorted, triggerSorting, sortOrder, title, disabled, isSortable, showTippyOnTruncate, id, handleResize, isResizable, }: SortableTableHeaderCellProps) => JSX.Element;
17
34
  export default SortableTableHeaderCell;
@@ -0,0 +1,2 @@
1
+ export declare const DEFAULT_MINIMUM_HEADER_WIDTH = 70;
2
+ export declare const DEFAULT_MAXIMUM_HEADER_WIDTH = 600;
@@ -1,2 +1,3 @@
1
1
  export { default as SortableTableHeaderCell } from './SortableTableHeaderCell';
2
+ export { default as useResizableTableConfig } from './useResizableTableConfig';
2
3
  export type { SortableTableHeaderCellProps } from './types';
@@ -1,35 +1,68 @@
1
1
  import { SortingOrder } from '../Constants';
2
- export interface SortableTableHeaderCellProps {
2
+ export type SortableTableHeaderCellProps = {
3
3
  /**
4
- * If true, the cell is sorted
4
+ * Label for the cell
5
5
  */
6
- isSorted: boolean;
6
+ title: string;
7
7
  /**
8
- * Callback for handling the sorting of the cell
8
+ * If true, the tippy is shown on Sortable header if text is truncated
9
+ * @default false
9
10
  */
10
- triggerSorting: () => void;
11
+ showTippyOnTruncate?: boolean;
12
+ } & ({
11
13
  /**
12
- * Current sort order
14
+ * Unique identifier for the column
15
+ */
16
+ id: string | number;
17
+ /**
18
+ * If true, the cell is resizable
13
19
  *
14
- * Note: On click, the sort order should be updated as required
20
+ * @default false
15
21
  */
16
- sortOrder: SortingOrder;
22
+ isResizable: true | boolean;
17
23
  /**
18
- * Label for the cell
24
+ * Resize handler for the table
19
25
  */
20
- title: string;
26
+ handleResize: (id: string | number, deltaChange: number) => void;
27
+ } | {
28
+ id?: never;
29
+ isResizable?: false | undefined;
30
+ handleResize?: never;
31
+ }) & ({
32
+ /**
33
+ * If false, the cell acts like normal table header cell
34
+ * @default true
35
+ */
36
+ isSortable?: boolean | undefined;
21
37
  /**
22
38
  * If true, the cell is disabled
23
39
  */
24
40
  disabled: boolean;
25
41
  /**
26
- * If false, the cell acts like normal table header cell
27
- * @default true
42
+ * If true, the cell is sorted
28
43
  */
29
- isSortable?: boolean;
44
+ isSorted: boolean;
30
45
  /**
31
- * If true, the tippy is shown on Sortable header if text is truncated
32
- * @default false
46
+ * Callback for handling the sorting of the cell
33
47
  */
34
- showTippyOnTruncate?: boolean;
48
+ triggerSorting: () => void;
49
+ /**
50
+ * Current sort order
51
+ *
52
+ * Note: On click, the sort order should be updated as required
53
+ */
54
+ sortOrder: SortingOrder;
55
+ } | {
56
+ isSortable: false;
57
+ disabled?: never;
58
+ isSorted?: never;
59
+ triggerSorting?: never;
60
+ sortOrder?: never;
61
+ });
62
+ export interface UseResizableTableConfigProps {
63
+ headersConfig: (Pick<SortableTableHeaderCellProps, 'id'> & {
64
+ width: number | string;
65
+ maxWidth?: number;
66
+ minWidth?: number;
67
+ })[];
35
68
  }
@@ -0,0 +1,6 @@
1
+ import { UseResizableTableConfigProps } from './types';
2
+ declare const useResizableTableConfig: ({ headersConfig }: UseResizableTableConfigProps) => {
3
+ gridTemplateColumns: string;
4
+ handleResize: (headerCellId: UseResizableTableConfigProps["headersConfig"][number]["id"], deltaChange: number) => void;
5
+ };
6
+ export default useResizableTableConfig;
@@ -168,7 +168,7 @@ export type SelectPickerProps<OptionValue = number | string, IsMulti extends boo
168
168
  export type SelectPickerGroupHeadingProps<OptionValue> = GroupHeadingProps<SelectPickerOptionType<OptionValue>> & {
169
169
  isGroupHeadingSelectable: boolean;
170
170
  };
171
- export interface FilterSelectPickerProps extends Required<Pick<SelectPickerProps<number | string, true>, 'options' | 'isDisabled' | 'placeholder' | 'isLoading'>>, Pick<SelectPickerProps<number | string, true>, 'selectRef' | 'inputId' | 'menuPosition' | 'autoFocus' | 'shouldMenuAlignRight' | 'optionListError' | 'reloadOptionList'> {
171
+ export interface FilterSelectPickerProps extends Required<Pick<SelectPickerProps<number | string, true>, 'options' | 'isDisabled' | 'placeholder' | 'isLoading'>>, Pick<SelectPickerProps<number | string, true>, 'selectRef' | 'inputId' | 'menuPosition' | 'autoFocus' | 'shouldMenuAlignRight' | 'optionListError' | 'reloadOptionList' | 'isOptionDisabled'> {
172
172
  appliedFilterOptions: SelectPickerOptionType[];
173
173
  handleApplyFilter: (filtersToApply: SelectPickerOptionType<number | string>[]) => void;
174
174
  }