@septkit/ui 0.0.81 → 0.0.83
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/dialecte/create-document-store.js +4 -4
- package/dist/external/.pnpm/{@dialecte_core@0.9.0/node_modules/@dialecte/core/dist/dialecte-oAXwOG-Q.js → @dialecte_core@0.10.0/node_modules/@dialecte/core/dist/dialecte-CVLWSkgW.js} +1 -1
- package/dist/external/.pnpm/@dialecte_core@0.10.0/node_modules/@dialecte/core/dist/helpers-D8p0KiJu.js +130 -0
- package/dist/external/.pnpm/@dialecte_core@0.10.0/node_modules/@dialecte/core/dist/index.js +6 -0
- package/dist/external/.pnpm/{@dialecte_core@0.9.0 → @dialecte_core@0.10.0}/node_modules/@dialecte/core/dist/project-key-2ccZ-0gu.js +1 -1
- package/dist/external/.pnpm/{@dialecte_core@0.9.0 → @dialecte_core@0.10.0}/node_modules/@dialecte/core/dist/rolldown-runtime-CYdcPHCu.js +1 -1
- package/dist/external/.pnpm/{@dialecte_core@0.9.0 → @dialecte_core@0.10.0}/node_modules/@dialecte/core/dist/running-operations-DCKvzlU7.js +1 -1
- package/dist/external/.pnpm/{@dialecte_core@0.9.0 → @dialecte_core@0.10.0}/node_modules/@dialecte/core/dist/same-json-value-_AChwM_n.js +1 -1
- package/dist/external/.pnpm/{@dialecte_core@0.9.0 → @dialecte_core@0.10.0}/node_modules/@dialecte/core/dist/utils-Cv4oHia0.js +79 -102
- package/dist/external/.pnpm/@dialecte_core@0.10.0/node_modules/@dialecte/core/dist/utils.js +2 -0
- package/dist/external/.pnpm/@vueuse_core@14.3.0_vue@3.5.39_typescript@5.8.3_/node_modules/@vueuse/core/dist/index.js +59 -117
- package/dist/external/.pnpm/@vueuse_shared@14.3.0_vue@3.5.39_typescript@5.8.3_/node_modules/@vueuse/shared/dist/index.js +57 -60
- package/dist/index.d.ts +49 -1960
- package/dist/index.js +19 -27
- package/dist/selector-input/index.js +3 -3
- package/dist/selector-input/selector-input.js +4 -89
- package/dist/selector-input/selector-input.vue_vue_type_script_setup_true_lang.js +91 -89
- package/dist/selector-input/selector-xpath.js +92 -0
- package/dist/ui.css +1 -1
- package/package.json +3 -3
- package/dist/external/.pnpm/@dialecte_core@0.9.0/node_modules/@dialecte/core/dist/helpers-D8p0KiJu.js +0 -179
- package/dist/external/.pnpm/@dialecte_core@0.9.0/node_modules/@dialecte/core/dist/helpers.js +0 -3
- package/dist/external/.pnpm/@dialecte_core@0.9.0/node_modules/@dialecte/core/dist/index.js +0 -6
- package/dist/external/.pnpm/@dialecte_core@0.9.0/node_modules/@dialecte/core/dist/utils.js +0 -2
- package/dist/external/.pnpm/@dialecte_scl@0.14.0_libxml2-wasm@0.7.2_vitest@4.1.10/node_modules/@dialecte/scl/dist/declaration.constants-DSLNk1wh.js +0 -45065
- package/dist/external/.pnpm/@dialecte_scl@0.14.0_libxml2-wasm@0.7.2_vitest@4.1.10/node_modules/@dialecte/scl/dist/v2019C1/index.js +0 -3
- package/dist/external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/arrow-right.js +0 -11
- package/dist/external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/list-tree.js +0 -26
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Stepper/StepperIndicator.js +0 -27
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Stepper/StepperItem.js +0 -67
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Stepper/StepperRoot.js +0 -136
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Stepper/StepperTitle.js +0 -28
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Stepper/StepperTrigger.js +0 -97
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/shared/useArrowNavigation.js +0 -31
- package/dist/merge/check-files/components/merge-preflight.js +0 -5
- package/dist/merge/check-files/components/merge-preflight.vue_vue_type_script_setup_true_lang.js +0 -53
- package/dist/merge/check-files/flags.js +0 -17
- package/dist/merge/check-files/identity-warning.js +0 -19
- package/dist/merge/confirm/components/merge-summary.js +0 -5
- package/dist/merge/confirm/components/merge-summary.vue_vue_type_script_setup_true_lang.js +0 -207
- package/dist/merge/confirm/landings.js +0 -34
- package/dist/merge/confirm/outcome.js +0 -179
- package/dist/merge/confirm/summary.js +0 -57
- package/dist/merge/done/applied-counts.js +0 -16
- package/dist/merge/done/applied-focus.js +0 -15
- package/dist/merge/help.js +0 -76
- package/dist/merge/index.js +0 -8
- package/dist/merge/match/components/merge-map.js +0 -5
- package/dist/merge/match/components/merge-map.vue_vue_type_script_setup_true_lang.js +0 -230
- package/dist/merge/match/match.js +0 -210
- package/dist/merge/review/affix.js +0 -14
- package/dist/merge/review/change-badge.js +0 -10
- package/dist/merge/review/components/decision-toggle.js +0 -5
- package/dist/merge/review/components/decision-toggle.vue_vue_type_script_setup_true_lang.js +0 -80
- package/dist/merge/review/components/element-detail.js +0 -5
- package/dist/merge/review/components/element-detail.vue_vue_type_script_setup_true_lang.js +0 -210
- package/dist/merge/review/components/merge-tree.js +0 -5
- package/dist/merge/review/components/merge-tree.vue_vue_type_script_setup_true_lang.js +0 -192
- package/dist/merge/review/components/type-name-authority.js +0 -5
- package/dist/merge/review/components/type-name-authority.vue_vue_type_script_setup_true_lang.js +0 -47
- package/dist/merge/review/decision.js +0 -12
- package/dist/merge/review/detail.js +0 -63
- package/dist/merge/review/highlight.js +0 -44
- package/dist/merge/review/marks.js +0 -17
- package/dist/merge/review/navigation.js +0 -82
- package/dist/merge/review/title.js +0 -7
- package/dist/merge/review/tree.js +0 -138
- package/dist/merge/session/components/merge-help.js +0 -7
- package/dist/merge/session/components/merge-help.vue_vue_type_script_setup_true_lang.js +0 -109
- package/dist/merge/session/components/merge-progress.js +0 -5
- package/dist/merge/session/components/merge-progress.vue_vue_type_script_setup_true_lang.js +0 -23
- package/dist/merge/session/components/merge-review.js +0 -5
- package/dist/merge/session/components/merge-review.vue_vue_type_script_setup_true_lang.js +0 -895
- package/dist/merge/session/merge.service.js +0 -113
- package/dist/merge/session/shortcuts.js +0 -22
- package/dist/merge/session/staged-writes.js +0 -47
- package/dist/merge/session/steps.js +0 -21
- package/dist/merge/session/use-document-progress.js +0 -26
- package/dist/merge/session/use-merge-session.js +0 -372
- package/dist/merge/wording.js +0 -123
- package/dist/selector-input/selector-input2.js +0 -5
package/dist/index.js
CHANGED
|
@@ -38,35 +38,27 @@ import { NOTE_CATEGORIES as M, NOTE_CATEGORY_LABELS as N, NOTE_STATUSES as P, pa
|
|
|
38
38
|
import L from "./notes/note-category-tag.js";
|
|
39
39
|
import R from "./notes/note-category-picker.js";
|
|
40
40
|
import "./notes/index.js";
|
|
41
|
-
import z from "./
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import G from "./merge/session/components/merge-review.js";
|
|
48
|
-
import "./merge/index.js";
|
|
49
|
-
import { KEY_SEPARATOR as K, NO_VALUE_KEY as q, buildFlatOptions as J, buildMultiValueOptions as Y, buildTreeOptions as X, collectLeafKeys as Z, collectParentKeys as Q, filterTree as $ } from "./table/filters/build-filter-options.js";
|
|
50
|
-
import { useColumnFilters as ee } from "./table/filters/use-column-filters.js";
|
|
51
|
-
import { useRowSort as te } from "./table/filters/use-row-sort.js";
|
|
52
|
-
import { provideColumnFilterHeader as ne, useColumnFilterHeaderContext as re } from "./table/column-filter-context.js";
|
|
53
|
-
import { provideRowSortHeader as ie, useOptionalRowSortContext as ae } from "./table/row-sort-context.js";
|
|
54
|
-
import oe from "./table/filterable-column-header.js";
|
|
41
|
+
import { KEY_SEPARATOR as z, NO_VALUE_KEY as B, buildFlatOptions as V, buildMultiValueOptions as H, buildTreeOptions as U, collectLeafKeys as W, collectParentKeys as G, filterTree as K } from "./table/filters/build-filter-options.js";
|
|
42
|
+
import { useColumnFilters as q } from "./table/filters/use-column-filters.js";
|
|
43
|
+
import { useRowSort as J } from "./table/filters/use-row-sort.js";
|
|
44
|
+
import { provideColumnFilterHeader as Y, useColumnFilterHeaderContext as X } from "./table/column-filter-context.js";
|
|
45
|
+
import { provideRowSortHeader as Z, useOptionalRowSortContext as Q } from "./table/row-sort-context.js";
|
|
46
|
+
import $ from "./table/filterable-column-header.js";
|
|
55
47
|
import "./table/index.js";
|
|
56
|
-
import
|
|
48
|
+
import ee from "./context-menu/context-menu.js";
|
|
57
49
|
import "./context-menu/index.js";
|
|
58
|
-
import { buildXpath as
|
|
59
|
-
import
|
|
50
|
+
import { buildXpath as te, matchName as ne, parseXpath as re, validateSearchText as ie, validateXpath as ae } from "./selector-input/selector-xpath.js";
|
|
51
|
+
import oe from "./selector-input/selector-input.js";
|
|
60
52
|
import "./selector-input/index.js";
|
|
61
|
-
import
|
|
53
|
+
import se from "./split-layout/split-layout.js";
|
|
62
54
|
import "./split-layout/index.js";
|
|
63
|
-
import { applyInitialVisibility as
|
|
64
|
-
import { groupStackMetrics as
|
|
65
|
-
import { GROUP_COLLAPSED_MEMBERS_HEIGHT as
|
|
66
|
-
import { computeGroups as
|
|
67
|
-
import { createElkLayoutEngine as
|
|
68
|
-
import { useDiagramLayout as
|
|
69
|
-
import
|
|
70
|
-
import
|
|
55
|
+
import { applyInitialVisibility as ce, buildRecordCache as le, collectVisibleIds as ue, hideDescendants as de } from "./diagram-layout/visibility-model.js";
|
|
56
|
+
import { groupStackMetrics as fe } from "./diagram-layout/group-stack.js";
|
|
57
|
+
import { GROUP_COLLAPSED_MEMBERS_HEIGHT as pe, GROUP_HEADER_HEIGHT as me, GROUP_MEMBER_GAP as he, GROUP_MEMBER_HEIGHT as ge, GROUP_MEMBER_HEIGHT_COMPACT as _e, memberCardHeight as ve } from "./diagram-layout/group-geometry.js";
|
|
58
|
+
import { computeGroups as ye, isGroupId as be, makeGroupId as xe } from "./diagram-layout/grouping.js";
|
|
59
|
+
import { createElkLayoutEngine as Se } from "./diagram-layout/elk-layout-engine.js";
|
|
60
|
+
import { useDiagramLayout as Ce } from "./diagram-layout/use-diagram-layout.js";
|
|
61
|
+
import we from "./diagram-layout/diagram-node-card.js";
|
|
62
|
+
import Te from "./diagram-layout/diagram-node-group.js";
|
|
71
63
|
import "./diagram-layout/index.js";
|
|
72
|
-
export { s as Button, x as CATEGORY_ELEMENTS, k as CodeBlock, l as Combobox,
|
|
64
|
+
export { s as Button, x as CATEGORY_ELEMENTS, k as CodeBlock, l as Combobox, ee as ContextMenu, we as DiagramNodeCard, Te as DiagramNodeGroup, p as Dialog, y as DialogHost, b as DocumentProgressBar, c as Dropdown, S as ELEMENT_TO_COLOR, C as ELEMENT_TO_ICON, w as ElementBadge, m as FeedbackDialog, $ as FilterableColumnHeader, u as FloatingTooltip, pe as GROUP_COLLAPSED_MEMBERS_HEIGHT, me as GROUP_HEADER_HEIGHT, he as GROUP_MEMBER_GAP, ge as GROUP_MEMBER_HEIGHT, _e as GROUP_MEMBER_HEIGHT_COMPACT, z as KEY_SEPARATOR, D as LibraryBrowser, d as MultiSelect, M as NOTE_CATEGORIES, N as NOTE_CATEGORY_LABELS, P as NOTE_STATUSES, B as NO_VALUE_KEY, R as NoteCategoryPicker, L as NoteCategoryTag, E as SclExplorer, oe as SelectorInput, se as SplitLayout, f as TextInputAutocomplete, j as XmlDiff, ce as applyInitialVisibility, V as buildFlatOptions, H as buildMultiValueOptions, le as buildRecordCache, U as buildTreeOptions, te as buildXpath, T as collectExpandableNodeIds, W as collectLeafKeys, G as collectParentKeys, ue as collectVisibleIds, ye as computeGroups, h as createDialogHost, e as createDocumentStore, Se as createElkLayoutEngine, g as dialogHostKey, A as diffLines, K as filterTree, fe as groupStackMetrics, de as hideDescendants, O as highlightCode, be as isGroupId, xe as makeGroupId, ne as matchName, ve as memberCardHeight, F as parseNoteData, re as parseXpath, Y as provideColumnFilterHeader, _ as provideDialogHost, Z as provideRowSortHeader, I as serializeNoteData, i as useActiveDocument, X as useColumnFilterHeaderContext, q as useColumnFilters, Ce as useDiagramLayout, t as useDialecteChannel, v as useDialog, a as useDocumentProgress, o as useDocumentState, n as useLiveData, Q as useOptionalRowSortContext, r as useProjectLiveData, J as useRowSort, ie as validateSearchText, ae as validateXpath };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { buildXpath as e, matchName as t, parseXpath as n,
|
|
2
|
-
import
|
|
3
|
-
export {
|
|
1
|
+
import { buildXpath as e, matchName as t, parseXpath as n, validateSearchText as r, validateXpath as i } from "./selector-xpath.js";
|
|
2
|
+
import a from "./selector-input.js";
|
|
3
|
+
export { a as SelectorInput, e as buildXpath, t as matchName, n as parseXpath, r as validateSearchText, i as validateXpath };
|
|
@@ -1,90 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
b(e, { optional: !0 }), t.forEach((e) => b(e)), r.forEach((e) => b(e));
|
|
5
|
-
let i = n?.value ? n : void 0;
|
|
6
|
-
if (!e && t.length === 0 && !i) return "";
|
|
7
|
-
let a = e ? `ancestor::*[local-name()='${e}'][1]` : "", o = i ? h(i) : "", s = i && r.length > 0 ? `[ancestor::*[${p(r)}][1][${o}]]` : i ? `[${o}]` : "";
|
|
8
|
-
return `${a}//*${t.length > 0 ? `[${p(t)}]` : ""}${s}`;
|
|
9
|
-
}
|
|
10
|
-
function d(e) {
|
|
11
|
-
let t = l.exec(e);
|
|
12
|
-
if (!t) return;
|
|
13
|
-
let [, n = "", r = "", i, a, o] = t, s = i ?? o, c = s ? g(s) : void 0;
|
|
14
|
-
if (c === null || !n && !r && !c) return;
|
|
15
|
-
let u = m(r);
|
|
16
|
-
return c ? a ? {
|
|
17
|
-
anchor: n,
|
|
18
|
-
targets: u,
|
|
19
|
-
nameFilter: c,
|
|
20
|
-
nameOwners: m(a)
|
|
21
|
-
} : {
|
|
22
|
-
anchor: n,
|
|
23
|
-
targets: u,
|
|
24
|
-
nameFilter: c
|
|
25
|
-
} : {
|
|
26
|
-
anchor: n,
|
|
27
|
-
targets: u
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
function f({ match: e, value: t }, n) {
|
|
31
|
-
if (n === void 0) return !1;
|
|
32
|
-
switch (e) {
|
|
33
|
-
case "equals": return n === t;
|
|
34
|
-
case "starts-with": return n.startsWith(t);
|
|
35
|
-
case "ends-with": return n.endsWith(t);
|
|
36
|
-
case "contains": return n.includes(t);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
function p(e) {
|
|
40
|
-
return e.map((e) => `local-name()='${e}'`).join(" or ");
|
|
41
|
-
}
|
|
42
|
-
function m(e) {
|
|
43
|
-
return [...e.matchAll(/local-name\(\)='([^']+)'/g)].map((e) => e[1]);
|
|
44
|
-
}
|
|
45
|
-
function h({ match: e, value: t }) {
|
|
46
|
-
let n = _(t);
|
|
47
|
-
switch (e) {
|
|
48
|
-
case "equals": return `@name=${n}`;
|
|
49
|
-
case "starts-with":
|
|
50
|
-
case "contains": return `${e}(@name,${n})`;
|
|
51
|
-
case "ends-with": return `substring(@name,string-length(@name)-string-length(${n})+1)=${n}`;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
function g(e) {
|
|
55
|
-
let t = s.exec(e);
|
|
56
|
-
if (!t) return null;
|
|
57
|
-
let [, n, r, i, a, o] = t;
|
|
58
|
-
return n ? {
|
|
59
|
-
match: "equals",
|
|
60
|
-
value: v(n)
|
|
61
|
-
} : r && i ? {
|
|
62
|
-
match: r,
|
|
63
|
-
value: v(i)
|
|
64
|
-
} : a === o ? {
|
|
65
|
-
match: "ends-with",
|
|
66
|
-
value: v(a)
|
|
67
|
-
} : null;
|
|
68
|
-
}
|
|
69
|
-
function _(e) {
|
|
70
|
-
if (!e.includes("'")) return `'${e}'`;
|
|
71
|
-
if (!e.includes("\"")) return `"${e}"`;
|
|
72
|
-
throw Error("Search text must not contain both single and double quotes");
|
|
73
|
-
}
|
|
74
|
-
function v(e) {
|
|
75
|
-
return e.slice(1, -1);
|
|
76
|
-
}
|
|
77
|
-
function y(e) {
|
|
78
|
-
if (e.trim() !== "") try {
|
|
79
|
-
let t = document.implementation.createDocument(null, "root");
|
|
80
|
-
t.evaluate(e, t, null, XPathResult.ANY_TYPE, null);
|
|
81
|
-
return;
|
|
82
|
-
} catch (e) {
|
|
83
|
-
return e instanceof Error && e.message || "Invalid XPath";
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
function b(e, { optional: n = !1 } = {}) {
|
|
87
|
-
if (!(n && e === "") && !t.test(e)) throw Error(`Invalid element name "${e}"`);
|
|
88
|
-
}
|
|
1
|
+
import e from "./selector-input.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
//#region lib/selector-input/selector-input.vue
|
|
3
|
+
var t = e;
|
|
89
4
|
//#endregion
|
|
90
|
-
export {
|
|
5
|
+
export { t as default };
|
|
@@ -1,58 +1,57 @@
|
|
|
1
|
-
import { buildXpath as e, parseXpath as t,
|
|
2
|
-
import { Fragment as
|
|
1
|
+
import { buildXpath as e, parseXpath as t, validateSearchText as n, validateXpath as r } from "./selector-xpath.js";
|
|
2
|
+
import { Fragment as i, computed as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, defineComponent as l, mergeModels as u, normalizeClass as d, onBeforeUnmount as f, openBlock as p, reactive as m, ref as h, renderList as g, renderSlot as _, toDisplayString as v, useModel as y, vModelText as b, watch as x, withDirectives as S } from "vue";
|
|
3
3
|
//#region lib/selector-input/selector-input.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
4
|
+
var C = {
|
|
5
5
|
class: "flex flex-col gap-2",
|
|
6
6
|
"data-testid": "selector-input"
|
|
7
|
-
},
|
|
7
|
+
}, w = { class: "tabs tabs-box w-fit tabs-sm" }, T = ["data-testid", "onClick"], E = {
|
|
8
8
|
key: 0,
|
|
9
9
|
role: "status",
|
|
10
10
|
class: "alert alert-soft alert-info py-2 text-sm",
|
|
11
11
|
"data-testid": "selector-input-custom-hint"
|
|
12
|
-
},
|
|
12
|
+
}, D = { class: "fieldset" }, O = { class: "flex flex-wrap gap-2" }, k = [
|
|
13
13
|
"aria-pressed",
|
|
14
14
|
"data-testid",
|
|
15
15
|
"onClick"
|
|
16
|
-
],
|
|
16
|
+
], A = {
|
|
17
17
|
key: 1,
|
|
18
18
|
class: "fieldset"
|
|
19
|
-
},
|
|
19
|
+
}, j = { class: "fieldset-legend text-sm font-medium" }, M = {
|
|
20
20
|
class: "join",
|
|
21
21
|
role: "group",
|
|
22
22
|
"aria-label": "Name match"
|
|
23
|
-
},
|
|
23
|
+
}, N = [
|
|
24
24
|
"aria-pressed",
|
|
25
25
|
"data-testid",
|
|
26
26
|
"onClick"
|
|
27
|
-
],
|
|
27
|
+
], P = [
|
|
28
28
|
"value",
|
|
29
29
|
"aria-label",
|
|
30
30
|
"placeholder"
|
|
31
|
-
],
|
|
32
|
-
key: 0,
|
|
33
|
-
class: "label text-error",
|
|
34
|
-
role: "alert",
|
|
35
|
-
"data-testid": "selector-input-search-error"
|
|
36
|
-
}, M = {
|
|
31
|
+
], F = {
|
|
37
32
|
key: 1,
|
|
38
33
|
class: "fieldset"
|
|
39
|
-
},
|
|
34
|
+
}, I = ["disabled"], L = {
|
|
40
35
|
key: 0,
|
|
41
36
|
class: "label text-error",
|
|
42
37
|
role: "alert",
|
|
43
38
|
"data-testid": "selector-input-error"
|
|
44
|
-
},
|
|
45
|
-
key:
|
|
39
|
+
}, R = {
|
|
40
|
+
key: 2,
|
|
46
41
|
class: "label text-error",
|
|
47
42
|
role: "alert",
|
|
48
43
|
"data-testid": "selector-input-search-error"
|
|
49
|
-
},
|
|
44
|
+
}, z = /*@__PURE__*/ l({
|
|
50
45
|
__name: "selector-input",
|
|
51
|
-
props: /*@__PURE__*/
|
|
46
|
+
props: /*@__PURE__*/ u({
|
|
52
47
|
anchors: {},
|
|
53
48
|
anywhereLabel: { default: "Anywhere" },
|
|
54
49
|
targets: { default: () => [] },
|
|
55
|
-
|
|
50
|
+
nameParent: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: !1
|
|
53
|
+
},
|
|
54
|
+
nameLabel: { default: "Name" },
|
|
56
55
|
searchable: {
|
|
57
56
|
type: Boolean,
|
|
58
57
|
default: !0
|
|
@@ -71,8 +70,14 @@ var x = {
|
|
|
71
70
|
invalidModifiers: {}
|
|
72
71
|
}),
|
|
73
72
|
emits: ["update:modelValue", "update:invalid"],
|
|
74
|
-
setup(
|
|
75
|
-
let l = [
|
|
73
|
+
setup(l) {
|
|
74
|
+
let u = l, z = y(l, "modelValue"), B = y(l, "invalid"), V = [{
|
|
75
|
+
value: "builder",
|
|
76
|
+
label: "Builder"
|
|
77
|
+
}, {
|
|
78
|
+
value: "xpath",
|
|
79
|
+
label: "XPath"
|
|
80
|
+
}], H = [
|
|
76
81
|
{
|
|
77
82
|
value: "equals",
|
|
78
83
|
label: "Full name"
|
|
@@ -89,92 +94,89 @@ var x = {
|
|
|
89
94
|
value: "contains",
|
|
90
95
|
label: "Contains"
|
|
91
96
|
}
|
|
92
|
-
],
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
y(Y, (e) => R.value = e, { immediate: !0 }), d(() => R.value = !1), y(L, (e) => {
|
|
97
|
-
let n = t(e);
|
|
98
|
-
B.value = n?.anchor ?? "", V.value = n?.targets ?? I.targets, U.value = n?.nameFilter?.value ?? "", n?.nameFilter && (H.value = n.nameFilter.match);
|
|
97
|
+
], U = h("builder"), W = m({
|
|
98
|
+
anchor: "",
|
|
99
|
+
match: "contains",
|
|
100
|
+
search: ""
|
|
99
101
|
});
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
Q(z.value), x(z, Q);
|
|
103
|
+
let G = a(() => t(z.value)), K = a(() => z.value !== "" && G.value === void 0), q = a(() => u.allowXpath ? r(z.value) : void 0), J = a(() => n(W.search)), Y = a(() => [{
|
|
104
|
+
value: "",
|
|
105
|
+
label: u.anywhereLabel
|
|
106
|
+
}, ...u.anchors]), X = a(() => `Search by ${u.nameLabel.toLowerCase()}`), Z = a(() => `A custom XPath is in use. Choosing a scope${u.searchable ? " or entering a search" : ""} replaces it.`);
|
|
107
|
+
x(() => !!(J.value || q.value), (e) => B.value = e, { immediate: !0 }), f(() => B.value = !1);
|
|
103
108
|
function Q(e) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
109
|
+
let n = t(e);
|
|
110
|
+
if (W.anchor = n?.anchor ?? "", n?.nameFilter) {
|
|
111
|
+
W.search = n.nameFilter.value, W.match = n.nameFilter.match;
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
W.search && (W.search = "", W.match = "contains");
|
|
108
115
|
}
|
|
109
|
-
function $() {
|
|
110
|
-
J.value
|
|
111
|
-
anchor:
|
|
112
|
-
targets:
|
|
116
|
+
function $(t) {
|
|
117
|
+
Object.assign(W, t), !J.value && (z.value = e({
|
|
118
|
+
anchor: W.anchor,
|
|
119
|
+
targets: G.value?.targets ?? u.targets,
|
|
113
120
|
nameFilter: {
|
|
114
|
-
match:
|
|
115
|
-
value:
|
|
121
|
+
match: W.match,
|
|
122
|
+
value: W.search
|
|
116
123
|
},
|
|
117
|
-
|
|
124
|
+
nameParent: G.value?.nameParent ?? u.nameParent
|
|
118
125
|
}));
|
|
119
126
|
}
|
|
120
|
-
return (e, t) => (
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
class: u(["tab", { "tab-active": W.value === "builder" }]),
|
|
124
|
-
"data-testid": "selector-input-mode-builder",
|
|
125
|
-
onClick: t[0] ||= (e) => W.value = "builder"
|
|
126
|
-
}, " Builder ", 2), s("button", {
|
|
127
|
+
return (e, t) => (p(), s("div", C, [
|
|
128
|
+
c("div", w, [(p(), s(i, null, g(V, (e) => c("button", {
|
|
129
|
+
key: e.value,
|
|
127
130
|
type: "button",
|
|
128
|
-
class:
|
|
129
|
-
"data-testid":
|
|
130
|
-
onClick: t
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
class: d(["tab", { "tab-active": U.value === e.value }]),
|
|
132
|
+
"data-testid": `selector-input-mode-${e.value}`,
|
|
133
|
+
onClick: (t) => U.value = e.value
|
|
134
|
+
}, v(e.label), 11, T)), 64))]),
|
|
135
|
+
U.value === "builder" ? (p(), s(i, { key: 0 }, [
|
|
136
|
+
K.value ? (p(), s("div", E, v(Z.value), 1)) : o("", !0),
|
|
137
|
+
c("fieldset", D, [t[2] ||= c("legend", { class: "fieldset-legend text-sm font-medium" }, "Scope", -1), c("div", O, [(p(!0), s(i, null, g(Y.value, (e) => (p(), s("button", {
|
|
135
138
|
key: e.value,
|
|
136
139
|
type: "button",
|
|
137
|
-
class:
|
|
138
|
-
"aria-pressed": !
|
|
140
|
+
class: d(["badge badge-sm cursor-pointer", !K.value && W.anchor === e.value ? "badge-primary" : "badge-soft"]),
|
|
141
|
+
"aria-pressed": !K.value && W.anchor === e.value,
|
|
139
142
|
"data-testid": `selector-input-anchor-${e.value || "none"}`,
|
|
140
|
-
onClick: (t) =>
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
onClick: (t) => $({ anchor: e.value })
|
|
144
|
+
}, v(e.label), 11, k))), 128))])]),
|
|
145
|
+
l.searchable ? (p(), s("fieldset", A, [
|
|
146
|
+
c("legend", j, v(l.nameLabel), 1),
|
|
147
|
+
c("div", M, [(p(), s(i, null, g(H, (e) => c("button", {
|
|
145
148
|
key: e.value,
|
|
146
149
|
type: "button",
|
|
147
|
-
class:
|
|
148
|
-
"aria-pressed":
|
|
150
|
+
class: d(["btn btn-sm join-item", { "btn-primary": W.match === e.value }]),
|
|
151
|
+
"aria-pressed": W.match === e.value,
|
|
149
152
|
"data-testid": `selector-input-match-${e.value}`,
|
|
150
|
-
onClick: (t) =>
|
|
151
|
-
},
|
|
152
|
-
|
|
153
|
-
value:
|
|
153
|
+
onClick: (t) => $({ match: e.value })
|
|
154
|
+
}, v(e.label), 11, N)), 64))]),
|
|
155
|
+
c("input", {
|
|
156
|
+
value: W.search,
|
|
154
157
|
type: "search",
|
|
155
|
-
"aria-label":
|
|
156
|
-
class:
|
|
157
|
-
placeholder:
|
|
158
|
+
"aria-label": X.value,
|
|
159
|
+
class: d(["input input-sm w-full", { "input-error": J.value }]),
|
|
160
|
+
placeholder: X.value,
|
|
158
161
|
"data-testid": "selector-input-search",
|
|
159
|
-
onInput: t[
|
|
160
|
-
}, null, 42,
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
"onUpdate:modelValue": t[3] ||= (e) => L.value = e,
|
|
162
|
+
onInput: t[0] ||= (e) => $({ search: e.target.value })
|
|
163
|
+
}, null, 42, P)
|
|
164
|
+
])) : o("", !0)
|
|
165
|
+
], 64)) : (p(), s("fieldset", F, [
|
|
166
|
+
t[3] ||= c("legend", { class: "fieldset-legend" }, "XPath", -1),
|
|
167
|
+
S(c("input", {
|
|
168
|
+
"onUpdate:modelValue": t[1] ||= (e) => z.value = e,
|
|
167
169
|
type: "text",
|
|
168
|
-
disabled: !
|
|
169
|
-
class:
|
|
170
|
+
disabled: !l.allowXpath,
|
|
171
|
+
class: d(["input w-full font-mono", { "input-error": q.value }]),
|
|
170
172
|
"data-testid": "selector-input-raw"
|
|
171
|
-
}, null, 10,
|
|
172
|
-
|
|
173
|
-
J.value ? (f(), o("p", F, g(J.value), 1)) : a("", !0)
|
|
173
|
+
}, null, 10, I), [[b, z.value]]),
|
|
174
|
+
q.value ? (p(), s("p", L, v(q.value), 1)) : o("", !0)
|
|
174
175
|
])),
|
|
175
|
-
|
|
176
|
+
J.value ? (p(), s("p", R, v(J.value), 1)) : o("", !0),
|
|
177
|
+
_(e.$slots, "footer")
|
|
176
178
|
]));
|
|
177
179
|
}
|
|
178
180
|
});
|
|
179
181
|
//#endregion
|
|
180
|
-
export {
|
|
182
|
+
export { z as default };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
//#region lib/selector-input/selector-xpath.ts
|
|
2
|
+
var e = "Search text must not contain both single and double quotes", t = "[\\w.-]+", n = RegExp(`^${t}$`), r = "(?:'[^']*'|\"[^\"]*\")", i = `local-name\\(\\)='${t}'`, a = `${i}(?: or ${i})*`, o = `(?:@name=(${r})|(starts-with|contains)\\(@name,(${r})\\)|substring\\(@name,string-length\\(@name\\)-string-length\\((${r})\\)\\+1\\)=(${r}))`, s = RegExp(`^${o}$`), c = RegExp(`^(?:ancestor::\\*\\[local-name\\(\\)='(?<anchor>${t})'\\]\\[1\\])?//\\*(?:\\[(?<targets>${a})\\])?(?:\\[(?<ownName>${o})\\]|\\[ancestor::\\*\\[${a}\\]\\[1\\]\\[(?<ownerName>${o})\\]\\]|\\[parent::\\*\\[(?<parentName>${o})\\]\\])?$`);
|
|
3
|
+
function l({ anchor: e, targets: t, nameFilter: n, nameParent: r = !1 }) {
|
|
4
|
+
e && x(e), t.forEach(x);
|
|
5
|
+
let i = n?.value ? n : void 0;
|
|
6
|
+
return !e && t.length === 0 && !i ? "" : `${e ? `ancestor::*[local-name()='${e}'][1]` : ""}//*${t.length > 0 ? `[${m(t)}]` : ""}${i ? h(i, r) : ""}`;
|
|
7
|
+
}
|
|
8
|
+
function u(e) {
|
|
9
|
+
let t = c.exec(e)?.groups;
|
|
10
|
+
if (!t) return;
|
|
11
|
+
let { anchor: n = "", targets: r = "", ownName: i, ownerName: a, parentName: o } = t, s = i ?? a ?? o, l = s ? v(s) : void 0;
|
|
12
|
+
if (s && !l || !n && !r && !l) return;
|
|
13
|
+
let u = {
|
|
14
|
+
anchor: n,
|
|
15
|
+
targets: _(r)
|
|
16
|
+
};
|
|
17
|
+
return l ? i ? {
|
|
18
|
+
...u,
|
|
19
|
+
nameFilter: l
|
|
20
|
+
} : {
|
|
21
|
+
...u,
|
|
22
|
+
nameFilter: l,
|
|
23
|
+
nameParent: !0
|
|
24
|
+
} : u;
|
|
25
|
+
}
|
|
26
|
+
function d({ match: e, value: t }, n) {
|
|
27
|
+
if (n === void 0) return !1;
|
|
28
|
+
switch (e) {
|
|
29
|
+
case "equals": return n === t;
|
|
30
|
+
case "starts-with": return n.startsWith(t);
|
|
31
|
+
case "ends-with": return n.endsWith(t);
|
|
32
|
+
case "contains": return n.includes(t);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function f(e) {
|
|
36
|
+
if (e.trim() !== "") try {
|
|
37
|
+
let t = document.implementation.createDocument(null, "root");
|
|
38
|
+
t.evaluate(e, t, null, XPathResult.ANY_TYPE, null);
|
|
39
|
+
return;
|
|
40
|
+
} catch (e) {
|
|
41
|
+
return e instanceof Error && e.message || "Invalid XPath";
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function p(t) {
|
|
45
|
+
return t.includes("'") && t.includes("\"") ? e : void 0;
|
|
46
|
+
}
|
|
47
|
+
function m(e) {
|
|
48
|
+
return e.map((e) => `local-name()='${e}'`).join(" or ");
|
|
49
|
+
}
|
|
50
|
+
function h(e, t) {
|
|
51
|
+
let n = g(e);
|
|
52
|
+
return t ? `[parent::*[${n}]]` : `[${n}]`;
|
|
53
|
+
}
|
|
54
|
+
function g({ match: e, value: t }) {
|
|
55
|
+
let n = y(t);
|
|
56
|
+
switch (e) {
|
|
57
|
+
case "equals": return `@name=${n}`;
|
|
58
|
+
case "starts-with":
|
|
59
|
+
case "contains": return `${e}(@name,${n})`;
|
|
60
|
+
case "ends-with": return `substring(@name,string-length(@name)-string-length(${n})+1)=${n}`;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function _(e) {
|
|
64
|
+
return [...e.matchAll(/local-name\(\)='([^']+)'/g)].map((e) => e[1]);
|
|
65
|
+
}
|
|
66
|
+
function v(e) {
|
|
67
|
+
let t = s.exec(e);
|
|
68
|
+
if (!t) return;
|
|
69
|
+
let [, n, r, i, a, o] = t;
|
|
70
|
+
return n ? {
|
|
71
|
+
match: "equals",
|
|
72
|
+
value: b(n)
|
|
73
|
+
} : r && i ? {
|
|
74
|
+
match: r,
|
|
75
|
+
value: b(i)
|
|
76
|
+
} : a === o ? {
|
|
77
|
+
match: "ends-with",
|
|
78
|
+
value: b(a)
|
|
79
|
+
} : void 0;
|
|
80
|
+
}
|
|
81
|
+
function y(t) {
|
|
82
|
+
if (p(t)) throw Error(e);
|
|
83
|
+
return t.includes("'") ? `"${t}"` : `'${t}'`;
|
|
84
|
+
}
|
|
85
|
+
function b(e) {
|
|
86
|
+
return e.slice(1, -1);
|
|
87
|
+
}
|
|
88
|
+
function x(e) {
|
|
89
|
+
if (!n.test(e)) throw Error(`Invalid element name "${e}"`);
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
export { l as buildXpath, d as matchName, u as parseXpath, p as validateSearchText, f as validateXpath };
|