@uzum-tech/ui 2.3.8 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +63596 -32483
- package/dist/index.mjs +64978 -33874
- package/dist/index.prod.js +3 -3
- package/dist/index.prod.mjs +3 -3
- package/es/_internal/icons/Bold.d.ts +2 -0
- package/es/_internal/icons/Bold.mjs +29 -0
- package/es/_internal/icons/BulletList.d.ts +2 -0
- package/es/_internal/icons/BulletList.mjs +23 -0
- package/es/_internal/icons/HorizontalRule.d.ts +2 -0
- package/es/_internal/icons/HorizontalRule.mjs +14 -0
- package/es/_internal/icons/Italic.d.ts +2 -0
- package/es/_internal/icons/Italic.mjs +19 -0
- package/es/_internal/icons/NumberedList.d.ts +2 -0
- package/es/_internal/icons/NumberedList.mjs +23 -0
- package/es/_internal/icons/Quote.d.ts +2 -0
- package/es/_internal/icons/Quote.mjs +23 -0
- package/es/_internal/icons/SettingsLine.d.ts +2 -0
- package/es/_internal/icons/SettingsLine.mjs +19 -0
- package/es/_internal/icons/Strikethrough.d.ts +2 -0
- package/es/_internal/icons/Strikethrough.mjs +14 -0
- package/es/_internal/icons/index.d.ts +8 -0
- package/es/_internal/icons/index.mjs +8 -0
- package/es/_styles/markdown/markdown-content.cssr.d.ts +6 -0
- package/es/_styles/markdown/markdown-content.cssr.mjs +22 -0
- package/es/_utils/markdown/index.d.ts +3 -2
- package/es/_utils/markdown/index.mjs +2 -1
- package/es/_utils/markdown/render-markdown.d.ts +2 -1
- package/es/_utils/markdown/render-markdown.mjs +1 -1
- package/es/chat/src/Chat.d.ts +261 -24
- package/es/chat/src/Chat.mjs +2 -0
- package/es/chat/src/ChatMainArea.d.ts +81 -8
- package/es/chat/src/ChatMainArea.mjs +111 -355
- package/es/chat/src/ChatParts/ChatAttachmentButton/ChatAttachmentButton.d.ts +9084 -0
- package/es/chat/src/ChatParts/ChatAttachmentButton/ChatAttachmentButton.mjs +70 -0
- package/es/chat/src/ChatParts/ChatAttachmentButton/interface.d.ts +2645 -0
- package/es/chat/src/ChatParts/ChatAttachmentButton/interface.mjs +19 -0
- package/es/chat/src/ChatParts/ChatEditingBlock/ChatEditingBlock.d.ts +9070 -0
- package/es/chat/src/ChatParts/ChatEditingBlock/ChatEditingBlock.mjs +78 -0
- package/es/chat/src/ChatParts/ChatEditingBlock/interface.d.ts +2637 -0
- package/es/chat/src/ChatParts/ChatEditingBlock/interface.mjs +15 -0
- package/es/chat/src/ChatParts/ChatEditorInput/ChatEditorInput.d.ts +89 -0
- package/es/chat/src/ChatParts/ChatEditorInput/ChatEditorInput.mjs +63 -0
- package/es/chat/src/ChatParts/ChatEditorInput/interface.d.ts +42 -0
- package/es/chat/src/ChatParts/ChatEditorInput/interface.mjs +34 -0
- package/es/chat/src/ChatParts/ChatFooter/ChatFooter.d.ts +115 -0
- package/es/chat/src/ChatParts/ChatFooter/ChatFooter.mjs +99 -0
- package/es/chat/src/ChatParts/ChatFooter/interface.d.ts +56 -0
- package/es/chat/src/ChatParts/ChatFooter/interface.mjs +46 -0
- package/es/chat/src/ChatParts/ChatHeader/ChatHeader.d.ts +9205 -0
- package/es/chat/src/ChatParts/ChatHeader/ChatHeader.mjs +219 -0
- package/es/chat/src/ChatParts/ChatHeader/interface.d.ts +2694 -0
- package/es/chat/src/ChatParts/ChatHeader/interface.mjs +67 -0
- package/es/chat/src/ChatParts/ChatLegacyInput/ChatLegacyInput.d.ts +9142 -0
- package/es/chat/src/ChatParts/ChatLegacyInput/ChatLegacyInput.mjs +130 -0
- package/es/chat/src/ChatParts/ChatLegacyInput/interface.d.ts +2654 -0
- package/es/chat/src/ChatParts/ChatLegacyInput/interface.mjs +27 -0
- package/es/chat/src/ChatParts/ChatMessagesArea/ChatMessagesArea.d.ts +148 -0
- package/es/chat/src/ChatParts/ChatMessagesArea/ChatMessagesArea.mjs +92 -0
- package/es/chat/src/ChatParts/ChatMessagesArea/interface.d.ts +72 -0
- package/es/chat/src/ChatParts/ChatMessagesArea/interface.mjs +58 -0
- package/es/chat/src/interface.d.ts +7 -0
- package/es/chat/src/interface.mjs +4 -0
- package/es/chat/src/styles/index.cssr.mjs +11 -12
- package/es/chat/styles/light.d.ts +4 -0
- package/es/chat/styles/light.mjs +20 -1
- package/es/components.d.ts +13087 -103
- package/es/components.mjs +5 -0
- package/es/config-provider/src/ConfigProvider.mjs +6 -2
- package/es/config-provider/src/internal-interface.d.ts +2 -0
- package/es/data-table/index.d.ts +1 -1
- package/es/data-table/src/ColumnSettings/ColumnSettingsDrawer.d.ts +156 -0
- package/es/data-table/src/ColumnSettings/ColumnSettingsDrawer.mjs +220 -0
- package/es/data-table/src/ColumnSettings/styles.cssr.d.ts +2 -0
- package/es/data-table/src/ColumnSettings/styles.cssr.mjs +25 -0
- package/es/data-table/src/DataTable.d.ts +60 -2
- package/es/data-table/src/DataTable.mjs +99 -23
- package/es/data-table/src/HeaderButton/FilterMenu.d.ts +14 -0
- package/es/data-table/src/interface.d.ts +53 -1
- package/es/data-table/src/interface.mjs +18 -1
- package/es/data-table/src/styles/index.cssr.mjs +17 -1
- package/es/data-table/src/use-column-settings.d.ts +2 -0
- package/es/data-table/src/use-column-settings.mjs +124 -0
- package/es/data-table/src/utils/column-utils.d.ts +2 -1
- package/es/data-table/src/utils/column-utils.mjs +6 -0
- package/es/editor/index.d.ts +10 -0
- package/es/editor/index.mjs +5 -0
- package/es/editor/src/Editor.d.ts +3922 -0
- package/es/editor/src/Editor.mjs +230 -0
- package/es/editor/src/EditorParts/BlockTypeSelect/BlockTypeSelect.d.ts +37 -0
- package/es/editor/src/EditorParts/BlockTypeSelect/BlockTypeSelect.mjs +63 -0
- package/es/editor/src/EditorParts/BlockTypeSelect/interface.d.ts +21 -0
- package/es/editor/src/EditorParts/BlockTypeSelect/interface.mjs +14 -0
- package/es/editor/src/EditorParts/EditorContent/EditorContent.d.ts +4102 -0
- package/es/editor/src/EditorParts/EditorContent/EditorContent.mjs +154 -0
- package/es/editor/src/EditorParts/EditorContent/index.d.ts +2 -0
- package/es/editor/src/EditorParts/EditorContent/index.mjs +2 -0
- package/es/editor/src/EditorParts/EditorContent/interface.d.ts +1918 -0
- package/es/editor/src/EditorParts/EditorContent/interface.mjs +17 -0
- package/es/editor/src/EditorParts/EditorToolbar/EditorToolbar.d.ts +4606 -0
- package/es/editor/src/EditorParts/EditorToolbar/EditorToolbar.mjs +170 -0
- package/es/editor/src/EditorParts/EditorToolbar/composables/use-editor-toolbar-customization.d.ts +11 -0
- package/es/editor/src/EditorParts/EditorToolbar/composables/use-editor-toolbar-customization.mjs +56 -0
- package/es/editor/src/EditorParts/EditorToolbar/index.d.ts +2 -0
- package/es/editor/src/EditorParts/EditorToolbar/index.mjs +2 -0
- package/es/editor/src/EditorParts/EditorToolbar/interface.d.ts +1924 -0
- package/es/editor/src/EditorParts/EditorToolbar/interface.mjs +18 -0
- package/es/editor/src/EditorParts/SendButton/SendButton.d.ts +23 -0
- package/es/editor/src/EditorParts/SendButton/SendButton.mjs +44 -0
- package/es/editor/src/EditorParts/SendButton/interface.d.ts +18 -0
- package/es/editor/src/EditorParts/SendButton/interface.mjs +8 -0
- package/es/editor/src/EditorParts/ToolbarButton/ToolbarButton.d.ts +32 -0
- package/es/editor/src/EditorParts/ToolbarButton/ToolbarButton.mjs +44 -0
- package/es/editor/src/EditorParts/ToolbarButton/interface.d.ts +20 -0
- package/es/editor/src/EditorParts/ToolbarButton/interface.mjs +13 -0
- package/es/editor/src/composables/use-editor-commands.d.ts +8 -0
- package/es/editor/src/composables/use-editor-commands.mjs +69 -0
- package/es/editor/src/composables/use-editor-css-vars.d.ts +4 -0
- package/es/editor/src/composables/use-editor-css-vars.mjs +89 -0
- package/es/editor/src/constants.d.ts +12 -0
- package/es/editor/src/constants.mjs +25 -0
- package/es/editor/src/extensions.d.ts +7 -0
- package/es/editor/src/extensions.mjs +135 -0
- package/es/editor/src/interface.d.ts +2037 -0
- package/es/editor/src/interface.mjs +53 -0
- package/es/editor/src/markdown/constants.d.ts +8 -0
- package/es/editor/src/markdown/constants.mjs +206 -0
- package/es/editor/src/markdown/editor-serializer.d.ts +9 -0
- package/es/editor/src/markdown/editor-serializer.mjs +18 -0
- package/es/editor/src/markdown/escape.d.ts +2 -0
- package/es/editor/src/markdown/escape.mjs +24 -0
- package/es/editor/src/markdown/html.d.ts +1 -0
- package/es/editor/src/markdown/html.mjs +4 -0
- package/es/editor/src/markdown/parser.d.ts +4 -0
- package/es/editor/src/markdown/parser.mjs +36 -0
- package/es/editor/src/markdown/serializer-state.d.ts +10 -0
- package/es/editor/src/markdown/serializer-state.mjs +12 -0
- package/es/editor/src/markdown/serializer.d.ts +3 -0
- package/es/editor/src/markdown/serializer.mjs +8 -0
- package/es/editor/src/styles/index.cssr.d.ts +2 -0
- package/es/editor/src/styles/index.cssr.mjs +131 -0
- package/es/editor/styles/dark.d.ts +634 -0
- package/es/editor/styles/dark.mjs +21 -0
- package/es/editor/styles/index.d.ts +3 -0
- package/es/editor/styles/index.mjs +2 -0
- package/es/editor/styles/light.d.ts +685 -0
- package/es/editor/styles/light.mjs +91 -0
- package/es/editor/tests/fixtures/round-trip.d.ts +12 -0
- package/es/editor/tests/fixtures/round-trip.mjs +98 -0
- package/es/editor/tests/utils.d.ts +7 -0
- package/es/editor/tests/utils.mjs +27 -0
- package/es/locales/common/enUS.d.ts +22 -0
- package/es/locales/common/enUS.mjs +23 -1
- package/es/locales/common/ruRU.mjs +28 -8
- package/es/locales/common/uzUZ.mjs +23 -1
- package/es/locales/common/zhCN.mjs +23 -1
- package/es/locales/utils/date-locale.d.ts +2 -0
- package/es/locales/utils/date-locale.mjs +8 -0
- package/es/message-bubble/src/MessageBubble.d.ts +9 -0
- package/es/message-bubble/src/MessageBubble.mjs +9 -8
- package/es/message-bubble/src/interface.d.ts +5 -1
- package/es/message-bubble/src/interface.mjs +4 -0
- package/es/message-bubble/src/styles/index.cssr.mjs +4 -17
- package/es/styles.d.ts +1 -0
- package/es/styles.mjs +1 -0
- package/es/themes/dark.mjs +2 -0
- package/es/themes/light.mjs +2 -0
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/lib/_internal/icons/Bold.d.ts +2 -0
- package/lib/_internal/icons/Bold.js +13 -0
- package/lib/_internal/icons/BulletList.d.ts +2 -0
- package/lib/_internal/icons/BulletList.js +13 -0
- package/lib/_internal/icons/HorizontalRule.d.ts +2 -0
- package/lib/_internal/icons/HorizontalRule.js +10 -0
- package/lib/_internal/icons/Italic.d.ts +2 -0
- package/lib/_internal/icons/Italic.js +11 -0
- package/lib/_internal/icons/NumberedList.d.ts +2 -0
- package/lib/_internal/icons/NumberedList.js +13 -0
- package/lib/_internal/icons/Quote.d.ts +2 -0
- package/lib/_internal/icons/Quote.js +13 -0
- package/lib/_internal/icons/SettingsLine.d.ts +2 -0
- package/lib/_internal/icons/SettingsLine.js +11 -0
- package/lib/_internal/icons/Strikethrough.d.ts +2 -0
- package/lib/_internal/icons/Strikethrough.js +10 -0
- package/lib/_internal/icons/index.d.ts +8 -0
- package/lib/_internal/icons/index.js +18 -2
- package/lib/_styles/markdown/markdown-content.cssr.d.ts +6 -0
- package/lib/_styles/markdown/markdown-content.cssr.js +28 -0
- package/lib/_utils/markdown/index.d.ts +3 -2
- package/lib/_utils/markdown/index.js +4 -1
- package/lib/_utils/markdown/render-markdown.d.ts +2 -1
- package/lib/_utils/markdown/render-markdown.js +1 -0
- package/lib/chat/src/Chat.d.ts +261 -24
- package/lib/chat/src/Chat.js +2 -0
- package/lib/chat/src/ChatMainArea.d.ts +81 -8
- package/lib/chat/src/ChatMainArea.js +93 -223
- package/lib/chat/src/ChatParts/ChatAttachmentButton/ChatAttachmentButton.d.ts +9084 -0
- package/lib/chat/src/ChatParts/ChatAttachmentButton/ChatAttachmentButton.js +52 -0
- package/lib/chat/src/ChatParts/ChatAttachmentButton/interface.d.ts +2645 -0
- package/lib/chat/src/ChatParts/ChatAttachmentButton/interface.js +17 -0
- package/lib/chat/src/ChatParts/ChatEditingBlock/ChatEditingBlock.d.ts +9070 -0
- package/lib/chat/src/ChatParts/ChatEditingBlock/ChatEditingBlock.js +55 -0
- package/lib/chat/src/ChatParts/ChatEditingBlock/interface.d.ts +2637 -0
- package/lib/chat/src/ChatParts/ChatEditingBlock/interface.js +14 -0
- package/lib/chat/src/ChatParts/ChatEditorInput/ChatEditorInput.d.ts +89 -0
- package/lib/chat/src/ChatParts/ChatEditorInput/ChatEditorInput.js +45 -0
- package/lib/chat/src/ChatParts/ChatEditorInput/interface.d.ts +42 -0
- package/lib/chat/src/ChatParts/ChatEditorInput/interface.js +37 -0
- package/lib/chat/src/ChatParts/ChatFooter/ChatFooter.d.ts +115 -0
- package/lib/chat/src/ChatParts/ChatFooter/ChatFooter.js +66 -0
- package/lib/chat/src/ChatParts/ChatFooter/interface.d.ts +56 -0
- package/lib/chat/src/ChatParts/ChatFooter/interface.js +49 -0
- package/lib/chat/src/ChatParts/ChatHeader/ChatHeader.d.ts +9205 -0
- package/lib/chat/src/ChatParts/ChatHeader/ChatHeader.js +164 -0
- package/lib/chat/src/ChatParts/ChatHeader/interface.d.ts +2694 -0
- package/lib/chat/src/ChatParts/ChatHeader/interface.js +53 -0
- package/lib/chat/src/ChatParts/ChatLegacyInput/ChatLegacyInput.d.ts +9142 -0
- package/lib/chat/src/ChatParts/ChatLegacyInput/ChatLegacyInput.js +98 -0
- package/lib/chat/src/ChatParts/ChatLegacyInput/interface.d.ts +2654 -0
- package/lib/chat/src/ChatParts/ChatLegacyInput/interface.js +23 -0
- package/lib/chat/src/ChatParts/ChatMessagesArea/ChatMessagesArea.d.ts +148 -0
- package/lib/chat/src/ChatParts/ChatMessagesArea/ChatMessagesArea.js +49 -0
- package/lib/chat/src/ChatParts/ChatMessagesArea/interface.d.ts +72 -0
- package/lib/chat/src/ChatParts/ChatMessagesArea/interface.js +61 -0
- package/lib/chat/src/interface.d.ts +7 -0
- package/lib/chat/src/interface.js +3 -0
- package/lib/chat/src/styles/index.cssr.js +11 -12
- package/lib/chat/styles/light.d.ts +4 -0
- package/lib/chat/styles/light.js +22 -1
- package/lib/components.d.ts +13087 -103
- package/lib/components.js +17 -7
- package/lib/config-provider/src/ConfigProvider.js +7 -4
- package/lib/config-provider/src/internal-interface.d.ts +2 -0
- package/lib/data-table/index.d.ts +1 -1
- package/lib/data-table/src/ColumnSettings/ColumnSettingsDrawer.d.ts +156 -0
- package/lib/data-table/src/ColumnSettings/ColumnSettingsDrawer.js +181 -0
- package/lib/data-table/src/ColumnSettings/styles.cssr.d.ts +2 -0
- package/lib/data-table/src/ColumnSettings/styles.cssr.js +30 -0
- package/lib/data-table/src/DataTable.d.ts +60 -2
- package/lib/data-table/src/DataTable.js +65 -23
- package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +14 -0
- package/lib/data-table/src/interface.d.ts +53 -1
- package/lib/data-table/src/interface.js +17 -2
- package/lib/data-table/src/styles/index.cssr.js +17 -1
- package/lib/data-table/src/use-column-settings.d.ts +2 -0
- package/lib/data-table/src/use-column-settings.js +144 -0
- package/lib/data-table/src/utils/column-utils.d.ts +2 -1
- package/lib/data-table/src/utils/column-utils.js +5 -0
- package/lib/editor/index.d.ts +10 -0
- package/lib/editor/index.js +19 -0
- package/lib/editor/src/Editor.d.ts +3922 -0
- package/lib/editor/src/Editor.js +224 -0
- package/lib/editor/src/EditorParts/BlockTypeSelect/BlockTypeSelect.d.ts +37 -0
- package/lib/editor/src/EditorParts/BlockTypeSelect/BlockTypeSelect.js +47 -0
- package/lib/editor/src/EditorParts/BlockTypeSelect/interface.d.ts +21 -0
- package/lib/editor/src/EditorParts/BlockTypeSelect/interface.js +17 -0
- package/lib/editor/src/EditorParts/EditorContent/EditorContent.d.ts +4102 -0
- package/lib/editor/src/EditorParts/EditorContent/EditorContent.js +121 -0
- package/lib/editor/src/EditorParts/EditorContent/index.d.ts +2 -0
- package/lib/editor/src/EditorParts/EditorContent/index.js +10 -0
- package/lib/editor/src/EditorParts/EditorContent/interface.d.ts +1918 -0
- package/lib/editor/src/EditorParts/EditorContent/interface.js +8 -0
- package/lib/editor/src/EditorParts/EditorToolbar/EditorToolbar.d.ts +4606 -0
- package/lib/editor/src/EditorParts/EditorToolbar/EditorToolbar.js +126 -0
- package/lib/editor/src/EditorParts/EditorToolbar/composables/use-editor-toolbar-customization.d.ts +11 -0
- package/lib/editor/src/EditorParts/EditorToolbar/composables/use-editor-toolbar-customization.js +52 -0
- package/lib/editor/src/EditorParts/EditorToolbar/index.d.ts +2 -0
- package/lib/editor/src/EditorParts/EditorToolbar/index.js +10 -0
- package/lib/editor/src/EditorParts/EditorToolbar/interface.d.ts +1924 -0
- package/lib/editor/src/EditorParts/EditorToolbar/interface.js +11 -0
- package/lib/editor/src/EditorParts/SendButton/SendButton.d.ts +23 -0
- package/lib/editor/src/EditorParts/SendButton/SendButton.js +31 -0
- package/lib/editor/src/EditorParts/SendButton/interface.d.ts +18 -0
- package/lib/editor/src/EditorParts/SendButton/interface.js +11 -0
- package/lib/editor/src/EditorParts/ToolbarButton/ToolbarButton.d.ts +32 -0
- package/lib/editor/src/EditorParts/ToolbarButton/ToolbarButton.js +34 -0
- package/lib/editor/src/EditorParts/ToolbarButton/interface.d.ts +20 -0
- package/lib/editor/src/EditorParts/ToolbarButton/interface.js +16 -0
- package/lib/editor/src/composables/use-editor-commands.d.ts +8 -0
- package/lib/editor/src/composables/use-editor-commands.js +70 -0
- package/lib/editor/src/composables/use-editor-css-vars.d.ts +4 -0
- package/lib/editor/src/composables/use-editor-css-vars.js +50 -0
- package/lib/editor/src/constants.d.ts +12 -0
- package/lib/editor/src/constants.js +56 -0
- package/lib/editor/src/extensions.d.ts +7 -0
- package/lib/editor/src/extensions.js +141 -0
- package/lib/editor/src/interface.d.ts +2037 -0
- package/lib/editor/src/interface.js +22 -0
- package/lib/editor/src/markdown/constants.d.ts +8 -0
- package/lib/editor/src/markdown/constants.js +201 -0
- package/lib/editor/src/markdown/editor-serializer.d.ts +9 -0
- package/lib/editor/src/markdown/editor-serializer.js +20 -0
- package/lib/editor/src/markdown/escape.d.ts +2 -0
- package/lib/editor/src/markdown/escape.js +31 -0
- package/lib/editor/src/markdown/html.d.ts +1 -0
- package/lib/editor/src/markdown/html.js +9 -0
- package/lib/editor/src/markdown/parser.d.ts +4 -0
- package/lib/editor/src/markdown/parser.js +42 -0
- package/lib/editor/src/markdown/serializer-state.d.ts +10 -0
- package/lib/editor/src/markdown/serializer-state.js +16 -0
- package/lib/editor/src/markdown/serializer.d.ts +3 -0
- package/lib/editor/src/markdown/serializer.js +9 -0
- package/lib/editor/src/styles/index.cssr.d.ts +2 -0
- package/lib/editor/src/styles/index.cssr.js +136 -0
- package/lib/editor/styles/dark.d.ts +634 -0
- package/lib/editor/styles/dark.js +23 -0
- package/lib/editor/styles/index.d.ts +3 -0
- package/lib/editor/styles/index.js +10 -0
- package/lib/editor/styles/light.d.ts +685 -0
- package/lib/editor/styles/light.js +75 -0
- package/lib/editor/tests/fixtures/round-trip.d.ts +12 -0
- package/lib/editor/tests/fixtures/round-trip.js +125 -0
- package/lib/editor/tests/utils.d.ts +7 -0
- package/lib/editor/tests/utils.js +26 -0
- package/lib/locales/common/enUS.d.ts +22 -0
- package/lib/locales/common/enUS.js +23 -1
- package/lib/locales/common/ruRU.js +28 -8
- package/lib/locales/common/uzUZ.js +23 -1
- package/lib/locales/common/zhCN.js +23 -1
- package/lib/locales/utils/date-locale.d.ts +2 -0
- package/lib/locales/utils/date-locale.js +14 -0
- package/lib/message-bubble/src/MessageBubble.d.ts +9 -0
- package/lib/message-bubble/src/MessageBubble.js +12 -7
- package/lib/message-bubble/src/interface.d.ts +5 -1
- package/lib/message-bubble/src/interface.js +3 -0
- package/lib/message-bubble/src/styles/index.cssr.js +4 -17
- package/lib/styles.d.ts +1 -0
- package/lib/styles.js +127 -125
- package/lib/themes/dark.js +136 -134
- package/lib/themes/light.js +136 -134
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +8 -1
- package/volar.d.ts +3 -0
- package/web-types.json +454 -2
|
@@ -5,14 +5,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const vue_1 = require("vue");
|
|
7
7
|
const _internal_1 = require("../../_internal");
|
|
8
|
+
const icon_1 = require("../../_internal/icon");
|
|
9
|
+
const icons_1 = require("../../_internal/icons");
|
|
8
10
|
const _mixins_1 = require("../../_mixins");
|
|
9
11
|
const _utils_1 = require("../../_utils");
|
|
12
|
+
const button_1 = require("../../button");
|
|
10
13
|
const pagination_1 = require("../../pagination");
|
|
11
14
|
const styles_1 = require("../styles");
|
|
15
|
+
const ColumnSettingsDrawer_1 = __importDefault(require("./ColumnSettings/ColumnSettingsDrawer"));
|
|
12
16
|
const interface_1 = require("./interface");
|
|
13
17
|
const MainTable_1 = __importDefault(require("./MainTable"));
|
|
14
18
|
const index_cssr_1 = __importDefault(require("./styles/index.cssr"));
|
|
15
19
|
const use_check_1 = require("./use-check");
|
|
20
|
+
const use_column_settings_1 = require("./use-column-settings");
|
|
16
21
|
const use_expand_1 = require("./use-expand");
|
|
17
22
|
const use_group_header_1 = require("./use-group-header");
|
|
18
23
|
const use_resizable_1 = require("./use-resizable");
|
|
@@ -27,6 +32,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
27
32
|
emits: ['edit'],
|
|
28
33
|
props: interface_1.dataTableProps,
|
|
29
34
|
setup(props, { slots, emit }) {
|
|
35
|
+
var _a;
|
|
30
36
|
const componentId = (0, vue_1.useId)();
|
|
31
37
|
if (process.env.NODE_ENV !== 'production') {
|
|
32
38
|
(0, vue_1.watchEffect)(() => {
|
|
@@ -62,29 +68,45 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
62
68
|
const bodyWidthRef = (0, vue_1.ref)(null);
|
|
63
69
|
const mainTableInstRef = (0, vue_1.ref)(null);
|
|
64
70
|
const { getResizableWidth, clearResizableWidth, doUpdateResizableWidth, setResizableWidths, resizableWidthsRef } = (0, use_resizable_1.useResizable)();
|
|
65
|
-
|
|
66
|
-
|
|
71
|
+
if (props.localStorageKey && props.resizableStorage !== false) {
|
|
72
|
+
const storedWidths = (_a = (0, use_table_storage_1.loadTableState)(props.localStorageKey)) === null || _a === void 0 ? void 0 : _a.columnWidths;
|
|
73
|
+
if (storedWidths && Object.keys(storedWidths).length > 0) {
|
|
74
|
+
resizableWidthsRef.value = Object.assign(Object.assign({}, resizableWidthsRef.value), storedWidths);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
const { enabledRef: columnSettingsEnabledRef, resolvedColumnsRef, scrollXRef: columnSettingsScrollXRef, columnsConfigRef, drawerOpenRef, drawerItemsRef, defaultDrawerItemsRef, openDrawer: openColumnSettings, resetConfig: resetColumnSettings, applyConfig: applyColumnSettings, applyConfigFromKeys: applyColumnSettingsFromKeys } = (0, use_column_settings_1.useColumnSettings)(props, getResizableWidth);
|
|
78
|
+
const columnsProps = new Proxy(props, {
|
|
79
|
+
get(target, prop, receiver) {
|
|
80
|
+
if (prop === 'columns')
|
|
81
|
+
return resolvedColumnsRef.value;
|
|
82
|
+
if (prop === 'scrollX')
|
|
83
|
+
return columnSettingsScrollXRef.value;
|
|
84
|
+
return Reflect.get(target, prop, receiver);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
const { rowsRef, colsRef, dataRelatedColsRef, hasEllipsisRef } = (0, use_group_header_1.useGroupHeader)(columnsProps, getResizableWidth);
|
|
88
|
+
const { treeMateRef, mergedCurrentPageRef, paginatedDataRef, rawPaginatedDataRef, selectionColumnRef, hoverKeyRef, mergedPaginationRef, mergedFilterStateRef, mergedSortStateRef, childTriggerColIndexRef, doUpdatePage, doUpdatePageSize, doUpdateFilters, onUnstableColumnResize, deriveNextSorter, restoreSortState, filter, filters, clearFilter, clearFilters, clearSorter, page, sort } = (0, use_table_data_1.useTableData)(columnsProps, { dataRelatedColsRef });
|
|
67
89
|
const downloadCsv = (options) => {
|
|
68
90
|
const { fileName = 'data.csv', keepOriginalData = false } = options || {};
|
|
69
91
|
const data = keepOriginalData ? props.data : rawPaginatedDataRef.value;
|
|
70
|
-
const csvData = (0, utils_1.generateCsv)(
|
|
92
|
+
const csvData = (0, utils_1.generateCsv)(resolvedColumnsRef.value, data, props.getCsvCell, props.getCsvHeader);
|
|
71
93
|
const blob = new Blob([csvData], { type: 'text/csv;charset=utf-8' });
|
|
72
94
|
const downloadUrl = URL.createObjectURL(blob);
|
|
73
95
|
(0, _utils_1.download)(downloadUrl, fileName.endsWith('.csv') ? fileName : `${fileName}.csv`);
|
|
74
96
|
URL.revokeObjectURL(downloadUrl);
|
|
75
97
|
};
|
|
76
|
-
const { doCheckAll, doUncheckAll, doCheck, doUncheck, doUpdateCheckedRowKeys, mergedCheckedRowKeysRef, headerCheckboxDisabledRef, someRowsCheckedRef, allRowsCheckedRef, mergedCheckedRowKeySetRef, mergedInderminateRowKeySetRef } = (0, use_check_1.useCheck)(
|
|
98
|
+
const { doCheckAll, doUncheckAll, doCheck, doUncheck, doUpdateCheckedRowKeys, mergedCheckedRowKeysRef, headerCheckboxDisabledRef, someRowsCheckedRef, allRowsCheckedRef, mergedCheckedRowKeySetRef, mergedInderminateRowKeySetRef } = (0, use_check_1.useCheck)(columnsProps, {
|
|
77
99
|
selectionColumnRef,
|
|
78
100
|
treeMateRef,
|
|
79
101
|
paginatedDataRef
|
|
80
102
|
});
|
|
81
|
-
const { stickyExpandedRowsRef, mergedExpandedRowKeysRef, renderExpandRef, expandableRef, doUpdateExpandedRowKeys } = (0, use_expand_1.useExpand)(
|
|
82
|
-
const { draggableColumnRef, draggingRowKeySetRef, droppingRowKeyRef, droppingPositionRef, handleRowDragStart, handleRowDragOver, handleRowDragLeave, handleRowDragEnd, handleRowDrop } = (0, use_row_drag_1.useRowDrag)(
|
|
103
|
+
const { stickyExpandedRowsRef, mergedExpandedRowKeysRef, renderExpandRef, expandableRef, doUpdateExpandedRowKeys } = (0, use_expand_1.useExpand)(columnsProps, treeMateRef);
|
|
104
|
+
const { draggableColumnRef, draggingRowKeySetRef, droppingRowKeyRef, droppingPositionRef, handleRowDragStart, handleRowDragOver, handleRowDragLeave, handleRowDragEnd, handleRowDrop } = (0, use_row_drag_1.useRowDrag)(columnsProps, {
|
|
83
105
|
paginatedDataRef,
|
|
84
106
|
mergedCheckedRowKeySetRef,
|
|
85
107
|
mergedClsPrefixRef
|
|
86
108
|
});
|
|
87
|
-
const { handleTableBodyScroll, handleTableHeaderScroll, syncScrollState, setHeaderScrollLeft, leftActiveFixedColKeyRef, leftActiveFixedChildrenColKeysRef, rightActiveFixedColKeyRef, rightActiveFixedChildrenColKeysRef, leftFixedColumnsRef, rightFixedColumnsRef, fixedColumnLeftMapRef, fixedColumnRightMapRef } = (0, use_scroll_1.useScroll)(
|
|
109
|
+
const { handleTableBodyScroll, handleTableHeaderScroll, syncScrollState, setHeaderScrollLeft, leftActiveFixedColKeyRef, leftActiveFixedChildrenColKeysRef, rightActiveFixedColKeyRef, rightActiveFixedChildrenColKeysRef, leftFixedColumnsRef, rightFixedColumnsRef, fixedColumnLeftMapRef, fixedColumnRightMapRef } = (0, use_scroll_1.useScroll)(columnsProps, {
|
|
88
110
|
bodyWidthRef,
|
|
89
111
|
mainTableInstRef,
|
|
90
112
|
mergedCurrentPageRef,
|
|
@@ -98,11 +120,6 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
98
120
|
const stored = (0, use_table_storage_1.loadTableState)(key);
|
|
99
121
|
if (!stored)
|
|
100
122
|
return;
|
|
101
|
-
if (props.resizableStorage
|
|
102
|
-
&& stored.columnWidths
|
|
103
|
-
&& Object.keys(stored.columnWidths).length > 0) {
|
|
104
|
-
resizableWidthsRef.value = Object.assign(Object.assign({}, resizableWidthsRef.value), stored.columnWidths);
|
|
105
|
-
}
|
|
106
123
|
if (props.pagination && stored.page != null) {
|
|
107
124
|
doUpdatePage(stored.page);
|
|
108
125
|
}
|
|
@@ -129,6 +146,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
129
146
|
? {
|
|
130
147
|
key: props.localStorageKey,
|
|
131
148
|
columnWidths: resizableWidthsRef.value,
|
|
149
|
+
columnsConfig: columnsConfigRef.value,
|
|
132
150
|
page: (_a = mergedPaginationRef.value) === null || _a === void 0 ? void 0 : _a.page,
|
|
133
151
|
pageSize: (_b = mergedPaginationRef.value) === null || _b === void 0 ? void 0 : _b.pageSize,
|
|
134
152
|
filters: mergedFilterStateRef.value,
|
|
@@ -141,21 +159,24 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
141
159
|
}
|
|
142
160
|
: null;
|
|
143
161
|
}, (state) => {
|
|
144
|
-
var _a, _b;
|
|
162
|
+
var _a, _b, _c;
|
|
145
163
|
if (!(state === null || state === void 0 ? void 0 : state.key))
|
|
146
164
|
return;
|
|
147
165
|
(0, use_table_storage_1.saveTableState)(state.key, {
|
|
148
166
|
columnWidths: state.columnWidths && Object.keys(state.columnWidths).length
|
|
149
167
|
? state.columnWidths
|
|
150
168
|
: undefined,
|
|
169
|
+
columnsConfig: ((_a = state.columnsConfig) === null || _a === void 0 ? void 0 : _a.length)
|
|
170
|
+
? state.columnsConfig
|
|
171
|
+
: undefined,
|
|
151
172
|
page: state.page,
|
|
152
173
|
pageSize: state.pageSize,
|
|
153
174
|
filters: state.filters,
|
|
154
175
|
sortState: state.sortState.length ? state.sortState : undefined,
|
|
155
|
-
checkedRowKeys: ((
|
|
176
|
+
checkedRowKeys: ((_b = state.checkedRowKeys) === null || _b === void 0 ? void 0 : _b.length)
|
|
156
177
|
? state.checkedRowKeys
|
|
157
178
|
: undefined,
|
|
158
|
-
expandedRowKeys: ((
|
|
179
|
+
expandedRowKeys: ((_c = state.expandedRowKeys) === null || _c === void 0 ? void 0 : _c.length)
|
|
159
180
|
? state.expandedRowKeys
|
|
160
181
|
: undefined
|
|
161
182
|
});
|
|
@@ -201,7 +222,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
201
222
|
});
|
|
202
223
|
const containerWidthSignalRef = (0, vue_1.computed)(() => {
|
|
203
224
|
const bodyWidth = bodyWidthRef.value;
|
|
204
|
-
const scrollXWidth = (0, utils_1.parseLengthToNumber)(
|
|
225
|
+
const scrollXWidth = (0, utils_1.parseLengthToNumber)(columnSettingsScrollXRef.value);
|
|
205
226
|
return bodyWidth !== null && bodyWidth > 0
|
|
206
227
|
? bodyWidth
|
|
207
228
|
: scrollXWidth !== undefined && scrollXWidth > 0
|
|
@@ -354,7 +375,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
354
375
|
}
|
|
355
376
|
};
|
|
356
377
|
const autoSummaryRef = (0, vue_1.computed)(() => {
|
|
357
|
-
const columns =
|
|
378
|
+
const columns = resolvedColumnsRef.value;
|
|
358
379
|
const hasTotalRow = columns.some(col => !('children' in col) && 'totalRow' in col && col.totalRow);
|
|
359
380
|
if (!hasTotalRow)
|
|
360
381
|
return null;
|
|
@@ -430,7 +451,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
430
451
|
emit('edit', value, row, key);
|
|
431
452
|
};
|
|
432
453
|
(0, vue_1.provide)(interface_1.dataTableInjectionKey, {
|
|
433
|
-
props,
|
|
454
|
+
props: columnsProps,
|
|
434
455
|
sizeRef: (0, vue_1.toRef)(props, 'size'),
|
|
435
456
|
treeMateRef,
|
|
436
457
|
renderExpandIconRef: (0, vue_1.toRef)(props, 'renderExpandIcon'),
|
|
@@ -443,7 +464,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
443
464
|
hoverKeyRef,
|
|
444
465
|
mergedClsPrefixRef,
|
|
445
466
|
mergedThemeRef: themeRef,
|
|
446
|
-
scrollXRef:
|
|
467
|
+
scrollXRef: columnSettingsScrollXRef,
|
|
447
468
|
rowsRef,
|
|
448
469
|
colsRef,
|
|
449
470
|
paginatedDataRef,
|
|
@@ -557,7 +578,10 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
557
578
|
return summaryResult;
|
|
558
579
|
}
|
|
559
580
|
return null;
|
|
560
|
-
}
|
|
581
|
+
},
|
|
582
|
+
openColumnSettings,
|
|
583
|
+
resetColumnSettings,
|
|
584
|
+
applyColumnSettings
|
|
561
585
|
};
|
|
562
586
|
const cssVarsRef = (0, vue_1.computed)(() => {
|
|
563
587
|
const { size } = props;
|
|
@@ -630,11 +654,14 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
630
654
|
&& mergedPagination.pageSize
|
|
631
655
|
&& mergedPagination.itemCount > mergedPagination.pageSize);
|
|
632
656
|
});
|
|
633
|
-
return Object.assign({ mainTableInstRef, mergedClsPrefix: mergedClsPrefixRef, mergedTheme: themeRef, paginatedData: paginatedDataRef, mergedBordered: mergedBorderedRef, mergedBottomBordered: mergedBottomBorderedRef, mergedPagination: mergedPaginationRef, mergedShowPagination: mergedShowPaginationRef, cssVars: inlineThemeDisabled ? undefined : cssVarsRef, themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass, onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender }, exposedMethods);
|
|
657
|
+
return Object.assign({ mainTableInstRef, mergedClsPrefix: mergedClsPrefixRef, mergedTheme: themeRef, paginatedData: paginatedDataRef, mergedBordered: mergedBorderedRef, mergedBottomBordered: mergedBottomBorderedRef, mergedPagination: mergedPaginationRef, mergedShowPagination: mergedShowPaginationRef, cssVars: inlineThemeDisabled ? undefined : cssVarsRef, themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass, onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender, columnSettingsEnabled: columnSettingsEnabledRef, drawerOpen: drawerOpenRef, drawerItems: drawerItemsRef, defaultDrawerItems: defaultDrawerItemsRef, applyColumnSettingsFromKeys, locale: localeRef }, exposedMethods);
|
|
634
658
|
},
|
|
635
659
|
render() {
|
|
636
|
-
|
|
660
|
+
var _a;
|
|
661
|
+
const { mergedClsPrefix, themeClass, onRender, $slots, spinProps, locale, mergedTheme, columnSettingsTriggerProps } = this;
|
|
637
662
|
onRender === null || onRender === void 0 ? void 0 : onRender();
|
|
663
|
+
const hasFilters = !(0, _utils_1.isSlotEmpty)($slots.filters);
|
|
664
|
+
const showToolbar = hasFilters || this.columnSettingsEnabled;
|
|
638
665
|
return ((0, vue_1.h)("div", { class: [
|
|
639
666
|
`${mergedClsPrefix}-data-table`,
|
|
640
667
|
themeClass,
|
|
@@ -647,6 +674,17 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
647
674
|
[`${mergedClsPrefix}-data-table--flex-height`]: this.flexHeight
|
|
648
675
|
}
|
|
649
676
|
], style: this.cssVars },
|
|
677
|
+
showToolbar ? ((0, vue_1.h)("div", { class: [
|
|
678
|
+
`${mergedClsPrefix}-data-table-toolbar`,
|
|
679
|
+
hasFilters
|
|
680
|
+
&& `${mergedClsPrefix}-data-table-toolbar--with-filters`
|
|
681
|
+
] },
|
|
682
|
+
hasFilters ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-data-table-toolbar__filters` }, (_a = $slots.filters) === null || _a === void 0 ? void 0 : _a.call($slots))) : null,
|
|
683
|
+
this.columnSettingsEnabled
|
|
684
|
+
? (0, _utils_1.resolveSlot)($slots['column-settings-trigger'], () => [
|
|
685
|
+
(0, vue_1.h)(button_1.UButton, Object.assign({ secondary: true, round: true, size: "small", class: `${mergedClsPrefix}-data-table-toolbar-button`, theme: mergedTheme.peers.Button, themeOverrides: mergedTheme.peerOverrides.Button, renderIcon: () => (0, vue_1.h)(icon_1.UIcon, null, { default: () => (0, vue_1.h)(icons_1.SettingsLine) }) }, columnSettingsTriggerProps, { onClick: this.openColumnSettings }), locale.columnSettingsButton)
|
|
686
|
+
])
|
|
687
|
+
: null)) : null,
|
|
650
688
|
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-data-table-wrapper` },
|
|
651
689
|
(0, vue_1.h)(MainTable_1.default, { ref: "mainTableInstRef", onEdit: (...args) => {
|
|
652
690
|
this.$emit('edit', ...args);
|
|
@@ -659,6 +697,10 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
659
697
|
(0, vue_1.h)(_internal_1.UBaseLoading, Object.assign({ clsPrefix: mergedClsPrefix, strokeWidth: 20 }, spinProps))
|
|
660
698
|
]))) : null;
|
|
661
699
|
}
|
|
662
|
-
})
|
|
700
|
+
}),
|
|
701
|
+
this.columnSettingsEnabled ? ((0, vue_1.h)(ColumnSettingsDrawer_1.default, { show: this.drawerOpen, items: this.drawerItems, defaultItems: this.defaultDrawerItems, title: locale.columnSettingsTitle, subtitle: locale.columnSettingsSubtitle, selectAllText: locale.columnSettingsSelectAll, resetText: locale.columnSettingsReset, cancelText: locale.columnSettingsCancel, applyText: locale.columnSettingsApply, 'onUpdate:show': (value) => {
|
|
702
|
+
this.drawerOpen = value;
|
|
703
|
+
},
|
|
704
|
+
onApply: this.applyColumnSettingsFromKeys })) : null));
|
|
663
705
|
}
|
|
664
706
|
});
|
|
@@ -3819,11 +3819,25 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
3819
3819
|
uncheckTableAll: string;
|
|
3820
3820
|
confirm: string;
|
|
3821
3821
|
clear: string;
|
|
3822
|
+
columnSettingsTitle: string;
|
|
3823
|
+
columnSettingsButton: string;
|
|
3824
|
+
columnSettingsSubtitle: string;
|
|
3825
|
+
columnSettingsSelectAll: string;
|
|
3826
|
+
columnSettingsReset: string;
|
|
3827
|
+
columnSettingsCancel: string;
|
|
3828
|
+
columnSettingsApply: string;
|
|
3822
3829
|
}, {
|
|
3823
3830
|
checkTableAll: string;
|
|
3824
3831
|
uncheckTableAll: string;
|
|
3825
3832
|
confirm: string;
|
|
3826
3833
|
clear: string;
|
|
3834
|
+
columnSettingsTitle: string;
|
|
3835
|
+
columnSettingsButton: string;
|
|
3836
|
+
columnSettingsSubtitle: string;
|
|
3837
|
+
columnSettingsSelectAll: string;
|
|
3838
|
+
columnSettingsReset: string;
|
|
3839
|
+
columnSettingsCancel: string;
|
|
3840
|
+
columnSettingsApply: string;
|
|
3827
3841
|
}>;
|
|
3828
3842
|
checkboxGroupValue: import("vue").ComputedRef<FilterOptionValue[] | null>;
|
|
3829
3843
|
radioGroupValue: import("vue").ComputedRef<FilterOptionValue | null>;
|
|
@@ -3,6 +3,7 @@ import type { ComputedRef, CSSProperties, ExtractPropTypes, HTMLAttributes, Prop
|
|
|
3
3
|
import type { BaseLoadingExposedProps } from '../../_internal';
|
|
4
4
|
import type { MergedTheme } from '../../_mixins';
|
|
5
5
|
import type { ExtractPublicPropTypes, MaybeArray } from '../../_utils';
|
|
6
|
+
import type { ButtonProps } from '../../button';
|
|
6
7
|
import type { EllipsisProps } from '../../ellipsis/src/Ellipsis';
|
|
7
8
|
import type { EmptyProps } from '../../empty';
|
|
8
9
|
import type { ULocale } from '../../locales';
|
|
@@ -11,6 +12,11 @@ import type { ScrollbarProps, ScrollTo } from '../../scrollbar/src/Scrollbar';
|
|
|
11
12
|
import type { DataTableTheme } from '../styles';
|
|
12
13
|
import type { DataTableGetCsvCell, DataTableGetCsvHeader, DataTableSize } from './public-types';
|
|
13
14
|
import type { ColItem, RowItem } from './use-group-header';
|
|
15
|
+
export declare enum TableColumnType {
|
|
16
|
+
SELECTION = "selection",
|
|
17
|
+
EXPAND = "expand",
|
|
18
|
+
DRAGGABLE = "draggable"
|
|
19
|
+
}
|
|
14
20
|
export declare const dataTableProps: {
|
|
15
21
|
readonly onUnstableColumnResize: PropType<(resizedWidth: number, limitedWidth: number, column: TableBaseColumn, getColumnWidth: (key: ColumnKey) => number | undefined) => void>;
|
|
16
22
|
readonly pagination: {
|
|
@@ -106,7 +112,18 @@ export declare const dataTableProps: {
|
|
|
106
112
|
readonly default: "current";
|
|
107
113
|
};
|
|
108
114
|
readonly scrollbarProps: PropType<ScrollbarProps>;
|
|
109
|
-
readonly localStorageKey:
|
|
115
|
+
readonly localStorageKey: {
|
|
116
|
+
readonly type: StringConstructor;
|
|
117
|
+
readonly default: undefined;
|
|
118
|
+
};
|
|
119
|
+
readonly columnSettings: {
|
|
120
|
+
readonly type: BooleanConstructor;
|
|
121
|
+
readonly default: false;
|
|
122
|
+
};
|
|
123
|
+
readonly columnSettingsTriggerProps: {
|
|
124
|
+
readonly type: PropType<Partial<ButtonProps>>;
|
|
125
|
+
readonly default: undefined;
|
|
126
|
+
};
|
|
110
127
|
readonly renderCell: PropType<(value: any, rowData: object, column: TableBaseColumn) => VNodeChild>;
|
|
111
128
|
readonly defaultEmptyValue: PropType<string | (() => VNodeChild) | undefined>;
|
|
112
129
|
readonly renderExpandIcon: PropType<RenderExpandIcon>;
|
|
@@ -3764,6 +3781,8 @@ export interface DataTableSlots {
|
|
|
3764
3781
|
empty?: () => VNode[];
|
|
3765
3782
|
loading?: () => VNode[];
|
|
3766
3783
|
'drag-handle'?: () => VNode[];
|
|
3784
|
+
filters?: () => VNode[];
|
|
3785
|
+
'column-settings-trigger'?: () => VNode[];
|
|
3767
3786
|
}
|
|
3768
3787
|
export type RowData = Record<string, any>;
|
|
3769
3788
|
export type InternalRowData = Record<string, unknown>;
|
|
@@ -3799,6 +3818,7 @@ export interface CommonColumnInfo<T = InternalRowData> {
|
|
|
3799
3818
|
cellProps?: (rowData: T, rowIndex: number) => HTMLAttributes;
|
|
3800
3819
|
allowExport?: boolean;
|
|
3801
3820
|
visible?: boolean;
|
|
3821
|
+
required?: boolean;
|
|
3802
3822
|
}
|
|
3803
3823
|
export interface TableColumnMaskObject {
|
|
3804
3824
|
postProcess: (value: string) => string;
|
|
@@ -4104,8 +4124,37 @@ export interface MainTableInjection {
|
|
|
4104
4124
|
leftActiveFixedColKey: ColumnKey | null;
|
|
4105
4125
|
rightActiveFixedColKey: ColumnKey | null;
|
|
4106
4126
|
}
|
|
4127
|
+
export interface DataTableColumnConfigState {
|
|
4128
|
+
key: string;
|
|
4129
|
+
order: number;
|
|
4130
|
+
hidden: boolean;
|
|
4131
|
+
}
|
|
4132
|
+
export interface DataTableColumnSettingsItem {
|
|
4133
|
+
key: string;
|
|
4134
|
+
title: string;
|
|
4135
|
+
visible: boolean;
|
|
4136
|
+
required: boolean;
|
|
4137
|
+
sortOrder: number;
|
|
4138
|
+
}
|
|
4139
|
+
export type DataTableConfigurableColumn = TableBaseColumn & {
|
|
4140
|
+
key: string | number;
|
|
4141
|
+
};
|
|
4142
|
+
export interface UseColumnSettingsReturn {
|
|
4143
|
+
enabledRef: ComputedRef<boolean>;
|
|
4144
|
+
resolvedColumnsRef: ComputedRef<TableColumns>;
|
|
4145
|
+
scrollXRef: ComputedRef<string | number | undefined>;
|
|
4146
|
+
columnsConfigRef: Ref<DataTableColumnConfigState[] | null>;
|
|
4147
|
+
drawerOpenRef: Ref<boolean>;
|
|
4148
|
+
drawerItemsRef: ComputedRef<DataTableColumnSettingsItem[]>;
|
|
4149
|
+
defaultDrawerItemsRef: ComputedRef<DataTableColumnSettingsItem[]>;
|
|
4150
|
+
openDrawer: () => void;
|
|
4151
|
+
resetConfig: () => void;
|
|
4152
|
+
applyConfig: (config: DataTableColumnConfigState[]) => void;
|
|
4153
|
+
applyConfigFromKeys: (orderedKeys: string[], hiddenKeys: string[]) => void;
|
|
4154
|
+
}
|
|
4107
4155
|
export interface DataTableStorageState {
|
|
4108
4156
|
columnWidths?: Record<string, number>;
|
|
4157
|
+
columnsConfig?: DataTableColumnConfigState[];
|
|
4109
4158
|
page?: number;
|
|
4110
4159
|
pageSize?: number;
|
|
4111
4160
|
filters?: FilterState;
|
|
@@ -4170,6 +4219,9 @@ export interface DataTableInst {
|
|
|
4170
4219
|
totalRows: InternalRowData | null;
|
|
4171
4220
|
};
|
|
4172
4221
|
getTotalRowData: () => InternalRowData | null;
|
|
4222
|
+
openColumnSettings: () => void;
|
|
4223
|
+
resetColumnSettings: () => void;
|
|
4224
|
+
applyColumnSettings: (config: DataTableColumnConfigState[]) => void;
|
|
4173
4225
|
/** @deprecated it but just leave it here, it does no harm */
|
|
4174
4226
|
clearFilter: () => void;
|
|
4175
4227
|
}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.dataTableInjectionKey = exports.dataTableProps = void 0;
|
|
3
|
+
exports.dataTableInjectionKey = exports.dataTableProps = exports.TableColumnType = void 0;
|
|
4
4
|
const _mixins_1 = require("../../_mixins");
|
|
5
5
|
const _utils_1 = require("../../_utils");
|
|
6
|
+
var TableColumnType;
|
|
7
|
+
(function (TableColumnType) {
|
|
8
|
+
TableColumnType["SELECTION"] = "selection";
|
|
9
|
+
TableColumnType["EXPAND"] = "expand";
|
|
10
|
+
TableColumnType["DRAGGABLE"] = "draggable";
|
|
11
|
+
})(TableColumnType || (exports.TableColumnType = TableColumnType = {}));
|
|
6
12
|
exports.dataTableProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props), { onUnstableColumnResize: Function, pagination: {
|
|
7
13
|
type: [Object, Boolean],
|
|
8
14
|
default: false
|
|
@@ -59,7 +65,16 @@ exports.dataTableProps = Object.assign(Object.assign({}, _mixins_1.useTheme.prop
|
|
|
59
65
|
}, paginationBehaviorOnFilter: {
|
|
60
66
|
type: String,
|
|
61
67
|
default: 'current'
|
|
62
|
-
}, scrollbarProps: Object, localStorageKey:
|
|
68
|
+
}, scrollbarProps: Object, localStorageKey: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: undefined
|
|
71
|
+
}, columnSettings: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: false
|
|
74
|
+
}, columnSettingsTriggerProps: {
|
|
75
|
+
type: Object,
|
|
76
|
+
default: undefined
|
|
77
|
+
}, renderCell: Function, defaultEmptyValue: [String, Function], renderExpandIcon: Function, spinProps: { type: Object, default: {} }, emptyProps: Object, getCsvCell: Function, getCsvHeader: Function, onLoad: Function, 'onUpdate:page': [Function, Array], onUpdatePage: [Function, Array], 'onUpdate:pageSize': [Function, Array], onUpdatePageSize: [Function, Array], 'onUpdate:sorter': [Function, Array], onUpdateSorter: [Function, Array], 'onUpdate:filters': [Function, Array], onUpdateFilters: [Function, Array], 'onUpdate:checkedRowKeys': [Function, Array], onUpdateCheckedRowKeys: [Function, Array], 'onUpdate:expandedRowKeys': [Function, Array], onUpdateExpandedRowKeys: [Function, Array], onScroll: Function,
|
|
63
78
|
// deprecated
|
|
64
79
|
onPageChange: [Function, Array], onPageSizeChange: [Function, Array], onSorterChange: [Function, Array], onFiltersChange: [Function, Array], onCheckedRowKeysChange: [Function, Array] });
|
|
65
80
|
exports.dataTableInjectionKey = (0, _utils_1.createInjectionKey)('u-data-table');
|
|
@@ -64,7 +64,23 @@ exports.default = (0, cssr_1.c)([(0, cssr_1.cB)('data-table', `
|
|
|
64
64
|
--u-merged-th-color-hover: var(--u-th-color-hover);
|
|
65
65
|
--u-merged-td-color-hover: var(--u-td-color-hover);
|
|
66
66
|
--u-merged-td-color-striped: var(--u-td-color-striped);
|
|
67
|
-
`, [(0, cssr_1.cB)('data-table-
|
|
67
|
+
`, [(0, cssr_1.cB)('data-table-toolbar', `
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
justify-content: flex-end;
|
|
71
|
+
gap: 16px;
|
|
72
|
+
margin-bottom: 12px;
|
|
73
|
+
flex-shrink: 0;
|
|
74
|
+
`, [(0, cssr_1.cM)('with-filters', `
|
|
75
|
+
justify-content: space-between;
|
|
76
|
+
`), (0, cssr_1.cE)('filters', `
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
flex: 1;
|
|
80
|
+
min-width: 0;
|
|
81
|
+
`)]), (0, cssr_1.cB)('data-table-toolbar-button', `
|
|
82
|
+
flex-shrink: 0;
|
|
83
|
+
`), (0, cssr_1.cB)('data-table-wrapper', `
|
|
68
84
|
flex-grow: 1;
|
|
69
85
|
display: flex;
|
|
70
86
|
flex-direction: column;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useColumnSettings = useColumnSettings;
|
|
4
|
+
const vue_1 = require("vue");
|
|
5
|
+
const interface_1 = require("./interface");
|
|
6
|
+
const use_table_storage_1 = require("./use-table-storage");
|
|
7
|
+
const utils_1 = require("./utils");
|
|
8
|
+
function isConfigurableColumn(column) {
|
|
9
|
+
if ('children' in column)
|
|
10
|
+
return false;
|
|
11
|
+
if (column.type === interface_1.TableColumnType.SELECTION
|
|
12
|
+
|| column.type === interface_1.TableColumnType.EXPAND
|
|
13
|
+
|| column.type === interface_1.TableColumnType.DRAGGABLE) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
return column.visible !== false;
|
|
17
|
+
}
|
|
18
|
+
function toColumnTitle(column) {
|
|
19
|
+
return typeof column.title === 'string' ? column.title : String(column.key);
|
|
20
|
+
}
|
|
21
|
+
function calcColumnsScrollX(columns, getResizableWidth) {
|
|
22
|
+
let total = 0;
|
|
23
|
+
for (const column of columns) {
|
|
24
|
+
if (!('key' in column))
|
|
25
|
+
return undefined;
|
|
26
|
+
const resized = getResizableWidth === null || getResizableWidth === void 0 ? void 0 : getResizableWidth(column.key);
|
|
27
|
+
const width = resized !== null && resized !== void 0 ? resized : (0, utils_1.getNumberColWidth)(column);
|
|
28
|
+
if (width === undefined)
|
|
29
|
+
return undefined;
|
|
30
|
+
total += width;
|
|
31
|
+
}
|
|
32
|
+
return total;
|
|
33
|
+
}
|
|
34
|
+
function useColumnSettings(props, getResizableWidth) {
|
|
35
|
+
var _a, _b;
|
|
36
|
+
const enabledRef = (0, vue_1.computed)(() => !!props.columnSettings && !!props.localStorageKey);
|
|
37
|
+
const columnsConfigRef = (0, vue_1.ref)(props.localStorageKey
|
|
38
|
+
? ((_b = (_a = (0, use_table_storage_1.loadTableState)(props.localStorageKey)) === null || _a === void 0 ? void 0 : _a.columnsConfig) !== null && _b !== void 0 ? _b : null)
|
|
39
|
+
: null);
|
|
40
|
+
const drawerOpenRef = (0, vue_1.ref)(false);
|
|
41
|
+
const configurableColumnsRef = (0, vue_1.computed)(() => {
|
|
42
|
+
return props.columns.filter(isConfigurableColumn);
|
|
43
|
+
});
|
|
44
|
+
const visibleColumnsRef = (0, vue_1.computed)(() => {
|
|
45
|
+
const cols = configurableColumnsRef.value;
|
|
46
|
+
const config = columnsConfigRef.value;
|
|
47
|
+
if (!enabledRef.value || !config)
|
|
48
|
+
return props.columns;
|
|
49
|
+
const stateMap = new Map(config.map(state => [state.key, state]));
|
|
50
|
+
const specialColumns = props.columns.filter((column) => {
|
|
51
|
+
if ('children' in column)
|
|
52
|
+
return true;
|
|
53
|
+
return (column.type === interface_1.TableColumnType.SELECTION
|
|
54
|
+
|| column.type === interface_1.TableColumnType.EXPAND
|
|
55
|
+
|| column.type === interface_1.TableColumnType.DRAGGABLE);
|
|
56
|
+
});
|
|
57
|
+
const ordered = [...cols]
|
|
58
|
+
.filter(col => { var _a; return !((_a = stateMap.get(String(col.key))) === null || _a === void 0 ? void 0 : _a.hidden); })
|
|
59
|
+
.sort((left, right) => {
|
|
60
|
+
var _a, _b, _c, _d;
|
|
61
|
+
const leftOrder = (_b = (_a = stateMap.get(String(left.key))) === null || _a === void 0 ? void 0 : _a.order) !== null && _b !== void 0 ? _b : config.length;
|
|
62
|
+
const rightOrder = (_d = (_c = stateMap.get(String(right.key))) === null || _c === void 0 ? void 0 : _c.order) !== null && _d !== void 0 ? _d : config.length;
|
|
63
|
+
return leftOrder - rightOrder;
|
|
64
|
+
});
|
|
65
|
+
return [...specialColumns, ...ordered];
|
|
66
|
+
});
|
|
67
|
+
function openDrawer() {
|
|
68
|
+
drawerOpenRef.value = true;
|
|
69
|
+
}
|
|
70
|
+
function resetConfig() {
|
|
71
|
+
columnsConfigRef.value = null;
|
|
72
|
+
}
|
|
73
|
+
function applyConfig(config) {
|
|
74
|
+
columnsConfigRef.value = config.map((item, index) => {
|
|
75
|
+
var _a;
|
|
76
|
+
return ({
|
|
77
|
+
key: item.key,
|
|
78
|
+
order: (_a = item.order) !== null && _a !== void 0 ? _a : index,
|
|
79
|
+
hidden: !!item.hidden
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function applyConfigFromKeys(orderedKeys, hiddenKeys) {
|
|
84
|
+
const hiddenSet = new Set(hiddenKeys);
|
|
85
|
+
applyConfig(orderedKeys.map((key, index) => ({
|
|
86
|
+
key,
|
|
87
|
+
order: index,
|
|
88
|
+
hidden: hiddenSet.has(key)
|
|
89
|
+
})));
|
|
90
|
+
}
|
|
91
|
+
const resolvedColumnsRef = (0, vue_1.computed)(() => {
|
|
92
|
+
if (!enabledRef.value)
|
|
93
|
+
return props.columns;
|
|
94
|
+
return visibleColumnsRef.value;
|
|
95
|
+
});
|
|
96
|
+
const scrollXRef = (0, vue_1.computed)(() => {
|
|
97
|
+
if (!enabledRef.value)
|
|
98
|
+
return props.scrollX;
|
|
99
|
+
if (props.scrollX !== undefined)
|
|
100
|
+
return props.scrollX;
|
|
101
|
+
return calcColumnsScrollX(visibleColumnsRef.value, getResizableWidth);
|
|
102
|
+
});
|
|
103
|
+
const defaultDrawerItemsRef = (0, vue_1.computed)(() => configurableColumnsRef.value.map((col, index) => ({
|
|
104
|
+
key: String(col.key),
|
|
105
|
+
title: toColumnTitle(col),
|
|
106
|
+
visible: true,
|
|
107
|
+
required: !!col.required,
|
|
108
|
+
sortOrder: index
|
|
109
|
+
})));
|
|
110
|
+
const drawerItemsRef = (0, vue_1.computed)(() => {
|
|
111
|
+
const cols = configurableColumnsRef.value;
|
|
112
|
+
const config = columnsConfigRef.value;
|
|
113
|
+
const stateMap = config
|
|
114
|
+
? new Map(config.map(state => [state.key, state]))
|
|
115
|
+
: new Map();
|
|
116
|
+
return cols
|
|
117
|
+
.map((col, defaultIndex) => {
|
|
118
|
+
var _a;
|
|
119
|
+
const key = String(col.key);
|
|
120
|
+
const state = stateMap.get(key);
|
|
121
|
+
return {
|
|
122
|
+
key,
|
|
123
|
+
title: toColumnTitle(col),
|
|
124
|
+
visible: state ? !state.hidden : true,
|
|
125
|
+
required: !!col.required,
|
|
126
|
+
sortOrder: (_a = state === null || state === void 0 ? void 0 : state.order) !== null && _a !== void 0 ? _a : defaultIndex
|
|
127
|
+
};
|
|
128
|
+
})
|
|
129
|
+
.sort((left, right) => left.sortOrder - right.sortOrder);
|
|
130
|
+
});
|
|
131
|
+
return {
|
|
132
|
+
enabledRef,
|
|
133
|
+
resolvedColumnsRef,
|
|
134
|
+
scrollXRef,
|
|
135
|
+
columnsConfigRef,
|
|
136
|
+
drawerOpenRef,
|
|
137
|
+
drawerItemsRef,
|
|
138
|
+
defaultDrawerItemsRef,
|
|
139
|
+
openDrawer,
|
|
140
|
+
resetConfig,
|
|
141
|
+
applyConfig,
|
|
142
|
+
applyConfigFromKeys
|
|
143
|
+
};
|
|
144
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CSSProperties } from 'vue';
|
|
2
|
-
import type { CreateRowClassName, DataRelatedColumn, InternalRowData, TableColumn } from '../interface';
|
|
2
|
+
import type { CreateRowClassName, DataRelatedColumn, DataTableColumnSettingsItem, InternalRowData, TableColumn } from '../interface';
|
|
3
3
|
export declare const SELECTION_COL_WIDTH = 40;
|
|
4
4
|
export declare const EXPAND_COL_WIDTH = 40;
|
|
5
5
|
export declare const DRAGGABLE_COL_WIDTH = 40;
|
|
@@ -12,3 +12,4 @@ export declare function isColumnSortable(column: TableColumn): boolean;
|
|
|
12
12
|
export declare function isColumnEllipsisEnabled(column: Pick<TableColumn, 'ellipsis'>): boolean;
|
|
13
13
|
export declare function isColumnResizable(column: TableColumn): boolean;
|
|
14
14
|
export declare function isColumnFilterable(column: TableColumn): boolean;
|
|
15
|
+
export declare function withSortSteps(items: DataTableColumnSettingsItem[]): DataTableColumnSettingsItem[];
|
|
@@ -10,6 +10,7 @@ exports.isColumnSortable = isColumnSortable;
|
|
|
10
10
|
exports.isColumnEllipsisEnabled = isColumnEllipsisEnabled;
|
|
11
11
|
exports.isColumnResizable = isColumnResizable;
|
|
12
12
|
exports.isColumnFilterable = isColumnFilterable;
|
|
13
|
+
exports.withSortSteps = withSortSteps;
|
|
13
14
|
const seemly_1 = require("seemly");
|
|
14
15
|
const _utils_1 = require("../../../_utils");
|
|
15
16
|
const width_utils_1 = require("./width-utils");
|
|
@@ -123,3 +124,7 @@ function isColumnFilterable(column) {
|
|
|
123
124
|
return false;
|
|
124
125
|
return (!!column.filter && (!!column.filterOptions || !!column.renderFilterMenu));
|
|
125
126
|
}
|
|
127
|
+
const SORT_ORDER_STEP = 1000;
|
|
128
|
+
function withSortSteps(items) {
|
|
129
|
+
return items.map((item, index) => (Object.assign(Object.assign({}, item), { sortOrder: index * SORT_ORDER_STEP })));
|
|
130
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { default as UEditor } from './src/Editor';
|
|
2
|
+
export type { BlockTypeSelectProps } from './src/EditorParts/BlockTypeSelect/interface';
|
|
3
|
+
export { editorContentProps, type EditorContentProps, UEditorContent } from './src/EditorParts/EditorContent';
|
|
4
|
+
export { type EditorToolbarProps, editorToolbarProps, UEditorToolbar } from './src/EditorParts/EditorToolbar';
|
|
5
|
+
export type { SendButtonProps } from './src/EditorParts/SendButton/interface';
|
|
6
|
+
export type { ToolbarButtonProps } from './src/EditorParts/ToolbarButton/interface';
|
|
7
|
+
export { createEditorExtensions } from './src/extensions';
|
|
8
|
+
export { editorInjectionKey, editorProps } from './src/interface';
|
|
9
|
+
export type { EditorInst, EditorNodeProps, EditorProps, EditorSlots, EditorToolbar, EditorToolbarItemKey } from './src/interface';
|
|
10
|
+
export type { Editor } from '@tiptap/vue-3';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.editorProps = exports.editorInjectionKey = exports.createEditorExtensions = exports.UEditorToolbar = exports.editorToolbarProps = exports.UEditorContent = exports.editorContentProps = exports.UEditor = void 0;
|
|
7
|
+
var Editor_1 = require("./src/Editor");
|
|
8
|
+
Object.defineProperty(exports, "UEditor", { enumerable: true, get: function () { return __importDefault(Editor_1).default; } });
|
|
9
|
+
var EditorContent_1 = require("./src/EditorParts/EditorContent");
|
|
10
|
+
Object.defineProperty(exports, "editorContentProps", { enumerable: true, get: function () { return EditorContent_1.editorContentProps; } });
|
|
11
|
+
Object.defineProperty(exports, "UEditorContent", { enumerable: true, get: function () { return EditorContent_1.UEditorContent; } });
|
|
12
|
+
var EditorToolbar_1 = require("./src/EditorParts/EditorToolbar");
|
|
13
|
+
Object.defineProperty(exports, "editorToolbarProps", { enumerable: true, get: function () { return EditorToolbar_1.editorToolbarProps; } });
|
|
14
|
+
Object.defineProperty(exports, "UEditorToolbar", { enumerable: true, get: function () { return EditorToolbar_1.UEditorToolbar; } });
|
|
15
|
+
var extensions_1 = require("./src/extensions");
|
|
16
|
+
Object.defineProperty(exports, "createEditorExtensions", { enumerable: true, get: function () { return extensions_1.createEditorExtensions; } });
|
|
17
|
+
var interface_1 = require("./src/interface");
|
|
18
|
+
Object.defineProperty(exports, "editorInjectionKey", { enumerable: true, get: function () { return interface_1.editorInjectionKey; } });
|
|
19
|
+
Object.defineProperty(exports, "editorProps", { enumerable: true, get: function () { return interface_1.editorProps; } });
|