@economic/taco 2.12.1 → 2.14.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Field/Field.d.ts +4 -2
- package/dist/components/Icon/components/Location.d.ts +3 -0
- package/dist/components/Icon/components/index.d.ts +1 -1
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Menu/components/Item.d.ts +1 -1
- package/dist/components/Menu/components/Link.d.ts +1 -1
- package/dist/components/Navigation2/components/Link.d.ts +1 -1
- package/dist/components/Provider/Localization.d.ts +1 -113
- package/dist/components/Select2/components/Option.d.ts +7 -5
- package/dist/components/Select2/components/Search.d.ts +1 -1
- package/dist/components/Table3/Table3.d.ts +9 -1
- package/dist/components/Table3/components/columns/header/Group.d.ts +15 -0
- package/dist/components/Table3/components/columns/header/Header.d.ts +5 -0
- package/dist/components/Table3/components/columns/internal/EditingActions.d.ts +1 -1
- package/dist/components/Table3/components/columns/styles.d.ts +2 -2
- package/dist/components/Table3/components/toolbar/Filter/filters/components/Filter.d.ts +4 -4
- package/dist/components/Table3/components/toolbar/Filter/filters/components/FilterColumn.d.ts +3 -2
- package/dist/components/Table3/components/toolbar/Filter/filters/components/Placeholder.d.ts +3 -2
- package/dist/components/Table3/components/toolbar/FontSize.d.ts +4 -0
- package/dist/components/Table3/hooks/features/useHeaderOffsetStyle.d.ts +3 -0
- package/dist/components/Table3/hooks/useCssGrid.d.ts +2 -1
- package/dist/components/Table3/hooks/useTable.d.ts +1 -1
- package/dist/components/Table3/types.d.ts +8 -1
- package/dist/components/Tag/Tag.d.ts +1 -1
- package/dist/esm/index.css +24 -6
- package/dist/esm/packages/taco/src/components/Combobox/useCombobox.js +1 -1
- package/dist/esm/packages/taco/src/components/Combobox/useCombobox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Field/Field.js +6 -4
- package/dist/esm/packages/taco/src/components/Field/Field.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Location.js +17 -0
- package/dist/esm/packages/taco/src/components/Icon/components/Location.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Icon/components/index.js +2 -0
- package/dist/esm/packages/taco/src/components/Icon/components/index.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Provider/Localization.js +1 -110
- package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Edit.js +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Edit.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Option.js +13 -6
- package/dist/esm/packages/taco/src/components/Select2/components/Option.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Search.js +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Search.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js +7 -6
- package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/Table3.js +29 -11
- package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/DisplayCell.js +2 -5
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/DisplayCell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js +1 -4
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingCell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Group.js +70 -0
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Group.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Header.js +26 -8
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Header.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Menu.js +6 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/header/Menu.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js +3 -2
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/EditingActions.js +13 -9
- package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/EditingActions.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/columns/styles.js +14 -2
- package/dist/esm/packages/taco/src/components/Table3/components/columns/styles.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/ColumnSettings.js +10 -7
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/ColumnSettings.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/Filters.js +15 -8
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/Filters.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/Filter.js +2 -2
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/Filter.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterColumn.js +25 -4
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterColumn.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterComparator.js +0 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterComparator.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterValue.js +5 -3
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterValue.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/Placeholder.js +2 -2
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/Placeholder.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/FontSize.js +9 -4
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/FontSize.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintIFrame.js +2 -3
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintIFrame.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/RowHeight.js +3 -2
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/RowHeight.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Settings.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useHeaderOffsetStyle.js +24 -0
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useHeaderOffsetStyle.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useSettings.js +6 -7
- package/dist/esm/packages/taco/src/components/Table3/hooks/features/useSettings.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useSettingsStateListener.js +48 -0
- package/dist/esm/packages/taco/src/components/Table3/hooks/listeners/useSettingsStateListener.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useConvertChildrenToColumns.js +34 -9
- package/dist/esm/packages/taco/src/components/Table3/hooks/useConvertChildrenToColumns.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useCssGrid.js +6 -5
- package/dist/esm/packages/taco/src/components/Table3/hooks/useCssGrid.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useCssVars.js +11 -9
- package/dist/esm/packages/taco/src/components/Table3/hooks/useCssVars.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/hooks/useTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/types.js.map +1 -1
- package/dist/esm/packages/taco/src/index.js +1 -2
- package/dist/esm/packages/taco/src/index.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/dom.js +1 -2
- package/dist/esm/packages/taco/src/utils/dom.js.map +1 -1
- package/dist/index.css +24 -6
- package/dist/index.d.ts +0 -1
- package/dist/taco.cjs.development.js +697 -4100
- package/dist/taco.cjs.development.js.map +1 -1
- package/dist/taco.cjs.production.min.js +1 -1
- package/dist/taco.cjs.production.min.js.map +1 -1
- package/package.json +2 -2
- package/tailwind.config.js +3 -0
- package/types.json +14334 -32345
- package/dist/components/Table2/Table2.d.ts +0 -130
- package/dist/components/Table2/components/BatchActionsMenu.d.ts +0 -10
- package/dist/components/Table2/components/ColumnSettingsButton.d.ts +0 -6
- package/dist/components/Table2/components/EditModeButton.d.ts +0 -8
- package/dist/components/Table2/components/RowDensityButton.d.ts +0 -7
- package/dist/components/Table2/components/Search.d.ts +0 -3
- package/dist/components/Table2/components/ShortcutsGuideButton.d.ts +0 -7
- package/dist/components/Table2/components/column/Base.d.ts +0 -14
- package/dist/components/Table2/components/column/Cell.d.ts +0 -15
- package/dist/components/Table2/components/column/Footer.d.ts +0 -9
- package/dist/components/Table2/components/column/Header.d.ts +0 -11
- package/dist/components/Table2/components/column/Indicator.d.ts +0 -17
- package/dist/components/Table2/components/column/ValidationError.d.ts +0 -5
- package/dist/components/Table2/components/column/utils.d.ts +0 -3
- package/dist/components/Table2/components/filters/FiltersButton.d.ts +0 -7
- package/dist/components/Table2/components/filters/components/Column.d.ts +0 -11
- package/dist/components/Table2/components/filters/components/ColumnFilter.d.ts +0 -10
- package/dist/components/Table2/components/filters/components/Comparator.d.ts +0 -11
- package/dist/components/Table2/components/filters/components/EmptyFilter.d.ts +0 -13
- package/dist/components/Table2/components/filters/components/InferredControl.d.ts +0 -10
- package/dist/components/Table2/components/row/Context.d.ts +0 -24
- package/dist/components/Table2/components/row/ExpandedRow.d.ts +0 -6
- package/dist/components/Table2/components/row/Row.d.ts +0 -2
- package/dist/components/Table2/hooks/listeners/useActiveCellStateListener.d.ts +0 -3
- package/dist/components/Table2/hooks/listeners/useActiveRowStateListener.d.ts +0 -3
- package/dist/components/Table2/hooks/listeners/useColumnOffsetStateListener.d.ts +0 -3
- package/dist/components/Table2/hooks/listeners/useFilterStateListener.d.ts +0 -3
- package/dist/components/Table2/hooks/listeners/useRowSelectionListener.d.ts +0 -3
- package/dist/components/Table2/hooks/listeners/useSettingsStateListener.d.ts +0 -3
- package/dist/components/Table2/hooks/useActiveCell.d.ts +0 -26
- package/dist/components/Table2/hooks/useActiveRow.d.ts +0 -10
- package/dist/components/Table2/hooks/useColumnDefinitions.d.ts +0 -37
- package/dist/components/Table2/hooks/useEditMode.d.ts +0 -28
- package/dist/components/Table2/hooks/useGridTemplate.d.ts +0 -2
- package/dist/components/Table2/hooks/useTable.d.ts +0 -46
- package/dist/components/Table2/hooks/useTableShortcuts.d.ts +0 -2
- package/dist/components/Table2/hooks/useVirtualiser.d.ts +0 -23
- package/dist/components/Table2/types.d.ts +0 -148
- package/dist/components/Table2/utilities/cell.d.ts +0 -14
- package/dist/components/Table2/utilities/columns.d.ts +0 -16
- package/dist/components/Table2/utilities/filterFn.d.ts +0 -3
- package/dist/esm/packages/taco/src/components/Table2/Table2.js +0 -422
- package/dist/esm/packages/taco/src/components/Table2/Table2.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/BatchActionsMenu.js +0 -83
- package/dist/esm/packages/taco/src/components/Table2/components/BatchActionsMenu.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/ColumnSettingsButton.js +0 -116
- package/dist/esm/packages/taco/src/components/Table2/components/ColumnSettingsButton.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/EditModeButton.js +0 -81
- package/dist/esm/packages/taco/src/components/Table2/components/EditModeButton.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/RowDensityButton.js +0 -47
- package/dist/esm/packages/taco/src/components/Table2/components/RowDensityButton.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/Search.js +0 -62
- package/dist/esm/packages/taco/src/components/Table2/components/Search.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/column/Base.js +0 -32
- package/dist/esm/packages/taco/src/components/Table2/components/column/Base.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/column/Cell.js +0 -605
- package/dist/esm/packages/taco/src/components/Table2/components/column/Cell.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/column/Footer.js +0 -32
- package/dist/esm/packages/taco/src/components/Table2/components/column/Footer.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/column/Header.js +0 -243
- package/dist/esm/packages/taco/src/components/Table2/components/column/Header.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/column/Indicator.js +0 -73
- package/dist/esm/packages/taco/src/components/Table2/components/column/Indicator.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/column/ValidationError.js +0 -30
- package/dist/esm/packages/taco/src/components/Table2/components/column/ValidationError.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/column/utils.js +0 -39
- package/dist/esm/packages/taco/src/components/Table2/components/column/utils.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/filters/FiltersButton.js +0 -155
- package/dist/esm/packages/taco/src/components/Table2/components/filters/FiltersButton.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/filters/components/Column.js +0 -31
- package/dist/esm/packages/taco/src/components/Table2/components/filters/components/Column.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/filters/components/ColumnFilter.js +0 -129
- package/dist/esm/packages/taco/src/components/Table2/components/filters/components/ColumnFilter.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/filters/components/Comparator.js +0 -68
- package/dist/esm/packages/taco/src/components/Table2/components/filters/components/Comparator.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/filters/components/EmptyFilter.js +0 -63
- package/dist/esm/packages/taco/src/components/Table2/components/filters/components/EmptyFilter.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/filters/components/InferredControl.js +0 -99
- package/dist/esm/packages/taco/src/components/Table2/components/filters/components/InferredControl.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/row/Context.js +0 -58
- package/dist/esm/packages/taco/src/components/Table2/components/row/Context.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/row/ExpandedRow.js +0 -36
- package/dist/esm/packages/taco/src/components/Table2/components/row/ExpandedRow.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/components/row/Row.js +0 -44
- package/dist/esm/packages/taco/src/components/Table2/components/row/Row.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useActiveRowStateListener.js +0 -19
- package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useActiveRowStateListener.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useColumnOffsetStateListener.js +0 -28
- package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useColumnOffsetStateListener.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useFilterStateListener.js +0 -12
- package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useFilterStateListener.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useRowSelectionListener.js +0 -18
- package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useRowSelectionListener.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useSettingsStateListener.js +0 -25
- package/dist/esm/packages/taco/src/components/Table2/hooks/listeners/useSettingsStateListener.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/useActiveRow.js +0 -33
- package/dist/esm/packages/taco/src/components/Table2/hooks/useActiveRow.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/useColumnDefinitions.js +0 -122
- package/dist/esm/packages/taco/src/components/Table2/hooks/useColumnDefinitions.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/useEditMode.js +0 -112
- package/dist/esm/packages/taco/src/components/Table2/hooks/useEditMode.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/useGridTemplate.js +0 -34
- package/dist/esm/packages/taco/src/components/Table2/hooks/useGridTemplate.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/useTable.js +0 -222
- package/dist/esm/packages/taco/src/components/Table2/hooks/useTable.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/useTableShortcuts.js +0 -46
- package/dist/esm/packages/taco/src/components/Table2/hooks/useTableShortcuts.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/hooks/useVirtualiser.js +0 -48
- package/dist/esm/packages/taco/src/components/Table2/hooks/useVirtualiser.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/types.js +0 -18
- package/dist/esm/packages/taco/src/components/Table2/types.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/utilities/cell.js +0 -41
- package/dist/esm/packages/taco/src/components/Table2/utilities/cell.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/utilities/columns.js +0 -387
- package/dist/esm/packages/taco/src/components/Table2/utilities/columns.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Table2/utilities/filterFn.js +0 -100
- package/dist/esm/packages/taco/src/components/Table2/utilities/filterFn.js.map +0 -1
- package/dist/esm/packages/taco/src/components/Truncate/Truncate.js +0 -32
- package/dist/esm/packages/taco/src/components/Truncate/Truncate.js.map +0 -1
- package/dist/esm/packages/taco/src/utils/hooks/useTruncated.js +0 -20
- package/dist/esm/packages/taco/src/utils/hooks/useTruncated.js.map +0 -1
@@ -4,5 +4,5 @@ export declare type EditingActionsProps<TType = unknown> = CellContext<TType, un
|
|
4
4
|
isHovered: boolean;
|
5
5
|
};
|
6
6
|
export declare const COLUMN_ID = "__editing_actions";
|
7
|
-
export declare const EDITING_ACTIONS_WIDTH =
|
7
|
+
export declare const EDITING_ACTIONS_WIDTH = 60;
|
8
8
|
export declare function createRowEditingActionsColumn<TType = unknown>(): DisplayColumnDef<TType, unknown>;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { Table3ColumnAlignment } from '../../types';
|
2
|
-
export declare const MIN_COLUMN_SIZE = 80;
|
1
|
+
import { Table3ColumnAlignment, Table3FontSize } from '../../types';
|
3
2
|
export declare const PRINT_MIN_COLUMN_SIZE = 20;
|
4
3
|
export declare const getCellAlignmentClasses: (alignment?: Table3ColumnAlignment) => string;
|
4
|
+
export declare const getFontBasedMinColumnSize: (fontSize: Table3FontSize | undefined) => 57 | 83 | 72;
|
5
5
|
export declare const getInputAppearanceClassnames: () => string;
|
@@ -1,12 +1,12 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import { Column as RTColumn
|
2
|
+
import { Column as RTColumn } from '@tanstack/react-table';
|
3
3
|
import { Table3Filter } from '../../../../../types';
|
4
4
|
export declare type FilterProps<TType = unknown> = {
|
5
5
|
allColumns: RTColumn<TType, unknown>[];
|
6
6
|
filter: Table3Filter;
|
7
|
-
filters:
|
7
|
+
filters: Table3Filter[];
|
8
8
|
position: number;
|
9
|
-
onChange: (id: string, value: Table3Filter) => void;
|
10
|
-
onRemove: (columnId: string) => void;
|
9
|
+
onChange: (id: string | null, value: Table3Filter) => void;
|
10
|
+
onRemove: (columnId: string | null) => void;
|
11
11
|
};
|
12
12
|
export declare function Filter<TType = unknown>(props: FilterProps<TType>): JSX.Element;
|
package/dist/components/Table3/components/toolbar/Filter/filters/components/FilterColumn.d.ts
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import { Column as RTColumn
|
2
|
+
import { Column as RTColumn } from '@tanstack/react-table';
|
3
3
|
import { Select2Props } from '../../../../../../Select2/Select2';
|
4
|
+
import { Table3Filter } from '../../../../../types';
|
4
5
|
export declare type FilterColumnProps<TType = unknown> = Omit<Select2Props, 'children'> & {
|
5
6
|
allColumns: RTColumn<TType, unknown>[];
|
6
|
-
filters:
|
7
|
+
filters: Table3Filter[];
|
7
8
|
};
|
8
9
|
export declare function FilterColumn<TType = unknown>(props: FilterColumnProps<TType>): JSX.Element;
|
package/dist/components/Table3/components/toolbar/Filter/filters/components/Placeholder.d.ts
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import { Column as RTColumn
|
2
|
+
import { Column as RTColumn } from '@tanstack/react-table';
|
3
3
|
import { Select2Value } from '../../../../../../Select2/Select2';
|
4
|
+
import { Table3Filter } from '../../../../../types';
|
4
5
|
export declare type PlaceholderFilterProps<TType = unknown> = {
|
5
6
|
allColumns: RTColumn<TType, unknown>[];
|
6
|
-
filters:
|
7
|
+
filters: Table3Filter[];
|
7
8
|
position: number;
|
8
9
|
onCreate?: (value: Select2Value) => void;
|
9
10
|
onRemove?: () => void;
|
@@ -1,7 +1,11 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { Table as RTable } from '@tanstack/react-table';
|
3
|
+
import { Table3FontSize } from '../../types';
|
3
4
|
declare type FontSizeButtonProps<TType = unknown> = {
|
4
5
|
table: RTable<TType>;
|
5
6
|
};
|
7
|
+
export declare const FONT_SIZE: {
|
8
|
+
[FontSize in Table3FontSize]: FontSize;
|
9
|
+
};
|
6
10
|
export declare function FontSize<TType = unknown>(props: FontSizeButtonProps<TType>): JSX.Element;
|
7
11
|
export {};
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { Table as RTable } from '@tanstack/react-table';
|
3
|
-
|
3
|
+
import { Table3FontSize } from '../types';
|
4
|
+
export declare const useCssGrid: <TType = unknown>(table: RTable<TType>, isPrintTable: boolean | undefined, actionsForRowLength: number | undefined, fontSize: Table3FontSize) => {
|
4
5
|
style: React.CSSProperties;
|
5
6
|
};
|
@@ -53,6 +53,12 @@ export declare type Table3ColumnProps<TType = unknown> = ValueOf<{
|
|
53
53
|
tooltip?: string;
|
54
54
|
};
|
55
55
|
}>;
|
56
|
+
export declare type Table3GroupProps = {
|
57
|
+
id: string;
|
58
|
+
header: string;
|
59
|
+
colSpan?: number;
|
60
|
+
children: (JSX.Element | boolean | null | undefined)[];
|
61
|
+
};
|
56
62
|
export declare type DeprecatedRowDensity = 'compact' | 'normal' | 'comfortable' | 'spacious';
|
57
63
|
export declare type Table3RowHeight = 'short' | 'medium' | 'tall' | 'extra-tall';
|
58
64
|
export declare type Table3FontSize = 'small' | 'medium' | 'large';
|
@@ -96,7 +102,7 @@ export declare type Table3FilterValue = {
|
|
96
102
|
value: any;
|
97
103
|
};
|
98
104
|
export declare type Table3Filter = {
|
99
|
-
id: string;
|
105
|
+
id: string | null;
|
100
106
|
value: Table3FilterValue;
|
101
107
|
};
|
102
108
|
export declare type ColumnFilter = RTColumnFilter;
|
@@ -291,6 +297,7 @@ export declare type Table3Texts = {
|
|
291
297
|
condition: string;
|
292
298
|
value: string;
|
293
299
|
};
|
300
|
+
hiddenColumn: string;
|
294
301
|
tooltip: string;
|
295
302
|
total: string;
|
296
303
|
};
|
@@ -13,7 +13,7 @@ export declare const Tag: React.ForwardRefExoticComponent<Pick<React.HTMLAttribu
|
|
13
13
|
children: string;
|
14
14
|
color?: "green" | "yellow" | "red" | "blue" | "purple" | "brown" | "pink" | "orange" | "grey" | "transparent" | undefined;
|
15
15
|
disabled?: boolean | undefined;
|
16
|
-
icon?: React.ReactElement<IconProps, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | "account-preview" | "accounting-year-cancel" | "accounting-year" | "accounting" | "arrow-bottom" | "arrow-down" | "arrow-end" | "arrow-left" | "arrow-right" | "arrow-start" | "arrow-top" | "arrow-up" | "attach-auto" | "attach-cancel" | "attach-warning" | "attach" | "autotext-insert" | "autotext" | "basic-tabs" | "basic" | "bell-solid" | "book" | "booking" | "budget" | "calendar" | "cash-account" | "cash-reports" | "chart-area" | "chart-bar" | "chart-line" | "chart-pie" | "chart-table" | "chat-solid" | "chat" | "chevron-down-double" | "chevron-down-solid" | "chevron-down" | "chevron-left-double" | "chevron-left-solid" | "chevron-left" | "chevron-right-double" | "chevron-right-solid" | "chevron-right" | "chevron-up-double" | "chevron-up-solid" | "chevron-up" | "circle-close" | "circle-information" | "circle-minus" | "circle-plus" | "circle-questionmark" | "circle-tick" | "circle-warning" | "clamp-open" | "clamp" | "close" | "column-freeze" | "column-unfreeze" | "columns" | "connection-enable" | "connection-revoke" | "contacts" | "copy" | "courses" | "credit" | "delete-permanently" | "delete" | "depecriate" | "developer" | "distribution-template" | "document-approve" | "document-create-entry" | "document-cut" | "document-error" | "document-isolate-page" | "document-merge" | "document-move" | "document-preview" | "document-received" | "document-rejected-request" | "document-split" | "document-time" | "document" | "download" | "drag" | "e-copedia" | "e-signature" | "edit-simple" | "edit" | "ellipsis-horizontal" | "ellipsis-vertical" | "entries-on-account" | "entries-open" | "entries-warning" | "entry-type-customer-invoice" | "entry-type-customer-payment" | "entry-type-journal-entry" | "entry-type-manual-customer-invoice" | "entry-type-supplier-invoice" | "entry-type-supplier-payment" | "envelope-approved" | "envelope" | "expand-view" | "expenses" | "export-to-excel" | "export-to-pdf" | "export" | "eye-off" | "eye-on" | "filter-solid" | "filter" | "font-size" | "graph-solid" | "hash" | "height-extra-tall" | "height-medium" | "height-short" | "height-tall" | "home" | "images" | "import" | "inbox-einvoicing" | "inbox-scanning" | "inbox-smart" | "inbox" | "info" | "inventory-matrix" | "inventory" | "journal-pro" | "layout-both" | "layout-first" | "layout-last" | "layout-none" | "layout" | "ledger-card-customer-reminder" | "ledger-card-manual-customer-invoice" | "ledger-card-obsolete-stock" | "ledger-card-opening-entry" | "ledger-card-reserved-entry" | "ledger-card-shrinkage-pilferage" | "ledger-card-stock-adjustment" | "ledger-card-transferred-opening-entry" | "ledger-card" | "lightbulb" | "line" | "list-bulleted" | "list-search" | "list" | "lock-open" | "lock" | "log-out" | "log" | "market" | "match-amount" | "match-entries" | "menu" | "mileage" | "modal-resize" | "modal-shrink" | "more-solid" | "more" | "move" | "navigation-list" | "note-follow-up" | "note-read" | "note" | "numbers" | "partner-api" | "payment-paid" | "payment-unpaid" | "period" | "person-change" | "person-minus" | "person-plus" | "person-tick" | "play" | "plus-minus" | "print" | "process-payment" | "product-ledger-card" | "profile" | "project-cards" | "projects" | "question-mark" | "quicklinks" | "rating-bankruptcy" | "rating-payment-problems" | "reconciled" | "refresh" | "report-solid" | "report" | "restore" | "rotate-left" | "rotate-right" | "sales" | "search-bold" | "search" | "secure-tick" | "secure" | "settings-solid" | "settings" | "shortcuts" | "show-all" | "show-less" | "show-more" | "show-template" | "sliders" | "smartpay" | "sort-by" | "star-solid" | "star" | "subscriptions" | "system-entries" | "tag" | "template-override" | "templates" | "thumb-both" | "thumb-down-solid" | "thumb-down" | "thumb-up-solid" | "thumb-up" | "tick-bold" | "tick" | "time" | "transfer-cancel" | "transfer-locked" | "transfer" | "undo" | "undock" | "unreconciled" | "warning" | "webshop" | "website" | "workflow-template-basic" | "workflow" | "zoom" | undefined;
|
16
|
+
icon?: React.ReactElement<IconProps, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | "account-preview" | "accounting-year-cancel" | "accounting-year" | "accounting" | "arrow-bottom" | "arrow-down" | "arrow-end" | "arrow-left" | "arrow-right" | "arrow-start" | "arrow-top" | "arrow-up" | "attach-auto" | "attach-cancel" | "attach-warning" | "attach" | "autotext-insert" | "autotext" | "basic-tabs" | "basic" | "bell-solid" | "book" | "booking" | "budget" | "calendar" | "cash-account" | "cash-reports" | "chart-area" | "chart-bar" | "chart-line" | "chart-pie" | "chart-table" | "chat-solid" | "chat" | "chevron-down-double" | "chevron-down-solid" | "chevron-down" | "chevron-left-double" | "chevron-left-solid" | "chevron-left" | "chevron-right-double" | "chevron-right-solid" | "chevron-right" | "chevron-up-double" | "chevron-up-solid" | "chevron-up" | "circle-close" | "circle-information" | "circle-minus" | "circle-plus" | "circle-questionmark" | "circle-tick" | "circle-warning" | "clamp-open" | "clamp" | "close" | "column-freeze" | "column-unfreeze" | "columns" | "connection-enable" | "connection-revoke" | "contacts" | "copy" | "courses" | "credit" | "delete-permanently" | "delete" | "depecriate" | "developer" | "distribution-template" | "document-approve" | "document-create-entry" | "document-cut" | "document-error" | "document-isolate-page" | "document-merge" | "document-move" | "document-preview" | "document-received" | "document-rejected-request" | "document-split" | "document-time" | "document" | "download" | "drag" | "e-copedia" | "e-signature" | "edit-simple" | "edit" | "ellipsis-horizontal" | "ellipsis-vertical" | "entries-on-account" | "entries-open" | "entries-warning" | "entry-type-customer-invoice" | "entry-type-customer-payment" | "entry-type-journal-entry" | "entry-type-manual-customer-invoice" | "entry-type-supplier-invoice" | "entry-type-supplier-payment" | "envelope-approved" | "envelope" | "expand-view" | "expenses" | "export-to-excel" | "export-to-pdf" | "export" | "eye-off" | "eye-on" | "filter-solid" | "filter" | "font-size" | "graph-solid" | "hash" | "height-extra-tall" | "height-medium" | "height-short" | "height-tall" | "home" | "images" | "import" | "inbox-einvoicing" | "inbox-scanning" | "inbox-smart" | "inbox" | "info" | "inventory-matrix" | "inventory" | "journal-pro" | "layout-both" | "layout-first" | "layout-last" | "layout-none" | "layout" | "ledger-card-customer-reminder" | "ledger-card-manual-customer-invoice" | "ledger-card-obsolete-stock" | "ledger-card-opening-entry" | "ledger-card-reserved-entry" | "ledger-card-shrinkage-pilferage" | "ledger-card-stock-adjustment" | "ledger-card-transferred-opening-entry" | "ledger-card" | "lightbulb" | "line" | "list-bulleted" | "list-search" | "list" | "location" | "lock-open" | "lock" | "log-out" | "log" | "market" | "match-amount" | "match-entries" | "menu" | "mileage" | "modal-resize" | "modal-shrink" | "more-solid" | "more" | "move" | "navigation-list" | "note-follow-up" | "note-read" | "note" | "numbers" | "partner-api" | "payment-paid" | "payment-unpaid" | "period" | "person-change" | "person-minus" | "person-plus" | "person-tick" | "play" | "plus-minus" | "print" | "process-payment" | "product-ledger-card" | "profile" | "project-cards" | "projects" | "question-mark" | "quicklinks" | "rating-bankruptcy" | "rating-payment-problems" | "reconciled" | "refresh" | "report-solid" | "report" | "restore" | "rotate-left" | "rotate-right" | "sales" | "search-bold" | "search" | "secure-tick" | "secure" | "settings-solid" | "settings" | "shortcuts" | "show-all" | "show-less" | "show-more" | "show-template" | "sliders" | "smartpay" | "sort-by" | "star-solid" | "star" | "subscriptions" | "system-entries" | "tag" | "template-override" | "templates" | "thumb-both" | "thumb-down-solid" | "thumb-down" | "thumb-up-solid" | "thumb-up" | "tick-bold" | "tick" | "time" | "transfer-cancel" | "transfer-locked" | "transfer" | "undo" | "undock" | "unreconciled" | "warning" | "webshop" | "website" | "workflow-template-basic" | "workflow" | "zoom" | undefined;
|
17
17
|
readOnly?: boolean | undefined;
|
18
18
|
onDelete?: ((event: React.MouseEvent<SVGSVGElement>) => void) | undefined;
|
19
19
|
} & React.RefAttributes<HTMLSpanElement>>;
|
package/dist/esm/index.css
CHANGED
@@ -641,12 +641,14 @@
|
|
641
641
|
/* cells */
|
642
642
|
[role='cell'],
|
643
643
|
[role='columnheader'],
|
644
|
+
[data-taco='table3-column-group'] > div,
|
644
645
|
[data-taco='table2-footer-summary'] {
|
645
646
|
@apply border-grey-300;
|
646
647
|
}
|
647
648
|
|
648
649
|
[role='cell']:not([data-highlighted='true']),
|
649
|
-
[role='columnheader']
|
650
|
+
[role='columnheader'],
|
651
|
+
[data-taco='table3-column-group'] > div {
|
650
652
|
@apply flex;
|
651
653
|
}
|
652
654
|
|
@@ -657,17 +659,20 @@
|
|
657
659
|
}
|
658
660
|
|
659
661
|
[role='cell'][data-align='left'],
|
660
|
-
[role='columnheader'][data-align='left']
|
662
|
+
[role='columnheader'][data-align='left'],
|
663
|
+
[data-taco='table3-column-group'][data-align='left'] > div {
|
661
664
|
@apply justify-start text-left;
|
662
665
|
}
|
663
666
|
|
664
667
|
[role='cell'][data-align='center'],
|
665
|
-
[role='columnheader'][data-align='center']
|
668
|
+
[role='columnheader'][data-align='center'],
|
669
|
+
[data-taco='table3-column-group'][data-align='center'] > div {
|
666
670
|
@apply justify-center text-center;
|
667
671
|
}
|
668
672
|
|
669
673
|
[role='cell'][data-align='right'],
|
670
|
-
[role='columnheader'][data-align='right']
|
674
|
+
[role='columnheader'][data-align='right'],
|
675
|
+
[data-taco='table3-column-group'][data-align='right'] > div {
|
671
676
|
@apply justify-end text-right;
|
672
677
|
}
|
673
678
|
|
@@ -683,10 +688,18 @@
|
|
683
688
|
|
684
689
|
/* row/cell backgrounds */
|
685
690
|
|
686
|
-
[role='columnheader']
|
691
|
+
[role='columnheader'],
|
692
|
+
[data-taco='table3-column-group'] > div {
|
687
693
|
@apply bg-white;
|
688
694
|
}
|
689
695
|
|
696
|
+
[role='columnheader'] [data-taco='header-separator'] {
|
697
|
+
@apply -mr-1;
|
698
|
+
}
|
699
|
+
[data-taco='table3-column-group'] [data-taco='header-separator'] {
|
700
|
+
@apply -mr-3;
|
701
|
+
}
|
702
|
+
|
690
703
|
/* normal rows */
|
691
704
|
[role='row']:not([data-selected='true']):not([data-error='true']) [role='cell'] {
|
692
705
|
@apply bg-white;
|
@@ -797,7 +810,12 @@
|
|
797
810
|
@apply !-my-2;
|
798
811
|
}
|
799
812
|
|
800
|
-
[data-font-size='small'] [role='cell']
|
813
|
+
[data-font-size='small'] [role='cell'] [data-taco='spinner'] {
|
814
|
+
@apply !h-4 !w-4;
|
815
|
+
}
|
816
|
+
|
817
|
+
[data-font-size='small'] [role='cell'] > [data-taco='icon'],
|
818
|
+
[data-font-size='small'] [role='cell'] [data-taco='spinner'] {
|
801
819
|
@apply !-my-[3px];
|
802
820
|
}
|
803
821
|
|
@@ -100,7 +100,7 @@ const useCombobox = ({
|
|
100
100
|
// event handlers
|
101
101
|
const handleInputBlur = event => {
|
102
102
|
event.persist();
|
103
|
-
if (event.relatedTarget === listRef.current) {
|
103
|
+
if (listRef.current && event.relatedTarget === listRef.current) {
|
104
104
|
event.preventDefault();
|
105
105
|
return;
|
106
106
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useCombobox.js","sources":["../../../../../../../src/components/Combobox/useCombobox.tsx"],"sourcesContent":["import * as React from 'react';\nimport { v4 as uuid } from 'uuid';\nimport debounce from 'lodash/debounce';\nimport { ComboboxProps } from './Combobox';\nimport {\n setInputValueByRef,\n getIndexFromValue,\n findByValue,\n useFlattenedData,\n sanitizeItem,\n getOptionParents,\n filterData,\n} from '../Listbox/util';\nimport { createCustomKeyboardEvent } from '../../utils/input';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { getId, ScrollableListItemValue, ScrollableListPropsWithRef } from '../Listbox/ScrollableList';\nimport { InputProps } from '../Input/Input';\n\nconst debouncer = debounce(f => f(), 200);\n\nconst convertToInputValue = (value: ScrollableListItemValue | undefined) => String(value ?? '');\n\ntype useCombobox = React.HTMLAttributes<HTMLDivElement> & {\n combobox: React.HTMLAttributes<HTMLSpanElement>;\n input: Omit<InputProps, 'defaultValue'> & { ref: React.RefObject<HTMLInputElement> };\n list: ScrollableListPropsWithRef;\n button: { ref: any };\n popover: { open: boolean; onOpenChange: (open: boolean) => void };\n};\n\nexport const useCombobox = (\n {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n data: unfilteredData = [],\n defaultValue,\n disabled,\n id: nativeId,\n inline,\n loading: __,\n onChange,\n onClick,\n onKeyDown,\n onSearch,\n readOnly,\n value,\n ...props\n }: Omit<ComboboxProps, 'dialog'>,\n ref: React.Ref<HTMLInputElement>\n): useCombobox => {\n const inputRef = useMergedRef<HTMLInputElement>(ref);\n const buttonRef = React.useRef<HTMLButtonElement>(null);\n const listRef = React.useRef<HTMLUListElement>(null);\n const [open, setOpen] = React.useState(false);\n const listId = React.useMemo(() => uuid(), []);\n const [inputValue, setInputValue] = React.useState<string>(convertToInputValue(value));\n const shouldFilterData = !onSearch && (!inline || (inline && inputValue !== convertToInputValue(value)));\n const flattenedData = useFlattenedData(unfilteredData);\n const data = React.useMemo(\n () => (shouldFilterData ? filterData(flattenedData, inputValue) : flattenedData),\n [shouldFilterData, inputValue, flattenedData]\n );\n // listbox/select change value _with_ the index, but combobox changes on select of an index (click/enter), so we need state\n const [currentIndex, setCurrentIndex] = React.useState<number | undefined>(\n inputValue !== undefined ? getIndexFromValue(data, inputValue) : undefined\n );\n\n const setInputValueByIndex = (index: number | undefined): void => {\n if (index !== undefined) {\n const option = data[index];\n\n if (option && !option.disabled) {\n setInputValueByRef(inputRef.current, option.value, 'focusout');\n }\n }\n };\n\n const setCurrentValue = (index: number | undefined) => {\n if (index === undefined) {\n return;\n }\n\n const option = data[index];\n\n // if the selected option is not already selected, trigger blur event\n if (option.value !== value) {\n setInputValueByIndex(index);\n } else {\n // if the selected option is already selected, refill input with its value\n setInputValue(convertToInputValue(value));\n }\n };\n\n // ensure the external value is synced with the internal value when mounting, e.g. incase a default value was set\n React.useEffect(() => {\n if (defaultValue && !value) {\n setInputValueByIndex(getIndexFromValue(data, defaultValue));\n }\n }, [data]);\n\n // update input value if it changed 'externally', e.g. clicking/entering an item in the listbox, from a modal etc\n React.useEffect(() => {\n if (value !== undefined && value !== inputValue) {\n setInputValue(convertToInputValue(value));\n }\n }, [value]);\n\n React.useEffect(() => {\n if (onSearch) {\n debouncer(() => {\n onSearch(inputValue);\n });\n }\n }, [inputValue]);\n\n // show listbox based on input value\n React.useEffect(() => {\n // don't show the popover if the internal (input) value already is the current value\n // this prevents the popover showing after selecting a value or pressing escape\n const isCurrentValue = value !== undefined && value !== null && inputValue === String(value);\n\n if (inputValue && data.length && !isCurrentValue) {\n setCurrentIndex(0);\n\n if (!open) {\n setOpen(true);\n }\n } else {\n setOpen(false);\n }\n }, [inputValue, data]);\n\n React.useEffect(() => {\n if (open) {\n setCurrentIndex(getIndexFromValue(data, inputValue) || 0);\n } else {\n setCurrentIndex(undefined);\n }\n }, [open]);\n\n // event handlers\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>): void => {\n event.persist();\n\n if (event.relatedTarget === listRef.current) {\n event.preventDefault();\n return;\n }\n\n if (onChange && event.target.value !== value) {\n const item = findByValue(flattenedData, event.target.value);\n (event as any).detail = sanitizeItem(item);\n\n const parents = getOptionParents(flattenedData, item?.path);\n\n if (parents !== null && parents.length > 0) {\n (event as any).detail.parents = parents;\n }\n\n onChange(event);\n }\n\n if (props.onBlur) {\n props.onBlur(event);\n }\n };\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n setInputValue(event.target.value);\n };\n\n const handleInputClick = (event: React.MouseEvent<HTMLInputElement>): void => {\n if (inline || (!open && inputValue && data.length)) {\n setOpen(true);\n }\n\n if (onClick) {\n event.persist();\n onClick(event);\n }\n };\n\n const handleInputKeyDown = (event: React.KeyboardEvent<HTMLInputElement>): void => {\n event.persist();\n\n switch (event.key) {\n case 'Backspace': {\n return;\n }\n\n case 'Escape': {\n event.preventDefault();\n setInputValue(convertToInputValue(value));\n setOpen(false);\n return;\n }\n\n case 'Tab':\n case 'Enter': {\n if (event.key !== 'Tab') {\n event.preventDefault();\n }\n\n setCurrentValue(currentIndex);\n setOpen(false);\n return;\n }\n\n case 'ArrowDown':\n if (open) {\n event.preventDefault();\n } else {\n if (!inline && buttonRef.current) {\n buttonRef.current.click();\n }\n }\n break;\n\n case 'ArrowUp':\n case 'Home':\n case 'End': {\n if (open) {\n event.preventDefault();\n }\n break;\n }\n\n default:\n }\n\n // we aren't focused on the list, so manually forward the keydown event to it\n if (listRef.current) {\n listRef.current.dispatchEvent(createCustomKeyboardEvent(event));\n }\n\n if (inline && !open) {\n if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n event.preventDefault();\n const initialIndex = event.key === 'ArrowUp' ? data.length - 1 : 0;\n setCurrentIndex(currentIndex !== undefined ? currentIndex : initialIndex);\n setOpen(true);\n }\n }\n\n if (!event.isDefaultPrevented() && onKeyDown) {\n event.persist();\n onKeyDown(event);\n }\n };\n\n const handleListboxChange = (index: number): void => {\n setCurrentIndex(index);\n };\n\n const handleListboxClick = (event: React.MouseEvent<HTMLLIElement>, index: number): void => {\n event.preventDefault();\n setCurrentValue(index);\n setOpen(false);\n };\n\n const combobox = {\n 'aria-expanded': open,\n 'aria-owns': listId,\n 'aria-haspopup': 'listbox' as const,\n role: 'combobox',\n };\n\n const input = {\n ...props,\n 'aria-controls': listId,\n // Indicates that the autocomplete behavior of the text input is to suggest a list of possible values in a popup and that the suggestions\n // are related to the string that is present in the textbox\n 'aria-autocomplete': 'list' as const,\n // Enables assistive technologies to know which element the application regards as focused while DOM focus remains on the input element\n 'aria-activedescendant':\n currentIndex !== undefined && data[currentIndex] ? getId(listId, String(data[currentIndex].value)) : undefined,\n 'aria-labelledby': ariaLabelledBy,\n disabled,\n onBlur: !disabled && !readOnly ? handleInputBlur : undefined,\n onChange: !disabled && !readOnly ? handleInputChange : undefined,\n onClick: !disabled && !readOnly ? handleInputClick : undefined,\n onKeyDown: !disabled && !readOnly ? handleInputKeyDown : undefined,\n readOnly,\n ref: inputRef,\n type: 'text',\n value: inputValue ?? '',\n };\n\n const list: ScrollableListPropsWithRef = {\n 'aria-labelledby': ariaLabelledBy,\n data,\n disabled,\n id: listId,\n onChange: handleListboxChange,\n onClick: handleListboxClick,\n ref: listRef,\n scrollOnFocus: false,\n tabIndex: -1,\n value: currentIndex,\n };\n\n const button = {\n ref: buttonRef,\n };\n\n return {\n combobox,\n input,\n list,\n button,\n popover: {\n open,\n onOpenChange: setOpen,\n //visible: !data.length ? false : open,\n },\n };\n};\n"],"names":["debouncer","debounce","f","convertToInputValue","value","String","useCombobox","ariaLabel","ariaLabelledBy","data","unfilteredData","defaultValue","disabled","id","nativeId","inline","loading","__","onChange","onClick","onKeyDown","onSearch","readOnly","props","ref","inputRef","useMergedRef","buttonRef","React","listRef","open","setOpen","listId","uuid","inputValue","setInputValue","shouldFilterData","flattenedData","useFlattenedData","filterData","currentIndex","setCurrentIndex","undefined","getIndexFromValue","setInputValueByIndex","index","option","setInputValueByRef","current","setCurrentValue","isCurrentValue","length","handleInputBlur","event","persist","relatedTarget","preventDefault","target","item","findByValue","detail","sanitizeItem","parents","getOptionParents","path","onBlur","handleInputChange","handleInputClick","handleInputKeyDown","key","click","dispatchEvent","createCustomKeyboardEvent","initialIndex","isDefaultPrevented","handleListboxChange","handleListboxClick","combobox","role","input","getId","type","list","scrollOnFocus","tabIndex","button","popover","onOpenChange"],"mappings":";;;;;;;;AAkBA,MAAMA,SAAS,gBA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.tsx"],"sourcesContent":["import * as React from 'react';\nimport { v4 as uuid } from 'uuid';\nimport debounce from 'lodash/debounce';\nimport { ComboboxProps } from './Combobox';\nimport {\n setInputValueByRef,\n getIndexFromValue,\n findByValue,\n useFlattenedData,\n sanitizeItem,\n getOptionParents,\n filterData,\n} from '../Listbox/util';\nimport { createCustomKeyboardEvent } from '../../utils/input';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { getId, ScrollableListItemValue, ScrollableListPropsWithRef } from '../Listbox/ScrollableList';\nimport { InputProps } from '../Input/Input';\n\nconst debouncer = debounce(f => f(), 200);\n\nconst convertToInputValue = (value: ScrollableListItemValue | undefined) => String(value ?? '');\n\ntype useCombobox = React.HTMLAttributes<HTMLDivElement> & {\n combobox: React.HTMLAttributes<HTMLSpanElement>;\n input: Omit<InputProps, 'defaultValue'> & { ref: React.RefObject<HTMLInputElement> };\n list: ScrollableListPropsWithRef;\n button: { ref: any };\n popover: { open: boolean; onOpenChange: (open: boolean) => void };\n};\n\nexport const useCombobox = (\n {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n data: unfilteredData = [],\n defaultValue,\n disabled,\n id: nativeId,\n inline,\n loading: __,\n onChange,\n onClick,\n onKeyDown,\n onSearch,\n readOnly,\n value,\n ...props\n }: Omit<ComboboxProps, 'dialog'>,\n ref: React.Ref<HTMLInputElement>\n): useCombobox => {\n const inputRef = useMergedRef<HTMLInputElement>(ref);\n const buttonRef = React.useRef<HTMLButtonElement>(null);\n const listRef = React.useRef<HTMLUListElement>(null);\n const [open, setOpen] = React.useState(false);\n const listId = React.useMemo(() => uuid(), []);\n const [inputValue, setInputValue] = React.useState<string>(convertToInputValue(value));\n const shouldFilterData = !onSearch && (!inline || (inline && inputValue !== convertToInputValue(value)));\n const flattenedData = useFlattenedData(unfilteredData);\n const data = React.useMemo(\n () => (shouldFilterData ? filterData(flattenedData, inputValue) : flattenedData),\n [shouldFilterData, inputValue, flattenedData]\n );\n // listbox/select change value _with_ the index, but combobox changes on select of an index (click/enter), so we need state\n const [currentIndex, setCurrentIndex] = React.useState<number | undefined>(\n inputValue !== undefined ? getIndexFromValue(data, inputValue) : undefined\n );\n\n const setInputValueByIndex = (index: number | undefined): void => {\n if (index !== undefined) {\n const option = data[index];\n\n if (option && !option.disabled) {\n setInputValueByRef(inputRef.current, option.value, 'focusout');\n }\n }\n };\n\n const setCurrentValue = (index: number | undefined) => {\n if (index === undefined) {\n return;\n }\n\n const option = data[index];\n\n // if the selected option is not already selected, trigger blur event\n if (option.value !== value) {\n setInputValueByIndex(index);\n } else {\n // if the selected option is already selected, refill input with its value\n setInputValue(convertToInputValue(value));\n }\n };\n\n // ensure the external value is synced with the internal value when mounting, e.g. incase a default value was set\n React.useEffect(() => {\n if (defaultValue && !value) {\n setInputValueByIndex(getIndexFromValue(data, defaultValue));\n }\n }, [data]);\n\n // update input value if it changed 'externally', e.g. clicking/entering an item in the listbox, from a modal etc\n React.useEffect(() => {\n if (value !== undefined && value !== inputValue) {\n setInputValue(convertToInputValue(value));\n }\n }, [value]);\n\n React.useEffect(() => {\n if (onSearch) {\n debouncer(() => {\n onSearch(inputValue);\n });\n }\n }, [inputValue]);\n\n // show listbox based on input value\n React.useEffect(() => {\n // don't show the popover if the internal (input) value already is the current value\n // this prevents the popover showing after selecting a value or pressing escape\n const isCurrentValue = value !== undefined && value !== null && inputValue === String(value);\n\n if (inputValue && data.length && !isCurrentValue) {\n setCurrentIndex(0);\n\n if (!open) {\n setOpen(true);\n }\n } else {\n setOpen(false);\n }\n }, [inputValue, data]);\n\n React.useEffect(() => {\n if (open) {\n setCurrentIndex(getIndexFromValue(data, inputValue) || 0);\n } else {\n setCurrentIndex(undefined);\n }\n }, [open]);\n\n // event handlers\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>): void => {\n event.persist();\n\n if (listRef.current && event.relatedTarget === listRef.current) {\n event.preventDefault();\n return;\n }\n\n if (onChange && event.target.value !== value) {\n const item = findByValue(flattenedData, event.target.value);\n (event as any).detail = sanitizeItem(item);\n\n const parents = getOptionParents(flattenedData, item?.path);\n\n if (parents !== null && parents.length > 0) {\n (event as any).detail.parents = parents;\n }\n\n onChange(event);\n }\n\n if (props.onBlur) {\n props.onBlur(event);\n }\n };\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n setInputValue(event.target.value);\n };\n\n const handleInputClick = (event: React.MouseEvent<HTMLInputElement>): void => {\n if (inline || (!open && inputValue && data.length)) {\n setOpen(true);\n }\n\n if (onClick) {\n event.persist();\n onClick(event);\n }\n };\n\n const handleInputKeyDown = (event: React.KeyboardEvent<HTMLInputElement>): void => {\n event.persist();\n\n switch (event.key) {\n case 'Backspace': {\n return;\n }\n\n case 'Escape': {\n event.preventDefault();\n setInputValue(convertToInputValue(value));\n setOpen(false);\n return;\n }\n\n case 'Tab':\n case 'Enter': {\n if (event.key !== 'Tab') {\n event.preventDefault();\n }\n\n setCurrentValue(currentIndex);\n setOpen(false);\n return;\n }\n\n case 'ArrowDown':\n if (open) {\n event.preventDefault();\n } else {\n if (!inline && buttonRef.current) {\n buttonRef.current.click();\n }\n }\n break;\n\n case 'ArrowUp':\n case 'Home':\n case 'End': {\n if (open) {\n event.preventDefault();\n }\n break;\n }\n\n default:\n }\n\n // we aren't focused on the list, so manually forward the keydown event to it\n if (listRef.current) {\n listRef.current.dispatchEvent(createCustomKeyboardEvent(event));\n }\n\n if (inline && !open) {\n if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n event.preventDefault();\n const initialIndex = event.key === 'ArrowUp' ? data.length - 1 : 0;\n setCurrentIndex(currentIndex !== undefined ? currentIndex : initialIndex);\n setOpen(true);\n }\n }\n\n if (!event.isDefaultPrevented() && onKeyDown) {\n event.persist();\n onKeyDown(event);\n }\n };\n\n const handleListboxChange = (index: number): void => {\n setCurrentIndex(index);\n };\n\n const handleListboxClick = (event: React.MouseEvent<HTMLLIElement>, index: number): void => {\n event.preventDefault();\n setCurrentValue(index);\n setOpen(false);\n };\n\n const combobox = {\n 'aria-expanded': open,\n 'aria-owns': listId,\n 'aria-haspopup': 'listbox' as const,\n role: 'combobox',\n };\n\n const input = {\n ...props,\n 'aria-controls': listId,\n // Indicates that the autocomplete behavior of the text input is to suggest a list of possible values in a popup and that the suggestions\n // are related to the string that is present in the textbox\n 'aria-autocomplete': 'list' as const,\n // Enables assistive technologies to know which element the application regards as focused while DOM focus remains on the input element\n 'aria-activedescendant':\n currentIndex !== undefined && data[currentIndex] ? getId(listId, String(data[currentIndex].value)) : undefined,\n 'aria-labelledby': ariaLabelledBy,\n disabled,\n onBlur: !disabled && !readOnly ? handleInputBlur : undefined,\n onChange: !disabled && !readOnly ? handleInputChange : undefined,\n onClick: !disabled && !readOnly ? handleInputClick : undefined,\n onKeyDown: !disabled && !readOnly ? handleInputKeyDown : undefined,\n readOnly,\n ref: inputRef,\n type: 'text',\n value: inputValue ?? '',\n };\n\n const list: ScrollableListPropsWithRef = {\n 'aria-labelledby': ariaLabelledBy,\n data,\n disabled,\n id: listId,\n onChange: handleListboxChange,\n onClick: handleListboxClick,\n ref: listRef,\n scrollOnFocus: false,\n tabIndex: -1,\n value: currentIndex,\n };\n\n const button = {\n ref: buttonRef,\n };\n\n return {\n combobox,\n input,\n list,\n button,\n popover: {\n open,\n onOpenChange: setOpen,\n //visible: !data.length ? false : open,\n },\n };\n};\n"],"names":["debouncer","debounce","f","convertToInputValue","value","String","useCombobox","ariaLabel","ariaLabelledBy","data","unfilteredData","defaultValue","disabled","id","nativeId","inline","loading","__","onChange","onClick","onKeyDown","onSearch","readOnly","props","ref","inputRef","useMergedRef","buttonRef","React","listRef","open","setOpen","listId","uuid","inputValue","setInputValue","shouldFilterData","flattenedData","useFlattenedData","filterData","currentIndex","setCurrentIndex","undefined","getIndexFromValue","setInputValueByIndex","index","option","setInputValueByRef","current","setCurrentValue","isCurrentValue","length","handleInputBlur","event","persist","relatedTarget","preventDefault","target","item","findByValue","detail","sanitizeItem","parents","getOptionParents","path","onBlur","handleInputChange","handleInputClick","handleInputKeyDown","key","click","dispatchEvent","createCustomKeyboardEvent","initialIndex","isDefaultPrevented","handleListboxChange","handleListboxClick","combobox","role","input","getId","type","list","scrollOnFocus","tabIndex","button","popover","onOpenChange"],"mappings":";;;;;;;;AAkBA,MAAMA,SAAS,gBAAGC,QAAQ,CAACC,CAAC,IAAIA,CAAC,EAAE,EAAE,GAAG,CAAC;AAEzC,MAAMC,mBAAmB,GAAIC,KAA0C,IAAKC,MAAM,CAACD,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,EAAE,CAAC;MAUlFE,WAAW,GAAGA,CACvB;EACI,YAAY,EAAEC,SAAS;EACvB,iBAAiB,EAAEC,cAAc;EACjCC,IAAI,EAAEC,cAAc,GAAG,EAAE;EACzBC,YAAY;EACZC,QAAQ;EACRC,EAAE,EAAEC,QAAQ;EACZC,MAAM;EACNC,OAAO,EAAEC,EAAE;EACXC,QAAQ;EACRC,OAAO;EACPC,SAAS;EACTC,QAAQ;EACRC,QAAQ;EACRlB,KAAK;EACL,GAAGmB;CACyB,EAChCC,GAAgC;EAEhC,MAAMC,QAAQ,GAAGC,YAAY,CAAmBF,GAAG,CAAC;EACpD,MAAMG,SAAS,GAAGC,MAAY,CAAoB,IAAI,CAAC;EACvD,MAAMC,OAAO,GAAGD,MAAY,CAAmB,IAAI,CAAC;EACpD,MAAM,CAACE,IAAI,EAAEC,OAAO,CAAC,GAAGH,QAAc,CAAC,KAAK,CAAC;EAC7C,MAAMI,MAAM,GAAGJ,OAAa,CAAC,MAAMK,EAAI,EAAE,EAAE,EAAE,CAAC;EAC9C,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGP,QAAc,CAASzB,mBAAmB,CAACC,KAAK,CAAC,CAAC;EACtF,MAAMgC,gBAAgB,GAAG,CAACf,QAAQ,KAAK,CAACN,MAAM,IAAKA,MAAM,IAAImB,UAAU,KAAK/B,mBAAmB,CAACC,KAAK,CAAE,CAAC;EACxG,MAAMiC,aAAa,GA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X7D,GAAG,EAAEG;GACR;EAED,OAAO;IACHkD,QAAQ;IACRE,KAAK;IACLG,IAAI;IACJG,MAAM;IACNC,OAAO,EAAE;MACLxD,IAAI;MACJyD,YAAY,EAAExD;;GAGrB;AACL;;;;"}
|
@@ -5,7 +5,8 @@ const Field = /*#__PURE__*/forwardRef(function Field(props, ref) {
|
|
5
5
|
const {
|
6
6
|
disabled,
|
7
7
|
children,
|
8
|
-
|
8
|
+
error = false,
|
9
|
+
warning = false,
|
9
10
|
message,
|
10
11
|
...otherProps
|
11
12
|
} = props;
|
@@ -13,8 +14,9 @@ const Field = /*#__PURE__*/forwardRef(function Field(props, ref) {
|
|
13
14
|
'text-grey-300': disabled
|
14
15
|
}, props.className);
|
15
16
|
const messageClassName = cn('h-4 text-xs text-left leading-normal font-normal truncate -mb-4', {
|
16
|
-
'text-grey-700': !
|
17
|
-
'text-red-500':
|
17
|
+
'text-grey-700': !error && !warning,
|
18
|
+
'text-red-500': error,
|
19
|
+
'text-yellow-700': warning && !error,
|
18
20
|
'opacity-50': disabled
|
19
21
|
});
|
20
22
|
return /*#__PURE__*/createElement("label", Object.assign({}, otherProps, {
|
@@ -23,7 +25,7 @@ const Field = /*#__PURE__*/forwardRef(function Field(props, ref) {
|
|
23
25
|
ref: ref
|
24
26
|
}), children, message && /*#__PURE__*/createElement("span", {
|
25
27
|
className: messageClassName,
|
26
|
-
role:
|
28
|
+
role: error ? 'alert' : undefined
|
27
29
|
}, message));
|
28
30
|
});
|
29
31
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Field.js","sources":["../../../../../../../src/components/Field/Field.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\n\nimport './Field.css';\n\nexport type FieldProps = React.LabelHTMLAttributes<HTMLLabelElement> & {\n /** Content of the field */\n children: React.ReactNode;\n /**\tChanges the style to indicate the element is disabled */\n disabled?: boolean;\n /* Whether the input is in an
|
1
|
+
{"version":3,"file":"Field.js","sources":["../../../../../../../src/components/Field/Field.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\n\nimport './Field.css';\n\nexport type FieldProps = React.LabelHTMLAttributes<HTMLLabelElement> & {\n /** Content of the field */\n children: React.ReactNode;\n /**\tChanges the style to indicate the element is disabled */\n disabled?: boolean;\n /* Whether the input is in an error state */\n error?: boolean;\n /* Whether the input is in a warning state */\n warning?: boolean;\n /**\n * Text displayed below the children of Field.\n * Should be a short text that indicates feedback for user.\n */\n message?: string;\n};\n\nexport const Field = React.forwardRef(function Field(props: FieldProps, ref: React.Ref<HTMLLabelElement>) {\n const { disabled, children, error = false, warning = false, message, ...otherProps } = props;\n const className = cn(\n 'flex flex-col font-bold text-xs leading-loose pb-4 min-h-[theme(spacing.18)]',\n {\n 'text-grey-300': disabled,\n },\n props.className\n );\n const messageClassName = cn('h-4 text-xs text-left leading-normal font-normal truncate -mb-4', {\n 'text-grey-700': !error && !warning,\n 'text-red-500': error,\n 'text-yellow-700': warning && !error,\n 'opacity-50': disabled,\n });\n\n return (\n <label {...otherProps} className={className} data-taco=\"label\" ref={ref}>\n {children}\n {message && (\n <span className={messageClassName} role={error ? 'alert' : undefined}>\n {message}\n </span>\n )}\n </label>\n );\n});\n"],"names":["Field","React","props","ref","disabled","children","error","warning","message","otherProps","className","cn","messageClassName","role","undefined"],"mappings":";;;MAqBaA,KAAK,gBAAGC,UAAgB,CAAC,SAASD,KAAKA,CAACE,KAAiB,EAAEC,GAAgC;EACpG,MAAM;IAAEC,QAAQ;IAAEC,QAAQ;IAAEC,KAAK,GAAG,KAAK;IAAEC,OAAO,GAAG,KAAK;IAAEC,OAAO;IAAE,GAAGC;GAAY,GAAGP,KAAK;EAC5F,MAAMQ,SAAS,GAAGC,EAAE,CAChB,8EAA8E,EAC9E;IACI,eAAe,EAAEP;GACpB,EACDF,KAAK,CAACQ,SAAS,CAClB;EACD,MAAME,gBAAgB,GAAGD,EAAE,CAAC,iEAAiE,EAAE;IAC3F,eAAe,EAAE,CAACL,KAAK,IAAI,CAACC,OAAO;IACnC,cAAc,EAAED,KAAK;IACrB,iBAAiB,EAAEC,OAAO,IAAI,CAACD,KAAK;IACpC,YAAY,EAAEF;GACjB,CAAC;EAEF,oBACIH,yCAAWQ,UAAU;IAAEC,SAAS,EAAEA,SAAS;iBAAY,OAAO;IAACP,GAAG,EAAEA;MAC/DE,QAAQ,EACRG,OAAO,iBACJP;IAAMS,SAAS,EAAEE,gBAAgB;IAAEC,IAAI,EAAEP,KAAK,GAAG,OAAO,GAAGQ;KACtDN,OAAO,CAEf,CACG;AAEhB,CAAC;;;;"}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { forwardRef, createElement } from 'react';
|
2
|
+
|
3
|
+
function IconLocation(props, svgRef) {
|
4
|
+
return /*#__PURE__*/createElement("svg", Object.assign({
|
5
|
+
fill: "none",
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
7
|
+
viewBox: "0 0 24 24",
|
8
|
+
ref: svgRef
|
9
|
+
}, props), /*#__PURE__*/createElement("path", {
|
10
|
+
d: "M5.843 4.568a8.707 8.707 0 0112.314 12.314l-1.187 1.174c-.875.858-2.01 1.962-3.406 3.312a2.25 2.25 0 01-3.128 0l-3.491-3.396c-.44-.431-.806-.794-1.102-1.09a8.707 8.707 0 010-12.314zm11.253 1.06A7.207 7.207 0 106.903 15.822l1.488 1.468c.818.801 1.848 1.801 3.088 3a.75.75 0 001.042 0l3.395-3.3c.47-.461.863-.85 1.18-1.168a7.207 7.207 0 000-10.192zM12 7.999a3.002 3.002 0 110 6.004A3.002 3.002 0 0112 8zm0 1.5a1.502 1.502 0 100 3.004A1.502 1.502 0 0012 9.5z",
|
11
|
+
fill: "currentColor"
|
12
|
+
}));
|
13
|
+
}
|
14
|
+
var Location = /*#__PURE__*/forwardRef(IconLocation);
|
15
|
+
|
16
|
+
export default Location;
|
17
|
+
//# sourceMappingURL=Location.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Location.js","sources":["../../../../../../../../src/components/Icon/components/Location.tsx"],"sourcesContent":["import * as React from 'react';\nfunction IconLocation(props: React.SVGProps<SVGSVGElement>, svgRef?: React.Ref<SVGSVGElement>): JSX.Element {\n return (\n <svg fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" ref={svgRef} {...props}>\n <path\n d=\"M5.843 4.568a8.707 8.707 0 0112.314 12.314l-1.187 1.174c-.875.858-2.01 1.962-3.406 3.312a2.25 2.25 0 01-3.128 0l-3.491-3.396c-.44-.431-.806-.794-1.102-1.09a8.707 8.707 0 010-12.314zm11.253 1.06A7.207 7.207 0 106.903 15.822l1.488 1.468c.818.801 1.848 1.801 3.088 3a.75.75 0 001.042 0l3.395-3.3c.47-.461.863-.85 1.18-1.168a7.207 7.207 0 000-10.192zM12 7.999a3.002 3.002 0 110 6.004A3.002 3.002 0 0112 8zm0 1.5a1.502 1.502 0 100 3.004A1.502 1.502 0 0012 9.5z\"\n fill=\"currentColor\"\n />\n </svg>\n );\n}\nexport default React.forwardRef(IconLocation);\n"],"names":["IconLocation","props","svgRef","React","fill","xmlns","viewBox","ref","d"],"mappings":";;AACA,SAASA,YAAYA,CAACC,KAAoC,EAAEC,MAAiC;EACzF,oBACIC;IAAKC,IAAI,EAAC,MAAM;IAACC,KAAK,EAAC,4BAA4B;IAACC,OAAO,EAAC,WAAW;IAACC,GAAG,EAAEL;KAAYD,KAAK,gBAC1FE;IACIK,CAAC,EAAC,ycAAyc;IAC3cJ,IAAI,EAAC;IACP,CACA;AAEd;AACA,4BAAeD,UAAgB,CAACH,YAAY,CAAC;;;;"}
|
@@ -146,6 +146,7 @@ import Line from './Line.js';
|
|
146
146
|
import ListBulleted from './ListBulleted.js';
|
147
147
|
import ListSearch from './ListSearch.js';
|
148
148
|
import List from './List.js';
|
149
|
+
import Location from './Location.js';
|
149
150
|
import LockOpen from './LockOpen.js';
|
150
151
|
import Lock from './Lock.js';
|
151
152
|
import LogOut from './LogOut.js';
|
@@ -384,6 +385,7 @@ const icons = {
|
|
384
385
|
'list-bulleted': ListBulleted,
|
385
386
|
'list-search': ListSearch,
|
386
387
|
list: List,
|
388
|
+
location: Location,
|
387
389
|
'lock-open': LockOpen,
|
388
390
|
lock: Lock,
|
389
391
|
'log-out': LogOut,
|