jodit-pro 4.18.3 → 4.18.7
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/CHANGELOG.md +11 -0
- package/README.md +2 -0
- package/config.js +1 -0
- package/es2015/jodit.css +2 -2
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +55 -18
- package/es2015/jodit.js +1139 -150
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +34 -9
- package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
- package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.js +1 -1
- package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
- package/es2015/plugins/autocomplete/autocomplete.css +1 -1
- package/es2015/plugins/autocomplete/autocomplete.js +1 -1
- package/es2015/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es2015/plugins/backup/backup.css +1 -1
- package/es2015/plugins/backup/backup.js +1 -1
- package/es2015/plugins/backup/backup.min.js +1 -1
- package/es2015/plugins/button-generator/button-generator.css +1 -1
- package/es2015/plugins/button-generator/button-generator.js +1 -1
- package/es2015/plugins/button-generator/button-generator.min.js +1 -1
- package/es2015/plugins/change-case/change-case.js +1 -1
- package/es2015/plugins/change-case/change-case.min.js +1 -1
- package/es2015/plugins/chart/chart.css +173 -0
- package/es2015/plugins/chart/chart.js +1479 -0
- package/es2015/plugins/chart/chart.min.css +1 -0
- package/es2015/plugins/chart/chart.min.js +20 -0
- package/es2015/plugins/color-picker/color-picker.css +1 -1
- package/es2015/plugins/color-picker/color-picker.js +1 -1
- package/es2015/plugins/color-picker/color-picker.min.js +1 -1
- package/es2015/plugins/emoji/emoji.css +1 -1
- package/es2015/plugins/emoji/emoji.js +1 -1
- package/es2015/plugins/emoji/emoji.min.js +1 -1
- package/es2015/plugins/export-docs/export-docs.js +1 -1
- package/es2015/plugins/export-docs/export-docs.min.js +1 -1
- package/es2015/plugins/finder/finder.css +1 -1
- package/es2015/plugins/finder/finder.js +1 -1
- package/es2015/plugins/finder/finder.min.js +1 -1
- package/es2015/plugins/google-maps/google-maps.css +1 -1
- package/es2015/plugins/google-maps/google-maps.js +1 -1
- package/es2015/plugins/google-maps/google-maps.min.js +1 -1
- package/es2015/plugins/google-search/google-search.js +1 -1
- package/es2015/plugins/google-search/google-search.min.js +1 -1
- package/es2015/plugins/highlight-signature/highlight-signature.js +1 -1
- package/es2015/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es2015/plugins/iframe-editor/iframe-editor.css +1 -1
- package/es2015/plugins/iframe-editor/iframe-editor.js +1 -1
- package/es2015/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es2015/plugins/image-editor-pro/image-editor-pro.css +1 -1
- package/es2015/plugins/image-editor-pro/image-editor-pro.js +1 -1
- package/es2015/plugins/image-editor-pro/image-editor-pro.min.js +1 -1
- package/es2015/plugins/keyboard/keyboard.css +1 -1
- package/es2015/plugins/keyboard/keyboard.js +1 -1
- package/es2015/plugins/keyboard/keyboard.min.js +1 -1
- package/es2015/plugins/mobile-view/mobile-view.js +1 -1
- package/es2015/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es2015/plugins/page-break/page-break.js +1 -1
- package/es2015/plugins/page-break/page-break.min.js +1 -1
- package/es2015/plugins/paste-code/paste-code.css +1 -1
- package/es2015/plugins/paste-code/paste-code.js +1 -1
- package/es2015/plugins/paste-code/paste-code.min.js +1 -1
- package/es2015/plugins/paste-from-word/paste-from-word.js +1 -1
- package/es2015/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es2015/plugins/show-blocks/show-blocks.js +1 -1
- package/es2015/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es2015/plugins/style/style.css +1 -1
- package/es2015/plugins/style/style.js +1 -1
- package/es2015/plugins/style/style.min.js +1 -1
- package/es2015/plugins/templates/templates.css +1 -1
- package/es2015/plugins/templates/templates.js +1 -1
- package/es2015/plugins/templates/templates.min.js +1 -1
- package/es2015/plugins/todo-list/todo-list.css +1 -1
- package/es2015/plugins/todo-list/todo-list.js +1 -1
- package/es2015/plugins/todo-list/todo-list.min.js +1 -1
- package/es2015/plugins/translate/translate.css +1 -1
- package/es2015/plugins/translate/translate.js +1 -1
- package/es2015/plugins/translate/translate.min.js +1 -1
- package/es2015/plugins/tune-block/tune-block.css +1 -1
- package/es2015/plugins/tune-block/tune-block.js +2 -1
- package/es2015/plugins/tune-block/tune-block.min.js +2 -2
- package/es2018/jodit.fat.min.css +1 -1
- package/es2018/jodit.fat.min.js +100 -63
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +64 -39
- package/es2018/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
- package/es2018/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es2018/plugins/backup/backup.min.js +1 -1
- package/es2018/plugins/button-generator/button-generator.min.js +1 -1
- package/es2018/plugins/change-case/change-case.min.js +1 -1
- package/es2018/plugins/chart/chart.min.css +1 -0
- package/es2018/plugins/chart/chart.min.js +20 -0
- package/es2018/plugins/color-picker/color-picker.min.js +1 -1
- package/es2018/plugins/emoji/emoji.min.js +1 -1
- package/es2018/plugins/export-docs/export-docs.min.js +1 -1
- package/es2018/plugins/finder/finder.min.js +1 -1
- package/es2018/plugins/google-maps/google-maps.min.js +1 -1
- package/es2018/plugins/google-search/google-search.min.js +1 -1
- package/es2018/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es2018/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es2018/plugins/image-editor-pro/image-editor-pro.min.js +1 -1
- package/es2018/plugins/keyboard/keyboard.min.js +1 -1
- package/es2018/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es2018/plugins/page-break/page-break.min.js +1 -1
- package/es2018/plugins/paste-code/paste-code.min.js +1 -1
- package/es2018/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es2018/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es2018/plugins/style/style.min.js +1 -1
- package/es2018/plugins/templates/templates.min.js +1 -1
- package/es2018/plugins/todo-list/todo-list.min.js +1 -1
- package/es2018/plugins/translate/translate.min.js +1 -1
- package/es2018/plugins/tune-block/tune-block.min.js +2 -2
- package/es2021/jodit.css +2 -2
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +51 -14
- package/es2021/jodit.js +1139 -150
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +78 -53
- package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
- package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.js +1 -1
- package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
- package/es2021/plugins/autocomplete/autocomplete.css +1 -1
- package/es2021/plugins/autocomplete/autocomplete.js +1 -1
- package/es2021/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es2021/plugins/backup/backup.css +1 -1
- package/es2021/plugins/backup/backup.js +1 -1
- package/es2021/plugins/backup/backup.min.js +1 -1
- package/es2021/plugins/button-generator/button-generator.css +1 -1
- package/es2021/plugins/button-generator/button-generator.js +1 -1
- package/es2021/plugins/button-generator/button-generator.min.js +1 -1
- package/es2021/plugins/change-case/change-case.js +1 -1
- package/es2021/plugins/change-case/change-case.min.js +1 -1
- package/es2021/plugins/chart/chart.css +173 -0
- package/es2021/plugins/chart/chart.js +1424 -0
- package/es2021/plugins/chart/chart.min.css +1 -0
- package/es2021/plugins/chart/chart.min.js +20 -0
- package/es2021/plugins/color-picker/color-picker.css +1 -1
- package/es2021/plugins/color-picker/color-picker.js +1 -1
- package/es2021/plugins/color-picker/color-picker.min.js +1 -1
- package/es2021/plugins/emoji/emoji.css +1 -1
- package/es2021/plugins/emoji/emoji.js +1 -1
- package/es2021/plugins/emoji/emoji.min.js +1 -1
- package/es2021/plugins/export-docs/export-docs.js +1 -1
- package/es2021/plugins/export-docs/export-docs.min.js +1 -1
- package/es2021/plugins/finder/finder.css +1 -1
- package/es2021/plugins/finder/finder.js +1 -1
- package/es2021/plugins/finder/finder.min.js +1 -1
- package/es2021/plugins/google-maps/google-maps.css +1 -1
- package/es2021/plugins/google-maps/google-maps.js +1 -1
- package/es2021/plugins/google-maps/google-maps.min.js +1 -1
- package/es2021/plugins/google-search/google-search.js +1 -1
- package/es2021/plugins/google-search/google-search.min.js +1 -1
- package/es2021/plugins/highlight-signature/highlight-signature.js +1 -1
- package/es2021/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es2021/plugins/iframe-editor/iframe-editor.css +1 -1
- package/es2021/plugins/iframe-editor/iframe-editor.js +1 -1
- package/es2021/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es2021/plugins/image-editor-pro/image-editor-pro.css +1 -1
- package/es2021/plugins/image-editor-pro/image-editor-pro.js +1 -1
- package/es2021/plugins/image-editor-pro/image-editor-pro.min.js +1 -1
- package/es2021/plugins/keyboard/keyboard.css +1 -1
- package/es2021/plugins/keyboard/keyboard.js +1 -1
- package/es2021/plugins/keyboard/keyboard.min.js +1 -1
- package/es2021/plugins/mobile-view/mobile-view.js +1 -1
- package/es2021/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es2021/plugins/page-break/page-break.js +1 -1
- package/es2021/plugins/page-break/page-break.min.js +1 -1
- package/es2021/plugins/paste-code/paste-code.css +1 -1
- package/es2021/plugins/paste-code/paste-code.js +1 -1
- package/es2021/plugins/paste-code/paste-code.min.js +1 -1
- package/es2021/plugins/paste-from-word/paste-from-word.js +1 -1
- package/es2021/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es2021/plugins/show-blocks/show-blocks.js +1 -1
- package/es2021/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es2021/plugins/style/style.css +1 -1
- package/es2021/plugins/style/style.js +1 -1
- package/es2021/plugins/style/style.min.js +1 -1
- package/es2021/plugins/templates/templates.css +1 -1
- package/es2021/plugins/templates/templates.js +1 -1
- package/es2021/plugins/templates/templates.min.js +1 -1
- package/es2021/plugins/todo-list/todo-list.css +1 -1
- package/es2021/plugins/todo-list/todo-list.js +1 -1
- package/es2021/plugins/todo-list/todo-list.min.js +1 -1
- package/es2021/plugins/translate/translate.css +1 -1
- package/es2021/plugins/translate/translate.js +1 -1
- package/es2021/plugins/translate/translate.min.js +1 -1
- package/es2021/plugins/tune-block/tune-block.css +1 -1
- package/es2021/plugins/tune-block/tune-block.js +2 -1
- package/es2021/plugins/tune-block/tune-block.min.js +2 -2
- package/es2021.en/jodit.css +2 -2
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +54 -17
- package/es2021.en/jodit.js +1139 -150
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +78 -53
- package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
- package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.js +1 -1
- package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
- package/es2021.en/plugins/autocomplete/autocomplete.css +1 -1
- package/es2021.en/plugins/autocomplete/autocomplete.js +1 -1
- package/es2021.en/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es2021.en/plugins/backup/backup.css +1 -1
- package/es2021.en/plugins/backup/backup.js +1 -1
- package/es2021.en/plugins/backup/backup.min.js +1 -1
- package/es2021.en/plugins/button-generator/button-generator.css +1 -1
- package/es2021.en/plugins/button-generator/button-generator.js +1 -1
- package/es2021.en/plugins/button-generator/button-generator.min.js +1 -1
- package/es2021.en/plugins/change-case/change-case.js +1 -1
- package/es2021.en/plugins/change-case/change-case.min.js +1 -1
- package/es2021.en/plugins/chart/chart.css +173 -0
- package/es2021.en/plugins/chart/chart.js +1424 -0
- package/es2021.en/plugins/chart/chart.min.css +1 -0
- package/es2021.en/plugins/chart/chart.min.js +20 -0
- package/es2021.en/plugins/color-picker/color-picker.css +1 -1
- package/es2021.en/plugins/color-picker/color-picker.js +1 -1
- package/es2021.en/plugins/color-picker/color-picker.min.js +1 -1
- package/es2021.en/plugins/emoji/emoji.css +1 -1
- package/es2021.en/plugins/emoji/emoji.js +1 -1
- package/es2021.en/plugins/emoji/emoji.min.js +1 -1
- package/es2021.en/plugins/export-docs/export-docs.js +1 -1
- package/es2021.en/plugins/export-docs/export-docs.min.js +1 -1
- package/es2021.en/plugins/finder/finder.css +1 -1
- package/es2021.en/plugins/finder/finder.js +1 -1
- package/es2021.en/plugins/finder/finder.min.js +1 -1
- package/es2021.en/plugins/google-maps/google-maps.css +1 -1
- package/es2021.en/plugins/google-maps/google-maps.js +1 -1
- package/es2021.en/plugins/google-maps/google-maps.min.js +1 -1
- package/es2021.en/plugins/google-search/google-search.js +1 -1
- package/es2021.en/plugins/google-search/google-search.min.js +1 -1
- package/es2021.en/plugins/highlight-signature/highlight-signature.js +1 -1
- package/es2021.en/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es2021.en/plugins/iframe-editor/iframe-editor.css +1 -1
- package/es2021.en/plugins/iframe-editor/iframe-editor.js +1 -1
- package/es2021.en/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es2021.en/plugins/image-editor-pro/image-editor-pro.css +1 -1
- package/es2021.en/plugins/image-editor-pro/image-editor-pro.js +1 -1
- package/es2021.en/plugins/image-editor-pro/image-editor-pro.min.js +1 -1
- package/es2021.en/plugins/keyboard/keyboard.css +1 -1
- package/es2021.en/plugins/keyboard/keyboard.js +1 -1
- package/es2021.en/plugins/keyboard/keyboard.min.js +1 -1
- package/es2021.en/plugins/mobile-view/mobile-view.js +1 -1
- package/es2021.en/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es2021.en/plugins/page-break/page-break.js +1 -1
- package/es2021.en/plugins/page-break/page-break.min.js +1 -1
- package/es2021.en/plugins/paste-code/paste-code.css +1 -1
- package/es2021.en/plugins/paste-code/paste-code.js +1 -1
- package/es2021.en/plugins/paste-code/paste-code.min.js +1 -1
- package/es2021.en/plugins/paste-from-word/paste-from-word.js +1 -1
- package/es2021.en/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es2021.en/plugins/show-blocks/show-blocks.js +1 -1
- package/es2021.en/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es2021.en/plugins/style/style.css +1 -1
- package/es2021.en/plugins/style/style.js +1 -1
- package/es2021.en/plugins/style/style.min.js +1 -1
- package/es2021.en/plugins/templates/templates.css +1 -1
- package/es2021.en/plugins/templates/templates.js +1 -1
- package/es2021.en/plugins/templates/templates.min.js +1 -1
- package/es2021.en/plugins/todo-list/todo-list.css +1 -1
- package/es2021.en/plugins/todo-list/todo-list.js +1 -1
- package/es2021.en/plugins/todo-list/todo-list.min.js +1 -1
- package/es2021.en/plugins/translate/translate.css +1 -1
- package/es2021.en/plugins/translate/translate.js +1 -1
- package/es2021.en/plugins/translate/translate.min.js +1 -1
- package/es2021.en/plugins/tune-block/tune-block.css +1 -1
- package/es2021.en/plugins/tune-block/tune-block.js +2 -1
- package/es2021.en/plugins/tune-block/tune-block.min.js +2 -2
- package/es5/jodit.css +3 -3
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +1521 -153
- package/es5/jodit.min.css +3 -3
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
- package/es5/plugins/ai-assistant-pro/ai-assistant-pro.js +1 -1
- package/es5/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
- package/es5/plugins/autocomplete/autocomplete.css +1 -1
- package/es5/plugins/autocomplete/autocomplete.js +1 -1
- package/es5/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es5/plugins/backup/backup.css +1 -1
- package/es5/plugins/backup/backup.js +1 -1
- package/es5/plugins/backup/backup.min.js +1 -1
- package/es5/plugins/button-generator/button-generator.css +1 -1
- package/es5/plugins/button-generator/button-generator.js +1 -1
- package/es5/plugins/button-generator/button-generator.min.js +1 -1
- package/es5/plugins/change-case/change-case.js +1 -1
- package/es5/plugins/change-case/change-case.min.js +1 -1
- package/es5/plugins/chart/chart.css +173 -0
- package/es5/plugins/chart/chart.js +1661 -0
- package/es5/plugins/chart/chart.min.css +1 -0
- package/es5/plugins/chart/chart.min.js +8 -0
- package/es5/plugins/color-picker/color-picker.css +1 -1
- package/es5/plugins/color-picker/color-picker.js +1 -1
- package/es5/plugins/color-picker/color-picker.min.js +1 -1
- package/es5/plugins/emoji/emoji.css +1 -1
- package/es5/plugins/emoji/emoji.js +1 -1
- package/es5/plugins/emoji/emoji.min.js +1 -1
- package/es5/plugins/export-docs/export-docs.js +1 -1
- package/es5/plugins/export-docs/export-docs.min.js +1 -1
- package/es5/plugins/finder/finder.css +1 -1
- package/es5/plugins/finder/finder.js +1 -1
- package/es5/plugins/finder/finder.min.js +1 -1
- package/es5/plugins/google-maps/google-maps.css +1 -1
- package/es5/plugins/google-maps/google-maps.js +1 -1
- package/es5/plugins/google-maps/google-maps.min.js +1 -1
- package/es5/plugins/google-search/google-search.js +1 -1
- package/es5/plugins/google-search/google-search.min.js +1 -1
- package/es5/plugins/highlight-signature/highlight-signature.js +1 -1
- package/es5/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es5/plugins/iframe-editor/iframe-editor.css +1 -1
- package/es5/plugins/iframe-editor/iframe-editor.js +1 -1
- package/es5/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es5/plugins/image-editor-pro/image-editor-pro.css +1 -1
- package/es5/plugins/image-editor-pro/image-editor-pro.js +1 -1
- package/es5/plugins/image-editor-pro/image-editor-pro.min.js +1 -1
- package/es5/plugins/keyboard/keyboard.css +1 -1
- package/es5/plugins/keyboard/keyboard.js +1 -1
- package/es5/plugins/keyboard/keyboard.min.js +1 -1
- package/es5/plugins/mobile-view/mobile-view.js +1 -1
- package/es5/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es5/plugins/page-break/page-break.js +1 -1
- package/es5/plugins/page-break/page-break.min.js +1 -1
- package/es5/plugins/paste-code/paste-code.css +1 -1
- package/es5/plugins/paste-code/paste-code.js +1 -1
- package/es5/plugins/paste-code/paste-code.min.js +1 -1
- package/es5/plugins/paste-from-word/paste-from-word.js +1 -1
- package/es5/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es5/plugins/show-blocks/show-blocks.js +1 -1
- package/es5/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es5/plugins/style/style.css +1 -1
- package/es5/plugins/style/style.js +1 -1
- package/es5/plugins/style/style.min.js +1 -1
- package/es5/plugins/templates/templates.css +1 -1
- package/es5/plugins/templates/templates.js +1 -1
- package/es5/plugins/templates/templates.min.js +1 -1
- package/es5/plugins/todo-list/todo-list.css +1 -1
- package/es5/plugins/todo-list/todo-list.js +1 -1
- package/es5/plugins/todo-list/todo-list.min.js +1 -1
- package/es5/plugins/translate/translate.css +1 -1
- package/es5/plugins/translate/translate.js +1 -1
- package/es5/plugins/translate/translate.min.js +1 -1
- package/es5/plugins/tune-block/tune-block.css +1 -1
- package/es5/plugins/tune-block/tune-block.js +2 -1
- package/es5/plugins/tune-block/tune-block.min.js +2 -2
- package/es5/polyfills.fat.min.js +1 -1
- package/es5/polyfills.js +1 -1
- package/es5/polyfills.min.js +1 -1
- package/esm/config.d.ts +27 -1
- package/esm/plugins/all.js +1 -1
- package/esm/plugins/chart/assets/chart.svg.js +1 -0
- package/esm/plugins/chart/chart.d.ts +56 -0
- package/esm/plugins/chart/chart.js +1 -0
- package/esm/plugins/chart/config.d.ts +33 -0
- package/esm/plugins/chart/config.js +1 -0
- package/esm/plugins/chart/helpers.d.ts +22 -0
- package/esm/plugins/chart/helpers.js +1 -0
- package/esm/plugins/chart/interface.d.ts +34 -0
- package/esm/plugins/chart/interface.js +0 -0
- package/esm/plugins/chart/render/bar.d.ts +8 -0
- package/esm/plugins/chart/render/bar.js +1 -0
- package/esm/plugins/chart/render/common.d.ts +40 -0
- package/esm/plugins/chart/render/common.js +1 -0
- package/esm/plugins/chart/render/index.d.ts +7 -0
- package/esm/plugins/chart/render/index.js +1 -0
- package/esm/plugins/chart/render/line.d.ts +7 -0
- package/esm/plugins/chart/render/line.js +1 -0
- package/esm/plugins/chart/render/pie.d.ts +7 -0
- package/esm/plugins/chart/render/pie.js +1 -0
- package/esm/plugins/chart/render/radar.d.ts +7 -0
- package/esm/plugins/chart/render/radar.js +1 -0
- package/esm/plugins/chart/ui/editor/editor.d.ts +52 -0
- package/esm/plugins/chart/ui/editor/editor.js +13 -0
- package/esm/plugins/tune-block/config.js +1 -1
- package/package.json +1 -1
- package/types/config.d.ts +27 -1
- package/types/plugins/chart/chart.d.ts +56 -0
- package/types/plugins/chart/config.d.ts +33 -0
- package/types/plugins/chart/helpers.d.ts +22 -0
- package/types/plugins/chart/interface.d.ts +34 -0
- package/types/plugins/chart/render/bar.d.ts +8 -0
- package/types/plugins/chart/render/common.d.ts +40 -0
- package/types/plugins/chart/render/index.d.ts +7 -0
- package/types/plugins/chart/render/line.d.ts +7 -0
- package/types/plugins/chart/render/pie.d.ts +7 -0
- package/types/plugins/chart/render/radar.d.ts +7 -0
- package/types/plugins/chart/ui/editor/editor.d.ts +52 -0
|
@@ -0,0 +1,1479 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* jodit-pro - PRO Version of Jodit Editor
|
|
3
|
+
* Author: Chupurnov Valerii <chupurnov@gmail.com>
|
|
4
|
+
* Version: v4.18.7
|
|
5
|
+
* Url: https://xdsoft.net/jodit/pro/
|
|
6
|
+
* License(s): SEE LICENSE IN LICENSE.md
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
10
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
|
11
|
+
module.exports = factory();
|
|
12
|
+
else if(typeof define === 'function' && define.amd)
|
|
13
|
+
define([], factory);
|
|
14
|
+
else {
|
|
15
|
+
var a = factory();
|
|
16
|
+
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
|
17
|
+
}
|
|
18
|
+
})(self, function() {
|
|
19
|
+
return (self["webpackChunkjodit_pro"] = self["webpackChunkjodit_pro"] || []).push([[418],{
|
|
20
|
+
|
|
21
|
+
/***/ 97467:
|
|
22
|
+
/***/ (function(module) {
|
|
23
|
+
|
|
24
|
+
module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"> <g fill=\"none\"> <path d=\"M5 20v-7M12 20V4M19 20v-5M3 20h18\"/> </g> </svg>"
|
|
25
|
+
|
|
26
|
+
/***/ }),
|
|
27
|
+
|
|
28
|
+
/***/ 57722:
|
|
29
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
30
|
+
|
|
31
|
+
"use strict";
|
|
32
|
+
__webpack_require__.r(__webpack_exports__);
|
|
33
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
34
|
+
/* harmony export */ Chart: function() { return /* binding */ Chart; }
|
|
35
|
+
/* harmony export */ });
|
|
36
|
+
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82749);
|
|
37
|
+
/* harmony import */ var _swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56075);
|
|
38
|
+
/* harmony import */ var _swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(11886);
|
|
39
|
+
/* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(31635);
|
|
40
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(88902);
|
|
41
|
+
/* harmony import */ var _ui_editor_editor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(90142);
|
|
42
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(99131);
|
|
43
|
+
/* harmony import */ var jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(65478);
|
|
44
|
+
/* harmony import */ var jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(2748);
|
|
45
|
+
/* harmony import */ var jodit_esm_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(4510);
|
|
46
|
+
/* harmony import */ var jodit_esm_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(5700);
|
|
47
|
+
/* harmony import */ var jodit_esm_core_plugin__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(50911);
|
|
48
|
+
/* harmony import */ var jodit_esm_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(10830);
|
|
49
|
+
/* harmony import */ var jodit_esm_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(56917);
|
|
50
|
+
/* harmony import */ var jodit_esm_modules_dialog_dialog__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(78584);
|
|
51
|
+
/* harmony import */ var jodit_esm_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(21491);
|
|
52
|
+
/* harmony import */ var jodit_pro_jodit_pro__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(2692);
|
|
53
|
+
/*!
|
|
54
|
+
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
55
|
+
* See LICENSE.md in the project root for license information.
|
|
56
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Inserts self-contained SVG charts (bar, horizontal bar, line, pie, donut)
|
|
77
|
+
* and lets the user edit them in a dialog or remove them from a popup.
|
|
78
|
+
*/ class Chart extends jodit_esm_core_plugin__WEBPACK_IMPORTED_MODULE_11__.Plugin {
|
|
79
|
+
afterInit(jodit) {
|
|
80
|
+
jodit.e.on('openChartEditor', this.openEditor).on('removeChart', this.removeChart).on('isChartEditorOpened', ()=>{
|
|
81
|
+
var _this___dialog;
|
|
82
|
+
return Boolean((_this___dialog = this.__dialog) === null || _this___dialog === void 0 ? void 0 : _this___dialog.isOpened);
|
|
83
|
+
});
|
|
84
|
+
jodit.registerCommand('insertChart', ()=>{
|
|
85
|
+
this.openEditor();
|
|
86
|
+
return false;
|
|
87
|
+
});
|
|
88
|
+
this.__decorateAll();
|
|
89
|
+
}
|
|
90
|
+
beforeDestruct() {
|
|
91
|
+
var _this___popup, _this___dialog;
|
|
92
|
+
this.closePopup();
|
|
93
|
+
(_this___popup = this.__popup) === null || _this___popup === void 0 ? void 0 : _this___popup.destruct();
|
|
94
|
+
(_this___dialog = this.__dialog) === null || _this___dialog === void 0 ? void 0 : _this___dialog.destruct();
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Opens the editor dialog for a new chart or for an existing one.
|
|
98
|
+
*/ openEditor(target) {
|
|
99
|
+
const figure = (0,_helpers__WEBPACK_IMPORTED_MODULE_6__.findChart)(this.j, target !== null && target !== void 0 ? target : null);
|
|
100
|
+
const data = figure && (0,_helpers__WEBPACK_IMPORTED_MODULE_6__.readChartData)(this.j, figure) || (0,_helpers__WEBPACK_IMPORTED_MODULE_6__.defaultChartData)(this.j);
|
|
101
|
+
this.closePopup();
|
|
102
|
+
this.j.s.save();
|
|
103
|
+
const dialog = this.__getDialog();
|
|
104
|
+
const editor = this.__editor;
|
|
105
|
+
if (!editor) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
editor.setData(data);
|
|
109
|
+
dialog.setHeader(this.j.i18n(figure ? 'Edit chart' : 'Insert chart')).setFooter([
|
|
110
|
+
(0,jodit_esm_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_12__.Button)(dialog, 'cancel', 'Cancel', 'default').onAction(()=>{
|
|
111
|
+
dialog.close();
|
|
112
|
+
}),
|
|
113
|
+
(0,jodit_esm_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_12__.Button)(dialog, 'ok', figure ? 'Save' : 'Insert', 'primary').onAction(()=>{
|
|
114
|
+
this.__save(figure, editor.getData());
|
|
115
|
+
dialog.close();
|
|
116
|
+
})
|
|
117
|
+
]).open();
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Removes the chart that owns the given node.
|
|
121
|
+
*/ removeChart(target) {
|
|
122
|
+
const figure = (0,_helpers__WEBPACK_IMPORTED_MODULE_6__.findChart)(this.j, target !== null && target !== void 0 ? target : this.__target);
|
|
123
|
+
this.closePopup();
|
|
124
|
+
if (figure) {
|
|
125
|
+
this.j.s.setCursorAfter(figure);
|
|
126
|
+
jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.safeRemove(figure);
|
|
127
|
+
this.j.synchronizeValues();
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
__save(figure, data) {
|
|
131
|
+
if (figure) {
|
|
132
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_6__.applyChartData)(this.j, figure, data);
|
|
133
|
+
} else {
|
|
134
|
+
figure = (0,_helpers__WEBPACK_IMPORTED_MODULE_6__.createChart)(this.j, data);
|
|
135
|
+
this.j.s.restore();
|
|
136
|
+
this.j.s.insertNode(figure, false, false);
|
|
137
|
+
}
|
|
138
|
+
this.j.s.setCursorAfter(figure);
|
|
139
|
+
this.j.synchronizeValues();
|
|
140
|
+
}
|
|
141
|
+
__getDialog() {
|
|
142
|
+
if (!this.__dialog) {
|
|
143
|
+
const { dialog } = this.j.o.chart;
|
|
144
|
+
this.__dialog = new jodit_esm_modules_dialog_dialog__WEBPACK_IMPORTED_MODULE_14__.Dialog({
|
|
145
|
+
language: this.j.o.language,
|
|
146
|
+
theme: this.j.o.theme,
|
|
147
|
+
shadowRoot: this.j.o.shadowRoot,
|
|
148
|
+
events: this.j.o.events
|
|
149
|
+
});
|
|
150
|
+
this.__editor = new _ui_editor_editor__WEBPACK_IMPORTED_MODULE_5__.UIChartEditor(this.j);
|
|
151
|
+
this.__dialog.setContent(this.__editor).setSize(dialog.width, dialog.height);
|
|
152
|
+
this.__dialog.e.on('beforeClose', ()=>{
|
|
153
|
+
this.j.s.restore();
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
return this.__dialog;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Handler: clicking a chart opens its popup; clicking elsewhere closes it.
|
|
160
|
+
*/ onClick(e) {
|
|
161
|
+
const figure = (0,_helpers__WEBPACK_IMPORTED_MODULE_6__.findChart)(this.j, e.target);
|
|
162
|
+
if (figure) {
|
|
163
|
+
this.openPopup(figure);
|
|
164
|
+
} else {
|
|
165
|
+
this.closePopup();
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
onDblClick(e) {
|
|
169
|
+
const figure = (0,_helpers__WEBPACK_IMPORTED_MODULE_6__.findChart)(this.j, e.target);
|
|
170
|
+
if (figure) {
|
|
171
|
+
this.openEditor(figure);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
onOutsideClick() {
|
|
175
|
+
this.closePopup();
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Shows the contextual popup (edit / delete) above the chart.
|
|
179
|
+
*/ openPopup(figure) {
|
|
180
|
+
if (this.j.o.readonly || !this.j.o.chart.popup.length) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
if (!this.__popup) {
|
|
184
|
+
this.__popup = new jodit_esm_core_ui_popup_popup__WEBPACK_IMPORTED_MODULE_13__.Popup(this.j, false);
|
|
185
|
+
this.__toolbar = (0,jodit_esm_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_15__.makeCollection)(this.j, this.__popup);
|
|
186
|
+
}
|
|
187
|
+
const popup = this.__popup;
|
|
188
|
+
const toolbar = this.__toolbar;
|
|
189
|
+
if (!toolbar) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
this.__target = figure;
|
|
193
|
+
toolbar.build(this.j.o.chart.popup, figure);
|
|
194
|
+
popup.setContent(toolbar.container);
|
|
195
|
+
if (popup.isOpened) {
|
|
196
|
+
popup.updatePosition();
|
|
197
|
+
} else {
|
|
198
|
+
popup.open(()=>(0,jodit_esm_core_helpers_size_position__WEBPACK_IMPORTED_MODULE_10__.position)(figure, this.j));
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
closePopup() {
|
|
202
|
+
var _this___popup;
|
|
203
|
+
this.__target = null;
|
|
204
|
+
(_this___popup = this.__popup) === null || _this___popup === void 0 ? void 0 : _this___popup.close();
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Decorates charts that arrived with the value (initial load, paste) and
|
|
208
|
+
* re-renders charts whose box was changed by the resizer.
|
|
209
|
+
*/ onChange() {
|
|
210
|
+
this.__decorateAll();
|
|
211
|
+
if (this.__target && !this.j.editor.contains(this.__target)) {
|
|
212
|
+
this.closePopup();
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
__decorateAll() {
|
|
216
|
+
let changed = false;
|
|
217
|
+
(0,jodit_esm_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_9__.toArray)(this.j.editor.querySelectorAll(`figure[${_helpers__WEBPACK_IMPORTED_MODULE_6__.CHART_ATTR}]`)).forEach((figure)=>{
|
|
218
|
+
if (!(0,_helpers__WEBPACK_IMPORTED_MODULE_6__.isChartElement)(figure, this.j.o.chart.className)) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
;(0,_helpers__WEBPACK_IMPORTED_MODULE_6__.decorateChart)(this.j, figure);
|
|
222
|
+
changed = this.__syncResized(figure) || changed;
|
|
223
|
+
changed = this.__renderMissing(figure) || changed;
|
|
224
|
+
});
|
|
225
|
+
if (changed) {
|
|
226
|
+
this.j.synchronizeValues();
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* A figure that carries data but no SVG (e.g. content produced by a
|
|
231
|
+
* backend) is rendered on load.
|
|
232
|
+
*/ __renderMissing(figure) {
|
|
233
|
+
if (figure.querySelector('svg')) {
|
|
234
|
+
return false;
|
|
235
|
+
}
|
|
236
|
+
const data = (0,_helpers__WEBPACK_IMPORTED_MODULE_6__.readChartData)(this.j, figure);
|
|
237
|
+
if (!data) {
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
;(0,_helpers__WEBPACK_IMPORTED_MODULE_6__.applyChartData)(this.j, figure, data);
|
|
241
|
+
return true;
|
|
242
|
+
}
|
|
243
|
+
__syncResized(figure) {
|
|
244
|
+
const data = (0,_helpers__WEBPACK_IMPORTED_MODULE_6__.readChartData)(this.j, figure);
|
|
245
|
+
if (!data) {
|
|
246
|
+
return false;
|
|
247
|
+
}
|
|
248
|
+
const width = (0,_helpers__WEBPACK_IMPORTED_MODULE_6__.pixels)(figure.style.width) || data.width;
|
|
249
|
+
const height = (0,_helpers__WEBPACK_IMPORTED_MODULE_6__.pixels)(figure.style.height) || data.height;
|
|
250
|
+
if (width === data.width && height === data.height) {
|
|
251
|
+
return false;
|
|
252
|
+
}
|
|
253
|
+
;(0,_helpers__WEBPACK_IMPORTED_MODULE_6__.applyChartData)(this.j, figure, (0,_swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_2__._)((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_1__._)({}, data), {
|
|
254
|
+
width,
|
|
255
|
+
height
|
|
256
|
+
}));
|
|
257
|
+
return true;
|
|
258
|
+
}
|
|
259
|
+
constructor(...args){
|
|
260
|
+
super(...args), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "buttons", [
|
|
261
|
+
{
|
|
262
|
+
name: 'chart',
|
|
263
|
+
group: 'insert'
|
|
264
|
+
}
|
|
265
|
+
]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__dialog", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__editor", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__popup", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__toolbar", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__target", null);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
;(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Chart, "requires", [
|
|
269
|
+
'license'
|
|
270
|
+
]);
|
|
271
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
|
|
272
|
+
jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_7__.autobind
|
|
273
|
+
], Chart.prototype, "openEditor", null);
|
|
274
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
|
|
275
|
+
jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_7__.autobind
|
|
276
|
+
], Chart.prototype, "removeChart", null);
|
|
277
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
|
|
278
|
+
(0,jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_7__.watch)(':click')
|
|
279
|
+
], Chart.prototype, "onClick", null);
|
|
280
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
|
|
281
|
+
(0,jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_7__.watch)(':dblclick')
|
|
282
|
+
], Chart.prototype, "onDblClick", null);
|
|
283
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
|
|
284
|
+
(0,jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_7__.watch)(':outsideClick')
|
|
285
|
+
], Chart.prototype, "onOutsideClick", null);
|
|
286
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
|
|
287
|
+
(0,jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_7__.watch)([
|
|
288
|
+
':change',
|
|
289
|
+
':afterSetMode'
|
|
290
|
+
]),
|
|
291
|
+
(0,jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_7__.debounce)()
|
|
292
|
+
], Chart.prototype, "onChange", null);
|
|
293
|
+
jodit_pro_jodit_pro__WEBPACK_IMPORTED_MODULE_16__.JoditPro.plugins.add('chart', Chart);
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
/***/ }),
|
|
297
|
+
|
|
298
|
+
/***/ 88902:
|
|
299
|
+
/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
|
|
300
|
+
|
|
301
|
+
"use strict";
|
|
302
|
+
/* harmony import */ var _assets_chart_svg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(97467);
|
|
303
|
+
/* harmony import */ var _assets_chart_svg__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_assets_chart_svg__WEBPACK_IMPORTED_MODULE_0__);
|
|
304
|
+
/* harmony import */ var jodit_esm_config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6441);
|
|
305
|
+
/* harmony import */ var jodit_esm_core_ui_icon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12153);
|
|
306
|
+
/*!
|
|
307
|
+
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
308
|
+
* See LICENSE.md in the project root for license information.
|
|
309
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
|
|
310
|
+
*/
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
jodit_esm_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.chart = {
|
|
314
|
+
className: 'jodit-chart',
|
|
315
|
+
types: [
|
|
316
|
+
'bar',
|
|
317
|
+
'horizontalBar',
|
|
318
|
+
'line',
|
|
319
|
+
'area',
|
|
320
|
+
'pie',
|
|
321
|
+
'donut',
|
|
322
|
+
'radar'
|
|
323
|
+
],
|
|
324
|
+
defaultType: 'bar',
|
|
325
|
+
defaultTitle: 'Sample chart',
|
|
326
|
+
defaultPoints: [
|
|
327
|
+
{
|
|
328
|
+
label: 'Item 1',
|
|
329
|
+
value: 10
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
label: 'Item 2',
|
|
333
|
+
value: 20
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
label: 'Item 3',
|
|
337
|
+
value: 15
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
label: 'Item 4',
|
|
341
|
+
value: 25
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
label: 'Item 5',
|
|
345
|
+
value: 30
|
|
346
|
+
}
|
|
347
|
+
],
|
|
348
|
+
colors: [
|
|
349
|
+
'#2a78d6',
|
|
350
|
+
'#eb6834',
|
|
351
|
+
'#1baf7a',
|
|
352
|
+
'#eda100',
|
|
353
|
+
'#e87ba4',
|
|
354
|
+
'#008300',
|
|
355
|
+
'#6250d6',
|
|
356
|
+
'#e34948'
|
|
357
|
+
],
|
|
358
|
+
defaultBackground: '#ffffff',
|
|
359
|
+
defaultTextColor: '#111827',
|
|
360
|
+
defaultBorderColor: '#e5e7eb',
|
|
361
|
+
allowChangeBackground: true,
|
|
362
|
+
allowChangeTextColor: true,
|
|
363
|
+
allowChangeBorderColor: true,
|
|
364
|
+
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",
|
|
365
|
+
width: 600,
|
|
366
|
+
height: 400,
|
|
367
|
+
popup: [
|
|
368
|
+
'chartEdit',
|
|
369
|
+
'chartRemove'
|
|
370
|
+
],
|
|
371
|
+
dialog: {
|
|
372
|
+
width: 620,
|
|
373
|
+
height: 720
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
jodit_esm_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.chart = {
|
|
377
|
+
tooltip: 'Insert chart',
|
|
378
|
+
icon: 'chart',
|
|
379
|
+
isActive (editor) {
|
|
380
|
+
return Boolean(editor.e.fire('isChartEditorOpened'));
|
|
381
|
+
},
|
|
382
|
+
exec (editor) {
|
|
383
|
+
editor.e.fire('openChartEditor');
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
jodit_esm_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.chartEdit = {
|
|
387
|
+
tooltip: 'Edit chart',
|
|
388
|
+
icon: 'pencil',
|
|
389
|
+
exec (editor, target) {
|
|
390
|
+
editor.e.fire('openChartEditor', target);
|
|
391
|
+
}
|
|
392
|
+
};
|
|
393
|
+
jodit_esm_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.controls.chartRemove = {
|
|
394
|
+
tooltip: 'Delete chart',
|
|
395
|
+
icon: 'bin',
|
|
396
|
+
exec (editor, target) {
|
|
397
|
+
editor.e.fire('removeChart', target);
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
jodit_esm_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.allowResizeTags = new Set([
|
|
401
|
+
...jodit_esm_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.allowResizeTags,
|
|
402
|
+
'figure'
|
|
403
|
+
]);
|
|
404
|
+
jodit_esm_core_ui_icon__WEBPACK_IMPORTED_MODULE_2__.Icon.set('chart', (_assets_chart_svg__WEBPACK_IMPORTED_MODULE_0___default()));
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
/***/ }),
|
|
408
|
+
|
|
409
|
+
/***/ 99131:
|
|
410
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
411
|
+
|
|
412
|
+
"use strict";
|
|
413
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
414
|
+
/* harmony export */ applyChartData: function() { return /* binding */ applyChartData; },
|
|
415
|
+
/* harmony export */ cloneChartData: function() { return /* binding */ cloneChartData; },
|
|
416
|
+
/* harmony export */ createChart: function() { return /* binding */ createChart; },
|
|
417
|
+
/* harmony export */ decorateChart: function() { return /* binding */ decorateChart; },
|
|
418
|
+
/* harmony export */ defaultChartData: function() { return /* binding */ defaultChartData; },
|
|
419
|
+
/* harmony export */ findChart: function() { return /* binding */ findChart; },
|
|
420
|
+
/* harmony export */ isChartElement: function() { return /* binding */ isChartElement; },
|
|
421
|
+
/* harmony export */ normalizePoint: function() { return /* binding */ normalizePoint; },
|
|
422
|
+
/* harmony export */ pixels: function() { return /* binding */ pixels; },
|
|
423
|
+
/* harmony export */ readChartData: function() { return /* binding */ readChartData; }
|
|
424
|
+
/* harmony export */ });
|
|
425
|
+
/* unused harmony exports CHART_TYPES, isChartType, normalizeChartData */
|
|
426
|
+
/* harmony import */ var _swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56075);
|
|
427
|
+
/* harmony import */ var _swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11886);
|
|
428
|
+
/* harmony import */ var _render__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(75787);
|
|
429
|
+
/* harmony import */ var jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2748);
|
|
430
|
+
/* harmony import */ var jodit_esm_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(70799);
|
|
431
|
+
/* harmony import */ var jodit_esm_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(29960);
|
|
432
|
+
/*!
|
|
433
|
+
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
434
|
+
* See LICENSE.md in the project root for license information.
|
|
435
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
|
|
436
|
+
*/
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
const CHART_ATTR = 'data-jodit-chart';
|
|
443
|
+
const CHART_TYPES = [
|
|
444
|
+
'bar',
|
|
445
|
+
'horizontalBar',
|
|
446
|
+
'line',
|
|
447
|
+
'area',
|
|
448
|
+
'pie',
|
|
449
|
+
'donut',
|
|
450
|
+
'radar'
|
|
451
|
+
];
|
|
452
|
+
const CHART_TYPE_TITLES = {
|
|
453
|
+
bar: 'Bar chart',
|
|
454
|
+
horizontalBar: 'Horizontal bar',
|
|
455
|
+
line: 'Line chart',
|
|
456
|
+
area: 'Area chart',
|
|
457
|
+
pie: 'Pie chart',
|
|
458
|
+
donut: 'Donut chart',
|
|
459
|
+
radar: 'Radar chart'
|
|
460
|
+
};
|
|
461
|
+
function isChartType(value) {
|
|
462
|
+
return CHART_TYPES.includes(value);
|
|
463
|
+
}
|
|
464
|
+
function normalizePoint(raw) {
|
|
465
|
+
var _raw_label;
|
|
466
|
+
const value = Number(raw.value);
|
|
467
|
+
const point = {
|
|
468
|
+
label: String((_raw_label = raw.label) !== null && _raw_label !== void 0 ? _raw_label : ''),
|
|
469
|
+
value: isFinite(value) ? value : 0
|
|
470
|
+
};
|
|
471
|
+
if (raw.color) {
|
|
472
|
+
point.color = String(raw.color);
|
|
473
|
+
}
|
|
474
|
+
return point;
|
|
475
|
+
}
|
|
476
|
+
function normalizeChartData(raw, defaults) {
|
|
477
|
+
var _raw_title;
|
|
478
|
+
const width = Number(raw.width);
|
|
479
|
+
const height = Number(raw.height);
|
|
480
|
+
return {
|
|
481
|
+
type: isChartType(raw.type) ? raw.type : defaults.type,
|
|
482
|
+
title: String((_raw_title = raw.title) !== null && _raw_title !== void 0 ? _raw_title : defaults.title),
|
|
483
|
+
points: Array.isArray(raw.points) ? raw.points.map(normalizePoint) : defaults.points.map(normalizePoint),
|
|
484
|
+
width: width > 0 ? Math.round(width) : defaults.width,
|
|
485
|
+
height: height > 0 ? Math.round(height) : defaults.height,
|
|
486
|
+
background: (0,jodit_esm_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_4__.isString)(raw.background) ? raw.background : defaults.background,
|
|
487
|
+
textColor: (0,jodit_esm_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_4__.isString)(raw.textColor) ? raw.textColor : defaults.textColor,
|
|
488
|
+
borderColor: (0,jodit_esm_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_4__.isString)(raw.borderColor) ? raw.borderColor : defaults.borderColor
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
function cloneChartData(data) {
|
|
492
|
+
return (0,_swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_1__._)((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_0__._)({}, data), {
|
|
493
|
+
points: data.points.map((p)=>(0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_0__._)({}, p))
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
function isChartElement(node, className) {
|
|
497
|
+
return jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isTag(node, 'figure') && (node.hasAttribute(CHART_ATTR) || node.classList.contains(className));
|
|
498
|
+
}
|
|
499
|
+
function findChart(jodit, node) {
|
|
500
|
+
return jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.closest(node, (n)=>isChartElement(n, jodit.o.chart.className), jodit.editor);
|
|
501
|
+
}
|
|
502
|
+
function readChartData(jodit, figure) {
|
|
503
|
+
const json = (0,jodit_esm_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__.attr)(figure, CHART_ATTR);
|
|
504
|
+
if (!json) {
|
|
505
|
+
return null;
|
|
506
|
+
}
|
|
507
|
+
try {
|
|
508
|
+
return normalizeChartData(JSON.parse(json), defaultChartData(jodit));
|
|
509
|
+
} catch (unused) {
|
|
510
|
+
return null;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
function defaultChartData(jodit) {
|
|
514
|
+
const { chart } = jodit.o;
|
|
515
|
+
return {
|
|
516
|
+
type: chart.defaultType,
|
|
517
|
+
title: chart.defaultTitle,
|
|
518
|
+
points: chart.defaultPoints.map(normalizePoint),
|
|
519
|
+
width: chart.width,
|
|
520
|
+
height: chart.height,
|
|
521
|
+
background: chart.defaultBackground,
|
|
522
|
+
textColor: chart.defaultTextColor,
|
|
523
|
+
borderColor: chart.defaultBorderColor
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
function decorateChart(jodit, figure) {
|
|
527
|
+
;(0,jodit_esm_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__.attr)(figure, {
|
|
528
|
+
class: jodit.o.chart.className,
|
|
529
|
+
contenteditable: false
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
function applyChartData(jodit, figure, data) {
|
|
533
|
+
const { chart } = jodit.o;
|
|
534
|
+
decorateChart(jodit, figure);
|
|
535
|
+
(0,jodit_esm_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__.attr)(figure, CHART_ATTR, JSON.stringify(data));
|
|
536
|
+
figure.style.width = data.width + 'px';
|
|
537
|
+
figure.style.maxWidth = '100%';
|
|
538
|
+
figure.style.height = '';
|
|
539
|
+
figure.innerHTML = (0,_render__WEBPACK_IMPORTED_MODULE_2__.renderChart)(data, {
|
|
540
|
+
colors: chart.colors,
|
|
541
|
+
fontFamily: chart.fontFamily
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
function createChart(jodit, data) {
|
|
545
|
+
const figure = jodit.createInside.element('figure');
|
|
546
|
+
applyChartData(jodit, figure, data);
|
|
547
|
+
return figure;
|
|
548
|
+
}
|
|
549
|
+
function pixels(value) {
|
|
550
|
+
return /^\d+(\.\d+)?px$/.test(value) ? Math.round(parseFloat(value)) : 0;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, [
|
|
554
|
+
/* harmony export */ "CHART_ATTR", 0, /* binding */ CHART_ATTR,
|
|
555
|
+
/* harmony export */ "CHART_TYPE_TITLES", 0, /* binding */ CHART_TYPE_TITLES
|
|
556
|
+
/* harmony export */ ]);
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+
/***/ }),
|
|
560
|
+
|
|
561
|
+
/***/ 93054:
|
|
562
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
563
|
+
|
|
564
|
+
"use strict";
|
|
565
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
566
|
+
/* harmony export */ renderBar: function() { return /* binding */ renderBar; },
|
|
567
|
+
/* harmony export */ renderHorizontalBar: function() { return /* binding */ renderHorizontalBar; }
|
|
568
|
+
/* harmony export */ });
|
|
569
|
+
/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36838);
|
|
570
|
+
/*!
|
|
571
|
+
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
572
|
+
* See LICENSE.md in the project root for license information.
|
|
573
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
|
|
574
|
+
*/
|
|
575
|
+
function renderBar(data, options) {
|
|
576
|
+
const scale = (0,_common__WEBPACK_IMPORTED_MODULE_0__.ticks)(data.points);
|
|
577
|
+
const top = scale[scale.length - 1];
|
|
578
|
+
const yLabelWidth = Math.max(...scale.map((v)=>(0,_common__WEBPACK_IMPORTED_MODULE_0__.textWidth)((0,_common__WEBPACK_IMPORTED_MODULE_0__.formatValue)(v), (/* inlined export .TICK_FONT */12))));
|
|
579
|
+
const box = (0,_common__WEBPACK_IMPORTED_MODULE_0__.plotBox)(data, {
|
|
580
|
+
x: yLabelWidth + 12,
|
|
581
|
+
y: 28,
|
|
582
|
+
width: 0,
|
|
583
|
+
height: 28
|
|
584
|
+
});
|
|
585
|
+
const theme = (0,_common__WEBPACK_IMPORTED_MODULE_0__.chartTheme)(data);
|
|
586
|
+
const parts = [
|
|
587
|
+
(0,_common__WEBPACK_IMPORTED_MODULE_0__.svgOpen)(data, options)
|
|
588
|
+
];
|
|
589
|
+
scale.forEach((v)=>{
|
|
590
|
+
const y = box.y + box.height - v / top * box.height;
|
|
591
|
+
parts.push(`<line x1="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(box.x)}" y1="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(y)}" x2="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(box.x + box.width)}" y2="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(y)}" stroke="${theme.grid}" stroke-dasharray="3 3"/>`, `<text x="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(box.x - 8)}" y="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(y + 4)}" font-size="${(/* inlined export .TICK_FONT */12)}" fill="${theme.inkMuted}" text-anchor="end">${(0,_common__WEBPACK_IMPORTED_MODULE_0__.esc)((0,_common__WEBPACK_IMPORTED_MODULE_0__.formatValue)(v))}</text>`);
|
|
592
|
+
});
|
|
593
|
+
const count = data.points.length || 1;
|
|
594
|
+
const band = box.width / count;
|
|
595
|
+
const barWidth = Math.max(2, band * 0.6);
|
|
596
|
+
const baseline = box.y + box.height;
|
|
597
|
+
data.points.forEach((point, i)=>{
|
|
598
|
+
const color = (0,_common__WEBPACK_IMPORTED_MODULE_0__.pointColor)(point, i, options);
|
|
599
|
+
const value = point.value > 0 ? point.value : 0;
|
|
600
|
+
const height = value / top * box.height;
|
|
601
|
+
const x = box.x + i * band + (band - barWidth) / 2;
|
|
602
|
+
const cx = x + barWidth / 2;
|
|
603
|
+
parts.push(`<path d="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.roundedBarPath)(x, baseline - height, barWidth, height, (/* inlined export .BAR_RADIUS */4), 'top')}" fill="${color}"><title>${(0,_common__WEBPACK_IMPORTED_MODULE_0__.esc)(point.label)}: ${(0,_common__WEBPACK_IMPORTED_MODULE_0__.esc)((0,_common__WEBPACK_IMPORTED_MODULE_0__.formatValue)(point.value))}</title></path>`, (0,_common__WEBPACK_IMPORTED_MODULE_0__.valuePill)(cx, baseline - height - 18, point.value, color, theme), `<text x="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(cx)}" y="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(baseline + 20)}" font-size="${(/* inlined export .LABEL_FONT */13)}" fill="${theme.inkMuted}" text-anchor="middle">${(0,_common__WEBPACK_IMPORTED_MODULE_0__.esc)((0,_common__WEBPACK_IMPORTED_MODULE_0__.truncate)(point.label))}</text>`);
|
|
604
|
+
});
|
|
605
|
+
parts.push(`<line x1="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(box.x)}" y1="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(baseline)}" x2="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(box.x + box.width)}" y2="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(baseline)}" stroke="${theme.border}"/>`, (0,_common__WEBPACK_IMPORTED_MODULE_0__.svgClose)());
|
|
606
|
+
return parts.join('');
|
|
607
|
+
}
|
|
608
|
+
function renderHorizontalBar(data, options) {
|
|
609
|
+
const scale = (0,_common__WEBPACK_IMPORTED_MODULE_0__.ticks)(data.points);
|
|
610
|
+
const top = scale[scale.length - 1];
|
|
611
|
+
const labelWidth = Math.min(160, Math.max(...data.points.map((p)=>(0,_common__WEBPACK_IMPORTED_MODULE_0__.textWidth)((0,_common__WEBPACK_IMPORTED_MODULE_0__.truncate)(p.label), (/* inlined export .LABEL_FONT */13)))));
|
|
612
|
+
const box = (0,_common__WEBPACK_IMPORTED_MODULE_0__.plotBox)(data, {
|
|
613
|
+
x: labelWidth + 12,
|
|
614
|
+
y: 8,
|
|
615
|
+
width: 56,
|
|
616
|
+
height: 28
|
|
617
|
+
});
|
|
618
|
+
const theme = (0,_common__WEBPACK_IMPORTED_MODULE_0__.chartTheme)(data);
|
|
619
|
+
const parts = [
|
|
620
|
+
(0,_common__WEBPACK_IMPORTED_MODULE_0__.svgOpen)(data, options)
|
|
621
|
+
];
|
|
622
|
+
const bottom = box.y + box.height;
|
|
623
|
+
scale.forEach((v)=>{
|
|
624
|
+
const x = box.x + v / top * box.width;
|
|
625
|
+
parts.push(`<line x1="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(x)}" y1="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(box.y)}" x2="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(x)}" y2="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(bottom)}" stroke="${theme.grid}" stroke-dasharray="3 3"/>`, `<text x="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(x)}" y="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(bottom + 18)}" font-size="${(/* inlined export .TICK_FONT */12)}" fill="${theme.inkMuted}" text-anchor="middle">${(0,_common__WEBPACK_IMPORTED_MODULE_0__.esc)((0,_common__WEBPACK_IMPORTED_MODULE_0__.formatValue)(v))}</text>`);
|
|
626
|
+
});
|
|
627
|
+
const count = data.points.length || 1;
|
|
628
|
+
const band = box.height / count;
|
|
629
|
+
const barHeight = Math.max(2, band * 0.6);
|
|
630
|
+
data.points.forEach((point, i)=>{
|
|
631
|
+
const color = (0,_common__WEBPACK_IMPORTED_MODULE_0__.pointColor)(point, i, options);
|
|
632
|
+
const value = point.value > 0 ? point.value : 0;
|
|
633
|
+
const width = value / top * box.width;
|
|
634
|
+
const y = box.y + i * band + (band - barHeight) / 2;
|
|
635
|
+
const cy = y + barHeight / 2;
|
|
636
|
+
parts.push(`<path d="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.roundedBarPath)(box.x, y, width, barHeight, (/* inlined export .BAR_RADIUS */4), 'right')}" fill="${color}"><title>${(0,_common__WEBPACK_IMPORTED_MODULE_0__.esc)(point.label)}: ${(0,_common__WEBPACK_IMPORTED_MODULE_0__.esc)((0,_common__WEBPACK_IMPORTED_MODULE_0__.formatValue)(point.value))}</title></path>`, (0,_common__WEBPACK_IMPORTED_MODULE_0__.valuePill)(box.x + width + 12 + (0,_common__WEBPACK_IMPORTED_MODULE_0__.textWidth)((0,_common__WEBPACK_IMPORTED_MODULE_0__.formatValue)(point.value), (/* inlined export .LABEL_FONT */13)) / 2 + 8, cy, point.value, color, theme), `<text x="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(box.x - 12)}" y="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(cy + 4.5)}" font-size="${(/* inlined export .LABEL_FONT */13)}" fill="${theme.inkMuted}" text-anchor="end">${(0,_common__WEBPACK_IMPORTED_MODULE_0__.esc)((0,_common__WEBPACK_IMPORTED_MODULE_0__.truncate)(point.label))}</text>`);
|
|
637
|
+
});
|
|
638
|
+
parts.push(`<line x1="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(box.x)}" y1="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(box.y)}" x2="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(box.x)}" y2="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(bottom)}" stroke="${theme.border}"/>`, (0,_common__WEBPACK_IMPORTED_MODULE_0__.svgClose)());
|
|
639
|
+
return parts.join('');
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
/***/ }),
|
|
644
|
+
|
|
645
|
+
/***/ 36838:
|
|
646
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
647
|
+
|
|
648
|
+
"use strict";
|
|
649
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
650
|
+
/* harmony export */ chartTheme: function() { return /* binding */ chartTheme; },
|
|
651
|
+
/* harmony export */ esc: function() { return /* binding */ esc; },
|
|
652
|
+
/* harmony export */ formatValue: function() { return /* binding */ formatValue; },
|
|
653
|
+
/* harmony export */ num: function() { return /* binding */ num; },
|
|
654
|
+
/* harmony export */ plotBox: function() { return /* binding */ plotBox; },
|
|
655
|
+
/* harmony export */ pointColor: function() { return /* binding */ pointColor; },
|
|
656
|
+
/* harmony export */ roundedBarPath: function() { return /* binding */ roundedBarPath; },
|
|
657
|
+
/* harmony export */ svgClose: function() { return /* binding */ svgClose; },
|
|
658
|
+
/* harmony export */ svgOpen: function() { return /* binding */ svgOpen; },
|
|
659
|
+
/* harmony export */ textWidth: function() { return /* binding */ textWidth; },
|
|
660
|
+
/* harmony export */ ticks: function() { return /* binding */ ticks; },
|
|
661
|
+
/* harmony export */ truncate: function() { return /* binding */ truncate; },
|
|
662
|
+
/* harmony export */ valuePill: function() { return /* binding */ valuePill; }
|
|
663
|
+
/* harmony export */ });
|
|
664
|
+
/* unused harmony exports TICK_COUNT, MAX_LABEL, niceStep, renderTitle */
|
|
665
|
+
/*!
|
|
666
|
+
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
667
|
+
* See LICENSE.md in the project root for license information.
|
|
668
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
|
|
669
|
+
*/ const PAD = 24;
|
|
670
|
+
const TITLE_HEIGHT = 40;
|
|
671
|
+
const LABEL_FONT = 13;
|
|
672
|
+
const TICK_FONT = 12;
|
|
673
|
+
const TICK_COUNT = 4;
|
|
674
|
+
const BAR_RADIUS = 4;
|
|
675
|
+
const MAX_LABEL = 14;
|
|
676
|
+
const DEFAULT_BACKGROUND = '#ffffff';
|
|
677
|
+
const DEFAULT_TEXT_COLOR = '#111827';
|
|
678
|
+
function alpha(hex, opacity) {
|
|
679
|
+
const m = /^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(hex);
|
|
680
|
+
if (!m) {
|
|
681
|
+
return hex;
|
|
682
|
+
}
|
|
683
|
+
const [r, g, b] = [
|
|
684
|
+
m[1],
|
|
685
|
+
m[2],
|
|
686
|
+
m[3]
|
|
687
|
+
].map((c)=>parseInt(c, 16));
|
|
688
|
+
return `rgba(${r}, ${g}, ${b}, ${opacity})`;
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* Colors derived from the chart background and text color so grids, axes and
|
|
692
|
+
* secondary labels stay readable on light and dark surfaces alike.
|
|
693
|
+
*/ function chartTheme(data) {
|
|
694
|
+
var _data_background;
|
|
695
|
+
const ink = data.textColor || DEFAULT_TEXT_COLOR;
|
|
696
|
+
const background = (_data_background = data.background) !== null && _data_background !== void 0 ? _data_background : DEFAULT_BACKGROUND;
|
|
697
|
+
return {
|
|
698
|
+
surface: background || DEFAULT_BACKGROUND,
|
|
699
|
+
transparent: !background,
|
|
700
|
+
border: data.borderColor || alpha(ink, 0.12),
|
|
701
|
+
grid: alpha(ink, 0.12),
|
|
702
|
+
ink,
|
|
703
|
+
inkSecondary: alpha(ink, 0.8),
|
|
704
|
+
inkMuted: alpha(ink, 0.6)
|
|
705
|
+
};
|
|
706
|
+
}
|
|
707
|
+
// DOM-free so the renderers can run outside the browser (SSR, tests).
|
|
708
|
+
function esc(value) {
|
|
709
|
+
return String(value).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
|
710
|
+
}
|
|
711
|
+
function num(value) {
|
|
712
|
+
return String(Math.round(value * 100) / 100);
|
|
713
|
+
}
|
|
714
|
+
function formatValue(value) {
|
|
715
|
+
return num(value).replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
|
|
716
|
+
}
|
|
717
|
+
function truncate(label, max = MAX_LABEL) {
|
|
718
|
+
return label.length > max ? label.slice(0, max - 1) + '…' : label;
|
|
719
|
+
}
|
|
720
|
+
function pointColor(point, index, options) {
|
|
721
|
+
const { colors } = options;
|
|
722
|
+
return point.color || colors[index % colors.length] || '#2a78d6';
|
|
723
|
+
}
|
|
724
|
+
function niceStep(rawStep) {
|
|
725
|
+
var _candidates_find;
|
|
726
|
+
if (rawStep <= 0) {
|
|
727
|
+
return 1;
|
|
728
|
+
}
|
|
729
|
+
const magnitude = Math.pow(10, Math.floor(Math.log10(rawStep)));
|
|
730
|
+
const normalized = rawStep / magnitude;
|
|
731
|
+
const candidates = [
|
|
732
|
+
1,
|
|
733
|
+
2,
|
|
734
|
+
2.5,
|
|
735
|
+
5,
|
|
736
|
+
10
|
|
737
|
+
];
|
|
738
|
+
const step = (_candidates_find = candidates.find((c)=>c >= normalized)) !== null && _candidates_find !== void 0 ? _candidates_find : 10;
|
|
739
|
+
return step * magnitude;
|
|
740
|
+
}
|
|
741
|
+
function ticks(points) {
|
|
742
|
+
const max = Math.max(0, ...points.map((p)=>p.value > 0 ? p.value : 0));
|
|
743
|
+
const step = niceStep((max || 1) / TICK_COUNT);
|
|
744
|
+
const top = Math.max(step, Math.ceil(max / step) * step);
|
|
745
|
+
const result = [];
|
|
746
|
+
for(let v = 0; v <= top + step / 2; v += step){
|
|
747
|
+
result.push(Math.round(v * 1000) / 1000);
|
|
748
|
+
}
|
|
749
|
+
return result;
|
|
750
|
+
}
|
|
751
|
+
function textWidth(text, fontSize) {
|
|
752
|
+
return text.length * fontSize * 0.58;
|
|
753
|
+
}
|
|
754
|
+
function plotBox(data, margin) {
|
|
755
|
+
const top = PAD + (data.title ? TITLE_HEIGHT : 0) + margin.y;
|
|
756
|
+
return {
|
|
757
|
+
x: PAD + margin.x,
|
|
758
|
+
y: top,
|
|
759
|
+
width: Math.max(10, data.width - PAD * 2 - margin.x - margin.width),
|
|
760
|
+
height: Math.max(10, data.height - top - PAD - margin.height)
|
|
761
|
+
};
|
|
762
|
+
}
|
|
763
|
+
function svgOpen(data, options) {
|
|
764
|
+
const theme = chartTheme(data);
|
|
765
|
+
const label = data.title ? ` aria-label="${esc(data.title)}"` : '';
|
|
766
|
+
const card = theme.transparent ? '' : `<rect x="0.5" y="0.5" width="${data.width - 1}" height="${data.height - 1}" rx="12" fill="${theme.surface}" stroke="${theme.border}"/>`;
|
|
767
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${data.width} ${data.height}" width="100%" role="img"${label} font-family="${esc(options.fontFamily)}">` + card + renderTitle(data, theme);
|
|
768
|
+
}
|
|
769
|
+
function svgClose() {
|
|
770
|
+
return '</svg>';
|
|
771
|
+
}
|
|
772
|
+
function renderTitle(data, theme) {
|
|
773
|
+
if (!data.title) {
|
|
774
|
+
return '';
|
|
775
|
+
}
|
|
776
|
+
return `<text x="${PAD}" y="${PAD + 20}" font-size="20" font-weight="600" fill="${theme.ink}">${esc(data.title)}</text>`;
|
|
777
|
+
}
|
|
778
|
+
function roundedBarPath(x, y, width, height, radius, side) {
|
|
779
|
+
if (height <= 0 || width <= 0) {
|
|
780
|
+
return '';
|
|
781
|
+
}
|
|
782
|
+
const r = Math.min(radius, width / 2, height / 2);
|
|
783
|
+
if (side === 'top') {
|
|
784
|
+
return [
|
|
785
|
+
`M${num(x)},${num(y + height)}`,
|
|
786
|
+
`V${num(y + r)}`,
|
|
787
|
+
`a${num(r)},${num(r)} 0 0 1 ${num(r)},${num(-r)}`,
|
|
788
|
+
`h${num(width - r * 2)}`,
|
|
789
|
+
`a${num(r)},${num(r)} 0 0 1 ${num(r)},${num(r)}`,
|
|
790
|
+
`V${num(y + height)}`,
|
|
791
|
+
'Z'
|
|
792
|
+
].join('');
|
|
793
|
+
}
|
|
794
|
+
return [
|
|
795
|
+
`M${num(x)},${num(y)}`,
|
|
796
|
+
`H${num(x + width - r)}`,
|
|
797
|
+
`a${num(r)},${num(r)} 0 0 1 ${num(r)},${num(r)}`,
|
|
798
|
+
`v${num(height - r * 2)}`,
|
|
799
|
+
`a${num(r)},${num(r)} 0 0 1 ${num(-r)},${num(r)}`,
|
|
800
|
+
`H${num(x)}`,
|
|
801
|
+
'Z'
|
|
802
|
+
].join('');
|
|
803
|
+
}
|
|
804
|
+
function valuePill(cx, cy, value, color, theme) {
|
|
805
|
+
const text = formatValue(value);
|
|
806
|
+
const width = textWidth(text, LABEL_FONT) + 16;
|
|
807
|
+
const height = 22;
|
|
808
|
+
return `<rect x="${num(cx - width / 2)}" y="${num(cy - height / 2)}" width="${num(width)}" height="${height}" rx="6" fill="${color}" fill-opacity="0.14"/>` + `<text x="${num(cx)}" y="${num(cy + 4.5)}" font-size="${LABEL_FONT}" font-weight="600" fill="${theme.inkSecondary}" text-anchor="middle">${esc(text)}</text>`;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, [
|
|
812
|
+
/* harmony export */ "DEFAULT_BACKGROUND", 0, /* binding */ DEFAULT_BACKGROUND,
|
|
813
|
+
/* harmony export */ "DEFAULT_TEXT_COLOR", 0, /* binding */ DEFAULT_TEXT_COLOR
|
|
814
|
+
/* harmony export */ ]);
|
|
815
|
+
|
|
816
|
+
|
|
817
|
+
/***/ }),
|
|
818
|
+
|
|
819
|
+
/***/ 75787:
|
|
820
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
821
|
+
|
|
822
|
+
"use strict";
|
|
823
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
824
|
+
/* harmony export */ renderChart: function() { return /* binding */ renderChart; }
|
|
825
|
+
/* harmony export */ });
|
|
826
|
+
/* harmony import */ var _bar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(93054);
|
|
827
|
+
/* harmony import */ var _line__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(73077);
|
|
828
|
+
/* harmony import */ var _pie__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(83349);
|
|
829
|
+
/* harmony import */ var _radar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(67407);
|
|
830
|
+
/*!
|
|
831
|
+
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
832
|
+
* See LICENSE.md in the project root for license information.
|
|
833
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
|
|
834
|
+
*/
|
|
835
|
+
|
|
836
|
+
|
|
837
|
+
|
|
838
|
+
function renderChart(data, options) {
|
|
839
|
+
switch(data.type){
|
|
840
|
+
case 'horizontalBar':
|
|
841
|
+
return (0,_bar__WEBPACK_IMPORTED_MODULE_0__.renderHorizontalBar)(data, options);
|
|
842
|
+
case 'line':
|
|
843
|
+
return (0,_line__WEBPACK_IMPORTED_MODULE_1__.renderLine)(data, options, false);
|
|
844
|
+
case 'area':
|
|
845
|
+
return (0,_line__WEBPACK_IMPORTED_MODULE_1__.renderLine)(data, options, true);
|
|
846
|
+
case 'radar':
|
|
847
|
+
return (0,_radar__WEBPACK_IMPORTED_MODULE_3__.renderRadar)(data, options);
|
|
848
|
+
case 'pie':
|
|
849
|
+
return (0,_pie__WEBPACK_IMPORTED_MODULE_2__.renderPie)(data, options, false);
|
|
850
|
+
case 'donut':
|
|
851
|
+
return (0,_pie__WEBPACK_IMPORTED_MODULE_2__.renderPie)(data, options, true);
|
|
852
|
+
default:
|
|
853
|
+
return (0,_bar__WEBPACK_IMPORTED_MODULE_0__.renderBar)(data, options);
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
|
|
858
|
+
/***/ }),
|
|
859
|
+
|
|
860
|
+
/***/ 73077:
|
|
861
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
862
|
+
|
|
863
|
+
"use strict";
|
|
864
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
865
|
+
/* harmony export */ renderLine: function() { return /* binding */ renderLine; }
|
|
866
|
+
/* harmony export */ });
|
|
867
|
+
/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36838);
|
|
868
|
+
/*!
|
|
869
|
+
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
870
|
+
* See LICENSE.md in the project root for license information.
|
|
871
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
|
|
872
|
+
*/
|
|
873
|
+
function renderLine(data, options, area) {
|
|
874
|
+
const scale = (0,_common__WEBPACK_IMPORTED_MODULE_0__.ticks)(data.points);
|
|
875
|
+
const top = scale[scale.length - 1];
|
|
876
|
+
const yLabelWidth = Math.max(...scale.map((v)=>(0,_common__WEBPACK_IMPORTED_MODULE_0__.textWidth)((0,_common__WEBPACK_IMPORTED_MODULE_0__.formatValue)(v), (/* inlined export .TICK_FONT */12))));
|
|
877
|
+
const box = (0,_common__WEBPACK_IMPORTED_MODULE_0__.plotBox)(data, {
|
|
878
|
+
x: yLabelWidth + 12,
|
|
879
|
+
y: 28,
|
|
880
|
+
width: 0,
|
|
881
|
+
height: 28
|
|
882
|
+
});
|
|
883
|
+
const theme = (0,_common__WEBPACK_IMPORTED_MODULE_0__.chartTheme)(data);
|
|
884
|
+
const parts = [
|
|
885
|
+
(0,_common__WEBPACK_IMPORTED_MODULE_0__.svgOpen)(data, options)
|
|
886
|
+
];
|
|
887
|
+
const baseline = box.y + box.height;
|
|
888
|
+
scale.forEach((v)=>{
|
|
889
|
+
const y = baseline - v / top * box.height;
|
|
890
|
+
parts.push(`<line x1="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(box.x)}" y1="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(y)}" x2="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(box.x + box.width)}" y2="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(y)}" stroke="${theme.grid}" stroke-dasharray="3 3"/>`, `<text x="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(box.x - 8)}" y="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(y + 4)}" font-size="${(/* inlined export .TICK_FONT */12)}" fill="${theme.inkMuted}" text-anchor="end">${(0,_common__WEBPACK_IMPORTED_MODULE_0__.esc)((0,_common__WEBPACK_IMPORTED_MODULE_0__.formatValue)(v))}</text>`);
|
|
891
|
+
});
|
|
892
|
+
const count = data.points.length || 1;
|
|
893
|
+
const band = box.width / count;
|
|
894
|
+
// A single series wears a single color: the first point's color (or the
|
|
895
|
+
// first palette slot) is the color of the whole line.
|
|
896
|
+
const color = data.points.length ? (0,_common__WEBPACK_IMPORTED_MODULE_0__.pointColor)(data.points[0], 0, options) : options.colors[0];
|
|
897
|
+
const coords = data.points.map((point, i)=>({
|
|
898
|
+
x: box.x + i * band + band / 2,
|
|
899
|
+
y: baseline - (point.value > 0 ? point.value : 0) / top * box.height
|
|
900
|
+
}));
|
|
901
|
+
if (coords.length > 1) {
|
|
902
|
+
const d = coords.map((c, i)=>`${i ? 'L' : 'M'}${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(c.x)},${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(c.y)}`).join('');
|
|
903
|
+
if (area) {
|
|
904
|
+
parts.push(`<path d="${d}L${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(coords[coords.length - 1].x)},${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(baseline)}L${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(coords[0].x)},${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(baseline)}Z" fill="${color}" fill-opacity="0.18"/>`);
|
|
905
|
+
}
|
|
906
|
+
parts.push(`<path d="${d}" fill="none" stroke="${color}" stroke-width="2" stroke-linejoin="round" stroke-linecap="round"/>`);
|
|
907
|
+
}
|
|
908
|
+
data.points.forEach((point, i)=>{
|
|
909
|
+
const { x, y } = coords[i];
|
|
910
|
+
parts.push(`<circle cx="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(x)}" cy="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(y)}" r="5" fill="${color}" stroke="${theme.surface}" stroke-width="2"><title>${(0,_common__WEBPACK_IMPORTED_MODULE_0__.esc)(point.label)}: ${(0,_common__WEBPACK_IMPORTED_MODULE_0__.esc)((0,_common__WEBPACK_IMPORTED_MODULE_0__.formatValue)(point.value))}</title></circle>`, (0,_common__WEBPACK_IMPORTED_MODULE_0__.valuePill)(x, y - 20, point.value, color, theme), `<text x="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(x)}" y="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(baseline + 20)}" font-size="${(/* inlined export .LABEL_FONT */13)}" fill="${theme.inkMuted}" text-anchor="middle">${(0,_common__WEBPACK_IMPORTED_MODULE_0__.esc)((0,_common__WEBPACK_IMPORTED_MODULE_0__.truncate)(point.label))}</text>`);
|
|
911
|
+
});
|
|
912
|
+
parts.push(`<line x1="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(box.x)}" y1="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(baseline)}" x2="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(box.x + box.width)}" y2="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(baseline)}" stroke="${theme.border}"/>`, (0,_common__WEBPACK_IMPORTED_MODULE_0__.svgClose)());
|
|
913
|
+
return parts.join('');
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
|
|
917
|
+
/***/ }),
|
|
918
|
+
|
|
919
|
+
/***/ 83349:
|
|
920
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
921
|
+
|
|
922
|
+
"use strict";
|
|
923
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
924
|
+
/* harmony export */ renderPie: function() { return /* binding */ renderPie; }
|
|
925
|
+
/* harmony export */ });
|
|
926
|
+
/* harmony import */ var _swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56075);
|
|
927
|
+
/* harmony import */ var _swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11886);
|
|
928
|
+
/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(36838);
|
|
929
|
+
/*!
|
|
930
|
+
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
931
|
+
* See LICENSE.md in the project root for license information.
|
|
932
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
|
|
933
|
+
*/
|
|
934
|
+
|
|
935
|
+
|
|
936
|
+
const LEGEND_WIDTH = 180;
|
|
937
|
+
const LEGEND_ROW = 26;
|
|
938
|
+
const STACK_BELOW = 420;
|
|
939
|
+
const MIN_PIE = 160;
|
|
940
|
+
function polar(cx, cy, r, angle) {
|
|
941
|
+
return `${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(cx + r * Math.cos(angle))},${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(cy + r * Math.sin(angle))}`;
|
|
942
|
+
}
|
|
943
|
+
function slicePath(cx, cy, outer, inner, start, end) {
|
|
944
|
+
const full = end - start >= Math.PI * 2 - 0.0001;
|
|
945
|
+
if (full) {
|
|
946
|
+
const ring = inner ? ` M${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(cx - inner)},${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(cy)} a${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(inner)},${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(inner)} 0 1 0 ${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(inner * 2)},0 a${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(inner)},${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(inner)} 0 1 0 ${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(-inner * 2)},0` : '';
|
|
947
|
+
return `M${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(cx - outer)},${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(cy)} a${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(outer)},${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(outer)} 0 1 0 ${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(outer * 2)},0 a${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(outer)},${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(outer)} 0 1 0 ${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(-outer * 2)},0${ring}`;
|
|
948
|
+
}
|
|
949
|
+
const large = end - start > Math.PI ? 1 : 0;
|
|
950
|
+
const path = [
|
|
951
|
+
`M${polar(cx, cy, outer, start)}`,
|
|
952
|
+
`A${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(outer)},${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(outer)} 0 ${large} 1 ${polar(cx, cy, outer, end)}`
|
|
953
|
+
];
|
|
954
|
+
if (inner) {
|
|
955
|
+
path.push(`L${polar(cx, cy, inner, end)}`, `A${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(inner)},${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(inner)} 0 ${large} 0 ${polar(cx, cy, inner, start)}`);
|
|
956
|
+
} else {
|
|
957
|
+
path.push(`L${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(cx)},${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(cy)}`);
|
|
958
|
+
}
|
|
959
|
+
return path.join('') + 'Z';
|
|
960
|
+
}
|
|
961
|
+
function renderPie(data, options, donut) {
|
|
962
|
+
const points = data.points.filter((p)=>p.value > 0);
|
|
963
|
+
const total = points.reduce((sum, p)=>sum + p.value, 0);
|
|
964
|
+
// Narrow charts stack the legend under the pie and grow in height so the
|
|
965
|
+
// pie keeps a readable size; wide ones keep the legend aside.
|
|
966
|
+
const stacked = data.width < STACK_BELOW;
|
|
967
|
+
const legendWidth = stacked ? data.width - (/* inlined export .PAD */24) * 2 : Math.min(LEGEND_WIDTH, Math.max(120, data.width * 0.3));
|
|
968
|
+
const legendHeight = points.length * LEGEND_ROW;
|
|
969
|
+
if (stacked) {
|
|
970
|
+
const needed = (/* inlined export .PAD */24) * 2 + (data.title ? (/* inlined export .TITLE_HEIGHT */40) : 0) + MIN_PIE + legendHeight + (/* inlined export .PAD */24) / 2;
|
|
971
|
+
data = (0,_swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_1__._)((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_0__._)({}, data), {
|
|
972
|
+
height: Math.max(data.height, needed)
|
|
973
|
+
});
|
|
974
|
+
}
|
|
975
|
+
const box = (0,_common__WEBPACK_IMPORTED_MODULE_2__.plotBox)(data, {
|
|
976
|
+
x: 0,
|
|
977
|
+
y: 0,
|
|
978
|
+
width: stacked ? 0 : legendWidth + (/* inlined export .PAD */24),
|
|
979
|
+
height: stacked ? legendHeight + (/* inlined export .PAD */24) / 2 : 0
|
|
980
|
+
});
|
|
981
|
+
const outer = Math.max(10, Math.min(box.width, box.height) / 2 - 4);
|
|
982
|
+
const inner = donut ? outer * 0.58 : 0;
|
|
983
|
+
const cx = box.x + box.width / 2;
|
|
984
|
+
const cy = box.y + box.height / 2;
|
|
985
|
+
const theme = (0,_common__WEBPACK_IMPORTED_MODULE_2__.chartTheme)(data);
|
|
986
|
+
const parts = [
|
|
987
|
+
(0,_common__WEBPACK_IMPORTED_MODULE_2__.svgOpen)(data, options)
|
|
988
|
+
];
|
|
989
|
+
let angle = -Math.PI / 2;
|
|
990
|
+
points.forEach((point, i)=>{
|
|
991
|
+
const color = (0,_common__WEBPACK_IMPORTED_MODULE_2__.pointColor)(point, i, options);
|
|
992
|
+
const sweep = total ? point.value / total * Math.PI * 2 : 0;
|
|
993
|
+
const percent = total ? Math.round(point.value / total * 1000) / 10 : 0;
|
|
994
|
+
parts.push(`<path d="${slicePath(cx, cy, outer, inner, angle, angle + sweep)}" fill="${color}" stroke="${theme.surface}" stroke-width="2" fill-rule="evenodd"><title>${(0,_common__WEBPACK_IMPORTED_MODULE_2__.esc)(point.label)}: ${(0,_common__WEBPACK_IMPORTED_MODULE_2__.esc)((0,_common__WEBPACK_IMPORTED_MODULE_2__.formatValue)(point.value))} (${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(percent)}%)</title></path>`);
|
|
995
|
+
angle += sweep;
|
|
996
|
+
});
|
|
997
|
+
if (donut && total) {
|
|
998
|
+
parts.push(`<text x="${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(cx)}" y="${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(cy + 7)}" font-size="20" font-weight="600" fill="${theme.ink}" text-anchor="middle">${(0,_common__WEBPACK_IMPORTED_MODULE_2__.esc)((0,_common__WEBPACK_IMPORTED_MODULE_2__.formatValue)(total))}</text>`);
|
|
999
|
+
}
|
|
1000
|
+
const legendX = stacked ? (/* inlined export .PAD */24) : data.width - (/* inlined export .PAD */24) - legendWidth;
|
|
1001
|
+
// Room for the label between the swatch and the right-aligned percent.
|
|
1002
|
+
const labelChars = Math.max(6, Math.floor((legendWidth - 22 - 48) / ((/* inlined export .LABEL_FONT */13) * 0.58)));
|
|
1003
|
+
const legendY = stacked ? box.y + box.height + (/* inlined export .PAD */24) / 2 + LEGEND_ROW / 2 : cy - legendHeight / 2 + LEGEND_ROW / 2;
|
|
1004
|
+
points.forEach((point, i)=>{
|
|
1005
|
+
const color = (0,_common__WEBPACK_IMPORTED_MODULE_2__.pointColor)(point, i, options);
|
|
1006
|
+
const y = legendY + i * LEGEND_ROW;
|
|
1007
|
+
const percent = total ? Math.round(point.value / total * 1000) / 10 : 0;
|
|
1008
|
+
parts.push(`<rect x="${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(legendX)}" y="${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(y - 7)}" width="14" height="14" rx="4" fill="${color}"/>`, `<text x="${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(legendX + 22)}" y="${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(y + 4.5)}" font-size="${(/* inlined export .LABEL_FONT */13)}" fill="${theme.inkSecondary}">${(0,_common__WEBPACK_IMPORTED_MODULE_2__.esc)((0,_common__WEBPACK_IMPORTED_MODULE_2__.truncate)(point.label, labelChars))}</text>`, `<text x="${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(legendX + legendWidth)}" y="${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(y + 4.5)}" font-size="${(/* inlined export .LABEL_FONT */13)}" fill="${theme.inkMuted}" text-anchor="end">${(0,_common__WEBPACK_IMPORTED_MODULE_2__.num)(percent)}%</text>`);
|
|
1009
|
+
});
|
|
1010
|
+
parts.push((0,_common__WEBPACK_IMPORTED_MODULE_2__.svgClose)());
|
|
1011
|
+
return parts.join('');
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
|
|
1015
|
+
/***/ }),
|
|
1016
|
+
|
|
1017
|
+
/***/ 67407:
|
|
1018
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1019
|
+
|
|
1020
|
+
"use strict";
|
|
1021
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1022
|
+
/* harmony export */ renderRadar: function() { return /* binding */ renderRadar; }
|
|
1023
|
+
/* harmony export */ });
|
|
1024
|
+
/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36838);
|
|
1025
|
+
/*!
|
|
1026
|
+
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
1027
|
+
* See LICENSE.md in the project root for license information.
|
|
1028
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
|
|
1029
|
+
*/
|
|
1030
|
+
const LABEL_GAP = 18;
|
|
1031
|
+
function spoke(cx, cy, radius, index, count) {
|
|
1032
|
+
const angle = -Math.PI / 2 + index / count * Math.PI * 2;
|
|
1033
|
+
return {
|
|
1034
|
+
x: cx + radius * Math.cos(angle),
|
|
1035
|
+
y: cy + radius * Math.sin(angle),
|
|
1036
|
+
angle
|
|
1037
|
+
};
|
|
1038
|
+
}
|
|
1039
|
+
function anchor(angle) {
|
|
1040
|
+
const cos = Math.cos(angle);
|
|
1041
|
+
if (Math.abs(cos) < 0.2) {
|
|
1042
|
+
return 'middle';
|
|
1043
|
+
}
|
|
1044
|
+
return cos > 0 ? 'start' : 'end';
|
|
1045
|
+
}
|
|
1046
|
+
function renderRadar(data, options) {
|
|
1047
|
+
const scale = (0,_common__WEBPACK_IMPORTED_MODULE_0__.ticks)(data.points);
|
|
1048
|
+
const top = scale[scale.length - 1];
|
|
1049
|
+
const box = (0,_common__WEBPACK_IMPORTED_MODULE_0__.plotBox)(data, {
|
|
1050
|
+
x: 60,
|
|
1051
|
+
y: 24,
|
|
1052
|
+
width: 60,
|
|
1053
|
+
height: 24
|
|
1054
|
+
});
|
|
1055
|
+
const cx = box.x + box.width / 2;
|
|
1056
|
+
const cy = box.y + box.height / 2;
|
|
1057
|
+
const radius = Math.max(10, Math.min(box.width, box.height) / 2 - 4);
|
|
1058
|
+
const count = Math.max(1, data.points.length);
|
|
1059
|
+
const theme = (0,_common__WEBPACK_IMPORTED_MODULE_0__.chartTheme)(data);
|
|
1060
|
+
const parts = [
|
|
1061
|
+
(0,_common__WEBPACK_IMPORTED_MODULE_0__.svgOpen)(data, options)
|
|
1062
|
+
];
|
|
1063
|
+
const color = data.points.length ? (0,_common__WEBPACK_IMPORTED_MODULE_0__.pointColor)(data.points[0], 0, options) : options.colors[0];
|
|
1064
|
+
// Concentric rings for the tick values, the outer one carries the label.
|
|
1065
|
+
scale.forEach((v, i)=>{
|
|
1066
|
+
if (!v) {
|
|
1067
|
+
return;
|
|
1068
|
+
}
|
|
1069
|
+
const r = v / top * radius;
|
|
1070
|
+
const ring = data.points.map((_, index)=>spoke(cx, cy, r, index, count)).map((p, index)=>`${index ? 'L' : 'M'}${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(p.x)},${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(p.y)}`).join('');
|
|
1071
|
+
parts.push(count > 2 ? `<path d="${ring}Z" fill="none" stroke="${theme.grid}" stroke-dasharray="3 3"/>` : `<circle cx="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(cx)}" cy="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(cy)}" r="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(r)}" fill="none" stroke="${theme.grid}" stroke-dasharray="3 3"/>`, i === scale.length - 1 ? `<text x="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(cx + 6)}" y="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(cy - r + 12)}" font-size="${(/* inlined export .TICK_FONT */12)}" fill="${theme.inkMuted}">${(0,_common__WEBPACK_IMPORTED_MODULE_0__.esc)((0,_common__WEBPACK_IMPORTED_MODULE_0__.formatValue)(v))}</text>` : '');
|
|
1072
|
+
});
|
|
1073
|
+
data.points.forEach((point, i)=>{
|
|
1074
|
+
const end = spoke(cx, cy, radius, i, count);
|
|
1075
|
+
const label = spoke(cx, cy, radius + LABEL_GAP, i, count);
|
|
1076
|
+
parts.push(`<line x1="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(cx)}" y1="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(cy)}" x2="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(end.x)}" y2="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(end.y)}" stroke="${theme.grid}"/>`, `<text x="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(label.x)}" y="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(label.y + 4.5)}" font-size="${(/* inlined export .LABEL_FONT */13)}" fill="${theme.inkMuted}" text-anchor="${anchor(label.angle)}">${(0,_common__WEBPACK_IMPORTED_MODULE_0__.esc)((0,_common__WEBPACK_IMPORTED_MODULE_0__.truncate)(point.label))}</text>`);
|
|
1077
|
+
});
|
|
1078
|
+
const coords = data.points.map((point, i)=>spoke(cx, cy, (point.value > 0 ? point.value : 0) / top * radius, i, count));
|
|
1079
|
+
if (coords.length > 1) {
|
|
1080
|
+
const d = coords.map((c, i)=>`${i ? 'L' : 'M'}${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(c.x)},${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(c.y)}`).join('');
|
|
1081
|
+
parts.push(`<path d="${d}Z" fill="${color}" fill-opacity="0.18" stroke="${color}" stroke-width="2" stroke-linejoin="round"/>`);
|
|
1082
|
+
}
|
|
1083
|
+
data.points.forEach((point, i)=>{
|
|
1084
|
+
const { x, y } = coords[i];
|
|
1085
|
+
parts.push(`<circle cx="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(x)}" cy="${(0,_common__WEBPACK_IMPORTED_MODULE_0__.num)(y)}" r="5" fill="${color}" stroke="${theme.surface}" stroke-width="2"><title>${(0,_common__WEBPACK_IMPORTED_MODULE_0__.esc)(point.label)}: ${(0,_common__WEBPACK_IMPORTED_MODULE_0__.esc)((0,_common__WEBPACK_IMPORTED_MODULE_0__.formatValue)(point.value))}</title></circle>`);
|
|
1086
|
+
});
|
|
1087
|
+
parts.push((0,_common__WEBPACK_IMPORTED_MODULE_0__.svgClose)());
|
|
1088
|
+
return parts.join('');
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
|
|
1092
|
+
/***/ }),
|
|
1093
|
+
|
|
1094
|
+
/***/ 90142:
|
|
1095
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1096
|
+
|
|
1097
|
+
"use strict";
|
|
1098
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1099
|
+
/* harmony export */ UIChartEditor: function() { return /* binding */ UIChartEditor; }
|
|
1100
|
+
/* harmony export */ });
|
|
1101
|
+
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82749);
|
|
1102
|
+
/* harmony import */ var _swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56075);
|
|
1103
|
+
/* harmony import */ var _swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(11886);
|
|
1104
|
+
/* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(31635);
|
|
1105
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(99131);
|
|
1106
|
+
/* harmony import */ var _render__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(75787);
|
|
1107
|
+
/* harmony import */ var _render_common__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(36838);
|
|
1108
|
+
/* harmony import */ var jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(65478);
|
|
1109
|
+
/* harmony import */ var jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(2748);
|
|
1110
|
+
/* harmony import */ var jodit_esm_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(38837);
|
|
1111
|
+
/* harmony import */ var jodit_esm_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(29960);
|
|
1112
|
+
/* harmony import */ var jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(67510);
|
|
1113
|
+
/*!
|
|
1114
|
+
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
1115
|
+
* See LICENSE.md in the project root for license information.
|
|
1116
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
|
|
1117
|
+
*/
|
|
1118
|
+
|
|
1119
|
+
|
|
1120
|
+
|
|
1121
|
+
|
|
1122
|
+
|
|
1123
|
+
|
|
1124
|
+
|
|
1125
|
+
|
|
1126
|
+
|
|
1127
|
+
|
|
1128
|
+
|
|
1129
|
+
|
|
1130
|
+
class UIChartEditor extends jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_11__.UIElement {
|
|
1131
|
+
className() {
|
|
1132
|
+
return 'UIChartEditor';
|
|
1133
|
+
}
|
|
1134
|
+
render() {
|
|
1135
|
+
return `<div>
|
|
1136
|
+
<div class="&__preview">
|
|
1137
|
+
<div class="&__colors"></div>
|
|
1138
|
+
<div class="&__canvas"></div>
|
|
1139
|
+
</div>
|
|
1140
|
+
<div class="&__fields"></div>
|
|
1141
|
+
<div class="&__points-header">
|
|
1142
|
+
<span class="&__points-title">~Data points~</span>
|
|
1143
|
+
<span class="&__summary"></span>
|
|
1144
|
+
<span class="&__add"></span>
|
|
1145
|
+
</div>
|
|
1146
|
+
<div class="&__points"></div>
|
|
1147
|
+
</div>`;
|
|
1148
|
+
}
|
|
1149
|
+
syncTransparent() {
|
|
1150
|
+
const transparent = !this.state.background;
|
|
1151
|
+
this.transparentButton.classList.toggle(this.getFullElName('transparent', 'active'), transparent);
|
|
1152
|
+
(0,jodit_esm_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__.attr)(this.transparentButton, 'aria-pressed', transparent);
|
|
1153
|
+
}
|
|
1154
|
+
createColorInput(name, onInput) {
|
|
1155
|
+
const input = this.j.c.element('input', {
|
|
1156
|
+
type: 'color',
|
|
1157
|
+
name,
|
|
1158
|
+
title: this.j.i18n(name === 'background' ? 'Background' : 'Text color'),
|
|
1159
|
+
class: this.getFullElName('color-input')
|
|
1160
|
+
});
|
|
1161
|
+
this.j.e.on(input, 'input', ()=>{
|
|
1162
|
+
onInput(input.value);
|
|
1163
|
+
this.refresh();
|
|
1164
|
+
});
|
|
1165
|
+
return input;
|
|
1166
|
+
}
|
|
1167
|
+
colorField(label, input) {
|
|
1168
|
+
return this.j.c.element('label', {
|
|
1169
|
+
class: this.getFullElName('color-field')
|
|
1170
|
+
}, [
|
|
1171
|
+
input,
|
|
1172
|
+
this.j.c.span(this.getFullElName('color-label'), this.j.i18n(label))
|
|
1173
|
+
]);
|
|
1174
|
+
}
|
|
1175
|
+
/**
|
|
1176
|
+
* Loads a copy of the data into the form.
|
|
1177
|
+
*/ setData(data) {
|
|
1178
|
+
this.state = (0,_helpers__WEBPACK_IMPORTED_MODULE_4__.cloneChartData)(data);
|
|
1179
|
+
this.typeSelect.value = this.state.type;
|
|
1180
|
+
this.titleInput.value = this.state.title;
|
|
1181
|
+
this.backgroundInput.value = this.state.background || _render_common__WEBPACK_IMPORTED_MODULE_6__.DEFAULT_BACKGROUND;
|
|
1182
|
+
this.textColorInput.value = this.state.textColor || _render_common__WEBPACK_IMPORTED_MODULE_6__.DEFAULT_TEXT_COLOR;
|
|
1183
|
+
this.borderColorInput.value = this.state.borderColor || this.j.o.chart.defaultBorderColor;
|
|
1184
|
+
this.syncTransparent();
|
|
1185
|
+
this.rebuildPoints();
|
|
1186
|
+
this.__render();
|
|
1187
|
+
}
|
|
1188
|
+
/**
|
|
1189
|
+
* Returns a normalized copy of the edited data.
|
|
1190
|
+
*/ getData() {
|
|
1191
|
+
return (0,_swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_2__._)((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_1__._)({}, this.state), {
|
|
1192
|
+
title: this.state.title.trim(),
|
|
1193
|
+
points: this.state.points.map(_helpers__WEBPACK_IMPORTED_MODULE_4__.normalizePoint)
|
|
1194
|
+
});
|
|
1195
|
+
}
|
|
1196
|
+
addPoint() {
|
|
1197
|
+
var _inputs_;
|
|
1198
|
+
const { points } = this.state;
|
|
1199
|
+
points.push({
|
|
1200
|
+
label: this.j.i18n('Item') + ' ' + (points.length + 1),
|
|
1201
|
+
value: 0
|
|
1202
|
+
});
|
|
1203
|
+
this.rebuildPoints();
|
|
1204
|
+
this.refresh();
|
|
1205
|
+
const inputs = this.getElms('point-label');
|
|
1206
|
+
const last = (_inputs_ = inputs[inputs.length - 1]) === null || _inputs_ === void 0 ? void 0 : _inputs_.querySelector('input');
|
|
1207
|
+
last === null || last === void 0 ? void 0 : last.focus();
|
|
1208
|
+
}
|
|
1209
|
+
removePoint(index) {
|
|
1210
|
+
this.state.points.splice(index, 1);
|
|
1211
|
+
this.rebuildPoints();
|
|
1212
|
+
this.refresh();
|
|
1213
|
+
}
|
|
1214
|
+
rebuildPoints() {
|
|
1215
|
+
const list = this.getElm('points');
|
|
1216
|
+
(0,jodit_esm_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_9__.assert)(list != null, 'points element does not exist');
|
|
1217
|
+
jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.detach(list);
|
|
1218
|
+
this.state.points.forEach((point, index)=>{
|
|
1219
|
+
list.appendChild(this.createPointRow(point, index));
|
|
1220
|
+
});
|
|
1221
|
+
}
|
|
1222
|
+
createPointRow(point, index) {
|
|
1223
|
+
const { j } = this;
|
|
1224
|
+
const label = new jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_11__.UIInput(j, {
|
|
1225
|
+
name: 'label',
|
|
1226
|
+
label: 'Label',
|
|
1227
|
+
value: point.label,
|
|
1228
|
+
className: this.getFullElName('point-label'),
|
|
1229
|
+
onChange: (value)=>{
|
|
1230
|
+
point.label = value;
|
|
1231
|
+
this.refresh();
|
|
1232
|
+
}
|
|
1233
|
+
});
|
|
1234
|
+
const value = new jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_11__.UIInput(j, {
|
|
1235
|
+
name: 'value',
|
|
1236
|
+
label: 'Value',
|
|
1237
|
+
type: 'number',
|
|
1238
|
+
value: point.value,
|
|
1239
|
+
className: this.getFullElName('point-value'),
|
|
1240
|
+
onChange: (raw)=>{
|
|
1241
|
+
const parsed = Number(raw);
|
|
1242
|
+
point.value = isFinite(parsed) ? parsed : 0;
|
|
1243
|
+
this.refresh();
|
|
1244
|
+
}
|
|
1245
|
+
});
|
|
1246
|
+
const color = j.c.element('input', {
|
|
1247
|
+
type: 'color',
|
|
1248
|
+
title: j.i18n('Color'),
|
|
1249
|
+
class: this.getFullElName('point-color'),
|
|
1250
|
+
value: (0,_render_common__WEBPACK_IMPORTED_MODULE_6__.pointColor)(point, index, {
|
|
1251
|
+
colors: j.o.chart.colors,
|
|
1252
|
+
fontFamily: ''
|
|
1253
|
+
})
|
|
1254
|
+
});
|
|
1255
|
+
j.e.on(color, 'input', ()=>{
|
|
1256
|
+
point.color = color.value;
|
|
1257
|
+
this.refresh();
|
|
1258
|
+
});
|
|
1259
|
+
const remove = (0,jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_11__.Button)(j, 'bin', '', 'default').setMod('variant', 'remove').onAction(()=>this.removePoint(index));
|
|
1260
|
+
(0,jodit_esm_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__.attr)(remove.container, 'title', j.i18n('Remove point'));
|
|
1261
|
+
const grip = j.c.element('span', {
|
|
1262
|
+
class: this.getFullElName('point-grip'),
|
|
1263
|
+
title: j.i18n('Drag to reorder')
|
|
1264
|
+
});
|
|
1265
|
+
const row = j.c.div(this.getFullElName('point'), [
|
|
1266
|
+
grip,
|
|
1267
|
+
label.container,
|
|
1268
|
+
value.container,
|
|
1269
|
+
color,
|
|
1270
|
+
remove.container
|
|
1271
|
+
]);
|
|
1272
|
+
this.bindDragAndDrop(row, grip, index);
|
|
1273
|
+
return row;
|
|
1274
|
+
}
|
|
1275
|
+
/**
|
|
1276
|
+
* Native drag and drop of a row. The grip is the draggable element so text
|
|
1277
|
+
* selection inside the inputs keeps working.
|
|
1278
|
+
*/ bindDragAndDrop(row, grip, index) {
|
|
1279
|
+
const { j } = this;
|
|
1280
|
+
const dropMod = (value)=>{
|
|
1281
|
+
row.classList.toggle(this.getFullElName('point', 'drop', 'before'), value === 'before');
|
|
1282
|
+
row.classList.toggle(this.getFullElName('point', 'drop', 'after'), value === 'after');
|
|
1283
|
+
};
|
|
1284
|
+
const isAfter = (e)=>{
|
|
1285
|
+
const box = row.getBoundingClientRect();
|
|
1286
|
+
return e.clientY > box.top + box.height / 2;
|
|
1287
|
+
};
|
|
1288
|
+
(0,jodit_esm_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__.attr)(grip, 'draggable', true);
|
|
1289
|
+
j.e.on(grip, 'dragstart', (e)=>{
|
|
1290
|
+
this.__dragIndex = index;
|
|
1291
|
+
row.classList.add(this.getFullElName('point', 'dragging'));
|
|
1292
|
+
if (e.dataTransfer) {
|
|
1293
|
+
e.dataTransfer.effectAllowed = 'move';
|
|
1294
|
+
e.dataTransfer.setData('text/plain', String(index));
|
|
1295
|
+
e.dataTransfer.setDragImage(row, 10, 10);
|
|
1296
|
+
}
|
|
1297
|
+
}).on(grip, 'dragend', ()=>{
|
|
1298
|
+
this.__dragIndex = -1;
|
|
1299
|
+
row.classList.remove(this.getFullElName('point', 'dragging'));
|
|
1300
|
+
this.getElms('point').forEach((elm)=>{
|
|
1301
|
+
elm.classList.remove(this.getFullElName('point', 'drop', 'before'), this.getFullElName('point', 'drop', 'after'));
|
|
1302
|
+
});
|
|
1303
|
+
});
|
|
1304
|
+
j.e.on(row, 'dragover', (e)=>{
|
|
1305
|
+
if (this.__dragIndex < 0 || this.__dragIndex === index) {
|
|
1306
|
+
return;
|
|
1307
|
+
}
|
|
1308
|
+
e.preventDefault();
|
|
1309
|
+
if (e.dataTransfer) {
|
|
1310
|
+
e.dataTransfer.dropEffect = 'move';
|
|
1311
|
+
}
|
|
1312
|
+
dropMod(isAfter(e) ? 'after' : 'before');
|
|
1313
|
+
}).on(row, 'dragleave', ()=>dropMod(null)).on(row, 'drop', (e)=>{
|
|
1314
|
+
if (this.__dragIndex < 0 || this.__dragIndex === index) {
|
|
1315
|
+
return;
|
|
1316
|
+
}
|
|
1317
|
+
e.preventDefault();
|
|
1318
|
+
this.movePoint(this.__dragIndex, index, isAfter(e));
|
|
1319
|
+
this.__dragIndex = -1;
|
|
1320
|
+
});
|
|
1321
|
+
}
|
|
1322
|
+
/**
|
|
1323
|
+
* Moves a point before or after another one and rebuilds the list.
|
|
1324
|
+
*/ movePoint(from, to, after) {
|
|
1325
|
+
const { points } = this.state;
|
|
1326
|
+
if (from === to || !points[from] || !points[to]) {
|
|
1327
|
+
return;
|
|
1328
|
+
}
|
|
1329
|
+
const [point] = points.splice(from, 1);
|
|
1330
|
+
let target = from < to ? to - 1 : to;
|
|
1331
|
+
if (after) {
|
|
1332
|
+
target++;
|
|
1333
|
+
}
|
|
1334
|
+
points.splice(target, 0, point);
|
|
1335
|
+
this.rebuildPoints();
|
|
1336
|
+
this.refresh();
|
|
1337
|
+
}
|
|
1338
|
+
refresh() {
|
|
1339
|
+
this.__render();
|
|
1340
|
+
}
|
|
1341
|
+
__render() {
|
|
1342
|
+
const { chart } = this.j.o;
|
|
1343
|
+
const preview = this.getElm('canvas');
|
|
1344
|
+
const summary = this.getElm('summary');
|
|
1345
|
+
if (preview) {
|
|
1346
|
+
preview.innerHTML = (0,_render__WEBPACK_IMPORTED_MODULE_5__.renderChart)(this.state, {
|
|
1347
|
+
colors: chart.colors,
|
|
1348
|
+
fontFamily: chart.fontFamily
|
|
1349
|
+
});
|
|
1350
|
+
}
|
|
1351
|
+
if (summary) {
|
|
1352
|
+
const total = this.state.points.reduce((sum, p)=>sum + p.value, 0);
|
|
1353
|
+
summary.textContent = this.state.points.length + ' ' + this.j.i18n('points') + ' · ' + this.j.i18n('Total') + ': ' + (0,_render_common__WEBPACK_IMPORTED_MODULE_6__.formatValue)(total);
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
constructor(jodit){
|
|
1357
|
+
super(jodit), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "state", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "typeSelect", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "titleInput", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "addButton", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "backgroundInput", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "textColorInput", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "borderColorInput", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "transparentButton", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__dragIndex", -1);
|
|
1358
|
+
this.typeSelect = new jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_11__.UISelect(jodit, {
|
|
1359
|
+
name: 'type',
|
|
1360
|
+
label: 'Chart type',
|
|
1361
|
+
options: jodit.o.chart.types.map((type)=>({
|
|
1362
|
+
value: type,
|
|
1363
|
+
text: jodit.i18n(_helpers__WEBPACK_IMPORTED_MODULE_4__.CHART_TYPE_TITLES[type])
|
|
1364
|
+
})),
|
|
1365
|
+
onChange: (value)=>{
|
|
1366
|
+
this.state.type = value;
|
|
1367
|
+
this.refresh();
|
|
1368
|
+
}
|
|
1369
|
+
});
|
|
1370
|
+
this.titleInput = new jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_11__.UIInput(jodit, {
|
|
1371
|
+
name: 'title',
|
|
1372
|
+
label: 'Chart title',
|
|
1373
|
+
placeholder: 'Optional',
|
|
1374
|
+
onChange: (value)=>{
|
|
1375
|
+
this.state.title = value;
|
|
1376
|
+
this.refresh();
|
|
1377
|
+
}
|
|
1378
|
+
});
|
|
1379
|
+
this.addButton = (0,jodit_esm_core_ui__WEBPACK_IMPORTED_MODULE_11__.Button)(jodit, 'plus', 'Add point').onAction(this.addPoint.bind(this));
|
|
1380
|
+
const fields = this.getElm('fields');
|
|
1381
|
+
(0,jodit_esm_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_9__.assert)(fields != null, 'fields element does not exist');
|
|
1382
|
+
fields.appendChild(this.typeSelect.container);
|
|
1383
|
+
fields.appendChild(this.titleInput.container);
|
|
1384
|
+
const add = this.getElm('add');
|
|
1385
|
+
(0,jodit_esm_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_9__.assert)(add != null, 'add element does not exist');
|
|
1386
|
+
add.appendChild(this.addButton.container);
|
|
1387
|
+
this.backgroundInput = this.createColorInput('background', (value)=>{
|
|
1388
|
+
this.state.background = value;
|
|
1389
|
+
this.syncTransparent();
|
|
1390
|
+
});
|
|
1391
|
+
this.textColorInput = this.createColorInput('textColor', (value)=>{
|
|
1392
|
+
this.state.textColor = value;
|
|
1393
|
+
});
|
|
1394
|
+
this.borderColorInput = this.createColorInput('borderColor', (value)=>{
|
|
1395
|
+
this.state.borderColor = value;
|
|
1396
|
+
});
|
|
1397
|
+
this.transparentButton = jodit.c.element('button', {
|
|
1398
|
+
type: 'button',
|
|
1399
|
+
name: 'transparent',
|
|
1400
|
+
class: this.getFullElName('transparent')
|
|
1401
|
+
});
|
|
1402
|
+
jodit.e.on(this.transparentButton, 'click', ()=>{
|
|
1403
|
+
this.state.background = this.state.background ? '' : this.backgroundInput.value;
|
|
1404
|
+
this.syncTransparent();
|
|
1405
|
+
this.refresh();
|
|
1406
|
+
});
|
|
1407
|
+
const colors = this.getElm('colors');
|
|
1408
|
+
(0,jodit_esm_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_9__.assert)(colors != null, 'colors element does not exist');
|
|
1409
|
+
const { chart } = jodit.o;
|
|
1410
|
+
if (chart.allowChangeBackground) {
|
|
1411
|
+
colors.appendChild(this.colorField('Background', this.backgroundInput));
|
|
1412
|
+
}
|
|
1413
|
+
if (chart.allowChangeTextColor) {
|
|
1414
|
+
colors.appendChild(this.colorField('Text', this.textColorInput));
|
|
1415
|
+
}
|
|
1416
|
+
if (chart.allowChangeBorderColor) {
|
|
1417
|
+
colors.appendChild(this.colorField('Border', this.borderColorInput));
|
|
1418
|
+
}
|
|
1419
|
+
if (chart.allowChangeBackground) {
|
|
1420
|
+
colors.appendChild(this.colorField('Transparent', this.transparentButton));
|
|
1421
|
+
}
|
|
1422
|
+
if (!colors.childNodes.length) {
|
|
1423
|
+
jodit_esm_core_dom_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.safeRemove(colors);
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
;(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
|
|
1428
|
+
(0,jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_7__.debounce)(50)
|
|
1429
|
+
], UIChartEditor.prototype, "refresh", null);
|
|
1430
|
+
UIChartEditor = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_3__.__decorate)([
|
|
1431
|
+
jodit_esm_core_decorators__WEBPACK_IMPORTED_MODULE_7__.component
|
|
1432
|
+
], UIChartEditor);
|
|
1433
|
+
|
|
1434
|
+
|
|
1435
|
+
/***/ }),
|
|
1436
|
+
|
|
1437
|
+
/***/ 11886:
|
|
1438
|
+
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
1439
|
+
|
|
1440
|
+
"use strict";
|
|
1441
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1442
|
+
/* harmony export */ _: function() { return /* binding */ _object_spread_props; }
|
|
1443
|
+
/* harmony export */ });
|
|
1444
|
+
function ownKeys(object, enumerableOnly) {
|
|
1445
|
+
var keys = Object.keys(object);
|
|
1446
|
+
if (Object.getOwnPropertySymbols) {
|
|
1447
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
1448
|
+
if (enumerableOnly) {
|
|
1449
|
+
symbols = symbols.filter(function(sym) {
|
|
1450
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
1451
|
+
});
|
|
1452
|
+
}
|
|
1453
|
+
keys.push.apply(keys, symbols);
|
|
1454
|
+
}
|
|
1455
|
+
return keys;
|
|
1456
|
+
}
|
|
1457
|
+
function _object_spread_props(target, source) {
|
|
1458
|
+
source = source != null ? source : {};
|
|
1459
|
+
if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
1460
|
+
else {
|
|
1461
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
1462
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
1463
|
+
});
|
|
1464
|
+
}
|
|
1465
|
+
return target;
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
|
|
1469
|
+
|
|
1470
|
+
/***/ })
|
|
1471
|
+
|
|
1472
|
+
},
|
|
1473
|
+
/******/ function(__webpack_require__) { // webpackRuntimeModules
|
|
1474
|
+
/******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(moduleId); }
|
|
1475
|
+
/******/ var __webpack_exports__ = (__webpack_exec__(57722));
|
|
1476
|
+
/******/ return __webpack_exports__;
|
|
1477
|
+
/******/ }
|
|
1478
|
+
]);
|
|
1479
|
+
});
|