@nuraly/runtime 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ui/components/inputs/ColorPicker/colorpicker.ts +1 -7
- package/components/ui/components/inputs/Form/Form.ts +3 -11
- package/components/ui/components/inputs/RadioButton/Radio-button.ts +1 -7
- package/components/ui/components/inputs/Select/Select.ts +1 -7
- package/components/ui/components/layout/Grid/Col.ts +2 -6
- package/components/ui/components/layout/Grid/Row.ts +2 -6
- package/components/ui/components/studio/FunctionsPanel/FunctionsPanel.ts +4 -16
- package/dist/AIChat-DP3ZdLL3.js +220 -0
- package/dist/AIChat-km1IYaR-.js +260 -0
- package/dist/Badge-BR94MUt5.js +48 -0
- package/dist/Badge-DzNZFKtC.js +70 -0
- package/dist/{BaseElement-BNBn_IJk.js → BaseElement-pS6m_x6Q.js} +153 -24
- package/dist/Button-BHAN7npC.js +92 -0
- package/dist/Button-DCqgsxrL.js +80 -0
- package/dist/Card-B70c8NFb.js +150 -0
- package/dist/Card-DhOCsGKC.js +120 -0
- package/dist/Checkbox-BZTcPwew.js +59 -0
- package/dist/Checkbox-LYTIBAUV.js +65 -0
- package/dist/Code-BWbiciC8.js +123 -0
- package/dist/Code-Ds0vFclr.js +109 -0
- package/dist/{CodeEditor-B1gNuvPb.js → CodeEditor-ChuFC0ex.js} +22 -22
- package/dist/Col-B_wpWUcU.js +217 -0
- package/dist/Col-DYs8_65c.js +193 -0
- package/dist/Collapse-4kxbQ74u.js +74 -0
- package/dist/Collapse-Dkw6Ner6.js +96 -0
- package/dist/Collections-BSF-PqBz.js +122 -0
- package/dist/Collections-D5rwMFbv.js +151 -0
- package/dist/Container-DMNh5U4Y.js +204 -0
- package/dist/DatePicker-BmEOONiA.js +99 -0
- package/dist/DatePicker-VuUroOT4.js +80 -0
- package/dist/Divider-BfxR3rVl.js +86 -0
- package/dist/Divider-etMTYU3d.js +106 -0
- package/dist/Document-CHBcJciR.js +74 -0
- package/dist/Document-Cj-TmjAf.js +90 -0
- package/dist/Dropdown-BRtHvDa3.js +133 -0
- package/dist/Dropdown-C47Y11dj.js +112 -0
- package/dist/EmbedURL-BwbJRnY1.js +142 -0
- package/dist/EmbedURL-Ci5X1vQG.js +114 -0
- package/dist/FileUpload-BBgPcRag.js +54 -0
- package/dist/FileUpload-BgkhxtNe.js +47 -0
- package/dist/Form-BLq6U3In.js +339 -0
- package/dist/Form-E6zXqgsm.js +286 -0
- package/dist/Icon-CcLuhz6B.js +64 -0
- package/dist/Icon-_UiLblGb.js +74 -0
- package/dist/Image-B_VERIvH.js +111 -0
- package/dist/Image-hI8kIx8U.js +93 -0
- package/dist/Link-BVTo43Cc.js +76 -0
- package/dist/Link-xSrPxOLt.js +95 -0
- package/dist/Menu-CembLIjO.js +83 -0
- package/dist/Menu-D9ZjIOMg.js +73 -0
- package/dist/MicroApp-DI1kQwJk.js +100 -0
- package/dist/MicroApp-DJw57sLE.js +75 -0
- package/dist/NumberInput-DftAAKEs.js +84 -0
- package/dist/NumberInput-eOAk0-fb.js +95 -0
- package/dist/Panel-Bso5fv4i.js +127 -0
- package/dist/Panel-CwzW9iuA.js +161 -0
- package/dist/Radio-button-Sii5iveh.js +71 -0
- package/dist/Radio-button-YXsVqipQ.js +53 -0
- package/dist/RefComponent-Bwk_I0mK.js +79 -0
- package/dist/RefComponent-ZxafRVhZ.js +96 -0
- package/dist/RichText-CgYXXC_a.js +485 -0
- package/dist/RichText-DV46U7fI.js +449 -0
- package/dist/Row-Bb95f5DI.js +229 -0
- package/dist/Row-Dmd_61mR.js +202 -0
- package/dist/Select-Cma8JHAj.js +77 -0
- package/dist/Select-DqA08VYb.js +87 -0
- package/dist/Slider-B2_Qecjz.js +74 -0
- package/dist/Slider-DVY0N2YX.js +55 -0
- package/dist/Table-0WjrBnz-.js +159 -0
- package/dist/Table-dEma50kw.js +184 -0
- package/dist/Tabs-BDKEv1jn.js +131 -0
- package/dist/Tabs-Cvt3Q8vx.js +116 -0
- package/dist/Tag-BcZvQkE_.js +47 -0
- package/dist/Tag-DMZ0mu8y.js +61 -0
- package/dist/TextInput-KI6r9xET.js +193 -0
- package/dist/TextInput-hxK-HhJi.js +148 -0
- package/dist/TextLabel-DkV26yaL.js +102 -0
- package/dist/Textarea-Bzs3jSUm.js +117 -0
- package/dist/Textarea-CwK3SYbz.js +83 -0
- package/dist/Video-C4uBWCBb.js +100 -0
- package/dist/Video-CL1lgcvB.js +120 -0
- package/dist/aitchat-DjX5s7_8.js +23 -0
- package/dist/colorpicker-B-KETfWw.js +64 -0
- package/dist/colorpicker-DhB0AygJ.js +75 -0
- package/dist/constants-Bs_KQRi_.js +4 -0
- package/dist/constants-CXdpxgF2.js +4 -0
- package/dist/{cssMode-D82-gS78.js → cssMode-CV7QbFJv.js} +1 -1
- package/dist/{freemarker2-CYRLpyjt.js → freemarker2-CqQxSEZa.js} +1 -1
- package/dist/{handlebars-R8Efxi60.js → handlebars-a71LdN7X.js} +1 -1
- package/dist/{html-czhjovcp.js → html-D8UaB7IC.js} +1 -1
- package/dist/{htmlMode-DpyKDYYs.js → htmlMode-CqWQMFWX.js} +1 -1
- package/dist/iconbutton-DfnrRmmB.js +69 -0
- package/dist/iconbutton-DvIQHV8o.js +53 -0
- package/dist/{javascript-DwqkMEdb.js → javascript-D_jGqcRD.js} +1 -1
- package/dist/{jsonMode-Cmxxe0W9.js → jsonMode-C3-m5xts.js} +1 -1
- package/dist/{liquid-2spuEcBh.js → liquid-DLwYj6Te.js} +1 -1
- package/dist/{mdx-BjBXyEeR.js → mdx-DhYjhxkW.js} +1 -1
- package/dist/micro-app-entry-DiNqE6xi.js +12042 -0
- package/dist/micro-app.bundle.js +1 -1
- package/dist/micro-app.js +6 -4969
- package/dist/{python-DLI1ji08.js → python-B-WcGqFq.js} +1 -1
- package/dist/{razor-oAnIJsrL.js → razor-JGACy1mz.js} +1 -1
- package/dist/runtime.js +4 -2
- package/dist/{tsMode-D_PMsbjK.js → tsMode-lzBM1oT2.js} +1 -1
- package/dist/{typescript-Bu3ZbtQI.js → typescript-CuL5pdO2.js} +1 -1
- package/dist/{xml-CNSSkPqy.js → xml-D1tacAKD.js} +1 -1
- package/dist/{yaml-5RF_PGNe.js → yaml-CjPB1g7v.js} +1 -1
- package/package.json +1 -1
- package/utils/index.ts +4 -1
- package/utils/lazy-component-loader.ts +120 -0
- package/utils/register-components.ts +14 -40
- package/utils/render-util.ts +84 -0
- package/dist/micro-app-entry-DYAnCRDo.js +0 -15860
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { B as h, $ as d, n as u, A as m, o as p, r as $, b as c, c as f, d as C, t as v } from "./micro-app-entry-DiNqE6xi.js";
|
|
2
|
+
var b = Object.defineProperty, g = Object.getOwnPropertyDescriptor, a = (t, n, o, e) => {
|
|
3
|
+
for (var s = e > 1 ? void 0 : e ? g(n, o) : n, r = t.length - 1, l; r >= 0; r--)
|
|
4
|
+
(l = t[r]) && (s = (e ? l(n, o, s) : l(s)) || s);
|
|
5
|
+
return e && s && b(n, o, s), s;
|
|
6
|
+
};
|
|
7
|
+
let i = class extends h {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(), this.childrenComponents = [];
|
|
10
|
+
}
|
|
11
|
+
connectedCallback() {
|
|
12
|
+
super.connectedCallback();
|
|
13
|
+
}
|
|
14
|
+
updateChildrenComponents() {
|
|
15
|
+
this.childrenComponents = this.component?.childrenIds?.map((t) => d.get()[this.component?.application_id]?.find(
|
|
16
|
+
(n) => n.uuid === t
|
|
17
|
+
)).filter(Boolean) ?? [];
|
|
18
|
+
}
|
|
19
|
+
updated(t) {
|
|
20
|
+
t.has("component") && this.updateChildrenComponents();
|
|
21
|
+
}
|
|
22
|
+
renderComponent() {
|
|
23
|
+
const t = this.inputHandlersValue?.url ?? "#", n = this.inputHandlersValue?.target ?? "_self", o = this.inputHandlersValue?.label ?? this.inputHandlersValue?.placeholder ?? "";
|
|
24
|
+
return c`
|
|
25
|
+
<a
|
|
26
|
+
${u(this.inputRef)}
|
|
27
|
+
href=${this.isViewMode ? t : m}
|
|
28
|
+
target=${n}
|
|
29
|
+
style=${p({
|
|
30
|
+
...this.getStyles()
|
|
31
|
+
})}
|
|
32
|
+
@click=${(e) => {
|
|
33
|
+
this.isViewMode || e.preventDefault(), this.executeEvent("onClick", e, { url: t, target: n });
|
|
34
|
+
}}
|
|
35
|
+
@mouseenter=${(e) => {
|
|
36
|
+
this.executeEvent("onMouseEnter", e);
|
|
37
|
+
}}
|
|
38
|
+
@mouseleave=${(e) => {
|
|
39
|
+
this.executeEvent("onMouseLeave", e);
|
|
40
|
+
}}
|
|
41
|
+
>
|
|
42
|
+
<span>
|
|
43
|
+
${this.childrenComponents.length ? $(this.childrenComponents.map((e) => ({ ...e, item: this.item })), this.item, this.isViewMode) : c`
|
|
44
|
+
<nr-label
|
|
45
|
+
style=${p({
|
|
46
|
+
"--resolved-text-label-color": this.getStyles()["title-color"]
|
|
47
|
+
})}
|
|
48
|
+
>${o}</nr-label>
|
|
49
|
+
|
|
50
|
+
<drag-wrapper
|
|
51
|
+
.where=${"inside"}
|
|
52
|
+
.message=${"Drop inside"}
|
|
53
|
+
.component=${{ ...this.component }}
|
|
54
|
+
.inputRef=${this.inputRef}
|
|
55
|
+
.isDragInitiator=${this.isDragInitiator}
|
|
56
|
+
>
|
|
57
|
+
</drag-wrapper>
|
|
58
|
+
|
|
59
|
+
`}
|
|
60
|
+
</span>
|
|
61
|
+
</a>
|
|
62
|
+
`;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
a([
|
|
66
|
+
f({ type: Object })
|
|
67
|
+
], i.prototype, "component", 2);
|
|
68
|
+
a([
|
|
69
|
+
C()
|
|
70
|
+
], i.prototype, "childrenComponents", 2);
|
|
71
|
+
i = a([
|
|
72
|
+
v("link-block")
|
|
73
|
+
], i);
|
|
74
|
+
export {
|
|
75
|
+
i as LinkBlock
|
|
76
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { nothing, html } from 'lit';
|
|
2
|
+
import { property, state, customElement } from 'lit/decorators.js';
|
|
3
|
+
import { styleMap } from 'lit/directives/style-map.js';
|
|
4
|
+
import { ae as BaseElementBlock, $ as $components, aM as renderComponent } from './BaseElement-pS6m_x6Q.js';
|
|
5
|
+
import { ref } from 'lit/directives/ref.js';
|
|
6
|
+
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
10
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
11
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
12
|
+
if (decorator = decorators[i])
|
|
13
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
14
|
+
if (kind && result) __defProp(target, key, result);
|
|
15
|
+
return result;
|
|
16
|
+
};
|
|
17
|
+
let LinkBlock = class extends BaseElementBlock {
|
|
18
|
+
constructor() {
|
|
19
|
+
super();
|
|
20
|
+
this.childrenComponents = [];
|
|
21
|
+
}
|
|
22
|
+
connectedCallback() {
|
|
23
|
+
super.connectedCallback();
|
|
24
|
+
}
|
|
25
|
+
updateChildrenComponents() {
|
|
26
|
+
this.childrenComponents = this.component?.childrenIds?.map((id) => {
|
|
27
|
+
return $components.get()[this.component?.application_id]?.find(
|
|
28
|
+
(component) => component.uuid === id
|
|
29
|
+
);
|
|
30
|
+
}).filter(Boolean) ?? [];
|
|
31
|
+
}
|
|
32
|
+
updated(changedProperties) {
|
|
33
|
+
if (changedProperties.has("component")) {
|
|
34
|
+
this.updateChildrenComponents();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
renderComponent() {
|
|
38
|
+
const url = this.inputHandlersValue?.url ?? "#";
|
|
39
|
+
const target = this.inputHandlersValue?.target ?? "_self";
|
|
40
|
+
const label = this.inputHandlersValue?.label ?? this.inputHandlersValue?.placeholder ?? "";
|
|
41
|
+
return html`
|
|
42
|
+
<a
|
|
43
|
+
${ref(this.inputRef)}
|
|
44
|
+
href=${this.isViewMode ? url : nothing}
|
|
45
|
+
target=${target}
|
|
46
|
+
style=${styleMap({
|
|
47
|
+
...this.getStyles()
|
|
48
|
+
})}
|
|
49
|
+
@click=${(e) => {
|
|
50
|
+
if (!this.isViewMode) {
|
|
51
|
+
e.preventDefault();
|
|
52
|
+
}
|
|
53
|
+
this.executeEvent("onClick", e, { url, target });
|
|
54
|
+
}}
|
|
55
|
+
@mouseenter=${(e) => {
|
|
56
|
+
this.executeEvent("onMouseEnter", e);
|
|
57
|
+
}}
|
|
58
|
+
@mouseleave=${(e) => {
|
|
59
|
+
this.executeEvent("onMouseLeave", e);
|
|
60
|
+
}}
|
|
61
|
+
>
|
|
62
|
+
<span>
|
|
63
|
+
${this.childrenComponents.length ? renderComponent(this.childrenComponents.map((component) => ({ ...component, item: this.item })), this.item, this.isViewMode) : html`
|
|
64
|
+
<nr-label
|
|
65
|
+
style=${styleMap({
|
|
66
|
+
"--resolved-text-label-color": this.getStyles()["title-color"]
|
|
67
|
+
})}
|
|
68
|
+
>${label}</nr-label>
|
|
69
|
+
|
|
70
|
+
<drag-wrapper
|
|
71
|
+
.where=${"inside"}
|
|
72
|
+
.message=${"Drop inside"}
|
|
73
|
+
.component=${{ ...this.component }}
|
|
74
|
+
.inputRef=${this.inputRef}
|
|
75
|
+
.isDragInitiator=${this.isDragInitiator}
|
|
76
|
+
>
|
|
77
|
+
</drag-wrapper>
|
|
78
|
+
|
|
79
|
+
`}
|
|
80
|
+
</span>
|
|
81
|
+
</a>
|
|
82
|
+
`;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
__decorateClass([
|
|
86
|
+
property({ type: Object })
|
|
87
|
+
], LinkBlock.prototype, "component", 2);
|
|
88
|
+
__decorateClass([
|
|
89
|
+
state()
|
|
90
|
+
], LinkBlock.prototype, "childrenComponents", 2);
|
|
91
|
+
LinkBlock = __decorateClass([
|
|
92
|
+
customElement("link-block")
|
|
93
|
+
], LinkBlock);
|
|
94
|
+
|
|
95
|
+
export { LinkBlock };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { html, css } from 'lit';
|
|
2
|
+
import { property, customElement } from 'lit/decorators.js';
|
|
3
|
+
import { ae as BaseElementBlock } from './BaseElement-pS6m_x6Q.js';
|
|
4
|
+
import { ref } from 'lit/directives/ref.js';
|
|
5
|
+
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
9
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
10
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
11
|
+
if (decorator = decorators[i])
|
|
12
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
13
|
+
if (kind && result) __defProp(target, key, result);
|
|
14
|
+
return result;
|
|
15
|
+
};
|
|
16
|
+
try {
|
|
17
|
+
await import('@nuralyui/menu');
|
|
18
|
+
} catch (error) {
|
|
19
|
+
console.warn("[@nuralyui/menu] Package not found or failed to load. Menu functionality may be limited.");
|
|
20
|
+
}
|
|
21
|
+
let MenuBlock = class extends BaseElementBlock {
|
|
22
|
+
constructor() {
|
|
23
|
+
super();
|
|
24
|
+
}
|
|
25
|
+
renderComponent() {
|
|
26
|
+
return html`
|
|
27
|
+
|
|
28
|
+
<nr-menu
|
|
29
|
+
${ref(this.inputRef)}
|
|
30
|
+
class="${`drop-${this.component.uuid}`}"
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
placeholder="Select an option"
|
|
34
|
+
size=${this.inputHandlersValue?.size ?? "medium"}
|
|
35
|
+
arrowPosition=${this.inputHandlersValue?.arrowPosition ?? "right"}
|
|
36
|
+
.items=${this.inputHandlersValue?.options ?? []}
|
|
37
|
+
@change="${(e) => {
|
|
38
|
+
const selectedOptionPath = e.detail.path;
|
|
39
|
+
const selectedPage = this.inputHandlersValue.options[selectedOptionPath[0]]?.id;
|
|
40
|
+
const option = selectedOptionPath.reduce((acc, curr) => acc && acc.children && acc.children[curr], { children: this.inputHandlersValue?.options });
|
|
41
|
+
this.executeEvent("onSelect", e, {
|
|
42
|
+
id: option?.id,
|
|
43
|
+
text: option?.text,
|
|
44
|
+
type: option?.type,
|
|
45
|
+
page: selectedPage,
|
|
46
|
+
path: selectedOptionPath,
|
|
47
|
+
value: e.detail.value
|
|
48
|
+
});
|
|
49
|
+
}}"
|
|
50
|
+
@action-click="${(e) => {
|
|
51
|
+
this.executeEvent("onActionClick", e, {
|
|
52
|
+
value: e.detail.additionalData,
|
|
53
|
+
action: e.detail.value
|
|
54
|
+
});
|
|
55
|
+
}}">
|
|
56
|
+
</nr-menu>
|
|
57
|
+
`;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
MenuBlock.styles = [
|
|
61
|
+
css`
|
|
62
|
+
nr-menu {
|
|
63
|
+
--nuraly-menu-width: 100%;
|
|
64
|
+
|
|
65
|
+
}
|
|
66
|
+
:host {
|
|
67
|
+
display: block;
|
|
68
|
+
}
|
|
69
|
+
.error {
|
|
70
|
+
color: red;
|
|
71
|
+
background-color: black;
|
|
72
|
+
font-size: smaller;
|
|
73
|
+
}
|
|
74
|
+
`
|
|
75
|
+
];
|
|
76
|
+
__decorateClass([
|
|
77
|
+
property({ type: Object, reflect: false })
|
|
78
|
+
], MenuBlock.prototype, "component", 2);
|
|
79
|
+
MenuBlock = __decorateClass([
|
|
80
|
+
customElement("menu-block")
|
|
81
|
+
], MenuBlock);
|
|
82
|
+
|
|
83
|
+
export { MenuBlock };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { B as c, n as u, b as p, i as d, c as h, t as m } from "./micro-app-entry-DiNqE6xi.js";
|
|
2
|
+
var f = Object.defineProperty, v = Object.getOwnPropertyDescriptor, s = (e, n, i, o) => {
|
|
3
|
+
for (var t = o > 1 ? void 0 : o ? v(n, i) : n, l = e.length - 1, a; l >= 0; l--)
|
|
4
|
+
(a = e[l]) && (t = (o ? a(n, i, t) : a(t)) || t);
|
|
5
|
+
return o && t && f(n, i, t), t;
|
|
6
|
+
};
|
|
7
|
+
try {
|
|
8
|
+
await import("@nuralyui/menu");
|
|
9
|
+
} catch {
|
|
10
|
+
console.warn("[@nuralyui/menu] Package not found or failed to load. Menu functionality may be limited.");
|
|
11
|
+
}
|
|
12
|
+
let r = class extends c {
|
|
13
|
+
constructor() {
|
|
14
|
+
super();
|
|
15
|
+
}
|
|
16
|
+
renderComponent() {
|
|
17
|
+
return p`
|
|
18
|
+
|
|
19
|
+
<nr-menu
|
|
20
|
+
${u(this.inputRef)}
|
|
21
|
+
class="${`drop-${this.component.uuid}`}"
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
placeholder="Select an option"
|
|
25
|
+
size=${this.inputHandlersValue?.size ?? "medium"}
|
|
26
|
+
arrowPosition=${this.inputHandlersValue?.arrowPosition ?? "right"}
|
|
27
|
+
.items=${this.inputHandlersValue?.options ?? []}
|
|
28
|
+
@change="${(e) => {
|
|
29
|
+
const n = e.detail.path, i = this.inputHandlersValue.options[n[0]]?.id, o = n.reduce((t, l) => t && t.children && t.children[l], { children: this.inputHandlersValue?.options });
|
|
30
|
+
this.executeEvent("onSelect", e, {
|
|
31
|
+
id: o?.id,
|
|
32
|
+
text: o?.text,
|
|
33
|
+
type: o?.type,
|
|
34
|
+
page: i,
|
|
35
|
+
path: n,
|
|
36
|
+
value: e.detail.value
|
|
37
|
+
});
|
|
38
|
+
}}"
|
|
39
|
+
@action-click="${(e) => {
|
|
40
|
+
this.executeEvent("onActionClick", e, {
|
|
41
|
+
value: e.detail.additionalData,
|
|
42
|
+
action: e.detail.value
|
|
43
|
+
});
|
|
44
|
+
}}">
|
|
45
|
+
</nr-menu>
|
|
46
|
+
`;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
r.styles = [
|
|
50
|
+
d`
|
|
51
|
+
nr-menu {
|
|
52
|
+
--nuraly-menu-width: 100%;
|
|
53
|
+
|
|
54
|
+
}
|
|
55
|
+
:host {
|
|
56
|
+
display: block;
|
|
57
|
+
}
|
|
58
|
+
.error {
|
|
59
|
+
color: red;
|
|
60
|
+
background-color: black;
|
|
61
|
+
font-size: smaller;
|
|
62
|
+
}
|
|
63
|
+
`
|
|
64
|
+
];
|
|
65
|
+
s([
|
|
66
|
+
h({ type: Object, reflect: !1 })
|
|
67
|
+
], r.prototype, "component", 2);
|
|
68
|
+
r = s([
|
|
69
|
+
m("menu-block")
|
|
70
|
+
], r);
|
|
71
|
+
export {
|
|
72
|
+
r as MenuBlock
|
|
73
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { nothing, html, css } from 'lit';
|
|
2
|
+
import { property, customElement } from 'lit/decorators.js';
|
|
3
|
+
import { styleMap } from 'lit/directives/style-map.js';
|
|
4
|
+
import { ae as BaseElementBlock, a0 as $microAppCurrentPage, j as $environment, a4 as ViewMode, $ as $components } from './BaseElement-pS6m_x6Q.js';
|
|
5
|
+
|
|
6
|
+
function debounce(func, wait = 300) {
|
|
7
|
+
let timeout;
|
|
8
|
+
return function(...args) {
|
|
9
|
+
clearTimeout(timeout);
|
|
10
|
+
timeout = setTimeout(() => func.apply(this, args), wait);
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
var __defProp = Object.defineProperty;
|
|
15
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
16
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
17
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
18
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
19
|
+
if (decorator = decorators[i])
|
|
20
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
21
|
+
if (kind && result) __defProp(target, key, result);
|
|
22
|
+
return result;
|
|
23
|
+
};
|
|
24
|
+
let MicroAppBlock = class extends BaseElementBlock {
|
|
25
|
+
constructor() {
|
|
26
|
+
super();
|
|
27
|
+
}
|
|
28
|
+
connectedCallback() {
|
|
29
|
+
super.connectedCallback();
|
|
30
|
+
const pageUUID = $microAppCurrentPage.get()["84105b5d-49fe-4724-bc0e-325b578cbe17"];
|
|
31
|
+
this.registerCallback("appUUID", debounce((appUUID) => {
|
|
32
|
+
if (appUUID) {
|
|
33
|
+
const appLoaded = $components.get()[appUUID];
|
|
34
|
+
if (appLoaded === void 0) {
|
|
35
|
+
fetch("/api/components/application/" + appUUID).then((response) => response.json()).then((data) => {
|
|
36
|
+
return data.map((component) => component.component);
|
|
37
|
+
}).then((data) => {
|
|
38
|
+
if (pageUUID)
|
|
39
|
+
data = data.filter((component) => component.pageId === pageUUID);
|
|
40
|
+
$components.setKey(appUUID, data);
|
|
41
|
+
this.requestUpdate();
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}, 0));
|
|
46
|
+
this.unsubscribe = $environment.subscribe((environment) => {
|
|
47
|
+
this.mode = environment.mode;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
disconnectedCallback() {
|
|
51
|
+
super.disconnectedCallback();
|
|
52
|
+
this.unregisterCallback("appUUID");
|
|
53
|
+
if (this.unsubscribe) {
|
|
54
|
+
this.unsubscribe();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
render() {
|
|
58
|
+
const isPreviewMode = this.inputHandlersValue.mode === ViewMode.Preview;
|
|
59
|
+
return html`
|
|
60
|
+
${this.inputHandlersValue.appUUID ? html`
|
|
61
|
+
<micro-app
|
|
62
|
+
uuid=${this.inputHandlersValue.appUUID}
|
|
63
|
+
componentToRenderUUID=${this.inputHandlersValue.componentToRenderUUID ?? nothing}
|
|
64
|
+
style=${styleMap({
|
|
65
|
+
pointerEvents: isPreviewMode ? "auto" : "none"
|
|
66
|
+
})}
|
|
67
|
+
></micro-app>
|
|
68
|
+
` : html`
|
|
69
|
+
<div class="no-app-selected">
|
|
70
|
+
No micro-app selected
|
|
71
|
+
</div>
|
|
72
|
+
`}
|
|
73
|
+
`;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
MicroAppBlock.styles = [
|
|
77
|
+
css`
|
|
78
|
+
.no-app-selected {
|
|
79
|
+
display: flex;
|
|
80
|
+
justify-content: center;
|
|
81
|
+
align-items: center;
|
|
82
|
+
height: 200px;
|
|
83
|
+
width:400px;
|
|
84
|
+
border: 2px dashed gray;
|
|
85
|
+
color: gray;
|
|
86
|
+
text-align: center;
|
|
87
|
+
}
|
|
88
|
+
`
|
|
89
|
+
];
|
|
90
|
+
__decorateClass([
|
|
91
|
+
property({ type: Object })
|
|
92
|
+
], MicroAppBlock.prototype, "component", 2);
|
|
93
|
+
__decorateClass([
|
|
94
|
+
property({ type: Object })
|
|
95
|
+
], MicroAppBlock.prototype, "item", 2);
|
|
96
|
+
MicroAppBlock = __decorateClass([
|
|
97
|
+
customElement("micro-app-block")
|
|
98
|
+
], MicroAppBlock);
|
|
99
|
+
|
|
100
|
+
export { MicroAppBlock };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { B as d, y as b, z as m, V as h, A as f, o as v, b as c, $ as l, i as y, c as u, t as g } from "./micro-app-entry-DiNqE6xi.js";
|
|
2
|
+
function U(o, t = 300) {
|
|
3
|
+
let s;
|
|
4
|
+
return function(...e) {
|
|
5
|
+
clearTimeout(s), s = setTimeout(() => o.apply(this, e), t);
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
var C = Object.defineProperty, $ = Object.getOwnPropertyDescriptor, a = (o, t, s, e) => {
|
|
9
|
+
for (var n = e > 1 ? void 0 : e ? $(t, s) : t, i = o.length - 1, p; i >= 0; i--)
|
|
10
|
+
(p = o[i]) && (n = (e ? p(t, s, n) : p(n)) || n);
|
|
11
|
+
return e && n && C(t, s, n), n;
|
|
12
|
+
};
|
|
13
|
+
let r = class extends d {
|
|
14
|
+
constructor() {
|
|
15
|
+
super();
|
|
16
|
+
}
|
|
17
|
+
connectedCallback() {
|
|
18
|
+
super.connectedCallback();
|
|
19
|
+
const o = b.get()["84105b5d-49fe-4724-bc0e-325b578cbe17"];
|
|
20
|
+
this.registerCallback("appUUID", U((t) => {
|
|
21
|
+
t && l.get()[t] === void 0 && fetch("/api/components/application/" + t).then((e) => e.json()).then((e) => e.map((n) => n.component)).then((e) => {
|
|
22
|
+
o && (e = e.filter((n) => n.pageId === o)), l.setKey(t, e), this.requestUpdate();
|
|
23
|
+
});
|
|
24
|
+
}, 0)), this.unsubscribe = m.subscribe((t) => {
|
|
25
|
+
this.mode = t.mode;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
disconnectedCallback() {
|
|
29
|
+
super.disconnectedCallback(), this.unregisterCallback("appUUID"), this.unsubscribe && this.unsubscribe();
|
|
30
|
+
}
|
|
31
|
+
render() {
|
|
32
|
+
const o = this.inputHandlersValue.mode === h.Preview;
|
|
33
|
+
return c`
|
|
34
|
+
${this.inputHandlersValue.appUUID ? c`
|
|
35
|
+
<micro-app
|
|
36
|
+
uuid=${this.inputHandlersValue.appUUID}
|
|
37
|
+
componentToRenderUUID=${this.inputHandlersValue.componentToRenderUUID ?? f}
|
|
38
|
+
style=${v({
|
|
39
|
+
pointerEvents: o ? "auto" : "none"
|
|
40
|
+
})}
|
|
41
|
+
></micro-app>
|
|
42
|
+
` : c`
|
|
43
|
+
<div class="no-app-selected">
|
|
44
|
+
No micro-app selected
|
|
45
|
+
</div>
|
|
46
|
+
`}
|
|
47
|
+
`;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
r.styles = [
|
|
51
|
+
y`
|
|
52
|
+
.no-app-selected {
|
|
53
|
+
display: flex;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
align-items: center;
|
|
56
|
+
height: 200px;
|
|
57
|
+
width:400px;
|
|
58
|
+
border: 2px dashed gray;
|
|
59
|
+
color: gray;
|
|
60
|
+
text-align: center;
|
|
61
|
+
}
|
|
62
|
+
`
|
|
63
|
+
];
|
|
64
|
+
a([
|
|
65
|
+
u({ type: Object })
|
|
66
|
+
], r.prototype, "component", 2);
|
|
67
|
+
a([
|
|
68
|
+
u({ type: Object })
|
|
69
|
+
], r.prototype, "item", 2);
|
|
70
|
+
r = a([
|
|
71
|
+
g("micro-app-block")
|
|
72
|
+
], r);
|
|
73
|
+
export {
|
|
74
|
+
r as MicroAppBlock
|
|
75
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { B as d, n as h, o as c, A as n, b, i as $, c as p, t as m } from "./micro-app-entry-DiNqE6xi.js";
|
|
2
|
+
var v = Object.defineProperty, y = Object.getOwnPropertyDescriptor, o = (t, l, r, e) => {
|
|
3
|
+
for (var a = e > 1 ? void 0 : e ? y(l, r) : l, u = t.length - 1, i; u >= 0; u--)
|
|
4
|
+
(i = t[u]) && (a = (e ? i(l, r, a) : i(a)) || a);
|
|
5
|
+
return e && a && v(l, r, a), a;
|
|
6
|
+
};
|
|
7
|
+
try {
|
|
8
|
+
await import("@nuralyui/input");
|
|
9
|
+
} catch {
|
|
10
|
+
console.warn("[@nuralyui/input] Package not found or failed to load.");
|
|
11
|
+
}
|
|
12
|
+
let s = class extends d {
|
|
13
|
+
render() {
|
|
14
|
+
const t = this.getStyles(), r = (this.component?.style || {})?.size || "medium";
|
|
15
|
+
return b`
|
|
16
|
+
<span>
|
|
17
|
+
<nr-input
|
|
18
|
+
${h(this.inputRef)}
|
|
19
|
+
style=${c({
|
|
20
|
+
...t,
|
|
21
|
+
"--nuraly-input-local-border-top-left-radius": t?.["border-top-left-radius"] ?? "",
|
|
22
|
+
"--nuraly-input-local-border-top-right-radius": t?.["border-top-right-radius"] ?? "",
|
|
23
|
+
"--nuraly-input-local-border-bottom-left-radius": t?.["border-bottom-left-radius"] ?? "",
|
|
24
|
+
"--nuraly-input-local-border-bottom-right-radius": t?.["border-bottom-right-radius"] ?? ""
|
|
25
|
+
})}
|
|
26
|
+
.value=${this.inputHandlersValue?.value ?? n}
|
|
27
|
+
.size=${r}
|
|
28
|
+
.state=${this.inputHandlersValue?.status ?? n}
|
|
29
|
+
.type=${"number"}
|
|
30
|
+
.variant=${this.inputHandlersValue?.variant ?? n}
|
|
31
|
+
.disabled=${this.inputHandlersValue?.state === "disabled"}
|
|
32
|
+
.readonly=${this.inputHandlersValue?.readonly || !1}
|
|
33
|
+
.placeholder=${this.inputHandlersValue?.placeholder ?? "Number input"}
|
|
34
|
+
.step=${this.inputHandlersValue?.step ?? n}
|
|
35
|
+
.min=${this.inputHandlersValue?.min ?? "0"}
|
|
36
|
+
.max=${this.inputHandlersValue?.max ?? n}
|
|
37
|
+
.name=${this.inputHandlersValue?.name ?? n}
|
|
38
|
+
.required=${this.inputHandlersValue?.required || !1}
|
|
39
|
+
.rules=${this.inputHandlersValue?.rules ?? []}
|
|
40
|
+
.validateOnChangeInput=${this.inputHandlersValue?.validateOnChange !== !1}
|
|
41
|
+
.validateOnBlurInput=${this.inputHandlersValue?.validateOnBlur !== !1}
|
|
42
|
+
.hasFeedback=${this.inputHandlersValue?.hasFeedback || !1}
|
|
43
|
+
@nr-input=${(e) => {
|
|
44
|
+
this.executeEvent("onChange", e, {
|
|
45
|
+
value: e.detail.value,
|
|
46
|
+
oldValue: e.detail.oldValue
|
|
47
|
+
});
|
|
48
|
+
}}
|
|
49
|
+
@nr-focus=${(e) => {
|
|
50
|
+
this.executeEvent("onFocus", e);
|
|
51
|
+
}}
|
|
52
|
+
@nr-blur=${(e) => {
|
|
53
|
+
this.executeEvent("onBlur", e);
|
|
54
|
+
}}
|
|
55
|
+
@nr-enter=${(e) => {
|
|
56
|
+
this.executeEvent("onEnter", e);
|
|
57
|
+
}}
|
|
58
|
+
>
|
|
59
|
+
<span slot="label">
|
|
60
|
+
${this.inputHandlersValue?.label ?? ""}
|
|
61
|
+
</span>
|
|
62
|
+
<span slot="helper-text">
|
|
63
|
+
${this.inputHandlersValue?.helper ?? ""}
|
|
64
|
+
</span>
|
|
65
|
+
</nr-input>
|
|
66
|
+
</span>
|
|
67
|
+
`;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
s.styles = [
|
|
71
|
+
$``
|
|
72
|
+
];
|
|
73
|
+
o([
|
|
74
|
+
p({ type: Object })
|
|
75
|
+
], s.prototype, "component", 2);
|
|
76
|
+
o([
|
|
77
|
+
p({ type: Object })
|
|
78
|
+
], s.prototype, "item", 2);
|
|
79
|
+
s = o([
|
|
80
|
+
m("number-input-block")
|
|
81
|
+
], s);
|
|
82
|
+
export {
|
|
83
|
+
s as NumberInputBlock
|
|
84
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { nothing, html, css } from 'lit';
|
|
2
|
+
import { property, customElement } from 'lit/decorators.js';
|
|
3
|
+
import { styleMap } from 'lit/directives/style-map.js';
|
|
4
|
+
import { ae as BaseElementBlock } from './BaseElement-pS6m_x6Q.js';
|
|
5
|
+
import { ref } from 'lit/directives/ref.js';
|
|
6
|
+
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
10
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
11
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
12
|
+
if (decorator = decorators[i])
|
|
13
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
14
|
+
if (kind && result) __defProp(target, key, result);
|
|
15
|
+
return result;
|
|
16
|
+
};
|
|
17
|
+
try {
|
|
18
|
+
await import('@nuralyui/input');
|
|
19
|
+
} catch (error) {
|
|
20
|
+
console.warn("[@nuralyui/input] Package not found or failed to load.");
|
|
21
|
+
}
|
|
22
|
+
let NumberInputBlock = class extends BaseElementBlock {
|
|
23
|
+
render() {
|
|
24
|
+
const inputStyles = this.getStyles();
|
|
25
|
+
const componentStyles = this.component?.style || {};
|
|
26
|
+
const size = componentStyles?.size || "medium";
|
|
27
|
+
return html`
|
|
28
|
+
<span>
|
|
29
|
+
<nr-input
|
|
30
|
+
${ref(this.inputRef)}
|
|
31
|
+
style=${styleMap({
|
|
32
|
+
...inputStyles,
|
|
33
|
+
"--nuraly-input-local-border-top-left-radius": inputStyles?.["border-top-left-radius"] ?? "",
|
|
34
|
+
"--nuraly-input-local-border-top-right-radius": inputStyles?.["border-top-right-radius"] ?? "",
|
|
35
|
+
"--nuraly-input-local-border-bottom-left-radius": inputStyles?.["border-bottom-left-radius"] ?? "",
|
|
36
|
+
"--nuraly-input-local-border-bottom-right-radius": inputStyles?.["border-bottom-right-radius"] ?? ""
|
|
37
|
+
})}
|
|
38
|
+
.value=${this.inputHandlersValue?.value ?? nothing}
|
|
39
|
+
.size=${size}
|
|
40
|
+
.state=${this.inputHandlersValue?.status ?? nothing}
|
|
41
|
+
.type=${"number"}
|
|
42
|
+
.variant=${this.inputHandlersValue?.variant ?? nothing}
|
|
43
|
+
.disabled=${this.inputHandlersValue?.state === "disabled"}
|
|
44
|
+
.readonly=${this.inputHandlersValue?.readonly || false}
|
|
45
|
+
.placeholder=${this.inputHandlersValue?.placeholder ?? "Number input"}
|
|
46
|
+
.step=${this.inputHandlersValue?.step ?? nothing}
|
|
47
|
+
.min=${this.inputHandlersValue?.min ?? "0"}
|
|
48
|
+
.max=${this.inputHandlersValue?.max ?? nothing}
|
|
49
|
+
.name=${this.inputHandlersValue?.name ?? nothing}
|
|
50
|
+
.required=${this.inputHandlersValue?.required || false}
|
|
51
|
+
.rules=${this.inputHandlersValue?.rules ?? []}
|
|
52
|
+
.validateOnChangeInput=${this.inputHandlersValue?.validateOnChange !== false}
|
|
53
|
+
.validateOnBlurInput=${this.inputHandlersValue?.validateOnBlur !== false}
|
|
54
|
+
.hasFeedback=${this.inputHandlersValue?.hasFeedback || false}
|
|
55
|
+
@nr-input=${(e) => {
|
|
56
|
+
this.executeEvent("onChange", e, {
|
|
57
|
+
value: e.detail.value,
|
|
58
|
+
oldValue: e.detail.oldValue
|
|
59
|
+
});
|
|
60
|
+
}}
|
|
61
|
+
@nr-focus=${(e) => {
|
|
62
|
+
this.executeEvent("onFocus", e);
|
|
63
|
+
}}
|
|
64
|
+
@nr-blur=${(e) => {
|
|
65
|
+
this.executeEvent("onBlur", e);
|
|
66
|
+
}}
|
|
67
|
+
@nr-enter=${(e) => {
|
|
68
|
+
this.executeEvent("onEnter", e);
|
|
69
|
+
}}
|
|
70
|
+
>
|
|
71
|
+
<span slot="label">
|
|
72
|
+
${this.inputHandlersValue?.label ?? ""}
|
|
73
|
+
</span>
|
|
74
|
+
<span slot="helper-text">
|
|
75
|
+
${this.inputHandlersValue?.helper ?? ""}
|
|
76
|
+
</span>
|
|
77
|
+
</nr-input>
|
|
78
|
+
</span>
|
|
79
|
+
`;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
NumberInputBlock.styles = [
|
|
83
|
+
css``
|
|
84
|
+
];
|
|
85
|
+
__decorateClass([
|
|
86
|
+
property({ type: Object })
|
|
87
|
+
], NumberInputBlock.prototype, "component", 2);
|
|
88
|
+
__decorateClass([
|
|
89
|
+
property({ type: Object })
|
|
90
|
+
], NumberInputBlock.prototype, "item", 2);
|
|
91
|
+
NumberInputBlock = __decorateClass([
|
|
92
|
+
customElement("number-input-block")
|
|
93
|
+
], NumberInputBlock);
|
|
94
|
+
|
|
95
|
+
export { NumberInputBlock };
|