@dynamicforms/vuetify-inputs 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,8 +3,8 @@ import { CachedIcon as V } from "vue-cached-icon";
|
|
|
3
3
|
import H from "vue-markdown-render";
|
|
4
4
|
import U, { Action as te, ExecuteAction as W, ValidationError as G } from "@dynamicforms/vue-forms";
|
|
5
5
|
import { castArray as ne, clone as re, first as ie, isArray as ae, isBoolean as K, isEmpty as q, isEqual as oe, isNaN as se, isObjectLike as ce, isPlainObject as le, isString as J, toNumber as Y, unionBy as ue } from "lodash-es";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { useDisplay as de } from "vuetify";
|
|
7
|
+
import { createTranslatable as fe } from "@dynamicforms/translatable";
|
|
8
8
|
import { format as pe, parse as me, parseISO as he } from "date-fns";
|
|
9
9
|
import ge from "@tiptap/extension-image";
|
|
10
10
|
import _e from "@tiptap/extension-placeholder";
|
|
@@ -1344,100 +1344,21 @@ var nn = { class: "d-flex w-100 df-style-resetting df-sub-field" }, rn = /* @__P
|
|
|
1344
1344
|
])) : r("", !0);
|
|
1345
1345
|
};
|
|
1346
1346
|
}
|
|
1347
|
-
}), an =
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
Close: "Close",
|
|
1351
|
-
Cancel: "Cancel",
|
|
1352
|
-
Ok: "OK",
|
|
1353
|
-
Paragraph: "Paragraph",
|
|
1354
|
-
Heading1: "Heading 1",
|
|
1355
|
-
Heading2: "Heading 2",
|
|
1356
|
-
Heading3: "Heading 3",
|
|
1357
|
-
Heading4: "Heading 4",
|
|
1358
|
-
Heading5: "Heading 5",
|
|
1359
|
-
Heading6: "Heading 6",
|
|
1360
|
-
Downloadable: "Downloadable",
|
|
1361
|
-
ArticleCategory: "Article category",
|
|
1362
|
-
Title: "Title",
|
|
1363
|
-
Subtitle: "Subtitle",
|
|
1364
|
-
InfoBox: "Info box",
|
|
1365
|
-
SideQuote: "Side quote",
|
|
1366
|
-
Marker: "Marker",
|
|
1367
|
-
Spoiler: "Spoiler",
|
|
1368
|
-
CodeDark: "Code (dark)",
|
|
1369
|
-
CodeBright: "Code (bright)",
|
|
1370
|
-
Undo: "Undo",
|
|
1371
|
-
Redo: "Redo",
|
|
1372
|
-
SelectAll: "Select all",
|
|
1373
|
-
Bold: "Bold",
|
|
1374
|
-
Italic: "Italic",
|
|
1375
|
-
HorizontalLine: "Horizontal line",
|
|
1376
|
-
Blockquote: "Block quote",
|
|
1377
|
-
BulletedList: "Bulleted list",
|
|
1378
|
-
NumberedList: "Numbered list",
|
|
1379
|
-
Outdent: "Decrease indent",
|
|
1380
|
-
Indent: "Increase indent",
|
|
1381
|
-
AlignLeft: "Align left",
|
|
1382
|
-
AlignCenter: "Align center",
|
|
1383
|
-
AlignRight: "Align right",
|
|
1384
|
-
AlignJustify: "Justify",
|
|
1385
|
-
Link: "Link",
|
|
1386
|
-
LinkUrl: "URL",
|
|
1387
|
-
LinkApply: "Apply",
|
|
1388
|
-
LinkRemove: "Remove link",
|
|
1389
|
-
Image: "Image",
|
|
1390
|
-
ImageUrl: "Image URL",
|
|
1391
|
-
ImageUpload: "Upload image",
|
|
1392
|
-
ImageInsert: "Insert",
|
|
1393
|
-
ImageDropHint: "Drop image here or click to browse",
|
|
1394
|
-
ImageReplace: "Replace image",
|
|
1395
|
-
ImageDownload: "Download image",
|
|
1396
|
-
FileDownload: "Download file",
|
|
1397
|
-
Table: "Table",
|
|
1398
|
-
TableInsert: "Insert table",
|
|
1399
|
-
TableAddRowAbove: "Add row above",
|
|
1400
|
-
TableAddRowBelow: "Add row below",
|
|
1401
|
-
TableDeleteRow: "Delete row",
|
|
1402
|
-
TableAddColumnBefore: "Add column before",
|
|
1403
|
-
TableAddColumnAfter: "Add column after",
|
|
1404
|
-
TableDeleteColumn: "Delete column",
|
|
1405
|
-
TableToggleHeaderRow: "Toggle header row",
|
|
1406
|
-
TableDeleteTable: "Delete table",
|
|
1407
|
-
Style: "Style",
|
|
1408
|
-
MediaEmbed: "Insert media",
|
|
1409
|
-
MediaEmbedUrl: "Video URL",
|
|
1410
|
-
MediaEmbedInsert: "Insert"
|
|
1411
|
-
}, on = de(an), { translateStrings: sn } = on, cn = /* @__PURE__ */ new WeakMap();
|
|
1412
|
-
function ln(e) {
|
|
1413
|
-
if (!(e != null && e.translate)) return on;
|
|
1414
|
-
let t = cn.get(e);
|
|
1415
|
-
return t || (t = de(an), t.translateStrings(e.translate, e.translateNamespace), cn.set(e, t)), t;
|
|
1416
|
-
}
|
|
1417
|
-
function un(e, t) {
|
|
1418
|
-
return ln(u() ? p(Yt, {}) : void 0).translate(e, t);
|
|
1419
|
-
}
|
|
1420
|
-
function dn() {
|
|
1421
|
-
let e = ln(p(Yt, {}));
|
|
1422
|
-
return (t, n) => e.translate(t, n);
|
|
1423
|
-
}
|
|
1424
|
-
//#endregion
|
|
1425
|
-
//#region src/helpers/action/action-display-style.ts
|
|
1426
|
-
var fn = Object.freeze(["button", "text"]), pn = "button";
|
|
1427
|
-
function mn(e) {
|
|
1428
|
-
return fn.includes(e);
|
|
1347
|
+
}), an = Object.freeze(["button", "text"]), on = "button";
|
|
1348
|
+
function sn(e) {
|
|
1349
|
+
return an.includes(e);
|
|
1429
1350
|
}
|
|
1430
1351
|
//#endregion
|
|
1431
1352
|
//#region src/helpers/action/responsive-render-options.ts
|
|
1432
|
-
var
|
|
1353
|
+
var cn = [
|
|
1433
1354
|
"xs",
|
|
1434
1355
|
"sm",
|
|
1435
1356
|
"md",
|
|
1436
1357
|
"lg",
|
|
1437
1358
|
"xl"
|
|
1438
|
-
],
|
|
1359
|
+
], ln = class {
|
|
1439
1360
|
constructor(e) {
|
|
1440
|
-
X(this, "_value", void 0), this._value = this.cleanBreakpoint(e, !0), e &&
|
|
1361
|
+
X(this, "_value", void 0), this._value = this.cleanBreakpoint(e, !0), e && cn.forEach((t) => {
|
|
1441
1362
|
let n = this.cleanBreakpoint(e[t]);
|
|
1442
1363
|
n && (this._value[t] = n);
|
|
1443
1364
|
});
|
|
@@ -1445,7 +1366,7 @@ var hn = [
|
|
|
1445
1366
|
getOptionsForBreakpoint(e) {
|
|
1446
1367
|
var t;
|
|
1447
1368
|
let n = (t = this.cleanBreakpoint(this._value)) == null ? {} : t;
|
|
1448
|
-
for (let t of
|
|
1369
|
+
for (let t of cn) {
|
|
1449
1370
|
var r;
|
|
1450
1371
|
let i = (r = this._value[t]) == null ? {} : r;
|
|
1451
1372
|
for (let e of Object.keys(i)) {
|
|
@@ -1457,22 +1378,22 @@ var hn = [
|
|
|
1457
1378
|
return n;
|
|
1458
1379
|
}
|
|
1459
1380
|
};
|
|
1460
|
-
function
|
|
1381
|
+
function un(e) {
|
|
1461
1382
|
return e.xlAndUp.value ? "xl" : e.lgAndUp.value ? "lg" : e.mdAndUp.value ? "md" : e.smAndUp.value ? "sm" : "xs";
|
|
1462
1383
|
}
|
|
1463
|
-
function
|
|
1464
|
-
let e =
|
|
1465
|
-
return t(() =>
|
|
1384
|
+
function dn() {
|
|
1385
|
+
let e = de();
|
|
1386
|
+
return t(() => un(e));
|
|
1466
1387
|
}
|
|
1467
1388
|
//#endregion
|
|
1468
1389
|
//#region src/helpers/action/action-render-options.ts
|
|
1469
|
-
var
|
|
1390
|
+
var fn = class extends ln {
|
|
1470
1391
|
cleanBreakpoint(e, t = !1) {
|
|
1471
1392
|
if ((!e || !ce(e)) && !t) return null;
|
|
1472
1393
|
let n = {};
|
|
1473
|
-
if (t && (n.renderAs =
|
|
1394
|
+
if (t && (n.renderAs = on, n.showLabel = !0, n.showIcon = !0), e) {
|
|
1474
1395
|
if (e.renderAs != null) {
|
|
1475
|
-
if (!
|
|
1396
|
+
if (!sn(e.renderAs)) throw Error(`'${e.renderAs}' is not an action display style: ${an.join(", ")}`);
|
|
1476
1397
|
n.renderAs = e.renderAs;
|
|
1477
1398
|
}
|
|
1478
1399
|
let t = N(e.label);
|
|
@@ -1481,8 +1402,8 @@ var yn = class extends gn {
|
|
|
1481
1402
|
return Object.keys(n).length ? n : null;
|
|
1482
1403
|
}
|
|
1483
1404
|
};
|
|
1484
|
-
function
|
|
1485
|
-
let n = new
|
|
1405
|
+
function pn(e, t) {
|
|
1406
|
+
let n = new fn(e).getOptionsForBreakpoint(t), r = n.label;
|
|
1486
1407
|
return {
|
|
1487
1408
|
name: n.name,
|
|
1488
1409
|
label: n.showLabel ? r : void 0,
|
|
@@ -1497,9 +1418,9 @@ function bn(e, t) {
|
|
|
1497
1418
|
}
|
|
1498
1419
|
//#endregion
|
|
1499
1420
|
//#region src/helpers/action/action.ts
|
|
1500
|
-
var
|
|
1421
|
+
var mn = class extends te {
|
|
1501
1422
|
getBreakpointValue(e) {
|
|
1502
|
-
return t(() =>
|
|
1423
|
+
return t(() => pn(this.value, e.value));
|
|
1503
1424
|
}
|
|
1504
1425
|
get label() {
|
|
1505
1426
|
return N(this.value.label);
|
|
@@ -1529,43 +1450,80 @@ var xn = class e extends te {
|
|
|
1529
1450
|
get passthroughAttrs() {
|
|
1530
1451
|
return this.value.passthroughAttrs;
|
|
1531
1452
|
}
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1453
|
+
}, hn = {
|
|
1454
|
+
Cancel: "Cancel",
|
|
1455
|
+
Ok: "OK",
|
|
1456
|
+
Paragraph: "Paragraph",
|
|
1457
|
+
Heading1: "Heading 1",
|
|
1458
|
+
Heading2: "Heading 2",
|
|
1459
|
+
Heading3: "Heading 3",
|
|
1460
|
+
Heading4: "Heading 4",
|
|
1461
|
+
Heading5: "Heading 5",
|
|
1462
|
+
Heading6: "Heading 6",
|
|
1463
|
+
Downloadable: "Downloadable",
|
|
1464
|
+
ArticleCategory: "Article category",
|
|
1465
|
+
Title: "Title",
|
|
1466
|
+
Subtitle: "Subtitle",
|
|
1467
|
+
InfoBox: "Info box",
|
|
1468
|
+
SideQuote: "Side quote",
|
|
1469
|
+
Marker: "Marker",
|
|
1470
|
+
Spoiler: "Spoiler",
|
|
1471
|
+
CodeDark: "Code (dark)",
|
|
1472
|
+
CodeBright: "Code (bright)",
|
|
1473
|
+
Undo: "Undo",
|
|
1474
|
+
Redo: "Redo",
|
|
1475
|
+
SelectAll: "Select all",
|
|
1476
|
+
Bold: "Bold",
|
|
1477
|
+
Italic: "Italic",
|
|
1478
|
+
HorizontalLine: "Horizontal line",
|
|
1479
|
+
Blockquote: "Block quote",
|
|
1480
|
+
BulletedList: "Bulleted list",
|
|
1481
|
+
NumberedList: "Numbered list",
|
|
1482
|
+
Outdent: "Decrease indent",
|
|
1483
|
+
Indent: "Increase indent",
|
|
1484
|
+
AlignLeft: "Align left",
|
|
1485
|
+
AlignCenter: "Align center",
|
|
1486
|
+
AlignRight: "Align right",
|
|
1487
|
+
AlignJustify: "Justify",
|
|
1488
|
+
Link: "Link",
|
|
1489
|
+
LinkUrl: "URL",
|
|
1490
|
+
LinkApply: "Apply",
|
|
1491
|
+
LinkRemove: "Remove link",
|
|
1492
|
+
Image: "Image",
|
|
1493
|
+
ImageUrl: "Image URL",
|
|
1494
|
+
ImageUpload: "Upload image",
|
|
1495
|
+
ImageInsert: "Insert",
|
|
1496
|
+
ImageDropHint: "Drop image here or click to browse",
|
|
1497
|
+
ImageReplace: "Replace image",
|
|
1498
|
+
ImageDownload: "Download image",
|
|
1499
|
+
FileDownload: "Download file",
|
|
1500
|
+
Table: "Table",
|
|
1501
|
+
TableInsert: "Insert table",
|
|
1502
|
+
TableAddRowAbove: "Add row above",
|
|
1503
|
+
TableAddRowBelow: "Add row below",
|
|
1504
|
+
TableDeleteRow: "Delete row",
|
|
1505
|
+
TableAddColumnBefore: "Add column before",
|
|
1506
|
+
TableAddColumnAfter: "Add column after",
|
|
1507
|
+
TableDeleteColumn: "Delete column",
|
|
1508
|
+
TableToggleHeaderRow: "Toggle header row",
|
|
1509
|
+
TableDeleteTable: "Delete table",
|
|
1510
|
+
Style: "Style",
|
|
1511
|
+
MediaEmbed: "Insert media",
|
|
1512
|
+
MediaEmbedUrl: "Video URL",
|
|
1513
|
+
MediaEmbedInsert: "Insert"
|
|
1514
|
+
}, gn = fe(hn), { translateStrings: _n } = gn, vn = /* @__PURE__ */ new WeakMap();
|
|
1515
|
+
function yn(e) {
|
|
1516
|
+
if (!(e != null && e.translate)) return gn;
|
|
1517
|
+
let t = vn.get(e);
|
|
1518
|
+
return t || (t = fe(hn), t.translateStrings(e.translate, e.translateNamespace), vn.set(e, t)), t;
|
|
1519
|
+
}
|
|
1520
|
+
function bn(e, t) {
|
|
1521
|
+
return yn(u() ? p(Yt, {}) : void 0).translate(e, t);
|
|
1522
|
+
}
|
|
1523
|
+
function xn() {
|
|
1524
|
+
let e = yn(p(Yt, {}));
|
|
1525
|
+
return (t, n) => e.translate(t, n);
|
|
1526
|
+
}
|
|
1569
1527
|
//#endregion
|
|
1570
1528
|
//#region src/helpers/use-file-touch-keepalive.ts
|
|
1571
1529
|
function Sn(e, t, n, r) {
|
|
@@ -1605,7 +1563,7 @@ var wn = {
|
|
|
1605
1563
|
showAsGroup: { default: "no" }
|
|
1606
1564
|
},
|
|
1607
1565
|
setup(a) {
|
|
1608
|
-
let o = a, s =
|
|
1566
|
+
let o = a, s = dn(), c = t(() => P(o.actions).filter((e) => e.visibility !== "suppress")), l = t(() => c.value.map((e) => Z({ action: e }, pn(e.value, s.value))));
|
|
1609
1567
|
function u(e) {
|
|
1610
1568
|
if (e.defaultConfirm) return "primary";
|
|
1611
1569
|
if (e.defaultReject) return "secondary";
|
|
@@ -1721,7 +1679,7 @@ var wn = {
|
|
|
1721
1679
|
//#region src/helpers/client-rendered.ts
|
|
1722
1680
|
function On() {
|
|
1723
1681
|
if (typeof window > "u") return k(!1);
|
|
1724
|
-
if (!
|
|
1682
|
+
if (!de().ssr) return k(!0);
|
|
1725
1683
|
let e = k(!1);
|
|
1726
1684
|
return S(() => {
|
|
1727
1685
|
e.value = !0;
|
|
@@ -1741,12 +1699,12 @@ var kn = /* @__PURE__ */ l({
|
|
|
1741
1699
|
let a = D("v-btn");
|
|
1742
1700
|
return C(), i(e, null, [c(a, {
|
|
1743
1701
|
variant: "text",
|
|
1744
|
-
text: P(
|
|
1702
|
+
text: P(bn)("Cancel"),
|
|
1745
1703
|
onClick: t.cancel
|
|
1746
1704
|
}, null, 8, ["text", "onClick"]), c(a, {
|
|
1747
1705
|
variant: "text",
|
|
1748
1706
|
disabled: t.isPristine,
|
|
1749
|
-
text: P(
|
|
1707
|
+
text: P(bn)("Ok"),
|
|
1750
1708
|
onClick: t.save
|
|
1751
1709
|
}, null, 8, [
|
|
1752
1710
|
"disabled",
|
|
@@ -2205,7 +2163,7 @@ var In = ["title", "aria-label"], Ln = /* @__PURE__ */ l({
|
|
|
2205
2163
|
}, en),
|
|
2206
2164
|
emits: ["update:modelValue", "click:clear"],
|
|
2207
2165
|
setup(e, { emit: i }) {
|
|
2208
|
-
let s = e, { density: l, densityClass: u, touched: d, value: f, vuetifyBindings: p } = tn(s, i), m =
|
|
2166
|
+
let s = e, { density: l, densityClass: u, touched: d, value: f, vuetifyBindings: p } = tn(s, i), m = bn, h = w(null), _ = w(0), y = w(), b = t(() => h.value && _.value < 100), x = t(() => !y.value && f.value ? f.value : ""), S = t(() => !y.value && !!f.value && !!s.comms.getDownloadUrl);
|
|
2209
2167
|
function T() {
|
|
2210
2168
|
return E.apply(this, arguments);
|
|
2211
2169
|
}
|
|
@@ -2338,7 +2296,7 @@ var In = ["title", "aria-label"], Ln = /* @__PURE__ */ l({
|
|
|
2338
2296
|
}, en),
|
|
2339
2297
|
emits: ["update:modelValue", "click:clear"],
|
|
2340
2298
|
setup(e, { emit: o }) {
|
|
2341
|
-
let s = e, { density: l, densityClass: u, touched: d, value: f, vuetifyBindings: p } = tn(s, o), m =
|
|
2299
|
+
let s = e, { density: l, densityClass: u, touched: d, value: f, vuetifyBindings: p } = tn(s, o), m = bn, h = F(), _ = w(null), y = w(0), S = w(null), T = w(0), E = w(null), O = t(() => _.value && y.value < 100), k = t(() => !!(p.value.disabled || p.value.readonly)), j = t(() => T.value > 0), M = t(() => {
|
|
2342
2300
|
var e;
|
|
2343
2301
|
return (e = S.value) == null ? f.value ? f.value : null : e;
|
|
2344
2302
|
}), N = t(() => !!f.value);
|
|
@@ -2812,7 +2770,7 @@ var ur = { class: "rtf-toolbar-group" }, dr = { class: "d-flex justify-end ga-2
|
|
|
2812
2770
|
buttonSize: { default: "small" }
|
|
2813
2771
|
},
|
|
2814
2772
|
setup(o) {
|
|
2815
|
-
let l = o, u = t(() => l.buttonSize), d =
|
|
2773
|
+
let l = o, u = t(() => l.buttonSize), d = bn, f = t(() => l.editor), p = lr(f), m = t(() => {
|
|
2816
2774
|
var e;
|
|
2817
2775
|
return p.value, !!((e = l.editor) != null && e.isEditable);
|
|
2818
2776
|
}), h = t(() => ({
|
|
@@ -3508,7 +3466,7 @@ var Cr = { class: "editor-container" }, wr = {
|
|
|
3508
3466
|
let f = On(), p = t(() => {
|
|
3509
3467
|
var e;
|
|
3510
3468
|
return Ut(new It((e = s.modelValue) == null ? "" : e));
|
|
3511
|
-
}), m =
|
|
3469
|
+
}), m = xn(), h;
|
|
3512
3470
|
I(u, (e) => {
|
|
3513
3471
|
h == null || h.disconnect();
|
|
3514
3472
|
let t = e == null ? void 0 : e.$el, n = t == null ? void 0 : t.closest(".v-field");
|
|
@@ -4150,6 +4108,6 @@ var Mr = {
|
|
|
4150
4108
|
e.provide(Yt, t == null ? {} : t), (n = t == null ? void 0 : t.registerComponents) != null && n && Object.entries(Fr).map(([t, n]) => e.component(t, n)), (r = t == null ? void 0 : t.registerVuetifyComponents) != null && r && Object.entries(Ir).map(([t, n]) => e.component(t, n));
|
|
4151
4109
|
} };
|
|
4152
4110
|
//#endregion
|
|
4153
|
-
export {
|
|
4111
|
+
export { mn as Action, Nt as DateTimeLocaleConfig, En as DfActions, Dn as DfCheckbox, Mn as DfColor, Nn as DfDateTime, Ln as DfFile, Un as DfImage, Wn as DfInput, Rr as DfInputComponentProps, Fr as DfInputComponents, Q as DfInputHint, $ as DfLabel, Dr as DfRtfEditor, Nr as DfSelect, Pr as DfTextArea, zr as DynamicFormsInputs, Pt as FileGoneError, It as HtmlString, rn as InputBase, $t as Label, Ft as MdString, Xt as MessagesWidget, Kt as RenderableValue, fn as ResponsiveActionRenderOptions, ln as ResponsiveRenderOptions, Ir as VuetifyComponents, an as actionDisplayStyles, en as defaultBaseProps, on as defaultDisplayStyle, Lr as dfInputComponentsByTag, Jt as errorText, un as getBreakpointName, pn as getRenderOptionsForBreakpoint, sn as isActionDisplayStyle, Gt as isCallableFunction, Rt as isRenderContent, Lt as isSimpleComponentDef, Ut as renderContentText, cn as responsiveBreakpoints, Zt as selectShownErrors, Cn as setFileGoneError, qt as toErrorDescription, bn as translate, _n as translateStrings, dn as useBreakpoint, Sn as useFileTouchKeepAlive, tn as useInputBase, Qt as useShownErrors, xn as useTranslate, Yt as vuetifyInputsSettingsKey };
|
|
4154
4112
|
|
|
4155
4113
|
//# sourceMappingURL=dynamicforms-vuetify-inputs.js.map
|