slick-table 0.0.15 → 0.0.16
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/.prettierignore +2 -0
- package/.prettierrc +22 -0
- package/dist/tsconfig.build-types.tsbuildinfo +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/eslint.config.js +23 -0
- package/index.html +13 -0
- package/package.json +9 -5
- package/src/App.tsx +9 -0
- package/src/app/styles/global.scss +31 -0
- package/src/app/styles/slickgrid.scss +13 -0
- package/src/app/types/index.d.ts +9 -0
- package/src/entities/portal/index.ts +3 -0
- package/src/entities/portal/lib/index.ts +1 -0
- package/src/entities/portal/lib/visibility/index.ts +1 -0
- package/src/entities/portal/lib/visibility/makeVisible.ts +9 -0
- package/src/entities/portal/model/index.ts +1 -0
- package/src/entities/portal/model/portalId.ts +1 -0
- package/src/entities/portal/ui/Overlay/Overlay.style.ts +14 -0
- package/src/entities/portal/ui/Overlay/Overlay.test.tsx +19 -0
- package/src/entities/portal/ui/Overlay/Overlay.tsx +20 -0
- package/src/entities/portal/ui/Overlay/index.ts +1 -0
- package/src/entities/portal/ui/Portal.style.ts +20 -0
- package/src/entities/portal/ui/Portal.test.tsx +48 -0
- package/src/entities/portal/ui/Portal.tsx +26 -0
- package/src/entities/portal/ui/index.ts +1 -0
- package/src/features/column-filters/index.ts +1 -0
- package/src/features/column-filters/lib/filter/applyFilter.ts +25 -0
- package/src/features/column-filters/lib/filter/index.ts +1 -0
- package/src/features/column-filters/lib/hooks/index.ts +2 -0
- package/src/features/column-filters/lib/hooks/useOpenMenu.ts +43 -0
- package/src/features/column-filters/lib/hooks/useSubscribeToEvent.ts +17 -0
- package/src/features/column-filters/lib/index.ts +4 -0
- package/src/features/column-filters/lib/props/datePickerProps.tsx +11 -0
- package/src/features/column-filters/lib/props/index.ts +1 -0
- package/src/features/column-filters/lib/select/firstIn.ts +22 -0
- package/src/features/column-filters/lib/select/index.ts +1 -0
- package/src/features/column-filters/model/consts/defaultValue.ts +6 -0
- package/src/features/column-filters/model/consts/index.ts +2 -0
- package/src/features/column-filters/model/consts/label.ts +5 -0
- package/src/features/column-filters/model/index.ts +2 -0
- package/src/features/column-filters/model/types/IProps.ts +9 -0
- package/src/features/column-filters/model/types/index.ts +1 -0
- package/src/features/column-filters/ui/BooleanInput/BooleanInput.style.ts +10 -0
- package/src/features/column-filters/ui/BooleanInput/BooleanInput.tsx +53 -0
- package/src/features/column-filters/ui/BooleanInput/index.ts +1 -0
- package/src/features/column-filters/ui/ButtonReset/ButtonReset.style.ts +10 -0
- package/src/features/column-filters/ui/ButtonReset/ButtonReset.tsx +39 -0
- package/src/features/column-filters/ui/ButtonReset/index.ts +1 -0
- package/src/features/column-filters/ui/ColumnFilters.style.ts +12 -0
- package/src/features/column-filters/ui/ColumnFilters.tsx +41 -0
- package/src/features/column-filters/ui/DateBetween/DateBetween.tsx +52 -0
- package/src/features/column-filters/ui/DateBetween/index.ts +1 -0
- package/src/features/column-filters/ui/DateInput/DateInput.tsx +36 -0
- package/src/features/column-filters/ui/DateInput/index.ts +1 -0
- package/src/features/column-filters/ui/InputArea/InputArea.tsx +63 -0
- package/src/features/column-filters/ui/InputArea/index.ts +1 -0
- package/src/features/column-filters/ui/MultipleSelect/index.ts +1 -0
- package/src/features/column-filters/ui/MultipleSelect/lib/index.ts +2 -0
- package/src/features/column-filters/ui/MultipleSelect/lib/props/index.ts +1 -0
- package/src/features/column-filters/ui/MultipleSelect/lib/props/props.ts +36 -0
- package/src/features/column-filters/ui/MultipleSelect/lib/sorting/ascending.ts +17 -0
- package/src/features/column-filters/ui/MultipleSelect/lib/sorting/index.ts +1 -0
- package/src/features/column-filters/ui/MultipleSelect/model/IValue.ts +1 -0
- package/src/features/column-filters/ui/MultipleSelect/model/index.ts +1 -0
- package/src/features/column-filters/ui/MultipleSelect/ui/MultipleSelect.style.ts +9 -0
- package/src/features/column-filters/ui/MultipleSelect/ui/MultipleSelect.tsx +72 -0
- package/src/features/column-filters/ui/MultipleSelect/ui/index.ts +1 -0
- package/src/features/column-filters/ui/NumberBetween/NumberBetween.tsx +42 -0
- package/src/features/column-filters/ui/NumberBetween/index.ts +1 -0
- package/src/features/column-filters/ui/NumberInput/NumberInput.tsx +24 -0
- package/src/features/column-filters/ui/NumberInput/index.ts +1 -0
- package/src/features/column-filters/ui/SelectFilter/index.ts +1 -0
- package/src/features/column-filters/ui/SelectFilter/model/index.ts +1 -0
- package/src/features/column-filters/ui/SelectFilter/model/options/index.ts +1 -0
- package/src/features/column-filters/ui/SelectFilter/model/options/options.ts +66 -0
- package/src/features/column-filters/ui/SelectFilter/ui/SelectFilter.tsx +50 -0
- package/src/features/column-filters/ui/SelectFilter/ui/index.ts +1 -0
- package/src/features/column-filters/ui/TextInput/TextInput.tsx +23 -0
- package/src/features/column-filters/ui/TextInput/index.ts +1 -0
- package/src/features/column-filters/ui/index.ts +1 -0
- package/src/features/context-menu/index.ts +1 -0
- package/src/features/context-menu/lib/hooks/index.ts +1 -0
- package/src/features/context-menu/lib/hooks/useSubscribeToEvent.ts +25 -0
- package/src/features/context-menu/lib/index.ts +1 -0
- package/src/features/context-menu/ui/ButtonDownloadCSV/ButtonDownloadCSV.tsx +34 -0
- package/src/features/context-menu/ui/ButtonDownloadCSV/index.ts +1 -0
- package/src/features/context-menu/ui/ButtonGroup/ButtonGroup.tsx +28 -0
- package/src/features/context-menu/ui/ButtonGroup/index.ts +1 -0
- package/src/features/context-menu/ui/ButtonResetFilters/index.ts +1 -0
- package/src/features/context-menu/ui/ButtonResetFilters/lib/index.ts +1 -0
- package/src/features/context-menu/ui/ButtonResetFilters/lib/visibility/hasFiltersApplied.ts +8 -0
- package/src/features/context-menu/ui/ButtonResetFilters/lib/visibility/index.ts +1 -0
- package/src/features/context-menu/ui/ButtonResetFilters/ui/ButtonResetFilters.tsx +39 -0
- package/src/features/context-menu/ui/ButtonResetFilters/ui/index.ts +1 -0
- package/src/features/context-menu/ui/ButtonUngroup/ButtonUngroup.tsx +28 -0
- package/src/features/context-menu/ui/ButtonUngroup/index.ts +1 -0
- package/src/features/context-menu/ui/CollapseAll/CollapseAll.tsx +31 -0
- package/src/features/context-menu/ui/CollapseAll/index.ts +1 -0
- package/src/features/context-menu/ui/ContextMenu.style.ts +29 -0
- package/src/features/context-menu/ui/ContextMenu.tsx +51 -0
- package/src/features/context-menu/ui/CopyToClipboard/CopyToClipboard.tsx +42 -0
- package/src/features/context-menu/ui/CopyToClipboard/index.ts +1 -0
- package/src/features/context-menu/ui/ExpandAll/ExpandAll.tsx +30 -0
- package/src/features/context-menu/ui/ExpandAll/index.ts +1 -0
- package/src/features/context-menu/ui/Print/index.ts +1 -0
- package/src/features/context-menu/ui/Print/ui/Print.tsx +25 -0
- package/src/features/context-menu/ui/Print/ui/index.ts +1 -0
- package/src/features/context-menu/ui/index.ts +1 -0
- package/src/index.scss +2 -0
- package/src/index.ts +2 -0
- package/src/main.tsx +15 -0
- package/src/pages/main/index.ts +1 -0
- package/src/pages/main/lib/columns.ts +33 -0
- package/src/pages/main/lib/index.ts +3 -0
- package/src/pages/main/lib/options.ts +6 -0
- package/src/pages/main/lib/table.ts +11 -0
- package/src/pages/main/ui/Main.style.ts +18 -0
- package/src/pages/main/ui/Main.tsx +30 -0
- package/src/pages/main/ui/index.ts +1 -0
- package/src/setupTests.ts +5 -0
- package/src/shared/lib/an-event/index.ts +31 -0
- package/src/shared/lib/datetime/dateToString.spec.ts +11 -0
- package/src/shared/lib/datetime/dateToString.ts +8 -0
- package/src/shared/lib/datetime/getTime.spec.ts +10 -0
- package/src/shared/lib/datetime/getTime.ts +3 -0
- package/src/shared/lib/datetime/index.ts +2 -0
- package/src/shared/lib/debounce/index.ts +11 -0
- package/src/shared/lib/dom/elementNotVisible.spec.ts +72 -0
- package/src/shared/lib/dom/elementNotVisible.ts +9 -0
- package/src/shared/lib/dom/index.ts +1 -0
- package/src/shared/lib/format/IOptions.ts +11 -0
- package/src/shared/lib/format/addParentheses.spec.ts +9 -0
- package/src/shared/lib/format/addParentheses.ts +7 -0
- package/src/shared/lib/format/formatNumber.spec.ts +50 -0
- package/src/shared/lib/format/formatNumber.ts +62 -0
- package/src/shared/lib/format/index.ts +2 -0
- package/src/shared/lib/numbers/index.ts +1 -0
- package/src/shared/lib/numbers/toNumber.spec.ts +25 -0
- package/src/shared/lib/numbers/toNumber.ts +11 -0
- package/src/shared/lib/regexp/dates.spec.ts +23 -0
- package/src/shared/lib/regexp/dates.ts +6 -0
- package/src/shared/lib/regexp/escapeSpecialChar.spec.ts +24 -0
- package/src/shared/lib/regexp/escapeSpecialChar.ts +4 -0
- package/src/shared/lib/regexp/index.ts +2 -0
- package/src/shared/lib/slickgrid/index.ts +68 -0
- package/src/shared/lib/slickgrid/lib/callbacks/getOnKeyDownCallback.ts +12 -0
- package/src/shared/lib/slickgrid/lib/callbacks/index.ts +4 -0
- package/src/shared/lib/slickgrid/lib/callbacks/onCellChange.ts +14 -0
- package/src/shared/lib/slickgrid/lib/callbacks/onRowCountChanged.ts +12 -0
- package/src/shared/lib/slickgrid/lib/callbacks/onRowsChanged.ts +8 -0
- package/src/shared/lib/slickgrid/lib/contextMenu/index.ts +1 -0
- package/src/shared/lib/slickgrid/lib/contextMenu/openContextMenu.ts +17 -0
- package/src/shared/lib/slickgrid/lib/editors/Autocomplete/Autocomplete.ts +152 -0
- package/src/shared/lib/slickgrid/lib/editors/Autocomplete/EditorAutocomplete.ts +66 -0
- package/src/shared/lib/slickgrid/lib/editors/Autocomplete/EditorSelectWithSearch.ts +79 -0
- package/src/shared/lib/slickgrid/lib/editors/Autocomplete/index.ts +3 -0
- package/src/shared/lib/slickgrid/lib/editors/EditorAmount.ts +82 -0
- package/src/shared/lib/slickgrid/lib/editors/EditorDate.ts +127 -0
- package/src/shared/lib/slickgrid/lib/editors/EditorSelectNumber.ts +16 -0
- package/src/shared/lib/slickgrid/lib/editors/EditorSelectString.ts +95 -0
- package/src/shared/lib/slickgrid/lib/editors/index.ts +9 -0
- package/src/shared/lib/slickgrid/lib/formatters/DateFormatter.ts +9 -0
- package/src/shared/lib/slickgrid/lib/formatters/FormatterCheck.ts +11 -0
- package/src/shared/lib/slickgrid/lib/formatters/PercentFormatter.spec.ts +11 -0
- package/src/shared/lib/slickgrid/lib/formatters/PercentFormatter.ts +8 -0
- package/src/shared/lib/slickgrid/lib/formatters/StringFormatter.ts +2 -0
- package/src/shared/lib/slickgrid/lib/formatters/getFormatterNumber.ts +17 -0
- package/src/shared/lib/slickgrid/lib/formatters/index.ts +5 -0
- package/src/shared/lib/slickgrid/lib/functions/addNewRow.ts +23 -0
- package/src/shared/lib/slickgrid/lib/functions/commitCurrentEdit.ts +6 -0
- package/src/shared/lib/slickgrid/lib/functions/copySelectedRows.ts +35 -0
- package/src/shared/lib/slickgrid/lib/functions/deleteRows.ts +20 -0
- package/src/shared/lib/slickgrid/lib/functions/getActiveRowId.ts +16 -0
- package/src/shared/lib/slickgrid/lib/functions/getDisplayedRows.ts +13 -0
- package/src/shared/lib/slickgrid/lib/functions/getLastRow.ts +6 -0
- package/src/shared/lib/slickgrid/lib/functions/getMaxId.ts +13 -0
- package/src/shared/lib/slickgrid/lib/functions/index.ts +10 -0
- package/src/shared/lib/slickgrid/lib/functions/isDeletionDangerous.ts +21 -0
- package/src/shared/lib/slickgrid/lib/functions/wereEdited.ts +12 -0
- package/src/shared/lib/slickgrid/lib/grouping/index.ts +1 -0
- package/src/shared/lib/slickgrid/lib/grouping/sumTotalsFormatter.ts +21 -0
- package/src/shared/lib/slickgrid/lib/highlighting/getColumnsHash.ts +8 -0
- package/src/shared/lib/slickgrid/lib/highlighting/highlightCell.ts +21 -0
- package/src/shared/lib/slickgrid/lib/highlighting/highlightColumns.ts +24 -0
- package/src/shared/lib/slickgrid/lib/highlighting/index.ts +2 -0
- package/src/shared/lib/slickgrid/lib/hooks/eventClickOnTable.ts +17 -0
- package/src/shared/lib/slickgrid/lib/hooks/index.ts +3 -0
- package/src/shared/lib/slickgrid/lib/hooks/useHotKeys.ts +39 -0
- package/src/shared/lib/slickgrid/lib/hooks/useListenIfTablesWereEdited.ts +36 -0
- package/src/shared/lib/slickgrid/lib/hooks/useUpdateTotal.ts +19 -0
- package/src/shared/lib/slickgrid/lib/hotKeys/hotKeysCopy.ts +7 -0
- package/src/shared/lib/slickgrid/lib/hotKeys/hotKeysDelete.ts +7 -0
- package/src/shared/lib/slickgrid/lib/hotKeys/hotKeysRedo.ts +7 -0
- package/src/shared/lib/slickgrid/lib/hotKeys/hotKeysReverse.ts +7 -0
- package/src/shared/lib/slickgrid/lib/hotKeys/hotKeysUndo.ts +7 -0
- package/src/shared/lib/slickgrid/lib/hotKeys/index.ts +7 -0
- package/src/shared/lib/slickgrid/lib/hotKeys/nothingToCopy.ts +14 -0
- package/src/shared/lib/slickgrid/lib/hotKeys/positionToPaste.ts +12 -0
- package/src/shared/lib/slickgrid/lib/index.ts +59 -0
- package/src/shared/lib/slickgrid/lib/selection/getUpdates.ts +41 -0
- package/src/shared/lib/slickgrid/lib/selection/index.ts +2 -0
- package/src/shared/lib/slickgrid/lib/selection/selectedRows.ts +17 -0
- package/src/shared/lib/slickgrid/lib/sorting/ColumnSorter.ts +89 -0
- package/src/shared/lib/slickgrid/lib/sorting/index.ts +1 -0
- package/src/shared/lib/slickgrid/lib/totals-row/addTitle.ts +8 -0
- package/src/shared/lib/slickgrid/lib/totals-row/addTotalSum.ts +16 -0
- package/src/shared/lib/slickgrid/lib/totals-row/index.ts +2 -0
- package/src/shared/lib/slickgrid/lib/totals-row/totalAmountOf.ts +13 -0
- package/src/shared/lib/slickgrid/lib/totals-row/updateTotal.ts +25 -0
- package/src/shared/lib/slickgrid/lib/totals-row/updateTotals.ts +10 -0
- package/src/shared/lib/slickgrid/lib/validators/DateValidator.ts +12 -0
- package/src/shared/lib/slickgrid/lib/validators/EmptyStringValidator.ts +5 -0
- package/src/shared/lib/slickgrid/lib/validators/LengthValidator.ts +7 -0
- package/src/shared/lib/slickgrid/lib/validators/index.ts +3 -0
- package/src/shared/lib/slickgrid/model/SlickTable/csvDownloadManager/DownloadManager.ts +110 -0
- package/src/shared/lib/slickgrid/model/SlickTable/csvDownloadManager/index.ts +1 -0
- package/src/shared/lib/slickgrid/model/SlickTable/filters/DeletedRowsFilter.test.ts +36 -0
- package/src/shared/lib/slickgrid/model/SlickTable/filters/DeletedRowsFilter.ts +12 -0
- package/src/shared/lib/slickgrid/model/SlickTable/filters/Filter.ts +54 -0
- package/src/shared/lib/slickgrid/model/SlickTable/filters/WithoutFilter.ts +30 -0
- package/src/shared/lib/slickgrid/model/SlickTable/filters/decorators/ColumnFilter/DecoratorColumnFilter.ts +53 -0
- package/src/shared/lib/slickgrid/model/SlickTable/filters/decorators/ColumnFilter/Filter.ts +108 -0
- package/src/shared/lib/slickgrid/model/SlickTable/filters/decorators/ColumnFilter/index.ts +1 -0
- package/src/shared/lib/slickgrid/model/SlickTable/filters/decorators/DecoratorEndingDate.ts +16 -0
- package/src/shared/lib/slickgrid/model/SlickTable/filters/decorators/DecoratorFilter.ts +55 -0
- package/src/shared/lib/slickgrid/model/SlickTable/filters/decorators/DecoratorPeriod.ts +24 -0
- package/src/shared/lib/slickgrid/model/SlickTable/filters/decorators/index.ts +4 -0
- package/src/shared/lib/slickgrid/model/SlickTable/filters/index.ts +9 -0
- package/src/shared/lib/slickgrid/model/SlickTable/hotKeys/DefaultHotKeys.ts +118 -0
- package/src/shared/lib/slickgrid/model/SlickTable/hotKeys/WithoutHotKeys.ts +20 -0
- package/src/shared/lib/slickgrid/model/SlickTable/hotKeys/decorators/HotKeysDecorator.ts +32 -0
- package/src/shared/lib/slickgrid/model/SlickTable/hotKeys/decorators/PreventCopying.ts +21 -0
- package/src/shared/lib/slickgrid/model/SlickTable/hotKeys/decorators/RedoUndoOnly.ts +25 -0
- package/src/shared/lib/slickgrid/model/SlickTable/hotKeys/decorators/WithConfirmationOfDeletion.ts +33 -0
- package/src/shared/lib/slickgrid/model/SlickTable/hotKeys/decorators/index.ts +4 -0
- package/src/shared/lib/slickgrid/model/SlickTable/hotKeys/index.ts +9 -0
- package/src/shared/lib/slickgrid/model/SlickTable/index.ts +18 -0
- package/src/shared/lib/slickgrid/model/SlickTable/printer/DefaultPrinter.ts +179 -0
- package/src/shared/lib/slickgrid/model/SlickTable/printer/index.ts +1 -0
- package/src/shared/lib/slickgrid/model/SlickTable/printer/model/consts/cssStyles.ts +46 -0
- package/src/shared/lib/slickgrid/model/SlickTable/printer/model/consts/index.ts +1 -0
- package/src/shared/lib/slickgrid/model/SlickTable/printer/model/index.ts +1 -0
- package/src/shared/lib/slickgrid/model/SlickTable/table/SlickTable.ts +148 -0
- package/src/shared/lib/slickgrid/model/SlickTable/table/index.ts +1 -0
- package/src/shared/lib/slickgrid/model/events/eventContextMenu.ts +10 -0
- package/src/shared/lib/slickgrid/model/events/index.ts +1 -0
- package/src/shared/lib/slickgrid/model/index.ts +17 -0
- package/src/shared/lib/slickgrid/ui/HeaderButtons/index.ts +2 -0
- package/src/shared/lib/slickgrid/ui/HeaderButtons/lib/handleClick/handleHeaderButtons.ts +27 -0
- package/src/shared/lib/slickgrid/ui/HeaderButtons/lib/handleClick/index.ts +1 -0
- package/src/shared/lib/slickgrid/ui/HeaderButtons/lib/highlighting/headerButtons.ts +45 -0
- package/src/shared/lib/slickgrid/ui/HeaderButtons/lib/highlighting/index.ts +1 -0
- package/src/shared/lib/slickgrid/ui/HeaderButtons/lib/index.ts +2 -0
- package/src/shared/lib/slickgrid/ui/HeaderButtons/model/buttons/index.ts +1 -0
- package/src/shared/lib/slickgrid/ui/HeaderButtons/model/buttons/openColumnFilter.ts +10 -0
- package/src/shared/lib/slickgrid/ui/HeaderButtons/model/event/eventOpenColumnFilters.ts +13 -0
- package/src/shared/lib/slickgrid/ui/HeaderButtons/model/event/index.ts +1 -0
- package/src/shared/lib/slickgrid/ui/HeaderButtons/model/index.ts +2 -0
- package/src/shared/lib/slickgrid/ui/SlickgridTable/index.ts +1 -0
- package/src/shared/lib/slickgrid/ui/SlickgridTable/lib/callbacks/index.ts +1 -0
- package/src/shared/lib/slickgrid/ui/SlickgridTable/lib/callbacks/onAddNewRow.ts +34 -0
- package/src/shared/lib/slickgrid/ui/SlickgridTable/lib/hooks/index.ts +1 -0
- package/src/shared/lib/slickgrid/ui/SlickgridTable/lib/hooks/useGrid.ts +140 -0
- package/src/shared/lib/slickgrid/ui/SlickgridTable/lib/index.ts +2 -0
- package/src/shared/lib/slickgrid/ui/SlickgridTable/model/defaultOptions.ts +8 -0
- package/src/shared/lib/slickgrid/ui/SlickgridTable/model/index.ts +2 -0
- package/src/shared/lib/slickgrid/ui/SlickgridTable/model/types/Props.ts +42 -0
- package/src/shared/lib/slickgrid/ui/SlickgridTable/model/types/index.ts +1 -0
- package/src/shared/lib/slickgrid/ui/SlickgridTable/ui/SlickgridTable.tsx +51 -0
- package/src/shared/lib/slickgrid/ui/SlickgridTable/ui/index.ts +1 -0
- package/src/shared/lib/slickgrid/ui/columns/columnCheckboxSelector/columnCheckboxSelector.ts +7 -0
- package/src/shared/lib/slickgrid/ui/columns/columnCheckboxSelector/index.ts +1 -0
- package/src/shared/lib/slickgrid/ui/columns/columnIsEdited/index.ts +1 -0
- package/src/shared/lib/slickgrid/ui/columns/columnIsEdited/lib/index.ts +1 -0
- package/src/shared/lib/slickgrid/ui/columns/columnIsEdited/lib/setEditedMark.spec.ts +11 -0
- package/src/shared/lib/slickgrid/ui/columns/columnIsEdited/lib/setEditedMark.ts +7 -0
- package/src/shared/lib/slickgrid/ui/columns/columnIsEdited/ui/columnIsEdited.ts +16 -0
- package/src/shared/lib/slickgrid/ui/columns/columnIsEdited/ui/index.ts +1 -0
- package/src/shared/lib/slickgrid/ui/columns/index.ts +2 -0
- package/src/shared/lib/slickgrid/ui/index.ts +9 -0
- package/src/shared/lib/slickgrid/ui/styles/WithTableStyles/WithTableStyles.style.ts +156 -0
- package/src/shared/lib/slickgrid/ui/styles/WithTableStyles/WithTableStyles.tsx +11 -0
- package/src/shared/lib/slickgrid/ui/styles/WithTableStyles/index.ts +1 -0
- package/src/shared/lib/slickgrid/ui/styles/index.ts +1 -0
- package/src/shared/lib/slickgrid/ui/styles/keyframes/index.ts +1 -0
- package/src/shared/lib/slickgrid/ui/styles/keyframes/wink.ts +7 -0
- package/src/shared/lib/sorting/Sort.ts +26 -0
- package/src/shared/lib/sorting/index.ts +1 -0
- package/src/shared/lib/stringCalculator/index.ts +2 -0
- package/src/shared/lib/stringCalculator/stringCalculator.js +834 -0
- package/src/shared/lib/stringCalculator/stringCalculator.spec.ts +16 -0
- package/src/shared/lib/strings/deleteDoubleQuotes.spec.ts +11 -0
- package/src/shared/lib/strings/deleteDoubleQuotes.ts +5 -0
- package/src/shared/lib/strings/index.ts +3 -0
- package/src/shared/lib/strings/removeHtml.spec.ts +29 -0
- package/src/shared/lib/strings/removeHtml.ts +5 -0
- package/src/shared/lib/strings/toStringWithCommas.spec.ts +16 -0
- package/src/shared/lib/strings/toStringWithCommas.ts +15 -0
- package/src/shared/model/consts/columnId.ts +1 -0
- package/src/shared/model/consts/dateFormats.ts +5 -0
- package/src/shared/model/consts/index.ts +4 -0
- package/src/shared/model/consts/invalidDate.ts +1 -0
- package/src/shared/model/consts/noPrivilegesMessage.ts +1 -0
- package/src/shared/model/enums/EColumnFilter.ts +16 -0
- package/src/shared/model/enums/EColumnFiltersGroup.ts +10 -0
- package/src/shared/model/enums/EDateFormat.ts +11 -0
- package/src/shared/model/enums/EKey.ts +8 -0
- package/src/shared/model/enums/EKeyCode.ts +8 -0
- package/src/shared/model/enums/ESortType.ts +6 -0
- package/src/shared/model/enums/index.ts +6 -0
- package/src/shared/model/types/IArguments.ts +14 -0
- package/src/shared/model/types/IColumn.ts +13 -0
- package/src/shared/model/types/IColumnFilterValue.ts +4 -0
- package/src/shared/model/types/IDownloadManager.ts +6 -0
- package/src/shared/model/types/IEditedRow.ts +5 -0
- package/src/shared/model/types/IExternalVariables.ts +1 -0
- package/src/shared/model/types/IFilter.ts +30 -0
- package/src/shared/model/types/IGrouping.ts +12 -0
- package/src/shared/model/types/IHotKeysBehavior.ts +15 -0
- package/src/shared/model/types/IObserver.ts +3 -0
- package/src/shared/model/types/IPrinter.ts +24 -0
- package/src/shared/model/types/ISlickRow.ts +1 -0
- package/src/shared/model/types/ISlickTable.ts +38 -0
- package/src/shared/model/types/TGridRow.ts +6 -0
- package/src/shared/model/types/index.ts +14 -0
- package/src/shared/ui/ContextSelect/ContextSelect.style.ts +9 -0
- package/src/shared/ui/ContextSelect/ContextSelect.tsx +87 -0
- package/src/shared/ui/ContextSelect/index.ts +2 -0
- package/src/shared/ui/notification/index.ts +1 -0
- package/src/shared/ui/notification/model/index.ts +1 -0
- package/src/shared/ui/notification/ui/index.style.ts +13 -0
- package/src/shared/ui/notification/ui/index.tsx +41 -0
- package/src/shared/ui/styles/WithDatePickerStyles.ts +11 -0
- package/src/shared/ui/styles/index.ts +1 -0
- package/src/vite-env.d.ts +1 -0
- package/tsconfig.build-types.json +21 -0
- package/tsconfig.build.json +17 -0
- package/tsconfig.json +23 -0
- package/vite.config.ts +34 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AnEvent } from "shared/lib/an-event";
|
|
2
|
+
import { EColumnFiltersGroup } from "shared/model/enums";
|
|
3
|
+
import { ISlickTable } from "shared/model/types";
|
|
4
|
+
|
|
5
|
+
class OpenColumnFilters extends AnEvent {
|
|
6
|
+
columnId: string | number = "";
|
|
7
|
+
group: EColumnFiltersGroup = EColumnFiltersGroup.Text;
|
|
8
|
+
table?: ISlickTable | undefined;
|
|
9
|
+
target: HTMLElement | null = null;
|
|
10
|
+
x = 0;
|
|
11
|
+
y = 0;
|
|
12
|
+
}
|
|
13
|
+
export const eventOpenColumnFilters = new OpenColumnFilters();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { eventOpenColumnFilters } from "./eventOpenColumnFilters";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SlickgridTable } from "./ui";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { onAddNewRow } from "./onAddNewRow";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Handler,
|
|
3
|
+
OnAddNewRowEventArgs,
|
|
4
|
+
SlickDataView,
|
|
5
|
+
SlickGrid,
|
|
6
|
+
} from "slickgrid";
|
|
7
|
+
|
|
8
|
+
import { ISlickTable } from "shared/model/types";
|
|
9
|
+
|
|
10
|
+
import { getLastRow, getMaxId } from "../../../../lib";
|
|
11
|
+
|
|
12
|
+
export const onAddNewRow =
|
|
13
|
+
(table: ISlickTable): Handler<OnAddNewRowEventArgs> =>
|
|
14
|
+
(_e, { grid, item }): void => {
|
|
15
|
+
addNewRow(grid, item);
|
|
16
|
+
grid.updateRowCount();
|
|
17
|
+
grid.invalidate();
|
|
18
|
+
table.isEdited = true;
|
|
19
|
+
table.hotKeysBehavior.pushToCommandQueue(grid);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const addNewRow = (grid: SlickGrid, item: Record<string, any>): void => {
|
|
23
|
+
const dataView: SlickDataView = grid.getData();
|
|
24
|
+
const lastRow = getLastRow<Record<string, any>>(dataView);
|
|
25
|
+
const maxId = getMaxId(grid);
|
|
26
|
+
const newRow = {
|
|
27
|
+
...lastRow,
|
|
28
|
+
...item,
|
|
29
|
+
id: maxId + 1,
|
|
30
|
+
isEdited: true,
|
|
31
|
+
isNew: true,
|
|
32
|
+
};
|
|
33
|
+
dataView.addItem(newRow);
|
|
34
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useGrid } from "./useGrid";
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Handler,
|
|
4
|
+
OnAddNewRowEventArgs,
|
|
5
|
+
OnCellChangeEventArgs,
|
|
6
|
+
SlickCheckboxSelectColumn,
|
|
7
|
+
SlickGroupItemMetadataProvider,
|
|
8
|
+
SlickHeaderButtons,
|
|
9
|
+
SlickHeaderMenu,
|
|
10
|
+
SlickResizer,
|
|
11
|
+
SlickRowSelectionModel,
|
|
12
|
+
SlickDataView as SlickgridDataView,
|
|
13
|
+
} from "slickgrid";
|
|
14
|
+
|
|
15
|
+
import { CHECKBOX_SELECTOR } from "shared/model/consts";
|
|
16
|
+
|
|
17
|
+
import {
|
|
18
|
+
onRowsChanged,
|
|
19
|
+
columnSorter as sorter,
|
|
20
|
+
onRowCountChanged as updateRowCount,
|
|
21
|
+
updateTotals,
|
|
22
|
+
} from "../../../../lib";
|
|
23
|
+
import { openContextMenu } from "../../../../lib/contextMenu";
|
|
24
|
+
import { handleHeaderButtons, headerButtons } from "../../../HeaderButtons";
|
|
25
|
+
import { Props, defaultOptions } from "../../model";
|
|
26
|
+
|
|
27
|
+
export function useGrid({
|
|
28
|
+
SlickDataView = SlickgridDataView,
|
|
29
|
+
applyCellCssStyles,
|
|
30
|
+
columnSorter = sorter,
|
|
31
|
+
columns,
|
|
32
|
+
getItemMetadata,
|
|
33
|
+
groups,
|
|
34
|
+
items,
|
|
35
|
+
onAddNewRow,
|
|
36
|
+
onBeforeEditCell,
|
|
37
|
+
onCellChange,
|
|
38
|
+
onClick,
|
|
39
|
+
onDblClick,
|
|
40
|
+
onHeaderMenuCommand,
|
|
41
|
+
onRowCountChanged = updateRowCount,
|
|
42
|
+
options = {},
|
|
43
|
+
table,
|
|
44
|
+
}: Props & {
|
|
45
|
+
onAddNewRow: Handler<OnAddNewRowEventArgs>;
|
|
46
|
+
onCellChange: Handler<OnCellChangeEventArgs>;
|
|
47
|
+
}) {
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
const groupItemMetadataProvider = new SlickGroupItemMetadataProvider();
|
|
50
|
+
const headerButtonsPlugin = new SlickHeaderButtons({});
|
|
51
|
+
const headerMenuPlugin = new SlickHeaderMenu({});
|
|
52
|
+
const dataView = new SlickDataView({
|
|
53
|
+
groupItemMetadataProvider: groups ? groupItemMetadataProvider : undefined,
|
|
54
|
+
});
|
|
55
|
+
const grid = table.createGrid(dataView, [], options);
|
|
56
|
+
|
|
57
|
+
const resizer = new SlickResizer({
|
|
58
|
+
container: table.id,
|
|
59
|
+
});
|
|
60
|
+
grid.setSelectionModel(
|
|
61
|
+
new SlickRowSelectionModel({ selectActiveRow: false }),
|
|
62
|
+
);
|
|
63
|
+
grid.registerPlugin(resizer);
|
|
64
|
+
grid.registerPlugin(headerButtonsPlugin);
|
|
65
|
+
grid.registerPlugin(groupItemMetadataProvider);
|
|
66
|
+
|
|
67
|
+
if (getItemMetadata) dataView.getItemMetadata = getItemMetadata(dataView);
|
|
68
|
+
dataView.setItems(items.map((item) => ({ ...item })));
|
|
69
|
+
grid.invalidate();
|
|
70
|
+
|
|
71
|
+
dataView.onRowCountChanged.subscribe(onRowCountChanged(table));
|
|
72
|
+
dataView.onRowsChanged.subscribe(onRowsChanged(grid));
|
|
73
|
+
grid.onAddNewRow.subscribe(onAddNewRow);
|
|
74
|
+
grid.onCellChange.subscribe(onCellChange);
|
|
75
|
+
onBeforeEditCell && grid.onBeforeEditCell.subscribe(onBeforeEditCell);
|
|
76
|
+
onClick && grid.onClick.subscribe(onClick);
|
|
77
|
+
onDblClick && grid.onDblClick.subscribe(onDblClick);
|
|
78
|
+
grid.onSort.subscribe(columnSorter.onSort());
|
|
79
|
+
grid.onContextMenu.subscribe(openContextMenu(table));
|
|
80
|
+
const onHeaderButtonCommand = handleHeaderButtons(table);
|
|
81
|
+
headerButtonsPlugin.onCommand.subscribe(onHeaderButtonCommand);
|
|
82
|
+
|
|
83
|
+
if (onHeaderMenuCommand) {
|
|
84
|
+
headerMenuPlugin.onCommand.subscribe(onHeaderMenuCommand);
|
|
85
|
+
grid.registerPlugin(headerMenuPlugin);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (groups) {
|
|
89
|
+
table.grouping = {
|
|
90
|
+
groups,
|
|
91
|
+
isGrouped: table.grouping.isGrouped ?? true,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
applyCellCssStyles?.(grid);
|
|
95
|
+
|
|
96
|
+
table.hotKeysBehavior.pushToCommandQueue(grid);
|
|
97
|
+
// table.notifyObservers();
|
|
98
|
+
|
|
99
|
+
return () => {
|
|
100
|
+
headerButtonsPlugin.onCommand.unsubscribe(onHeaderButtonCommand);
|
|
101
|
+
onHeaderMenuCommand &&
|
|
102
|
+
headerMenuPlugin.onCommand.unsubscribe(onHeaderMenuCommand);
|
|
103
|
+
grid.onAddNewRow.unsubscribe(onAddNewRow);
|
|
104
|
+
grid.onCellChange.unsubscribe(onCellChange);
|
|
105
|
+
onBeforeEditCell && grid.onBeforeEditCell.unsubscribe(onBeforeEditCell);
|
|
106
|
+
onClick && grid.onClick.unsubscribe(onClick);
|
|
107
|
+
onDblClick && grid.onDblClick.unsubscribe(onDblClick);
|
|
108
|
+
table.reset();
|
|
109
|
+
};
|
|
110
|
+
}, [items]);
|
|
111
|
+
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
const grid = table.grid;
|
|
114
|
+
if (!grid || !options) return;
|
|
115
|
+
grid.setOptions({ ...defaultOptions, ...options });
|
|
116
|
+
grid.render();
|
|
117
|
+
}, [options, items]);
|
|
118
|
+
|
|
119
|
+
useEffect(() => {
|
|
120
|
+
const grid = table.grid;
|
|
121
|
+
if (!grid) return;
|
|
122
|
+
if (!columns.length) return;
|
|
123
|
+
if (columns[0].id === CHECKBOX_SELECTOR) {
|
|
124
|
+
const checkboxSelector = new SlickCheckboxSelectColumn();
|
|
125
|
+
grid.setColumns([
|
|
126
|
+
// @ts-ignore
|
|
127
|
+
{ ...checkboxSelector.getColumnDefinition(), focusable: false },
|
|
128
|
+
...columns.slice(1),
|
|
129
|
+
]);
|
|
130
|
+
grid.registerPlugin(checkboxSelector);
|
|
131
|
+
} else {
|
|
132
|
+
grid.setColumns(columns);
|
|
133
|
+
}
|
|
134
|
+
headerButtons.highlightAllColumns(table.filter.args, table.id);
|
|
135
|
+
table.filter.register(grid, table.id);
|
|
136
|
+
grid.invalidate();
|
|
137
|
+
updateTotals(grid);
|
|
138
|
+
table.notifyObservers();
|
|
139
|
+
}, [columns, items]);
|
|
140
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GridAutosizeColsMode, GridOption } from "slickgrid";
|
|
2
|
+
|
|
3
|
+
export const defaultOptions: GridOption = {
|
|
4
|
+
asyncEditorLoading: false, // increases keyboard navigation speed
|
|
5
|
+
autosizeColsMode: GridAutosizeColsMode.LegacyForceFit,
|
|
6
|
+
enableAutoSizeColumns: true,
|
|
7
|
+
enableColumnReorder: false,
|
|
8
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GridOption,
|
|
3
|
+
Grouping,
|
|
4
|
+
Handler,
|
|
5
|
+
ItemMetadata,
|
|
6
|
+
MenuCommandItemCallbackArgs,
|
|
7
|
+
OnAddNewRowEventArgs,
|
|
8
|
+
OnBeforeEditCellEventArgs,
|
|
9
|
+
OnCellChangeEventArgs,
|
|
10
|
+
OnClickEventArgs,
|
|
11
|
+
OnDblClickEventArgs,
|
|
12
|
+
OnRowCountChangedEventArgs,
|
|
13
|
+
SlickDataView,
|
|
14
|
+
SlickGrid,
|
|
15
|
+
} from "slickgrid";
|
|
16
|
+
|
|
17
|
+
import { IColumn, ISlickTable } from "shared/model/types";
|
|
18
|
+
|
|
19
|
+
import { ColumnSorter } from "../../../../lib";
|
|
20
|
+
|
|
21
|
+
export interface Props {
|
|
22
|
+
SlickDataView?: typeof SlickDataView;
|
|
23
|
+
applyCellCssStyles?: (grid: SlickGrid) => void;
|
|
24
|
+
columnSorter?: ColumnSorter;
|
|
25
|
+
columns: IColumn[];
|
|
26
|
+
getItemMetadata?: (
|
|
27
|
+
dataView: SlickDataView,
|
|
28
|
+
) => (row: number) => ItemMetadata | null;
|
|
29
|
+
groups?: Grouping[];
|
|
30
|
+
items: Record<string, any>[];
|
|
31
|
+
onAddNewRow?: Handler<OnAddNewRowEventArgs>;
|
|
32
|
+
onBeforeEditCell?: Handler<OnBeforeEditCellEventArgs>;
|
|
33
|
+
onCellChange?: Handler<OnCellChangeEventArgs>;
|
|
34
|
+
onClick?: Handler<OnClickEventArgs>;
|
|
35
|
+
onDblClick?: Handler<OnDblClickEventArgs>;
|
|
36
|
+
onHeaderMenuCommand?: Handler<MenuCommandItemCallbackArgs>;
|
|
37
|
+
onRowCountChanged?: (
|
|
38
|
+
table: ISlickTable,
|
|
39
|
+
) => Handler<OnRowCountChangedEventArgs>;
|
|
40
|
+
options?: GridOption;
|
|
41
|
+
table: ISlickTable;
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { Props } from "./Props";
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
onCellChange as cellChange,
|
|
5
|
+
useHotKeys,
|
|
6
|
+
useUpdateTotal,
|
|
7
|
+
} from "../../../lib";
|
|
8
|
+
import { onAddNewRow as addNewRow, useGrid } from "../lib";
|
|
9
|
+
import { Props } from "../model";
|
|
10
|
+
|
|
11
|
+
export const SlickgridTable: FC<Props> = ({
|
|
12
|
+
SlickDataView,
|
|
13
|
+
applyCellCssStyles,
|
|
14
|
+
columnSorter,
|
|
15
|
+
columns,
|
|
16
|
+
getItemMetadata,
|
|
17
|
+
groups,
|
|
18
|
+
items,
|
|
19
|
+
onAddNewRow,
|
|
20
|
+
onBeforeEditCell,
|
|
21
|
+
onCellChange,
|
|
22
|
+
onClick,
|
|
23
|
+
onDblClick,
|
|
24
|
+
onHeaderMenuCommand,
|
|
25
|
+
onRowCountChanged,
|
|
26
|
+
options,
|
|
27
|
+
table,
|
|
28
|
+
}) => {
|
|
29
|
+
useGrid({
|
|
30
|
+
SlickDataView,
|
|
31
|
+
applyCellCssStyles,
|
|
32
|
+
columnSorter,
|
|
33
|
+
columns,
|
|
34
|
+
getItemMetadata,
|
|
35
|
+
groups,
|
|
36
|
+
items,
|
|
37
|
+
onAddNewRow: onAddNewRow || addNewRow(table),
|
|
38
|
+
onBeforeEditCell,
|
|
39
|
+
onCellChange: onCellChange || cellChange(table),
|
|
40
|
+
onClick,
|
|
41
|
+
onDblClick,
|
|
42
|
+
onHeaderMenuCommand,
|
|
43
|
+
onRowCountChanged,
|
|
44
|
+
options,
|
|
45
|
+
table,
|
|
46
|
+
});
|
|
47
|
+
useHotKeys(table);
|
|
48
|
+
useUpdateTotal(table);
|
|
49
|
+
|
|
50
|
+
return <div id={table.id} className={"slick-container"}></div>;
|
|
51
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SlickgridTable } from "./SlickgridTable";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { columnCheckboxSelector } from "./columnCheckboxSelector";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { columnIsEdited } from "./ui";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { setEditedMark } from "./setEditedMark";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { setEditedMark } from "./setEditedMark";
|
|
2
|
+
|
|
3
|
+
const rowIndex = 1;
|
|
4
|
+
const columnIndex = 2;
|
|
5
|
+
|
|
6
|
+
test("Return expected values", () => {
|
|
7
|
+
expect(setEditedMark(rowIndex, columnIndex, undefined)).toBe("");
|
|
8
|
+
expect(setEditedMark(rowIndex, columnIndex, true)).toBe(
|
|
9
|
+
"<span>✎</span>",
|
|
10
|
+
);
|
|
11
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ESortType } from "shared/model/enums";
|
|
2
|
+
import { IColumn } from "shared/model/types";
|
|
3
|
+
|
|
4
|
+
import { setEditedMark } from "../lib";
|
|
5
|
+
|
|
6
|
+
export const columnIsEdited: IColumn = {
|
|
7
|
+
id: "isEdited",
|
|
8
|
+
name: "✎",
|
|
9
|
+
field: "isEdited",
|
|
10
|
+
formatter: setEditedMark,
|
|
11
|
+
focusable: false,
|
|
12
|
+
sortable: true,
|
|
13
|
+
sortAs: ESortType.NUMBER,
|
|
14
|
+
cssClass: "text-center",
|
|
15
|
+
maxWidth: 30,
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { columnIsEdited } from "./columnIsEdited";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export {
|
|
2
|
+
eventOpenColumnFilters,
|
|
3
|
+
handleHeaderButtons,
|
|
4
|
+
headerButtons,
|
|
5
|
+
openColumnFilter,
|
|
6
|
+
} from "./HeaderButtons";
|
|
7
|
+
export { SlickgridTable } from "./SlickgridTable";
|
|
8
|
+
export { WithTableStyles } from "./styles";
|
|
9
|
+
export { columnCheckboxSelector, columnIsEdited } from "./columns";
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { Box, styled } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
import { wink } from "../keyframes";
|
|
4
|
+
|
|
5
|
+
const Wrapper = styled(Box)(({ theme }) => ({
|
|
6
|
+
"& .slick-container": {
|
|
7
|
+
userSelect: "none",
|
|
8
|
+
maxWidth: "100%",
|
|
9
|
+
maxHeight: "100%",
|
|
10
|
+
color: theme.palette.text.primary,
|
|
11
|
+
borderColor: theme.palette.background.paper,
|
|
12
|
+
fontFamily: "inherit",
|
|
13
|
+
fontSize: "0.75rem",
|
|
14
|
+
|
|
15
|
+
"& .slick-header-column": {
|
|
16
|
+
"&.filter-active .slick-header-button::after": {
|
|
17
|
+
width: "7px",
|
|
18
|
+
height: "7px",
|
|
19
|
+
content: "''",
|
|
20
|
+
backgroundColor: "#2196f3",
|
|
21
|
+
position: "absolute",
|
|
22
|
+
borderRadius: "50%",
|
|
23
|
+
border: "2px solid #f8f8f8",
|
|
24
|
+
top: "3px",
|
|
25
|
+
right: "3px",
|
|
26
|
+
},
|
|
27
|
+
"&:not([data-id=_checkbox_selector]):not([data-id=isEdited])": {
|
|
28
|
+
"& .slick-column-name": {
|
|
29
|
+
textOverflow: "ellipsis",
|
|
30
|
+
whiteSpace: "nowrap",
|
|
31
|
+
overflow: "hidden",
|
|
32
|
+
maxWidth: "calc(100% - 16px)",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
"&.slick-state-hover": {
|
|
36
|
+
"&.filter-active .slick-header-button::after": {
|
|
37
|
+
border: "2px solid #e8e8e8",
|
|
38
|
+
},
|
|
39
|
+
"& .slick-header-button": {
|
|
40
|
+
"&::before": {
|
|
41
|
+
backgroundColor: "#e8e8e8",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
"& .slick-header-button": {
|
|
46
|
+
width: "19px",
|
|
47
|
+
height: "12px",
|
|
48
|
+
"&::before": {
|
|
49
|
+
position: "absolute",
|
|
50
|
+
content: "''",
|
|
51
|
+
width: "19px",
|
|
52
|
+
height: "12px",
|
|
53
|
+
top: "6px",
|
|
54
|
+
right: "5px",
|
|
55
|
+
backgroundImage:
|
|
56
|
+
"repeating-linear-gradient(0deg, #808080, #808080 2px, transparent 2px, transparent 4px)",
|
|
57
|
+
clipPath: "polygon(0% 0%, 100% 0%, 50% 110%)",
|
|
58
|
+
backgroundColor: "#f8f8f8",
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
"& .slick-viewport": {
|
|
63
|
+
backgroundColor: theme.palette.background.paper,
|
|
64
|
+
"& .grid-canvas": {
|
|
65
|
+
"& .ui-widget-content.slick-row": {
|
|
66
|
+
"&.even": {
|
|
67
|
+
backgroundColor: theme.palette.background.default,
|
|
68
|
+
},
|
|
69
|
+
// "&.odd": {
|
|
70
|
+
// backgroundColor: theme.palette.background.secondary,
|
|
71
|
+
// },
|
|
72
|
+
// "&:hover": {
|
|
73
|
+
// backgroundColor: theme.palette.background.row_hover,
|
|
74
|
+
// },
|
|
75
|
+
// "&.active": {
|
|
76
|
+
// backgroundColor: theme.palette.background.row_hover,
|
|
77
|
+
// },
|
|
78
|
+
"& .slick-cell": {
|
|
79
|
+
"&.active": {
|
|
80
|
+
// backgroundColor: theme.palette.background.row_hover,
|
|
81
|
+
borderColor: "#007bff",
|
|
82
|
+
"& input": {
|
|
83
|
+
// backgroundColor: theme.palette.background.row_hover,
|
|
84
|
+
color: theme.palette.text.primary,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
"&.selected": {
|
|
88
|
+
// backgroundColor: theme.palette.background.cell_selected,
|
|
89
|
+
color: theme.palette.text.primary,
|
|
90
|
+
},
|
|
91
|
+
"&.text-right": {
|
|
92
|
+
textAlign: "right",
|
|
93
|
+
},
|
|
94
|
+
"&.bold": {
|
|
95
|
+
fontWeight: "bold",
|
|
96
|
+
},
|
|
97
|
+
"&.wink": {
|
|
98
|
+
animation: `${wink} infinite 0.5s linear`,
|
|
99
|
+
"& input": {
|
|
100
|
+
animation: `${wink} infinite 0.5s linear`,
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
"& input.editor-text": {
|
|
104
|
+
textAlign: "inherit",
|
|
105
|
+
},
|
|
106
|
+
"& select": {
|
|
107
|
+
color: theme.palette.text.primary,
|
|
108
|
+
backgroundColor: theme.palette.background.default,
|
|
109
|
+
},
|
|
110
|
+
"& #autocomplete": {
|
|
111
|
+
margin: 0,
|
|
112
|
+
padding: 0,
|
|
113
|
+
maxHeight: "300px",
|
|
114
|
+
width: "100%",
|
|
115
|
+
overflow: "auto",
|
|
116
|
+
backgroundColor: theme.palette.background.default,
|
|
117
|
+
fontSize: "12px",
|
|
118
|
+
boxShadow: "0 0 5px 1px gray",
|
|
119
|
+
"& div": {
|
|
120
|
+
"&:hover": {
|
|
121
|
+
// backgroundColor: theme.palette.background.row_hover,
|
|
122
|
+
cursor: "pointer",
|
|
123
|
+
},
|
|
124
|
+
"&.active": {
|
|
125
|
+
// backgroundColor: theme.palette.background.row_hover,
|
|
126
|
+
},
|
|
127
|
+
"& strong": {
|
|
128
|
+
color: "#007bff",
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
|
|
137
|
+
"& .slick-footerrow": {
|
|
138
|
+
backgroundColor: theme.palette.background.default,
|
|
139
|
+
borderTop: "1px solid silver",
|
|
140
|
+
"& .slick-footerrow-column": {
|
|
141
|
+
height: "100%",
|
|
142
|
+
display: "flex",
|
|
143
|
+
justifyContent: "flex-end",
|
|
144
|
+
alignItems: "center",
|
|
145
|
+
paddingRight: "5px",
|
|
146
|
+
borderBottom: "none",
|
|
147
|
+
fontWeight: "bold",
|
|
148
|
+
"&:last-child": {
|
|
149
|
+
borderRight: "none",
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
}));
|
|
155
|
+
|
|
156
|
+
export default { Wrapper };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
import Styled from "./WithTableStyles.style";
|
|
4
|
+
|
|
5
|
+
export const WithTableStyles: FC<IProps> = ({ children }) => {
|
|
6
|
+
return <Styled.Wrapper>{children}</Styled.Wrapper>;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
interface IProps {
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { WithTableStyles } from "./WithTableStyles";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { WithTableStyles } from "./WithTableStyles";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { wink } from "./wink";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { getTime } from "../datetime";
|
|
2
|
+
|
|
3
|
+
class Sort implements ISort {
|
|
4
|
+
emptyValue = "1/1/1970";
|
|
5
|
+
dates(a: string, b: string): number {
|
|
6
|
+
const value1 = getTime(a || this.emptyValue);
|
|
7
|
+
const value2 = getTime(b || this.emptyValue);
|
|
8
|
+
return value1 - value2;
|
|
9
|
+
}
|
|
10
|
+
numbers(a?: string | number | null, b?: string | number | null): number {
|
|
11
|
+
return Number(a || 0) - Number(b || 0);
|
|
12
|
+
}
|
|
13
|
+
strings(a?: string, b?: string): number {
|
|
14
|
+
if ((a || "").toLowerCase() > (b || "").toLowerCase()) return 1;
|
|
15
|
+
if ((a || "").toLowerCase() < (b || "").toLowerCase()) return -1;
|
|
16
|
+
return 0;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const sort = new Sort();
|
|
21
|
+
|
|
22
|
+
interface ISort {
|
|
23
|
+
strings(): number;
|
|
24
|
+
numbers(a?: string | number | null, b?: string | number | null): number;
|
|
25
|
+
dates(a: string, b: string): number;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { sort } from "./Sort";
|