diff options
| author | かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> | 2025-02-05 19:01:44 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-05 10:01:44 +0000 |
| commit | c548ec9906947c72743e611254a6557e8e8d057c (patch) | |
| tree | 18a7ed26909bf9a3b788be38cb7e756dca6f4134 /packages/frontend/src/components/grid | |
| parent | [skip ci] Update CHANGELOG.md (prepend template) (diff) | |
| download | misskey-c548ec9906947c72743e611254a6557e8e8d057c.tar.gz misskey-c548ec9906947c72743e611254a6557e8e8d057c.tar.bz2 misskey-c548ec9906947c72743e611254a6557e8e8d057c.zip | |
refactor(frontend): verbatimModuleSyntaxを有効化 (#15323)
* wip
* wip
* wip
* wip
* revert unnecessary changes
* wip
* refactor(frontend): enforce verbatimModuleSyntax
* fix
* refactor(frontend-shared): enforce verbatimModuleSyntax
* wip
* refactor(frontend-embed): enforce verbatimModuleSyntax
* enforce consistent-type-imports
* fix lint config
* attemt to fix ci
* fix lint
* fix
* fix
* fix
Diffstat (limited to 'packages/frontend/src/components/grid')
14 files changed, 67 insertions, 57 deletions
diff --git a/packages/frontend/src/components/grid/MkDataCell.vue b/packages/frontend/src/components/grid/MkDataCell.vue index e473b7c1af..c2dc05efe6 100644 --- a/packages/frontend/src/components/grid/MkDataCell.vue +++ b/packages/frontend/src/components/grid/MkDataCell.vue @@ -89,12 +89,13 @@ SPDX-License-Identifier: AGPL-3.0-only <script setup lang="ts"> import { computed, defineAsyncComponent, nextTick, onMounted, onUnmounted, ref, shallowRef, toRefs, watch } from 'vue'; -import { GridEventEmitter, Size } from '@/components/grid/grid.js'; +import { GridEventEmitter } from '@/components/grid/grid.js'; import { useTooltip } from '@/scripts/use-tooltip.js'; import * as os from '@/os.js'; -import { CellValue, GridCell } from '@/components/grid/cell.js'; import { equalCellAddress, getCellAddress } from '@/components/grid/grid-utils.js'; -import { GridRowSetting } from '@/components/grid/row.js'; +import type { Size } from '@/components/grid/grid.js'; +import type { CellValue, GridCell } from '@/components/grid/cell.js'; +import type { GridRowSetting } from '@/components/grid/row.js'; const emit = defineEmits<{ (ev: 'operation:beginEdit', sender: GridCell): void; diff --git a/packages/frontend/src/components/grid/MkDataRow.vue b/packages/frontend/src/components/grid/MkDataRow.vue index 280a14bc4a..a35f93b435 100644 --- a/packages/frontend/src/components/grid/MkDataRow.vue +++ b/packages/frontend/src/components/grid/MkDataRow.vue @@ -37,11 +37,12 @@ SPDX-License-Identifier: AGPL-3.0-only </template> <script setup lang="ts"> -import { GridEventEmitter, Size } from '@/components/grid/grid.js'; +import { GridEventEmitter } from '@/components/grid/grid.js'; import MkDataCell from '@/components/grid/MkDataCell.vue'; import MkNumberCell from '@/components/grid/MkNumberCell.vue'; -import { CellValue, GridCell } from '@/components/grid/cell.js'; -import { GridRow, GridRowSetting } from '@/components/grid/row.js'; +import type { Size } from '@/components/grid/grid.js'; +import type { CellValue, GridCell } from '@/components/grid/cell.js'; +import type { GridRow, GridRowSetting } from '@/components/grid/row.js'; const emit = defineEmits<{ (ev: 'operation:beginEdit', sender: GridCell): void; diff --git a/packages/frontend/src/components/grid/MkGrid.stories.impl.ts b/packages/frontend/src/components/grid/MkGrid.stories.impl.ts index 5801012f15..f85bf146e8 100644 --- a/packages/frontend/src/components/grid/MkGrid.stories.impl.ts +++ b/packages/frontend/src/components/grid/MkGrid.stories.impl.ts @@ -5,14 +5,14 @@ /* eslint-disable @typescript-eslint/explicit-function-return-type */ import { action } from '@storybook/addon-actions'; -import { StoryObj } from '@storybook/vue3'; +import type { StoryObj } from '@storybook/vue3'; import { ref } from 'vue'; import { commonHandlers } from '../../../.storybook/mocks.js'; import { boolean, choose, country, date, firstName, integer, lastName, text } from '../../../.storybook/fake-utils.js'; import MkGrid from './MkGrid.vue'; -import { GridContext, GridEvent } from '@/components/grid/grid-event.js'; -import { DataSource, GridSetting } from '@/components/grid/grid.js'; -import { GridColumnSetting } from '@/components/grid/column.js'; +import type { GridContext, GridEvent } from '@/components/grid/grid-event.js'; +import type { DataSource, GridSetting } from '@/components/grid/grid.js'; +import type { GridColumnSetting } from '@/components/grid/column.js'; function d(p: { check?: boolean, diff --git a/packages/frontend/src/components/grid/MkGrid.vue b/packages/frontend/src/components/grid/MkGrid.vue index 4dbd4ebcae..84f1f754b2 100644 --- a/packages/frontend/src/components/grid/MkGrid.vue +++ b/packages/frontend/src/components/grid/MkGrid.vue @@ -50,11 +50,11 @@ SPDX-License-Identifier: AGPL-3.0-only <script setup lang="ts"> import { computed, onMounted, ref, toRefs, watch } from 'vue'; -import { DataSource, GridEventEmitter, GridSetting, GridState, Size } from '@/components/grid/grid.js'; +import { GridEventEmitter } from '@/components/grid/grid.js'; import MkDataRow from '@/components/grid/MkDataRow.vue'; import MkHeaderRow from '@/components/grid/MkHeaderRow.vue'; import { cellValidation } from '@/components/grid/cell-validators.js'; -import { CELL_ADDRESS_NONE, CellAddress, CellValue, createCell, GridCell, resetCell } from '@/components/grid/cell.js'; +import { CELL_ADDRESS_NONE, createCell, resetCell } from '@/components/grid/cell.js'; import { copyGridDataToClipboard, equalCellAddress, @@ -63,13 +63,18 @@ import { pasteToGridFromClipboard, removeDataFromGrid, } from '@/components/grid/grid-utils.js'; -import { MenuItem } from '@/types/menu.js'; import * as os from '@/os.js'; -import { GridContext, GridEvent } from '@/components/grid/grid-event.js'; -import { createColumn, GridColumn } from '@/components/grid/column.js'; -import { createRow, defaultGridRowSetting, GridRow, GridRowSetting, resetRow } from '@/components/grid/row.js'; +import { createColumn } from '@/components/grid/column.js'; +import { createRow, defaultGridRowSetting, resetRow } from '@/components/grid/row.js'; import { handleKeyEvent } from '@/scripts/key-event.js'; +import type { DataSource, GridSetting, GridState, Size } from '@/components/grid/grid.js'; +import type { CellAddress, CellValue, GridCell } from '@/components/grid/cell.js'; +import type { GridContext, GridEvent } from '@/components/grid/grid-event.js'; +import type { GridColumn } from '@/components/grid/column.js'; +import type { GridRow, GridRowSetting } from '@/components/grid/row.js'; +import type { MenuItem } from '@/types/menu.js'; + type RowHolder = { row: GridRow, cells: GridCell[], diff --git a/packages/frontend/src/components/grid/MkHeaderCell.vue b/packages/frontend/src/components/grid/MkHeaderCell.vue index aecfe7eaa3..69a68b6f2c 100644 --- a/packages/frontend/src/components/grid/MkHeaderCell.vue +++ b/packages/frontend/src/components/grid/MkHeaderCell.vue @@ -32,8 +32,9 @@ SPDX-License-Identifier: AGPL-3.0-only <script setup lang="ts"> import { computed, nextTick, onMounted, onUnmounted, ref, toRefs, watch } from 'vue'; -import { GridEventEmitter, Size } from '@/components/grid/grid.js'; -import { GridColumn } from '@/components/grid/column.js'; +import { GridEventEmitter } from '@/components/grid/grid.js'; +import type { Size } from '@/components/grid/grid.js'; +import type { GridColumn } from '@/components/grid/column.js'; const emit = defineEmits<{ (ev: 'operation:beginWidthChange', sender: GridColumn): void; diff --git a/packages/frontend/src/components/grid/MkHeaderRow.vue b/packages/frontend/src/components/grid/MkHeaderRow.vue index 8affa08fd5..225f623b84 100644 --- a/packages/frontend/src/components/grid/MkHeaderRow.vue +++ b/packages/frontend/src/components/grid/MkHeaderRow.vue @@ -29,11 +29,12 @@ SPDX-License-Identifier: AGPL-3.0-only </template> <script setup lang="ts"> -import { GridEventEmitter, Size } from '@/components/grid/grid.js'; +import { GridEventEmitter } from '@/components/grid/grid.js'; import MkHeaderCell from '@/components/grid/MkHeaderCell.vue'; import MkNumberCell from '@/components/grid/MkNumberCell.vue'; -import { GridColumn } from '@/components/grid/column.js'; -import { GridRowSetting } from '@/components/grid/row.js'; +import type { Size } from '@/components/grid/grid.js'; +import type { GridColumn } from '@/components/grid/column.js'; +import type { GridRowSetting } from '@/components/grid/row.js'; const emit = defineEmits<{ (ev: 'operation:beginWidthChange', sender: GridColumn): void; diff --git a/packages/frontend/src/components/grid/MkNumberCell.vue b/packages/frontend/src/components/grid/MkNumberCell.vue index 674bba96bc..d3b5956ddd 100644 --- a/packages/frontend/src/components/grid/MkNumberCell.vue +++ b/packages/frontend/src/components/grid/MkNumberCell.vue @@ -19,8 +19,7 @@ SPDX-License-Identifier: AGPL-3.0-only </template> <script setup lang="ts"> - -import { GridRow } from '@/components/grid/row.js'; +import type { GridRow } from '@/components/grid/row.js'; defineProps<{ content: string, diff --git a/packages/frontend/src/components/grid/cell-validators.ts b/packages/frontend/src/components/grid/cell-validators.ts index 949cab2ec6..56d7f0f13d 100644 --- a/packages/frontend/src/components/grid/cell-validators.ts +++ b/packages/frontend/src/components/grid/cell-validators.ts @@ -3,9 +3,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { CellValue, GridCell } from '@/components/grid/cell.js'; -import { GridColumn } from '@/components/grid/column.js'; -import { GridRow } from '@/components/grid/row.js'; +import type { CellValue, GridCell } from '@/components/grid/cell.js'; +import type { GridColumn } from '@/components/grid/column.js'; +import type { GridRow } from '@/components/grid/row.js'; import { i18n } from '@/i18n.js'; export type ValidatorParams = { diff --git a/packages/frontend/src/components/grid/cell.ts b/packages/frontend/src/components/grid/cell.ts index 71b7a3e3f1..2569c6d50d 100644 --- a/packages/frontend/src/components/grid/cell.ts +++ b/packages/frontend/src/components/grid/cell.ts @@ -3,12 +3,12 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { ValidateViolation } from '@/components/grid/cell-validators.js'; -import { Size } from '@/components/grid/grid.js'; -import { GridColumn } from '@/components/grid/column.js'; -import { GridRow } from '@/components/grid/row.js'; -import { MenuItem } from '@/types/menu.js'; -import { GridContext } from '@/components/grid/grid-event.js'; +import type { ValidateViolation } from '@/components/grid/cell-validators.js'; +import type { Size } from '@/components/grid/grid.js'; +import type { GridColumn } from '@/components/grid/column.js'; +import type { GridRow } from '@/components/grid/row.js'; +import type { MenuItem } from '@/types/menu.js'; +import type { GridContext } from '@/components/grid/grid-event.js'; export type CellValue = string | boolean | number | undefined | null | Array<unknown> | NonNullable<unknown>; diff --git a/packages/frontend/src/components/grid/column.ts b/packages/frontend/src/components/grid/column.ts index 2f505756fe..6780c8a3a7 100644 --- a/packages/frontend/src/components/grid/column.ts +++ b/packages/frontend/src/components/grid/column.ts @@ -3,13 +3,13 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { GridCellValidator } from '@/components/grid/cell-validators.js'; -import { Size, SizeStyle } from '@/components/grid/grid.js'; import { calcCellWidth } from '@/components/grid/grid-utils.js'; -import { CellValue, GridCell } from '@/components/grid/cell.js'; -import { GridRow } from '@/components/grid/row.js'; -import { MenuItem } from '@/types/menu.js'; -import { GridContext } from '@/components/grid/grid-event.js'; +import type { GridCellValidator } from '@/components/grid/cell-validators.js'; +import type { Size, SizeStyle } from '@/components/grid/grid.js'; +import type { CellValue, GridCell } from '@/components/grid/cell.js'; +import type { GridRow } from '@/components/grid/row.js'; +import type { MenuItem } from '@/types/menu.js'; +import type { GridContext } from '@/components/grid/grid-event.js'; export type ColumnType = 'text' | 'number' | 'date' | 'boolean' | 'image' | 'hidden'; diff --git a/packages/frontend/src/components/grid/grid-event.ts b/packages/frontend/src/components/grid/grid-event.ts index 074b72b956..e2f1e44055 100644 --- a/packages/frontend/src/components/grid/grid-event.ts +++ b/packages/frontend/src/components/grid/grid-event.ts @@ -3,11 +3,11 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { CellAddress, CellValue, GridCell } from '@/components/grid/cell.js'; -import { GridState } from '@/components/grid/grid.js'; -import { ValidateViolation } from '@/components/grid/cell-validators.js'; -import { GridColumn } from '@/components/grid/column.js'; -import { GridRow } from '@/components/grid/row.js'; +import type { CellAddress, CellValue, GridCell } from '@/components/grid/cell.js'; +import type { GridState } from '@/components/grid/grid.js'; +import type { ValidateViolation } from '@/components/grid/cell-validators.js'; +import type { GridColumn } from '@/components/grid/column.js'; +import type { GridRow } from '@/components/grid/row.js'; export type GridContext = { selectedCell?: GridCell; diff --git a/packages/frontend/src/components/grid/grid-utils.ts b/packages/frontend/src/components/grid/grid-utils.ts index a45bc88926..4f48af194c 100644 --- a/packages/frontend/src/components/grid/grid-utils.ts +++ b/packages/frontend/src/components/grid/grid-utils.ts @@ -3,13 +3,15 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { isRef, Ref } from 'vue'; -import { DataSource, SizeStyle } from '@/components/grid/grid.js'; -import { CELL_ADDRESS_NONE, CellAddress, CellValue, GridCell } from '@/components/grid/cell.js'; -import { GridRow } from '@/components/grid/row.js'; -import { GridContext } from '@/components/grid/grid-event.js'; +import { isRef } from 'vue'; +import type { Ref } from 'vue'; +import type { DataSource, SizeStyle } from '@/components/grid/grid.js'; +import { CELL_ADDRESS_NONE } from '@/components/grid/cell.js'; +import type { CellAddress, CellValue, GridCell } from '@/components/grid/cell.js'; +import type { GridRow } from '@/components/grid/row.js'; +import type { GridContext } from '@/components/grid/grid-event.js'; import { copyToClipboard } from '@/scripts/copy-to-clipboard.js'; -import { GridColumn, GridColumnSetting } from '@/components/grid/column.js'; +import type { GridColumn, GridColumnSetting } from '@/components/grid/column.js'; export function isCellElement(elem: HTMLElement): boolean { return elem.hasAttribute('data-grid-cell'); diff --git a/packages/frontend/src/components/grid/grid.ts b/packages/frontend/src/components/grid/grid.ts index b82e12b304..03947b7ee3 100644 --- a/packages/frontend/src/components/grid/grid.ts +++ b/packages/frontend/src/components/grid/grid.ts @@ -4,9 +4,9 @@ */ import { EventEmitter } from 'eventemitter3'; -import { CellValue, GridCellSetting } from '@/components/grid/cell.js'; -import { GridColumnSetting } from '@/components/grid/column.js'; -import { GridRowSetting } from '@/components/grid/row.js'; +import type { CellValue, GridCellSetting } from '@/components/grid/cell.js'; +import type { GridColumnSetting } from '@/components/grid/column.js'; +import type { GridRowSetting } from '@/components/grid/row.js'; export type GridSetting = { root?: { diff --git a/packages/frontend/src/components/grid/row.ts b/packages/frontend/src/components/grid/row.ts index e0a317c9d3..f34770312a 100644 --- a/packages/frontend/src/components/grid/row.ts +++ b/packages/frontend/src/components/grid/row.ts @@ -3,11 +3,11 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { AdditionalStyle } from '@/components/grid/grid.js'; -import { GridCell } from '@/components/grid/cell.js'; -import { GridColumn } from '@/components/grid/column.js'; -import { MenuItem } from '@/types/menu.js'; -import { GridContext } from '@/components/grid/grid-event.js'; +import type { AdditionalStyle } from '@/components/grid/grid.js'; +import type { GridCell } from '@/components/grid/cell.js'; +import type { GridColumn } from '@/components/grid/column.js'; +import type { MenuItem } from '@/types/menu.js'; +import type { GridContext } from '@/components/grid/grid-event.js'; export const defaultGridRowSetting: Required<GridRowSetting> = { showNumber: true, |