@dooboostore/simple-web-component 1.0.13 → 1.0.14
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/dist/cjs/decorators/elementDefine.js.map +2 -2
- package/dist/cjs/elements/SwcInterfaces.js.map +2 -2
- package/dist/cjs/elements/apps/SwcApp.js +14 -7
- package/dist/cjs/elements/apps/SwcApp.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppAnchor.js +14 -7
- package/dist/cjs/elements/apps/SwcAppAnchor.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppArea.js +14 -7
- package/dist/cjs/elements/apps/SwcAppArea.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppAudio.js +14 -7
- package/dist/cjs/elements/apps/SwcAppAudio.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppBase.js +14 -7
- package/dist/cjs/elements/apps/SwcAppBase.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppBody.js +14 -7
- package/dist/cjs/elements/apps/SwcAppBody.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppButton.js +14 -7
- package/dist/cjs/elements/apps/SwcAppButton.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppCanvas.js +14 -7
- package/dist/cjs/elements/apps/SwcAppCanvas.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppData.js +14 -7
- package/dist/cjs/elements/apps/SwcAppData.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppDataList.js +14 -7
- package/dist/cjs/elements/apps/SwcAppDataList.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppDetails.js +14 -7
- package/dist/cjs/elements/apps/SwcAppDetails.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppDialog.js +14 -7
- package/dist/cjs/elements/apps/SwcAppDialog.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppDiv.js +14 -7
- package/dist/cjs/elements/apps/SwcAppDiv.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppDl.js +14 -7
- package/dist/cjs/elements/apps/SwcAppDl.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppEmbed.js +14 -7
- package/dist/cjs/elements/apps/SwcAppEmbed.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppFieldSet.js +14 -7
- package/dist/cjs/elements/apps/SwcAppFieldSet.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppForm.js +14 -7
- package/dist/cjs/elements/apps/SwcAppForm.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppHeading.js +14 -7
- package/dist/cjs/elements/apps/SwcAppHeading.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppHr.js +14 -7
- package/dist/cjs/elements/apps/SwcAppHr.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppIFrame.js +14 -7
- package/dist/cjs/elements/apps/SwcAppIFrame.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppImage.js +14 -7
- package/dist/cjs/elements/apps/SwcAppImage.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppInput.js +14 -7
- package/dist/cjs/elements/apps/SwcAppInput.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppLabel.js +14 -7
- package/dist/cjs/elements/apps/SwcAppLabel.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppLegend.js +14 -7
- package/dist/cjs/elements/apps/SwcAppLegend.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppLi.js +14 -7
- package/dist/cjs/elements/apps/SwcAppLi.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppLink.js +14 -7
- package/dist/cjs/elements/apps/SwcAppLink.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppMap.js +14 -7
- package/dist/cjs/elements/apps/SwcAppMap.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppMeta.js +14 -7
- package/dist/cjs/elements/apps/SwcAppMeta.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppMeter.js +14 -7
- package/dist/cjs/elements/apps/SwcAppMeter.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppMod.js +14 -7
- package/dist/cjs/elements/apps/SwcAppMod.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppObject.js +14 -7
- package/dist/cjs/elements/apps/SwcAppObject.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppOl.js +14 -7
- package/dist/cjs/elements/apps/SwcAppOl.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppOptGroup.js +14 -7
- package/dist/cjs/elements/apps/SwcAppOptGroup.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppOption.js +14 -7
- package/dist/cjs/elements/apps/SwcAppOption.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppOutput.js +14 -7
- package/dist/cjs/elements/apps/SwcAppOutput.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppParagraph.js +14 -7
- package/dist/cjs/elements/apps/SwcAppParagraph.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppParam.js +14 -7
- package/dist/cjs/elements/apps/SwcAppParam.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppPicture.js +14 -7
- package/dist/cjs/elements/apps/SwcAppPicture.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppPre.js +14 -7
- package/dist/cjs/elements/apps/SwcAppPre.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppProgress.js +14 -7
- package/dist/cjs/elements/apps/SwcAppProgress.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppQuote.js +14 -7
- package/dist/cjs/elements/apps/SwcAppQuote.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppScript.js +14 -7
- package/dist/cjs/elements/apps/SwcAppScript.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppSelect.js +14 -7
- package/dist/cjs/elements/apps/SwcAppSelect.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppSlot.js +14 -7
- package/dist/cjs/elements/apps/SwcAppSlot.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppSource.js +14 -7
- package/dist/cjs/elements/apps/SwcAppSource.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppSpan.js +14 -7
- package/dist/cjs/elements/apps/SwcAppSpan.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppStyle.js +14 -7
- package/dist/cjs/elements/apps/SwcAppStyle.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppTable.js +14 -7
- package/dist/cjs/elements/apps/SwcAppTable.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppTableCell.js +14 -7
- package/dist/cjs/elements/apps/SwcAppTableCell.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppTableRow.js +14 -7
- package/dist/cjs/elements/apps/SwcAppTableRow.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppTableSection.js +14 -7
- package/dist/cjs/elements/apps/SwcAppTableSection.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppTemplate.js +14 -7
- package/dist/cjs/elements/apps/SwcAppTemplate.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppTextArea.js +14 -7
- package/dist/cjs/elements/apps/SwcAppTextArea.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppTime.js +14 -7
- package/dist/cjs/elements/apps/SwcAppTime.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppTitle.js +14 -7
- package/dist/cjs/elements/apps/SwcAppTitle.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppTrack.js +14 -7
- package/dist/cjs/elements/apps/SwcAppTrack.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppUl.js +14 -7
- package/dist/cjs/elements/apps/SwcAppUl.js.map +2 -2
- package/dist/cjs/elements/apps/SwcAppVideo.js +14 -7
- package/dist/cjs/elements/apps/SwcAppVideo.js.map +2 -2
- package/dist/cjs/router/ElementRouter.js +172 -0
- package/dist/cjs/router/ElementRouter.js.map +7 -0
- package/dist/esm/decorators/elementDefine.js.map +2 -2
- package/dist/esm/elements/SwcInterfaces.js.map +2 -2
- package/dist/esm/elements/apps/SwcApp.js +14 -7
- package/dist/esm/elements/apps/SwcApp.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppAnchor.js +14 -7
- package/dist/esm/elements/apps/SwcAppAnchor.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppArea.js +14 -7
- package/dist/esm/elements/apps/SwcAppArea.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppAudio.js +14 -7
- package/dist/esm/elements/apps/SwcAppAudio.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppBase.js +14 -7
- package/dist/esm/elements/apps/SwcAppBase.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppBody.js +14 -7
- package/dist/esm/elements/apps/SwcAppBody.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppButton.js +14 -7
- package/dist/esm/elements/apps/SwcAppButton.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppCanvas.js +14 -7
- package/dist/esm/elements/apps/SwcAppCanvas.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppData.js +14 -7
- package/dist/esm/elements/apps/SwcAppData.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppDataList.js +14 -7
- package/dist/esm/elements/apps/SwcAppDataList.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppDetails.js +14 -7
- package/dist/esm/elements/apps/SwcAppDetails.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppDialog.js +14 -7
- package/dist/esm/elements/apps/SwcAppDialog.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppDiv.js +14 -7
- package/dist/esm/elements/apps/SwcAppDiv.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppDl.js +14 -7
- package/dist/esm/elements/apps/SwcAppDl.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppEmbed.js +14 -7
- package/dist/esm/elements/apps/SwcAppEmbed.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppFieldSet.js +14 -7
- package/dist/esm/elements/apps/SwcAppFieldSet.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppForm.js +14 -7
- package/dist/esm/elements/apps/SwcAppForm.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppHeading.js +14 -7
- package/dist/esm/elements/apps/SwcAppHeading.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppHr.js +14 -7
- package/dist/esm/elements/apps/SwcAppHr.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppIFrame.js +14 -7
- package/dist/esm/elements/apps/SwcAppIFrame.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppImage.js +14 -7
- package/dist/esm/elements/apps/SwcAppImage.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppInput.js +14 -7
- package/dist/esm/elements/apps/SwcAppInput.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppLabel.js +14 -7
- package/dist/esm/elements/apps/SwcAppLabel.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppLegend.js +14 -7
- package/dist/esm/elements/apps/SwcAppLegend.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppLi.js +14 -7
- package/dist/esm/elements/apps/SwcAppLi.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppLink.js +14 -7
- package/dist/esm/elements/apps/SwcAppLink.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppMap.js +14 -7
- package/dist/esm/elements/apps/SwcAppMap.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppMeta.js +14 -7
- package/dist/esm/elements/apps/SwcAppMeta.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppMeter.js +14 -7
- package/dist/esm/elements/apps/SwcAppMeter.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppMod.js +14 -7
- package/dist/esm/elements/apps/SwcAppMod.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppObject.js +14 -7
- package/dist/esm/elements/apps/SwcAppObject.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppOl.js +14 -7
- package/dist/esm/elements/apps/SwcAppOl.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppOptGroup.js +14 -7
- package/dist/esm/elements/apps/SwcAppOptGroup.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppOption.js +14 -7
- package/dist/esm/elements/apps/SwcAppOption.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppOutput.js +14 -7
- package/dist/esm/elements/apps/SwcAppOutput.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppParagraph.js +14 -7
- package/dist/esm/elements/apps/SwcAppParagraph.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppParam.js +14 -7
- package/dist/esm/elements/apps/SwcAppParam.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppPicture.js +14 -7
- package/dist/esm/elements/apps/SwcAppPicture.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppPre.js +14 -7
- package/dist/esm/elements/apps/SwcAppPre.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppProgress.js +14 -7
- package/dist/esm/elements/apps/SwcAppProgress.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppQuote.js +14 -7
- package/dist/esm/elements/apps/SwcAppQuote.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppScript.js +14 -7
- package/dist/esm/elements/apps/SwcAppScript.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppSelect.js +14 -7
- package/dist/esm/elements/apps/SwcAppSelect.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppSlot.js +14 -7
- package/dist/esm/elements/apps/SwcAppSlot.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppSource.js +14 -7
- package/dist/esm/elements/apps/SwcAppSource.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppSpan.js +14 -7
- package/dist/esm/elements/apps/SwcAppSpan.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppStyle.js +14 -7
- package/dist/esm/elements/apps/SwcAppStyle.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppTable.js +14 -7
- package/dist/esm/elements/apps/SwcAppTable.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppTableCell.js +14 -7
- package/dist/esm/elements/apps/SwcAppTableCell.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppTableRow.js +14 -7
- package/dist/esm/elements/apps/SwcAppTableRow.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppTableSection.js +14 -7
- package/dist/esm/elements/apps/SwcAppTableSection.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppTemplate.js +14 -7
- package/dist/esm/elements/apps/SwcAppTemplate.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppTextArea.js +14 -7
- package/dist/esm/elements/apps/SwcAppTextArea.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppTime.js +14 -7
- package/dist/esm/elements/apps/SwcAppTime.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppTitle.js +14 -7
- package/dist/esm/elements/apps/SwcAppTitle.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppTrack.js +14 -7
- package/dist/esm/elements/apps/SwcAppTrack.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppUl.js +14 -7
- package/dist/esm/elements/apps/SwcAppUl.js.map +2 -2
- package/dist/esm/elements/apps/SwcAppVideo.js +14 -7
- package/dist/esm/elements/apps/SwcAppVideo.js.map +2 -2
- package/dist/esm/router/ElementRouter.js +153 -0
- package/dist/esm/router/ElementRouter.js.map +7 -0
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +912 -415
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +4 -4
- package/dist/types/decorators/elementDefine.d.ts.map +1 -1
- package/dist/types/elements/SwcInterfaces.d.ts +3 -1
- package/dist/types/elements/SwcInterfaces.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcApp.d.ts +2 -3
- package/dist/types/elements/apps/SwcApp.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppAnchor.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppAnchor.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppArea.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppArea.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppAudio.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppAudio.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppBase.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppBase.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppBody.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppBody.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppButton.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppButton.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppCanvas.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppCanvas.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppData.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppData.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppDataList.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppDataList.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppDetails.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppDetails.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppDialog.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppDialog.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppDiv.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppDiv.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppDl.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppDl.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppEmbed.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppEmbed.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppFieldSet.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppFieldSet.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppForm.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppForm.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppHeading.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppHeading.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppHr.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppHr.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppIFrame.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppIFrame.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppImage.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppImage.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppInput.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppInput.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppLabel.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppLabel.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppLegend.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppLegend.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppLi.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppLi.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppLink.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppLink.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppMap.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppMap.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppMeta.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppMeta.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppMeter.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppMeter.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppMod.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppMod.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppObject.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppObject.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppOl.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppOl.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppOptGroup.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppOptGroup.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppOption.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppOption.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppOutput.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppOutput.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppParagraph.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppParagraph.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppParam.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppParam.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppPicture.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppPicture.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppPre.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppPre.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppProgress.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppProgress.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppQuote.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppQuote.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppScript.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppScript.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppSelect.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppSelect.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppSlot.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppSlot.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppSource.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppSource.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppSpan.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppSpan.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppStyle.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppStyle.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppTable.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppTable.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppTableCell.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppTableCell.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppTableRow.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppTableRow.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppTableSection.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppTableSection.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppTemplate.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppTemplate.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppTextArea.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppTextArea.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppTime.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppTime.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppTitle.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppTitle.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppTrack.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppTrack.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppUl.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppUl.d.ts.map +1 -1
- package/dist/types/elements/apps/SwcAppVideo.d.ts +2 -3
- package/dist/types/elements/apps/SwcAppVideo.d.ts.map +1 -1
- package/dist/types/router/ElementRouter.d.ts +41 -0
- package/dist/types/router/ElementRouter.d.ts.map +1 -0
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +912 -415
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +4 -4
- package/package.json +2 -2
- package/src/decorators/elementDefine.ts +1 -0
- package/src/elements/SwcInterfaces.ts +6 -2
- package/src/elements/apps/SwcApp.ts +17 -9
- package/src/elements/apps/SwcAppAnchor.ts +17 -9
- package/src/elements/apps/SwcAppArea.ts +17 -9
- package/src/elements/apps/SwcAppAudio.ts +17 -9
- package/src/elements/apps/SwcAppBase.ts +17 -9
- package/src/elements/apps/SwcAppBody.ts +17 -9
- package/src/elements/apps/SwcAppButton.ts +17 -9
- package/src/elements/apps/SwcAppCanvas.ts +17 -9
- package/src/elements/apps/SwcAppData.ts +17 -9
- package/src/elements/apps/SwcAppDataList.ts +17 -9
- package/src/elements/apps/SwcAppDetails.ts +17 -9
- package/src/elements/apps/SwcAppDialog.ts +17 -9
- package/src/elements/apps/SwcAppDiv.ts +17 -9
- package/src/elements/apps/SwcAppDl.ts +17 -9
- package/src/elements/apps/SwcAppEmbed.ts +17 -9
- package/src/elements/apps/SwcAppFieldSet.ts +17 -9
- package/src/elements/apps/SwcAppForm.ts +17 -9
- package/src/elements/apps/SwcAppHeading.ts +17 -9
- package/src/elements/apps/SwcAppHr.ts +17 -9
- package/src/elements/apps/SwcAppIFrame.ts +17 -9
- package/src/elements/apps/SwcAppImage.ts +17 -9
- package/src/elements/apps/SwcAppInput.ts +17 -9
- package/src/elements/apps/SwcAppLabel.ts +17 -9
- package/src/elements/apps/SwcAppLegend.ts +17 -9
- package/src/elements/apps/SwcAppLi.ts +17 -9
- package/src/elements/apps/SwcAppLink.ts +17 -9
- package/src/elements/apps/SwcAppMap.ts +17 -9
- package/src/elements/apps/SwcAppMeta.ts +17 -9
- package/src/elements/apps/SwcAppMeter.ts +17 -9
- package/src/elements/apps/SwcAppMod.ts +17 -9
- package/src/elements/apps/SwcAppObject.ts +17 -9
- package/src/elements/apps/SwcAppOl.ts +17 -9
- package/src/elements/apps/SwcAppOptGroup.ts +17 -9
- package/src/elements/apps/SwcAppOption.ts +17 -9
- package/src/elements/apps/SwcAppOutput.ts +17 -9
- package/src/elements/apps/SwcAppParagraph.ts +17 -9
- package/src/elements/apps/SwcAppParam.ts +17 -9
- package/src/elements/apps/SwcAppPicture.ts +17 -9
- package/src/elements/apps/SwcAppPre.ts +17 -9
- package/src/elements/apps/SwcAppProgress.ts +17 -9
- package/src/elements/apps/SwcAppQuote.ts +17 -9
- package/src/elements/apps/SwcAppScript.ts +17 -9
- package/src/elements/apps/SwcAppSelect.ts +17 -9
- package/src/elements/apps/SwcAppSlot.ts +17 -9
- package/src/elements/apps/SwcAppSource.ts +17 -9
- package/src/elements/apps/SwcAppSpan.ts +17 -9
- package/src/elements/apps/SwcAppStyle.ts +17 -9
- package/src/elements/apps/SwcAppTable.ts +17 -9
- package/src/elements/apps/SwcAppTableCell.ts +17 -9
- package/src/elements/apps/SwcAppTableRow.ts +17 -9
- package/src/elements/apps/SwcAppTableSection.ts +17 -9
- package/src/elements/apps/SwcAppTemplate.ts +17 -9
- package/src/elements/apps/SwcAppTextArea.ts +17 -9
- package/src/elements/apps/SwcAppTime.ts +17 -9
- package/src/elements/apps/SwcAppTitle.ts +17 -9
- package/src/elements/apps/SwcAppTrack.ts +17 -9
- package/src/elements/apps/SwcAppUl.ts +17 -9
- package/src/elements/apps/SwcAppVideo.ts +17 -9
- package/src/router/ElementRouter.ts +187 -0
|
@@ -25,6 +25,7 @@ var import_elementDefine = require("../../decorators/elementDefine");
|
|
|
25
25
|
var import_SimpleApplication = require("@dooboostore/simple-boot/SimpleApplication");
|
|
26
26
|
var import_PathRouter = require("@dooboostore/core-web/routers/PathRouter");
|
|
27
27
|
var import_HashRouter = require("@dooboostore/core-web/routers/HashRouter");
|
|
28
|
+
var import_ElementRouter = require("../../router/ElementRouter");
|
|
28
29
|
var import_SimOption = require("@dooboostore/simple-boot/SimOption");
|
|
29
30
|
var import_Router = require("@dooboostore/core-web/routers/Router");
|
|
30
31
|
var __decorate = function(decorators, target, key, desc) {
|
|
@@ -51,12 +52,18 @@ let SwcAppProgress = class SwcAppProgress2 extends import_SwcHTMLProgressElement
|
|
|
51
52
|
const userConfig = new Function(`return ${applicationConfigStr}`).apply(this);
|
|
52
53
|
if (userConfig) {
|
|
53
54
|
const _config = {
|
|
54
|
-
routeType: "
|
|
55
|
+
routeType: "element",
|
|
55
56
|
window,
|
|
56
57
|
...userConfig
|
|
57
58
|
};
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
if (_config.routeType === "path") {
|
|
60
|
+
this.router = new import_PathRouter.PathRouter({ window: _config.window, firstUrl: _config.path });
|
|
61
|
+
} else if (_config.routeType === "hash") {
|
|
62
|
+
this.router = new import_HashRouter.HashRouter({ window: _config.window, firstUrl: _config.path });
|
|
63
|
+
} else {
|
|
64
|
+
this.router = new import_ElementRouter.ElementRouter({ window: _config.window, firstUrl: _config.path });
|
|
65
|
+
}
|
|
66
|
+
this.routerSubscription = this.router.observable.subscribe((route) => {
|
|
60
67
|
if (route.triggerPoint === "end") {
|
|
61
68
|
this.routingProcess(route.path);
|
|
62
69
|
}
|
|
@@ -67,8 +74,8 @@ let SwcAppProgress = class SwcAppProgress2 extends import_SwcHTMLProgressElement
|
|
|
67
74
|
});
|
|
68
75
|
this.simpleApplication = new import_SimpleApplication.SimpleApplication(option);
|
|
69
76
|
const otherInstanceSim = /* @__PURE__ */ new Map();
|
|
70
|
-
if (this.
|
|
71
|
-
otherInstanceSim.set(import_Router.Router, this.
|
|
77
|
+
if (this.router) {
|
|
78
|
+
otherInstanceSim.set(import_Router.Router, this.router);
|
|
72
79
|
}
|
|
73
80
|
this.simpleApplication.run(otherInstanceSim);
|
|
74
81
|
const data = this.simpleApplication.sim(_config.rootRouter);
|
|
@@ -80,7 +87,7 @@ let SwcAppProgress = class SwcAppProgress2 extends import_SwcHTMLProgressElement
|
|
|
80
87
|
}
|
|
81
88
|
}
|
|
82
89
|
if (_config.path) {
|
|
83
|
-
await this.
|
|
90
|
+
await this.router?.go(_config.path);
|
|
84
91
|
}
|
|
85
92
|
}
|
|
86
93
|
} catch (e) {
|
|
@@ -92,7 +99,7 @@ let SwcAppProgress = class SwcAppProgress2 extends import_SwcHTMLProgressElement
|
|
|
92
99
|
this.routerSubscription?.unsubscribe();
|
|
93
100
|
}
|
|
94
101
|
async routing(path) {
|
|
95
|
-
await this.
|
|
102
|
+
await this.router?.go(path);
|
|
96
103
|
}
|
|
97
104
|
async routingProcess(path) {
|
|
98
105
|
await this.simpleApplication?.routing(path);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/elements/apps/SwcAppProgress.ts"],
|
|
4
|
-
"sourcesContent": ["import { SwcHTMLProgressElementBase } from '../base/SwcHTMLProgressElementBase';\nimport { elementDefine } from '../../decorators/elementDefine';\nimport { SimpleApplication } from '@dooboostore/simple-boot/SimpleApplication';\nimport { SwcAppInterface, SwcConfigType, SwcAttributeConfigType } from '../SwcInterfaces';\nimport { PathRouter } from '@dooboostore/core-web/routers/PathRouter';\nimport { HashRouter } from '@dooboostore/core-web/routers/HashRouter';\nimport { SimOption } from '@dooboostore/simple-boot/SimOption';\nimport { ConstructorType } from '@dooboostore/core/types';\nimport { Router, RouterEventType } from '@dooboostore/core-web/routers/Router';\nimport { Subscription } from '@dooboostore/core/message/Subscription';\n\n@elementDefine({ name: 'swc-app-progress', extends: 'progress' })\nexport class SwcAppProgress extends SwcHTMLProgressElementBase implements SwcAppInterface {\n public simpleApplication?: SimpleApplication;\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA,wCAA2C;AAC3C,2BAA8B;AAC9B,+BAAkC;AAElC,wBAA2B;AAC3B,wBAA2B;AAC3B,uBAA0B;AAE1B,oBAAwC;;;;;;;;;;AAIjC,IAAM,iBAAN,MAAMA,wBAAuB,6DAA0B;EAK5D,cAAA;AACE,UAAK;EACP;EAEA,MAAM,oBAAiB;AACrB,QAAI,KAAK;AAAgB;AACzB,SAAK,iBAAiB;AAGtB,UAAM,IAAI,QAAQ,aAAW,WAAW,SAAS,CAAC,CAAC;AAEnD,UAAM,uBAAuB,KAAK,aAAa,4BAA4B;AAC3E,QAAI,sBAAsB;AACxB,UAAI;AACF,cAAM,aAAqC,IAAI,SAAS,UAAU,oBAAoB,EAAE,EAAE,MAAM,IAAI;AACpG,YAAI,YAAY;AACd,gBAAM,
|
|
4
|
+
"sourcesContent": ["import { SwcHTMLProgressElementBase } from '../base/SwcHTMLProgressElementBase';\nimport { elementDefine } from '../../decorators/elementDefine';\nimport { SimpleApplication } from '@dooboostore/simple-boot/SimpleApplication';\nimport { SwcAppInterface, SwcConfigType, SwcAttributeConfigType } from '../SwcInterfaces';\nimport { PathRouter } from '@dooboostore/core-web/routers/PathRouter';\nimport { HashRouter } from '@dooboostore/core-web/routers/HashRouter';\nimport { ElementRouter } from '../../router/ElementRouter';\nimport { SimOption } from '@dooboostore/simple-boot/SimOption';\nimport { ConstructorType } from '@dooboostore/core/types';\nimport { Router, RouterEventType } from '@dooboostore/core-web/routers/Router';\nimport { Subscription } from '@dooboostore/core/message/Subscription';\n\n@elementDefine({ name: 'swc-app-progress', extends: 'progress' })\nexport class SwcAppProgress extends SwcHTMLProgressElementBase implements SwcAppInterface {\n public simpleApplication?: SimpleApplication;\n public router?: Router;\n private routerSubscription?: Subscription;\n\n constructor() {\n super();\n }\n\n async connectedCallback() {\n if (this._isInitialized) return;\n this._isInitialized = true;\n\n // Push to the end of the event loop to ensure global scripts are evaluated\n await new Promise(resolve => setTimeout(resolve, 0));\n\n const applicationConfigStr = this.getAttribute('swc-get-application-config');\n if (applicationConfigStr) {\n try {\n const userConfig: SwcAttributeConfigType = new Function(`return ${applicationConfigStr}`).apply(this);\n if (userConfig) {\n const _config: SwcConfigType = {\n routeType: 'element',\n window: window,\n ...userConfig\n };\n\n if (_config.routeType === 'path') {\n this.router = new PathRouter({ window: _config.window, firstUrl: _config.path });\n } else if (_config.routeType === 'hash') {\n this.router = new HashRouter({ window: _config.window, firstUrl: _config.path });\n } else {\n this.router = new ElementRouter({ window: _config.window, firstUrl: _config.path });\n }\n\n this.routerSubscription = this.router.observable.subscribe((route: RouterEventType) => {\n if (route.triggerPoint === 'end') {\n this.routingProcess(route.path);\n }\n });\n const option = new SimOption({\n excludeProxys: [Node],\n rootRouter: _config.rootRouter\n });\n\n this.simpleApplication = new SimpleApplication(option);\n\n // Use 'any' key for Map to allow Abstract classes like Router\n const otherInstanceSim = new Map<any, any>();\n if (this.router) {\n otherInstanceSim.set(Router, this.router);\n }\n this.simpleApplication.run(otherInstanceSim);\n const data = this.simpleApplication.sim(_config.rootRouter);\n if (data instanceof Node) {\n if (this.shadowRoot) {\n this.shadowRoot.replaceChildren(data);\n } else if (!this.contains(data)) {\n this.replaceChildren(data);\n }\n }\n if (_config.path) {\n await this.router?.go(_config.path);\n }\n }\n } catch (e) {\n console.error('[SWC-APP] Failed to execute swc-get-application-config script:', e);\n }\n }\n }\n\n disconnectedCallback() {\n this.routerSubscription?.unsubscribe();\n }\n\n async routing(path: string) {\n await this.router?.go(path);\n }\n\n private async routingProcess(path: string) {\n await this.simpleApplication?.routing(path);\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA,wCAA2C;AAC3C,2BAA8B;AAC9B,+BAAkC;AAElC,wBAA2B;AAC3B,wBAA2B;AAC3B,2BAA8B;AAC9B,uBAA0B;AAE1B,oBAAwC;;;;;;;;;;AAIjC,IAAM,iBAAN,MAAMA,wBAAuB,6DAA0B;EAK5D,cAAA;AACE,UAAK;EACP;EAEA,MAAM,oBAAiB;AACrB,QAAI,KAAK;AAAgB;AACzB,SAAK,iBAAiB;AAGtB,UAAM,IAAI,QAAQ,aAAW,WAAW,SAAS,CAAC,CAAC;AAEnD,UAAM,uBAAuB,KAAK,aAAa,4BAA4B;AAC3E,QAAI,sBAAsB;AACxB,UAAI;AACF,cAAM,aAAqC,IAAI,SAAS,UAAU,oBAAoB,EAAE,EAAE,MAAM,IAAI;AACpG,YAAI,YAAY;AACd,gBAAM,UAAyB;YAC7B,WAAW;YACX;YACA,GAAG;;AAGL,cAAI,QAAQ,cAAc,QAAQ;AAChC,iBAAK,SAAS,IAAI,6BAAW,EAAE,QAAQ,QAAQ,QAAQ,UAAU,QAAQ,KAAI,CAAE;UACjF,WAAW,QAAQ,cAAc,QAAQ;AACvC,iBAAK,SAAS,IAAI,6BAAW,EAAE,QAAQ,QAAQ,QAAQ,UAAU,QAAQ,KAAI,CAAE;UACjF,OAAO;AACL,iBAAK,SAAS,IAAI,mCAAc,EAAE,QAAQ,QAAQ,QAAQ,UAAU,QAAQ,KAAI,CAAE;UACpF;AAEA,eAAK,qBAAqB,KAAK,OAAO,WAAW,UAAU,CAAC,UAA0B;AACpF,gBAAI,MAAM,iBAAiB,OAAO;AAChC,mBAAK,eAAe,MAAM,IAAI;YAChC;UACF,CAAC;AACD,gBAAM,SAAS,IAAI,2BAAU;YAC3B,eAAe,CAAC,IAAI;YACpB,YAAY,QAAQ;WACrB;AAED,eAAK,oBAAoB,IAAI,2CAAkB,MAAM;AAGrD,gBAAM,mBAAmB,oBAAI,IAAG;AAChC,cAAI,KAAK,QAAQ;AACf,6BAAiB,IAAI,sBAAQ,KAAK,MAAM;UAC1C;AACA,eAAK,kBAAkB,IAAI,gBAAgB;AAC3C,gBAAM,OAAO,KAAK,kBAAkB,IAAI,QAAQ,UAAU;AAC1D,cAAI,gBAAgB,MAAM;AACxB,gBAAI,KAAK,YAAY;AACnB,mBAAK,WAAW,gBAAgB,IAAI;YACtC,WAAW,CAAC,KAAK,SAAS,IAAI,GAAG;AAC/B,mBAAK,gBAAgB,IAAI;YAC3B;UACF;AACA,cAAI,QAAQ,MAAM;AAChB,kBAAM,KAAK,QAAQ,GAAG,QAAQ,IAAI;UACpC;QACF;MACF,SAAS,GAAG;AACV,gBAAQ,MAAM,kEAAkE,CAAC;MACnF;IACF;EACF;EAEA,uBAAoB;AAClB,SAAK,oBAAoB,YAAW;EACtC;EAEA,MAAM,QAAQ,MAAY;AACxB,UAAM,KAAK,QAAQ,GAAG,IAAI;EAC5B;EAEQ,MAAM,eAAe,MAAY;AACvC,UAAM,KAAK,mBAAmB,QAAQ,IAAI;EAC5C;;AAjFW,iBAAc,WAAA;MAD1B,oCAAc,EAAE,MAAM,oBAAoB,SAAS,WAAU,CAAE;;GACnD,cAAc;",
|
|
6
6
|
"names": ["SwcAppProgress"]
|
|
7
7
|
}
|
|
@@ -25,6 +25,7 @@ var import_elementDefine = require("../../decorators/elementDefine");
|
|
|
25
25
|
var import_SimpleApplication = require("@dooboostore/simple-boot/SimpleApplication");
|
|
26
26
|
var import_PathRouter = require("@dooboostore/core-web/routers/PathRouter");
|
|
27
27
|
var import_HashRouter = require("@dooboostore/core-web/routers/HashRouter");
|
|
28
|
+
var import_ElementRouter = require("../../router/ElementRouter");
|
|
28
29
|
var import_SimOption = require("@dooboostore/simple-boot/SimOption");
|
|
29
30
|
var import_Router = require("@dooboostore/core-web/routers/Router");
|
|
30
31
|
var __decorate = function(decorators, target, key, desc) {
|
|
@@ -51,12 +52,18 @@ let SwcAppQuote = class SwcAppQuote2 extends import_SwcHTMLQuoteElementBase.SwcH
|
|
|
51
52
|
const userConfig = new Function(`return ${applicationConfigStr}`).apply(this);
|
|
52
53
|
if (userConfig) {
|
|
53
54
|
const _config = {
|
|
54
|
-
routeType: "
|
|
55
|
+
routeType: "element",
|
|
55
56
|
window,
|
|
56
57
|
...userConfig
|
|
57
58
|
};
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
if (_config.routeType === "path") {
|
|
60
|
+
this.router = new import_PathRouter.PathRouter({ window: _config.window, firstUrl: _config.path });
|
|
61
|
+
} else if (_config.routeType === "hash") {
|
|
62
|
+
this.router = new import_HashRouter.HashRouter({ window: _config.window, firstUrl: _config.path });
|
|
63
|
+
} else {
|
|
64
|
+
this.router = new import_ElementRouter.ElementRouter({ window: _config.window, firstUrl: _config.path });
|
|
65
|
+
}
|
|
66
|
+
this.routerSubscription = this.router.observable.subscribe((route) => {
|
|
60
67
|
if (route.triggerPoint === "end") {
|
|
61
68
|
this.routingProcess(route.path);
|
|
62
69
|
}
|
|
@@ -67,8 +74,8 @@ let SwcAppQuote = class SwcAppQuote2 extends import_SwcHTMLQuoteElementBase.SwcH
|
|
|
67
74
|
});
|
|
68
75
|
this.simpleApplication = new import_SimpleApplication.SimpleApplication(option);
|
|
69
76
|
const otherInstanceSim = /* @__PURE__ */ new Map();
|
|
70
|
-
if (this.
|
|
71
|
-
otherInstanceSim.set(import_Router.Router, this.
|
|
77
|
+
if (this.router) {
|
|
78
|
+
otherInstanceSim.set(import_Router.Router, this.router);
|
|
72
79
|
}
|
|
73
80
|
this.simpleApplication.run(otherInstanceSim);
|
|
74
81
|
const data = this.simpleApplication.sim(_config.rootRouter);
|
|
@@ -80,7 +87,7 @@ let SwcAppQuote = class SwcAppQuote2 extends import_SwcHTMLQuoteElementBase.SwcH
|
|
|
80
87
|
}
|
|
81
88
|
}
|
|
82
89
|
if (_config.path) {
|
|
83
|
-
await this.
|
|
90
|
+
await this.router?.go(_config.path);
|
|
84
91
|
}
|
|
85
92
|
}
|
|
86
93
|
} catch (e) {
|
|
@@ -92,7 +99,7 @@ let SwcAppQuote = class SwcAppQuote2 extends import_SwcHTMLQuoteElementBase.SwcH
|
|
|
92
99
|
this.routerSubscription?.unsubscribe();
|
|
93
100
|
}
|
|
94
101
|
async routing(path) {
|
|
95
|
-
await this.
|
|
102
|
+
await this.router?.go(path);
|
|
96
103
|
}
|
|
97
104
|
async routingProcess(path) {
|
|
98
105
|
await this.simpleApplication?.routing(path);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/elements/apps/SwcAppQuote.ts"],
|
|
4
|
-
"sourcesContent": ["import { SwcHTMLQuoteElementBase } from '../base/SwcHTMLQuoteElementBase';\nimport { elementDefine } from '../../decorators/elementDefine';\nimport { SimpleApplication } from '@dooboostore/simple-boot/SimpleApplication';\nimport { SwcAppInterface, SwcConfigType, SwcAttributeConfigType } from '../SwcInterfaces';\nimport { PathRouter } from '@dooboostore/core-web/routers/PathRouter';\nimport { HashRouter } from '@dooboostore/core-web/routers/HashRouter';\nimport { SimOption } from '@dooboostore/simple-boot/SimOption';\nimport { ConstructorType } from '@dooboostore/core/types';\nimport { Router, RouterEventType } from '@dooboostore/core-web/routers/Router';\nimport { Subscription } from '@dooboostore/core/message/Subscription';\n\n@elementDefine({ name: 'swc-app-blockquote', extends: 'blockquote' })\nexport class SwcAppQuote extends SwcHTMLQuoteElementBase implements SwcAppInterface {\n public simpleApplication?: SimpleApplication;\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAwC;AACxC,2BAA8B;AAC9B,+BAAkC;AAElC,wBAA2B;AAC3B,wBAA2B;AAC3B,uBAA0B;AAE1B,oBAAwC;;;;;;;;;;AAIjC,IAAM,cAAN,MAAMA,qBAAoB,uDAAuB;EAKtD,cAAA;AACE,UAAK;EACP;EAEA,MAAM,oBAAiB;AACrB,QAAI,KAAK;AAAgB;AACzB,SAAK,iBAAiB;AAGtB,UAAM,IAAI,QAAQ,aAAW,WAAW,SAAS,CAAC,CAAC;AAEnD,UAAM,uBAAuB,KAAK,aAAa,4BAA4B;AAC3E,QAAI,sBAAsB;AACxB,UAAI;AACF,cAAM,aAAqC,IAAI,SAAS,UAAU,oBAAoB,EAAE,EAAE,MAAM,IAAI;AACpG,YAAI,YAAY;AACd,gBAAM,
|
|
4
|
+
"sourcesContent": ["import { SwcHTMLQuoteElementBase } from '../base/SwcHTMLQuoteElementBase';\nimport { elementDefine } from '../../decorators/elementDefine';\nimport { SimpleApplication } from '@dooboostore/simple-boot/SimpleApplication';\nimport { SwcAppInterface, SwcConfigType, SwcAttributeConfigType } from '../SwcInterfaces';\nimport { PathRouter } from '@dooboostore/core-web/routers/PathRouter';\nimport { HashRouter } from '@dooboostore/core-web/routers/HashRouter';\nimport { ElementRouter } from '../../router/ElementRouter';\nimport { SimOption } from '@dooboostore/simple-boot/SimOption';\nimport { ConstructorType } from '@dooboostore/core/types';\nimport { Router, RouterEventType } from '@dooboostore/core-web/routers/Router';\nimport { Subscription } from '@dooboostore/core/message/Subscription';\n\n@elementDefine({ name: 'swc-app-blockquote', extends: 'blockquote' })\nexport class SwcAppQuote extends SwcHTMLQuoteElementBase implements SwcAppInterface {\n public simpleApplication?: SimpleApplication;\n public router?: Router;\n private routerSubscription?: Subscription;\n\n constructor() {\n super();\n }\n\n async connectedCallback() {\n if (this._isInitialized) return;\n this._isInitialized = true;\n\n // Push to the end of the event loop to ensure global scripts are evaluated\n await new Promise(resolve => setTimeout(resolve, 0));\n\n const applicationConfigStr = this.getAttribute('swc-get-application-config');\n if (applicationConfigStr) {\n try {\n const userConfig: SwcAttributeConfigType = new Function(`return ${applicationConfigStr}`).apply(this);\n if (userConfig) {\n const _config: SwcConfigType = {\n routeType: 'element',\n window: window,\n ...userConfig\n };\n\n if (_config.routeType === 'path') {\n this.router = new PathRouter({ window: _config.window, firstUrl: _config.path });\n } else if (_config.routeType === 'hash') {\n this.router = new HashRouter({ window: _config.window, firstUrl: _config.path });\n } else {\n this.router = new ElementRouter({ window: _config.window, firstUrl: _config.path });\n }\n\n this.routerSubscription = this.router.observable.subscribe((route: RouterEventType) => {\n if (route.triggerPoint === 'end') {\n this.routingProcess(route.path);\n }\n });\n const option = new SimOption({\n excludeProxys: [Node],\n rootRouter: _config.rootRouter\n });\n\n this.simpleApplication = new SimpleApplication(option);\n\n // Use 'any' key for Map to allow Abstract classes like Router\n const otherInstanceSim = new Map<any, any>();\n if (this.router) {\n otherInstanceSim.set(Router, this.router);\n }\n this.simpleApplication.run(otherInstanceSim);\n const data = this.simpleApplication.sim(_config.rootRouter);\n if (data instanceof Node) {\n if (this.shadowRoot) {\n this.shadowRoot.replaceChildren(data);\n } else if (!this.contains(data)) {\n this.replaceChildren(data);\n }\n }\n if (_config.path) {\n await this.router?.go(_config.path);\n }\n }\n } catch (e) {\n console.error('[SWC-APP] Failed to execute swc-get-application-config script:', e);\n }\n }\n }\n\n disconnectedCallback() {\n this.routerSubscription?.unsubscribe();\n }\n\n async routing(path: string) {\n await this.router?.go(path);\n }\n\n private async routingProcess(path: string) {\n await this.simpleApplication?.routing(path);\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAwC;AACxC,2BAA8B;AAC9B,+BAAkC;AAElC,wBAA2B;AAC3B,wBAA2B;AAC3B,2BAA8B;AAC9B,uBAA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AAC1D,cAAI,gBAAgB,MAAM;AACxB,gBAAI,KAAK,YAAY;AACnB,mBAAK,WAAW,gBAAgB,IAAI;YACtC,WAAW,CAAC,KAAK,SAAS,IAAI,GAAG;AAC/B,mBAAK,gBAAgB,IAAI;YAC3B;UACF;AACA,cAAI,QAAQ,MAAM;AAChB,kBAAM,KAAK,QAAQ,GAAG,QAAQ,IAAI;UACpC;QACF;MACF,SAAS,GAAG;AACV,gBAAQ,MAAM,kEAAkE,CAAC;MACnF;IACF;EACF;EAEA,uBAAoB;AAClB,SAAK,oBAAoB,YAAW;EACtC;EAEA,MAAM,QAAQ,MAAY;AACxB,UAAM,KAAK,QAAQ,GAAG,IAAI;EAC5B;EAEQ,MAAM,eAAe,MAAY;AACvC,UAAM,KAAK,mBAAmB,QAAQ,IAAI;EAC5C;;AAjFW,cAAW,WAAA;MADvB,oCAAc,EAAE,MAAM,sBAAsB,SAAS,aAAY,CAAE;;GACvD,WAAW;",
|
|
6
6
|
"names": ["SwcAppQuote"]
|
|
7
7
|
}
|
|
@@ -25,6 +25,7 @@ var import_elementDefine = require("../../decorators/elementDefine");
|
|
|
25
25
|
var import_SimpleApplication = require("@dooboostore/simple-boot/SimpleApplication");
|
|
26
26
|
var import_PathRouter = require("@dooboostore/core-web/routers/PathRouter");
|
|
27
27
|
var import_HashRouter = require("@dooboostore/core-web/routers/HashRouter");
|
|
28
|
+
var import_ElementRouter = require("../../router/ElementRouter");
|
|
28
29
|
var import_SimOption = require("@dooboostore/simple-boot/SimOption");
|
|
29
30
|
var import_Router = require("@dooboostore/core-web/routers/Router");
|
|
30
31
|
var __decorate = function(decorators, target, key, desc) {
|
|
@@ -51,12 +52,18 @@ let SwcAppScript = class SwcAppScript2 extends import_SwcHTMLScriptElementBase.S
|
|
|
51
52
|
const userConfig = new Function(`return ${applicationConfigStr}`).apply(this);
|
|
52
53
|
if (userConfig) {
|
|
53
54
|
const _config = {
|
|
54
|
-
routeType: "
|
|
55
|
+
routeType: "element",
|
|
55
56
|
window,
|
|
56
57
|
...userConfig
|
|
57
58
|
};
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
if (_config.routeType === "path") {
|
|
60
|
+
this.router = new import_PathRouter.PathRouter({ window: _config.window, firstUrl: _config.path });
|
|
61
|
+
} else if (_config.routeType === "hash") {
|
|
62
|
+
this.router = new import_HashRouter.HashRouter({ window: _config.window, firstUrl: _config.path });
|
|
63
|
+
} else {
|
|
64
|
+
this.router = new import_ElementRouter.ElementRouter({ window: _config.window, firstUrl: _config.path });
|
|
65
|
+
}
|
|
66
|
+
this.routerSubscription = this.router.observable.subscribe((route) => {
|
|
60
67
|
if (route.triggerPoint === "end") {
|
|
61
68
|
this.routingProcess(route.path);
|
|
62
69
|
}
|
|
@@ -67,8 +74,8 @@ let SwcAppScript = class SwcAppScript2 extends import_SwcHTMLScriptElementBase.S
|
|
|
67
74
|
});
|
|
68
75
|
this.simpleApplication = new import_SimpleApplication.SimpleApplication(option);
|
|
69
76
|
const otherInstanceSim = /* @__PURE__ */ new Map();
|
|
70
|
-
if (this.
|
|
71
|
-
otherInstanceSim.set(import_Router.Router, this.
|
|
77
|
+
if (this.router) {
|
|
78
|
+
otherInstanceSim.set(import_Router.Router, this.router);
|
|
72
79
|
}
|
|
73
80
|
this.simpleApplication.run(otherInstanceSim);
|
|
74
81
|
const data = this.simpleApplication.sim(_config.rootRouter);
|
|
@@ -80,7 +87,7 @@ let SwcAppScript = class SwcAppScript2 extends import_SwcHTMLScriptElementBase.S
|
|
|
80
87
|
}
|
|
81
88
|
}
|
|
82
89
|
if (_config.path) {
|
|
83
|
-
await this.
|
|
90
|
+
await this.router?.go(_config.path);
|
|
84
91
|
}
|
|
85
92
|
}
|
|
86
93
|
} catch (e) {
|
|
@@ -92,7 +99,7 @@ let SwcAppScript = class SwcAppScript2 extends import_SwcHTMLScriptElementBase.S
|
|
|
92
99
|
this.routerSubscription?.unsubscribe();
|
|
93
100
|
}
|
|
94
101
|
async routing(path) {
|
|
95
|
-
await this.
|
|
102
|
+
await this.router?.go(path);
|
|
96
103
|
}
|
|
97
104
|
async routingProcess(path) {
|
|
98
105
|
await this.simpleApplication?.routing(path);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/elements/apps/SwcAppScript.ts"],
|
|
4
|
-
"sourcesContent": ["import { SwcHTMLScriptElementBase } from '../base/SwcHTMLScriptElementBase';\nimport { elementDefine } from '../../decorators/elementDefine';\nimport { SimpleApplication } from '@dooboostore/simple-boot/SimpleApplication';\nimport { SwcAppInterface, SwcConfigType, SwcAttributeConfigType } from '../SwcInterfaces';\nimport { PathRouter } from '@dooboostore/core-web/routers/PathRouter';\nimport { HashRouter } from '@dooboostore/core-web/routers/HashRouter';\nimport { SimOption } from '@dooboostore/simple-boot/SimOption';\nimport { ConstructorType } from '@dooboostore/core/types';\nimport { Router, RouterEventType } from '@dooboostore/core-web/routers/Router';\nimport { Subscription } from '@dooboostore/core/message/Subscription';\n\n@elementDefine({ name: 'swc-app-script', extends: 'script' })\nexport class SwcAppScript extends SwcHTMLScriptElementBase implements SwcAppInterface {\n public simpleApplication?: SimpleApplication;\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA,sCAAyC;AACzC,2BAA8B;AAC9B,+BAAkC;AAElC,wBAA2B;AAC3B,wBAA2B;AAC3B,uBAA0B;AAE1B,oBAAwC;;;;;;;;;;AAIjC,IAAM,eAAN,MAAMA,sBAAqB,yDAAwB;EAKxD,cAAA;AACE,UAAK;EACP;EAEA,MAAM,oBAAiB;AACrB,QAAI,KAAK;AAAgB;AACzB,SAAK,iBAAiB;AAGtB,UAAM,IAAI,QAAQ,aAAW,WAAW,SAAS,CAAC,CAAC;AAEnD,UAAM,uBAAuB,KAAK,aAAa,4BAA4B;AAC3E,QAAI,sBAAsB;AACxB,UAAI;AACF,cAAM,aAAqC,IAAI,SAAS,UAAU,oBAAoB,EAAE,EAAE,MAAM,IAAI;AACpG,YAAI,YAAY;AACd,gBAAM,
|
|
4
|
+
"sourcesContent": ["import { SwcHTMLScriptElementBase } from '../base/SwcHTMLScriptElementBase';\nimport { elementDefine } from '../../decorators/elementDefine';\nimport { SimpleApplication } from '@dooboostore/simple-boot/SimpleApplication';\nimport { SwcAppInterface, SwcConfigType, SwcAttributeConfigType } from '../SwcInterfaces';\nimport { PathRouter } from '@dooboostore/core-web/routers/PathRouter';\nimport { HashRouter } from '@dooboostore/core-web/routers/HashRouter';\nimport { ElementRouter } from '../../router/ElementRouter';\nimport { SimOption } from '@dooboostore/simple-boot/SimOption';\nimport { ConstructorType } from '@dooboostore/core/types';\nimport { Router, RouterEventType } from '@dooboostore/core-web/routers/Router';\nimport { Subscription } from '@dooboostore/core/message/Subscription';\n\n@elementDefine({ name: 'swc-app-script', extends: 'script' })\nexport class SwcAppScript extends SwcHTMLScriptElementBase implements SwcAppInterface {\n public simpleApplication?: SimpleApplication;\n public router?: Router;\n private routerSubscription?: Subscription;\n\n constructor() {\n super();\n }\n\n async connectedCallback() {\n if (this._isInitialized) return;\n this._isInitialized = true;\n\n // Push to the end of the event loop to ensure global scripts are evaluated\n await new Promise(resolve => setTimeout(resolve, 0));\n\n const applicationConfigStr = this.getAttribute('swc-get-application-config');\n if (applicationConfigStr) {\n try {\n const userConfig: SwcAttributeConfigType = new Function(`return ${applicationConfigStr}`).apply(this);\n if (userConfig) {\n const _config: SwcConfigType = {\n routeType: 'element',\n window: window,\n ...userConfig\n };\n\n if (_config.routeType === 'path') {\n this.router = new PathRouter({ window: _config.window, firstUrl: _config.path });\n } else if (_config.routeType === 'hash') {\n this.router = new HashRouter({ window: _config.window, firstUrl: _config.path });\n } else {\n this.router = new ElementRouter({ window: _config.window, firstUrl: _config.path });\n }\n\n this.routerSubscription = this.router.observable.subscribe((route: RouterEventType) => {\n if (route.triggerPoint === 'end') {\n this.routingProcess(route.path);\n }\n });\n const option = new SimOption({\n excludeProxys: [Node],\n rootRouter: _config.rootRouter\n });\n\n this.simpleApplication = new SimpleApplication(option);\n\n // Use 'any' key for Map to allow Abstract classes like Router\n const otherInstanceSim = new Map<any, any>();\n if (this.router) {\n otherInstanceSim.set(Router, this.router);\n }\n this.simpleApplication.run(otherInstanceSim);\n const data = this.simpleApplication.sim(_config.rootRouter);\n if (data instanceof Node) {\n if (this.shadowRoot) {\n this.shadowRoot.replaceChildren(data);\n } else if (!this.contains(data)) {\n this.replaceChildren(data);\n }\n }\n if (_config.path) {\n await this.router?.go(_config.path);\n }\n }\n } catch (e) {\n console.error('[SWC-APP] Failed to execute swc-get-application-config script:', e);\n }\n }\n }\n\n disconnectedCallback() {\n this.routerSubscription?.unsubscribe();\n }\n\n async routing(path: string) {\n await this.router?.go(path);\n }\n\n private async routingProcess(path: string) {\n await this.simpleApplication?.routing(path);\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA,sCAAyC;AACzC,2BAA8B;AAC9B,+BAAkC;AAElC,wBAA2B;AAC3B,wBAA2B;AAC3B,2BAA8B;AAC9B,uBAA0B;AAE1B,oBAAwC;;;;;;;;;;AAIjC,IAAM,eAAN,MAAMA,sBAAqB,yDAAwB;EAKxD,cAAA;AACE,UAAK;EACP;EAEA,MAAM,oBAAiB;AACrB,QAAI,KAAK;AAAgB;AACzB,SAAK,iBAAiB;AAGtB,UAAM,IAAI,QAAQ,aAAW,WAAW,SAAS,CAAC,CAAC;AAEnD,UAAM,uBAAuB,KAAK,aAAa,4BAA4B;AAC3E,QAAI,sBAAsB;AACxB,UAAI;AACF,cAAM,aAAqC,IAAI,SAAS,UAAU,oBAAoB,EAAE,EAAE,MAAM,IAAI;AACpG,YAAI,YAAY;AACd,gBAAM,UAAyB;YAC7B,WAAW;YACX;YACA,GAAG;;AAGL,cAAI,QAAQ,cAAc,QAAQ;AAChC,iBAAK,SAAS,IAAI,6BAAW,EAAE,QAAQ,QAAQ,QAAQ,UAAU,QAAQ,KAAI,CAAE;UACjF,WAA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,SAAQ,CAAE;;GAC/C,YAAY;",
|
|
6
6
|
"names": ["SwcAppScript"]
|
|
7
7
|
}
|
|
@@ -25,6 +25,7 @@ var import_elementDefine = require("../../decorators/elementDefine");
|
|
|
25
25
|
var import_SimpleApplication = require("@dooboostore/simple-boot/SimpleApplication");
|
|
26
26
|
var import_PathRouter = require("@dooboostore/core-web/routers/PathRouter");
|
|
27
27
|
var import_HashRouter = require("@dooboostore/core-web/routers/HashRouter");
|
|
28
|
+
var import_ElementRouter = require("../../router/ElementRouter");
|
|
28
29
|
var import_SimOption = require("@dooboostore/simple-boot/SimOption");
|
|
29
30
|
var import_Router = require("@dooboostore/core-web/routers/Router");
|
|
30
31
|
var __decorate = function(decorators, target, key, desc) {
|
|
@@ -51,12 +52,18 @@ let SwcAppSelect = class SwcAppSelect2 extends import_SwcHTMLSelectElementBase.S
|
|
|
51
52
|
const userConfig = new Function(`return ${applicationConfigStr}`).apply(this);
|
|
52
53
|
if (userConfig) {
|
|
53
54
|
const _config = {
|
|
54
|
-
routeType: "
|
|
55
|
+
routeType: "element",
|
|
55
56
|
window,
|
|
56
57
|
...userConfig
|
|
57
58
|
};
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
if (_config.routeType === "path") {
|
|
60
|
+
this.router = new import_PathRouter.PathRouter({ window: _config.window, firstUrl: _config.path });
|
|
61
|
+
} else if (_config.routeType === "hash") {
|
|
62
|
+
this.router = new import_HashRouter.HashRouter({ window: _config.window, firstUrl: _config.path });
|
|
63
|
+
} else {
|
|
64
|
+
this.router = new import_ElementRouter.ElementRouter({ window: _config.window, firstUrl: _config.path });
|
|
65
|
+
}
|
|
66
|
+
this.routerSubscription = this.router.observable.subscribe((route) => {
|
|
60
67
|
if (route.triggerPoint === "end") {
|
|
61
68
|
this.routingProcess(route.path);
|
|
62
69
|
}
|
|
@@ -67,8 +74,8 @@ let SwcAppSelect = class SwcAppSelect2 extends import_SwcHTMLSelectElementBase.S
|
|
|
67
74
|
});
|
|
68
75
|
this.simpleApplication = new import_SimpleApplication.SimpleApplication(option);
|
|
69
76
|
const otherInstanceSim = /* @__PURE__ */ new Map();
|
|
70
|
-
if (this.
|
|
71
|
-
otherInstanceSim.set(import_Router.Router, this.
|
|
77
|
+
if (this.router) {
|
|
78
|
+
otherInstanceSim.set(import_Router.Router, this.router);
|
|
72
79
|
}
|
|
73
80
|
this.simpleApplication.run(otherInstanceSim);
|
|
74
81
|
const data = this.simpleApplication.sim(_config.rootRouter);
|
|
@@ -80,7 +87,7 @@ let SwcAppSelect = class SwcAppSelect2 extends import_SwcHTMLSelectElementBase.S
|
|
|
80
87
|
}
|
|
81
88
|
}
|
|
82
89
|
if (_config.path) {
|
|
83
|
-
await this.
|
|
90
|
+
await this.router?.go(_config.path);
|
|
84
91
|
}
|
|
85
92
|
}
|
|
86
93
|
} catch (e) {
|
|
@@ -92,7 +99,7 @@ let SwcAppSelect = class SwcAppSelect2 extends import_SwcHTMLSelectElementBase.S
|
|
|
92
99
|
this.routerSubscription?.unsubscribe();
|
|
93
100
|
}
|
|
94
101
|
async routing(path) {
|
|
95
|
-
await this.
|
|
102
|
+
await this.router?.go(path);
|
|
96
103
|
}
|
|
97
104
|
async routingProcess(path) {
|
|
98
105
|
await this.simpleApplication?.routing(path);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/elements/apps/SwcAppSelect.ts"],
|
|
4
|
-
"sourcesContent": ["import { SwcHTMLSelectElementBase } from '../base/SwcHTMLSelectElementBase';\nimport { elementDefine } from '../../decorators/elementDefine';\nimport { SimpleApplication } from '@dooboostore/simple-boot/SimpleApplication';\nimport { SwcAppInterface, SwcConfigType, SwcAttributeConfigType } from '../SwcInterfaces';\nimport { PathRouter } from '@dooboostore/core-web/routers/PathRouter';\nimport { HashRouter } from '@dooboostore/core-web/routers/HashRouter';\nimport { SimOption } from '@dooboostore/simple-boot/SimOption';\nimport { ConstructorType } from '@dooboostore/core/types';\nimport { Router, RouterEventType } from '@dooboostore/core-web/routers/Router';\nimport { Subscription } from '@dooboostore/core/message/Subscription';\n\n@elementDefine({ name: 'swc-app-select', extends: 'select' })\nexport class SwcAppSelect extends SwcHTMLSelectElementBase implements SwcAppInterface {\n public simpleApplication?: SimpleApplication;\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA,sCAAyC;AACzC,2BAA8B;AAC9B,+BAAkC;AAElC,wBAA2B;AAC3B,wBAA2B;AAC3B,uBAA0B;AAE1B,oBAAwC;;;;;;;;;;AAIjC,IAAM,eAAN,MAAMA,sBAAqB,yDAAwB;EAKxD,cAAA;AACE,UAAK;EACP;EAEA,MAAM,oBAAiB;AACrB,QAAI,KAAK;AAAgB;AACzB,SAAK,iBAAiB;AAGtB,UAAM,IAAI,QAAQ,aAAW,WAAW,SAAS,CAAC,CAAC;AAEnD,UAAM,uBAAuB,KAAK,aAAa,4BAA4B;AAC3E,QAAI,sBAAsB;AACxB,UAAI;AACF,cAAM,aAAqC,IAAI,SAAS,UAAU,oBAAoB,EAAE,EAAE,MAAM,IAAI;AACpG,YAAI,YAAY;AACd,gBAAM,
|
|
4
|
+
"sourcesContent": ["import { SwcHTMLSelectElementBase } from '../base/SwcHTMLSelectElementBase';\nimport { elementDefine } from '../../decorators/elementDefine';\nimport { SimpleApplication } from '@dooboostore/simple-boot/SimpleApplication';\nimport { SwcAppInterface, SwcConfigType, SwcAttributeConfigType } from '../SwcInterfaces';\nimport { PathRouter } from '@dooboostore/core-web/routers/PathRouter';\nimport { HashRouter } from '@dooboostore/core-web/routers/HashRouter';\nimport { ElementRouter } from '../../router/ElementRouter';\nimport { SimOption } from '@dooboostore/simple-boot/SimOption';\nimport { ConstructorType } from '@dooboostore/core/types';\nimport { Router, RouterEventType } from '@dooboostore/core-web/routers/Router';\nimport { Subscription } from '@dooboostore/core/message/Subscription';\n\n@elementDefine({ name: 'swc-app-select', extends: 'select' })\nexport class SwcAppSelect extends SwcHTMLSelectElementBase implements SwcAppInterface {\n public simpleApplication?: SimpleApplication;\n public router?: Router;\n private routerSubscription?: Subscription;\n\n constructor() {\n super();\n }\n\n async connectedCallback() {\n if (this._isInitialized) return;\n this._isInitialized = true;\n\n // Push to the end of the event loop to ensure global scripts are evaluated\n await new Promise(resolve => setTimeout(resolve, 0));\n\n const applicationConfigStr = this.getAttribute('swc-get-application-config');\n if (applicationConfigStr) {\n try {\n const userConfig: SwcAttributeConfigType = new Function(`return ${applicationConfigStr}`).apply(this);\n if (userConfig) {\n const _config: SwcConfigType = {\n routeType: 'element',\n window: window,\n ...userConfig\n };\n\n if (_config.routeType === 'path') {\n this.router = new PathRouter({ window: _config.window, firstUrl: _config.path });\n } else if (_config.routeType === 'hash') {\n this.router = new HashRouter({ window: _config.window, firstUrl: _config.path });\n } else {\n this.router = new ElementRouter({ window: _config.window, firstUrl: _config.path });\n }\n\n this.routerSubscription = this.router.observable.subscribe((route: RouterEventType) => {\n if (route.triggerPoint === 'end') {\n this.routingProcess(route.path);\n }\n });\n const option = new SimOption({\n excludeProxys: [Node],\n rootRouter: _config.rootRouter\n });\n\n this.simpleApplication = new SimpleApplication(option);\n\n // Use 'any' key for Map to allow Abstract classes like Router\n const otherInstanceSim = new Map<any, any>();\n if (this.router) {\n otherInstanceSim.set(Router, this.router);\n }\n this.simpleApplication.run(otherInstanceSim);\n const data = this.simpleApplication.sim(_config.rootRouter);\n if (data instanceof Node) {\n if (this.shadowRoot) {\n this.shadowRoot.replaceChildren(data);\n } else if (!this.contains(data)) {\n this.replaceChildren(data);\n }\n }\n if (_config.path) {\n await this.router?.go(_config.path);\n }\n }\n } catch (e) {\n console.error('[SWC-APP] Failed to execute swc-get-application-config script:', e);\n }\n }\n }\n\n disconnectedCallback() {\n this.routerSubscription?.unsubscribe();\n }\n\n async routing(path: string) {\n await this.router?.go(path);\n }\n\n private async routingProcess(path: string) {\n await this.simpleApplication?.routing(path);\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;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I,sBAAQ,KAAK,MAAM;UAC1C;AACA,eAAK,kBAAkB,IAAI,gBAAgB;AAC3C,gBAAM,OAAO,KAAK,kBAAkB,IAAI,QAAQ,UAAU;AAC1D,cAAI,gBAAgB,MAAM;AACxB,gBAAI,KAAK,YAAY;AACnB,mBAAK,WAAW,gBAAgB,IAAI;YACtC,WAAW,CAAC,KAAK,SAAS,IAAI,GAAG;AAC/B,mBAAK,gBAAgB,IAAI;YAC3B;UACF;AACA,cAAI,QAAQ,MAAM;AAChB,kBAAM,KAAK,QAAQ,GAAG,QAAQ,IAAI;UACpC;QACF;MACF,SAAS,GAAG;AACV,gBAAQ,MAAM,kEAAkE,CAAC;MACnF;IACF;EACF;EAEA,uBAAoB;AAClB,SAAK,oBAAoB,YAAW;EACtC;EAEA,MAAM,QAAQ,MAAY;AACxB,UAAM,KAAK,QAAQ,GAAG,IAAI;EAC5B;EAEQ,MAAM,eAAe,MAAY;AACvC,UAAM,KAAK,mBAAmB,QAAQ,IAAI;EAC5C;;AAjFW,eAAY,WAAA;MADxB,oCAAc,EAAE,MAAM,kBAAkB,SAAS,SAAQ,CAAE;;GAC/C,YAAY;",
|
|
6
6
|
"names": ["SwcAppSelect"]
|
|
7
7
|
}
|
|
@@ -25,6 +25,7 @@ var import_elementDefine = require("../../decorators/elementDefine");
|
|
|
25
25
|
var import_SimpleApplication = require("@dooboostore/simple-boot/SimpleApplication");
|
|
26
26
|
var import_PathRouter = require("@dooboostore/core-web/routers/PathRouter");
|
|
27
27
|
var import_HashRouter = require("@dooboostore/core-web/routers/HashRouter");
|
|
28
|
+
var import_ElementRouter = require("../../router/ElementRouter");
|
|
28
29
|
var import_SimOption = require("@dooboostore/simple-boot/SimOption");
|
|
29
30
|
var import_Router = require("@dooboostore/core-web/routers/Router");
|
|
30
31
|
var __decorate = function(decorators, target, key, desc) {
|
|
@@ -51,12 +52,18 @@ let SwcAppSlot = class SwcAppSlot2 extends import_SwcHTMLSlotElementBase.SwcHTML
|
|
|
51
52
|
const userConfig = new Function(`return ${applicationConfigStr}`).apply(this);
|
|
52
53
|
if (userConfig) {
|
|
53
54
|
const _config = {
|
|
54
|
-
routeType: "
|
|
55
|
+
routeType: "element",
|
|
55
56
|
window,
|
|
56
57
|
...userConfig
|
|
57
58
|
};
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
if (_config.routeType === "path") {
|
|
60
|
+
this.router = new import_PathRouter.PathRouter({ window: _config.window, firstUrl: _config.path });
|
|
61
|
+
} else if (_config.routeType === "hash") {
|
|
62
|
+
this.router = new import_HashRouter.HashRouter({ window: _config.window, firstUrl: _config.path });
|
|
63
|
+
} else {
|
|
64
|
+
this.router = new import_ElementRouter.ElementRouter({ window: _config.window, firstUrl: _config.path });
|
|
65
|
+
}
|
|
66
|
+
this.routerSubscription = this.router.observable.subscribe((route) => {
|
|
60
67
|
if (route.triggerPoint === "end") {
|
|
61
68
|
this.routingProcess(route.path);
|
|
62
69
|
}
|
|
@@ -67,8 +74,8 @@ let SwcAppSlot = class SwcAppSlot2 extends import_SwcHTMLSlotElementBase.SwcHTML
|
|
|
67
74
|
});
|
|
68
75
|
this.simpleApplication = new import_SimpleApplication.SimpleApplication(option);
|
|
69
76
|
const otherInstanceSim = /* @__PURE__ */ new Map();
|
|
70
|
-
if (this.
|
|
71
|
-
otherInstanceSim.set(import_Router.Router, this.
|
|
77
|
+
if (this.router) {
|
|
78
|
+
otherInstanceSim.set(import_Router.Router, this.router);
|
|
72
79
|
}
|
|
73
80
|
this.simpleApplication.run(otherInstanceSim);
|
|
74
81
|
const data = this.simpleApplication.sim(_config.rootRouter);
|
|
@@ -80,7 +87,7 @@ let SwcAppSlot = class SwcAppSlot2 extends import_SwcHTMLSlotElementBase.SwcHTML
|
|
|
80
87
|
}
|
|
81
88
|
}
|
|
82
89
|
if (_config.path) {
|
|
83
|
-
await this.
|
|
90
|
+
await this.router?.go(_config.path);
|
|
84
91
|
}
|
|
85
92
|
}
|
|
86
93
|
} catch (e) {
|
|
@@ -92,7 +99,7 @@ let SwcAppSlot = class SwcAppSlot2 extends import_SwcHTMLSlotElementBase.SwcHTML
|
|
|
92
99
|
this.routerSubscription?.unsubscribe();
|
|
93
100
|
}
|
|
94
101
|
async routing(path) {
|
|
95
|
-
await this.
|
|
102
|
+
await this.router?.go(path);
|
|
96
103
|
}
|
|
97
104
|
async routingProcess(path) {
|
|
98
105
|
await this.simpleApplication?.routing(path);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/elements/apps/SwcAppSlot.ts"],
|
|
4
|
-
"sourcesContent": ["import { SwcHTMLSlotElementBase } from '../base/SwcHTMLSlotElementBase';\nimport { elementDefine } from '../../decorators/elementDefine';\nimport { SimpleApplication } from '@dooboostore/simple-boot/SimpleApplication';\nimport { SwcAppInterface, SwcConfigType, SwcAttributeConfigType } from '../SwcInterfaces';\nimport { PathRouter } from '@dooboostore/core-web/routers/PathRouter';\nimport { HashRouter } from '@dooboostore/core-web/routers/HashRouter';\nimport { SimOption } from '@dooboostore/simple-boot/SimOption';\nimport { ConstructorType } from '@dooboostore/core/types';\nimport { Router, RouterEventType } from '@dooboostore/core-web/routers/Router';\nimport { Subscription } from '@dooboostore/core/message/Subscription';\n\n@elementDefine({ name: 'swc-app-slot', extends: 'slot' })\nexport class SwcAppSlot extends SwcHTMLSlotElementBase implements SwcAppInterface {\n public simpleApplication?: SimpleApplication;\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA,oCAAuC;AACvC,2BAA8B;AAC9B,+BAAkC;AAElC,wBAA2B;AAC3B,wBAA2B;AAC3B,uBAA0B;AAE1B,oBAAwC;;;;;;;;;;AAIjC,IAAM,aAAN,MAAMA,oBAAmB,qDAAsB;EAKpD,cAAA;AACE,UAAK;EACP;EAEA,MAAM,oBAAiB;AACrB,QAAI,KAAK;AAAgB;AACzB,SAAK,iBAAiB;AAGtB,UAAM,IAAI,QAAQ,aAAW,WAAW,SAAS,CAAC,CAAC;AAEnD,UAAM,uBAAuB,KAAK,aAAa,4BAA4B;AAC3E,QAAI,sBAAsB;AACxB,UAAI;AACF,cAAM,aAAqC,IAAI,SAAS,UAAU,oBAAoB,EAAE,EAAE,MAAM,IAAI;AACpG,YAAI,YAAY;AACd,gBAAM,
|
|
4
|
+
"sourcesContent": ["import { SwcHTMLSlotElementBase } from '../base/SwcHTMLSlotElementBase';\nimport { elementDefine } from '../../decorators/elementDefine';\nimport { SimpleApplication } from '@dooboostore/simple-boot/SimpleApplication';\nimport { SwcAppInterface, SwcConfigType, SwcAttributeConfigType } from '../SwcInterfaces';\nimport { PathRouter } from '@dooboostore/core-web/routers/PathRouter';\nimport { HashRouter } from '@dooboostore/core-web/routers/HashRouter';\nimport { ElementRouter } from '../../router/ElementRouter';\nimport { SimOption } from '@dooboostore/simple-boot/SimOption';\nimport { ConstructorType } from '@dooboostore/core/types';\nimport { Router, RouterEventType } from '@dooboostore/core-web/routers/Router';\nimport { Subscription } from '@dooboostore/core/message/Subscription';\n\n@elementDefine({ name: 'swc-app-slot', extends: 'slot' })\nexport class SwcAppSlot extends SwcHTMLSlotElementBase implements SwcAppInterface {\n public simpleApplication?: SimpleApplication;\n public router?: Router;\n private routerSubscription?: Subscription;\n\n constructor() {\n super();\n }\n\n async connectedCallback() {\n if (this._isInitialized) return;\n this._isInitialized = true;\n\n // Push to the end of the event loop to ensure global scripts are evaluated\n await new Promise(resolve => setTimeout(resolve, 0));\n\n const applicationConfigStr = this.getAttribute('swc-get-application-config');\n if (applicationConfigStr) {\n try {\n const userConfig: SwcAttributeConfigType = new Function(`return ${applicationConfigStr}`).apply(this);\n if (userConfig) {\n const _config: SwcConfigType = {\n routeType: 'element',\n window: window,\n ...userConfig\n };\n\n if (_config.routeType === 'path') {\n this.router = new PathRouter({ window: _config.window, firstUrl: _config.path });\n } else if (_config.routeType === 'hash') {\n this.router = new HashRouter({ window: _config.window, firstUrl: _config.path });\n } else {\n this.router = new ElementRouter({ window: _config.window, firstUrl: _config.path });\n }\n\n this.routerSubscription = this.router.observable.subscribe((route: RouterEventType) => {\n if (route.triggerPoint === 'end') {\n this.routingProcess(route.path);\n }\n });\n const option = new SimOption({\n excludeProxys: [Node],\n rootRouter: _config.rootRouter\n });\n\n this.simpleApplication = new SimpleApplication(option);\n\n // Use 'any' key for Map to allow Abstract classes like Router\n const otherInstanceSim = new Map<any, any>();\n if (this.router) {\n otherInstanceSim.set(Router, this.router);\n }\n this.simpleApplication.run(otherInstanceSim);\n const data = this.simpleApplication.sim(_config.rootRouter);\n if (data instanceof Node) {\n if (this.shadowRoot) {\n this.shadowRoot.replaceChildren(data);\n } else if (!this.contains(data)) {\n this.replaceChildren(data);\n }\n }\n if (_config.path) {\n await this.router?.go(_config.path);\n }\n }\n } catch (e) {\n console.error('[SWC-APP] Failed to execute swc-get-application-config script:', e);\n }\n }\n }\n\n disconnectedCallback() {\n this.routerSubscription?.unsubscribe();\n }\n\n async routing(path: string) {\n await this.router?.go(path);\n }\n\n private async routingProcess(path: string) {\n await this.simpleApplication?.routing(path);\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA,oCAAuC;AACvC,2BAA8B;AAC9B,+BAAkC;AAElC,wBAA2B;AAC3B,wBAA2B;AAC3B,2BAA8B;AAC9B,uBAA0B;AAE1B,oBAAwC;;;;;;;;;;AAIjC,IAAM,aAAN,MAAMA,oBAAmB,qDAAsB;EAKpD,cAAA;AACE,UAAK;EACP;EAEA,MAAM,oBAAiB;AACrB,QAAI,KAAK;AAAgB;AACzB,SAAK,iBAAiB;AAGtB,UAAM,IAAI,QAAQ,aAAW,WAAW,SAAS,CAAC,CAAC;AAEnD,UAAM,uBAAuB,KAAK,aAAa,4BAA4B;AAC3E,QAAI,sBAAsB;AACxB,UAAI;AACF,cAAM,aAAqC,IAAI,SAAS,UAAU,oBAAoB,EAAE,EAAE,MAAM,IAAI;AACpG,YAAI,YAAY;AACd,gBAAM,UA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AAK,QAAQ,GAAG,IAAI;EAC5B;EAEQ,MAAM,eAAe,MAAY;AACvC,UAAM,KAAK,mBAAmB,QAAQ,IAAI;EAC5C;;AAjFW,aAAU,WAAA;MADtB,oCAAc,EAAE,MAAM,gBAAgB,SAAS,OAAM,CAAE;;GAC3C,UAAU;",
|
|
6
6
|
"names": ["SwcAppSlot"]
|
|
7
7
|
}
|
|
@@ -25,6 +25,7 @@ var import_elementDefine = require("../../decorators/elementDefine");
|
|
|
25
25
|
var import_SimpleApplication = require("@dooboostore/simple-boot/SimpleApplication");
|
|
26
26
|
var import_PathRouter = require("@dooboostore/core-web/routers/PathRouter");
|
|
27
27
|
var import_HashRouter = require("@dooboostore/core-web/routers/HashRouter");
|
|
28
|
+
var import_ElementRouter = require("../../router/ElementRouter");
|
|
28
29
|
var import_SimOption = require("@dooboostore/simple-boot/SimOption");
|
|
29
30
|
var import_Router = require("@dooboostore/core-web/routers/Router");
|
|
30
31
|
var __decorate = function(decorators, target, key, desc) {
|
|
@@ -51,12 +52,18 @@ let SwcAppSource = class SwcAppSource2 extends import_SwcHTMLSourceElementBase.S
|
|
|
51
52
|
const userConfig = new Function(`return ${applicationConfigStr}`).apply(this);
|
|
52
53
|
if (userConfig) {
|
|
53
54
|
const _config = {
|
|
54
|
-
routeType: "
|
|
55
|
+
routeType: "element",
|
|
55
56
|
window,
|
|
56
57
|
...userConfig
|
|
57
58
|
};
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
if (_config.routeType === "path") {
|
|
60
|
+
this.router = new import_PathRouter.PathRouter({ window: _config.window, firstUrl: _config.path });
|
|
61
|
+
} else if (_config.routeType === "hash") {
|
|
62
|
+
this.router = new import_HashRouter.HashRouter({ window: _config.window, firstUrl: _config.path });
|
|
63
|
+
} else {
|
|
64
|
+
this.router = new import_ElementRouter.ElementRouter({ window: _config.window, firstUrl: _config.path });
|
|
65
|
+
}
|
|
66
|
+
this.routerSubscription = this.router.observable.subscribe((route) => {
|
|
60
67
|
if (route.triggerPoint === "end") {
|
|
61
68
|
this.routingProcess(route.path);
|
|
62
69
|
}
|
|
@@ -67,8 +74,8 @@ let SwcAppSource = class SwcAppSource2 extends import_SwcHTMLSourceElementBase.S
|
|
|
67
74
|
});
|
|
68
75
|
this.simpleApplication = new import_SimpleApplication.SimpleApplication(option);
|
|
69
76
|
const otherInstanceSim = /* @__PURE__ */ new Map();
|
|
70
|
-
if (this.
|
|
71
|
-
otherInstanceSim.set(import_Router.Router, this.
|
|
77
|
+
if (this.router) {
|
|
78
|
+
otherInstanceSim.set(import_Router.Router, this.router);
|
|
72
79
|
}
|
|
73
80
|
this.simpleApplication.run(otherInstanceSim);
|
|
74
81
|
const data = this.simpleApplication.sim(_config.rootRouter);
|
|
@@ -80,7 +87,7 @@ let SwcAppSource = class SwcAppSource2 extends import_SwcHTMLSourceElementBase.S
|
|
|
80
87
|
}
|
|
81
88
|
}
|
|
82
89
|
if (_config.path) {
|
|
83
|
-
await this.
|
|
90
|
+
await this.router?.go(_config.path);
|
|
84
91
|
}
|
|
85
92
|
}
|
|
86
93
|
} catch (e) {
|
|
@@ -92,7 +99,7 @@ let SwcAppSource = class SwcAppSource2 extends import_SwcHTMLSourceElementBase.S
|
|
|
92
99
|
this.routerSubscription?.unsubscribe();
|
|
93
100
|
}
|
|
94
101
|
async routing(path) {
|
|
95
|
-
await this.
|
|
102
|
+
await this.router?.go(path);
|
|
96
103
|
}
|
|
97
104
|
async routingProcess(path) {
|
|
98
105
|
await this.simpleApplication?.routing(path);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/elements/apps/SwcAppSource.ts"],
|
|
4
|
-
"sourcesContent": ["import { SwcHTMLSourceElementBase } from '../base/SwcHTMLSourceElementBase';\nimport { elementDefine } from '../../decorators/elementDefine';\nimport { SimpleApplication } from '@dooboostore/simple-boot/SimpleApplication';\nimport { SwcAppInterface, SwcConfigType, SwcAttributeConfigType } from '../SwcInterfaces';\nimport { PathRouter } from '@dooboostore/core-web/routers/PathRouter';\nimport { HashRouter } from '@dooboostore/core-web/routers/HashRouter';\nimport { SimOption } from '@dooboostore/simple-boot/SimOption';\nimport { ConstructorType } from '@dooboostore/core/types';\nimport { Router, RouterEventType } from '@dooboostore/core-web/routers/Router';\nimport { Subscription } from '@dooboostore/core/message/Subscription';\n\n@elementDefine({ name: 'swc-app-source', extends: 'source' })\nexport class SwcAppSource extends SwcHTMLSourceElementBase implements SwcAppInterface {\n public simpleApplication?: SimpleApplication;\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA,sCAAyC;AACzC,2BAA8B;AAC9B,+BAAkC;AAElC,wBAA2B;AAC3B,wBAA2B;AAC3B,uBAA0B;AAE1B,oBAAwC;;;;;;;;;;AAIjC,IAAM,eAAN,MAAMA,sBAAqB,yDAAwB;EAKxD,cAAA;AACE,UAAK;EACP;EAEA,MAAM,oBAAiB;AACrB,QAAI,KAAK;AAAgB;AACzB,SAAK,iBAAiB;AAGtB,UAAM,IAAI,QAAQ,aAAW,WAAW,SAAS,CAAC,CAAC;AAEnD,UAAM,uBAAuB,KAAK,aAAa,4BAA4B;AAC3E,QAAI,sBAAsB;AACxB,UAAI;AACF,cAAM,aAAqC,IAAI,SAAS,UAAU,oBAAoB,EAAE,EAAE,MAAM,IAAI;AACpG,YAAI,YAAY;AACd,gBAAM,
|
|
4
|
+
"sourcesContent": ["import { SwcHTMLSourceElementBase } from '../base/SwcHTMLSourceElementBase';\nimport { elementDefine } from '../../decorators/elementDefine';\nimport { SimpleApplication } from '@dooboostore/simple-boot/SimpleApplication';\nimport { SwcAppInterface, SwcConfigType, SwcAttributeConfigType } from '../SwcInterfaces';\nimport { PathRouter } from '@dooboostore/core-web/routers/PathRouter';\nimport { HashRouter } from '@dooboostore/core-web/routers/HashRouter';\nimport { ElementRouter } from '../../router/ElementRouter';\nimport { SimOption } from '@dooboostore/simple-boot/SimOption';\nimport { ConstructorType } from '@dooboostore/core/types';\nimport { Router, RouterEventType } from '@dooboostore/core-web/routers/Router';\nimport { Subscription } from '@dooboostore/core/message/Subscription';\n\n@elementDefine({ name: 'swc-app-source', extends: 'source' })\nexport class SwcAppSource extends SwcHTMLSourceElementBase implements SwcAppInterface {\n public simpleApplication?: SimpleApplication;\n public router?: Router;\n private routerSubscription?: Subscription;\n\n constructor() {\n super();\n }\n\n async connectedCallback() {\n if (this._isInitialized) return;\n this._isInitialized = true;\n\n // Push to the end of the event loop to ensure global scripts are evaluated\n await new Promise(resolve => setTimeout(resolve, 0));\n\n const applicationConfigStr = this.getAttribute('swc-get-application-config');\n if (applicationConfigStr) {\n try {\n const userConfig: SwcAttributeConfigType = new Function(`return ${applicationConfigStr}`).apply(this);\n if (userConfig) {\n const _config: SwcConfigType = {\n routeType: 'element',\n window: window,\n ...userConfig\n };\n\n if (_config.routeType === 'path') {\n this.router = new PathRouter({ window: _config.window, firstUrl: _config.path });\n } else if (_config.routeType === 'hash') {\n this.router = new HashRouter({ window: _config.window, firstUrl: _config.path });\n } else {\n this.router = new ElementRouter({ window: _config.window, firstUrl: _config.path });\n }\n\n this.routerSubscription = this.router.observable.subscribe((route: RouterEventType) => {\n if (route.triggerPoint === 'end') {\n this.routingProcess(route.path);\n }\n });\n const option = new SimOption({\n excludeProxys: [Node],\n rootRouter: _config.rootRouter\n });\n\n this.simpleApplication = new SimpleApplication(option);\n\n // Use 'any' key for Map to allow Abstract classes like Router\n const otherInstanceSim = new Map<any, any>();\n if (this.router) {\n otherInstanceSim.set(Router, this.router);\n }\n this.simpleApplication.run(otherInstanceSim);\n const data = this.simpleApplication.sim(_config.rootRouter);\n if (data instanceof Node) {\n if (this.shadowRoot) {\n this.shadowRoot.replaceChildren(data);\n } else if (!this.contains(data)) {\n this.replaceChildren(data);\n }\n }\n if (_config.path) {\n await this.router?.go(_config.path);\n }\n }\n } catch (e) {\n console.error('[SWC-APP] Failed to execute swc-get-application-config script:', e);\n }\n }\n }\n\n disconnectedCallback() {\n this.routerSubscription?.unsubscribe();\n }\n\n async routing(path: string) {\n await this.router?.go(path);\n }\n\n private async routingProcess(path: string) {\n await this.simpleApplication?.routing(path);\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA,sCAAyC;AACzC,2BAA8B;AAC9B,+BAAkC;AAElC,wBAA2B;AAC3B,wBAA2B;AAC3B,2BAA8B;AAC9B,uBAA0B;AAE1B,oBAAwC;;;;;;;;;;AAIjC,IAAM,eAAN,MAAMA,sBAAqB,yDAAwB;EAKxD,cAAA;AACE,UAAK;EACP;EAEA,MAAM,oBAAiB;AACrB,QAAI,KAAK;AAAgB;AACzB,SAAK,iBAAiB;AAGtB,UAAM,IAAI,QAAQ,aAAW,WAAW,SAAS,CAAC,CAAC;AAEnD,UAAM,uBAAuB,KAAK,aAAa,4BAA4B;AAC3E,QAAI,sBAAsB;AACxB,UAAI;AACF,cAAM,aAAqC,IAAI,SAAS,UAAU,oBAAoB,EAAE,EAAE,MAAM,IAAI;AACpG,YAAI,YAAY;AACd,gBAAM,UAAyB;YAC7B,WAAW;YACX;YACA,GAAG;;AAGL,cAAI,QAAQ,cAAc,QAAQ;AAChC,iBAAK,SAAS,IAAI,6BAAW,EAAE,QAAQ,QAAQ,QAAQ,UAAU,QAAQ,KAAI,CAAE;UACjF,WAAW,QAAQ,cAAc,QAAQ;AACvC,iBAAK,SAAS,IAAI,6BAAW,EAAE,QAAQ,QAAQ,QAAQ,UAAU,QAAQ,KAAI,CAAE;UACjF,OAAO;AACL,iBAAK,SAAS,IAAI,mCAAc,EAAE,QAAQ,QAAQ,QAAQ,UAAU,QAAQ,KAAI,CAAE;UACpF;AAEA,eAAK,qBAAqB,KAAK,OAAO,WAAW,UAAU,CAAC,UAA0B;AACpF,gBAAI,MAAM,iBAAiB,OAAO;AAChC,mBAAK,eAAe,MAAM,IAAI;YAChC;UACF,CAAC;AACD,gBAAM,SAAS,IAAI,2BAAU;YAC3B,eAAe,CAAC,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