@nuraly/runtime 0.1.9 → 0.1.11

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.
Files changed (114) hide show
  1. package/components/ui/components/base/controllers/InputHandlerController.ts +5 -0
  2. package/components/ui/components/inputs/ColorPicker/colorpicker.ts +1 -7
  3. package/components/ui/components/inputs/Form/Form.ts +3 -11
  4. package/components/ui/components/inputs/RadioButton/Radio-button.ts +1 -7
  5. package/components/ui/components/inputs/Select/Select.ts +1 -7
  6. package/components/ui/components/layout/Grid/Col.ts +2 -6
  7. package/components/ui/components/layout/Grid/Row.ts +2 -6
  8. package/components/ui/components/studio/FunctionsPanel/FunctionsPanel.ts +4 -16
  9. package/dist/AIChat-C-wFf4PD.js +220 -0
  10. package/dist/AIChat-Cly-frW6.js +260 -0
  11. package/dist/Badge-BUm76SZ2.js +70 -0
  12. package/dist/Badge-BarGcY8u.js +48 -0
  13. package/dist/{BaseElement-BNBn_IJk.js → BaseElement-wyA58UxT.js} +156 -24
  14. package/dist/Button-BEgayuX9.js +80 -0
  15. package/dist/Button-wgwjzM_f.js +92 -0
  16. package/dist/Card-B4r5RQgn.js +120 -0
  17. package/dist/Card-a1sdDpKe.js +150 -0
  18. package/dist/Checkbox-CC9PkwpC.js +59 -0
  19. package/dist/Checkbox-WVmAN9ZP.js +65 -0
  20. package/dist/Code-Dc66ui4C.js +109 -0
  21. package/dist/Code-kVoVXBbt.js +123 -0
  22. package/dist/{CodeEditor-B1gNuvPb.js → CodeEditor-2QHTZxKN.js} +22 -22
  23. package/dist/Col-BKbQ2o0P.js +217 -0
  24. package/dist/Col-x4rRO4dz.js +193 -0
  25. package/dist/Collapse-Dd2GfevD.js +74 -0
  26. package/dist/Collapse-Xo-jb8zs.js +96 -0
  27. package/dist/Collections-DEqUHWFe.js +151 -0
  28. package/dist/Collections-DsTr-Zt7.js +122 -0
  29. package/dist/Container-C1HjQgb7.js +204 -0
  30. package/dist/DatePicker-DRVwFJmL.js +99 -0
  31. package/dist/DatePicker-oAOJyU3e.js +80 -0
  32. package/dist/Divider-BMA6S7Pd.js +106 -0
  33. package/dist/Divider-zbcO-KF9.js +86 -0
  34. package/dist/Document-BqVezrmJ.js +90 -0
  35. package/dist/Document-C2lg-jdj.js +74 -0
  36. package/dist/Dropdown-BRN-hpgd.js +133 -0
  37. package/dist/Dropdown-j62nqdd-.js +112 -0
  38. package/dist/EmbedURL-Bgr2pdf_.js +114 -0
  39. package/dist/EmbedURL-DFt6rN3J.js +142 -0
  40. package/dist/FileUpload-B5TBQJPC.js +54 -0
  41. package/dist/FileUpload-sYxMn9Rj.js +47 -0
  42. package/dist/Form-7ZWgBVzR.js +286 -0
  43. package/dist/Form-CsN7UMF-.js +339 -0
  44. package/dist/Icon-B_2ZWGd0.js +64 -0
  45. package/dist/Icon-CkLIObME.js +74 -0
  46. package/dist/Image-CcswllGj.js +93 -0
  47. package/dist/Image-CihbGdKt.js +111 -0
  48. package/dist/Link-BEUscah_.js +95 -0
  49. package/dist/Link-C4HV3i5L.js +76 -0
  50. package/dist/Menu-B98hcumz.js +83 -0
  51. package/dist/Menu-BEzo-k-M.js +73 -0
  52. package/dist/MicroApp-BDPSu_XC.js +75 -0
  53. package/dist/MicroApp-DCBOKAJ4.js +100 -0
  54. package/dist/NumberInput-Bbo10XmQ.js +95 -0
  55. package/dist/NumberInput-YJKsJDcd.js +84 -0
  56. package/dist/Panel-C1tcqveD.js +161 -0
  57. package/dist/Panel-DidE5uT5.js +127 -0
  58. package/dist/Radio-button-CuVS3-fC.js +71 -0
  59. package/dist/Radio-button-Cxj0bL8i.js +53 -0
  60. package/dist/RefComponent-BgOcavVg.js +79 -0
  61. package/dist/RefComponent-DTerPZ8J.js +96 -0
  62. package/dist/RichText-BiZgSdNO.js +449 -0
  63. package/dist/RichText-CwMNVuR_.js +485 -0
  64. package/dist/Row-BEx5bGTR.js +202 -0
  65. package/dist/Row-XczXHjOV.js +229 -0
  66. package/dist/Select-Bd16OOiE.js +87 -0
  67. package/dist/Select-D0xinu-U.js +77 -0
  68. package/dist/Slider-BVFPWYh3.js +55 -0
  69. package/dist/Slider-DGulvswN.js +74 -0
  70. package/dist/Table-C44wa8yn.js +159 -0
  71. package/dist/Table-CQiS_Q-s.js +184 -0
  72. package/dist/Tabs-CPQxFISc.js +131 -0
  73. package/dist/Tabs-DW2Su8xF.js +116 -0
  74. package/dist/Tag-BEfAQrjG.js +61 -0
  75. package/dist/Tag-BLxTFDcC.js +47 -0
  76. package/dist/TextInput-BWhdGS3a.js +148 -0
  77. package/dist/TextInput-CV850FvO.js +193 -0
  78. package/dist/TextLabel-CbSGmoVY.js +102 -0
  79. package/dist/Textarea-Bncyxfts.js +83 -0
  80. package/dist/Textarea-SEbx4KI5.js +117 -0
  81. package/dist/Video--shJ014h.js +120 -0
  82. package/dist/Video-CflXfaiK.js +100 -0
  83. package/dist/aitchat-Btz9TPEN.js +23 -0
  84. package/dist/colorpicker-BO_4CeX4.js +64 -0
  85. package/dist/colorpicker-UzXsx6gP.js +75 -0
  86. package/dist/constants-Bs_KQRi_.js +4 -0
  87. package/dist/constants-CXdpxgF2.js +4 -0
  88. package/dist/{cssMode-D82-gS78.js → cssMode-tpaxIZJS.js} +1 -1
  89. package/dist/{freemarker2-CYRLpyjt.js → freemarker2-Nx-tkO9y.js} +1 -1
  90. package/dist/{handlebars-R8Efxi60.js → handlebars-CF3Jmmto.js} +1 -1
  91. package/dist/{html-czhjovcp.js → html-CdZEJTJR.js} +1 -1
  92. package/dist/{htmlMode-DpyKDYYs.js → htmlMode-CztruwTl.js} +1 -1
  93. package/dist/iconbutton-BwuZYQyh.js +53 -0
  94. package/dist/iconbutton-CE0Vxu1G.js +69 -0
  95. package/dist/{javascript-DwqkMEdb.js → javascript-CVODTc2t.js} +1 -1
  96. package/dist/{jsonMode-Cmxxe0W9.js → jsonMode-ChPl6moP.js} +1 -1
  97. package/dist/{liquid-2spuEcBh.js → liquid-BckHw388.js} +1 -1
  98. package/dist/{mdx-BjBXyEeR.js → mdx-DB1fiwuN.js} +1 -1
  99. package/dist/micro-app-entry-BgDXbkmh.js +12042 -0
  100. package/dist/micro-app.bundle.js +1 -1
  101. package/dist/micro-app.js +6 -4969
  102. package/dist/{python-DLI1ji08.js → python-DOQt67t7.js} +1 -1
  103. package/dist/{razor-oAnIJsrL.js → razor-D65ZeXuP.js} +1 -1
  104. package/dist/runtime.js +4 -2
  105. package/dist/{tsMode-D_PMsbjK.js → tsMode-CXrSAnjJ.js} +1 -1
  106. package/dist/{typescript-Bu3ZbtQI.js → typescript-BuKvlC_a.js} +1 -1
  107. package/dist/{xml-CNSSkPqy.js → xml-_nj2r-yt.js} +1 -1
  108. package/dist/{yaml-5RF_PGNe.js → yaml-m8PrW_TL.js} +1 -1
  109. package/package.json +1 -1
  110. package/utils/index.ts +4 -1
  111. package/utils/lazy-component-loader.ts +120 -0
  112. package/utils/register-components.ts +14 -40
  113. package/utils/render-util.ts +84 -0
  114. package/dist/micro-app-entry-DYAnCRDo.js +0 -15860
@@ -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-wyA58UxT.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,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-BgDXbkmh.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,83 @@
1
+ import { html, css } from 'lit';
2
+ import { property, customElement } from 'lit/decorators.js';
3
+ import { ae as BaseElementBlock } from './BaseElement-wyA58UxT.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-BgDXbkmh.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,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-BgDXbkmh.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,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-wyA58UxT.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,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-wyA58UxT.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 };
@@ -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-BgDXbkmh.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
+ };