@threadlabs/looma 0.28.7 → 0.28.9
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/components/ui-editor-code-language/ui-editor-code-language.html +17 -0
- package/components/ui-editor-code-language/ui-editor-code-language.js +14 -0
- package/components/ui-editor-link-form/ui-editor-link-form.html +118 -0
- package/components/ui-editor-link-form/ui-editor-link-form.js +71 -0
- package/dist/index.js +37 -35
- package/package.json +1 -1
- package/styles/ui-editor-code-language.css +1 -0
- package/styles/ui-editor-link-form.css +1 -0
- package/vanilla/UiEditorCodeLanguage.d.ts +16 -0
- package/vanilla/UiEditorCodeLanguage.js +64 -0
- package/vanilla/UiEditorLinkForm.d.ts +32 -0
- package/vanilla/UiEditorLinkForm.js +354 -0
- package/vanilla/index.js +2 -0
- package/vue/UiEditorCodeLanguage.d.ts +44 -0
- package/vue/UiEditorCodeLanguage.js +2 -0
- package/vue/UiEditorCodeLanguage.vue +156 -0
- package/vue/UiEditorLinkForm.d.ts +165 -0
- package/vue/UiEditorLinkForm.js +2 -0
- package/vue/UiEditorLinkForm.vue +557 -0
- package/vue/chunks/UiEditorCodeLanguage.js +163 -0
- package/vue/chunks/UiEditorLinkForm.js +669 -0
- package/vue/components.css +407 -407
- package/vue/editor/index.js +81 -171
- package/vue/editor/primitives.d.ts +21 -1
- package/vue/index.d.ts +2 -0
- package/vue/index.js +5 -3
|
@@ -0,0 +1,669 @@
|
|
|
1
|
+
import { _ as uniqueKeys, a as concat, g as text, i as checkHydratedRoot, n as KeyedBoundary, o as createDispatch, p as nativeAttrs, s as cycleCheckedComputed, v as useComponentHost, y as useReflectedProp } from "./_plugin-vue_export-helper.js";
|
|
2
|
+
import { a as vPropValidity, n as checkedProp, r as propValidityState, t as acceptsControllerWrite } from "./props.js";
|
|
3
|
+
import { t as UiIcon_default } from "./UiIcon.js";
|
|
4
|
+
import { t as UiCheckbox_default } from "./UiCheckbox.js";
|
|
5
|
+
import { t as UiScrollArea_default } from "./UiScrollArea.js";
|
|
6
|
+
import { t as UiFormField_default } from "./UiFormField.js";
|
|
7
|
+
import { t as UiIconButton_default } from "./UiIconButton.js";
|
|
8
|
+
import { t as UiInput_default } from "./UiInput.js";
|
|
9
|
+
import { t as UiStack_default } from "./UiStack.js";
|
|
10
|
+
import { t as UiText_default } from "./UiText.js";
|
|
11
|
+
import { t as UiInputGroup_default } from "./UiInputGroup.js";
|
|
12
|
+
import { t as UiSearchResultRow_default } from "./UiSearchResultRow.js";
|
|
13
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, mergeProps, openBlock, provide, ref, renderList, toDisplayString, unref, watchSyncEffect, withCtx, withDirectives } from "vue";
|
|
14
|
+
//#region .build/vue/UiEditorLinkForm.vue?vue&type=script&setup=true&lang.ts
|
|
15
|
+
var _hoisted_1 = [
|
|
16
|
+
"data-error",
|
|
17
|
+
"data-existing",
|
|
18
|
+
"data-mode",
|
|
19
|
+
"data-new-tab",
|
|
20
|
+
"data-placeholder",
|
|
21
|
+
"data-results",
|
|
22
|
+
"data-searchable",
|
|
23
|
+
"data-selected",
|
|
24
|
+
"data-status",
|
|
25
|
+
"data-text",
|
|
26
|
+
"data-text-editable",
|
|
27
|
+
"data-value"
|
|
28
|
+
];
|
|
29
|
+
var _hoisted_2 = ["for"];
|
|
30
|
+
var _hoisted_3 = ["for"];
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region .build/vue/UiEditorLinkForm.vue
|
|
33
|
+
var UiEditorLinkForm_default = /* @__PURE__ */ defineComponent({
|
|
34
|
+
inheritAttrs: false,
|
|
35
|
+
__name: "UiEditorLinkForm",
|
|
36
|
+
props: {
|
|
37
|
+
error: {
|
|
38
|
+
type: null,
|
|
39
|
+
default: ""
|
|
40
|
+
},
|
|
41
|
+
existing: {
|
|
42
|
+
type: null,
|
|
43
|
+
default: false
|
|
44
|
+
},
|
|
45
|
+
mode: {
|
|
46
|
+
type: null,
|
|
47
|
+
default: "url"
|
|
48
|
+
},
|
|
49
|
+
newTab: {
|
|
50
|
+
type: null,
|
|
51
|
+
default: false
|
|
52
|
+
},
|
|
53
|
+
placeholder: {
|
|
54
|
+
type: null,
|
|
55
|
+
default: "https://example.com"
|
|
56
|
+
},
|
|
57
|
+
results: {
|
|
58
|
+
type: null,
|
|
59
|
+
default: () => []
|
|
60
|
+
},
|
|
61
|
+
searchable: {
|
|
62
|
+
type: null,
|
|
63
|
+
default: false
|
|
64
|
+
},
|
|
65
|
+
selected: {
|
|
66
|
+
type: null,
|
|
67
|
+
default: ""
|
|
68
|
+
},
|
|
69
|
+
status: {
|
|
70
|
+
type: null,
|
|
71
|
+
default: ""
|
|
72
|
+
},
|
|
73
|
+
text: {
|
|
74
|
+
type: null,
|
|
75
|
+
default: ""
|
|
76
|
+
},
|
|
77
|
+
textEditable: {
|
|
78
|
+
type: null,
|
|
79
|
+
default: false
|
|
80
|
+
},
|
|
81
|
+
value: {
|
|
82
|
+
type: null,
|
|
83
|
+
default: ""
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
emits: [
|
|
87
|
+
"update:newTab",
|
|
88
|
+
"update:text",
|
|
89
|
+
"update:value",
|
|
90
|
+
"destination",
|
|
91
|
+
"text",
|
|
92
|
+
"new-tab",
|
|
93
|
+
"choose",
|
|
94
|
+
"clear",
|
|
95
|
+
"save",
|
|
96
|
+
"dismiss"
|
|
97
|
+
],
|
|
98
|
+
setup(__props, { emit: __emit }) {
|
|
99
|
+
const propValidityContract = { props: {
|
|
100
|
+
error: {
|
|
101
|
+
type: {
|
|
102
|
+
kind: "terminal",
|
|
103
|
+
name: "string"
|
|
104
|
+
},
|
|
105
|
+
required: false,
|
|
106
|
+
target: { attribute: "error" },
|
|
107
|
+
description: "A problem to show under the fields, announced as an alert.",
|
|
108
|
+
default: ""
|
|
109
|
+
},
|
|
110
|
+
existing: {
|
|
111
|
+
type: {
|
|
112
|
+
kind: "terminal",
|
|
113
|
+
name: "boolean"
|
|
114
|
+
},
|
|
115
|
+
required: false,
|
|
116
|
+
target: { attribute: "existing" },
|
|
117
|
+
description: "Whether the link already exists, so the heading reads Edit link rather than Add link.",
|
|
118
|
+
default: false
|
|
119
|
+
},
|
|
120
|
+
mode: {
|
|
121
|
+
type: {
|
|
122
|
+
kind: "terminal",
|
|
123
|
+
name: "keyword"
|
|
124
|
+
},
|
|
125
|
+
required: false,
|
|
126
|
+
target: { attribute: "mode" },
|
|
127
|
+
description: "What the destination field holds: an address, which offers Open in new tab, or a search, which lists results.",
|
|
128
|
+
values: ["url", "target"],
|
|
129
|
+
default: "url"
|
|
130
|
+
},
|
|
131
|
+
newTab: {
|
|
132
|
+
type: {
|
|
133
|
+
kind: "terminal",
|
|
134
|
+
name: "boolean"
|
|
135
|
+
},
|
|
136
|
+
required: false,
|
|
137
|
+
target: { attribute: "checked" },
|
|
138
|
+
description: "Whether Open in new tab is checked.",
|
|
139
|
+
default: false
|
|
140
|
+
},
|
|
141
|
+
placeholder: {
|
|
142
|
+
type: {
|
|
143
|
+
kind: "terminal",
|
|
144
|
+
name: "string"
|
|
145
|
+
},
|
|
146
|
+
required: false,
|
|
147
|
+
target: { attribute: "placeholder" },
|
|
148
|
+
description: "The destination field's placeholder.",
|
|
149
|
+
default: "https://example.com"
|
|
150
|
+
},
|
|
151
|
+
results: {
|
|
152
|
+
type: {
|
|
153
|
+
kind: "list",
|
|
154
|
+
item: {
|
|
155
|
+
kind: "object",
|
|
156
|
+
fields: [
|
|
157
|
+
{
|
|
158
|
+
name: "id",
|
|
159
|
+
type: {
|
|
160
|
+
kind: "terminal",
|
|
161
|
+
name: "string"
|
|
162
|
+
},
|
|
163
|
+
optional: false
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: "label",
|
|
167
|
+
type: {
|
|
168
|
+
kind: "terminal",
|
|
169
|
+
name: "string"
|
|
170
|
+
},
|
|
171
|
+
optional: false
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: "detail",
|
|
175
|
+
type: {
|
|
176
|
+
kind: "terminal",
|
|
177
|
+
name: "string"
|
|
178
|
+
},
|
|
179
|
+
optional: true
|
|
180
|
+
}
|
|
181
|
+
],
|
|
182
|
+
open: false
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
required: false,
|
|
186
|
+
target: { attribute: "results" },
|
|
187
|
+
description: "The destinations a search found.",
|
|
188
|
+
default: []
|
|
189
|
+
},
|
|
190
|
+
searchable: {
|
|
191
|
+
type: {
|
|
192
|
+
kind: "terminal",
|
|
193
|
+
name: "boolean"
|
|
194
|
+
},
|
|
195
|
+
required: false,
|
|
196
|
+
target: { attribute: "searchable" },
|
|
197
|
+
description: "Whether the destination field searches for a destination as well as taking an address. A searchable field has a search icon and a Clear search\n button.",
|
|
198
|
+
default: false
|
|
199
|
+
},
|
|
200
|
+
selected: {
|
|
201
|
+
type: {
|
|
202
|
+
kind: "terminal",
|
|
203
|
+
name: "string"
|
|
204
|
+
},
|
|
205
|
+
required: false,
|
|
206
|
+
target: { attribute: "selected" },
|
|
207
|
+
description: "The id of the chosen result, which shows a check.",
|
|
208
|
+
default: ""
|
|
209
|
+
},
|
|
210
|
+
status: {
|
|
211
|
+
type: {
|
|
212
|
+
kind: "terminal",
|
|
213
|
+
name: "string"
|
|
214
|
+
},
|
|
215
|
+
required: false,
|
|
216
|
+
target: { attribute: "status" },
|
|
217
|
+
description: "A line above the results, such as Searching… or No results found., announced politely. Shown only for a search.",
|
|
218
|
+
default: ""
|
|
219
|
+
},
|
|
220
|
+
text: {
|
|
221
|
+
type: {
|
|
222
|
+
kind: "terminal",
|
|
223
|
+
name: "string"
|
|
224
|
+
},
|
|
225
|
+
required: false,
|
|
226
|
+
target: { attribute: "value" },
|
|
227
|
+
description: "The Text field's value.",
|
|
228
|
+
default: ""
|
|
229
|
+
},
|
|
230
|
+
textEditable: {
|
|
231
|
+
type: {
|
|
232
|
+
kind: "terminal",
|
|
233
|
+
name: "boolean"
|
|
234
|
+
},
|
|
235
|
+
required: false,
|
|
236
|
+
target: { attribute: "texteditable" },
|
|
237
|
+
description: "Shows a Text field, for a link added where no text is selected.",
|
|
238
|
+
default: false
|
|
239
|
+
},
|
|
240
|
+
value: {
|
|
241
|
+
type: {
|
|
242
|
+
kind: "terminal",
|
|
243
|
+
name: "string"
|
|
244
|
+
},
|
|
245
|
+
required: false,
|
|
246
|
+
target: { attribute: "value" },
|
|
247
|
+
description: "The destination field's text: the address, or the search.",
|
|
248
|
+
default: ""
|
|
249
|
+
}
|
|
250
|
+
} };
|
|
251
|
+
const props = __props;
|
|
252
|
+
const acceptedProps = {
|
|
253
|
+
error: "",
|
|
254
|
+
existing: false,
|
|
255
|
+
mode: "url",
|
|
256
|
+
newTab: false,
|
|
257
|
+
placeholder: "https://example.com",
|
|
258
|
+
results: () => [],
|
|
259
|
+
searchable: false,
|
|
260
|
+
selected: "",
|
|
261
|
+
status: "",
|
|
262
|
+
text: "",
|
|
263
|
+
textEditable: false,
|
|
264
|
+
value: ""
|
|
265
|
+
};
|
|
266
|
+
const checkedProps = computed(() => ({
|
|
267
|
+
error: checkedProp(props["error"], {
|
|
268
|
+
kind: "terminal",
|
|
269
|
+
name: "string"
|
|
270
|
+
}, false, "error", acceptedProps),
|
|
271
|
+
existing: checkedProp(props["existing"], {
|
|
272
|
+
kind: "terminal",
|
|
273
|
+
name: "boolean"
|
|
274
|
+
}, false, "existing", acceptedProps),
|
|
275
|
+
mode: checkedProp(props["mode"], {
|
|
276
|
+
kind: "terminal",
|
|
277
|
+
name: "keyword"
|
|
278
|
+
}, false, "mode", acceptedProps),
|
|
279
|
+
newTab: checkedProp(props["newTab"], {
|
|
280
|
+
kind: "terminal",
|
|
281
|
+
name: "boolean"
|
|
282
|
+
}, false, "newTab", acceptedProps),
|
|
283
|
+
placeholder: checkedProp(props["placeholder"], {
|
|
284
|
+
kind: "terminal",
|
|
285
|
+
name: "string"
|
|
286
|
+
}, false, "placeholder", acceptedProps),
|
|
287
|
+
results: checkedProp(props["results"], {
|
|
288
|
+
kind: "list",
|
|
289
|
+
item: {
|
|
290
|
+
kind: "object",
|
|
291
|
+
fields: [
|
|
292
|
+
{
|
|
293
|
+
name: "id",
|
|
294
|
+
type: {
|
|
295
|
+
kind: "terminal",
|
|
296
|
+
name: "string"
|
|
297
|
+
},
|
|
298
|
+
optional: false
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
name: "label",
|
|
302
|
+
type: {
|
|
303
|
+
kind: "terminal",
|
|
304
|
+
name: "string"
|
|
305
|
+
},
|
|
306
|
+
optional: false
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
name: "detail",
|
|
310
|
+
type: {
|
|
311
|
+
kind: "terminal",
|
|
312
|
+
name: "string"
|
|
313
|
+
},
|
|
314
|
+
optional: true
|
|
315
|
+
}
|
|
316
|
+
],
|
|
317
|
+
open: false
|
|
318
|
+
}
|
|
319
|
+
}, false, "results", acceptedProps),
|
|
320
|
+
searchable: checkedProp(props["searchable"], {
|
|
321
|
+
kind: "terminal",
|
|
322
|
+
name: "boolean"
|
|
323
|
+
}, false, "searchable", acceptedProps),
|
|
324
|
+
selected: checkedProp(props["selected"], {
|
|
325
|
+
kind: "terminal",
|
|
326
|
+
name: "string"
|
|
327
|
+
}, false, "selected", acceptedProps),
|
|
328
|
+
status: checkedProp(props["status"], {
|
|
329
|
+
kind: "terminal",
|
|
330
|
+
name: "string"
|
|
331
|
+
}, false, "status", acceptedProps),
|
|
332
|
+
text: checkedProp(props["text"], {
|
|
333
|
+
kind: "terminal",
|
|
334
|
+
name: "string"
|
|
335
|
+
}, false, "text", acceptedProps),
|
|
336
|
+
textEditable: checkedProp(props["textEditable"], {
|
|
337
|
+
kind: "terminal",
|
|
338
|
+
name: "boolean"
|
|
339
|
+
}, false, "textEditable", acceptedProps),
|
|
340
|
+
value: checkedProp(props["value"], {
|
|
341
|
+
kind: "terminal",
|
|
342
|
+
name: "string"
|
|
343
|
+
}, false, "value", acceptedProps)
|
|
344
|
+
}));
|
|
345
|
+
checkedProps.value;
|
|
346
|
+
watchSyncEffect(() => {
|
|
347
|
+
checkedProps.value;
|
|
348
|
+
});
|
|
349
|
+
const reflectedProp = useReflectedProp();
|
|
350
|
+
const hydrationInstance = getCurrentInstance();
|
|
351
|
+
const emit = __emit;
|
|
352
|
+
const root = ref(null);
|
|
353
|
+
const base = ref("ui-editor-link-form");
|
|
354
|
+
let headingPrevious = null;
|
|
355
|
+
const heading = cycleCheckedComputed(() => {
|
|
356
|
+
const next = ((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])({
|
|
357
|
+
true: "Edit link",
|
|
358
|
+
false: "Add link"
|
|
359
|
+
}, concat(checkedProps.value.existing));
|
|
360
|
+
if (next === Symbol.for("html-next.invalid-result")) return headingPrevious;
|
|
361
|
+
return headingPrevious = next;
|
|
362
|
+
});
|
|
363
|
+
let fieldLabelPrevious = null;
|
|
364
|
+
const fieldLabel = cycleCheckedComputed(() => {
|
|
365
|
+
const next = ((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])({
|
|
366
|
+
true: "Link destination",
|
|
367
|
+
false: "URL"
|
|
368
|
+
}, concat(checkedProps.value.searchable));
|
|
369
|
+
if (next === Symbol.for("html-next.invalid-result")) return fieldLabelPrevious;
|
|
370
|
+
return fieldLabelPrevious = next;
|
|
371
|
+
});
|
|
372
|
+
let guardedPrevious = null;
|
|
373
|
+
const guarded = computed(() => {
|
|
374
|
+
const candidate = concat(base.value, "-destination");
|
|
375
|
+
if (candidate === Symbol.for("html-next.invalid-result")) return guardedPrevious;
|
|
376
|
+
return guardedPrevious = candidate;
|
|
377
|
+
});
|
|
378
|
+
let guardedBindingPrevious = null;
|
|
379
|
+
const guardedBinding = computed(() => {
|
|
380
|
+
const candidate = ((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])({
|
|
381
|
+
true: "search",
|
|
382
|
+
false: "link"
|
|
383
|
+
}, concat(checkedProps.value.mode === "target"));
|
|
384
|
+
if (candidate === Symbol.for("html-next.invalid-result")) return guardedBindingPrevious;
|
|
385
|
+
return guardedBindingPrevious = candidate;
|
|
386
|
+
});
|
|
387
|
+
let guardedBinding2Previous = null;
|
|
388
|
+
const guardedBinding2 = computed(() => {
|
|
389
|
+
const candidate = concat(base.value, "-destination");
|
|
390
|
+
if (candidate === Symbol.for("html-next.invalid-result")) return guardedBinding2Previous;
|
|
391
|
+
return guardedBinding2Previous = candidate;
|
|
392
|
+
});
|
|
393
|
+
let guardedBinding3Previous = null;
|
|
394
|
+
const guardedBinding3 = computed(() => {
|
|
395
|
+
const candidate = concat(base.value, "-destination");
|
|
396
|
+
if (candidate === Symbol.for("html-next.invalid-result")) return guardedBinding3Previous;
|
|
397
|
+
return guardedBinding3Previous = candidate;
|
|
398
|
+
});
|
|
399
|
+
let guardedBinding4Previous = null;
|
|
400
|
+
const guardedBinding4 = computed(() => {
|
|
401
|
+
const candidate = concat(base.value, "-text");
|
|
402
|
+
if (candidate === Symbol.for("html-next.invalid-result")) return guardedBinding4Previous;
|
|
403
|
+
return guardedBinding4Previous = candidate;
|
|
404
|
+
});
|
|
405
|
+
let guardedBinding5Previous = null;
|
|
406
|
+
const guardedBinding5 = computed(() => {
|
|
407
|
+
const candidate = concat(base.value, "-text");
|
|
408
|
+
if (candidate === Symbol.for("html-next.invalid-result")) return guardedBinding5Previous;
|
|
409
|
+
return guardedBinding5Previous = candidate;
|
|
410
|
+
});
|
|
411
|
+
provide("html-next:ui-editor-link-form:base", base);
|
|
412
|
+
checkHydratedRoot("form", "ui-editor-link-form");
|
|
413
|
+
const isDestinationDetail = (detail) => detail !== null && typeof detail === "object" && !Array.isArray(detail) && typeof detail["value"] === "string" && Object.keys(detail).every((key) => ["value"].includes(key));
|
|
414
|
+
const isTextDetail = (detail) => detail !== null && typeof detail === "object" && !Array.isArray(detail) && typeof detail["text"] === "string" && Object.keys(detail).every((key) => ["text"].includes(key));
|
|
415
|
+
const isNewTabDetail = (detail) => detail !== null && typeof detail === "object" && !Array.isArray(detail) && typeof detail["newTab"] === "boolean" && Object.keys(detail).every((key) => ["newTab"].includes(key));
|
|
416
|
+
const isChooseDetail = (detail) => detail !== null && typeof detail === "object" && !Array.isArray(detail) && typeof detail["id"] === "string" && Object.keys(detail).every((key) => ["id"].includes(key));
|
|
417
|
+
const isClearDetail = (detail) => detail !== null && typeof detail === "object" && !Array.isArray(detail) && Object.values(detail).every((item) => true);
|
|
418
|
+
const dispatch = createDispatch(root, emit, {
|
|
419
|
+
checks: {
|
|
420
|
+
destination: isDestinationDetail,
|
|
421
|
+
text: isTextDetail,
|
|
422
|
+
"new-tab": isNewTabDetail,
|
|
423
|
+
choose: isChooseDetail,
|
|
424
|
+
clear: isClearDetail,
|
|
425
|
+
save: isClearDetail,
|
|
426
|
+
dismiss: isClearDetail
|
|
427
|
+
},
|
|
428
|
+
modeled: [
|
|
429
|
+
"newTab",
|
|
430
|
+
"text",
|
|
431
|
+
"value"
|
|
432
|
+
]
|
|
433
|
+
});
|
|
434
|
+
useComponentHost(() => import("@threadlabs/looma/components/ui-editor-link-form/ui-editor-link-form.js"), {
|
|
435
|
+
root,
|
|
436
|
+
dispatch,
|
|
437
|
+
acceptsState: (name, keys, value) => acceptsControllerWrite(value, { base: {
|
|
438
|
+
kind: "terminal",
|
|
439
|
+
name: "string"
|
|
440
|
+
} }[name], keys),
|
|
441
|
+
controllerSource: {
|
|
442
|
+
specifier: "../components/ui-editor-link-form/ui-editor-link-form.js",
|
|
443
|
+
definition: "./components/ui-editor-link-form/ui-editor-link-form.html"
|
|
444
|
+
},
|
|
445
|
+
props: checkedProps,
|
|
446
|
+
propInputs: (name) => {
|
|
447
|
+
const incoming = hydrationInstance?.vnode.props;
|
|
448
|
+
const kebab = name.replace(/[A-Z]/g, (letter) => "-" + letter.toLowerCase());
|
|
449
|
+
return incoming !== null && incoming !== void 0 ? incoming[name] ?? incoming[kebab] ?? null : null;
|
|
450
|
+
},
|
|
451
|
+
propNames: [
|
|
452
|
+
"error",
|
|
453
|
+
"existing",
|
|
454
|
+
"mode",
|
|
455
|
+
"newTab",
|
|
456
|
+
"placeholder",
|
|
457
|
+
"results",
|
|
458
|
+
"searchable",
|
|
459
|
+
"selected",
|
|
460
|
+
"status",
|
|
461
|
+
"text",
|
|
462
|
+
"textEditable",
|
|
463
|
+
"value"
|
|
464
|
+
],
|
|
465
|
+
propValidity: (name) => propValidityState({
|
|
466
|
+
contract: propValidityContract,
|
|
467
|
+
values: { ...props }
|
|
468
|
+
}, name),
|
|
469
|
+
state: { base },
|
|
470
|
+
computed: {
|
|
471
|
+
heading,
|
|
472
|
+
fieldLabel
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
return (_ctx, _cache) => {
|
|
476
|
+
return withDirectives((openBlock(), createElementBlock("form", mergeProps({ "aria-label": "Edit link" }, unref(nativeAttrs)(_ctx.$attrs), {
|
|
477
|
+
"data-error": unref(reflectedProp)("error", "error", checkedProps.value.error, void 0, false),
|
|
478
|
+
"data-existing": unref(reflectedProp)("existing", "existing", checkedProps.value.existing, void 0, false),
|
|
479
|
+
"data-mode": unref(reflectedProp)("mode", "mode", checkedProps.value.mode, void 0, false),
|
|
480
|
+
"data-new-tab": unref(reflectedProp)("newTab", "new-tab", checkedProps.value.newTab, void 0, false),
|
|
481
|
+
"data-placeholder": unref(reflectedProp)("placeholder", "placeholder", checkedProps.value.placeholder, void 0, false),
|
|
482
|
+
"data-results": unref(reflectedProp)("results", "results", checkedProps.value.results, void 0, false),
|
|
483
|
+
"data-searchable": unref(reflectedProp)("searchable", "searchable", checkedProps.value.searchable, void 0, false),
|
|
484
|
+
"data-selected": unref(reflectedProp)("selected", "selected", checkedProps.value.selected, void 0, false),
|
|
485
|
+
"data-status": unref(reflectedProp)("status", "status", checkedProps.value.status, void 0, false),
|
|
486
|
+
"data-text": unref(reflectedProp)("text", "text", checkedProps.value.text, void 0, false),
|
|
487
|
+
"data-text-editable": unref(reflectedProp)("textEditable", "text-editable", checkedProps.value.textEditable, void 0, false),
|
|
488
|
+
"data-value": unref(reflectedProp)("value", "value", checkedProps.value.value, void 0, false),
|
|
489
|
+
ref_key: "root",
|
|
490
|
+
ref: root
|
|
491
|
+
}), [createVNode(UiStack_default, { gap: "s" }, {
|
|
492
|
+
default: withCtx(() => [
|
|
493
|
+
createVNode(UiText_default, {
|
|
494
|
+
as: "h3",
|
|
495
|
+
size: "sm",
|
|
496
|
+
weight: "semibold"
|
|
497
|
+
}, {
|
|
498
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(text)(unref(heading))), 1)]),
|
|
499
|
+
_: 1
|
|
500
|
+
}),
|
|
501
|
+
createVNode(UiStack_default, { gap: "s" }, {
|
|
502
|
+
default: withCtx(() => [
|
|
503
|
+
createVNode(UiFormField_default, { invalid: checkedProps.value.error !== "" }, {
|
|
504
|
+
default: withCtx(() => [
|
|
505
|
+
createElementVNode("label", {
|
|
506
|
+
slot: "label",
|
|
507
|
+
for: guarded.value
|
|
508
|
+
}, toDisplayString(unref(text)(unref(fieldLabel))), 9, _hoisted_2),
|
|
509
|
+
checkedProps.value.searchable ? (openBlock(), createBlock(UiInputGroup_default, {
|
|
510
|
+
key: 0,
|
|
511
|
+
"prefix-kind": "icon"
|
|
512
|
+
}, {
|
|
513
|
+
default: withCtx(() => [
|
|
514
|
+
createVNode(UiIcon_default, {
|
|
515
|
+
slot: "prefix",
|
|
516
|
+
name: guardedBinding.value
|
|
517
|
+
}, null, 8, ["name"]),
|
|
518
|
+
createVNode(UiInput_default, {
|
|
519
|
+
"data-link-destination": "",
|
|
520
|
+
"data-link-search": "",
|
|
521
|
+
type: "text",
|
|
522
|
+
role: "searchbox",
|
|
523
|
+
autocomplete: "off",
|
|
524
|
+
id: guardedBinding2.value,
|
|
525
|
+
placeholder: checkedProps.value.placeholder,
|
|
526
|
+
value: checkedProps.value.value
|
|
527
|
+
}, null, 8, [
|
|
528
|
+
"id",
|
|
529
|
+
"placeholder",
|
|
530
|
+
"value"
|
|
531
|
+
]),
|
|
532
|
+
checkedProps.value.value !== "" ? (openBlock(), createBlock(UiIconButton_default, {
|
|
533
|
+
key: 0,
|
|
534
|
+
slot: "action",
|
|
535
|
+
label: "Clear search",
|
|
536
|
+
variant: "ghost",
|
|
537
|
+
size: "sm",
|
|
538
|
+
"data-link-clear": ""
|
|
539
|
+
}, {
|
|
540
|
+
default: withCtx(() => [createVNode(UiIcon_default, { name: "x" })]),
|
|
541
|
+
_: 1
|
|
542
|
+
})) : createCommentVNode("v-if", true)
|
|
543
|
+
]),
|
|
544
|
+
_: 1
|
|
545
|
+
})) : createCommentVNode("v-if", true),
|
|
546
|
+
!checkedProps.value.searchable ? (openBlock(), createBlock(UiInput_default, {
|
|
547
|
+
key: 1,
|
|
548
|
+
"data-link-destination": "",
|
|
549
|
+
type: "text",
|
|
550
|
+
inputmode: "url",
|
|
551
|
+
size: "sm",
|
|
552
|
+
id: guardedBinding3.value,
|
|
553
|
+
placeholder: checkedProps.value.placeholder,
|
|
554
|
+
value: checkedProps.value.value
|
|
555
|
+
}, null, 8, [
|
|
556
|
+
"id",
|
|
557
|
+
"placeholder",
|
|
558
|
+
"value"
|
|
559
|
+
])) : createCommentVNode("v-if", true)
|
|
560
|
+
]),
|
|
561
|
+
_: 1
|
|
562
|
+
}, 8, ["invalid"]),
|
|
563
|
+
checkedProps.value.mode === "target" ? (openBlock(), createBlock(UiScrollArea_default, {
|
|
564
|
+
key: 0,
|
|
565
|
+
size: "sm",
|
|
566
|
+
"aria-label": "Destination search results"
|
|
567
|
+
}, {
|
|
568
|
+
default: withCtx(() => [checkedProps.value.status !== "" ? (openBlock(), createBlock(UiText_default, {
|
|
569
|
+
key: 0,
|
|
570
|
+
size: "sm",
|
|
571
|
+
tone: "secondary",
|
|
572
|
+
role: "status"
|
|
573
|
+
}, {
|
|
574
|
+
default: withCtx(() => [createTextVNode(toDisplayString(checkedProps.value.status), 1)]),
|
|
575
|
+
_: 1
|
|
576
|
+
})) : createCommentVNode("v-if", true), createVNode(unref(KeyedBoundary), null, {
|
|
577
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(uniqueKeys)(checkedProps.value.results, (result, index, loop) => result.id), (result) => {
|
|
578
|
+
return openBlock(), createBlock(UiSearchResultRow_default, {
|
|
579
|
+
key: result.id,
|
|
580
|
+
density: "compact",
|
|
581
|
+
"data-link-result": "",
|
|
582
|
+
selected: result.id === checkedProps.value.selected,
|
|
583
|
+
"data-link-id": result.id
|
|
584
|
+
}, {
|
|
585
|
+
default: withCtx(() => [
|
|
586
|
+
createVNode(UiIcon_default, {
|
|
587
|
+
slot: "leading",
|
|
588
|
+
name: "file-text"
|
|
589
|
+
}),
|
|
590
|
+
createVNode(UiText_default, {
|
|
591
|
+
slot: "title",
|
|
592
|
+
as: "strong",
|
|
593
|
+
size: "sm",
|
|
594
|
+
weight: "medium",
|
|
595
|
+
truncate: true,
|
|
596
|
+
title: result.label
|
|
597
|
+
}, {
|
|
598
|
+
default: withCtx(() => [createTextVNode(toDisplayString(result.label), 1)]),
|
|
599
|
+
_: 2
|
|
600
|
+
}, 1032, ["title"]),
|
|
601
|
+
result.detail ? (openBlock(), createBlock(UiText_default, {
|
|
602
|
+
key: 0,
|
|
603
|
+
slot: "meta",
|
|
604
|
+
as: "span",
|
|
605
|
+
size: "xs",
|
|
606
|
+
tone: "secondary",
|
|
607
|
+
truncate: true,
|
|
608
|
+
title: result.detail
|
|
609
|
+
}, {
|
|
610
|
+
default: withCtx(() => [createTextVNode(toDisplayString(result.detail), 1)]),
|
|
611
|
+
_: 2
|
|
612
|
+
}, 1032, ["title"])) : createCommentVNode("v-if", true),
|
|
613
|
+
result.id === checkedProps.value.selected ? (openBlock(), createBlock(UiIcon_default, {
|
|
614
|
+
key: 1,
|
|
615
|
+
slot: "trailing",
|
|
616
|
+
name: "check"
|
|
617
|
+
})) : createCommentVNode("v-if", true)
|
|
618
|
+
]),
|
|
619
|
+
_: 2
|
|
620
|
+
}, 1032, ["selected", "data-link-id"]);
|
|
621
|
+
}), 128))]),
|
|
622
|
+
_: 1
|
|
623
|
+
})]),
|
|
624
|
+
_: 1
|
|
625
|
+
})) : createCommentVNode("v-if", true),
|
|
626
|
+
checkedProps.value.mode === "url" ? (openBlock(), createBlock(UiCheckbox_default, {
|
|
627
|
+
key: 1,
|
|
628
|
+
size: "sm",
|
|
629
|
+
"data-link-new-tab": "",
|
|
630
|
+
checked: checkedProps.value.newTab
|
|
631
|
+
}, {
|
|
632
|
+
default: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode("Open in new tab", -1)])]),
|
|
633
|
+
_: 1
|
|
634
|
+
}, 8, ["checked"])) : createCommentVNode("v-if", true)
|
|
635
|
+
]),
|
|
636
|
+
_: 1
|
|
637
|
+
}),
|
|
638
|
+
checkedProps.value.textEditable ? (openBlock(), createBlock(UiFormField_default, { key: 0 }, {
|
|
639
|
+
default: withCtx(() => [createElementVNode("label", {
|
|
640
|
+
slot: "label",
|
|
641
|
+
for: guardedBinding4.value
|
|
642
|
+
}, "Text", 8, _hoisted_3), createVNode(UiInput_default, {
|
|
643
|
+
"data-link-text": "",
|
|
644
|
+
size: "sm",
|
|
645
|
+
id: guardedBinding5.value,
|
|
646
|
+
value: checkedProps.value.text
|
|
647
|
+
}, null, 8, ["id", "value"])]),
|
|
648
|
+
_: 1
|
|
649
|
+
})) : createCommentVNode("v-if", true),
|
|
650
|
+
checkedProps.value.error !== "" ? (openBlock(), createBlock(UiText_default, {
|
|
651
|
+
key: 1,
|
|
652
|
+
size: "sm",
|
|
653
|
+
tone: "danger",
|
|
654
|
+
role: "alert"
|
|
655
|
+
}, {
|
|
656
|
+
default: withCtx(() => [createTextVNode(toDisplayString(checkedProps.value.error), 1)]),
|
|
657
|
+
_: 1
|
|
658
|
+
})) : createCommentVNode("v-if", true)
|
|
659
|
+
]),
|
|
660
|
+
_: 1
|
|
661
|
+
})], 16, _hoisted_1)), [[unref(vPropValidity), {
|
|
662
|
+
contract: propValidityContract,
|
|
663
|
+
values: { ...props }
|
|
664
|
+
}]]);
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
});
|
|
668
|
+
//#endregion
|
|
669
|
+
export { UiEditorLinkForm_default as t };
|