slick-table 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/myWorkLogo.ico +0 -0
- package/dist/slick-table.es.js +18734 -0
- package/dist/slick-table.umd.js +281 -0
- package/package.json +13 -2
- package/src/shared/lib/sorting/Sort.ts +1 -1
- package/tsconfig.build-types.json +21 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/vite.config.ts +15 -0
- package/dist/entities/portal/index.js +0 -3
- package/dist/entities/portal/lib/index.js +0 -1
- package/dist/entities/portal/lib/visibility/index.js +0 -1
- package/dist/entities/portal/lib/visibility/makeVisible.js +0 -9
- package/dist/entities/portal/model/index.js +0 -1
- package/dist/entities/portal/model/portalId.js +0 -1
- package/dist/entities/portal/ui/Overlay/Overlay.js +0 -8
- package/dist/entities/portal/ui/Overlay/Overlay.style.js +0 -12
- package/dist/entities/portal/ui/Overlay/index.js +0 -1
- package/dist/entities/portal/ui/Portal.js +0 -12
- package/dist/entities/portal/ui/Portal.style.js +0 -18
- package/dist/entities/portal/ui/index.js +0 -1
- package/dist/features/column-filters/index.js +0 -1
- package/dist/features/column-filters/lib/filter/applyFilter.js +0 -24
- package/dist/features/column-filters/lib/filter/index.js +0 -1
- package/dist/features/column-filters/lib/hooks/index.js +0 -2
- package/dist/features/column-filters/lib/hooks/useOpenMenu.js +0 -36
- package/dist/features/column-filters/lib/hooks/useSubscribeToEvent.js +0 -13
- package/dist/features/column-filters/lib/index.js +0 -4
- package/dist/features/column-filters/lib/props/datePickerProps.js +0 -9
- package/dist/features/column-filters/lib/props/index.js +0 -1
- package/dist/features/column-filters/lib/select/firstIn.js +0 -21
- package/dist/features/column-filters/lib/select/index.js +0 -1
- package/dist/features/column-filters/model/consts/defaultValue.js +0 -4
- package/dist/features/column-filters/model/consts/index.js +0 -2
- package/dist/features/column-filters/model/consts/label.js +0 -5
- package/dist/features/column-filters/model/index.js +0 -1
- package/dist/features/column-filters/model/types/IProps.js +0 -1
- package/dist/features/column-filters/model/types/index.js +0 -1
- package/dist/features/column-filters/ui/BooleanInput/BooleanInput.js +0 -11
- package/dist/features/column-filters/ui/BooleanInput/BooleanInput.style.js +0 -8
- package/dist/features/column-filters/ui/BooleanInput/index.js +0 -1
- package/dist/features/column-filters/ui/ButtonReset/ButtonReset.js +0 -21
- package/dist/features/column-filters/ui/ButtonReset/ButtonReset.style.js +0 -8
- package/dist/features/column-filters/ui/ButtonReset/index.js +0 -1
- package/dist/features/column-filters/ui/ColumnFilters.js +0 -20
- package/dist/features/column-filters/ui/ColumnFilters.style.js +0 -10
- package/dist/features/column-filters/ui/DateBetween/DateBetween.js +0 -30
- package/dist/features/column-filters/ui/DateBetween/index.js +0 -1
- package/dist/features/column-filters/ui/DateInput/DateInput.js +0 -21
- package/dist/features/column-filters/ui/DateInput/index.js +0 -1
- package/dist/features/column-filters/ui/InputArea/InputArea.js +0 -14
- package/dist/features/column-filters/ui/InputArea/index.js +0 -1
- package/dist/features/column-filters/ui/MultipleSelect/index.js +0 -1
- package/dist/features/column-filters/ui/MultipleSelect/lib/index.js +0 -2
- package/dist/features/column-filters/ui/MultipleSelect/lib/props/index.js +0 -1
- package/dist/features/column-filters/ui/MultipleSelect/lib/props/props.js +0 -29
- package/dist/features/column-filters/ui/MultipleSelect/lib/sorting/ascending.js +0 -16
- package/dist/features/column-filters/ui/MultipleSelect/lib/sorting/index.js +0 -1
- package/dist/features/column-filters/ui/MultipleSelect/model/IValue.js +0 -1
- package/dist/features/column-filters/ui/MultipleSelect/model/index.js +0 -1
- package/dist/features/column-filters/ui/MultipleSelect/ui/MultipleSelect.js +0 -31
- package/dist/features/column-filters/ui/MultipleSelect/ui/MultipleSelect.style.js +0 -7
- package/dist/features/column-filters/ui/MultipleSelect/ui/index.js +0 -1
- package/dist/features/column-filters/ui/NumberBetween/NumberBetween.js +0 -18
- package/dist/features/column-filters/ui/NumberBetween/index.js +0 -1
- package/dist/features/column-filters/ui/NumberInput/NumberInput.js +0 -11
- package/dist/features/column-filters/ui/NumberInput/index.js +0 -1
- package/dist/features/column-filters/ui/SelectFilter/index.js +0 -1
- package/dist/features/column-filters/ui/SelectFilter/model/index.js +0 -1
- package/dist/features/column-filters/ui/SelectFilter/model/options/index.js +0 -1
- package/dist/features/column-filters/ui/SelectFilter/model/options/options.js +0 -60
- package/dist/features/column-filters/ui/SelectFilter/ui/SelectFilter.js +0 -31
- package/dist/features/column-filters/ui/SelectFilter/ui/index.js +0 -1
- package/dist/features/column-filters/ui/TextInput/TextInput.js +0 -12
- package/dist/features/column-filters/ui/TextInput/index.js +0 -1
- package/dist/features/column-filters/ui/index.js +0 -1
- package/dist/features/context-menu/index.js +0 -1
- package/dist/features/context-menu/lib/hooks/index.js +0 -1
- package/dist/features/context-menu/lib/hooks/useSubscribeToEvent.js +0 -21
- package/dist/features/context-menu/lib/index.js +0 -1
- package/dist/features/context-menu/ui/ButtonDownloadCSV/ButtonDownloadCSV.js +0 -16
- package/dist/features/context-menu/ui/ButtonDownloadCSV/index.js +0 -1
- package/dist/features/context-menu/ui/ButtonGroup/ButtonGroup.js +0 -15
- package/dist/features/context-menu/ui/ButtonGroup/index.js +0 -1
- package/dist/features/context-menu/ui/ButtonResetFilters/index.js +0 -1
- package/dist/features/context-menu/ui/ButtonResetFilters/lib/index.js +0 -1
- package/dist/features/context-menu/ui/ButtonResetFilters/lib/visibility/hasFiltersApplied.js +0 -5
- package/dist/features/context-menu/ui/ButtonResetFilters/lib/visibility/index.js +0 -1
- package/dist/features/context-menu/ui/ButtonResetFilters/ui/ButtonResetFilters.js +0 -23
- package/dist/features/context-menu/ui/ButtonResetFilters/ui/index.js +0 -1
- package/dist/features/context-menu/ui/ButtonUngroup/ButtonUngroup.js +0 -15
- package/dist/features/context-menu/ui/ButtonUngroup/index.js +0 -1
- package/dist/features/context-menu/ui/CollapseAll/CollapseAll.js +0 -17
- package/dist/features/context-menu/ui/CollapseAll/index.js +0 -1
- package/dist/features/context-menu/ui/ContextMenu.js +0 -20
- package/dist/features/context-menu/ui/ContextMenu.style.js +0 -25
- package/dist/features/context-menu/ui/CopyToClipboard/CopyToClipboard.js +0 -27
- package/dist/features/context-menu/ui/CopyToClipboard/index.js +0 -1
- package/dist/features/context-menu/ui/ExpandAll/ExpandAll.js +0 -17
- package/dist/features/context-menu/ui/ExpandAll/index.js +0 -1
- package/dist/features/context-menu/ui/Print/index.js +0 -1
- package/dist/features/context-menu/ui/Print/ui/Print.js +0 -11
- package/dist/features/context-menu/ui/Print/ui/index.js +0 -1
- package/dist/features/context-menu/ui/index.js +0 -1
- package/dist/index.js +0 -1
- package/dist/shared/lib/an-event/index.js +0 -22
- package/dist/shared/lib/datetime/dateToString.js +0 -6
- package/dist/shared/lib/datetime/getTime.js +0 -3
- package/dist/shared/lib/datetime/index.js +0 -2
- package/dist/shared/lib/debounce/index.js +0 -11
- package/dist/shared/lib/dom/elementNotVisible.js +0 -8
- package/dist/shared/lib/dom/index.js +0 -1
- package/dist/shared/lib/format/IOptions.js +0 -1
- package/dist/shared/lib/format/addParentheses.js +0 -6
- package/dist/shared/lib/format/formatNumber.js +0 -48
- package/dist/shared/lib/format/index.js +0 -1
- package/dist/shared/lib/numbers/index.js +0 -1
- package/dist/shared/lib/numbers/toNumber.js +0 -14
- package/dist/shared/lib/regexp/dates.js +0 -6
- package/dist/shared/lib/regexp/escapeSpecialChar.js +0 -4
- package/dist/shared/lib/regexp/index.js +0 -2
- package/dist/shared/lib/slickgrid/index.js +0 -3
- package/dist/shared/lib/slickgrid/lib/callbacks/getOnKeyDownCallback.js +0 -7
- package/dist/shared/lib/slickgrid/lib/callbacks/index.js +0 -4
- package/dist/shared/lib/slickgrid/lib/callbacks/onCellChange.js +0 -8
- package/dist/shared/lib/slickgrid/lib/callbacks/onRowCountChanged.js +0 -7
- package/dist/shared/lib/slickgrid/lib/callbacks/onRowsChanged.js +0 -4
- package/dist/shared/lib/slickgrid/lib/contextMenu/index.js +0 -1
- package/dist/shared/lib/slickgrid/lib/contextMenu/openContextMenu.js +0 -12
- package/dist/shared/lib/slickgrid/lib/editors/Autocomplete/Autocomplete.js +0 -141
- package/dist/shared/lib/slickgrid/lib/editors/Autocomplete/EditorAutocomplete.js +0 -57
- package/dist/shared/lib/slickgrid/lib/editors/Autocomplete/EditorSelectWithSearch.js +0 -60
- package/dist/shared/lib/slickgrid/lib/editors/Autocomplete/index.js +0 -3
- package/dist/shared/lib/slickgrid/lib/editors/EditorAmount.js +0 -70
- package/dist/shared/lib/slickgrid/lib/editors/EditorDate.js +0 -101
- package/dist/shared/lib/slickgrid/lib/editors/EditorSelectNumber.js +0 -7
- package/dist/shared/lib/slickgrid/lib/editors/EditorSelectString.js +0 -70
- package/dist/shared/lib/slickgrid/lib/editors/index.js +0 -5
- package/dist/shared/lib/slickgrid/lib/formatters/DateFormatter.js +0 -4
- package/dist/shared/lib/slickgrid/lib/formatters/FormatterCheck.js +0 -6
- package/dist/shared/lib/slickgrid/lib/formatters/PercentFormatter.js +0 -4
- package/dist/shared/lib/slickgrid/lib/formatters/StringFormatter.js +0 -1
- package/dist/shared/lib/slickgrid/lib/formatters/getFormatterNumber.js +0 -9
- package/dist/shared/lib/slickgrid/lib/formatters/index.js +0 -5
- package/dist/shared/lib/slickgrid/lib/functions/addNewRow.js +0 -16
- package/dist/shared/lib/slickgrid/lib/functions/commitCurrentEdit.js +0 -5
- package/dist/shared/lib/slickgrid/lib/functions/copySelectedRows.js +0 -33
- package/dist/shared/lib/slickgrid/lib/functions/deleteRows.js +0 -17
- package/dist/shared/lib/slickgrid/lib/functions/getActiveRowId.js +0 -13
- package/dist/shared/lib/slickgrid/lib/functions/getDisplayedRows.js +0 -11
- package/dist/shared/lib/slickgrid/lib/functions/getLastRow.js +0 -4
- package/dist/shared/lib/slickgrid/lib/functions/getMaxId.js +0 -11
- package/dist/shared/lib/slickgrid/lib/functions/index.js +0 -10
- package/dist/shared/lib/slickgrid/lib/functions/isDeletionDangerous.js +0 -18
- package/dist/shared/lib/slickgrid/lib/functions/wereEdited.js +0 -10
- package/dist/shared/lib/slickgrid/lib/grouping/index.js +0 -1
- package/dist/shared/lib/slickgrid/lib/grouping/sumTotalsFormatter.js +0 -10
- package/dist/shared/lib/slickgrid/lib/highlighting/getColumnsHash.js +0 -6
- package/dist/shared/lib/slickgrid/lib/highlighting/highlightCell.js +0 -16
- package/dist/shared/lib/slickgrid/lib/highlighting/highlightColumns.js +0 -20
- package/dist/shared/lib/slickgrid/lib/highlighting/index.js +0 -2
- package/dist/shared/lib/slickgrid/lib/hooks/eventClickOnTable.js +0 -16
- package/dist/shared/lib/slickgrid/lib/hooks/index.js +0 -3
- package/dist/shared/lib/slickgrid/lib/hooks/useHotKeys.js +0 -33
- package/dist/shared/lib/slickgrid/lib/hooks/useListenIfTablesWereEdited.js +0 -28
- package/dist/shared/lib/slickgrid/lib/hooks/useUpdateTotal.js +0 -16
- package/dist/shared/lib/slickgrid/lib/hotKeys/hotKeysCopy.js +0 -4
- package/dist/shared/lib/slickgrid/lib/hotKeys/hotKeysDelete.js +0 -4
- package/dist/shared/lib/slickgrid/lib/hotKeys/hotKeysRedo.js +0 -4
- package/dist/shared/lib/slickgrid/lib/hotKeys/hotKeysReverse.js +0 -4
- package/dist/shared/lib/slickgrid/lib/hotKeys/hotKeysUndo.js +0 -4
- package/dist/shared/lib/slickgrid/lib/hotKeys/index.js +0 -7
- package/dist/shared/lib/slickgrid/lib/hotKeys/nothingToCopy.js +0 -11
- package/dist/shared/lib/slickgrid/lib/hotKeys/positionToPaste.js +0 -9
- package/dist/shared/lib/slickgrid/lib/index.js +0 -12
- package/dist/shared/lib/slickgrid/lib/selection/getUpdates.js +0 -30
- package/dist/shared/lib/slickgrid/lib/selection/index.js +0 -2
- package/dist/shared/lib/slickgrid/lib/selection/selectedRows.js +0 -14
- package/dist/shared/lib/slickgrid/lib/sorting/ColumnSorter.js +0 -70
- package/dist/shared/lib/slickgrid/lib/sorting/index.js +0 -1
- package/dist/shared/lib/slickgrid/lib/totals-row/addTitle.js +0 -6
- package/dist/shared/lib/slickgrid/lib/totals-row/addTotalSum.js +0 -11
- package/dist/shared/lib/slickgrid/lib/totals-row/index.js +0 -2
- package/dist/shared/lib/slickgrid/lib/totals-row/totalAmountOf.js +0 -8
- package/dist/shared/lib/slickgrid/lib/totals-row/updateTotal.js +0 -17
- package/dist/shared/lib/slickgrid/lib/totals-row/updateTotals.js +0 -7
- package/dist/shared/lib/slickgrid/lib/validators/DateValidator.js +0 -9
- package/dist/shared/lib/slickgrid/lib/validators/EmptyStringValidator.js +0 -3
- package/dist/shared/lib/slickgrid/lib/validators/LengthValidator.js +0 -3
- package/dist/shared/lib/slickgrid/lib/validators/index.js +0 -3
- package/dist/shared/lib/slickgrid/model/SlickTable/csvDownloadManager/IDownloadManager.js +0 -1
- package/dist/shared/lib/slickgrid/model/SlickTable/csvDownloadManager/downloadManager.js +0 -95
- package/dist/shared/lib/slickgrid/model/SlickTable/csvDownloadManager/index.js +0 -1
- package/dist/shared/lib/slickgrid/model/SlickTable/filters/DeletedRowsFilter.js +0 -7
- package/dist/shared/lib/slickgrid/model/SlickTable/filters/Filter.js +0 -53
- package/dist/shared/lib/slickgrid/model/SlickTable/filters/WithoutFilter.js +0 -27
- package/dist/shared/lib/slickgrid/model/SlickTable/filters/decorators/ColumnFilter/DecoratorColumnFilter.js +0 -40
- package/dist/shared/lib/slickgrid/model/SlickTable/filters/decorators/ColumnFilter/Filter.js +0 -108
- package/dist/shared/lib/slickgrid/model/SlickTable/filters/decorators/ColumnFilter/index.js +0 -1
- package/dist/shared/lib/slickgrid/model/SlickTable/filters/decorators/DecoratorEndingDate.js +0 -10
- package/dist/shared/lib/slickgrid/model/SlickTable/filters/decorators/DecoratorFilter.js +0 -43
- package/dist/shared/lib/slickgrid/model/SlickTable/filters/decorators/DecoratorPeriod.js +0 -17
- package/dist/shared/lib/slickgrid/model/SlickTable/filters/decorators/index.js +0 -4
- package/dist/shared/lib/slickgrid/model/SlickTable/filters/index.js +0 -4
- package/dist/shared/lib/slickgrid/model/SlickTable/filters/model/IFilter.js +0 -1
- package/dist/shared/lib/slickgrid/model/SlickTable/filters/model/index.js +0 -1
- package/dist/shared/lib/slickgrid/model/SlickTable/hotKeys/DefaultHotKeys.js +0 -101
- package/dist/shared/lib/slickgrid/model/SlickTable/hotKeys/HotKeysBehavior.js +0 -1
- package/dist/shared/lib/slickgrid/model/SlickTable/hotKeys/WithoutHotKeys.js +0 -17
- package/dist/shared/lib/slickgrid/model/SlickTable/hotKeys/decorators/HotKeysDecorator.js +0 -20
- package/dist/shared/lib/slickgrid/model/SlickTable/hotKeys/decorators/PreventCopying.js +0 -15
- package/dist/shared/lib/slickgrid/model/SlickTable/hotKeys/decorators/RedoUndoOnly.js +0 -17
- package/dist/shared/lib/slickgrid/model/SlickTable/hotKeys/decorators/WithConfirmationOfDeletion.js +0 -28
- package/dist/shared/lib/slickgrid/model/SlickTable/hotKeys/decorators/index.js +0 -4
- package/dist/shared/lib/slickgrid/model/SlickTable/hotKeys/index.js +0 -3
- package/dist/shared/lib/slickgrid/model/SlickTable/index.js +0 -5
- package/dist/shared/lib/slickgrid/model/SlickTable/printer/DefaultPrinter.js +0 -161
- package/dist/shared/lib/slickgrid/model/SlickTable/printer/index.js +0 -1
- package/dist/shared/lib/slickgrid/model/SlickTable/printer/model/Printer.js +0 -1
- package/dist/shared/lib/slickgrid/model/SlickTable/printer/model/consts/cssStyles.js +0 -46
- package/dist/shared/lib/slickgrid/model/SlickTable/printer/model/consts/index.js +0 -1
- package/dist/shared/lib/slickgrid/model/SlickTable/printer/model/index.js +0 -1
- package/dist/shared/lib/slickgrid/model/SlickTable/table/SlickTable.js +0 -109
- package/dist/shared/lib/slickgrid/model/SlickTable/table/index.js +0 -1
- package/dist/shared/lib/slickgrid/model/events/eventContextMenu.js +0 -9
- package/dist/shared/lib/slickgrid/model/events/index.js +0 -1
- package/dist/shared/lib/slickgrid/model/index.js +0 -2
- package/dist/shared/lib/slickgrid/model/types/IColumn.js +0 -1
- package/dist/shared/lib/slickgrid/model/types/IColumnFilterValue.js +0 -1
- package/dist/shared/lib/slickgrid/model/types/IGrouping.js +0 -1
- package/dist/shared/lib/slickgrid/model/types/ISlickRow.js +0 -1
- package/dist/shared/lib/slickgrid/model/types/index.js +0 -1
- package/dist/shared/lib/slickgrid/ui/HeaderButtons/index.js +0 -2
- package/dist/shared/lib/slickgrid/ui/HeaderButtons/lib/handleClick/handleHeaderButtons.js +0 -16
- package/dist/shared/lib/slickgrid/ui/HeaderButtons/lib/handleClick/index.js +0 -1
- package/dist/shared/lib/slickgrid/ui/HeaderButtons/lib/highlighting/headerButtons.js +0 -47
- package/dist/shared/lib/slickgrid/ui/HeaderButtons/lib/highlighting/index.js +0 -1
- package/dist/shared/lib/slickgrid/ui/HeaderButtons/lib/index.js +0 -2
- package/dist/shared/lib/slickgrid/ui/HeaderButtons/model/buttons/index.js +0 -1
- package/dist/shared/lib/slickgrid/ui/HeaderButtons/model/buttons/openColumnFilter.js +0 -6
- package/dist/shared/lib/slickgrid/ui/HeaderButtons/model/event/eventOpenColumnFilters.js +0 -13
- package/dist/shared/lib/slickgrid/ui/HeaderButtons/model/event/index.js +0 -1
- package/dist/shared/lib/slickgrid/ui/HeaderButtons/model/index.js +0 -2
- package/dist/shared/lib/slickgrid/ui/SlickgridTable/index.js +0 -1
- package/dist/shared/lib/slickgrid/ui/SlickgridTable/lib/callbacks/index.js +0 -1
- package/dist/shared/lib/slickgrid/ui/SlickgridTable/lib/callbacks/onAddNewRow.js +0 -21
- package/dist/shared/lib/slickgrid/ui/SlickgridTable/lib/hooks/index.js +0 -1
- package/dist/shared/lib/slickgrid/ui/SlickgridTable/lib/hooks/useGrid.js +0 -95
- package/dist/shared/lib/slickgrid/ui/SlickgridTable/lib/index.js +0 -2
- package/dist/shared/lib/slickgrid/ui/SlickgridTable/model/defaultOptions.js +0 -7
- package/dist/shared/lib/slickgrid/ui/SlickgridTable/model/index.js +0 -1
- package/dist/shared/lib/slickgrid/ui/SlickgridTable/model/types/Props.js +0 -1
- package/dist/shared/lib/slickgrid/ui/SlickgridTable/model/types/index.js +0 -1
- package/dist/shared/lib/slickgrid/ui/SlickgridTable/ui/SlickgridTable.js +0 -26
- package/dist/shared/lib/slickgrid/ui/SlickgridTable/ui/index.js +0 -1
- package/dist/shared/lib/slickgrid/ui/columns/columnCheckboxSelector/columnCheckboxSelector.js +0 -5
- package/dist/shared/lib/slickgrid/ui/columns/columnCheckboxSelector/index.js +0 -1
- package/dist/shared/lib/slickgrid/ui/columns/columnIsEdited/index.js +0 -1
- package/dist/shared/lib/slickgrid/ui/columns/columnIsEdited/lib/index.js +0 -1
- package/dist/shared/lib/slickgrid/ui/columns/columnIsEdited/lib/setEditedMark.js +0 -3
- package/dist/shared/lib/slickgrid/ui/columns/columnIsEdited/ui/columnIsEdited.js +0 -13
- package/dist/shared/lib/slickgrid/ui/columns/columnIsEdited/ui/index.js +0 -1
- package/dist/shared/lib/slickgrid/ui/columns/index.js +0 -2
- package/dist/shared/lib/slickgrid/ui/index.js +0 -4
- package/dist/shared/lib/slickgrid/ui/styles/WithTableStyles/WithTableStyles.js +0 -5
- package/dist/shared/lib/slickgrid/ui/styles/WithTableStyles/WithTableStyles.style.js +0 -150
- package/dist/shared/lib/slickgrid/ui/styles/WithTableStyles/index.js +0 -1
- package/dist/shared/lib/slickgrid/ui/styles/index.js +0 -1
- package/dist/shared/lib/slickgrid/ui/styles/keyframes/index.js +0 -1
- package/dist/shared/lib/slickgrid/ui/styles/keyframes/wink.js +0 -6
- package/dist/shared/lib/sorting/Sort.js +0 -22
- package/dist/shared/lib/sorting/index.js +0 -1
- package/dist/shared/lib/stringCalculator/index.js +0 -2
- package/dist/shared/lib/strings/deleteDoubleQuotes.js +0 -6
- package/dist/shared/lib/strings/index.js +0 -3
- package/dist/shared/lib/strings/removeHtml.js +0 -5
- package/dist/shared/lib/strings/toStringWithCommas.js +0 -12
- package/dist/shared/model/consts/columnId.js +0 -1
- package/dist/shared/model/consts/dateFormats.js +0 -3
- package/dist/shared/model/consts/index.js +0 -4
- package/dist/shared/model/consts/invalidDate.js +0 -1
- package/dist/shared/model/consts/noPrivilegesMessage.js +0 -1
- package/dist/shared/model/enums/EColumnFilter.js +0 -17
- package/dist/shared/model/enums/EColumnFiltersGroup.js +0 -11
- package/dist/shared/model/enums/EDateFormat.js +0 -12
- package/dist/shared/model/enums/EKey.js +0 -9
- package/dist/shared/model/enums/EKeyCode.js +0 -9
- package/dist/shared/model/enums/ESortType.js +0 -7
- package/dist/shared/model/enums/index.js +0 -6
- package/dist/shared/model/types/index.js +0 -1
- package/dist/shared/model/types/slickgrid/IEditedRow.js +0 -1
- package/dist/shared/model/types/slickgrid/TGridRow.js +0 -1
- package/dist/shared/model/types/slickgrid/index.js +0 -1
- package/dist/shared/ui/ContextSelect/ContextSelect.js +0 -16
- package/dist/shared/ui/ContextSelect/ContextSelect.style.js +0 -7
- package/dist/shared/ui/ContextSelect/index.js +0 -1
- package/dist/shared/ui/notification/index.js +0 -1
- package/dist/shared/ui/notification/model/index.js +0 -1
- package/dist/shared/ui/notification/ui/index.js +0 -22
- package/dist/shared/ui/notification/ui/index.style.js +0 -11
- package/dist/shared/ui/styles/WithDatePickerStyles.js +0 -10
- package/dist/shared/ui/styles/index.js +0 -1
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import moment from "moment";
|
|
2
|
-
import { removeHtml } from "shared/lib/strings";
|
|
3
|
-
// import { injectedStore } from "shared/model/store";
|
|
4
|
-
import { getDisplayedRows } from "../../../lib";
|
|
5
|
-
import { cssStyles } from "./model";
|
|
6
|
-
export class DefaultPrinter {
|
|
7
|
-
constructor() {
|
|
8
|
-
this.cssStyles = cssStyles;
|
|
9
|
-
}
|
|
10
|
-
// protected get store() {
|
|
11
|
-
// return injectedStore;
|
|
12
|
-
// }
|
|
13
|
-
clientName() {
|
|
14
|
-
const result = document.createElement("tr");
|
|
15
|
-
// const { clientId, name: clientName } = this.store.getState().clientReducer;
|
|
16
|
-
// if (clientName) {
|
|
17
|
-
// const name = document.createElement("th");
|
|
18
|
-
// name.classList.add("align_left");
|
|
19
|
-
// name.setAttribute("colspan", "100%");
|
|
20
|
-
// name.innerText = `${clientName} [${clientId}]`;
|
|
21
|
-
// result.append(name);
|
|
22
|
-
// }
|
|
23
|
-
return result;
|
|
24
|
-
}
|
|
25
|
-
columnNames(table) {
|
|
26
|
-
const result = document.createElement("tr");
|
|
27
|
-
const grid = table.grid;
|
|
28
|
-
const columns = grid?.getColumns() || [];
|
|
29
|
-
const columnsFiltered = columns.filter((el) => el.forPrint);
|
|
30
|
-
columnsFiltered.forEach(({ name }) => {
|
|
31
|
-
const th = document.createElement("th");
|
|
32
|
-
th.classList.add("column_name");
|
|
33
|
-
if (typeof name === "string") {
|
|
34
|
-
th.innerText = name;
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
th.innerText = " ";
|
|
38
|
-
}
|
|
39
|
-
result.append(th);
|
|
40
|
-
});
|
|
41
|
-
return result;
|
|
42
|
-
}
|
|
43
|
-
tableNameAndTime(table) {
|
|
44
|
-
const result = document.createElement("tr");
|
|
45
|
-
result.classList.add("heading");
|
|
46
|
-
const tableName = document.createElement("th");
|
|
47
|
-
tableName.setAttribute("colspan", "2");
|
|
48
|
-
tableName.classList.add("table_name");
|
|
49
|
-
tableName.innerText = table.name || table.id;
|
|
50
|
-
result.append(tableName);
|
|
51
|
-
const dateStamp = document.createElement("th");
|
|
52
|
-
dateStamp.setAttribute("colspan", "100%");
|
|
53
|
-
dateStamp.classList.add("date_stamp");
|
|
54
|
-
dateStamp.innerText = moment().format("MM/DD/YYYY h:mm A");
|
|
55
|
-
result.append(dateStamp);
|
|
56
|
-
return result;
|
|
57
|
-
}
|
|
58
|
-
createStyleElement() {
|
|
59
|
-
const result = document.createElement("style");
|
|
60
|
-
result.innerHTML = this.cssStyles;
|
|
61
|
-
return result;
|
|
62
|
-
}
|
|
63
|
-
createTableElement(table) {
|
|
64
|
-
const result = document.createElement("table");
|
|
65
|
-
result.append(this.createThead(table));
|
|
66
|
-
result.append(this.createTbody(table));
|
|
67
|
-
return result;
|
|
68
|
-
}
|
|
69
|
-
createTbody(table) {
|
|
70
|
-
const result = document.createElement("tbody");
|
|
71
|
-
const grid = table.grid;
|
|
72
|
-
if (!grid)
|
|
73
|
-
return result;
|
|
74
|
-
const columns = grid.getColumns();
|
|
75
|
-
const columnsFiltered = columns.filter((el) => el.forPrint);
|
|
76
|
-
const dataView = grid.getData();
|
|
77
|
-
const displayedRows = getDisplayedRows(dataView);
|
|
78
|
-
displayedRows.forEach((_row, rowIndex) => {
|
|
79
|
-
const tr = this.createTr(columnsFiltered, rowIndex, grid);
|
|
80
|
-
result.append(tr);
|
|
81
|
-
});
|
|
82
|
-
result.append(...this.totals(table));
|
|
83
|
-
return result;
|
|
84
|
-
}
|
|
85
|
-
filters(table) {
|
|
86
|
-
const result = [];
|
|
87
|
-
if (table.filter) {
|
|
88
|
-
const appliedFilters = table.filter.print(table);
|
|
89
|
-
if (appliedFilters.length) {
|
|
90
|
-
const tr = document.createElement("tr");
|
|
91
|
-
const th = document.createElement("th");
|
|
92
|
-
th.setAttribute("colspan", "100%");
|
|
93
|
-
th.classList.add("align_left");
|
|
94
|
-
th.innerText = "Applied filters";
|
|
95
|
-
tr.append(th);
|
|
96
|
-
result.push(tr);
|
|
97
|
-
}
|
|
98
|
-
appliedFilters.forEach((filter) => {
|
|
99
|
-
result.push(filter);
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
return result;
|
|
103
|
-
}
|
|
104
|
-
/** for tables with total calculations */
|
|
105
|
-
totals(_table) {
|
|
106
|
-
return [];
|
|
107
|
-
}
|
|
108
|
-
createThead(table) {
|
|
109
|
-
const result = document.createElement("thead");
|
|
110
|
-
result.append(this.clientName());
|
|
111
|
-
result.append(this.tableNameAndTime(table));
|
|
112
|
-
result.append(...this.filters(table));
|
|
113
|
-
result.append(this.columnNames(table));
|
|
114
|
-
return result;
|
|
115
|
-
}
|
|
116
|
-
createTr(columns, rowIndex, grid) {
|
|
117
|
-
const result = document.createElement("tr");
|
|
118
|
-
const dataView = grid.getData();
|
|
119
|
-
const row = dataView.getItem(rowIndex);
|
|
120
|
-
const isGroupTitle = row.__group;
|
|
121
|
-
const isGroupTotal = row.__groupTotals;
|
|
122
|
-
if (isGroupTitle) {
|
|
123
|
-
const td = document.createElement("td");
|
|
124
|
-
td.setAttribute("colspan", "100%");
|
|
125
|
-
td.innerText = removeHtml(row.title);
|
|
126
|
-
result.append(td);
|
|
127
|
-
}
|
|
128
|
-
else {
|
|
129
|
-
columns.forEach((column) => {
|
|
130
|
-
const td = document.createElement("td");
|
|
131
|
-
column.cssClass && td.classList.add(column.cssClass);
|
|
132
|
-
const field = column.field;
|
|
133
|
-
const metaData = dataView.getItemMetadata(rowIndex);
|
|
134
|
-
const formatterSpecific = metaData?.columns?.[field]?.formatter;
|
|
135
|
-
const formatter = column.printer || formatterSpecific || column.formatter;
|
|
136
|
-
let value = row[field];
|
|
137
|
-
if (isGroupTotal) {
|
|
138
|
-
const totalsFormatter = column.groupTotalsFormatter;
|
|
139
|
-
value = totalsFormatter ? totalsFormatter(row, column, grid) : "";
|
|
140
|
-
}
|
|
141
|
-
else if (formatter) {
|
|
142
|
-
value = formatter(0, 0, value, column, row, grid);
|
|
143
|
-
}
|
|
144
|
-
td.innerText = value || "";
|
|
145
|
-
result.append(td);
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
return result;
|
|
149
|
-
}
|
|
150
|
-
print(table) {
|
|
151
|
-
const newTab = window.open();
|
|
152
|
-
const title = document.createElement("title");
|
|
153
|
-
title.innerText = table.name || table.id;
|
|
154
|
-
const head = newTab.document.querySelector("head");
|
|
155
|
-
head.append(title);
|
|
156
|
-
head.append(this.createStyleElement());
|
|
157
|
-
const body = newTab.document.querySelector("body");
|
|
158
|
-
body.append(this.createTableElement(table));
|
|
159
|
-
newTab.print();
|
|
160
|
-
}
|
|
161
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { DefaultPrinter } from "./DefaultPrinter";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export const cssStyles = `
|
|
2
|
-
html body {
|
|
3
|
-
font-family: "Courier", "sans-serif";
|
|
4
|
-
font-size: 12px;
|
|
5
|
-
}
|
|
6
|
-
body table {
|
|
7
|
-
margin: 0 auto;
|
|
8
|
-
border-collapse: collapse;
|
|
9
|
-
font-size: 12px;
|
|
10
|
-
}
|
|
11
|
-
table thead {
|
|
12
|
-
border-bottom: 2px solid gray;
|
|
13
|
-
}
|
|
14
|
-
table th,
|
|
15
|
-
table td {
|
|
16
|
-
padding: 0 10px;
|
|
17
|
-
font-weight: normal;
|
|
18
|
-
}
|
|
19
|
-
table td.text-center {
|
|
20
|
-
text-align: center;
|
|
21
|
-
}
|
|
22
|
-
table td.text-right {
|
|
23
|
-
text-align: right;
|
|
24
|
-
}
|
|
25
|
-
.heading {
|
|
26
|
-
height: 30px;
|
|
27
|
-
}
|
|
28
|
-
.heading .table_name {
|
|
29
|
-
text-align: left;
|
|
30
|
-
padding-bottom: 20px;
|
|
31
|
-
}
|
|
32
|
-
.heading .date_stamp {
|
|
33
|
-
text-align: right;
|
|
34
|
-
padding-bottom: 20px;
|
|
35
|
-
}
|
|
36
|
-
.column_name {
|
|
37
|
-
padding-top: 1em;
|
|
38
|
-
font-weight: bold;
|
|
39
|
-
}
|
|
40
|
-
.align_right {
|
|
41
|
-
text-align: right;
|
|
42
|
-
}
|
|
43
|
-
.align_left {
|
|
44
|
-
text-align: left;
|
|
45
|
-
}
|
|
46
|
-
`;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { cssStyles } from "./cssStyles";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { cssStyles } from "./consts";
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { SlickGrid, } from "slickgrid";
|
|
2
|
-
import { elementNotVisible } from "shared/lib/dom";
|
|
3
|
-
import { getOnKeyDownCallback } from "../../../lib";
|
|
4
|
-
import { DownloadManager } from "../csvDownloadManager";
|
|
5
|
-
import { WithoutFilter } from "../filters";
|
|
6
|
-
import { WithoutHotKeys } from "../hotKeys";
|
|
7
|
-
import { DefaultPrinter } from "../printer";
|
|
8
|
-
export class SlickTable {
|
|
9
|
-
constructor(args) {
|
|
10
|
-
this.hotKeysBehavior = new WithoutHotKeys();
|
|
11
|
-
this.printer = new DefaultPrinter();
|
|
12
|
-
this.filter = new WithoutFilter();
|
|
13
|
-
this.downloadManager = new DownloadManager();
|
|
14
|
-
this._grid = null;
|
|
15
|
-
this._grouping = {};
|
|
16
|
-
this._isActive = false;
|
|
17
|
-
this._isEdited = false;
|
|
18
|
-
this._observers = [];
|
|
19
|
-
const { downloadManager, filter, hotKeys, id, name, printer } = args;
|
|
20
|
-
this.id = id;
|
|
21
|
-
this.name = name || "";
|
|
22
|
-
if (hotKeys)
|
|
23
|
-
this.hotKeysBehavior = hotKeys;
|
|
24
|
-
if (printer)
|
|
25
|
-
this.printer = printer;
|
|
26
|
-
if (filter)
|
|
27
|
-
this.filter = filter;
|
|
28
|
-
if (downloadManager)
|
|
29
|
-
this.downloadManager = downloadManager;
|
|
30
|
-
}
|
|
31
|
-
createGrid(dataView, columns, options) {
|
|
32
|
-
this.reset();
|
|
33
|
-
const grid = new SlickGrid(`#${this.id}`, dataView, columns, options);
|
|
34
|
-
this.grid = grid;
|
|
35
|
-
grid.onKeyDown.subscribe(getOnKeyDownCallback(grid));
|
|
36
|
-
this.filter.register(grid, this.id);
|
|
37
|
-
return this.grid;
|
|
38
|
-
}
|
|
39
|
-
handleKeyboardEvent(event) {
|
|
40
|
-
if (elementNotVisible(`#${this.id}`))
|
|
41
|
-
return;
|
|
42
|
-
this.hotKeysBehavior.handleKeyboardEvent(event, this);
|
|
43
|
-
}
|
|
44
|
-
get grid() {
|
|
45
|
-
return this._grid;
|
|
46
|
-
}
|
|
47
|
-
get grouping() {
|
|
48
|
-
return this._grouping;
|
|
49
|
-
}
|
|
50
|
-
get isEdited() {
|
|
51
|
-
return this._isEdited;
|
|
52
|
-
}
|
|
53
|
-
set grid(grid) {
|
|
54
|
-
this._grid = grid;
|
|
55
|
-
}
|
|
56
|
-
set grouping(grouping) {
|
|
57
|
-
this._grouping = { ...this._grouping, ...grouping };
|
|
58
|
-
if (!this.grid)
|
|
59
|
-
return;
|
|
60
|
-
const dataView = this.grid.getData();
|
|
61
|
-
if (this.grouping.isGrouped) {
|
|
62
|
-
dataView.setGrouping(this.grouping.groups || []);
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
dataView.setGrouping([]);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
set isEdited(isEdited) {
|
|
69
|
-
this._isEdited = isEdited;
|
|
70
|
-
this.notifyObservers();
|
|
71
|
-
}
|
|
72
|
-
setPrinter(printer) {
|
|
73
|
-
this.printer = printer;
|
|
74
|
-
}
|
|
75
|
-
get isActive() {
|
|
76
|
-
return this._isActive;
|
|
77
|
-
}
|
|
78
|
-
set isActive(isActive) {
|
|
79
|
-
this._isActive = isActive;
|
|
80
|
-
}
|
|
81
|
-
resizeCanvas() {
|
|
82
|
-
console.log(""); // doesn't resize without this code line O_o
|
|
83
|
-
this.grid?.resizeCanvas();
|
|
84
|
-
}
|
|
85
|
-
registerObservers(observer) {
|
|
86
|
-
if (!~this._observers.indexOf(observer)) {
|
|
87
|
-
this._observers.push(observer);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
notifyObservers() {
|
|
91
|
-
for (const observer of this._observers) {
|
|
92
|
-
observer(this);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
deleteObserver(observer) {
|
|
96
|
-
const index = this._observers.indexOf(observer);
|
|
97
|
-
this._observers.splice(index, 1);
|
|
98
|
-
}
|
|
99
|
-
reset() {
|
|
100
|
-
this.grid?.onKeyDown.unsubscribe(getOnKeyDownCallback(this.grid));
|
|
101
|
-
if (this.grid?.getSelectionModel()) {
|
|
102
|
-
this.grid.setSelectedRows([]);
|
|
103
|
-
}
|
|
104
|
-
this.hotKeysBehavior.resetQueue();
|
|
105
|
-
this.isEdited = false;
|
|
106
|
-
this.isActive = false;
|
|
107
|
-
this.grid = null;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { SlickTable } from "./SlickTable";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { eventContextMenu } from "./eventContextMenu";
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export { DownloadManager, DecoratorEndingDate, DecoratorFilter, DecoratorColumnFilter, DecoratorPeriod, DefaultHotKeys, DefaultPrinter, DeletedRowsFilter, Filter, PreventCopying, RedoUndoOnly, SlickTable, WithConfirmationOfDeletion, WithoutHotKeys, } from "./SlickTable";
|
|
2
|
-
export { eventContextMenu } from "./events";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { eventOpenColumnFilters } from "../../model";
|
|
2
|
-
import { headerButtons } from "../highlighting";
|
|
3
|
-
export function handleHeaderButtons(table) {
|
|
4
|
-
headerButtons.highlightAllColumns(table.filter.args, table.id);
|
|
5
|
-
return function (event, args) {
|
|
6
|
-
event.preventDefault();
|
|
7
|
-
eventOpenColumnFilters.columnId = args.column.id || "";
|
|
8
|
-
eventOpenColumnFilters.group =
|
|
9
|
-
args.command;
|
|
10
|
-
eventOpenColumnFilters.table = table;
|
|
11
|
-
eventOpenColumnFilters.target = event.target;
|
|
12
|
-
eventOpenColumnFilters.x = event.x || 0;
|
|
13
|
-
eventOpenColumnFilters.y = event.y || 0;
|
|
14
|
-
eventOpenColumnFilters.notify();
|
|
15
|
-
};
|
|
16
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { handleHeaderButtons } from "./handleHeaderButtons";
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
class HeaderButtons {
|
|
2
|
-
highlightAllColumns(args, tableId) {
|
|
3
|
-
const slickTable = document.getElementById(tableId);
|
|
4
|
-
if (!slickTable)
|
|
5
|
-
return;
|
|
6
|
-
const columnIds = Object.keys(args.columnFilters || {});
|
|
7
|
-
if (!columnIds.length) {
|
|
8
|
-
const columns = slickTable.querySelectorAll(".slick-header-column");
|
|
9
|
-
for (const column of columns) {
|
|
10
|
-
column.classList.remove("filter-active");
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
for (const columnId of columnIds) {
|
|
15
|
-
const column = slickTable.querySelector(`[data-id="${columnId}"]`);
|
|
16
|
-
if (!column)
|
|
17
|
-
return;
|
|
18
|
-
if (args.columnFilters[columnId].value[1] ||
|
|
19
|
-
args.columnFilters[columnId].value[2]) {
|
|
20
|
-
column.classList.add("filter-active");
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
column.classList.remove("filter-active");
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
highlightColumn(table, dataId) {
|
|
29
|
-
const slickTable = document.getElementById(table.id);
|
|
30
|
-
if (!slickTable)
|
|
31
|
-
return;
|
|
32
|
-
const column = slickTable.querySelector(`[data-id="${dataId}"]`);
|
|
33
|
-
if (!column)
|
|
34
|
-
return;
|
|
35
|
-
column.classList.add("filter-active");
|
|
36
|
-
}
|
|
37
|
-
resetColumn(table, dataId) {
|
|
38
|
-
const slickTable = document.getElementById(table.id);
|
|
39
|
-
if (!slickTable)
|
|
40
|
-
return;
|
|
41
|
-
const column = slickTable.querySelector(`[data-id="${dataId}"]`);
|
|
42
|
-
if (!column)
|
|
43
|
-
return;
|
|
44
|
-
column.classList.remove("filter-active");
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
export const headerButtons = new HeaderButtons();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { headerButtons } from "./headerButtons";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { openColumnFilter } from "./openColumnFilter";
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { AnEvent } from "shared/lib/an-event";
|
|
2
|
-
import { EColumnFiltersGroup } from "shared/model/enums";
|
|
3
|
-
class OpenColumnFilters extends AnEvent {
|
|
4
|
-
constructor() {
|
|
5
|
-
super(...arguments);
|
|
6
|
-
this.columnId = "";
|
|
7
|
-
this.group = EColumnFiltersGroup.Text;
|
|
8
|
-
this.target = null;
|
|
9
|
-
this.x = 0;
|
|
10
|
-
this.y = 0;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export const eventOpenColumnFilters = new OpenColumnFilters();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { eventOpenColumnFilters } from "./eventOpenColumnFilters";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { SlickgridTable } from "./ui";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { onAddNewRow } from "./onAddNewRow";
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { getLastRow, getMaxId } from "../../../../lib";
|
|
2
|
-
export const onAddNewRow = (table) => (_e, { grid, item }) => {
|
|
3
|
-
addNewRow(grid, item);
|
|
4
|
-
grid.updateRowCount();
|
|
5
|
-
grid.invalidate();
|
|
6
|
-
table.isEdited = true;
|
|
7
|
-
table.hotKeysBehavior.pushToCommandQueue(grid);
|
|
8
|
-
};
|
|
9
|
-
const addNewRow = (grid, item) => {
|
|
10
|
-
const dataView = grid.getData();
|
|
11
|
-
const lastRow = getLastRow(dataView);
|
|
12
|
-
const maxId = getMaxId(grid);
|
|
13
|
-
const newRow = {
|
|
14
|
-
...lastRow,
|
|
15
|
-
...item,
|
|
16
|
-
id: maxId + 1,
|
|
17
|
-
isEdited: true,
|
|
18
|
-
isNew: true,
|
|
19
|
-
};
|
|
20
|
-
dataView.addItem(newRow);
|
|
21
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { useGrid } from "./useGrid";
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { useEffect } from "react";
|
|
2
|
-
import { SlickCheckboxSelectColumn, SlickGroupItemMetadataProvider, SlickHeaderButtons, SlickHeaderMenu, SlickResizer, SlickRowSelectionModel, SlickDataView as SlickgridDataView, } from "slickgrid";
|
|
3
|
-
import { CHECKBOX_SELECTOR } from "shared/model/consts";
|
|
4
|
-
import { onRowsChanged, columnSorter as sorter, onRowCountChanged as updateRowCount, updateTotals, } from "../../../../lib";
|
|
5
|
-
import { openContextMenu } from "../../../../lib/contextMenu";
|
|
6
|
-
import { handleHeaderButtons, headerButtons } from "../../../HeaderButtons";
|
|
7
|
-
import { defaultOptions } from "../../model";
|
|
8
|
-
export function useGrid({ SlickDataView = SlickgridDataView, applyCellCssStyles, columnSorter = sorter, columns, getItemMetadata, groups, items, onAddNewRow, onBeforeEditCell, onCellChange, onClick, onDblClick, onHeaderMenuCommand, onRowCountChanged = updateRowCount, options = {}, table, }) {
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
const groupItemMetadataProvider = new SlickGroupItemMetadataProvider();
|
|
11
|
-
const headerButtonsPlugin = new SlickHeaderButtons({});
|
|
12
|
-
const headerMenuPlugin = new SlickHeaderMenu({});
|
|
13
|
-
const dataView = new SlickDataView({
|
|
14
|
-
groupItemMetadataProvider: groups ? groupItemMetadataProvider : undefined,
|
|
15
|
-
});
|
|
16
|
-
const grid = table.createGrid(dataView, [], options);
|
|
17
|
-
const resizer = new SlickResizer({
|
|
18
|
-
container: table.id,
|
|
19
|
-
});
|
|
20
|
-
grid.setSelectionModel(new SlickRowSelectionModel({ selectActiveRow: false }));
|
|
21
|
-
grid.registerPlugin(resizer);
|
|
22
|
-
grid.registerPlugin(headerButtonsPlugin);
|
|
23
|
-
grid.registerPlugin(groupItemMetadataProvider);
|
|
24
|
-
if (getItemMetadata)
|
|
25
|
-
dataView.getItemMetadata = getItemMetadata(dataView);
|
|
26
|
-
dataView.setItems(items.map((item) => ({ ...item })));
|
|
27
|
-
grid.invalidate();
|
|
28
|
-
dataView.onRowCountChanged.subscribe(onRowCountChanged(table));
|
|
29
|
-
dataView.onRowsChanged.subscribe(onRowsChanged(grid));
|
|
30
|
-
grid.onAddNewRow.subscribe(onAddNewRow);
|
|
31
|
-
grid.onCellChange.subscribe(onCellChange);
|
|
32
|
-
onBeforeEditCell && grid.onBeforeEditCell.subscribe(onBeforeEditCell);
|
|
33
|
-
onClick && grid.onClick.subscribe(onClick);
|
|
34
|
-
onDblClick && grid.onDblClick.subscribe(onDblClick);
|
|
35
|
-
grid.onSort.subscribe(columnSorter.onSort());
|
|
36
|
-
grid.onContextMenu.subscribe(openContextMenu(table));
|
|
37
|
-
const onHeaderButtonCommand = handleHeaderButtons(table);
|
|
38
|
-
headerButtonsPlugin.onCommand.subscribe(onHeaderButtonCommand);
|
|
39
|
-
if (onHeaderMenuCommand) {
|
|
40
|
-
headerMenuPlugin.onCommand.subscribe(onHeaderMenuCommand);
|
|
41
|
-
grid.registerPlugin(headerMenuPlugin);
|
|
42
|
-
}
|
|
43
|
-
if (groups) {
|
|
44
|
-
table.grouping = {
|
|
45
|
-
groups,
|
|
46
|
-
isGrouped: table.grouping.isGrouped ?? true,
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
applyCellCssStyles?.(grid);
|
|
50
|
-
table.hotKeysBehavior.pushToCommandQueue(grid);
|
|
51
|
-
// table.notifyObservers();
|
|
52
|
-
return () => {
|
|
53
|
-
headerButtonsPlugin.onCommand.unsubscribe(onHeaderButtonCommand);
|
|
54
|
-
onHeaderMenuCommand &&
|
|
55
|
-
headerMenuPlugin.onCommand.unsubscribe(onHeaderMenuCommand);
|
|
56
|
-
grid.onAddNewRow.unsubscribe(onAddNewRow);
|
|
57
|
-
grid.onCellChange.unsubscribe(onCellChange);
|
|
58
|
-
onBeforeEditCell && grid.onBeforeEditCell.unsubscribe(onBeforeEditCell);
|
|
59
|
-
onClick && grid.onClick.unsubscribe(onClick);
|
|
60
|
-
onDblClick && grid.onDblClick.unsubscribe(onDblClick);
|
|
61
|
-
table.reset();
|
|
62
|
-
};
|
|
63
|
-
}, [items]);
|
|
64
|
-
useEffect(() => {
|
|
65
|
-
const grid = table.grid;
|
|
66
|
-
if (!grid || !options)
|
|
67
|
-
return;
|
|
68
|
-
grid.setOptions({ ...defaultOptions, ...options });
|
|
69
|
-
grid.render();
|
|
70
|
-
}, [options, items]);
|
|
71
|
-
useEffect(() => {
|
|
72
|
-
const grid = table.grid;
|
|
73
|
-
if (!grid)
|
|
74
|
-
return;
|
|
75
|
-
if (!columns.length)
|
|
76
|
-
return;
|
|
77
|
-
if (columns[0].id === CHECKBOX_SELECTOR) {
|
|
78
|
-
const checkboxSelector = new SlickCheckboxSelectColumn();
|
|
79
|
-
grid.setColumns([
|
|
80
|
-
// @ts-ignore
|
|
81
|
-
{ ...checkboxSelector.getColumnDefinition(), focusable: false },
|
|
82
|
-
...columns.slice(1),
|
|
83
|
-
]);
|
|
84
|
-
grid.registerPlugin(checkboxSelector);
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
grid.setColumns(columns);
|
|
88
|
-
}
|
|
89
|
-
headerButtons.highlightAllColumns(table.filter.args, table.id);
|
|
90
|
-
table.filter.register(grid, table.id);
|
|
91
|
-
grid.invalidate();
|
|
92
|
-
updateTotals(grid);
|
|
93
|
-
table.notifyObservers();
|
|
94
|
-
}, [columns, items]);
|
|
95
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { GridAutosizeColsMode } from "slickgrid";
|
|
2
|
-
export const defaultOptions = {
|
|
3
|
-
asyncEditorLoading: false, // increases keyboard navigation speed
|
|
4
|
-
autosizeColsMode: GridAutosizeColsMode.LegacyForceFit,
|
|
5
|
-
enableAutoSizeColumns: true,
|
|
6
|
-
enableColumnReorder: false,
|
|
7
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { defaultOptions } from "./defaultOptions";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { onCellChange as cellChange, useHotKeys, useUpdateTotal, } from "../../../lib";
|
|
3
|
-
import { onAddNewRow as addNewRow, useGrid } from "../lib";
|
|
4
|
-
export const SlickgridTable = ({ SlickDataView, applyCellCssStyles, columnSorter, columns, getItemMetadata, groups, items, onAddNewRow, onBeforeEditCell, onCellChange, onClick, onDblClick, onHeaderMenuCommand, onRowCountChanged, options, table, }) => {
|
|
5
|
-
useGrid({
|
|
6
|
-
SlickDataView,
|
|
7
|
-
applyCellCssStyles,
|
|
8
|
-
columnSorter,
|
|
9
|
-
columns,
|
|
10
|
-
getItemMetadata,
|
|
11
|
-
groups,
|
|
12
|
-
items,
|
|
13
|
-
onAddNewRow: onAddNewRow || addNewRow(table),
|
|
14
|
-
onBeforeEditCell,
|
|
15
|
-
onCellChange: onCellChange || cellChange(table),
|
|
16
|
-
onClick,
|
|
17
|
-
onDblClick,
|
|
18
|
-
onHeaderMenuCommand,
|
|
19
|
-
onRowCountChanged,
|
|
20
|
-
options,
|
|
21
|
-
table,
|
|
22
|
-
});
|
|
23
|
-
useHotKeys(table);
|
|
24
|
-
useUpdateTotal(table);
|
|
25
|
-
return _jsx("div", { id: table.id, className: "slick-container" });
|
|
26
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { SlickgridTable } from "./SlickgridTable";
|