@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.
- package/components/ui/components/base/controllers/InputHandlerController.ts +5 -0
- 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-C-wFf4PD.js +220 -0
- package/dist/AIChat-Cly-frW6.js +260 -0
- package/dist/Badge-BUm76SZ2.js +70 -0
- package/dist/Badge-BarGcY8u.js +48 -0
- package/dist/{BaseElement-BNBn_IJk.js → BaseElement-wyA58UxT.js} +156 -24
- package/dist/Button-BEgayuX9.js +80 -0
- package/dist/Button-wgwjzM_f.js +92 -0
- package/dist/Card-B4r5RQgn.js +120 -0
- package/dist/Card-a1sdDpKe.js +150 -0
- package/dist/Checkbox-CC9PkwpC.js +59 -0
- package/dist/Checkbox-WVmAN9ZP.js +65 -0
- package/dist/Code-Dc66ui4C.js +109 -0
- package/dist/Code-kVoVXBbt.js +123 -0
- package/dist/{CodeEditor-B1gNuvPb.js → CodeEditor-2QHTZxKN.js} +22 -22
- package/dist/Col-BKbQ2o0P.js +217 -0
- package/dist/Col-x4rRO4dz.js +193 -0
- package/dist/Collapse-Dd2GfevD.js +74 -0
- package/dist/Collapse-Xo-jb8zs.js +96 -0
- package/dist/Collections-DEqUHWFe.js +151 -0
- package/dist/Collections-DsTr-Zt7.js +122 -0
- package/dist/Container-C1HjQgb7.js +204 -0
- package/dist/DatePicker-DRVwFJmL.js +99 -0
- package/dist/DatePicker-oAOJyU3e.js +80 -0
- package/dist/Divider-BMA6S7Pd.js +106 -0
- package/dist/Divider-zbcO-KF9.js +86 -0
- package/dist/Document-BqVezrmJ.js +90 -0
- package/dist/Document-C2lg-jdj.js +74 -0
- package/dist/Dropdown-BRN-hpgd.js +133 -0
- package/dist/Dropdown-j62nqdd-.js +112 -0
- package/dist/EmbedURL-Bgr2pdf_.js +114 -0
- package/dist/EmbedURL-DFt6rN3J.js +142 -0
- package/dist/FileUpload-B5TBQJPC.js +54 -0
- package/dist/FileUpload-sYxMn9Rj.js +47 -0
- package/dist/Form-7ZWgBVzR.js +286 -0
- package/dist/Form-CsN7UMF-.js +339 -0
- package/dist/Icon-B_2ZWGd0.js +64 -0
- package/dist/Icon-CkLIObME.js +74 -0
- package/dist/Image-CcswllGj.js +93 -0
- package/dist/Image-CihbGdKt.js +111 -0
- package/dist/Link-BEUscah_.js +95 -0
- package/dist/Link-C4HV3i5L.js +76 -0
- package/dist/Menu-B98hcumz.js +83 -0
- package/dist/Menu-BEzo-k-M.js +73 -0
- package/dist/MicroApp-BDPSu_XC.js +75 -0
- package/dist/MicroApp-DCBOKAJ4.js +100 -0
- package/dist/NumberInput-Bbo10XmQ.js +95 -0
- package/dist/NumberInput-YJKsJDcd.js +84 -0
- package/dist/Panel-C1tcqveD.js +161 -0
- package/dist/Panel-DidE5uT5.js +127 -0
- package/dist/Radio-button-CuVS3-fC.js +71 -0
- package/dist/Radio-button-Cxj0bL8i.js +53 -0
- package/dist/RefComponent-BgOcavVg.js +79 -0
- package/dist/RefComponent-DTerPZ8J.js +96 -0
- package/dist/RichText-BiZgSdNO.js +449 -0
- package/dist/RichText-CwMNVuR_.js +485 -0
- package/dist/Row-BEx5bGTR.js +202 -0
- package/dist/Row-XczXHjOV.js +229 -0
- package/dist/Select-Bd16OOiE.js +87 -0
- package/dist/Select-D0xinu-U.js +77 -0
- package/dist/Slider-BVFPWYh3.js +55 -0
- package/dist/Slider-DGulvswN.js +74 -0
- package/dist/Table-C44wa8yn.js +159 -0
- package/dist/Table-CQiS_Q-s.js +184 -0
- package/dist/Tabs-CPQxFISc.js +131 -0
- package/dist/Tabs-DW2Su8xF.js +116 -0
- package/dist/Tag-BEfAQrjG.js +61 -0
- package/dist/Tag-BLxTFDcC.js +47 -0
- package/dist/TextInput-BWhdGS3a.js +148 -0
- package/dist/TextInput-CV850FvO.js +193 -0
- package/dist/TextLabel-CbSGmoVY.js +102 -0
- package/dist/Textarea-Bncyxfts.js +83 -0
- package/dist/Textarea-SEbx4KI5.js +117 -0
- package/dist/Video--shJ014h.js +120 -0
- package/dist/Video-CflXfaiK.js +100 -0
- package/dist/aitchat-Btz9TPEN.js +23 -0
- package/dist/colorpicker-BO_4CeX4.js +64 -0
- package/dist/colorpicker-UzXsx6gP.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-tpaxIZJS.js} +1 -1
- package/dist/{freemarker2-CYRLpyjt.js → freemarker2-Nx-tkO9y.js} +1 -1
- package/dist/{handlebars-R8Efxi60.js → handlebars-CF3Jmmto.js} +1 -1
- package/dist/{html-czhjovcp.js → html-CdZEJTJR.js} +1 -1
- package/dist/{htmlMode-DpyKDYYs.js → htmlMode-CztruwTl.js} +1 -1
- package/dist/iconbutton-BwuZYQyh.js +53 -0
- package/dist/iconbutton-CE0Vxu1G.js +69 -0
- package/dist/{javascript-DwqkMEdb.js → javascript-CVODTc2t.js} +1 -1
- package/dist/{jsonMode-Cmxxe0W9.js → jsonMode-ChPl6moP.js} +1 -1
- package/dist/{liquid-2spuEcBh.js → liquid-BckHw388.js} +1 -1
- package/dist/{mdx-BjBXyEeR.js → mdx-DB1fiwuN.js} +1 -1
- package/dist/micro-app-entry-BgDXbkmh.js +12042 -0
- package/dist/micro-app.bundle.js +1 -1
- package/dist/micro-app.js +6 -4969
- package/dist/{python-DLI1ji08.js → python-DOQt67t7.js} +1 -1
- package/dist/{razor-oAnIJsrL.js → razor-D65ZeXuP.js} +1 -1
- package/dist/runtime.js +4 -2
- package/dist/{tsMode-D_PMsbjK.js → tsMode-CXrSAnjJ.js} +1 -1
- package/dist/{typescript-Bu3ZbtQI.js → typescript-BuKvlC_a.js} +1 -1
- package/dist/{xml-CNSSkPqy.js → xml-_nj2r-yt.js} +1 -1
- package/dist/{yaml-5RF_PGNe.js → yaml-m8PrW_TL.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,193 @@
|
|
|
1
|
+
import { nothing, html, css } from 'lit';
|
|
2
|
+
import { property, state, customElement } from 'lit/decorators.js';
|
|
3
|
+
import { ae as BaseElementBlock } from './BaseElement-wyA58UxT.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,102 @@
|
|
|
1
|
+
import { css, nothing, html } from 'lit';
|
|
2
|
+
import { property, state, customElement } from 'lit/decorators.js';
|
|
3
|
+
import { ae as BaseElementBlock } from './BaseElement-wyA58UxT.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,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-BgDXbkmh.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
|
+
};
|
|
@@ -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-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/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,120 @@
|
|
|
1
|
+
import { html, nothing, 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/video');
|
|
19
|
+
} catch (error) {
|
|
20
|
+
console.warn("[@nuralyui/video] Package not found or failed to load.");
|
|
21
|
+
}
|
|
22
|
+
let VideoBlock = class extends BaseElementBlock {
|
|
23
|
+
renderComponent() {
|
|
24
|
+
const videoStyles = this.getStyles() || {};
|
|
25
|
+
const videoStyleHandlers = this.component?.styleHandlers ? Object.fromEntries(
|
|
26
|
+
Object.entries(this.component?.styleHandlers).filter(([key, value]) => value)
|
|
27
|
+
) : {};
|
|
28
|
+
const src = this.inputHandlersValue?.src;
|
|
29
|
+
const poster = this.inputHandlersValue?.poster;
|
|
30
|
+
const autoplay = this.inputHandlersValue?.autoplay ?? false;
|
|
31
|
+
const controls = this.inputHandlersValue?.controls ?? true;
|
|
32
|
+
const loop = this.inputHandlersValue?.loop ?? false;
|
|
33
|
+
const muted = this.inputHandlersValue?.muted ?? false;
|
|
34
|
+
const preload = this.inputHandlersValue?.preload ?? "metadata";
|
|
35
|
+
if (!src) {
|
|
36
|
+
return html`
|
|
37
|
+
<div
|
|
38
|
+
${ref(this.inputRef)}
|
|
39
|
+
class="video-placeholder"
|
|
40
|
+
style=${styleMap({
|
|
41
|
+
...this.getStyles(),
|
|
42
|
+
width: videoStyleHandlers?.width || videoStyles?.width || "100%",
|
|
43
|
+
height: videoStyleHandlers?.height || videoStyles?.height || "200px"
|
|
44
|
+
})}
|
|
45
|
+
@click=${(e) => this.executeEvent("onClick", e)}
|
|
46
|
+
>
|
|
47
|
+
<nr-icon name="video"></nr-icon>
|
|
48
|
+
<nr-label>No video source</nr-label>
|
|
49
|
+
</div>
|
|
50
|
+
`;
|
|
51
|
+
}
|
|
52
|
+
return html`
|
|
53
|
+
<nr-video-player
|
|
54
|
+
${ref(this.inputRef)}
|
|
55
|
+
style=${styleMap({
|
|
56
|
+
...this.getStyles(),
|
|
57
|
+
"display": "block"
|
|
58
|
+
})}
|
|
59
|
+
.src=${src}
|
|
60
|
+
.poster=${poster ?? nothing}
|
|
61
|
+
.autoplay=${autoplay}
|
|
62
|
+
.controls=${controls}
|
|
63
|
+
.loop=${loop}
|
|
64
|
+
.muted=${muted}
|
|
65
|
+
.preload=${preload}
|
|
66
|
+
.width=${videoStyleHandlers?.width || videoStyles?.width}
|
|
67
|
+
.height=${videoStyleHandlers?.height || videoStyles?.height}
|
|
68
|
+
@click=${(e) => this.executeEvent("onClick", e)}
|
|
69
|
+
@play=${(e) => this.executeEvent("onPlay", e)}
|
|
70
|
+
@pause=${(e) => this.executeEvent("onPause", e)}
|
|
71
|
+
@ended=${(e) => this.executeEvent("onEnded", e)}
|
|
72
|
+
@loadeddata=${(e) => this.executeEvent("onLoad", e)}
|
|
73
|
+
@error=${(e) => this.executeEvent("onError", e)}
|
|
74
|
+
@timeupdate=${(e) => {
|
|
75
|
+
const video = e.target;
|
|
76
|
+
this.executeEvent("onTimeUpdate", e, {
|
|
77
|
+
currentTime: video?.currentTime,
|
|
78
|
+
duration: video?.duration
|
|
79
|
+
});
|
|
80
|
+
}}
|
|
81
|
+
@volumechange=${(e) => {
|
|
82
|
+
const video = e.target;
|
|
83
|
+
this.executeEvent("onVolumeChange", e, {
|
|
84
|
+
volume: video?.volume,
|
|
85
|
+
muted: video?.muted
|
|
86
|
+
});
|
|
87
|
+
}}
|
|
88
|
+
>
|
|
89
|
+
</nr-video-player>
|
|
90
|
+
`;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
VideoBlock.styles = [css`
|
|
94
|
+
.video-placeholder {
|
|
95
|
+
display: flex;
|
|
96
|
+
flex-direction: column;
|
|
97
|
+
align-items: center;
|
|
98
|
+
justify-content: center;
|
|
99
|
+
color: #64748b;
|
|
100
|
+
min-height: 200px;
|
|
101
|
+
border-radius: 8px;
|
|
102
|
+
border: 2px dashed #cbd5e1;
|
|
103
|
+
gap: 12px;
|
|
104
|
+
}
|
|
105
|
+
.video-placeholder nr-icon {
|
|
106
|
+
--nuraly-icon-size: 48px;
|
|
107
|
+
}
|
|
108
|
+
.video-placeholder span {
|
|
109
|
+
font-size: 14px;
|
|
110
|
+
font-weight: 500;
|
|
111
|
+
}
|
|
112
|
+
`];
|
|
113
|
+
__decorateClass([
|
|
114
|
+
property({ type: Object })
|
|
115
|
+
], VideoBlock.prototype, "component", 2);
|
|
116
|
+
VideoBlock = __decorateClass([
|
|
117
|
+
customElement("video-block")
|
|
118
|
+
], VideoBlock);
|
|
119
|
+
|
|
120
|
+
export { VideoBlock };
|