概要

このサンプルではステッパーコンポーネントでワークフローの進行管理やステップ間の移動制御といったよく利用されるシナリオを確認することができます。

ステッパーコンポーネント(GcStepper)は、ユーザーが段階的な手順を進める際に、現在のステップや進行状況を視覚的に示すUIコンポーネントです。ステップ間の移動制御、カスタムアイコン表示、進行状況の詳細表示などの機能を提供します。
import '@mescius/inputman/CSS/gc.inputman-js.css'; import { InputMan } from '@mescius/inputman'; InputMan.appearanceStyle = InputMan.AppearanceStyle.Modern; const nameInput = new InputMan.GcTextBox(document.getElementById('name'), { watermarkDisplayNullText: '名前', width: 300, height: 35, }); const addressInput = new InputMan.GcTextBox( document.getElementById('address'), { watermarkDisplayNullText: 'メールアドレス', width: 300, height: 35, } ); const gcStepper = new InputMan.GcStepper( document.getElementById('gcStepper'), { steps: [ { label: 'お名前', title: 'お名前を入力してください', target: () => document.getElementById('form1'), }, { label: 'メールアドレス', title: 'メールアドレスを入力してください', target: () => document.getElementById('form2'), }, { label: '送信完了', title: '送信完了', target: ` <div style="text-align: center; padding: 5px;"> <h3>正常に会員登録が完了いたしました。</h3> <p>ご登録いただいたメールアドレスに認証メールをお送りいたしました。</p> </div> `, }, ], } ); document .querySelectorAll('.prevBtn') .forEach((v) => v.addEventListener('click', () => gcStepper.previous())); document .querySelectorAll('.nextBtn') .forEach((v) => v.addEventListener('click', () => gcStepper.next()));
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>ステッパーコンポーネント - 概要</title> <!-- SystemJS --> <script src="node_modules/systemjs/dist/system.src.js"></script> <script src="systemjs.config.js"></script> <script> window.onload = function () { System.import('./src/app'); } </script> </head> <body> <div id="form1"> <input id="name" /> <button class="nextBtn">次へ</button> </div> <div id="form2"> <input id="address" /> <div class="button-group"> <button class="prevBtn">戻る</button> <button class="nextBtn">次へ</button> </div> </div> <div class="container"> <div id="gcStepper"></div> </div> </body> </html>
button { min-width: 60px; padding: 5px 7px; border: none; border-radius: 6px; background: #0056d6; color: #fff; font-size: 0.8em; font-weight: 300; cursor: pointer; margin-left: 10px; margin-top: 10px; box-shadow: 0 1px 3px #0056d61a; } .container { border: 1px solid #ccc; margin: 10px auto; background: #fff; border-radius: 12px; box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1); padding: 32px 36px 28px 36px; } .prevBtn, .panel button { background: #f3f4f6; color: #2d3a4b; border: 1px solid #e0e0e0; } .step { width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; } #form1, #form2 { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; } #form2 input { margin-bottom: 10px; } #form2 .button-group { display: flex; gap: 10px; } .gcim_watermark_null { color: lightgrey; }
button { min-width: 60px; padding: 5px 7px; border: none; border-radius: 6px; background: #0056d6; color: #fff; font-size: 0.8em; font-weight: 300; cursor: pointer; margin-left: 10px; margin-top: 10px; box-shadow: 0 1px 3px #0056d61a; } .prevBtn, .panel button { background: #f3f4f6; color: #2d3a4b; border: 1px solid #e0e0e0; } .step { width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; } #form1, #form2 { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; } #form2 input { margin-bottom: 10px; } #form2 .button-group { display: flex; gap: 10px; } [gcim-control-appearance="modern"] .gcim_watermark_null { color: lightgrey; }
System.config({ transpiler: 'plugin-babel', babelOptions: { es2015: true }, meta: { '*.css': { loader: 'css' } }, paths: { // paths serve as alias 'npm:': 'node_modules/' }, // map tells the System loader where to look for things map: { '@mescius/inputman': 'npm:@mescius/inputman/index.js', '@mescius/inputman/CSS': 'npm:@mescius/inputman/CSS', '@mescius/inputman.richtexteditor': 'npm:@mescius/inputman.richtexteditor/index.js', "@mescius/inputman.richtexteditor/CSS": "npm:@mescius/inputman.richtexteditor/CSS", '@mescius/inputman.richtexteditor/JS/plugins/advlist': 'npm:@mescius/inputman.richtexteditor/JS/plugins/advlist/plugin.js', '@mescius/inputman.richtexteditor/JS/plugins/all': 'npm:@mescius/inputman.richtexteditor/JS/plugins/all/plugin.js', '@mescius/inputman.richtexteditor/JS/plugins/autosave': 'npm:@mescius/inputman.richtexteditor/JS/plugins/autosave/plugin.js', '@mescius/inputman.richtexteditor/JS/plugins/charmap': 'npm:@mescius/inputman.richtexteditor/JS/plugins/charmap/plugin.js', '@mescius/inputman.richtexteditor/JS/plugins/directionality': 'npm:@mescius/inputman.richtexteditor/JS/plugins/directionality/plugin.js', '@mescius/inputman.richtexteditor/JS/plugins/emoticons': 'npm:@mescius/inputman.richtexteditor/JS/plugins/emoticons/plugin.js', '@mescius/inputman.richtexteditor/JS/plugins/fullscreen': 'npm:@mescius/inputman.richtexteditor/JS/plugins/fullscreen/plugin.js', '@mescius/inputman.richtexteditor/JS/plugins/htmlcode': 'npm:@mescius/inputman.richtexteditor/JS/plugins/htmlcode/plugin.js', '@mescius/inputman.richtexteditor/JS/plugins/image': 'npm:@mescius/inputman.richtexteditor/JS/plugins/image/plugin.js', '@mescius/inputman.richtexteditor/JS/plugins/link': 'npm:@mescius/inputman.richtexteditor/JS/plugins/link/plugin.js', '@mescius/inputman.richtexteditor/JS/plugins/lists': 'npm:@mescius/inputman.richtexteditor/JS/plugins/lists/plugin.js', '@mescius/inputman.richtexteditor/JS/plugins/media': 'npm:@mescius/inputman.richtexteditor/JS/plugins/media/plugin.js', '@mescius/inputman.richtexteditor/JS/plugins/pagebreak': 'npm:@mescius/inputman.richtexteditor/JS/plugins/pagebreak/plugin.js', '@mescius/inputman.richtexteditor/JS/plugins/preview': 'npm:@mescius/inputman.richtexteditor/JS/plugins/preview/plugin.js', '@mescius/inputman.richtexteditor/JS/plugins/save': 'npm:@mescius/inputman.richtexteditor/JS/plugins/save/plugin.js', '@mescius/inputman.richtexteditor/JS/plugins/searchreplace': 'npm:@mescius/inputman.richtexteditor/JS/plugins/searchreplace/plugin.js', '@mescius/inputman.richtexteditor/JS/plugins/table': 'npm:@mescius/inputman.richtexteditor/JS/plugins/table/plugin.js', '@mescius/inputman.richtexteditor/JS/plugins/template': 'npm:@mescius/inputman.richtexteditor/JS/plugins/template/plugin.js', '@mescius/inputman.richtexteditor/JS/plugins/wordcount': 'npm:@mescius/inputman.richtexteditor/JS/plugins/wordcount/plugin.js', '@mescius/inputman.comment': 'npm:@mescius/inputman.comment/index.js', '@mescius/inputman.comment/CSS': 'npm:@mescius/inputman.comment/CSS', '@mescius/wijmo': 'npm:@mescius/wijmo/index.js', '@mescius/wijmo.styles': 'npm:@mescius/wijmo.styles', '@mescius/wijmo.cultures': 'npm:@mescius/wijmo.cultures', '@mescius/wijmo.input': 'npm:@mescius/wijmo.input/index.js', '@mescius/wijmo.grid': 'npm:@mescius/wijmo.grid/index.js', '@mescius/wijmo.nav': 'npm:@mescius/wijmo.nav/index.js', '@mescius/spread-sheets': 'npm:@mescius/spread-sheets/index.js', '@mescius/spread-sheets-resources-ja': 'npm:@mescius/spread-sheets-resources-ja/index.js', '@mescius/spread-sheets/styles': 'npm:@mescius/spread-sheets/styles', 'css': 'npm:systemjs-plugin-css/css.js', 'plugin-babel': 'npm:systemjs-plugin-babel/plugin-babel.js', 'systemjs-babel-build': 'npm:systemjs-plugin-babel/systemjs-babel-browser.js' }, // packages tells the System loader how to load when no filename and/or no extension packages: { src: { defaultExtension: 'js' }, "node_modules": { defaultExtension: 'js' }, } });