@g4rcez/components 4.1.1 → 4.1.3
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/core/button.d.ts +77 -0
- package/dist/components/core/button.d.ts.map +1 -0
- package/dist/components/core/button.jsx +79 -0
- package/dist/components/core/heading.d.ts +3 -0
- package/dist/components/core/heading.d.ts.map +1 -0
- package/dist/components/core/heading.jsx +4 -0
- package/dist/components/core/polymorph.d.ts +10 -0
- package/dist/components/core/polymorph.d.ts.map +1 -0
- package/dist/components/core/polymorph.jsx +5 -0
- package/dist/components/core/render-on-view.d.ts +7 -0
- package/dist/components/core/render-on-view.d.ts.map +1 -0
- package/dist/components/core/render-on-view.jsx +31 -0
- package/dist/components/core/resizable.d.ts +3 -0
- package/dist/components/core/resizable.d.ts.map +1 -0
- package/dist/components/core/resizable.jsx +51 -0
- package/dist/components/core/slot.d.ts +16 -0
- package/dist/components/core/slot.d.ts.map +1 -0
- package/dist/components/core/slot.jsx +156 -0
- package/dist/components/core/tag.d.ts +35 -0
- package/dist/components/core/tag.d.ts.map +1 -0
- package/dist/components/core/tag.jsx +51 -0
- package/dist/components/core/typography.d.ts +25 -0
- package/dist/components/core/typography.d.ts.map +1 -0
- package/dist/components/core/typography.jsx +18 -0
- package/dist/components/display/alert.d.ts +28 -0
- package/dist/components/display/alert.d.ts.map +1 -0
- package/dist/components/display/alert.jsx +61 -0
- package/dist/components/display/calendar.d.ts +42 -0
- package/dist/components/display/calendar.d.ts.map +1 -0
- package/dist/components/display/calendar.jsx +299 -0
- package/dist/components/display/card.d.ts +29 -0
- package/dist/components/display/card.d.ts.map +1 -0
- package/dist/components/display/card.jsx +43 -0
- package/dist/components/display/empty.d.ts +8 -0
- package/dist/components/display/empty.d.ts.map +1 -0
- package/dist/components/display/empty.jsx +11 -0
- package/dist/components/display/list.d.ts +16 -0
- package/dist/components/display/list.d.ts.map +1 -0
- package/dist/components/display/list.jsx +81 -0
- package/dist/components/display/notifications.d.ts +27 -0
- package/dist/components/display/notifications.d.ts.map +1 -0
- package/dist/components/display/notifications.jsx +126 -0
- package/dist/components/display/progress.d.ts +13 -0
- package/dist/components/display/progress.d.ts.map +1 -0
- package/dist/components/display/progress.jsx +11 -0
- package/dist/components/display/shortcut.d.ts +4 -0
- package/dist/components/display/shortcut.d.ts.map +1 -0
- package/dist/components/display/shortcut.jsx +23 -0
- package/dist/components/display/skeleton.d.ts +12 -0
- package/dist/components/display/skeleton.d.ts.map +1 -0
- package/dist/components/display/skeleton.jsx +19 -0
- package/dist/components/display/spinner.d.ts +5 -0
- package/dist/components/display/spinner.d.ts.map +1 -0
- package/dist/components/display/spinner.jsx +11 -0
- package/dist/components/display/stats.d.ts +12 -0
- package/dist/components/display/stats.d.ts.map +1 -0
- package/dist/components/display/stats.jsx +20 -0
- package/dist/components/display/step.d.ts +24 -0
- package/dist/components/display/step.d.ts.map +1 -0
- package/dist/components/display/step.jsx +131 -0
- package/dist/components/display/tabs.d.ts +24 -0
- package/dist/components/display/tabs.d.ts.map +1 -0
- package/dist/components/display/tabs.jsx +125 -0
- package/dist/components/display/timeline.d.ts +10 -0
- package/dist/components/display/timeline.d.ts.map +1 -0
- package/dist/components/display/timeline.jsx +25 -0
- package/dist/components/floating/command-palette.d.ts +49 -0
- package/dist/components/floating/command-palette.d.ts.map +1 -0
- package/dist/components/floating/command-palette.jsx +197 -0
- package/dist/components/floating/dropdown.d.ts +15 -0
- package/dist/components/floating/dropdown.d.ts.map +1 -0
- package/dist/components/floating/dropdown.jsx +56 -0
- package/dist/components/floating/expand.d.ts +11 -0
- package/dist/components/floating/expand.d.ts.map +1 -0
- package/dist/components/floating/expand.jsx +44 -0
- package/dist/components/floating/menu.d.ts +52 -0
- package/dist/components/floating/menu.d.ts.map +1 -0
- package/dist/components/floating/menu.jsx +147 -0
- package/dist/components/floating/modal.d.ts +60 -0
- package/dist/components/floating/modal.d.ts.map +1 -0
- package/dist/components/floating/modal.jsx +301 -0
- package/dist/components/floating/toolbar.d.ts +6 -0
- package/dist/components/floating/toolbar.d.ts.map +1 -0
- package/dist/components/floating/toolbar.jsx +5 -0
- package/dist/components/floating/tooltip.d.ts +17 -0
- package/dist/components/floating/tooltip.d.ts.map +1 -0
- package/dist/components/floating/tooltip.jsx +58 -0
- package/dist/components/floating/wizard.d.ts +26 -0
- package/dist/components/floating/wizard.d.ts.map +1 -0
- package/dist/components/floating/wizard.jsx +161 -0
- package/dist/components/form/autocomplete.d.ts +16 -0
- package/dist/components/form/autocomplete.d.ts.map +1 -0
- package/dist/components/form/autocomplete.jsx +278 -0
- package/dist/components/form/checkbox.d.ts +12 -0
- package/dist/components/form/checkbox.d.ts.map +1 -0
- package/dist/components/form/checkbox.jsx +12 -0
- package/dist/components/form/date-picker.d.ts +10 -0
- package/dist/components/form/date-picker.d.ts.map +1 -0
- package/dist/components/form/date-picker.jsx +115 -0
- package/dist/components/form/file-upload.d.ts +15 -0
- package/dist/components/form/file-upload.d.ts.map +1 -0
- package/dist/components/form/file-upload.jsx +134 -0
- package/dist/components/form/form.d.ts +3 -0
- package/dist/components/form/form.d.ts.map +1 -0
- package/dist/components/form/form.jsx +10 -0
- package/dist/components/form/formReset.d.ts +2 -0
- package/dist/components/form/formReset.d.ts.map +1 -0
- package/dist/components/form/formReset.jsx +17 -0
- package/dist/components/form/free-text.d.ts +11 -0
- package/dist/components/form/free-text.d.ts.map +1 -0
- package/dist/components/form/free-text.jsx +41 -0
- package/dist/components/form/input-field.d.ts +34 -0
- package/dist/components/form/input-field.d.ts.map +1 -0
- package/dist/components/form/input-field.jsx +58 -0
- package/dist/components/form/input.d.ts +52 -0
- package/dist/components/form/input.d.ts.map +1 -0
- package/dist/components/form/input.jsx +36 -0
- package/dist/components/form/multi-select.d.ts +19 -0
- package/dist/components/form/multi-select.d.ts.map +1 -0
- package/dist/components/form/multi-select.jsx +336 -0
- package/dist/components/form/radiobox.d.ts +7 -0
- package/dist/components/form/radiobox.d.ts.map +1 -0
- package/dist/components/form/radiobox.jsx +6 -0
- package/dist/components/form/select.d.ts +13 -0
- package/dist/components/form/select.d.ts.map +1 -0
- package/dist/components/form/select.jsx +42 -0
- package/dist/components/form/slider.d.ts +7 -0
- package/dist/components/form/slider.d.ts.map +1 -0
- package/dist/components/form/slider.jsx +45 -0
- package/dist/components/form/switch.d.ts +9 -0
- package/dist/components/form/switch.d.ts.map +1 -0
- package/dist/components/form/switch.jsx +46 -0
- package/dist/components/form/task-list.d.ts +3 -0
- package/dist/components/form/task-list.d.ts.map +1 -0
- package/dist/components/form/task-list.jsx +26 -0
- package/dist/components/form/textarea.d.ts +6 -0
- package/dist/components/form/textarea.d.ts.map +1 -0
- package/dist/components/form/textarea.jsx +12 -0
- package/dist/components/index.d.ts +45 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +44 -0
- package/dist/components/page-calendar/calendar-header.d.ts +16 -0
- package/dist/components/page-calendar/calendar-header.d.ts.map +1 -0
- package/dist/components/page-calendar/calendar-header.jsx +83 -0
- package/dist/components/page-calendar/day-view.d.ts +12 -0
- package/dist/components/page-calendar/day-view.d.ts.map +1 -0
- package/dist/components/page-calendar/day-view.jsx +94 -0
- package/dist/components/page-calendar/event-pill.d.ts +9 -0
- package/dist/components/page-calendar/event-pill.d.ts.map +1 -0
- package/dist/components/page-calendar/event-pill.jsx +25 -0
- package/dist/components/page-calendar/index.d.ts +4 -0
- package/dist/components/page-calendar/index.d.ts.map +1 -0
- package/dist/components/page-calendar/index.js +2 -0
- package/dist/components/page-calendar/month-view.d.ts +11 -0
- package/dist/components/page-calendar/month-view.d.ts.map +1 -0
- package/dist/components/page-calendar/month-view.jsx +46 -0
- package/dist/components/page-calendar/page-calendar.d.ts +18 -0
- package/dist/components/page-calendar/page-calendar.d.ts.map +1 -0
- package/dist/components/page-calendar/page-calendar.jsx +41 -0
- package/dist/components/page-calendar/page-calendar.types.d.ts +18 -0
- package/dist/components/page-calendar/page-calendar.types.d.ts.map +1 -0
- package/dist/components/page-calendar/page-calendar.types.js +1 -0
- package/dist/components/page-calendar/page-calendar.utils.d.ts +24 -0
- package/dist/components/page-calendar/page-calendar.utils.d.ts.map +1 -0
- package/dist/components/page-calendar/page-calendar.utils.js +93 -0
- package/dist/components/page-calendar/week-view.d.ts +11 -0
- package/dist/components/page-calendar/week-view.d.ts.map +1 -0
- package/dist/components/page-calendar/week-view.jsx +71 -0
- package/dist/components/table/filter.d.ts +42 -0
- package/dist/components/table/filter.d.ts.map +1 -0
- package/dist/components/table/filter.jsx +141 -0
- package/dist/components/table/group.d.ts +17 -0
- package/dist/components/table/group.d.ts.map +1 -0
- package/dist/components/table/group.jsx +68 -0
- package/dist/components/table/index.d.ts +19 -0
- package/dist/components/table/index.d.ts.map +1 -0
- package/dist/components/table/index.jsx +60 -0
- package/dist/components/table/inner-table.d.ts +29 -0
- package/dist/components/table/inner-table.d.ts.map +1 -0
- package/dist/components/table/inner-table.jsx +102 -0
- package/dist/components/table/metadata.d.ts +4 -0
- package/dist/components/table/metadata.d.ts.map +1 -0
- package/dist/components/table/metadata.jsx +36 -0
- package/dist/components/table/pagination.d.ts +5 -0
- package/dist/components/table/pagination.d.ts.map +1 -0
- package/dist/components/table/pagination.jsx +74 -0
- package/dist/components/table/row.d.ts +11 -0
- package/dist/components/table/row.d.ts.map +1 -0
- package/dist/components/table/row.jsx +49 -0
- package/dist/components/table/sort.d.ts +28 -0
- package/dist/components/table/sort.d.ts.map +1 -0
- package/dist/components/table/sort.jsx +109 -0
- package/dist/components/table/table-lib.d.ts +135 -0
- package/dist/components/table/table-lib.d.ts.map +1 -0
- package/dist/components/table/table-lib.js +83 -0
- package/dist/components/table/table.context.d.ts +10 -0
- package/dist/components/table/table.context.d.ts.map +1 -0
- package/dist/components/table/table.context.jsx +4 -0
- package/dist/components/table/thead.d.ts +9 -0
- package/dist/components/table/thead.d.ts.map +1 -0
- package/dist/components/table/thead.jsx +103 -0
- package/dist/config/context.d.ts +21 -0
- package/dist/config/context.d.ts.map +1 -0
- package/dist/config/context.js +12 -0
- package/dist/config/default-translations.d.ts +94 -0
- package/dist/config/default-translations.d.ts.map +1 -0
- package/dist/config/default-translations.jsx +87 -0
- package/dist/config/default-tweaks.d.ts +13 -0
- package/dist/config/default-tweaks.d.ts.map +1 -0
- package/dist/config/default-tweaks.js +4 -0
- package/dist/constants.d.ts +3 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +2 -0
- package/dist/hooks/use-click-outside.d.ts +3 -0
- package/dist/hooks/use-click-outside.d.ts.map +1 -0
- package/dist/hooks/use-click-outside.js +17 -0
- package/dist/hooks/use-color-parser.d.ts +2 -0
- package/dist/hooks/use-color-parser.d.ts.map +1 -0
- package/dist/hooks/use-color-parser.js +9 -0
- package/dist/hooks/use-components-provider.d.ts +15 -0
- package/dist/hooks/use-components-provider.d.ts.map +1 -0
- package/dist/hooks/use-components-provider.jsx +22 -0
- package/dist/hooks/use-debounce.d.ts +5 -0
- package/dist/hooks/use-debounce.d.ts.map +1 -0
- package/dist/hooks/use-debounce.js +12 -0
- package/dist/hooks/use-floating-ref.d.ts +2 -0
- package/dist/hooks/use-floating-ref.d.ts.map +1 -0
- package/dist/hooks/use-floating-ref.js +6 -0
- package/dist/hooks/use-form.d.ts +394 -0
- package/dist/hooks/use-form.d.ts.map +1 -0
- package/dist/hooks/use-form.js +563 -0
- package/dist/hooks/use-hover.d.ts +3 -0
- package/dist/hooks/use-hover.d.ts.map +1 -0
- package/dist/hooks/use-hover.js +18 -0
- package/dist/hooks/use-input-id.d.ts +4 -0
- package/dist/hooks/use-input-id.d.ts.map +1 -0
- package/dist/hooks/use-input-id.js +5 -0
- package/dist/hooks/use-is-coarse-device.d.ts +2 -0
- package/dist/hooks/use-is-coarse-device.d.ts.map +1 -0
- package/dist/hooks/use-is-coarse-device.js +12 -0
- package/dist/hooks/use-locale.d.ts +3 -0
- package/dist/hooks/use-locale.d.ts.map +1 -0
- package/dist/hooks/use-locale.js +10 -0
- package/dist/hooks/use-media-query.d.ts +2 -0
- package/dist/hooks/use-media-query.d.ts.map +1 -0
- package/dist/hooks/use-media-query.js +25 -0
- package/dist/hooks/use-on-event.d.ts +4 -0
- package/dist/hooks/use-on-event.d.ts.map +1 -0
- package/dist/hooks/use-on-event.js +7 -0
- package/dist/hooks/use-parent.d.ts +3 -0
- package/dist/hooks/use-parent.d.ts.map +1 -0
- package/dist/hooks/use-parent.js +21 -0
- package/dist/hooks/use-preferences.d.ts +2 -0
- package/dist/hooks/use-preferences.d.ts.map +1 -0
- package/dist/hooks/use-preferences.js +23 -0
- package/dist/hooks/use-previous.d.ts +2 -0
- package/dist/hooks/use-previous.d.ts.map +1 -0
- package/dist/hooks/use-previous.js +9 -0
- package/dist/hooks/use-reactive.d.ts +2 -0
- package/dist/hooks/use-reactive.d.ts.map +1 -0
- package/dist/hooks/use-reactive.js +9 -0
- package/dist/hooks/use-remove-scroll.d.ts +4 -0
- package/dist/hooks/use-remove-scroll.d.ts.map +1 -0
- package/dist/hooks/use-remove-scroll.js +48 -0
- package/dist/hooks/use-resize-observer.d.ts +2 -0
- package/dist/hooks/use-resize-observer.d.ts.map +1 -0
- package/dist/hooks/use-resize-observer.js +17 -0
- package/dist/hooks/use-stable-ref.d.ts +2 -0
- package/dist/hooks/use-stable-ref.d.ts.map +1 -0
- package/dist/hooks/use-stable-ref.js +9 -0
- package/dist/hooks/use-swipe.d.ts +8 -0
- package/dist/hooks/use-swipe.d.ts.map +1 -0
- package/dist/hooks/use-swipe.js +17 -0
- package/dist/hooks/use-translations.d.ts +92 -0
- package/dist/hooks/use-translations.d.ts.map +1 -0
- package/dist/hooks/use-translations.js +9 -0
- package/dist/hooks/use-tweaks.d.ts +3 -0
- package/dist/hooks/use-tweaks.d.ts.map +1 -0
- package/dist/hooks/use-tweaks.js +9 -0
- package/dist/hooks/use-window-size.d.ts +5 -0
- package/dist/hooks/use-window-size.d.ts.map +1 -0
- package/dist/hooks/use-window-size.js +14 -0
- package/dist/index-DDeQW0JW.js.map +1 -1
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -8231
- package/dist/index.js.map +1 -1
- package/dist/lib/combi-keys.d.ts +15 -0
- package/dist/lib/combi-keys.d.ts.map +1 -0
- package/dist/lib/combi-keys.js +60 -0
- package/dist/lib/dict.d.ts +9 -0
- package/dist/lib/dict.d.ts.map +1 -0
- package/dist/lib/dict.js +28 -0
- package/dist/lib/dom.d.ts +20 -0
- package/dist/lib/dom.d.ts.map +1 -0
- package/dist/lib/dom.js +66 -0
- package/dist/lib/fns.d.ts +11 -0
- package/dist/lib/fns.d.ts.map +1 -0
- package/dist/lib/fns.js +46 -0
- package/dist/lib/fzf.d.ts +16 -0
- package/dist/lib/fzf.d.ts.map +1 -0
- package/dist/lib/fzf.js +115 -0
- package/dist/lib/keyboard-area.d.ts +16 -0
- package/dist/lib/keyboard-area.d.ts.map +1 -0
- package/dist/lib/keyboard-area.js +14 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/types.d.ts +26 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { AllPaths } from "sidekicker";
|
|
3
|
+
import { Any, POJO, SetState } from "../../types";
|
|
4
|
+
import { OptionProps } from "../form/select";
|
|
5
|
+
import { FilterConfig } from "./filter";
|
|
6
|
+
import { GroupItem } from "./group";
|
|
7
|
+
import { Sorter } from "./sort";
|
|
8
|
+
export declare const getLabel: <T extends POJO>(col: Col<T>) => string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined>;
|
|
9
|
+
export type TableConfiguration<T extends POJO, M extends POJO = Any> = M & {
|
|
10
|
+
cols: Col<T>[];
|
|
11
|
+
options: OptionProps[];
|
|
12
|
+
};
|
|
13
|
+
export declare const createOptionCols: <T extends POJO>(cols: Col<T>[]) => OptionProps[];
|
|
14
|
+
export declare enum ColType {
|
|
15
|
+
Boolean = "boolean",
|
|
16
|
+
Number = "number",
|
|
17
|
+
Select = "select",
|
|
18
|
+
Text = "text"
|
|
19
|
+
}
|
|
20
|
+
export declare const valueFromType: (input: HTMLInputElement) => string | number;
|
|
21
|
+
type THead = React.ReactElement | React.ReactNode;
|
|
22
|
+
export type ColMatrix = `${number},${number}`;
|
|
23
|
+
type ParsePath<path, output extends string[] = [], currentChunk extends string = ""> = path extends number ? [`${path}`] : path extends `${infer first}${infer rest}` ? first extends "." | "[" | "]" ? ParsePath<rest, [...output, ...(currentChunk extends "" ? [] : [currentChunk])], ""> : ParsePath<rest, output, `${currentChunk}${first}`> : [...output, ...(currentChunk extends "" ? [] : [currentChunk])];
|
|
24
|
+
type RecursiveGet<Obj, pathList> = Obj extends any ? pathList extends [infer first, ...infer rest] ? first extends keyof Obj ? RecursiveGet<Obj[first], rest> : [first, Obj] extends [`${number}` | "number", readonly any[]] ? RecursiveGet<Extract<Obj, any[]>[number], rest> : undefined : Obj : never;
|
|
25
|
+
type GetFromPath<Obj, path> = RecursiveGet<Obj, ParsePath<path>>;
|
|
26
|
+
export type CellAsideElement<T extends POJO> = {
|
|
27
|
+
row: T;
|
|
28
|
+
rowIndex: number;
|
|
29
|
+
col: ColOptions<T, AllPaths<T>>;
|
|
30
|
+
};
|
|
31
|
+
export type CellPropsElement<T extends POJO, K extends AllPaths<T>> = {
|
|
32
|
+
row: T;
|
|
33
|
+
value: GetFromPath<T, K>;
|
|
34
|
+
rowIndex: number;
|
|
35
|
+
matrix: ColMatrix;
|
|
36
|
+
col: ColOptions<T, K> & {
|
|
37
|
+
id: K;
|
|
38
|
+
thead: THead;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
type ColOptions<T extends POJO, K extends AllPaths<T>> = Partial<{
|
|
42
|
+
type: ColType;
|
|
43
|
+
allowSort: boolean;
|
|
44
|
+
headerLabel: string;
|
|
45
|
+
allowFilter: boolean;
|
|
46
|
+
Element: React.FC<CellPropsElement<T, K>>;
|
|
47
|
+
thProps: React.HTMLAttributes<HTMLTableCellElement>;
|
|
48
|
+
cellProps: React.HTMLAttributes<HTMLTableCellElement>;
|
|
49
|
+
}>;
|
|
50
|
+
export type ColConstructor<T extends POJO> = {
|
|
51
|
+
getAll: () => Col<T>[];
|
|
52
|
+
remove: <K extends AllPaths<T>>(id: K) => void;
|
|
53
|
+
filter: (c: (c: Col<T>) => boolean) => Col<T>[];
|
|
54
|
+
add: <K extends AllPaths<T>>(id: K, thead: THead, props?: ColOptions<T, K>) => void;
|
|
55
|
+
};
|
|
56
|
+
declare const cols: <T extends POJO>() => <K extends AllPaths<T>>(id: K, thead: THead, options: ColOptions<T, K>) => {
|
|
57
|
+
id: K;
|
|
58
|
+
thead: THead;
|
|
59
|
+
type?: ColType | undefined;
|
|
60
|
+
allowSort?: boolean | undefined;
|
|
61
|
+
headerLabel?: string | undefined;
|
|
62
|
+
allowFilter?: boolean | undefined;
|
|
63
|
+
Element?: React.FC<CellPropsElement<T, K>> | undefined;
|
|
64
|
+
thProps?: React.HTMLAttributes<HTMLTableCellElement> | undefined;
|
|
65
|
+
cellProps?: React.HTMLAttributes<HTMLTableCellElement> | undefined;
|
|
66
|
+
};
|
|
67
|
+
export type Col<T extends POJO> = ReturnType<ReturnType<typeof cols<T>>>;
|
|
68
|
+
export type TablePagination = {
|
|
69
|
+
size: number;
|
|
70
|
+
pages: number;
|
|
71
|
+
current: number;
|
|
72
|
+
hasNext: boolean;
|
|
73
|
+
sizes?: number[];
|
|
74
|
+
totalItems: number;
|
|
75
|
+
hasPrevious: boolean;
|
|
76
|
+
onChangeSize?: (size: number) => void;
|
|
77
|
+
asLink?: React.FC<React.PropsWithChildren<{
|
|
78
|
+
href: number | "previous" | "next";
|
|
79
|
+
className: string;
|
|
80
|
+
}>>;
|
|
81
|
+
};
|
|
82
|
+
export type TableGetters<T extends POJO> = {
|
|
83
|
+
rows: T[];
|
|
84
|
+
cols: Col<T>[];
|
|
85
|
+
sorters: Sorter<T>[];
|
|
86
|
+
groups: GroupItem<T>[];
|
|
87
|
+
filters: FilterConfig<T>[];
|
|
88
|
+
pagination: TablePagination | null;
|
|
89
|
+
};
|
|
90
|
+
type TableSetters<T extends POJO> = {
|
|
91
|
+
setCols: SetState<Col<T>[]>;
|
|
92
|
+
setSorters: SetState<Sorter<T>[]>;
|
|
93
|
+
setGroups: SetState<GroupItem<T>[]>;
|
|
94
|
+
setFilters: SetState<FilterConfig<T>[]>;
|
|
95
|
+
};
|
|
96
|
+
export type TableOperationProps<T extends POJO> = TableConfiguration<T, TableSetters<T> & TableGetters<T> & {
|
|
97
|
+
set?: (v: TableGetters<T>) => void;
|
|
98
|
+
} & {
|
|
99
|
+
inlineSorter: boolean;
|
|
100
|
+
inlineFilter: boolean;
|
|
101
|
+
}>;
|
|
102
|
+
export declare const createColumns: <T extends POJO>(callback: (o: ColConstructor<T>) => void) => {
|
|
103
|
+
id: AllPaths<T, never>;
|
|
104
|
+
thead: THead;
|
|
105
|
+
type?: ColType | undefined;
|
|
106
|
+
allowSort?: boolean | undefined;
|
|
107
|
+
headerLabel?: string | undefined;
|
|
108
|
+
allowFilter?: boolean | undefined;
|
|
109
|
+
Element?: React.FC<CellPropsElement<T, AllPaths<T, never>>> | undefined;
|
|
110
|
+
thProps?: React.HTMLAttributes<HTMLTableCellElement> | undefined;
|
|
111
|
+
cellProps?: React.HTMLAttributes<HTMLTableCellElement> | undefined;
|
|
112
|
+
}[];
|
|
113
|
+
export declare const useTablePreferences: <T extends POJO>(name: string, cols: Col<T>[], options?: Partial<TableGetters<T>>) => {
|
|
114
|
+
name: string;
|
|
115
|
+
set: (getters: TableGetters<T>) => void;
|
|
116
|
+
cols: {
|
|
117
|
+
id: AllPaths<T, never>;
|
|
118
|
+
thead: THead;
|
|
119
|
+
type?: ColType | undefined;
|
|
120
|
+
allowSort?: boolean | undefined;
|
|
121
|
+
headerLabel?: string | undefined;
|
|
122
|
+
allowFilter?: boolean | undefined;
|
|
123
|
+
Element?: React.FC<CellPropsElement<T, AllPaths<T, never>>> | undefined;
|
|
124
|
+
thProps?: React.HTMLAttributes<HTMLTableCellElement> | undefined;
|
|
125
|
+
cellProps?: React.HTMLAttributes<HTMLTableCellElement> | undefined;
|
|
126
|
+
}[];
|
|
127
|
+
sorters: Sorter<T>[];
|
|
128
|
+
groups: GroupItem<T>[];
|
|
129
|
+
filters: FilterConfig<T>[];
|
|
130
|
+
pagination: TablePagination | null;
|
|
131
|
+
};
|
|
132
|
+
export declare const useWidthControl: <T extends object>(reorder: (c: Col<T>[]) => void) => readonly [React.RefObject<HTMLTableRowElement | null>, (cols: Col<T>[]) => void];
|
|
133
|
+
export declare const getModalScrollerRef: () => HTMLElement | undefined;
|
|
134
|
+
export {};
|
|
135
|
+
//# sourceMappingURL=table-lib.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-lib.d.ts","sourceRoot":"","sources":["../../../src/components/table/table-lib.ts"],"names":[],"mappings":"AACA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAKtC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,IAAI,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,sUAAuD,CAAC;AAE5G,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC,SAAS,I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AAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,IAAI,IAAI,kBAAkB,CAChE,CAAC,EACD,YAAY,CAAC,CAAC,CAAC,GACX,YAAY,CAAC,CAAC,CAAC,GAAG;IACd,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;CACtC,GAAG;IACA,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;CACzB,CACR,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,IAAI,EAAE,UAAU,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,IAAI;;;;;;;;;;GAQrF,CAAC;AA0BF,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,IAAI,EAAE,MAAM,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,UAAS,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAQ;;;;;;;;;;;;;;;;;gBAvD1G,eAAe,GAAG,IAAI;CA+ErC,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,MAAM,EAAE,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,mEAIjE,GAAG,CAAC,CAAC,CAAC,EAAE,UAWtB,CAAC;AAEF,eAAO,MAAM,mBAAmB,+BAAyG,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useRef } from "react";
|
|
3
|
+
import { LocalStorage } from "storage-manager-js";
|
|
4
|
+
import { useReducer } from "use-typed-reducer";
|
|
5
|
+
import { useStableRef } from "../../hooks/use-stable-ref";
|
|
6
|
+
import { isSsr } from "../../lib/fns";
|
|
7
|
+
export const getLabel = (col) => col.headerLabel ?? col.thead ?? col.id;
|
|
8
|
+
export const createOptionCols = (cols) => cols.map((opt) => ({
|
|
9
|
+
value: opt.id,
|
|
10
|
+
label: (opt.thead ?? opt.headerLabel ?? opt.id),
|
|
11
|
+
}));
|
|
12
|
+
export var ColType;
|
|
13
|
+
(function (ColType) {
|
|
14
|
+
ColType["Boolean"] = "boolean";
|
|
15
|
+
ColType["Number"] = "number";
|
|
16
|
+
ColType["Select"] = "select";
|
|
17
|
+
ColType["Text"] = "text";
|
|
18
|
+
})(ColType || (ColType = {}));
|
|
19
|
+
export const valueFromType = (input) => (input.type === "number" ? input.valueAsNumber : input.value);
|
|
20
|
+
const cols = () => (id, thead, options) => ({ ...options, id, thead });
|
|
21
|
+
export const createColumns = (callback) => {
|
|
22
|
+
let items = [];
|
|
23
|
+
const add = (id, thead, options) => items.push({ ...options, id, thead });
|
|
24
|
+
const remove = (id) => (items = items.filter((x) => x.id !== id));
|
|
25
|
+
const getAll = () => Array.from(items);
|
|
26
|
+
const filter = (c) => (items = Array.from(items.filter(c)));
|
|
27
|
+
callback({ add, remove, getAll, filter });
|
|
28
|
+
return items;
|
|
29
|
+
};
|
|
30
|
+
const noop = {};
|
|
31
|
+
const mergeCols = (cols, saved) => {
|
|
32
|
+
if (!Array.isArray(saved))
|
|
33
|
+
return cols;
|
|
34
|
+
const savedSet = new Set(saved.map((x) => x.id));
|
|
35
|
+
if (!cols.every((x) => savedSet.has(x.id))) {
|
|
36
|
+
return cols;
|
|
37
|
+
}
|
|
38
|
+
const map = new Map(cols.map((x) => [x.id, x]));
|
|
39
|
+
return saved.map((mock, index) => {
|
|
40
|
+
const original = map.get(mock.id);
|
|
41
|
+
if (original === undefined)
|
|
42
|
+
return cols[index];
|
|
43
|
+
return original;
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
export const useTablePreferences = (name, cols, options = noop) => {
|
|
47
|
+
const init = isSsr() ? null : LocalStorage.get(`@components/table-${name}`) || null;
|
|
48
|
+
const [state, dispatch] = useReducer({
|
|
49
|
+
name,
|
|
50
|
+
groups: options.groups || init?.groups || [],
|
|
51
|
+
sorters: options.sorters || init?.sorters || [],
|
|
52
|
+
filters: options.filters || init?.filters || [],
|
|
53
|
+
cols: mergeCols(cols, init?.cols),
|
|
54
|
+
}, (get) => {
|
|
55
|
+
const intercept = (partial) => {
|
|
56
|
+
const prev = get.state();
|
|
57
|
+
const result = { ...prev, ...partial };
|
|
58
|
+
if (!isSsr())
|
|
59
|
+
LocalStorage.set(`@components/table-${prev.name}`, result);
|
|
60
|
+
return result;
|
|
61
|
+
};
|
|
62
|
+
intercept(get.state());
|
|
63
|
+
return {
|
|
64
|
+
set: (getters) => intercept(getters),
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
return { ...state, ...dispatch, name };
|
|
68
|
+
};
|
|
69
|
+
export const useWidthControl = (reorder) => {
|
|
70
|
+
const stableRef = useStableRef(reorder);
|
|
71
|
+
const ref = useRef(null);
|
|
72
|
+
const onChange = useCallback((cols) => {
|
|
73
|
+
stableRef.current(cols);
|
|
74
|
+
cols.forEach((x) => {
|
|
75
|
+
const c = ref.current.querySelector(`th[data-tableheader="${x.id}"]`);
|
|
76
|
+
if (!c)
|
|
77
|
+
return;
|
|
78
|
+
c.style.width = "auto";
|
|
79
|
+
});
|
|
80
|
+
}, [stableRef]);
|
|
81
|
+
return [ref, onChange];
|
|
82
|
+
};
|
|
83
|
+
export const getModalScrollerRef = () => (isSsr() ? undefined : document.querySelector(`[data-component="modal-body"]`));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type TableContextProps = Partial<{
|
|
2
|
+
sticky: number;
|
|
3
|
+
}>;
|
|
4
|
+
export declare const TableProvider: import("react").Provider<Partial<{
|
|
5
|
+
sticky: number;
|
|
6
|
+
}>>;
|
|
7
|
+
export declare const useTable: () => Partial<{
|
|
8
|
+
sticky: number;
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=table.context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.context.d.ts","sourceRoot":"","sources":["../../../src/components/table/table.context.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAI5D,eAAO,MAAM,aAAa;YAJwB,MAAM;GAIN,CAAC;AAEnD,eAAO,MAAM,QAAQ;YAN6B,MAAM;EAMF,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Col, TableOperationProps } from "./table-lib";
|
|
3
|
+
type TableHeaderProps<T extends object> = {
|
|
4
|
+
loading: boolean;
|
|
5
|
+
headers: Col<T>[];
|
|
6
|
+
} & Pick<TableOperationProps<T>, "filters" | "setFilters" | "setCols" | "setSorters" | "sorters" | "inlineSorter" | "inlineFilter">;
|
|
7
|
+
export declare const TableHeader: <T extends object>(props: TableHeaderProps<T>) => React.JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=thead.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thead.d.ts","sourceRoot":"","sources":["../../../src/components/table/thead.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAM7D,OAAO,EAAE,GAAG,EAAY,mBAAmB,EAAmB,MAAM,aAAa,CAAC;AAIlF,KAAK,gBAAgB,CAAC,CAAC,SAAS,MAAM,IAAI;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;CACrB,GAAG,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,SAAS,GAAG,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,GAAG,cAAc,GAAG,cAAc,CAAC,CAAC;AAmKpI,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,MAAM,EAAE,OAAO,gBAAgB,CAAC,CAAC,CAAC,sBAuBvE,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { AnimatePresence, motion, Reorder } from "motion/react";
|
|
3
|
+
import { Order } from "linq-arrays";
|
|
4
|
+
import { PlusIcon, MagnifyingGlassIcon, MagnifyingGlassMinusIcon } from "@phosphor-icons/react";
|
|
5
|
+
import React, { Fragment, useCallback, useRef } from "react";
|
|
6
|
+
import { useTranslations } from "../../hooks/use-translations";
|
|
7
|
+
import { useTweaks } from "../../hooks/use-tweaks";
|
|
8
|
+
import { Dropdown } from "../floating/dropdown";
|
|
9
|
+
import { ColumnHeaderFilter, createFilterFromCol, useOperators } from "./filter";
|
|
10
|
+
import { SorterHead } from "./sort";
|
|
11
|
+
import { getLabel, useWidthControl } from "./table-lib";
|
|
12
|
+
const dragConstraints = { top: 0, left: 0, right: 0, bottom: -1 };
|
|
13
|
+
const HeaderChild = (props) => {
|
|
14
|
+
const tweaks = useTweaks();
|
|
15
|
+
const translation = useTranslations();
|
|
16
|
+
const ownFilters = props.filters.filter((x) => x.name === props.header.id);
|
|
17
|
+
const hasFilters = ownFilters.length > 0;
|
|
18
|
+
const defaultAllowSort = props.header.allowSort ?? tweaks.table.sorters ?? true;
|
|
19
|
+
const defaultAllowFilter = props.header.allowFilter ?? tweaks.table.filters ?? true;
|
|
20
|
+
const operators = useOperators();
|
|
21
|
+
const FilterIcon = hasFilters ? MagnifyingGlassIcon : MagnifyingGlassMinusIcon;
|
|
22
|
+
const th = useRef(null);
|
|
23
|
+
const onDelete = (e) => {
|
|
24
|
+
const id = e.currentTarget.dataset.id || "";
|
|
25
|
+
return props.setFilters((prev) => prev.filter((x) => x.id !== id));
|
|
26
|
+
};
|
|
27
|
+
const dragRef = useCallback((dom) => {
|
|
28
|
+
if (dom === null)
|
|
29
|
+
return;
|
|
30
|
+
th.current = dom;
|
|
31
|
+
const controller = new AbortController();
|
|
32
|
+
dom.addEventListener("pointerdown", (e) => {
|
|
33
|
+
const target = e.target;
|
|
34
|
+
if (target.dataset.type === "resizer") {
|
|
35
|
+
e.stopPropagation();
|
|
36
|
+
return e.stopImmediatePropagation();
|
|
37
|
+
}
|
|
38
|
+
}, { signal: controller.signal });
|
|
39
|
+
return () => controller.abort();
|
|
40
|
+
}, []);
|
|
41
|
+
const ownSorter = props.sorters.find((x) => props.header.id === x.value);
|
|
42
|
+
const ariaSort = !ownSorter?.type ? "none" : ownSorter.type === Order.Asc ? "ascending" : "descending";
|
|
43
|
+
const label = getLabel(props.header);
|
|
44
|
+
return (<Reorder.Item {...props.header.thProps} as="th" ref={dragRef} initial={false} dragSnapToOrigin dragDirectionLock role="columnheader" aria-sort={ariaSort} value={props.header} aria-busy={props.loading} data-tableheader={props.header.id} whileDrag={{ cursor: "grabbing" }} className={`typography relative min-w-0 cursor-grab overflow-clip border-r-[1px] border-table-border bg-table-header font-medium first:rounded-tl-lg last:rounded-tr-lg last:border-r-transparent md:h-14 ${props.header.thProps?.className ?? ""}`}>
|
|
45
|
+
<span className={`flex h-full items-center justify-between bg-table-header p-[var(--table-cell-padding)] ${props.isLast ? "rounded-tr-lg" : ""} ${props.index === 0 ? "rounded-tl-lg" : ""}`}>
|
|
46
|
+
<span className="flex items-center gap-1">
|
|
47
|
+
{props.inlineFilter && defaultAllowFilter ? (<Dropdown arrow trigger={<span>
|
|
48
|
+
<span id={`${props.header.id}-filter-dropdown-button`} className="sr-only">
|
|
49
|
+
{translation.tableFilterDropdownTitleUnique} {label}
|
|
50
|
+
</span>
|
|
51
|
+
<FilterIcon aria-labelledby={`${props.header.id}-filter-dropdown-button`} size={14}/>
|
|
52
|
+
</span>} title={<span className="text-lg">
|
|
53
|
+
{translation.tableFilterDropdownTitleUnique} <span className="font-medium">{label}</span>
|
|
54
|
+
</span>}>
|
|
55
|
+
<ul className="font-medium">
|
|
56
|
+
{ownFilters.length === 0 ? null : (<Fragment>
|
|
57
|
+
{ownFilters.map((filter) => (<li key={`thead-filter-${filter.id}`} className="my-1">
|
|
58
|
+
<ColumnHeaderFilter onDelete={onDelete} filter={filter} set={props.setFilters}/>
|
|
59
|
+
</li>))}
|
|
60
|
+
</Fragment>)}
|
|
61
|
+
<li>
|
|
62
|
+
<button type="button" className="flex items-center gap-1 text-primary" onClick={() => props.setFilters((prev) => prev.concat(createFilterFromCol(props.header, operators.options, operators.operations)))}>
|
|
63
|
+
<PlusIcon size={14}/> {translation.tableFilterNewFilter}
|
|
64
|
+
</button>
|
|
65
|
+
</li>
|
|
66
|
+
</ul>
|
|
67
|
+
</Dropdown>) : null}
|
|
68
|
+
<span className="pointer-events-auto text-balance text-base">{props.header.thead}</span>
|
|
69
|
+
{props.inlineSorter && defaultAllowSort ? (<SorterHead col={props.header} setSorters={props.setSorters} sorters={props.sorters}/>) : null}
|
|
70
|
+
</span>
|
|
71
|
+
</span>
|
|
72
|
+
{props.isLast ? null : (<motion.button drag="x" draggable dragListener dragMomentum type="button" animate={false} dragElastic={0} dragPropagation initial={false} dragSnapToOrigin dragDirectionLock data-type="resizer" title={props.header.id} dragConstraints={dragConstraints} className="absolute -right-[0.5px] top-0 z-calendar block h-full w-[1px] cursor-col-resize bg-transparent hover:w-1.5 hover:bg-primary active:w-1.5 active:bg-primary" onClick={(e) => void e.currentTarget.focus()} onKeyDown={(e) => {
|
|
73
|
+
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
74
|
+
if (th.current === null)
|
|
75
|
+
return;
|
|
76
|
+
th.current.setAttribute("data-resized", "true");
|
|
77
|
+
const v = th.current.getBoundingClientRect().width;
|
|
78
|
+
const move = e.shiftKey ? 50 : 10;
|
|
79
|
+
const delta = move * (e.key === "ArrowLeft" ? -1 : 1);
|
|
80
|
+
th.current.style.width = `${Math.abs(v + delta)}px`;
|
|
81
|
+
}
|
|
82
|
+
}} onDoubleClick={() => {
|
|
83
|
+
if (th.current === null)
|
|
84
|
+
return;
|
|
85
|
+
th.current.style.width = "auto";
|
|
86
|
+
}} onDrag={(_, info) => {
|
|
87
|
+
if (th.current === null)
|
|
88
|
+
return;
|
|
89
|
+
th.current.setAttribute("data-resized", "true");
|
|
90
|
+
const v = th.current.getBoundingClientRect().width;
|
|
91
|
+
const delta = info.delta.x;
|
|
92
|
+
th.current.style.width = `${Math.abs(v + delta)}px`;
|
|
93
|
+
}}/>)}
|
|
94
|
+
</Reorder.Item>);
|
|
95
|
+
};
|
|
96
|
+
export const TableHeader = (props) => {
|
|
97
|
+
const [ref, onChange] = useWidthControl(props.setCols);
|
|
98
|
+
return (<Reorder.Group layout as="tr" axis="x" drag="x" ref={ref} layoutRoot role="row" layoutScroll onReorder={onChange} values={props.headers}>
|
|
99
|
+
<AnimatePresence>
|
|
100
|
+
{props.headers.map((header, index) => (<HeaderChild index={index} header={header} filters={props.filters} loading={props.loading} sorters={props.sorters} setFilters={props.setFilters} setSorters={props.setSorters} inlineFilter={props.inlineFilter} inlineSorter={props.inlineSorter} isLast={index === props.headers.length - 1} key={`header-child-item-${header.id}`}/>))}
|
|
101
|
+
</AnimatePresence>
|
|
102
|
+
</Reorder.Group>);
|
|
103
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { IconProps } from "@phosphor-icons/react";
|
|
2
|
+
import type { Locales } from "the-mask-input";
|
|
3
|
+
import { parsers } from "../styles/design-tokens";
|
|
4
|
+
import { type Translations } from "./default-translations";
|
|
5
|
+
import { type Tweaks } from "./default-tweaks";
|
|
6
|
+
export type ContextProps = Partial<{
|
|
7
|
+
tweaks: Partial<Tweaks>;
|
|
8
|
+
map: Partial<Translations>;
|
|
9
|
+
locale: Locales | undefined;
|
|
10
|
+
parser: typeof parsers.hsla;
|
|
11
|
+
rootFloating?: HTMLElement | null;
|
|
12
|
+
iconWeight: IconProps["weight"];
|
|
13
|
+
}>;
|
|
14
|
+
export declare const Context: import("react").Context<Partial<{
|
|
15
|
+
tweaks: Tweaks;
|
|
16
|
+
map: Translations;
|
|
17
|
+
locale: Locales | undefined;
|
|
18
|
+
parser: typeof parsers.hsla;
|
|
19
|
+
floatingRef?: HTMLElement | null;
|
|
20
|
+
}>>;
|
|
21
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/config/context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAiB,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE9D,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC;IAC/B,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACxB,GAAG,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC3B,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,MAAM,EAAE,OAAO,OAAO,CAAC,IAAI,CAAC;IAC5B,YAAY,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAClC,UAAU,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;CACnC,CAAC,CAAC;AAEH,eAAO,MAAM,OAAO;;;;;;GAMlB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext } from "react";
|
|
3
|
+
import { parsers } from "../styles/design-tokens";
|
|
4
|
+
import { defaultTranslations } from "./default-translations";
|
|
5
|
+
import { defaultTweaks } from "./default-tweaks";
|
|
6
|
+
export const Context = createContext({
|
|
7
|
+
parser: parsers.hsla,
|
|
8
|
+
tweaks: defaultTweaks,
|
|
9
|
+
floatingRef: undefined,
|
|
10
|
+
map: defaultTranslations,
|
|
11
|
+
locale: undefined,
|
|
12
|
+
});
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const defaultTranslations: {
|
|
3
|
+
autocompleteEmpty: string;
|
|
4
|
+
calendarBackMonth: string;
|
|
5
|
+
calendarFromDate: string;
|
|
6
|
+
calendarMonthLabel: string;
|
|
7
|
+
calendarNextMonth: string;
|
|
8
|
+
calendarDatetimeTitle: string;
|
|
9
|
+
calendarToDate: string;
|
|
10
|
+
calendarToday: string;
|
|
11
|
+
pageCalendarMonthView: string;
|
|
12
|
+
pageCalendarWeekView: string;
|
|
13
|
+
pageCalendarDayView: string;
|
|
14
|
+
pageCalendarPrevious: string;
|
|
15
|
+
pageCalendarNext: string;
|
|
16
|
+
pageCalendarToday: string;
|
|
17
|
+
pageCalendarAddEvent: string;
|
|
18
|
+
pageCalendarWeekLabel: (n: number) => string;
|
|
19
|
+
pageCalendarFilter: string;
|
|
20
|
+
pageCalendarMoreEvents: (n: number) => string;
|
|
21
|
+
pageCalendarLabel: string;
|
|
22
|
+
pageCalendarNavigation: string;
|
|
23
|
+
pageCalendarMonthGrid: string;
|
|
24
|
+
pageCalendarFilterEnabled: string;
|
|
25
|
+
pageCalendarFilterDisabled: string;
|
|
26
|
+
pageCalendarEventCount: (n: number) => string;
|
|
27
|
+
pageCalendarEventAt: (title: string, time: string) => string;
|
|
28
|
+
commandPaletteEmpty: string;
|
|
29
|
+
commandPaletteLoading: string;
|
|
30
|
+
datePickerCalendarButtonLabel: string;
|
|
31
|
+
emptyDataMessage: string;
|
|
32
|
+
inputCaretDown: string;
|
|
33
|
+
inputCloseValue: string;
|
|
34
|
+
inputOptionalLabel: string;
|
|
35
|
+
wizardNext: string;
|
|
36
|
+
wizardPrev: string;
|
|
37
|
+
wizardFinish: string;
|
|
38
|
+
wizardSkip: string;
|
|
39
|
+
multiSelectInnerPlaceholder: string;
|
|
40
|
+
multiSelectSelectedLabel: string;
|
|
41
|
+
tableColumnResizer: string;
|
|
42
|
+
tableFilterColumnPlaceholder: string;
|
|
43
|
+
tableFilterColumnTitle: string;
|
|
44
|
+
tableFilterDropdownTitle: string;
|
|
45
|
+
tableFilterDropdownTitleUnique: string;
|
|
46
|
+
tableFilterLabel: string;
|
|
47
|
+
tableFilterNewFilter: string;
|
|
48
|
+
tableFilterOperatorPlaceholder: string;
|
|
49
|
+
tableFilterOperatorTitle: string;
|
|
50
|
+
tableFilterTypeContains: string;
|
|
51
|
+
tableFilterTypeEndsWith: string;
|
|
52
|
+
tableFilterTypeGreaterThan: string;
|
|
53
|
+
tableFilterTypeIs: string;
|
|
54
|
+
tableFilterTypeIsNot: string;
|
|
55
|
+
tableFilterTypeLessThan: string;
|
|
56
|
+
tableFilterTypeNotContains: string;
|
|
57
|
+
tableFilterTypeStartsWith: string;
|
|
58
|
+
tableFilterValuePlaceholder: string;
|
|
59
|
+
tableFilterValueTitle: string;
|
|
60
|
+
tableGroupLabel: string;
|
|
61
|
+
tableGroupLabelWithCount: string;
|
|
62
|
+
tablePaginationFooter: (pagination: {
|
|
63
|
+
pages: number;
|
|
64
|
+
totalItems: number;
|
|
65
|
+
sizes?: number[];
|
|
66
|
+
current: number;
|
|
67
|
+
select: React.ReactNode;
|
|
68
|
+
}) => React.JSX.Element;
|
|
69
|
+
tablePaginationNext: string;
|
|
70
|
+
tablePaginationPrevious: string;
|
|
71
|
+
tablePaginationSelectLabel: string;
|
|
72
|
+
tableSortAddButton: string;
|
|
73
|
+
tableSortAsc: string;
|
|
74
|
+
tableSortDesc: string;
|
|
75
|
+
tableSortDropdownTitle: string;
|
|
76
|
+
tableSortOrderByLabel: string;
|
|
77
|
+
tableSortOrderInputPlaceholder: string;
|
|
78
|
+
tableSortOrderInputTitle: string;
|
|
79
|
+
tableSortTypeInputPlaceholder: string;
|
|
80
|
+
tableSortTypeInputTitle: string;
|
|
81
|
+
uploadIdle: string;
|
|
82
|
+
uploadIdleButton: string;
|
|
83
|
+
uploadDragging: (props: {
|
|
84
|
+
n: number;
|
|
85
|
+
}) => string;
|
|
86
|
+
uploadDialogTitle: string;
|
|
87
|
+
datepickerPlaceholder: (_: string) => string;
|
|
88
|
+
spinnerLoading: string;
|
|
89
|
+
skeletonLoading: string;
|
|
90
|
+
closeButton: string;
|
|
91
|
+
fileUploadZoneLabel: string;
|
|
92
|
+
};
|
|
93
|
+
export type Translations = typeof defaultTranslations;
|
|
94
|
+
//# sourceMappingURL=default-translations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-translations.d.ts","sourceRoot":"","sources":["../../src/config/default-translations.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;+BAgBD,MAAM;;gCAEL,MAAM;;;;;;gCAMN,MAAM;iCACL,MAAM,QAAQ,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAmCb;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE;;;;;;;;;;;;;;;4BAqB7G;QAAE,CAAC,EAAE,MAAM,CAAA;KAAE;;+BAGV,MAAM;;;;;CAKpC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,OAAO,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import React, { Fragment } from "react";
|
|
2
|
+
export const defaultTranslations = {
|
|
3
|
+
autocompleteEmpty: "Nothing here...",
|
|
4
|
+
calendarBackMonth: "Back month",
|
|
5
|
+
calendarFromDate: "From",
|
|
6
|
+
calendarMonthLabel: "Month",
|
|
7
|
+
calendarNextMonth: "Next month",
|
|
8
|
+
calendarDatetimeTitle: "Time",
|
|
9
|
+
calendarToDate: "To",
|
|
10
|
+
calendarToday: "Today",
|
|
11
|
+
pageCalendarMonthView: "Month view",
|
|
12
|
+
pageCalendarWeekView: "Week view",
|
|
13
|
+
pageCalendarDayView: "Day view",
|
|
14
|
+
pageCalendarPrevious: "Previous",
|
|
15
|
+
pageCalendarNext: "Next",
|
|
16
|
+
pageCalendarToday: "Today",
|
|
17
|
+
pageCalendarAddEvent: "Add event",
|
|
18
|
+
pageCalendarWeekLabel: (n) => `Week ${n}`,
|
|
19
|
+
pageCalendarFilter: "Filter:",
|
|
20
|
+
pageCalendarMoreEvents: (n) => `+${n} more...`,
|
|
21
|
+
pageCalendarLabel: "Calendar",
|
|
22
|
+
pageCalendarNavigation: "Calendar navigation",
|
|
23
|
+
pageCalendarMonthGrid: "Calendar month",
|
|
24
|
+
pageCalendarFilterEnabled: "enabled",
|
|
25
|
+
pageCalendarFilterDisabled: "disabled",
|
|
26
|
+
pageCalendarEventCount: (n) => (n === 1 ? "1 event" : `${n} events`),
|
|
27
|
+
pageCalendarEventAt: (title, time) => `${title} at ${time}`,
|
|
28
|
+
commandPaletteEmpty: "Nothing here...",
|
|
29
|
+
commandPaletteLoading: "Loading...",
|
|
30
|
+
datePickerCalendarButtonLabel: "Click to open a date picker",
|
|
31
|
+
emptyDataMessage: "No data",
|
|
32
|
+
inputCaretDown: "Click to see all options",
|
|
33
|
+
inputCloseValue: "Click to clear the value",
|
|
34
|
+
inputOptionalLabel: "Optional",
|
|
35
|
+
wizardNext: "Next",
|
|
36
|
+
wizardPrev: "Previous",
|
|
37
|
+
wizardFinish: "Finish",
|
|
38
|
+
wizardSkip: "Skip",
|
|
39
|
+
multiSelectInnerPlaceholder: "Search...",
|
|
40
|
+
multiSelectSelectedLabel: "Selected",
|
|
41
|
+
tableColumnResizer: "Resize column",
|
|
42
|
+
tableFilterColumnPlaceholder: "Filter by",
|
|
43
|
+
tableFilterColumnTitle: "Filter by",
|
|
44
|
+
tableFilterDropdownTitle: "Filters",
|
|
45
|
+
tableFilterDropdownTitleUnique: "Filter by",
|
|
46
|
+
tableFilterLabel: "Filters",
|
|
47
|
+
tableFilterNewFilter: "New filter",
|
|
48
|
+
tableFilterOperatorPlaceholder: "Equals to...",
|
|
49
|
+
tableFilterOperatorTitle: "Operation",
|
|
50
|
+
tableFilterTypeContains: "Contains",
|
|
51
|
+
tableFilterTypeEndsWith: "Ends with",
|
|
52
|
+
tableFilterTypeGreaterThan: "Greater than",
|
|
53
|
+
tableFilterTypeIs: "Is",
|
|
54
|
+
tableFilterTypeIsNot: "Is not",
|
|
55
|
+
tableFilterTypeLessThan: "Less than",
|
|
56
|
+
tableFilterTypeNotContains: "Not contains",
|
|
57
|
+
tableFilterTypeStartsWith: "Starts with",
|
|
58
|
+
tableFilterValuePlaceholder: "Something...",
|
|
59
|
+
tableFilterValueTitle: "Value",
|
|
60
|
+
tableGroupLabel: "Group",
|
|
61
|
+
tableGroupLabelWithCount: "Group",
|
|
62
|
+
tablePaginationFooter: (pagination) => (<Fragment>
|
|
63
|
+
{pagination.current} to {pagination.pages} of {pagination.totalItems} items.{Array.isArray(pagination.sizes) ? pagination.select : null}{" "}
|
|
64
|
+
per page.
|
|
65
|
+
</Fragment>),
|
|
66
|
+
tablePaginationNext: "Next",
|
|
67
|
+
tablePaginationPrevious: "Previous",
|
|
68
|
+
tablePaginationSelectLabel: "Select the size of page",
|
|
69
|
+
tableSortAddButton: "Add sort",
|
|
70
|
+
tableSortAsc: "Ascending",
|
|
71
|
+
tableSortDesc: "Descending",
|
|
72
|
+
tableSortDropdownTitle: "Order by",
|
|
73
|
+
tableSortOrderByLabel: "Order by",
|
|
74
|
+
tableSortOrderInputPlaceholder: "Order by",
|
|
75
|
+
tableSortOrderInputTitle: "Order by",
|
|
76
|
+
tableSortTypeInputPlaceholder: "Ascending",
|
|
77
|
+
tableSortTypeInputTitle: "Sort type",
|
|
78
|
+
uploadIdle: "You can drag your files here",
|
|
79
|
+
uploadIdleButton: "Choose your files",
|
|
80
|
+
uploadDragging: (props) => `Dragging ${props.n} ${props.n > 0 ? "files" : "file"}`,
|
|
81
|
+
uploadDialogTitle: "Details of your file",
|
|
82
|
+
datepickerPlaceholder: (_) => "day/month/year",
|
|
83
|
+
spinnerLoading: "Loading",
|
|
84
|
+
skeletonLoading: "Loading content",
|
|
85
|
+
closeButton: "Close",
|
|
86
|
+
fileUploadZoneLabel: "File upload area. Drag files here or press Enter to browse.",
|
|
87
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type Tweaks = {
|
|
2
|
+
table: {
|
|
3
|
+
sorters: boolean;
|
|
4
|
+
filters: boolean;
|
|
5
|
+
operations: boolean;
|
|
6
|
+
sticky: number | undefined;
|
|
7
|
+
};
|
|
8
|
+
input: {
|
|
9
|
+
iconFeedback: boolean;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare const defaultTweaks: Tweaks;
|
|
13
|
+
//# sourceMappingURL=default-tweaks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-tweaks.d.ts","sourceRoot":"","sources":["../../src/config/default-tweaks.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG;IACjB,KAAK,EAAE;QACH,OAAO,EAAE,OAAO,CAAC;QACjB,OAAO,EAAE,OAAO,CAAC;QACjB,UAAU,EAAE,OAAO,CAAC;QACpB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;KAC9B,CAAC;IACF,KAAK,EAAE;QACH,YAAY,EAAE,OAAO,CAAC;KACzB,CAAC;CACL,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,MAG3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC,eAAO,MAAM,qBAAqB,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-click-outside.d.ts","sourceRoot":"","sources":["../../src/hooks/use-click-outside.ts"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAEzC,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,WAAW,EAAE,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,KAAK,IAAI,SAclI,CAAC"}
|