@guiexpert/table 1.1.18 → 1.1.20
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/.eslintrc.json +16 -0
- package/dist/README.md +101 -0
- package/dist/css/main.css +350 -0
- package/dist/css/table-classes.css +42 -0
- package/dist/css/table-color-classes.css +98 -0
- package/dist/css/table-color-vars.css +158 -0
- package/dist/css/table-tree.css +53 -0
- package/dist/index.cjs +351 -0
- package/{index.d.ts → dist/index.d.ts} +3 -0
- package/{index.js → dist/index.js} +896 -831
- package/dist/lib/common/decorator/avoid-double-execution.decorator.d.ts +7 -0
- package/{lib → dist/lib}/table/event-listener.if.d.ts +3 -1
- package/dist/lib/table/focus/event-focus-changed-listener.if.d.ts +4 -0
- package/{lib → dist/lib}/table/focus/focus-model.d.ts +6 -0
- package/dist/lib/table/focus/focus-model.if.d.ts +12 -0
- package/dist/lib/table/renderer/positive-and-negative-number-renderer.d.ts +8 -0
- package/dist/lib/table/selection/event-selection-changed-listener.if.d.ts +4 -0
- package/{lib → dist/lib}/table/selection/multi-rows-selection-model.d.ts +9 -0
- package/{lib → dist/lib}/table/selection/selection-model.d.ts +7 -0
- package/{lib → dist/lib}/table/selection/selection-model.if.d.ts +4 -0
- package/{lib → dist/lib}/table/table-scope.d.ts +3 -1
- package/dist/package.json +51 -0
- package/doc.css +1565 -0
- package/package.json +27 -8
- package/patch.js +16 -0
- package/src/index.ts +176 -0
- package/src/lib/common/decorator/avoid-double-execution.decorator.ts +21 -0
- package/src/lib/table/action/action-id.type.ts +36 -0
- package/src/lib/table/action/on-action-triggered.if.ts +14 -0
- package/src/lib/table/action/osx-shortcut-actionId-mapping.ts +39 -0
- package/src/lib/table/action/shortcut-actionid-mapping.type.ts +7 -0
- package/src/lib/table/action/shortcut.service.ts +162 -0
- package/src/lib/table/action/windows-shortcut-actionId-mapping.ts +35 -0
- package/src/lib/table/checkbox/checkbox-model.if.ts +16 -0
- package/src/lib/table/checkbox/checkbox-model.ts +62 -0
- package/src/lib/table/checkbox/tree-checkbox-model.ts +123 -0
- package/src/lib/table/color/color-rgb.if.ts +12 -0
- package/src/lib/table/color/color-rgb.ts +10 -0
- package/src/lib/table/color/ge-css-color-util.ts +43 -0
- package/src/lib/table/color/three-color-gradient-arg.if.ts +15 -0
- package/src/lib/table/color/three-color-gradient-arg.ts +14 -0
- package/src/lib/table/color/two-color-gradient-arg.if.ts +12 -0
- package/src/lib/table/color/two-color-gradient-arg.ts +12 -0
- package/src/lib/table/css-vars.ts +243 -0
- package/src/lib/table/data/chunk/chunk.data-event.if.ts +8 -0
- package/src/lib/table/data/chunk/chunk.data-event.ts +27 -0
- package/src/lib/table/data/chunk/request-chunk.if.ts +9 -0
- package/src/lib/table/data/chunk/request-chunk.ts +15 -0
- package/src/lib/table/data/common/aligns.ts +42 -0
- package/src/lib/table/data/common/area-map-factory.ts +20 -0
- package/src/lib/table/data/common/area-map.ts +18 -0
- package/src/lib/table/data/common/area-map.type.ts +5 -0
- package/src/lib/table/data/common/args-adjust-columns-to-row-parent-params.ts +21 -0
- package/src/lib/table/data/common/args-render-cell-div.ts +34 -0
- package/src/lib/table/data/common/boolean-function.ts +16 -0
- package/src/lib/table/data/common/cell-range.ts +66 -0
- package/src/lib/table/data/common/checkbox-column-def.ts +31 -0
- package/src/lib/table/data/common/checked-type.ts +6 -0
- package/src/lib/table/data/common/event/ge-cell-indices.ts +12 -0
- package/src/lib/table/data/common/event/ge-key-event.ts +15 -0
- package/src/lib/table/data/common/event/ge-model-change-event.ts +16 -0
- package/src/lib/table/data/common/event/ge-mouse-event.ts +41 -0
- package/src/lib/table/data/common/event/input/table-cell-update-event.if.ts +58 -0
- package/src/lib/table/data/common/event/input/table-cell-update-event.ts +27 -0
- package/src/lib/table/data/common/filter-function.ts +9 -0
- package/src/lib/table/data/common/get-t.ts +7 -0
- package/src/lib/table/data/common/index-and-px.ts +12 -0
- package/src/lib/table/data/common/size.if.ts +8 -0
- package/src/lib/table/data/common/size.ts +9 -0
- package/src/lib/table/data/common/sizes.ts +35 -0
- package/src/lib/table/data/common/sort-item.ts +14 -0
- package/src/lib/table/data/common/sort-state.type.ts +7 -0
- package/src/lib/table/data/common/tree-arrow.type.ts +8 -0
- package/src/lib/table/data/common/tree-row-if.ts +15 -0
- package/src/lib/table/data/common/tree-row.ts +22 -0
- package/src/lib/table/data/common/value-label.if.ts +6 -0
- package/src/lib/table/data/common/value-label.ts +13 -0
- package/src/lib/table/data/div-scope.type.ts +14 -0
- package/src/lib/table/data/event/mouse-target-data.ts +48 -0
- package/src/lib/table/data/geo-data.ts +16 -0
- package/src/lib/table/data/options/auto-restore-options.if.ts +21 -0
- package/src/lib/table/data/options/auto-restore-options.ts +50 -0
- package/src/lib/table/data/options/default-row-heights.if.ts +5 -0
- package/src/lib/table/data/options/default-row-heights.ts +10 -0
- package/src/lib/table/data/options/header-group-options.if.ts +9 -0
- package/src/lib/table/data/options/header-group-options.ts +23 -0
- package/src/lib/table/data/options/icon.if.ts +20 -0
- package/src/lib/table/data/options/icon.ts +10 -0
- package/src/lib/table/data/options/sorted-options.if.ts +13 -0
- package/src/lib/table/data/options/sorted-options.ts +15 -0
- package/src/lib/table/data/options/table-options.if.ts +240 -0
- package/src/lib/table/data/options/table-options.ts +68 -0
- package/src/lib/table/data/options/tree-options.if.ts +10 -0
- package/src/lib/table/data/options/tree-options.ts +32 -0
- package/src/lib/table/data/side-ident.type.ts +4 -0
- package/src/lib/table/data/table-model-and-options.if.ts +11 -0
- package/src/lib/table/data/table-model-and-options.ts +16 -0
- package/src/lib/table/data/tablemodel/area-ident.type.ts +18 -0
- package/src/lib/table/data/tablemodel/areamodel/abstract-area-model.ts +184 -0
- package/src/lib/table/data/tablemodel/areamodel/area-model-array-of-arrays.ts +63 -0
- package/src/lib/table/data/tablemodel/areamodel/area-model-cell-groups.ts +236 -0
- package/src/lib/table/data/tablemodel/areamodel/area-model-hidden.ts +126 -0
- package/src/lib/table/data/tablemodel/areamodel/area-model-object-array-with-columndefs.ts +28 -0
- package/src/lib/table/data/tablemodel/areamodel/area-model-object-array.ts +120 -0
- package/src/lib/table/data/tablemodel/areamodel/area-model-tree.ts +224 -0
- package/src/lib/table/data/tablemodel/areamodel/area-model.if.ts +192 -0
- package/src/lib/table/data/tablemodel/areamodel/area-model.ts +117 -0
- package/src/lib/table/data/tablemodel/areamodel/async-area-model-object-array.ts +110 -0
- package/src/lib/table/data/tablemodel/areamodel/col-and-rowspan-model.ts +64 -0
- package/src/lib/table/data/tablemodel/areamodel/has-default-row-height-if.ts +3 -0
- package/src/lib/table/data/tablemodel/areamodel/object-array-holder.if.ts +8 -0
- package/src/lib/table/data/tablemodel/cellgroup/cell-group-ext.ts +172 -0
- package/src/lib/table/data/tablemodel/cellgroup/cell-group.if.ts +12 -0
- package/src/lib/table/data/tablemodel/cellgroup/cell-group.ts +18 -0
- package/src/lib/table/data/tablemodel/cellgroup/cellgroup-factory.ts +148 -0
- package/src/lib/table/data/tablemodel/column/column-def.if.ts +141 -0
- package/src/lib/table/data/tablemodel/column/column-def.ts +108 -0
- package/src/lib/table/data/tablemodel/padding.ts +12 -0
- package/src/lib/table/data/tablemodel/table-model.if.ts +256 -0
- package/src/lib/table/data/tablemodel/table-model.ts +542 -0
- package/src/lib/table/ele-scope.ts +309 -0
- package/src/lib/table/event-adapter.ts +43 -0
- package/src/lib/table/event-listener.if.ts +32 -0
- package/src/lib/table/factory/table-factory.ts +379 -0
- package/src/lib/table/factory/tree-factory.ts +52 -0
- package/src/lib/table/focus/event-focus-changed-listener.if.ts +8 -0
- package/src/lib/table/focus/focus-model.if.ts +20 -0
- package/src/lib/table/focus/focus-model.ts +76 -0
- package/src/lib/table/focus/focus.type.ts +4 -0
- package/src/lib/table/input-handler.ts +48 -0
- package/src/lib/table/instanceof-workaround.ts +41 -0
- package/src/lib/table/license-manager.ts +47 -0
- package/src/lib/table/mouse-handler.ts +307 -0
- package/src/lib/table/render-scope.ts +1440 -0
- package/src/lib/table/renderer/cell-group-ext-cell-renderer.ts +123 -0
- package/src/lib/table/renderer/cell-render.if.ts +16 -0
- package/src/lib/table/renderer/checkbox-boolean-property-cell-renderer.ts +63 -0
- package/src/lib/table/renderer/checkbox-cell-renderer.ts +39 -0
- package/src/lib/table/renderer/date-to-int-date-cell-renderer.ts +39 -0
- package/src/lib/table/renderer/date-to-iso-cell-renderer.ts +25 -0
- package/src/lib/table/renderer/date-to-locale-date-cell-renderer.ts +24 -0
- package/src/lib/table/renderer/date-to-tec-cell-renderer.ts +28 -0
- package/src/lib/table/renderer/edit/edit-cell-renderer.type.ts +3 -0
- package/src/lib/table/renderer/edit/edit-input-pipe-for-number.ts +6 -0
- package/src/lib/table/renderer/edit/edit-input-pipe.if.ts +15 -0
- package/src/lib/table/renderer/edit/input-cell-renderer.ts +41 -0
- package/src/lib/table/renderer/edit/select-cell-renderer.ts +60 -0
- package/src/lib/table/renderer/male-female-to-icon-cell-renderer.ts +26 -0
- package/src/lib/table/renderer/number-cell-progress-bar-cell-renderer.ts +57 -0
- package/src/lib/table/renderer/number-cell-renderer.ts +38 -0
- package/src/lib/table/renderer/positive-and-negative-number-renderer.ts +45 -0
- package/src/lib/table/renderer/progress-bar-cell-renderer.ts +60 -0
- package/src/lib/table/renderer/renderer-cleanup-fn.type.ts +1 -0
- package/src/lib/table/renderer/renderer.ts +11 -0
- package/src/lib/table/renderer/star-rating-cell-renderer.ts +45 -0
- package/src/lib/table/renderer/true-false-cell-renderer.ts +28 -0
- package/src/lib/table/selection/event-selection-changed-listener.if.ts +8 -0
- package/src/lib/table/selection/multi-rows-selection-model.ts +118 -0
- package/src/lib/table/selection/selection-model.if.ts +56 -0
- package/src/lib/table/selection/selection-model.ts +182 -0
- package/src/lib/table/selection/selection-service.ts +129 -0
- package/src/lib/table/selection/selection.type.ts +6 -0
- package/src/lib/table/service/abstract-store-state.service.ts +105 -0
- package/src/lib/table/service/convenience-dom.service.ts +574 -0
- package/src/lib/table/service/copy-service.if.ts +45 -0
- package/src/lib/table/service/copy-service.ts +130 -0
- package/src/lib/table/service/data/collapsed-expanded.data.ts +11 -0
- package/src/lib/table/service/data/html-style.type.ts +1 -0
- package/src/lib/table/service/dom-service.if.ts +18 -0
- package/src/lib/table/service/ge-filter.service.ts +123 -0
- package/src/lib/table/service/simple-dom-service.ts +55 -0
- package/src/lib/table/service/sorter.service.ts +30 -0
- package/src/lib/table/service/store-state-collapsed-expand.service.ts +76 -0
- package/src/lib/table/service/store-state-scroll-pos.service.ts +40 -0
- package/src/lib/table/service/store-state-sorting.service.ts +41 -0
- package/src/lib/table/service/tree-row.service.ts +32 -0
- package/src/lib/table/table-api.ts +234 -0
- package/src/lib/table/table-scope.ts +770 -0
- package/tsconfig.json +21 -0
- package/tsconfig.lib.json +10 -0
- package/tsconfig.spec.json +25 -0
- package/vite.config.ts +56 -0
- package/index.cjs +0 -351
- package/lib/table/focus/focus-model.if.d.ts +0 -8
- package/lib/table/renderer/positive-and-negative-number-renderer.d.ts +0 -4
- /package/{lib → dist/lib}/table/action/action-id.type.d.ts +0 -0
- /package/{lib → dist/lib}/table/action/on-action-triggered.if.d.ts +0 -0
- /package/{lib → dist/lib}/table/action/osx-shortcut-actionId-mapping.d.ts +0 -0
- /package/{lib → dist/lib}/table/action/shortcut-actionid-mapping.type.d.ts +0 -0
- /package/{lib → dist/lib}/table/action/shortcut.service.d.ts +0 -0
- /package/{lib → dist/lib}/table/action/windows-shortcut-actionId-mapping.d.ts +0 -0
- /package/{lib → dist/lib}/table/checkbox/checkbox-model.d.ts +0 -0
- /package/{lib → dist/lib}/table/checkbox/checkbox-model.if.d.ts +0 -0
- /package/{lib → dist/lib}/table/checkbox/tree-checkbox-model.d.ts +0 -0
- /package/{lib → dist/lib}/table/color/color-rgb.d.ts +0 -0
- /package/{lib → dist/lib}/table/color/color-rgb.if.d.ts +0 -0
- /package/{lib → dist/lib}/table/color/ge-css-color-util.d.ts +0 -0
- /package/{lib → dist/lib}/table/color/three-color-gradient-arg.d.ts +0 -0
- /package/{lib → dist/lib}/table/color/three-color-gradient-arg.if.d.ts +0 -0
- /package/{lib → dist/lib}/table/color/two-color-gradient-arg.d.ts +0 -0
- /package/{lib → dist/lib}/table/color/two-color-gradient-arg.if.d.ts +0 -0
- /package/{lib → dist/lib}/table/css-vars.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/chunk/chunk.data-event.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/chunk/chunk.data-event.if.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/chunk/request-chunk.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/chunk/request-chunk.if.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/common/aligns.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/common/area-map-factory.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/common/area-map.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/common/area-map.type.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/common/args-adjust-columns-to-row-parent-params.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/common/args-render-cell-div.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/common/boolean-function.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/common/cell-range.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/common/checkbox-column-def.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/common/checked-type.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/common/event/ge-cell-indices.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/common/event/ge-key-event.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/common/event/ge-model-change-event.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/common/event/ge-mouse-event.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/common/event/input/table-cell-update-event.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/common/event/input/table-cell-update-event.if.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/common/filter-function.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/common/get-t.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/common/index-and-px.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/common/size.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/common/size.if.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/common/sizes.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/common/sort-item.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/common/sort-state.type.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/common/tree-arrow.type.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/common/tree-row-if.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/common/tree-row.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/common/value-label.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/common/value-label.if.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/div-scope.type.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/event/mouse-target-data.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/geo-data.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/options/auto-restore-options.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/options/auto-restore-options.if.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/options/default-row-heights.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/options/default-row-heights.if.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/options/header-group-options.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/options/header-group-options.if.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/options/icon.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/options/icon.if.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/options/sorted-options.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/options/sorted-options.if.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/options/table-options.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/options/table-options.if.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/options/tree-options.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/options/tree-options.if.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/side-ident.type.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/table-model-and-options.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/table-model-and-options.if.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/tablemodel/area-ident.type.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/tablemodel/areamodel/abstract-area-model.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/tablemodel/areamodel/area-model-array-of-arrays.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/tablemodel/areamodel/area-model-cell-groups.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/tablemodel/areamodel/area-model-hidden.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/tablemodel/areamodel/area-model-object-array-with-columndefs.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/tablemodel/areamodel/area-model-object-array.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/tablemodel/areamodel/area-model-tree.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/tablemodel/areamodel/area-model.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/tablemodel/areamodel/area-model.if.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/tablemodel/areamodel/async-area-model-object-array.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/tablemodel/areamodel/col-and-rowspan-model.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/tablemodel/areamodel/has-default-row-height-if.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/tablemodel/areamodel/object-array-holder.if.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/tablemodel/cellgroup/cell-group-ext.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/tablemodel/cellgroup/cell-group.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/tablemodel/cellgroup/cell-group.if.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/tablemodel/cellgroup/cellgroup-factory.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/tablemodel/column/column-def.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/tablemodel/column/column-def.if.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/tablemodel/padding.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/tablemodel/table-model.d.ts +0 -0
- /package/{lib → dist/lib}/table/data/tablemodel/table-model.if.d.ts +0 -0
- /package/{lib → dist/lib}/table/ele-scope.d.ts +0 -0
- /package/{lib → dist/lib}/table/event-adapter.d.ts +0 -0
- /package/{lib → dist/lib}/table/factory/table-factory.d.ts +0 -0
- /package/{lib → dist/lib}/table/factory/tree-factory.d.ts +0 -0
- /package/{lib → dist/lib}/table/focus/focus.type.d.ts +0 -0
- /package/{lib → dist/lib}/table/input-handler.d.ts +0 -0
- /package/{lib → dist/lib}/table/instanceof-workaround.d.ts +0 -0
- /package/{lib → dist/lib}/table/license-manager.d.ts +0 -0
- /package/{lib → dist/lib}/table/mouse-handler.d.ts +0 -0
- /package/{lib → dist/lib}/table/render-scope.d.ts +0 -0
- /package/{lib → dist/lib}/table/renderer/cell-group-ext-cell-renderer.d.ts +0 -0
- /package/{lib → dist/lib}/table/renderer/cell-render.if.d.ts +0 -0
- /package/{lib → dist/lib}/table/renderer/checkbox-boolean-property-cell-renderer.d.ts +0 -0
- /package/{lib → dist/lib}/table/renderer/checkbox-cell-renderer.d.ts +0 -0
- /package/{lib → dist/lib}/table/renderer/date-to-int-date-cell-renderer.d.ts +0 -0
- /package/{lib → dist/lib}/table/renderer/date-to-iso-cell-renderer.d.ts +0 -0
- /package/{lib → dist/lib}/table/renderer/date-to-locale-date-cell-renderer.d.ts +0 -0
- /package/{lib → dist/lib}/table/renderer/date-to-tec-cell-renderer.d.ts +0 -0
- /package/{lib → dist/lib}/table/renderer/edit/edit-cell-renderer.type.d.ts +0 -0
- /package/{lib → dist/lib}/table/renderer/edit/edit-input-pipe-for-number.d.ts +0 -0
- /package/{lib → dist/lib}/table/renderer/edit/edit-input-pipe.if.d.ts +0 -0
- /package/{lib → dist/lib}/table/renderer/edit/input-cell-renderer.d.ts +0 -0
- /package/{lib → dist/lib}/table/renderer/edit/select-cell-renderer.d.ts +0 -0
- /package/{lib → dist/lib}/table/renderer/male-female-to-icon-cell-renderer.d.ts +0 -0
- /package/{lib → dist/lib}/table/renderer/number-cell-progress-bar-cell-renderer.d.ts +0 -0
- /package/{lib → dist/lib}/table/renderer/number-cell-renderer.d.ts +0 -0
- /package/{lib → dist/lib}/table/renderer/progress-bar-cell-renderer.d.ts +0 -0
- /package/{lib → dist/lib}/table/renderer/renderer-cleanup-fn.type.d.ts +0 -0
- /package/{lib → dist/lib}/table/renderer/renderer.d.ts +0 -0
- /package/{lib → dist/lib}/table/renderer/star-rating-cell-renderer.d.ts +0 -0
- /package/{lib → dist/lib}/table/renderer/true-false-cell-renderer.d.ts +0 -0
- /package/{lib → dist/lib}/table/selection/selection-service.d.ts +0 -0
- /package/{lib → dist/lib}/table/selection/selection.type.d.ts +0 -0
- /package/{lib → dist/lib}/table/service/abstract-store-state.service.d.ts +0 -0
- /package/{lib → dist/lib}/table/service/convenience-dom.service.d.ts +0 -0
- /package/{lib → dist/lib}/table/service/copy-service.d.ts +0 -0
- /package/{lib → dist/lib}/table/service/copy-service.if.d.ts +0 -0
- /package/{lib → dist/lib}/table/service/data/collapsed-expanded.data.d.ts +0 -0
- /package/{lib → dist/lib}/table/service/data/html-style.type.d.ts +0 -0
- /package/{lib → dist/lib}/table/service/dom-service.if.d.ts +0 -0
- /package/{lib → dist/lib}/table/service/ge-filter.service.d.ts +0 -0
- /package/{lib → dist/lib}/table/service/simple-dom-service.d.ts +0 -0
- /package/{lib → dist/lib}/table/service/sorter.service.d.ts +0 -0
- /package/{lib → dist/lib}/table/service/store-state-collapsed-expand.service.d.ts +0 -0
- /package/{lib → dist/lib}/table/service/store-state-scroll-pos.service.d.ts +0 -0
- /package/{lib → dist/lib}/table/service/store-state-sorting.service.d.ts +0 -0
- /package/{lib → dist/lib}/table/service/tree-row.service.d.ts +0 -0
- /package/{lib → dist/lib}/table/table-api.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guiexpert/table",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"
|
|
5
|
-
"tslib": "^2.3.0"
|
|
6
|
-
},
|
|
3
|
+
"version": "1.1.20",
|
|
4
|
+
"private": false,
|
|
7
5
|
"type": "module",
|
|
8
6
|
"main": "./index.js",
|
|
9
7
|
"types": "./index.d.ts",
|
|
@@ -11,18 +9,39 @@
|
|
|
11
9
|
"entryFile": "src/index.ts"
|
|
12
10
|
},
|
|
13
11
|
"scripts": {
|
|
12
|
+
"i": "pnpm i",
|
|
13
|
+
"patch-version": "node patch.js",
|
|
14
|
+
"build": "vite build && npm run concat-css:main && npm run concat-css:dist",
|
|
15
|
+
"concat-css:main": "cat css/table*.css > css/main.css",
|
|
16
|
+
"concat-css:dist": "cat css/table*.css > dist/css/main.css",
|
|
14
17
|
"typedoc:json": "npx typedoc --json ../../apps/table-website/src/assets/json/doctype.json src/index.ts",
|
|
15
18
|
"typedoc:docs-html": "npx typedoc --out ../../apps/table-website/src/assets/docs src/index.ts",
|
|
16
19
|
"typedoc:docs-html-custom-css": "npx typedoc --customCss ./doc.css --out ../../apps/table-website/src/assets/docs src/index.ts",
|
|
17
20
|
"typedoc:docs-md": "npx typedoc --plugin typedoc-plugin-markdown --out ../../apps/table-website/src/assets/docsmd src/index.ts",
|
|
18
|
-
"npm-pub
|
|
21
|
+
"npm-pub": "npm publish --access public"
|
|
19
22
|
},
|
|
20
23
|
"exports": {
|
|
21
24
|
".": {
|
|
22
25
|
"import": "./index.js",
|
|
23
26
|
"require": "./index.cjs"
|
|
24
27
|
}
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"tslib": "^2.3.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@types/node": "^20.11.17",
|
|
34
|
+
"vite": "^5.1.1",
|
|
35
|
+
"vite-plugin-dts": "^3.7.2",
|
|
36
|
+
"vite-plugin-eslint": "^1.8.1",
|
|
37
|
+
"vite-plugin-static-copy": "^0.17.0",
|
|
38
|
+
"vite-tsconfig-paths": "^4.2.1",
|
|
39
|
+
"vite-plugin-babel": "^1.2.0",
|
|
40
|
+
"ts-node": "10.9.1",
|
|
41
|
+
"tsconfig": "^7.0.0",
|
|
42
|
+
"typedoc": "0.25.3",
|
|
43
|
+
"typedoc-plugin-rename-defaults": "^0.7.0",
|
|
44
|
+
"typedoc-plugin-markdown": "3.17.1",
|
|
45
|
+
"typescript": "5.2.2"
|
|
25
46
|
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
47
|
+
}
|
package/patch.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
|
|
3
|
+
const packageJsonPath = 'package.json';
|
|
4
|
+
|
|
5
|
+
try {
|
|
6
|
+
const pack = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
7
|
+
const currentVersion = pack.version;
|
|
8
|
+
const [major, minor, patch] = currentVersion.split('.').map(Number);
|
|
9
|
+
const newPatchVersion = `${major}.${minor}.${patch + 1}`;
|
|
10
|
+
pack.version = newPatchVersion;
|
|
11
|
+
fs.writeFileSync(packageJsonPath, JSON.stringify(pack, null, 2));
|
|
12
|
+
console.log(`${pack.name} -> version patched to ${newPatchVersion}.`);
|
|
13
|
+
|
|
14
|
+
} catch (error) {
|
|
15
|
+
console.error('Error:', error);
|
|
16
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
|
|
2
|
+
export * from './lib/common/decorator/avoid-double-execution.decorator';
|
|
3
|
+
|
|
4
|
+
export * from './lib/table/license-manager';
|
|
5
|
+
export * from './lib/table/instanceof-workaround';
|
|
6
|
+
export * from './lib/table/table-scope';
|
|
7
|
+
export * from './lib/table/table-api';
|
|
8
|
+
export * from './lib/table/ele-scope';
|
|
9
|
+
export * from './lib/table/render-scope';
|
|
10
|
+
export * from './lib/table/mouse-handler';
|
|
11
|
+
export * from './lib/table/input-handler';
|
|
12
|
+
export * from './lib/table/event-listener.if';
|
|
13
|
+
export * from './lib/table/event-adapter';
|
|
14
|
+
export * from './lib/table/css-vars';
|
|
15
|
+
export * from './lib/table/selection/event-selection-changed-listener.if';
|
|
16
|
+
export * from './lib/table/focus/event-focus-changed-listener.if';
|
|
17
|
+
|
|
18
|
+
export * from './lib/table/factory/tree-factory';
|
|
19
|
+
export * from './lib/table/factory/table-factory';
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
export * from './lib/table/action/action-id.type';
|
|
23
|
+
export * from './lib/table/action/shortcut.service';
|
|
24
|
+
export * from './lib/table/action/shortcut-actionid-mapping.type';
|
|
25
|
+
export * from './lib/table/action/windows-shortcut-actionId-mapping';
|
|
26
|
+
export * from './lib/table/action/osx-shortcut-actionId-mapping';
|
|
27
|
+
export * from './lib/table/action/on-action-triggered.if';
|
|
28
|
+
|
|
29
|
+
export * from './lib/table/data/side-ident.type';
|
|
30
|
+
export * from './lib/table/data/div-scope.type';
|
|
31
|
+
export * from './lib/table/data/geo-data';
|
|
32
|
+
export * from './lib/table/data/table-model-and-options.if';
|
|
33
|
+
export * from './lib/table/data/table-model-and-options';
|
|
34
|
+
export * from './lib/table/data/chunk/chunk.data-event';
|
|
35
|
+
export * from './lib/table/data/chunk/chunk.data-event.if';
|
|
36
|
+
export * from './lib/table/data/chunk/request-chunk';
|
|
37
|
+
export * from './lib/table/data/chunk/request-chunk.if';
|
|
38
|
+
|
|
39
|
+
export * from './lib/table/data/common/get-t';
|
|
40
|
+
export * from './lib/table/data/common/value-label.if';
|
|
41
|
+
export * from './lib/table/data/common/value-label';
|
|
42
|
+
export * from './lib/table/data/common/sort-item';
|
|
43
|
+
export * from './lib/table/data/common/sort-state.type';
|
|
44
|
+
export * from './lib/table/data/common/index-and-px';
|
|
45
|
+
export * from './lib/table/data/common/cell-range';
|
|
46
|
+
export * from './lib/table/data/common/checked-type';
|
|
47
|
+
export * from './lib/table/data/common/sizes';
|
|
48
|
+
export * from './lib/table/data/common/aligns';
|
|
49
|
+
export * from './lib/table/data/common/boolean-function';
|
|
50
|
+
export * from './lib/table/data/common/checkbox-column-def';
|
|
51
|
+
export * from './lib/table/data/common/size';
|
|
52
|
+
export * from './lib/table/data/common/size.if';
|
|
53
|
+
export * from './lib/table/data/common/sort-item';
|
|
54
|
+
export * from './lib/table/data/common/sort-state.type';
|
|
55
|
+
export * from './lib/table/data/common/area-map';
|
|
56
|
+
export * from './lib/table/data/common/area-map.type';
|
|
57
|
+
export * from "./lib/table/data/common/area-map-factory";
|
|
58
|
+
export * from "./lib/table/data/common/filter-function";
|
|
59
|
+
export * from "./lib/table/data/common/args-render-cell-div";
|
|
60
|
+
export * from "./lib/table/data/common/args-adjust-columns-to-row-parent-params";
|
|
61
|
+
|
|
62
|
+
export * from "./lib/table/data/common/event/ge-mouse-event";
|
|
63
|
+
export * from "./lib/table/data/common/event/ge-model-change-event";
|
|
64
|
+
export * from "./lib/table/data/common/event/ge-cell-indices";
|
|
65
|
+
export * from "./lib/table/data/common/event/ge-key-event";
|
|
66
|
+
|
|
67
|
+
export * from "./lib/table/data/common/event/input/table-cell-update-event";
|
|
68
|
+
export * from "./lib/table/data/common/event/input/table-cell-update-event.if";
|
|
69
|
+
|
|
70
|
+
export * from "./lib/table/data/event/mouse-target-data";
|
|
71
|
+
|
|
72
|
+
export * from "./lib/table/focus/focus-model";
|
|
73
|
+
export * from "./lib/table/focus/focus-model.if";
|
|
74
|
+
export * from "./lib/table/focus/focus.type";
|
|
75
|
+
|
|
76
|
+
export * from "./lib/table/checkbox/checkbox-model";
|
|
77
|
+
export * from "./lib/table/checkbox/tree-checkbox-model";
|
|
78
|
+
export * from "./lib/table/checkbox/checkbox-model.if";
|
|
79
|
+
|
|
80
|
+
export * from "./lib/table/data/options/auto-restore-options.if";
|
|
81
|
+
export * from './lib/table/data/options/auto-restore-options';
|
|
82
|
+
export * from './lib/table/data/options/table-options';
|
|
83
|
+
export * from './lib/table/data/options/table-options.if';
|
|
84
|
+
export * from './lib/table/data/options/default-row-heights.if';
|
|
85
|
+
export * from './lib/table/data/options/default-row-heights';
|
|
86
|
+
export * from './lib/table/data/options/tree-options';
|
|
87
|
+
export * from './lib/table/data/options/tree-options.if';
|
|
88
|
+
export * from './lib/table/data/options/icon';
|
|
89
|
+
export * from './lib/table/data/options/icon.if';
|
|
90
|
+
export * from './lib/table/data/options/sorted-options.if';
|
|
91
|
+
export * from './lib/table/data/options/sorted-options';
|
|
92
|
+
|
|
93
|
+
export * from './lib/table/data/tablemodel/padding';
|
|
94
|
+
export * from './lib/table/data/tablemodel/table-model.if';
|
|
95
|
+
export * from './lib/table/data/tablemodel/table-model';
|
|
96
|
+
export * from './lib/table/data/tablemodel/area-ident.type';
|
|
97
|
+
|
|
98
|
+
export * from './lib/table/data/tablemodel/column/column-def';
|
|
99
|
+
export * from './lib/table/data/tablemodel/column/column-def.if';
|
|
100
|
+
|
|
101
|
+
export * from './lib/table/data/tablemodel/cellgroup/cell-group';
|
|
102
|
+
export * from './lib/table/data/tablemodel/cellgroup/cell-group.if';
|
|
103
|
+
export * from './lib/table/data/tablemodel/cellgroup/cellgroup-factory';
|
|
104
|
+
export * from './lib/table/data/tablemodel/cellgroup/cell-group-ext';
|
|
105
|
+
|
|
106
|
+
export * from './lib/table/data/tablemodel/areamodel/area-model.if';
|
|
107
|
+
export * from './lib/table/data/tablemodel/areamodel/area-model';
|
|
108
|
+
export * from './lib/table/data/tablemodel/areamodel/area-model-cell-groups';
|
|
109
|
+
export * from "./lib/table/data/tablemodel/areamodel/abstract-area-model";
|
|
110
|
+
export * from "./lib/table/data/tablemodel/areamodel/area-model-array-of-arrays";
|
|
111
|
+
export * from "./lib/table/data/tablemodel/areamodel/area-model-hidden";
|
|
112
|
+
export * from './lib/table/data/tablemodel/areamodel/area-model-object-array';
|
|
113
|
+
export * from './lib/table/data/tablemodel/areamodel/area-model-tree';
|
|
114
|
+
export * from './lib/table/data/tablemodel/areamodel/col-and-rowspan-model';
|
|
115
|
+
export * from './lib/table/data/tablemodel/areamodel/has-default-row-height-if';
|
|
116
|
+
export * from './lib/table/data/tablemodel/areamodel/object-array-holder.if';
|
|
117
|
+
|
|
118
|
+
export * from './lib/table/data/common/tree-row';
|
|
119
|
+
export * from './lib/table/data/common/tree-row-if';
|
|
120
|
+
export * from './lib/table/data/common/tree-arrow.type';
|
|
121
|
+
export * from './lib/table/data/tablemodel/areamodel/area-model-object-array-with-columndefs';
|
|
122
|
+
|
|
123
|
+
export * from './lib/table/service/convenience-dom.service';
|
|
124
|
+
export * from "./lib/table/service/dom-service.if";
|
|
125
|
+
export * from "./lib/table/service/simple-dom-service";
|
|
126
|
+
export * from "./lib/table/service/tree-row.service";
|
|
127
|
+
export * from "./lib/table/service/store-state-scroll-pos.service";
|
|
128
|
+
export * from "./lib/table/service/store-state-collapsed-expand.service";
|
|
129
|
+
export * from "./lib/table/service/store-state-sorting.service";
|
|
130
|
+
export * from "./lib/table/service/data/collapsed-expanded.data";
|
|
131
|
+
export * from "./lib/table/service/data/html-style.type";
|
|
132
|
+
export * from "./lib/table/service/ge-filter.service";
|
|
133
|
+
export * from "./lib/table/service/copy-service";
|
|
134
|
+
export * from "./lib/table/service/copy-service.if";
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
export * from "./lib/table/renderer/renderer";
|
|
138
|
+
export * from "./lib/table/renderer/cell-render.if";
|
|
139
|
+
export * from "./lib/table/renderer/cell-group-ext-cell-renderer";
|
|
140
|
+
export * from "./lib/table/renderer/checkbox-cell-renderer";
|
|
141
|
+
export * from "./lib/table/renderer/checkbox-boolean-property-cell-renderer";
|
|
142
|
+
export * from "./lib/table/renderer/date-to-iso-cell-renderer";
|
|
143
|
+
export * from "./lib/table/renderer/date-to-int-date-cell-renderer";
|
|
144
|
+
export * from "./lib/table/renderer/date-to-locale-date-cell-renderer";
|
|
145
|
+
export * from "./lib/table/renderer/male-female-to-icon-cell-renderer";
|
|
146
|
+
export * from "./lib/table/renderer/number-cell-progress-bar-cell-renderer";
|
|
147
|
+
export * from "./lib/table/renderer/true-false-cell-renderer";
|
|
148
|
+
export * from "./lib/table/renderer/date-to-tec-cell-renderer";
|
|
149
|
+
export * from "./lib/table/renderer/renderer-cleanup-fn.type";
|
|
150
|
+
export * from "./lib/table/renderer/number-cell-renderer";
|
|
151
|
+
export * from "./lib/table/renderer/star-rating-cell-renderer";
|
|
152
|
+
export * from "./lib/table/renderer/progress-bar-cell-renderer";
|
|
153
|
+
export * from "./lib/table/renderer/positive-and-negative-number-renderer";
|
|
154
|
+
|
|
155
|
+
export * from "./lib/table/renderer/edit/edit-cell-renderer.type";
|
|
156
|
+
export * from "./lib/table/renderer/edit/edit-input-pipe.if";
|
|
157
|
+
export * from "./lib/table/renderer/edit/edit-input-pipe-for-number";
|
|
158
|
+
export * from "./lib/table/renderer/edit/input-cell-renderer";
|
|
159
|
+
export * from './lib/table/renderer/edit/select-cell-renderer';
|
|
160
|
+
|
|
161
|
+
export * from './lib/table/selection/selection-model';
|
|
162
|
+
export * from './lib/table/selection/selection-model.if';
|
|
163
|
+
export * from './lib/table/selection/selection.type';
|
|
164
|
+
export * from './lib/table/selection/selection-service';
|
|
165
|
+
export * from './lib/table/selection/multi-rows-selection-model';
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
export * from './lib/table/color/color-rgb';
|
|
169
|
+
export * from './lib/table/color/color-rgb.if';
|
|
170
|
+
export * from './lib/table/color/ge-css-color-util';
|
|
171
|
+
export * from './lib/table/color/three-color-gradient-arg.if';
|
|
172
|
+
export * from './lib/table/color/three-color-gradient-arg';
|
|
173
|
+
export * from './lib/table/color/two-color-gradient-arg.if';
|
|
174
|
+
export * from './lib/table/color/two-color-gradient-arg';
|
|
175
|
+
export * from "./lib/table/data/tablemodel/areamodel/has-default-row-height-if";
|
|
176
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A decorator that prevents a method from being executed multiple times within a specified delay.
|
|
3
|
+
*
|
|
4
|
+
* @param {number} [delay=500] - The delay threshold in milliseconds.
|
|
5
|
+
* @returns {Function} - The decorated method descriptor.
|
|
6
|
+
*/
|
|
7
|
+
export function AvoidDoubleExecution(delay:number = 500) {
|
|
8
|
+
return function (_target: any, _key: string, descriptor: PropertyDescriptor) {
|
|
9
|
+
let lastClick = 0;
|
|
10
|
+
const originalMethod = descriptor.value;
|
|
11
|
+
descriptor.value = function (...args: any[]) {
|
|
12
|
+
if (Date.now() - lastClick < delay) {
|
|
13
|
+
// skipped
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
lastClick = Date.now();
|
|
17
|
+
return originalMethod.apply(this, args);
|
|
18
|
+
};
|
|
19
|
+
return descriptor;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An array of action identifiers.
|
|
3
|
+
*
|
|
4
|
+
* @type {ReadonlyArray<string>}
|
|
5
|
+
*/
|
|
6
|
+
export const actionIds = [
|
|
7
|
+
"COPY_2_CLIPBOARD",
|
|
8
|
+
|
|
9
|
+
"START_EDITING",
|
|
10
|
+
|
|
11
|
+
"TOGGLE_SELECTION",
|
|
12
|
+
"SELECT_ALL",
|
|
13
|
+
"DESELECT_ALL",
|
|
14
|
+
|
|
15
|
+
"NAVIGATE_LEFT",
|
|
16
|
+
"NAVIGATE_RIGHT",
|
|
17
|
+
"NAVIGATE_UP",
|
|
18
|
+
"NAVIGATE_DOWN",
|
|
19
|
+
//
|
|
20
|
+
// "ENTER_PRESSED",
|
|
21
|
+
// "HOME_PRESSED",
|
|
22
|
+
// "SPACE_PRESSED",
|
|
23
|
+
// "END_PRESSED",
|
|
24
|
+
// "PAGEUP_PRESSED",
|
|
25
|
+
// "PAGEDOWN_PRESSED"
|
|
26
|
+
] as const;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Represents an action ID.
|
|
30
|
+
*
|
|
31
|
+
* @typedef {string} ActionId
|
|
32
|
+
* @memberof module:myModule
|
|
33
|
+
* @see module:myModule.actionIds
|
|
34
|
+
*/
|
|
35
|
+
export type ActionId = typeof actionIds[number];
|
|
36
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ActionId } from "./action-id.type";
|
|
2
|
+
|
|
3
|
+
export interface OnActionTriggeredIf {
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Triggers an action based on the provided action ID.
|
|
7
|
+
*
|
|
8
|
+
* @param {ActionId} actionId - The ID of the action to be triggered.
|
|
9
|
+
*
|
|
10
|
+
* @return {boolean} - Returns true if the action was successfully triggered; otherwise, false.
|
|
11
|
+
*/
|
|
12
|
+
onActionTriggered(actionId: ActionId): boolean;
|
|
13
|
+
|
|
14
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ActionId } from "./action-id.type";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Class representing the mapping of OS X shortcut actions to action IDs.
|
|
5
|
+
*
|
|
6
|
+
* Use 'meta' for the MacOS 'cmd' key.
|
|
7
|
+
*
|
|
8
|
+
* @class OsxShortcutActionIdMapping
|
|
9
|
+
*/
|
|
10
|
+
export class OsxShortcutActionIdMapping {
|
|
11
|
+
|
|
12
|
+
get(): { [key: string]: ActionId } {
|
|
13
|
+
return {
|
|
14
|
+
"f2": "START_EDITING",
|
|
15
|
+
|
|
16
|
+
"space": "TOGGLE_SELECTION",
|
|
17
|
+
|
|
18
|
+
"ctrl+num_add": "SELECT_ALL",
|
|
19
|
+
"meta+a": "SELECT_ALL",
|
|
20
|
+
"ctrl+a": "SELECT_ALL",
|
|
21
|
+
|
|
22
|
+
"meta+x": "DESELECT_ALL",
|
|
23
|
+
"meta+shift+a": "DESELECT_ALL",
|
|
24
|
+
"ctrl+shift+a": "DESELECT_ALL",
|
|
25
|
+
"ctrl+num_subtract": "DESELECT_ALL",
|
|
26
|
+
"ctrl -": "DESELECT_ALL",
|
|
27
|
+
|
|
28
|
+
"arrowup": "NAVIGATE_UP",
|
|
29
|
+
"arrowdown": "NAVIGATE_DOWN",
|
|
30
|
+
"arrowleft": "NAVIGATE_LEFT",
|
|
31
|
+
"arrowright": "NAVIGATE_RIGHT",
|
|
32
|
+
|
|
33
|
+
"meta+c": "COPY_2_CLIPBOARD",
|
|
34
|
+
"ctrl+c": "COPY_2_CLIPBOARD",
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { ActionId } from "./action-id.type";
|
|
2
|
+
import { TableScope } from "../table-scope";
|
|
3
|
+
import { ShortcutActionIdMapping } from "./shortcut-actionid-mapping.type";
|
|
4
|
+
import { WindowsShortcutActionIdMapping } from "./windows-shortcut-actionId-mapping";
|
|
5
|
+
import { OsxShortcutActionIdMapping } from "./osx-shortcut-actionId-mapping";
|
|
6
|
+
import { OnActionTriggeredIf } from "./on-action-triggered.if";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Represents a service for managing shortcuts and triggering actions based on keyboard events.
|
|
11
|
+
*/
|
|
12
|
+
export class ShortcutService {
|
|
13
|
+
|
|
14
|
+
private shortcutActionIdMapping: ShortcutActionIdMapping = {};
|
|
15
|
+
private listener: OnActionTriggeredIf[] = [];
|
|
16
|
+
|
|
17
|
+
constructor(
|
|
18
|
+
protected tableScope: TableScope
|
|
19
|
+
) {
|
|
20
|
+
this.listener.push(tableScope);
|
|
21
|
+
this.init();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Adds a listener to the list of listeners.
|
|
27
|
+
*
|
|
28
|
+
* @param {OnActionTriggeredIf} listener - The listener to be added.
|
|
29
|
+
* @returns {void}
|
|
30
|
+
*/
|
|
31
|
+
addListener(listener: OnActionTriggeredIf) {
|
|
32
|
+
if (!this.listener.includes(listener)) {
|
|
33
|
+
this.listener.push(listener);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Initializes the ShortcutService by assigning shortcut action id mappings based on the current operating system.
|
|
39
|
+
* Also adds key down event listener to the table host element.
|
|
40
|
+
*/
|
|
41
|
+
init() {
|
|
42
|
+
this.assignPredefinedSystemShortcutMappings();
|
|
43
|
+
|
|
44
|
+
// Overwrite predefined mapping with mapping from the table options:
|
|
45
|
+
Object.assign(this.shortcutActionIdMapping, this.tableScope.tableOptions.shortcutActionIdMapping);
|
|
46
|
+
|
|
47
|
+
if (this.isDebug()) {
|
|
48
|
+
console.debug("ShortcutService", this.shortcutActionIdMapping);
|
|
49
|
+
}
|
|
50
|
+
// add key down listener:
|
|
51
|
+
this.tableScope.hostElement.addEventListener("keydown", this.onKeyDown.bind(this));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
private assignPredefinedSystemShortcutMappings(){
|
|
55
|
+
if (this.isMacintosh()) {
|
|
56
|
+
Object.assign(this.shortcutActionIdMapping, new OsxShortcutActionIdMapping().get());
|
|
57
|
+
} else {
|
|
58
|
+
Object.assign(this.shortcutActionIdMapping, new WindowsShortcutActionIdMapping().get());
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
private isMacintosh() {
|
|
63
|
+
return navigator.platform.indexOf("Mac") > -1;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
private isDebug() {
|
|
67
|
+
return this.isLocalhost();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
private isLocalhost() {
|
|
71
|
+
return (location.hostname === "localhost" || location.hostname === "127.0.0.1");
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
private onKeyDown(evt: KeyboardEvent) {
|
|
76
|
+
const actionId = this.findEntity(evt);
|
|
77
|
+
if (actionId) {
|
|
78
|
+
const consumed = this.emit(actionId);
|
|
79
|
+
if (consumed) {
|
|
80
|
+
evt.preventDefault();
|
|
81
|
+
evt.stopPropagation();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
private emit(actionId: ActionId): boolean {
|
|
87
|
+
if (this.isDebug()) {
|
|
88
|
+
console.debug("ShortcutService emit :", actionId);
|
|
89
|
+
}
|
|
90
|
+
let ret = false;
|
|
91
|
+
for (const l of this.listener) {
|
|
92
|
+
const consumed = l.onActionTriggered(actionId);
|
|
93
|
+
if (consumed) {
|
|
94
|
+
ret = true;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return ret;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
private findEntity(evt: KeyboardEvent): ActionId | undefined {
|
|
101
|
+
const tokens = this.getTokenByEvent(evt);
|
|
102
|
+
if (this.isDebug()) {
|
|
103
|
+
console.debug("ShortcutService tokens :", tokens);
|
|
104
|
+
}
|
|
105
|
+
for (const key in this.shortcutActionIdMapping) {
|
|
106
|
+
const shortcutTokens = key
|
|
107
|
+
.replace(/opt/g, "alt")
|
|
108
|
+
.replace(/cmd/g, "meta")
|
|
109
|
+
.split(/[+ ]/g).sort();
|
|
110
|
+
|
|
111
|
+
if (this.areTokensEquals(tokens, shortcutTokens)) {
|
|
112
|
+
return this.shortcutActionIdMapping[key] as ActionId;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
private areTokensEquals(tokens1: string[], tokens2: string[]): boolean {
|
|
119
|
+
if (tokens1.length !== tokens2.length) {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
if (tokens1.length === 0) {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
for (let i = 0; i < tokens1.length; i++) {
|
|
126
|
+
if (tokens1[i] !== tokens2[i]) {
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return true;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
private getTokenByEvent(evt: KeyboardEvent): string[] {
|
|
135
|
+
const tokens: string[] = [];
|
|
136
|
+
if (evt.altKey) {
|
|
137
|
+
tokens.push("alt");
|
|
138
|
+
}
|
|
139
|
+
if (evt.shiftKey) {
|
|
140
|
+
tokens.push("shift");
|
|
141
|
+
}
|
|
142
|
+
if (evt.ctrlKey) {
|
|
143
|
+
tokens.push("ctrl");
|
|
144
|
+
}
|
|
145
|
+
if (evt.metaKey) {
|
|
146
|
+
tokens.push("meta");
|
|
147
|
+
}
|
|
148
|
+
if (evt.code) {
|
|
149
|
+
tokens.push(evt.code.toLowerCase().replace(/key/g, ""));
|
|
150
|
+
}
|
|
151
|
+
return tokens.sort();
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Retrieves the shortcut action mapping object.
|
|
156
|
+
*
|
|
157
|
+
* @returns {ShortcutActionIdMapping} - The shortcut action mapping object.
|
|
158
|
+
*/
|
|
159
|
+
getShortcutActionMapping(): ShortcutActionIdMapping {
|
|
160
|
+
return this.shortcutActionIdMapping;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ActionId } from "./action-id.type";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Class representing a mapping of Windows shortcut keys to action IDs.
|
|
5
|
+
*
|
|
6
|
+
* Use 'meta' for the MacOS 'cmd' key.
|
|
7
|
+
*/
|
|
8
|
+
export class WindowsShortcutActionIdMapping {
|
|
9
|
+
|
|
10
|
+
get(): { [key: string]: ActionId } {
|
|
11
|
+
return {
|
|
12
|
+
"f2": "START_EDITING",
|
|
13
|
+
|
|
14
|
+
"space": "TOGGLE_SELECTION",
|
|
15
|
+
|
|
16
|
+
"ctrl+num_add": "SELECT_ALL",
|
|
17
|
+
"ctrl+a": "SELECT_ALL",
|
|
18
|
+
|
|
19
|
+
"ctrl+shift+a": "DESELECT_ALL",
|
|
20
|
+
"ctrl+x": "DESELECT_ALL",
|
|
21
|
+
"ctrl+num_subtract": "DESELECT_ALL",
|
|
22
|
+
|
|
23
|
+
"meta -": "DESELECT_ALL",
|
|
24
|
+
|
|
25
|
+
"arrowup": "NAVIGATE_UP",
|
|
26
|
+
"arrowdown": "NAVIGATE_DOWN",
|
|
27
|
+
"arrowleft": "NAVIGATE_LEFT",
|
|
28
|
+
"arrowright": "NAVIGATE_RIGHT",
|
|
29
|
+
|
|
30
|
+
"meta+c": "COPY_2_CLIPBOARD",
|
|
31
|
+
"ctrl+c": "COPY_2_CLIPBOARD",
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CheckedType } from "../data/common/checked-type";
|
|
2
|
+
|
|
3
|
+
export interface CheckboxModelIf<T> {
|
|
4
|
+
|
|
5
|
+
getCheckedRows(): T[];
|
|
6
|
+
|
|
7
|
+
setCheckedRows(value: T[]): void;
|
|
8
|
+
|
|
9
|
+
addCheckedRows(value: T[]): void;
|
|
10
|
+
|
|
11
|
+
checkRow(row: T, check: boolean): void;
|
|
12
|
+
|
|
13
|
+
isRowChecked(row: T): CheckedType;
|
|
14
|
+
|
|
15
|
+
checkAll(value: T[]): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { CheckedType } from "../data/common/checked-type";
|
|
2
|
+
import { CheckboxModelIf } from "./checkbox-model.if";
|
|
3
|
+
|
|
4
|
+
export class CheckboxModel<T> implements CheckboxModelIf<T> {
|
|
5
|
+
|
|
6
|
+
protected checkedRows: Array<T> = [];
|
|
7
|
+
|
|
8
|
+
getCheckedRows(): T[] {
|
|
9
|
+
return this.checkedRows;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
setCheckedRows(rows: T[]) {
|
|
13
|
+
this.checkedRows = rows;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
addCheckedRows(rows: T[]) {
|
|
18
|
+
if (!this.checkedRows) {
|
|
19
|
+
this.checkedRows = [];
|
|
20
|
+
}
|
|
21
|
+
for (const row of rows) {
|
|
22
|
+
if (!this.checkedRows.includes(row)) {
|
|
23
|
+
this.checkedRows.push(row);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
checkRow(row: T, sel: boolean) {
|
|
29
|
+
if (!this.checkedRows) {
|
|
30
|
+
this.checkedRows = [];
|
|
31
|
+
}
|
|
32
|
+
if (sel) {
|
|
33
|
+
if (!this.checkedRows.includes(row)) {
|
|
34
|
+
this.checkedRows.push(row);
|
|
35
|
+
}
|
|
36
|
+
} else {
|
|
37
|
+
this.removeSelectedRow(row);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
isRowChecked(row: T): CheckedType {
|
|
43
|
+
if (this.checkedRows) {
|
|
44
|
+
return this.checkedRows.includes(row) ? "full" : "none";
|
|
45
|
+
}
|
|
46
|
+
return "none";
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
checkAll(_rows: T[]) {
|
|
50
|
+
this.checkedRows = [];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
private removeSelectedRow(row: T) {
|
|
54
|
+
if (this.checkedRows) {
|
|
55
|
+
const idx = this.checkedRows.indexOf(row);
|
|
56
|
+
if (idx > -1) {
|
|
57
|
+
this.checkedRows.splice(idx, 1);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
}
|