@ecsplico/editor 1.0.0 → 2.1.0
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 +37 -0
- package/README.md +7 -7
- package/dist/adapters/anchors.d.ts +80 -0
- package/dist/adapters/anchors.js +270 -0
- package/dist/adapters/anchors.js.map +1 -0
- package/dist/adapters/comments/client.d.ts +64 -0
- package/dist/adapters/comments/client.js +536 -0
- package/dist/adapters/comments/client.js.map +1 -0
- package/dist/adapters/comments/drizzle.d.ts +430 -0
- package/dist/adapters/comments/drizzle.js +236 -0
- package/dist/adapters/comments/drizzle.js.map +1 -0
- package/dist/adapters/comments/errors.d.ts +9 -0
- package/dist/adapters/comments/errors.js +19 -0
- package/dist/adapters/comments/errors.js.map +1 -0
- package/dist/adapters/comments/json.d.ts +19 -0
- package/dist/adapters/comments/json.js +94 -0
- package/dist/adapters/comments/json.js.map +1 -0
- package/dist/adapters/comments/record.js +78 -0
- package/dist/adapters/comments/record.js.map +1 -0
- package/dist/adapters/comments/server.d.ts +23 -0
- package/dist/adapters/comments/server.js +102 -0
- package/dist/adapters/comments/server.js.map +1 -0
- package/dist/adapters/comments/types.d.ts +109 -0
- package/dist/adapters/documents.js +108 -0
- package/dist/adapters/documents.js.map +1 -0
- package/dist/adapters/drizzle.d.ts +293 -0
- package/dist/adapters/drizzle.js +157 -0
- package/dist/adapters/drizzle.js.map +1 -0
- package/dist/adapters/files.js +30 -0
- package/dist/adapters/files.js.map +1 -0
- package/dist/adapters/forge.d.ts +58 -0
- package/dist/adapters/forge.js +91 -0
- package/dist/adapters/forge.js.map +1 -0
- package/dist/adapters/index.d.ts +13 -0
- package/dist/adapters/index.js +0 -0
- package/dist/adapters/json.d.ts +24 -0
- package/dist/adapters/json.js +128 -0
- package/dist/adapters/json.js.map +1 -0
- package/dist/adapters/nitro.d.ts +61 -0
- package/dist/adapters/nitro.js +212 -0
- package/dist/adapters/nitro.js.map +1 -0
- package/dist/adapters/routes.js +16 -0
- package/dist/adapters/routes.js.map +1 -0
- package/dist/adapters/shared.d.ts +37 -0
- package/dist/adapters/shared.js +32 -0
- package/dist/adapters/shared.js.map +1 -0
- package/dist/adapters/vue.d.ts +67 -0
- package/dist/adapters/vue.js +187 -0
- package/dist/adapters/vue.js.map +1 -0
- package/dist/code/CodeSurface.vue.d.ts +3 -3
- package/dist/core/doc-anchors.d.ts +5 -0
- package/dist/core/doc-anchors.js +4 -3
- package/dist/core/doc-anchors.js.map +1 -1
- package/dist/core/editor-ui.js +57 -1
- package/dist/core/editor-ui.js.map +1 -1
- package/dist/core/notify.d.ts +1 -1
- package/dist/core/notify.js.map +1 -1
- package/dist/core/surface-session.js +139 -0
- package/dist/core/surface-session.js.map +1 -0
- package/dist/document/DocumentSurface.d.ts +1 -1
- package/dist/document/DocumentSurface.vue.d.ts +3 -3
- package/dist/features/ai/agent-op-review.d.ts +2 -2
- package/dist/features/ai/agent-op-review.js.map +1 -1
- package/dist/features/ai/agent-ops.d.ts +1 -1
- package/dist/features/ai/agent-ops.js +9 -6
- package/dist/features/ai/agent-ops.js.map +1 -1
- package/dist/features/ai/ai-apply.d.ts +1 -1
- package/dist/features/ai/ai-review.js +10 -1
- package/dist/features/ai/ai-review.js.map +1 -1
- package/dist/features/ai/components/AiSelectionMenu.js +78 -252
- package/dist/features/ai/components/AiSelectionMenu.js.map +1 -1
- package/dist/features/ai/components/AiSelectionMenu.vue.d.ts +2 -1
- package/dist/features/ai/components/AiSidebar.js +2 -2
- package/dist/features/ai/components/DocumentChatAnswer.js +1 -1
- package/dist/features/ai/components/DocumentChatOps.js +1 -0
- package/dist/features/ai/components/DocumentChatOps.js.map +1 -1
- package/dist/features/ai/components/ModelQuickSwitch.js +1 -1
- package/dist/features/ai/components/SettingsAiTab.js +1 -1
- package/dist/features/ai/components/SettingsModelProfiles.js +1 -1
- package/dist/features/ai/document-chat.d.ts +3 -2
- package/dist/features/ai/document-chat.js +16 -19
- package/dist/features/ai/document-chat.js.map +1 -1
- package/dist/features/ai/index.d.ts +5 -3
- package/dist/features/ai/index.js +4 -2
- package/dist/features/ai/protocol/agent-ops.d.ts +22 -17
- package/dist/features/ai/protocol/agent-ops.js +65 -39
- package/dist/features/ai/protocol/agent-ops.js.map +1 -1
- package/dist/features/ai/protocol/block-lines.d.ts +89 -0
- package/dist/features/ai/protocol/block-lines.js +177 -0
- package/dist/features/ai/protocol/block-lines.js.map +1 -0
- package/dist/features/ai/protocol/chat.js +10 -10
- package/dist/features/ai/protocol/chat.js.map +1 -1
- package/dist/features/ai/protocol/index.d.ts +3 -2
- package/dist/features/ai/protocol/index.js +3 -2
- package/dist/features/ai/react/AiSelectionMenu.d.ts +3 -2
- package/dist/features/ai/react/AiSelectionMenu.js +64 -255
- package/dist/features/ai/react/AiSelectionMenu.js.map +1 -1
- package/dist/features/ai/react/AiSidebar.js +2 -2
- package/dist/features/ai/react/DocumentChatAnswer.js +1 -1
- package/dist/features/ai/react/DocumentChatOps.js +1 -0
- package/dist/features/ai/react/DocumentChatOps.js.map +1 -1
- package/dist/features/ai/react/ModelQuickSwitch.js +1 -1
- package/dist/features/ai/react/SettingsAiTab.js +1 -1
- package/dist/features/ai/react/SettingsModelProfiles.js +1 -1
- package/dist/features/ai/react/use-ai-selection-flow.js +34 -0
- package/dist/features/ai/react/use-ai-selection-flow.js.map +1 -0
- package/dist/features/ai/selection-flow.d.ts +133 -0
- package/dist/features/ai/selection-flow.js +283 -0
- package/dist/features/ai/selection-flow.js.map +1 -0
- package/dist/features/ai/use-ai-assistant.d.ts +1 -1
- package/dist/features/ai/use-document-chat.d.ts +1 -1
- package/dist/features/authors/components/AuthorColorsPanel.js +1 -1
- package/dist/features/authors/feature.js +1 -1
- package/dist/features/authors/index.js +1 -1
- package/dist/features/authors/react/AuthorColorsPanel.js +1 -1
- package/dist/features/comments/components/CommentBubble.js +1 -1
- package/dist/features/comments/components/CommentComposer.js +1 -1
- package/dist/features/comments/components/CommentThreadView.js +5 -2
- package/dist/features/comments/components/CommentThreadView.js.map +1 -1
- package/dist/features/comments/components/CommentsMargin.js +108 -230
- package/dist/features/comments/components/CommentsMargin.js.map +1 -1
- package/dist/features/comments/components/CommentsOverlay.js +1 -1
- package/dist/features/comments/feature.js +1 -1
- package/dist/features/comments/index.d.ts +4 -2
- package/dist/features/comments/index.js +4 -2
- package/dist/features/comments/margin-controller.d.ts +44 -0
- package/dist/features/comments/margin-controller.js +132 -0
- package/dist/features/comments/margin-controller.js.map +1 -0
- package/dist/features/comments/margin-layout.d.ts +55 -0
- package/dist/features/comments/margin-layout.js +79 -0
- package/dist/features/comments/margin-layout.js.map +1 -0
- package/dist/features/comments/model.d.ts +8 -0
- package/dist/features/comments/model.js +60 -34
- package/dist/features/comments/model.js.map +1 -1
- package/dist/features/comments/react/CommentBubble.js +1 -1
- package/dist/features/comments/react/CommentComposer.js +1 -1
- package/dist/features/comments/react/CommentThreadView.js +2 -2
- package/dist/features/comments/react/CommentThreadView.js.map +1 -1
- package/dist/features/comments/react/CommentsMargin.d.ts +0 -5
- package/dist/features/comments/react/CommentsMargin.js +85 -251
- package/dist/features/comments/react/CommentsMargin.js.map +1 -1
- package/dist/features/comments/react/CommentsOverlay.js +1 -1
- package/dist/features/comments/react/use-comments.js +1 -1
- package/dist/features/comments/react/use-margin-layout.js +45 -0
- package/dist/features/comments/react/use-margin-layout.js.map +1 -0
- package/dist/features/comments/react.d.ts +1 -1
- package/dist/features/comments/schema.d.ts +23 -0
- package/dist/features/comments/schema.js.map +1 -1
- package/dist/features/comments/snapshot-equality.js +40 -0
- package/dist/features/comments/snapshot-equality.js.map +1 -0
- package/dist/features/comments/thread-anchor.js +33 -0
- package/dist/features/comments/thread-anchor.js.map +1 -0
- package/dist/features/comments/use-comments.d.ts +3 -1
- package/dist/features/comments/use-comments.js +1 -0
- package/dist/features/comments/use-comments.js.map +1 -1
- package/dist/features/comments/use-margin-layout.js +29 -0
- package/dist/features/comments/use-margin-layout.js.map +1 -0
- package/dist/features/comments/vue.d.ts +1 -1
- package/dist/features/composites/accepted-children.d.ts +21 -0
- package/dist/features/composites/accepted-children.js +126 -0
- package/dist/features/composites/accepted-children.js.map +1 -0
- package/dist/features/composites/components/CompositeDetails.js +1 -1
- package/dist/features/composites/components/CompositeInspector.js +38 -164
- package/dist/features/composites/components/CompositeInspector.js.map +1 -1
- package/dist/features/composites/feature.d.ts +2 -1
- package/dist/features/composites/feature.js +8 -2
- package/dist/features/composites/feature.js.map +1 -1
- package/dist/features/composites/index.d.ts +5 -3
- package/dist/features/composites/index.js +8 -6
- package/dist/features/composites/inspector-model.d.ts +97 -0
- package/dist/features/composites/inspector-model.js +255 -0
- package/dist/features/composites/inspector-model.js.map +1 -0
- package/dist/features/composites/kinds.d.ts +11 -0
- package/dist/features/composites/kinds.js +17 -2
- package/dist/features/composites/kinds.js.map +1 -1
- package/dist/features/composites/outline.d.ts +18 -5
- package/dist/features/composites/outline.js +44 -12
- package/dist/features/composites/outline.js.map +1 -1
- package/dist/features/composites/react/CompositeDetails.js +1 -1
- package/dist/features/composites/react/CompositeInspector.d.ts +1 -1
- package/dist/features/composites/react/CompositeInspector.js +21 -180
- package/dist/features/composites/react/CompositeInspector.js.map +1 -1
- package/dist/features/composites/react/CompositeStatusMenu.d.ts +1 -1
- package/dist/features/composites/react/CompositeView.js +1 -1
- package/dist/features/composites/react/use-composite-inspector.js +29 -0
- package/dist/features/composites/react/use-composite-inspector.js.map +1 -0
- package/dist/features/composites/schema.d.ts +2 -2
- package/dist/features/composites/schema.js +2 -2
- package/dist/features/composites/schema.js.map +1 -1
- package/dist/features/composites/use-composite-anchors.d.ts +1 -1
- package/dist/features/composites/use-composite-inspector.js +41 -0
- package/dist/features/composites/use-composite-inspector.js.map +1 -0
- package/dist/features/composites/use-composite-rows.d.ts +1 -1
- package/dist/features/media/index.d.ts +1 -1
- package/dist/features/media/vue.d.ts +1 -1
- package/dist/features/mentions/index.d.ts +3 -3
- package/dist/features/mentions/index.js +3 -3
- package/dist/features/mentions/schema.d.ts +1 -1
- package/dist/features/mentions/schema.js +1 -1
- package/dist/features/themes/index.d.ts +1 -1
- package/dist/features/themes/index.js +1 -1
- package/dist/features/transcript/feature.js +1 -1
- package/dist/features/transcript/index.js +2 -2
- package/dist/i18n/de/ai.js +2 -0
- package/dist/i18n/de/ai.js.map +1 -1
- package/dist/i18n/de/common.js +1 -2
- package/dist/i18n/de/common.js.map +1 -1
- package/dist/i18n/de/composites.js +8 -1
- package/dist/i18n/de/composites.js.map +1 -1
- package/dist/i18n/de/tree.js +14 -1
- package/dist/i18n/de/tree.js.map +1 -1
- package/dist/i18n/de.d.ts +22 -1
- package/dist/i18n/en/ai.js +2 -0
- package/dist/i18n/en/ai.js.map +1 -1
- package/dist/i18n/en/common.js +1 -2
- package/dist/i18n/en/common.js.map +1 -1
- package/dist/i18n/en/composites.js +8 -1
- package/dist/i18n/en/composites.js.map +1 -1
- package/dist/i18n/en/tree.js +14 -1
- package/dist/i18n/en/tree.js.map +1 -1
- package/dist/integrations/composite-ai/composite-fill.js +2 -2
- package/dist/integrations/composite-ai/composite-summary.js +2 -2
- package/dist/integrations/composite-ai/index.js +2 -2
- package/dist/integrations/transcript-ai/transcript-cleanup.js +1 -1
- package/dist/markdown/MarkdownSurface.d.ts +1 -1
- package/dist/markdown/MarkdownSurface.js +2 -2
- package/dist/markdown/MarkdownSurface.vue.d.ts +7 -7
- package/dist/markdown/index.d.ts +2 -2
- package/dist/nuxt/module.d.ts +0 -6
- package/dist/nuxt/module.js +3 -5
- package/dist/nuxt/module.js.map +1 -1
- package/dist/nuxt/runtime/install-context.d.ts +2 -3
- package/dist/nuxt/runtime/install-context.js +2 -3
- package/dist/nuxt/runtime/install-context.js.map +1 -1
- package/dist/nuxt/runtime/plugins/editor-context-nuxt-ui.client.ts +1 -1
- package/dist/nuxt/runtime/server/routes/collab/[id].js +1 -1
- package/dist/react/EditorSurface.d.ts +1 -1
- package/dist/react/EditorSurface.js +43 -149
- package/dist/react/EditorSurface.js.map +1 -1
- package/dist/react/EditorToolbar.js +3 -40
- package/dist/react/EditorToolbar.js.map +1 -1
- package/dist/react/styles/ui-vars.css +2 -2
- package/dist/schema/advanced.js +2 -2
- package/dist/server/adapter.d.ts +2 -2
- package/dist/server/collab.js +1 -1
- package/dist/server/handlers/ai.d.ts +4 -2
- package/dist/server/handlers/ai.js +11 -9
- package/dist/server/handlers/ai.js.map +1 -1
- package/dist/server/handlers/context.d.ts +1 -1
- package/dist/server/handlers/editor.d.ts +1 -1
- package/dist/server/handlers/editor.js +2 -2
- package/dist/server/host.d.ts +1 -1
- package/dist/server/index.d.ts +2 -2
- package/dist/settings/index.d.ts +1 -1
- package/dist/styles/ai.css +1 -1
- package/dist/styles/authors.css +1 -1
- package/dist/styles/block-ui.css +1 -1
- package/dist/styles/collab.css +1 -1
- package/dist/styles/comments.css +1 -1
- package/dist/styles/core.css +2 -2
- package/dist/styles/media.css +1 -1
- package/dist/styles/mentions.css +1 -1
- package/dist/styles/themes.css +1 -1
- package/dist/styles/tokens.css +1 -1
- package/dist/styles/transcript.css +1 -1
- package/dist/tree/DocumentTree.js +159 -387
- package/dist/tree/DocumentTree.js.map +1 -1
- package/dist/tree/drop-rules.js +37 -0
- package/dist/tree/drop-rules.js.map +1 -0
- package/dist/tree/react/DocumentTree.d.ts +2 -2
- package/dist/tree/react/DocumentTree.js +135 -397
- package/dist/tree/react/DocumentTree.js.map +1 -1
- package/dist/tree/react/use-tree-model.js +129 -0
- package/dist/tree/react/use-tree-model.js.map +1 -0
- package/dist/tree/react.js +1 -1
- package/dist/tree/tree-host.js +100 -0
- package/dist/tree/tree-host.js.map +1 -0
- package/dist/tree/tree-items.js +22 -43
- package/dist/tree/tree-items.js.map +1 -1
- package/dist/tree/tree-model.js +580 -0
- package/dist/tree/tree-model.js.map +1 -0
- package/dist/tree/tree-rows.js +77 -0
- package/dist/tree/tree-rows.js.map +1 -0
- package/dist/tree/use-tree-model.js +94 -0
- package/dist/tree/use-tree-model.js.map +1 -0
- package/dist/tree/vue.js +1 -1
- package/dist/vue/AdvancedEditor.vue.d.ts +4 -4
- package/dist/vue/SimpleEditor.vue.d.ts +2 -2
- package/dist/vue/components/EditorSurface.js +27 -87
- package/dist/vue/components/EditorSurface.js.map +1 -1
- package/dist/vue/components/EditorSurface.vue.d.ts +4 -4
- package/dist/vue/components/EditorToolbar.js +7 -44
- package/dist/vue/components/EditorToolbar.js.map +1 -1
- package/dist/vue/context.d.ts +4 -4
- package/dist/vue/context.js +3 -2
- package/dist/vue/context.js.map +1 -1
- package/dist/vue/kit/types.d.ts +1 -1
- package/dist/vue/kit/use-ui-kit.d.ts +2 -2
- package/dist/vue/kit/use-ui-kit.js +3 -3
- package/dist/vue/kit/use-ui-kit.js.map +1 -1
- package/dist/vue/use-editor-ui.d.ts +1 -1
- package/dist/vue/use-notifier.d.ts +1 -1
- package/docs/integration.md +98 -5
- package/docs/llms.md +10 -2
- package/docs/usage.md +10 -5
- package/package.json +70 -23
- package/dist/nuxt/runtime/plugins/editor-context-primevue.client.ts +0 -8
- package/dist/vue/kit/primevue/Alert.js +0 -49
- package/dist/vue/kit/primevue/Alert.js.map +0 -1
- package/dist/vue/kit/primevue/Avatar.js +0 -54
- package/dist/vue/kit/primevue/Avatar.js.map +0 -1
- package/dist/vue/kit/primevue/Badge.js +0 -41
- package/dist/vue/kit/primevue/Badge.js.map +0 -1
- package/dist/vue/kit/primevue/Button.js +0 -112
- package/dist/vue/kit/primevue/Button.js.map +0 -1
- package/dist/vue/kit/primevue/Chip.js +0 -38
- package/dist/vue/kit/primevue/Chip.js.map +0 -1
- package/dist/vue/kit/primevue/DropdownMenu.js +0 -98
- package/dist/vue/kit/primevue/DropdownMenu.js.map +0 -1
- package/dist/vue/kit/primevue/FieldGroup.js +0 -22
- package/dist/vue/kit/primevue/FieldGroup.js.map +0 -1
- package/dist/vue/kit/primevue/FormField.js +0 -56
- package/dist/vue/kit/primevue/FormField.js.map +0 -1
- package/dist/vue/kit/primevue/Icon.js +0 -23
- package/dist/vue/kit/primevue/Icon.js.map +0 -1
- package/dist/vue/kit/primevue/Input.js +0 -96
- package/dist/vue/kit/primevue/Input.js.map +0 -1
- package/dist/vue/kit/primevue/InputMenu.js +0 -122
- package/dist/vue/kit/primevue/InputMenu.js.map +0 -1
- package/dist/vue/kit/primevue/Modal.js +0 -59
- package/dist/vue/kit/primevue/Modal.js.map +0 -1
- package/dist/vue/kit/primevue/Popover.js +0 -135
- package/dist/vue/kit/primevue/Popover.js.map +0 -1
- package/dist/vue/kit/primevue/RadioGroup.js +0 -58
- package/dist/vue/kit/primevue/RadioGroup.js.map +0 -1
- package/dist/vue/kit/primevue/Select.js +0 -68
- package/dist/vue/kit/primevue/Select.js.map +0 -1
- package/dist/vue/kit/primevue/SelectMenu.js +0 -94
- package/dist/vue/kit/primevue/SelectMenu.js.map +0 -1
- package/dist/vue/kit/primevue/Separator.js +0 -16
- package/dist/vue/kit/primevue/Separator.js.map +0 -1
- package/dist/vue/kit/primevue/Switch.js +0 -46
- package/dist/vue/kit/primevue/Switch.js.map +0 -1
- package/dist/vue/kit/primevue/Table.js +0 -54
- package/dist/vue/kit/primevue/Table.js.map +0 -1
- package/dist/vue/kit/primevue/Tabs.js +0 -49
- package/dist/vue/kit/primevue/Tabs.js.map +0 -1
- package/dist/vue/kit/primevue/Textarea.js +0 -55
- package/dist/vue/kit/primevue/Textarea.js.map +0 -1
- package/dist/vue/kit/primevue/Tooltip.js +0 -43
- package/dist/vue/kit/primevue/Tooltip.js.map +0 -1
- package/dist/vue/kit/primevue/Tree.js +0 -75
- package/dist/vue/kit/primevue/Tree.js.map +0 -1
- package/dist/vue/kit/primevue/select-options.js +0 -55
- package/dist/vue/kit/primevue/select-options.js.map +0 -1
- package/dist/vue/kit/primevue/shared.js +0 -49
- package/dist/vue/kit/primevue/shared.js.map +0 -1
- package/dist/vue/kit/primevue/trigger.js +0 -25
- package/dist/vue/kit/primevue/trigger.js.map +0 -1
- package/dist/vue/kit/primevue.css +0 -86
- package/dist/vue/kit/primevue.d.ts +0 -33
- package/dist/vue/kit/primevue.js +0 -96
- package/dist/vue/kit/primevue.js.map +0 -1
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { sizeOf } from "./shared.js";
|
|
2
|
-
import _sfc_main$1 from "./Icon.js";
|
|
3
|
-
import { choiceOf, choicesOf } from "./select-options.js";
|
|
4
|
-
import { computed, createBlock, createCommentVNode, createElementVNode, defineComponent, openBlock, toDisplayString, unref, withCtx } from "vue";
|
|
5
|
-
import PSelect from "primevue/select";
|
|
6
|
-
//#region src/vue/kit/primevue/Select.vue
|
|
7
|
-
const _hoisted_1 = { class: "inline-flex min-w-0 items-center gap-2" };
|
|
8
|
-
const _hoisted_2 = { class: "truncate" };
|
|
9
|
-
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
10
|
-
__name: "Select",
|
|
11
|
-
props: {
|
|
12
|
-
modelValue: {},
|
|
13
|
-
items: {},
|
|
14
|
-
placeholder: {},
|
|
15
|
-
size: {},
|
|
16
|
-
disabled: { type: Boolean }
|
|
17
|
-
},
|
|
18
|
-
emits: ["update:modelValue"],
|
|
19
|
-
setup(__props, { emit: __emit }) {
|
|
20
|
-
const props = __props;
|
|
21
|
-
const emit = __emit;
|
|
22
|
-
const choices = computed(() => choicesOf(props.items));
|
|
23
|
-
/** A choice's `onSelect` may `preventDefault()` the change, like in the Nuxt UI kit. */
|
|
24
|
-
function onChange(value) {
|
|
25
|
-
if (value === void 0) return;
|
|
26
|
-
const choice = choiceOf(choices.value.options, value);
|
|
27
|
-
if (choice?.onSelect) {
|
|
28
|
-
const event = new Event("select", { cancelable: true });
|
|
29
|
-
choice.onSelect(event);
|
|
30
|
-
if (event.defaultPrevented) return;
|
|
31
|
-
}
|
|
32
|
-
emit("update:modelValue", value);
|
|
33
|
-
}
|
|
34
|
-
return (_ctx, _cache) => {
|
|
35
|
-
return openBlock(), createBlock(unref(PSelect), {
|
|
36
|
-
"model-value": __props.modelValue,
|
|
37
|
-
options: choices.value.options,
|
|
38
|
-
"option-label": "label",
|
|
39
|
-
"option-value": "value",
|
|
40
|
-
"option-disabled": "disabled",
|
|
41
|
-
"option-group-label": choices.value.grouped ? "label" : void 0,
|
|
42
|
-
"option-group-children": choices.value.grouped ? "items" : void 0,
|
|
43
|
-
placeholder: __props.placeholder,
|
|
44
|
-
size: unref(sizeOf)(__props.size),
|
|
45
|
-
disabled: __props.disabled,
|
|
46
|
-
"onUpdate:modelValue": onChange
|
|
47
|
-
}, {
|
|
48
|
-
option: withCtx(({ option }) => [createElementVNode("span", _hoisted_1, [option.icon ? (openBlock(), createBlock(_sfc_main$1, {
|
|
49
|
-
key: 0,
|
|
50
|
-
name: option.icon
|
|
51
|
-
}, null, 8, ["name"])) : createCommentVNode("v-if", true), createElementVNode("span", _hoisted_2, toDisplayString(option.label), 1)])]),
|
|
52
|
-
_: 1
|
|
53
|
-
}, 8, [
|
|
54
|
-
"model-value",
|
|
55
|
-
"options",
|
|
56
|
-
"option-group-label",
|
|
57
|
-
"option-group-children",
|
|
58
|
-
"placeholder",
|
|
59
|
-
"size",
|
|
60
|
-
"disabled"
|
|
61
|
-
]);
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
//#endregion
|
|
66
|
-
export { _sfc_main as default };
|
|
67
|
-
|
|
68
|
-
//# sourceMappingURL=Select.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","names":["_openBlock","_createBlock","_unref","_withCtx","_createElementVNode","Icon","_createCommentVNode","_toDisplayString"],"sources":["../../../../src/vue/kit/primevue/Select.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport PSelect from 'primevue/select'\nimport { computed } from 'vue'\nimport type { SelectProps } from '../types'\nimport Icon from './Icon.vue'\nimport { choiceOf, choicesOf } from './select-options'\nimport { sizeOf } from './shared'\n\nconst props = defineProps<SelectProps>()\nconst emit = defineEmits<{ 'update:modelValue': [value: string | number] }>()\n\nconst choices = computed(() => choicesOf(props.items))\n\n/** A choice's `onSelect` may `preventDefault()` the change, like in the Nuxt UI kit. */\nfunction onChange(value: string | number | undefined) {\n if (value === undefined) return\n const choice = choiceOf(choices.value.options, value)\n if (choice?.onSelect) {\n const event = new Event('select', { cancelable: true })\n choice.onSelect(event)\n if (event.defaultPrevented) return\n }\n emit('update:modelValue', value)\n}\n</script>\n\n<template>\n <PSelect\n :model-value=\"modelValue\"\n :options=\"choices.options\"\n option-label=\"label\"\n option-value=\"value\"\n option-disabled=\"disabled\"\n :option-group-label=\"choices.grouped ? 'label' : undefined\"\n :option-group-children=\"choices.grouped ? 'items' : undefined\"\n :placeholder=\"placeholder\"\n :size=\"sizeOf(size)\"\n :disabled=\"disabled\"\n @update:model-value=\"onChange\"\n >\n <template #option=\"{ option }\">\n <span class=\"inline-flex min-w-0 items-center gap-2\">\n <Icon v-if=\"option.icon\" :name=\"option.icon\" />\n <span class=\"truncate\">{{ option.label }}</span>\n </span>\n </template>\n </PSelect>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;EAQA,MAAM,QAAQ;EACd,MAAM,OAAO;EAEb,MAAM,UAAU,eAAe,UAAU,MAAM,KAAK,CAAC;;EAGrD,SAAS,SAAS,OAAoC;GACpD,IAAI,UAAU,KAAA,GAAW;GACzB,MAAM,SAAS,SAAS,QAAQ,MAAM,SAAS,KAAK;GACpD,IAAI,QAAQ,UAAU;IACpB,MAAM,QAAQ,IAAI,MAAM,UAAU,EAAE,YAAY,KAAK,CAAC;IACtD,OAAO,SAAS,KAAK;IACrB,IAAI,MAAM,kBAAkB;GAC9B;GACA,KAAK,qBAAqB,KAAK;EACjC;;GAIE,OAAAA,UAAA,GAAAC,YAmBUC,MAAA,OAAA,GAAA;IAlBP,eAAa,QAAA;IACb,SAAS,QAAA,MAAQ;IAClB,gBAAa;IACb,gBAAa;IACb,mBAAgB;IACf,sBAAoB,QAAA,MAAQ,UAAO,UAAa,KAAA;IAChD,yBAAuB,QAAA,MAAQ,UAAO,UAAa,KAAA;IACnD,aAAa,QAAA;IACb,MAAMA,MAAA,MAAA,CAAM,CAAC,QAAA,IAAI;IACjB,UAAU,QAAA;IACV,uBAAoB;;IAEV,QAAMC,SAIR,EAJY,aAAM,CACzBC,mBAGO,QAHP,YAGO,CAFO,OAAO,QAAnBJ,UAAA,GAAAC,YAA+CI,aAAA;;KAArB,MAAM,OAAO;IACvC,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA,KAAAC,mBAAA,QAAA,IAAA,GAAAF,mBAAgD,QAAhD,YAAgDG,gBAAtB,OAAO,KAAK,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { sizeOf } from "./shared.js";
|
|
2
|
-
import _sfc_main$1 from "./Icon.js";
|
|
3
|
-
import { choiceOf, choicesOf } from "./select-options.js";
|
|
4
|
-
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, openBlock, toDisplayString, unref, useTemplateRef, watch, withCtx } from "vue";
|
|
5
|
-
import PSelect from "primevue/select";
|
|
6
|
-
//#region src/vue/kit/primevue/SelectMenu.vue
|
|
7
|
-
const _hoisted_1 = { class: "inline-flex min-w-0 items-center gap-2" };
|
|
8
|
-
const _hoisted_2 = { class: "truncate" };
|
|
9
|
-
const _hoisted_3 = { class: "sk-select-option" };
|
|
10
|
-
const _hoisted_4 = { class: "sk-select-option-text" };
|
|
11
|
-
const _hoisted_5 = { class: "truncate" };
|
|
12
|
-
const _hoisted_6 = {
|
|
13
|
-
key: 0,
|
|
14
|
-
class: "sk-select-option-description"
|
|
15
|
-
};
|
|
16
|
-
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
17
|
-
__name: "SelectMenu",
|
|
18
|
-
props: {
|
|
19
|
-
modelValue: {},
|
|
20
|
-
items: {},
|
|
21
|
-
valueKey: {},
|
|
22
|
-
searchInput: { type: Boolean },
|
|
23
|
-
placeholder: {},
|
|
24
|
-
icon: {},
|
|
25
|
-
size: {},
|
|
26
|
-
open: { type: Boolean },
|
|
27
|
-
ui: {}
|
|
28
|
-
},
|
|
29
|
-
emits: ["update:modelValue", "update:open"],
|
|
30
|
-
setup(__props, { emit: __emit }) {
|
|
31
|
-
const props = __props;
|
|
32
|
-
const emit = __emit;
|
|
33
|
-
const select = useTemplateRef("select");
|
|
34
|
-
const choices = computed(() => choicesOf(props.items));
|
|
35
|
-
watch(() => props.open, (open) => {
|
|
36
|
-
if (open === void 0 || !select.value) return;
|
|
37
|
-
if (open && !select.value.overlayVisible) select.value.show();
|
|
38
|
-
else if (!open && select.value.overlayVisible) select.value.hide();
|
|
39
|
-
}, { flush: "post" });
|
|
40
|
-
function onChange(value) {
|
|
41
|
-
if (value === void 0) return;
|
|
42
|
-
const choice = choiceOf(choices.value.options, value);
|
|
43
|
-
if (choice?.onSelect) {
|
|
44
|
-
const event = new Event("select", { cancelable: true });
|
|
45
|
-
choice.onSelect(event);
|
|
46
|
-
if (event.defaultPrevented) return;
|
|
47
|
-
}
|
|
48
|
-
emit("update:modelValue", value);
|
|
49
|
-
}
|
|
50
|
-
return (_ctx, _cache) => {
|
|
51
|
-
return openBlock(), createBlock(unref(PSelect), {
|
|
52
|
-
ref_key: "select",
|
|
53
|
-
ref: select,
|
|
54
|
-
"model-value": __props.modelValue,
|
|
55
|
-
options: choices.value.options,
|
|
56
|
-
"option-label": "label",
|
|
57
|
-
"option-value": "value",
|
|
58
|
-
"option-disabled": "disabled",
|
|
59
|
-
"option-group-label": choices.value.grouped ? "label" : void 0,
|
|
60
|
-
"option-group-children": choices.value.grouped ? "items" : void 0,
|
|
61
|
-
filter: __props.searchInput !== false,
|
|
62
|
-
placeholder: __props.placeholder,
|
|
63
|
-
size: unref(sizeOf)(__props.size),
|
|
64
|
-
"overlay-class": __props.ui?.content,
|
|
65
|
-
"onUpdate:modelValue": onChange,
|
|
66
|
-
onShow: _cache[0] || (_cache[0] = ($event) => emit("update:open", true)),
|
|
67
|
-
onHide: _cache[1] || (_cache[1] = ($event) => emit("update:open", false))
|
|
68
|
-
}, createSlots({
|
|
69
|
-
option: withCtx(({ option }) => [createElementVNode("span", _hoisted_3, [option.icon ? (openBlock(), createBlock(_sfc_main$1, {
|
|
70
|
-
key: 0,
|
|
71
|
-
name: option.icon
|
|
72
|
-
}, null, 8, ["name"])) : createCommentVNode("v-if", true), createElementVNode("span", _hoisted_4, [createElementVNode("span", _hoisted_5, toDisplayString(option.label), 1), option.description ? (openBlock(), createElementBlock("span", _hoisted_6, toDisplayString(option.description), 1)) : createCommentVNode("v-if", true)])])]),
|
|
73
|
-
_: 2
|
|
74
|
-
}, [__props.icon ? {
|
|
75
|
-
name: "value",
|
|
76
|
-
fn: withCtx(({ value, placeholder: hint }) => [createElementVNode("span", _hoisted_1, [createVNode(_sfc_main$1, { name: __props.icon }, null, 8, ["name"]), createElementVNode("span", _hoisted_2, toDisplayString(unref(choiceOf)(choices.value.options, value)?.label ?? hint), 1)])]),
|
|
77
|
-
key: "0"
|
|
78
|
-
} : void 0]), 1032, [
|
|
79
|
-
"model-value",
|
|
80
|
-
"options",
|
|
81
|
-
"option-group-label",
|
|
82
|
-
"option-group-children",
|
|
83
|
-
"filter",
|
|
84
|
-
"placeholder",
|
|
85
|
-
"size",
|
|
86
|
-
"overlay-class"
|
|
87
|
-
]);
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
//#endregion
|
|
92
|
-
export { _sfc_main as default };
|
|
93
|
-
|
|
94
|
-
//# sourceMappingURL=SelectMenu.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectMenu.js","names":["_openBlock","_createBlock","_unref","_createSlots","_withCtx","_createElementVNode","Icon","_createCommentVNode","_toDisplayString","_createElementBlock","_createVNode"],"sources":["../../../../src/vue/kit/primevue/SelectMenu.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport PSelect from 'primevue/select'\nimport { computed, useTemplateRef, watch } from 'vue'\nimport type { SelectMenuProps } from '../types'\nimport Icon from './Icon.vue'\nimport { choiceOf, choicesOf } from './select-options'\nimport { sizeOf } from './shared'\n\nconst props = defineProps<SelectMenuProps>()\nconst emit = defineEmits<{ 'update:modelValue': [value: string | number], 'update:open': [open: boolean] }>()\n\nconst select = useTemplateRef<{ show: () => void, hide: () => void, overlayVisible?: boolean }>('select')\nconst choices = computed(() => choicesOf(props.items))\n\n// `open` is two-way: the host may open or close the list, the list reports its own changes.\nwatch(() => props.open, (open) => {\n if (open === undefined || !select.value) return\n if (open && !select.value.overlayVisible) select.value.show()\n else if (!open && select.value.overlayVisible) select.value.hide()\n}, { flush: 'post' })\n\nfunction onChange(value: string | number | undefined) {\n if (value === undefined) return\n const choice = choiceOf(choices.value.options, value)\n if (choice?.onSelect) {\n const event = new Event('select', { cancelable: true })\n choice.onSelect(event)\n if (event.defaultPrevented) return\n }\n emit('update:modelValue', value)\n}\n</script>\n\n<template>\n <PSelect\n ref=\"select\"\n :model-value=\"modelValue\"\n :options=\"choices.options\"\n option-label=\"label\"\n option-value=\"value\"\n option-disabled=\"disabled\"\n :option-group-label=\"choices.grouped ? 'label' : undefined\"\n :option-group-children=\"choices.grouped ? 'items' : undefined\"\n :filter=\"searchInput !== false\"\n :placeholder=\"placeholder\"\n :size=\"sizeOf(size)\"\n :overlay-class=\"ui?.content\"\n @update:model-value=\"onChange\"\n @show=\"emit('update:open', true)\"\n @hide=\"emit('update:open', false)\"\n >\n <template v-if=\"icon\" #value=\"{ value, placeholder: hint }\">\n <span class=\"inline-flex min-w-0 items-center gap-2\">\n <Icon :name=\"icon\" />\n <span class=\"truncate\">{{ choiceOf(choices.options, value)?.label ?? hint }}</span>\n </span>\n </template>\n <template #option=\"{ option }\">\n <span class=\"sk-select-option\">\n <Icon v-if=\"option.icon\" :name=\"option.icon\" />\n <span class=\"sk-select-option-text\">\n <span class=\"truncate\">{{ option.label }}</span>\n <span v-if=\"option.description\" class=\"sk-select-option-description\">{{ option.description }}</span>\n </span>\n </span>\n </template>\n </PSelect>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQA,MAAM,QAAQ;EACd,MAAM,OAAO;EAEb,MAAM,SAAS,eAAiF,QAAQ;EACxG,MAAM,UAAU,eAAe,UAAU,MAAM,KAAK,CAAC;EAGrD,YAAY,MAAM,OAAO,SAAS;GAChC,IAAI,SAAS,KAAA,KAAa,CAAC,OAAO,OAAO;GACzC,IAAI,QAAQ,CAAC,OAAO,MAAM,gBAAgB,OAAO,MAAM,KAAK;QACvD,IAAI,CAAC,QAAQ,OAAO,MAAM,gBAAgB,OAAO,MAAM,KAAK;EACnE,GAAG,EAAE,OAAO,OAAO,CAAC;EAEpB,SAAS,SAAS,OAAoC;GACpD,IAAI,UAAU,KAAA,GAAW;GACzB,MAAM,SAAS,SAAS,QAAQ,MAAM,SAAS,KAAK;GACpD,IAAI,QAAQ,UAAU;IACpB,MAAM,QAAQ,IAAI,MAAM,UAAU,EAAE,YAAY,KAAK,CAAC;IACtD,OAAO,SAAS,KAAK;IACrB,IAAI,MAAM,kBAAkB;GAC9B;GACA,KAAK,qBAAqB,KAAK;EACjC;;GAIE,OAAAA,UAAA,GAAAC,YAgCUC,MAAA,OAAA,GAAA;IA/BJ,SAAA;IAAJ,KAAI;IACH,eAAa,QAAA;IACb,SAAS,QAAA,MAAQ;IAClB,gBAAa;IACb,gBAAa;IACb,mBAAgB;IACf,sBAAoB,QAAA,MAAQ,UAAO,UAAa,KAAA;IAChD,yBAAuB,QAAA,MAAQ,UAAO,UAAa,KAAA;IACnD,QAAQ,QAAA,gBAAW;IACnB,aAAa,QAAA;IACb,MAAMA,MAAA,MAAA,CAAM,CAAC,QAAA,IAAI;IACjB,iBAAe,QAAA,IAAI;IACnB,uBAAoB;IACpB,QAAI,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,eAAA,IAAA;IACV,QAAI,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,eAAA,KAAA;;IAQA,QAAME,SAOR,EAPY,aAAM,CACzBC,mBAMO,QANP,YAMO,CALO,OAAO,QAAnBL,UAAA,GAAAC,YAA+CK,aAAA;;KAArB,MAAM,OAAO;IACvC,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA,KAAAC,mBAAA,QAAA,IAAA,GAAAF,mBAGO,QAHP,YAGO,CAFLA,mBAAgD,QAAhD,YAAgDG,gBAAtB,OAAO,KAAK,GAAA,CAAA,GAC1B,OAAO,eAAnBR,UAAA,GAAAS,mBAAoG,QAApG,YAAoGD,gBAA5B,OAAO,WAAW,GAAA,CAAA,KAAAD,mBAAA,QAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;GAXhF,GAAA,CAAA,QAAA,OAAA;IAAO,MAAA;IACrB,IAAAH,SAGO,EAJuB,OAAK,aAAe,WAAI,CACtDC,mBAGO,QAHP,YAGO,CAFLK,YAAqBJ,aAAA,EAAd,MAAM,QAAA,KAAI,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA,GACjBD,mBAAmF,QAAnF,YAAmFG,gBAAzDN,MAAA,QAAA,CAAQ,CAAC,QAAA,MAAQ,SAAS,KAAK,CAAA,EAAG,SAAS,IAAI,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { createBlock, defineComponent, openBlock, unref } from "vue";
|
|
2
|
-
import PDivider from "primevue/divider";
|
|
3
|
-
//#region src/vue/kit/primevue/Separator.vue
|
|
4
|
-
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
5
|
-
__name: "Separator",
|
|
6
|
-
props: { orientation: {} },
|
|
7
|
-
setup(__props) {
|
|
8
|
-
return (_ctx, _cache) => {
|
|
9
|
-
return openBlock(), createBlock(unref(PDivider), { layout: __props.orientation === "vertical" ? "vertical" : "horizontal" }, null, 8, ["layout"]);
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
//#endregion
|
|
14
|
-
export { _sfc_main as default };
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=Separator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Separator.js","names":["_openBlock","_createBlock","_unref"],"sources":["../../../../src/vue/kit/primevue/Separator.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport PDivider from 'primevue/divider'\nimport type { SeparatorProps } from '../types'\n\ndefineProps<SeparatorProps>()\n</script>\n\n<template>\n <PDivider :layout=\"orientation === 'vertical' ? 'vertical' : 'horizontal'\" />\n</template>\n"],"mappings":";;;;;;;;GAQE,OAAAA,UAAA,GAAAC,YAA6EC,MAAA,QAAA,GAAA,EAAlE,QAAQ,QAAA,gBAAW,aAAA,aAAA,aAAA,GAAA,MAAA,GAAA,CAAA,QAAA,CAAA"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { createCommentVNode, createElementBlock, createVNode, defineComponent, openBlock, toDisplayString, unref, useId } from "vue";
|
|
2
|
-
import ToggleSwitch from "primevue/toggleswitch";
|
|
3
|
-
//#region src/vue/kit/primevue/Switch.vue
|
|
4
|
-
const _hoisted_1 = { class: "sk-switch" };
|
|
5
|
-
const _hoisted_2 = ["for"];
|
|
6
|
-
const _hoisted_3 = {
|
|
7
|
-
key: 0,
|
|
8
|
-
class: "sk-switch-label"
|
|
9
|
-
};
|
|
10
|
-
const _hoisted_4 = {
|
|
11
|
-
key: 1,
|
|
12
|
-
class: "sk-switch-description"
|
|
13
|
-
};
|
|
14
|
-
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
15
|
-
__name: "Switch",
|
|
16
|
-
props: {
|
|
17
|
-
modelValue: { type: Boolean },
|
|
18
|
-
label: {},
|
|
19
|
-
description: {},
|
|
20
|
-
disabled: { type: Boolean }
|
|
21
|
-
},
|
|
22
|
-
emits: ["update:modelValue"],
|
|
23
|
-
setup(__props) {
|
|
24
|
-
const id = useId();
|
|
25
|
-
return (_ctx, _cache) => {
|
|
26
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [createVNode(unref(ToggleSwitch), {
|
|
27
|
-
"input-id": unref(id),
|
|
28
|
-
"model-value": __props.modelValue,
|
|
29
|
-
disabled: __props.disabled,
|
|
30
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = (value) => _ctx.$emit("update:modelValue", value))
|
|
31
|
-
}, null, 8, [
|
|
32
|
-
"input-id",
|
|
33
|
-
"model-value",
|
|
34
|
-
"disabled"
|
|
35
|
-
]), __props.label || __props.description ? (openBlock(), createElementBlock("label", {
|
|
36
|
-
key: 0,
|
|
37
|
-
for: unref(id),
|
|
38
|
-
class: "sk-switch-text"
|
|
39
|
-
}, [__props.label ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(__props.label), 1)) : createCommentVNode("v-if", true), __props.description ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(__props.description), 1)) : createCommentVNode("v-if", true)], 8, _hoisted_2)) : createCommentVNode("v-if", true)]);
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
//#endregion
|
|
44
|
-
export { _sfc_main as default };
|
|
45
|
-
|
|
46
|
-
//# sourceMappingURL=Switch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.js","names":["$emit","_openBlock","_createElementBlock","_createVNode","_unref","_toDisplayString","_createCommentVNode"],"sources":["../../../../src/vue/kit/primevue/Switch.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport ToggleSwitch from 'primevue/toggleswitch'\nimport { useId } from 'vue'\nimport type { SwitchProps } from '../types'\n\ndefineProps<SwitchProps>()\ndefineEmits<{ 'update:modelValue': [value: boolean] }>()\nconst id = useId()\n</script>\n\n<template>\n <div class=\"sk-switch\">\n <ToggleSwitch :input-id=\"id\" :model-value=\"modelValue\" :disabled=\"disabled\" @update:model-value=\"(value: boolean) => $emit('update:modelValue', value)\" />\n <label v-if=\"label || description\" :for=\"id\" class=\"sk-switch-text\">\n <span v-if=\"label\" class=\"sk-switch-label\">{{ label }}</span>\n <span v-if=\"description\" class=\"sk-switch-description\">{{ description }}</span>\n </label>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;EAOA,MAAM,KAAK,MAAM;;GAIf,OAAAC,UAAA,GAAAC,mBAMM,OANN,YAMM,CALJC,YAA0JC,MAAA,YAAA,GAAA;IAA3I,YAAUA,MAAA,EAAA;IAAK,eAAa,QAAA;IAAa,UAAU,QAAA;IAAW,uBAAkB,OAAA,OAAA,OAAA,MAAG,UAAmBJ,KAAAA,MAAK,qBAAsB,KAAK;;;;;GACxI,CAAA,GAAA,QAAA,SAAS,QAAA,eAAtBC,UAAA,GAAAC,mBAGQ,SAAA;;IAH4B,KAAKE,MAAA,EAAA;IAAI,OAAM;GACrC,GAAA,CAAA,QAAA,SAAZH,UAAA,GAAAC,mBAA6D,QAA7D,YAA6DG,gBAAf,QAAA,KAAK,GAAA,CAAA,KAAAC,mBAAA,QAAA,IAAA,GACvC,QAAA,eAAZL,UAAA,GAAAC,mBAA+E,QAA/E,YAA+EG,gBAArB,QAAA,WAAW,GAAA,CAAA,KAAAC,mBAAA,QAAA,IAAA,CAAA,GAAA,GAAA,UAAA,KAAAA,mBAAA,QAAA,IAAA,CAAA,CAAA"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { Fragment, createBlock, createElementBlock, createSlots, createTextVNode, defineComponent, openBlock, renderList, renderSlot, toDisplayString, unref, withCtx } from "vue";
|
|
2
|
-
import Column from "primevue/column";
|
|
3
|
-
import DataTable from "primevue/datatable";
|
|
4
|
-
//#region src/vue/kit/primevue/Table.vue
|
|
5
|
-
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
6
|
-
__name: "Table",
|
|
7
|
-
props: {
|
|
8
|
-
data: {},
|
|
9
|
-
columns: {},
|
|
10
|
-
getRowId: { type: Function },
|
|
11
|
-
sorting: {},
|
|
12
|
-
sticky: { type: Boolean },
|
|
13
|
-
ui: {}
|
|
14
|
-
},
|
|
15
|
-
emits: ["select"],
|
|
16
|
-
setup(__props) {
|
|
17
|
-
return (_ctx, _cache) => {
|
|
18
|
-
return openBlock(), createBlock(unref(DataTable), {
|
|
19
|
-
value: __props.data,
|
|
20
|
-
scrollable: __props.sticky,
|
|
21
|
-
"scroll-height": __props.sticky ? "flex" : void 0,
|
|
22
|
-
size: "small",
|
|
23
|
-
class: "sk-table",
|
|
24
|
-
"row-hover": "",
|
|
25
|
-
onRowClick: _cache[0] || (_cache[0] = (event) => _ctx.$emit("select", event.originalEvent, { original: event.data }))
|
|
26
|
-
}, createSlots({
|
|
27
|
-
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (column) => {
|
|
28
|
-
return openBlock(), createBlock(unref(Column), {
|
|
29
|
-
key: column.id,
|
|
30
|
-
"header-class": [column.meta?.class?.th, __props.ui?.th],
|
|
31
|
-
"body-class": [column.meta?.class?.td, __props.ui?.td]
|
|
32
|
-
}, {
|
|
33
|
-
header: withCtx(() => [renderSlot(_ctx.$slots, `${column.id}-header`, {}, () => [createTextVNode(toDisplayString(column.header), 1)])]),
|
|
34
|
-
body: withCtx(({ data: row }) => [renderSlot(_ctx.$slots, `${column.id}-cell`, { row: { original: row } }, () => [createTextVNode(toDisplayString(column.accessorFn?.(row)), 1)])]),
|
|
35
|
-
_: 2
|
|
36
|
-
}, 1032, ["header-class", "body-class"]);
|
|
37
|
-
}), 128))]),
|
|
38
|
-
_: 2
|
|
39
|
-
}, [_ctx.$slots.empty ? {
|
|
40
|
-
name: "empty",
|
|
41
|
-
fn: withCtx(() => [renderSlot(_ctx.$slots, "empty")]),
|
|
42
|
-
key: "0"
|
|
43
|
-
} : void 0]), 1032, [
|
|
44
|
-
"value",
|
|
45
|
-
"scrollable",
|
|
46
|
-
"scroll-height"
|
|
47
|
-
]);
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
//#endregion
|
|
52
|
-
export { _sfc_main as default };
|
|
53
|
-
|
|
54
|
-
//# sourceMappingURL=Table.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Table.js","names":["$emit","$slots","_openBlock","_createBlock","_unref","_createSlots","_withCtx","_createElementBlock","_Fragment","_renderList","_renderSlot","_createTextVNode","_toDisplayString"],"sources":["../../../../src/vue/kit/primevue/Table.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport Column from 'primevue/column'\nimport DataTable from 'primevue/datatable'\nimport type { TableProps } from '../types'\n\n// `getRowId`, `sorting` and `ui` are accepted for contract parity: PrimeVue's table does not sort by itself here (the\n// host orders `data`) and has no use for row ids without selection.\ndefineProps<TableProps<any>>()\ndefineEmits<{ select: [event: Event, row: { original: any }] }>()\n</script>\n\n<template>\n <DataTable\n :value=\"data\"\n :scrollable=\"sticky\"\n :scroll-height=\"sticky ? 'flex' : undefined\"\n size=\"small\"\n class=\"sk-table\"\n row-hover\n @row-click=\"(event: { originalEvent: Event, data: unknown }) => $emit('select', event.originalEvent, { original: event.data })\"\n >\n <Column\n v-for=\"column in columns\"\n :key=\"column.id\"\n :header-class=\"[column.meta?.class?.th, ui?.th]\"\n :body-class=\"[column.meta?.class?.td, ui?.td]\"\n >\n <template #header>\n <slot :name=\"`${column.id}-header`\">{{ column.header }}</slot>\n </template>\n <template #body=\"{ data: row }\">\n <slot :name=\"`${column.id}-cell`\" :row=\"{ original: row }\">{{ column.accessorFn?.(row) }}</slot>\n </template>\n </Column>\n <template v-if=\"$slots.empty\" #empty>\n <slot name=\"empty\" />\n </template>\n </DataTable>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;GAYE,OAAAE,UAAA,GAAAC,YAyBYC,MAAA,SAAA,GAAA;IAxBT,OAAO,QAAA;IACP,YAAY,QAAA;IACZ,iBAAe,QAAA,SAAM,SAAY,KAAA;IAClC,MAAK;IACL,OAAM;IACN,aAAA;IACC,YAAS,OAAA,OAAA,OAAA,MAAG,UAAmDJ,KAAAA,MAAK,UAAW,MAAM,eAAa,EAAA,UAAc,MAAM,KAAI,CAAA;;IAGzH,SAAAM,cAAyB,EAD3BJ,UAAA,IAAA,GAAAK,mBAYSC,UAAA,MAAAC,WAXU,QAAA,UAAV,WAAM;KADf,OAAAP,UAAA,GAAAC,YAYSC,MAAA,MAAA,GAAA;MAVN,KAAK,OAAO;MACZ,gBAAY,CAAG,OAAO,MAAM,OAAO,IAAI,QAAA,IAAI,EAAE;MAC7C,cAAU,CAAG,OAAO,MAAM,OAAO,IAAI,QAAA,IAAI,EAAE;;MAEjC,QAAME,cAC+C,CAA9DI,WAA8D,KAAA,QAAA,GAA9C,OAAO,GAAE,UAAA,CAAA,SAAqC,CAAvBC,gBAAAC,gBAAA,OAAO,MAAM,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA;MAE3C,MAAIN,SACmF,EAAA,MADzE,UAAG,CAC1BI,WAAgG,KAAA,QAAA,GAAhF,OAAO,GAAE,QAAA,EAAU,KAAG,EAAA,UAAc,IAAG,EAAvD,SAAgG,CAAlCC,gBAAAC,gBAAA,OAAO,aAAa,GAAG,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;;;;GAGzEX,GAAAA,CAAAA,KAAAA,OAAO,QAAA;IAAQ,MAAA;IAC7B,IAAAK,cAAqB,CAArBI,WAAqB,KAAA,QAAA,OAAA,CAAA,CAAA"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import _sfc_main$1 from "./Icon.js";
|
|
2
|
-
import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, renderList, toDisplayString, unref, withCtx } from "vue";
|
|
3
|
-
import Tab from "primevue/tab";
|
|
4
|
-
import TabList from "primevue/tablist";
|
|
5
|
-
import Tabs from "primevue/tabs";
|
|
6
|
-
//#region src/vue/kit/primevue/Tabs.vue
|
|
7
|
-
const _hoisted_1 = { class: "inline-flex items-center gap-1.5" };
|
|
8
|
-
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
9
|
-
__name: "Tabs",
|
|
10
|
-
props: {
|
|
11
|
-
modelValue: {},
|
|
12
|
-
items: {},
|
|
13
|
-
orientation: {},
|
|
14
|
-
variant: {},
|
|
15
|
-
content: { type: Boolean }
|
|
16
|
-
},
|
|
17
|
-
emits: ["update:modelValue"],
|
|
18
|
-
setup(__props) {
|
|
19
|
-
return (_ctx, _cache) => {
|
|
20
|
-
return openBlock(), createBlock(unref(Tabs), {
|
|
21
|
-
value: __props.modelValue ?? "",
|
|
22
|
-
class: normalizeClass(__props.orientation === "vertical" ? "sk-tabs-vertical" : void 0),
|
|
23
|
-
"onUpdate:value": _cache[0] || (_cache[0] = (value) => _ctx.$emit("update:modelValue", String(value)))
|
|
24
|
-
}, {
|
|
25
|
-
default: withCtx(() => [createVNode(unref(TabList), null, {
|
|
26
|
-
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item) => {
|
|
27
|
-
return openBlock(), createBlock(unref(Tab), {
|
|
28
|
-
key: item.value,
|
|
29
|
-
value: item.value,
|
|
30
|
-
disabled: item.disabled
|
|
31
|
-
}, {
|
|
32
|
-
default: withCtx(() => [createElementVNode("span", _hoisted_1, [item.icon ? (openBlock(), createBlock(_sfc_main$1, {
|
|
33
|
-
key: 0,
|
|
34
|
-
name: item.icon
|
|
35
|
-
}, null, 8, ["name"])) : createCommentVNode("v-if", true), createTextVNode(" " + toDisplayString(item.label), 1)])]),
|
|
36
|
-
_: 2
|
|
37
|
-
}, 1032, ["value", "disabled"]);
|
|
38
|
-
}), 128))]),
|
|
39
|
-
_: 1
|
|
40
|
-
})]),
|
|
41
|
-
_: 1
|
|
42
|
-
}, 8, ["value", "class"]);
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
//#endregion
|
|
47
|
-
export { _sfc_main as default };
|
|
48
|
-
|
|
49
|
-
//# sourceMappingURL=Tabs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.js","names":["$emit","_openBlock","_createBlock","_unref","_normalizeClass","_withCtx","_createVNode","_createElementBlock","_Fragment","_renderList","_createElementVNode","Icon","_createCommentVNode","_createTextVNode","_toDisplayString"],"sources":["../../../../src/vue/kit/primevue/Tabs.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport Tab from 'primevue/tab'\nimport TabList from 'primevue/tablist'\nimport Tabs from 'primevue/tabs'\nimport type { TabsProps } from '../types'\nimport Icon from './Icon.vue'\n\ndefineProps<TabsProps>()\ndefineEmits<{ 'update:modelValue': [value: string] }>()\n</script>\n\n<template>\n <Tabs :value=\"modelValue ?? ''\" :class=\"orientation === 'vertical' ? 'sk-tabs-vertical' : undefined\" @update:value=\"(value: string | number) => $emit('update:modelValue', String(value))\">\n <TabList>\n <Tab v-for=\"item in items\" :key=\"item.value\" :value=\"item.value\" :disabled=\"item.disabled\">\n <span class=\"inline-flex items-center gap-1.5\">\n <Icon v-if=\"item.icon\" :name=\"item.icon\" />\n {{ item.label }}\n </span>\n </Tab>\n </TabList>\n </Tabs>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;GAYE,OAAAC,UAAA,GAAAC,YASOC,MAAA,IAAA,GAAA;IATA,OAAO,QAAA,cAAU;IAAS,OAAKC,eAAE,QAAA,gBAAW,aAAA,qBAAuC,KAAA,CAAS;IAAG,kBAAY,OAAA,OAAA,OAAA,MAAG,UAA2BJ,KAAAA,MAAK,qBAAsB,OAAO,KAAK,CAAA;;IACrL,SAAAK,cAOU,CAPVC,YAOUH,MAAA,OAAA,GAAA,MAAA;KANH,SAAAE,cAAqB,EAA1BJ,UAAA,IAAA,GAAAM,mBAKMC,UAAA,MAAAC,WALc,QAAA,QAAR,SAAI;MAAhB,OAAAR,UAAA,GAAAC,YAKMC,MAAA,GAAA,GAAA;OALsB,KAAK,KAAK;OAAQ,OAAO,KAAK;OAAQ,UAAU,KAAK;;OAC/E,SAAAE,cAGO,CAHPK,mBAGO,QAHP,YAGO,CAFO,KAAK,QAAjBT,UAAA,GAAAC,YAA2CS,aAAA;;QAAnB,MAAM,KAAK;OAAQ,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA,KAAAC,mBAAA,QAAA,IAAA,GAAAC,gBAAA,MAC3CC,gBAAG,KAAK,KAAK,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { computed, createBlock, defineComponent, normalizeStyle, openBlock, unref } from "vue";
|
|
2
|
-
import PTextarea from "primevue/textarea";
|
|
3
|
-
//#region src/vue/kit/primevue/Textarea.vue
|
|
4
|
-
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
5
|
-
__name: "Textarea",
|
|
6
|
-
props: {
|
|
7
|
-
modelValue: {},
|
|
8
|
-
rows: {},
|
|
9
|
-
maxrows: {},
|
|
10
|
-
autoresize: { type: Boolean },
|
|
11
|
-
size: {},
|
|
12
|
-
placeholder: {},
|
|
13
|
-
disabled: { type: Boolean },
|
|
14
|
-
readonly: { type: Boolean },
|
|
15
|
-
maxlength: {},
|
|
16
|
-
autofocus: { type: Boolean }
|
|
17
|
-
},
|
|
18
|
-
emits: ["update:modelValue"],
|
|
19
|
-
setup(__props) {
|
|
20
|
-
const props = __props;
|
|
21
|
-
const style = computed(() => props.maxrows ? {
|
|
22
|
-
maxHeight: `${props.maxrows * 1.5 + 1}em`,
|
|
23
|
-
overflowY: "auto"
|
|
24
|
-
} : void 0);
|
|
25
|
-
return (_ctx, _cache) => {
|
|
26
|
-
return openBlock(), createBlock(unref(PTextarea), {
|
|
27
|
-
"model-value": __props.modelValue,
|
|
28
|
-
rows: __props.rows,
|
|
29
|
-
"auto-resize": __props.autoresize,
|
|
30
|
-
style: normalizeStyle(style.value),
|
|
31
|
-
placeholder: __props.placeholder,
|
|
32
|
-
disabled: __props.disabled,
|
|
33
|
-
readonly: __props.readonly,
|
|
34
|
-
maxlength: __props.maxlength === void 0 ? void 0 : Number(__props.maxlength),
|
|
35
|
-
autofocus: __props.autofocus,
|
|
36
|
-
fluid: "",
|
|
37
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = (value) => _ctx.$emit("update:modelValue", value ?? ""))
|
|
38
|
-
}, null, 8, [
|
|
39
|
-
"model-value",
|
|
40
|
-
"rows",
|
|
41
|
-
"auto-resize",
|
|
42
|
-
"style",
|
|
43
|
-
"placeholder",
|
|
44
|
-
"disabled",
|
|
45
|
-
"readonly",
|
|
46
|
-
"maxlength",
|
|
47
|
-
"autofocus"
|
|
48
|
-
]);
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
//#endregion
|
|
53
|
-
export { _sfc_main as default };
|
|
54
|
-
|
|
55
|
-
//# sourceMappingURL=Textarea.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.js","names":["$emit","_openBlock","_createBlock","_unref","_normalizeStyle"],"sources":["../../../../src/vue/kit/primevue/Textarea.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport PTextarea from 'primevue/textarea'\nimport { computed } from 'vue'\nimport type { TextareaProps } from '../types'\n\nconst props = defineProps<TextareaProps>()\ndefineEmits<{ 'update:modelValue': [value: string] }>()\nconst style = computed(() => (props.maxrows ? { maxHeight: `${props.maxrows * 1.5 + 1}em`, overflowY: 'auto' as const } : undefined))\n</script>\n\n<template>\n <PTextarea\n :model-value=\"modelValue\"\n :rows=\"rows\"\n :auto-resize=\"autoresize\"\n :style=\"style\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :maxlength=\"maxlength === undefined ? undefined : Number(maxlength)\"\n :autofocus=\"autofocus\"\n fluid\n @update:model-value=\"(value: string | undefined) => $emit('update:modelValue', value ?? '')\"\n />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;EAKA,MAAM,QAAQ;EAEd,MAAM,QAAQ,eAAgB,MAAM,UAAU;GAAE,WAAW,GAAG,MAAM,UAAU,MAAM,EAAE;GAAK,WAAW;EAAgB,IAAI,KAAA,CAAU;;GAIlI,OAAAC,UAAA,GAAAC,YAYEC,MAAA,SAAA,GAAA;IAXC,eAAa,QAAA;IACb,MAAM,QAAA;IACN,eAAa,QAAA;IACb,OAAKC,eAAE,MAAA,KAAK;IACZ,aAAa,QAAA;IACb,UAAU,QAAA;IACV,UAAU,QAAA;IACV,WAAW,QAAA,cAAc,KAAA,IAAY,KAAA,IAAY,OAAO,QAAA,SAAS;IACjE,WAAW,QAAA;IACZ,OAAA;IACC,uBAAkB,OAAA,OAAA,OAAA,MAAG,UAA8BJ,KAAAA,MAAK,qBAAsB,SAAK,EAAA"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { kbdText } from "./shared.js";
|
|
2
|
-
import { triggerNodes } from "./trigger.js";
|
|
3
|
-
import { defineComponent, withDirectives } from "vue";
|
|
4
|
-
import Tooltip from "primevue/tooltip";
|
|
5
|
-
//#region src/vue/kit/primevue/Tooltip.ts
|
|
6
|
-
/**
|
|
7
|
-
* PrimeVue's tooltip is a directive: this component applies it to its single child (the trigger). The shortcut keys are
|
|
8
|
-
* appended to the text (`Fett ⌘B`). Without text the child renders as it is.
|
|
9
|
-
*/
|
|
10
|
-
var Tooltip_default = defineComponent({
|
|
11
|
-
name: "KitTooltip",
|
|
12
|
-
props: {
|
|
13
|
-
text: {
|
|
14
|
-
type: String,
|
|
15
|
-
default: void 0
|
|
16
|
-
},
|
|
17
|
-
kbds: {
|
|
18
|
-
type: Array,
|
|
19
|
-
default: void 0
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
setup(props, { slots }) {
|
|
23
|
-
return () => {
|
|
24
|
-
const nodes = triggerNodes(slots.default?.());
|
|
25
|
-
const [child] = nodes;
|
|
26
|
-
const text = [props.text, props.kbds?.length ? kbdText(props.kbds) : void 0].filter(Boolean).join(" ");
|
|
27
|
-
if (!child || !text || nodes.length > 1) return nodes.length === 1 ? child : nodes;
|
|
28
|
-
return withDirectives(child, [[
|
|
29
|
-
Tooltip,
|
|
30
|
-
{
|
|
31
|
-
value: text,
|
|
32
|
-
showDelay: 400
|
|
33
|
-
},
|
|
34
|
-
"",
|
|
35
|
-
{ top: true }
|
|
36
|
-
]]);
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
//#endregion
|
|
41
|
-
export { Tooltip_default as default };
|
|
42
|
-
|
|
43
|
-
//# sourceMappingURL=Tooltip.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","names":[],"sources":["../../../../src/vue/kit/primevue/Tooltip.ts"],"sourcesContent":["import Tooltip from 'primevue/tooltip'\nimport { defineComponent, withDirectives } from 'vue'\nimport { kbdText } from './shared'\nimport { triggerNodes } from './trigger'\n\n/**\n * PrimeVue's tooltip is a directive: this component applies it to its single child (the trigger). The shortcut keys are\n * appended to the text (`Fett ⌘B`). Without text the child renders as it is.\n */\nexport default defineComponent({\n name: 'KitTooltip',\n props: {\n text: { type: String, default: undefined },\n kbds: { type: Array as () => string[], default: undefined },\n },\n setup(props, { slots }) {\n return () => {\n const nodes = triggerNodes(slots.default?.())\n const [child] = nodes\n const text = [props.text, props.kbds?.length ? kbdText(props.kbds) : undefined].filter(Boolean).join(' ')\n if (!child || !text || nodes.length > 1) return nodes.length === 1 ? child : nodes\n return withDirectives(child, [[Tooltip, { value: text, showDelay: 400 }, '', { top: true }]])\n }\n },\n})\n"],"mappings":";;;;;;;;;AASA,IAAA,kBAAe,gBAAgB;CAC7B,MAAM;CACN,OAAO;EACL,MAAM;GAAE,MAAM;GAAQ,SAAS,KAAA;EAAU;EACzC,MAAM;GAAE,MAAM;GAAyB,SAAS,KAAA;EAAU;CAC5D;CACA,MAAM,OAAO,EAAE,SAAS;EACtB,aAAa;GACX,MAAM,QAAQ,aAAa,MAAM,UAAU,CAAC;GAC5C,MAAM,CAAC,SAAS;GAChB,MAAM,OAAO,CAAC,MAAM,MAAM,MAAM,MAAM,SAAS,QAAQ,MAAM,IAAI,IAAI,KAAA,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;GACxG,IAAI,CAAC,SAAS,CAAC,QAAQ,MAAM,SAAS,GAAG,OAAO,MAAM,WAAW,IAAI,QAAQ;GAC7E,OAAO,eAAe,OAAO,CAAC;IAAC;IAAS;KAAE,OAAO;KAAM,WAAW;IAAI;IAAG;IAAI,EAAE,KAAK,KAAK;GAAC,CAAC,CAAC;EAC9F;CACF;AACF,CAAC"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { computed, createBlock, createTextVNode, defineComponent, openBlock, renderSlot, toDisplayString, unref, withCtx } from "vue";
|
|
2
|
-
import PTree from "primevue/tree";
|
|
3
|
-
//#region src/vue/kit/primevue/Tree.vue
|
|
4
|
-
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
5
|
-
__name: "Tree",
|
|
6
|
-
props: {
|
|
7
|
-
items: {},
|
|
8
|
-
getKey: { type: Function },
|
|
9
|
-
expanded: {},
|
|
10
|
-
size: {}
|
|
11
|
-
},
|
|
12
|
-
emits: ["update:expanded"],
|
|
13
|
-
setup(__props, { emit: __emit }) {
|
|
14
|
-
const props = __props;
|
|
15
|
-
const emit = __emit;
|
|
16
|
-
const levels = /* @__PURE__ */ new Map();
|
|
17
|
-
function keyOf(item) {
|
|
18
|
-
return props.getKey ? props.getKey(item) : item.key ?? item.label ?? "";
|
|
19
|
-
}
|
|
20
|
-
function nodesOf(items, level) {
|
|
21
|
-
return items.map((item) => {
|
|
22
|
-
const key = keyOf(item);
|
|
23
|
-
levels.set(key, level);
|
|
24
|
-
return {
|
|
25
|
-
key,
|
|
26
|
-
label: item.label,
|
|
27
|
-
data: item,
|
|
28
|
-
leaf: !item.children?.length,
|
|
29
|
-
...item.children?.length && { children: nodesOf(item.children, level + 1) }
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
const nodes = computed(() => {
|
|
34
|
-
levels.clear();
|
|
35
|
-
return nodesOf(props.items, 0);
|
|
36
|
-
});
|
|
37
|
-
const expandedKeys = computed(() => Object.fromEntries((props.expanded ?? []).map((key) => [key, true])));
|
|
38
|
-
function toggled(key, open) {
|
|
39
|
-
const rest = (props.expanded ?? []).filter((k) => k !== key);
|
|
40
|
-
return open ? [...rest, key] : rest;
|
|
41
|
-
}
|
|
42
|
-
/** Row activation (click or Enter): the item's `onSelect` first, then the tree toggles a row that has children unless it was cancelled. */
|
|
43
|
-
function onSelect(node) {
|
|
44
|
-
const item = node.data;
|
|
45
|
-
const activation = new Event("select", { cancelable: true });
|
|
46
|
-
item.onSelect?.(activation);
|
|
47
|
-
if (activation.defaultPrevented || !item.children?.length) return;
|
|
48
|
-
const open = !(props.expanded ?? []).includes(keyOf(item));
|
|
49
|
-
item.onToggle?.(activation);
|
|
50
|
-
emit("update:expanded", toggled(keyOf(item), open));
|
|
51
|
-
}
|
|
52
|
-
return (_ctx, _cache) => {
|
|
53
|
-
return openBlock(), createBlock(unref(PTree), {
|
|
54
|
-
value: nodes.value,
|
|
55
|
-
"expanded-keys": expandedKeys.value,
|
|
56
|
-
"selection-mode": "single",
|
|
57
|
-
"selection-keys": {},
|
|
58
|
-
class: "sk-tree",
|
|
59
|
-
"onUpdate:expandedKeys": _cache[0] || (_cache[0] = (keys) => emit("update:expanded", Object.keys(keys).filter((key) => keys[key]))),
|
|
60
|
-
onNodeSelect: onSelect
|
|
61
|
-
}, {
|
|
62
|
-
default: withCtx(({ node, expanded }) => [renderSlot(_ctx.$slots, "item-wrapper", {
|
|
63
|
-
item: node.data,
|
|
64
|
-
expanded: !!expanded,
|
|
65
|
-
level: unref(levels).get(node.key ?? "") ?? 0
|
|
66
|
-
}, () => [createTextVNode(toDisplayString(node.label), 1)])]),
|
|
67
|
-
_: 3
|
|
68
|
-
}, 8, ["value", "expanded-keys"]);
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
//#endregion
|
|
73
|
-
export { _sfc_main as default };
|
|
74
|
-
|
|
75
|
-
//# sourceMappingURL=Tree.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Tree.js","names":["_openBlock","_createBlock","_unref","_withCtx","_renderSlot","_createTextVNode","_toDisplayString"],"sources":["../../../../src/vue/kit/primevue/Tree.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport PTree from 'primevue/tree'\nimport type { TreeNode as PrimeNode } from 'primevue/treenode'\nimport { computed } from 'vue'\nimport type { TreeNode, TreeProps } from '../types'\n\nconst props = defineProps<TreeProps>()\nconst emit = defineEmits<{ 'update:expanded': [keys: string[]] }>()\n\nconst levels = new Map<string, number>()\n\nfunction keyOf(item: TreeNode): string {\n return props.getKey ? props.getKey(item) : (item.key ?? item.label ?? '')\n}\n\nfunction nodesOf(items: TreeNode[], level: number): PrimeNode[] {\n return items.map((item) => {\n const key = keyOf(item)\n levels.set(key, level)\n return {\n key,\n label: item.label,\n data: item,\n leaf: !item.children?.length,\n ...(item.children?.length && { children: nodesOf(item.children, level + 1) }),\n }\n })\n}\n\nconst nodes = computed(() => {\n levels.clear()\n return nodesOf(props.items, 0)\n})\nconst expandedKeys = computed(() => Object.fromEntries((props.expanded ?? []).map(key => [key, true])))\n\nfunction toggled(key: string, open: boolean): string[] {\n const rest = (props.expanded ?? []).filter(k => k !== key)\n return open ? [...rest, key] : rest\n}\n\n/** Row activation (click or Enter): the item's `onSelect` first, then the tree toggles a row that has children unless it was cancelled. */\nfunction onSelect(node: PrimeNode) {\n const item = node.data as TreeNode\n const activation = new Event('select', { cancelable: true })\n item.onSelect?.(activation)\n if (activation.defaultPrevented || !item.children?.length) return\n const open = !(props.expanded ?? []).includes(keyOf(item))\n item.onToggle?.(activation)\n emit('update:expanded', toggled(keyOf(item), open))\n}\n</script>\n\n<template>\n <PTree\n :value=\"nodes\"\n :expanded-keys=\"expandedKeys\"\n selection-mode=\"single\"\n :selection-keys=\"{}\"\n class=\"sk-tree\"\n @update:expanded-keys=\"(keys: Record<string, boolean>) => emit('update:expanded', Object.keys(keys).filter(key => keys[key]))\"\n @node-select=\"onSelect\"\n >\n <template #default=\"{ node, expanded }\">\n <slot name=\"item-wrapper\" :item=\"node.data\" :expanded=\"!!expanded\" :level=\"levels.get(node.key ?? '') ?? 0\">\n {{ node.label }}\n </slot>\n </template>\n </PTree>\n</template>\n"],"mappings":";;;;;;;;;;;;;EAMA,MAAM,QAAQ;EACd,MAAM,OAAO;EAEb,MAAM,yBAAS,IAAI,IAAoB;EAEvC,SAAS,MAAM,MAAwB;GACrC,OAAO,MAAM,SAAS,MAAM,OAAO,IAAI,IAAK,KAAK,OAAO,KAAK,SAAS;EACxE;EAEA,SAAS,QAAQ,OAAmB,OAA4B;GAC9D,OAAO,MAAM,KAAK,SAAS;IACzB,MAAM,MAAM,MAAM,IAAI;IACtB,OAAO,IAAI,KAAK,KAAK;IACrB,OAAO;KACL;KACA,OAAO,KAAK;KACZ,MAAM;KACN,MAAM,CAAC,KAAK,UAAU;KACtB,GAAI,KAAK,UAAU,UAAU,EAAE,UAAU,QAAQ,KAAK,UAAU,QAAQ,CAAC,EAAE;IAC7E;GACF,CAAC;EACH;EAEA,MAAM,QAAQ,eAAe;GAC3B,OAAO,MAAM;GACb,OAAO,QAAQ,MAAM,OAAO,CAAC;EAC/B,CAAC;EACD,MAAM,eAAe,eAAe,OAAO,aAAa,MAAM,YAAY,CAAC,EAAA,CAAG,KAAI,QAAO,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC;EAEtG,SAAS,QAAQ,KAAa,MAAyB;GACrD,MAAM,QAAQ,MAAM,YAAY,CAAC,EAAA,CAAG,QAAO,MAAK,MAAM,GAAG;GACzD,OAAO,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI;EACjC;;EAGA,SAAS,SAAS,MAAiB;GACjC,MAAM,OAAO,KAAK;GAClB,MAAM,aAAa,IAAI,MAAM,UAAU,EAAE,YAAY,KAAK,CAAC;GAC3D,KAAK,WAAW,UAAU;GAC1B,IAAI,WAAW,oBAAoB,CAAC,KAAK,UAAU,QAAQ;GAC3D,MAAM,OAAO,EAAE,MAAM,YAAY,CAAC,EAAA,CAAG,SAAS,MAAM,IAAI,CAAC;GACzD,KAAK,WAAW,UAAU;GAC1B,KAAK,mBAAmB,QAAQ,MAAM,IAAI,GAAG,IAAI,CAAC;EACpD;;GAIE,OAAAA,UAAA,GAAAC,YAcQC,MAAA,KAAA,GAAA;IAbL,OAAO,MAAA;IACP,iBAAe,aAAA;IAChB,kBAAe;IACd,kBAAgB,CAAA;IACjB,OAAM;IACL,yBAAoB,OAAA,OAAA,OAAA,MAAG,SAAkC,KAAI,mBAAoB,OAAO,KAAK,IAAI,CAAA,CAAE,QAAO,QAAO,KAAK,IAAG,CAAA;IACzH,cAAa;;IAEH,SAAOC,SAGT,EAHa,MAAM,eAAQ,CAClCC,WAEO,KAAA,QAAA,gBAAA;KAFoB,MAAM,KAAK;KAAO,UAAQ,CAAA,CAAI;KAAW,OAAOF,MAAA,MAAA,CAAM,CAAC,IAAI,KAAK,OAAG,EAAA,KAAA;IAA9F,SAEO,CADFG,gBAAAC,gBAAA,KAAK,KAAK,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
//#region src/vue/kit/primevue/select-options.ts
|
|
2
|
-
/**
|
|
3
|
-
* Kit items to PrimeVue options: strings and numbers are choices of their own value, separators vanish (Prime lists have
|
|
4
|
-
* none) and a `label` heading starts a group; without any heading the result is flat.
|
|
5
|
-
*/
|
|
6
|
-
function choicesOf(items) {
|
|
7
|
-
const grouped = items.some((item) => typeof item === "object" && item.type === "label");
|
|
8
|
-
const options = [];
|
|
9
|
-
let current;
|
|
10
|
-
for (const item of items) {
|
|
11
|
-
if (typeof item === "string" || typeof item === "number") {
|
|
12
|
-
const choice = {
|
|
13
|
-
label: String(item),
|
|
14
|
-
value: item
|
|
15
|
-
};
|
|
16
|
-
if (current) current.items.push(choice);
|
|
17
|
-
else options.push(choice);
|
|
18
|
-
continue;
|
|
19
|
-
}
|
|
20
|
-
if (item.type === "separator") continue;
|
|
21
|
-
if (item.type === "label") {
|
|
22
|
-
current = {
|
|
23
|
-
label: item.label ?? "",
|
|
24
|
-
items: []
|
|
25
|
-
};
|
|
26
|
-
options.push(current);
|
|
27
|
-
continue;
|
|
28
|
-
}
|
|
29
|
-
const choice = {
|
|
30
|
-
label: item.label ?? String(item.value ?? ""),
|
|
31
|
-
value: item.value ?? item.label ?? "",
|
|
32
|
-
...item.description !== void 0 && { description: item.description },
|
|
33
|
-
...item.icon !== void 0 && { icon: item.icon },
|
|
34
|
-
...item.disabled !== void 0 && { disabled: item.disabled },
|
|
35
|
-
...item.onSelect && { onSelect: item.onSelect }
|
|
36
|
-
};
|
|
37
|
-
if (current) current.items.push(choice);
|
|
38
|
-
else options.push(choice);
|
|
39
|
-
}
|
|
40
|
-
return {
|
|
41
|
-
grouped,
|
|
42
|
-
options
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
/** Finds the choice that carries `value`. */
|
|
46
|
-
function choiceOf(options, value) {
|
|
47
|
-
for (const option of options) if ("items" in option) {
|
|
48
|
-
const found = option.items.find((choice) => choice.value === value);
|
|
49
|
-
if (found) return found;
|
|
50
|
-
} else if (option.value === value) return option;
|
|
51
|
-
}
|
|
52
|
-
//#endregion
|
|
53
|
-
export { choiceOf, choicesOf };
|
|
54
|
-
|
|
55
|
-
//# sourceMappingURL=select-options.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"select-options.js","names":[],"sources":["../../../../src/vue/kit/primevue/select-options.ts"],"sourcesContent":["import type { SelectItem } from '../types'\n\n/** What a `Select` shows: a plain choice, or a heading with the choices below it. */\nexport interface Choice {\n label: string\n value: string | number | boolean\n description?: string\n icon?: string\n disabled?: boolean\n onSelect?: (event: Event) => void\n}\nexport interface ChoiceGroup { label: string, items: Choice[] }\n\ntype Entry = SelectItem | string | number\n\n/**\n * Kit items to PrimeVue options: strings and numbers are choices of their own value, separators vanish (Prime lists have\n * none) and a `label` heading starts a group; without any heading the result is flat.\n */\nexport function choicesOf(items: readonly Entry[]): { grouped: boolean, options: (Choice | ChoiceGroup)[] } {\n const grouped = items.some(item => typeof item === 'object' && item.type === 'label')\n const options: (Choice | ChoiceGroup)[] = []\n let current: ChoiceGroup | undefined\n for (const item of items) {\n if (typeof item === 'string' || typeof item === 'number') {\n const choice: Choice = { label: String(item), value: item }\n if (current) current.items.push(choice)\n else options.push(choice)\n continue\n }\n if (item.type === 'separator') continue\n if (item.type === 'label') {\n current = { label: item.label ?? '', items: [] }\n options.push(current)\n continue\n }\n const choice: Choice = {\n label: item.label ?? String(item.value ?? ''),\n value: item.value ?? item.label ?? '',\n ...(item.description !== undefined && { description: item.description }),\n ...(item.icon !== undefined && { icon: item.icon }),\n ...(item.disabled !== undefined && { disabled: item.disabled }),\n ...(item.onSelect && { onSelect: item.onSelect }),\n }\n if (current) current.items.push(choice)\n else options.push(choice)\n }\n return { grouped, options }\n}\n\n/** Finds the choice that carries `value`. */\nexport function choiceOf(options: (Choice | ChoiceGroup)[], value: unknown): Choice | undefined {\n for (const option of options) {\n if ('items' in option) {\n const found = option.items.find(choice => choice.value === value)\n if (found) return found\n }\n else if (option.value === value) return option\n }\n return undefined\n}\n"],"mappings":";;;;;AAmBA,SAAgB,UAAU,OAAkF;CAC1G,MAAM,UAAU,MAAM,MAAK,SAAQ,OAAO,SAAS,YAAY,KAAK,SAAS,OAAO;CACpF,MAAM,UAAoC,CAAC;CAC3C,IAAI;CACJ,KAAK,MAAM,QAAQ,OAAO;EACxB,IAAI,OAAO,SAAS,YAAY,OAAO,SAAS,UAAU;GACxD,MAAM,SAAiB;IAAE,OAAO,OAAO,IAAI;IAAG,OAAO;GAAK;GAC1D,IAAI,SAAS,QAAQ,MAAM,KAAK,MAAM;QACjC,QAAQ,KAAK,MAAM;GACxB;EACF;EACA,IAAI,KAAK,SAAS,aAAa;EAC/B,IAAI,KAAK,SAAS,SAAS;GACzB,UAAU;IAAE,OAAO,KAAK,SAAS;IAAI,OAAO,CAAC;GAAE;GAC/C,QAAQ,KAAK,OAAO;GACpB;EACF;EACA,MAAM,SAAiB;GACrB,OAAO,KAAK,SAAS,OAAO,KAAK,SAAS,EAAE;GAC5C,OAAO,KAAK,SAAS,KAAK,SAAS;GACnC,GAAI,KAAK,gBAAgB,KAAA,KAAa,EAAE,aAAa,KAAK,YAAY;GACtE,GAAI,KAAK,SAAS,KAAA,KAAa,EAAE,MAAM,KAAK,KAAK;GACjD,GAAI,KAAK,aAAa,KAAA,KAAa,EAAE,UAAU,KAAK,SAAS;GAC7D,GAAI,KAAK,YAAY,EAAE,UAAU,KAAK,SAAS;EACjD;EACA,IAAI,SAAS,QAAQ,MAAM,KAAK,MAAM;OACjC,QAAQ,KAAK,MAAM;CAC1B;CACA,OAAO;EAAE;EAAS;CAAQ;AAC5B;;AAGA,SAAgB,SAAS,SAAmC,OAAoC;CAC9F,KAAK,MAAM,UAAU,SACnB,IAAI,WAAW,QAAQ;EACrB,MAAM,QAAQ,OAAO,MAAM,MAAK,WAAU,OAAO,UAAU,KAAK;EAChE,IAAI,OAAO,OAAO;CACpB,OACK,IAAI,OAAO,UAAU,OAAO,OAAO;AAG5C"}
|