slick-table 0.0.13 → 0.0.15
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 +5 -9
- 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,110 +0,0 @@
|
|
|
1
|
-
import { SlickDataView, SlickGrid, SlickGroupTotals } from "slickgrid";
|
|
2
|
-
|
|
3
|
-
import { deleteDoubleQuotes, removeHtml } from "shared/lib/strings";
|
|
4
|
-
import {
|
|
5
|
-
IColumn,
|
|
6
|
-
IDownloadManager,
|
|
7
|
-
ISlickRow,
|
|
8
|
-
ISlickTable,
|
|
9
|
-
} from "shared/model/types";
|
|
10
|
-
|
|
11
|
-
import { selectedRows } from "../../../lib";
|
|
12
|
-
|
|
13
|
-
/** Causes the circular dependencies issue */
|
|
14
|
-
const ignore = ["FormatterStatus", "FormatterNumber"]; // todo Use FORMATTER_NUMBER, FORMATTER_STATUS
|
|
15
|
-
|
|
16
|
-
export class DownloadManager implements IDownloadManager {
|
|
17
|
-
table: ISlickTable | null = null;
|
|
18
|
-
|
|
19
|
-
download(table: ISlickTable, clientId: number, name: string) {
|
|
20
|
-
if (!this.table) this.table = table;
|
|
21
|
-
this.table = table;
|
|
22
|
-
const grid = table.grid;
|
|
23
|
-
if (!grid) return;
|
|
24
|
-
const output = this.createCSV(table);
|
|
25
|
-
|
|
26
|
-
const a = document.createElement("a");
|
|
27
|
-
a.href = "data:text/csv;charset=utf-8," + encodeURIComponent(output);
|
|
28
|
-
a.target = "_blank";
|
|
29
|
-
a.download = `${clientId}-${name}-${table.id}.csv`;
|
|
30
|
-
a.click();
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
createCSV(table: ISlickTable): string {
|
|
34
|
-
if (!this.table) this.table = table;
|
|
35
|
-
const grid = table.grid;
|
|
36
|
-
if (!grid) return "";
|
|
37
|
-
const title = this.getTitle();
|
|
38
|
-
const header = this.getCSVHeader(grid);
|
|
39
|
-
const body = this.getCSVBody(grid);
|
|
40
|
-
return `${title}${header}${body}`;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
getTitle(): string {
|
|
44
|
-
return "";
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
getCSVHeader(grid: SlickGrid): string {
|
|
48
|
-
const columns: IColumn[] = grid.getColumns();
|
|
49
|
-
const columnsForPrinting = columns.filter((el) => el.forPrint);
|
|
50
|
-
|
|
51
|
-
const header = columnsForPrinting.reduce((acc: string, column) => {
|
|
52
|
-
if (typeof column.name === "string") {
|
|
53
|
-
const name = deleteDoubleQuotes(column.name);
|
|
54
|
-
return acc.concat(`"${name}",`);
|
|
55
|
-
} else {
|
|
56
|
-
return acc.concat('" ",');
|
|
57
|
-
}
|
|
58
|
-
}, "");
|
|
59
|
-
|
|
60
|
-
return this.addRowSeparator(header);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
getCSVBody(grid: SlickGrid): string {
|
|
64
|
-
const dataView: SlickDataView<ISlickRow> = grid.getData();
|
|
65
|
-
const columns: IColumn[] = grid.getColumns();
|
|
66
|
-
const columnsForPrinting = columns.filter((el) => el.forPrint);
|
|
67
|
-
|
|
68
|
-
return selectedRows(grid).reduce((acc: string, rowIndex) => {
|
|
69
|
-
const metaData = dataView.getItemMetadata(rowIndex);
|
|
70
|
-
const row = dataView.getItem(rowIndex);
|
|
71
|
-
const isGroupTitle = row.__group;
|
|
72
|
-
const isGroupTotal = row.__groupTotals;
|
|
73
|
-
let csvRow = "";
|
|
74
|
-
if (isGroupTitle) {
|
|
75
|
-
const valueWithoutQuotes = deleteDoubleQuotes(removeHtml(row.title));
|
|
76
|
-
csvRow += `"${valueWithoutQuotes}",`;
|
|
77
|
-
} else {
|
|
78
|
-
for (let i = 0; i < columnsForPrinting.length; ++i) {
|
|
79
|
-
const column = columnsForPrinting[i];
|
|
80
|
-
const field = column.field;
|
|
81
|
-
const formatterSpecific = metaData?.columns?.[field]?.formatter;
|
|
82
|
-
const formatter =
|
|
83
|
-
column.printer || formatterSpecific || column.formatter;
|
|
84
|
-
let value = row[field];
|
|
85
|
-
if (isGroupTotal) {
|
|
86
|
-
const totalsFormatter = column.groupTotalsFormatter;
|
|
87
|
-
value = totalsFormatter
|
|
88
|
-
? totalsFormatter(
|
|
89
|
-
row as unknown as SlickGroupTotals,
|
|
90
|
-
column,
|
|
91
|
-
grid,
|
|
92
|
-
)
|
|
93
|
-
: "";
|
|
94
|
-
} else {
|
|
95
|
-
if (formatter && !ignore.includes(formatter.name)) {
|
|
96
|
-
value = formatter(0, 0, value, column, row, grid);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
const valueWithoutQuotes = deleteDoubleQuotes(value);
|
|
100
|
-
csvRow += `"${valueWithoutQuotes}",`;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
return this.addRowSeparator(`${acc}${csvRow}`);
|
|
104
|
-
}, "");
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
addRowSeparator(str: string): string {
|
|
108
|
-
return `${str}\n`;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { DownloadManager } from "./DownloadManager";
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { DeletedRowsFilter } from "./DeletedRowsFilter";
|
|
2
|
-
|
|
3
|
-
describe("shared | lib | slickgrid | DeletedRowsFilter", () => {
|
|
4
|
-
let filter: DeletedRowsFilter;
|
|
5
|
-
|
|
6
|
-
beforeEach(() => {
|
|
7
|
-
filter = new DeletedRowsFilter();
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
it("should return a function when getFilterFn is called", () => {
|
|
11
|
-
const filterFn = filter.getFilterFn();
|
|
12
|
-
|
|
13
|
-
expect(typeof filterFn).toBe("function");
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
it("should filter out items with isDeleted property set to true", () => {
|
|
17
|
-
const filterFn = filter.getFilterFn();
|
|
18
|
-
|
|
19
|
-
const items = [
|
|
20
|
-
{ id: 1, isDeleted: false },
|
|
21
|
-
{ id: 2, isDeleted: true },
|
|
22
|
-
{ id: 3, isDeleted: false },
|
|
23
|
-
{ id: 4, isDeleted: true },
|
|
24
|
-
{ id: 5 },
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
const filteredItems = items.filter(filterFn);
|
|
28
|
-
|
|
29
|
-
expect(filteredItems).toHaveLength(3);
|
|
30
|
-
expect(filteredItems).toEqual([
|
|
31
|
-
{ id: 1, isDeleted: false },
|
|
32
|
-
{ id: 3, isDeleted: false },
|
|
33
|
-
{ id: 5 },
|
|
34
|
-
]);
|
|
35
|
-
});
|
|
36
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { FilterFn } from "slickgrid";
|
|
2
|
-
|
|
3
|
-
import { Filter } from "./Filter";
|
|
4
|
-
|
|
5
|
-
export class DeletedRowsFilter extends Filter {
|
|
6
|
-
public getFilterFn(): FilterFn<IRow> {
|
|
7
|
-
// item is undefined until dataView.setItems() method is called
|
|
8
|
-
return (item) => !item?.isDeleted;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
type IRow = Record<string, any>;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { FilterFn, SlickDataView, SlickGrid } from "slickgrid";
|
|
2
|
-
|
|
3
|
-
import { IArguments, IFilter } from "shared/model/types";
|
|
4
|
-
|
|
5
|
-
const emptyObj = {};
|
|
6
|
-
|
|
7
|
-
export class Filter implements IFilter {
|
|
8
|
-
private _args: IArguments = { ...emptyObj };
|
|
9
|
-
private _grid: SlickGrid | null = null;
|
|
10
|
-
private _tableId = "";
|
|
11
|
-
public getFilterFn(): FilterFn<Record<string, any>> {
|
|
12
|
-
return (): boolean => true;
|
|
13
|
-
}
|
|
14
|
-
public register(grid: SlickGrid, tableId: string): void {
|
|
15
|
-
this.tableId = tableId;
|
|
16
|
-
this.grid = grid;
|
|
17
|
-
const dataView: SlickDataView = grid.getData();
|
|
18
|
-
dataView.setFilter(this.getFilterFn());
|
|
19
|
-
dataView.setFilterArgs(this.args);
|
|
20
|
-
dataView.refresh();
|
|
21
|
-
}
|
|
22
|
-
public reset() {
|
|
23
|
-
if (!this.grid) return;
|
|
24
|
-
this.args = emptyObj;
|
|
25
|
-
const dataView: SlickDataView = this.grid.getData();
|
|
26
|
-
dataView.setFilterArgs(emptyObj);
|
|
27
|
-
dataView.refresh();
|
|
28
|
-
}
|
|
29
|
-
public print(): HTMLTableRowElement[] {
|
|
30
|
-
return [];
|
|
31
|
-
}
|
|
32
|
-
set grid(grid) {
|
|
33
|
-
this._grid = grid;
|
|
34
|
-
}
|
|
35
|
-
get grid() {
|
|
36
|
-
return this._grid;
|
|
37
|
-
}
|
|
38
|
-
set args(args) {
|
|
39
|
-
this._args = args;
|
|
40
|
-
if (!this.grid) return;
|
|
41
|
-
const dataView: SlickDataView = this.grid.getData();
|
|
42
|
-
dataView.setFilterArgs(args);
|
|
43
|
-
dataView.refresh();
|
|
44
|
-
}
|
|
45
|
-
get args() {
|
|
46
|
-
return this._args;
|
|
47
|
-
}
|
|
48
|
-
set tableId(tableId: string) {
|
|
49
|
-
this._tableId = tableId;
|
|
50
|
-
}
|
|
51
|
-
get tableId() {
|
|
52
|
-
return this._tableId;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { FilterFn, SlickGrid } from "slickgrid";
|
|
2
|
-
|
|
3
|
-
import { IArguments, IFilter } from "shared/model/types";
|
|
4
|
-
|
|
5
|
-
export class WithoutFilter implements IFilter {
|
|
6
|
-
private _args: IArguments = {};
|
|
7
|
-
private _grid: SlickGrid | null = null;
|
|
8
|
-
private _tableId = "";
|
|
9
|
-
public getFilterFn(): FilterFn<Record<string, any>> {
|
|
10
|
-
return (): boolean => true;
|
|
11
|
-
}
|
|
12
|
-
public register(): void {}
|
|
13
|
-
public print(): HTMLTableRowElement[] {
|
|
14
|
-
return [];
|
|
15
|
-
}
|
|
16
|
-
public reset() {}
|
|
17
|
-
|
|
18
|
-
get args() {
|
|
19
|
-
return this._args;
|
|
20
|
-
}
|
|
21
|
-
get grid() {
|
|
22
|
-
return this._grid;
|
|
23
|
-
}
|
|
24
|
-
get tableId() {
|
|
25
|
-
return this._tableId;
|
|
26
|
-
}
|
|
27
|
-
set args(_args) {}
|
|
28
|
-
set grid(_grid) {}
|
|
29
|
-
set tableId(_tableId) {}
|
|
30
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { EColumnFilter, EColumnFiltersGroup } from "shared/model/enums";
|
|
2
|
-
import { IColumnFilterValue } from "shared/model/types";
|
|
3
|
-
|
|
4
|
-
import { headerButtons } from "../../../../../ui";
|
|
5
|
-
import { DecoratorFilter } from "../DecoratorFilter";
|
|
6
|
-
import { filter } from "./Filter";
|
|
7
|
-
|
|
8
|
-
const formatterNotNeeded: EColumnFiltersGroup[] = [
|
|
9
|
-
EColumnFiltersGroup.Date,
|
|
10
|
-
EColumnFiltersGroup.Boolean,
|
|
11
|
-
EColumnFiltersGroup.Number,
|
|
12
|
-
];
|
|
13
|
-
|
|
14
|
-
export class DecoratorColumnFilter extends DecoratorFilter {
|
|
15
|
-
public filterFn(item: Record<string, any>, args: IArgs) {
|
|
16
|
-
if (!args.columnFilters) return true;
|
|
17
|
-
const grid = this.grid;
|
|
18
|
-
if (!grid) return true;
|
|
19
|
-
const columns = grid.getColumns();
|
|
20
|
-
const columnIds = Object.keys(args.columnFilters);
|
|
21
|
-
for (let i = 0; i < columnIds.length; i++) {
|
|
22
|
-
const columnId = columnIds[i];
|
|
23
|
-
const column = columns[grid.getColumnIndex(columnId)];
|
|
24
|
-
const { filterId, group, value } = args.columnFilters[columnId];
|
|
25
|
-
let cellValue = item[column?.field];
|
|
26
|
-
if (!formatterNotNeeded.includes(group)) {
|
|
27
|
-
const formatter = column?.formatter;
|
|
28
|
-
if (formatter)
|
|
29
|
-
cellValue = formatter(0, 0, cellValue, column, item, grid);
|
|
30
|
-
}
|
|
31
|
-
if (!filter.passed(cellValue, value, filterId)) {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
public reset() {
|
|
38
|
-
this.filter.reset();
|
|
39
|
-
if (this.tableId)
|
|
40
|
-
headerButtons.highlightAllColumns(this.args, this.tableId);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
interface IArgs {
|
|
45
|
-
columnFilters?: Record<
|
|
46
|
-
string,
|
|
47
|
-
{
|
|
48
|
-
filterId: EColumnFilter;
|
|
49
|
-
group: EColumnFiltersGroup;
|
|
50
|
-
value: IColumnFilterValue;
|
|
51
|
-
}
|
|
52
|
-
>;
|
|
53
|
-
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { getTime } from "shared/lib/datetime";
|
|
2
|
-
import { EColumnFilter } from "shared/model/enums";
|
|
3
|
-
import { IColumnFilterValue } from "shared/model/types";
|
|
4
|
-
|
|
5
|
-
class Filter {
|
|
6
|
-
passed(
|
|
7
|
-
cellValue: string,
|
|
8
|
-
value: IColumnFilterValue,
|
|
9
|
-
filterId: EColumnFilter,
|
|
10
|
-
) {
|
|
11
|
-
if (!value[1] && !value[2]) return true;
|
|
12
|
-
switch (filterId) {
|
|
13
|
-
case EColumnFilter.Boolean: {
|
|
14
|
-
return this.boolean(cellValue, value);
|
|
15
|
-
}
|
|
16
|
-
case EColumnFilter.DateBetween: {
|
|
17
|
-
return this.dateBetween(cellValue, value);
|
|
18
|
-
}
|
|
19
|
-
case EColumnFilter.DateEqual: {
|
|
20
|
-
return this.dateEqual(cellValue, value[1]);
|
|
21
|
-
}
|
|
22
|
-
case EColumnFilter.DateFrom: {
|
|
23
|
-
return this.dateFrom(cellValue, value[1]);
|
|
24
|
-
}
|
|
25
|
-
case EColumnFilter.DateTo: {
|
|
26
|
-
return this.dateTo(cellValue, value[1]);
|
|
27
|
-
}
|
|
28
|
-
case EColumnFilter.MultipleSelect: {
|
|
29
|
-
return this.multipleSelect(cellValue, value[1]);
|
|
30
|
-
}
|
|
31
|
-
case EColumnFilter.NumberBetween: {
|
|
32
|
-
return this.numberBetween(cellValue, value);
|
|
33
|
-
}
|
|
34
|
-
case EColumnFilter.NumberEqual: {
|
|
35
|
-
return this.numberEqual(cellValue, value[1]);
|
|
36
|
-
}
|
|
37
|
-
case EColumnFilter.NumberFrom: {
|
|
38
|
-
return this.numberFrom(cellValue, value[1]);
|
|
39
|
-
}
|
|
40
|
-
case EColumnFilter.NumberTo: {
|
|
41
|
-
return this.numberTo(cellValue, value[1]);
|
|
42
|
-
}
|
|
43
|
-
case EColumnFilter.TextContain: {
|
|
44
|
-
return this.textContain(cellValue, value[1]);
|
|
45
|
-
}
|
|
46
|
-
case EColumnFilter.TextEqual: {
|
|
47
|
-
return this.textEqual(cellValue, value[1]);
|
|
48
|
-
}
|
|
49
|
-
case EColumnFilter.TextNotContain: {
|
|
50
|
-
return !this.textContain(cellValue, value[1]);
|
|
51
|
-
}
|
|
52
|
-
case EColumnFilter.TextNotEqual: {
|
|
53
|
-
return !this.textEqual(cellValue, value[1]);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
boolean(cellValue: string, value: IColumnFilterValue) {
|
|
59
|
-
if (value[1]) return Boolean(cellValue);
|
|
60
|
-
if (value[2]) return !cellValue;
|
|
61
|
-
return true;
|
|
62
|
-
}
|
|
63
|
-
dateBetween(cellValue: string, value: IColumnFilterValue) {
|
|
64
|
-
const from = value[1];
|
|
65
|
-
const to = value[2];
|
|
66
|
-
if (!from) return this.dateTo(cellValue, to);
|
|
67
|
-
if (!to) return this.dateFrom(cellValue, from);
|
|
68
|
-
return this.dateFrom(cellValue, from) && this.dateTo(cellValue, to);
|
|
69
|
-
}
|
|
70
|
-
dateEqual(cellValue: string, filter: string) {
|
|
71
|
-
return filter === cellValue;
|
|
72
|
-
}
|
|
73
|
-
dateFrom(cellValue: string, filter: string) {
|
|
74
|
-
return getTime(cellValue) >= getTime(filter);
|
|
75
|
-
}
|
|
76
|
-
dateTo(cellValue: string, filter: string) {
|
|
77
|
-
return getTime(cellValue) <= getTime(filter);
|
|
78
|
-
}
|
|
79
|
-
multipleSelect(cellValue: string, filter: string) {
|
|
80
|
-
const array = JSON.parse(filter) as (number | string)[];
|
|
81
|
-
if (array.includes("All")) return true;
|
|
82
|
-
return array.includes(cellValue);
|
|
83
|
-
}
|
|
84
|
-
numberBetween(cellValue: string, value: IColumnFilterValue) {
|
|
85
|
-
const from = value[1] || 0;
|
|
86
|
-
const to = value[2] || 0;
|
|
87
|
-
if (!from) return Number(cellValue) <= Number(to);
|
|
88
|
-
if (!to) return Number(cellValue) >= Number(from);
|
|
89
|
-
return this.numberFrom(cellValue, from) && this.numberTo(cellValue, to);
|
|
90
|
-
}
|
|
91
|
-
numberEqual(cellValue: string, filter: string) {
|
|
92
|
-
return Number(filter) === Number(cellValue);
|
|
93
|
-
}
|
|
94
|
-
numberFrom(cellValue: string, filter: string) {
|
|
95
|
-
return Number(cellValue) >= Number(filter);
|
|
96
|
-
}
|
|
97
|
-
numberTo(cellValue: string, filter: string) {
|
|
98
|
-
return Number(cellValue) <= Number(filter);
|
|
99
|
-
}
|
|
100
|
-
textEqual(cellValue: string, filter: string) {
|
|
101
|
-
return (cellValue || "").toLowerCase() === filter.toLowerCase();
|
|
102
|
-
}
|
|
103
|
-
textContain(cellValue: string, filter: string) {
|
|
104
|
-
return (cellValue || "").toLowerCase().match(filter.toLowerCase());
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export const filter = new Filter();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { DecoratorColumnFilter } from "./DecoratorColumnFilter";
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { getTime } from "shared/lib/datetime";
|
|
2
|
-
import { ISlickRow } from "shared/model/types";
|
|
3
|
-
|
|
4
|
-
import { DecoratorFilter } from "./DecoratorFilter";
|
|
5
|
-
|
|
6
|
-
export class DecoratorEndingDate extends DecoratorFilter {
|
|
7
|
-
filterFn(row: ISlickRow, args: IArguments): boolean {
|
|
8
|
-
const { endingDate } = args;
|
|
9
|
-
if (!endingDate) return true;
|
|
10
|
-
return getTime(row.date) <= getTime(endingDate);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
interface IArguments {
|
|
15
|
-
endingDate?: string;
|
|
16
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { FilterFn, SlickDataView, SlickGrid } from "slickgrid";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
IArguments,
|
|
5
|
-
IFilter,
|
|
6
|
-
ISlickRow,
|
|
7
|
-
ISlickTable,
|
|
8
|
-
} from "shared/model/types";
|
|
9
|
-
|
|
10
|
-
export abstract class DecoratorFilter implements IFilter {
|
|
11
|
-
protected filter: IFilter;
|
|
12
|
-
constructor(filter: IFilter) {
|
|
13
|
-
this.filter = filter;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
abstract filterFn(row: ISlickRow, args: IArguments): boolean;
|
|
17
|
-
public getFilterFn(): FilterFn<ISlickRow> {
|
|
18
|
-
const filterFn = this.filter.getFilterFn();
|
|
19
|
-
return (row, args): boolean => {
|
|
20
|
-
return this.filterFn(row, args) && filterFn(row, args);
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
public register(grid: SlickGrid, tableId: string): void {
|
|
24
|
-
this.tableId = tableId;
|
|
25
|
-
this.grid = grid;
|
|
26
|
-
const dataView: SlickDataView = grid.getData();
|
|
27
|
-
dataView.setFilter(this.getFilterFn());
|
|
28
|
-
dataView.setFilterArgs(this.args);
|
|
29
|
-
dataView.refresh();
|
|
30
|
-
}
|
|
31
|
-
public reset() {
|
|
32
|
-
this.filter.reset();
|
|
33
|
-
}
|
|
34
|
-
public print(table: ISlickTable): HTMLTableRowElement[] {
|
|
35
|
-
return this.filter.print(table);
|
|
36
|
-
}
|
|
37
|
-
set args(args) {
|
|
38
|
-
this.filter.args = args;
|
|
39
|
-
}
|
|
40
|
-
set grid(grid) {
|
|
41
|
-
this.filter.grid = grid;
|
|
42
|
-
}
|
|
43
|
-
set tableId(table) {
|
|
44
|
-
this.filter.tableId = table;
|
|
45
|
-
}
|
|
46
|
-
get args() {
|
|
47
|
-
return this.filter.args;
|
|
48
|
-
}
|
|
49
|
-
get grid() {
|
|
50
|
-
return this.filter.grid;
|
|
51
|
-
}
|
|
52
|
-
get tableId() {
|
|
53
|
-
return this.filter.tableId;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import moment from "moment/moment";
|
|
2
|
-
|
|
3
|
-
import { dateFormats } from "shared/model/consts";
|
|
4
|
-
|
|
5
|
-
import { DecoratorFilter } from "./DecoratorFilter";
|
|
6
|
-
|
|
7
|
-
export class DecoratorPeriod extends DecoratorFilter {
|
|
8
|
-
public filterFn(row: Record<string, any>, filterArgs: IFilterArgs): boolean {
|
|
9
|
-
const { endDate, startDate } = filterArgs;
|
|
10
|
-
if (endDate && startDate) {
|
|
11
|
-
const start = moment(startDate);
|
|
12
|
-
const end = moment(endDate);
|
|
13
|
-
const recordDate = moment(row.date, dateFormats);
|
|
14
|
-
return recordDate.isBetween(start, end, undefined, "[]");
|
|
15
|
-
} else {
|
|
16
|
-
return true;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
interface IFilterArgs {
|
|
22
|
-
endDate: string;
|
|
23
|
-
startDate: string;
|
|
24
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export { DeletedRowsFilter } from "./DeletedRowsFilter";
|
|
2
|
-
export { Filter } from "./Filter";
|
|
3
|
-
export { WithoutFilter } from "./WithoutFilter";
|
|
4
|
-
export {
|
|
5
|
-
DecoratorEndingDate,
|
|
6
|
-
DecoratorFilter,
|
|
7
|
-
DecoratorColumnFilter,
|
|
8
|
-
DecoratorPeriod,
|
|
9
|
-
} from "./decorators";
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
OnKeyDownEventArgs,
|
|
3
|
-
SlickDataView,
|
|
4
|
-
SlickEventData,
|
|
5
|
-
SlickGrid,
|
|
6
|
-
} from "slickgrid";
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
IExternalVariables,
|
|
10
|
-
IHotKeysBehavior,
|
|
11
|
-
ISlickRow,
|
|
12
|
-
ISlickTable,
|
|
13
|
-
TGridRow,
|
|
14
|
-
} from "shared/model/types";
|
|
15
|
-
|
|
16
|
-
import {
|
|
17
|
-
copySelectedRows,
|
|
18
|
-
hotKeysCopy,
|
|
19
|
-
hotKeysDelete,
|
|
20
|
-
hotKeysRedo,
|
|
21
|
-
hotKeysUndo,
|
|
22
|
-
nothingToCopy,
|
|
23
|
-
} from "../../../lib";
|
|
24
|
-
|
|
25
|
-
export class DefaultHotKeys implements IHotKeysBehavior {
|
|
26
|
-
private externalVariables: IExternalVariables = {};
|
|
27
|
-
private commandQueue: ISlickRow[][] = [];
|
|
28
|
-
private queueIndex = -1;
|
|
29
|
-
|
|
30
|
-
private getQueueIndex(): number {
|
|
31
|
-
return this.queueIndex;
|
|
32
|
-
}
|
|
33
|
-
private setQueueIndex(queueIndex: number): void {
|
|
34
|
-
this.queueIndex = queueIndex;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
public handleKeyboardEvent(
|
|
38
|
-
event: SlickEventData<OnKeyDownEventArgs>,
|
|
39
|
-
table: ISlickTable,
|
|
40
|
-
): void {
|
|
41
|
-
const grid = table.grid;
|
|
42
|
-
if (!table.isActive) return;
|
|
43
|
-
if (!grid) return;
|
|
44
|
-
const dataView: SlickDataView = grid.getData();
|
|
45
|
-
if (hotKeysCopy(event)) {
|
|
46
|
-
event.preventDefault();
|
|
47
|
-
event.stopImmediatePropagation();
|
|
48
|
-
// if (clientIsLocked()) return;
|
|
49
|
-
if (nothingToCopy(grid)) return;
|
|
50
|
-
if (this.externalVariables.editingAllowed === false) return;
|
|
51
|
-
copySelectedRows(grid);
|
|
52
|
-
grid.invalidate();
|
|
53
|
-
this.pushToCommandQueue(grid);
|
|
54
|
-
table.isEdited = true;
|
|
55
|
-
} else if (hotKeysDelete(event)) {
|
|
56
|
-
event.preventDefault();
|
|
57
|
-
event.stopImmediatePropagation();
|
|
58
|
-
// if (clientIsLocked()) return;
|
|
59
|
-
const selectedRows = grid.getSelectedRows();
|
|
60
|
-
if (!selectedRows.length) return;
|
|
61
|
-
selectedRows.forEach((rowNumber): void => {
|
|
62
|
-
const row = dataView.getItem<TGridRow>(rowNumber);
|
|
63
|
-
row.isDeleted = true;
|
|
64
|
-
});
|
|
65
|
-
grid.setSelectedRows([]);
|
|
66
|
-
dataView.refresh();
|
|
67
|
-
grid.invalidate();
|
|
68
|
-
this.pushToCommandQueue(grid);
|
|
69
|
-
table.isEdited = true;
|
|
70
|
-
} else if (hotKeysUndo(event)) {
|
|
71
|
-
event.preventDefault();
|
|
72
|
-
event.stopImmediatePropagation();
|
|
73
|
-
const queueIndex = this.getQueueIndex();
|
|
74
|
-
if (queueIndex < 1) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
const newQueueIndex = queueIndex - 1;
|
|
78
|
-
this.setQueueIndex(newQueueIndex);
|
|
79
|
-
dataView.setItems(copy(this.commandQueue[newQueueIndex]));
|
|
80
|
-
grid.invalidate();
|
|
81
|
-
table.isEdited = newQueueIndex !== 0;
|
|
82
|
-
} else if (hotKeysRedo(event)) {
|
|
83
|
-
event.preventDefault();
|
|
84
|
-
event.stopImmediatePropagation();
|
|
85
|
-
const queueIndex = this.getQueueIndex();
|
|
86
|
-
if (queueIndex === this.commandQueue.length - 1) return;
|
|
87
|
-
const newQueueIndex = queueIndex + 1;
|
|
88
|
-
this.setQueueIndex(newQueueIndex);
|
|
89
|
-
dataView.setItems(copy(this.commandQueue[newQueueIndex]));
|
|
90
|
-
grid.invalidate();
|
|
91
|
-
table.isEdited = true;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
public pushToCommandQueue(grid: SlickGrid | null): void {
|
|
95
|
-
if (!grid) return;
|
|
96
|
-
const dataView: SlickDataView = grid.getData();
|
|
97
|
-
const rows = dataView.getItems();
|
|
98
|
-
const queueIndex = this.getQueueIndex();
|
|
99
|
-
const newQueueIndex = queueIndex + 1;
|
|
100
|
-
this.commandQueue.length = newQueueIndex;
|
|
101
|
-
this.commandQueue.push(copy(rows));
|
|
102
|
-
this.setQueueIndex(newQueueIndex);
|
|
103
|
-
}
|
|
104
|
-
public resetQueue(): void {
|
|
105
|
-
this.commandQueue.length = 0;
|
|
106
|
-
this.queueIndex = -1;
|
|
107
|
-
}
|
|
108
|
-
public setExternalVariables(variables: IExternalVariables): void {
|
|
109
|
-
this.externalVariables = { ...this.externalVariables, ...variables };
|
|
110
|
-
}
|
|
111
|
-
public getExternalVariables(): IExternalVariables {
|
|
112
|
-
return this.externalVariables;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function copy(rows: ISlickRow[]): ISlickRow[] {
|
|
117
|
-
return rows.map((row) => ({ ...row }));
|
|
118
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { IExternalVariables, IHotKeysBehavior } from "shared/model/types";
|
|
2
|
-
|
|
3
|
-
export class WithoutHotKeys implements IHotKeysBehavior {
|
|
4
|
-
handleKeyboardEvent(): void {
|
|
5
|
-
// does nothing
|
|
6
|
-
}
|
|
7
|
-
pushToCommandQueue(): void {
|
|
8
|
-
// does nothing
|
|
9
|
-
}
|
|
10
|
-
resetQueue(): void {
|
|
11
|
-
// does nothing
|
|
12
|
-
}
|
|
13
|
-
setExternalVariables(_variables: IExternalVariables): void {
|
|
14
|
-
// does nothing
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
getExternalVariables(): IExternalVariables {
|
|
18
|
-
return {};
|
|
19
|
-
}
|
|
20
|
-
}
|