@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,106 @@
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/divider');
19
+ } catch (error) {
20
+ console.warn("[@nuralyui/divider] Package not found or failed to load.");
21
+ }
22
+ let DividerBlock = class extends BaseElementBlock {
23
+ connectedCallback() {
24
+ super.connectedCallback();
25
+ this.registerCallback("value", () => {
26
+ });
27
+ this.updateHostAttribute();
28
+ }
29
+ updated(changedProperties) {
30
+ super.updated(changedProperties);
31
+ this.updateHostAttribute();
32
+ }
33
+ updateHostAttribute() {
34
+ const direction = this.inputHandlersValue?.direction ?? "horizontal";
35
+ this.setAttribute("data-type", direction);
36
+ }
37
+ disconnectedCallback() {
38
+ super.disconnectedCallback();
39
+ if (this.unsubscribe) this.unsubscribe();
40
+ }
41
+ render() {
42
+ const dividerStyles = this.component?.style || {};
43
+ const dividerAutoWidth = this.inputHandlersValue?.width;
44
+ const dividerAutoHeight = this.inputHandlersValue?.height;
45
+ const isVertical = (this.inputHandlersValue?.direction ?? "horizontal") === "vertical";
46
+ const filteredStyles = { ...dividerStyles };
47
+ if (isVertical && dividerAutoHeight) {
48
+ delete filteredStyles.height;
49
+ }
50
+ return html`
51
+ ${!this.inputHandlersValue?.display || this.inputHandlersValue.display == "show" ? html`
52
+ <nr-divider
53
+ ${ref(this.inputRef)}
54
+ style=${styleMap({
55
+ ...filteredStyles,
56
+ width: dividerAutoWidth ? "100%" : dividerStyles.width,
57
+ height: !isVertical && dividerAutoHeight ? "auto" : filteredStyles.height
58
+ })}
59
+ type=${this.inputHandlersValue?.direction ?? "horizontal"}
60
+ .variant=${this.inputHandlersValue?.variant || "solid"}
61
+ .orientation=${this.inputHandlersValue?.textOrientation || "center"}
62
+ .orientationMargin=${this.inputHandlersValue?.orientationMargin ?? nothing}
63
+ .plain=${this.inputHandlersValue?.plain !== false}
64
+ .size=${this.inputHandlersValue?.size ?? nothing}
65
+ .dashed=${this.inputHandlersValue?.dashed || false}
66
+ @click=${(e) => {
67
+ this.executeEvent("onClick", e);
68
+ }}
69
+ >
70
+ ${this.inputHandlersValue?.text || ""}
71
+ </nr-divider>
72
+ ` : nothing}
73
+ `;
74
+ }
75
+ };
76
+ DividerBlock.styles = [
77
+ css`
78
+ :host {
79
+ display: block;
80
+ width: 100%;
81
+ }
82
+
83
+ :host([data-type="vertical"]) {
84
+ display: inline-flex;
85
+ width: auto;
86
+ align-self: stretch; /* This makes it fill the parent's height in flexbox */
87
+ }
88
+
89
+ :host([data-type="vertical"]) nr-divider {
90
+ height: 100%;
91
+ display: flex;
92
+ align-items: stretch;
93
+ }
94
+ `
95
+ ];
96
+ __decorateClass([
97
+ property({ type: Object })
98
+ ], DividerBlock.prototype, "component", 2);
99
+ __decorateClass([
100
+ property({ type: Object })
101
+ ], DividerBlock.prototype, "item", 2);
102
+ DividerBlock = __decorateClass([
103
+ customElement("divider-block")
104
+ ], DividerBlock);
105
+
106
+ export { DividerBlock };
@@ -0,0 +1,86 @@
1
+ import { B as c, A as d, n as p, o as v, b as h, i as b, c as u, t as y } from "./micro-app-entry-BgDXbkmh.js";
2
+ var f = Object.defineProperty, H = Object.getOwnPropertyDescriptor, o = (e, a, s, i) => {
3
+ for (var t = i > 1 ? void 0 : i ? H(a, s) : a, n = e.length - 1, r; n >= 0; n--)
4
+ (r = e[n]) && (t = (i ? r(a, s, t) : r(t)) || t);
5
+ return i && t && f(a, s, t), t;
6
+ };
7
+ try {
8
+ await import("@nuralyui/divider");
9
+ } catch {
10
+ console.warn("[@nuralyui/divider] Package not found or failed to load.");
11
+ }
12
+ let l = class extends c {
13
+ connectedCallback() {
14
+ super.connectedCallback(), this.registerCallback("value", () => {
15
+ }), this.updateHostAttribute();
16
+ }
17
+ updated(e) {
18
+ super.updated(e), this.updateHostAttribute();
19
+ }
20
+ updateHostAttribute() {
21
+ const e = this.inputHandlersValue?.direction ?? "horizontal";
22
+ this.setAttribute("data-type", e);
23
+ }
24
+ disconnectedCallback() {
25
+ super.disconnectedCallback(), this.unsubscribe && this.unsubscribe();
26
+ }
27
+ render() {
28
+ const e = this.component?.style || {}, a = this.inputHandlersValue?.width, s = this.inputHandlersValue?.height, i = (this.inputHandlersValue?.direction ?? "horizontal") === "vertical", t = { ...e };
29
+ return i && s && delete t.height, h`
30
+ ${!this.inputHandlersValue?.display || this.inputHandlersValue.display == "show" ? h`
31
+ <nr-divider
32
+ ${p(this.inputRef)}
33
+ style=${v({
34
+ ...t,
35
+ width: a ? "100%" : e.width,
36
+ height: !i && s ? "auto" : t.height
37
+ })}
38
+ type=${this.inputHandlersValue?.direction ?? "horizontal"}
39
+ .variant=${this.inputHandlersValue?.variant || "solid"}
40
+ .orientation=${this.inputHandlersValue?.textOrientation || "center"}
41
+ .orientationMargin=${this.inputHandlersValue?.orientationMargin ?? d}
42
+ .plain=${this.inputHandlersValue?.plain !== !1}
43
+ .size=${this.inputHandlersValue?.size ?? d}
44
+ .dashed=${this.inputHandlersValue?.dashed || !1}
45
+ @click=${(n) => {
46
+ this.executeEvent("onClick", n);
47
+ }}
48
+ >
49
+ ${this.inputHandlersValue?.text || ""}
50
+ </nr-divider>
51
+ ` : d}
52
+ `;
53
+ }
54
+ };
55
+ l.styles = [
56
+ b`
57
+ :host {
58
+ display: block;
59
+ width: 100%;
60
+ }
61
+
62
+ :host([data-type="vertical"]) {
63
+ display: inline-flex;
64
+ width: auto;
65
+ align-self: stretch; /* This makes it fill the parent's height in flexbox */
66
+ }
67
+
68
+ :host([data-type="vertical"]) nr-divider {
69
+ height: 100%;
70
+ display: flex;
71
+ align-items: stretch;
72
+ }
73
+ `
74
+ ];
75
+ o([
76
+ u({ type: Object })
77
+ ], l.prototype, "component", 2);
78
+ o([
79
+ u({ type: Object })
80
+ ], l.prototype, "item", 2);
81
+ l = o([
82
+ y("divider-block")
83
+ ], l);
84
+ export {
85
+ l as DividerBlock
86
+ };
@@ -0,0 +1,90 @@
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 { styleMap } from 'lit/directives/style-map.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/document');
19
+ } catch (error) {
20
+ console.warn("[@nuralyui/document] Package not found or failed to load.");
21
+ }
22
+ let DocumentBlock = class extends BaseElementBlock {
23
+ renderComponent() {
24
+ const documentStyles = this.getStyles() || {};
25
+ const documentStyleHandlers = this.component?.styleHandlers ? Object.fromEntries(
26
+ Object.entries(this.component?.styleHandlers).filter(([key, value]) => value)
27
+ ) : {};
28
+ const src = this.inputHandlersValue?.src;
29
+ const type = this.inputHandlersValue?.type ?? "pdf";
30
+ const previewable = this.inputHandlersValue?.previewable ?? false;
31
+ if (!src) {
32
+ return html`
33
+ <div
34
+ ${ref(this.inputRef)}
35
+ class="document-placeholder"
36
+ style=${styleMap({
37
+ ...this.getStyles(),
38
+ width: documentStyleHandlers?.width || documentStyles?.width || "100%",
39
+ height: documentStyleHandlers?.height || documentStyles?.height || "200px"
40
+ })}
41
+ @click=${(e) => this.executeEvent("onClick", e)}
42
+ >
43
+ <nr-icon name="file-text"></nr-icon>
44
+ <nr-label>No document source</nr-label>
45
+ </div>
46
+ `;
47
+ }
48
+ return html`
49
+ <nr-document-viewer
50
+ ${ref(this.inputRef)}
51
+ style=${styleMap({
52
+ ...this.getStyles()
53
+ })}
54
+ .src=${src}
55
+ .type=${type}
56
+ .previewable=${previewable}
57
+ .width=${documentStyleHandlers?.width || documentStyles?.width}
58
+ .height=${documentStyleHandlers?.height || documentStyles?.height}
59
+ @click=${(e) => this.executeEvent("onClick", e)}
60
+ @load=${(e) => this.executeEvent("onLoad", e, { src })}
61
+ @error=${(e) => this.executeEvent("onError", e, { src, error: "Failed to load document" })}
62
+ >
63
+ </nr-document-viewer>
64
+ `;
65
+ }
66
+ };
67
+ DocumentBlock.styles = [css`
68
+ .document-placeholder {
69
+ display: flex;
70
+ flex-direction: column;
71
+ align-items: center;
72
+ justify-content: center;
73
+ color: #64748b;
74
+ min-height: 200px;
75
+ border-radius: 8px;
76
+ border: 2px dashed #cbd5e1;
77
+ gap: 12px;
78
+ }
79
+ .document-placeholder nr-icon {
80
+ --nuraly-icon-size: 48px;
81
+ }
82
+ `];
83
+ __decorateClass([
84
+ property({ type: Object })
85
+ ], DocumentBlock.prototype, "component", 2);
86
+ DocumentBlock = __decorateClass([
87
+ customElement("document-block")
88
+ ], DocumentBlock);
89
+
90
+ export { DocumentBlock };
@@ -0,0 +1,74 @@
1
+ import { B as p, n as s, o as a, b as d, i as u, c as m, t as y } from "./micro-app-entry-BgDXbkmh.js";
2
+ var f = Object.defineProperty, v = Object.getOwnPropertyDescriptor, h = (r, t, o, i) => {
3
+ for (var n = i > 1 ? void 0 : i ? v(t, o) : t, e = r.length - 1, c; e >= 0; e--)
4
+ (c = r[e]) && (n = (i ? c(t, o, n) : c(n)) || n);
5
+ return i && n && f(t, o, n), n;
6
+ };
7
+ try {
8
+ await import("@nuralyui/document");
9
+ } catch {
10
+ console.warn("[@nuralyui/document] Package not found or failed to load.");
11
+ }
12
+ let l = class extends p {
13
+ renderComponent() {
14
+ const r = this.getStyles() || {}, t = this.component?.styleHandlers ? Object.fromEntries(
15
+ Object.entries(this.component?.styleHandlers).filter(([e, c]) => c)
16
+ ) : {}, o = this.inputHandlersValue?.src, i = this.inputHandlersValue?.type ?? "pdf", n = this.inputHandlersValue?.previewable ?? !1;
17
+ return o ? d`
18
+ <nr-document-viewer
19
+ ${s(this.inputRef)}
20
+ style=${a({
21
+ ...this.getStyles()
22
+ })}
23
+ .src=${o}
24
+ .type=${i}
25
+ .previewable=${n}
26
+ .width=${t?.width || r?.width}
27
+ .height=${t?.height || r?.height}
28
+ @click=${(e) => this.executeEvent("onClick", e)}
29
+ @load=${(e) => this.executeEvent("onLoad", e, { src: o })}
30
+ @error=${(e) => this.executeEvent("onError", e, { src: o, error: "Failed to load document" })}
31
+ >
32
+ </nr-document-viewer>
33
+ ` : d`
34
+ <div
35
+ ${s(this.inputRef)}
36
+ class="document-placeholder"
37
+ style=${a({
38
+ ...this.getStyles(),
39
+ width: t?.width || r?.width || "100%",
40
+ height: t?.height || r?.height || "200px"
41
+ })}
42
+ @click=${(e) => this.executeEvent("onClick", e)}
43
+ >
44
+ <nr-icon name="file-text"></nr-icon>
45
+ <nr-label>No document source</nr-label>
46
+ </div>
47
+ `;
48
+ }
49
+ };
50
+ l.styles = [u`
51
+ .document-placeholder {
52
+ display: flex;
53
+ flex-direction: column;
54
+ align-items: center;
55
+ justify-content: center;
56
+ color: #64748b;
57
+ min-height: 200px;
58
+ border-radius: 8px;
59
+ border: 2px dashed #cbd5e1;
60
+ gap: 12px;
61
+ }
62
+ .document-placeholder nr-icon {
63
+ --nuraly-icon-size: 48px;
64
+ }
65
+ `];
66
+ h([
67
+ m({ type: Object })
68
+ ], l.prototype, "component", 2);
69
+ l = h([
70
+ y("document-block")
71
+ ], l);
72
+ export {
73
+ l as DocumentBlock
74
+ };
@@ -0,0 +1,133 @@
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
+ try {
18
+ await import('@nuralyui/dropdown');
19
+ } catch (error) {
20
+ console.warn("[@nuralyui/dropdown] Package not found or failed to load. Dropdown functionality may be limited.");
21
+ }
22
+ let DropdownBlock = class extends BaseElementBlock {
23
+ constructor() {
24
+ super();
25
+ this.childrenComponents = [];
26
+ this.options = [
27
+ { label: "Copy", value: "Copy", icon: "copy" },
28
+ { label: "Paste", value: "Paste", icon: "paste" },
29
+ { label: "Delete", value: "Delete", icon: "trash" },
30
+ { label: "Export", value: "value12" },
31
+ { label: "Import", value: "value12" }
32
+ ];
33
+ }
34
+ connectedCallback() {
35
+ super.connectedCallback();
36
+ this.registerCallback("value", (v) => {
37
+ this.requestUpdate();
38
+ });
39
+ }
40
+ updateChildrenComponents() {
41
+ this.childrenComponents = this.component?.childrenIds?.map((id) => {
42
+ return $components.get()[this.component?.application_id]?.find(
43
+ (component) => component.uuid === id
44
+ );
45
+ }).filter(Boolean) ?? [];
46
+ }
47
+ updated(changedProperties) {
48
+ if (changedProperties.has("component")) {
49
+ this.updateChildrenComponents();
50
+ }
51
+ }
52
+ renderComponent() {
53
+ const options = this.inputHandlersValue?.value?.[0] ?? [];
54
+ const dropdownStyles = this.component?.style || {};
55
+ const size = dropdownStyles.size || "medium";
56
+ const placement = dropdownStyles.placement || "bottom";
57
+ const trigger = dropdownStyles.trigger || "click";
58
+ const animation = dropdownStyles.animation || "fade";
59
+ return html`
60
+ <nr-dropdown
61
+ .open=${this.inputHandlersValue.show || false}
62
+ ${ref(this.inputRef)}
63
+ style=${styleMap({
64
+ ...this.getStyles()
65
+ })}
66
+ .trigger=${trigger}
67
+ .placement=${placement}
68
+ .size=${size}
69
+ .animation=${animation}
70
+ .disabled=${this.inputHandlersValue?.state == "disabled"}
71
+ .items=${this.inputHandlersValue.options || options}
72
+ .arrow=${dropdownStyles.arrow === "true" || this.inputHandlersValue.arrow || false}
73
+ .autoClose=${dropdownStyles.autoClose !== "false" && this.inputHandlersValue.autoClose !== false}
74
+ .closeOnOutsideClick=${dropdownStyles.closeOnOutsideClick !== "false" && this.inputHandlersValue.closeOnOutsideClick !== false}
75
+ .closeOnEscape=${dropdownStyles.closeOnEscape !== "false" && this.inputHandlersValue.closeOnEscape !== false}
76
+ .offset=${this.inputHandlersValue.offset || 4}
77
+ .delay=${this.inputHandlersValue.delay || 50}
78
+ .maxHeight=${this.inputHandlersValue.maxHeight || "300px"}
79
+ .minWidth=${this.inputHandlersValue.minWidth || "auto"}
80
+ .cascadeDirection=${this.inputHandlersValue.cascadeDirection || "auto"}
81
+ .cascadeDelay=${this.inputHandlersValue.cascadeDelay || 50}
82
+ .cascadeOnHover=${this.inputHandlersValue.cascadeOnHover !== false}
83
+ @nr-dropdown-item-click=${(e) => {
84
+ const item = e.detail.item;
85
+ this.executeEvent("onItemClick", e, {
86
+ value: item.value,
87
+ item,
88
+ additionalData: item.additionalData
89
+ });
90
+ }}
91
+ @nr-dropdown-open=${(e) => {
92
+ this.executeEvent("onOpen", e);
93
+ }}
94
+ @nr-dropdown-close=${(e) => {
95
+ this.executeEvent("onClose", e);
96
+ }}
97
+ >
98
+ <span slot="trigger">
99
+ ${this.childrenComponents.length ? renderComponent(this.childrenComponents.map((component) => ({ ...component, item: this.item })), this.item, this.isViewMode) : html`
100
+ <nr-label
101
+ style=${styleMap({
102
+ "--resolved-text-label-color": this.getStyles()["title-color"]
103
+ })}
104
+ >${this.inputHandlersValue?.label ?? this.inputHandlersValue?.placeholder ?? nothing}</nr-label>
105
+
106
+ <drag-wrapper
107
+ .where=${"inside"}
108
+ .message=${"Drop inside"}
109
+ .component=${{ ...this.component }}
110
+ .inputRef=${this.inputRef}
111
+ .isDragInitiator=${this.isDragInitiator}
112
+ >
113
+ </drag-wrapper>
114
+ `}
115
+ </span>
116
+ </nr-dropdown>
117
+ `;
118
+ }
119
+ };
120
+ __decorateClass([
121
+ property({ type: Object })
122
+ ], DropdownBlock.prototype, "component", 2);
123
+ __decorateClass([
124
+ state()
125
+ ], DropdownBlock.prototype, "childrenComponents", 2);
126
+ __decorateClass([
127
+ state()
128
+ ], DropdownBlock.prototype, "options", 2);
129
+ DropdownBlock = __decorateClass([
130
+ customElement("dropdown-block")
131
+ ], DropdownBlock);
132
+
133
+ export { DropdownBlock };
@@ -0,0 +1,112 @@
1
+ import { B as h, $ as m, n as $, o as d, r as f, A as C, b as c, c as v, d as u, t as w } from "./micro-app-entry-BgDXbkmh.js";
2
+ var b = Object.defineProperty, g = Object.getOwnPropertyDescriptor, r = (n, e, o, s) => {
3
+ for (var a = s > 1 ? void 0 : s ? g(e, o) : e, i = n.length - 1, t; i >= 0; i--)
4
+ (t = n[i]) && (a = (s ? t(e, o, a) : t(a)) || a);
5
+ return s && a && b(e, o, a), a;
6
+ };
7
+ try {
8
+ await import("@nuralyui/dropdown");
9
+ } catch {
10
+ console.warn("[@nuralyui/dropdown] Package not found or failed to load. Dropdown functionality may be limited.");
11
+ }
12
+ let l = class extends h {
13
+ constructor() {
14
+ super(), this.childrenComponents = [], this.options = [
15
+ { label: "Copy", value: "Copy", icon: "copy" },
16
+ { label: "Paste", value: "Paste", icon: "paste" },
17
+ { label: "Delete", value: "Delete", icon: "trash" },
18
+ { label: "Export", value: "value12" },
19
+ { label: "Import", value: "value12" }
20
+ ];
21
+ }
22
+ connectedCallback() {
23
+ super.connectedCallback(), this.registerCallback("value", (n) => {
24
+ this.requestUpdate();
25
+ });
26
+ }
27
+ updateChildrenComponents() {
28
+ this.childrenComponents = this.component?.childrenIds?.map((n) => m.get()[this.component?.application_id]?.find(
29
+ (e) => e.uuid === n
30
+ )).filter(Boolean) ?? [];
31
+ }
32
+ updated(n) {
33
+ n.has("component") && this.updateChildrenComponents();
34
+ }
35
+ renderComponent() {
36
+ const n = this.inputHandlersValue?.value?.[0] ?? [], e = this.component?.style || {}, o = e.size || "medium", s = e.placement || "bottom", a = e.trigger || "click", i = e.animation || "fade";
37
+ return c`
38
+ <nr-dropdown
39
+ .open=${this.inputHandlersValue.show || !1}
40
+ ${$(this.inputRef)}
41
+ style=${d({
42
+ ...this.getStyles()
43
+ })}
44
+ .trigger=${a}
45
+ .placement=${s}
46
+ .size=${o}
47
+ .animation=${i}
48
+ .disabled=${this.inputHandlersValue?.state == "disabled"}
49
+ .items=${this.inputHandlersValue.options || n}
50
+ .arrow=${e.arrow === "true" || this.inputHandlersValue.arrow || !1}
51
+ .autoClose=${e.autoClose !== "false" && this.inputHandlersValue.autoClose !== !1}
52
+ .closeOnOutsideClick=${e.closeOnOutsideClick !== "false" && this.inputHandlersValue.closeOnOutsideClick !== !1}
53
+ .closeOnEscape=${e.closeOnEscape !== "false" && this.inputHandlersValue.closeOnEscape !== !1}
54
+ .offset=${this.inputHandlersValue.offset || 4}
55
+ .delay=${this.inputHandlersValue.delay || 50}
56
+ .maxHeight=${this.inputHandlersValue.maxHeight || "300px"}
57
+ .minWidth=${this.inputHandlersValue.minWidth || "auto"}
58
+ .cascadeDirection=${this.inputHandlersValue.cascadeDirection || "auto"}
59
+ .cascadeDelay=${this.inputHandlersValue.cascadeDelay || 50}
60
+ .cascadeOnHover=${this.inputHandlersValue.cascadeOnHover !== !1}
61
+ @nr-dropdown-item-click=${(t) => {
62
+ const p = t.detail.item;
63
+ this.executeEvent("onItemClick", t, {
64
+ value: p.value,
65
+ item: p,
66
+ additionalData: p.additionalData
67
+ });
68
+ }}
69
+ @nr-dropdown-open=${(t) => {
70
+ this.executeEvent("onOpen", t);
71
+ }}
72
+ @nr-dropdown-close=${(t) => {
73
+ this.executeEvent("onClose", t);
74
+ }}
75
+ >
76
+ <span slot="trigger">
77
+ ${this.childrenComponents.length ? f(this.childrenComponents.map((t) => ({ ...t, item: this.item })), this.item, this.isViewMode) : c`
78
+ <nr-label
79
+ style=${d({
80
+ "--resolved-text-label-color": this.getStyles()["title-color"]
81
+ })}
82
+ >${this.inputHandlersValue?.label ?? this.inputHandlersValue?.placeholder ?? C}</nr-label>
83
+
84
+ <drag-wrapper
85
+ .where=${"inside"}
86
+ .message=${"Drop inside"}
87
+ .component=${{ ...this.component }}
88
+ .inputRef=${this.inputRef}
89
+ .isDragInitiator=${this.isDragInitiator}
90
+ >
91
+ </drag-wrapper>
92
+ `}
93
+ </span>
94
+ </nr-dropdown>
95
+ `;
96
+ }
97
+ };
98
+ r([
99
+ v({ type: Object })
100
+ ], l.prototype, "component", 2);
101
+ r([
102
+ u()
103
+ ], l.prototype, "childrenComponents", 2);
104
+ r([
105
+ u()
106
+ ], l.prototype, "options", 2);
107
+ l = r([
108
+ w("dropdown-block")
109
+ ], l);
110
+ export {
111
+ l as DropdownBlock
112
+ };