@veltra/desktop 1.7.17 → 1.7.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/batch-edit/batch-edit-form.js +6 -1
- package/dist/components/batch-edit/batch-edit-form.js.map +1 -1
- package/dist/components/batch-edit/batch-edit-list.js +45 -27
- package/dist/components/batch-edit/batch-edit-list.js.map +1 -1
- package/dist/components/batch-edit/batch-edit.js +2 -2
- package/dist/components/batch-edit/batch-edit.js.map +1 -1
- package/dist/components/batch-edit/di.js.map +1 -1
- package/dist/components/batch-edit/use-edit-state.js +14 -10
- package/dist/components/batch-edit/use-edit-state.js.map +1 -1
- package/dist/components/batch-edit/use-handlers.js +1 -0
- package/dist/components/batch-edit/use-handlers.js.map +1 -1
- package/dist/components/dialog/style2.css +1 -1
- package/dist/components/expression-editor/core/chip.js +1 -15
- package/dist/components/expression-editor/core/chip.js.map +1 -1
- package/dist/components/expression-editor/core/editor.js +0 -18
- package/dist/components/expression-editor/core/editor.js.map +1 -1
- package/dist/components/expression-editor/expression-editor.js +0 -4
- package/dist/components/expression-editor/expression-editor.js.map +1 -1
- package/dist/components/expression-editor/style2.css +0 -23
- package/dist/index.d.ts +2 -2
- package/dist/types/batch-edit.d.ts +0 -3
- package/dist/types/index.d.ts +2 -2
- package/package.json +1 -1
- package/src/components/batch-edit/__test__/batch-edit.test.ts +165 -38
- package/src/components/batch-edit/batch-edit-form.vue +7 -1
- package/src/components/batch-edit/batch-edit-list.vue +53 -22
- package/src/components/batch-edit/batch-edit.vue +2 -1
- package/src/components/batch-edit/di.ts +2 -0
- package/src/components/batch-edit/use-edit-state.ts +25 -32
- package/src/components/batch-edit/use-handlers.ts +2 -0
- package/src/components/dialog/style.scss +2 -1
- package/src/components/expression-editor/__test__/chip.test.ts +3 -14
- package/src/components/expression-editor/core/chip.ts +3 -29
- package/src/components/expression-editor/core/editor.ts +0 -21
- package/src/components/expression-editor/expression-editor.vue +0 -4
- package/src/components/expression-editor/style.scss +0 -29
- package/src/types/batch-edit.ts +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.js","names":[],"sources":["../../../../src/components/expression-editor/core/editor.ts"],"sourcesContent":["import type { BEM } from '@veltra/utils'\n\nimport type { VariableItem } from '../../../types'\nimport { createChip, isChipElement, readChipType, readChipValue } from './chip'\nimport { normalize, parse, serialize, type Doc, type Segment } from './model'\n\nconst TEXT_SEG_ATTR = 'data-seg'\nconst TEXT_SEG_VALUE = 'text'\n\nexport interface EditorVariableInfo {\n value: string\n label: string\n type?: string\n}\n\nexport interface EditorOptions {\n container: HTMLElement\n cls: BEM<'expression-editor'>\n initialDoc: Doc\n /**\n * 在 DOM → 模型反推、字符串 → 模型反序列化时为 chip 补齐 label / type。\n * 用 getter 形式以便外层 `variables` props 变化时拿到最新映射。\n */\n getVariableMap?: () => Map<string, VariableItem>\n /** 模型每次更新(包括用户键入文本)后回调 */\n onChange?: (doc: Doc) => void\n /** 选中区域 / 光标偏移变化时回调,offset 为序列化字符串中的位置;无选中或不在编辑器内时为 null */\n onSelectionChange?: (info: { offset: number | null }) => void\n /** 用户点击某个 chip 的主体(重选) */\n onChipReselect?: (info: { chipEl: HTMLElement; segIndex: number; chipOffset: number }) => void\n /** 用户点击某个 chip 的 ×(删除) */\n onChipRemove?: (info: { chipEl: HTMLElement; segIndex: number }) => void\n}\n\nexport interface EditorAPI {\n /** 当前模型 */\n getDoc(): Doc\n /** 完全替换模型(会重渲染 DOM) */\n setDoc(doc: Doc): void\n /** 序列化为字符串(modelValue 形态) */\n getValue(): string\n /** 反序列化字符串为模型并替换(可选传入 variableMap 以补齐 label/type) */\n setValue(value: string): void\n /** 当前光标偏移(无 selection 返回 null) */\n getCaretOffset(): number | null\n /** 把光标设置到指定偏移(不会修改模型) */\n setCaretOffset(offset: number): void\n /**\n * 用一个 var chip 替换 [start, end) 区间。\n * 调用方通常在 mention 选中时用:start = `@` 起点、end = 当前光标。\n */\n replaceRangeWithVar(start: number, end: number, variable: EditorVariableInfo): void\n /** 移除指定段下标对应的 var chip(必须是 var 段)。 */\n removeVarAt(segIndex: number): void\n /** 替换指定段下标对应的 var chip 为新变量(必须是 var 段)。 */\n replaceVarAt(segIndex: number, variable: EditorVariableInfo): void\n /** 卸载所有事件监听(不会销毁 container DOM) */\n dispose(): void\n /** 强制根据当前模型重渲染 DOM(光标位置尽量保留) */\n rerender(): void\n /** 容器引用(只读) */\n readonly container: HTMLElement\n}\n\nexport function createEditor(opts: EditorOptions): EditorAPI {\n let doc: Doc = normalize(opts.initialDoc)\n let composing = false\n\n function emitChange(next: Doc) {\n doc = next\n opts.onChange?.(doc)\n }\n\n function makeTextSpan(value: string): HTMLSpanElement {\n const span = document.createElement('span')\n span.setAttribute(TEXT_SEG_ATTR, TEXT_SEG_VALUE)\n span.textContent = value\n return span\n }\n\n function makeChipSpan(seg: Extract<Segment, { kind: 'var' }>): HTMLElement {\n return createChip(seg, {\n cls: opts.cls,\n onReselect: (chipEl) => {\n const { segIndex, chipOffset } = locateChip(chipEl)\n if (segIndex < 0) return\n opts.onChipReselect?.({ chipEl, segIndex, chipOffset })\n },\n onRemove: (chipEl) => {\n const { segIndex } = locateChip(chipEl)\n if (segIndex < 0) return\n opts.onChipRemove?.({ chipEl, segIndex })\n }\n })\n }\n\n function locateChip(chipEl: HTMLElement): { segIndex: number; chipOffset: number } {\n let chipOffset = 0\n let segIdx = -1\n let i = 0\n for (const child of Array.from(opts.container.childNodes)) {\n if (child === chipEl) {\n segIdx = i\n return { segIndex: segIdx, chipOffset }\n }\n chipOffset += childSerialLength(child)\n i++\n }\n return { segIndex: -1, chipOffset: -1 }\n }\n\n function childSerialLength(node: Node): number {\n if (isChipElement(node)) return readChipValue(node).length + 2\n return (node.textContent ?? '').length\n }\n\n /** 渲染 doc 到 container:每个 var 两侧都补一个 text span(即便空),保证光标可停靠。 */\n function render(targetCaret?: number) {\n const container = opts.container\n container.innerHTML = ''\n\n // 在边界与每两个 var 之间确保有 text span 占位\n const expanded: Segment[] = []\n let lastWasVar = false\n let first = true\n for (const seg of doc) {\n if (first) {\n if (seg.kind === 'var') expanded.push({ kind: 'text', value: '' })\n first = false\n } else if (lastWasVar && seg.kind === 'var') {\n expanded.push({ kind: 'text', value: '' })\n }\n expanded.push(seg)\n lastWasVar = seg.kind === 'var'\n }\n if (lastWasVar || expanded.length === 0) expanded.push({ kind: 'text', value: '' })\n\n for (const seg of expanded) {\n if (seg.kind === 'text') container.appendChild(makeTextSpan(seg.value))\n else container.appendChild(makeChipSpan(seg))\n }\n\n if (typeof targetCaret === 'number') setCaret(targetCaret)\n }\n\n /** 从 DOM 反推模型:宽容裸 text node、空 text span。 */\n function readDocFromDOM(): Doc {\n const segs: Segment[] = []\n for (const child of Array.from(opts.container.childNodes)) {\n if (isChipElement(child)) {\n const value = readChipValue(child)\n const domType = readChipType(child)\n const fallbackLabel =\n child.querySelector(`.${opts.cls.e('chip-label')}`)?.textContent ?? value\n // 优先从 variableMap 取最新 label / type,保持与外部数据源一致\n const fromMap = opts.getVariableMap?.().get(value)\n const finalType = fromMap?.type ?? domType\n const seg: Segment = finalType\n ? { kind: 'var', value, label: fromMap?.label ?? fallbackLabel, type: finalType }\n : { kind: 'var', value, label: fromMap?.label ?? fallbackLabel }\n segs.push(seg)\n } else {\n segs.push({ kind: 'text', value: child.textContent ?? '' })\n }\n }\n return normalize(segs)\n }\n\n /**\n * 计算光标在序列化字符串中的全局偏移。\n * 规则:\n * - 在 text span / 裸 text node 中:父级 / 节点之前的 segments 长度累加 + selection 内偏移\n * - 在 chip 边界:根据 selection 在 chip 节点之前 / 之后判断\n */\n function getCaretOffset(): number | null {\n const sel = document.getSelection()\n if (!sel || sel.rangeCount === 0) return null\n const range = sel.getRangeAt(0)\n if (!opts.container.contains(range.startContainer)) return null\n\n let offset = 0\n let found = false\n for (const child of Array.from(opts.container.childNodes)) {\n if (found) break\n if (isChipElement(child)) {\n if (range.startContainer === child) {\n // selection.startOffset 表示子节点索引:0 表示 chip 起始,>=1 表示 chip 之后\n if (range.startOffset === 0) return offset\n return offset + childSerialLength(child)\n }\n if (range.startContainer === opts.container && getChildIndex(child) === range.startOffset) {\n // 容器层 selection:偏移即子节点索引\n return offset\n }\n offset += childSerialLength(child)\n } else {\n // text span 或裸 text 节点\n if (\n range.startContainer === child ||\n (child.contains(range.startContainer) && child !== opts.container)\n ) {\n // 计算 selection 在该 child textContent 中的偏移\n const localOffset = computeTextOffsetWithin(\n child,\n range.startContainer,\n range.startOffset\n )\n return offset + localOffset\n }\n if (range.startContainer === opts.container && getChildIndex(child) === range.startOffset) {\n return offset\n }\n offset += childSerialLength(child)\n }\n }\n if (\n range.startContainer === opts.container &&\n range.startOffset === opts.container.childNodes.length\n ) {\n return offset\n }\n return null\n }\n\n function getChildIndex(node: Node): number {\n let i = 0\n let cur: Node | null = node.previousSibling\n while (cur) {\n i++\n cur = cur.previousSibling\n }\n return i\n }\n\n function computeTextOffsetWithin(root: Node, target: Node, targetOffset: number): number {\n if (root === target) return targetOffset\n let total = 0\n function walk(n: Node): boolean {\n if (n === target) {\n total += targetOffset\n return true\n }\n if (n.nodeType === 3) {\n total += (n as Text).data.length\n return false\n }\n for (const c of Array.from(n.childNodes)) {\n if (walk(c)) return true\n }\n return false\n }\n walk(root)\n return total\n }\n\n /** 把光标放到 offset 处,offset 大于文档长度时落到末尾。 */\n function setCaret(offset: number): void {\n const sel = document.getSelection()\n if (!sel) return\n\n let remain = offset\n const children = Array.from(opts.container.childNodes)\n for (let i = 0; i < children.length; i++) {\n const child = children[i]!\n const len = childSerialLength(child)\n if (isChipElement(child)) {\n if (remain <= 0) {\n // 光标定到 chip 之前 → 落到容器层 child 索引\n placeAt(opts.container, i)\n return\n }\n if (remain < len) {\n // 落在 chip 内部 → 视作 chip 之后\n placeAt(opts.container, i + 1)\n return\n }\n remain -= len\n } else {\n if (remain <= len) {\n // 落在该 text span 内\n placeWithinText(child, remain)\n return\n }\n remain -= len\n }\n }\n // 落到末尾\n if (children.length === 0) {\n placeAt(opts.container, 0)\n return\n }\n const last = children[children.length - 1]!\n if (isChipElement(last)) placeAt(opts.container, children.length)\n else placeWithinText(last, (last.textContent ?? '').length)\n }\n\n function placeAt(parent: Node, index: number) {\n const sel = document.getSelection()\n if (!sel) return\n const range = document.createRange()\n range.setStart(parent, index)\n range.collapse(true)\n sel.removeAllRanges()\n sel.addRange(range)\n }\n\n function placeWithinText(span: Node, offset: number): void {\n const sel = document.getSelection()\n if (!sel) return\n const target = firstTextDescendant(span)\n const range = document.createRange()\n if (target) {\n const max = target.data.length\n range.setStart(target, Math.min(offset, max))\n } else {\n // 空 span:让光标落到 span 内(child index 0)\n range.setStart(span, 0)\n }\n range.collapse(true)\n sel.removeAllRanges()\n sel.addRange(range)\n }\n\n function firstTextDescendant(root: Node): Text | null {\n if (root.nodeType === 3) return root as Text\n for (const c of Array.from(root.childNodes)) {\n const t = firstTextDescendant(c)\n if (t) return t\n }\n return null\n }\n\n /** input 后:从 DOM 反推 doc,并触发 onChange(如有变化)。 */\n function syncFromDOM(): void {\n if (composing) return\n const next = readDocFromDOM()\n if (!docEqual(next, doc)) emitChange(next)\n }\n\n function docEqual(a: Doc, b: Doc): boolean {\n if (a.length !== b.length) return false\n for (let i = 0; i < a.length; i++) {\n const x = a[i]!\n const y = b[i]!\n if (x.kind !== y.kind) return false\n if (x.kind === 'text' && y.kind === 'text' && x.value !== y.value) return false\n if (x.kind === 'var' && y.kind === 'var') {\n if (x.value !== y.value || x.label !== y.label || x.type !== y.type) return false\n }\n }\n return true\n }\n\n function onInput() {\n syncFromDOM()\n }\n function onCompositionStart() {\n composing = true\n }\n function onCompositionEnd() {\n composing = false\n syncFromDOM()\n }\n function onPaste(e: ClipboardEvent) {\n e.preventDefault()\n const text = e.clipboardData?.getData('text/plain') ?? ''\n if (!text) return\n insertPlainTextAtCaret(text)\n }\n function onSelectionChange() {\n if (composing) return\n if (!opts.onSelectionChange) return\n const sel = document.getSelection()\n if (!sel || sel.rangeCount === 0) {\n opts.onSelectionChange({ offset: null })\n return\n }\n const range = sel.getRangeAt(0)\n if (!opts.container.contains(range.startContainer)) {\n opts.onSelectionChange({ offset: null })\n return\n }\n opts.onSelectionChange({ offset: getCaretOffset() })\n }\n\n function insertPlainTextAtCaret(text: string) {\n const sel = document.getSelection()\n if (!sel || sel.rangeCount === 0) return\n const range = sel.getRangeAt(0)\n if (!opts.container.contains(range.startContainer)) return\n range.deleteContents()\n const node = document.createTextNode(text)\n range.insertNode(node)\n range.setStartAfter(node)\n range.collapse(true)\n sel.removeAllRanges()\n sel.addRange(range)\n syncFromDOM()\n }\n\n // 命令:替换区间为 var chip\n function replaceRangeWithVar(start: number, end: number, variable: EditorVariableInfo) {\n const a = Math.min(start, end)\n const b = Math.max(start, end)\n const left = sliceDoc(doc, 0, a)\n const right = sliceDoc(doc, b, totalLength(doc))\n const inserted: Segment = variable.type\n ? { kind: 'var', value: variable.value, label: variable.label, type: variable.type }\n : { kind: 'var', value: variable.value, label: variable.label }\n const next = normalize([...left, inserted, ...right])\n emitChange(next)\n render(a + variable.value.length + 2) // 光标定到 chip 之后\n }\n\n function removeVarAt(segIndex: number) {\n const target = doc[segIndex]\n if (!target || target.kind !== 'var') return\n const before = doc.slice(0, segIndex)\n const after = doc.slice(segIndex + 1)\n const caretOffset = sliceLength(before)\n const next = normalize([...before, ...after])\n emitChange(next)\n render(caretOffset)\n }\n\n function replaceVarAt(segIndex: number, variable: EditorVariableInfo) {\n const target = doc[segIndex]\n if (!target || target.kind !== 'var') return\n const next = doc.slice()\n const replaced: Segment = variable.type\n ? { kind: 'var', value: variable.value, label: variable.label, type: variable.type }\n : { kind: 'var', value: variable.value, label: variable.label }\n next[segIndex] = replaced\n const caretOffset = sliceLength(doc.slice(0, segIndex)) + variable.value.length + 2\n emitChange(normalize(next))\n render(caretOffset)\n }\n\n // 工具:基于序列化偏移的切片(不会切开 var)\n function sliceDoc(d: Doc, start: number, end: number): Doc {\n const out: Segment[] = []\n let pos = 0\n for (const seg of d) {\n const len = seg.kind === 'text' ? seg.value.length : seg.value.length + 2\n const segStart = pos\n const segEnd = pos + len\n if (segEnd <= start || segStart >= end) {\n pos += len\n continue\n }\n if (seg.kind === 'text') {\n const a = Math.max(0, start - segStart)\n const b = Math.min(len, end - segStart)\n const slice = seg.value.slice(a, b)\n if (slice) out.push({ kind: 'text', value: slice })\n } else {\n // var 是原子:只有当 [start, end) 完整覆盖该 var 时保留;否则抛弃\n if (start <= segStart && end >= segEnd) out.push(seg)\n }\n pos += len\n }\n return out\n }\n\n function sliceLength(d: Doc): number {\n let n = 0\n for (const s of d) n += s.kind === 'text' ? s.value.length : s.value.length + 2\n return n\n }\n\n function totalLength(d: Doc): number {\n return sliceLength(d)\n }\n\n // 绑定监听\n const container = opts.container\n container.addEventListener('input', onInput)\n container.addEventListener('compositionstart', onCompositionStart)\n container.addEventListener('compositionend', onCompositionEnd)\n container.addEventListener('paste', onPaste)\n document.addEventListener('selectionchange', onSelectionChange)\n\n // 初次渲染\n render()\n\n return {\n getDoc: () => doc,\n setDoc: (next) => {\n doc = normalize(next)\n render()\n opts.onChange?.(doc)\n },\n getValue: () => serialize(doc),\n setValue: (value) => {\n doc = parse(value, opts.getVariableMap?.())\n render()\n opts.onChange?.(doc)\n },\n getCaretOffset,\n setCaretOffset: setCaret,\n replaceRangeWithVar,\n removeVarAt,\n replaceVarAt,\n rerender: () => render(),\n dispose: () => {\n container.removeEventListener('input', onInput)\n container.removeEventListener('compositionstart', onCompositionStart)\n container.removeEventListener('compositionend', onCompositionEnd)\n container.removeEventListener('paste', onPaste)\n document.removeEventListener('selectionchange', onSelectionChange)\n },\n container\n }\n}\n"],"mappings":";;;AAMA,MAAM,gBAAgB;AACtB,MAAM,iBAAiB;AAyDvB,SAAgB,aAAa,MAAgC;CAC3D,IAAI,MAAW,UAAU,KAAK,UAAU;CACxC,IAAI,YAAY;CAEhB,SAAS,WAAW,MAAW;EAC7B,MAAM;EACN,KAAK,WAAW,GAAG;CACrB;CA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GAEtD,OAAO;EACT;EACA,OAAO;CACT;CAEA,SAAS,YAAY,GAAgB;EACnC,IAAI,IAAI;EACR,KAAK,MAAM,KAAK,GAAG,KAAK,EAAE,SAAS,SAAS,EAAE,MAAM,SAAS,EAAE,MAAM,SAAS;EAC9E,OAAO;CACT;CAEA,SAAS,YAAY,GAAgB;EACnC,OAAO,YAAY,CAAC;CACtB;CAGA,MAAM,YAAY,KAAK;CACvB,UAAU,iBAAiB,SAAS,OAAO;CAC3C,UAAU,iBAAiB,oBAAoB,kBAAkB;CACjE,UAAU,iBAAiB,kBAAkB,gBAAgB;CAC7D,UAAU,iBAAiB,SAAS,OAAO;CAC3C,SAAS,iBAAiB,mBAAmB,iBAAiB;CAG9D,OAAO;CAEP,OAAO;EACL,cAAc;EACd,SAAS,SAAS;GAChB,MAAM,UAAU,IAAI;GACpB,OAAO;GACP,KAAK,WAAW,GAAG;EACrB;EACA,gBAAgB,UAAU,GAAG;EAC7B,WAAW,UAAU;GACnB,MAAM,MAAM,OAAO,KAAK,iBAAiB,CAAC;GAC1C,OAAO;GACP,KAAK,WAAW,GAAG;EACrB;EACA;EACA,gBAAgB;EAChB;EACA;EACA;EACA,gBAAgB,OAAO;EACvB,eAAe;GACb,UAAU,oBAAoB,SAAS,OAAO;GAC9C,UAAU,oBAAoB,oBAAoB,kBAAkB;GACpE,UAAU,oBAAoB,kBAAkB,gBAAgB;GAChE,UAAU,oBAAoB,SAAS,OAAO;GAC9C,SAAS,oBAAoB,mBAAmB,iBAAiB;EACnE;EACA;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"editor.js","names":[],"sources":["../../../../src/components/expression-editor/core/editor.ts"],"sourcesContent":["import type { BEM } from '@veltra/utils'\n\nimport type { VariableItem } from '../../../types'\nimport { createChip, isChipElement, readChipType, readChipValue } from './chip'\nimport { normalize, parse, serialize, type Doc, type Segment } from './model'\n\nconst TEXT_SEG_ATTR = 'data-seg'\nconst TEXT_SEG_VALUE = 'text'\n\nexport interface EditorVariableInfo {\n value: string\n label: string\n type?: string\n}\n\nexport interface EditorOptions {\n container: HTMLElement\n cls: BEM<'expression-editor'>\n initialDoc: Doc\n /**\n * 在 DOM → 模型反推、字符串 → 模型反序列化时为 chip 补齐 label / type。\n * 用 getter 形式以便外层 `variables` props 变化时拿到最新映射。\n */\n getVariableMap?: () => Map<string, VariableItem>\n /** 模型每次更新(包括用户键入文本)后回调 */\n onChange?: (doc: Doc) => void\n /** 选中区域 / 光标偏移变化时回调,offset 为序列化字符串中的位置;无选中或不在编辑器内时为 null */\n onSelectionChange?: (info: { offset: number | null }) => void\n /** 用户点击某个 chip 的主体(重选) */\n onChipReselect?: (info: { chipEl: HTMLElement; segIndex: number; chipOffset: number }) => void\n}\n\nexport interface EditorAPI {\n /** 当前模型 */\n getDoc(): Doc\n /** 完全替换模型(会重渲染 DOM) */\n setDoc(doc: Doc): void\n /** 序列化为字符串(modelValue 形态) */\n getValue(): string\n /** 反序列化字符串为模型并替换(可选传入 variableMap 以补齐 label/type) */\n setValue(value: string): void\n /** 当前光标偏移(无 selection 返回 null) */\n getCaretOffset(): number | null\n /** 把光标设置到指定偏移(不会修改模型) */\n setCaretOffset(offset: number): void\n /**\n * 用一个 var chip 替换 [start, end) 区间。\n * 调用方通常在 mention 选中时用:start = `@` 起点、end = 当前光标。\n */\n replaceRangeWithVar(start: number, end: number, variable: EditorVariableInfo): void\n /** 替换指定段下标对应的 var chip 为新变量(必须是 var 段)。 */\n replaceVarAt(segIndex: number, variable: EditorVariableInfo): void\n /** 卸载所有事件监听(不会销毁 container DOM) */\n dispose(): void\n /** 强制根据当前模型重渲染 DOM(光标位置尽量保留) */\n rerender(): void\n /** 容器引用(只读) */\n readonly container: HTMLElement\n}\n\nexport function createEditor(opts: EditorOptions): EditorAPI {\n let doc: Doc = normalize(opts.initialDoc)\n let composing = false\n\n function emitChange(next: Doc) {\n doc = next\n opts.onChange?.(doc)\n }\n\n function makeTextSpan(value: string): HTMLSpanElement {\n const span = document.createElement('span')\n span.setAttribute(TEXT_SEG_ATTR, TEXT_SEG_VALUE)\n span.textContent = value\n return span\n }\n\n function makeChipSpan(seg: Extract<Segment, { kind: 'var' }>): HTMLElement {\n return createChip(seg, {\n cls: opts.cls,\n onReselect: (chipEl) => {\n const { segIndex, chipOffset } = locateChip(chipEl)\n if (segIndex < 0) return\n opts.onChipReselect?.({ chipEl, segIndex, chipOffset })\n }\n })\n }\n\n function locateChip(chipEl: HTMLElement): { segIndex: number; chipOffset: number } {\n let chipOffset = 0\n let segIdx = -1\n let i = 0\n for (const child of Array.from(opts.container.childNodes)) {\n if (child === chipEl) {\n segIdx = i\n return { segIndex: segIdx, chipOffset }\n }\n chipOffset += childSerialLength(child)\n i++\n }\n return { segIndex: -1, chipOffset: -1 }\n }\n\n function childSerialLength(node: Node): number {\n if (isChipElement(node)) return readChipValue(node).length + 2\n return (node.textContent ?? '').length\n }\n\n /** 渲染 doc 到 container:每个 var 两侧都补一个 text span(即便空),保证光标可停靠。 */\n function render(targetCaret?: number) {\n const container = opts.container\n container.innerHTML = ''\n\n // 在边界与每两个 var 之间确保有 text span 占位\n const expanded: Segment[] = []\n let lastWasVar = false\n let first = true\n for (const seg of doc) {\n if (first) {\n if (seg.kind === 'var') expanded.push({ kind: 'text', value: '' })\n first = false\n } else if (lastWasVar && seg.kind === 'var') {\n expanded.push({ kind: 'text', value: '' })\n }\n expanded.push(seg)\n lastWasVar = seg.kind === 'var'\n }\n if (lastWasVar || expanded.length === 0) expanded.push({ kind: 'text', value: '' })\n\n for (const seg of expanded) {\n if (seg.kind === 'text') container.appendChild(makeTextSpan(seg.value))\n else container.appendChild(makeChipSpan(seg))\n }\n\n if (typeof targetCaret === 'number') setCaret(targetCaret)\n }\n\n /** 从 DOM 反推模型:宽容裸 text node、空 text span。 */\n function readDocFromDOM(): Doc {\n const segs: Segment[] = []\n for (const child of Array.from(opts.container.childNodes)) {\n if (isChipElement(child)) {\n const value = readChipValue(child)\n const domType = readChipType(child)\n const fallbackLabel =\n child.querySelector(`.${opts.cls.e('chip-label')}`)?.textContent ?? value\n // 优先从 variableMap 取最新 label / type,保持与外部数据源一致\n const fromMap = opts.getVariableMap?.().get(value)\n const finalType = fromMap?.type ?? domType\n const seg: Segment = finalType\n ? { kind: 'var', value, label: fromMap?.label ?? fallbackLabel, type: finalType }\n : { kind: 'var', value, label: fromMap?.label ?? fallbackLabel }\n segs.push(seg)\n } else {\n segs.push({ kind: 'text', value: child.textContent ?? '' })\n }\n }\n return normalize(segs)\n }\n\n /**\n * 计算光标在序列化字符串中的全局偏移。\n * 规则:\n * - 在 text span / 裸 text node 中:父级 / 节点之前的 segments 长度累加 + selection 内偏移\n * - 在 chip 边界:根据 selection 在 chip 节点之前 / 之后判断\n */\n function getCaretOffset(): number | null {\n const sel = document.getSelection()\n if (!sel || sel.rangeCount === 0) return null\n const range = sel.getRangeAt(0)\n if (!opts.container.contains(range.startContainer)) return null\n\n let offset = 0\n let found = false\n for (const child of Array.from(opts.container.childNodes)) {\n if (found) break\n if (isChipElement(child)) {\n if (range.startContainer === child) {\n // selection.startOffset 表示子节点索引:0 表示 chip 起始,>=1 表示 chip 之后\n if (range.startOffset === 0) return offset\n return offset + childSerialLength(child)\n }\n if (range.startContainer === opts.container && getChildIndex(child) === range.startOffset) {\n // 容器层 selection:偏移即子节点索引\n return offset\n }\n offset += childSerialLength(child)\n } else {\n // text span 或裸 text 节点\n if (\n range.startContainer === child ||\n (child.contains(range.startContainer) && child !== opts.container)\n ) {\n // 计算 selection 在该 child textContent 中的偏移\n const localOffset = computeTextOffsetWithin(\n child,\n range.startContainer,\n range.startOffset\n )\n return offset + localOffset\n }\n if (range.startContainer === opts.container && getChildIndex(child) === range.startOffset) {\n return offset\n }\n offset += childSerialLength(child)\n }\n }\n if (\n range.startContainer === opts.container &&\n range.startOffset === opts.container.childNodes.length\n ) {\n return offset\n }\n return null\n }\n\n function getChildIndex(node: Node): number {\n let i = 0\n let cur: Node | null = node.previousSibling\n while (cur) {\n i++\n cur = cur.previousSibling\n }\n return i\n }\n\n function computeTextOffsetWithin(root: Node, target: Node, targetOffset: number): number {\n if (root === target) return targetOffset\n let total = 0\n function walk(n: Node): boolean {\n if (n === target) {\n total += targetOffset\n return true\n }\n if (n.nodeType === 3) {\n total += (n as Text).data.length\n return false\n }\n for (const c of Array.from(n.childNodes)) {\n if (walk(c)) return true\n }\n return false\n }\n walk(root)\n return total\n }\n\n /** 把光标放到 offset 处,offset 大于文档长度时落到末尾。 */\n function setCaret(offset: number): void {\n const sel = document.getSelection()\n if (!sel) return\n\n let remain = offset\n const children = Array.from(opts.container.childNodes)\n for (let i = 0; i < children.length; i++) {\n const child = children[i]!\n const len = childSerialLength(child)\n if (isChipElement(child)) {\n if (remain <= 0) {\n // 光标定到 chip 之前 → 落到容器层 child 索引\n placeAt(opts.container, i)\n return\n }\n if (remain < len) {\n // 落在 chip 内部 → 视作 chip 之后\n placeAt(opts.container, i + 1)\n return\n }\n remain -= len\n } else {\n if (remain <= len) {\n // 落在该 text span 内\n placeWithinText(child, remain)\n return\n }\n remain -= len\n }\n }\n // 落到末尾\n if (children.length === 0) {\n placeAt(opts.container, 0)\n return\n }\n const last = children[children.length - 1]!\n if (isChipElement(last)) placeAt(opts.container, children.length)\n else placeWithinText(last, (last.textContent ?? '').length)\n }\n\n function placeAt(parent: Node, index: number) {\n const sel = document.getSelection()\n if (!sel) return\n const range = document.createRange()\n range.setStart(parent, index)\n range.collapse(true)\n sel.removeAllRanges()\n sel.addRange(range)\n }\n\n function placeWithinText(span: Node, offset: number): void {\n const sel = document.getSelection()\n if (!sel) return\n const target = firstTextDescendant(span)\n const range = document.createRange()\n if (target) {\n const max = target.data.length\n range.setStart(target, Math.min(offset, max))\n } else {\n // 空 span:让光标落到 span 内(child index 0)\n range.setStart(span, 0)\n }\n range.collapse(true)\n sel.removeAllRanges()\n sel.addRange(range)\n }\n\n function firstTextDescendant(root: Node): Text | null {\n if (root.nodeType === 3) return root as Text\n for (const c of Array.from(root.childNodes)) {\n const t = firstTextDescendant(c)\n if (t) return t\n }\n return null\n }\n\n /** input 后:从 DOM 反推 doc,并触发 onChange(如有变化)。 */\n function syncFromDOM(): void {\n if (composing) return\n const next = readDocFromDOM()\n if (!docEqual(next, doc)) emitChange(next)\n }\n\n function docEqual(a: Doc, b: Doc): boolean {\n if (a.length !== b.length) return false\n for (let i = 0; i < a.length; i++) {\n const x = a[i]!\n const y = b[i]!\n if (x.kind !== y.kind) return false\n if (x.kind === 'text' && y.kind === 'text' && x.value !== y.value) return false\n if (x.kind === 'var' && y.kind === 'var') {\n if (x.value !== y.value || x.label !== y.label || x.type !== y.type) return false\n }\n }\n return true\n }\n\n function onInput() {\n syncFromDOM()\n }\n function onCompositionStart() {\n composing = true\n }\n function onCompositionEnd() {\n composing = false\n syncFromDOM()\n }\n function onPaste(e: ClipboardEvent) {\n e.preventDefault()\n const text = e.clipboardData?.getData('text/plain') ?? ''\n if (!text) return\n insertPlainTextAtCaret(text)\n }\n function onSelectionChange() {\n if (composing) return\n if (!opts.onSelectionChange) return\n const sel = document.getSelection()\n if (!sel || sel.rangeCount === 0) {\n opts.onSelectionChange({ offset: null })\n return\n }\n const range = sel.getRangeAt(0)\n if (!opts.container.contains(range.startContainer)) {\n opts.onSelectionChange({ offset: null })\n return\n }\n opts.onSelectionChange({ offset: getCaretOffset() })\n }\n\n function insertPlainTextAtCaret(text: string) {\n const sel = document.getSelection()\n if (!sel || sel.rangeCount === 0) return\n const range = sel.getRangeAt(0)\n if (!opts.container.contains(range.startContainer)) return\n range.deleteContents()\n const node = document.createTextNode(text)\n range.insertNode(node)\n range.setStartAfter(node)\n range.collapse(true)\n sel.removeAllRanges()\n sel.addRange(range)\n syncFromDOM()\n }\n\n // 命令:替换区间为 var chip\n function replaceRangeWithVar(start: number, end: number, variable: EditorVariableInfo) {\n const a = Math.min(start, end)\n const b = Math.max(start, end)\n const left = sliceDoc(doc, 0, a)\n const right = sliceDoc(doc, b, totalLength(doc))\n const inserted: Segment = variable.type\n ? { kind: 'var', value: variable.value, label: variable.label, type: variable.type }\n : { kind: 'var', value: variable.value, label: variable.label }\n const next = normalize([...left, inserted, ...right])\n emitChange(next)\n render(a + variable.value.length + 2) // 光标定到 chip 之后\n }\n\n function replaceVarAt(segIndex: number, variable: EditorVariableInfo) {\n const target = doc[segIndex]\n if (!target || target.kind !== 'var') return\n const next = doc.slice()\n const replaced: Segment = variable.type\n ? { kind: 'var', value: variable.value, label: variable.label, type: variable.type }\n : { kind: 'var', value: variable.value, label: variable.label }\n next[segIndex] = replaced\n const caretOffset = sliceLength(doc.slice(0, segIndex)) + variable.value.length + 2\n emitChange(normalize(next))\n render(caretOffset)\n }\n\n // 工具:基于序列化偏移的切片(不会切开 var)\n function sliceDoc(d: Doc, start: number, end: number): Doc {\n const out: Segment[] = []\n let pos = 0\n for (const seg of d) {\n const len = seg.kind === 'text' ? seg.value.length : seg.value.length + 2\n const segStart = pos\n const segEnd = pos + len\n if (segEnd <= start || segStart >= end) {\n pos += len\n continue\n }\n if (seg.kind === 'text') {\n const a = Math.max(0, start - segStart)\n const b = Math.min(len, end - segStart)\n const slice = seg.value.slice(a, b)\n if (slice) out.push({ kind: 'text', value: slice })\n } else {\n // var 是原子:只有当 [start, end) 完整覆盖该 var 时保留;否则抛弃\n if (start <= segStart && end >= segEnd) out.push(seg)\n }\n pos += len\n }\n return out\n }\n\n function sliceLength(d: Doc): number {\n let n = 0\n for (const s of d) n += s.kind === 'text' ? s.value.length : s.value.length + 2\n return n\n }\n\n function totalLength(d: Doc): number {\n return sliceLength(d)\n }\n\n // 绑定监听\n const container = opts.container\n container.addEventListener('input', onInput)\n container.addEventListener('compositionstart', onCompositionStart)\n container.addEventListener('compositionend', onCompositionEnd)\n container.addEventListener('paste', onPaste)\n document.addEventListener('selectionchange', onSelectionChange)\n\n // 初次渲染\n render()\n\n return {\n getDoc: () => doc,\n setDoc: (next) => {\n doc = normalize(next)\n render()\n opts.onChange?.(doc)\n },\n getValue: () => serialize(doc),\n setValue: (value) => {\n doc = parse(value, opts.getVariableMap?.())\n render()\n opts.onChange?.(doc)\n },\n getCaretOffset,\n setCaretOffset: setCaret,\n replaceRangeWithVar,\n replaceVarAt,\n rerender: () => render(),\n dispose: () => {\n container.removeEventListener('input', onInput)\n container.removeEventListener('compositionstart', onCompositionStart)\n container.removeEventListener('compositionend', onCompositionEnd)\n container.removeEventListener('paste', onPaste)\n document.removeEventListener('selectionchange', onSelectionChange)\n },\n container\n }\n}\n"],"mappings":";;;AAMA,MAAM,gBAAgB;AACtB,MAAM,iBAAiB;AAqDvB,SAAgB,aAAa,MAAgC;CAC3D,IAAI,MAAW,UAAU,KAAK,UAAU;CACxC,IAAI,YAAY;CAEhB,SAAS,WAAW,MAAW;EAC7B,MAAM;EACN,KAAK,WAAW,GAAG;CACrB;CAEA,SAAS,aAAa,OAAgC;EACpD,MAAM,OAAO,SAAS,cAAc,MAAM;EAC1C,KAAK,aAAa,eAAe,cAAc;EAC/C,KAAK,cAAc;EACnB,OAAO;CACT;CAEA,SAAS,aAAa,KAAqD;EACzE,OAAO,WAAW,KAAK;GACrB,KAAK,KAAK;GACV,aAAa,WAAW;IACtB,MAAM,EAAE,UAAU,eAAe,WAAW,MAAM;IAClD,IAAI,WAAW,GAAG;IAClB,KAAK,iBAAiB;KAAE;KAAQ;KAAU;IAAW,CAAC;GACxD;EACF,CAAC;CACH;CAEA,SAAS,WAAW,QAA+D;EACjF,IAAI,aAAa;EACjB,IAAI,SAAS;EACb,IAAI,IAAI;EACR,KAAK,MAAM,SAAS,MAAM,KAAK,KAAK,UAAU,UAAU,GAAG;GACzD,IAAI,UAAU,QAAQ;IACpB,SAAS;IACT,OAAO;KAAE,UAAU;KAAQ;IAAW;GACxC;GACA,cAAc,kBAAkB,KAAK;GACrC;EACF;EACA,OAAO;GAAE,UAAU;GAAI,YAAY;EAAG;CACxC;CAEA,SAAS,kBAAkB,MAAoB;EAC7C,IAAI,cAAc,IAAI,GAAG,OAAO,cAAc,IAAI,CAAC,CAAC,SA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M,CAAC;GACpD,OAEE,IAAI,SAAS,YAAY,OAAO,QAAQ,IAAI,KAAK,GAAG;GAEtD,OAAO;EACT;EACA,OAAO;CACT;CAEA,SAAS,YAAY,GAAgB;EACnC,IAAI,IAAI;EACR,KAAK,MAAM,KAAK,GAAG,KAAK,EAAE,SAAS,SAAS,EAAE,MAAM,SAAS,EAAE,MAAM,SAAS;EAC9E,OAAO;CACT;CAEA,SAAS,YAAY,GAAgB;EACnC,OAAO,YAAY,CAAC;CACtB;CAGA,MAAM,YAAY,KAAK;CACvB,UAAU,iBAAiB,SAAS,OAAO;CAC3C,UAAU,iBAAiB,oBAAoB,kBAAkB;CACjE,UAAU,iBAAiB,kBAAkB,gBAAgB;CAC7D,UAAU,iBAAiB,SAAS,OAAO;CAC3C,SAAS,iBAAiB,mBAAmB,iBAAiB;CAG9D,OAAO;CAEP,OAAO;EACL,cAAc;EACd,SAAS,SAAS;GAChB,MAAM,UAAU,IAAI;GACpB,OAAO;GACP,KAAK,WAAW,GAAG;EACrB;EACA,gBAAgB,UAAU,GAAG;EAC7B,WAAW,UAAU;GACnB,MAAM,MAAM,OAAO,KAAK,iBAAiB,CAAC;GAC1C,OAAO;GACP,KAAK,WAAW,GAAG;EACrB;EACA;EACA,gBAAgB;EAChB;EACA;EACA,gBAAgB,OAAO;EACvB,eAAe;GACb,UAAU,oBAAoB,SAAS,OAAO;GAC9C,UAAU,oBAAoB,oBAAoB,kBAAkB;GACpE,UAAU,oBAAoB,kBAAkB,gBAAgB;GAChE,UAAU,oBAAoB,SAAS,OAAO;GAC9C,SAAS,oBAAoB,mBAAmB,iBAAiB;EACnE;EACA;CACF;AACF"}
|
|
@@ -97,10 +97,6 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
97
97
|
pickerFilter.value = "";
|
|
98
98
|
pickerTriggerDom.value = chipEl;
|
|
99
99
|
reselectingSegIdx.value = segIndex;
|
|
100
|
-
},
|
|
101
|
-
onChipRemove: ({ segIndex }) => {
|
|
102
|
-
if (disabled.value || readonly.value) return;
|
|
103
|
-
editor.removeVarAt(segIndex);
|
|
104
100
|
}
|
|
105
101
|
});
|
|
106
102
|
editorRef.value = editor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expression-editor.js","names":[],"sources":["../../../src/components/expression-editor/expression-editor.vue"],"sourcesContent":["<template>\n <div :class=\"className\">\n <div\n ref=\"container\"\n :class=\"cls.e('container')\"\n :contenteditable=\"!readonly && !disabled\"\n :data-empty=\"isEmpty || undefined\"\n :data-placeholder=\"props.placeholder\"\n @keydown=\"onKeydown\"\n @blur=\"onBlur\"\n ></div>\n\n <div v-if=\"showPlaceholder\" :class=\"cls.e('placeholder')\">\n {{ props.placeholder }}\n </div>\n\n <VariablePicker\n ref=\"pickerRef\"\n :visible=\"pickerVisible\"\n :trigger-dom=\"pickerTriggerDom\"\n :variables=\"props.variables\"\n :filter=\"pickerFilter\"\n :selectable-levels=\"props.selectableLevels ?? 'leaf'\"\n @select=\"onPickerSelect\"\n @dismiss=\"onPickerDismiss\"\n @update:visible=\"onPickerVisibleChange\"\n />\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { useFormFallbackProps } from '@veltra/compositions'\nimport { bem } from '@veltra/utils'\nimport { injectFormContext } from '@veltra/utils'\nimport {\n computed,\n nextTick,\n onBeforeUnmount,\n onMounted,\n shallowRef,\n useTemplateRef,\n watch\n} from 'vue'\n\nimport type { ExpressionEditorProps, VariableItem } from '../../types'\nimport VariablePicker from './components/variable-picker.vue'\nimport { createEditor, type EditorAPI } from './core/editor'\nimport { createMention, type MentionAPI } from './core/mention'\nimport { parse, type Doc } from './core/model'\nimport { createVariableMap } from './di'\n\ndefineOptions({ name: 'UExpressionEditor' })\n\nconst props = withDefaults(defineProps<ExpressionEditorProps>(), {\n placeholder: '请输入表达式,输入 @ 可插入变量',\n selectableLevels: 'leaf'\n})\n\nconst emit = defineEmits<{ (e: 'update:modelValue', value: string): void }>()\n\nconst cls = bem('expression-editor')\nconst { formProps } = injectFormContext()\nconst { size, disabled, readonly } = useFormFallbackProps([formProps ?? {}, props])\n\nconst containerRef = useTemplateRef<HTMLDivElement>('container')\nconst pickerRef = useTemplateRef<{ handleKeydown: (e: KeyboardEvent) => boolean }>('pickerRef')\n\nconst className = computed(() => [\n cls.b,\n cls.m(size.value),\n bem.is('disabled', disabled.value),\n bem.is('readonly', readonly.value)\n])\n\nconst variableMap = computed(() => createVariableMap(props.variables))\n\nconst editorRef = shallowRef<EditorAPI | null>(null)\nconst mention: MentionAPI = createMention()\n\nconst currentDoc = shallowRef<Doc>([])\nconst isEmpty = computed(() => currentDoc.value.length === 0)\nconst showPlaceholder = computed(() => isEmpty.value && !disabled.value)\n\nconst pickerMode = shallowRef<'mention' | 'reselect' | null>(null)\nconst pickerTriggerDom = shallowRef<HTMLElement | undefined>(undefined)\nconst reselectingSegIdx = shallowRef<number | null>(null)\nconst pickerFilter = shallowRef('')\n\nconst pickerVisible = computed(() => pickerMode.value !== null)\n\nfunction syncMention() {\n const editor = editorRef.value\n if (!editor) return\n if (pickerMode.value === 'reselect') return\n const caret = editor.getCaretOffset()\n const state = mention.update(currentDoc.value, caret)\n if (state) {\n pickerMode.value = 'mention'\n pickerFilter.value = state.filter\n pickerTriggerDom.value = containerRef.value ?? undefined\n } else if (pickerMode.value === 'mention') {\n closePicker()\n }\n}\n\nfunction closePicker() {\n pickerMode.value = null\n reselectingSegIdx.value = null\n pickerFilter.value = ''\n}\n\nonMounted(() => {\n if (!containerRef.value) return\n const initialDoc = parse(props.modelValue ?? '', variableMap.value)\n currentDoc.value = initialDoc\n\n const editor = createEditor({\n container: containerRef.value,\n cls,\n initialDoc,\n getVariableMap: () => variableMap.value,\n onChange: (doc) => {\n currentDoc.value = doc\n const value = serializeFromDoc(doc)\n if (value !== (props.modelValue ?? '')) emit('update:modelValue', value)\n syncMention()\n },\n onSelectionChange: () => {\n syncMention()\n },\n onChipReselect: ({ chipEl, segIndex }) => {\n if (disabled.value || readonly.value) return\n mention.commit()\n pickerMode.value = 'reselect'\n pickerFilter.value = ''\n pickerTriggerDom.value = chipEl\n reselectingSegIdx.value = segIndex\n },\n onChipRemove: ({ segIndex }) => {\n if (disabled.value || readonly.value) return\n editor.removeVarAt(segIndex)\n }\n })\n editorRef.value = editor\n})\n\nonBeforeUnmount(() => {\n editorRef.value?.dispose()\n})\n\nfunction serializeFromDoc(doc: Doc): string {\n let s = ''\n for (const seg of doc) s += seg.kind === 'text' ? seg.value : `{${seg.value}}`\n return s\n}\n\nwatch(\n () => props.modelValue,\n (v) => {\n const editor = editorRef.value\n if (!editor) return\n if (v === editor.getValue()) return\n editor.setValue(v ?? '')\n }\n)\n\nwatch(variableMap, () => {\n // variables 变化:重渲染以刷新 chip label / type\n const editor = editorRef.value\n if (!editor) return\n editor.setValue(editor.getValue())\n})\n\nfunction onKeydown(e: KeyboardEvent) {\n if (disabled.value || readonly.value) return\n // mention / reselect 激活时,优先把箭头键 / Enter / Esc 转给 picker\n if (pickerMode.value !== null) {\n const handledByPicker = pickerRef.value?.handleKeydown(e)\n if (handledByPicker) {\n e.preventDefault()\n return\n }\n }\n\n if (pickerMode.value === 'mention') {\n // 这些键导致 mention 退出(保留 @filter 文本,光标继续移动)\n if (e.key === ' ' || e.key === 'ArrowLeft' || e.key === 'ArrowRight') {\n mention.dismiss()\n closePicker()\n }\n }\n}\n\nfunction onBlur() {\n if (pickerMode.value === 'mention') {\n mention.dismiss()\n // 下一帧再关闭,避免和 picker 内 click 冲突\n void nextTick(() => closePicker())\n }\n}\n\nfunction onPickerSelect(item: VariableItem) {\n const editor = editorRef.value\n if (!editor) return\n\n if (pickerMode.value === 'mention') {\n const state = mention.getState()\n if (!state) return\n const anchor = state.anchorOffset\n const caret = editor.getCaretOffset() ?? anchor + state.filter.length + 1\n editor.replaceRangeWithVar(anchor, caret, {\n value: item.value,\n label: item.label,\n ...(item.type ? { type: item.type } : {})\n })\n mention.commit()\n } else if (pickerMode.value === 'reselect') {\n const idx = reselectingSegIdx.value\n if (idx !== null) {\n editor.replaceVarAt(idx, {\n value: item.value,\n label: item.label,\n ...(item.type ? { type: item.type } : {})\n })\n }\n }\n closePicker()\n}\n\nfunction onPickerDismiss() {\n if (pickerMode.value === 'mention') mention.dismiss()\n closePicker()\n}\n\nfunction onPickerVisibleChange(v: boolean) {\n if (!v && pickerMode.value !== null) {\n if (pickerMode.value === 'mention') mention.dismiss()\n closePicker()\n }\n}\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqDA,MAAM,QAAQ;EAKd,MAAM,OAAO;EAEb,MAAM,MAAM,IAAI,mBAAmB;EACnC,MAAM,EAAE,cAAc,kBAAkB;EACxC,MAAM,EAAE,MAAM,UAAU,aAAa,qBAAqB,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC;EAElF,MAAM,eAAe,eAA+B,WAAW;EAC/D,MAAM,YAAY,eAAiE,WAAW;EAE9F,MAAM,YAAY,eAAe;GAC/B,IAAI;GACJ,IAAI,EAAE,KAAK,KAAK;GAChB,IAAI,GAAG,YAAY,SAAS,KAAK;GACjC,IAAI,GAAG,YAAY,SAAS,KAAK;EACnC,CAAC;EAED,MAAM,cAAc,eAAe,kBAAkB,MAAM,SAAS,CAAC;EAErE,MAAM,YAAY,WAA6B,IAAI;EACnD,MAAM,UAAsB,cAAc;EAE1C,MAAM,aAAa,WAAgB,CAAC,CAAC;EACrC,MAAM,UAAU,eAAe,WAAW,MAAM,WAAW,CAAC;EAC5D,MAAM,kBAAkB,eAAe,QAAQ,SAAS,CAAC,SAAS,KAAK;EAEvE,MAAM,aAAa,WAA0C,IAAI;EACjE,MAAM,mBAAmB,WAAoC,KAAA,CAAS;EACtE,MAAM,oBAAoB,WAA0B,IAAI;EACxD,MAAM,eAAe,WAAW,EAAE;EAElC,MAAM,gBAAgB,eAAe,WAAW,UAAU,IAAI;EAE9D,SAAS,cAAc;GACrB,MAAM,SAAS,UAAU;GACzB,IAAI,CAAC,QAAQ;GACb,IA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AAO,EAAE,MAAM,KAAK,KAAK,IAAI,CAAC;IACzC,CAAC;GAEL;GACA,YAAY;EACd;EAEA,SAAS,kBAAkB;GACzB,IAAI,WAAW,UAAU,WAAW,QAAQ,QAAQ;GACpD,YAAY;EACd;EAEA,SAAS,sBAAsB,GAAY;GACzC,IAAI,CAAC,KAAK,WAAW,UAAU,MAAM;IACnC,IAAI,WAAW,UAAU,WAAW,QAAQ,QAAQ;IACpD,YAAY;GACd;EACF;;GA9OE,OAAA,UAAA,GAAA,mBA0BM,OAAA,EA1BA,OAAK,eAAE,UAAA,KAAS,EAAA,GAAA;IACpB,mBAQO,OAAA;KAPL,KAAI;KACH,OAAK,eAAE,MAAA,GAAA,CAAG,CAAC,EAAC,WAAA,CAAA;KACZ,iBAAe,CAAG,MAAA,QAAA,KAAQ,CAAK,MAAA,QAAA;KAC/B,cAAY,QAAA,SAAW,KAAA;KACvB,oBAAkB,MAAM;KACf;KACH;;IAGE,gBAAA,SAAX,UAAA,GAAA,mBAEM,OAAA;;KAFuB,OAAK,eAAE,MAAA,GAAA,CAAG,CAAC,EAAC,aAAA,CAAA;IACpC,GAAA,gBAAA,MAAM,WAAW,GAAA,CAAA,KAAA,mBAAA,QAAA,IAAA;IAGtB,YAUE,aAAA;KATI,SAAA;KAAJ,KAAI;KACH,SAAS,cAAA;KACT,eAAa,iBAAA;KACb,WAAW,MAAM;KACjB,QAAQ,aAAA;KACR,qBAAmB,MAAM,oBAAgB;KACzC,UAAQ;KACR,WAAS;KACT,oBAAgB"}
|
|
1
|
+
{"version":3,"file":"expression-editor.js","names":[],"sources":["../../../src/components/expression-editor/expression-editor.vue"],"sourcesContent":["<template>\n <div :class=\"className\">\n <div\n ref=\"container\"\n :class=\"cls.e('container')\"\n :contenteditable=\"!readonly && !disabled\"\n :data-empty=\"isEmpty || undefined\"\n :data-placeholder=\"props.placeholder\"\n @keydown=\"onKeydown\"\n @blur=\"onBlur\"\n ></div>\n\n <div v-if=\"showPlaceholder\" :class=\"cls.e('placeholder')\">\n {{ props.placeholder }}\n </div>\n\n <VariablePicker\n ref=\"pickerRef\"\n :visible=\"pickerVisible\"\n :trigger-dom=\"pickerTriggerDom\"\n :variables=\"props.variables\"\n :filter=\"pickerFilter\"\n :selectable-levels=\"props.selectableLevels ?? 'leaf'\"\n @select=\"onPickerSelect\"\n @dismiss=\"onPickerDismiss\"\n @update:visible=\"onPickerVisibleChange\"\n />\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { useFormFallbackProps } from '@veltra/compositions'\nimport { bem } from '@veltra/utils'\nimport { injectFormContext } from '@veltra/utils'\nimport {\n computed,\n nextTick,\n onBeforeUnmount,\n onMounted,\n shallowRef,\n useTemplateRef,\n watch\n} from 'vue'\n\nimport type { ExpressionEditorProps, VariableItem } from '../../types'\nimport VariablePicker from './components/variable-picker.vue'\nimport { createEditor, type EditorAPI } from './core/editor'\nimport { createMention, type MentionAPI } from './core/mention'\nimport { parse, type Doc } from './core/model'\nimport { createVariableMap } from './di'\n\ndefineOptions({ name: 'UExpressionEditor' })\n\nconst props = withDefaults(defineProps<ExpressionEditorProps>(), {\n placeholder: '请输入表达式,输入 @ 可插入变量',\n selectableLevels: 'leaf'\n})\n\nconst emit = defineEmits<{ (e: 'update:modelValue', value: string): void }>()\n\nconst cls = bem('expression-editor')\nconst { formProps } = injectFormContext()\nconst { size, disabled, readonly } = useFormFallbackProps([formProps ?? {}, props])\n\nconst containerRef = useTemplateRef<HTMLDivElement>('container')\nconst pickerRef = useTemplateRef<{ handleKeydown: (e: KeyboardEvent) => boolean }>('pickerRef')\n\nconst className = computed(() => [\n cls.b,\n cls.m(size.value),\n bem.is('disabled', disabled.value),\n bem.is('readonly', readonly.value)\n])\n\nconst variableMap = computed(() => createVariableMap(props.variables))\n\nconst editorRef = shallowRef<EditorAPI | null>(null)\nconst mention: MentionAPI = createMention()\n\nconst currentDoc = shallowRef<Doc>([])\nconst isEmpty = computed(() => currentDoc.value.length === 0)\nconst showPlaceholder = computed(() => isEmpty.value && !disabled.value)\n\nconst pickerMode = shallowRef<'mention' | 'reselect' | null>(null)\nconst pickerTriggerDom = shallowRef<HTMLElement | undefined>(undefined)\nconst reselectingSegIdx = shallowRef<number | null>(null)\nconst pickerFilter = shallowRef('')\n\nconst pickerVisible = computed(() => pickerMode.value !== null)\n\nfunction syncMention() {\n const editor = editorRef.value\n if (!editor) return\n if (pickerMode.value === 'reselect') return\n const caret = editor.getCaretOffset()\n const state = mention.update(currentDoc.value, caret)\n if (state) {\n pickerMode.value = 'mention'\n pickerFilter.value = state.filter\n pickerTriggerDom.value = containerRef.value ?? undefined\n } else if (pickerMode.value === 'mention') {\n closePicker()\n }\n}\n\nfunction closePicker() {\n pickerMode.value = null\n reselectingSegIdx.value = null\n pickerFilter.value = ''\n}\n\nonMounted(() => {\n if (!containerRef.value) return\n const initialDoc = parse(props.modelValue ?? '', variableMap.value)\n currentDoc.value = initialDoc\n\n const editor = createEditor({\n container: containerRef.value,\n cls,\n initialDoc,\n getVariableMap: () => variableMap.value,\n onChange: (doc) => {\n currentDoc.value = doc\n const value = serializeFromDoc(doc)\n if (value !== (props.modelValue ?? '')) emit('update:modelValue', value)\n syncMention()\n },\n onSelectionChange: () => {\n syncMention()\n },\n onChipReselect: ({ chipEl, segIndex }) => {\n if (disabled.value || readonly.value) return\n mention.commit()\n pickerMode.value = 'reselect'\n pickerFilter.value = ''\n pickerTriggerDom.value = chipEl\n reselectingSegIdx.value = segIndex\n }\n })\n editorRef.value = editor\n})\n\nonBeforeUnmount(() => {\n editorRef.value?.dispose()\n})\n\nfunction serializeFromDoc(doc: Doc): string {\n let s = ''\n for (const seg of doc) s += seg.kind === 'text' ? seg.value : `{${seg.value}}`\n return s\n}\n\nwatch(\n () => props.modelValue,\n (v) => {\n const editor = editorRef.value\n if (!editor) return\n if (v === editor.getValue()) return\n editor.setValue(v ?? '')\n }\n)\n\nwatch(variableMap, () => {\n // variables 变化:重渲染以刷新 chip label / type\n const editor = editorRef.value\n if (!editor) return\n editor.setValue(editor.getValue())\n})\n\nfunction onKeydown(e: KeyboardEvent) {\n if (disabled.value || readonly.value) return\n // mention / reselect 激活时,优先把箭头键 / Enter / Esc 转给 picker\n if (pickerMode.value !== null) {\n const handledByPicker = pickerRef.value?.handleKeydown(e)\n if (handledByPicker) {\n e.preventDefault()\n return\n }\n }\n\n if (pickerMode.value === 'mention') {\n // 这些键导致 mention 退出(保留 @filter 文本,光标继续移动)\n if (e.key === ' ' || e.key === 'ArrowLeft' || e.key === 'ArrowRight') {\n mention.dismiss()\n closePicker()\n }\n }\n}\n\nfunction onBlur() {\n if (pickerMode.value === 'mention') {\n mention.dismiss()\n // 下一帧再关闭,避免和 picker 内 click 冲突\n void nextTick(() => closePicker())\n }\n}\n\nfunction onPickerSelect(item: VariableItem) {\n const editor = editorRef.value\n if (!editor) return\n\n if (pickerMode.value === 'mention') {\n const state = mention.getState()\n if (!state) return\n const anchor = state.anchorOffset\n const caret = editor.getCaretOffset() ?? anchor + state.filter.length + 1\n editor.replaceRangeWithVar(anchor, caret, {\n value: item.value,\n label: item.label,\n ...(item.type ? { type: item.type } : {})\n })\n mention.commit()\n } else if (pickerMode.value === 'reselect') {\n const idx = reselectingSegIdx.value\n if (idx !== null) {\n editor.replaceVarAt(idx, {\n value: item.value,\n label: item.label,\n ...(item.type ? { type: item.type } : {})\n })\n }\n }\n closePicker()\n}\n\nfunction onPickerDismiss() {\n if (pickerMode.value === 'mention') mention.dismiss()\n closePicker()\n}\n\nfunction onPickerVisibleChange(v: boolean) {\n if (!v && pickerMode.value !== null) {\n if (pickerMode.value === 'mention') mention.dismiss()\n closePicker()\n }\n}\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqDA,MAAM,QAAQ;EAKd,MAAM,OAAO;EAEb,MAAM,MAAM,IAAI,mBAAmB;EACnC,MAAM,EAAE,cAAc,kBAAkB;EACxC,MAAM,EAAE,MAAM,UAAU,aAAa,qBAAqB,CAAC,aAAa,CAAC,G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;IAGE,gBAAA,SAAX,UAAA,GAAA,mBAEM,OAAA;;KAFuB,OAAK,eAAE,MAAA,GAAA,CAAG,CAAC,EAAC,aAAA,CAAA;IACpC,GAAA,gBAAA,MAAM,WAAW,GAAA,CAAA,KAAA,mBAAA,QAAA,IAAA;IAGtB,YAUE,aAAA;KATI,SAAA;KAAJ,KAAI;KACH,SAAS,cAAA;KACT,eAAa,iBAAA;KACb,WAAW,MAAM;KACjB,QAAQ,aAAA;KACR,qBAAmB,MAAM,oBAAgB;KACzC,UAAQ;KACR,WAAS;KACT,oBAAgB"}
|
|
@@ -93,35 +93,12 @@
|
|
|
93
93
|
background-color: var(--u-expression-editor-chip-bg, var(--u-color-primary-light-7));
|
|
94
94
|
box-shadow: 0 1px 4px var(--u-shadow-color);
|
|
95
95
|
}
|
|
96
|
-
.u-expression-editor__chip:hover .u-expression-editor__chip-close {
|
|
97
|
-
opacity: 1;
|
|
98
|
-
max-width: 14px;
|
|
99
|
-
margin-left: 2px;
|
|
100
|
-
}
|
|
101
96
|
.u-expression-editor__chip.is-focused {
|
|
102
97
|
box-shadow: 0 0 0 2px var(--u-color-primary-light-7);
|
|
103
98
|
}
|
|
104
99
|
.u-expression-editor__chip-label {
|
|
105
100
|
pointer-events: none;
|
|
106
101
|
}
|
|
107
|
-
.u-expression-editor__chip-close {
|
|
108
|
-
display: inline-flex;
|
|
109
|
-
align-items: center;
|
|
110
|
-
justify-content: center;
|
|
111
|
-
width: 14px;
|
|
112
|
-
max-width: 0;
|
|
113
|
-
margin-left: 0;
|
|
114
|
-
overflow: hidden;
|
|
115
|
-
font-size: 14px;
|
|
116
|
-
line-height: 1;
|
|
117
|
-
color: var(--u-color-primary);
|
|
118
|
-
opacity: 0;
|
|
119
|
-
transition: opacity 0.12s ease, max-width 0.12s ease, margin-left 0.12s ease;
|
|
120
|
-
cursor: pointer;
|
|
121
|
-
}
|
|
122
|
-
.u-expression-editor__chip-close:hover {
|
|
123
|
-
transform: scale(1.1);
|
|
124
|
-
}
|
|
125
102
|
.u-expression-editor__picker {
|
|
126
103
|
min-width: 220px;
|
|
127
104
|
background-color: var(--u-bg-color-top);
|
package/dist/index.d.ts
CHANGED
|
@@ -115,7 +115,7 @@ import { DatePanelEmits, DatePanelProps, PanelType } from "./types/date-panel.js
|
|
|
115
115
|
import { DialogEmits, DialogExposed, DialogProps, DialogTransition, _DialogExposed } from "./types/dialog.js";
|
|
116
116
|
import { ActionEmits, ActionExposed, ActionGroupExposed, ActionGroupProps, ActionProps, _ActionExposed, _ActionGroupExposed } from "./types/action.js";
|
|
117
117
|
import { TableColumn, TableColumnAlign, TableColumnNode, TableColumnRenderContext, TableColumnSlotsScope, TableColumnStyle, TableEmits, TableExposed, TableProps, TableRow, TableRowSlotsScope, TableSummaryContext, _TableExposed } from "./types/table.js";
|
|
118
|
-
import { BatchEditColumn, BatchEditEmits, BatchEditExposed, BatchEditFeature,
|
|
118
|
+
import { BatchEditColumn, BatchEditEmits, BatchEditExposed, BatchEditFeature, BatchEditProps, BatchEditSlots, BatchEditStates, _BatchEditExposed } from "./types/batch-edit.js";
|
|
119
119
|
import { BreadcrumbEmits, BreadcrumbExposed, BreadcrumbItem, BreadcrumbProps, BreadcrumbSlotScope, _BreadcrumbExposed } from "./types/breadcrumb.js";
|
|
120
120
|
import { ListEmits, ListExposed, ListProps, _ListExposed } from "./types/list.js";
|
|
121
121
|
import { EmptyEmits, EmptyExposed, EmptyProps, _EmptyExposed } from "./types/empty.js";
|
|
@@ -185,4 +185,4 @@ import { defineBatchEditColumns } from "./components/batch-edit/helper.js";
|
|
|
185
185
|
import { defineTableColumns } from "./components/table/use-columns.js";
|
|
186
186
|
import "./components/index.js";
|
|
187
187
|
export * from "@veltra/utils";
|
|
188
|
-
export { type ActionEmits, type ActionExposed, type ActionGroupExposed, type ActionGroupProps, type ActionProps, type AnimationEmits, type AnimationExposed, type AnimationProps, type AutoCompleteEmits, type AutoCompleteExposed, type AutoCompleteProps, type BadgeEmits, type BadgeExposed, type BadgeProps, type BarType, type BatchEditColumn, type BatchEditEmits, type BatchEditExposed, type BatchEditFeature, type BatchEditFormStatus, type BatchEditProps, type BatchEditSlots, type BatchEditStates, type BreadcrumbEmits, type BreadcrumbExposed, type BreadcrumbItem, type BreadcrumbProps, type BreadcrumbSlotScope, type BreakCols, type Breakpoint, type ButtonEmits, type ButtonExposed, type ButtonProps, type ButtonType, type CalendarDay, type CalendarEmits, type CalendarExposed, type CalendarMonth, type CalendarProps, type CalendarYear, type CardActionProps, type CardContentProps, type CardCoverProps, type CardEmits, type CardExposed, type CardProps, type CascadeEmits, type CascadeExposed, type CascadeNode, type CascadeProps, type CheckTagEmits, type CheckTagExposed, type CheckTagProps, type CheckboxButtonEmits, type CheckboxButtonProps, type CheckboxEmits, type CheckboxExposed, type CheckboxGroupEmits, type CheckboxGroupExposed, type CheckboxGroupProps, type CheckboxProps, type CodeEditorEmits, type CodeEditorExposed, type CodeEditorLang, type CodeEditorProps, type CollapseEmits, type CollapseItemEmits, type CollapseItemProps, type CollapseModelValue, type CollapseProps, type CollapseValue, type ConditionConnector, type ConditionEditorEmits, type ConditionEditorExposed, type ConditionEditorProps, type EvaluateOptions as ConditionEvaluateOptions, type ConditionExpression, type ConditionField, type ConditionGroup, type ConditionLeaf, type ConditionNode, type ConditionValue, type ContextmenuEmits, type ContextmenuExposed, type ContextmenuItem, ContextmenuPanelDIKey, type ContextmenuProps, ContextmenuRootDIKey, type CssTransitionEmits, type CssTransitionExposed, type CssTransitionProps, type DatePanelEmits, type DatePanelProps, type DatePickerDataType, type DatePickerEmits, type DatePickerExposed, type DatePickerProps, type DateRangePickerDataType, type DateRangePickerEmits, type DateRangePickerExposed, type DateRangePickerProps, type DateRangeValue, type DialogEmits, type DialogExposed, type DialogProps, type DialogTransition, type DrawerDirection, type DrawerEmits, type DrawerExposed, type DrawerMode, type DrawerProps, type DropdownEmits, type DropdownExposed, type DropdownProps, type DualNavEmits, type DualNavExposed, type DualNavProps, type DualNavRailVariant, type DualNavRootItem, type EmptyEmits, type EmptyExposed, type EmptyProps, type ExpressionEditorEmits, type ExpressionEditorExposed, type ExpressionEditorProps, type ExpressionSelectableLevels, type FileViewerEmits, type FileViewerExposed, type FileViewerItem, type FileViewerKind, type FileViewerProps, type FloatButtonEmits, type FloatButtonExposed, type FloatButtonItem, type FloatButtonProps, type FormEmits, type FormExposed, type FormItemEmits, type FormItemExposed, type FormItemProps, type FormProps, type GanttChartEmits, type GanttChartExposed, type GanttChartProps, type GridEmits, type GridExposed, type GridInputEmits, type GridInputExposed, type GridInputProps, type GridItemProps, type GridProps, type GroupInputEmits, type GroupInputExposed, type GroupInputProps, type GroupNavEmits, type GroupNavGroup, type GroupNavProps, type IconEmits, type IconExposed, type IconProps, type ImageCropperChangePayload, type ImageCropperCropTransform, type ImageCropperEmits, type ImageCropperExposed, type ImageCropperProps, type ImageCropperResult, type ImageCropperResultOptions, type ImageCropperSelection, type InputEmits, type InputExposed, type InputProps, type LayoutEmits, type LayoutExposed, type LayoutProps, type ListEmits, type ListExposed, type ListProps, type LoadingEmits, type LoadingExposed, type LoadingProps, type LoadingType, type Message, type MessageConfirm, type MessageConfirmAction, type MessageConfirmEmits, type MessageConfirmExposed, type MessageConfirmInstance, type MessageConfirmOptions, type MessageConfirmProps, type MessageEmits, type MessageExposed, type MessageInstance, type MessageOptions, type MessageProps, type MessageType, type MultiAutoCompleteEmits, type MultiAutoCompleteExposed, type MultiAutoCompleteProps, type MultiSelectEmits, type MultiSelectExposed, type MultiSelectProps, type MultiTreeSelectEmits, type MultiTreeSelectExposed, type MultiTreeSelectProps, type NavEmits, type NavExposed, type NavItem, type NavProps, type NodeRenderExposed, type NodeRenderProps, type Notification, type NotificationEmits, type NotificationExposed, type NotificationInstance, type NotificationOptions, type NotificationPosition, type NotificationProps, type NumberEmits, type NumberExposed, type NumberInputEmits, type NumberInputExposed, type NumberInputProps, type NumberProps, type NumberRangeInputEmits, type NumberRangeInputExposed, type NumberRangeInputProps, type NumberRangeTuple, type PaginatorEmits, type PaginatorExposed, type PaginatorProps, type PaletteColorType, type PaletteEmits, type PaletteExposed, type PaletteHSV, type PaletteProps, type PaletteRGB, type PanelItem, type PanelType, type PasswordInputEmits, type PasswordInputExposed, type PasswordInputProps, type PopConfirmEmits, type PopConfirmExposed, type PopConfirmProps, type PopEmits, type PopExposed, type PopProps, type ProgressEmits, type ProgressExposed, type ProgressNodesEmits, type ProgressNodesExposed, type ProgressNodesProps, type ProgressProps, type QuickBatchEditEmits, type QuickBatchEditExposed, type QuickBatchEditProps, type RadioEmits, type RadioExposed, type RadioGroupEmits, type RadioGroupExposed, type RadioGroupProps, type RadioProps, type RichTextEditorEmits, type RichTextEditorExposed, type RichTextEditorProps, type RichTextFormat, type ScrollEmits, type ScrollExposed, type ScrollPosition, type ScrollProps, type SegmentEmits, type SegmentExposed, type SegmentItem, type SegmentProps, type SelectEmits, type SelectExposed, type SelectProps, type SliderEmits, type SliderExposed, type SliderProps, type StepsEmits, type StepsExposed, type StepsProps, type StepsSlotScope, type SwitchEmits, type SwitchExposed, type SwitchProps, type TabItem, type TableColumn, type TableColumnAlign, type TableColumnNode, type TableColumnRenderContext, type TableColumnSlotsScope, type TableColumnStyle, type TableEditorColumn, type TableEditorEmits, type TableEditorExposed, type TableEditorProps, type TableEmits, type TableExposed, type TableProps, type TableRow, type TableRowSlotsScope, type TableSummaryContext, type TabsEmits, type TabsExposed, type TabsHorizontalEmits, type TabsHorizontalExposed, type TabsHorizontalProps, type TabsProps, type TabsVerticalEmits, type TabsVerticalExposed, type TabsVerticalProps, type TagEmits, type TagExposed, type TagProps, type TextEditorEmits, type TextEditorExposed, type TextEditorProps, type TextEmits, type TextExposed, type TextProps, type TextareaEmits, type TextareaExposed, type TextareaProps, type ThemeExposed, type ThemeProps, type TipAlign, type TipDirection, type TipEmits, type TipExposed, type TipProps, type TipType, type ToolbarItem, type TreeEmit, type TreeExposed, type TreeNode, type TreeNodeProps, type TreeProps, type TreeSelectEmits, type TreeSelectExposed, type TreeSelectProps, _sfc_main as UAction, action_group_default as UActionGroup, _sfc_main$1 as UAutoComplete, _sfc_main$2 as UBadge, _sfc_main$3 as UBatchEdit, _sfc_main$4 as UBreadcrumb, _sfc_main$5 as UButton, _sfc_main$6 as UButtonGroup, _sfc_main$7 as UCalendar, _sfc_main$8 as UCard, _sfc_main$9 as UCardAction, _sfc_main$10 as UCardContent, _sfc_main$11 as UCardCover, _sfc_main$12 as UCardHeader, _sfc_main$13 as UCascade, _sfc_main$14 as UCheckTag, _sfc_main$15 as UCheckbox, _sfc_main$16 as UCheckboxButton, _sfc_main$17 as UCheckboxGroup, _sfc_main$18 as UCodeEditor, _sfc_main$19 as UCollapse, _sfc_main$20 as UCollapseItem, _sfc_main$21 as UConditionEditor, _sfc_main$22 as UContextmenu, _sfc_main$23 as UDatePanel, _sfc_main$24 as UDatePicker, _sfc_main$25 as UDateRangePicker, _sfc_main$26 as UDialog, _sfc_main$27 as UDrawer, _sfc_main$28 as UDropdown, _sfc_main$29 as UDualNav, _sfc_main$30 as UEmpty, _sfc_main$31 as UExpressionEditor, _sfc_main$32 as UFilePicker, _sfc_main$33 as UFileViewer, _sfc_main$34 as UFloatButton, form_default as UForm, form_item_default as UFormItem, _sfc_main$35 as UGanttChart, _sfc_main$36 as UGrid, _sfc_main$37 as UGridInput, _sfc_main$38 as UGridItem, _sfc_main$39 as UGroupInput, _sfc_main$40 as UGroupNav, _sfc_main$41 as UIcon, _sfc_main$42 as UImageCropper, input_default as UInput, _sfc_main$43 as UKbd, _sfc_main$44 as ULayout, _sfc_main$45 as UList, _sfc_main$46 as UListItem, _sfc_main$47 as ULoading, _sfc_main$48 as UMessage, _sfc_main$49 as UMessageConfirm, _sfc_main$50 as UMultiSelect, _sfc_main$51 as UMultiTreeSelect, _sfc_main$52 as UNav, _sfc_main$53 as UNavItem, _sfc_main$54 as UNavSub, NodeRender as UNodeRender, _sfc_main$55 as UNotification, _sfc_main$56 as UNumber, _sfc_main$57 as UNumberInput, _sfc_main$58 as UNumberRangeInput, _sfc_main$59 as UPaginator, _sfc_main$60 as UPalette, _sfc_main$61 as UPasswordInput, _sfc_main$62 as UPopConfirm, _sfc_main$63 as UProgress, _sfc_main$64 as UProgressNodes, _sfc_main$65 as URadio, _sfc_main$66 as URadioGroup, _sfc_main$67 as URichTextEditor, _sfc_main$68 as UScroll, _sfc_main$69 as USegment, _sfc_main$70 as USelect, _sfc_main$71 as USlider, _sfc_main$72 as USteps, _sfc_main$73 as USwitch, _sfc_main$74 as UTable, _sfc_main$75 as UTableEditor, _sfc_main$76 as UTabs, _sfc_main$77 as UTabsHorizontal, _sfc_main$78 as UTabsVertical, _sfc_main$79 as UTag, _sfc_main$80 as UText, _sfc_main$81 as UTextarea, _sfc_main$82 as UTheme, _sfc_main$83 as UTip, _sfc_main$84 as UTree, _sfc_main$85 as UTreeSelect, _sfc_main$86 as UWatermark, type UploaderEmits, type UploaderExposed, type UploaderProps, type VariableItem, type WatermarkEmits, type WatermarkExposed, type WatermarkProps, type _ActionExposed, type _ActionGroupExposed, type _AnimationExposed, type _AutoCompleteExposed, type _BadgeExposed, type _BatchEditExposed, type _BreadcrumbExposed, type _ButtonExposed, type _CalendarExposed, type _CardExposed, type _CascadeExposed, type _CheckTagExposed, type _CodeEditorExposed, type _ConditionEditorExposed, type _ContextmenuExposed, type _CssTransitionExposed, type _DatePickerExposed, type _DateRangePickerExposed, type _DialogExposed, type _DrawerExposed, type _DropdownExposed, type _DualNavExposed, type _EmptyExposed, type _ExpressionEditorExposed, type _FileViewerExposed, type _FloatButtonExposed, type _FormExposed, type _GanttChartExposed, type _GridExposed, type _GridInputExposed, type _GroupInputExposed, type _ImageCropperExposed, type _InputExposed, type _LayoutExposed, type _ListExposed, type _LoadingExposed, type _MessageConfirmExposed, type _MessageExposed, type _MultiAutoCompleteExposed, type _MultiSelectExposed, type _MultiTreeSelectExposed, type _NavExposed, type _NotificationExposed, type _PaginatorExposed, type _PaletteExposed, type _PasswordInputExposed, type _PopConfirmExposed, type _PopExposed, type _ProgressExposed, type _ProgressNodesExposed, type _QuickBatchEditExposed, type _RadioExposed, type _RadioGroupExposed, type _RichTextEditorExposed, type _ScrollExposed, type _SegmentExposed, type _SelectExposed, type _SliderExposed, type _StepsExposed, type _SwitchExposed, type _TableEditorExposed, type _TableExposed, type _TabsExposed, type _TabsHorizontalExposed, type _TabsVerticalExposed, type _TextEditorExposed, type _TextExposed, type _TextareaExposed, type _ThemeExposed, type _TipExposed, type _TreeExposed, type _TreeSelectExposed, type _UploaderExposed, type _WatermarkExposed, contextmenu, createEmptyGroup, createEmptyLeaf, defineBatchEditColumns, defineTableColumns, evaluate as evaluateConditionExpression, message, messageConfirm, notification, vLoading };
|
|
188
|
+
export { type ActionEmits, type ActionExposed, type ActionGroupExposed, type ActionGroupProps, type ActionProps, type AnimationEmits, type AnimationExposed, type AnimationProps, type AutoCompleteEmits, type AutoCompleteExposed, type AutoCompleteProps, type BadgeEmits, type BadgeExposed, type BadgeProps, type BarType, type BatchEditColumn, type BatchEditEmits, type BatchEditExposed, type BatchEditFeature, type BatchEditProps, type BatchEditSlots, type BatchEditStates, type BreadcrumbEmits, type BreadcrumbExposed, type BreadcrumbItem, type BreadcrumbProps, type BreadcrumbSlotScope, type BreakCols, type Breakpoint, type ButtonEmits, type ButtonExposed, type ButtonProps, type ButtonType, type CalendarDay, type CalendarEmits, type CalendarExposed, type CalendarMonth, type CalendarProps, type CalendarYear, type CardActionProps, type CardContentProps, type CardCoverProps, type CardEmits, type CardExposed, type CardProps, type CascadeEmits, type CascadeExposed, type CascadeNode, type CascadeProps, type CheckTagEmits, type CheckTagExposed, type CheckTagProps, type CheckboxButtonEmits, type CheckboxButtonProps, type CheckboxEmits, type CheckboxExposed, type CheckboxGroupEmits, type CheckboxGroupExposed, type CheckboxGroupProps, type CheckboxProps, type CodeEditorEmits, type CodeEditorExposed, type CodeEditorLang, type CodeEditorProps, type CollapseEmits, type CollapseItemEmits, type CollapseItemProps, type CollapseModelValue, type CollapseProps, type CollapseValue, type ConditionConnector, type ConditionEditorEmits, type ConditionEditorExposed, type ConditionEditorProps, type EvaluateOptions as ConditionEvaluateOptions, type ConditionExpression, type ConditionField, type ConditionGroup, type ConditionLeaf, type ConditionNode, type ConditionValue, type ContextmenuEmits, type ContextmenuExposed, type ContextmenuItem, ContextmenuPanelDIKey, type ContextmenuProps, ContextmenuRootDIKey, type CssTransitionEmits, type CssTransitionExposed, type CssTransitionProps, type DatePanelEmits, type DatePanelProps, type DatePickerDataType, type DatePickerEmits, type DatePickerExposed, type DatePickerProps, type DateRangePickerDataType, type DateRangePickerEmits, type DateRangePickerExposed, type DateRangePickerProps, type DateRangeValue, type DialogEmits, type DialogExposed, type DialogProps, type DialogTransition, type DrawerDirection, type DrawerEmits, type DrawerExposed, type DrawerMode, type DrawerProps, type DropdownEmits, type DropdownExposed, type DropdownProps, type DualNavEmits, type DualNavExposed, type DualNavProps, type DualNavRailVariant, type DualNavRootItem, type EmptyEmits, type EmptyExposed, type EmptyProps, type ExpressionEditorEmits, type ExpressionEditorExposed, type ExpressionEditorProps, type ExpressionSelectableLevels, type FileViewerEmits, type FileViewerExposed, type FileViewerItem, type FileViewerKind, type FileViewerProps, type FloatButtonEmits, type FloatButtonExposed, type FloatButtonItem, type FloatButtonProps, type FormEmits, type FormExposed, type FormItemEmits, type FormItemExposed, type FormItemProps, type FormProps, type GanttChartEmits, type GanttChartExposed, type GanttChartProps, type GridEmits, type GridExposed, type GridInputEmits, type GridInputExposed, type GridInputProps, type GridItemProps, type GridProps, type GroupInputEmits, type GroupInputExposed, type GroupInputProps, type GroupNavEmits, type GroupNavGroup, type GroupNavProps, type IconEmits, type IconExposed, type IconProps, type ImageCropperChangePayload, type ImageCropperCropTransform, type ImageCropperEmits, type ImageCropperExposed, type ImageCropperProps, type ImageCropperResult, type ImageCropperResultOptions, type ImageCropperSelection, type InputEmits, type InputExposed, type InputProps, type LayoutEmits, type LayoutExposed, type LayoutProps, type ListEmits, type ListExposed, type ListProps, type LoadingEmits, type LoadingExposed, type LoadingProps, type LoadingType, type Message, type MessageConfirm, type MessageConfirmAction, type MessageConfirmEmits, type MessageConfirmExposed, type MessageConfirmInstance, type MessageConfirmOptions, type MessageConfirmProps, type MessageEmits, type MessageExposed, type MessageInstance, type MessageOptions, type MessageProps, type MessageType, type MultiAutoCompleteEmits, type MultiAutoCompleteExposed, type MultiAutoCompleteProps, type MultiSelectEmits, type MultiSelectExposed, type MultiSelectProps, type MultiTreeSelectEmits, type MultiTreeSelectExposed, type MultiTreeSelectProps, type NavEmits, type NavExposed, type NavItem, type NavProps, type NodeRenderExposed, type NodeRenderProps, type Notification, type NotificationEmits, type NotificationExposed, type NotificationInstance, type NotificationOptions, type NotificationPosition, type NotificationProps, type NumberEmits, type NumberExposed, type NumberInputEmits, type NumberInputExposed, type NumberInputProps, type NumberProps, type NumberRangeInputEmits, type NumberRangeInputExposed, type NumberRangeInputProps, type NumberRangeTuple, type PaginatorEmits, type PaginatorExposed, type PaginatorProps, type PaletteColorType, type PaletteEmits, type PaletteExposed, type PaletteHSV, type PaletteProps, type PaletteRGB, type PanelItem, type PanelType, type PasswordInputEmits, type PasswordInputExposed, type PasswordInputProps, type PopConfirmEmits, type PopConfirmExposed, type PopConfirmProps, type PopEmits, type PopExposed, type PopProps, type ProgressEmits, type ProgressExposed, type ProgressNodesEmits, type ProgressNodesExposed, type ProgressNodesProps, type ProgressProps, type QuickBatchEditEmits, type QuickBatchEditExposed, type QuickBatchEditProps, type RadioEmits, type RadioExposed, type RadioGroupEmits, type RadioGroupExposed, type RadioGroupProps, type RadioProps, type RichTextEditorEmits, type RichTextEditorExposed, type RichTextEditorProps, type RichTextFormat, type ScrollEmits, type ScrollExposed, type ScrollPosition, type ScrollProps, type SegmentEmits, type SegmentExposed, type SegmentItem, type SegmentProps, type SelectEmits, type SelectExposed, type SelectProps, type SliderEmits, type SliderExposed, type SliderProps, type StepsEmits, type StepsExposed, type StepsProps, type StepsSlotScope, type SwitchEmits, type SwitchExposed, type SwitchProps, type TabItem, type TableColumn, type TableColumnAlign, type TableColumnNode, type TableColumnRenderContext, type TableColumnSlotsScope, type TableColumnStyle, type TableEditorColumn, type TableEditorEmits, type TableEditorExposed, type TableEditorProps, type TableEmits, type TableExposed, type TableProps, type TableRow, type TableRowSlotsScope, type TableSummaryContext, type TabsEmits, type TabsExposed, type TabsHorizontalEmits, type TabsHorizontalExposed, type TabsHorizontalProps, type TabsProps, type TabsVerticalEmits, type TabsVerticalExposed, type TabsVerticalProps, type TagEmits, type TagExposed, type TagProps, type TextEditorEmits, type TextEditorExposed, type TextEditorProps, type TextEmits, type TextExposed, type TextProps, type TextareaEmits, type TextareaExposed, type TextareaProps, type ThemeExposed, type ThemeProps, type TipAlign, type TipDirection, type TipEmits, type TipExposed, type TipProps, type TipType, type ToolbarItem, type TreeEmit, type TreeExposed, type TreeNode, type TreeNodeProps, type TreeProps, type TreeSelectEmits, type TreeSelectExposed, type TreeSelectProps, _sfc_main as UAction, action_group_default as UActionGroup, _sfc_main$1 as UAutoComplete, _sfc_main$2 as UBadge, _sfc_main$3 as UBatchEdit, _sfc_main$4 as UBreadcrumb, _sfc_main$5 as UButton, _sfc_main$6 as UButtonGroup, _sfc_main$7 as UCalendar, _sfc_main$8 as UCard, _sfc_main$9 as UCardAction, _sfc_main$10 as UCardContent, _sfc_main$11 as UCardCover, _sfc_main$12 as UCardHeader, _sfc_main$13 as UCascade, _sfc_main$14 as UCheckTag, _sfc_main$15 as UCheckbox, _sfc_main$16 as UCheckboxButton, _sfc_main$17 as UCheckboxGroup, _sfc_main$18 as UCodeEditor, _sfc_main$19 as UCollapse, _sfc_main$20 as UCollapseItem, _sfc_main$21 as UConditionEditor, _sfc_main$22 as UContextmenu, _sfc_main$23 as UDatePanel, _sfc_main$24 as UDatePicker, _sfc_main$25 as UDateRangePicker, _sfc_main$26 as UDialog, _sfc_main$27 as UDrawer, _sfc_main$28 as UDropdown, _sfc_main$29 as UDualNav, _sfc_main$30 as UEmpty, _sfc_main$31 as UExpressionEditor, _sfc_main$32 as UFilePicker, _sfc_main$33 as UFileViewer, _sfc_main$34 as UFloatButton, form_default as UForm, form_item_default as UFormItem, _sfc_main$35 as UGanttChart, _sfc_main$36 as UGrid, _sfc_main$37 as UGridInput, _sfc_main$38 as UGridItem, _sfc_main$39 as UGroupInput, _sfc_main$40 as UGroupNav, _sfc_main$41 as UIcon, _sfc_main$42 as UImageCropper, input_default as UInput, _sfc_main$43 as UKbd, _sfc_main$44 as ULayout, _sfc_main$45 as UList, _sfc_main$46 as UListItem, _sfc_main$47 as ULoading, _sfc_main$48 as UMessage, _sfc_main$49 as UMessageConfirm, _sfc_main$50 as UMultiSelect, _sfc_main$51 as UMultiTreeSelect, _sfc_main$52 as UNav, _sfc_main$53 as UNavItem, _sfc_main$54 as UNavSub, NodeRender as UNodeRender, _sfc_main$55 as UNotification, _sfc_main$56 as UNumber, _sfc_main$57 as UNumberInput, _sfc_main$58 as UNumberRangeInput, _sfc_main$59 as UPaginator, _sfc_main$60 as UPalette, _sfc_main$61 as UPasswordInput, _sfc_main$62 as UPopConfirm, _sfc_main$63 as UProgress, _sfc_main$64 as UProgressNodes, _sfc_main$65 as URadio, _sfc_main$66 as URadioGroup, _sfc_main$67 as URichTextEditor, _sfc_main$68 as UScroll, _sfc_main$69 as USegment, _sfc_main$70 as USelect, _sfc_main$71 as USlider, _sfc_main$72 as USteps, _sfc_main$73 as USwitch, _sfc_main$74 as UTable, _sfc_main$75 as UTableEditor, _sfc_main$76 as UTabs, _sfc_main$77 as UTabsHorizontal, _sfc_main$78 as UTabsVertical, _sfc_main$79 as UTag, _sfc_main$80 as UText, _sfc_main$81 as UTextarea, _sfc_main$82 as UTheme, _sfc_main$83 as UTip, _sfc_main$84 as UTree, _sfc_main$85 as UTreeSelect, _sfc_main$86 as UWatermark, type UploaderEmits, type UploaderExposed, type UploaderProps, type VariableItem, type WatermarkEmits, type WatermarkExposed, type WatermarkProps, type _ActionExposed, type _ActionGroupExposed, type _AnimationExposed, type _AutoCompleteExposed, type _BadgeExposed, type _BatchEditExposed, type _BreadcrumbExposed, type _ButtonExposed, type _CalendarExposed, type _CardExposed, type _CascadeExposed, type _CheckTagExposed, type _CodeEditorExposed, type _ConditionEditorExposed, type _ContextmenuExposed, type _CssTransitionExposed, type _DatePickerExposed, type _DateRangePickerExposed, type _DialogExposed, type _DrawerExposed, type _DropdownExposed, type _DualNavExposed, type _EmptyExposed, type _ExpressionEditorExposed, type _FileViewerExposed, type _FloatButtonExposed, type _FormExposed, type _GanttChartExposed, type _GridExposed, type _GridInputExposed, type _GroupInputExposed, type _ImageCropperExposed, type _InputExposed, type _LayoutExposed, type _ListExposed, type _LoadingExposed, type _MessageConfirmExposed, type _MessageExposed, type _MultiAutoCompleteExposed, type _MultiSelectExposed, type _MultiTreeSelectExposed, type _NavExposed, type _NotificationExposed, type _PaginatorExposed, type _PaletteExposed, type _PasswordInputExposed, type _PopConfirmExposed, type _PopExposed, type _ProgressExposed, type _ProgressNodesExposed, type _QuickBatchEditExposed, type _RadioExposed, type _RadioGroupExposed, type _RichTextEditorExposed, type _ScrollExposed, type _SegmentExposed, type _SelectExposed, type _SliderExposed, type _StepsExposed, type _SwitchExposed, type _TableEditorExposed, type _TableExposed, type _TabsExposed, type _TabsHorizontalExposed, type _TabsVerticalExposed, type _TextEditorExposed, type _TextExposed, type _TextareaExposed, type _ThemeExposed, type _TipExposed, type _TreeExposed, type _TreeSelectExposed, type _UploaderExposed, type _WatermarkExposed, contextmenu, createEmptyGroup, createEmptyLeaf, defineBatchEditColumns, defineTableColumns, evaluate as evaluateConditionExpression, message, messageConfirm, notification, vLoading };
|
|
@@ -5,7 +5,6 @@ import { DeconstructValue } from "@veltra/utils";
|
|
|
5
5
|
/** 批量编辑列 */
|
|
6
6
|
export interface BatchEditColumn extends TableColumn {}
|
|
7
7
|
export type BatchEditFeature = 'create' | 'update' | 'delete' | 'view' | 'createChild';
|
|
8
|
-
export type BatchEditFormStatus = 'hidden';
|
|
9
8
|
/** 批量编辑状态 */
|
|
10
9
|
export interface BatchEditStates {
|
|
11
10
|
/** 层级 */
|
|
@@ -30,8 +29,6 @@ export interface BatchEditProps extends TableProps {
|
|
|
30
29
|
* @description 与右侧 UForm 绑定的 reactive 对象
|
|
31
30
|
*/
|
|
32
31
|
model?: Record<string, any>;
|
|
33
|
-
/** 表格标题 */
|
|
34
|
-
title?: string;
|
|
35
32
|
/**
|
|
36
33
|
* 列的宽度定义
|
|
37
34
|
*/
|
package/dist/types/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ import { DatePanelEmits, DatePanelProps, PanelType } from "./date-panel.js";
|
|
|
24
24
|
import { DialogEmits, DialogExposed, DialogProps, DialogTransition, _DialogExposed } from "./dialog.js";
|
|
25
25
|
import { ActionEmits, ActionExposed, ActionGroupExposed, ActionGroupProps, ActionProps, _ActionExposed, _ActionGroupExposed } from "./action.js";
|
|
26
26
|
import { TableColumn, TableColumnAlign, TableColumnNode, TableColumnRenderContext, TableColumnSlotsScope, TableColumnStyle, TableEmits, TableExposed, TableProps, TableRow, TableRowSlotsScope, TableSummaryContext, _TableExposed } from "./table.js";
|
|
27
|
-
import { BatchEditColumn, BatchEditEmits, BatchEditExposed, BatchEditFeature,
|
|
27
|
+
import { BatchEditColumn, BatchEditEmits, BatchEditExposed, BatchEditFeature, BatchEditProps, BatchEditSlots, BatchEditStates, _BatchEditExposed } from "./batch-edit.js";
|
|
28
28
|
import { BreadcrumbEmits, BreadcrumbExposed, BreadcrumbItem, BreadcrumbProps, BreadcrumbSlotScope, _BreadcrumbExposed } from "./breadcrumb.js";
|
|
29
29
|
import { ListEmits, ListExposed, ListProps, _ListExposed } from "./list.js";
|
|
30
30
|
import { EmptyEmits, EmptyExposed, EmptyProps, _EmptyExposed } from "./empty.js";
|
|
@@ -82,4 +82,4 @@ import { CollapseEmits, CollapseItemEmits, CollapseItemProps, CollapseModelValue
|
|
|
82
82
|
import { SegmentEmits, SegmentExposed, SegmentItem, SegmentProps, _SegmentExposed } from "./segment.js";
|
|
83
83
|
import { ImageCropperChangePayload, ImageCropperCropTransform, ImageCropperEmits, ImageCropperExposed, ImageCropperProps, ImageCropperResult, ImageCropperResultOptions, ImageCropperSelection, _ImageCropperExposed } from "./image-cropper.js";
|
|
84
84
|
export type * from "@veltra/utils";
|
|
85
|
-
export { ActionEmits, ActionExposed, ActionGroupExposed, ActionGroupProps, ActionProps, AnimationEmits, AnimationExposed, AnimationProps, AutoCompleteEmits, AutoCompleteExposed, AutoCompleteProps, BadgeEmits, BadgeExposed, BadgeProps, BarType, BatchEditColumn, BatchEditEmits, BatchEditExposed, BatchEditFeature,
|
|
85
|
+
export { ActionEmits, ActionExposed, ActionGroupExposed, ActionGroupProps, ActionProps, AnimationEmits, AnimationExposed, AnimationProps, AutoCompleteEmits, AutoCompleteExposed, AutoCompleteProps, BadgeEmits, BadgeExposed, BadgeProps, BarType, BatchEditColumn, BatchEditEmits, BatchEditExposed, BatchEditFeature, BatchEditProps, BatchEditSlots, BatchEditStates, BreadcrumbEmits, BreadcrumbExposed, BreadcrumbItem, BreadcrumbProps, BreadcrumbSlotScope, BreakCols, Breakpoint, ButtonEmits, ButtonExposed, ButtonProps, ButtonType, CalendarDay, CalendarEmits, CalendarExposed, CalendarMonth, CalendarProps, CalendarYear, CardActionProps, CardContentProps, CardCoverProps, CardEmits, CardExposed, CardProps, CascadeEmits, CascadeExposed, CascadeNode, CascadeProps, CheckTagEmits, CheckTagExposed, CheckTagProps, CheckboxButtonEmits, CheckboxButtonProps, CheckboxEmits, CheckboxExposed, CheckboxGroupEmits, CheckboxGroupExposed, CheckboxGroupProps, CheckboxProps, CodeEditorEmits, CodeEditorExposed, CodeEditorLang, CodeEditorProps, CollapseEmits, CollapseItemEmits, CollapseItemProps, CollapseModelValue, CollapseProps, CollapseValue, ConditionConnector, ConditionEditorEmits, ConditionEditorExposed, ConditionEditorProps, ConditionExpression, ConditionField, ConditionGroup, ConditionLeaf, ConditionNode, ConditionValue, ContextmenuEmits, ContextmenuExposed, ContextmenuItem, ContextmenuProps, CssTransitionEmits, CssTransitionExposed, CssTransitionProps, DatePanelEmits, DatePanelProps, DatePickerDataType, DatePickerEmits, DatePickerExposed, DatePickerProps, DateRangePickerDataType, DateRangePickerEmits, DateRangePickerExposed, DateRangePickerProps, DateRangeValue, DialogEmits, DialogExposed, DialogProps, DialogTransition, DrawerDirection, DrawerEmits, DrawerExposed, DrawerMode, DrawerProps, DropdownEmits, DropdownExposed, DropdownProps, DualNavEmits, DualNavExposed, DualNavProps, DualNavRailVariant, DualNavRootItem, EmptyEmits, EmptyExposed, EmptyProps, ExpressionEditorEmits, ExpressionEditorExposed, ExpressionEditorProps, ExpressionSelectableLevels, FileViewerEmits, FileViewerExposed, FileViewerItem, FileViewerKind, FileViewerProps, FloatButtonEmits, FloatButtonExposed, FloatButtonItem, FloatButtonProps, FormEmits, FormExposed, FormItemEmits, FormItemExposed, FormItemProps, FormProps, GanttChartEmits, GanttChartExposed, GanttChartProps, GridEmits, GridExposed, GridInputEmits, GridInputExposed, GridInputProps, GridItemProps, GridProps, GroupInputEmits, GroupInputExposed, GroupInputProps, GroupNavEmits, GroupNavGroup, GroupNavProps, IconEmits, IconExposed, IconProps, ImageCropperChangePayload, ImageCropperCropTransform, ImageCropperEmits, ImageCropperExposed, ImageCropperProps, ImageCropperResult, ImageCropperResultOptions, ImageCropperSelection, InputEmits, InputExposed, InputProps, LayoutEmits, LayoutExposed, LayoutProps, ListEmits, ListExposed, ListProps, LoadingEmits, LoadingExposed, LoadingProps, LoadingType, Message, MessageConfirm, MessageConfirmAction, MessageConfirmEmits, MessageConfirmExposed, MessageConfirmInstance, MessageConfirmOptions, MessageConfirmProps, MessageEmits, MessageExposed, MessageInstance, MessageOptions, MessageProps, MessageType, MultiAutoCompleteEmits, MultiAutoCompleteExposed, MultiAutoCompleteProps, MultiSelectEmits, MultiSelectExposed, MultiSelectProps, MultiTreeSelectEmits, MultiTreeSelectExposed, MultiTreeSelectProps, NavEmits, NavExposed, NavItem, NavProps, NodeRenderExposed, NodeRenderProps, Notification, NotificationEmits, NotificationExposed, NotificationInstance, NotificationOptions, NotificationPosition, NotificationProps, NumberEmits, NumberExposed, NumberInputEmits, NumberInputExposed, NumberInputProps, NumberProps, NumberRangeInputEmits, NumberRangeInputExposed, NumberRangeInputProps, NumberRangeTuple, PaginatorEmits, PaginatorExposed, PaginatorProps, PaletteColorType, PaletteEmits, PaletteExposed, PaletteHSV, PaletteProps, PaletteRGB, PanelItem, PanelType, PasswordInputEmits, PasswordInputExposed, PasswordInputProps, PopConfirmEmits, PopConfirmExposed, PopConfirmProps, PopEmits, PopExposed, PopProps, ProgressEmits, ProgressExposed, ProgressNodesEmits, ProgressNodesExposed, ProgressNodesProps, ProgressProps, QuickBatchEditEmits, QuickBatchEditExposed, QuickBatchEditProps, RadioEmits, RadioExposed, RadioGroupEmits, RadioGroupExposed, RadioGroupProps, RadioProps, RichTextEditorEmits, RichTextEditorExposed, RichTextEditorProps, RichTextFormat, ScrollEmits, ScrollExposed, ScrollPosition, ScrollProps, SegmentEmits, SegmentExposed, SegmentItem, SegmentProps, SelectEmits, SelectExposed, SelectProps, SliderEmits, SliderExposed, SliderProps, StepsEmits, StepsExposed, StepsProps, StepsSlotScope, SwitchEmits, SwitchExposed, SwitchProps, TabItem, TableColumn, TableColumnAlign, TableColumnNode, TableColumnRenderContext, TableColumnSlotsScope, TableColumnStyle, TableEditorColumn, TableEditorEmits, TableEditorExposed, TableEditorProps, TableEmits, TableExposed, TableProps, TableRow, TableRowSlotsScope, TableSummaryContext, TabsEmits, TabsExposed, TabsHorizontalEmits, TabsHorizontalExposed, TabsHorizontalProps, TabsProps, TabsVerticalEmits, TabsVerticalExposed, TabsVerticalProps, TagEmits, TagExposed, TagProps, TextEditorEmits, TextEditorExposed, TextEditorProps, TextEmits, TextExposed, TextProps, TextareaEmits, TextareaExposed, TextareaProps, ThemeExposed, ThemeProps, TipAlign, TipDirection, TipEmits, TipExposed, TipProps, TipType, ToolbarItem, TreeEmit, TreeExposed, TreeNode, TreeNodeProps, TreeProps, TreeSelectEmits, TreeSelectExposed, TreeSelectProps, UploaderEmits, UploaderExposed, UploaderProps, VariableItem, WatermarkEmits, WatermarkExposed, WatermarkProps, _ActionExposed, _ActionGroupExposed, _AnimationExposed, _AutoCompleteExposed, _BadgeExposed, _BatchEditExposed, _BreadcrumbExposed, _ButtonExposed, _CalendarExposed, _CardExposed, _CascadeExposed, _CheckTagExposed, _CodeEditorExposed, _ConditionEditorExposed, _ContextmenuExposed, _CssTransitionExposed, _DatePickerExposed, _DateRangePickerExposed, _DialogExposed, _DrawerExposed, _DropdownExposed, _DualNavExposed, _EmptyExposed, _ExpressionEditorExposed, _FileViewerExposed, _FloatButtonExposed, _FormExposed, _GanttChartExposed, _GridExposed, _GridInputExposed, _GroupInputExposed, _ImageCropperExposed, _InputExposed, _LayoutExposed, _ListExposed, _LoadingExposed, _MessageConfirmExposed, _MessageExposed, _MultiAutoCompleteExposed, _MultiSelectExposed, _MultiTreeSelectExposed, _NavExposed, _NotificationExposed, _PaginatorExposed, _PaletteExposed, _PasswordInputExposed, _PopConfirmExposed, _PopExposed, _ProgressExposed, _ProgressNodesExposed, _QuickBatchEditExposed, _RadioExposed, _RadioGroupExposed, _RichTextEditorExposed, _ScrollExposed, _SegmentExposed, _SelectExposed, _SliderExposed, _StepsExposed, _SwitchExposed, _TableEditorExposed, _TableExposed, _TabsExposed, _TabsHorizontalExposed, _TabsVerticalExposed, _TextEditorExposed, _TextExposed, _TextareaExposed, _ThemeExposed, _TipExposed, _TreeExposed, _TreeSelectExposed, _UploaderExposed, _WatermarkExposed };
|