@melodicdev/components 1.2.4 → 1.3.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.
- package/assets/melodic-components.js +32 -7
- package/assets/melodic-components.js.map +1 -1
- package/assets/melodic-components.min.js +88 -64
- package/lib/components/forms/file-upload/file-icon.component.d.ts +12 -0
- package/lib/components/forms/file-upload/file-icon.component.d.ts.map +1 -0
- package/lib/components/forms/file-upload/file-icon.component.js +34 -0
- package/lib/components/forms/file-upload/file-icon.styles.d.ts +2 -0
- package/lib/components/forms/file-upload/file-icon.styles.d.ts.map +1 -0
- package/lib/components/forms/file-upload/file-icon.styles.js +124 -0
- package/lib/components/forms/file-upload/file-icon.template.d.ts +3 -0
- package/lib/components/forms/file-upload/file-icon.template.d.ts.map +1 -0
- package/lib/components/forms/file-upload/file-icon.template.js +18 -0
- package/lib/components/forms/file-upload/file-upload-item.component.d.ts +17 -0
- package/lib/components/forms/file-upload/file-upload-item.component.d.ts.map +1 -0
- package/lib/components/forms/file-upload/file-upload-item.component.js +52 -0
- package/lib/components/forms/file-upload/file-upload-item.styles.d.ts +2 -0
- package/lib/components/forms/file-upload/file-upload-item.styles.d.ts.map +1 -0
- package/lib/components/forms/file-upload/file-upload-item.styles.js +172 -0
- package/lib/components/forms/file-upload/file-upload-item.template.d.ts +3 -0
- package/lib/components/forms/file-upload/file-upload-item.template.d.ts.map +1 -0
- package/lib/components/forms/file-upload/file-upload-item.template.js +55 -0
- package/lib/components/forms/file-upload/file-upload.component.d.ts +24 -0
- package/lib/components/forms/file-upload/file-upload.component.d.ts.map +1 -0
- package/lib/components/forms/file-upload/file-upload.component.js +130 -0
- package/lib/components/forms/file-upload/file-upload.styles.d.ts +2 -0
- package/lib/components/forms/file-upload/file-upload.styles.d.ts.map +1 -0
- package/lib/components/forms/file-upload/file-upload.styles.js +125 -0
- package/lib/components/forms/file-upload/file-upload.template.d.ts +3 -0
- package/lib/components/forms/file-upload/file-upload.template.d.ts.map +1 -0
- package/lib/components/forms/file-upload/file-upload.template.js +51 -0
- package/lib/components/forms/file-upload/file-upload.types.d.ts +9 -0
- package/lib/components/forms/file-upload/file-upload.types.d.ts.map +1 -0
- package/lib/components/forms/file-upload/file-upload.types.js +40 -0
- package/lib/components/forms/file-upload/index.d.ts +6 -0
- package/lib/components/forms/file-upload/index.d.ts.map +1 -0
- package/lib/components/forms/file-upload/index.js +4 -0
- package/package.json +5 -1
|
@@ -4,7 +4,7 @@ function fs(e) {
|
|
|
4
4
|
t.params || (t.params = []), t.params[l] = { __injectionToken: O(e) };
|
|
5
5
|
};
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function ee(e = {}) {
|
|
8
8
|
return function(t) {
|
|
9
9
|
const r = e.token ?? t, l = e.dependencies?.map((a) => O(a));
|
|
10
10
|
L.bind(r, t, {
|
|
@@ -148,7 +148,7 @@ function H(e) {
|
|
|
148
148
|
});
|
|
149
149
|
};
|
|
150
150
|
}
|
|
151
|
-
function
|
|
151
|
+
function te(e) {
|
|
152
152
|
return Symbol(e);
|
|
153
153
|
}
|
|
154
154
|
async function _s(e = {}) {
|
|
@@ -369,7 +369,7 @@ function ys(e) {
|
|
|
369
369
|
};
|
|
370
370
|
return e.extends ? kr(e.extends, r) : r;
|
|
371
371
|
}
|
|
372
|
-
const rl =
|
|
372
|
+
const rl = te("APP_CONFIG");
|
|
373
373
|
function xs(e) {
|
|
374
374
|
return (t) => {
|
|
375
375
|
t.bindValue(rl, e);
|
|
@@ -852,7 +852,7 @@ var xe = class {
|
|
|
852
852
|
return this._resolvedData.get(t);
|
|
853
853
|
}
|
|
854
854
|
};
|
|
855
|
-
xe = g([
|
|
855
|
+
xe = g([ee()], xe);
|
|
856
856
|
function j(e, t) {
|
|
857
857
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
|
|
858
858
|
}
|
|
@@ -1102,7 +1102,7 @@ var V = class {
|
|
|
1102
1102
|
};
|
|
1103
1103
|
}
|
|
1104
1104
|
};
|
|
1105
|
-
V = g([
|
|
1105
|
+
V = g([ee(), j("design:paramtypes", [])], V);
|
|
1106
1106
|
var W = /* @__PURE__ */ new Map(), Tr = (e) => {
|
|
1107
1107
|
if (W.has(e)) return W.get(e);
|
|
1108
1108
|
const t = e.toLowerCase();
|
|
@@ -1123,15 +1123,15 @@ function zs(e) {
|
|
|
1123
1123
|
function As() {
|
|
1124
1124
|
return Array.from(W.keys());
|
|
1125
1125
|
}
|
|
1126
|
-
function
|
|
1126
|
+
function Y(e) {
|
|
1127
1127
|
return typeof e == "object" && e !== null && "__directive" in e;
|
|
1128
1128
|
}
|
|
1129
|
-
var pe = `m${Math.random().toString(36).slice(2, 9)}`, ul = `<!--${pe}-->`, Ie = `__${pe}_`, He = new RegExp(`${Ie}(\\d+)__`, "g"), ie = (e) => `${Ie}${e}__`,
|
|
1129
|
+
var pe = `m${Math.random().toString(36).slice(2, 9)}`, ul = `<!--${pe}-->`, Ie = `__${pe}_`, He = new RegExp(`${Ie}(\\d+)__`, "g"), ie = (e) => `${Ie}${e}__`, X = /* @__PURE__ */ new Map(), Ke = /* @__PURE__ */ new WeakMap();
|
|
1130
1130
|
function be(e) {
|
|
1131
1131
|
let t = Ke.get(e);
|
|
1132
1132
|
return t === void 0 && (t = e.join(pe), Ke.set(e, t)), t;
|
|
1133
1133
|
}
|
|
1134
|
-
var hl = class
|
|
1134
|
+
var hl = class J {
|
|
1135
1135
|
constructor(t, r) {
|
|
1136
1136
|
this.strings = t, this.values = r;
|
|
1137
1137
|
}
|
|
@@ -1159,7 +1159,7 @@ var hl = class X {
|
|
|
1159
1159
|
this.commit(o);
|
|
1160
1160
|
}
|
|
1161
1161
|
getTemplate(t) {
|
|
1162
|
-
let r =
|
|
1162
|
+
let r = X.get(t);
|
|
1163
1163
|
if (r) return r;
|
|
1164
1164
|
const l = [];
|
|
1165
1165
|
let a = this.strings[0];
|
|
@@ -1289,11 +1289,11 @@ var hl = class X {
|
|
|
1289
1289
|
element: c,
|
|
1290
1290
|
parts: l,
|
|
1291
1291
|
partPaths: m
|
|
1292
|
-
},
|
|
1293
|
-
const w =
|
|
1294
|
-
w &&
|
|
1292
|
+
}, X.size >= 500) {
|
|
1293
|
+
const w = X.keys().next().value;
|
|
1294
|
+
w && X.delete(w);
|
|
1295
1295
|
}
|
|
1296
|
-
return
|
|
1296
|
+
return X.set(t, r), r;
|
|
1297
1297
|
}
|
|
1298
1298
|
getAttributePreProcessor(t) {
|
|
1299
1299
|
return {
|
|
@@ -1412,6 +1412,27 @@ var hl = class X {
|
|
|
1412
1412
|
t.renderedNodes = [], t.arrayState = void 0, t.nestedContainer = void 0;
|
|
1413
1413
|
}
|
|
1414
1414
|
}
|
|
1415
|
+
/**
|
|
1416
|
+
* Clears DOM nodes created by a directive (e.g. repeat, when) when
|
|
1417
|
+
* switching away from a directive to a different renderable type.
|
|
1418
|
+
* Removes all nodes between the directive's markers and restores
|
|
1419
|
+
* part.node into the DOM so non-directive rendering can proceed.
|
|
1420
|
+
*/
|
|
1421
|
+
clearDirectiveDOM(t) {
|
|
1422
|
+
const r = t.directiveState;
|
|
1423
|
+
if (!r) return;
|
|
1424
|
+
const l = r.startMarker, a = r.endMarker;
|
|
1425
|
+
if (l && a && l.parentNode) {
|
|
1426
|
+
const o = l.parentNode;
|
|
1427
|
+
let s = l.nextSibling;
|
|
1428
|
+
for (; s && s !== a; ) {
|
|
1429
|
+
const n = s.nextSibling;
|
|
1430
|
+
o.removeChild(s), s = n;
|
|
1431
|
+
}
|
|
1432
|
+
t.node && o.insertBefore(t.node, a), o.removeChild(l), o.removeChild(a);
|
|
1433
|
+
}
|
|
1434
|
+
t.directiveState = void 0;
|
|
1435
|
+
}
|
|
1415
1436
|
cleanupParts(t) {
|
|
1416
1437
|
for (const r of t) {
|
|
1417
1438
|
if (r.actionCleanup) try {
|
|
@@ -1498,7 +1519,7 @@ var hl = class X {
|
|
|
1498
1519
|
}
|
|
1499
1520
|
this.clearRenderedNodes(t);
|
|
1500
1521
|
const o = [];
|
|
1501
|
-
for (const s of r) if (s instanceof
|
|
1522
|
+
for (const s of r) if (s instanceof J) {
|
|
1502
1523
|
const n = document.createDocumentFragment();
|
|
1503
1524
|
s.renderInto(n);
|
|
1504
1525
|
const c = Array.from(n.childNodes);
|
|
@@ -1525,7 +1546,7 @@ var hl = class X {
|
|
|
1525
1546
|
}
|
|
1526
1547
|
createArrayItem(t, r, l) {
|
|
1527
1548
|
const a = document.createDocumentFragment();
|
|
1528
|
-
t instanceof
|
|
1549
|
+
t instanceof J ? t.renderInto(a) : t instanceof Node ? a.appendChild(t) : t != null && a.appendChild(document.createTextNode(String(t)));
|
|
1529
1550
|
const o = Array.from(a.childNodes);
|
|
1530
1551
|
return r.insertBefore(a, l), {
|
|
1531
1552
|
container: a,
|
|
@@ -1533,7 +1554,7 @@ var hl = class X {
|
|
|
1533
1554
|
};
|
|
1534
1555
|
}
|
|
1535
1556
|
updateArrayItem(t, r, l, a) {
|
|
1536
|
-
if (r instanceof
|
|
1557
|
+
if (r instanceof J) {
|
|
1537
1558
|
r.renderInto(t.container), t.value = r, t.nodes = Array.from(t.container.childNodes);
|
|
1538
1559
|
return;
|
|
1539
1560
|
}
|
|
@@ -1545,15 +1566,18 @@ var hl = class X {
|
|
|
1545
1566
|
commit(t) {
|
|
1546
1567
|
for (const r of t) {
|
|
1547
1568
|
const l = this.values[r.index], a = r.type === "attribute" && r.attributeIndices && r.attributeStrings;
|
|
1548
|
-
if (!(!a && !
|
|
1569
|
+
if (!(!a && !Y(l) && r.type !== "action" && r.previousValue === l)) {
|
|
1549
1570
|
switch (r.type) {
|
|
1550
1571
|
case "node":
|
|
1551
|
-
|
|
1572
|
+
if (r.node) {
|
|
1573
|
+
const o = Y(r.previousValue), s = Y(l);
|
|
1574
|
+
o && !s && r.directiveState && this.clearDirectiveDOM(r), !o && s && this.clearRenderedNodes(r), s ? r.directiveState = l.render(r.node, r.directiveState) : l instanceof J ? this.renderNestedTemplate(r, l) : l instanceof Node ? this.renderNode(r, l) : Array.isArray(l) ? this.renderArray(r, l) : (this.clearRenderedNodes(r), r.node.textContent = String(l ?? ""));
|
|
1575
|
+
}
|
|
1552
1576
|
break;
|
|
1553
1577
|
case "attribute":
|
|
1554
1578
|
if (r.node && r.name) {
|
|
1555
1579
|
const o = r.node;
|
|
1556
|
-
if (
|
|
1580
|
+
if (Y(l)) r.directiveState = l.render(o, r.directiveState);
|
|
1557
1581
|
else if (a) {
|
|
1558
1582
|
const s = r.attributeStrings, n = r.attributeIndices;
|
|
1559
1583
|
let c = s[0] ?? "";
|
|
@@ -1574,7 +1598,7 @@ var hl = class X {
|
|
|
1574
1598
|
}
|
|
1575
1599
|
break;
|
|
1576
1600
|
case "property":
|
|
1577
|
-
r.node && r.name && (
|
|
1601
|
+
r.node && r.name && (Y(l) ? r.directiveState = l.render(r.node, r.directiveState) : r.node[r.name] = l);
|
|
1578
1602
|
break;
|
|
1579
1603
|
case "event":
|
|
1580
1604
|
if (r.node && r.name) {
|
|
@@ -2006,7 +2030,7 @@ const Ns = (e) => {
|
|
|
2006
2030
|
}, Ls = (e, t) => ({
|
|
2007
2031
|
action: e(),
|
|
2008
2032
|
reducer: t
|
|
2009
|
-
}), $e =
|
|
2033
|
+
}), $e = te("RX_INIT_STATE"), Ce = te("RX_ACTION_PROVIDERS"), Se = te("RX_EFFECTS_PROVIDERS"), Ir = te("RX_STATE_DEBUG");
|
|
2010
2034
|
var vl = class {
|
|
2011
2035
|
constructor() {
|
|
2012
2036
|
this._effects = [];
|
|
@@ -2133,7 +2157,7 @@ g([H($e), j("design:type", Object)], F.prototype, "_state", void 0);
|
|
|
2133
2157
|
g([H(Ce), j("design:type", Object)], F.prototype, "_reducerMap", void 0);
|
|
2134
2158
|
g([H(Se), j("design:type", Object)], F.prototype, "_effectMap", void 0);
|
|
2135
2159
|
g([H(Ir), j("design:type", Boolean)], F.prototype, "_debug", void 0);
|
|
2136
|
-
F = g([
|
|
2160
|
+
F = g([ee(), j("design:paramtypes", [])], F);
|
|
2137
2161
|
function Fs(e, t, r, l = !1) {
|
|
2138
2162
|
return (a) => {
|
|
2139
2163
|
a.bindValue($e, e), a.bindValue(Ce, t), a.bindValue(Se, r), a.bindValue(Ir, l), a.bind(F, F, { dependencies: [
|
|
@@ -3481,7 +3505,7 @@ function Wl(e, t, r) {
|
|
|
3481
3505
|
y: s
|
|
3482
3506
|
};
|
|
3483
3507
|
}
|
|
3484
|
-
function
|
|
3508
|
+
function re(e, t, r = {}) {
|
|
3485
3509
|
const { placement: l = "bottom", middleware: a = [] } = r, o = e.getBoundingClientRect(), s = t.getBoundingClientRect(), { x: n, y: c } = Wl(o, s, l);
|
|
3486
3510
|
let m = {
|
|
3487
3511
|
x: n,
|
|
@@ -3567,7 +3591,7 @@ function Me(e, t, r, l = {}) {
|
|
|
3567
3591
|
c.forEach((m) => m());
|
|
3568
3592
|
};
|
|
3569
3593
|
}
|
|
3570
|
-
function
|
|
3594
|
+
function le(e = 0) {
|
|
3571
3595
|
const t = typeof e == "number" ? e : e.mainAxis ?? 0, r = typeof e == "number" ? 0 : e.crossAxis ?? 0;
|
|
3572
3596
|
return {
|
|
3573
3597
|
name: "offset",
|
|
@@ -3623,7 +3647,7 @@ function rt(e, t) {
|
|
|
3623
3647
|
return !1;
|
|
3624
3648
|
}
|
|
3625
3649
|
}
|
|
3626
|
-
function
|
|
3650
|
+
function ae(e = {}) {
|
|
3627
3651
|
const { padding: t = 0 } = e;
|
|
3628
3652
|
return {
|
|
3629
3653
|
name: "flip",
|
|
@@ -3686,7 +3710,7 @@ function Yl(e, t, r) {
|
|
|
3686
3710
|
y: s
|
|
3687
3711
|
};
|
|
3688
3712
|
}
|
|
3689
|
-
function
|
|
3713
|
+
function oe(e = {}) {
|
|
3690
3714
|
const { padding: t = 0, mainAxis: r = !0, crossAxis: l = !0 } = e;
|
|
3691
3715
|
return {
|
|
3692
3716
|
name: "shift",
|
|
@@ -3804,23 +3828,23 @@ function nn(e, t) {
|
|
|
3804
3828
|
const r = Ql(e, t);
|
|
3805
3829
|
return r.activate(), () => r.deactivate();
|
|
3806
3830
|
}
|
|
3807
|
-
var
|
|
3831
|
+
var Q = !1, lt = !1;
|
|
3808
3832
|
function Vr() {
|
|
3809
3833
|
lt || (lt = !0, document.addEventListener("keydown", () => {
|
|
3810
|
-
|
|
3834
|
+
Q = !0;
|
|
3811
3835
|
}, !0), document.addEventListener("mousedown", () => {
|
|
3812
|
-
|
|
3836
|
+
Q = !1;
|
|
3813
3837
|
}, !0), document.addEventListener("pointerdown", () => {
|
|
3814
|
-
|
|
3838
|
+
Q = !1;
|
|
3815
3839
|
}, !0));
|
|
3816
3840
|
}
|
|
3817
3841
|
function dn() {
|
|
3818
|
-
return Vr(),
|
|
3842
|
+
return Vr(), Q;
|
|
3819
3843
|
}
|
|
3820
3844
|
function cn(e, t = "focus-visible") {
|
|
3821
3845
|
Vr();
|
|
3822
3846
|
function r() {
|
|
3823
|
-
|
|
3847
|
+
Q && e.classList.add(t);
|
|
3824
3848
|
}
|
|
3825
3849
|
function l() {
|
|
3826
3850
|
e.classList.remove(t);
|
|
@@ -6663,12 +6687,12 @@ var gt = class {
|
|
|
6663
6687
|
const t = this.elementRef.shadowRoot?.querySelector(".ml-select__trigger"), r = this.getDropdownEl();
|
|
6664
6688
|
if (!t || !r) return;
|
|
6665
6689
|
r.style.width = `${t.offsetWidth}px`;
|
|
6666
|
-
const { x: l, y: a } =
|
|
6690
|
+
const { x: l, y: a } = re(t, r, {
|
|
6667
6691
|
placement: "bottom-start",
|
|
6668
6692
|
middleware: [
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
|
|
6693
|
+
le(4),
|
|
6694
|
+
ae(),
|
|
6695
|
+
oe({ padding: 8 })
|
|
6672
6696
|
]
|
|
6673
6697
|
});
|
|
6674
6698
|
r.style.left = `${l}px`, r.style.top = `${a}px`;
|
|
@@ -7944,12 +7968,12 @@ var xt = class {
|
|
|
7944
7968
|
this._cleanupAutoUpdate?.(), this._cleanupAutoUpdate = Me(t, r, l);
|
|
7945
7969
|
}
|
|
7946
7970
|
updatePosition(t, r) {
|
|
7947
|
-
const { x: l, y: a } =
|
|
7971
|
+
const { x: l, y: a } = re(t, r, {
|
|
7948
7972
|
placement: "bottom-start",
|
|
7949
7973
|
middleware: [
|
|
7950
|
-
|
|
7951
|
-
|
|
7952
|
-
|
|
7974
|
+
le(4),
|
|
7975
|
+
ae(),
|
|
7976
|
+
oe({ padding: 8 })
|
|
7953
7977
|
]
|
|
7954
7978
|
});
|
|
7955
7979
|
r.style.left = `${l}px`, r.style.top = `${a}px`;
|
|
@@ -8199,7 +8223,7 @@ var kt = class {
|
|
|
8199
8223
|
return this._containerEl && document.body.contains(this._containerEl) ? this._containerEl : (this._containerEl = document.createElement("ml-toast-container"), this._containerEl.setAttribute("position", this._position), document.body.appendChild(this._containerEl), this._containerEl);
|
|
8200
8224
|
}
|
|
8201
8225
|
};
|
|
8202
|
-
kt = g([
|
|
8226
|
+
kt = g([ee()], kt);
|
|
8203
8227
|
function Wa(e) {
|
|
8204
8228
|
return i`
|
|
8205
8229
|
<div
|
|
@@ -16772,7 +16796,7 @@ var Ki = class {
|
|
|
16772
16796
|
onBackdropClick(e) {
|
|
16773
16797
|
e.target === this._dialogEl && !this._disableClose && this.close();
|
|
16774
16798
|
}
|
|
16775
|
-
},
|
|
16799
|
+
}, Z = class {
|
|
16776
16800
|
constructor() {
|
|
16777
16801
|
this._dialogs = /* @__PURE__ */ new Map();
|
|
16778
16802
|
}
|
|
@@ -16811,7 +16835,7 @@ var Ki = class {
|
|
|
16811
16835
|
t.remove();
|
|
16812
16836
|
}
|
|
16813
16837
|
};
|
|
16814
|
-
|
|
16838
|
+
Z = g([ee()], Z);
|
|
16815
16839
|
var nr, Te = class {
|
|
16816
16840
|
constructor() {
|
|
16817
16841
|
this._dialogID = ea(), this._registered = !1;
|
|
@@ -16837,7 +16861,7 @@ var nr, Te = class {
|
|
|
16837
16861
|
return this.elementRef.getAttributeNames().find((t) => t.startsWith("#"))?.slice(1) ?? this._dialogID;
|
|
16838
16862
|
}
|
|
16839
16863
|
};
|
|
16840
|
-
g([H(
|
|
16864
|
+
g([H(Z), j("design:type", typeof (nr = typeof Z < "u" && Z) == "function" ? nr : Object)], Te.prototype, "_dialogService", void 0);
|
|
16841
16865
|
Te = g([_({
|
|
16842
16866
|
selector: "ml-dialog",
|
|
16843
16867
|
template: Bi,
|
|
@@ -17356,15 +17380,15 @@ var cr = class {
|
|
|
17356
17380
|
}
|
|
17357
17381
|
updatePosition(t, r) {
|
|
17358
17382
|
const l = this.arrow ? this.elementRef.shadowRoot?.querySelector(".ml-dropdown__arrow") : null, a = [
|
|
17359
|
-
|
|
17360
|
-
|
|
17361
|
-
|
|
17383
|
+
le(this.offset),
|
|
17384
|
+
ae(),
|
|
17385
|
+
oe({ padding: 8 })
|
|
17362
17386
|
];
|
|
17363
17387
|
l && a.push(Nr({
|
|
17364
17388
|
element: l,
|
|
17365
17389
|
padding: 8
|
|
17366
17390
|
}));
|
|
17367
|
-
const { x: o, y: s, placement: n, middlewareData: c } =
|
|
17391
|
+
const { x: o, y: s, placement: n, middlewareData: c } = re(t, r, {
|
|
17368
17392
|
placement: this.placement,
|
|
17369
17393
|
middleware: a
|
|
17370
17394
|
});
|
|
@@ -17668,12 +17692,12 @@ var pr = class {
|
|
|
17668
17692
|
updatePosition() {
|
|
17669
17693
|
const t = this.elementRef.shadowRoot?.querySelector(".ml-tooltip__trigger"), r = this.elementRef.shadowRoot?.querySelector(".ml-tooltip__content"), l = this.elementRef.shadowRoot?.querySelector(".ml-tooltip__arrow");
|
|
17670
17694
|
if (!t || !r) return;
|
|
17671
|
-
const { x: a, y: o, placement: s } =
|
|
17695
|
+
const { x: a, y: o, placement: s } = re(t, r, {
|
|
17672
17696
|
placement: this.placement,
|
|
17673
17697
|
middleware: [
|
|
17674
|
-
|
|
17675
|
-
|
|
17676
|
-
|
|
17698
|
+
le(8),
|
|
17699
|
+
ae(),
|
|
17700
|
+
oe({ padding: 8 })
|
|
17677
17701
|
]
|
|
17678
17702
|
});
|
|
17679
17703
|
if (r.style.left = `${a}px`, r.style.top = `${o}px`, r.setAttribute("data-placement", s), l) {
|
|
@@ -17824,15 +17848,15 @@ var vr = class {
|
|
|
17824
17848
|
}
|
|
17825
17849
|
updatePosition(t, r) {
|
|
17826
17850
|
const l = this.arrow ? this.elementRef.shadowRoot?.querySelector(".ml-popover__arrow") : null, a = [
|
|
17827
|
-
|
|
17828
|
-
|
|
17829
|
-
|
|
17851
|
+
le(this.offset),
|
|
17852
|
+
ae(),
|
|
17853
|
+
oe({ padding: 8 })
|
|
17830
17854
|
];
|
|
17831
17855
|
l && a.push(Nr({
|
|
17832
17856
|
element: l,
|
|
17833
17857
|
padding: 8
|
|
17834
17858
|
}));
|
|
17835
|
-
const { x: o, y: s, placement: n, middlewareData: c } =
|
|
17859
|
+
const { x: o, y: s, placement: n, middlewareData: c } = re(t, r, {
|
|
17836
17860
|
placement: this.placement,
|
|
17837
17861
|
middleware: a
|
|
17838
17862
|
});
|
|
@@ -19253,7 +19277,7 @@ export {
|
|
|
19253
19277
|
xt as DatePickerComponent,
|
|
19254
19278
|
Te as DialogComponent,
|
|
19255
19279
|
Ki as DialogRef,
|
|
19256
|
-
|
|
19280
|
+
Z as DialogService,
|
|
19257
19281
|
Hs as Directive,
|
|
19258
19282
|
Rt as DividerComponent,
|
|
19259
19283
|
dr as DrawerComponent,
|
|
@@ -19273,7 +19297,7 @@ export {
|
|
|
19273
19297
|
qe as HttpError,
|
|
19274
19298
|
Ut as IconComponent,
|
|
19275
19299
|
fs as Inject,
|
|
19276
|
-
|
|
19300
|
+
ee as Injectable,
|
|
19277
19301
|
Gr as InjectionEngine,
|
|
19278
19302
|
L as Injector,
|
|
19279
19303
|
nt as InputComponent,
|
|
@@ -19358,7 +19382,7 @@ export {
|
|
|
19358
19382
|
gn as clickOutside,
|
|
19359
19383
|
Ml as colorTokens,
|
|
19360
19384
|
vn as componentBaseStyles,
|
|
19361
|
-
|
|
19385
|
+
re as computePosition,
|
|
19362
19386
|
z as computed,
|
|
19363
19387
|
no as containerStyles,
|
|
19364
19388
|
so as containerTemplate,
|
|
@@ -19375,7 +19399,7 @@ export {
|
|
|
19375
19399
|
Cs as createResolver,
|
|
19376
19400
|
Ns as createState,
|
|
19377
19401
|
Or as createTheme,
|
|
19378
|
-
|
|
19402
|
+
te as createToken,
|
|
19379
19403
|
Us as createValidator,
|
|
19380
19404
|
y as css,
|
|
19381
19405
|
et as darkTheme,
|
|
@@ -19396,7 +19420,7 @@ export {
|
|
|
19396
19420
|
Ui as dropdownTemplate,
|
|
19397
19421
|
tl as environment,
|
|
19398
19422
|
sl as findRouteByName,
|
|
19399
|
-
|
|
19423
|
+
ae as flip,
|
|
19400
19424
|
on as focusFirst,
|
|
19401
19425
|
sn as focusLast,
|
|
19402
19426
|
nn as focusTrap,
|
|
@@ -19419,7 +19443,7 @@ export {
|
|
|
19419
19443
|
ns as heroSectionTemplate,
|
|
19420
19444
|
i as html,
|
|
19421
19445
|
ln as injectTheme,
|
|
19422
|
-
|
|
19446
|
+
Y as isDirective,
|
|
19423
19447
|
dn as isFocusVisible,
|
|
19424
19448
|
Ur as isSignal,
|
|
19425
19449
|
Bl as lightTheme,
|
|
@@ -19432,7 +19456,7 @@ export {
|
|
|
19432
19456
|
us as loginPageTemplate,
|
|
19433
19457
|
ye as matchRouteTree,
|
|
19434
19458
|
ea as newID,
|
|
19435
|
-
|
|
19459
|
+
le as offset,
|
|
19436
19460
|
Ls as onAction,
|
|
19437
19461
|
tn as onThemeChange,
|
|
19438
19462
|
ms as pageHeaderStyles,
|
|
@@ -19457,7 +19481,7 @@ export {
|
|
|
19457
19481
|
Ea as selectTemplate,
|
|
19458
19482
|
Ye as setActiveEffect,
|
|
19459
19483
|
Nl as shadowTokens,
|
|
19460
|
-
|
|
19484
|
+
oe as shift,
|
|
19461
19485
|
ki as sidebarGroupStyles,
|
|
19462
19486
|
wi as sidebarGroupTemplate,
|
|
19463
19487
|
Ci as sidebarItemStyles,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IElementRef } from '@melodicdev/core';
|
|
2
|
+
import type { Size } from '../../../types/index.js';
|
|
3
|
+
import type { FileIconColor } from './file-upload.types.js';
|
|
4
|
+
export declare class FileIconComponent implements IElementRef {
|
|
5
|
+
elementRef: HTMLElement;
|
|
6
|
+
extension: string;
|
|
7
|
+
color: FileIconColor | '';
|
|
8
|
+
size: Size;
|
|
9
|
+
get resolvedColor(): FileIconColor;
|
|
10
|
+
get displayExtension(): string;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=file-icon.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-icon.component.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/file-upload/file-icon.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAK5D,qBAMa,iBAAkB,YAAW,WAAW;IACpD,UAAU,EAAG,WAAW,CAAC;IAEzB,SAAS,SAAM;IACf,KAAK,EAAE,aAAa,GAAG,EAAE,CAAM;IAC/B,IAAI,EAAE,IAAI,CAAQ;IAElB,IAAI,aAAa,IAAI,aAAa,CAGjC;IAED,IAAI,gBAAgB,IAAI,MAAM,CAE7B;CACD"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { MelodicComponent } from '@melodicdev/core';
|
|
8
|
+
import { getColorForExtension } from './file-upload.types.js';
|
|
9
|
+
import { fileIconTemplate } from './file-icon.template.js';
|
|
10
|
+
import { fileIconStyles } from './file-icon.styles.js';
|
|
11
|
+
let FileIconComponent = class FileIconComponent {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.extension = '';
|
|
14
|
+
this.color = '';
|
|
15
|
+
this.size = 'md';
|
|
16
|
+
}
|
|
17
|
+
get resolvedColor() {
|
|
18
|
+
if (this.color)
|
|
19
|
+
return this.color;
|
|
20
|
+
return this.extension ? getColorForExtension(this.extension) : 'gray';
|
|
21
|
+
}
|
|
22
|
+
get displayExtension() {
|
|
23
|
+
return this.extension.toUpperCase();
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
FileIconComponent = __decorate([
|
|
27
|
+
MelodicComponent({
|
|
28
|
+
selector: 'ml-file-icon',
|
|
29
|
+
template: fileIconTemplate,
|
|
30
|
+
styles: fileIconStyles,
|
|
31
|
+
attributes: ['extension', 'color', 'size']
|
|
32
|
+
})
|
|
33
|
+
], FileIconComponent);
|
|
34
|
+
export { FileIconComponent };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-icon.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/file-upload/file-icon.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,iDA0H1B,CAAC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { css } from '@melodicdev/core';
|
|
2
|
+
export const fileIconStyles = () => css `
|
|
3
|
+
:host {
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.ml-file-icon {
|
|
8
|
+
position: relative;
|
|
9
|
+
display: inline-flex;
|
|
10
|
+
flex-shrink: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.ml-file-icon__svg {
|
|
14
|
+
display: block;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.ml-file-icon__body {
|
|
18
|
+
fill: var(--ml-color-surface);
|
|
19
|
+
stroke: var(--ml-color-border);
|
|
20
|
+
stroke-width: 1;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.ml-file-icon__fold {
|
|
24
|
+
fill: var(--ml-color-border);
|
|
25
|
+
opacity: 0.6;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.ml-file-icon__badge {
|
|
29
|
+
position: absolute;
|
|
30
|
+
bottom: 4px;
|
|
31
|
+
left: 50%;
|
|
32
|
+
transform: translateX(-50%);
|
|
33
|
+
font-size: 8px;
|
|
34
|
+
font-weight: var(--ml-font-bold, 700);
|
|
35
|
+
font-family: var(--ml-font-sans);
|
|
36
|
+
letter-spacing: 0.02em;
|
|
37
|
+
line-height: 1;
|
|
38
|
+
padding: 2px 4px;
|
|
39
|
+
border-radius: var(--ml-radius-xs);
|
|
40
|
+
color: white;
|
|
41
|
+
white-space: nowrap;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Sizes */
|
|
45
|
+
.ml-file-icon--sm .ml-file-icon__svg {
|
|
46
|
+
width: 24px;
|
|
47
|
+
height: 28px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.ml-file-icon--sm .ml-file-icon__badge {
|
|
51
|
+
font-size: 6px;
|
|
52
|
+
padding: 1px 3px;
|
|
53
|
+
bottom: 2px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.ml-file-icon--md .ml-file-icon__svg {
|
|
57
|
+
width: 32px;
|
|
58
|
+
height: 38px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.ml-file-icon--md .ml-file-icon__badge {
|
|
62
|
+
font-size: 7px;
|
|
63
|
+
padding: 2px 4px;
|
|
64
|
+
bottom: 3px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.ml-file-icon--lg .ml-file-icon__svg {
|
|
68
|
+
width: 40px;
|
|
69
|
+
height: 48px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.ml-file-icon--lg .ml-file-icon__badge {
|
|
73
|
+
font-size: 8px;
|
|
74
|
+
padding: 2px 5px;
|
|
75
|
+
bottom: 4px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.ml-file-icon--xs .ml-file-icon__svg {
|
|
79
|
+
width: 20px;
|
|
80
|
+
height: 24px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.ml-file-icon--xs .ml-file-icon__badge {
|
|
84
|
+
font-size: 5px;
|
|
85
|
+
padding: 1px 2px;
|
|
86
|
+
bottom: 2px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.ml-file-icon--xl .ml-file-icon__svg {
|
|
90
|
+
width: 48px;
|
|
91
|
+
height: 58px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.ml-file-icon--xl .ml-file-icon__badge {
|
|
95
|
+
font-size: 10px;
|
|
96
|
+
padding: 2px 6px;
|
|
97
|
+
bottom: 6px;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* Color variants */
|
|
101
|
+
.ml-file-icon--red .ml-file-icon__badge {
|
|
102
|
+
background-color: var(--ml-color-danger);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.ml-file-icon--green .ml-file-icon__badge {
|
|
106
|
+
background-color: var(--ml-color-success);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.ml-file-icon--blue .ml-file-icon__badge {
|
|
110
|
+
background-color: var(--ml-color-primary);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.ml-file-icon--purple .ml-file-icon__badge {
|
|
114
|
+
background-color: var(--ml-purple-600, #7c3aed);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.ml-file-icon--amber .ml-file-icon__badge {
|
|
118
|
+
background-color: var(--ml-color-warning);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.ml-file-icon--gray .ml-file-icon__badge {
|
|
122
|
+
background-color: var(--ml-color-text-muted);
|
|
123
|
+
}
|
|
124
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-icon.template.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/file-upload/file-icon.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,iBAAiB,6CAmBpD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { html, classMap, when } from '@melodicdev/core';
|
|
2
|
+
export function fileIconTemplate(c) {
|
|
3
|
+
return html `
|
|
4
|
+
<div class=${classMap({
|
|
5
|
+
'ml-file-icon': true,
|
|
6
|
+
[`ml-file-icon--${c.size}`]: true,
|
|
7
|
+
[`ml-file-icon--${c.resolvedColor}`]: true
|
|
8
|
+
})}>
|
|
9
|
+
<svg viewBox="0 0 40 48" fill="none" class="ml-file-icon__svg">
|
|
10
|
+
<!-- Document body -->
|
|
11
|
+
<path d="M0 4C0 1.79 1.79 0 4 0H24L40 16V44C40 46.21 38.21 48 36 48H4C1.79 48 0 46.21 0 44V4Z" class="ml-file-icon__body" />
|
|
12
|
+
<!-- Folded corner -->
|
|
13
|
+
<path d="M24 0L40 16H28C25.79 16 24 14.21 24 12V0Z" class="ml-file-icon__fold" />
|
|
14
|
+
</svg>
|
|
15
|
+
${when(!!c.extension, () => html `<span class="ml-file-icon__badge">${c.displayExtension}</span>`)}
|
|
16
|
+
</div>
|
|
17
|
+
`;
|
|
18
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IElementRef } from '@melodicdev/core';
|
|
2
|
+
import type { FileUploadStatus } from './file-upload.types.js';
|
|
3
|
+
export declare class FileUploadItemComponent implements IElementRef {
|
|
4
|
+
elementRef: HTMLElement;
|
|
5
|
+
name: string;
|
|
6
|
+
size: string;
|
|
7
|
+
status: FileUploadStatus;
|
|
8
|
+
progress: number;
|
|
9
|
+
error: string;
|
|
10
|
+
file: File | null;
|
|
11
|
+
get extension(): string;
|
|
12
|
+
get displayProgress(): string;
|
|
13
|
+
get progressWidth(): number;
|
|
14
|
+
handleRemove: () => void;
|
|
15
|
+
handleRetry: () => void;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=file-upload-item.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-upload-item.component.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/file-upload/file-upload-item.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAI/D,qBAMa,uBAAwB,YAAW,WAAW;IAC1D,UAAU,EAAG,WAAW,CAAC;IAEzB,IAAI,SAAM;IACV,IAAI,SAAM;IACV,MAAM,EAAE,gBAAgB,CAAU;IAClC,QAAQ,SAAK;IACb,KAAK,SAAM;IACX,IAAI,EAAE,IAAI,GAAG,IAAI,CAAQ;IAEzB,IAAI,SAAS,IAAI,MAAM,CAGtB;IAED,IAAI,eAAe,IAAI,MAAM,CAE5B;IAED,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED,YAAY,QAAO,IAAI,CAQrB;IAEF,WAAW,QAAO,IAAI,CAQpB;CACF"}
|