kempo-ui 0.4.20 → 0.4.21
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/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/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/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/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/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/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/{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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"./ButtonControl.js";import{html as e}from"../../lit-all.min.js";import"../Icon.js";export default class i extends t{static hostEvents=["page-change"];connectedCallback(){super.connectedCallback(),this.hasAttribute("title")||(this.title="First Page"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","First Page")}willUpdate(t){super.willUpdate(t);const e=this.host;this.disabled=!e||e.page<=1}handleAction(){const t=this.host;t&&(t.page=1)}render(){return e`<slot><k-icon name="chevron-line" direction="left"></k-icon></slot>`}}customElements.define("kc-pg-first",i);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import t from"./Control.js";import{html as e,css as o}from"../../lit-all.min.js";import"../Combobox.js";export default class s extends t{static hostEvents=["page-change"];handleInput=t=>{const e=this.host;if(e&&t.target.value){const o=parseInt(t.target.value,10);!isNaN(o)&&o>0&&(e.page=o)}};handleBlur=t=>{const e=this.host;e&&(t.target.value=String(e.page))};render(){const t=this.host,o=t?.page??1,s=t?.totalPages??1;return e`
|
|
2
|
+
<k-combobox
|
|
3
|
+
.value=${String(o)}
|
|
4
|
+
@input=${this.handleInput}
|
|
5
|
+
@blur=${this.handleBlur}
|
|
6
|
+
placeholder="page"
|
|
7
|
+
no-results-message="Invalid Page"
|
|
8
|
+
>
|
|
9
|
+
${Array.from({length:s},(t,o)=>e`
|
|
10
|
+
<k-option value=${o+1}>${o+1}</k-option>
|
|
11
|
+
`)}
|
|
12
|
+
</k-combobox>
|
|
13
|
+
`}static styles=[t.styles,o`
|
|
14
|
+
k-combobox { width: 5rem; }
|
|
15
|
+
`]}customElements.define("kc-pg-goto-page",s);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import e from"./Control.js";import{html as t,css as s}from"../../lit-all.min.js";export default class a extends e{static hostEvents=["page-change"];handleChange=e=>{const t=this.host;t&&(t.itemsPerPage=parseInt(e.target.value,10))};render(){const e=this.host,s=e?.itemsPerPage??10,a=e?.pageSizes??[5,10,25,50,100];return t`
|
|
2
|
+
<label>
|
|
3
|
+
<slot>Items per page:</slot>
|
|
4
|
+
<select @change=${this.handleChange}>
|
|
5
|
+
${a.map(e=>t`<option value=${e} ?selected=${e===s}>${e}</option>`)}
|
|
6
|
+
</select>
|
|
7
|
+
</label>
|
|
8
|
+
`}static styles=[e.styles,s`
|
|
9
|
+
:host { align-items: center; }
|
|
10
|
+
label { display: inline-flex; align-items: center; gap: var(--spacer_q, 0.25rem); padding: 0; white-space: nowrap; }
|
|
11
|
+
select { min-height: 2.5rem; box-sizing: border-box; }
|
|
12
|
+
`]}customElements.define("kc-pg-items-per-page",a);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"./ButtonControl.js";import{html as e}from"../../lit-all.min.js";import"../Icon.js";export default class s extends t{static hostEvents=["page-change"];connectedCallback(){super.connectedCallback(),this.hasAttribute("title")||(this.title="Last Page"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Last Page")}willUpdate(t){super.willUpdate(t);const e=this.host;this.disabled=!e||e.page>=e.totalPages}handleAction(){const t=this.host;t&&(t.page=t.totalPages)}render(){return e`<slot><k-icon name="chevron-line"></k-icon></slot>`}}customElements.define("kc-pg-last",s);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"./ButtonControl.js";import{html as e}from"../../lit-all.min.js";import"../Icon.js";export default class s extends t{static hostEvents=["page-change"];connectedCallback(){super.connectedCallback(),this.hasAttribute("title")||(this.title="Next Page"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Next Page")}willUpdate(t){super.willUpdate(t);const e=this.host;this.disabled=!e||e.page>=e.totalPages}handleAction(){this.host?.nextPage()}render(){return e`<slot><k-icon name="chevron"></k-icon></slot>`}}customElements.define("kc-pg-next",s);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import s from"./Control.js";import{html as e,css as t}from"../../lit-all.min.js";export default class a extends s{static hostEvents=["page-change"];render(){const s=this.host;return e`<span class="info">Page ${s?.page??1} of ${s?.totalPages??1}</span>`}static styles=[s.styles,t`
|
|
2
|
+
.info { padding: 0 var(--spacer_q, 0.25rem); white-space: nowrap; }
|
|
3
|
+
`]}customElements.define("kc-pg-page-info",a);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"./ButtonControl.js";import{html as e}from"../../lit-all.min.js";import"../Icon.js";export default class i extends t{static hostEvents=["page-change"];connectedCallback(){super.connectedCallback(),this.hasAttribute("title")||(this.title="Previous Page"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Previous Page")}willUpdate(t){super.willUpdate(t);const e=this.host;this.disabled=!e||e.page<=1}handleAction(){this.host?.previousPage()}render(){return e`<slot><k-icon name="chevron" direction="left"></k-icon></slot>`}}customElements.define("kc-pg-prev",i);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"./ButtonControl.js";import{html as e}from"../../lit-all.min.js";import"../Icon.js";export default class o extends t{static requires=["quote"];static hostMode=["visual","write"];connectedCallback(){super.connectedCallback(),this.hasAttribute("title")||(this.title="Quote")}handleAction(){this.host?.quote?.()}render(){return e`<slot><k-icon name="format_quote"></k-icon></slot>`}}customElements.define("kc-quote",o);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"./ButtonControl.js";import{html as e}from"../../lit-all.min.js";import"../Icon.js";export default class o extends t{static requires=["redo"];connectedCallback(){super.connectedCallback(),this.hasAttribute("title")||(this.title="Redo")}handleAction(){this.host?.redo?.()}render(){return e`<slot><k-icon name="redo"></k-icon></slot>`}}customElements.define("kc-redo",o);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import e from"../ShadowComponent.js";import{html as t,css as s}from"../../lit-all.min.js";export default class l extends e{static styles=s`
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
:host {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
flex: 1;
|
|
5
|
+
}
|
|
6
|
+
`;render(){return t``}}customElements.define("kc-spacer",l);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"./ButtonControl.js";import{html as e}from"../../lit-all.min.js";import"../Icon.js";export default class o extends t{static requires=["strikethrough"];static hostMode=["visual","write"];connectedCallback(){super.connectedCallback(),this.hasAttribute("title")||(this.title="Strikethrough")}handleAction(){this.host?.strikethrough?.()}render(){return e`<slot><k-icon name="strikethrough_s"></k-icon></slot>`}}customElements.define("kc-strikethrough",o);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"./ButtonControl.js";import{html as t}from"../../lit-all.min.js";import"../Icon.js";export default class o extends e{connectedCallback(){super.connectedCallback(),this.hasAttribute("title")||(this.title="Delete Record")}get record(){const e=this.closest(".record");if(e){const t=e.dataset.index;if(void 0!==t)return this.host?.records?.[t]}return null}delete(){this.handleAction()}handleAction(){const e=this.record;e&&this.host?.deleteRecord(e)}render(){return t`<slot><k-icon name="delete"></k-icon></slot>`}}customElements.define("kc-tc-delete-record",o);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"./ButtonControl.js";import{html as t}from"../../lit-all.min.js";import"../Icon.js";export default class l extends e{connectedCallback(){super.connectedCallback(),this.hasAttribute("title")||(this.title="Delete Selected")}handleAction(){this.host?.deleteSelected()}render(){return t`<slot><k-icon name="delete_sweep"></k-icon></slot>`}}customElements.define("kc-tc-delete-selected",l);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import t from"./Control.js";import{html as e,css as i}from"../../lit-all.min.js";import"../Icon.js";export default class n extends t{static hostEvents=["editingChange"];static properties={...t.properties,isEditing:{type:Boolean,state:!0}};constructor(){super(),this.isEditing=!1}get record(){const t=this.closest(".record");if(t){const e=t.dataset.index;if(void 0!==e)return this.host?.records?.[e]}return null}connectedCallback(){super.connectedCallback();const t=this.host;t&&t.addEventListener("editingChange",t=>{t.detail.record===this.record&&(this.isEditing=t.detail.editing)})}handleEdit=()=>{const t=this.record;t&&this.host?.editRecord(t)};handleSave=()=>{const t=this.record;t&&this.host?.saveEditedRecord(t)};handleCancel=()=>{const t=this.record;t&&this.host?.cancelEditedRecord(t)};render(){return this.isEditing?e`
|
|
2
|
+
<button class="edit-btn save" @click=${this.handleSave}><k-icon name="check"></k-icon></button>
|
|
3
|
+
<button class="edit-btn cancel" @click=${this.handleCancel}><k-icon name="close"></k-icon></button>
|
|
4
|
+
`:e`
|
|
5
|
+
<button class="edit-btn" @click=${this.handleEdit}><k-icon name="edit"></k-icon></button>
|
|
6
|
+
`}static styles=[t.styles,i`
|
|
7
|
+
:host { align-items: baseline; gap: 0.25rem; }
|
|
8
|
+
.edit-btn { background: transparent; border: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: var(--radius); }
|
|
9
|
+
.edit-btn:hover { background: oklch(from var(--c_bg__inv) l c h / 0.1); }
|
|
10
|
+
.save { color: var(--c_success, green); }
|
|
11
|
+
.cancel { color: var(--c_danger, red); }
|
|
12
|
+
`]}customElements.define("kc-tc-edit",n);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import t from"./ButtonControl.js";import{html as e,css as o}from"../../lit-all.min.js";import"../Icon.js";export default class r extends t{connectedCallback(){super.connectedCallback(),this.hasAttribute("title")||(this.title="Export CSV")}get record(){const t=this.closest(".record");if(t){const e=t.dataset.index;if(void 0!==e)return this.host?.records?.[e]}return null}getCSV(){const t=this.host;if(!t)return"";const e=[];t.fields.forEach(({name:t,calculator:o})=>{o||e.push(t)});let o=e.join(",")+"\n";const r=this.record;return r?o+=e.map(t=>r[t]||"").join(",")+"\n":t.records.forEach(t=>{o+=e.map(e=>t[e]||"").join(",")+"\n"}),o}export(){this.handleAction()}handleAction(){const t=this.getCSV(),e=new Blob([t],{type:"text/csv"}),o=URL.createObjectURL(e),r=document.createElement("a");r.href=o,r.download="data.csv",r.click(),URL.revokeObjectURL(o)}render(){return e`<slot><k-icon name="export-file"></k-icon> Export CSV</slot>`}static styles=[t.styles,o`
|
|
2
|
+
:host { gap: 0.25rem; padding: 0 var(--spacer_h, 0.5rem); }
|
|
3
|
+
`]}customElements.define("kc-tc-export-csv",r);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import t from"./ButtonControl.js";import{html as e,css as o}from"../../lit-all.min.js";import"../Icon.js";export default class r extends t{connectedCallback(){super.connectedCallback(),this.hasAttribute("title")||(this.title="Export JSON")}get record(){const t=this.closest(".record");if(t){const e=t.dataset.index;if(void 0!==e)return this.host?.records?.[e]}return null}export(){this.handleAction()}handleAction(){const t=this.record,e=t?JSON.stringify(t):JSON.stringify(this.host?.records||[]),o=new Blob([e],{type:"application/json"}),r=URL.createObjectURL(o),s=document.createElement("a");s.href=r,s.download="data.json",s.click(),URL.revokeObjectURL(r)}render(){return e`<slot><k-icon name="export-file"></k-icon> Export JSON</slot>`}static styles=[t.styles,o`
|
|
2
|
+
:host { gap: 0.25rem; padding: 0 var(--spacer_h, 0.5rem); }
|
|
3
|
+
`]}customElements.define("kc-tc-export-json",r);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import e from"./ButtonControl.js";import{html as t,render as i}from"../../lit-all.min.js";import"../Icon.js";import l from"../Dialog.js";export default class o extends e{connectedCallback(){super.connectedCallback(),this.hasAttribute("title")||(this.title="Show / Hide / Order Fields")}openDialog(){this.handleAction()}handleAction(){import("../Sortable.js");const e=this.host;if(!e)return;const o=document.createElement("div");i(t`
|
|
2
|
+
<div class="m">
|
|
3
|
+
<k-sortable id="sorting" @sort=${t=>{const i=Array.from(t.target.querySelectorAll("k-sortable-item")).map(e=>e.getAttribute("data-field"));e.reorderFields(i)}}>
|
|
4
|
+
${e.fields.map(i=>t`
|
|
5
|
+
<k-sortable-item data-field="${i.name}">
|
|
6
|
+
<label class="field pb0">
|
|
7
|
+
<input
|
|
8
|
+
class="field-visibility"
|
|
9
|
+
data-field="${i.name}"
|
|
10
|
+
type="checkbox"
|
|
11
|
+
.checked="${!i.hidden}"
|
|
12
|
+
@change="${t=>e.setFieldHiddenState(i.name,!t.target.checked)}"
|
|
13
|
+
style="height: 1.25rem; width: 1.25rem"
|
|
14
|
+
/>
|
|
15
|
+
${i.label}
|
|
16
|
+
</label>
|
|
17
|
+
</k-sortable-item>
|
|
18
|
+
`)}
|
|
19
|
+
</k-sortable>
|
|
20
|
+
</div>
|
|
21
|
+
`,o),l.create(o,{title:"Show / Hide / Order Fields",width:"400px",cancelText:"Close"})}render(){return t`<slot><k-icon name="table-visibility"></k-icon></slot>`}}customElements.define("kc-tc-field-sort-hide",o);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import t from"./ButtonControl.js";import{html as e,render as l}from"../../lit-all.min.js";import"../Icon.js";import i from"../Dialog.js";const n={equals:"equals","not-equals":"does not equal",contains:"contains","not-contains":"does not contain","greater-than":"is greater than","greater-than-or-equal":"is greater than or equal to","less-than":"is less than","less-than-or-equal":"is less than or equal to"};export default class o extends t{connectedCallback(){super.connectedCallback(),this.hasAttribute("title")||(this.title="Filters")}handleFilter(){this.handleAction()}handleAction(){this.openDialog()}openDialog=()=>{const t=this.host;if(!t)return;const o=document.createElement("div");l(e`
|
|
2
|
+
<div class="p">
|
|
3
|
+
${0===t.filters.length?e`<p>No Current Filters.</p>`:e`
|
|
4
|
+
<h5>Current Filters</h5>
|
|
5
|
+
<ul id="currentFilters">
|
|
6
|
+
${t.filters.map(({field:l,condition:i,value:o})=>e`
|
|
7
|
+
<li data-field="${l}" data-condition="${i}" data-value="${o}">
|
|
8
|
+
${t.getFieldLabel(l)} ${n[i]} "${o}"
|
|
9
|
+
<button class="remove-filter no-btn pq" @click=${()=>{t.removeFilter(l,i,o),s.close(),this.openDialog()}}>
|
|
10
|
+
<k-icon name="close"></k-icon>
|
|
11
|
+
</button>
|
|
12
|
+
</li>
|
|
13
|
+
`)}
|
|
14
|
+
</ul>
|
|
15
|
+
`}
|
|
16
|
+
<hr />
|
|
17
|
+
<h5>Add A Filter</h5>
|
|
18
|
+
<form id="addFilter" @submit=${e=>{e.preventDefault();const l=e.target;t.addFilter(l.filterField.value,l.filterCondition.value,l.filterValue.value),s.close(),this.openDialog()}}>
|
|
19
|
+
<select id="filterField" class="mb">
|
|
20
|
+
${t.fields.map(({name:t,label:l})=>e`<option value="${t}">${l}</option>`)}
|
|
21
|
+
</select>
|
|
22
|
+
<select id="filterCondition" class="mb">
|
|
23
|
+
${Object.entries(n).map(([t,l])=>e`
|
|
24
|
+
<option value="${t}" ?selected="${"contains"===t}">${l}</option>
|
|
25
|
+
`)}
|
|
26
|
+
</select>
|
|
27
|
+
<input id="filterValue" type="text" class="mb" />
|
|
28
|
+
<button type="submit" class="btn primary mb mr">Add Filter</button>
|
|
29
|
+
${0===t.filters.length?"":e`
|
|
30
|
+
<button type="button" class="btn danger mb mr" @click=${()=>{t.removeAllFilters(),s.close()}}>Clear All Filters</button>
|
|
31
|
+
`}
|
|
32
|
+
</form>
|
|
33
|
+
</div>
|
|
34
|
+
`,o);const s=i.create(o,{width:"600px",title:"Filters"})};render(){return e`<slot><k-icon name="filter"></k-icon></slot>`}}customElements.define("kc-tc-filters",o);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"./ButtonControl.js";import{html as e}from"../../lit-all.min.js";import"../Icon.js";export default class s extends t{static hostEvents=["pageChange"];connectedCallback(){super.connectedCallback(),this.hasAttribute("title")||(this.title="First Page")}willUpdate(t){super.willUpdate(t);const e=this.host;this.disabled=!e||1===e.getCurrentPage()}handleAction(){this.host?.firstPage()}render(){return e`<slot><k-icon name="chevron-line" direction="left"></k-icon></slot>`}}customElements.define("kc-tc-first-page",s);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"./Control.js";import{html as e}from"../../lit-all.min.js";export default class d extends t{static hostEvents=["recordHidden","recordShown"];static properties={...t.properties,hiddenCount:{type:Number,state:!0}};constructor(){super(),this.hiddenCount=0}connectedCallback(){super.connectedCallback(),this.updateCount()}willUpdate(t){super.willUpdate?.(t),this.updateCount()}updateHiddenCount(){this.updateCount()}handleHiddenChange(){this.updateCount()}updateCount(){this.hiddenCount=this.host?.getHiddenRecords?.()?.length||0}render(){return e`<div><span>${this.hiddenCount}</span> Hidden Records</div>`}}customElements.define("kc-tc-hidden-count",d);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"./ButtonControl.js";import{html as e}from"../../lit-all.min.js";import"../Icon.js";export default class o extends t{connectedCallback(){super.connectedCallback(),this.hasAttribute("title")||(this.title="Hide Record")}get record(){const t=this.closest(".record");if(t){const e=t.dataset.index;if(void 0!==e)return this.host?.records?.[e]}return null}handleHide(){this.handleAction()}handleAction(){const t=this.record;t&&this.host?.hideRecord(t)}render(){return e`<slot><k-icon name="hide"></k-icon></slot>`}}customElements.define("kc-tc-hide",o);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"./ButtonControl.js";import{html as e}from"../../lit-all.min.js";import"../Icon.js";export default class s extends t{static hostEvents=["pageChange"];connectedCallback(){super.connectedCallback(),this.hasAttribute("title")||(this.title="Last Page")}willUpdate(t){super.willUpdate(t);const e=this.host;this.disabled=!e||e.getCurrentPage()===e.getTotalPages()}handleAction(){this.host?.lastPage()}render(){return e`<slot><k-icon name="chevron-line"></k-icon></slot>`}}customElements.define("kc-tc-last-page",s);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"./ButtonControl.js";import{html as e}from"../../lit-all.min.js";import"../Icon.js";export default class s extends t{static hostEvents=["pageChange"];connectedCallback(){super.connectedCallback(),this.hasAttribute("title")||(this.title="Next Page")}willUpdate(t){super.willUpdate(t);const e=this.host;this.disabled=!e||e.getCurrentPage()===e.getTotalPages()}handleAction(){this.host?.nextPage()}render(){return e`<slot><k-icon name="chevron"></k-icon></slot>`}}customElements.define("kc-tc-next-page",s);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import e from"./Control.js";import{html as t,css as a}from"../../lit-all.min.js";export default class s extends e{static hostEvents=["pageChange","pageSizeChange","pageCountChanged","recordsSet"];handleSelectChange=e=>{this.host?.setPage(parseInt(e.target.value))};render(){const e=this.host,a=e?.getCurrentPage?.()??1,s=e?.getTotalPages?.()??1,l=[];for(let e=1;e<=s;e++)l.push(t`<option value="${e}" ?selected="${e===a}">Page ${e}</option>`);return t`
|
|
2
|
+
<div class="page-select">
|
|
3
|
+
<select @change=${this.handleSelectChange} ?disabled=${s<=1}>${l}</select>
|
|
4
|
+
<label> out of ${s}</label>
|
|
5
|
+
</div>
|
|
6
|
+
`}static styles=[e.styles,a`
|
|
7
|
+
.page-select { display: flex; align-items: center; gap: 0.25rem; white-space: nowrap; }
|
|
8
|
+
label { padding: 0; margin: 0; }
|
|
9
|
+
`]}customElements.define("kc-tc-page-select",s);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import e from"./Control.js";import{html as t}from"../../lit-all.min.js";export default class a extends e{static hostEvents=["pageChange","pageSizeChange"];handleChange=e=>{this.host?.setPageSize(parseInt(e.target.value))};render(){const e=this.host,a=e?.getPageSize?.()??10,s=e?.pageSizeOptions??[10,25,50,100,500];return t`
|
|
2
|
+
<select @change=${this.handleChange}>
|
|
3
|
+
${s.map(e=>t`<option value="${e}" ?selected="${e===a}">${e} per page</option>`)}
|
|
4
|
+
</select>
|
|
5
|
+
`}}customElements.define("kc-tc-page-size",a);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"./ButtonControl.js";import{html as e}from"../../lit-all.min.js";import"../Icon.js";export default class s extends t{static hostEvents=["pageChange"];connectedCallback(){super.connectedCallback(),this.hasAttribute("title")||(this.title="Previous Page")}willUpdate(t){super.willUpdate(t);const e=this.host;this.disabled=!e||1===e.getCurrentPage()}handleAction(){this.host?.prevPage()}render(){return e`<slot><k-icon name="chevron" direction="left"></k-icon></slot>`}}customElements.define("kc-tc-prev-page",s);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"./Control.js";import{html as r}from"../../lit-all.min.js";import t from"../../utils/debounce.js";export default class s extends e{static properties={...e.properties,searchTerm:{type:String,state:!0}};constructor(){super(),this.searchTerm="",this.debouncedSearch=t(()=>this.performSearch(),200)}handleInput=e=>{this.searchTerm=e.target.value,this.debouncedSearch()};performSearch(){const e=this.host;e&&(!this.searchTerm||this.searchTerm.length<3?e.showAllRecords():e.search(this.searchTerm))}render(){return r`<input type="search" placeholder="Search" .value=${this.searchTerm||""} @input=${this.handleInput} />`}}customElements.define("kc-tc-search",s);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"./ButtonControl.js";import{html as o}from"../../lit-all.min.js";import"../Icon.js";export default class l extends t{connectedCallback(){super.connectedCallback(),this.hasAttribute("title")||(this.title="Show All Records")}handleShowAll(){this.handleAction()}handleAction(){this.host?.showAllRecords()}render(){return o`<slot><k-icon name="show"></k-icon></slot>`}}customElements.define("kc-tc-show-all",l);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import o from"./Control.js";import{html as e,css as r}from"../../lit-all.min.js";import"../Dropdown.js";import"../Icon.js";export default class t extends o{static requires=["setTextBackgroundColor"];static hostMode="visual";static properties={...o.properties,colors:{type:String},disableRemove:{type:Boolean,attribute:"disable-remove"},disablePicker:{type:Boolean,attribute:"disable-picker"}};constructor(){super(),this.colors="#ffff00,#00ffff,#ff66ff,#99ff99,#ffcc99,#ff9999,#cccccc,#ffffff,#ffffcc,#ccffff,#ffccff,#ccffcc",this.disableRemove=!1,this.disablePicker=!1}get opened(){return this.shadowRoot?.querySelector("k-dropdown")?.opened??!1}set opened(o){const e=this.shadowRoot?.querySelector("k-dropdown");e&&(e.opened=o)}handleRemove=()=>{this.host?.removeTextBackgroundColor?.(),this.shadowRoot.querySelector("k-dropdown")?.close()};handleSwatch=o=>{const e=o.target.style.backgroundColor;if(!e)return;const r=e.match(/\d+/g),t=r?"#"+r.map(o=>parseInt(o).toString(16).padStart(2,"0")).join(""):e;this.host?.setTextBackgroundColor?.(t),this.shadowRoot.querySelector("k-dropdown")?.close()};handlePicker=o=>{this.host?.setTextBackgroundColor?.(o.target.value),this.shadowRoot.querySelector("k-dropdown")?.close()};render(){const o=this.colors.split(",").map(o=>o.trim()).filter(Boolean);return e`
|
|
2
|
+
<k-dropdown>
|
|
3
|
+
<button slot="trigger" class="trigger" title="Highlight Color">
|
|
4
|
+
<k-icon name="format_color_fill"></k-icon>
|
|
5
|
+
</button>
|
|
6
|
+
<div class="content">
|
|
7
|
+
${this.disableRemove?"":e`<button class="remove" @click=${this.handleRemove}>Remove Color</button>`}
|
|
8
|
+
<div class="swatches">
|
|
9
|
+
${o.map(o=>e`<button class="swatch" style="background-color:${o}" @click=${this.handleSwatch}></button>`)}
|
|
10
|
+
</div>
|
|
11
|
+
${this.disablePicker?"":e`
|
|
12
|
+
<div class="picker"><label>Custom:</label><input type="color" @input=${this.handlePicker} /></div>
|
|
13
|
+
`}
|
|
14
|
+
</div>
|
|
15
|
+
</k-dropdown>
|
|
16
|
+
`}static styles=[o.styles,r`
|
|
17
|
+
:host { border: 1px solid var(--c_border); border-radius: var(--radius); margin: var(--spacer_q); }
|
|
18
|
+
.trigger { min-width: 2.5rem; min-height: 2.5rem; background: transparent; border: none; cursor: pointer; }
|
|
19
|
+
.content { padding: 8px; min-width: 200px; }
|
|
20
|
+
.remove { width: 100%; padding: 8px; margin-bottom: 8px; border: 1px solid var(--c_border); background: transparent; cursor: pointer; border-radius: var(--radius); }
|
|
21
|
+
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
|
|
22
|
+
.swatch { width: 32px; height: 32px; border: 1px solid var(--c_border); cursor: pointer; border-radius: 4px; }
|
|
23
|
+
.swatch:hover { box-shadow: 0 0 4px rgba(0,122,204,0.3); }
|
|
24
|
+
.picker { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
|
|
25
|
+
.picker input { flex: 1; height: 32px; border: 1px solid var(--c_border); border-radius: 4px; cursor: pointer; }
|
|
26
|
+
`]}customElements.define("kc-text-background-color",t);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import e from"./Control.js";import{html as o,css as t}from"../../lit-all.min.js";import"../Dropdown.js";import"../Icon.js";export default class r extends e{static requires=["setTextColor"];static hostMode="visual";static properties={...e.properties,colors:{type:String},disableRemove:{type:Boolean,attribute:"disable-remove"},disablePicker:{type:Boolean,attribute:"disable-picker"}};constructor(){super(),this.colors="#000000,#e60000,#ff9900,#ffff00,#008a00,#0066cc,#9933ff,#ffffff,#facccc,#ffebcc,#ffffcc,#cce8cc,#cce0f5,#ebd6ff",this.disableRemove=!1,this.disablePicker=!1}get opened(){return this.shadowRoot?.querySelector("k-dropdown")?.opened??!1}set opened(e){const o=this.shadowRoot?.querySelector("k-dropdown");o&&(o.opened=e)}handleRemove=()=>{this.host?.removeTextColor?.(),this.shadowRoot.querySelector("k-dropdown")?.close()};handleSwatch=e=>{const o=e.target.style.backgroundColor;if(!o)return;const t=o.match(/\d+/g),r=t?"#"+t.map(e=>parseInt(e).toString(16).padStart(2,"0")).join(""):o;this.host?.setTextColor?.(r),this.shadowRoot.querySelector("k-dropdown")?.close()};handlePicker=e=>{this.host?.setTextColor?.(e.target.value),this.shadowRoot.querySelector("k-dropdown")?.close()};render(){const e=this.colors.split(",").map(e=>e.trim()).filter(Boolean);return o`
|
|
2
|
+
<k-dropdown>
|
|
3
|
+
<button slot="trigger" class="trigger" title="Text Color">
|
|
4
|
+
<k-icon name="format_color_text"></k-icon>
|
|
5
|
+
</button>
|
|
6
|
+
<div class="content">
|
|
7
|
+
${this.disableRemove?"":o`<button class="remove" @click=${this.handleRemove}>Remove Color</button>`}
|
|
8
|
+
<div class="swatches">
|
|
9
|
+
${e.map(e=>o`<button class="swatch" style="background-color:${e}" @click=${this.handleSwatch}></button>`)}
|
|
10
|
+
</div>
|
|
11
|
+
${this.disablePicker?"":o`
|
|
12
|
+
<div class="picker"><label>Custom:</label><input type="color" @input=${this.handlePicker} /></div>
|
|
13
|
+
`}
|
|
14
|
+
</div>
|
|
15
|
+
</k-dropdown>
|
|
16
|
+
`}static styles=[e.styles,t`
|
|
17
|
+
:host { border: 1px solid var(--c_border); border-radius: var(--radius); margin: var(--spacer_q); }
|
|
18
|
+
.trigger { min-width: 2.5rem; min-height: 2.5rem; background: transparent; border: none; cursor: pointer; }
|
|
19
|
+
.content { padding: 8px; min-width: 200px; }
|
|
20
|
+
.remove { width: 100%; padding: 8px; margin-bottom: 8px; border: 1px solid var(--c_border); background: transparent; cursor: pointer; border-radius: var(--radius); }
|
|
21
|
+
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
|
|
22
|
+
.swatch { width: 32px; height: 32px; border: 1px solid var(--c_border); cursor: pointer; border-radius: 4px; }
|
|
23
|
+
.swatch:hover { box-shadow: 0 0 4px rgba(0,122,204,0.3); }
|
|
24
|
+
.picker { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
|
|
25
|
+
.picker input { flex: 1; height: 32px; border: 1px solid var(--c_border); border-radius: 4px; cursor: pointer; }
|
|
26
|
+
`]}customElements.define("kc-text-color",r);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"./ButtonControl.js";import{html as e}from"../../lit-all.min.js";import"../Icon.js";export default class n extends t{static requires=["underline"];static hostMode="visual";connectedCallback(){super.connectedCallback(),this.hasAttribute("title")||(this.title="Underline")}handleAction(){this.host?.underline?.()}render(){return e`<slot><k-icon name="format_underlined"></k-icon></slot>`}}customElements.define("kc-underline",n);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"./ButtonControl.js";import{html as o}from"../../lit-all.min.js";import"../Icon.js";export default class e extends t{static requires=["undo"];connectedCallback(){super.connectedCallback(),this.hasAttribute("title")||(this.title="Undo")}handleAction(){this.host?.undo?.()}render(){return o`<slot><k-icon name="undo"></k-icon></slot>`}}customElements.define("kc-undo",e);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import t from"./Control.js";import{html as e,css as s}from"../../lit-all.min.js";export default class n extends t{static hostEvents=["change","ready"];static properties={...t.properties,count:{type:Number,state:!0}};constructor(){super(),this.count=0}connectedCallback(){super.connectedCallback(),setTimeout(()=>this.updateCount(),0)}willUpdate(t){super.willUpdate?.(t),this.updateCount()}updateCount(){const t=this.host;if(!t||"function"!=typeof t.getValue)return;const e=t.getValue()||"",s=e.includes("<")?(new DOMParser).parseFromString(e,"text/html").body.innerText||"":e;this.count=s.trim().split(/\s+/).filter(t=>t.length>0).length}render(){return e`<span class="word-count"><slot name="label">Words:</slot> ${this.count}</span>`}static styles=[t.styles,s`
|
|
2
|
+
:host { align-items: center; padding: 0 0.5rem; font-size: 0.875rem; color: var(--tc_muted, #666); }
|
|
3
|
+
.word-count { display: flex; align-items: center; gap: 0.25rem; }
|
|
4
|
+
`]}customElements.define("kc-word-count",n);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"./ButtonControl.js";import{html as e,css as o}from"../../lit-all.min.js";import"../Icon.js";export default class s extends t{static requires=["toggleWordWrap"];static hostMode="code";static hostEvents=["word-wrap-changed"];static properties={...t.properties,active:{type:Boolean,reflect:!0}};constructor(){super(),this.active=!0}connectedCallback(){super.connectedCallback(),this.hasAttribute("title")||(this.title="Toggle Word Wrap"),this.host&&(this.active=!1!==this.host.wordWrap)}willUpdate(t){super.willUpdate?.(t),this.host&&(this.active=!1!==this.host.wordWrap)}handleAction(){this.host?.toggleWordWrap?.()}render(){return e`<slot><k-icon name="wrap_text"></k-icon></slot>`}}customElements.define("kc-word-wrap",s);
|
|
@@ -505,7 +505,8 @@
|
|
|
505
505
|
<a href="#controlsExample">Built-in Controls</a><br />
|
|
506
506
|
<a href="#customControls">Custom Controls</a><br />
|
|
507
507
|
<a href="#height">Setting Height</a><br />
|
|
508
|
-
<a href="#
|
|
508
|
+
<a href="#formIntegration">Form Integration</a><br />
|
|
509
|
+
<a href="#disabled">Disabled</a><br />
|
|
509
510
|
<a href="#jsApi">JavaScript API</a><br />
|
|
510
511
|
|
|
511
512
|
<h6 class="mt"><a href="#jsRef" class="no-link">JavaScript Reference</a></h6>
|
|
@@ -562,7 +563,7 @@ console.log(sorted);"></k-code-editor>
|
|
|
562
563
|
<div class="row -mx">
|
|
563
564
|
<div class="col m-span-12 px">
|
|
564
565
|
<k-card label="HTML">
|
|
565
|
-
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-code-editor</span> <span class="hljs-attr">language</span>=<span class="hljs-string">'html'</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">
|
|
566
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-code-editor</span> <span class="hljs-attr">language</span>=<span class="hljs-string">'html'</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">kc-format-code</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">'toolbar-top-left'</span>></span><span class="hljs-tag"></<span class="hljs-name">kc-format-code</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">kc-copy-code</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">'toolbar-top-left'</span>></span><span class="hljs-tag"></<span class="hljs-name">kc-copy-code</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">kc-editor-theme</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">'toolbar-top-right'</span>></span><span class="hljs-tag"></<span class="hljs-name">kc-editor-theme</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">kc-fullscreen</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">'toolbar-top-right'</span>></span><span class="hljs-tag"></<span class="hljs-name">kc-fullscreen</span>></span><br><span class="hljs-tag"></<span class="hljs-name">k-code-editor</span>></span></code></pre>
|
|
566
567
|
</k-card>
|
|
567
568
|
</div>
|
|
568
569
|
<div class="col m-span-12 px">
|
|
@@ -571,10 +572,10 @@ console.log(sorted);"></k-code-editor>
|
|
|
571
572
|
<h1>Hello World</h1>
|
|
572
573
|
<p>This is a paragraph.</p>
|
|
573
574
|
</div>">
|
|
574
|
-
<
|
|
575
|
-
<
|
|
576
|
-
<
|
|
577
|
-
<
|
|
575
|
+
<kc-format-code slot="toolbar-top-left"></kc-format-code>
|
|
576
|
+
<kc-copy-code slot="toolbar-top-left"></kc-copy-code>
|
|
577
|
+
<kc-editor-theme slot="toolbar-top-right"></kc-editor-theme>
|
|
578
|
+
<kc-fullscreen slot="toolbar-top-right"></kc-fullscreen>
|
|
578
579
|
</k-code-editor>
|
|
579
580
|
</k-card>
|
|
580
581
|
</div>
|
|
@@ -597,12 +598,38 @@ console.log(x);"></k-code-editor>
|
|
|
597
598
|
</div>
|
|
598
599
|
</div>
|
|
599
600
|
|
|
600
|
-
<h3 id="
|
|
601
|
-
<p>The
|
|
601
|
+
<h3 id="formIntegration"><a href="#formIntegration" class="no-link">Form Integration</a></h3>
|
|
602
|
+
<p>The code editor supports form association. Add a <code>name</code> attribute so the value is submitted with the form, and use <code>required</code> to enforce validation:</p>
|
|
602
603
|
<div class="row -mx">
|
|
603
604
|
<div class="col m-span-12 px">
|
|
604
605
|
<k-card label="HTML">
|
|
605
|
-
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-code-editor</span> <span class="hljs-attr">
|
|
606
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">form</span> <span class="hljs-attr">id</span>=<span class="hljs-string">'codeForm'</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">k-code-editor</span> <span class="hljs-attr">name</span>=<span class="hljs-string">'code'</span> <span class="hljs-attr">language</span>=<span class="hljs-string">'javascript'</span> <span class="hljs-attr">required</span> <span class="hljs-attr">class</span>=<span class="hljs-string">'b r'</span>></span><span class="hljs-tag"></<span class="hljs-name">k-code-editor</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">type</span>=<span class="hljs-string">'submit'</span> <span class="hljs-attr">class</span>=<span class="hljs-string">'btn mt'</span>></span>Submit<span class="hljs-tag"></<span class="hljs-name">button</span>></span><br><span class="hljs-tag"></<span class="hljs-name">form</span>></span><br><span class="hljs-tag"><<span class="hljs-name">pre</span> <span class="hljs-attr">id</span>=<span class="hljs-string">'formOutput'</span>></span><span class="hljs-tag"></<span class="hljs-name">pre</span>></span><br><span class="hljs-tag"><<span class="hljs-name">script</span>></span><span class="language-javascript"><br> <span class="hljs-variable language_">document</span>.<span class="hljs-title function_">getElementById</span>(<span class="hljs-string">'codeForm'</span>).<span class="hljs-title function_">addEventListener</span>(<span class="hljs-string">'submit'</span>, <span class="hljs-function"><span class="hljs-params">e</span> =></span> {<br> e.<span class="hljs-title function_">preventDefault</span>();<br> <span class="hljs-keyword">const</span> data = <span class="hljs-keyword">new</span> <span class="hljs-title class_">FormData</span>(e.<span class="hljs-property">target</span>);<br> <span class="hljs-variable language_">document</span>.<span class="hljs-title function_">getElementById</span>(<span class="hljs-string">'formOutput'</span>).<span class="hljs-property">textContent</span> = data.<span class="hljs-title function_">get</span>(<span class="hljs-string">'code'</span>);<br> });<br></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span></code></pre>
|
|
607
|
+
</k-card>
|
|
608
|
+
</div>
|
|
609
|
+
<div class="col m-span-12 px">
|
|
610
|
+
<k-card label="Output">
|
|
611
|
+
<form id="codeForm">
|
|
612
|
+
<k-code-editor name="code" language="javascript" required class="b r" style="height: 200px" value="console.log('hello');"></k-code-editor>
|
|
613
|
+
<button type="submit" class="btn mt">Submit</button>
|
|
614
|
+
</form>
|
|
615
|
+
<pre id="formOutput" class="mt b r p" style="min-height: 2rem;"></pre>
|
|
616
|
+
<script>
|
|
617
|
+
document.getElementById('codeForm').addEventListener('submit', e => {
|
|
618
|
+
e.preventDefault();
|
|
619
|
+
const data = new FormData(e.target);
|
|
620
|
+
document.getElementById('formOutput').textContent = data.get('code');
|
|
621
|
+
});
|
|
622
|
+
</script>
|
|
623
|
+
</k-card>
|
|
624
|
+
</div>
|
|
625
|
+
</div>
|
|
626
|
+
|
|
627
|
+
<h3 id="disabled"><a href="#disabled" class="no-link">Disabled</a></h3>
|
|
628
|
+
<p>The <code>disabled</code> attribute makes the editor non-interactive (Monaco is set to <code>readOnly</code>), mutes the toolbar, fades the host, and excludes the field from form submission.</p>
|
|
629
|
+
<div class="row -mx">
|
|
630
|
+
<div class="col m-span-12 px">
|
|
631
|
+
<k-card label="HTML">
|
|
632
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-code-editor</span> <span class="hljs-attr">disabled</span> <span class="hljs-attr">value</span>=<span class="hljs-string">"..."</span>></span><span class="hljs-tag"></<span class="hljs-name">k-code-editor</span>></span></code></pre>
|
|
606
633
|
</k-card>
|
|
607
634
|
</div>
|
|
608
635
|
<div class="col m-span-12 px">
|
|
@@ -610,18 +637,9 @@ console.log(x);"></k-code-editor>
|
|
|
610
637
|
<k-code-editor
|
|
611
638
|
disabled
|
|
612
639
|
language="javascript"
|
|
613
|
-
class="b r mb"
|
|
614
|
-
style="height: 160px"
|
|
615
|
-
value="// This editor is disabled — toolbar is muted, content is locked.
|
|
616
|
-
const x = 42;
|
|
617
|
-
console.log(x);"
|
|
618
|
-
></k-code-editor>
|
|
619
|
-
<k-code-editor
|
|
620
|
-
readonly
|
|
621
|
-
language="javascript"
|
|
622
640
|
class="b r"
|
|
623
641
|
style="height: 160px"
|
|
624
|
-
value="// This editor is
|
|
642
|
+
value="// This editor is disabled — toolbar is muted, content is locked.
|
|
625
643
|
const x = 42;
|
|
626
644
|
console.log(x);"
|
|
627
645
|
></k-code-editor>
|
|
@@ -657,7 +675,6 @@ console.log(x);"
|
|
|
657
675
|
<tr><td><code>monacoSrc</code></td><td><code>monaco-src</code></td><td>String</td><td><code>''</code></td><td>Custom Monaco CDN base URL</td></tr>
|
|
658
676
|
<tr><td><code>editorTheme</code></td><td><code>editor-theme</code></td><td>String</td><td><code>'auto'</code></td><td>Theme override: <code>'auto'</code> (matches site theme), <code>'light'</code>, or <code>'dark'</code></td></tr>
|
|
659
677
|
<tr><td><code>disabled</code></td><td><code>disabled</code></td><td>Boolean</td><td><code>false</code></td><td>Editor is non-interactive (Monaco set to <code>readOnly</code>), toolbar is muted, host fades, and the field is excluded from form submission</td></tr>
|
|
660
|
-
<tr><td><code>readonly</code></td><td><code>readonly</code></td><td>Boolean</td><td><code>false</code></td><td>User can select and copy text but not edit (Monaco set to <code>readOnly</code>); value still submitted with the form</td></tr>
|
|
661
678
|
<tr><td><code>required</code></td><td><code>required</code></td><td>Boolean</td><td><code>false</code></td><td>When <code>true</code> and the editor is empty, the element reports a <code>valueMissing</code> validity error</td></tr>
|
|
662
679
|
</tbody>
|
|
663
680
|
</table>
|
|
@@ -729,38 +746,42 @@ console.log(x);"
|
|
|
729
746
|
<tr><th>Element</th><th>Description</th></tr>
|
|
730
747
|
</thead>
|
|
731
748
|
<tbody>
|
|
732
|
-
<tr><td><code><
|
|
733
|
-
<tr><td><code><
|
|
734
|
-
<tr><td><code><
|
|
735
|
-
<tr><td><code><
|
|
736
|
-
<tr><td><code><
|
|
737
|
-
<tr><td><code><
|
|
738
|
-
<tr><td><code><
|
|
739
|
-
<tr><td><code><
|
|
740
|
-
<tr><td><code><
|
|
741
|
-
<tr><td><code><
|
|
742
|
-
<tr><td><code><
|
|
743
|
-
<tr><td><code><
|
|
744
|
-
<tr><td><code><
|
|
745
|
-
<tr><td><code><
|
|
749
|
+
<tr><td><code><kc-format-code></code></td><td>Formats the code using Monaco's built-in formatter</td></tr>
|
|
750
|
+
<tr><td><code><kc-copy-code></code></td><td>Copies the editor content to the clipboard</td></tr>
|
|
751
|
+
<tr><td><code><kc-undo></code></td><td>Undoes the last edit</td></tr>
|
|
752
|
+
<tr><td><code><kc-redo></code></td><td>Redoes the last undone edit</td></tr>
|
|
753
|
+
<tr><td><code><kc-word-wrap></code></td><td>Toggles word wrapping on/off</td></tr>
|
|
754
|
+
<tr><td><code><kc-minimap></code></td><td>Toggles the minimap on/off</td></tr>
|
|
755
|
+
<tr><td><code><kc-find-replace></code></td><td>Opens Monaco's Find & Replace dialog</td></tr>
|
|
756
|
+
<tr><td><code><kc-font-size></code></td><td>Container for increase/decrease font size buttons</td></tr>
|
|
757
|
+
<tr><td><code><kc-font-size-decrease></code></td><td>Decreases the editor font size</td></tr>
|
|
758
|
+
<tr><td><code><kc-font-size-increase></code></td><td>Increases the editor font size</td></tr>
|
|
759
|
+
<tr><td><code><kc-fold-all></code></td><td>Toggles fold/unfold all code regions</td></tr>
|
|
760
|
+
<tr><td><code><kc-fullscreen></code></td><td>Toggles the editor in and out of fullscreen — visible in all modes</td></tr>
|
|
761
|
+
<tr><td><code><kc-language></code></td><td>Select dropdown to change the syntax language</td></tr>
|
|
762
|
+
<tr><td><code><kc-editor-theme></code></td><td>Select dropdown to switch between auto, light, and dark editor themes</td></tr>
|
|
763
|
+
<tr><td><code><k-control-group></code></td><td>Groups controls visually with shared borders</td></tr>
|
|
764
|
+
<tr><td><code><kc-spacer></code></td><td>Flexible spacer to push controls apart</td></tr>
|
|
746
765
|
</tbody>
|
|
747
766
|
</table>
|
|
748
767
|
|
|
749
768
|
<script type="module" src="../src/components/CodeEditor.js"></script>
|
|
750
|
-
<script type="module" src="../src/components/
|
|
751
|
-
<script type="module" src="../src/components/
|
|
752
|
-
<script type="module" src="../src/components/
|
|
753
|
-
<script type="module" src="../src/components/
|
|
754
|
-
<script type="module" src="../src/components/
|
|
755
|
-
<script type="module" src="../src/components/
|
|
756
|
-
<script type="module" src="../src/components/
|
|
757
|
-
<script type="module" src="../src/components/
|
|
758
|
-
<script type="module" src="../src/components/
|
|
759
|
-
<script type="module" src="../src/components/
|
|
760
|
-
<script type="module" src="../src/components/
|
|
761
|
-
<script type="module" src="../src/components/
|
|
762
|
-
<script type="module" src="../src/components/
|
|
763
|
-
<script type="module" src="../src/components/
|
|
769
|
+
<script type="module" src="../src/components/controls/FormatCode.js"></script>
|
|
770
|
+
<script type="module" src="../src/components/controls/CopyCode.js"></script>
|
|
771
|
+
<script type="module" src="../src/components/controls/EditorTheme.js"></script>
|
|
772
|
+
<script type="module" src="../src/components/controls/Undo.js"></script>
|
|
773
|
+
<script type="module" src="../src/components/controls/Redo.js"></script>
|
|
774
|
+
<script type="module" src="../src/components/controls/WordWrap.js"></script>
|
|
775
|
+
<script type="module" src="../src/components/controls/Minimap.js"></script>
|
|
776
|
+
<script type="module" src="../src/components/controls/FindReplace.js"></script>
|
|
777
|
+
<script type="module" src="../src/components/controls/FontSize.js"></script>
|
|
778
|
+
<script type="module" src="../src/components/controls/FontSizeDecrease.js"></script>
|
|
779
|
+
<script type="module" src="../src/components/controls/FontSizeIncrease.js"></script>
|
|
780
|
+
<script type="module" src="../src/components/controls/FoldAll.js"></script>
|
|
781
|
+
<script type="module" src="../src/components/controls/Language.js"></script>
|
|
782
|
+
<script type="module" src="../src/components/controls/Fullscreen.js"></script>
|
|
783
|
+
<script type="module" src="../src/components/ControlGroup.js"></script>
|
|
784
|
+
<script type="module" src="../src/components/controls/Spacer.js"></script>
|
|
764
785
|
<script type="module" src="../src/components/Accordion.js"></script>
|
|
765
786
|
<script type="module" src="../src/components/Card.js"></script>
|
|
766
787
|
|