@ac-design/design-system 0.0.0-stage → 1.0.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/README.md +160 -2
- package/dist/lib/compat.css +4441 -0
- package/dist/lib/components/AcAccordion.js +5 -0
- package/dist/lib/components/AcAccordion.vue.d.ts +35 -0
- package/dist/lib/components/AcAccordion.vue_vue_type_script_setup_true_lang.js +61 -0
- package/dist/lib/components/AcAccordionItem.js +5 -0
- package/dist/lib/components/AcAccordionItem.vue.d.ts +49 -0
- package/dist/lib/components/AcAccordionItem.vue_vue_type_script_setup_true_lang.js +81 -0
- package/dist/lib/components/AcAlert.js +5 -0
- package/dist/lib/components/AcAlert.vue.d.ts +52 -0
- package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +121 -0
- package/dist/lib/components/AcAppSwitcher.js +5 -0
- package/dist/lib/components/AcAppSwitcher.vue.d.ts +83 -0
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +303 -0
- package/dist/lib/components/AcAvatar.js +5 -0
- package/dist/lib/components/AcAvatar.vue.d.ts +27 -0
- package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +116 -0
- package/dist/lib/components/AcBadge.js +5 -0
- package/dist/lib/components/AcBadge.vue.d.ts +32 -0
- package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +88 -0
- package/dist/lib/components/AcBanner.js +5 -0
- package/dist/lib/components/AcBanner.vue.d.ts +57 -0
- package/dist/lib/components/AcBanner.vue_vue_type_script_setup_true_lang.js +114 -0
- package/dist/lib/components/AcBreadcrumb.js +5 -0
- package/dist/lib/components/AcBreadcrumb.vue.d.ts +25 -0
- package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +88 -0
- package/dist/lib/components/AcButton.js +5 -0
- package/dist/lib/components/AcButton.vue.d.ts +49 -0
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +103 -0
- package/dist/lib/components/AcButtons.js +5 -0
- package/dist/lib/components/AcButtons.vue.d.ts +31 -0
- package/dist/lib/components/AcButtons.vue_vue_type_script_setup_true_lang.js +44 -0
- package/dist/lib/components/AcCard.js +5 -0
- package/dist/lib/components/AcCard.vue.d.ts +27 -0
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +28 -0
- package/dist/lib/components/AcCellValue.js +5 -0
- package/dist/lib/components/AcCellValue.vue.d.ts +139 -0
- package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +386 -0
- package/dist/lib/components/AcCheckBox.js +5 -0
- package/dist/lib/components/AcCheckBox.vue.d.ts +31 -0
- package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/lib/components/AcCheckRadio.js +5 -0
- package/dist/lib/components/AcCheckRadio.vue.d.ts +35 -0
- package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +56 -0
- package/dist/lib/components/AcClusterSwitcher.js +5 -0
- package/dist/lib/components/AcClusterSwitcher.vue.d.ts +95 -0
- package/dist/lib/components/AcClusterSwitcher.vue_vue_type_script_setup_true_lang.js +416 -0
- package/dist/lib/components/AcCodeEditor.js +5 -0
- package/dist/lib/components/AcCodeEditor.vue.d.ts +88 -0
- package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +381 -0
- package/dist/lib/components/AcContentHeader.js +5 -0
- package/dist/lib/components/AcContentHeader.vue.d.ts +29 -0
- package/dist/lib/components/AcContentHeader.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/lib/components/AcContentLayout.js +5 -0
- package/dist/lib/components/AcContentLayout.vue.d.ts +21 -0
- package/dist/lib/components/AcContentLayout.vue_vue_type_script_setup_true_lang.js +18 -0
- package/dist/lib/components/AcContentTable.js +5 -0
- package/dist/lib/components/AcContentTable.vue.d.ts +54 -0
- package/dist/lib/components/AcContentTable.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/lib/components/AcDatePicker.js +5 -0
- package/dist/lib/components/AcDatePicker.vue.d.ts +88 -0
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +794 -0
- package/dist/lib/components/AcDeleteModal.js +5 -0
- package/dist/lib/components/AcDeleteModal.vue.d.ts +51 -0
- package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +110 -0
- package/dist/lib/components/AcDivider.js +5 -0
- package/dist/lib/components/AcDivider.vue.d.ts +25 -0
- package/dist/lib/components/AcDivider.vue_vue_type_script_setup_true_lang.js +39 -0
- package/dist/lib/components/AcDropdown.js +5 -0
- package/dist/lib/components/AcDropdown.vue.d.ts +45 -0
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +152 -0
- package/dist/lib/components/AcDropdownDivider.js +5 -0
- package/dist/lib/components/AcDropdownDivider.vue.d.ts +9 -0
- package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +20 -0
- package/dist/lib/components/AcDropdownItem.js +5 -0
- package/dist/lib/components/AcDropdownItem.vue.d.ts +50 -0
- package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +86 -0
- package/dist/lib/components/AcEmptyState.js +5 -0
- package/dist/lib/components/AcEmptyState.vue.d.ts +42 -0
- package/dist/lib/components/AcEmptyState.vue_vue_type_script_setup_true_lang.js +81 -0
- package/dist/lib/components/AcFeatureCard.js +5 -0
- package/dist/lib/components/AcFeatureCard.vue.d.ts +84 -0
- package/dist/lib/components/AcFeatureCard.vue_vue_type_script_setup_true_lang.js +218 -0
- package/dist/lib/components/AcFileEditor.js +5 -0
- package/dist/lib/components/AcFileEditor.vue.d.ts +95 -0
- package/dist/lib/components/AcFileEditor.vue_vue_type_script_setup_true_lang.js +556 -0
- package/dist/lib/components/AcFileUpload.js +5 -0
- package/dist/lib/components/AcFileUpload.vue.d.ts +67 -0
- package/dist/lib/components/AcFileUpload.vue_vue_type_script_setup_true_lang.js +274 -0
- package/dist/lib/components/AcFontScale.js +5 -0
- package/dist/lib/components/AcFontScale.vue.d.ts +17 -0
- package/dist/lib/components/AcFontScale.vue_vue_type_script_setup_true_lang.js +65 -0
- package/dist/lib/components/AcForm.js +5 -0
- package/dist/lib/components/AcForm.vue.d.ts +31 -0
- package/dist/lib/components/AcForm.vue_vue_type_script_setup_true_lang.js +38 -0
- package/dist/lib/components/AcFormArray.js +5 -0
- package/dist/lib/components/AcFormArray.vue.d.ts +124 -0
- package/dist/lib/components/AcFormArray.vue_vue_type_script_setup_true_lang.js +485 -0
- package/dist/lib/components/AcFormFooter.js +5 -0
- package/dist/lib/components/AcFormFooter.vue.d.ts +48 -0
- package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +86 -0
- package/dist/lib/components/AcFormSection.js +5 -0
- package/dist/lib/components/AcFormSection.vue.d.ts +32 -0
- package/dist/lib/components/AcFormSection.vue_vue_type_script_setup_true_lang.js +38 -0
- package/dist/lib/components/AcHeader.js +5 -0
- package/dist/lib/components/AcHeader.vue.d.ts +46 -0
- package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/lib/components/AcHeaderItem.js +5 -0
- package/dist/lib/components/AcHeaderItem.vue.d.ts +13 -0
- package/dist/lib/components/AcHeaderItem.vue_vue_type_script_setup_true_lang.js +14 -0
- package/dist/lib/components/AcHeaderItems.js +5 -0
- package/dist/lib/components/AcHeaderItems.vue.d.ts +13 -0
- package/dist/lib/components/AcHeaderItems.vue_vue_type_script_setup_true_lang.js +14 -0
- package/dist/lib/components/AcInfoTable.js +5 -0
- package/dist/lib/components/AcInfoTable.vue.d.ts +59 -0
- package/dist/lib/components/AcInfoTable.vue_vue_type_script_setup_true_lang.js +127 -0
- package/dist/lib/components/AcInput.js +5 -0
- package/dist/lib/components/AcInput.vue.d.ts +68 -0
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +143 -0
- package/dist/lib/components/AcKbd.js +5 -0
- package/dist/lib/components/AcKbd.vue.d.ts +25 -0
- package/dist/lib/components/AcKbd.vue_vue_type_script_setup_true_lang.js +134 -0
- package/dist/lib/components/AcLogo.js +5 -0
- package/dist/lib/components/AcLogo.vue.d.ts +18 -0
- package/dist/lib/components/AcLogo.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/lib/components/AcModal.js +5 -0
- package/dist/lib/components/AcModal.vue.d.ts +54 -0
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +125 -0
- package/dist/lib/components/AcNavbar.js +5 -0
- package/dist/lib/components/AcNavbar.vue.d.ts +41 -0
- package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/lib/components/AcNavbarItem.js +5 -0
- package/dist/lib/components/AcNavbarItem.vue.d.ts +44 -0
- package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +65 -0
- package/dist/lib/components/AcNotificationMenu.js +5 -0
- package/dist/lib/components/AcNotificationMenu.vue.d.ts +90 -0
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +345 -0
- package/dist/lib/components/AcPage.js +5 -0
- package/dist/lib/components/AcPage.vue.d.ts +25 -0
- package/dist/lib/components/AcPage.vue_vue_type_script_setup_true_lang.js +36 -0
- package/dist/lib/components/AcPagination.js +5 -0
- package/dist/lib/components/AcPagination.vue.d.ts +51 -0
- package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +160 -0
- package/dist/lib/components/AcPreloader.js +5 -0
- package/dist/lib/components/AcPreloader.vue.d.ts +28 -0
- package/dist/lib/components/AcPreloader.vue_vue_type_script_setup_true_lang.js +39 -0
- package/dist/lib/components/AcProgress.js +5 -0
- package/dist/lib/components/AcProgress.vue.d.ts +31 -0
- package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/lib/components/AcResourceCard.js +5 -0
- package/dist/lib/components/AcResourceCard.vue.d.ts +106 -0
- package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +203 -0
- package/dist/lib/components/AcSearchBar.js +5 -0
- package/dist/lib/components/AcSearchBar.vue.d.ts +41 -0
- package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/lib/components/AcSectionContent.js +5 -0
- package/dist/lib/components/AcSectionContent.vue.d.ts +55 -0
- package/dist/lib/components/AcSectionContent.vue_vue_type_script_setup_true_lang.js +74 -0
- package/dist/lib/components/AcSegmentedControl.js +5 -0
- package/dist/lib/components/AcSegmentedControl.vue.d.ts +46 -0
- package/dist/lib/components/AcSegmentedControl.vue_vue_type_script_setup_true_lang.js +104 -0
- package/dist/lib/components/AcSelect.js +5 -0
- package/dist/lib/components/AcSelect.vue.d.ts +78 -0
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +441 -0
- package/dist/lib/components/AcSidePanel.js +5 -0
- package/dist/lib/components/AcSidePanel.vue.d.ts +57 -0
- package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +128 -0
- package/dist/lib/components/AcSideTabs.js +5 -0
- package/dist/lib/components/AcSideTabs.vue.d.ts +93 -0
- package/dist/lib/components/AcSideTabs.vue_vue_type_script_setup_true_lang.js +373 -0
- package/dist/lib/components/AcSidebar.js +5 -0
- package/dist/lib/components/AcSidebar.vue.d.ts +63 -0
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +221 -0
- package/dist/lib/components/AcSidebarItem.js +5 -0
- package/dist/lib/components/AcSidebarItem.vue.d.ts +55 -0
- package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +155 -0
- package/dist/lib/components/AcSidebarSection.js +5 -0
- package/dist/lib/components/AcSidebarSection.vue.d.ts +32 -0
- package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/lib/components/AcSkeleton.js +5 -0
- package/dist/lib/components/AcSkeleton.vue.d.ts +27 -0
- package/dist/lib/components/AcSkeleton.vue_vue_type_script_setup_true_lang.js +142 -0
- package/dist/lib/components/AcSlider.js +5 -0
- package/dist/lib/components/AcSlider.vue.d.ts +72 -0
- package/dist/lib/components/AcSlider.vue_vue_type_script_setup_true_lang.js +327 -0
- package/dist/lib/components/AcSpinner.js +5 -0
- package/dist/lib/components/AcSpinner.vue.d.ts +12 -0
- package/dist/lib/components/AcSpinner.vue_vue_type_script_setup_true_lang.js +45 -0
- package/dist/lib/components/AcStatCard.js +5 -0
- package/dist/lib/components/AcStatCard.vue.d.ts +84 -0
- package/dist/lib/components/AcStatCard.vue_vue_type_script_setup_true_lang.js +225 -0
- package/dist/lib/components/AcStatusBar.js +5 -0
- package/dist/lib/components/AcStatusBar.vue.d.ts +66 -0
- package/dist/lib/components/AcStatusBar.vue_vue_type_script_setup_true_lang.js +145 -0
- package/dist/lib/components/AcSteps.js +5 -0
- package/dist/lib/components/AcSteps.vue.d.ts +28 -0
- package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +91 -0
- package/dist/lib/components/AcSwitch.js +5 -0
- package/dist/lib/components/AcSwitch.vue.d.ts +44 -0
- package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/lib/components/AcTable.js +5 -0
- package/dist/lib/components/AcTable.vue.d.ts +98 -0
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +272 -0
- package/dist/lib/components/AcTabs.js +5 -0
- package/dist/lib/components/AcTabs.vue.d.ts +40 -0
- package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +72 -0
- package/dist/lib/components/AcTag.js +5 -0
- package/dist/lib/components/AcTag.vue.d.ts +41 -0
- package/dist/lib/components/AcTag.vue_vue_type_script_setup_true_lang.js +99 -0
- package/dist/lib/components/AcTextarea.js +5 -0
- package/dist/lib/components/AcTextarea.vue.d.ts +53 -0
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +120 -0
- package/dist/lib/components/AcThemeMode.js +5 -0
- package/dist/lib/components/AcThemeMode.vue.d.ts +17 -0
- package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/lib/components/AcToaster.js +5 -0
- package/dist/lib/components/AcToaster.vue.d.ts +15 -0
- package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +166 -0
- package/dist/lib/components/AcTooltip.js +5 -0
- package/dist/lib/components/AcTooltip.vue.d.ts +30 -0
- package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +117 -0
- package/dist/lib/components/AcUsageCard.js +5 -0
- package/dist/lib/components/AcUsageCard.vue.d.ts +85 -0
- package/dist/lib/components/AcUsageCard.vue_vue_type_script_setup_true_lang.js +230 -0
- package/dist/lib/components/AcUserMenu.js +5 -0
- package/dist/lib/components/AcUserMenu.vue.d.ts +77 -0
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +258 -0
- package/dist/lib/components/index.d.ts +76 -0
- package/dist/lib/components/types.d.ts +16 -0
- package/dist/lib/composables/copyText.d.ts +6 -0
- package/dist/lib/composables/copyText.js +16 -0
- package/dist/lib/composables/useBrandColor.d.ts +53 -0
- package/dist/lib/composables/useBrandColor.js +148 -0
- package/dist/lib/composables/useColorMode.d.ts +12 -0
- package/dist/lib/composables/useColorMode.js +40 -0
- package/dist/lib/composables/useFontScale.d.ts +16 -0
- package/dist/lib/composables/useFontScale.js +43 -0
- package/dist/lib/composables/useToast.d.ts +68 -0
- package/dist/lib/composables/useToast.js +36 -0
- package/dist/lib/editor/index.d.ts +4 -0
- package/dist/lib/editor/index.js +3 -0
- package/dist/lib/editor/theme.d.ts +3 -0
- package/dist/lib/editor/theme.js +309 -0
- package/dist/lib/editor/validate.d.ts +19 -0
- package/dist/lib/editor/validate.js +127 -0
- package/dist/lib/index.d.ts +29 -0
- package/dist/lib/index.js +78 -0
- package/dist/lib/theme.css +556 -0
- package/package.json +82 -4
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
import e from "./AcTooltip.js";
|
|
2
|
+
import { copyText as t } from "../composables/copyText.js";
|
|
3
|
+
import n from "./AcSegmentedControl.js";
|
|
4
|
+
import { editorHighlight as r, editorPhrases as i, editorTheme as a } from "../editor/theme.js";
|
|
5
|
+
import { Fragment as ee, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, defineComponent as d, mergeModels as f, nextTick as te, normalizeClass as p, normalizeStyle as ne, onBeforeUnmount as re, onMounted as ie, openBlock as m, ref as h, renderList as ae, renderSlot as oe, resolveDynamicComponent as se, shallowRef as ce, toDisplayString as g, unref as _, useId as le, useModel as ue, useSlots as de, vShow as fe, watch as v, withCtx as pe, withDirectives as me } from "vue";
|
|
6
|
+
import { Check as he, CircleAlert as ge, Copy as _e, TriangleAlert as ve } from "@lucide/vue";
|
|
7
|
+
import { closeBrackets as ye, closeBracketsKeymap as be } from "@codemirror/autocomplete";
|
|
8
|
+
import { defaultKeymap as xe, history as Se, historyKeymap as Ce, indentWithTab as we, simplifySelection as Te, temporarilySetTabFocusMode as Ee } from "@codemirror/commands";
|
|
9
|
+
import { json as De } from "@codemirror/lang-json";
|
|
10
|
+
import { yaml as Oe } from "@codemirror/lang-yaml";
|
|
11
|
+
import { StreamLanguage as ke, bracketMatching as Ae, foldGutter as je, foldKeymap as Me, indentOnInput as Ne, indentUnit as Pe } from "@codemirror/language";
|
|
12
|
+
import { shell as Fe } from "@codemirror/legacy-modes/mode/shell";
|
|
13
|
+
import { lintGutter as Ie, lintKeymap as Le, linter as Re } from "@codemirror/lint";
|
|
14
|
+
import { highlightSelectionMatches as ze, search as Be, searchKeymap as Ve } from "@codemirror/search";
|
|
15
|
+
import { Compartment as y, EditorState as b, Text as x } from "@codemirror/state";
|
|
16
|
+
import { EditorView as S, drawSelection as He, dropCursor as Ue, highlightActiveLine as We, highlightActiveLineGutter as Ge, keymap as Ke, lineNumbers as C, placeholder as w } from "@codemirror/view";
|
|
17
|
+
//#region src/lib/components/AcCodeEditor.vue?vue&type=script&setup=true&lang.ts
|
|
18
|
+
var qe = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "flex min-h-11 flex-wrap items-center gap-x-3 gap-y-1.5 border-b border-border-light px-3 py-2"
|
|
21
|
+
}, Je = {
|
|
22
|
+
key: 0,
|
|
23
|
+
class: "min-w-0 truncate font-mono text-xs font-medium text-heading"
|
|
24
|
+
}, Ye = {
|
|
25
|
+
key: 1,
|
|
26
|
+
class: "rounded-4 bg-surface-sunken px-1.5 text-sm leading-5 font-medium text-muted"
|
|
27
|
+
}, Xe = {
|
|
28
|
+
key: 2,
|
|
29
|
+
class: "text-xs text-muted"
|
|
30
|
+
}, Ze = { class: "ml-auto flex min-w-0 flex-wrap items-center justify-end gap-2" }, Qe = ["aria-label"], $e = ["id"], et = {
|
|
31
|
+
class: "sr-only",
|
|
32
|
+
"aria-live": "polite"
|
|
33
|
+
}, tt = { class: "ac-scrollbar max-h-[calc(92px*var(--ac-scale))] py-1" }, nt = ["onClick"], rt = { class: "shrink-0 font-mono text-muted" }, it = { class: "min-w-0 [overflow-wrap:anywhere]" }, T = /*@__PURE__*/ d({
|
|
34
|
+
__name: "AcCodeEditor",
|
|
35
|
+
props: /*@__PURE__*/ f({
|
|
36
|
+
language: { default: "yaml" },
|
|
37
|
+
original: { default: void 0 },
|
|
38
|
+
readonly: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: !1
|
|
41
|
+
},
|
|
42
|
+
height: { default: "320px" },
|
|
43
|
+
maxHeight: { default: void 0 },
|
|
44
|
+
schema: { default: void 0 },
|
|
45
|
+
validate: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: !0
|
|
48
|
+
},
|
|
49
|
+
wrap: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: !0
|
|
52
|
+
},
|
|
53
|
+
lineNumbers: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: !0
|
|
56
|
+
},
|
|
57
|
+
placeholder: { default: "" },
|
|
58
|
+
title: { default: "" },
|
|
59
|
+
copyable: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: !1
|
|
62
|
+
},
|
|
63
|
+
diffLayout: { default: "unified" },
|
|
64
|
+
label: { default: "" },
|
|
65
|
+
bordered: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: !0
|
|
68
|
+
}
|
|
69
|
+
}, {
|
|
70
|
+
modelValue: { default: "" },
|
|
71
|
+
modelModifiers: {},
|
|
72
|
+
view: { default: "edit" },
|
|
73
|
+
viewModifiers: {}
|
|
74
|
+
}),
|
|
75
|
+
emits: /*@__PURE__*/ f([
|
|
76
|
+
"validate",
|
|
77
|
+
"focus",
|
|
78
|
+
"blur"
|
|
79
|
+
], ["update:modelValue", "update:view"]),
|
|
80
|
+
setup(d, { expose: f, emit: T }) {
|
|
81
|
+
let E = d, D = ue(d, "modelValue"), O = ue(d, "view"), k = T, at = de(), ot, A = () => ot ??= import("@codemirror/merge"), st, ct = () => st ??= import("../editor/validate.js"), j = {
|
|
82
|
+
yaml: "YAML",
|
|
83
|
+
json: "JSON",
|
|
84
|
+
shell: "Shell",
|
|
85
|
+
text: "Text"
|
|
86
|
+
}, M = {
|
|
87
|
+
margin: 3,
|
|
88
|
+
minSize: 6
|
|
89
|
+
}, lt = h(), N = h(), P = ce(), F, I = h([]), L = h(0), R = h(!1), ut = le(), z = o(() => E.original !== void 0 && !E.readonly), B = o(() => E.original !== void 0 && E.readonly), V = o(() => B.value || z.value && O.value === "changes"), dt = o(() => !!E.title || E.copyable || z.value || B.value || !!at.actions), ft = o(() => E.validate && (E.language === "yaml" || E.language === "json")), H = o(() => E.label || E.title || `${j[E.language]} editor`), pt = o(() => I.value.filter((e) => e.severity === "error").length), mt = o(() => [{
|
|
90
|
+
value: "edit",
|
|
91
|
+
label: "Edit"
|
|
92
|
+
}, {
|
|
93
|
+
value: "changes",
|
|
94
|
+
label: L.value ? `Changes · ${L.value}` : "Changes"
|
|
95
|
+
}]), U = o(() => ({
|
|
96
|
+
height: E.height === "auto" ? void 0 : E.height,
|
|
97
|
+
maxHeight: E.maxHeight
|
|
98
|
+
})), W = {
|
|
99
|
+
language: new y(),
|
|
100
|
+
readonly: new y(),
|
|
101
|
+
wrap: new y(),
|
|
102
|
+
gutters: new y(),
|
|
103
|
+
lint: new y(),
|
|
104
|
+
placeholder: new y(),
|
|
105
|
+
attributes: new y()
|
|
106
|
+
};
|
|
107
|
+
function G() {
|
|
108
|
+
return E.language === "yaml" ? Oe() : E.language === "json" ? De() : E.language === "shell" ? ke.define(Fe) : [];
|
|
109
|
+
}
|
|
110
|
+
function ht() {
|
|
111
|
+
return E.lineNumbers ? [
|
|
112
|
+
C(),
|
|
113
|
+
je({
|
|
114
|
+
openText: "▾",
|
|
115
|
+
closedText: "▸"
|
|
116
|
+
}),
|
|
117
|
+
Ge()
|
|
118
|
+
] : [];
|
|
119
|
+
}
|
|
120
|
+
function gt(e) {
|
|
121
|
+
JSON.stringify(e) !== JSON.stringify(I.value) && (I.value = e, k("validate", e));
|
|
122
|
+
}
|
|
123
|
+
function _t() {
|
|
124
|
+
return ft.value ? [Ie(), Re(async (e) => {
|
|
125
|
+
let t = e.state.doc.toString(), { checkDocument: n, toProblems: r } = await ct(), i = await n(t, E.language, E.schema);
|
|
126
|
+
return P.value?.state.doc.toString() === t && gt(r(i, e.state.doc)), i;
|
|
127
|
+
}, { delay: 300 })] : (gt([]), []);
|
|
128
|
+
}
|
|
129
|
+
function vt() {
|
|
130
|
+
return S.contentAttributes.of({
|
|
131
|
+
"aria-label": H.value,
|
|
132
|
+
...E.readonly ? { "aria-readonly": "true" } : {},
|
|
133
|
+
...pt.value ? {
|
|
134
|
+
"aria-invalid": "true",
|
|
135
|
+
"aria-describedby": ut
|
|
136
|
+
} : {}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
let K = 0, yt = {
|
|
140
|
+
key: "Escape",
|
|
141
|
+
run: (e) => {
|
|
142
|
+
let t = Date.now();
|
|
143
|
+
return t - K < 2e3 ? !1 : (K = t, Te(e), Ee(e));
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
function bt() {
|
|
147
|
+
P.value = new S({
|
|
148
|
+
parent: lt.value,
|
|
149
|
+
state: b.create({
|
|
150
|
+
doc: D.value,
|
|
151
|
+
extensions: [
|
|
152
|
+
a,
|
|
153
|
+
r,
|
|
154
|
+
i,
|
|
155
|
+
Se(),
|
|
156
|
+
He(),
|
|
157
|
+
Ue(),
|
|
158
|
+
Ne(),
|
|
159
|
+
Pe.of(" "),
|
|
160
|
+
b.tabSize.of(2),
|
|
161
|
+
Ae(),
|
|
162
|
+
ye(),
|
|
163
|
+
We(),
|
|
164
|
+
ze(),
|
|
165
|
+
Be({ top: !0 }),
|
|
166
|
+
Ke.of([
|
|
167
|
+
...be,
|
|
168
|
+
...Ve,
|
|
169
|
+
...Me,
|
|
170
|
+
...Le,
|
|
171
|
+
yt,
|
|
172
|
+
we,
|
|
173
|
+
...Ce,
|
|
174
|
+
...xe
|
|
175
|
+
]),
|
|
176
|
+
W.language.of(G()),
|
|
177
|
+
W.readonly.of(b.readOnly.of(E.readonly)),
|
|
178
|
+
W.wrap.of(E.wrap ? S.lineWrapping : []),
|
|
179
|
+
W.gutters.of(ht()),
|
|
180
|
+
W.lint.of(_t()),
|
|
181
|
+
W.placeholder.of(E.placeholder ? w(E.placeholder) : []),
|
|
182
|
+
W.attributes.of(vt()),
|
|
183
|
+
S.updateListener.of((e) => {
|
|
184
|
+
e.docChanged && (D.value = e.state.doc.toString()), e.focusChanged && e.view.hasFocus ? k("focus") : e.focusChanged && k("blur");
|
|
185
|
+
})
|
|
186
|
+
]
|
|
187
|
+
})
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
function q(e, t) {
|
|
191
|
+
P.value?.dispatch({ effects: e.reconfigure(t) });
|
|
192
|
+
}
|
|
193
|
+
function J(e) {
|
|
194
|
+
return [
|
|
195
|
+
a,
|
|
196
|
+
r,
|
|
197
|
+
G(),
|
|
198
|
+
b.readOnly.of(!0),
|
|
199
|
+
b.tabSize.of(2),
|
|
200
|
+
E.wrap ? S.lineWrapping : [],
|
|
201
|
+
E.lineNumbers ? C() : [],
|
|
202
|
+
S.contentAttributes.of({
|
|
203
|
+
"aria-label": e,
|
|
204
|
+
"aria-readonly": "true"
|
|
205
|
+
})
|
|
206
|
+
];
|
|
207
|
+
}
|
|
208
|
+
function Y() {
|
|
209
|
+
X++, F?.destroy(), F = void 0;
|
|
210
|
+
}
|
|
211
|
+
let X = 0;
|
|
212
|
+
async function Z() {
|
|
213
|
+
let e = ++X, { MergeView: t, unifiedMergeView: n } = await A();
|
|
214
|
+
if (e !== X || !V.value || (Y(), !N.value)) return;
|
|
215
|
+
let r = E.original ?? "";
|
|
216
|
+
if (E.diffLayout === "split") {
|
|
217
|
+
F = new t({
|
|
218
|
+
parent: N.value,
|
|
219
|
+
a: {
|
|
220
|
+
doc: r,
|
|
221
|
+
extensions: J(`Saved version of ${H.value}`)
|
|
222
|
+
},
|
|
223
|
+
b: {
|
|
224
|
+
doc: D.value,
|
|
225
|
+
extensions: J(`Changed version of ${H.value}`)
|
|
226
|
+
},
|
|
227
|
+
gutter: !0,
|
|
228
|
+
highlightChanges: !0,
|
|
229
|
+
collapseUnchanged: M
|
|
230
|
+
});
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
F = new S({
|
|
234
|
+
parent: N.value,
|
|
235
|
+
doc: D.value,
|
|
236
|
+
extensions: [J(`Changes to ${H.value}`), n({
|
|
237
|
+
original: r,
|
|
238
|
+
mergeControls: !1,
|
|
239
|
+
gutter: !0,
|
|
240
|
+
highlightChanges: !0,
|
|
241
|
+
syntaxHighlightDeletions: !0,
|
|
242
|
+
collapseUnchanged: M
|
|
243
|
+
})]
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
let Q;
|
|
247
|
+
function xt() {
|
|
248
|
+
if (clearTimeout(Q), E.original === void 0) {
|
|
249
|
+
L.value = 0;
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
Q = setTimeout(async () => {
|
|
253
|
+
let { Chunk: e } = await A();
|
|
254
|
+
E.original !== void 0 && (L.value = e.build(x.of(E.original.split("\n")), x.of(D.value.split("\n"))).length);
|
|
255
|
+
}, 250);
|
|
256
|
+
}
|
|
257
|
+
function St() {
|
|
258
|
+
P.value?.focus();
|
|
259
|
+
}
|
|
260
|
+
function Ct(e) {
|
|
261
|
+
let t = P.value;
|
|
262
|
+
t && (t.dispatch({
|
|
263
|
+
selection: {
|
|
264
|
+
anchor: e.from,
|
|
265
|
+
head: e.to
|
|
266
|
+
},
|
|
267
|
+
scrollIntoView: !0
|
|
268
|
+
}), t.focus());
|
|
269
|
+
}
|
|
270
|
+
let $;
|
|
271
|
+
async function wt() {
|
|
272
|
+
try {
|
|
273
|
+
await t(D.value), R.value = !0, clearTimeout($), $ = setTimeout(() => R.value = !1, 1500);
|
|
274
|
+
} catch {}
|
|
275
|
+
}
|
|
276
|
+
return v(D, (e) => {
|
|
277
|
+
let t = P.value;
|
|
278
|
+
t && e !== t.state.doc.toString() && t.dispatch({ changes: {
|
|
279
|
+
from: 0,
|
|
280
|
+
to: t.state.doc.length,
|
|
281
|
+
insert: e
|
|
282
|
+
} });
|
|
283
|
+
}), v(() => E.language, () => q(W.language, G())), v(() => E.readonly, (e) => q(W.readonly, b.readOnly.of(e))), v(() => E.wrap, (e) => q(W.wrap, e ? S.lineWrapping : [])), v(() => E.lineNumbers, () => q(W.gutters, ht())), v(() => E.placeholder, (e) => q(W.placeholder, e ? w(e) : [])), v([
|
|
284
|
+
() => E.language,
|
|
285
|
+
() => E.schema,
|
|
286
|
+
() => E.validate
|
|
287
|
+
], () => q(W.lint, _t())), v([
|
|
288
|
+
H,
|
|
289
|
+
() => E.readonly,
|
|
290
|
+
pt
|
|
291
|
+
], () => q(W.attributes, vt())), v([() => E.original, D], xt, { immediate: !0 }), v([
|
|
292
|
+
V,
|
|
293
|
+
() => E.diffLayout,
|
|
294
|
+
() => E.original,
|
|
295
|
+
() => E.language,
|
|
296
|
+
() => E.wrap
|
|
297
|
+
], async ([e]) => {
|
|
298
|
+
if (!e) return Y();
|
|
299
|
+
await te(), Z();
|
|
300
|
+
}), v(D, () => V.value && Z()), ie(() => {
|
|
301
|
+
bt(), V.value && Z();
|
|
302
|
+
}), re(() => {
|
|
303
|
+
clearTimeout(Q), clearTimeout($), Y(), P.value?.destroy();
|
|
304
|
+
}), f({
|
|
305
|
+
focus: St,
|
|
306
|
+
editor: P
|
|
307
|
+
}), (t, r) => (m(), l("div", {
|
|
308
|
+
class: p(["flex min-w-0 flex-col overflow-hidden bg-surface", d.bordered && "rounded-10 border border-border shadow-xs transition-[border-color,box-shadow] has-[.cm-editor.cm-focused]:focus-ring"]),
|
|
309
|
+
"data-ac-ds": "",
|
|
310
|
+
"data-testid": "ac-code-editor"
|
|
311
|
+
}, [
|
|
312
|
+
dt.value ? (m(), l("div", qe, [
|
|
313
|
+
d.title ? (m(), l("span", Je, g(d.title), 1)) : c("", !0),
|
|
314
|
+
d.language === "text" ? c("", !0) : (m(), l("span", Ye, g(j[d.language]), 1)),
|
|
315
|
+
B.value ? (m(), l("span", Xe, g(L.value ? `${L.value} ${L.value === 1 ? "change" : "changes"}` : "No changes"), 1)) : c("", !0),
|
|
316
|
+
u("div", Ze, [
|
|
317
|
+
oe(t.$slots, "actions"),
|
|
318
|
+
z.value ? (m(), s(n, {
|
|
319
|
+
key: 0,
|
|
320
|
+
modelValue: O.value,
|
|
321
|
+
"onUpdate:modelValue": r[0] ||= (e) => O.value = e,
|
|
322
|
+
options: mt.value,
|
|
323
|
+
size: "small",
|
|
324
|
+
label: "Editor view"
|
|
325
|
+
}, null, 8, ["modelValue", "options"])) : c("", !0),
|
|
326
|
+
d.copyable ? (m(), s(e, {
|
|
327
|
+
key: 1,
|
|
328
|
+
content: R.value ? "Copied" : "Copy"
|
|
329
|
+
}, {
|
|
330
|
+
default: pe(() => [u("button", {
|
|
331
|
+
type: "button",
|
|
332
|
+
class: "inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-6 text-muted transition hover:bg-surface-sunken hover:text-heading focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring",
|
|
333
|
+
"aria-label": R.value ? "Copied" : "Copy to clipboard",
|
|
334
|
+
onClick: wt
|
|
335
|
+
}, [R.value ? (m(), s(_(he), {
|
|
336
|
+
key: 0,
|
|
337
|
+
class: "size-3.5 text-success",
|
|
338
|
+
"aria-hidden": "true"
|
|
339
|
+
})) : (m(), s(_(_e), {
|
|
340
|
+
key: 1,
|
|
341
|
+
class: "size-3.5",
|
|
342
|
+
"aria-hidden": "true"
|
|
343
|
+
}))], 8, Qe)]),
|
|
344
|
+
_: 1
|
|
345
|
+
}, 8, ["content"])) : c("", !0)
|
|
346
|
+
])
|
|
347
|
+
])) : c("", !0),
|
|
348
|
+
me(u("div", {
|
|
349
|
+
ref_key: "host",
|
|
350
|
+
ref: lt,
|
|
351
|
+
class: p(["min-h-0 flex-auto [&>.cm-editor]:max-h-[inherit]", d.height === "auto" && "min-h-20"]),
|
|
352
|
+
style: ne(U.value)
|
|
353
|
+
}, null, 6), [[fe, !V.value]]),
|
|
354
|
+
V.value ? (m(), l("div", {
|
|
355
|
+
key: 1,
|
|
356
|
+
ref_key: "diffHost",
|
|
357
|
+
ref: N,
|
|
358
|
+
class: "min-h-0 flex-auto overflow-auto [&_.cm-mergeView]:h-full [&>.cm-editor]:max-h-[inherit]",
|
|
359
|
+
style: ne(U.value)
|
|
360
|
+
}, null, 4)) : c("", !0),
|
|
361
|
+
I.value.length && !V.value ? (m(), l("div", {
|
|
362
|
+
key: 2,
|
|
363
|
+
id: _(ut),
|
|
364
|
+
class: "border-t border-border-light bg-surface-muted"
|
|
365
|
+
}, [u("p", et, g(I.value.length) + " " + g(I.value.length === 1 ? "problem" : "problems"), 1), u("ul", tt, [(m(!0), l(ee, null, ae(I.value, (e, t) => (m(), l("li", { key: t }, [u("button", {
|
|
366
|
+
type: "button",
|
|
367
|
+
class: "flex w-full cursor-pointer items-start gap-2 px-3 py-1 text-left text-xs leading-5 text-body hover:bg-surface-sunken focus-visible:bg-surface-sunken focus-visible:outline-none",
|
|
368
|
+
onClick: (t) => Ct(e)
|
|
369
|
+
}, [
|
|
370
|
+
(m(), s(se(e.severity === "error" ? _(ge) : _(ve)), {
|
|
371
|
+
class: p(["mt-0.75 size-3.5 shrink-0", e.severity === "error" ? "text-red-50" : "text-yellow-50"]),
|
|
372
|
+
"aria-hidden": "true"
|
|
373
|
+
}, null, 8, ["class"])),
|
|
374
|
+
u("span", rt, "Ln " + g(e.line) + ", Col " + g(e.column), 1),
|
|
375
|
+
u("span", it, g(e.message), 1)
|
|
376
|
+
], 8, nt)]))), 128))])], 8, $e)) : c("", !0)
|
|
377
|
+
], 2));
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
//#endregion
|
|
381
|
+
export { T as default };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface Props {
|
|
2
|
+
/** Section title. */
|
|
3
|
+
title?: string;
|
|
4
|
+
/** Line under the title. */
|
|
5
|
+
subtitle?: string;
|
|
6
|
+
/** Draws a divider under the header. */
|
|
7
|
+
bordered?: boolean;
|
|
8
|
+
}
|
|
9
|
+
type __VLS_Slots = {
|
|
10
|
+
/** Icon before the title. */
|
|
11
|
+
icon?: () => unknown;
|
|
12
|
+
/** Right after the title, e.g. a count badge or info tooltip. */
|
|
13
|
+
"title-actions"?: () => unknown;
|
|
14
|
+
/** Right side: filters, search and actions. */
|
|
15
|
+
default?: () => unknown;
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
18
|
+
bordered: boolean;
|
|
19
|
+
title: string;
|
|
20
|
+
subtitle: string;
|
|
21
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
23
|
+
declare const _default: typeof __VLS_export;
|
|
24
|
+
export default _default;
|
|
25
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
26
|
+
new (): {
|
|
27
|
+
$slots: S;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createCommentVNode as e, createElementBlock as t, createElementVNode as n, defineComponent as r, normalizeClass as i, openBlock as a, renderSlot as o, toDisplayString as s } from "vue";
|
|
2
|
+
//#region src/lib/components/AcContentHeader.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var c = { class: "flex min-w-0 items-center gap-2.5" }, l = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "inline-flex shrink-0 text-muted"
|
|
6
|
+
}, u = { class: "min-w-0" }, d = { class: "flex items-center gap-2" }, f = { class: "truncate" }, p = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "mt-0.5 truncate text-xs text-muted"
|
|
9
|
+
}, m = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "flex flex-wrap items-center gap-2"
|
|
12
|
+
}, h = /*@__PURE__*/ r({
|
|
13
|
+
__name: "AcContentHeader",
|
|
14
|
+
props: {
|
|
15
|
+
title: { default: "" },
|
|
16
|
+
subtitle: { default: "" },
|
|
17
|
+
bordered: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: !0
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
setup(r) {
|
|
23
|
+
return (h, g) => (a(), t("div", {
|
|
24
|
+
class: i(["flex flex-wrap items-center justify-between gap-x-6 gap-y-3 px-5 py-3.5", r.bordered && "border-b border-border-light"]),
|
|
25
|
+
"data-ac-ds": "",
|
|
26
|
+
"data-testid": "ac-content-header"
|
|
27
|
+
}, [n("div", c, [h.$slots.icon ? (a(), t("span", l, [o(h.$slots, "icon")])) : e("", !0), n("div", u, [n("div", d, [n("h5", f, s(r.title), 1), o(h.$slots, "title-actions")]), r.subtitle ? (a(), t("p", p, s(r.subtitle), 1)) : e("", !0)])]), h.$slots.default ? (a(), t("div", m, [o(h.$slots, "default")])) : e("", !0)], 2));
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
//#endregion
|
|
31
|
+
export { h as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface Props {
|
|
2
|
+
/** Draws the white bordered surface. Turn off to place the layout inside another card. */
|
|
3
|
+
surface?: boolean;
|
|
4
|
+
}
|
|
5
|
+
type __VLS_Slots = {
|
|
6
|
+
/** Usually an `AcContentHeader`. */
|
|
7
|
+
header?: () => unknown;
|
|
8
|
+
/** The content under the header. */
|
|
9
|
+
default?: () => unknown;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
12
|
+
surface: boolean;
|
|
13
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
18
|
+
new (): {
|
|
19
|
+
$slots: S;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createElementBlock as e, createElementVNode as t, defineComponent as n, normalizeClass as r, openBlock as i, renderSlot as a } from "vue";
|
|
2
|
+
//#region src/lib/components/AcContentLayout.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var o = /*@__PURE__*/ n({
|
|
4
|
+
__name: "AcContentLayout",
|
|
5
|
+
props: { surface: {
|
|
6
|
+
type: Boolean,
|
|
7
|
+
default: !0
|
|
8
|
+
} },
|
|
9
|
+
setup(n) {
|
|
10
|
+
return (o, s) => (i(), e("section", {
|
|
11
|
+
class: r(n.surface && "rounded-10 border border-border bg-surface shadow-xs"),
|
|
12
|
+
"data-ac-ds": "",
|
|
13
|
+
"data-testid": "ac-content-layout"
|
|
14
|
+
}, [a(o.$slots, "header"), t("div", { class: r(n.surface && ["overflow-hidden rounded-b-10", !o.$slots.header && "rounded-t-10"]) }, [a(o.$slots, "default")], 2)], 2));
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
//#endregion
|
|
18
|
+
export { o as default };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export interface Props {
|
|
2
|
+
/** Title above the table. */
|
|
3
|
+
title?: string;
|
|
4
|
+
/** Line under the title, e.g. a count. */
|
|
5
|
+
subtitle?: string;
|
|
6
|
+
/** Adds a search box to the header. Its text is passed to the default slot as `searchText`. */
|
|
7
|
+
searchable?: boolean;
|
|
8
|
+
/** Placeholder of the search box. */
|
|
9
|
+
searchPlaceholder?: string;
|
|
10
|
+
/** Hides the header entirely. */
|
|
11
|
+
hideHeader?: boolean;
|
|
12
|
+
/** Pads the content area. Turn off when the slot is a flush table. */
|
|
13
|
+
padded?: boolean;
|
|
14
|
+
}
|
|
15
|
+
type __VLS_Props = Props;
|
|
16
|
+
type __VLS_Slots = {
|
|
17
|
+
/** Right after the title. */
|
|
18
|
+
"title-actions"?: () => unknown;
|
|
19
|
+
/** Header controls before the search box, e.g. filters. */
|
|
20
|
+
"left-controls"?: () => unknown;
|
|
21
|
+
/** Header controls after the search box, e.g. the Create button. */
|
|
22
|
+
"right-controls"?: () => unknown;
|
|
23
|
+
/** The table. Receives the current `searchText`. */
|
|
24
|
+
default?: (props: {
|
|
25
|
+
searchText: string;
|
|
26
|
+
}) => unknown;
|
|
27
|
+
};
|
|
28
|
+
type __VLS_ModelProps = {
|
|
29
|
+
/** The search text. Bind with `v-model:search` to control or read it. */
|
|
30
|
+
"search"?: string;
|
|
31
|
+
};
|
|
32
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
33
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
34
|
+
search: (value: string) => any;
|
|
35
|
+
"update:search": (value: string) => any;
|
|
36
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
37
|
+
onSearch?: ((value: string) => any) | undefined;
|
|
38
|
+
"onUpdate:search"?: ((value: string) => any) | undefined;
|
|
39
|
+
}>, {
|
|
40
|
+
title: string;
|
|
41
|
+
subtitle: string;
|
|
42
|
+
padded: boolean;
|
|
43
|
+
searchable: boolean;
|
|
44
|
+
searchPlaceholder: string;
|
|
45
|
+
hideHeader: boolean;
|
|
46
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
47
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
48
|
+
declare const _default: typeof __VLS_export;
|
|
49
|
+
export default _default;
|
|
50
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
51
|
+
new (): {
|
|
52
|
+
$slots: S;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import e from "./AcContentHeader.js";
|
|
2
|
+
import t from "./AcContentLayout.js";
|
|
3
|
+
import n from "./AcSearchBar.js";
|
|
4
|
+
import { createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createSlots as s, createVNode as c, defineComponent as l, mergeModels as u, normalizeClass as d, openBlock as f, renderSlot as p, useModel as m, withCtx as h } from "vue";
|
|
5
|
+
//#region src/lib/components/AcContentTable.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var g = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "w-56"
|
|
9
|
+
}, _ = /*@__PURE__*/ l({
|
|
10
|
+
__name: "AcContentTable",
|
|
11
|
+
props: /*@__PURE__*/ u({
|
|
12
|
+
title: { default: "" },
|
|
13
|
+
subtitle: { default: "" },
|
|
14
|
+
searchable: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: !1
|
|
17
|
+
},
|
|
18
|
+
searchPlaceholder: { default: "Search" },
|
|
19
|
+
hideHeader: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: !1
|
|
22
|
+
},
|
|
23
|
+
padded: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: !0
|
|
26
|
+
}
|
|
27
|
+
}, {
|
|
28
|
+
search: { default: "" },
|
|
29
|
+
searchModifiers: {}
|
|
30
|
+
}),
|
|
31
|
+
emits: /*@__PURE__*/ u(["search"], ["update:search"]),
|
|
32
|
+
setup(l, { emit: u }) {
|
|
33
|
+
let _ = u, v = m(l, "search");
|
|
34
|
+
return (u, m) => (f(), r(t, {
|
|
35
|
+
"data-ac-ds": "",
|
|
36
|
+
"data-testid": "ac-content-table"
|
|
37
|
+
}, s({
|
|
38
|
+
default: h(() => [o("div", { class: d(l.padded && "p-4") }, [p(u.$slots, "default", { searchText: v.value })], 2)]),
|
|
39
|
+
_: 2
|
|
40
|
+
}, [l.hideHeader ? void 0 : {
|
|
41
|
+
name: "header",
|
|
42
|
+
fn: h(() => [c(e, {
|
|
43
|
+
title: l.title,
|
|
44
|
+
subtitle: l.subtitle
|
|
45
|
+
}, s({
|
|
46
|
+
default: h(() => [
|
|
47
|
+
p(u.$slots, "left-controls"),
|
|
48
|
+
l.searchable ? (f(), a("div", g, [c(n, {
|
|
49
|
+
modelValue: v.value,
|
|
50
|
+
"onUpdate:modelValue": m[0] ||= (e) => v.value = e,
|
|
51
|
+
placeholder: l.searchPlaceholder,
|
|
52
|
+
onSearch: m[1] ||= (e) => _("search", e)
|
|
53
|
+
}, null, 8, ["modelValue", "placeholder"])])) : i("", !0),
|
|
54
|
+
p(u.$slots, "right-controls")
|
|
55
|
+
]),
|
|
56
|
+
_: 2
|
|
57
|
+
}, [u.$slots["title-actions"] ? {
|
|
58
|
+
name: "title-actions",
|
|
59
|
+
fn: h(() => [p(u.$slots, "title-actions")]),
|
|
60
|
+
key: "0"
|
|
61
|
+
} : void 0]), 1032, ["title", "subtitle"])]),
|
|
62
|
+
key: "0"
|
|
63
|
+
}]), 1024));
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
//#endregion
|
|
67
|
+
export { _ as default };
|