@ng-atomic/common 19.0.0-preview.8 → 19.1.1
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/directives/fallback-src/index.d.ts +12 -1
- package/directives/ios-safari-scroll-buggyfill/index.d.ts +18 -2
- package/directives/molecules/column/index.d.ts +70 -1
- package/directives/resize-column/index.d.ts +24 -1
- package/fesm2022/ng-atomic-common-directives-fallback-src.mjs +3 -3
- package/fesm2022/ng-atomic-common-directives-fallback-src.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-directives-ios-safari-scroll-buggyfill.mjs +7 -7
- package/fesm2022/ng-atomic-common-directives-ios-safari-scroll-buggyfill.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-directives-molecules-column.mjs +7 -7
- package/fesm2022/ng-atomic-common-directives-molecules-column.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-directives-resize-column.mjs +6 -6
- package/fesm2022/ng-atomic-common-directives-resize-column.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-interceptors-authorization.mjs +3 -3
- package/fesm2022/ng-atomic-common-interceptors-authorization.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-interceptors-throttle.mjs +6 -6
- package/fesm2022/ng-atomic-common-interceptors-throttle.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-interceptors-token.mjs +3 -3
- package/fesm2022/ng-atomic-common-interceptors-token.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-interceptors.mjs +4 -4
- package/fesm2022/ng-atomic-common-interceptors.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-models.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-actions.mjs +3 -3
- package/fesm2022/ng-atomic-common-pipes-actions.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-auto-columns.mjs +4 -4
- package/fesm2022/ng-atomic-common-pipes-auto-columns.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-columns.mjs +3 -3
- package/fesm2022/ng-atomic-common-pipes-columns.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-data-accessor.mjs +3 -3
- package/fesm2022/ng-atomic-common-pipes-data-accessor.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-domain.mjs +17 -7
- package/fesm2022/ng-atomic-common-pipes-domain.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-error.mjs +11 -6
- package/fesm2022/ng-atomic-common-pipes-error.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-expression.mjs +3 -3
- package/fesm2022/ng-atomic-common-pipes-expression.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-grouped-by.mjs +3 -3
- package/fesm2022/ng-atomic-common-pipes-grouped-by.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-index-length.mjs +3 -3
- package/fesm2022/ng-atomic-common-pipes-index-length.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-index.mjs +3 -3
- package/fesm2022/ng-atomic-common-pipes-index.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-keys.mjs +3 -3
- package/fesm2022/ng-atomic-common-pipes-keys.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-map.mjs +3 -3
- package/fesm2022/ng-atomic-common-pipes-map.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-page.mjs +3 -3
- package/fesm2022/ng-atomic-common-pipes-page.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-pagination.mjs +4 -4
- package/fesm2022/ng-atomic-common-pipes-pagination.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-query.mjs +4 -4
- package/fesm2022/ng-atomic-common-pipes-query.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-resolve-columns.mjs +3 -3
- package/fesm2022/ng-atomic-common-pipes-resolve-columns.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-secret.mjs +3 -3
- package/fesm2022/ng-atomic-common-pipes-secret.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-select-id.mjs +3 -3
- package/fesm2022/ng-atomic-common-pipes-select-id.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-signal.mjs +3 -3
- package/fesm2022/ng-atomic-common-pipes-signal.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-smart-field.mjs +7 -4
- package/fesm2022/ng-atomic-common-pipes-smart-field.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-sort-by.mjs +3 -3
- package/fesm2022/ng-atomic-common-pipes-sort-by.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-sort.mjs +3 -3
- package/fesm2022/ng-atomic-common-pipes-sort.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-style.mjs +3 -3
- package/fesm2022/ng-atomic-common-pipes-style.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-yen.mjs +3 -3
- package/fesm2022/ng-atomic-common-pipes-yen.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-app.mjs +6 -6
- package/fesm2022/ng-atomic-common-services-app.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-auth.mjs +29 -6
- package/fesm2022/ng-atomic-common-services-auth.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-breakpoint.mjs +3 -3
- package/fesm2022/ng-atomic-common-services-breakpoint.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-chips-manager.mjs +3 -3
- package/fesm2022/ng-atomic-common-services-chips-manager.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-csv.mjs +3 -3
- package/fesm2022/ng-atomic-common-services-csv.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-editing.mjs +56 -0
- package/fesm2022/ng-atomic-common-services-editing.mjs.map +1 -0
- package/fesm2022/ng-atomic-common-services-fab.mjs +3 -3
- package/fesm2022/ng-atomic-common-services-fab.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-form-_index.mjs +3 -3
- package/fesm2022/ng-atomic-common-services-form-_index.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-form-columns.mjs +3 -3
- package/fesm2022/ng-atomic-common-services-form-columns.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-form-json-schema.mjs +127 -19
- package/fesm2022/ng-atomic-common-services-form-json-schema.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-form-pagination.mjs +3 -3
- package/fesm2022/ng-atomic-common-services-form-pagination.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-form-sort.mjs +3 -3
- package/fesm2022/ng-atomic-common-services-form-sort.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-form.mjs +37 -2
- package/fesm2022/ng-atomic-common-services-form.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-initializer.mjs +3 -3
- package/fesm2022/ng-atomic-common-services-initializer.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-language.mjs +3 -3
- package/fesm2022/ng-atomic-common-services-language.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-loading.mjs +6 -6
- package/fesm2022/ng-atomic-common-services-loading.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-navigation-history.mjs +3 -3
- package/fesm2022/ng-atomic-common-services-navigation-history.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-query-resolver.mjs +7 -7
- package/fesm2022/ng-atomic-common-services-query-resolver.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-root-property.mjs +9 -9
- package/fesm2022/ng-atomic-common-services-root-property.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-router.mjs +3 -3
- package/fesm2022/ng-atomic-common-services-router.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-secret.mjs +3 -3
- package/fesm2022/ng-atomic-common-services-secret.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-sheets-actions.mjs +5 -5
- package/fesm2022/ng-atomic-common-services-sheets-actions.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-sheets.mjs +11 -14
- package/fesm2022/ng-atomic-common-services-sheets.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-side-app.mjs +6 -6
- package/fesm2022/ng-atomic-common-services-side-app.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-side-nav-mode.mjs +3 -3
- package/fesm2022/ng-atomic-common-services-side-nav-mode.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-snack-bar.mjs +7 -7
- package/fesm2022/ng-atomic-common-services-snack-bar.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-spreadsheet.mjs +433 -197
- package/fesm2022/ng-atomic-common-services-spreadsheet.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-ui.mjs +45 -19
- package/fesm2022/ng-atomic-common-services-ui.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-stores-entities.mjs +19 -18
- package/fesm2022/ng-atomic-common-stores-entities.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-stores-entity.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-stores-pagination.mjs +3 -3
- package/fesm2022/ng-atomic-common-stores-pagination.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-stores-query.mjs +3 -3
- package/fesm2022/ng-atomic-common-stores-query.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-stores-selection.mjs +3 -3
- package/fesm2022/ng-atomic-common-stores-selection.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-stores-sort.mjs +3 -3
- package/fesm2022/ng-atomic-common-stores-sort.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-utils.mjs +22 -12
- package/fesm2022/ng-atomic-common-utils.mjs.map +1 -1
- package/fesm2022/ng-atomic-common.mjs +340 -50
- package/fesm2022/ng-atomic-common.mjs.map +1 -1
- package/index.d.ts +111 -1
- package/interceptors/authorization/index.d.ts +20 -1
- package/interceptors/index.d.ts +10 -1
- package/interceptors/throttle/index.d.ts +25 -1
- package/interceptors/token/index.d.ts +17 -1
- package/models/index.d.ts +32 -11
- package/package.json +15 -35
- package/pipes/actions/index.d.ts +11 -1
- package/pipes/auto-columns/index.d.ts +10 -1
- package/pipes/columns/index.d.ts +12 -1
- package/pipes/data-accessor/index.d.ts +23 -1
- package/pipes/domain/index.d.ts +72 -1
- package/pipes/error/index.d.ts +21 -1
- package/pipes/expression/index.d.ts +13 -1
- package/pipes/grouped-by/index.d.ts +13 -1
- package/pipes/index/index.d.ts +17 -1
- package/pipes/index-length/index.d.ts +15 -1
- package/pipes/keys/index.d.ts +12 -1
- package/pipes/map/index.d.ts +10 -1
- package/pipes/page/index.d.ts +14 -1
- package/pipes/pagination/index.d.ts +28 -1
- package/pipes/query/index.d.ts +14 -1
- package/pipes/resolve-columns/index.d.ts +14 -1
- package/pipes/secret/index.d.ts +11 -1
- package/pipes/select-id/index.d.ts +16 -1
- package/pipes/signal/index.d.ts +15 -1
- package/pipes/smart-field/index.d.ts +102 -1
- package/pipes/sort/index.d.ts +11 -1
- package/pipes/sort-by/index.d.ts +20 -1
- package/pipes/style/index.d.ts +22 -1
- package/pipes/yen/index.d.ts +10 -1
- package/services/app/index.d.ts +37 -1
- package/services/auth/index.d.ts +56 -1
- package/services/breakpoint/index.d.ts +35 -1
- package/services/chips-manager/index.d.ts +14 -1
- package/services/csv/index.d.ts +9 -1
- package/services/editing/index.d.ts +30 -0
- package/services/fab/index.d.ts +22 -1
- package/services/form/_index/index.d.ts +61 -1
- package/services/form/columns/index.d.ts +68 -1
- package/services/form/index.d.ts +34 -1
- package/services/form/json-schema/index.d.ts +73 -1
- package/services/form/pagination/index.d.ts +21 -1
- package/services/form/sort/index.d.ts +21 -1
- package/services/initializer/index.d.ts +24 -1
- package/services/language/index.d.ts +16 -1
- package/services/loading/index.d.ts +33 -1
- package/services/navigation-history/index.d.ts +17 -1
- package/services/query-resolver/index.d.ts +32 -1
- package/services/root-property/index.d.ts +100 -2
- package/services/router/index.d.ts +15 -1
- package/services/secret/index.d.ts +9 -1
- package/services/sheets/actions/index.d.ts +12 -1
- package/services/sheets/index.d.ts +20 -2
- package/services/side-app/index.d.ts +24 -1
- package/services/side-nav-mode/index.d.ts +16 -1
- package/services/snack-bar/index.d.ts +22 -2
- package/services/spreadsheet/index.d.ts +307 -4
- package/services/ui/index.d.ts +104 -2
- package/stores/entities/index.d.ts +169 -6
- package/stores/entity/index.d.ts +31 -1
- package/stores/pagination/index.d.ts +24 -1
- package/stores/query/index.d.ts +22 -1
- package/stores/selection/index.d.ts +28 -1
- package/stores/sort/index.d.ts +25 -1
- package/utils/index.d.ts +236 -13
- package/common.module.d.ts +0 -15
- package/directives/fallback-src/fallback-src.directive.d.ts +0 -9
- package/directives/ios-safari-scroll-buggyfill/ios-safari-scroll-buggyfill.directive.d.ts +0 -8
- package/directives/ios-safari-scroll-buggyfill/ios-safari-scroll-buggyfill.module.d.ts +0 -8
- package/directives/molecules/column/column.molecule.d.ts +0 -67
- package/directives/resize-column/resize-column.directive.d.ts +0 -21
- package/directives/resize-column/resize-handle.component.d.ts +0 -5
- package/interceptors/authorization/authorization.interceptor.d.ts +0 -16
- package/interceptors/interceptors.module.d.ts +0 -7
- package/interceptors/throttle/throttle.interceptor.d.ts +0 -23
- package/interceptors/token/authorization.interceptor.d.ts +0 -13
- package/models/menu-item.d.ts +0 -4
- package/pipes/actions/actions.pipe.d.ts +0 -8
- package/pipes/auto-columns/auto-columns.pipe.d.ts +0 -7
- package/pipes/columns/columns.pipe.d.ts +0 -9
- package/pipes/data-accessor/data-accessor.pipe.d.ts +0 -19
- package/pipes/domain/domain.pipe.d.ts +0 -59
- package/pipes/error/error.pipe.d.ts +0 -16
- package/pipes/expression/expression.pipe.d.ts +0 -9
- package/pipes/grouped-by/grouped-by.pipe.d.ts +0 -10
- package/pipes/index/index.pipe.d.ts +0 -11
- package/pipes/index-length/index-length.pipe.d.ts +0 -10
- package/pipes/keys/keys.pipe.d.ts +0 -9
- package/pipes/map/map.pipe.d.ts +0 -7
- package/pipes/page/page.pipe.d.ts +0 -11
- package/pipes/pagination/pagination.pipe.d.ts +0 -25
- package/pipes/query/query.pipe.d.ts +0 -11
- package/pipes/resolve-columns/resolve-columns.pipe.d.ts +0 -11
- package/pipes/secret/secret.pipe.d.ts +0 -8
- package/pipes/select-id/select-id.pipe.d.ts +0 -12
- package/pipes/signal/signal.pipe.d.ts +0 -11
- package/pipes/smart-field/smart-field.pipe.d.ts +0 -98
- package/pipes/sort/sort.pipe.d.ts +0 -8
- package/pipes/sort-by/sort-by.pipe.d.ts +0 -17
- package/pipes/style/style.pipe.d.ts +0 -18
- package/pipes/yen/yen.pipe.d.ts +0 -7
- package/services/app/app.service.d.ts +0 -34
- package/services/auth/auth.service.d.ts +0 -48
- package/services/breakpoint/breakpoint.service.d.ts +0 -29
- package/services/chips-manager/chips.manager.d.ts +0 -11
- package/services/csv/csv.service.d.ts +0 -6
- package/services/fab/fab.service.d.ts +0 -18
- package/services/form/_index/index.service.d.ts +0 -64
- package/services/form/columns/columns.service.d.ts +0 -63
- package/services/form/form.service.d.ts +0 -7
- package/services/form/json-schema/json-schema.d.ts +0 -2
- package/services/form/json-schema/json-schema.service.d.ts +0 -65
- package/services/form/pagination/pagination.service.d.ts +0 -16
- package/services/form/sort/sort.service.d.ts +0 -17
- package/services/initializer/initializer.service.d.ts +0 -22
- package/services/language/language.service.d.ts +0 -12
- package/services/loading/loading.service.d.ts +0 -30
- package/services/navigation-history/navigation-history.service.d.ts +0 -14
- package/services/query-resolver/query-resolver.service.d.ts +0 -27
- package/services/root-property/root-property.di.d.ts +0 -1
- package/services/root-property/root-property.service.d.ts +0 -94
- package/services/router/router.service.d.ts +0 -10
- package/services/secret/secret.service.d.ts +0 -6
- package/services/sheets/actions/actions.sheet.d.ts +0 -9
- package/services/sheets/sheets.module.d.ts +0 -11
- package/services/sheets/sheets.service.d.ts +0 -10
- package/services/side-app/side-app.service.d.ts +0 -21
- package/services/side-nav-mode/side-nav-mode.service.d.ts +0 -12
- package/services/snack-bar/snack-bar.module.d.ts +0 -8
- package/services/snack-bar/snack-bar.service.d.ts +0 -11
- package/services/spreadsheet/directives/grid-cell.directive.d.ts +0 -41
- package/services/spreadsheet/directives/index.d.ts +0 -1
- package/services/spreadsheet/features/clipboard.service.d.ts +0 -15
- package/services/spreadsheet/features/data.service.d.ts +0 -16
- package/services/spreadsheet/features/editor.service.d.ts +0 -22
- package/services/spreadsheet/features/grid.service.d.ts +0 -17
- package/services/spreadsheet/features/index.d.ts +0 -7
- package/services/spreadsheet/features/navigation.service.d.ts +0 -17
- package/services/spreadsheet/features/protection.service.d.ts +0 -24
- package/services/spreadsheet/features/selection.service.d.ts +0 -40
- package/services/spreadsheet/models/cell.model.d.ts +0 -17
- package/services/spreadsheet/models/index.d.ts +0 -1
- package/services/spreadsheet/spreadsheet.service.d.ts +0 -29
- package/services/ui/ui.helpers.d.ts +0 -32
- package/services/ui/ui.service.d.ts +0 -22
- package/stores/entities/di.d.ts +0 -23
- package/stores/entities/entity-store-adapter.d.ts +0 -28
- package/stores/entities/entity-store-manager.d.ts +0 -12
- package/stores/entities/entity-store.d.ts +0 -71
- package/stores/entities/proxy-id.service.d.ts +0 -10
- package/stores/entities/task-composer.d.ts +0 -35
- package/stores/entity/entity.store.d.ts +0 -26
- package/stores/pagination/pagination.store.d.ts +0 -19
- package/stores/query/query.store.d.ts +0 -17
- package/stores/selection/selection.store.d.ts +0 -23
- package/stores/sort/sort.store.d.ts +0 -20
- package/utils/comma/comma.d.ts +0 -3
- package/utils/comma/index.d.ts +0 -1
- package/utils/compare-by-id/compare-by-id.d.ts +0 -5
- package/utils/compare-by-id/index.d.ts +0 -1
- package/utils/date-utils/date-utils.d.ts +0 -10
- package/utils/date-utils/index.d.ts +0 -1
- package/utils/diff/diff.d.ts +0 -5
- package/utils/diff/index.d.ts +0 -1
- package/utils/expression/expression.transformer.d.ts +0 -12
- package/utils/expression/index.d.ts +0 -1
- package/utils/form/form.d.ts +0 -10
- package/utils/form/index.d.ts +0 -1
- package/utils/get/get.d.ts +0 -6
- package/utils/get/index.d.ts +0 -1
- package/utils/inject/index.d.ts +0 -1
- package/utils/inject/inject.d.ts +0 -76
- package/utils/mat-dayjs-date/dayjs-date.adapter.d.ts +0 -60
- package/utils/mat-dayjs-date/dayjs-date.formats.d.ts +0 -5
- package/utils/mat-dayjs-date/dayjs-date.module.d.ts +0 -8
- package/utils/mat-dayjs-date/dayjs-jp-providers.d.ts +0 -10
- package/utils/mat-dayjs-date/index.d.ts +0 -4
- package/utils/page/index.d.ts +0 -1
- package/utils/page/page.d.ts +0 -11
- package/utils/router/index.d.ts +0 -1
- package/utils/router/router.d.ts +0 -4
- package/utils/time.d.ts +0 -1
- package/utils/to-object/index.d.ts +0 -1
- package/utils/to-object/to-object.d.ts +0 -1
|
@@ -1,48 +1,32 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { signal,
|
|
2
|
+
import { signal, Injectable, inject, computed, effect, InjectionToken, ElementRef, input, Directive, Renderer2, output, HostListener, Component, ViewContainerRef } from '@angular/core';
|
|
3
3
|
import { isEqual } from 'lodash-es';
|
|
4
4
|
import { Clipboard } from '@angular/cdk/clipboard';
|
|
5
|
-
import papaparse from 'papaparse';
|
|
6
5
|
import { SnackBarService } from '@ng-atomic/common/services/snack-bar';
|
|
7
|
-
import { LanguageService } from '@ng-atomic/common/services/language';
|
|
8
6
|
import { injectDataAccessor } from '@ng-atomic/common/pipes/data-accessor';
|
|
9
7
|
import { EXPRESSION_TRANSFORMER } from '@ng-atomic/common/utils';
|
|
8
|
+
import { LanguageService } from '@ng-atomic/common/services/language';
|
|
9
|
+
import papaparse from 'papaparse';
|
|
10
|
+
import { EditingStateManager } from '@ng-atomic/common/services/editing';
|
|
11
|
+
|
|
12
|
+
class SpreadSheetDataService {
|
|
13
|
+
constructor() {
|
|
14
|
+
this.displayedColumns = signal([]);
|
|
15
|
+
this.items = signal([]);
|
|
16
|
+
}
|
|
17
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: SpreadSheetDataService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
18
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: SpreadSheetDataService }); }
|
|
19
|
+
}
|
|
20
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: SpreadSheetDataService, decorators: [{
|
|
21
|
+
type: Injectable
|
|
22
|
+
}] });
|
|
10
23
|
|
|
11
24
|
class GridService {
|
|
12
25
|
constructor() {
|
|
13
|
-
this.data = signal([[]]);
|
|
14
|
-
this.columns = computed(() => Array.from({ length: this.data()[0].length }, (_, i) => String.fromCharCode(65 + i)));
|
|
15
26
|
this.contextMap = new Map();
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
this.
|
|
19
|
-
data[row][col] = {
|
|
20
|
-
dataValue: value,
|
|
21
|
-
expressionValue: value,
|
|
22
|
-
};
|
|
23
|
-
return [...data];
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
getValue(position) {
|
|
27
|
-
return this.getCell(position)?.dataValue ?? null;
|
|
28
|
-
}
|
|
29
|
-
getExpressionValue(position) {
|
|
30
|
-
return this.getCell(position)?.expressionValue ?? null;
|
|
31
|
-
}
|
|
32
|
-
getCell(position) {
|
|
33
|
-
return this.data()[position.row]?.[position.col] ?? null;
|
|
34
|
-
}
|
|
35
|
-
updateAllCells(predicate, updates) {
|
|
36
|
-
this.data.update(data => {
|
|
37
|
-
for (let i = 0; i < data.length; i++) {
|
|
38
|
-
for (let j = 0; j < data[0].length; j++) {
|
|
39
|
-
if (predicate(data[i][j])) {
|
|
40
|
-
data[i][j] = { ...data[i][j], ...updates };
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return [...data];
|
|
45
|
-
});
|
|
27
|
+
this.data = inject(SpreadSheetDataService);
|
|
28
|
+
this.maxCol = computed(() => this.data.displayedColumns().length - 1);
|
|
29
|
+
this.maxRow = computed(() => this.data.items().length);
|
|
46
30
|
}
|
|
47
31
|
setContext(context) {
|
|
48
32
|
this.contextMap.set(this.buildKey(context.position), context);
|
|
@@ -53,39 +37,37 @@ class GridService {
|
|
|
53
37
|
buildKey(position) {
|
|
54
38
|
return `(${position.row}, ${position.col})`;
|
|
55
39
|
}
|
|
56
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
57
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
40
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: GridService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
41
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: GridService }); }
|
|
58
42
|
}
|
|
59
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: GridService, decorators: [{
|
|
60
44
|
type: Injectable
|
|
61
45
|
}] });
|
|
62
46
|
|
|
63
47
|
class NavigationService {
|
|
64
|
-
constructor(
|
|
65
|
-
this.gridService =
|
|
48
|
+
constructor() {
|
|
49
|
+
this.gridService = inject(GridService);
|
|
66
50
|
}
|
|
67
51
|
moveToNextCell({ row, col }) {
|
|
68
|
-
|
|
69
|
-
if (col < columns.length - 1) {
|
|
52
|
+
if (col < this.gridService.maxCol()) {
|
|
70
53
|
return { row, col: col + 1 };
|
|
71
54
|
}
|
|
72
|
-
else if (row < this.gridService.
|
|
55
|
+
else if (row < this.gridService.maxRow()) {
|
|
73
56
|
return { row: row + 1, col: 0 };
|
|
74
57
|
}
|
|
75
58
|
return { row, col };
|
|
76
59
|
}
|
|
77
60
|
moveToPreviousCell({ row, col }) {
|
|
78
|
-
const columns = this.gridService.columns();
|
|
79
61
|
if (col > 0) {
|
|
80
62
|
return { row, col: col - 1 };
|
|
81
63
|
}
|
|
82
64
|
else if (row > 0) {
|
|
83
|
-
return { row: row - 1, col:
|
|
65
|
+
return { row: row - 1, col: this.gridService.maxCol() };
|
|
84
66
|
}
|
|
85
67
|
return { row, col };
|
|
86
68
|
}
|
|
87
69
|
moveToNextRow({ row, col }) {
|
|
88
|
-
if (row < this.gridService.
|
|
70
|
+
if (row < this.gridService.maxRow()) {
|
|
89
71
|
return { row: row + 1, col };
|
|
90
72
|
}
|
|
91
73
|
return { row, col };
|
|
@@ -96,8 +78,9 @@ class NavigationService {
|
|
|
96
78
|
}
|
|
97
79
|
return { row, col };
|
|
98
80
|
}
|
|
99
|
-
moveRight(
|
|
100
|
-
|
|
81
|
+
moveRight(position) {
|
|
82
|
+
const { row, col } = position;
|
|
83
|
+
if (col < this.gridService.maxCol()) {
|
|
101
84
|
return { row, col: col + 1 };
|
|
102
85
|
}
|
|
103
86
|
return { row, col };
|
|
@@ -115,20 +98,21 @@ class NavigationService {
|
|
|
115
98
|
return { row, col };
|
|
116
99
|
}
|
|
117
100
|
moveDown({ row, col }) {
|
|
118
|
-
if (row < this.gridService.
|
|
101
|
+
if (row < this.gridService.maxRow()) {
|
|
119
102
|
return { row: row + 1, col };
|
|
120
103
|
}
|
|
121
104
|
return { row, col };
|
|
122
105
|
}
|
|
123
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
124
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
106
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: NavigationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
107
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: NavigationService }); }
|
|
125
108
|
}
|
|
126
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
109
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: NavigationService, decorators: [{
|
|
127
110
|
type: Injectable
|
|
128
|
-
}]
|
|
111
|
+
}] });
|
|
129
112
|
|
|
130
113
|
class SelectionService {
|
|
131
114
|
constructor() {
|
|
115
|
+
this.data = inject(SpreadSheetDataService);
|
|
132
116
|
this.selection = signal({ start: { row: 1, col: 0 }, end: null });
|
|
133
117
|
this.selectionStart = computed(() => this.selection().start, { equal: isEqual });
|
|
134
118
|
this.isMouseDown = signal(false);
|
|
@@ -192,17 +176,6 @@ class SelectionService {
|
|
|
192
176
|
getSelectionEndOrStart() {
|
|
193
177
|
return this.selection()?.end || this.selection()?.start;
|
|
194
178
|
}
|
|
195
|
-
findSelectedCell() {
|
|
196
|
-
const data = this.grid.data();
|
|
197
|
-
for (let i = 0; i < data.length; i++) {
|
|
198
|
-
for (let j = 0; j < data[i].length; j++) {
|
|
199
|
-
if (this.isSelected({ row: i, col: j })) {
|
|
200
|
-
return { row: i, col: j };
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
return null;
|
|
205
|
-
}
|
|
206
179
|
updateSelectionEnd(position) {
|
|
207
180
|
this.selection.update((selection) => ({ ...selection, end: position }));
|
|
208
181
|
}
|
|
@@ -215,18 +188,6 @@ class SelectionService {
|
|
|
215
188
|
}
|
|
216
189
|
}
|
|
217
190
|
clearSelectedRange(selection) {
|
|
218
|
-
const minRow = Math.min(selection.start.row, selection.end.row);
|
|
219
|
-
const maxRow = Math.max(selection.start.row, selection.end.row);
|
|
220
|
-
const minCol = Math.min(selection.start.col, selection.end.col);
|
|
221
|
-
const maxCol = Math.max(selection.start.col, selection.end.col);
|
|
222
|
-
for (let i = minRow; i <= maxRow; i++) {
|
|
223
|
-
for (let j = minCol; j <= maxCol; j++) {
|
|
224
|
-
this.grid.updateCell(i, j, {
|
|
225
|
-
dataValue: '',
|
|
226
|
-
expressionValue: ''
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
191
|
}
|
|
231
192
|
setCell(position, el) {
|
|
232
193
|
this.cellElMap.set(`${this.buildKey(position)}`, el);
|
|
@@ -245,74 +206,66 @@ class SelectionService {
|
|
|
245
206
|
buildKey(position) {
|
|
246
207
|
return `(${position.row}, ${position.col})`;
|
|
247
208
|
}
|
|
248
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
249
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
209
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: SelectionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
210
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: SelectionService }); }
|
|
250
211
|
}
|
|
251
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
212
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: SelectionService, decorators: [{
|
|
252
213
|
type: Injectable
|
|
253
214
|
}], ctorParameters: () => [] });
|
|
254
215
|
|
|
255
216
|
class ClipboardService {
|
|
256
|
-
constructor(
|
|
257
|
-
this.gridService = gridService;
|
|
217
|
+
constructor(selectionService) {
|
|
258
218
|
this.selectionService = selectionService;
|
|
259
219
|
this.clipboard = inject(Clipboard);
|
|
260
220
|
this.snackBar = inject(SnackBarService);
|
|
221
|
+
this.data = inject(SpreadSheetDataService);
|
|
222
|
+
this.dataAccessor = injectDataAccessor();
|
|
223
|
+
this.expression = inject(EXPRESSION_TRANSFORMER);
|
|
224
|
+
this.language = inject(LanguageService);
|
|
225
|
+
}
|
|
226
|
+
buildGridData(range) {
|
|
227
|
+
const header = this.data.displayedColumns().map(column => ({
|
|
228
|
+
dataValue: this.language.transform(column),
|
|
229
|
+
expressionValue: this.language.transform(column),
|
|
230
|
+
isHeader: true
|
|
231
|
+
}));
|
|
232
|
+
const rows = this.data.items().map(item => this.data.displayedColumns().map(column => ({
|
|
233
|
+
dataValue: this.dataAccessor(item, column),
|
|
234
|
+
expressionValue: this.expression(this.dataAccessor(item, column), { item, name: column }),
|
|
235
|
+
})));
|
|
236
|
+
const fullData = [header, ...rows];
|
|
237
|
+
return fullData.slice(range.minRow, range.maxRow + 1).map(row => row.slice(range.minCol, range.maxCol + 1));
|
|
261
238
|
}
|
|
262
239
|
async copy() {
|
|
263
240
|
const selection = this.selectionService.getSelection();
|
|
264
241
|
if (!selection)
|
|
265
242
|
return;
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
this.copyText(this.gridService.data()[start.row][start.col].dataValue);
|
|
269
|
-
return;
|
|
270
|
-
}
|
|
243
|
+
let { start, end } = selection;
|
|
244
|
+
end = end ?? start;
|
|
271
245
|
const minRow = Math.min(start.row, end.row);
|
|
272
246
|
const maxRow = Math.max(start.row, end.row);
|
|
273
247
|
const minCol = Math.min(start.col, end.col);
|
|
274
248
|
const maxCol = Math.max(start.col, end.col);
|
|
275
|
-
const
|
|
276
|
-
const
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
clipboardData.push(row);
|
|
283
|
-
}
|
|
284
|
-
const tsv = papaparse.unparse(clipboardData, { delimiter: '\t', newline: '\n', header: false });
|
|
285
|
-
this.clipboard.copy(tsv);
|
|
249
|
+
const selectedData = this.buildGridData({ minRow, maxRow, minCol, maxCol });
|
|
250
|
+
const tsv = papaparse.unparse(selectedData.map(row => row.map(cell => cell.dataValue)), { delimiter: "\t", newline: "\n", header: false });
|
|
251
|
+
this.copyText(tsv);
|
|
252
|
+
}
|
|
253
|
+
setData(items, displayedColumns) {
|
|
254
|
+
this.data.displayedColumns.set(displayedColumns);
|
|
255
|
+
this.data.items.set(items);
|
|
286
256
|
}
|
|
287
257
|
copyText(text) {
|
|
288
258
|
this.clipboard.copy(text);
|
|
289
259
|
this.snackBar.open('クリップボードにコピーしました。');
|
|
290
260
|
}
|
|
291
261
|
async paste(targetRow, targetCol) {
|
|
292
|
-
try {
|
|
293
|
-
const clipboardText = await navigator.clipboard.readText();
|
|
294
|
-
const rows = clipboardText.split('\n');
|
|
295
|
-
const data = this.gridService.data();
|
|
296
|
-
const rowCount = Math.min(rows.length, data.length - targetRow);
|
|
297
|
-
for (let i = 0; i < rowCount; i++) {
|
|
298
|
-
const cells = rows[i].split('\t');
|
|
299
|
-
const colCount = Math.min(cells.length, this.gridService.columns().length - targetCol);
|
|
300
|
-
for (let j = 0; j < colCount; j++) {
|
|
301
|
-
this.gridService.updateCell(targetRow + i, targetCol + j, cells[j]);
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
console.log('Data pasted from clipboard as TSV');
|
|
305
|
-
}
|
|
306
|
-
catch (err) {
|
|
307
|
-
console.error('Failed to read data from clipboard', err);
|
|
308
|
-
}
|
|
309
262
|
}
|
|
310
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
311
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
263
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: ClipboardService, deps: [{ token: SelectionService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
264
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: ClipboardService }); }
|
|
312
265
|
}
|
|
313
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
266
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: ClipboardService, decorators: [{
|
|
314
267
|
type: Injectable
|
|
315
|
-
}], ctorParameters: () => [{ type:
|
|
268
|
+
}], ctorParameters: () => [{ type: SelectionService }] });
|
|
316
269
|
|
|
317
270
|
const COLUMN_PROTECTOR = new InjectionToken('COLUMN_PROTECTOR', {
|
|
318
271
|
providedIn: 'root',
|
|
@@ -330,18 +283,20 @@ class ProtectionService {
|
|
|
330
283
|
return true;
|
|
331
284
|
return this.protectors.every((protector) => protector(value, context));
|
|
332
285
|
}
|
|
333
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
334
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
286
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: ProtectionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
287
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: ProtectionService }); }
|
|
335
288
|
}
|
|
336
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
289
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: ProtectionService, decorators: [{
|
|
337
290
|
type: Injectable
|
|
338
291
|
}] });
|
|
339
292
|
|
|
340
293
|
class EditorService {
|
|
341
294
|
constructor() {
|
|
295
|
+
this.data = inject(SpreadSheetDataService);
|
|
342
296
|
this.grid = inject(GridService);
|
|
343
297
|
this.selection = inject(SelectionService);
|
|
344
298
|
this.protection = inject(ProtectionService);
|
|
299
|
+
this.editingStateManager = inject(EditingStateManager);
|
|
345
300
|
this.editinngCell = signal(null);
|
|
346
301
|
this.inputMap = new Map();
|
|
347
302
|
}
|
|
@@ -356,9 +311,18 @@ class EditorService {
|
|
|
356
311
|
}
|
|
357
312
|
this.selection.clearSelection();
|
|
358
313
|
this.editinngCell.set(position);
|
|
314
|
+
// Notify EditingStateManager about editing start
|
|
315
|
+
const columnId = this.data.displayedColumns()[position.col];
|
|
316
|
+
this.editingStateManager.startEditing(position.row, columnId);
|
|
359
317
|
this.focus(position);
|
|
360
318
|
}
|
|
361
319
|
stopEditing() {
|
|
320
|
+
const editingCell = this.editinngCell();
|
|
321
|
+
if (editingCell) {
|
|
322
|
+
// Notify EditingStateManager about editing stop
|
|
323
|
+
const columnId = this.data.displayedColumns()[editingCell.col];
|
|
324
|
+
this.editingStateManager.stopEditing(editingCell.row, columnId);
|
|
325
|
+
}
|
|
362
326
|
this.editinngCell.set(null);
|
|
363
327
|
}
|
|
364
328
|
focus(position) {
|
|
@@ -371,9 +335,8 @@ class EditorService {
|
|
|
371
335
|
});
|
|
372
336
|
}
|
|
373
337
|
getEditingCell() {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
for (let j = 0; j < data[i].length; j++) {
|
|
338
|
+
for (let i = 0; i < this.data.items().length; i++) {
|
|
339
|
+
for (let j = 0; j < this.data.displayedColumns().length; j++) {
|
|
377
340
|
if (this.isEditing({ row: i, col: j })) {
|
|
378
341
|
return { row: i, col: j };
|
|
379
342
|
}
|
|
@@ -390,68 +353,73 @@ class EditorService {
|
|
|
390
353
|
buildKey(position) {
|
|
391
354
|
return `(${position.row}, ${position.col})`;
|
|
392
355
|
}
|
|
393
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
394
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
356
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: EditorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
357
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: EditorService }); }
|
|
395
358
|
}
|
|
396
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
359
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: EditorService, decorators: [{
|
|
397
360
|
type: Injectable
|
|
398
361
|
}] });
|
|
399
362
|
|
|
400
|
-
class
|
|
363
|
+
class AutoFillService {
|
|
401
364
|
constructor() {
|
|
402
|
-
this.
|
|
403
|
-
this.
|
|
404
|
-
this.
|
|
405
|
-
this.
|
|
365
|
+
this.autofillMode = signal(false);
|
|
366
|
+
this.sourcePosition = signal(null);
|
|
367
|
+
this.targetRange = signal(null);
|
|
368
|
+
this.previewElements = new Set();
|
|
369
|
+
this.isAutofillMode = this.autofillMode.asReadonly();
|
|
370
|
+
this.getSourcePosition = this.sourcePosition.asReadonly();
|
|
371
|
+
this.getTargetRange = this.targetRange.asReadonly();
|
|
372
|
+
}
|
|
373
|
+
startAutofill(position) {
|
|
374
|
+
this.autofillMode.set(true);
|
|
375
|
+
this.sourcePosition.set(position);
|
|
376
|
+
this.targetRange.set({ start: position, end: position });
|
|
377
|
+
}
|
|
378
|
+
updateAutofillRange(endPosition) {
|
|
379
|
+
const sourcePos = this.sourcePosition();
|
|
380
|
+
if (sourcePos) {
|
|
381
|
+
this.targetRange.set({ start: sourcePos, end: endPosition });
|
|
382
|
+
this.updatePreview();
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
cancelAutofill() {
|
|
386
|
+
this.resetAutofill();
|
|
387
|
+
}
|
|
388
|
+
updatePreview() {
|
|
389
|
+
// 既存のプレビューをクリア
|
|
390
|
+
this.clearPreview();
|
|
391
|
+
const range = this.targetRange();
|
|
392
|
+
if (!range)
|
|
393
|
+
return;
|
|
394
|
+
// 影響を受けるセルにプレビュークラスを追加
|
|
395
|
+
for (let row = range.start.row + 1; row <= range.end.row; row++) {
|
|
396
|
+
const position = { row, col: range.start.col };
|
|
397
|
+
const cellElement = this.getCellElement(position);
|
|
398
|
+
if (cellElement) {
|
|
399
|
+
cellElement.classList.add('autofill-preview');
|
|
400
|
+
this.previewElements.add(cellElement);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
406
403
|
}
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
}
|
|
413
|
-
buildGridHeaderRow(columns) {
|
|
414
|
-
const key = this.buildKey({ columns });
|
|
415
|
-
const cached = this.cache.get(key);
|
|
416
|
-
if (cached)
|
|
417
|
-
return cached;
|
|
418
|
-
const row = columns.map((column) => ({
|
|
419
|
-
dataValue: this.language.transform(column),
|
|
420
|
-
expressionValue: this.language.transform(column),
|
|
421
|
-
isHeader: true
|
|
422
|
-
}));
|
|
423
|
-
this.cache.set(key, row);
|
|
424
|
-
return row;
|
|
425
|
-
}
|
|
426
|
-
buildGridRow(item, displayedColumns) {
|
|
427
|
-
const key = this.buildKey({ item, displayedColumns });
|
|
428
|
-
const cached = this.cache.get(key);
|
|
429
|
-
if (cached)
|
|
430
|
-
return cached;
|
|
431
|
-
const row = displayedColumns.map((column) => this.buildGridCell(item, column));
|
|
432
|
-
this.cache.set(key, row);
|
|
433
|
-
return row;
|
|
434
|
-
}
|
|
435
|
-
buildGridCell(item, column) {
|
|
436
|
-
const key = this.buildKey({ item, column });
|
|
437
|
-
const cached = this.cache.get(key);
|
|
438
|
-
if (cached)
|
|
439
|
-
return cached;
|
|
440
|
-
const cell = {
|
|
441
|
-
dataValue: this.dataAccessor(item, column),
|
|
442
|
-
expressionValue: this.expression(this.dataAccessor(item, column), { item, name: column }),
|
|
443
|
-
};
|
|
444
|
-
this.cache.set(key, cell);
|
|
445
|
-
return cell;
|
|
404
|
+
clearPreview() {
|
|
405
|
+
this.previewElements.forEach(element => {
|
|
406
|
+
element.classList.remove('autofill-preview');
|
|
407
|
+
});
|
|
408
|
+
this.previewElements.clear();
|
|
446
409
|
}
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
return JSON.stringify(obj);
|
|
410
|
+
getCellElement(position) {
|
|
411
|
+
return document.querySelector(`[data-row="${position.row}"][data-col="${position.col}"]`);
|
|
450
412
|
}
|
|
451
|
-
|
|
452
|
-
|
|
413
|
+
resetAutofill() {
|
|
414
|
+
this.clearPreview();
|
|
415
|
+
this.autofillMode.set(false);
|
|
416
|
+
this.sourcePosition.set(null);
|
|
417
|
+
this.targetRange.set(null);
|
|
418
|
+
}
|
|
419
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: AutoFillService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
420
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: AutoFillService }); }
|
|
453
421
|
}
|
|
454
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
422
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: AutoFillService, decorators: [{
|
|
455
423
|
type: Injectable
|
|
456
424
|
}] });
|
|
457
425
|
|
|
@@ -459,12 +427,13 @@ class SpreadSheetService {
|
|
|
459
427
|
constructor() {
|
|
460
428
|
this.config = { paste: false };
|
|
461
429
|
this.grid = inject(GridService);
|
|
462
|
-
|
|
430
|
+
// readonly data = inject(SpreadSheetDataService);
|
|
463
431
|
this.navigation = inject(NavigationService);
|
|
464
432
|
this.selection = inject(SelectionService);
|
|
465
433
|
this.clipboard = inject(ClipboardService);
|
|
466
434
|
this.editor = inject(EditorService);
|
|
467
435
|
this.protection = inject(ProtectionService);
|
|
436
|
+
this.autofill = inject(AutoFillService);
|
|
468
437
|
}
|
|
469
438
|
handleKeyDown(event) {
|
|
470
439
|
if (this.editor.editinngCell()) {
|
|
@@ -476,6 +445,11 @@ class SpreadSheetService {
|
|
|
476
445
|
}
|
|
477
446
|
handleKeyDownOnEditing(event) {
|
|
478
447
|
const cell = this.editor.editinngCell();
|
|
448
|
+
// stopPropagation()が呼ばれている場合は処理しない
|
|
449
|
+
// IME入力中やユーザーの意図的な入力中断の場合にValueCellAtomから制御される
|
|
450
|
+
if (event.cancelBubble) {
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
479
453
|
if (event.key === 'Tab') {
|
|
480
454
|
event.preventDefault();
|
|
481
455
|
if (event.shiftKey) {
|
|
@@ -497,7 +471,7 @@ class SpreadSheetService {
|
|
|
497
471
|
}
|
|
498
472
|
handleKeyDownOnSelecting(event) {
|
|
499
473
|
if (event.key === 'Tab') {
|
|
500
|
-
const selectedCell = this.selection.
|
|
474
|
+
const selectedCell = this.selection.getSelection().start;
|
|
501
475
|
event.preventDefault();
|
|
502
476
|
event.stopPropagation();
|
|
503
477
|
if (event.shiftKey) {
|
|
@@ -509,7 +483,7 @@ class SpreadSheetService {
|
|
|
509
483
|
return;
|
|
510
484
|
}
|
|
511
485
|
else if (event.key === 'Enter') {
|
|
512
|
-
const selectedCell = this.selection.
|
|
486
|
+
const selectedCell = this.selection.getSelection().start;
|
|
513
487
|
if (selectedCell) {
|
|
514
488
|
this.editor.startEditing(selectedCell);
|
|
515
489
|
event.preventDefault();
|
|
@@ -523,7 +497,7 @@ class SpreadSheetService {
|
|
|
523
497
|
else if (event.key === 'v') {
|
|
524
498
|
if (!this.config.paste)
|
|
525
499
|
return;
|
|
526
|
-
const target = this.selection.
|
|
500
|
+
const target = this.selection.getSelection().start;
|
|
527
501
|
if (target) {
|
|
528
502
|
this.clipboard.paste(target.row, target.col);
|
|
529
503
|
}
|
|
@@ -540,7 +514,7 @@ class SpreadSheetService {
|
|
|
540
514
|
}
|
|
541
515
|
}
|
|
542
516
|
else {
|
|
543
|
-
const
|
|
517
|
+
const selection = this.selection.getSelection().start;
|
|
544
518
|
let newPosition;
|
|
545
519
|
if (event.shiftKey) {
|
|
546
520
|
const selectionEnd = this.selection.getSelectionEndOrStart();
|
|
@@ -568,16 +542,16 @@ class SpreadSheetService {
|
|
|
568
542
|
else {
|
|
569
543
|
switch (event.key) {
|
|
570
544
|
case 'ArrowRight':
|
|
571
|
-
newPosition = this.navigation.moveRight(
|
|
545
|
+
newPosition = this.navigation.moveRight(selection);
|
|
572
546
|
break;
|
|
573
547
|
case 'ArrowLeft':
|
|
574
|
-
newPosition = this.navigation.moveLeft(
|
|
548
|
+
newPosition = this.navigation.moveLeft(selection);
|
|
575
549
|
break;
|
|
576
550
|
case 'ArrowUp':
|
|
577
|
-
newPosition = this.navigation.moveUp(
|
|
551
|
+
newPosition = this.navigation.moveUp(selection);
|
|
578
552
|
break;
|
|
579
553
|
case 'ArrowDown':
|
|
580
|
-
newPosition = this.navigation.moveDown(
|
|
554
|
+
newPosition = this.navigation.moveDown(selection);
|
|
581
555
|
break;
|
|
582
556
|
default:
|
|
583
557
|
return;
|
|
@@ -610,10 +584,10 @@ class SpreadSheetService {
|
|
|
610
584
|
this.editor.startEditing(position);
|
|
611
585
|
}
|
|
612
586
|
}
|
|
613
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
614
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
587
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: SpreadSheetService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
588
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: SpreadSheetService }); }
|
|
615
589
|
}
|
|
616
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
590
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: SpreadSheetService, decorators: [{
|
|
617
591
|
type: Injectable
|
|
618
592
|
}] });
|
|
619
593
|
function provideSpreadSheetService() {
|
|
@@ -625,7 +599,8 @@ function provideSpreadSheetService() {
|
|
|
625
599
|
GridService,
|
|
626
600
|
NavigationService,
|
|
627
601
|
SelectionService,
|
|
628
|
-
ProtectionService
|
|
602
|
+
ProtectionService,
|
|
603
|
+
AutoFillService
|
|
629
604
|
];
|
|
630
605
|
}
|
|
631
606
|
|
|
@@ -700,10 +675,10 @@ class SpreadSheetCell {
|
|
|
700
675
|
el.style.whiteSpace = 'nowrap';
|
|
701
676
|
this.el.nativeElement.appendChild(el);
|
|
702
677
|
}
|
|
703
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
704
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
678
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: SpreadSheetCell, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
679
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.5", type: SpreadSheetCell, isStandalone: true, selector: "[ssCell]", inputs: { position: { classPropertyName: "position", publicName: "ssCell", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "ssCellEditable", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "ssCellContext", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mousedown": "ss.selection.handleMouseDown(position(), $event)", "mouseup": "ss.selection.handleMouseUp()", "mouseenter": "ss.selection.handleMouseEnter(position())", "click": "ss.selection.handleClick(position(), $event)", "dblclick": "onDbClick()" }, properties: { "class.selected": "ss.selection.isSelected(position())", "class.editing": "ss.editor.isEditing(position())", "attr.data-row": "position().row", "attr.data-col": "position().col" } }, ngImport: i0 }); }
|
|
705
680
|
}
|
|
706
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
681
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: SpreadSheetCell, decorators: [{
|
|
707
682
|
type: Directive,
|
|
708
683
|
args: [{
|
|
709
684
|
standalone: true,
|
|
@@ -716,6 +691,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
|
|
|
716
691
|
'(mouseenter)': 'ss.selection.handleMouseEnter(position())',
|
|
717
692
|
'(click)': 'ss.selection.handleClick(position(), $event)',
|
|
718
693
|
'(dblclick)': 'onDbClick()',
|
|
694
|
+
'[attr.data-row]': 'position().row',
|
|
695
|
+
'[attr.data-col]': 'position().col',
|
|
719
696
|
}
|
|
720
697
|
}]
|
|
721
698
|
}], ctorParameters: () => [] });
|
|
@@ -736,10 +713,10 @@ class SpreadSheetCellInput {
|
|
|
736
713
|
stopEditing() {
|
|
737
714
|
this.ss.editor.stopEditing();
|
|
738
715
|
}
|
|
739
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
740
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
716
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: SpreadSheetCellInput, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
717
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.5", type: SpreadSheetCellInput, isStandalone: true, selector: "[ssCellInput]", inputs: { position: { classPropertyName: "position", publicName: "ssCellInput", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "blur": "stopEditing()" } }, ngImport: i0 }); }
|
|
741
718
|
}
|
|
742
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
719
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: SpreadSheetCellInput, decorators: [{
|
|
743
720
|
type: Directive,
|
|
744
721
|
args: [{
|
|
745
722
|
standalone: true,
|
|
@@ -750,9 +727,268 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
|
|
|
750
727
|
}]
|
|
751
728
|
}] });
|
|
752
729
|
|
|
730
|
+
class AutofillHandleComponent {
|
|
731
|
+
constructor() {
|
|
732
|
+
this.elementRef = inject((ElementRef));
|
|
733
|
+
this.renderer = inject(Renderer2);
|
|
734
|
+
this.handleMouseDown = output();
|
|
735
|
+
}
|
|
736
|
+
onMouseDown(e) {
|
|
737
|
+
e.preventDefault();
|
|
738
|
+
e.stopPropagation();
|
|
739
|
+
this.handleMouseDown.emit(e);
|
|
740
|
+
}
|
|
741
|
+
show(rect, containerRect) {
|
|
742
|
+
const el = this.elementRef.nativeElement;
|
|
743
|
+
// ハンドルをセルの右下角に配置
|
|
744
|
+
const handleSize = 14; // 8px + 2px*2 (border)
|
|
745
|
+
if (containerRect) {
|
|
746
|
+
// コンテナからの相対位置を計算
|
|
747
|
+
this.renderer.setStyle(el, 'left', `${rect.right - containerRect.left - handleSize / 2}px`);
|
|
748
|
+
this.renderer.setStyle(el, 'top', `${rect.bottom - containerRect.top - handleSize / 2}px`);
|
|
749
|
+
}
|
|
750
|
+
else {
|
|
751
|
+
// position: fixedの場合(フォールバック)
|
|
752
|
+
this.renderer.setStyle(el, 'left', `${rect.right - handleSize}px`);
|
|
753
|
+
this.renderer.setStyle(el, 'top', `${rect.bottom - handleSize}px`);
|
|
754
|
+
}
|
|
755
|
+
this.renderer.addClass(el, 'visible');
|
|
756
|
+
}
|
|
757
|
+
hide() {
|
|
758
|
+
this.renderer.removeClass(this.elementRef.nativeElement, 'visible');
|
|
759
|
+
}
|
|
760
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: AutofillHandleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
761
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.5", type: AutofillHandleComponent, isStandalone: true, selector: "autofill-handle", outputs: { handleMouseDown: "handleMouseDown" }, host: { listeners: { "mousedown": "onMouseDown($event)" } }, ngImport: i0, template: '', isInline: true, styles: [":host{position:absolute;width:8px;height:8px;background-color:#2196f3;border:2px solid #ffffff;border-radius:50%;cursor:crosshair;z-index:10000;box-shadow:0 1px 3px #0000004d;transition:background-color .2s,opacity .2s;opacity:0;pointer-events:none}:host:hover{background-color:#1976d2}:host.visible{opacity:1;pointer-events:auto}\n"] }); }
|
|
762
|
+
}
|
|
763
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: AutofillHandleComponent, decorators: [{
|
|
764
|
+
type: Component,
|
|
765
|
+
args: [{ selector: 'autofill-handle', standalone: true, template: '', styles: [":host{position:absolute;width:8px;height:8px;background-color:#2196f3;border:2px solid #ffffff;border-radius:50%;cursor:crosshair;z-index:10000;box-shadow:0 1px 3px #0000004d;transition:background-color .2s,opacity .2s;opacity:0;pointer-events:none}:host:hover{background-color:#1976d2}:host.visible{opacity:1;pointer-events:auto}\n"] }]
|
|
766
|
+
}], propDecorators: { onMouseDown: [{
|
|
767
|
+
type: HostListener,
|
|
768
|
+
args: ['mousedown', ['$event']]
|
|
769
|
+
}] } });
|
|
770
|
+
/**
|
|
771
|
+
* テーブル全体のオートフィル機能を管理するディレクティブ
|
|
772
|
+
* セルディレクティブから直接呼び出される
|
|
773
|
+
*/
|
|
774
|
+
class GridDataTableAutofill {
|
|
775
|
+
constructor() {
|
|
776
|
+
this.ss = inject(SpreadSheetService);
|
|
777
|
+
this.viewContainerRef = inject(ViewContainerRef);
|
|
778
|
+
this.renderer = inject(Renderer2);
|
|
779
|
+
this.autofillStartPosition = null;
|
|
780
|
+
this.lastAutofillContexts = null;
|
|
781
|
+
this.cleanupFunctions = [];
|
|
782
|
+
this.handleComponent = null;
|
|
783
|
+
this.currentCell = null;
|
|
784
|
+
// オートフィル完了イベント
|
|
785
|
+
this.autofillComplete = output();
|
|
786
|
+
this.currentPosition = null;
|
|
787
|
+
// ハンドルコンポーネントを作成
|
|
788
|
+
this.handleComponent = this.viewContainerRef.createComponent(AutofillHandleComponent);
|
|
789
|
+
// ハンドルのmousedownイベントを設定
|
|
790
|
+
this.handleComponent.instance.handleMouseDown.subscribe(() => {
|
|
791
|
+
if (this.currentPosition) {
|
|
792
|
+
this.startAutofill(this.currentPosition);
|
|
793
|
+
}
|
|
794
|
+
});
|
|
795
|
+
}
|
|
796
|
+
showHandle(cell, position) {
|
|
797
|
+
this.currentCell = cell;
|
|
798
|
+
this.currentPosition = position;
|
|
799
|
+
// ハンドルを適切な親要素に配置(初回のみ)
|
|
800
|
+
let scrollContainer = null;
|
|
801
|
+
if (!this.handleComponent?.location.nativeElement.parentElement) {
|
|
802
|
+
// スクロールビューポートか、テーブルコンテナを探す
|
|
803
|
+
scrollContainer = cell.closest('cdk-virtual-scroll-viewport') ||
|
|
804
|
+
cell.closest('.mat-table-container') ||
|
|
805
|
+
cell.closest('table')?.parentElement;
|
|
806
|
+
if (scrollContainer) {
|
|
807
|
+
this.renderer.appendChild(scrollContainer, this.handleComponent.location.nativeElement);
|
|
808
|
+
}
|
|
809
|
+
else {
|
|
810
|
+
// フォールバック: document.bodyに追加(position: fixedモード)
|
|
811
|
+
this.renderer.appendChild(document.body, this.handleComponent.location.nativeElement);
|
|
812
|
+
this.renderer.setStyle(this.handleComponent.location.nativeElement, 'position', 'fixed');
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
else {
|
|
816
|
+
scrollContainer = this.handleComponent.location.nativeElement.parentElement;
|
|
817
|
+
}
|
|
818
|
+
const cellRect = cell.getBoundingClientRect();
|
|
819
|
+
const containerRect = scrollContainer?.getBoundingClientRect();
|
|
820
|
+
this.handleComponent?.instance.show(cellRect, containerRect);
|
|
821
|
+
// スクロールイベントのリスナーを設定
|
|
822
|
+
this.setupScrollListener();
|
|
823
|
+
}
|
|
824
|
+
hideHandle() {
|
|
825
|
+
this.currentCell = null;
|
|
826
|
+
this.currentPosition = null;
|
|
827
|
+
this.handleComponent?.instance.hide();
|
|
828
|
+
}
|
|
829
|
+
onAutofillStart(position) {
|
|
830
|
+
this.startAutofill(position);
|
|
831
|
+
}
|
|
832
|
+
setupScrollListener() {
|
|
833
|
+
if (this.cleanupFunctions.some(fn => fn.name === 'scrollCleanup')) {
|
|
834
|
+
return; // 既にリスナーが設定されている
|
|
835
|
+
}
|
|
836
|
+
const scrollHandler = () => {
|
|
837
|
+
if (this.currentCell && this.handleComponent) {
|
|
838
|
+
const cellRect = this.currentCell.getBoundingClientRect();
|
|
839
|
+
const containerElement = this.handleComponent.location.nativeElement.parentElement;
|
|
840
|
+
const containerRect = containerElement?.getBoundingClientRect();
|
|
841
|
+
this.handleComponent.instance.show(cellRect, containerRect);
|
|
842
|
+
}
|
|
843
|
+
};
|
|
844
|
+
// スクロール可能な親要素を見つける
|
|
845
|
+
const scrollContainer = this.currentCell?.closest('cdk-virtual-scroll-viewport') ||
|
|
846
|
+
this.currentCell?.closest('.mat-table-container');
|
|
847
|
+
if (scrollContainer) {
|
|
848
|
+
scrollContainer.addEventListener('scroll', scrollHandler, { passive: true });
|
|
849
|
+
const cleanup = () => scrollContainer.removeEventListener('scroll', scrollHandler);
|
|
850
|
+
Object.defineProperty(cleanup, 'name', { value: 'scrollCleanup' });
|
|
851
|
+
this.cleanupFunctions.push(cleanup);
|
|
852
|
+
}
|
|
853
|
+
// ウィンドウスクロールも監視
|
|
854
|
+
window.addEventListener('scroll', scrollHandler, { passive: true });
|
|
855
|
+
const windowCleanup = () => window.removeEventListener('scroll', scrollHandler);
|
|
856
|
+
Object.defineProperty(windowCleanup, 'name', { value: 'scrollCleanup' });
|
|
857
|
+
this.cleanupFunctions.push(windowCleanup);
|
|
858
|
+
}
|
|
859
|
+
// セルディレクティブから呼び出されるメソッド
|
|
860
|
+
startAutofill(position) {
|
|
861
|
+
this.autofillStartPosition = position;
|
|
862
|
+
this.ss.autofill.startAutofill(position);
|
|
863
|
+
// 既存のリスナーをクリーンアップ
|
|
864
|
+
this.cleanup();
|
|
865
|
+
// マウスイベントの設定
|
|
866
|
+
const onMouseMove = this.onMouseMove.bind(this);
|
|
867
|
+
const onMouseUp = this.onMouseUp.bind(this);
|
|
868
|
+
document.addEventListener('mousemove', onMouseMove);
|
|
869
|
+
document.addEventListener('mouseup', onMouseUp);
|
|
870
|
+
this.cleanupFunctions.push(() => {
|
|
871
|
+
document.removeEventListener('mousemove', onMouseMove);
|
|
872
|
+
document.removeEventListener('mouseup', onMouseUp);
|
|
873
|
+
});
|
|
874
|
+
}
|
|
875
|
+
onMouseMove(event) {
|
|
876
|
+
if (!this.autofillStartPosition)
|
|
877
|
+
return;
|
|
878
|
+
// ドラッグ中のプレビュー処理
|
|
879
|
+
const element = document.elementFromPoint(event.clientX, event.clientY);
|
|
880
|
+
const cell = element?.closest('td[mat-cell]');
|
|
881
|
+
if (cell) {
|
|
882
|
+
const targetRow = parseInt(cell.getAttribute('data-row') || '0');
|
|
883
|
+
const targetCol = parseInt(cell.getAttribute('data-col') || '0');
|
|
884
|
+
this.ss.autofill.updateAutofillRange({ row: targetRow, col: targetCol });
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
onMouseUp() {
|
|
888
|
+
const result = this.completeAutofill();
|
|
889
|
+
if (result) {
|
|
890
|
+
this.autofillComplete.emit(result);
|
|
891
|
+
}
|
|
892
|
+
this.autofillStartPosition = null;
|
|
893
|
+
this.cleanup();
|
|
894
|
+
}
|
|
895
|
+
completeAutofill() {
|
|
896
|
+
const sourcePosition = this.ss.autofill.getSourcePosition();
|
|
897
|
+
const targetRange = this.ss.autofill.getTargetRange();
|
|
898
|
+
if (!sourcePosition || !targetRange) {
|
|
899
|
+
return null;
|
|
900
|
+
}
|
|
901
|
+
// GridServiceから実際のコンテキストを収集
|
|
902
|
+
const contexts = [];
|
|
903
|
+
const { start, end } = targetRange;
|
|
904
|
+
// ソースコンテキストを取得
|
|
905
|
+
const sourceContext = this.ss.grid.getContext(sourcePosition);
|
|
906
|
+
if (!sourceContext) {
|
|
907
|
+
console.warn('Source context not found');
|
|
908
|
+
this.ss.autofill.cancelAutofill();
|
|
909
|
+
return null;
|
|
910
|
+
}
|
|
911
|
+
// 影響を受けるセルのコンテキストを収集(表示されているセルのみ)
|
|
912
|
+
for (let row = start.row + 1; row <= end.row; row++) {
|
|
913
|
+
const targetContext = this.ss.grid.getContext({ row, col: start.col });
|
|
914
|
+
if (targetContext) {
|
|
915
|
+
contexts.push({ position: { row, col: start.col }, context: targetContext });
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
// コンテキスト情報を保存
|
|
919
|
+
this.lastAutofillContexts = { sourceContext, targetContexts: contexts };
|
|
920
|
+
// オートフィルモードをリセット
|
|
921
|
+
this.ss.autofill.cancelAutofill();
|
|
922
|
+
if (contexts.length > 0) {
|
|
923
|
+
return {
|
|
924
|
+
sourcePosition,
|
|
925
|
+
targetRange,
|
|
926
|
+
contexts: this.lastAutofillContexts
|
|
927
|
+
};
|
|
928
|
+
}
|
|
929
|
+
return null;
|
|
930
|
+
}
|
|
931
|
+
getLastAutofillContexts() {
|
|
932
|
+
return this.lastAutofillContexts;
|
|
933
|
+
}
|
|
934
|
+
cleanup() {
|
|
935
|
+
this.cleanupFunctions.forEach(fn => fn());
|
|
936
|
+
this.cleanupFunctions = [];
|
|
937
|
+
}
|
|
938
|
+
ngOnDestroy() {
|
|
939
|
+
this.cleanup();
|
|
940
|
+
if (this.handleComponent) {
|
|
941
|
+
this.handleComponent.destroy();
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: GridDataTableAutofill, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
945
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.5", type: GridDataTableAutofill, isStandalone: true, selector: "[gridDataTableAutofill]", outputs: { autofillComplete: "autofillComplete" }, ngImport: i0 }); }
|
|
946
|
+
}
|
|
947
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: GridDataTableAutofill, decorators: [{
|
|
948
|
+
type: Directive,
|
|
949
|
+
args: [{
|
|
950
|
+
standalone: true,
|
|
951
|
+
selector: '[gridDataTableAutofill]'
|
|
952
|
+
}]
|
|
953
|
+
}], ctorParameters: () => [] });
|
|
954
|
+
|
|
955
|
+
class SpreadSheetCellAutofill {
|
|
956
|
+
constructor() {
|
|
957
|
+
this.ss = inject(SpreadSheetService);
|
|
958
|
+
this.el = inject(ElementRef);
|
|
959
|
+
this.table = inject(GridDataTableAutofill);
|
|
960
|
+
this.position = input({ row: 0, col: 0 }, { alias: 'gridDataCellAutofill' });
|
|
961
|
+
this.enabled = input(true, { alias: 'gridDataCellAutofillEnabled' });
|
|
962
|
+
this.shouldShow = computed(() => this.enabled() &&
|
|
963
|
+
this.ss.selection.isCursorPosition(this.position()) &&
|
|
964
|
+
!this.ss.editor.isEditing(this.position()) &&
|
|
965
|
+
!this.ss.autofill.isAutofillMode());
|
|
966
|
+
// requestAnimationFrameを使用して、DOMの更新後に実行
|
|
967
|
+
effect(() => {
|
|
968
|
+
if (this.shouldShow()) {
|
|
969
|
+
requestAnimationFrame(() => {
|
|
970
|
+
this.table.showHandle(this.el.nativeElement, this.position());
|
|
971
|
+
});
|
|
972
|
+
}
|
|
973
|
+
else if (!this.shouldShow() && this.ss.selection.isCursorPosition(this.position())) {
|
|
974
|
+
// 現在のセルがカーソル位置だが表示条件を満たさない場合のみ非表示
|
|
975
|
+
this.table.hideHandle();
|
|
976
|
+
}
|
|
977
|
+
});
|
|
978
|
+
}
|
|
979
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: SpreadSheetCellAutofill, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
980
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.5", type: SpreadSheetCellAutofill, isStandalone: true, selector: "[gridDataCellAutofill]", inputs: { position: { classPropertyName: "position", publicName: "gridDataCellAutofill", isSignal: true, isRequired: false, transformFunction: null }, enabled: { classPropertyName: "enabled", publicName: "gridDataCellAutofillEnabled", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
981
|
+
}
|
|
982
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: SpreadSheetCellAutofill, decorators: [{
|
|
983
|
+
type: Directive,
|
|
984
|
+
args: [{ standalone: true, selector: '[gridDataCellAutofill]' }]
|
|
985
|
+
}], ctorParameters: () => [] });
|
|
986
|
+
|
|
987
|
+
// Components are imported directly by directives to avoid circular dependencies
|
|
988
|
+
|
|
753
989
|
/**
|
|
754
990
|
* Generated bundle index. Do not edit.
|
|
755
991
|
*/
|
|
756
992
|
|
|
757
|
-
export { COLUMN_PROTECTOR, ClipboardService, EditorService, GridService, NavigationService, ProtectionService, SelectionService, SpreadSheetCell, SpreadSheetCellInput, SpreadSheetDataService, SpreadSheetService, provideCellProtector, provideSpreadSheetService };
|
|
993
|
+
export { AutoFillService, COLUMN_PROTECTOR, ClipboardService, EditorService, GridDataTableAutofill, GridService, NavigationService, ProtectionService, SelectionService, SpreadSheetCell, SpreadSheetCellAutofill, SpreadSheetCellInput, SpreadSheetDataService, SpreadSheetService, provideCellProtector, provideSpreadSheetService };
|
|
758
994
|
//# sourceMappingURL=ng-atomic-common-services-spreadsheet.mjs.map
|