@golemui/gui-lit 0.0.2 → 0.12.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/README.md +17 -4
- package/{accordion.element-D1RfC2ew.js → accordion.element-81uTv6Ms.js} +29 -18
- package/{alert.element-B4rpyqGV.js → alert.element-DWrS5ggK.js} +17 -17
- package/button.element-hjhVBamJ.js +56 -0
- package/{calendar.element-D7mAbpAa.js → calendar.element-C1rLK7aY.js} +24 -18
- package/{checkbox.element--Kc7sWBx.js → checkbox.element-bu9_MvED.js} +8 -8
- package/{currency.element-D9dyGRBH.js → currency.element-Bxv2WxAx.js} +20 -19
- package/date-picker.element-GNC8f3Qi.js +157 -0
- package/{date.element-na_Uywms.js → date.element-Dzw-UJzC.js} +10 -10
- package/{dropdown.element-Cfj40aJz.js → dropdown.element-CebROj9s.js} +95 -78
- package/flex.element-BMqqfxjI.js +77 -0
- package/grid.element-CBMoOuLt.js +75 -0
- package/index.js +1104 -1031
- package/index.umd.cjs +319 -112
- package/lib/components/accordion.element.d.ts +1 -1
- package/lib/components/alert.element.d.ts +1 -1
- package/lib/components/button.element.d.ts +3 -2
- package/lib/components/calendar.element.d.ts +1 -0
- package/lib/components/checkbox.element.d.ts +1 -1
- package/lib/components/currency.element.d.ts +1 -1
- package/lib/components/date-picker.element.d.ts +4 -2
- package/lib/components/date.element.d.ts +1 -1
- package/lib/components/dropdown.element.d.ts +1 -1
- package/lib/components/flex.element.d.ts +1 -1
- package/lib/components/form.element.d.ts +6 -16
- package/lib/components/grid.element.d.ts +16 -0
- package/lib/components/list.element.d.ts +1 -1
- package/lib/components/markdown-text.element.d.ts +16 -0
- package/lib/components/markdown.element.d.ts +17 -0
- package/lib/components/number.element.d.ts +1 -1
- package/lib/components/password.element.d.ts +1 -1
- package/lib/components/radiogroup.element.d.ts +1 -1
- package/lib/components/range-calendar.element.d.ts +1 -0
- package/lib/components/range-date-input.element.d.ts +18 -0
- package/lib/components/range-date-picker.element.d.ts +30 -0
- package/lib/components/renderer.element.d.ts +1 -0
- package/lib/components/repeater.element.d.ts +5 -1
- package/lib/components/select.element.d.ts +1 -1
- package/lib/components/tabs.element.d.ts +1 -1
- package/lib/components/textarea.element.d.ts +1 -1
- package/lib/components/textinput.element.d.ts +1 -1
- package/lib/components/toggle.element.d.ts +1 -1
- package/lib/widget.loaders.d.ts +2 -2
- package/{list.element--aj6sNNU.js → list.element-DIIgN_Ww.js} +66 -59
- package/markdown-text.element-DY7b-dU5.js +53 -0
- package/markdown.element-ZD_n4ObO.js +73 -0
- package/{number.element-Bl5YReaL.js → number.element-B0E7W2TK.js} +20 -19
- package/package.json +11 -6
- package/{password.element-CKmcH8Gn.js → password.element-C4_eLdUO.js} +11 -10
- package/{radiogroup.element-Cn1lyyVE.js → radiogroup.element-BD8qBNoO.js} +8 -7
- package/{range-calendar.element-C2YUElqM.js → range-calendar.element-Bli9UfhN.js} +35 -27
- package/range-date-input.element-BwPvGk5F.js +72 -0
- package/range-date-picker.element-DJQOwDPh.js +170 -0
- package/renderer.element-B99qD2mz.js +48 -0
- package/repeater.element-AaifWsOB.js +136 -0
- package/{select.element-LWiqYxzA.js → select.element-BLxtqB0A.js} +9 -8
- package/{tabs.element-DYg1wAz9.js → tabs.element-k8JMNDXi.js} +18 -16
- package/{textarea.element-BXc-rLZE.js → textarea.element-DgDwfzYP.js} +14 -14
- package/{textinput.element-x9LYeW8B.js → textinput.element-DSLFDjfb.js} +17 -16
- package/{toggle.element-BP4YKWyR.js → toggle.element-BLu6F99u.js} +5 -5
- package/CHANGELOG.md +0 -529
- package/button.element-BnUBVNSH.js +0 -58
- package/date-picker.element-Dcs5OpxN.js +0 -136
- package/flex.element-BSMOum-h.js +0 -65
- package/renderer.element-B7AjPqr2.js +0 -43
- package/repeater.element-BfwzCooC.js +0 -83
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as o from "@golemui/lit";
|
|
2
|
+
import { consume as n, provide as u } from "@lit/context";
|
|
3
|
+
import { LitElement as h, html as m } from "lit";
|
|
4
|
+
import { property as c, customElement as D } from "lit/decorators.js";
|
|
5
|
+
var $ = Object.defineProperty, f = Object.getOwnPropertyDescriptor, l = (e, t, s, r) => {
|
|
6
|
+
for (var a = r > 1 ? void 0 : r ? f(t, s) : t, p = e.length - 1, d; p >= 0; p--)
|
|
7
|
+
(d = e[p]) && (a = (r ? d(t, s, a) : d(a)) || a);
|
|
8
|
+
return r && a && $(t, s, a), a;
|
|
9
|
+
};
|
|
10
|
+
let i = class extends h {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments), this.adapter = new o.InputWidgetAdapter(), this.subscriptions = [];
|
|
13
|
+
}
|
|
14
|
+
createRenderRoot() {
|
|
15
|
+
return this;
|
|
16
|
+
}
|
|
17
|
+
updated(e) {
|
|
18
|
+
super.updated(e);
|
|
19
|
+
const t = this.adapter.templateData.size;
|
|
20
|
+
t ? this.style.flex = String(t) : this.style.removeProperty("flex");
|
|
21
|
+
}
|
|
22
|
+
connectedCallback() {
|
|
23
|
+
super.connectedCallback(), this.classList.add("gui-markdown", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
24
|
+
this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
render() {
|
|
28
|
+
return super.render(), m`
|
|
29
|
+
<gui-markdown
|
|
30
|
+
.uid=${this.widget.uid}
|
|
31
|
+
.label=${this.adapter.templateData.label}
|
|
32
|
+
.errors=${this.adapter.templateData.errors}
|
|
33
|
+
?touched=${this.adapter.templateData.touched}
|
|
34
|
+
?required=${this.adapter.templateData.validator?.required}
|
|
35
|
+
?disabled=${this.adapter.templateData.disabled}
|
|
36
|
+
?readonly=${this.adapter.templateData.readonly}
|
|
37
|
+
.value=${this.adapter.templateData.value}
|
|
38
|
+
.hint=${this.adapter.templateData.hint}
|
|
39
|
+
.placeholder=${this.adapter.templateData.placeholder}
|
|
40
|
+
.autocomplete=${this.adapter.templateData.autocomplete}
|
|
41
|
+
.counterMode=${this.adapter.templateData.counterMode}
|
|
42
|
+
.minimumHeight=${this.adapter.templateData.minimumHeight}
|
|
43
|
+
.autoGrow=${this.adapter.templateData.autoGrow}
|
|
44
|
+
.tools=${this.adapter.templateData.tools}
|
|
45
|
+
.defaultOpenPreview=${this.adapter.templateData.defaultOpenPreview}
|
|
46
|
+
.maxLength=${this.adapter.templateData.validator?.maxLength}
|
|
47
|
+
.dependencies=${this.adapter.templateData.deps}
|
|
48
|
+
@input=${this.valueChanged}
|
|
49
|
+
@blur=${() => this.adapter.onBlur()}
|
|
50
|
+
></gui-markdown>
|
|
51
|
+
`;
|
|
52
|
+
}
|
|
53
|
+
valueChanged(e) {
|
|
54
|
+
const t = e.detail.value;
|
|
55
|
+
this.adapter.valueChanged(t);
|
|
56
|
+
}
|
|
57
|
+
disconnectedCallback() {
|
|
58
|
+
super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((e) => e.unsubscribe());
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
l([
|
|
62
|
+
n({ context: o.formContext }),
|
|
63
|
+
c({ attribute: !1 })
|
|
64
|
+
], i.prototype, "formContext", 2);
|
|
65
|
+
l([
|
|
66
|
+
u({ context: o.inputContext })
|
|
67
|
+
], i.prototype, "adapter", 2);
|
|
68
|
+
i = l([
|
|
69
|
+
D("gui-markdown-input")
|
|
70
|
+
], i);
|
|
71
|
+
export {
|
|
72
|
+
i as MarkdownElement
|
|
73
|
+
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as d from "@golemui/lit";
|
|
2
2
|
import { consume as u, provide as n } from "@lit/context";
|
|
3
3
|
import { LitElement as m, html as h } from "lit";
|
|
4
4
|
import { property as c, customElement as b } from "lit/decorators.js";
|
|
5
|
-
var f = Object.defineProperty, D = Object.getOwnPropertyDescriptor, o = (e, t,
|
|
6
|
-
for (var a = r > 1 ? void 0 : r ? D(t,
|
|
7
|
-
(
|
|
8
|
-
return r && a && f(t,
|
|
5
|
+
var f = Object.defineProperty, D = Object.getOwnPropertyDescriptor, o = (e, t, s, r) => {
|
|
6
|
+
for (var a = r > 1 ? void 0 : r ? D(t, s) : t, p = e.length - 1, l; p >= 0; p--)
|
|
7
|
+
(l = e[p]) && (a = (r ? l(t, s, a) : l(a)) || a);
|
|
8
|
+
return r && a && f(t, s, a), a;
|
|
9
9
|
};
|
|
10
|
-
let
|
|
10
|
+
let i = class extends m {
|
|
11
11
|
constructor() {
|
|
12
|
-
super(...arguments), this.adapter = new
|
|
12
|
+
super(...arguments), this.adapter = new d.InputWidgetAdapter(), this.subscriptions = [];
|
|
13
13
|
}
|
|
14
14
|
createRenderRoot() {
|
|
15
15
|
return this;
|
|
16
16
|
}
|
|
17
|
-
connectedCallback() {
|
|
18
|
-
super.connectedCallback(), this.classList.add("gui-number"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
19
|
-
this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
17
|
updated(e) {
|
|
23
18
|
super.updated(e);
|
|
24
19
|
const t = this.adapter.templateData.size;
|
|
25
20
|
t ? this.style.flex = String(t) : this.style.removeProperty("flex");
|
|
26
21
|
}
|
|
22
|
+
connectedCallback() {
|
|
23
|
+
super.connectedCallback(), this.classList.add("gui-number", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
24
|
+
this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
27
|
render() {
|
|
28
28
|
return super.render(), h`
|
|
29
29
|
<gui-number
|
|
@@ -41,6 +41,7 @@ let s = class extends m {
|
|
|
41
41
|
.maximum=${this.adapter.templateData.maximum}
|
|
42
42
|
.autoGrow=${this.adapter.templateData.autoGrow}
|
|
43
43
|
.placeholder=${this.adapter.templateData.placeholder}
|
|
44
|
+
.autocomplete=${this.adapter.templateData.autocomplete}
|
|
44
45
|
@input=${this.valueChanged}
|
|
45
46
|
@blur=${() => this.adapter.onBlur()}
|
|
46
47
|
></gui-number>
|
|
@@ -55,15 +56,15 @@ let s = class extends m {
|
|
|
55
56
|
}
|
|
56
57
|
};
|
|
57
58
|
o([
|
|
58
|
-
u({ context:
|
|
59
|
+
u({ context: d.formContext }),
|
|
59
60
|
c({ attribute: !1 })
|
|
60
|
-
],
|
|
61
|
+
], i.prototype, "formContext", 2);
|
|
61
62
|
o([
|
|
62
|
-
n({ context:
|
|
63
|
-
],
|
|
64
|
-
|
|
63
|
+
n({ context: d.inputContext })
|
|
64
|
+
], i.prototype, "adapter", 2);
|
|
65
|
+
i = o([
|
|
65
66
|
b("gui-number-input")
|
|
66
|
-
],
|
|
67
|
+
], i);
|
|
67
68
|
export {
|
|
68
|
-
|
|
69
|
+
i as NumberElement
|
|
69
70
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golemui/gui-lit",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.umd.cjs",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -21,14 +21,19 @@
|
|
|
21
21
|
"*.md"
|
|
22
22
|
],
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@golemui/lit": "
|
|
25
|
-
"@golemui/core": "
|
|
26
|
-
"@golemui/gui-components": "
|
|
27
|
-
"@golemui/gui-shared": "
|
|
28
|
-
"@golemui/gui-validators": "
|
|
24
|
+
"@golemui/lit": "0.12.0",
|
|
25
|
+
"@golemui/core": "0.12.0",
|
|
26
|
+
"@golemui/gui-components": "0.12.0",
|
|
27
|
+
"@golemui/gui-shared": "0.12.0",
|
|
28
|
+
"@golemui/gui-validators": "0.12.0",
|
|
29
29
|
"@lit/context": "^1.1.6",
|
|
30
30
|
"lit-html": "^3.3.1",
|
|
31
31
|
"lit": "^3.3.1",
|
|
32
32
|
"rxjs": "^7.8.0"
|
|
33
|
+
},
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "https://github.com/golemui/golemui.git",
|
|
37
|
+
"directory": "libs/gui/lit"
|
|
33
38
|
}
|
|
34
39
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as o from "@golemui/lit";
|
|
2
|
-
import { consume as
|
|
2
|
+
import { consume as h, provide as n } from "@lit/context";
|
|
3
3
|
import { LitElement as u, html as c } from "lit";
|
|
4
4
|
import { property as m, customElement as b } from "lit/decorators.js";
|
|
5
5
|
var w = Object.defineProperty, D = Object.getOwnPropertyDescriptor, l = (e, t, i, s) => {
|
|
6
|
-
for (var a = s > 1 ? void 0 : s ? D(t, i) : t,
|
|
7
|
-
(
|
|
6
|
+
for (var a = s > 1 ? void 0 : s ? D(t, i) : t, p = e.length - 1, d; p >= 0; p--)
|
|
7
|
+
(d = e[p]) && (a = (s ? d(t, i, a) : d(a)) || a);
|
|
8
8
|
return s && a && w(t, i, a), a;
|
|
9
9
|
};
|
|
10
10
|
let r = class extends u {
|
|
@@ -14,16 +14,16 @@ let r = class extends u {
|
|
|
14
14
|
createRenderRoot() {
|
|
15
15
|
return this;
|
|
16
16
|
}
|
|
17
|
-
connectedCallback() {
|
|
18
|
-
super.connectedCallback(), this.classList.add("gui-password"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
19
|
-
this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
17
|
updated(e) {
|
|
23
18
|
super.updated(e);
|
|
24
19
|
const t = this.adapter.templateData.size;
|
|
25
20
|
t ? this.style.flex = String(t) : this.style.removeProperty("flex");
|
|
26
21
|
}
|
|
22
|
+
connectedCallback() {
|
|
23
|
+
super.connectedCallback(), this.classList.add("gui-password", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
24
|
+
this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
27
|
render() {
|
|
28
28
|
return super.render(), c`
|
|
29
29
|
<gui-password
|
|
@@ -38,6 +38,7 @@ let r = class extends u {
|
|
|
38
38
|
.value=${this.adapter.templateData.value}
|
|
39
39
|
.icon=${this.adapter.templateData.icon}
|
|
40
40
|
.placeholder=${this.adapter.templateData.placeholder}
|
|
41
|
+
.autocomplete=${this.adapter.templateData.autocomplete}
|
|
41
42
|
.showPasswordIcon=${this.adapter.templateData.showPasswordIcon}
|
|
42
43
|
.hidePasswordIcon=${this.adapter.templateData.hidePasswordIcon}
|
|
43
44
|
.showPasswordLabel=${this.adapter.templateData.showPasswordLabel}
|
|
@@ -56,11 +57,11 @@ let r = class extends u {
|
|
|
56
57
|
}
|
|
57
58
|
};
|
|
58
59
|
l([
|
|
59
|
-
|
|
60
|
+
h({ context: o.formContext }),
|
|
60
61
|
m({ attribute: !1 })
|
|
61
62
|
], r.prototype, "formContext", 2);
|
|
62
63
|
l([
|
|
63
|
-
|
|
64
|
+
n({ context: o.inputContext })
|
|
64
65
|
], r.prototype, "adapter", 2);
|
|
65
66
|
r = l([
|
|
66
67
|
b("gui-password-input")
|
|
@@ -2,8 +2,8 @@ import * as o from "@golemui/lit";
|
|
|
2
2
|
import { consume as n, provide as u } from "@lit/context";
|
|
3
3
|
import { LitElement as h, html as c } from "lit";
|
|
4
4
|
import { property as m, customElement as b } from "lit/decorators.js";
|
|
5
|
-
var g = Object.defineProperty,
|
|
6
|
-
for (var a = r > 1 ? void 0 : r ?
|
|
5
|
+
var g = Object.defineProperty, f = Object.getOwnPropertyDescriptor, l = (e, t, s, r) => {
|
|
6
|
+
for (var a = r > 1 ? void 0 : r ? f(t, s) : t, p = e.length - 1, d; p >= 0; p--)
|
|
7
7
|
(d = e[p]) && (a = (r ? d(t, s, a) : d(a)) || a);
|
|
8
8
|
return r && a && g(t, s, a), a;
|
|
9
9
|
};
|
|
@@ -14,16 +14,16 @@ let i = class extends h {
|
|
|
14
14
|
createRenderRoot() {
|
|
15
15
|
return this;
|
|
16
16
|
}
|
|
17
|
-
connectedCallback() {
|
|
18
|
-
super.connectedCallback(), this.classList.add("gui-radiogroup"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
19
|
-
this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
17
|
updated(e) {
|
|
23
18
|
super.updated(e);
|
|
24
19
|
const t = this.adapter.templateData.size;
|
|
25
20
|
t ? this.style.flex = String(t) : this.style.removeProperty("flex");
|
|
26
21
|
}
|
|
22
|
+
connectedCallback() {
|
|
23
|
+
super.connectedCallback(), this.classList.add("gui-radiogroup", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
24
|
+
this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
27
|
render() {
|
|
28
28
|
return super.render(), c`
|
|
29
29
|
<gui-radiogroup
|
|
@@ -39,6 +39,7 @@ let i = class extends h {
|
|
|
39
39
|
.options=${this.adapter.templateData.options}
|
|
40
40
|
.labelField=${this.adapter.templateData.labelField}
|
|
41
41
|
.valueField=${this.adapter.templateData.valueField}
|
|
42
|
+
.direction=${this.adapter.templateData.direction}
|
|
42
43
|
@change=${this.valueChanged}
|
|
43
44
|
@blur=${() => this.adapter.onBlur()}
|
|
44
45
|
></gui-radiogroup>
|
|
@@ -1,26 +1,31 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { consume as
|
|
3
|
-
import { LitElement as m, html as
|
|
4
|
-
import { property as
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
(
|
|
8
|
-
return r &&
|
|
1
|
+
import * as n from "@golemui/lit";
|
|
2
|
+
import { consume as o, provide as h } from "@lit/context";
|
|
3
|
+
import { LitElement as m, html as u } from "lit";
|
|
4
|
+
import { property as c, customElement as b } from "lit/decorators.js";
|
|
5
|
+
var D = Object.defineProperty, $ = Object.getOwnPropertyDescriptor, d = (e, t, s, r) => {
|
|
6
|
+
for (var a = r > 1 ? void 0 : r ? $(t, s) : t, p = e.length - 1, l; p >= 0; p--)
|
|
7
|
+
(l = e[p]) && (a = (r ? l(t, s, a) : l(a)) || a);
|
|
8
|
+
return r && a && D(t, s, a), a;
|
|
9
9
|
};
|
|
10
|
-
let
|
|
10
|
+
let i = class extends m {
|
|
11
11
|
constructor() {
|
|
12
|
-
super(...arguments), this.adapter = new
|
|
12
|
+
super(...arguments), this.adapter = new n.InputWidgetAdapter(), this.subscriptions = [];
|
|
13
13
|
}
|
|
14
14
|
createRenderRoot() {
|
|
15
15
|
return this;
|
|
16
16
|
}
|
|
17
|
+
updated(e) {
|
|
18
|
+
super.updated(e);
|
|
19
|
+
const t = this.adapter.templateData.size;
|
|
20
|
+
t ? this.style.flex = String(t) : this.style.removeProperty("flex");
|
|
21
|
+
}
|
|
17
22
|
connectedCallback() {
|
|
18
|
-
super.connectedCallback(), this.classList.add("gui-calendar"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
23
|
+
super.connectedCallback(), this.classList.add("gui-calendar", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
19
24
|
this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
|
|
20
25
|
);
|
|
21
26
|
}
|
|
22
27
|
render() {
|
|
23
|
-
return super.render(),
|
|
28
|
+
return super.render(), u`
|
|
24
29
|
<gui-range-calendar
|
|
25
30
|
.uid=${this.widget.uid}
|
|
26
31
|
.label=${this.adapter.templateData.label}
|
|
@@ -42,29 +47,32 @@ let s = class extends m {
|
|
|
42
47
|
.maxDate=${this.adapter.templateData.maxDate}
|
|
43
48
|
.disabledRanges=${this.adapter.templateData.disabledRanges}
|
|
44
49
|
.numberOfMonths=${this.adapter.templateData.numberOfMonths}
|
|
50
|
+
.hidePills=${!1}
|
|
51
|
+
.removePillAriaLabel=${this.adapter.templateData.removePillAriaLabel}
|
|
45
52
|
.localeId=${this.adapter.templateData.lang}
|
|
46
53
|
@change=${this.valueChanged}
|
|
54
|
+
@blur=${() => this.adapter.onBlur()}
|
|
47
55
|
></gui-range-calendar>
|
|
48
56
|
`;
|
|
49
57
|
}
|
|
50
|
-
valueChanged(
|
|
51
|
-
const
|
|
52
|
-
this.adapter.valueChanged(
|
|
58
|
+
valueChanged(e) {
|
|
59
|
+
const t = e?.target;
|
|
60
|
+
this.adapter.valueChanged(t.value);
|
|
53
61
|
}
|
|
54
62
|
disconnectedCallback() {
|
|
55
|
-
super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((
|
|
63
|
+
super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((e) => e.unsubscribe());
|
|
56
64
|
}
|
|
57
65
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
],
|
|
62
|
-
|
|
63
|
-
h({ context:
|
|
64
|
-
],
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
],
|
|
66
|
+
d([
|
|
67
|
+
o({ context: n.formContext }),
|
|
68
|
+
c({ attribute: !1 })
|
|
69
|
+
], i.prototype, "formContext", 2);
|
|
70
|
+
d([
|
|
71
|
+
h({ context: n.inputContext })
|
|
72
|
+
], i.prototype, "adapter", 2);
|
|
73
|
+
i = d([
|
|
74
|
+
b("gui-range-calendar-input")
|
|
75
|
+
], i);
|
|
68
76
|
export {
|
|
69
|
-
|
|
77
|
+
i as RangeCalendarElement
|
|
70
78
|
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as d from "@golemui/lit";
|
|
2
|
+
import { consume as o, provide as u } from "@lit/context";
|
|
3
|
+
import { LitElement as h, html as c } from "lit";
|
|
4
|
+
import { property as m, customElement as b } from "lit/decorators.js";
|
|
5
|
+
var D = Object.defineProperty, g = Object.getOwnPropertyDescriptor, n = (t, e, s, r) => {
|
|
6
|
+
for (var a = r > 1 ? void 0 : r ? g(e, s) : e, p = t.length - 1, l; p >= 0; p--)
|
|
7
|
+
(l = t[p]) && (a = (r ? l(e, s, a) : l(a)) || a);
|
|
8
|
+
return r && a && D(e, s, a), a;
|
|
9
|
+
};
|
|
10
|
+
let i = class extends h {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments), this.adapter = new d.InputWidgetAdapter(), this.subscriptions = [];
|
|
13
|
+
}
|
|
14
|
+
createRenderRoot() {
|
|
15
|
+
return this;
|
|
16
|
+
}
|
|
17
|
+
updated(t) {
|
|
18
|
+
super.updated(t);
|
|
19
|
+
const e = this.adapter.templateData.size;
|
|
20
|
+
e ? this.style.flex = String(e) : this.style.removeProperty("flex");
|
|
21
|
+
}
|
|
22
|
+
connectedCallback() {
|
|
23
|
+
super.connectedCallback(), this.classList.add("gui-range-date", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
24
|
+
this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
render() {
|
|
28
|
+
return super.render(), c`
|
|
29
|
+
<gui-range-date
|
|
30
|
+
.uid=${this.widget.uid}
|
|
31
|
+
.label=${this.adapter.templateData.label}
|
|
32
|
+
.hint=${this.adapter.templateData.hint}
|
|
33
|
+
.icon=${this.adapter.templateData.icon}
|
|
34
|
+
.errors=${this.adapter.templateData.errors}
|
|
35
|
+
?touched=${this.adapter.templateData.touched}
|
|
36
|
+
?required=${this.adapter.templateData.validator?.required}
|
|
37
|
+
?disabled=${this.adapter.templateData.disabled}
|
|
38
|
+
?readonly=${this.adapter.templateData.readonly}
|
|
39
|
+
.value=${this.adapter.templateData.value}
|
|
40
|
+
.localeId=${this.adapter.templateData.lang}
|
|
41
|
+
.separator=${this.adapter.templateData.separator}
|
|
42
|
+
.removePillAriaLabel=${this.adapter.templateData.removePillAriaLabel}
|
|
43
|
+
.startDateAriaLabel=${this.adapter.templateData.startDateAriaLabel}
|
|
44
|
+
.endDateAriaLabel=${this.adapter.templateData.endDateAriaLabel}
|
|
45
|
+
@change=${this.valueChanged}
|
|
46
|
+
@inputError=${this.onInputError}
|
|
47
|
+
></gui-range-date>
|
|
48
|
+
`;
|
|
49
|
+
}
|
|
50
|
+
valueChanged(t) {
|
|
51
|
+
this.adapter.injectValidationIssues(null), this.adapter.valueChanged(t.detail.value);
|
|
52
|
+
}
|
|
53
|
+
onInputError(t) {
|
|
54
|
+
this.adapter.injectValidationIssues([t.detail.message]);
|
|
55
|
+
}
|
|
56
|
+
disconnectedCallback() {
|
|
57
|
+
super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((t) => t.unsubscribe());
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
n([
|
|
61
|
+
o({ context: d.formContext }),
|
|
62
|
+
m({ attribute: !1 })
|
|
63
|
+
], i.prototype, "formContext", 2);
|
|
64
|
+
n([
|
|
65
|
+
u({ context: d.inputContext })
|
|
66
|
+
], i.prototype, "adapter", 2);
|
|
67
|
+
i = n([
|
|
68
|
+
b("gui-range-date-input")
|
|
69
|
+
], i);
|
|
70
|
+
export {
|
|
71
|
+
i as RangeDateInputElement
|
|
72
|
+
};
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import * as p from "@golemui/lit";
|
|
2
|
+
import { addIcon as c, addLabel as m, addErrors as g } from "@golemui/gui-components";
|
|
3
|
+
import { consume as D, provide as C } from "@lit/context";
|
|
4
|
+
import { LitElement as $, html as o, nothing as f } from "lit";
|
|
5
|
+
import { property as v, query as h, state as u, customElement as b } from "lit/decorators.js";
|
|
6
|
+
import { classMap as k } from "lit/directives/class-map.js";
|
|
7
|
+
var y = Object.defineProperty, I = Object.getOwnPropertyDescriptor, n = (e, t, a, r) => {
|
|
8
|
+
for (var i = r > 1 ? void 0 : r ? I(t, a) : t, l = e.length - 1, d; l >= 0; l--)
|
|
9
|
+
(d = e[l]) && (i = (r ? d(t, a, i) : d(i)) || i);
|
|
10
|
+
return r && i && y(t, a, i), i;
|
|
11
|
+
};
|
|
12
|
+
let s = class extends $ {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments), this.adapter = new p.InputWidgetAdapter(), this.isCalendarOpen = !1, this.focusDate = void 0, this.subscriptions = [], this.onFocusOut = (e) => {
|
|
15
|
+
if (!this.isCalendarOpen) return;
|
|
16
|
+
const t = e.relatedTarget;
|
|
17
|
+
t && this.contains(t) || this.closeCalendar();
|
|
18
|
+
}, this.onDocumentClick = (e) => {
|
|
19
|
+
if (!this.isCalendarOpen) return;
|
|
20
|
+
const t = e.composedPath(), a = this.dateInput && t.includes(this.dateInput), r = this.calendarInput && t.includes(this.calendarInput);
|
|
21
|
+
!a && !r && this.closeCalendar();
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
createRenderRoot() {
|
|
25
|
+
return this;
|
|
26
|
+
}
|
|
27
|
+
updated(e) {
|
|
28
|
+
super.updated(e);
|
|
29
|
+
const t = this.adapter.templateData.size;
|
|
30
|
+
t ? this.style.flex = String(t) : this.style.removeProperty("flex");
|
|
31
|
+
}
|
|
32
|
+
connectedCallback() {
|
|
33
|
+
super.connectedCallback(), document.addEventListener("click", this.onDocumentClick), this.addEventListener("focusout", this.onFocusOut), this.classList.add("gui-range-date-picker", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
34
|
+
this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
render() {
|
|
38
|
+
super.render();
|
|
39
|
+
const e = c("datePicker", this.adapter.templateData), t = this.isCalendarOpen ? o`<gui-range-calendar
|
|
40
|
+
id="calendar-input"
|
|
41
|
+
.uid=${this.widget.uid}
|
|
42
|
+
.hint=${this.adapter.templateData.hint}
|
|
43
|
+
?touched=${this.adapter.templateData.touched}
|
|
44
|
+
?required=${this.adapter.templateData.validator?.required}
|
|
45
|
+
?disabled=${this.adapter.templateData.disabled}
|
|
46
|
+
?readonly=${this.adapter.templateData.readonly}
|
|
47
|
+
.value=${this.adapter.templateData.value}
|
|
48
|
+
.focusDate=${this.focusDate}
|
|
49
|
+
.prevMonthIcon=${this.adapter.templateData.prevMonthIcon}
|
|
50
|
+
.nextMonthIcon=${this.adapter.templateData.nextMonthIcon}
|
|
51
|
+
.prevMonthAriaLabel=${this.adapter.templateData.prevMonthAriaLabel}
|
|
52
|
+
.nextMonthAriaLabel=${this.adapter.templateData.nextMonthAriaLabel}
|
|
53
|
+
.dayFormat=${this.adapter.templateData.dayFormat}
|
|
54
|
+
.weekdayFormat=${this.adapter.templateData.weekdayFormat}
|
|
55
|
+
.monthFormat=${this.adapter.templateData.monthFormat}
|
|
56
|
+
.minDate=${this.adapter.templateData.minDate}
|
|
57
|
+
.maxDate=${this.adapter.templateData.maxDate}
|
|
58
|
+
.disabledRanges=${this.adapter.templateData.disabledRanges}
|
|
59
|
+
.numberOfMonths=${this.adapter.templateData.numberOfMonths}
|
|
60
|
+
.localeId=${this.adapter.templateData.lang}
|
|
61
|
+
.hidePills=${!0}
|
|
62
|
+
@blur=${this.onBlurCalendar}
|
|
63
|
+
@change=${this.valueChanged}
|
|
64
|
+
></gui-range-calendar>` : f;
|
|
65
|
+
return o`
|
|
66
|
+
${m(this.widget.uid, {
|
|
67
|
+
...this.adapter.templateData,
|
|
68
|
+
required: this.adapter.templateData.validator?.required
|
|
69
|
+
})}
|
|
70
|
+
|
|
71
|
+
<div
|
|
72
|
+
role="button"
|
|
73
|
+
tabindex="-1"
|
|
74
|
+
class="gui-widget"
|
|
75
|
+
aria-expanded=${this.isCalendarOpen}
|
|
76
|
+
@keyup=${(a) => this.onKeyUp(a)}
|
|
77
|
+
@click=${(a) => this.toggleCalendar(a)}
|
|
78
|
+
>
|
|
79
|
+
<gui-range-date
|
|
80
|
+
id="date-input"
|
|
81
|
+
class=${k(e.widgetClasses)}
|
|
82
|
+
.uid=${this.widget.uid}
|
|
83
|
+
.hint=${this.adapter.templateData.hint}
|
|
84
|
+
.showErrors=${!1}
|
|
85
|
+
.errors=${this.adapter.templateData.errors}
|
|
86
|
+
?touched=${this.adapter.templateData.touched}
|
|
87
|
+
?required=${this.adapter.templateData.validator?.required}
|
|
88
|
+
?disabled=${this.adapter.templateData.disabled}
|
|
89
|
+
?readonly=${this.adapter.templateData.readonly}
|
|
90
|
+
.value=${this.adapter.templateData.value}
|
|
91
|
+
.icon=${this.adapter.templateData.icon}
|
|
92
|
+
.localeId=${this.adapter.templateData.lang}
|
|
93
|
+
.separator=${this.adapter.templateData.separator}
|
|
94
|
+
.removePillAriaLabel=${this.adapter.templateData.removePillAriaLabel}
|
|
95
|
+
.startDateAriaLabel=${this.adapter.templateData.startDateAriaLabel}
|
|
96
|
+
.endDateAriaLabel=${this.adapter.templateData.endDateAriaLabel}
|
|
97
|
+
@inputError=${this.onInputError}
|
|
98
|
+
@blur=${() => this.adapter.onBlur()}
|
|
99
|
+
@focus=${this.openCalendar}
|
|
100
|
+
@change=${this.valueChanged}
|
|
101
|
+
@pillClick=${this.onPillClick}
|
|
102
|
+
></gui-range-date>
|
|
103
|
+
<span class="gui-range-date-picker__arrow"
|
|
104
|
+
><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 256 256">
|
|
105
|
+
<path
|
|
106
|
+
d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"
|
|
107
|
+
></path></svg
|
|
108
|
+
></span>
|
|
109
|
+
|
|
110
|
+
${t}
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
${g(this.widget.uid, this.adapter.templateData)}
|
|
114
|
+
`;
|
|
115
|
+
}
|
|
116
|
+
valueChanged(e) {
|
|
117
|
+
this.adapter.injectValidationIssues(null), this.adapter.valueChanged(e.detail.value);
|
|
118
|
+
}
|
|
119
|
+
onBlurCalendar() {
|
|
120
|
+
this.adapter.onBlur(), this.closeCalendar();
|
|
121
|
+
}
|
|
122
|
+
onInputError(e) {
|
|
123
|
+
this.adapter.injectValidationIssues([e.detail.message]);
|
|
124
|
+
}
|
|
125
|
+
onPillClick(e) {
|
|
126
|
+
this.focusDate = e.detail.range.start, this.openCalendar();
|
|
127
|
+
}
|
|
128
|
+
onKeyUp(e) {
|
|
129
|
+
const t = e;
|
|
130
|
+
t.target === t.currentTarget && (t?.key === "Enter" || t?.key === " ") && (this.isCalendarOpen = !this.isCalendarOpen, this.requestUpdate());
|
|
131
|
+
}
|
|
132
|
+
toggleCalendar(e) {
|
|
133
|
+
const t = e.target, a = t.closest(".gui-range-date-input__part"), r = t.closest("gui-range-calendar"), i = t.closest(".gui-range-date-input__pill"), l = t.closest(".gui-range-date-input__pill--count");
|
|
134
|
+
a || r || i ? this.openCalendar() : l ? this.closeCalendar() : (this.isCalendarOpen = !this.isCalendarOpen, this.requestUpdate());
|
|
135
|
+
}
|
|
136
|
+
openCalendar() {
|
|
137
|
+
this.isCalendarOpen || (this.isCalendarOpen = !0, this.requestUpdate());
|
|
138
|
+
}
|
|
139
|
+
closeCalendar() {
|
|
140
|
+
this.isCalendarOpen = !1, this.requestUpdate();
|
|
141
|
+
}
|
|
142
|
+
disconnectedCallback() {
|
|
143
|
+
super.disconnectedCallback(), document.removeEventListener("click", this.onDocumentClick), this.removeEventListener("focusout", this.onFocusOut), this.adapter.destroy(), this.subscriptions.forEach((e) => e.unsubscribe());
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
n([
|
|
147
|
+
D({ context: p.formContext }),
|
|
148
|
+
v({ attribute: !1 })
|
|
149
|
+
], s.prototype, "formContext", 2);
|
|
150
|
+
n([
|
|
151
|
+
C({ context: p.inputContext })
|
|
152
|
+
], s.prototype, "adapter", 2);
|
|
153
|
+
n([
|
|
154
|
+
h("#date-input")
|
|
155
|
+
], s.prototype, "dateInput", 2);
|
|
156
|
+
n([
|
|
157
|
+
h("#calendar-input")
|
|
158
|
+
], s.prototype, "calendarInput", 2);
|
|
159
|
+
n([
|
|
160
|
+
u()
|
|
161
|
+
], s.prototype, "isCalendarOpen", 2);
|
|
162
|
+
n([
|
|
163
|
+
u()
|
|
164
|
+
], s.prototype, "focusDate", 2);
|
|
165
|
+
s = n([
|
|
166
|
+
b("gui-range-date-picker-input")
|
|
167
|
+
], s);
|
|
168
|
+
export {
|
|
169
|
+
s as RangeDatePickerElement
|
|
170
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as n from "@golemui/lit";
|
|
2
|
+
import { consume as c, provide as l } from "@lit/context";
|
|
3
|
+
import { LitElement as u, html as h } from "lit";
|
|
4
|
+
import { property as m, customElement as f } from "lit/decorators.js";
|
|
5
|
+
var b = Object.defineProperty, g = Object.getOwnPropertyDescriptor, d = (r, e, a, s) => {
|
|
6
|
+
for (var t = s > 1 ? void 0 : s ? g(e, a) : e, o = r.length - 1, p; o >= 0; o--)
|
|
7
|
+
(p = r[o]) && (t = (s ? p(e, a, t) : p(t)) || t);
|
|
8
|
+
return s && t && b(e, a, t), t;
|
|
9
|
+
};
|
|
10
|
+
let i = class extends u {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments), this.adapter = new n.DisplayWidgetAdapter(), this.subscriptions = [];
|
|
13
|
+
}
|
|
14
|
+
createRenderRoot() {
|
|
15
|
+
return this;
|
|
16
|
+
}
|
|
17
|
+
updated(r) {
|
|
18
|
+
super.updated(r);
|
|
19
|
+
const e = this.adapter.templateData.size;
|
|
20
|
+
e ? this.style.flex = String(e) : this.style.removeProperty("flex");
|
|
21
|
+
}
|
|
22
|
+
connectedCallback() {
|
|
23
|
+
super.connectedCallback(), this.classList.add("gui-renderer", "gui-field"), this.adapter.context = this.formContext, this.adapter.init(this.widget), this.subscriptions.push(
|
|
24
|
+
this.adapter.templateDataChanged$.subscribe(() => this.requestUpdate())
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
render() {
|
|
28
|
+
return h`
|
|
29
|
+
<div class="gui-widget" id=${this.widget.uid}>${this.adapter.templateData.render}</div>
|
|
30
|
+
`;
|
|
31
|
+
}
|
|
32
|
+
disconnectedCallback() {
|
|
33
|
+
super.disconnectedCallback(), this.adapter.destroy(), this.subscriptions.forEach((r) => r.unsubscribe());
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
d([
|
|
37
|
+
c({ context: n.formContext }),
|
|
38
|
+
m({ attribute: !1 })
|
|
39
|
+
], i.prototype, "formContext", 2);
|
|
40
|
+
d([
|
|
41
|
+
l({ context: n.displayWidgetContext })
|
|
42
|
+
], i.prototype, "adapter", 2);
|
|
43
|
+
i = d([
|
|
44
|
+
f("gui-renderer-component")
|
|
45
|
+
], i);
|
|
46
|
+
export {
|
|
47
|
+
i as RendererElement
|
|
48
|
+
};
|