2024-01-20 03:33:34 +08:00
import { createApp } from 'vue/dist/vue.esm-bundler.js' ;
import { shallowRef } from 'vue' ;
import WizardModal from '../../../vue/shared/wizard_modal.vue' ;
2024-04-02 16:29:20 +08:00
import InfoModal from '../../../vue/shared/info_modal.vue' ;
2024-01-20 03:33:34 +08:00
import Step1 from './wizard_steps/step_1.vue' ;
import Step2 from './wizard_steps/step_2.vue' ;
import Step3 from './wizard_steps/step_3.vue' ;
import { mountWithTurbolinks } from '../helpers/turbolinks.js' ;
const app = createApp ( {
components : {
Step1 ,
Step2 ,
Step3
} ,
methods : {
fireAlert ( ) {
alert ( 'Fired!' ) ;
}
} ,
data ( ) {
return {
2024-04-02 16:29:20 +08:00
// Wizard modal
2024-01-20 03:33:34 +08:00
wizardConfig : {
title : 'Wizard steps' ,
subtitle : 'Wizard subtitle description' ,
steps : [
{
id : 'step1' ,
2024-04-08 17:35:41 +08:00
icon : 'sn-icon-open' ,
2024-01-20 03:33:34 +08:00
label : 'Step 1' ,
component : shallowRef ( Step1 )
} ,
{
id : 'step2' ,
2024-04-08 17:35:41 +08:00
icon : 'sn-icon-edit' ,
2024-01-20 03:33:34 +08:00
label : 'Step 2' ,
component : shallowRef ( Step2 )
} ,
{
id : 'step3' ,
2024-04-08 17:35:41 +08:00
icon : 'sn-icon-inventory' ,
2024-01-20 03:33:34 +08:00
label : 'Step 3' ,
component : shallowRef ( Step3 )
}
]
} ,
wizardParams : {
text : 'Some text'
} ,
2024-04-02 16:29:20 +08:00
showWizard : false ,
// Info modal
infoParams : {
2024-04-08 17:35:41 +08:00
title : 'Guide for updating the inventory' ,
2024-04-02 16:29:20 +08:00
modalTitle : 'Update inventory' ,
helpText : 'Help' ,
2024-04-08 17:35:41 +08:00
steps : [
2024-04-02 16:29:20 +08:00
{
id : 'el1' ,
2024-04-08 17:35:41 +08:00
icon : 'sn-icon-export' ,
2024-04-02 16:29:20 +08:00
label : 'Export inventory' ,
subtext : "Before making edits, we advise you to export the latest inventory information. If you're only adding new items, consider exporting empty inventory."
} ,
{
id : 'el2' ,
2024-04-08 17:35:41 +08:00
icon : 'sn-icon-edit' ,
2024-04-02 16:29:20 +08:00
label : 'Edit your data' ,
subtext : 'Make sure to include header names in first row, followed by item data.'
} ,
{
id : 'el3' ,
2024-04-08 17:35:41 +08:00
icon : 'sn-icon-import' ,
2024-04-02 16:29:20 +08:00
label : 'Import new or update items' ,
subtext : 'Upload your data using .xlsx, .csv or .txt files.'
} ,
{
id : 'el4' ,
2024-04-08 17:35:41 +08:00
icon : 'sn-icon-tables' ,
2024-04-02 16:29:20 +08:00
label : 'Merge your data' ,
subtext : 'Complete the process by merging the columns you want to update.'
} ,
{
id : 'el5' ,
2024-04-08 17:35:41 +08:00
icon : 'sn-icon-open' ,
2024-04-02 16:29:20 +08:00
label : 'Learn more' ,
linkTo : 'https://knowledgebase.scinote.net/en/knowledge/how-to-add-items-to-an-inventory'
}
]
} ,
showInfo : false
2024-01-20 03:33:34 +08:00
} ;
}
} ) ;
app . component ( 'WizardModal' , WizardModal ) ;
2024-04-02 16:29:20 +08:00
app . component ( 'InfoModal' , InfoModal ) ;
2024-01-20 03:33:34 +08:00
app . config . globalProperties . i18n = window . I18n ;
mountWithTurbolinks ( app , '#modals' ) ;