@golemui/gui-lit 1.0.1 → 1.0.2
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/CHANGELOG.md +4 -0
- package/{currency.element-YyL4TeL0.js → currency.element-BHXWcOEu.js} +57 -54
- package/index.js +4 -4
- package/index.umd.cjs +24 -23
- package/{markdown.element-CNp4wbg9.js → markdown.element-p-kC47D7.js} +22 -21
- package/{number.element-B6TsvHMK.js → number.element-BhEyoOtc.js} +6 -6
- package/package.json +6 -6
- package/{textarea.element-Cu9ZW3K4.js → textarea.element-HThYqdR_.js} +5 -4
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { InputWidgetAdapter as S, formContext as V, inputContext as
|
|
1
|
+
import { InputWidgetAdapter as S, formContext as V, inputContext as _ } from "@golemui/lit";
|
|
2
2
|
import { LitElement as L, html as u, nothing as $ } from "lit";
|
|
3
|
-
import { property as l, state as A, customElement as
|
|
3
|
+
import { property as l, state as A, customElement as O } from "lit/decorators.js";
|
|
4
4
|
import { classMap as y } from "lit/directives/class-map.js";
|
|
5
|
-
import { G as
|
|
5
|
+
import { G as T, b as I, c as M } from "./templates-Dk1jxLwS.js";
|
|
6
6
|
import { styleMap as H } from "lit-html/directives/style-map.js";
|
|
7
7
|
import { ifDefined as x } from "lit/directives/if-defined.js";
|
|
8
8
|
import "./markdown-text-X-BRJT6K.js";
|
|
@@ -15,7 +15,7 @@ var Z = Object.defineProperty, D = Object.getOwnPropertyDescriptor, r = (t, e, i
|
|
|
15
15
|
};
|
|
16
16
|
let o = class extends L {
|
|
17
17
|
constructor() {
|
|
18
|
-
super(...arguments), this.uid = void 0, this.label = void 0, this.localeId = "en", this.errors = [], this.touched = !1, this.required = !1, this.disabled = !1, this.readOnly = !1, this.value = void 0, this.hint = void 0, this.tools = void 0, this.placeholder = void 0, this.autocomplete = void 0, this.minimumHeight = void 0, this.autoGrow = !1, this.defaultOpenPreview = void 0, this.maxLength = void 0, this.headingTitle = void 0, this.boldTitle = void 0, this.italicTitle = void 0, this.strikethroughTitle = void 0, this.quoteTitle = void 0, this.linkTitle = void 0, this.orderedListTitle = void 0, this.unorderedListTitle = void 0, this.splitViewTitle = void 0, this.dependencies = void 0, this.splitViewActive = !1, this.activeFormats = {}, this.splitViewInitialized = !1, this.ariaController = new
|
|
18
|
+
super(...arguments), this.uid = void 0, this.label = void 0, this.localeId = "en", this.errors = [], this.touched = !1, this.required = !1, this.disabled = !1, this.readOnly = !1, this.value = void 0, this.hint = void 0, this.tools = void 0, this.placeholder = void 0, this.autocomplete = void 0, this.minimumHeight = void 0, this.autoGrow = !1, this.defaultOpenPreview = void 0, this.maxLength = void 0, this.headingTitle = void 0, this.boldTitle = void 0, this.italicTitle = void 0, this.strikethroughTitle = void 0, this.quoteTitle = void 0, this.linkTitle = void 0, this.orderedListTitle = void 0, this.unorderedListTitle = void 0, this.splitViewTitle = void 0, this.dependencies = void 0, this.splitViewActive = !1, this.activeFormats = {}, this.splitViewInitialized = !1, this.ariaController = new T(this, {
|
|
19
19
|
getTargets: () => this.querySelectorAll(`textarea[id="${this.uid}"]`),
|
|
20
20
|
getState: () => ({
|
|
21
21
|
uid: this.uid,
|
|
@@ -79,7 +79,7 @@ let o = class extends L {
|
|
|
79
79
|
"min-height": `${t.minimumHeight}px`
|
|
80
80
|
};
|
|
81
81
|
return u`
|
|
82
|
-
${
|
|
82
|
+
${I(this.uid, t)}
|
|
83
83
|
|
|
84
84
|
<div
|
|
85
85
|
class=${y({
|
|
@@ -151,7 +151,7 @@ let o = class extends L {
|
|
|
151
151
|
</div>
|
|
152
152
|
|
|
153
153
|
<div class="gui-markdown--validation">
|
|
154
|
-
<div>${
|
|
154
|
+
<div>${M(this.uid, t)}</div>
|
|
155
155
|
${i}
|
|
156
156
|
</div>
|
|
157
157
|
`;
|
|
@@ -311,6 +311,7 @@ let o = class extends L {
|
|
|
311
311
|
toolbarBtnClass(t) {
|
|
312
312
|
return y({
|
|
313
313
|
"gui-markdown__toolbar-button": !0,
|
|
314
|
+
"gui-markdown__toolbar-button--disabled": this.disabled === !0 || this.readOnly === !0,
|
|
314
315
|
"gui-markdown__toolbar-button--active": !!t && !!this.activeFormats[t]
|
|
315
316
|
});
|
|
316
317
|
}
|
|
@@ -377,28 +378,28 @@ let o = class extends L {
|
|
|
377
378
|
`, s), g = a.substring(d, h === -1 ? a.length : h);
|
|
378
379
|
if (i)
|
|
379
380
|
if (n === "link") {
|
|
380
|
-
const p = s - d,
|
|
381
|
+
const p = s - d, b = /\[([^\]]*)\]\([^)]*\)/g;
|
|
381
382
|
let c;
|
|
382
|
-
for (; (c =
|
|
383
|
+
for (; (c = b.exec(g)) !== null; )
|
|
383
384
|
if (p >= c.index && p <= c.index + c[0].length) {
|
|
384
|
-
const v = c[1], m = d + c.index,
|
|
385
|
-
t.value = `${a.substring(0, m)}${v}${a.substring(
|
|
385
|
+
const v = c[1], m = d + c.index, w = m + c[0].length;
|
|
386
|
+
t.value = `${a.substring(0, m)}${v}${a.substring(w)}`, t.selectionStart = m, t.selectionEnd = m + v.length;
|
|
386
387
|
break;
|
|
387
388
|
}
|
|
388
389
|
} else {
|
|
389
390
|
const p = s - d;
|
|
390
|
-
let
|
|
391
|
-
for (;
|
|
392
|
-
const c = g.indexOf(e,
|
|
391
|
+
let b = 0;
|
|
392
|
+
for (; b < g.length; ) {
|
|
393
|
+
const c = g.indexOf(e, b);
|
|
393
394
|
if (c === -1) break;
|
|
394
395
|
const v = g.indexOf(i, c + e.length);
|
|
395
396
|
if (v === -1) break;
|
|
396
397
|
if (p >= c && p <= v + i.length) {
|
|
397
|
-
const m = g.substring(c + e.length, v),
|
|
398
|
-
t.value = `${a.substring(0,
|
|
398
|
+
const m = g.substring(c + e.length, v), w = d + c, C = d + v + i.length;
|
|
399
|
+
t.value = `${a.substring(0, w)}${m}${a.substring(C)}`, t.selectionStart = w, t.selectionEnd = w + m.length;
|
|
399
400
|
break;
|
|
400
401
|
}
|
|
401
|
-
|
|
402
|
+
b = v + i.length;
|
|
402
403
|
}
|
|
403
404
|
}
|
|
404
405
|
else {
|
|
@@ -410,8 +411,8 @@ let o = class extends L {
|
|
|
410
411
|
const m = g.match(/^\d+\.\s/);
|
|
411
412
|
m && (p = m[0]);
|
|
412
413
|
}
|
|
413
|
-
const
|
|
414
|
-
t.value = `${
|
|
414
|
+
const b = a.substring(0, d), c = g.substring(p.length), v = a.substring(h === -1 ? a.length : h);
|
|
415
|
+
t.value = `${b}${c}${v}`, t.selectionStart = Math.max(d, s - p.length), t.selectionEnd = t.selectionStart;
|
|
415
416
|
}
|
|
416
417
|
}
|
|
417
418
|
valueChanged(t) {
|
|
@@ -526,7 +527,7 @@ r([
|
|
|
526
527
|
A()
|
|
527
528
|
], o.prototype, "activeFormats", 2);
|
|
528
529
|
o = r([
|
|
529
|
-
|
|
530
|
+
O("gui-markdown")
|
|
530
531
|
], o);
|
|
531
532
|
typeof customElements < "u" && !customElements.get("gui-markdown") && customElements.define("gui-markdown", o);
|
|
532
533
|
var E = Object.defineProperty, q = Object.getOwnPropertyDescriptor, k = (t, e, i, n) => {
|
|
@@ -590,10 +591,10 @@ k([
|
|
|
590
591
|
l({ attribute: !1 })
|
|
591
592
|
], f.prototype, "formContext", 2);
|
|
592
593
|
k([
|
|
593
|
-
F({ context:
|
|
594
|
+
F({ context: _ })
|
|
594
595
|
], f.prototype, "adapter", 2);
|
|
595
596
|
f = k([
|
|
596
|
-
|
|
597
|
+
O("gui-markdown-input")
|
|
597
598
|
], f);
|
|
598
599
|
export {
|
|
599
600
|
f as MarkdownElement
|
|
@@ -3,12 +3,12 @@ import { LitElement as m, nothing as h, html as c } from "lit";
|
|
|
3
3
|
import { property as s, customElement as b } from "lit/decorators.js";
|
|
4
4
|
import { G as f, b as w, c as $ } from "./templates-Dk1jxLwS.js";
|
|
5
5
|
import { styleMap as x } from "lit-html/directives/style-map.js";
|
|
6
|
-
import { consume as D, provide as
|
|
6
|
+
import { consume as D, provide as N } from "@lit/context";
|
|
7
7
|
import "rxjs";
|
|
8
|
-
var
|
|
8
|
+
var C = Object.defineProperty, A = Object.getOwnPropertyDescriptor, r = (t, i, e, o) => {
|
|
9
9
|
for (var u = o > 1 ? void 0 : o ? A(i, e) : i, l = t.length - 1, p; l >= 0; l--)
|
|
10
10
|
(p = t[l]) && (u = (o ? p(i, e, u) : p(u)) || u);
|
|
11
|
-
return o && u &&
|
|
11
|
+
return o && u && C(i, e, u), u;
|
|
12
12
|
};
|
|
13
13
|
let a = class extends m {
|
|
14
14
|
constructor() {
|
|
@@ -135,10 +135,10 @@ let a = class extends m {
|
|
|
135
135
|
}
|
|
136
136
|
valueChanged(t) {
|
|
137
137
|
if (t.stopPropagation(), !this.readOnly) {
|
|
138
|
-
const
|
|
138
|
+
const e = t.target.valueAsNumber;
|
|
139
139
|
this.dispatchEvent(
|
|
140
140
|
new CustomEvent("input", {
|
|
141
|
-
detail: { value:
|
|
141
|
+
detail: { value: Number.isNaN(e) ? void 0 : e },
|
|
142
142
|
bubbles: !0,
|
|
143
143
|
composed: !0
|
|
144
144
|
})
|
|
@@ -264,7 +264,7 @@ n([
|
|
|
264
264
|
s({ attribute: !1 })
|
|
265
265
|
], d.prototype, "formContext", 2);
|
|
266
266
|
n([
|
|
267
|
-
|
|
267
|
+
N({ context: g })
|
|
268
268
|
], d.prototype, "adapter", 2);
|
|
269
269
|
d = n([
|
|
270
270
|
b("gui-number-input")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golemui/gui-lit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.umd.cjs",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"*.md"
|
|
23
23
|
],
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@golemui/lit": "1.0.
|
|
26
|
-
"@golemui/core": "1.0.
|
|
27
|
-
"@golemui/gui-components": "1.0.
|
|
28
|
-
"@golemui/gui-shared": "1.0.
|
|
29
|
-
"@golemui/gui-validators": "1.0.
|
|
25
|
+
"@golemui/lit": "1.0.2",
|
|
26
|
+
"@golemui/core": "1.0.2",
|
|
27
|
+
"@golemui/gui-components": "1.0.2",
|
|
28
|
+
"@golemui/gui-shared": "1.0.2",
|
|
29
|
+
"@golemui/gui-validators": "1.0.2",
|
|
30
30
|
"@lit/context": "^1.1.6",
|
|
31
31
|
"lit-html": "^3.3.1",
|
|
32
32
|
"lit": "^3.3.1",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { InputWidgetAdapter as v, formContext as b, inputContext as
|
|
1
|
+
import { InputWidgetAdapter as v, formContext as b, inputContext as $ } from "@golemui/lit";
|
|
2
2
|
import { LitElement as m, html as n, nothing as c } from "lit";
|
|
3
3
|
import { property as i, customElement as g } from "lit/decorators.js";
|
|
4
|
-
import { classMap as
|
|
4
|
+
import { classMap as x } from "lit/directives/class-map.js";
|
|
5
5
|
import { G as f, b as C, c as w } from "./templates-Dk1jxLwS.js";
|
|
6
6
|
import { styleMap as D } from "lit-html/directives/style-map.js";
|
|
7
7
|
import { consume as _, provide as L } from "@lit/context";
|
|
@@ -58,7 +58,7 @@ let r = class extends m {
|
|
|
58
58
|
"gui-textarea--counter": !0,
|
|
59
59
|
"gui-textarea--counter__error": (t.value?.length ?? 0) > t.maxLength
|
|
60
60
|
}, l = t.counterMode === "current" ? n`<span>${t.value?.length ?? 0}</span>` : n`<span>${t.maxLength - (t.value?.length ?? 0)}</span>`;
|
|
61
|
-
a = n`<div class=${
|
|
61
|
+
a = n`<div class=${x(e)}>
|
|
62
62
|
${l}
|
|
63
63
|
<span> / ${t.maxLength}</span>
|
|
64
64
|
</div>`;
|
|
@@ -85,6 +85,7 @@ let r = class extends m {
|
|
|
85
85
|
?readonly=${t.readonly}
|
|
86
86
|
placeholder=${t.placeholder || c}
|
|
87
87
|
autocomplete=${this.autocomplete || c}
|
|
88
|
+
.value=${this.value || ""}
|
|
88
89
|
@input=${this.valueChanged}
|
|
89
90
|
@blur=${this.onBlur}
|
|
90
91
|
></textarea>
|
|
@@ -227,7 +228,7 @@ h([
|
|
|
227
228
|
i({ attribute: !1 })
|
|
228
229
|
], u.prototype, "formContext", 2);
|
|
229
230
|
h([
|
|
230
|
-
L({ context:
|
|
231
|
+
L({ context: $ })
|
|
231
232
|
], u.prototype, "adapter", 2);
|
|
232
233
|
u = h([
|
|
233
234
|
g("gui-textarea-input")
|