kempo-ui 0.4.20 → 0.4.22
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 +18 -0
- package/dist/components/Chat.js +10 -10
- package/dist/components/CodeEditor.js +23 -24
- package/dist/components/ControlGroup.js +17 -0
- package/dist/components/HtmlEditor.js +105 -106
- package/dist/components/MarkdownEditor.js +49 -49
- package/dist/components/Pagination.js +11 -11
- package/dist/components/PhotoViewer.js +2 -2
- package/dist/components/Table.js +1 -1
- package/dist/components/controls/AlignCenter.js +1 -0
- package/dist/components/controls/AlignJustify.js +1 -0
- package/dist/components/controls/AlignLeft.js +1 -0
- package/dist/components/controls/AlignRight.js +1 -0
- package/dist/components/controls/Bold.js +1 -0
- package/dist/components/controls/BulletList.js +1 -0
- package/dist/components/controls/ButtonControl.js +33 -0
- package/dist/components/controls/CharacterCount.js +4 -0
- package/dist/components/controls/ClearFormatting.js +1 -0
- package/dist/components/controls/CodeBlock.js +1 -0
- package/dist/components/controls/Control.js +12 -0
- package/dist/components/controls/CopyCode.js +1 -0
- package/dist/components/controls/CreateLink.js +1 -0
- package/dist/components/controls/EditorTheme.js +30 -0
- package/dist/components/controls/FindReplace.js +1 -0
- package/dist/components/controls/FoldAll.js +1 -0
- package/dist/components/controls/FontSize.js +8 -0
- package/dist/components/controls/FontSizeDecrease.js +1 -0
- package/dist/components/controls/FontSizeIncrease.js +1 -0
- package/dist/components/controls/FormatBlock.js +8 -0
- package/dist/components/controls/FormatCode.js +1 -0
- package/dist/components/controls/Fullscreen.js +1 -0
- package/dist/components/controls/InlineCode.js +1 -0
- package/dist/components/controls/InsertTable.js +1 -0
- package/dist/components/controls/Italic.js +1 -0
- package/dist/components/controls/Language.js +21 -0
- package/dist/components/controls/MdImage.js +23 -0
- package/dist/components/controls/MdLink.js +1 -0
- package/dist/components/controls/MdSpeechToText.js +10 -0
- package/dist/components/controls/MdTable.js +19 -0
- package/dist/components/controls/Menu.js +51 -0
- package/dist/components/controls/Minimap.js +1 -0
- package/dist/components/controls/Mode.js +1 -0
- package/dist/components/controls/NumberList.js +1 -0
- package/dist/components/controls/PgCount.js +1 -0
- package/dist/components/controls/PgFirst.js +1 -0
- package/dist/components/controls/PgGotoPage.js +15 -0
- package/dist/components/controls/PgItemsPerPage.js +12 -0
- package/dist/components/controls/PgLast.js +1 -0
- package/dist/components/controls/PgNext.js +1 -0
- package/dist/components/controls/PgPageInfo.js +3 -0
- package/dist/components/controls/PgPrev.js +1 -0
- package/dist/components/controls/Quote.js +1 -0
- package/dist/components/controls/Redo.js +1 -0
- package/dist/components/{htmlEditorControls/ControlSpacer.js → controls/Spacer.js} +5 -5
- package/dist/components/controls/Strikethrough.js +1 -0
- package/dist/components/controls/TcDeleteRecord.js +1 -0
- package/dist/components/controls/TcDeleteSelected.js +1 -0
- package/dist/components/controls/TcEdit.js +12 -0
- package/dist/components/controls/TcExportCsv.js +3 -0
- package/dist/components/controls/TcExportJson.js +3 -0
- package/dist/components/controls/TcFieldSortHide.js +21 -0
- package/dist/components/controls/TcFilters.js +34 -0
- package/dist/components/controls/TcFirstPage.js +1 -0
- package/dist/components/controls/TcHiddenCount.js +1 -0
- package/dist/components/controls/TcHide.js +1 -0
- package/dist/components/controls/TcLastPage.js +1 -0
- package/dist/components/controls/TcNextPage.js +1 -0
- package/dist/components/controls/TcPageSelect.js +9 -0
- package/dist/components/controls/TcPageSize.js +5 -0
- package/dist/components/controls/TcPrevPage.js +1 -0
- package/dist/components/controls/TcSearch.js +1 -0
- package/dist/components/controls/TcShowAll.js +1 -0
- package/dist/components/controls/TextBackgroundColor.js +26 -0
- package/dist/components/controls/TextColor.js +26 -0
- package/dist/components/controls/Underline.js +1 -0
- package/dist/components/controls/Undo.js +1 -0
- package/dist/components/controls/WordCount.js +4 -0
- package/dist/components/controls/WordWrap.js +1 -0
- package/docs/components/code-editor.html +69 -48
- package/docs/components/html-editor.html +70 -69
- package/docs/components/markdown-editor.html +59 -78
- package/docs/components/pagination.html +51 -51
- package/docs/components/photo-viewer.html +42 -1
- package/docs/components/tableControls.html +5 -5
- package/docs/components/tableCustomFields.html +3 -3
- package/docs/components/tableFetchRecords.html +13 -13
- package/docs/components/tableFieldSortHide.html +4 -4
- package/docs/components/tablePagination.html +13 -13
- package/docs/components/tablePlaceholder.html +3 -3
- package/docs/components/tableRecordEditing.html +4 -4
- package/docs/components/tableRecordFiltering.html +5 -5
- package/docs/components/tableRecordHiding.html +7 -7
- package/docs/components/tableRecordSearching.html +3 -3
- package/docs/components/tableRowControls.html +6 -6
- package/docs/components/tableServerSync.html +7 -7
- package/docs/src/components/Chat.js +10 -10
- package/docs/src/components/CodeEditor.js +23 -24
- package/docs/src/components/ControlGroup.js +17 -0
- package/docs/src/components/HtmlEditor.js +105 -106
- package/docs/src/components/MarkdownEditor.js +49 -49
- package/docs/src/components/Pagination.js +11 -11
- package/docs/src/components/PhotoViewer.js +2 -2
- package/docs/src/components/Table.js +1 -1
- package/docs/src/components/controls/AlignCenter.js +1 -0
- package/docs/src/components/controls/AlignJustify.js +1 -0
- package/docs/src/components/controls/AlignLeft.js +1 -0
- package/docs/src/components/controls/AlignRight.js +1 -0
- package/docs/src/components/controls/Bold.js +1 -0
- package/docs/src/components/controls/BulletList.js +1 -0
- package/docs/src/components/controls/ButtonControl.js +33 -0
- package/docs/src/components/controls/CharacterCount.js +4 -0
- package/docs/src/components/controls/ClearFormatting.js +1 -0
- package/docs/src/components/controls/CodeBlock.js +1 -0
- package/docs/src/components/controls/Control.js +12 -0
- package/docs/src/components/controls/CopyCode.js +1 -0
- package/docs/src/components/controls/CreateLink.js +1 -0
- package/docs/src/components/controls/EditorTheme.js +30 -0
- package/docs/src/components/controls/FindReplace.js +1 -0
- package/docs/src/components/controls/FoldAll.js +1 -0
- package/docs/src/components/controls/FontSize.js +8 -0
- package/docs/src/components/controls/FontSizeDecrease.js +1 -0
- package/docs/src/components/controls/FontSizeIncrease.js +1 -0
- package/docs/src/components/controls/FormatBlock.js +8 -0
- package/docs/src/components/controls/FormatCode.js +1 -0
- package/docs/src/components/controls/Fullscreen.js +1 -0
- package/docs/src/components/controls/InlineCode.js +1 -0
- package/docs/src/components/controls/InsertTable.js +1 -0
- package/docs/src/components/controls/Italic.js +1 -0
- package/docs/src/components/controls/Language.js +21 -0
- package/docs/src/components/controls/MdImage.js +23 -0
- package/docs/src/components/controls/MdLink.js +1 -0
- package/docs/src/components/controls/MdSpeechToText.js +10 -0
- package/docs/src/components/controls/MdTable.js +19 -0
- package/docs/src/components/controls/Menu.js +51 -0
- package/docs/src/components/controls/Minimap.js +1 -0
- package/docs/src/components/controls/Mode.js +1 -0
- package/docs/src/components/controls/NumberList.js +1 -0
- package/docs/src/components/controls/PgCount.js +1 -0
- package/docs/src/components/controls/PgFirst.js +1 -0
- package/docs/src/components/controls/PgGotoPage.js +15 -0
- package/docs/src/components/controls/PgItemsPerPage.js +12 -0
- package/docs/src/components/controls/PgLast.js +1 -0
- package/docs/src/components/controls/PgNext.js +1 -0
- package/docs/src/components/controls/PgPageInfo.js +3 -0
- package/docs/src/components/controls/PgPrev.js +1 -0
- package/docs/src/components/controls/Quote.js +1 -0
- package/docs/src/components/controls/Redo.js +1 -0
- package/docs/src/components/{codeEditorControls/ControlSpacer.js → controls/Spacer.js} +5 -5
- package/docs/src/components/controls/Strikethrough.js +1 -0
- package/docs/src/components/controls/TcDeleteRecord.js +1 -0
- package/docs/src/components/controls/TcDeleteSelected.js +1 -0
- package/docs/src/components/controls/TcEdit.js +12 -0
- package/docs/src/components/controls/TcExportCsv.js +3 -0
- package/docs/src/components/controls/TcExportJson.js +3 -0
- package/docs/src/components/controls/TcFieldSortHide.js +21 -0
- package/docs/src/components/controls/TcFilters.js +34 -0
- package/docs/src/components/controls/TcFirstPage.js +1 -0
- package/docs/src/components/controls/TcHiddenCount.js +1 -0
- package/docs/src/components/controls/TcHide.js +1 -0
- package/docs/src/components/controls/TcLastPage.js +1 -0
- package/docs/src/components/controls/TcNextPage.js +1 -0
- package/docs/src/components/controls/TcPageSelect.js +9 -0
- package/docs/src/components/controls/TcPageSize.js +5 -0
- package/docs/src/components/controls/TcPrevPage.js +1 -0
- package/docs/src/components/controls/TcSearch.js +1 -0
- package/docs/src/components/controls/TcShowAll.js +1 -0
- package/docs/src/components/controls/TextBackgroundColor.js +26 -0
- package/docs/src/components/controls/TextColor.js +26 -0
- package/docs/src/components/controls/Underline.js +1 -0
- package/docs/src/components/controls/Undo.js +1 -0
- package/docs/src/components/controls/WordCount.js +4 -0
- package/docs/src/components/controls/WordWrap.js +1 -0
- package/docs-src/components/code-editor.page.html +69 -48
- package/docs-src/components/html-editor.page.html +70 -69
- package/docs-src/components/markdown-editor.page.html +59 -78
- package/docs-src/components/pagination.page.html +51 -51
- package/docs-src/components/photo-viewer.page.html +42 -1
- package/docs-src/components/tableControls.page.html +5 -5
- package/docs-src/components/tableCustomFields.page.html +3 -3
- package/docs-src/components/tableFetchRecords.page.html +13 -13
- package/docs-src/components/tableFieldSortHide.page.html +4 -4
- package/docs-src/components/tablePagination.page.html +13 -13
- package/docs-src/components/tablePlaceholder.page.html +3 -3
- package/docs-src/components/tableRecordEditing.page.html +4 -4
- package/docs-src/components/tableRecordFiltering.page.html +5 -5
- package/docs-src/components/tableRecordHiding.page.html +7 -7
- package/docs-src/components/tableRecordSearching.page.html +3 -3
- package/docs-src/components/tableRowControls.page.html +6 -6
- package/docs-src/components/tableServerSync.page.html +7 -7
- package/llms.txt +37 -3
- package/package.json +1 -1
- package/src/components/Chat.js +14 -14
- package/src/components/CodeEditor.js +26 -32
- package/src/components/{codeEditorControls/ControlGroup.js → ControlGroup.js} +10 -6
- package/src/components/HtmlEditor.js +107 -125
- package/src/components/MarkdownEditor.js +117 -59
- package/src/components/Pagination.js +18 -23
- package/src/components/PhotoViewer.js +48 -1
- package/src/components/Table.js +5 -0
- package/src/components/controls/AlignCenter.js +19 -0
- package/src/components/controls/AlignJustify.js +19 -0
- package/src/components/controls/AlignLeft.js +19 -0
- package/src/components/controls/AlignRight.js +19 -0
- package/src/components/controls/Bold.js +19 -0
- package/src/components/controls/BulletList.js +19 -0
- package/src/components/controls/ButtonControl.js +114 -0
- package/src/components/controls/CharacterCount.js +48 -0
- package/src/components/controls/ClearFormatting.js +19 -0
- package/src/components/controls/CodeBlock.js +27 -0
- package/src/components/controls/Control.js +176 -0
- package/src/components/controls/CopyCode.js +19 -0
- package/src/components/controls/CreateLink.js +63 -0
- package/src/components/controls/EditorTheme.js +71 -0
- package/src/components/controls/FindReplace.js +19 -0
- package/src/components/controls/FoldAll.js +35 -0
- package/src/components/controls/FontSize.js +31 -0
- package/src/components/controls/FontSizeDecrease.js +19 -0
- package/src/components/controls/FontSizeIncrease.js +19 -0
- package/src/components/controls/FormatBlock.js +64 -0
- package/src/components/controls/FormatCode.js +19 -0
- package/src/components/controls/Fullscreen.js +42 -0
- package/src/components/controls/InlineCode.js +19 -0
- package/src/components/controls/InsertTable.js +67 -0
- package/src/components/controls/Italic.js +19 -0
- package/src/components/controls/Language.js +69 -0
- package/src/components/controls/MdImage.js +72 -0
- package/src/components/controls/MdLink.js +60 -0
- package/src/components/controls/MdSpeechToText.js +46 -0
- package/src/components/controls/MdTable.js +79 -0
- package/src/components/controls/Menu.js +98 -0
- package/src/components/controls/Minimap.js +36 -0
- package/src/components/controls/Mode.js +30 -0
- package/src/components/controls/NumberList.js +19 -0
- package/src/components/controls/PgCount.js +12 -0
- package/src/components/controls/PgFirst.js +28 -0
- package/src/components/controls/PgGotoPage.js +48 -0
- package/src/components/controls/PgItemsPerPage.js +36 -0
- package/src/components/controls/PgLast.js +28 -0
- package/src/components/controls/PgNext.js +25 -0
- package/src/components/controls/PgPageInfo.js +22 -0
- package/src/components/controls/PgPrev.js +25 -0
- package/src/components/controls/Quote.js +19 -0
- package/src/components/controls/Redo.js +18 -0
- package/src/components/controls/Spacer.js +15 -0
- package/src/components/controls/Strikethrough.js +19 -0
- package/src/components/controls/TcDeleteRecord.js +30 -0
- package/src/components/controls/TcDeleteSelected.js +16 -0
- package/src/components/controls/TcEdit.js +73 -0
- package/src/components/controls/TcExportCsv.js +60 -0
- package/src/components/controls/TcExportJson.js +46 -0
- package/src/components/controls/TcFieldSortHide.js +56 -0
- package/src/components/controls/TcFilters.js +86 -0
- package/src/components/controls/TcFirstPage.js +24 -0
- package/src/components/controls/TcHiddenCount.js +39 -0
- package/src/components/controls/TcHide.js +30 -0
- package/src/components/controls/TcLastPage.js +24 -0
- package/src/components/controls/TcNextPage.js +24 -0
- package/src/components/controls/TcPageSelect.js +36 -0
- package/src/components/controls/TcPageSize.js +23 -0
- package/src/components/controls/TcPrevPage.js +24 -0
- package/src/components/controls/TcSearch.js +34 -0
- package/src/components/controls/TcShowAll.js +18 -0
- package/src/components/controls/TextBackgroundColor.js +84 -0
- package/src/components/controls/TextColor.js +84 -0
- package/src/components/controls/Underline.js +19 -0
- package/src/components/controls/Undo.js +18 -0
- package/src/components/controls/WordCount.js +48 -0
- package/src/components/controls/WordWrap.js +36 -0
- package/tasks/released/0007-code-editor-updates/branch-custom-controls.png +0 -0
- package/tasks/released/0007-code-editor-updates/branch-toolbar.png +0 -0
- package/tasks/released/0007-code-editor-updates/docs-overview.png +0 -0
- package/tasks/released/0007-code-editor-updates/form-integration.png +0 -0
- package/tasks/released/0007-code-editor-updates/live-builtin-controls.png +0 -0
- package/tasks/released/0007-code-editor-updates/live-custom-controls.png +0 -0
- package/tasks/released/0007-code-editor-updates/live-toolbar.png +0 -0
- package/tasks/released/0007-code-editor-updates/local-builtin-controls.png +0 -0
- package/tasks/released/0007-code-editor-updates/local-fixed-builtin.png +0 -0
- package/tasks/released/0007-code-editor-updates/theme-selector.png +0 -0
- package/tasks/released/0007-code-editor-updates.md +96 -0
- package/tests/components/Chat.browser-test.js +0 -23
- package/tests/components/CodeEditor.browser-test.js +0 -42
- package/tests/components/HtmlEditor.browser-test.js +0 -88
- package/tests/components/MarkdownEditor.browser-test.js +0 -72
- package/tests/components/Pagination.browser-test.js +12 -90
- package/tests/components/PhotoViewer.browser-test.js +176 -0
- package/tests/components/{htmlEditorControls → controls}/Align.browser-test.js +16 -16
- package/tests/components/{htmlEditorControls → controls}/Bold.browser-test.js +7 -7
- package/tests/components/{htmlEditorControls → controls}/BulletList.browser-test.js +7 -7
- package/tests/components/{htmlEditorControls → controls}/CharacterCount.browser-test.js +5 -5
- package/tests/components/{htmlEditorControls → controls}/ClearFormatting.browser-test.js +7 -7
- package/tests/components/{htmlEditorControls → controls}/CodeBlock.browser-test.js +8 -8
- package/tests/components/controls/Control.browser-test.js +147 -0
- package/tests/components/{htmlEditorControls → controls}/ControlGroup.browser-test.js +9 -9
- package/tests/components/{htmlEditorControls → controls}/ControlSpacer.browser-test.js +4 -4
- package/tests/components/{codeEditorControls → controls}/CopyCode.browser-test.js +8 -8
- package/tests/components/{htmlEditorControls → controls}/CreateLink.browser-test.js +7 -7
- package/tests/components/{htmlEditorControls → controls}/DropdownControl.browser-test.js +8 -8
- package/tests/components/{codeEditorControls → controls}/EditorTheme.browser-test.js +4 -4
- package/tests/components/{tableControls → controls}/ExportControls.browser-test.js +22 -46
- package/tests/components/{tableControls → controls}/FieldSortHide.browser-test.js +14 -26
- package/tests/components/{tableControls → controls}/Filters.browser-test.js +15 -27
- package/tests/components/{codeEditorControls → controls}/FindReplace.browser-test.js +8 -8
- package/tests/components/{codeEditorControls → controls}/FoldAll.browser-test.js +10 -10
- package/tests/components/{codeEditorControls → controls}/FontSize.browser-test.js +19 -14
- package/tests/components/{htmlEditorControls → controls}/FormatBlock.browser-test.js +9 -9
- package/tests/components/{htmlEditorControls → controls}/FormatCode.browser-test.js +17 -18
- package/tests/components/{codeEditorControls → controls}/Fullscreen.browser-test.js +11 -32
- package/tests/components/{tableControls → controls}/HiddenCount.browser-test.js +4 -4
- package/tests/components/{htmlEditorControls → controls}/InlineCode.browser-test.js +7 -7
- package/tests/components/{htmlEditorControls → controls}/InsertTable.browser-test.js +7 -7
- package/tests/components/{htmlEditorControls → controls}/Italic.browser-test.js +7 -7
- package/tests/components/{codeEditorControls → controls}/LanguageSelect.browser-test.js +4 -4
- package/tests/components/{codeEditorControls → controls}/Minimap.browser-test.js +8 -8
- package/tests/components/{htmlEditorControls → controls}/Mode.browser-test.js +7 -7
- package/tests/components/{codeEditorControls → controls}/ModeVisibility.browser-test.js +7 -7
- package/tests/components/{htmlEditorControls → controls}/NumberList.browser-test.js +7 -7
- package/tests/components/{tableControls → controls}/PaginationControls.browser-test.js +45 -45
- package/tests/components/{tableControls → controls}/RecordControls.browser-test.js +24 -60
- package/tests/components/{tableControls → controls}/Search.browser-test.js +4 -16
- package/tests/components/{htmlEditorControls → controls}/Strikethrough.browser-test.js +7 -7
- package/tests/components/{htmlEditorControls → controls}/TextBackgroundColor.browser-test.js +5 -5
- package/tests/components/{htmlEditorControls → controls}/TextColor.browser-test.js +5 -5
- package/tests/components/{htmlEditorControls → controls}/Underline.browser-test.js +7 -7
- package/tests/components/{codeEditorControls → controls}/UndoRedo.browser-test.js +15 -15
- package/tests/components/{htmlEditorControls → controls}/WordCount.browser-test.js +5 -5
- package/tests/components/{codeEditorControls → controls}/WordWrap.browser-test.js +8 -8
- package/dist/components/codeEditorControls/CodeEditorControl.js +0 -17
- package/dist/components/codeEditorControls/ControlGroup.js +0 -12
- package/dist/components/codeEditorControls/ControlSpacer.js +0 -6
- package/dist/components/codeEditorControls/CopyCode.js +0 -9
- package/dist/components/codeEditorControls/EditorTheme.js +0 -26
- package/dist/components/codeEditorControls/FindReplace.js +0 -7
- package/dist/components/codeEditorControls/FoldAll.js +0 -7
- package/dist/components/codeEditorControls/FontSize.js +0 -13
- package/dist/components/codeEditorControls/FormatCode.js +0 -9
- package/dist/components/codeEditorControls/Fullscreen.js +0 -12
- package/dist/components/codeEditorControls/LanguageSelect.js +0 -15
- package/dist/components/codeEditorControls/Minimap.js +0 -8
- package/dist/components/codeEditorControls/Redo.js +0 -7
- package/dist/components/codeEditorControls/Undo.js +0 -7
- package/dist/components/codeEditorControls/WordWrap.js +0 -8
- package/dist/components/htmlEditorControls/AlignCenter.js +0 -12
- package/dist/components/htmlEditorControls/AlignJustify.js +0 -12
- package/dist/components/htmlEditorControls/AlignLeft.js +0 -12
- package/dist/components/htmlEditorControls/AlignRight.js +0 -12
- package/dist/components/htmlEditorControls/Bold.js +0 -12
- package/dist/components/htmlEditorControls/BulletList.js +0 -12
- package/dist/components/htmlEditorControls/CharacterCount.js +0 -18
- package/dist/components/htmlEditorControls/ClearFormatting.js +0 -12
- package/dist/components/htmlEditorControls/CodeBlock.js +0 -12
- package/dist/components/htmlEditorControls/ControlGroup.js +0 -12
- package/dist/components/htmlEditorControls/CreateLink.js +0 -15
- package/dist/components/htmlEditorControls/DropdownControl.js +0 -57
- package/dist/components/htmlEditorControls/FormatBlock.js +0 -12
- package/dist/components/htmlEditorControls/FormatCode.js +0 -1
- package/dist/components/htmlEditorControls/HtmlEditorControl.js +0 -44
- package/dist/components/htmlEditorControls/InlineCode.js +0 -12
- package/dist/components/htmlEditorControls/InsertTable.js +0 -15
- package/dist/components/htmlEditorControls/Italic.js +0 -12
- package/dist/components/htmlEditorControls/Mode.js +0 -9
- package/dist/components/htmlEditorControls/NumberList.js +0 -12
- package/dist/components/htmlEditorControls/Strikethrough.js +0 -12
- package/dist/components/htmlEditorControls/TextBackgroundColor.js +0 -97
- package/dist/components/htmlEditorControls/TextColor.js +0 -97
- package/dist/components/htmlEditorControls/Underline.js +0 -12
- package/dist/components/htmlEditorControls/WordCount.js +0 -18
- package/dist/components/markdownEditorControls/Bold.js +0 -11
- package/dist/components/markdownEditorControls/BulletList.js +0 -11
- package/dist/components/markdownEditorControls/Code.js +0 -11
- package/dist/components/markdownEditorControls/FormatBlock.js +0 -30
- package/dist/components/markdownEditorControls/Heading.js +0 -11
- package/dist/components/markdownEditorControls/Image.js +0 -93
- package/dist/components/markdownEditorControls/Italic.js +0 -11
- package/dist/components/markdownEditorControls/Link.js +0 -11
- package/dist/components/markdownEditorControls/MarkdownEditorControl.js +0 -39
- package/dist/components/markdownEditorControls/Menu.js +0 -30
- package/dist/components/markdownEditorControls/NumberedList.js +0 -11
- package/dist/components/markdownEditorControls/Quote.js +0 -11
- package/dist/components/markdownEditorControls/SpeechToText.js +0 -16
- package/dist/components/markdownEditorControls/Strikethrough.js +0 -11
- package/dist/components/markdownEditorControls/Table.js +0 -80
- package/dist/components/paginationControls/FirstPage.js +0 -1
- package/dist/components/paginationControls/GotoPage.js +0 -17
- package/dist/components/paginationControls/ItemsPerPage.js +0 -15
- package/dist/components/paginationControls/LastPage.js +0 -1
- package/dist/components/paginationControls/NextPage.js +0 -1
- package/dist/components/paginationControls/PageCount.js +0 -1
- package/dist/components/paginationControls/PageInfo.js +0 -6
- package/dist/components/paginationControls/PaginationButtonControl.js +0 -20
- package/dist/components/paginationControls/PaginationControl.js +0 -5
- package/dist/components/paginationControls/PrevPage.js +0 -1
- package/dist/components/tableControls/DeleteRecord.js +0 -7
- package/dist/components/tableControls/DeleteSelected.js +0 -7
- package/dist/components/tableControls/Edit.js +0 -18
- package/dist/components/tableControls/ExportCSV.js +0 -8
- package/dist/components/tableControls/ExportJson.js +0 -8
- package/dist/components/tableControls/FieldSortHide.js +0 -25
- package/dist/components/tableControls/Filters.js +0 -46
- package/dist/components/tableControls/FirstPage.js +0 -9
- package/dist/components/tableControls/HiddenCount.js +0 -3
- package/dist/components/tableControls/Hide.js +0 -5
- package/dist/components/tableControls/LastPage.js +0 -9
- package/dist/components/tableControls/NextPage.js +0 -9
- package/dist/components/tableControls/PageSelect.js +0 -22
- package/dist/components/tableControls/PageSize.js +0 -5
- package/dist/components/tableControls/PrevPage.js +0 -9
- package/dist/components/tableControls/Search.js +0 -9
- package/dist/components/tableControls/ShowAll.js +0 -5
- package/dist/components/tableControls/TableControl.js +0 -16
- package/docs/src/components/codeEditorControls/CodeEditorControl.js +0 -17
- package/docs/src/components/codeEditorControls/ControlGroup.js +0 -12
- package/docs/src/components/codeEditorControls/CopyCode.js +0 -9
- package/docs/src/components/codeEditorControls/EditorTheme.js +0 -26
- package/docs/src/components/codeEditorControls/FindReplace.js +0 -7
- package/docs/src/components/codeEditorControls/FoldAll.js +0 -7
- package/docs/src/components/codeEditorControls/FontSize.js +0 -13
- package/docs/src/components/codeEditorControls/FormatCode.js +0 -9
- package/docs/src/components/codeEditorControls/Fullscreen.js +0 -12
- package/docs/src/components/codeEditorControls/LanguageSelect.js +0 -15
- package/docs/src/components/codeEditorControls/Minimap.js +0 -8
- package/docs/src/components/codeEditorControls/Redo.js +0 -7
- package/docs/src/components/codeEditorControls/Undo.js +0 -7
- package/docs/src/components/codeEditorControls/WordWrap.js +0 -8
- package/docs/src/components/htmlEditorControls/AlignCenter.js +0 -12
- package/docs/src/components/htmlEditorControls/AlignJustify.js +0 -12
- package/docs/src/components/htmlEditorControls/AlignLeft.js +0 -12
- package/docs/src/components/htmlEditorControls/AlignRight.js +0 -12
- package/docs/src/components/htmlEditorControls/Bold.js +0 -12
- package/docs/src/components/htmlEditorControls/BulletList.js +0 -12
- package/docs/src/components/htmlEditorControls/CharacterCount.js +0 -18
- package/docs/src/components/htmlEditorControls/ClearFormatting.js +0 -12
- package/docs/src/components/htmlEditorControls/CodeBlock.js +0 -12
- package/docs/src/components/htmlEditorControls/ControlGroup.js +0 -12
- package/docs/src/components/htmlEditorControls/ControlSpacer.js +0 -6
- package/docs/src/components/htmlEditorControls/CreateLink.js +0 -15
- package/docs/src/components/htmlEditorControls/DropdownControl.js +0 -57
- package/docs/src/components/htmlEditorControls/FormatBlock.js +0 -12
- package/docs/src/components/htmlEditorControls/FormatCode.js +0 -1
- package/docs/src/components/htmlEditorControls/HtmlEditorControl.js +0 -44
- package/docs/src/components/htmlEditorControls/InlineCode.js +0 -12
- package/docs/src/components/htmlEditorControls/InsertTable.js +0 -15
- package/docs/src/components/htmlEditorControls/Italic.js +0 -12
- package/docs/src/components/htmlEditorControls/Mode.js +0 -9
- package/docs/src/components/htmlEditorControls/NumberList.js +0 -12
- package/docs/src/components/htmlEditorControls/Strikethrough.js +0 -12
- package/docs/src/components/htmlEditorControls/TextBackgroundColor.js +0 -97
- package/docs/src/components/htmlEditorControls/TextColor.js +0 -97
- package/docs/src/components/htmlEditorControls/Underline.js +0 -12
- package/docs/src/components/htmlEditorControls/WordCount.js +0 -18
- package/docs/src/components/markdownEditorControls/Bold.js +0 -11
- package/docs/src/components/markdownEditorControls/BulletList.js +0 -11
- package/docs/src/components/markdownEditorControls/Code.js +0 -11
- package/docs/src/components/markdownEditorControls/FormatBlock.js +0 -30
- package/docs/src/components/markdownEditorControls/Heading.js +0 -11
- package/docs/src/components/markdownEditorControls/Image.js +0 -93
- package/docs/src/components/markdownEditorControls/Italic.js +0 -11
- package/docs/src/components/markdownEditorControls/Link.js +0 -11
- package/docs/src/components/markdownEditorControls/MarkdownEditorControl.js +0 -39
- package/docs/src/components/markdownEditorControls/Menu.js +0 -30
- package/docs/src/components/markdownEditorControls/NumberedList.js +0 -11
- package/docs/src/components/markdownEditorControls/Quote.js +0 -11
- package/docs/src/components/markdownEditorControls/SpeechToText.js +0 -16
- package/docs/src/components/markdownEditorControls/Strikethrough.js +0 -11
- package/docs/src/components/markdownEditorControls/Table.js +0 -80
- package/docs/src/components/paginationControls/FirstPage.js +0 -1
- package/docs/src/components/paginationControls/GotoPage.js +0 -17
- package/docs/src/components/paginationControls/ItemsPerPage.js +0 -15
- package/docs/src/components/paginationControls/LastPage.js +0 -1
- package/docs/src/components/paginationControls/NextPage.js +0 -1
- package/docs/src/components/paginationControls/PageCount.js +0 -1
- package/docs/src/components/paginationControls/PageInfo.js +0 -6
- package/docs/src/components/paginationControls/PaginationButtonControl.js +0 -20
- package/docs/src/components/paginationControls/PaginationControl.js +0 -5
- package/docs/src/components/paginationControls/PrevPage.js +0 -1
- package/docs/src/components/tableControls/DeleteRecord.js +0 -7
- package/docs/src/components/tableControls/DeleteSelected.js +0 -7
- package/docs/src/components/tableControls/Edit.js +0 -18
- package/docs/src/components/tableControls/ExportCSV.js +0 -8
- package/docs/src/components/tableControls/ExportJson.js +0 -8
- package/docs/src/components/tableControls/FieldSortHide.js +0 -25
- package/docs/src/components/tableControls/Filters.js +0 -46
- package/docs/src/components/tableControls/FirstPage.js +0 -9
- package/docs/src/components/tableControls/HiddenCount.js +0 -3
- package/docs/src/components/tableControls/Hide.js +0 -5
- package/docs/src/components/tableControls/LastPage.js +0 -9
- package/docs/src/components/tableControls/NextPage.js +0 -9
- package/docs/src/components/tableControls/PageSelect.js +0 -22
- package/docs/src/components/tableControls/PageSize.js +0 -5
- package/docs/src/components/tableControls/PrevPage.js +0 -9
- package/docs/src/components/tableControls/Search.js +0 -9
- package/docs/src/components/tableControls/ShowAll.js +0 -5
- package/docs/src/components/tableControls/TableControl.js +0 -16
- package/src/components/codeEditorControls/CodeEditorControl.js +0 -134
- package/src/components/codeEditorControls/ControlSpacer.js +0 -23
- package/src/components/codeEditorControls/CopyCode.js +0 -37
- package/src/components/codeEditorControls/EditorTheme.js +0 -81
- package/src/components/codeEditorControls/FindReplace.js +0 -35
- package/src/components/codeEditorControls/FoldAll.js +0 -49
- package/src/components/codeEditorControls/FontSize.js +0 -45
- package/src/components/codeEditorControls/FormatCode.js +0 -37
- package/src/components/codeEditorControls/Fullscreen.js +0 -72
- package/src/components/codeEditorControls/LanguageSelect.js +0 -74
- package/src/components/codeEditorControls/Minimap.js +0 -60
- package/src/components/codeEditorControls/Redo.js +0 -35
- package/src/components/codeEditorControls/Undo.js +0 -35
- package/src/components/codeEditorControls/WordWrap.js +0 -60
- package/src/components/htmlEditorControls/AlignCenter.js +0 -63
- package/src/components/htmlEditorControls/AlignJustify.js +0 -63
- package/src/components/htmlEditorControls/AlignLeft.js +0 -63
- package/src/components/htmlEditorControls/AlignRight.js +0 -63
- package/src/components/htmlEditorControls/Bold.js +0 -63
- package/src/components/htmlEditorControls/BulletList.js +0 -63
- package/src/components/htmlEditorControls/CharacterCount.js +0 -75
- package/src/components/htmlEditorControls/ClearFormatting.js +0 -63
- package/src/components/htmlEditorControls/CodeBlock.js +0 -64
- package/src/components/htmlEditorControls/ControlGroup.js +0 -70
- package/src/components/htmlEditorControls/ControlSpacer.js +0 -23
- package/src/components/htmlEditorControls/CreateLink.js +0 -115
- package/src/components/htmlEditorControls/DropdownControl.js +0 -149
- package/src/components/htmlEditorControls/FormatBlock.js +0 -106
- package/src/components/htmlEditorControls/FormatCode.js +0 -7
- package/src/components/htmlEditorControls/HtmlEditorControl.js +0 -164
- package/src/components/htmlEditorControls/InlineCode.js +0 -63
- package/src/components/htmlEditorControls/InsertTable.js +0 -126
- package/src/components/htmlEditorControls/Italic.js +0 -63
- package/src/components/htmlEditorControls/Mode.js +0 -68
- package/src/components/htmlEditorControls/NumberList.js +0 -63
- package/src/components/htmlEditorControls/Strikethrough.js +0 -63
- package/src/components/htmlEditorControls/TextBackgroundColor.js +0 -189
- package/src/components/htmlEditorControls/TextColor.js +0 -189
- package/src/components/htmlEditorControls/Underline.js +0 -63
- package/src/components/htmlEditorControls/WordCount.js +0 -76
- package/src/components/markdownEditorControls/Bold.js +0 -30
- package/src/components/markdownEditorControls/BulletList.js +0 -30
- package/src/components/markdownEditorControls/Code.js +0 -39
- package/src/components/markdownEditorControls/FormatBlock.js +0 -102
- package/src/components/markdownEditorControls/Heading.js +0 -46
- package/src/components/markdownEditorControls/Image.js +0 -250
- package/src/components/markdownEditorControls/Italic.js +0 -30
- package/src/components/markdownEditorControls/Link.js +0 -74
- package/src/components/markdownEditorControls/MarkdownEditorControl.js +0 -158
- package/src/components/markdownEditorControls/Menu.js +0 -86
- package/src/components/markdownEditorControls/NumberedList.js +0 -69
- package/src/components/markdownEditorControls/Quote.js +0 -30
- package/src/components/markdownEditorControls/SpeechToText.js +0 -65
- package/src/components/markdownEditorControls/Strikethrough.js +0 -35
- package/src/components/markdownEditorControls/Table.js +0 -165
- package/src/components/paginationControls/FirstPage.js +0 -26
- package/src/components/paginationControls/GotoPage.js +0 -56
- package/src/components/paginationControls/ItemsPerPage.js +0 -44
- package/src/components/paginationControls/LastPage.js +0 -26
- package/src/components/paginationControls/NextPage.js +0 -26
- package/src/components/paginationControls/PageCount.js +0 -10
- package/src/components/paginationControls/PageInfo.js +0 -23
- package/src/components/paginationControls/PaginationButtonControl.js +0 -76
- package/src/components/paginationControls/PaginationControl.js +0 -43
- package/src/components/paginationControls/PrevPage.js +0 -26
- package/src/components/tableControls/DeleteRecord.js +0 -29
- package/src/components/tableControls/DeleteSelected.js +0 -27
- package/src/components/tableControls/Edit.js +0 -86
- package/src/components/tableControls/ExportCSV.js +0 -71
- package/src/components/tableControls/ExportJson.js +0 -55
- package/src/components/tableControls/FieldSortHide.js +0 -76
- package/src/components/tableControls/Filters.js +0 -113
- package/src/components/tableControls/FirstPage.js +0 -65
- package/src/components/tableControls/HiddenCount.js +0 -43
- package/src/components/tableControls/Hide.js +0 -34
- package/src/components/tableControls/LastPage.js +0 -65
- package/src/components/tableControls/NextPage.js +0 -65
- package/src/components/tableControls/PageSelect.js +0 -101
- package/src/components/tableControls/PageSize.js +0 -68
- package/src/components/tableControls/PrevPage.js +0 -65
- package/src/components/tableControls/Search.js +0 -56
- package/src/components/tableControls/ShowAll.js +0 -34
- package/src/components/tableControls/TableControl.js +0 -103
- package/tests/components/tableControls/TableControl.browser-test.js +0 -300
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import '../../../src/components/HtmlEditor.js';
|
|
2
|
-
import CodeBlock from '../../../src/components/
|
|
2
|
+
import CodeBlock from '../../../src/components/controls/CodeBlock.js';
|
|
3
3
|
|
|
4
4
|
const createEditorWithControl = async () => {
|
|
5
5
|
const container = document.createElement('div');
|
|
6
6
|
container.innerHTML = `
|
|
7
7
|
<k-html-editor>
|
|
8
|
-
<
|
|
8
|
+
<kc-code-block slot="toolbar-top-left"></kc-code-block>
|
|
9
9
|
</k-html-editor>
|
|
10
10
|
`;
|
|
11
11
|
document.body.appendChild(container);
|
|
12
12
|
const editor = container.querySelector('k-html-editor');
|
|
13
13
|
await new Promise(r => editor.addEventListener('ready', r, { once: true }));
|
|
14
|
-
const control = container.querySelector('
|
|
14
|
+
const control = container.querySelector('kc-code-block');
|
|
15
15
|
return { container, editor, control };
|
|
16
16
|
};
|
|
17
17
|
|
|
@@ -23,7 +23,7 @@ export default {
|
|
|
23
23
|
/*
|
|
24
24
|
Element Creation
|
|
25
25
|
*/
|
|
26
|
-
'should create
|
|
26
|
+
'should create kc-code-block element': async ({pass, fail}) => {
|
|
27
27
|
const { container, control } = await createEditorWithControl();
|
|
28
28
|
if(!(control instanceof CodeBlock)){
|
|
29
29
|
cleanup(container);
|
|
@@ -46,7 +46,7 @@ export default {
|
|
|
46
46
|
'should render a button': async ({pass, fail}) => {
|
|
47
47
|
const { container, control } = await createEditorWithControl();
|
|
48
48
|
await control.updateComplete;
|
|
49
|
-
const button = control
|
|
49
|
+
const button = control;
|
|
50
50
|
if(!button){
|
|
51
51
|
cleanup(container);
|
|
52
52
|
return fail('CodeBlock should render a button');
|
|
@@ -76,7 +76,7 @@ export default {
|
|
|
76
76
|
*/
|
|
77
77
|
'should find parent editor': async ({pass, fail}) => {
|
|
78
78
|
const { container, editor, control } = await createEditorWithControl();
|
|
79
|
-
if(control.
|
|
79
|
+
if(control.host !== editor){
|
|
80
80
|
cleanup(container);
|
|
81
81
|
return fail('CodeBlock should find its parent k-html-editor');
|
|
82
82
|
}
|
|
@@ -90,7 +90,7 @@ export default {
|
|
|
90
90
|
let calledWith = null;
|
|
91
91
|
editor.isSelectionInCodeBlock = () => false;
|
|
92
92
|
editor.formatBlock = tag => { calledWith = tag; };
|
|
93
|
-
control.
|
|
93
|
+
control.click();
|
|
94
94
|
if(calledWith !== 'pre'){
|
|
95
95
|
cleanup(container);
|
|
96
96
|
return fail(`Expected formatBlock("pre"), got formatBlock("${calledWith}")`);
|
|
@@ -105,7 +105,7 @@ export default {
|
|
|
105
105
|
let calledWith = null;
|
|
106
106
|
editor.isSelectionInCodeBlock = () => true;
|
|
107
107
|
editor.formatBlock = tag => { calledWith = tag; };
|
|
108
|
-
control.
|
|
108
|
+
control.click();
|
|
109
109
|
if(calledWith !== 'p'){
|
|
110
110
|
cleanup(container);
|
|
111
111
|
return fail(`Expected formatBlock("p"), got formatBlock("${calledWith}")`);
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import Control from '../../../src/components/controls/Control.js';
|
|
2
|
+
import '../../../src/components/Table.js';
|
|
3
|
+
import { html } from '../../../src/lit-all.min.js';
|
|
4
|
+
|
|
5
|
+
class TestControl extends Control {
|
|
6
|
+
static requires = ['setRecords'];
|
|
7
|
+
render() {
|
|
8
|
+
return html`<button class="test-btn">Test Control</button>`;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if(!customElements.get('test-control-base')){
|
|
13
|
+
customElements.define('test-control-base', TestControl);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const sampleRecords = [
|
|
17
|
+
{ id: 1, name: 'Alice', age: 30 },
|
|
18
|
+
{ id: 2, name: 'Bob', age: 25 },
|
|
19
|
+
{ id: 3, name: 'Charlie', age: 35 }
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
const createTableWithControl = async (controlHtml = '<test-control-base></test-control-base>') => {
|
|
23
|
+
const container = document.createElement('div');
|
|
24
|
+
container.innerHTML = `
|
|
25
|
+
<k-table>
|
|
26
|
+
<div slot="controls">${controlHtml}</div>
|
|
27
|
+
</k-table>
|
|
28
|
+
`;
|
|
29
|
+
document.body.appendChild(container);
|
|
30
|
+
const table = container.querySelector('k-table');
|
|
31
|
+
table.setRecords([...sampleRecords]);
|
|
32
|
+
await table.updateComplete;
|
|
33
|
+
const control = container.querySelector('test-control-base');
|
|
34
|
+
if(control) await control.updateComplete;
|
|
35
|
+
return { container, table, control };
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const cleanup = (container) => {
|
|
39
|
+
if(container && container.parentNode){
|
|
40
|
+
container.parentNode.removeChild(container);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export default {
|
|
45
|
+
/*
|
|
46
|
+
Host Discovery Tests
|
|
47
|
+
*/
|
|
48
|
+
'should find parent host via controlled attribute': async ({pass, fail}) => {
|
|
49
|
+
const { container, table, control } = await createTableWithControl();
|
|
50
|
+
if(!control.host){
|
|
51
|
+
cleanup(container);
|
|
52
|
+
return fail('Control should find parent host');
|
|
53
|
+
}
|
|
54
|
+
if(control.host !== table){
|
|
55
|
+
cleanup(container);
|
|
56
|
+
return fail('Control should reference correct host');
|
|
57
|
+
}
|
|
58
|
+
cleanup(container);
|
|
59
|
+
pass('host getter finds parent k-table');
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
'should return null when no parent host': async ({pass, fail}) => {
|
|
63
|
+
const control = document.createElement('test-control-base');
|
|
64
|
+
document.body.appendChild(control);
|
|
65
|
+
await control.updateComplete;
|
|
66
|
+
if(control.host !== null){
|
|
67
|
+
document.body.removeChild(control);
|
|
68
|
+
return fail('host getter should return null when no parent host');
|
|
69
|
+
}
|
|
70
|
+
document.body.removeChild(control);
|
|
71
|
+
pass('host getter returns null when no parent host');
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
/*
|
|
75
|
+
Requires / Host Support Tests
|
|
76
|
+
*/
|
|
77
|
+
'should not be disabled when host has required methods': async ({pass, fail}) => {
|
|
78
|
+
const { container, control } = await createTableWithControl();
|
|
79
|
+
await control.updateComplete;
|
|
80
|
+
if(control.disabled){
|
|
81
|
+
cleanup(container);
|
|
82
|
+
return fail('Control should not be disabled when host has required methods');
|
|
83
|
+
}
|
|
84
|
+
cleanup(container);
|
|
85
|
+
pass('Control enabled when host supports required methods');
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
'should be disabled when host missing required methods': async ({pass, fail}) => {
|
|
89
|
+
class StrictControl extends Control {
|
|
90
|
+
static requires = ['nonExistentMethod'];
|
|
91
|
+
render() { return html`<span>test</span>`; }
|
|
92
|
+
}
|
|
93
|
+
if(!customElements.get('test-strict-control')){
|
|
94
|
+
customElements.define('test-strict-control', StrictControl);
|
|
95
|
+
}
|
|
96
|
+
const container = document.createElement('div');
|
|
97
|
+
container.innerHTML = `
|
|
98
|
+
<k-table>
|
|
99
|
+
<div slot="controls"><test-strict-control></test-strict-control></div>
|
|
100
|
+
</k-table>
|
|
101
|
+
`;
|
|
102
|
+
document.body.appendChild(container);
|
|
103
|
+
const table = container.querySelector('k-table');
|
|
104
|
+
table.setRecords([...sampleRecords]);
|
|
105
|
+
await table.updateComplete;
|
|
106
|
+
const control = container.querySelector('test-strict-control');
|
|
107
|
+
await control.updateComplete;
|
|
108
|
+
if(!control.disabled){
|
|
109
|
+
cleanup(container);
|
|
110
|
+
return fail('Control should be disabled when host lacks required methods');
|
|
111
|
+
}
|
|
112
|
+
cleanup(container);
|
|
113
|
+
pass('Control disabled when host missing required methods');
|
|
114
|
+
},
|
|
115
|
+
|
|
116
|
+
/*
|
|
117
|
+
Host Method Invocation Tests
|
|
118
|
+
*/
|
|
119
|
+
'should invoke host method directly via host getter': async ({pass, fail}) => {
|
|
120
|
+
const { container, table, control } = await createTableWithControl();
|
|
121
|
+
const newRecords = [{ id: 99, name: 'Zara', age: 22 }];
|
|
122
|
+
control.host?.setRecords(newRecords);
|
|
123
|
+
await table.updateComplete;
|
|
124
|
+
if(table.records.length !== 1 || table.records[0].name !== 'Zara'){
|
|
125
|
+
cleanup(container);
|
|
126
|
+
return fail('Host method should be callable via control.host');
|
|
127
|
+
}
|
|
128
|
+
cleanup(container);
|
|
129
|
+
pass('Host method invoked correctly via control.host');
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
/*
|
|
133
|
+
Rendering Tests
|
|
134
|
+
*/
|
|
135
|
+
'should render content in shadow root': async ({pass, fail}) => {
|
|
136
|
+
const control = document.createElement('test-control-base');
|
|
137
|
+
document.body.appendChild(control);
|
|
138
|
+
await control.updateComplete;
|
|
139
|
+
const btn = control.shadowRoot.querySelector('.test-btn');
|
|
140
|
+
if(!btn){
|
|
141
|
+
document.body.removeChild(control);
|
|
142
|
+
return fail('Should render test button');
|
|
143
|
+
}
|
|
144
|
+
document.body.removeChild(control);
|
|
145
|
+
pass('Control renders content in shadow root');
|
|
146
|
+
}
|
|
147
|
+
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import '../../../src/components/HtmlEditor.js';
|
|
2
|
-
import ControlGroup from '../../../src/components/
|
|
3
|
-
import '../../../src/components/
|
|
4
|
-
import '../../../src/components/
|
|
2
|
+
import ControlGroup from '../../../src/components/ControlGroup.js';
|
|
3
|
+
import '../../../src/components/controls/Bold.js';
|
|
4
|
+
import '../../../src/components/controls/Italic.js';
|
|
5
5
|
|
|
6
6
|
const createEditorWithGroup = async () => {
|
|
7
7
|
const container = document.createElement('div');
|
|
8
8
|
container.innerHTML = `
|
|
9
9
|
<k-html-editor>
|
|
10
|
-
<k-
|
|
11
|
-
<
|
|
12
|
-
<
|
|
13
|
-
</k-
|
|
10
|
+
<k-control-group slot="toolbar-top-left">
|
|
11
|
+
<kc-bold></kc-bold>
|
|
12
|
+
<kc-italic></kc-italic>
|
|
13
|
+
</k-control-group>
|
|
14
14
|
</k-html-editor>
|
|
15
15
|
`;
|
|
16
16
|
document.body.appendChild(container);
|
|
17
17
|
const editor = container.querySelector('k-html-editor');
|
|
18
18
|
await new Promise(r => editor.addEventListener('ready', r, { once: true }));
|
|
19
|
-
const group = container.querySelector('k-
|
|
19
|
+
const group = container.querySelector('k-control-group');
|
|
20
20
|
return { container, editor, group };
|
|
21
21
|
};
|
|
22
22
|
|
|
@@ -28,7 +28,7 @@ export default {
|
|
|
28
28
|
/*
|
|
29
29
|
Element Creation
|
|
30
30
|
*/
|
|
31
|
-
'should create k-
|
|
31
|
+
'should create k-control-group element': async ({pass, fail}) => {
|
|
32
32
|
const { container, group } = await createEditorWithGroup();
|
|
33
33
|
if(!(group instanceof ControlGroup)){
|
|
34
34
|
cleanup(container);
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import '../../../src/components/HtmlEditor.js';
|
|
2
|
-
import ControlSpacer from '../../../src/components/
|
|
2
|
+
import ControlSpacer from '../../../src/components/controls/Spacer.js';
|
|
3
3
|
|
|
4
4
|
const createEditorWithControl = async () => {
|
|
5
5
|
const container = document.createElement('div');
|
|
6
6
|
container.innerHTML = `
|
|
7
7
|
<k-html-editor>
|
|
8
|
-
<
|
|
8
|
+
<kc-spacer slot="toolbar-top-left"></kc-spacer>
|
|
9
9
|
</k-html-editor>
|
|
10
10
|
`;
|
|
11
11
|
document.body.appendChild(container);
|
|
12
12
|
const editor = container.querySelector('k-html-editor');
|
|
13
13
|
await new Promise(r => editor.addEventListener('ready', r, { once: true }));
|
|
14
|
-
const control = container.querySelector('
|
|
14
|
+
const control = container.querySelector('kc-spacer');
|
|
15
15
|
return { container, editor, control };
|
|
16
16
|
};
|
|
17
17
|
|
|
@@ -23,7 +23,7 @@ export default {
|
|
|
23
23
|
/*
|
|
24
24
|
Element Creation
|
|
25
25
|
*/
|
|
26
|
-
'should create
|
|
26
|
+
'should create kc-spacer element': async ({pass, fail}) => {
|
|
27
27
|
const { container, control } = await createEditorWithControl();
|
|
28
28
|
if(!(control instanceof ControlSpacer)){
|
|
29
29
|
cleanup(container);
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import '../../../src/components/CodeEditor.js';
|
|
2
|
-
import '../../../src/components/
|
|
2
|
+
import '../../../src/components/controls/CopyCode.js';
|
|
3
3
|
|
|
4
4
|
const createEditorWithControl = async () => {
|
|
5
5
|
const container = document.createElement('div');
|
|
6
6
|
container.innerHTML = `
|
|
7
7
|
<k-code-editor language="javascript" style="height:200px">
|
|
8
|
-
<
|
|
8
|
+
<kc-copy-code slot="toolbar-top-left"></kc-copy-code>
|
|
9
9
|
</k-code-editor>
|
|
10
10
|
`;
|
|
11
11
|
document.body.appendChild(container);
|
|
12
12
|
const editor = container.querySelector('k-code-editor');
|
|
13
13
|
await new Promise(r => editor.addEventListener('ready', r, { once: true }));
|
|
14
|
-
const control = container.querySelector('
|
|
14
|
+
const control = container.querySelector('kc-copy-code');
|
|
15
15
|
return { container, editor, control };
|
|
16
16
|
};
|
|
17
17
|
|
|
@@ -20,12 +20,12 @@ const cleanup = container => {
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
export default {
|
|
23
|
-
'should
|
|
23
|
+
'should have button role': async ({pass, fail}) => {
|
|
24
24
|
const { container, control } = await createEditorWithControl();
|
|
25
25
|
await control.updateComplete;
|
|
26
|
-
if(
|
|
26
|
+
if(control.getAttribute('role') !== 'button'){
|
|
27
27
|
cleanup(container);
|
|
28
|
-
return fail('Should
|
|
28
|
+
return fail('Should have role="button"');
|
|
29
29
|
}
|
|
30
30
|
cleanup(container);
|
|
31
31
|
pass();
|
|
@@ -33,7 +33,7 @@ export default {
|
|
|
33
33
|
|
|
34
34
|
'should find parent editor': async ({pass, fail}) => {
|
|
35
35
|
const { container, editor, control } = await createEditorWithControl();
|
|
36
|
-
if(control.
|
|
36
|
+
if(control.host !== editor){
|
|
37
37
|
cleanup(container);
|
|
38
38
|
return fail('Should find parent k-code-editor');
|
|
39
39
|
}
|
|
@@ -46,7 +46,7 @@ export default {
|
|
|
46
46
|
await control.updateComplete;
|
|
47
47
|
let called = false;
|
|
48
48
|
editor.copyToClipboard = () => { called = true; return editor; };
|
|
49
|
-
control.
|
|
49
|
+
control.click();
|
|
50
50
|
if(!called){
|
|
51
51
|
cleanup(container);
|
|
52
52
|
return fail('Should call editor.copyToClipboard() on click');
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import '../../../src/components/HtmlEditor.js';
|
|
2
|
-
import CreateLink from '../../../src/components/
|
|
2
|
+
import CreateLink from '../../../src/components/controls/CreateLink.js';
|
|
3
3
|
|
|
4
4
|
const createEditorWithControl = async () => {
|
|
5
5
|
const container = document.createElement('div');
|
|
6
6
|
container.innerHTML = `
|
|
7
7
|
<k-html-editor>
|
|
8
|
-
<
|
|
8
|
+
<kc-create-link slot="toolbar-top-left"></kc-create-link>
|
|
9
9
|
</k-html-editor>
|
|
10
10
|
`;
|
|
11
11
|
document.body.appendChild(container);
|
|
12
12
|
const editor = container.querySelector('k-html-editor');
|
|
13
13
|
await new Promise(r => editor.addEventListener('ready', r, { once: true }));
|
|
14
|
-
const control = container.querySelector('
|
|
14
|
+
const control = container.querySelector('kc-create-link');
|
|
15
15
|
return { container, editor, control };
|
|
16
16
|
};
|
|
17
17
|
|
|
@@ -23,7 +23,7 @@ export default {
|
|
|
23
23
|
/*
|
|
24
24
|
Element Creation
|
|
25
25
|
*/
|
|
26
|
-
'should create
|
|
26
|
+
'should create kc-create-link element': async ({pass, fail}) => {
|
|
27
27
|
const { container, control } = await createEditorWithControl();
|
|
28
28
|
if(!(control instanceof CreateLink)){
|
|
29
29
|
cleanup(container);
|
|
@@ -46,7 +46,7 @@ export default {
|
|
|
46
46
|
'should render a button': async ({pass, fail}) => {
|
|
47
47
|
const { container, control } = await createEditorWithControl();
|
|
48
48
|
await control.updateComplete;
|
|
49
|
-
const button = control
|
|
49
|
+
const button = control;
|
|
50
50
|
if(!button){
|
|
51
51
|
cleanup(container);
|
|
52
52
|
return fail('CreateLink should render a button');
|
|
@@ -76,7 +76,7 @@ export default {
|
|
|
76
76
|
*/
|
|
77
77
|
'should find parent editor': async ({pass, fail}) => {
|
|
78
78
|
const { container, editor, control } = await createEditorWithControl();
|
|
79
|
-
if(control.
|
|
79
|
+
if(control.host !== editor){
|
|
80
80
|
cleanup(container);
|
|
81
81
|
return fail('CreateLink should find its parent k-html-editor');
|
|
82
82
|
}
|
|
@@ -88,7 +88,7 @@ export default {
|
|
|
88
88
|
const { container, editor, control } = await createEditorWithControl();
|
|
89
89
|
await control.updateComplete;
|
|
90
90
|
editor.getSelectedText = () => '';
|
|
91
|
-
control.
|
|
91
|
+
control.click();
|
|
92
92
|
await new Promise(r => setTimeout(r, 100));
|
|
93
93
|
const dialog = document.querySelector('k-dialog');
|
|
94
94
|
if(!dialog){
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import '../../../src/components/HtmlEditor.js';
|
|
2
|
-
import DropdownControl from '../../../src/components/
|
|
3
|
-
import '../../../src/components/
|
|
2
|
+
import DropdownControl from '../../../src/components/controls/Menu.js';
|
|
3
|
+
import '../../../src/components/controls/Bold.js';
|
|
4
4
|
|
|
5
5
|
const createEditorWithControl = async () => {
|
|
6
6
|
const container = document.createElement('div');
|
|
7
7
|
container.innerHTML = `
|
|
8
8
|
<k-html-editor>
|
|
9
|
-
<
|
|
9
|
+
<kc-menu slot="toolbar-top-left">
|
|
10
10
|
<k-icon name="more_vert" slot="icon"></k-icon>
|
|
11
|
-
<
|
|
12
|
-
</
|
|
11
|
+
<kc-bold></kc-bold>
|
|
12
|
+
</kc-menu>
|
|
13
13
|
</k-html-editor>
|
|
14
14
|
`;
|
|
15
15
|
document.body.appendChild(container);
|
|
16
16
|
const editor = container.querySelector('k-html-editor');
|
|
17
17
|
await new Promise(r => editor.addEventListener('ready', r, { once: true }));
|
|
18
|
-
const control = container.querySelector('
|
|
18
|
+
const control = container.querySelector('kc-menu');
|
|
19
19
|
return { container, editor, control };
|
|
20
20
|
};
|
|
21
21
|
|
|
@@ -27,7 +27,7 @@ export default {
|
|
|
27
27
|
/*
|
|
28
28
|
Element Creation
|
|
29
29
|
*/
|
|
30
|
-
'should create
|
|
30
|
+
'should create kc-menu element': async ({pass, fail}) => {
|
|
31
31
|
const { container, control } = await createEditorWithControl();
|
|
32
32
|
if(!(control instanceof DropdownControl)){
|
|
33
33
|
cleanup(container);
|
|
@@ -76,7 +76,7 @@ export default {
|
|
|
76
76
|
*/
|
|
77
77
|
'should find parent editor': async ({pass, fail}) => {
|
|
78
78
|
const { container, editor, control } = await createEditorWithControl();
|
|
79
|
-
if(control.
|
|
79
|
+
if(control.host !== editor){
|
|
80
80
|
cleanup(container);
|
|
81
81
|
return fail('DropdownControl should find its parent k-html-editor');
|
|
82
82
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import '../../../src/components/CodeEditor.js';
|
|
2
|
-
import '../../../src/components/
|
|
2
|
+
import '../../../src/components/controls/EditorTheme.js';
|
|
3
3
|
|
|
4
4
|
const createEditorWithControl = async () => {
|
|
5
5
|
const container = document.createElement('div');
|
|
6
6
|
container.innerHTML = `
|
|
7
7
|
<k-code-editor language="javascript" style="height:200px">
|
|
8
|
-
<
|
|
8
|
+
<kc-editor-theme slot="toolbar-top-right"></kc-editor-theme>
|
|
9
9
|
</k-code-editor>
|
|
10
10
|
`;
|
|
11
11
|
document.body.appendChild(container);
|
|
12
12
|
const editor = container.querySelector('k-code-editor');
|
|
13
13
|
await new Promise(r => editor.addEventListener('ready', r, { once: true }));
|
|
14
|
-
const control = container.querySelector('
|
|
14
|
+
const control = container.querySelector('kc-editor-theme');
|
|
15
15
|
return { container, editor, control };
|
|
16
16
|
};
|
|
17
17
|
|
|
@@ -33,7 +33,7 @@ export default {
|
|
|
33
33
|
|
|
34
34
|
'should find parent editor': async ({pass, fail}) => {
|
|
35
35
|
const { container, editor, control } = await createEditorWithControl();
|
|
36
|
-
if(control.
|
|
36
|
+
if(control.host !== editor){
|
|
37
37
|
cleanup(container);
|
|
38
38
|
return fail('Should find parent k-code-editor');
|
|
39
39
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import '../../../src/components/
|
|
2
|
-
import '../../../src/components/
|
|
1
|
+
import '../../../src/components/controls/TcExportCSV.js';
|
|
2
|
+
import '../../../src/components/controls/TcExportJson.js';
|
|
3
3
|
import '../../../src/components/Table.js';
|
|
4
4
|
|
|
5
5
|
const sampleRecords = [
|
|
@@ -50,9 +50,9 @@ export default {
|
|
|
50
50
|
ExportCSV Tests
|
|
51
51
|
*/
|
|
52
52
|
'ExportCSV: should render export button': async ({pass, fail}) => {
|
|
53
|
-
const { container, control } = await createTableWithControl('
|
|
53
|
+
const { container, control } = await createTableWithControl('kc-tc-export-csv');
|
|
54
54
|
|
|
55
|
-
const btn = control
|
|
55
|
+
const btn = control;
|
|
56
56
|
if(!btn){
|
|
57
57
|
cleanup(container);
|
|
58
58
|
fail('ExportCSV should render button');
|
|
@@ -70,21 +70,9 @@ export default {
|
|
|
70
70
|
pass('ExportCSV renders correctly');
|
|
71
71
|
},
|
|
72
72
|
|
|
73
|
-
'ExportCSV: should have default maxWidth of 136': async ({pass, fail}) => {
|
|
74
|
-
const { container, control } = await createTableWithControl('k-tc-export-csv');
|
|
75
|
-
|
|
76
|
-
if(control.maxWidth !== 136){
|
|
77
|
-
cleanup(container);
|
|
78
|
-
fail(`Expected maxWidth 136, got ${control.maxWidth}`);
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
cleanup(container);
|
|
83
|
-
pass('ExportCSV has default maxWidth of 136');
|
|
84
|
-
},
|
|
85
73
|
|
|
86
74
|
'ExportCSV: should have getCSV method': async ({pass, fail}) => {
|
|
87
|
-
const { container, control } = await createTableWithControl('
|
|
75
|
+
const { container, control } = await createTableWithControl('kc-tc-export-csv');
|
|
88
76
|
|
|
89
77
|
if(typeof control.getCSV !== 'function'){
|
|
90
78
|
cleanup(container);
|
|
@@ -97,7 +85,7 @@ export default {
|
|
|
97
85
|
},
|
|
98
86
|
|
|
99
87
|
'ExportCSV: should have export method': async ({pass, fail}) => {
|
|
100
|
-
const { container, control } = await createTableWithControl('
|
|
88
|
+
const { container, control } = await createTableWithControl('kc-tc-export-csv');
|
|
101
89
|
|
|
102
90
|
if(typeof control.export !== 'function'){
|
|
103
91
|
cleanup(container);
|
|
@@ -110,7 +98,7 @@ export default {
|
|
|
110
98
|
},
|
|
111
99
|
|
|
112
100
|
'ExportCSV: getCSV should return CSV string': async ({pass, fail}) => {
|
|
113
|
-
const { container, control } = await createTableWithControl('
|
|
101
|
+
const { container, control } = await createTableWithControl('kc-tc-export-csv');
|
|
114
102
|
|
|
115
103
|
const csv = control.getCSV();
|
|
116
104
|
|
|
@@ -125,7 +113,7 @@ export default {
|
|
|
125
113
|
},
|
|
126
114
|
|
|
127
115
|
'ExportCSV: CSV should have header row': async ({pass, fail}) => {
|
|
128
|
-
const { container, control } = await createTableWithControl('
|
|
116
|
+
const { container, control } = await createTableWithControl('kc-tc-export-csv');
|
|
129
117
|
|
|
130
118
|
const csv = control.getCSV();
|
|
131
119
|
const lines = csv.split('\n');
|
|
@@ -142,7 +130,7 @@ export default {
|
|
|
142
130
|
},
|
|
143
131
|
|
|
144
132
|
'ExportCSV: CSV should have data rows': async ({pass, fail}) => {
|
|
145
|
-
const { container, control } = await createTableWithControl('
|
|
133
|
+
const { container, control } = await createTableWithControl('kc-tc-export-csv');
|
|
146
134
|
|
|
147
135
|
const csv = control.getCSV();
|
|
148
136
|
const lines = csv.split('\n').filter(l => l.trim());
|
|
@@ -159,7 +147,7 @@ export default {
|
|
|
159
147
|
},
|
|
160
148
|
|
|
161
149
|
'ExportCSV: CSV should contain record data': async ({pass, fail}) => {
|
|
162
|
-
const { container, control } = await createTableWithControl('
|
|
150
|
+
const { container, control } = await createTableWithControl('kc-tc-export-csv');
|
|
163
151
|
|
|
164
152
|
const csv = control.getCSV();
|
|
165
153
|
|
|
@@ -178,7 +166,7 @@ export default {
|
|
|
178
166
|
container.innerHTML = `
|
|
179
167
|
<k-table>
|
|
180
168
|
<div slot="controls">
|
|
181
|
-
<
|
|
169
|
+
<kc-tc-export-csv></kc-tc-export-csv>
|
|
182
170
|
</div>
|
|
183
171
|
</k-table>
|
|
184
172
|
`;
|
|
@@ -194,7 +182,7 @@ export default {
|
|
|
194
182
|
});
|
|
195
183
|
await table.updateComplete;
|
|
196
184
|
|
|
197
|
-
const control = container.querySelector('
|
|
185
|
+
const control = container.querySelector('kc-tc-export-csv');
|
|
198
186
|
await control.updateComplete;
|
|
199
187
|
|
|
200
188
|
const csv = control.getCSV();
|
|
@@ -211,7 +199,7 @@ export default {
|
|
|
211
199
|
},
|
|
212
200
|
|
|
213
201
|
'ExportCSV: should return empty string without table': async ({pass, fail}) => {
|
|
214
|
-
const control = document.createElement('
|
|
202
|
+
const control = document.createElement('kc-tc-export-csv');
|
|
215
203
|
document.body.appendChild(control);
|
|
216
204
|
await control.updateComplete;
|
|
217
205
|
|
|
@@ -231,9 +219,9 @@ export default {
|
|
|
231
219
|
ExportJson Tests
|
|
232
220
|
*/
|
|
233
221
|
'ExportJson: should render export button': async ({pass, fail}) => {
|
|
234
|
-
const { container, control } = await createTableWithControl('
|
|
222
|
+
const { container, control } = await createTableWithControl('kc-tc-export-json');
|
|
235
223
|
|
|
236
|
-
const btn = control
|
|
224
|
+
const btn = control;
|
|
237
225
|
if(!btn){
|
|
238
226
|
cleanup(container);
|
|
239
227
|
fail('ExportJson should render button');
|
|
@@ -251,21 +239,9 @@ export default {
|
|
|
251
239
|
pass('ExportJson renders correctly');
|
|
252
240
|
},
|
|
253
241
|
|
|
254
|
-
'ExportJson: should have default maxWidth of 136': async ({pass, fail}) => {
|
|
255
|
-
const { container, control } = await createTableWithControl('k-tc-export-json');
|
|
256
|
-
|
|
257
|
-
if(control.maxWidth !== 136){
|
|
258
|
-
cleanup(container);
|
|
259
|
-
fail(`Expected maxWidth 136, got ${control.maxWidth}`);
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
cleanup(container);
|
|
264
|
-
pass('ExportJson has default maxWidth of 136');
|
|
265
|
-
},
|
|
266
242
|
|
|
267
243
|
'ExportJson: should have export method': async ({pass, fail}) => {
|
|
268
|
-
const { container, control } = await createTableWithControl('
|
|
244
|
+
const { container, control } = await createTableWithControl('kc-tc-export-json');
|
|
269
245
|
|
|
270
246
|
if(typeof control.export !== 'function'){
|
|
271
247
|
cleanup(container);
|
|
@@ -278,10 +254,10 @@ export default {
|
|
|
278
254
|
},
|
|
279
255
|
|
|
280
256
|
'ExportJson: should display Export JSON text': async ({pass, fail}) => {
|
|
281
|
-
const { container, control } = await createTableWithControl('
|
|
257
|
+
const { container, control } = await createTableWithControl('kc-tc-export-json');
|
|
282
258
|
|
|
283
|
-
const btn = control
|
|
284
|
-
if(!btn.textContent.includes('Export JSON')){
|
|
259
|
+
const btn = control;
|
|
260
|
+
if(!btn.shadowRoot.textContent.includes('Export JSON')){
|
|
285
261
|
cleanup(container);
|
|
286
262
|
fail('Button should display "Export JSON" text');
|
|
287
263
|
return;
|
|
@@ -292,10 +268,10 @@ export default {
|
|
|
292
268
|
},
|
|
293
269
|
|
|
294
270
|
'ExportCSV: should display Export CSV text': async ({pass, fail}) => {
|
|
295
|
-
const { container, control } = await createTableWithControl('
|
|
271
|
+
const { container, control } = await createTableWithControl('kc-tc-export-csv');
|
|
296
272
|
|
|
297
|
-
const btn = control
|
|
298
|
-
if(!btn.textContent.includes('Export CSV')){
|
|
273
|
+
const btn = control;
|
|
274
|
+
if(!btn.shadowRoot.textContent.includes('Export CSV')){
|
|
299
275
|
cleanup(container);
|
|
300
276
|
fail('Button should display "Export CSV" text');
|
|
301
277
|
return;
|