File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 106106 cursor : pointer ;
107107 }
108108 }
109+ }
110+
111+ #convert-movie-clip-button
112+ {
113+ pointer-events : none ;
114+ opacity : 0.5 ;
109115}
Original file line number Diff line number Diff line change @@ -255,9 +255,10 @@ let $editingElement: HTMLElement | null = null;
255255 */
256256export const $setEditingElement = ( element : HTMLElement | null ) : void =>
257257{
258- if ( $editingElement ) {
258+ if ( $editingElement && $editingElement !== element ) {
259259 $editingElement . blur ( ) ;
260260 }
261+
261262 $editingElement = element ;
262263} ;
263264
Original file line number Diff line number Diff line change 1+
2+ /**
3+ * @description ConvertMovieClipModalの中心点の入力チェック状態
4+ * Input check state of ConvertMovieClipModal center point
5+ *
6+ * @type {boolean }
7+ * @private
8+ */
9+ let $selected : boolean = false ;
10+
11+ /**
12+ * @description ConvertMovieClipModalの入力チェック状態
13+ * Input check state of ConvertMovieClipModal
14+ *
15+ * @type {boolean }
16+ * @private
17+ */
18+ let $validValue : boolean = false ;
19+
20+ /**
21+ * @description ConvertMovieClipModalの入力チェック状態を初期化
22+ * Initialize the input check state of ConvertMovieClipModal
23+ *
24+ * @return {void }
25+ * @method
26+ * @public
27+ */
28+ export const $resetState = ( ) : void =>
29+ {
30+ $validValue = false ;
31+ $selected = false ;
32+ } ;
33+
34+ /**
35+ * @description ConvertMovieClipModalの入力チェック状態を取得
36+ * Get the input check state of ConvertMovieClipModal
37+ *
38+ * @return {void }
39+ * @method
40+ * @public
41+ */
42+ export const $selectReference = ( ) : void =>
43+ {
44+ $selected = true ;
45+ } ;
46+
47+ /**
48+ * @description ConvertMovieClipModalの入力チェック状態をセット
49+ * Set the input check state of ConvertMovieClipModal
50+ *
51+ * @param {boolean } valid
52+ * @return {void }
53+ * @method
54+ * @public
55+ */
56+ export const $verifyValue = ( valid : boolean ) : void =>
57+ {
58+ $validValue = valid ;
59+ } ;
60+
61+ /**
62+ * @description ConvertMovieClipModalの入力チェック状態を取得
63+ * Get the input check state of ConvertMovieClipModal
64+ *
65+ * @return {boolean }
66+ * @method
67+ * @public
68+ */
69+ export const $canProceed = ( ) : boolean =>
70+ {
71+ return $selected && $validValue ;
72+ } ;
Load diff This file was deleted.
Original file line number Diff line number Diff line change 1+ import { $CONVERT_MOVIE_CLIP_BUTTON_ID } from "@/config/ConvertMovieClipConfig" ;
2+ import { $canProceed } from "../ConvertMovieClipModalUtil" ;
3+
4+ /**
5+ * @description ConvertMovieClipModalの変換ボタンの状態を更新
6+ * Update the state of the convert button in ConvertMovieClipModal
7+ *
8+ * @return {void }
9+ * @method
10+ * @public
11+ */
12+ export const execute = ( ) : void =>
13+ {
14+ const element : HTMLElement | null = document
15+ . getElementById ( $CONVERT_MOVIE_CLIP_BUTTON_ID ) ;
16+
17+ if ( ! element ) {
18+ return ;
19+ }
20+
21+ if ( $canProceed ( ) ) {
22+ element . style . pointerEvents = "auto" ;
23+ element . style . opacity = "1" ;
24+ } else {
25+ element . setAttribute ( "style" , "" ) ;
26+ }
27+ } ;
Original file line number Diff line number Diff line change 1- import { $CONVERT_MOVIE_CLIP_BUTTON_ID } from "@/config/ConvertMovieClipConfig" ;
1+ import { $CONVERT_MOVIE_CLIP_INPUT_ID } from "@/config/ConvertMovieClipConfig" ;
22import { $getCurrentWorkSpace } from "@/core/application/CoreUtil" ;
33import { execute as convertMovieClipModalHideUseCase } from "./ConvertMovieClipModalHideUseCase" ;
44
@@ -21,7 +21,7 @@ export const execute = async (event: PointerEvent): Promise<void> =>
2121 }
2222
2323 const inputElement = document
24- . getElementById ( $CONVERT_MOVIE_CLIP_BUTTON_ID ) as HTMLInputElement ;
24+ . getElementById ( $CONVERT_MOVIE_CLIP_INPUT_ID ) as HTMLInputElement ;
2525 if ( ! inputElement || ! inputElement . value ) {
2626 return ;
2727 }
@@ -31,12 +31,10 @@ export const execute = async (event: PointerEvent): Promise<void> =>
3131
3232 // 指定の名前でMovieClipを作成
3333 const name = inputElement . value ;
34+ console . log ( name ) ;
3435
3536 // todo
3637
3738 // モーダルを非表示にする
3839 convertMovieClipModalHideUseCase ( ) ;
39-
40- // inputを初期化
41- inputElement . value = "" ;
4240} ;
Original file line number Diff line number Diff line change 1+ import { $selectReference } from "../ConvertMovieClipModalUtil" ;
12import { execute as convertMovieClipModalChildInactiveService } from "../service/ConvertMovieClipModalChildInactiveService" ;
3+ import { execute as convertMovieClipModalUpdateButtonService } from "../service/ConvertMovieClipModalUpdateButtonService" ;
24
35/**
46 * @description ConvertMovieClipModalの子要素がPointerDownイベントを受け取った際の処理
@@ -24,4 +26,10 @@ export const execute = (event: PointerEvent): void =>
2426
2527 // 選択された要素にactiveクラスを追加する
2628 element . classList . add ( "active" ) ;
29+
30+ // 参照選択状態をセットする
31+ $selectReference ( ) ;
32+
33+ // 変換ボタンの状態を更新
34+ convertMovieClipModalUpdateButtonService ( ) ;
2735} ;
Original file line number Diff line number Diff line change 11import { $CONVERT_MOVIE_CLIP_MODAL_NAME } from "@/config/MenuConfig" ;
22import { $getMenu } from "../../MenuUtil" ;
3+ import { $CONVERT_MOVIE_CLIP_INPUT_ID } from "@/config/ConvertMovieClipConfig" ;
4+ import { $resetState } from "../ConvertMovieClipModalUtil" ;
35import { execute as convertMovieClipModalChildInactiveService } from "../service/ConvertMovieClipModalChildInactiveService" ;
6+ import { execute as convertMovieClipModalUpdateButtonService } from "../service/ConvertMovieClipModalUpdateButtonService" ;
47
58/**
69 * @description MovieClipの変換エリアを非表示にする
@@ -17,8 +20,23 @@ export const execute = (): void =>
1720 return ;
1821 }
1922
23+ const inputElement = document . getElementById ( $CONVERT_MOVIE_CLIP_INPUT_ID ) as HTMLInputElement ;
24+ if ( ! inputElement ) {
25+ return ;
26+ }
27+
2028 // 全ての子要素のactiveクラスを削除する
2129 convertMovieClipModalChildInactiveService ( ) ;
2230
31+ // 入力フィールドの値を初期化する
32+ inputElement . value = "" ;
33+
34+ // 状態を初期化する
35+ $resetState ( ) ;
36+
37+ // 変換ボタンの状態を更新
38+ convertMovieClipModalUpdateButtonService ( ) ;
39+
40+ // モーダルを非表示にする
2341 menu . hide ( ) ;
2442} ;
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { $CONVERT_MOVIE_CLIP_MODAL_NAME } from "@/config/MenuConfig";
33import { execute as convertMovieClipModalCancelPointerDownEventUseCase } from "./ConvertMovieClipModalCancelPointerDownEventUseCase" ;
44import { execute as convertMovieClipModalChildPointerDownEventUseCase } from "./ConvertMovieClipModalChildPointerDownEventUseCase" ;
55import { execute as convertMovieClipModalInputFocusInEventService } from "../service/ConvertMovieClipModalInputFocusInEventService" ;
6- import { execute as convertMovieClipModalInputFocusOutEventUseCase } from "../service /ConvertMovieClipModalInputFocusOutEventUseCase" ;
6+ import { execute as convertMovieClipModalInputFocusOutEventUseCase } from "./ConvertMovieClipModalInputFocusOutEventUseCase" ;
77import { execute as convertMovieClipModalInputKeyPressEventService } from "../service/ConvertMovieClipModalInputKeyPressEventService" ;
88import { execute as convertMovieClipModalButtonPointerDownEventUseCase } from "./ConvertMovieClipModalButtonPointerDownEventUseCase" ;
99import {
Original file line number Diff line number Diff line change 1+ import { $updateKeyLock } from "@/shortcut/ShortcutUtil" ;
2+ import { $getCurrentWorkSpace } from "@/core/application/CoreUtil" ;
3+ import { execute as externalLibraryGetItemUseCase } from "@/external/controller/application/ExternalLibrary/usecase/ExternalLibraryGetItemUseCase" ;
4+ import { execute as detailModalCustomFadeInUseCase } from "@/menu/application/DetailModal/usecase/DetailModalCustomFadeInUseCase" ;
5+ import { $ERROR_DUPLICATE_NAME_TEXT } from "@/config/ErrorTextConfig" ;
6+ import { $verifyValue } from "../ConvertMovieClipModalUtil" ;
7+ import { execute as convertMovieClipModalUpdateButtonService } from "../service/ConvertMovieClipModalUpdateButtonService" ;
8+
9+ /**
10+ * @description ConvertMovieClipModalの入力フィールドからフォーカスが外れたときの処理
11+ * Process when focus is lost from the input field of ConvertMovieClipModal
12+ *
13+ * @param {FocusEvent } event
14+ * @return {Promise<void> }
15+ * @method
16+ * @public
17+ */
18+ export const execute = async ( event : FocusEvent ) : Promise < void > =>
19+ {
20+ const inputElement = event . target as HTMLInputElement ;
21+ if ( ! inputElement ) {
22+ return ;
23+ }
24+
25+ // イベントの伝播を止める
26+ event . stopPropagation ( ) ;
27+
28+ // 重複チェック
29+ const item = externalLibraryGetItemUseCase (
30+ $getCurrentWorkSpace ( ) ,
31+ inputElement . value
32+ ) ;
33+
34+ if ( item ) {
35+
36+ const parent = inputElement . offsetParent as HTMLElement ;
37+ if ( ! parent ) {
38+ return ;
39+ }
40+
41+ // 進行状況画面を表示
42+ detailModalCustomFadeInUseCase (
43+ $ERROR_DUPLICATE_NAME_TEXT ,
44+ parent . offsetLeft - 35 , parent . offsetTop - 55
45+ ) ;
46+
47+ // 入力のやり直しを促す
48+ $verifyValue ( false ) ;
49+
50+ inputElement . focus ( ) ;
51+ } else {
52+ // 入力が有効であることをセット
53+ $verifyValue ( true ) ;
54+
55+ // 入力モードを終了する
56+ $updateKeyLock ( false ) ;
57+ }
58+
59+ // 変換ボタンの状態を更新
60+ convertMovieClipModalUpdateButtonService ( ) ;
61+ } ;
You can’t perform that action at this time.
0 commit comments