@nuraly/runtime 0.1.8 → 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/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-Bf4L2rO_.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-DMsdy1N0.js → cssMode-CV7QbFJv.js} +1 -1
- package/dist/{freemarker2-D51H9HYi.js → freemarker2-CqQxSEZa.js} +1 -1
- package/dist/{handlebars-CF6gdAX4.js → handlebars-a71LdN7X.js} +1 -1
- package/dist/{html-c2n_zkM3.js → html-D8UaB7IC.js} +1 -1
- package/dist/{htmlMode-9IJTuZUh.js → htmlMode-CqWQMFWX.js} +1 -1
- package/dist/iconbutton-DfnrRmmB.js +69 -0
- package/dist/iconbutton-DvIQHV8o.js +53 -0
- package/dist/{javascript-DhEEBMxD.js → javascript-D_jGqcRD.js} +1 -1
- package/dist/{jsonMode-CB6k-4rp.js → jsonMode-C3-m5xts.js} +1 -1
- package/dist/{liquid-CwtPiwnW.js → liquid-DLwYj6Te.js} +1 -1
- package/dist/{mdx-LewPRYF8.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 -4940
- package/dist/{python-h5Z2g-yl.js → python-B-WcGqFq.js} +1 -1
- package/dist/{razor-D5ep1Doy.js → razor-JGACy1mz.js} +1 -1
- package/dist/runtime.js +4 -2
- package/dist/{tsMode-B_6LiBE1.js → tsMode-lzBM1oT2.js} +1 -1
- package/dist/{typescript-BBG0jH4p.js → typescript-CuL5pdO2.js} +1 -1
- package/dist/{xml-DgLB7rE6.js → xml-D1tacAKD.js} +1 -1
- package/dist/{yaml-DiI4HpSv.js → yaml-CjPB1g7v.js} +1 -1
- package/package.json +4 -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-C3RDIukG.js +0 -15831
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { nothing, html, css } from 'lit';
|
|
2
|
+
import { property, state, 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
|
+
function registerWithParentForm(element, nrElement) {
|
|
7
|
+
const name = element.inputHandlersValue?.name;
|
|
8
|
+
if (!name || !nrElement) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
element.dispatchEvent(new CustomEvent("nr-field-register", {
|
|
12
|
+
bubbles: true,
|
|
13
|
+
composed: true,
|
|
14
|
+
detail: {
|
|
15
|
+
element: nrElement,
|
|
16
|
+
name,
|
|
17
|
+
blockElement: element
|
|
18
|
+
}
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
function unregisterFromParentForm(element) {
|
|
22
|
+
const name = element.inputHandlersValue?.name;
|
|
23
|
+
if (!name) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
element.dispatchEvent(new CustomEvent("nr-field-unregister", {
|
|
27
|
+
bubbles: true,
|
|
28
|
+
composed: true,
|
|
29
|
+
detail: {
|
|
30
|
+
name,
|
|
31
|
+
blockElement: element
|
|
32
|
+
}
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var __defProp = Object.defineProperty;
|
|
37
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
38
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
39
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
40
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
41
|
+
if (decorator = decorators[i])
|
|
42
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
43
|
+
if (kind && result) __defProp(target, key, result);
|
|
44
|
+
return result;
|
|
45
|
+
};
|
|
46
|
+
try {
|
|
47
|
+
await import('@nuralyui/input');
|
|
48
|
+
} catch (error) {
|
|
49
|
+
console.warn("[@nuralyui/input] Package not found or failed to load.");
|
|
50
|
+
}
|
|
51
|
+
let TextInputBlock = class extends BaseElementBlock {
|
|
52
|
+
constructor() {
|
|
53
|
+
super();
|
|
54
|
+
this.currentValue = "";
|
|
55
|
+
this._isUserFocused = false;
|
|
56
|
+
this._focusResetTimeout = null;
|
|
57
|
+
this._inputElement = null;
|
|
58
|
+
}
|
|
59
|
+
firstUpdated(_changedProperties) {
|
|
60
|
+
super.firstUpdated(_changedProperties);
|
|
61
|
+
this.registerCallback("value", (value) => {
|
|
62
|
+
if (!this._isUserFocused && this.currentValue !== value) {
|
|
63
|
+
this.currentValue = value ?? "";
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
this._inputElement = this.renderRoot.querySelector("nr-input");
|
|
67
|
+
if (this._inputElement && this.inputHandlersValue?.name) {
|
|
68
|
+
registerWithParentForm(this, this._inputElement);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
disconnectedCallback() {
|
|
72
|
+
super.disconnectedCallback();
|
|
73
|
+
if (this.unsubscribe) this.unsubscribe();
|
|
74
|
+
if (this._focusResetTimeout) clearTimeout(this._focusResetTimeout);
|
|
75
|
+
if (this.inputHandlersValue?.name) {
|
|
76
|
+
unregisterFromParentForm(this);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
resetFocusAfterInactivity() {
|
|
80
|
+
if (this._focusResetTimeout) {
|
|
81
|
+
clearTimeout(this._focusResetTimeout);
|
|
82
|
+
}
|
|
83
|
+
this._focusResetTimeout = setTimeout(() => {
|
|
84
|
+
this._isUserFocused = false;
|
|
85
|
+
}, 3e3);
|
|
86
|
+
}
|
|
87
|
+
renderComponent() {
|
|
88
|
+
this.getStyles();
|
|
89
|
+
const componentStyles = this.component?.style || {};
|
|
90
|
+
componentStyles?.size || "medium";
|
|
91
|
+
return html`
|
|
92
|
+
<nr-input
|
|
93
|
+
${ref(this.inputRef)}
|
|
94
|
+
class="${`drop-${this.component.uuid}`}"
|
|
95
|
+
|
|
96
|
+
.value=${this.inputHandlersValue?.value ?? nothing}
|
|
97
|
+
.size=${this.inputHandlersValue?.size ?? "medium"}
|
|
98
|
+
.state=${this.inputHandlersValue.status ?? nothing}
|
|
99
|
+
.type=${this.inputHandlersValue.type ?? nothing}
|
|
100
|
+
.variant=${this.inputHandlersValue.variant ?? nothing}
|
|
101
|
+
.disabled=${this.inputHandlersValue.state === "disabled"}
|
|
102
|
+
.readonly=${this.inputHandlersValue.readonly || false}
|
|
103
|
+
.placeholder=${this.inputHandlersValue?.placeholder ?? "Text input"}
|
|
104
|
+
.step=${this.inputHandlersValue?.step ?? nothing}
|
|
105
|
+
.min=${this.inputHandlersValue?.min ?? nothing}
|
|
106
|
+
.max=${this.inputHandlersValue?.max ?? nothing}
|
|
107
|
+
.name=${this.inputHandlersValue?.name ?? nothing}
|
|
108
|
+
.required=${this.inputHandlersValue?.required || false}
|
|
109
|
+
.withCopy=${this.inputHandlersValue?.withCopy || false}
|
|
110
|
+
.allowClear=${this.inputHandlersValue?.allowClear || false}
|
|
111
|
+
.showCount=${this.inputHandlersValue?.showCount || false}
|
|
112
|
+
.maxLength=${this.inputHandlersValue?.maxLength ?? nothing}
|
|
113
|
+
.rules=${this.inputHandlersValue?.rules ?? []}
|
|
114
|
+
.validateOnChangeInput=${this.inputHandlersValue?.validateOnChange !== false}
|
|
115
|
+
.validateOnBlurInput=${this.inputHandlersValue?.validateOnBlur !== false}
|
|
116
|
+
.hasFeedback=${this.inputHandlersValue?.hasFeedback || false}
|
|
117
|
+
.autocomplete=${this.inputHandlersValue?.autocomplete ?? "off"}
|
|
118
|
+
@nr-input=${(e) => {
|
|
119
|
+
this._isUserFocused = true;
|
|
120
|
+
this.executeEvent(
|
|
121
|
+
"onChange",
|
|
122
|
+
e,
|
|
123
|
+
{
|
|
124
|
+
value: e.detail.value,
|
|
125
|
+
oldValue: e.detail.oldValue
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
this.resetFocusAfterInactivity();
|
|
129
|
+
}}
|
|
130
|
+
@nr-focus=${(e) => {
|
|
131
|
+
this._isUserFocused = true;
|
|
132
|
+
this.executeEvent("onFocus", e, {
|
|
133
|
+
value: e.detail.value
|
|
134
|
+
});
|
|
135
|
+
}}
|
|
136
|
+
@nr-blur=${(e) => {
|
|
137
|
+
this._isUserFocused = false;
|
|
138
|
+
this.executeEvent("onBlur", e, {
|
|
139
|
+
value: e.detail.value
|
|
140
|
+
});
|
|
141
|
+
}}
|
|
142
|
+
@nr-enter=${(e) => {
|
|
143
|
+
this.executeEvent("onEnter", e, {
|
|
144
|
+
value: e.detail.value
|
|
145
|
+
});
|
|
146
|
+
}}
|
|
147
|
+
@nr-clear=${(e) => {
|
|
148
|
+
this.executeEvent("onClear", e, {
|
|
149
|
+
value: e.detail.value
|
|
150
|
+
});
|
|
151
|
+
}}
|
|
152
|
+
@keydown=${(e) => {
|
|
153
|
+
if (e.key === "ArrowUp") {
|
|
154
|
+
this.executeEvent("onArrowUp", e);
|
|
155
|
+
} else if (e.key === "ArrowDown") {
|
|
156
|
+
this.executeEvent("onArrowDown", e);
|
|
157
|
+
}
|
|
158
|
+
}}
|
|
159
|
+
>
|
|
160
|
+
<span
|
|
161
|
+
slot="label"
|
|
162
|
+
|
|
163
|
+
>
|
|
164
|
+
${this.inputHandlersValue?.label ?? ""}
|
|
165
|
+
</span>
|
|
166
|
+
<span
|
|
167
|
+
slot="helper-text"
|
|
168
|
+
|
|
169
|
+
>
|
|
170
|
+
${this.inputHandlersValue?.helper ?? ""}
|
|
171
|
+
</span>
|
|
172
|
+
</nr-input>
|
|
173
|
+
`;
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
TextInputBlock.styles = [css``];
|
|
177
|
+
__decorateClass([
|
|
178
|
+
property({ type: Object })
|
|
179
|
+
], TextInputBlock.prototype, "component", 2);
|
|
180
|
+
__decorateClass([
|
|
181
|
+
property({ type: Object })
|
|
182
|
+
], TextInputBlock.prototype, "item", 2);
|
|
183
|
+
__decorateClass([
|
|
184
|
+
state()
|
|
185
|
+
], TextInputBlock.prototype, "currentValue", 2);
|
|
186
|
+
__decorateClass([
|
|
187
|
+
state()
|
|
188
|
+
], TextInputBlock.prototype, "_isUserFocused", 2);
|
|
189
|
+
TextInputBlock = __decorateClass([
|
|
190
|
+
customElement("text-input-block")
|
|
191
|
+
], TextInputBlock);
|
|
192
|
+
|
|
193
|
+
export { TextInputBlock };
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { B as h, n as c, A as s, b as m, i as f, c as p, d, t as v } from "./micro-app-entry-DiNqE6xi.js";
|
|
2
|
+
function V(t, e) {
|
|
3
|
+
const a = t.inputHandlersValue?.name;
|
|
4
|
+
!a || !e || t.dispatchEvent(new CustomEvent("nr-field-register", {
|
|
5
|
+
bubbles: !0,
|
|
6
|
+
composed: !0,
|
|
7
|
+
detail: {
|
|
8
|
+
element: e,
|
|
9
|
+
name: a,
|
|
10
|
+
blockElement: t
|
|
11
|
+
}
|
|
12
|
+
}));
|
|
13
|
+
}
|
|
14
|
+
function $(t) {
|
|
15
|
+
const e = t.inputHandlersValue?.name;
|
|
16
|
+
e && t.dispatchEvent(new CustomEvent("nr-field-unregister", {
|
|
17
|
+
bubbles: !0,
|
|
18
|
+
composed: !0,
|
|
19
|
+
detail: {
|
|
20
|
+
name: e,
|
|
21
|
+
blockElement: t
|
|
22
|
+
}
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
var b = Object.defineProperty, H = Object.getOwnPropertyDescriptor, u = (t, e, a, l) => {
|
|
26
|
+
for (var n = l > 1 ? void 0 : l ? H(e, a) : e, r = t.length - 1, o; r >= 0; r--)
|
|
27
|
+
(o = t[r]) && (n = (l ? o(e, a, n) : o(n)) || n);
|
|
28
|
+
return l && n && b(e, a, n), n;
|
|
29
|
+
};
|
|
30
|
+
try {
|
|
31
|
+
await import("@nuralyui/input");
|
|
32
|
+
} catch {
|
|
33
|
+
console.warn("[@nuralyui/input] Package not found or failed to load.");
|
|
34
|
+
}
|
|
35
|
+
let i = class extends h {
|
|
36
|
+
constructor() {
|
|
37
|
+
super(), this.currentValue = "", this._isUserFocused = !1, this._focusResetTimeout = null, this._inputElement = null;
|
|
38
|
+
}
|
|
39
|
+
firstUpdated(t) {
|
|
40
|
+
super.firstUpdated(t), this.registerCallback("value", (e) => {
|
|
41
|
+
!this._isUserFocused && this.currentValue !== e && (this.currentValue = e ?? "");
|
|
42
|
+
}), this._inputElement = this.renderRoot.querySelector("nr-input"), this._inputElement && this.inputHandlersValue?.name && V(this, this._inputElement);
|
|
43
|
+
}
|
|
44
|
+
disconnectedCallback() {
|
|
45
|
+
super.disconnectedCallback(), this.unsubscribe && this.unsubscribe(), this._focusResetTimeout && clearTimeout(this._focusResetTimeout), this.inputHandlersValue?.name && $(this);
|
|
46
|
+
}
|
|
47
|
+
resetFocusAfterInactivity() {
|
|
48
|
+
this._focusResetTimeout && clearTimeout(this._focusResetTimeout), this._focusResetTimeout = setTimeout(() => {
|
|
49
|
+
this._isUserFocused = !1;
|
|
50
|
+
}, 3e3);
|
|
51
|
+
}
|
|
52
|
+
renderComponent() {
|
|
53
|
+
return this.getStyles(), (this.component?.style || {})?.size, m`
|
|
54
|
+
<nr-input
|
|
55
|
+
${c(this.inputRef)}
|
|
56
|
+
class="${`drop-${this.component.uuid}`}"
|
|
57
|
+
|
|
58
|
+
.value=${this.inputHandlersValue?.value ?? s}
|
|
59
|
+
.size=${this.inputHandlersValue?.size ?? "medium"}
|
|
60
|
+
.state=${this.inputHandlersValue.status ?? s}
|
|
61
|
+
.type=${this.inputHandlersValue.type ?? s}
|
|
62
|
+
.variant=${this.inputHandlersValue.variant ?? s}
|
|
63
|
+
.disabled=${this.inputHandlersValue.state === "disabled"}
|
|
64
|
+
.readonly=${this.inputHandlersValue.readonly || !1}
|
|
65
|
+
.placeholder=${this.inputHandlersValue?.placeholder ?? "Text input"}
|
|
66
|
+
.step=${this.inputHandlersValue?.step ?? s}
|
|
67
|
+
.min=${this.inputHandlersValue?.min ?? s}
|
|
68
|
+
.max=${this.inputHandlersValue?.max ?? s}
|
|
69
|
+
.name=${this.inputHandlersValue?.name ?? s}
|
|
70
|
+
.required=${this.inputHandlersValue?.required || !1}
|
|
71
|
+
.withCopy=${this.inputHandlersValue?.withCopy || !1}
|
|
72
|
+
.allowClear=${this.inputHandlersValue?.allowClear || !1}
|
|
73
|
+
.showCount=${this.inputHandlersValue?.showCount || !1}
|
|
74
|
+
.maxLength=${this.inputHandlersValue?.maxLength ?? s}
|
|
75
|
+
.rules=${this.inputHandlersValue?.rules ?? []}
|
|
76
|
+
.validateOnChangeInput=${this.inputHandlersValue?.validateOnChange !== !1}
|
|
77
|
+
.validateOnBlurInput=${this.inputHandlersValue?.validateOnBlur !== !1}
|
|
78
|
+
.hasFeedback=${this.inputHandlersValue?.hasFeedback || !1}
|
|
79
|
+
.autocomplete=${this.inputHandlersValue?.autocomplete ?? "off"}
|
|
80
|
+
@nr-input=${(e) => {
|
|
81
|
+
this._isUserFocused = !0, this.executeEvent(
|
|
82
|
+
"onChange",
|
|
83
|
+
e,
|
|
84
|
+
{
|
|
85
|
+
value: e.detail.value,
|
|
86
|
+
oldValue: e.detail.oldValue
|
|
87
|
+
}
|
|
88
|
+
), this.resetFocusAfterInactivity();
|
|
89
|
+
}}
|
|
90
|
+
@nr-focus=${(e) => {
|
|
91
|
+
this._isUserFocused = !0, this.executeEvent("onFocus", e, {
|
|
92
|
+
value: e.detail.value
|
|
93
|
+
});
|
|
94
|
+
}}
|
|
95
|
+
@nr-blur=${(e) => {
|
|
96
|
+
this._isUserFocused = !1, this.executeEvent("onBlur", e, {
|
|
97
|
+
value: e.detail.value
|
|
98
|
+
});
|
|
99
|
+
}}
|
|
100
|
+
@nr-enter=${(e) => {
|
|
101
|
+
this.executeEvent("onEnter", e, {
|
|
102
|
+
value: e.detail.value
|
|
103
|
+
});
|
|
104
|
+
}}
|
|
105
|
+
@nr-clear=${(e) => {
|
|
106
|
+
this.executeEvent("onClear", e, {
|
|
107
|
+
value: e.detail.value
|
|
108
|
+
});
|
|
109
|
+
}}
|
|
110
|
+
@keydown=${(e) => {
|
|
111
|
+
e.key === "ArrowUp" ? this.executeEvent("onArrowUp", e) : e.key === "ArrowDown" && this.executeEvent("onArrowDown", e);
|
|
112
|
+
}}
|
|
113
|
+
>
|
|
114
|
+
<span
|
|
115
|
+
slot="label"
|
|
116
|
+
|
|
117
|
+
>
|
|
118
|
+
${this.inputHandlersValue?.label ?? ""}
|
|
119
|
+
</span>
|
|
120
|
+
<span
|
|
121
|
+
slot="helper-text"
|
|
122
|
+
|
|
123
|
+
>
|
|
124
|
+
${this.inputHandlersValue?.helper ?? ""}
|
|
125
|
+
</span>
|
|
126
|
+
</nr-input>
|
|
127
|
+
`;
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
i.styles = [f``];
|
|
131
|
+
u([
|
|
132
|
+
p({ type: Object })
|
|
133
|
+
], i.prototype, "component", 2);
|
|
134
|
+
u([
|
|
135
|
+
p({ type: Object })
|
|
136
|
+
], i.prototype, "item", 2);
|
|
137
|
+
u([
|
|
138
|
+
d()
|
|
139
|
+
], i.prototype, "currentValue", 2);
|
|
140
|
+
u([
|
|
141
|
+
d()
|
|
142
|
+
], i.prototype, "_isUserFocused", 2);
|
|
143
|
+
i = u([
|
|
144
|
+
v("text-input-block")
|
|
145
|
+
], i);
|
|
146
|
+
export {
|
|
147
|
+
i as TextInputBlock
|
|
148
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { css, nothing, html } from 'lit';
|
|
2
|
+
import { property, state, 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
|
+
const textLabelStyles = css`
|
|
7
|
+
label{
|
|
8
|
+
color:var(--text-label-color);
|
|
9
|
+
user-select: none
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
:host{
|
|
13
|
+
display: flex;
|
|
14
|
+
width:fit-content;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@media (prefers-color-scheme: dark) {
|
|
18
|
+
:host {
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
`;
|
|
23
|
+
const styles = [textLabelStyles];
|
|
24
|
+
|
|
25
|
+
var __defProp = Object.defineProperty;
|
|
26
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
27
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
28
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
29
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
30
|
+
if (decorator = decorators[i])
|
|
31
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
32
|
+
if (kind && result) __defProp(target, key, result);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
try {
|
|
36
|
+
await import('@nuralyui/label');
|
|
37
|
+
} catch (error) {
|
|
38
|
+
console.warn("[@nuralyui/label] Package not found or failed to load.");
|
|
39
|
+
}
|
|
40
|
+
let TextLabelBlock = class extends BaseElementBlock {
|
|
41
|
+
constructor() {
|
|
42
|
+
super();
|
|
43
|
+
this.isEditable = false;
|
|
44
|
+
this.registerCallback("innerAlignment", (value) => {
|
|
45
|
+
if (this.closestGenericComponentWrapper) {
|
|
46
|
+
if (this.inputHandlersValue?.innerAlignment === "end") {
|
|
47
|
+
this.closestGenericComponentWrapper.style.marginLeft = "auto";
|
|
48
|
+
} else {
|
|
49
|
+
this.closestGenericComponentWrapper.style.marginLeft = "unset";
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
renderComponent() {
|
|
55
|
+
return html`
|
|
56
|
+
<nr-label
|
|
57
|
+
class="${`drop-${this.component.uuid}`}"
|
|
58
|
+
@input=${(e) => {
|
|
59
|
+
const eventData = { ["value"]: { type: "string", value: e.target.innerText } };
|
|
60
|
+
this.executeEvent("onInput", e, eventData);
|
|
61
|
+
}}
|
|
62
|
+
${ref(this.inputRef)}
|
|
63
|
+
id=${this.component.uuid}
|
|
64
|
+
.size=${this.inputHandlersValue.size ?? "medium"}
|
|
65
|
+
.variant=${this.inputHandlersValue.variant || "default"}
|
|
66
|
+
.required=${this.inputHandlersValue.required || false}
|
|
67
|
+
.disabled=${this.inputHandlersValue.state === "disabled"}
|
|
68
|
+
.for=${this.inputHandlersValue.for || nothing}
|
|
69
|
+
.value=${this.inputHandlersValue.value || ""}
|
|
70
|
+
contentEditable="${this.isEditable}"
|
|
71
|
+
@click=${(e) => {
|
|
72
|
+
this.executeEvent("onClick", e);
|
|
73
|
+
}}
|
|
74
|
+
@mouseenter=${(e) => {
|
|
75
|
+
this.executeEvent("onMouseEnter", e);
|
|
76
|
+
}}
|
|
77
|
+
@mouseleave=${(e) => {
|
|
78
|
+
this.executeEvent("onMouseLeave", e);
|
|
79
|
+
}}
|
|
80
|
+
|
|
81
|
+
@dblclick=${(e) => {
|
|
82
|
+
e.preventDefault();
|
|
83
|
+
this.isEditable = true;
|
|
84
|
+
}}>${this.inputHandlersValue.value || "Text label"}</nr-label>
|
|
85
|
+
`;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
TextLabelBlock.styles = styles;
|
|
89
|
+
__decorateClass([
|
|
90
|
+
property({ type: Object })
|
|
91
|
+
], TextLabelBlock.prototype, "component", 2);
|
|
92
|
+
__decorateClass([
|
|
93
|
+
property({ type: Object })
|
|
94
|
+
], TextLabelBlock.prototype, "item", 2);
|
|
95
|
+
__decorateClass([
|
|
96
|
+
state()
|
|
97
|
+
], TextLabelBlock.prototype, "isEditable", 2);
|
|
98
|
+
TextLabelBlock = __decorateClass([
|
|
99
|
+
customElement("text-label-block")
|
|
100
|
+
], TextLabelBlock);
|
|
101
|
+
|
|
102
|
+
export { TextLabelBlock };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { 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/textarea');
|
|
19
|
+
} catch (error) {
|
|
20
|
+
console.warn("[@nuralyui/textarea] Package not found or failed to load.");
|
|
21
|
+
}
|
|
22
|
+
let TextareaBlock = class extends BaseElementBlock {
|
|
23
|
+
renderComponent() {
|
|
24
|
+
const textareaStyles = this.component?.style || {};
|
|
25
|
+
const value = this.inputHandlersValue?.value ?? "";
|
|
26
|
+
const placeholder = this.inputHandlersValue?.placeholder ?? "";
|
|
27
|
+
const label = this.inputHandlersValue?.label ?? "";
|
|
28
|
+
const helperText = this.inputHandlersValue?.helperText ?? this.inputHandlersValue?.helper ?? "";
|
|
29
|
+
const disabled = this.inputHandlersValue?.disabled ?? (this.inputHandlersValue?.state === "disabled" || false);
|
|
30
|
+
const readonly = this.inputHandlersValue?.readonly ?? false;
|
|
31
|
+
const required = this.inputHandlersValue?.required ?? false;
|
|
32
|
+
const allowClear = this.inputHandlersValue?.allowClear ?? false;
|
|
33
|
+
const showCount = this.inputHandlersValue?.showCount ?? false;
|
|
34
|
+
const autoResize = this.inputHandlersValue?.autoResize ?? false;
|
|
35
|
+
const size = this.inputHandlersValue?.size ?? "medium";
|
|
36
|
+
const variant = this.inputHandlersValue?.variant ?? "";
|
|
37
|
+
const state = this.inputHandlersValue?.state ?? "default";
|
|
38
|
+
const resize = this.inputHandlersValue?.resize ?? "vertical";
|
|
39
|
+
const rows = this.inputHandlersValue?.rows ?? 4;
|
|
40
|
+
const cols = this.inputHandlersValue?.cols;
|
|
41
|
+
const maxLength = this.inputHandlersValue?.maxLength;
|
|
42
|
+
const minHeight = this.inputHandlersValue?.minHeight;
|
|
43
|
+
const maxHeight = this.inputHandlersValue?.maxHeight;
|
|
44
|
+
const rules = this.inputHandlersValue?.rules ?? [];
|
|
45
|
+
const name = this.inputHandlersValue?.name;
|
|
46
|
+
const autocomplete = this.inputHandlersValue?.autocomplete ?? "off";
|
|
47
|
+
const validateOnChange = this.inputHandlersValue?.validateOnChange ?? true;
|
|
48
|
+
const validateOnBlur = this.inputHandlersValue?.validateOnBlur ?? true;
|
|
49
|
+
const hasFeedback = this.inputHandlersValue?.hasFeedback ?? false;
|
|
50
|
+
return html`
|
|
51
|
+
<nr-textarea
|
|
52
|
+
${ref(this.inputRef)}
|
|
53
|
+
style=${styleMap(textareaStyles)}
|
|
54
|
+
.value=${value}
|
|
55
|
+
.placeholder=${placeholder}
|
|
56
|
+
.label=${label}
|
|
57
|
+
.helperText=${helperText}
|
|
58
|
+
.size=${size}
|
|
59
|
+
.variant=${variant}
|
|
60
|
+
.state=${state}
|
|
61
|
+
.resize=${resize}
|
|
62
|
+
.rows=${rows}
|
|
63
|
+
.cols=${cols}
|
|
64
|
+
.maxLength=${maxLength}
|
|
65
|
+
.minHeight=${minHeight}
|
|
66
|
+
.maxHeight=${maxHeight}
|
|
67
|
+
.rules=${rules}
|
|
68
|
+
.name=${name}
|
|
69
|
+
.autocomplete=${autocomplete}
|
|
70
|
+
?disabled=${disabled}
|
|
71
|
+
?readonly=${readonly}
|
|
72
|
+
?required=${required}
|
|
73
|
+
?allowClear=${allowClear}
|
|
74
|
+
?showCount=${showCount}
|
|
75
|
+
?autoResize=${autoResize}
|
|
76
|
+
?validateOnChange=${validateOnChange}
|
|
77
|
+
?validateOnBlur=${validateOnBlur}
|
|
78
|
+
?hasFeedback=${hasFeedback}
|
|
79
|
+
@nr-textarea-change=${(e) => {
|
|
80
|
+
this.executeEvent("onChange", e, {
|
|
81
|
+
value: e.detail.value,
|
|
82
|
+
characterCount: e.detail.characterCount
|
|
83
|
+
});
|
|
84
|
+
}}
|
|
85
|
+
@nr-focus=${(e) => {
|
|
86
|
+
this.executeEvent("onFocus", e);
|
|
87
|
+
}}
|
|
88
|
+
@nr-blur=${(e) => {
|
|
89
|
+
this.executeEvent("onBlur", e, {
|
|
90
|
+
value: e.detail.value
|
|
91
|
+
});
|
|
92
|
+
}}
|
|
93
|
+
@nr-clear=${(e) => {
|
|
94
|
+
this.executeEvent("onClear", e);
|
|
95
|
+
}}
|
|
96
|
+
@nr-resize=${(e) => {
|
|
97
|
+
this.executeEvent("onResize", e, {
|
|
98
|
+
height: e.detail.height,
|
|
99
|
+
width: e.detail.width
|
|
100
|
+
});
|
|
101
|
+
}}
|
|
102
|
+
></nr-textarea>
|
|
103
|
+
`;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
TextareaBlock.styles = [css``];
|
|
107
|
+
__decorateClass([
|
|
108
|
+
property({ type: Object })
|
|
109
|
+
], TextareaBlock.prototype, "component", 2);
|
|
110
|
+
__decorateClass([
|
|
111
|
+
property({ type: Object })
|
|
112
|
+
], TextareaBlock.prototype, "item", 2);
|
|
113
|
+
TextareaBlock = __decorateClass([
|
|
114
|
+
customElement("textarea-block")
|
|
115
|
+
], TextareaBlock);
|
|
116
|
+
|
|
117
|
+
export { TextareaBlock };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { B as _, n as P, o as R, b as j, i as F, c as h, t as T } from "./micro-app-entry-DiNqE6xi.js";
|
|
2
|
+
var q = Object.defineProperty, L = Object.getOwnPropertyDescriptor, o = (l, a, s, n) => {
|
|
3
|
+
for (var t = n > 1 ? void 0 : n ? L(a, s) : a, i = l.length - 1, r; i >= 0; i--)
|
|
4
|
+
(r = l[i]) && (t = (n ? r(a, s, t) : r(t)) || t);
|
|
5
|
+
return n && t && q(a, s, t), t;
|
|
6
|
+
};
|
|
7
|
+
try {
|
|
8
|
+
await import("@nuralyui/textarea");
|
|
9
|
+
} catch {
|
|
10
|
+
console.warn("[@nuralyui/textarea] Package not found or failed to load.");
|
|
11
|
+
}
|
|
12
|
+
let u = class extends _ {
|
|
13
|
+
renderComponent() {
|
|
14
|
+
const l = this.component?.style || {}, a = this.inputHandlersValue?.value ?? "", s = this.inputHandlersValue?.placeholder ?? "", n = this.inputHandlersValue?.label ?? "", t = this.inputHandlersValue?.helperText ?? this.inputHandlersValue?.helper ?? "", i = this.inputHandlersValue?.disabled ?? (this.inputHandlersValue?.state === "disabled" || !1), r = this.inputHandlersValue?.readonly ?? !1, c = this.inputHandlersValue?.required ?? !1, d = this.inputHandlersValue?.allowClear ?? !1, p = this.inputHandlersValue?.showCount ?? !1, H = this.inputHandlersValue?.autoResize ?? !1, $ = this.inputHandlersValue?.size ?? "medium", v = this.inputHandlersValue?.variant ?? "", V = this.inputHandlersValue?.state ?? "default", m = this.inputHandlersValue?.resize ?? "vertical", x = this.inputHandlersValue?.rows ?? 4, f = this.inputHandlersValue?.cols, b = this.inputHandlersValue?.maxLength, g = this.inputHandlersValue?.minHeight, w = this.inputHandlersValue?.maxHeight, C = this.inputHandlersValue?.rules ?? [], y = this.inputHandlersValue?.name, O = this.inputHandlersValue?.autocomplete ?? "off", z = this.inputHandlersValue?.validateOnChange ?? !0, B = this.inputHandlersValue?.validateOnBlur ?? !0, E = this.inputHandlersValue?.hasFeedback ?? !1;
|
|
15
|
+
return j`
|
|
16
|
+
<nr-textarea
|
|
17
|
+
${P(this.inputRef)}
|
|
18
|
+
style=${R(l)}
|
|
19
|
+
.value=${a}
|
|
20
|
+
.placeholder=${s}
|
|
21
|
+
.label=${n}
|
|
22
|
+
.helperText=${t}
|
|
23
|
+
.size=${$}
|
|
24
|
+
.variant=${v}
|
|
25
|
+
.state=${V}
|
|
26
|
+
.resize=${m}
|
|
27
|
+
.rows=${x}
|
|
28
|
+
.cols=${f}
|
|
29
|
+
.maxLength=${b}
|
|
30
|
+
.minHeight=${g}
|
|
31
|
+
.maxHeight=${w}
|
|
32
|
+
.rules=${C}
|
|
33
|
+
.name=${y}
|
|
34
|
+
.autocomplete=${O}
|
|
35
|
+
?disabled=${i}
|
|
36
|
+
?readonly=${r}
|
|
37
|
+
?required=${c}
|
|
38
|
+
?allowClear=${d}
|
|
39
|
+
?showCount=${p}
|
|
40
|
+
?autoResize=${H}
|
|
41
|
+
?validateOnChange=${z}
|
|
42
|
+
?validateOnBlur=${B}
|
|
43
|
+
?hasFeedback=${E}
|
|
44
|
+
@nr-textarea-change=${(e) => {
|
|
45
|
+
this.executeEvent("onChange", e, {
|
|
46
|
+
value: e.detail.value,
|
|
47
|
+
characterCount: e.detail.characterCount
|
|
48
|
+
});
|
|
49
|
+
}}
|
|
50
|
+
@nr-focus=${(e) => {
|
|
51
|
+
this.executeEvent("onFocus", e);
|
|
52
|
+
}}
|
|
53
|
+
@nr-blur=${(e) => {
|
|
54
|
+
this.executeEvent("onBlur", e, {
|
|
55
|
+
value: e.detail.value
|
|
56
|
+
});
|
|
57
|
+
}}
|
|
58
|
+
@nr-clear=${(e) => {
|
|
59
|
+
this.executeEvent("onClear", e);
|
|
60
|
+
}}
|
|
61
|
+
@nr-resize=${(e) => {
|
|
62
|
+
this.executeEvent("onResize", e, {
|
|
63
|
+
height: e.detail.height,
|
|
64
|
+
width: e.detail.width
|
|
65
|
+
});
|
|
66
|
+
}}
|
|
67
|
+
></nr-textarea>
|
|
68
|
+
`;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
u.styles = [F``];
|
|
72
|
+
o([
|
|
73
|
+
h({ type: Object })
|
|
74
|
+
], u.prototype, "component", 2);
|
|
75
|
+
o([
|
|
76
|
+
h({ type: Object })
|
|
77
|
+
], u.prototype, "item", 2);
|
|
78
|
+
u = o([
|
|
79
|
+
T("textarea-block")
|
|
80
|
+
], u);
|
|
81
|
+
export {
|
|
82
|
+
u as TextareaBlock
|
|
83
|
+
};
|