slick-table 0.0.13 → 0.0.14
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/package.json +2 -1
- package/.prettierignore +0 -2
- package/.prettierrc +0 -22
- package/eslint.config.js +0 -23
- package/index.html +0 -13
- package/src/App.tsx +0 -9
- package/src/app/styles/global.scss +0 -31
- package/src/app/styles/slickgrid.scss +0 -13
- package/src/app/types/index.d.ts +0 -9
- package/src/entities/portal/index.ts +0 -3
- package/src/entities/portal/lib/index.ts +0 -1
- package/src/entities/portal/lib/visibility/index.ts +0 -1
- package/src/entities/portal/lib/visibility/makeVisible.ts +0 -9
- package/src/entities/portal/model/index.ts +0 -1
- package/src/entities/portal/model/portalId.ts +0 -1
- package/src/entities/portal/ui/Overlay/Overlay.style.ts +0 -14
- package/src/entities/portal/ui/Overlay/Overlay.test.tsx +0 -19
- package/src/entities/portal/ui/Overlay/Overlay.tsx +0 -20
- package/src/entities/portal/ui/Overlay/index.ts +0 -1
- package/src/entities/portal/ui/Portal.style.ts +0 -20
- package/src/entities/portal/ui/Portal.test.tsx +0 -48
- package/src/entities/portal/ui/Portal.tsx +0 -26
- package/src/entities/portal/ui/index.ts +0 -1
- package/src/features/column-filters/index.ts +0 -1
- package/src/features/column-filters/lib/filter/applyFilter.ts +0 -25
- package/src/features/column-filters/lib/filter/index.ts +0 -1
- package/src/features/column-filters/lib/hooks/index.ts +0 -2
- package/src/features/column-filters/lib/hooks/useOpenMenu.ts +0 -43
- package/src/features/column-filters/lib/hooks/useSubscribeToEvent.ts +0 -17
- package/src/features/column-filters/lib/index.ts +0 -4
- package/src/features/column-filters/lib/props/datePickerProps.tsx +0 -11
- package/src/features/column-filters/lib/props/index.ts +0 -1
- package/src/features/column-filters/lib/select/firstIn.ts +0 -22
- package/src/features/column-filters/lib/select/index.ts +0 -1
- package/src/features/column-filters/model/consts/defaultValue.ts +0 -6
- package/src/features/column-filters/model/consts/index.ts +0 -2
- package/src/features/column-filters/model/consts/label.ts +0 -5
- package/src/features/column-filters/model/index.ts +0 -2
- package/src/features/column-filters/model/types/IProps.ts +0 -9
- package/src/features/column-filters/model/types/index.ts +0 -1
- package/src/features/column-filters/ui/BooleanInput/BooleanInput.style.ts +0 -10
- package/src/features/column-filters/ui/BooleanInput/BooleanInput.tsx +0 -53
- package/src/features/column-filters/ui/BooleanInput/index.ts +0 -1
- package/src/features/column-filters/ui/ButtonReset/ButtonReset.style.ts +0 -10
- package/src/features/column-filters/ui/ButtonReset/ButtonReset.tsx +0 -39
- package/src/features/column-filters/ui/ButtonReset/index.ts +0 -1
- package/src/features/column-filters/ui/ColumnFilters.style.ts +0 -12
- package/src/features/column-filters/ui/ColumnFilters.tsx +0 -41
- package/src/features/column-filters/ui/DateBetween/DateBetween.tsx +0 -52
- package/src/features/column-filters/ui/DateBetween/index.ts +0 -1
- package/src/features/column-filters/ui/DateInput/DateInput.tsx +0 -36
- package/src/features/column-filters/ui/DateInput/index.ts +0 -1
- package/src/features/column-filters/ui/InputArea/InputArea.tsx +0 -63
- package/src/features/column-filters/ui/InputArea/index.ts +0 -1
- package/src/features/column-filters/ui/MultipleSelect/index.ts +0 -1
- package/src/features/column-filters/ui/MultipleSelect/lib/index.ts +0 -2
- package/src/features/column-filters/ui/MultipleSelect/lib/props/index.ts +0 -1
- package/src/features/column-filters/ui/MultipleSelect/lib/props/props.ts +0 -36
- package/src/features/column-filters/ui/MultipleSelect/lib/sorting/ascending.ts +0 -17
- package/src/features/column-filters/ui/MultipleSelect/lib/sorting/index.ts +0 -1
- package/src/features/column-filters/ui/MultipleSelect/model/IValue.ts +0 -1
- package/src/features/column-filters/ui/MultipleSelect/model/index.ts +0 -1
- package/src/features/column-filters/ui/MultipleSelect/ui/MultipleSelect.style.ts +0 -9
- package/src/features/column-filters/ui/MultipleSelect/ui/MultipleSelect.tsx +0 -72
- package/src/features/column-filters/ui/MultipleSelect/ui/index.ts +0 -1
- package/src/features/column-filters/ui/NumberBetween/NumberBetween.tsx +0 -42
- package/src/features/column-filters/ui/NumberBetween/index.ts +0 -1
- package/src/features/column-filters/ui/NumberInput/NumberInput.tsx +0 -24
- package/src/features/column-filters/ui/NumberInput/index.ts +0 -1
- package/src/features/column-filters/ui/SelectFilter/index.ts +0 -1
- package/src/features/column-filters/ui/SelectFilter/model/index.ts +0 -1
- package/src/features/column-filters/ui/SelectFilter/model/options/index.ts +0 -1
- package/src/features/column-filters/ui/SelectFilter/model/options/options.ts +0 -66
- package/src/features/column-filters/ui/SelectFilter/ui/SelectFilter.tsx +0 -50
- package/src/features/column-filters/ui/SelectFilter/ui/index.ts +0 -1
- package/src/features/column-filters/ui/TextInput/TextInput.tsx +0 -23
- package/src/features/column-filters/ui/TextInput/index.ts +0 -1
- package/src/features/column-filters/ui/index.ts +0 -1
- package/src/features/context-menu/index.ts +0 -1
- package/src/features/context-menu/lib/hooks/index.ts +0 -1
- package/src/features/context-menu/lib/hooks/useSubscribeToEvent.ts +0 -25
- package/src/features/context-menu/lib/index.ts +0 -1
- package/src/features/context-menu/ui/ButtonDownloadCSV/ButtonDownloadCSV.tsx +0 -34
- package/src/features/context-menu/ui/ButtonDownloadCSV/index.ts +0 -1
- package/src/features/context-menu/ui/ButtonGroup/ButtonGroup.tsx +0 -28
- package/src/features/context-menu/ui/ButtonGroup/index.ts +0 -1
- package/src/features/context-menu/ui/ButtonResetFilters/index.ts +0 -1
- package/src/features/context-menu/ui/ButtonResetFilters/lib/index.ts +0 -1
- package/src/features/context-menu/ui/ButtonResetFilters/lib/visibility/hasFiltersApplied.ts +0 -8
- package/src/features/context-menu/ui/ButtonResetFilters/lib/visibility/index.ts +0 -1
- package/src/features/context-menu/ui/ButtonResetFilters/ui/ButtonResetFilters.tsx +0 -39
- package/src/features/context-menu/ui/ButtonResetFilters/ui/index.ts +0 -1
- package/src/features/context-menu/ui/ButtonUngroup/ButtonUngroup.tsx +0 -28
- package/src/features/context-menu/ui/ButtonUngroup/index.ts +0 -1
- package/src/features/context-menu/ui/CollapseAll/CollapseAll.tsx +0 -31
- package/src/features/context-menu/ui/CollapseAll/index.ts +0 -1
- package/src/features/context-menu/ui/ContextMenu.style.ts +0 -29
- package/src/features/context-menu/ui/ContextMenu.tsx +0 -51
- package/src/features/context-menu/ui/CopyToClipboard/CopyToClipboard.tsx +0 -42
- package/src/features/context-menu/ui/CopyToClipboard/index.ts +0 -1
- package/src/features/context-menu/ui/ExpandAll/ExpandAll.tsx +0 -30
- package/src/features/context-menu/ui/ExpandAll/index.ts +0 -1
- package/src/features/context-menu/ui/Print/index.ts +0 -1
- package/src/features/context-menu/ui/Print/ui/Print.tsx +0 -25
- package/src/features/context-menu/ui/Print/ui/index.ts +0 -1
- package/src/features/context-menu/ui/index.ts +0 -1
- package/src/index.scss +0 -2
- package/src/index.ts +0 -5
- package/src/main.tsx +0 -15
- package/src/pages/main/index.ts +0 -1
- package/src/pages/main/lib/columns.ts +0 -33
- package/src/pages/main/lib/index.ts +0 -3
- package/src/pages/main/lib/options.ts +0 -6
- package/src/pages/main/lib/table.ts +0 -11
- package/src/pages/main/ui/Main.style.ts +0 -18
- package/src/pages/main/ui/Main.tsx +0 -30
- package/src/pages/main/ui/index.ts +0 -1
- package/src/setupTests.ts +0 -5
- package/src/shared/lib/an-event/index.ts +0 -31
- package/src/shared/lib/datetime/dateToString.spec.ts +0 -11
- package/src/shared/lib/datetime/dateToString.ts +0 -8
- package/src/shared/lib/datetime/getTime.spec.ts +0 -10
- package/src/shared/lib/datetime/getTime.ts +0 -3
- package/src/shared/lib/datetime/index.ts +0 -2
- package/src/shared/lib/debounce/index.ts +0 -11
- package/src/shared/lib/dom/elementNotVisible.spec.ts +0 -72
- package/src/shared/lib/dom/elementNotVisible.ts +0 -9
- package/src/shared/lib/dom/index.ts +0 -1
- package/src/shared/lib/format/IOptions.ts +0 -11
- package/src/shared/lib/format/addParentheses.spec.ts +0 -9
- package/src/shared/lib/format/addParentheses.ts +0 -7
- package/src/shared/lib/format/formatNumber.spec.ts +0 -50
- package/src/shared/lib/format/formatNumber.ts +0 -62
- package/src/shared/lib/format/index.ts +0 -2
- package/src/shared/lib/numbers/index.ts +0 -1
- package/src/shared/lib/numbers/toNumber.spec.ts +0 -25
- package/src/shared/lib/numbers/toNumber.ts +0 -11
- package/src/shared/lib/regexp/dates.spec.ts +0 -23
- package/src/shared/lib/regexp/dates.ts +0 -6
- package/src/shared/lib/regexp/escapeSpecialChar.spec.ts +0 -24
- package/src/shared/lib/regexp/escapeSpecialChar.ts +0 -4
- package/src/shared/lib/regexp/index.ts +0 -2
- package/src/shared/lib/slickgrid/index.ts +0 -68
- package/src/shared/lib/slickgrid/lib/callbacks/getOnKeyDownCallback.ts +0 -12
- package/src/shared/lib/slickgrid/lib/callbacks/index.ts +0 -4
- package/src/shared/lib/slickgrid/lib/callbacks/onCellChange.ts +0 -14
- package/src/shared/lib/slickgrid/lib/callbacks/onRowCountChanged.ts +0 -12
- package/src/shared/lib/slickgrid/lib/callbacks/onRowsChanged.ts +0 -8
- package/src/shared/lib/slickgrid/lib/contextMenu/index.ts +0 -1
- package/src/shared/lib/slickgrid/lib/contextMenu/openContextMenu.ts +0 -17
- package/src/shared/lib/slickgrid/lib/editors/Autocomplete/Autocomplete.ts +0 -152
- package/src/shared/lib/slickgrid/lib/editors/Autocomplete/EditorAutocomplete.ts +0 -66
- package/src/shared/lib/slickgrid/lib/editors/Autocomplete/EditorSelectWithSearch.ts +0 -79
- package/src/shared/lib/slickgrid/lib/editors/Autocomplete/index.ts +0 -3
- package/src/shared/lib/slickgrid/lib/editors/EditorAmount.ts +0 -82
- package/src/shared/lib/slickgrid/lib/editors/EditorDate.ts +0 -127
- package/src/shared/lib/slickgrid/lib/editors/EditorSelectNumber.ts +0 -16
- package/src/shared/lib/slickgrid/lib/editors/EditorSelectString.ts +0 -95
- package/src/shared/lib/slickgrid/lib/editors/index.ts +0 -9
- package/src/shared/lib/slickgrid/lib/formatters/DateFormatter.ts +0 -9
- package/src/shared/lib/slickgrid/lib/formatters/FormatterCheck.ts +0 -11
- package/src/shared/lib/slickgrid/lib/formatters/PercentFormatter.spec.ts +0 -11
- package/src/shared/lib/slickgrid/lib/formatters/PercentFormatter.ts +0 -8
- package/src/shared/lib/slickgrid/lib/formatters/StringFormatter.ts +0 -2
- package/src/shared/lib/slickgrid/lib/formatters/getFormatterNumber.ts +0 -17
- package/src/shared/lib/slickgrid/lib/formatters/index.ts +0 -5
- package/src/shared/lib/slickgrid/lib/functions/addNewRow.ts +0 -23
- package/src/shared/lib/slickgrid/lib/functions/commitCurrentEdit.ts +0 -6
- package/src/shared/lib/slickgrid/lib/functions/copySelectedRows.ts +0 -35
- package/src/shared/lib/slickgrid/lib/functions/deleteRows.ts +0 -20
- package/src/shared/lib/slickgrid/lib/functions/getActiveRowId.ts +0 -16
- package/src/shared/lib/slickgrid/lib/functions/getDisplayedRows.ts +0 -13
- package/src/shared/lib/slickgrid/lib/functions/getLastRow.ts +0 -6
- package/src/shared/lib/slickgrid/lib/functions/getMaxId.ts +0 -13
- package/src/shared/lib/slickgrid/lib/functions/index.ts +0 -10
- package/src/shared/lib/slickgrid/lib/functions/isDeletionDangerous.ts +0 -21
- package/src/shared/lib/slickgrid/lib/functions/wereEdited.ts +0 -12
- package/src/shared/lib/slickgrid/lib/grouping/index.ts +0 -1
- package/src/shared/lib/slickgrid/lib/grouping/sumTotalsFormatter.ts +0 -21
- package/src/shared/lib/slickgrid/lib/highlighting/getColumnsHash.ts +0 -8
- package/src/shared/lib/slickgrid/lib/highlighting/highlightCell.ts +0 -21
- package/src/shared/lib/slickgrid/lib/highlighting/highlightColumns.ts +0 -24
- package/src/shared/lib/slickgrid/lib/highlighting/index.ts +0 -2
- package/src/shared/lib/slickgrid/lib/hooks/eventClickOnTable.ts +0 -17
- package/src/shared/lib/slickgrid/lib/hooks/index.ts +0 -3
- package/src/shared/lib/slickgrid/lib/hooks/useHotKeys.ts +0 -39
- package/src/shared/lib/slickgrid/lib/hooks/useListenIfTablesWereEdited.ts +0 -36
- package/src/shared/lib/slickgrid/lib/hooks/useUpdateTotal.ts +0 -19
- package/src/shared/lib/slickgrid/lib/hotKeys/hotKeysCopy.ts +0 -7
- package/src/shared/lib/slickgrid/lib/hotKeys/hotKeysDelete.ts +0 -7
- package/src/shared/lib/slickgrid/lib/hotKeys/hotKeysRedo.ts +0 -7
- package/src/shared/lib/slickgrid/lib/hotKeys/hotKeysReverse.ts +0 -7
- package/src/shared/lib/slickgrid/lib/hotKeys/hotKeysUndo.ts +0 -7
- package/src/shared/lib/slickgrid/lib/hotKeys/index.ts +0 -7
- package/src/shared/lib/slickgrid/lib/hotKeys/nothingToCopy.ts +0 -14
- package/src/shared/lib/slickgrid/lib/hotKeys/positionToPaste.ts +0 -12
- package/src/shared/lib/slickgrid/lib/index.ts +0 -59
- package/src/shared/lib/slickgrid/lib/selection/getUpdates.ts +0 -41
- package/src/shared/lib/slickgrid/lib/selection/index.ts +0 -2
- package/src/shared/lib/slickgrid/lib/selection/selectedRows.ts +0 -17
- package/src/shared/lib/slickgrid/lib/sorting/ColumnSorter.ts +0 -89
- package/src/shared/lib/slickgrid/lib/sorting/index.ts +0 -1
- package/src/shared/lib/slickgrid/lib/totals-row/addTitle.ts +0 -8
- package/src/shared/lib/slickgrid/lib/totals-row/addTotalSum.ts +0 -16
- package/src/shared/lib/slickgrid/lib/totals-row/index.ts +0 -2
- package/src/shared/lib/slickgrid/lib/totals-row/totalAmountOf.ts +0 -13
- package/src/shared/lib/slickgrid/lib/totals-row/updateTotal.ts +0 -25
- package/src/shared/lib/slickgrid/lib/totals-row/updateTotals.ts +0 -10
- package/src/shared/lib/slickgrid/lib/validators/DateValidator.ts +0 -12
- package/src/shared/lib/slickgrid/lib/validators/EmptyStringValidator.ts +0 -5
- package/src/shared/lib/slickgrid/lib/validators/LengthValidator.ts +0 -7
- package/src/shared/lib/slickgrid/lib/validators/index.ts +0 -3
- package/src/shared/lib/slickgrid/model/SlickTable/csvDownloadManager/DownloadManager.ts +0 -110
- package/src/shared/lib/slickgrid/model/SlickTable/csvDownloadManager/index.ts +0 -1
- package/src/shared/lib/slickgrid/model/SlickTable/filters/DeletedRowsFilter.test.ts +0 -36
- package/src/shared/lib/slickgrid/model/SlickTable/filters/DeletedRowsFilter.ts +0 -12
- package/src/shared/lib/slickgrid/model/SlickTable/filters/Filter.ts +0 -54
- package/src/shared/lib/slickgrid/model/SlickTable/filters/WithoutFilter.ts +0 -30
- package/src/shared/lib/slickgrid/model/SlickTable/filters/decorators/ColumnFilter/DecoratorColumnFilter.ts +0 -53
- package/src/shared/lib/slickgrid/model/SlickTable/filters/decorators/ColumnFilter/Filter.ts +0 -108
- package/src/shared/lib/slickgrid/model/SlickTable/filters/decorators/ColumnFilter/index.ts +0 -1
- package/src/shared/lib/slickgrid/model/SlickTable/filters/decorators/DecoratorEndingDate.ts +0 -16
- package/src/shared/lib/slickgrid/model/SlickTable/filters/decorators/DecoratorFilter.ts +0 -55
- package/src/shared/lib/slickgrid/model/SlickTable/filters/decorators/DecoratorPeriod.ts +0 -24
- package/src/shared/lib/slickgrid/model/SlickTable/filters/decorators/index.ts +0 -4
- package/src/shared/lib/slickgrid/model/SlickTable/filters/index.ts +0 -9
- package/src/shared/lib/slickgrid/model/SlickTable/hotKeys/DefaultHotKeys.ts +0 -118
- package/src/shared/lib/slickgrid/model/SlickTable/hotKeys/WithoutHotKeys.ts +0 -20
- package/src/shared/lib/slickgrid/model/SlickTable/hotKeys/decorators/HotKeysDecorator.ts +0 -32
- package/src/shared/lib/slickgrid/model/SlickTable/hotKeys/decorators/PreventCopying.ts +0 -21
- package/src/shared/lib/slickgrid/model/SlickTable/hotKeys/decorators/RedoUndoOnly.ts +0 -25
- package/src/shared/lib/slickgrid/model/SlickTable/hotKeys/decorators/WithConfirmationOfDeletion.ts +0 -33
- package/src/shared/lib/slickgrid/model/SlickTable/hotKeys/decorators/index.ts +0 -4
- package/src/shared/lib/slickgrid/model/SlickTable/hotKeys/index.ts +0 -9
- package/src/shared/lib/slickgrid/model/SlickTable/index.ts +0 -18
- package/src/shared/lib/slickgrid/model/SlickTable/printer/DefaultPrinter.ts +0 -179
- package/src/shared/lib/slickgrid/model/SlickTable/printer/index.ts +0 -1
- package/src/shared/lib/slickgrid/model/SlickTable/printer/model/consts/cssStyles.ts +0 -46
- package/src/shared/lib/slickgrid/model/SlickTable/printer/model/consts/index.ts +0 -1
- package/src/shared/lib/slickgrid/model/SlickTable/printer/model/index.ts +0 -1
- package/src/shared/lib/slickgrid/model/SlickTable/table/SlickTable.ts +0 -148
- package/src/shared/lib/slickgrid/model/SlickTable/table/index.ts +0 -1
- package/src/shared/lib/slickgrid/model/events/eventContextMenu.ts +0 -10
- package/src/shared/lib/slickgrid/model/events/index.ts +0 -1
- package/src/shared/lib/slickgrid/model/index.ts +0 -17
- package/src/shared/lib/slickgrid/ui/HeaderButtons/index.ts +0 -2
- package/src/shared/lib/slickgrid/ui/HeaderButtons/lib/handleClick/handleHeaderButtons.ts +0 -27
- package/src/shared/lib/slickgrid/ui/HeaderButtons/lib/handleClick/index.ts +0 -1
- package/src/shared/lib/slickgrid/ui/HeaderButtons/lib/highlighting/headerButtons.ts +0 -45
- package/src/shared/lib/slickgrid/ui/HeaderButtons/lib/highlighting/index.ts +0 -1
- package/src/shared/lib/slickgrid/ui/HeaderButtons/lib/index.ts +0 -2
- package/src/shared/lib/slickgrid/ui/HeaderButtons/model/buttons/index.ts +0 -1
- package/src/shared/lib/slickgrid/ui/HeaderButtons/model/buttons/openColumnFilter.ts +0 -10
- package/src/shared/lib/slickgrid/ui/HeaderButtons/model/event/eventOpenColumnFilters.ts +0 -13
- package/src/shared/lib/slickgrid/ui/HeaderButtons/model/event/index.ts +0 -1
- package/src/shared/lib/slickgrid/ui/HeaderButtons/model/index.ts +0 -2
- package/src/shared/lib/slickgrid/ui/SlickgridTable/index.ts +0 -1
- package/src/shared/lib/slickgrid/ui/SlickgridTable/lib/callbacks/index.ts +0 -1
- package/src/shared/lib/slickgrid/ui/SlickgridTable/lib/callbacks/onAddNewRow.ts +0 -34
- package/src/shared/lib/slickgrid/ui/SlickgridTable/lib/hooks/index.ts +0 -1
- package/src/shared/lib/slickgrid/ui/SlickgridTable/lib/hooks/useGrid.ts +0 -140
- package/src/shared/lib/slickgrid/ui/SlickgridTable/lib/index.ts +0 -2
- package/src/shared/lib/slickgrid/ui/SlickgridTable/model/defaultOptions.ts +0 -8
- package/src/shared/lib/slickgrid/ui/SlickgridTable/model/index.ts +0 -2
- package/src/shared/lib/slickgrid/ui/SlickgridTable/model/types/Props.ts +0 -42
- package/src/shared/lib/slickgrid/ui/SlickgridTable/model/types/index.ts +0 -1
- package/src/shared/lib/slickgrid/ui/SlickgridTable/ui/SlickgridTable.tsx +0 -51
- package/src/shared/lib/slickgrid/ui/SlickgridTable/ui/index.ts +0 -1
- package/src/shared/lib/slickgrid/ui/columns/columnCheckboxSelector/columnCheckboxSelector.ts +0 -7
- package/src/shared/lib/slickgrid/ui/columns/columnCheckboxSelector/index.ts +0 -1
- package/src/shared/lib/slickgrid/ui/columns/columnIsEdited/index.ts +0 -1
- package/src/shared/lib/slickgrid/ui/columns/columnIsEdited/lib/index.ts +0 -1
- package/src/shared/lib/slickgrid/ui/columns/columnIsEdited/lib/setEditedMark.spec.ts +0 -11
- package/src/shared/lib/slickgrid/ui/columns/columnIsEdited/lib/setEditedMark.ts +0 -7
- package/src/shared/lib/slickgrid/ui/columns/columnIsEdited/ui/columnIsEdited.ts +0 -16
- package/src/shared/lib/slickgrid/ui/columns/columnIsEdited/ui/index.ts +0 -1
- package/src/shared/lib/slickgrid/ui/columns/index.ts +0 -2
- package/src/shared/lib/slickgrid/ui/index.ts +0 -9
- package/src/shared/lib/slickgrid/ui/styles/WithTableStyles/WithTableStyles.style.ts +0 -156
- package/src/shared/lib/slickgrid/ui/styles/WithTableStyles/WithTableStyles.tsx +0 -11
- package/src/shared/lib/slickgrid/ui/styles/WithTableStyles/index.ts +0 -1
- package/src/shared/lib/slickgrid/ui/styles/index.ts +0 -1
- package/src/shared/lib/slickgrid/ui/styles/keyframes/index.ts +0 -1
- package/src/shared/lib/slickgrid/ui/styles/keyframes/wink.ts +0 -7
- package/src/shared/lib/sorting/Sort.ts +0 -26
- package/src/shared/lib/sorting/index.ts +0 -1
- package/src/shared/lib/stringCalculator/index.ts +0 -2
- package/src/shared/lib/stringCalculator/stringCalculator.js +0 -834
- package/src/shared/lib/stringCalculator/stringCalculator.spec.ts +0 -16
- package/src/shared/lib/strings/deleteDoubleQuotes.spec.ts +0 -11
- package/src/shared/lib/strings/deleteDoubleQuotes.ts +0 -5
- package/src/shared/lib/strings/index.ts +0 -3
- package/src/shared/lib/strings/removeHtml.spec.ts +0 -29
- package/src/shared/lib/strings/removeHtml.ts +0 -5
- package/src/shared/lib/strings/toStringWithCommas.spec.ts +0 -16
- package/src/shared/lib/strings/toStringWithCommas.ts +0 -15
- package/src/shared/model/consts/columnId.ts +0 -1
- package/src/shared/model/consts/dateFormats.ts +0 -5
- package/src/shared/model/consts/index.ts +0 -4
- package/src/shared/model/consts/invalidDate.ts +0 -1
- package/src/shared/model/consts/noPrivilegesMessage.ts +0 -1
- package/src/shared/model/enums/EColumnFilter.ts +0 -16
- package/src/shared/model/enums/EColumnFiltersGroup.ts +0 -10
- package/src/shared/model/enums/EDateFormat.ts +0 -11
- package/src/shared/model/enums/EKey.ts +0 -8
- package/src/shared/model/enums/EKeyCode.ts +0 -8
- package/src/shared/model/enums/ESortType.ts +0 -6
- package/src/shared/model/enums/index.ts +0 -6
- package/src/shared/model/types/IArguments.ts +0 -14
- package/src/shared/model/types/IColumn.ts +0 -13
- package/src/shared/model/types/IColumnFilterValue.ts +0 -4
- package/src/shared/model/types/IDownloadManager.ts +0 -6
- package/src/shared/model/types/IEditedRow.ts +0 -5
- package/src/shared/model/types/IExternalVariables.ts +0 -1
- package/src/shared/model/types/IFilter.ts +0 -30
- package/src/shared/model/types/IGrouping.ts +0 -12
- package/src/shared/model/types/IHotKeysBehavior.ts +0 -15
- package/src/shared/model/types/IObserver.ts +0 -3
- package/src/shared/model/types/IPrinter.ts +0 -24
- package/src/shared/model/types/ISlickRow.ts +0 -1
- package/src/shared/model/types/ISlickTable.ts +0 -38
- package/src/shared/model/types/TGridRow.ts +0 -6
- package/src/shared/model/types/index.ts +0 -14
- package/src/shared/ui/ContextSelect/ContextSelect.style.ts +0 -9
- package/src/shared/ui/ContextSelect/ContextSelect.tsx +0 -87
- package/src/shared/ui/ContextSelect/index.ts +0 -2
- package/src/shared/ui/notification/index.ts +0 -1
- package/src/shared/ui/notification/model/index.ts +0 -1
- package/src/shared/ui/notification/ui/index.style.ts +0 -13
- package/src/shared/ui/notification/ui/index.tsx +0 -41
- package/src/shared/ui/styles/WithDatePickerStyles.ts +0 -11
- package/src/shared/ui/styles/index.ts +0 -1
- package/src/vite-env.d.ts +0 -1
- package/tsconfig.build-types.json +0 -21
- package/tsconfig.build.json +0 -17
- package/tsconfig.json +0 -23
- package/vite.config.ts +0 -34
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { FC, useState } from "react";
|
|
2
|
-
|
|
3
|
-
import { EColumnFilter } from "shared/model/enums";
|
|
4
|
-
import { IColumnFilterValue } from "shared/model/types";
|
|
5
|
-
|
|
6
|
-
import { Portal } from "entities/portal";
|
|
7
|
-
|
|
8
|
-
import { useOpenMenu, useSubscribeToEvent } from "../lib";
|
|
9
|
-
import { defaultValue } from "../model";
|
|
10
|
-
import { ButtonReset } from "./ButtonReset";
|
|
11
|
-
import { InputArea } from "./InputArea";
|
|
12
|
-
import { SelectFilter } from "./SelectFilter";
|
|
13
|
-
|
|
14
|
-
import Styled from "./ColumnFilters.style";
|
|
15
|
-
|
|
16
|
-
export const ColumnFilters: FC = () => {
|
|
17
|
-
const [value, setValue] = useState<IColumnFilterValue>(defaultValue);
|
|
18
|
-
const [filterId, setFilterId] = useState<EColumnFilter>(
|
|
19
|
-
EColumnFilter.TextContain,
|
|
20
|
-
);
|
|
21
|
-
const [isOpened, setIsOpened] = useState(false);
|
|
22
|
-
|
|
23
|
-
useSubscribeToEvent(setIsOpened);
|
|
24
|
-
useOpenMenu(isOpened, setFilterId, setValue);
|
|
25
|
-
|
|
26
|
-
if (!isOpened) return null;
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<Portal setIsOpened={setIsOpened}>
|
|
30
|
-
<Styled.Wrapper>
|
|
31
|
-
<SelectFilter filterId={filterId} setFilterId={setFilterId} />
|
|
32
|
-
<InputArea filterId={filterId} setValue={setValue} value={value} />
|
|
33
|
-
<ButtonReset
|
|
34
|
-
setIsOpened={setIsOpened}
|
|
35
|
-
setValue={setValue}
|
|
36
|
-
value={value}
|
|
37
|
-
/>
|
|
38
|
-
</Styled.Wrapper>
|
|
39
|
-
</Portal>
|
|
40
|
-
);
|
|
41
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { AdapterMoment } from "@mui/x-date-pickers/AdapterMoment";
|
|
2
|
-
import { DatePicker } from "@mui/x-date-pickers/DatePicker";
|
|
3
|
-
import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider";
|
|
4
|
-
import { Moment } from "moment/moment";
|
|
5
|
-
import { FC } from "react";
|
|
6
|
-
|
|
7
|
-
import { INVALID_DATE } from "shared/model/consts";
|
|
8
|
-
import { EDateFormat } from "shared/model/enums";
|
|
9
|
-
import { WithDatePickerStyles } from "shared/ui/styles";
|
|
10
|
-
|
|
11
|
-
import { applyFilter, datePickerProps } from "../../lib";
|
|
12
|
-
import { IProps, defaultValue, label } from "../../model";
|
|
13
|
-
|
|
14
|
-
export const DateBetween: FC<Omit<IProps, "label">> = ({ setValue, value }) => {
|
|
15
|
-
function onChange1(date: Moment | null) {
|
|
16
|
-
const dayString = date?.format(EDateFormat.db) || "";
|
|
17
|
-
const newValue = {
|
|
18
|
-
...value,
|
|
19
|
-
1: dayString === INVALID_DATE ? defaultValue[1] : dayString,
|
|
20
|
-
};
|
|
21
|
-
setValue(newValue);
|
|
22
|
-
applyFilter(newValue);
|
|
23
|
-
}
|
|
24
|
-
function onChange2(date: Moment | null) {
|
|
25
|
-
const dayString = date?.format(EDateFormat.db) || "";
|
|
26
|
-
const newValue = {
|
|
27
|
-
...value,
|
|
28
|
-
2: dayString === INVALID_DATE ? defaultValue[2] : dayString,
|
|
29
|
-
};
|
|
30
|
-
setValue(newValue);
|
|
31
|
-
applyFilter(newValue);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<LocalizationProvider dateAdapter={AdapterMoment}>
|
|
36
|
-
<WithDatePickerStyles>
|
|
37
|
-
<DatePicker
|
|
38
|
-
label={label.from}
|
|
39
|
-
onChange={onChange1}
|
|
40
|
-
{...datePickerProps(value[1])}
|
|
41
|
-
/>
|
|
42
|
-
</WithDatePickerStyles>
|
|
43
|
-
<WithDatePickerStyles>
|
|
44
|
-
<DatePicker
|
|
45
|
-
label={label.to}
|
|
46
|
-
onChange={onChange2}
|
|
47
|
-
{...datePickerProps(value[2])}
|
|
48
|
-
/>
|
|
49
|
-
</WithDatePickerStyles>
|
|
50
|
-
</LocalizationProvider>
|
|
51
|
-
);
|
|
52
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { DateBetween } from "./DateBetween";
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { AdapterMoment } from "@mui/x-date-pickers/AdapterMoment";
|
|
2
|
-
import { DatePicker } from "@mui/x-date-pickers/DatePicker";
|
|
3
|
-
import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider";
|
|
4
|
-
import { Moment } from "moment/moment";
|
|
5
|
-
import { FC } from "react";
|
|
6
|
-
|
|
7
|
-
import { INVALID_DATE } from "shared/model/consts";
|
|
8
|
-
import { EDateFormat } from "shared/model/enums";
|
|
9
|
-
import { WithDatePickerStyles } from "shared/ui/styles";
|
|
10
|
-
|
|
11
|
-
import { applyFilter, datePickerProps } from "../../lib";
|
|
12
|
-
import { IProps, defaultValue } from "../../model";
|
|
13
|
-
|
|
14
|
-
export const DateInput: FC<IProps> = ({ label, setValue, value }) => {
|
|
15
|
-
function onChange(date: Moment | null) {
|
|
16
|
-
const dayString = date?.format(EDateFormat.db) || "";
|
|
17
|
-
const newValue = {
|
|
18
|
-
...value,
|
|
19
|
-
1: dayString === INVALID_DATE ? defaultValue[1] : dayString,
|
|
20
|
-
};
|
|
21
|
-
setValue(newValue);
|
|
22
|
-
applyFilter(newValue);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<LocalizationProvider dateAdapter={AdapterMoment}>
|
|
27
|
-
<WithDatePickerStyles>
|
|
28
|
-
<DatePicker
|
|
29
|
-
label={label}
|
|
30
|
-
onChange={onChange}
|
|
31
|
-
{...datePickerProps(value[1])}
|
|
32
|
-
/>
|
|
33
|
-
</WithDatePickerStyles>
|
|
34
|
-
</LocalizationProvider>
|
|
35
|
-
);
|
|
36
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { DateInput } from "./DateInput";
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { FC, Fragment } from "react";
|
|
2
|
-
|
|
3
|
-
import { EColumnFilter } from "shared/model/enums";
|
|
4
|
-
|
|
5
|
-
import { IProps, label } from "../../model";
|
|
6
|
-
import { BooleanInput } from "../BooleanInput";
|
|
7
|
-
import { DateBetween } from "../DateBetween";
|
|
8
|
-
import { DateInput } from "../DateInput";
|
|
9
|
-
import { MultipleSelect } from "../MultipleSelect";
|
|
10
|
-
import { NumberBetween } from "../NumberBetween";
|
|
11
|
-
import { NumberInput } from "../NumberInput";
|
|
12
|
-
import { TextInput } from "../TextInput";
|
|
13
|
-
|
|
14
|
-
export const InputArea: FC<Props> = ({ filterId, setValue, value }) => {
|
|
15
|
-
return (
|
|
16
|
-
<Fragment>
|
|
17
|
-
{filterId === EColumnFilter.Boolean && (
|
|
18
|
-
<BooleanInput setValue={setValue} value={value} />
|
|
19
|
-
)}
|
|
20
|
-
{filterId === EColumnFilter.TextEqual && (
|
|
21
|
-
<TextInput setValue={setValue} value={value} />
|
|
22
|
-
)}
|
|
23
|
-
{filterId === EColumnFilter.TextNotEqual && (
|
|
24
|
-
<TextInput setValue={setValue} value={value} />
|
|
25
|
-
)}
|
|
26
|
-
{filterId === EColumnFilter.TextContain && (
|
|
27
|
-
<TextInput setValue={setValue} value={value} />
|
|
28
|
-
)}
|
|
29
|
-
{filterId === EColumnFilter.TextNotContain && (
|
|
30
|
-
<TextInput setValue={setValue} value={value} />
|
|
31
|
-
)}
|
|
32
|
-
{filterId === EColumnFilter.MultipleSelect && (
|
|
33
|
-
<MultipleSelect setValue={setValue} value={value} />
|
|
34
|
-
)}
|
|
35
|
-
{filterId === EColumnFilter.NumberEqual && (
|
|
36
|
-
<NumberInput label={label.filter} setValue={setValue} value={value} />
|
|
37
|
-
)}
|
|
38
|
-
{filterId === EColumnFilter.NumberFrom && (
|
|
39
|
-
<NumberInput label={label.from} setValue={setValue} value={value} />
|
|
40
|
-
)}
|
|
41
|
-
{filterId === EColumnFilter.NumberTo && (
|
|
42
|
-
<NumberInput label={label.to} setValue={setValue} value={value} />
|
|
43
|
-
)}
|
|
44
|
-
{filterId === EColumnFilter.NumberBetween && (
|
|
45
|
-
<NumberBetween setValue={setValue} value={value} />
|
|
46
|
-
)}
|
|
47
|
-
{filterId === EColumnFilter.DateEqual && (
|
|
48
|
-
<DateInput label={label.filter} setValue={setValue} value={value} />
|
|
49
|
-
)}
|
|
50
|
-
{filterId === EColumnFilter.DateFrom && (
|
|
51
|
-
<DateInput label={label.from} setValue={setValue} value={value} />
|
|
52
|
-
)}
|
|
53
|
-
{filterId === EColumnFilter.DateTo && (
|
|
54
|
-
<DateInput label={label.to} setValue={setValue} value={value} />
|
|
55
|
-
)}
|
|
56
|
-
{filterId === EColumnFilter.DateBetween && (
|
|
57
|
-
<DateBetween setValue={setValue} value={value} />
|
|
58
|
-
)}
|
|
59
|
-
</Fragment>
|
|
60
|
-
);
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
type Props = Omit<IProps, "label"> & { filterId: EColumnFilter };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { InputArea } from "./InputArea";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { MultipleSelect } from "./ui";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { props } from "./props";
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { SlickDataView } from "slickgrid";
|
|
2
|
-
|
|
3
|
-
import { eventOpenColumnFilters } from "shared/lib/slickgrid";
|
|
4
|
-
|
|
5
|
-
import { IValue } from "../../model";
|
|
6
|
-
|
|
7
|
-
const emptyProps = { label: "", options: [] };
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Molds label and options list for multiple select.
|
|
11
|
-
*
|
|
12
|
-
* @returns {Object} contains "label" and "options" fields.
|
|
13
|
-
*/
|
|
14
|
-
export function props(): { label: string; options: IValue[] } {
|
|
15
|
-
const { columnId, table } = eventOpenColumnFilters;
|
|
16
|
-
const grid = table?.grid;
|
|
17
|
-
if (!grid) return emptyProps;
|
|
18
|
-
const column = grid?.getColumns().find(({ id }) => id === columnId);
|
|
19
|
-
if (!column) return emptyProps;
|
|
20
|
-
const label = column.name as string;
|
|
21
|
-
|
|
22
|
-
const options: IValue[] = [];
|
|
23
|
-
const { formatter, id } = column;
|
|
24
|
-
const dataView: SlickDataView = grid.getData();
|
|
25
|
-
const optionsSet = new Set<IValue>();
|
|
26
|
-
const items = dataView.getItems();
|
|
27
|
-
items.forEach((item) => {
|
|
28
|
-
optionsSet.add(
|
|
29
|
-
formatter ? formatter(0, 0, item[id], column, null, grid) : item[id],
|
|
30
|
-
);
|
|
31
|
-
});
|
|
32
|
-
for (const option of optionsSet) {
|
|
33
|
-
options.push(option);
|
|
34
|
-
}
|
|
35
|
-
return { label, options };
|
|
36
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { IValue } from "../../model";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Callback for sorting array elements ascending.
|
|
5
|
-
*
|
|
6
|
-
* @param {Number | String} a element of an array.
|
|
7
|
-
* @param {Number | String} b element of an array.
|
|
8
|
-
* @returns Sorting result.
|
|
9
|
-
*/
|
|
10
|
-
export function ascending(a: IValue, b: IValue): number {
|
|
11
|
-
if (typeof a === "string" && typeof b === "string") {
|
|
12
|
-
return a.localeCompare(b);
|
|
13
|
-
} else if (typeof a === "number" && typeof b === "number") {
|
|
14
|
-
return a - b;
|
|
15
|
-
}
|
|
16
|
-
return 0;
|
|
17
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ascending } from "./ascending";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type IValue = number | string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { IValue } from "./IValue";
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
FormControl,
|
|
3
|
-
InputLabel,
|
|
4
|
-
ListItemText,
|
|
5
|
-
MenuItem,
|
|
6
|
-
OutlinedInput,
|
|
7
|
-
Select,
|
|
8
|
-
SelectChangeEvent,
|
|
9
|
-
} from "@mui/material";
|
|
10
|
-
import React from "react";
|
|
11
|
-
|
|
12
|
-
import { applyFilter } from "../../../lib";
|
|
13
|
-
import { IProps } from "../../../model";
|
|
14
|
-
import { ascending, props } from "../lib";
|
|
15
|
-
import { IValue } from "../model";
|
|
16
|
-
|
|
17
|
-
import Styled from "./MultipleSelect.style";
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Generates multiple select based on values represented in the column
|
|
21
|
-
*/
|
|
22
|
-
export const MultipleSelect: React.FC<Props> = ({ setValue, value }) => {
|
|
23
|
-
const selectedValues = JSON.parse(value[1] || '["All"]');
|
|
24
|
-
|
|
25
|
-
const { label, options } = props();
|
|
26
|
-
|
|
27
|
-
const handleChange = (event: SelectChangeEvent<unknown>) => {
|
|
28
|
-
const targetValue = event.target.value as string[];
|
|
29
|
-
let newValue;
|
|
30
|
-
if (targetValue[targetValue.length - 1] === "All" || !targetValue.length) {
|
|
31
|
-
newValue = { 1: "", 2: "" };
|
|
32
|
-
} else {
|
|
33
|
-
if (targetValue.length > 1 && targetValue[0] === "All") {
|
|
34
|
-
targetValue.shift();
|
|
35
|
-
}
|
|
36
|
-
newValue = {
|
|
37
|
-
...value,
|
|
38
|
-
1: JSON.stringify(targetValue),
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
setValue(newValue);
|
|
42
|
-
applyFilter(newValue);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
return (
|
|
46
|
-
<FormControl size={"small"}>
|
|
47
|
-
<InputLabel id="column-filter-multiple-select-label">{label}</InputLabel>
|
|
48
|
-
<Select
|
|
49
|
-
labelId="column-filter-multiple-select-label"
|
|
50
|
-
id="column-filter-multiple-select"
|
|
51
|
-
multiple
|
|
52
|
-
value={selectedValues}
|
|
53
|
-
onChange={handleChange}
|
|
54
|
-
input={<OutlinedInput label={label} />}
|
|
55
|
-
renderValue={(selected: unknown) => (selected as IValue[]).join(", ")}
|
|
56
|
-
>
|
|
57
|
-
<MenuItem key={0} value={"All"}>
|
|
58
|
-
<Styled.Checkbox checked={selectedValues.indexOf("All") > -1} />
|
|
59
|
-
<ListItemText primary={"All"} />
|
|
60
|
-
</MenuItem>
|
|
61
|
-
{options.sort(ascending).map((option) => (
|
|
62
|
-
<MenuItem key={option} value={option}>
|
|
63
|
-
<Styled.Checkbox checked={selectedValues.indexOf(option) > -1} />
|
|
64
|
-
<ListItemText primary={option} />
|
|
65
|
-
</MenuItem>
|
|
66
|
-
))}
|
|
67
|
-
</Select>
|
|
68
|
-
</FormControl>
|
|
69
|
-
);
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
type Props = Omit<IProps, "label">;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { MultipleSelect } from "./MultipleSelect";
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { TextField } from "@mui/material";
|
|
2
|
-
import { ChangeEvent, FC, Fragment } from "react";
|
|
3
|
-
|
|
4
|
-
import { applyFilter } from "../../lib";
|
|
5
|
-
import { IProps, label } from "../../model";
|
|
6
|
-
|
|
7
|
-
export const NumberBetween: FC<Omit<IProps, "label">> = ({
|
|
8
|
-
setValue,
|
|
9
|
-
value,
|
|
10
|
-
}) => {
|
|
11
|
-
function onChange1(event: ChangeEvent<HTMLInputElement>) {
|
|
12
|
-
const newValue = { ...value, 1: event.target.value };
|
|
13
|
-
setValue(newValue);
|
|
14
|
-
applyFilter(newValue);
|
|
15
|
-
}
|
|
16
|
-
function onChange2(event: ChangeEvent<HTMLInputElement>) {
|
|
17
|
-
const newValue = { ...value, 2: event.target.value };
|
|
18
|
-
setValue(newValue);
|
|
19
|
-
applyFilter(newValue);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<Fragment>
|
|
24
|
-
<TextField
|
|
25
|
-
label={label.from}
|
|
26
|
-
value={value[1]}
|
|
27
|
-
type={"number"}
|
|
28
|
-
onChange={onChange1}
|
|
29
|
-
size={"small"}
|
|
30
|
-
autoComplete={"off"}
|
|
31
|
-
/>
|
|
32
|
-
<TextField
|
|
33
|
-
label={label.to}
|
|
34
|
-
value={value[2]}
|
|
35
|
-
type={"number"}
|
|
36
|
-
onChange={onChange2}
|
|
37
|
-
size={"small"}
|
|
38
|
-
autoComplete={"off"}
|
|
39
|
-
/>
|
|
40
|
-
</Fragment>
|
|
41
|
-
);
|
|
42
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { NumberBetween } from "./NumberBetween";
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { TextField } from "@mui/material";
|
|
2
|
-
import { ChangeEvent, FC } from "react";
|
|
3
|
-
|
|
4
|
-
import { applyFilter } from "../../lib";
|
|
5
|
-
import { IProps } from "../../model";
|
|
6
|
-
|
|
7
|
-
export const NumberInput: FC<IProps> = ({ label, setValue, value }) => {
|
|
8
|
-
function onChange(event: ChangeEvent<HTMLInputElement>) {
|
|
9
|
-
const newValue = { ...value, 1: event.target.value };
|
|
10
|
-
setValue(newValue);
|
|
11
|
-
applyFilter(newValue);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<TextField
|
|
16
|
-
label={label}
|
|
17
|
-
value={value[1]}
|
|
18
|
-
type={"number"}
|
|
19
|
-
onChange={onChange}
|
|
20
|
-
size={"small"}
|
|
21
|
-
autoComplete={"off"}
|
|
22
|
-
/>
|
|
23
|
-
);
|
|
24
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { NumberInput } from "./NumberInput";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { SelectFilter } from "./ui";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { options } from "./options";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { options } from "./options";
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { EColumnFilter, EColumnFiltersGroup } from "shared/model/enums";
|
|
2
|
-
import { IContextSelectValue } from "shared/ui/ContextSelect";
|
|
3
|
-
|
|
4
|
-
const dateBetween: IContextSelectValue = {
|
|
5
|
-
id: EColumnFilter.DateBetween,
|
|
6
|
-
name: "Between",
|
|
7
|
-
};
|
|
8
|
-
const dateEqual: IContextSelectValue = {
|
|
9
|
-
id: EColumnFilter.DateEqual,
|
|
10
|
-
name: "Equal",
|
|
11
|
-
};
|
|
12
|
-
const dateFrom: IContextSelectValue = {
|
|
13
|
-
id: EColumnFilter.DateFrom,
|
|
14
|
-
name: "From",
|
|
15
|
-
};
|
|
16
|
-
const dateTo: IContextSelectValue = { id: EColumnFilter.DateTo, name: "To" };
|
|
17
|
-
const numberBetween: IContextSelectValue = {
|
|
18
|
-
id: EColumnFilter.NumberBetween,
|
|
19
|
-
name: "Between",
|
|
20
|
-
};
|
|
21
|
-
const numberEqual: IContextSelectValue = {
|
|
22
|
-
id: EColumnFilter.NumberEqual,
|
|
23
|
-
name: "Equal",
|
|
24
|
-
};
|
|
25
|
-
const numberFrom: IContextSelectValue = {
|
|
26
|
-
id: EColumnFilter.NumberFrom,
|
|
27
|
-
name: "From",
|
|
28
|
-
};
|
|
29
|
-
const numberTo: IContextSelectValue = {
|
|
30
|
-
id: EColumnFilter.NumberTo,
|
|
31
|
-
name: "To",
|
|
32
|
-
};
|
|
33
|
-
const textContain: IContextSelectValue = {
|
|
34
|
-
id: EColumnFilter.TextContain,
|
|
35
|
-
name: "Contains",
|
|
36
|
-
};
|
|
37
|
-
const textEqual: IContextSelectValue = {
|
|
38
|
-
id: EColumnFilter.TextEqual,
|
|
39
|
-
name: "Equal",
|
|
40
|
-
};
|
|
41
|
-
const textNotContain: IContextSelectValue = {
|
|
42
|
-
id: EColumnFilter.TextNotContain,
|
|
43
|
-
name: "Does not contain",
|
|
44
|
-
};
|
|
45
|
-
const textNotEqual: IContextSelectValue = {
|
|
46
|
-
id: EColumnFilter.TextNotEqual,
|
|
47
|
-
name: "Not equal",
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const numberFilters = [numberEqual, numberFrom, numberTo, numberBetween];
|
|
51
|
-
|
|
52
|
-
export const options: IOptions = {
|
|
53
|
-
[EColumnFiltersGroup.Boolean]: [],
|
|
54
|
-
[EColumnFiltersGroup.Date]: [dateEqual, dateFrom, dateTo, dateBetween],
|
|
55
|
-
[EColumnFiltersGroup.MultipleSelect]: [],
|
|
56
|
-
[EColumnFiltersGroup.Number]: numberFilters,
|
|
57
|
-
[EColumnFiltersGroup.NumberFormatted]: numberFilters,
|
|
58
|
-
[EColumnFiltersGroup.Text]: [
|
|
59
|
-
textContain,
|
|
60
|
-
textNotContain,
|
|
61
|
-
textEqual,
|
|
62
|
-
textNotEqual,
|
|
63
|
-
],
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
type IOptions = Record<EColumnFiltersGroup, IContextSelectValue[]>;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { SelectChangeEvent } from "@mui/material";
|
|
2
|
-
import { Dispatch, FC, SetStateAction } from "react";
|
|
3
|
-
|
|
4
|
-
import { eventOpenColumnFilters } from "shared/lib/slickgrid";
|
|
5
|
-
import { EColumnFilter } from "shared/model/enums";
|
|
6
|
-
import { ContextSelect } from "shared/ui/ContextSelect";
|
|
7
|
-
|
|
8
|
-
import { options } from "../model";
|
|
9
|
-
|
|
10
|
-
export const SelectFilter: FC<IProps> = ({ filterId, setFilterId }) => {
|
|
11
|
-
const list = options[eventOpenColumnFilters.group];
|
|
12
|
-
const value = list.some(({ id }) => id === filterId) ? filterId : list[0]?.id;
|
|
13
|
-
|
|
14
|
-
function onChange(event: SelectChangeEvent<string | number>) {
|
|
15
|
-
const { columnId, table } = eventOpenColumnFilters;
|
|
16
|
-
if (!columnId || !table) return;
|
|
17
|
-
const args = table.filter.args;
|
|
18
|
-
const id = event.target.value as number;
|
|
19
|
-
if (!args.columnFilters) return;
|
|
20
|
-
table.filter.args = {
|
|
21
|
-
...args,
|
|
22
|
-
columnFilters: {
|
|
23
|
-
...args.columnFilters,
|
|
24
|
-
[columnId]: {
|
|
25
|
-
...args.columnFilters[columnId],
|
|
26
|
-
filterId: id,
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
setFilterId(id);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (!value) return null;
|
|
34
|
-
|
|
35
|
-
return (
|
|
36
|
-
<ContextSelect
|
|
37
|
-
name={""}
|
|
38
|
-
list={list}
|
|
39
|
-
onChange={onChange}
|
|
40
|
-
width={"100%"}
|
|
41
|
-
showSelect={false}
|
|
42
|
-
value={value}
|
|
43
|
-
/>
|
|
44
|
-
);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
interface IProps {
|
|
48
|
-
filterId: EColumnFilter;
|
|
49
|
-
setFilterId: Dispatch<SetStateAction<EColumnFilter>>;
|
|
50
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { SelectFilter } from "./SelectFilter";
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { TextField } from "@mui/material";
|
|
2
|
-
import { ChangeEvent, FC } from "react";
|
|
3
|
-
|
|
4
|
-
import { applyFilter } from "../../lib";
|
|
5
|
-
import { IProps, label } from "../../model";
|
|
6
|
-
|
|
7
|
-
export const TextInput: FC<Omit<IProps, "label">> = ({ setValue, value }) => {
|
|
8
|
-
function onChange(event: ChangeEvent<HTMLInputElement>) {
|
|
9
|
-
const newValue = { ...value, 1: event.target.value };
|
|
10
|
-
setValue(newValue);
|
|
11
|
-
applyFilter(newValue);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<TextField
|
|
16
|
-
label={label.filter}
|
|
17
|
-
value={value[1]}
|
|
18
|
-
onChange={onChange}
|
|
19
|
-
size={"small"}
|
|
20
|
-
autoComplete={"off"}
|
|
21
|
-
/>
|
|
22
|
-
);
|
|
23
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { TextInput } from "./TextInput";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ColumnFilters } from "./ColumnFilters";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ContextMenu } from "./ui";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { useSubscribeToEvent } from "./useSubscribeToEvent";
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Dispatch, SetStateAction, useEffect } from "react";
|
|
2
|
-
|
|
3
|
-
import { eventContextMenu } from "shared/lib/slickgrid";
|
|
4
|
-
|
|
5
|
-
import { PORTAL_ID, makeVisible } from "entities/portal";
|
|
6
|
-
|
|
7
|
-
export function useSubscribeToEvent(
|
|
8
|
-
setIsOpened: Dispatch<SetStateAction<boolean>>,
|
|
9
|
-
) {
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
function callback() {
|
|
12
|
-
setIsOpened(true);
|
|
13
|
-
setTimeout(() => {
|
|
14
|
-
const menu = document.getElementById(PORTAL_ID);
|
|
15
|
-
if (!menu) return;
|
|
16
|
-
const { x, y } = eventContextMenu;
|
|
17
|
-
makeVisible(menu, x, y);
|
|
18
|
-
}, 0);
|
|
19
|
-
}
|
|
20
|
-
eventContextMenu.subscribe(callback);
|
|
21
|
-
return () => {
|
|
22
|
-
eventContextMenu.unsubscribe(callback);
|
|
23
|
-
};
|
|
24
|
-
}, []);
|
|
25
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { useSubscribeToEvent } from "./hooks";
|