@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
|
@@ -2822,13 +2822,6 @@ function createPageFunctions() {
|
|
|
2822
2822
|
};
|
|
2823
2823
|
}
|
|
2824
2824
|
|
|
2825
|
-
function addTempApplication(uuid, components) {
|
|
2826
|
-
$components.set({
|
|
2827
|
-
...$components.get(),
|
|
2828
|
-
[uuid]: components
|
|
2829
|
-
});
|
|
2830
|
-
}
|
|
2831
|
-
|
|
2832
2825
|
function setApplication(apps) {
|
|
2833
2826
|
$applications.set(apps);
|
|
2834
2827
|
}
|
|
@@ -3251,6 +3244,11 @@ ToastContainer = __decorateClass$4([
|
|
|
3251
3244
|
customElement("toast-container")
|
|
3252
3245
|
], ToastContainer);
|
|
3253
3246
|
|
|
3247
|
+
const ToastContainer$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
3248
|
+
__proto__: null,
|
|
3249
|
+
get ToastContainer () { return ToastContainer; }
|
|
3250
|
+
}, Symbol.toStringTag, { value: 'Module' }));
|
|
3251
|
+
|
|
3254
3252
|
let toastIdCounter = 0;
|
|
3255
3253
|
function generateToastId() {
|
|
3256
3254
|
return `toast-${Date.now()}-${++toastIdCounter}`;
|
|
@@ -4350,19 +4348,6 @@ function setContextMenuEvent(e) {
|
|
|
4350
4348
|
$contextMenuEvent.set(e);
|
|
4351
4349
|
}
|
|
4352
4350
|
|
|
4353
|
-
function addGeneratedComponents(structureComponent) {
|
|
4354
|
-
structureComponent.forEach((component) => {
|
|
4355
|
-
addComponentAction(
|
|
4356
|
-
component,
|
|
4357
|
-
getVar("global", "currentPage").value,
|
|
4358
|
-
getVar("global", "currentEditingApplication").value.uuid
|
|
4359
|
-
);
|
|
4360
|
-
});
|
|
4361
|
-
setTimeout(() => {
|
|
4362
|
-
eventDispatcher.emit("component:refresh");
|
|
4363
|
-
}, 1e3);
|
|
4364
|
-
}
|
|
4365
|
-
|
|
4366
4351
|
function addlogDebug({
|
|
4367
4352
|
errors
|
|
4368
4353
|
}) {
|
|
@@ -4459,6 +4444,142 @@ function registerComponents(components) {
|
|
|
4459
4444
|
components.forEach((options) => ComponentRegistry.register(options));
|
|
4460
4445
|
}
|
|
4461
4446
|
|
|
4447
|
+
const loadedComponents = /* @__PURE__ */ new Set();
|
|
4448
|
+
const loadingPromises = /* @__PURE__ */ new Map();
|
|
4449
|
+
const componentImports = {
|
|
4450
|
+
// Layout components with @nuralyui dependencies
|
|
4451
|
+
"grid-row-block": () => import('./Row-Bb95f5DI.js'),
|
|
4452
|
+
"grid-col-block": () => import('./Col-B_wpWUcU.js'),
|
|
4453
|
+
"panel-block": () => import('./Panel-CwzW9iuA.js'),
|
|
4454
|
+
"tabs-block": () => import('./Tabs-BDKEv1jn.js'),
|
|
4455
|
+
"card-block": () => import('./Card-B70c8NFb.js'),
|
|
4456
|
+
// Input components with @nuralyui dependencies
|
|
4457
|
+
"select-block": () => import('./Select-DqA08VYb.js'),
|
|
4458
|
+
"button-block": () => import('./Button-BHAN7npC.js'),
|
|
4459
|
+
"checkbox-block": () => import('./Checkbox-LYTIBAUV.js'),
|
|
4460
|
+
"radio-button-block": () => import('./Radio-button-Sii5iveh.js'),
|
|
4461
|
+
"color-picker-block": () => import('./colorpicker-DhB0AygJ.js'),
|
|
4462
|
+
"date-picker-block": () => import('./DatePicker-BmEOONiA.js'),
|
|
4463
|
+
"dropdown-block": () => import('./Dropdown-BRtHvDa3.js'),
|
|
4464
|
+
"text-input-block": () => import('./TextInput-KI6r9xET.js'),
|
|
4465
|
+
"number-input-block": () => import('./NumberInput-eOAk0-fb.js'),
|
|
4466
|
+
"textarea-block": () => import('./Textarea-Bzs3jSUm.js'),
|
|
4467
|
+
"slider-block": () => import('./Slider-B2_Qecjz.js'),
|
|
4468
|
+
"file-upload-block": () => import('./FileUpload-BBgPcRag.js'),
|
|
4469
|
+
"form-block": () => import('./Form-BLq6U3In.js'),
|
|
4470
|
+
"icon-button-block": () => import('./iconbutton-DfnrRmmB.js'),
|
|
4471
|
+
// Display components with @nuralyui dependencies
|
|
4472
|
+
"table-block": () => import('./Table-dEma50kw.js'),
|
|
4473
|
+
"icon-block": () => import('./Icon-_UiLblGb.js'),
|
|
4474
|
+
"image-block": () => import('./Image-B_VERIvH.js'),
|
|
4475
|
+
"divider-block": () => import('./Divider-etMTYU3d.js'),
|
|
4476
|
+
"text-label-block": () => import('./TextLabel-DkV26yaL.js'),
|
|
4477
|
+
"badge-block": () => import('./Badge-DzNZFKtC.js'),
|
|
4478
|
+
"tag-block": () => import('./Tag-DMZ0mu8y.js'),
|
|
4479
|
+
"video-block": () => import('./Video-CL1lgcvB.js'),
|
|
4480
|
+
"code-block": () => import('./Code-BWbiciC8.js'),
|
|
4481
|
+
// Navigation components
|
|
4482
|
+
"menu-block": () => import('./Menu-CembLIjO.js'),
|
|
4483
|
+
"link-block": () => import('./Link-xSrPxOLt.js'),
|
|
4484
|
+
"embed-url-block": () => import('./EmbedURL-BwbJRnY1.js'),
|
|
4485
|
+
// Advanced components
|
|
4486
|
+
"ai-chat-block": () => import('./AIChat-km1IYaR-.js'),
|
|
4487
|
+
"collapse-block": () => import('./Collapse-Dkw6Ner6.js'),
|
|
4488
|
+
"collection-viewer": () => import('./Collections-D5rwMFbv.js'),
|
|
4489
|
+
"ref-component-container-block": () => import('./RefComponent-ZxafRVhZ.js'),
|
|
4490
|
+
"rich-text-block": () => import('./RichText-CgYXXC_a.js'),
|
|
4491
|
+
"micro-app-block": () => import('./MicroApp-DI1kQwJk.js'),
|
|
4492
|
+
// Utility components
|
|
4493
|
+
"document-block": () => import('./Document-Cj-TmjAf.js'),
|
|
4494
|
+
"vertical-container-block": () => import('./Container-DMNh5U4Y.js'),
|
|
4495
|
+
"toast-container": () => Promise.resolve().then(() => ToastContainer$1)
|
|
4496
|
+
};
|
|
4497
|
+
async function loadComponent(tagName) {
|
|
4498
|
+
if (loadedComponents.has(tagName)) {
|
|
4499
|
+
return;
|
|
4500
|
+
}
|
|
4501
|
+
if (loadingPromises.has(tagName)) {
|
|
4502
|
+
return loadingPromises.get(tagName);
|
|
4503
|
+
}
|
|
4504
|
+
const importFn = componentImports[tagName];
|
|
4505
|
+
if (!importFn) {
|
|
4506
|
+
console.warn(`[LazyLoader] No import found for component: ${tagName}`);
|
|
4507
|
+
return;
|
|
4508
|
+
}
|
|
4509
|
+
const loadPromise = importFn().then(() => {
|
|
4510
|
+
loadedComponents.add(tagName);
|
|
4511
|
+
loadingPromises.delete(tagName);
|
|
4512
|
+
}).catch((error) => {
|
|
4513
|
+
console.warn(`[LazyLoader] Failed to load component ${tagName}:`, error);
|
|
4514
|
+
loadingPromises.delete(tagName);
|
|
4515
|
+
});
|
|
4516
|
+
loadingPromises.set(tagName, loadPromise);
|
|
4517
|
+
return loadPromise;
|
|
4518
|
+
}
|
|
4519
|
+
async function loadComponents(tagNames) {
|
|
4520
|
+
await Promise.all(tagNames.map(loadComponent));
|
|
4521
|
+
}
|
|
4522
|
+
function isComponentLoaded(tagName) {
|
|
4523
|
+
return loadedComponents.has(tagName);
|
|
4524
|
+
}
|
|
4525
|
+
function getAvailableComponents() {
|
|
4526
|
+
return Object.keys(componentImports);
|
|
4527
|
+
}
|
|
4528
|
+
|
|
4529
|
+
const componentTypeToTagName = {
|
|
4530
|
+
[ComponentType.Select]: "select-block",
|
|
4531
|
+
[ComponentType.IconButton]: "icon-button-block",
|
|
4532
|
+
[ComponentType.ColorPicker]: "color-picker-block",
|
|
4533
|
+
[ComponentType.NumberInput]: "number-input-block",
|
|
4534
|
+
[ComponentType.TextInput]: "text-input-block",
|
|
4535
|
+
[ComponentType.TextLabel]: "text-label-block",
|
|
4536
|
+
[ComponentType.Button]: "button-block",
|
|
4537
|
+
[ComponentType.Tabs]: "tabs-block",
|
|
4538
|
+
[ComponentType.Menu]: "menu-block",
|
|
4539
|
+
[ComponentType.Table]: "table-block",
|
|
4540
|
+
[ComponentType.Container]: "vertical-container-block",
|
|
4541
|
+
[ComponentType.Collection]: "collection-viewer",
|
|
4542
|
+
[ComponentType.Checkbox]: "checkbox-block",
|
|
4543
|
+
[ComponentType.DatePicker]: "date-picker-block",
|
|
4544
|
+
[ComponentType.Divider]: "divider-block",
|
|
4545
|
+
[ComponentType.Icon]: "icon-block",
|
|
4546
|
+
[ComponentType.Image]: "image-block",
|
|
4547
|
+
[ComponentType.RadioButton]: "radio-button-block",
|
|
4548
|
+
[ComponentType.AI]: "ai-chat-block",
|
|
4549
|
+
[ComponentType.MicroApp]: "micro-app-block",
|
|
4550
|
+
[ComponentType.Collapse]: "collapse-block",
|
|
4551
|
+
[ComponentType.Dropdown]: "dropdown-block",
|
|
4552
|
+
[ComponentType.RefComponent]: "ref-component-container-block",
|
|
4553
|
+
[ComponentType.Code]: "code-block",
|
|
4554
|
+
[ComponentType.RichText]: "rich-text-block",
|
|
4555
|
+
[ComponentType.EmbedURL]: "embed-url-block",
|
|
4556
|
+
[ComponentType.Link]: "link-block",
|
|
4557
|
+
[ComponentType.FileUpload]: "file-upload-block",
|
|
4558
|
+
[ComponentType.Video]: "video-block",
|
|
4559
|
+
[ComponentType.Document]: "document-block",
|
|
4560
|
+
[ComponentType.Textarea]: "textarea-block",
|
|
4561
|
+
[ComponentType.Badge]: "badge-block",
|
|
4562
|
+
[ComponentType.Card]: "card-block",
|
|
4563
|
+
[ComponentType.Tag]: "tag-block",
|
|
4564
|
+
[ComponentType.Slider]: "slider-block",
|
|
4565
|
+
[ComponentType.Panel]: "panel-block",
|
|
4566
|
+
[ComponentType.GridRow]: "grid-row-block",
|
|
4567
|
+
[ComponentType.GridCol]: "grid-col-block",
|
|
4568
|
+
[ComponentType.Form]: "form-block"
|
|
4569
|
+
};
|
|
4570
|
+
async function preloadComponents(components) {
|
|
4571
|
+
const tagNames = /* @__PURE__ */ new Set();
|
|
4572
|
+
function collectTagNames(comps) {
|
|
4573
|
+
for (const comp of comps) {
|
|
4574
|
+
const tagName = componentTypeToTagName[comp?.component_type];
|
|
4575
|
+
if (tagName) {
|
|
4576
|
+
tagNames.add(tagName);
|
|
4577
|
+
}
|
|
4578
|
+
}
|
|
4579
|
+
}
|
|
4580
|
+
collectTagNames(components);
|
|
4581
|
+
await Promise.all(Array.from(tagNames).map(loadComponent));
|
|
4582
|
+
}
|
|
4462
4583
|
const selectTemplate = (props, isViewMode) => html`<select-block .isViewMode=${isViewMode} .parentcomponent=${props.parent} .item=${props.item} .component=${props.component}></select-block>`;
|
|
4463
4584
|
const iconButtonTemplate = (props, isViewMode) => html`<icon-button-block .isViewMode=${isViewMode} .parentcomponent=${props.parent} .item=${props.item} .component=${props.component}></icon-button-block>`;
|
|
4464
4585
|
const colorPickerTemplate = (props, isViewMode) => html`<color-picker-block .isViewMode=${isViewMode} .parentcomponent=${props.parent} .item=${props.item} .component=${props.component}></color-picker-block>`;
|
|
@@ -4597,6 +4718,17 @@ function getComponentTemplate(component, commonProps, isViewMode) {
|
|
|
4597
4718
|
}
|
|
4598
4719
|
function renderComponent(components, item, isViewMode, parent) {
|
|
4599
4720
|
if (!components || !components.length) return html``;
|
|
4721
|
+
preloadComponents(components);
|
|
4722
|
+
return html`
|
|
4723
|
+
${components.map((component) => {
|
|
4724
|
+
const commonProps = { item: { ...item }, component, parent: { ...parent } };
|
|
4725
|
+
return renderComponentElement(component, commonProps, isViewMode);
|
|
4726
|
+
})}
|
|
4727
|
+
`;
|
|
4728
|
+
}
|
|
4729
|
+
async function renderComponentAsync(components, item, isViewMode, parent) {
|
|
4730
|
+
if (!components || !components.length) return html``;
|
|
4731
|
+
await preloadComponents(components);
|
|
4600
4732
|
return html`
|
|
4601
4733
|
${components.map((component) => {
|
|
4602
4734
|
const commonProps = { item: { ...item }, component, parent: { ...parent } };
|
|
@@ -4671,9 +4803,6 @@ function hasOnlyEmptyObjects(error) {
|
|
|
4671
4803
|
);
|
|
4672
4804
|
}
|
|
4673
4805
|
|
|
4674
|
-
const NO_EVENT_LISTENER = "";
|
|
4675
|
-
const EMPTY_STRING = "";
|
|
4676
|
-
|
|
4677
4806
|
setupChangeDetection();
|
|
4678
4807
|
|
|
4679
4808
|
class EventDebouncer {
|
|
@@ -6497,4 +6626,4 @@ class BaseElementBlock extends EditorModeMixin(BaseElementCore) {
|
|
|
6497
6626
|
}
|
|
6498
6627
|
}
|
|
6499
6628
|
|
|
6500
|
-
export { $components as $, $componentWithChildren as A, $runtimeStyles as B, $runtimeValues as C, $componentRuntimeValuesById as D, ExecuteInstance as E, FRONT_API_URLS as F, $componentRuntimeValueByKey as G, $componentsByUUIDs as H, $runtimeStylescomponentStyleByID as I, getAllChildrenRecursive as J, getDirectChildren as K, $componentById as L, setComponentRuntimeValue as M, setComponentRuntimeValues as N, setcomponentRuntimeStyleAttribute as O, clearComponentRuntimeValues as P, clearComponentRuntimeValue as Q, RuntimeInstance as R, clearAllRuntimeValues as S, clearComponentRuntimeStyleAttributes as T, fillComponentChildren as U, fillApplicationComponents as V, extractChildresIds as W, extractAllChildrenIds as X, $applications as Y, $currentPage as Z, $contextMenuEvent as _, $hoveredComponent as a,
|
|
6629
|
+
export { $components as $, $componentWithChildren as A, $runtimeStyles as B, $runtimeValues as C, $componentRuntimeValuesById as D, ExecuteInstance as E, FRONT_API_URLS as F, $componentRuntimeValueByKey as G, $componentsByUUIDs as H, $runtimeStylescomponentStyleByID as I, getAllChildrenRecursive as J, getDirectChildren as K, $componentById as L, setComponentRuntimeValue as M, setComponentRuntimeValues as N, setcomponentRuntimeStyleAttribute as O, clearComponentRuntimeValues as P, clearComponentRuntimeValue as Q, RuntimeInstance as R, clearAllRuntimeValues as S, clearComponentRuntimeStyleAttributes as T, fillComponentChildren as U, fillApplicationComponents as V, extractChildresIds as W, extractAllChildrenIds as X, $applications as Y, $currentPage as Z, $contextMenuEvent as _, $hoveredComponent as a, generateNuralyClipboardStructure as a$, $microAppCurrentPage as a0, $applicationPages as a1, refreshPageStoreVar as a2, $context as a3, ViewMode as a4, $toasts as a5, $debug as a6, $providers as a7, executeHandler as a8, getContextFromComponent as a9, addComponentHandler as aA, deleteComponentActionHandler as aB, validateAndEmitErrors as aC, updatePageHandler as aD, deletePageHandler as aE, refreshPagesActionHandler as aF, loadOrRefreshApplications as aG, createApplicationAction as aH, deleteApplicationAction as aI, addPermission as aJ, invokeFunctionHandler as aK, loadFunctionsHandler as aL, renderComponent as aM, renderComponentAsync as aN, loadComponent as aO, loadComponents as aP, isComponentLoaded as aQ, getAvailableComponents as aR, log as aS, setLogLevel as aT, enableLogging as aU, enableBenchmarking as aV, LOG_LEVELS as aW, eventDispatcher as aX, copyCpmponentToClipboard as aY, pasteComponentFromClipboard as aZ, traitCompoentFromSchema as a_, compileHandlerFunction as aa, ComponentRegistry as ab, registerComponent as ac, registerComponents as ad, BaseElementBlock as ae, BaseElementCore as af, addComponentAction as ag, addComponentToCurrentPageAction as ah, deleteComponentAction as ai, moveDraggedComponent as aj, setCurrentComponentIdAction as ak, setDraggingComponentInfo as al, updateComponentName as am, updateComponentAttributes as an, deletePageAction as ao, setContextMenuEvent as ap, updatePageAction as aq, addPageToApplicationAction as ar, setApplication as as, setPermissionMessage as at, updateApplication as au, closeCreateApplicationModalAction as av, openEditorTab as aw, setCurrentEditorTab as ax, addlogDebug as ay, resetComponentDebug as az, $hoveredComponentId as b, RuntimeContextHelpers as b0, validateHandlerCode as b1, validateComponentHandlers as b2, isForbiddenGlobal as b3, isForbiddenProperty as b4, isAllowedGlobal as b5, isForbiddenFunction as b6, getErrorMessage as b7, FORBIDDEN_GLOBALS as b8, FORBIDDEN_PROPERTIES as b9, FORBIDDEN_FUNCTIONS as ba, VALIDATION_ERROR_MESSAGES as bb, formatValidationErrors as bc, getNestedAttribute as bd, hasOnlyEmptyObjects as be, GenerateName as bf, showToast as bg, hideToast as bh, clearAllToasts as bi, showSuccess as bj, showError as bk, showWarning as bl, showInfo as bm, ToastContainer as bn, getInitPlatform as bo, getVar as bp, $showShareApplicationModal as c, $permissionsState as d, $applicationPermission as e, $currentApplication as f, updateApplicationActionHandler as g, $showCreateApplicationModal as h, $editorState as i, $environment as j, addPageHandler as k, $currentPageId as l, $currentPageViewPort as m, $resizing as n, $showBorder as o, $pageSize as p, $pages as q, removeComponentToCurrentPageAction as r, $pageZoom as s, EditorInstance as t, updateComponentHandler as u, RuntimeHelpers as v, $applicationComponents as w, $selectedComponent as x, $currentComponentId as y, $draggingComponentInfo as z };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { nothing, html, css } 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 } 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/button');
|
|
19
|
+
} catch (error) {
|
|
20
|
+
console.warn("[@nuralyui/button] Package not found or failed to load. Button functionality may be limited.");
|
|
21
|
+
}
|
|
22
|
+
let ButtonBlock = class extends BaseElementBlock {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
this.display = false;
|
|
26
|
+
}
|
|
27
|
+
connectedCallback() {
|
|
28
|
+
super.connectedCallback();
|
|
29
|
+
this.registerCallback("value", () => {
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
renderComponent() {
|
|
33
|
+
const buttonStyles = this.getStyles();
|
|
34
|
+
const iconArray = this.inputHandlersValue.icon ? [this.inputHandlersValue.icon] : [];
|
|
35
|
+
return html`
|
|
36
|
+
<nr-button
|
|
37
|
+
${ref(this.inputRef)}
|
|
38
|
+
size=${this.inputHandlersValue?.size || nothing}
|
|
39
|
+
type=${this.inputHandlersValue?.type || "default"}
|
|
40
|
+
.shape=${this.inputHandlersValue?.shape || nothing}
|
|
41
|
+
.disabled=${this.inputHandlersValue?.state == "disabled"}
|
|
42
|
+
.loading=${this.inputHandlersValue?.loading || false}
|
|
43
|
+
.block=${this.inputHandlersValue?.block || false}
|
|
44
|
+
.dashed=${this.inputHandlersValue?.dashed || false}
|
|
45
|
+
.icon=${iconArray}
|
|
46
|
+
.iconLeft=${this.inputHandlersValue?.iconLeft || nothing}
|
|
47
|
+
.iconRight=${this.inputHandlersValue?.iconRight || nothing}
|
|
48
|
+
.icons=${this.inputHandlersValue?.icons || nothing}
|
|
49
|
+
.iconPosition=${this.inputHandlersValue?.iconPosition || "left"}
|
|
50
|
+
.href=${this.inputHandlersValue?.href || nothing}
|
|
51
|
+
.target=${this.inputHandlersValue?.target || nothing}
|
|
52
|
+
.ripple=${this.inputHandlersValue?.ripple !== false}
|
|
53
|
+
.buttonAriaLabel=${this.inputHandlersValue?.ariaLabel || nothing}
|
|
54
|
+
.htmlType=${this.inputHandlersValue?.htmlType || nothing}
|
|
55
|
+
@click=${(e) => {
|
|
56
|
+
this.executeEvent("onClick", e);
|
|
57
|
+
}}
|
|
58
|
+
@button-clicked=${(e) => {
|
|
59
|
+
this.executeEvent("onButtonClicked", e);
|
|
60
|
+
}}
|
|
61
|
+
@link-navigation=${(e) => {
|
|
62
|
+
this.executeEvent("onLinkNavigation", e);
|
|
63
|
+
}}
|
|
64
|
+
style=${styleMap({
|
|
65
|
+
...this.getStyles(),
|
|
66
|
+
width: buttonStyles?.width,
|
|
67
|
+
height: buttonStyles?.height
|
|
68
|
+
})}
|
|
69
|
+
>
|
|
70
|
+
${this.inputHandlersValue.label ? this.inputHandlersValue.label : this.inputHandlersValue.iconOnly ? "" : "Button"}
|
|
71
|
+
</nr-button>
|
|
72
|
+
`;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
ButtonBlock.styles = [
|
|
76
|
+
css`
|
|
77
|
+
:host {
|
|
78
|
+
--nuraly-button-icon-width: 19px;
|
|
79
|
+
}
|
|
80
|
+
`
|
|
81
|
+
];
|
|
82
|
+
__decorateClass([
|
|
83
|
+
property({ type: Object })
|
|
84
|
+
], ButtonBlock.prototype, "component", 2);
|
|
85
|
+
__decorateClass([
|
|
86
|
+
state()
|
|
87
|
+
], ButtonBlock.prototype, "display", 2);
|
|
88
|
+
ButtonBlock = __decorateClass([
|
|
89
|
+
customElement("button-block")
|
|
90
|
+
], ButtonBlock);
|
|
91
|
+
|
|
92
|
+
export { ButtonBlock };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { B as p, n as c, A as e, o as h, b as d, i as b, c as $, d as f, t as y } from "./micro-app-entry-DiNqE6xi.js";
|
|
2
|
+
var H = Object.defineProperty, V = Object.getOwnPropertyDescriptor, r = (i, l, t, s) => {
|
|
3
|
+
for (var n = s > 1 ? void 0 : s ? V(l, t) : l, o = i.length - 1, u; o >= 0; o--)
|
|
4
|
+
(u = i[o]) && (n = (s ? u(l, t, n) : u(n)) || n);
|
|
5
|
+
return s && n && H(l, t, n), n;
|
|
6
|
+
};
|
|
7
|
+
try {
|
|
8
|
+
await import("@nuralyui/button");
|
|
9
|
+
} catch {
|
|
10
|
+
console.warn("[@nuralyui/button] Package not found or failed to load. Button functionality may be limited.");
|
|
11
|
+
}
|
|
12
|
+
let a = class extends p {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments), this.display = !1;
|
|
15
|
+
}
|
|
16
|
+
connectedCallback() {
|
|
17
|
+
super.connectedCallback(), this.registerCallback("value", () => {
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
renderComponent() {
|
|
21
|
+
const i = this.getStyles(), l = this.inputHandlersValue.icon ? [this.inputHandlersValue.icon] : [];
|
|
22
|
+
return d`
|
|
23
|
+
<nr-button
|
|
24
|
+
${c(this.inputRef)}
|
|
25
|
+
size=${this.inputHandlersValue?.size || e}
|
|
26
|
+
type=${this.inputHandlersValue?.type || "default"}
|
|
27
|
+
.shape=${this.inputHandlersValue?.shape || e}
|
|
28
|
+
.disabled=${this.inputHandlersValue?.state == "disabled"}
|
|
29
|
+
.loading=${this.inputHandlersValue?.loading || !1}
|
|
30
|
+
.block=${this.inputHandlersValue?.block || !1}
|
|
31
|
+
.dashed=${this.inputHandlersValue?.dashed || !1}
|
|
32
|
+
.icon=${l}
|
|
33
|
+
.iconLeft=${this.inputHandlersValue?.iconLeft || e}
|
|
34
|
+
.iconRight=${this.inputHandlersValue?.iconRight || e}
|
|
35
|
+
.icons=${this.inputHandlersValue?.icons || e}
|
|
36
|
+
.iconPosition=${this.inputHandlersValue?.iconPosition || "left"}
|
|
37
|
+
.href=${this.inputHandlersValue?.href || e}
|
|
38
|
+
.target=${this.inputHandlersValue?.target || e}
|
|
39
|
+
.ripple=${this.inputHandlersValue?.ripple !== !1}
|
|
40
|
+
.buttonAriaLabel=${this.inputHandlersValue?.ariaLabel || e}
|
|
41
|
+
.htmlType=${this.inputHandlersValue?.htmlType || e}
|
|
42
|
+
@click=${(t) => {
|
|
43
|
+
this.executeEvent("onClick", t);
|
|
44
|
+
}}
|
|
45
|
+
@button-clicked=${(t) => {
|
|
46
|
+
this.executeEvent("onButtonClicked", t);
|
|
47
|
+
}}
|
|
48
|
+
@link-navigation=${(t) => {
|
|
49
|
+
this.executeEvent("onLinkNavigation", t);
|
|
50
|
+
}}
|
|
51
|
+
style=${h({
|
|
52
|
+
...this.getStyles(),
|
|
53
|
+
width: i?.width,
|
|
54
|
+
height: i?.height
|
|
55
|
+
})}
|
|
56
|
+
>
|
|
57
|
+
${this.inputHandlersValue.label ? this.inputHandlersValue.label : this.inputHandlersValue.iconOnly ? "" : "Button"}
|
|
58
|
+
</nr-button>
|
|
59
|
+
`;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
a.styles = [
|
|
63
|
+
b`
|
|
64
|
+
:host {
|
|
65
|
+
--nuraly-button-icon-width: 19px;
|
|
66
|
+
}
|
|
67
|
+
`
|
|
68
|
+
];
|
|
69
|
+
r([
|
|
70
|
+
$({ type: Object })
|
|
71
|
+
], a.prototype, "component", 2);
|
|
72
|
+
r([
|
|
73
|
+
f()
|
|
74
|
+
], a.prototype, "display", 2);
|
|
75
|
+
a = r([
|
|
76
|
+
y("button-block")
|
|
77
|
+
], a);
|
|
78
|
+
export {
|
|
79
|
+
a as ButtonBlock
|
|
80
|
+
};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { nothing, html, css } from 'lit';
|
|
2
|
+
import { property, state, customElement } from 'lit/decorators.js';
|
|
3
|
+
import { styleMap } from 'lit/directives/style-map.js';
|
|
4
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
5
|
+
import { ae as BaseElementBlock, $ as $components, aM as renderComponent, v as RuntimeHelpers, ap as setContextMenuEvent, ak as setCurrentComponentIdAction } from './BaseElement-pS6m_x6Q.js';
|
|
6
|
+
import { ref } from 'lit/directives/ref.js';
|
|
7
|
+
|
|
8
|
+
var __defProp = Object.defineProperty;
|
|
9
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
10
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
11
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
12
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
13
|
+
if (decorator = decorators[i])
|
|
14
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
15
|
+
if (kind && result) __defProp(target, key, result);
|
|
16
|
+
return result;
|
|
17
|
+
};
|
|
18
|
+
try {
|
|
19
|
+
await import('@nuralyui/card');
|
|
20
|
+
} catch (error) {
|
|
21
|
+
console.warn("[@nuralyui/card] Package not found or failed to load.");
|
|
22
|
+
}
|
|
23
|
+
let CardBlock = class extends BaseElementBlock {
|
|
24
|
+
constructor() {
|
|
25
|
+
super(...arguments);
|
|
26
|
+
this.isViewMode = false;
|
|
27
|
+
this.childrenComponents = [];
|
|
28
|
+
this.dragOverSituation = false;
|
|
29
|
+
}
|
|
30
|
+
connectedCallback() {
|
|
31
|
+
super.connectedCallback();
|
|
32
|
+
this.updateChildrenComponents();
|
|
33
|
+
}
|
|
34
|
+
willUpdate(changedProperties) {
|
|
35
|
+
super.willUpdate(changedProperties);
|
|
36
|
+
if (changedProperties.has("component")) {
|
|
37
|
+
this.updateChildrenComponents();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
updateChildrenComponents() {
|
|
41
|
+
this.childrenComponents = this.component?.childrenIds?.map((id) => {
|
|
42
|
+
return $components.get()[this.component?.application_id]?.find((component) => component.uuid === id);
|
|
43
|
+
}) ?? [];
|
|
44
|
+
}
|
|
45
|
+
renderView() {
|
|
46
|
+
const cardStyles = this.component?.style || {};
|
|
47
|
+
const title = this.component?.input?.title?.value || this.inputHandlersValue?.title || "";
|
|
48
|
+
const bordered = this.component?.input?.bordered?.value ?? this.inputHandlersValue?.bordered ?? true;
|
|
49
|
+
const hoverable = this.component?.input?.hoverable?.value ?? this.inputHandlersValue?.hoverable ?? false;
|
|
50
|
+
const loading = this.component?.input?.loading?.value ?? this.inputHandlersValue?.loading ?? false;
|
|
51
|
+
const size = this.component?.input?.size?.value || this.inputHandlersValue?.size || "default";
|
|
52
|
+
return html`
|
|
53
|
+
<nr-card
|
|
54
|
+
id=${this.inputHandlersValue.id ?? nothing}
|
|
55
|
+
${ref(this.inputRef)}
|
|
56
|
+
data-component-uuid=${this.component?.uuid}
|
|
57
|
+
data-component-name=${this.component?.name}
|
|
58
|
+
style=${styleMap({
|
|
59
|
+
"width": RuntimeHelpers.extractUnit(cardStyles?.width) === "%" ? "100%" : cardStyles?.width ?? "auto",
|
|
60
|
+
...cardStyles
|
|
61
|
+
})}
|
|
62
|
+
class=${classMap({
|
|
63
|
+
"drag-over": this.dragOverSituation
|
|
64
|
+
})}
|
|
65
|
+
.header=${title}
|
|
66
|
+
.size=${size}
|
|
67
|
+
?bordered=${bordered}
|
|
68
|
+
?hoverable=${hoverable}
|
|
69
|
+
?loading=${loading}
|
|
70
|
+
@mouseenter="${(e) => this.executeEvent("onMouseEnter", { ...e, unique: this.uniqueUUID })}"
|
|
71
|
+
@mouseleave="${(e) => this.executeEvent("onMouseLeave", { ...e, unique: this.uniqueUUID })}"
|
|
72
|
+
@click=${(e) => this.executeEvent("onClick", e)}
|
|
73
|
+
>
|
|
74
|
+
<div slot="content">
|
|
75
|
+
${this.childrenComponents.length ? renderComponent(this.childrenComponents.map((component) => ({ ...component, item: this.item })), this.item, this.isViewMode, { ...this.component, uniqueUUID: this.uniqueUUID }) : nothing}
|
|
76
|
+
</div>
|
|
77
|
+
</nr-card>
|
|
78
|
+
`;
|
|
79
|
+
}
|
|
80
|
+
renderComponent() {
|
|
81
|
+
const cardStyles = this.component?.style || {};
|
|
82
|
+
const title = this.component?.input?.title?.value || this.inputHandlersValue?.title || "";
|
|
83
|
+
const bordered = this.component?.input?.bordered?.value ?? this.inputHandlersValue?.bordered ?? true;
|
|
84
|
+
const hoverable = this.component?.input?.hoverable?.value ?? this.inputHandlersValue?.hoverable ?? false;
|
|
85
|
+
const loading = this.component?.input?.loading?.value ?? this.inputHandlersValue?.loading ?? false;
|
|
86
|
+
const size = this.component?.input?.size?.value || this.inputHandlersValue?.size || "default";
|
|
87
|
+
return html`
|
|
88
|
+
${this.isViewMode ? this.renderView() : html`
|
|
89
|
+
<nr-card
|
|
90
|
+
${ref(this.inputRef)}
|
|
91
|
+
data-component-uuid=${this.component?.uuid}
|
|
92
|
+
data-component-name=${this.component?.name}
|
|
93
|
+
style=${styleMap(cardStyles)}
|
|
94
|
+
class=${classMap({
|
|
95
|
+
"drag-over": this.dragOverSituation
|
|
96
|
+
})}
|
|
97
|
+
.header=${title}
|
|
98
|
+
.size=${size}
|
|
99
|
+
?bordered=${bordered}
|
|
100
|
+
?hoverable=${hoverable}
|
|
101
|
+
?loading=${loading}
|
|
102
|
+
@click=${(e) => {
|
|
103
|
+
setContextMenuEvent(null);
|
|
104
|
+
this.executeEvent("onClick", e);
|
|
105
|
+
}}
|
|
106
|
+
>
|
|
107
|
+
<div slot="content" style=${styleMap({ "min-height": this.childrenComponents.length ? "auto" : "100px" })}>
|
|
108
|
+
${this.childrenComponents.length ? renderComponent(this.childrenComponents.map((component) => ({ ...component, item: this.item })), this.item, this.isViewMode, { ...this.component, uniqueUUID: this.uniqueUUID }) : html`
|
|
109
|
+
<div
|
|
110
|
+
style="padding: 20px; text-align: center; color: #999;"
|
|
111
|
+
@click="${() => setCurrentComponentIdAction(this.component?.uuid)}"
|
|
112
|
+
>
|
|
113
|
+
Add or Drag an item into this card
|
|
114
|
+
<drag-wrapper
|
|
115
|
+
.where=${"inside"}
|
|
116
|
+
.message=${"Drop inside"}
|
|
117
|
+
.component=${{ ...this.component }}
|
|
118
|
+
.inputRef=${this.inputRef}
|
|
119
|
+
.isDragInitiator=${this.isDragInitiator}
|
|
120
|
+
>
|
|
121
|
+
</drag-wrapper>
|
|
122
|
+
</div>
|
|
123
|
+
`}
|
|
124
|
+
</div>
|
|
125
|
+
</nr-card>
|
|
126
|
+
`}
|
|
127
|
+
`;
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
CardBlock.styles = [css``];
|
|
131
|
+
__decorateClass([
|
|
132
|
+
property({ type: Object })
|
|
133
|
+
], CardBlock.prototype, "component", 2);
|
|
134
|
+
__decorateClass([
|
|
135
|
+
property({ type: Object })
|
|
136
|
+
], CardBlock.prototype, "item", 2);
|
|
137
|
+
__decorateClass([
|
|
138
|
+
property({ type: Boolean })
|
|
139
|
+
], CardBlock.prototype, "isViewMode", 2);
|
|
140
|
+
__decorateClass([
|
|
141
|
+
state()
|
|
142
|
+
], CardBlock.prototype, "childrenComponents", 2);
|
|
143
|
+
__decorateClass([
|
|
144
|
+
state()
|
|
145
|
+
], CardBlock.prototype, "dragOverSituation", 2);
|
|
146
|
+
CardBlock = __decorateClass([
|
|
147
|
+
customElement("card-block")
|
|
148
|
+
], CardBlock);
|
|
149
|
+
|
|
150
|
+
export { CardBlock };
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { B as g, $ as C, A as c, n as h, o as u, g as m, r as v, R as b, b as d, a as f, s as w, i as y, c as p, d as $, t as V } from "./micro-app-entry-DiNqE6xi.js";
|
|
2
|
+
var U = Object.defineProperty, D = Object.getOwnPropertyDescriptor, l = (t, i, a, o) => {
|
|
3
|
+
for (var n = o > 1 ? void 0 : o ? D(i, a) : i, r = t.length - 1, e; r >= 0; r--)
|
|
4
|
+
(e = t[r]) && (n = (o ? e(i, a, n) : e(n)) || n);
|
|
5
|
+
return o && n && U(i, a, n), n;
|
|
6
|
+
};
|
|
7
|
+
try {
|
|
8
|
+
await import("@nuralyui/card");
|
|
9
|
+
} catch {
|
|
10
|
+
console.warn("[@nuralyui/card] Package not found or failed to load.");
|
|
11
|
+
}
|
|
12
|
+
let s = class extends g {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments), this.isViewMode = !1, this.childrenComponents = [], this.dragOverSituation = !1;
|
|
15
|
+
}
|
|
16
|
+
connectedCallback() {
|
|
17
|
+
super.connectedCallback(), this.updateChildrenComponents();
|
|
18
|
+
}
|
|
19
|
+
willUpdate(t) {
|
|
20
|
+
super.willUpdate(t), t.has("component") && this.updateChildrenComponents();
|
|
21
|
+
}
|
|
22
|
+
updateChildrenComponents() {
|
|
23
|
+
this.childrenComponents = this.component?.childrenIds?.map((t) => C.get()[this.component?.application_id]?.find((i) => i.uuid === t)) ?? [];
|
|
24
|
+
}
|
|
25
|
+
renderView() {
|
|
26
|
+
const t = this.component?.style || {}, i = this.component?.input?.title?.value || this.inputHandlersValue?.title || "", a = this.component?.input?.bordered?.value ?? this.inputHandlersValue?.bordered ?? !0, o = this.component?.input?.hoverable?.value ?? this.inputHandlersValue?.hoverable ?? !1, n = this.component?.input?.loading?.value ?? this.inputHandlersValue?.loading ?? !1, r = this.component?.input?.size?.value || this.inputHandlersValue?.size || "default";
|
|
27
|
+
return d`
|
|
28
|
+
<nr-card
|
|
29
|
+
id=${this.inputHandlersValue.id ?? c}
|
|
30
|
+
${h(this.inputRef)}
|
|
31
|
+
data-component-uuid=${this.component?.uuid}
|
|
32
|
+
data-component-name=${this.component?.name}
|
|
33
|
+
style=${u({
|
|
34
|
+
width: b.extractUnit(t?.width) === "%" ? "100%" : t?.width ?? "auto",
|
|
35
|
+
...t
|
|
36
|
+
})}
|
|
37
|
+
class=${m({
|
|
38
|
+
"drag-over": this.dragOverSituation
|
|
39
|
+
})}
|
|
40
|
+
.header=${i}
|
|
41
|
+
.size=${r}
|
|
42
|
+
?bordered=${a}
|
|
43
|
+
?hoverable=${o}
|
|
44
|
+
?loading=${n}
|
|
45
|
+
@mouseenter="${(e) => this.executeEvent("onMouseEnter", { ...e, unique: this.uniqueUUID })}"
|
|
46
|
+
@mouseleave="${(e) => this.executeEvent("onMouseLeave", { ...e, unique: this.uniqueUUID })}"
|
|
47
|
+
@click=${(e) => this.executeEvent("onClick", e)}
|
|
48
|
+
>
|
|
49
|
+
<div slot="content">
|
|
50
|
+
${this.childrenComponents.length ? v(this.childrenComponents.map((e) => ({ ...e, item: this.item })), this.item, this.isViewMode, { ...this.component, uniqueUUID: this.uniqueUUID }) : c}
|
|
51
|
+
</div>
|
|
52
|
+
</nr-card>
|
|
53
|
+
`;
|
|
54
|
+
}
|
|
55
|
+
renderComponent() {
|
|
56
|
+
const t = this.component?.style || {}, i = this.component?.input?.title?.value || this.inputHandlersValue?.title || "", a = this.component?.input?.bordered?.value ?? this.inputHandlersValue?.bordered ?? !0, o = this.component?.input?.hoverable?.value ?? this.inputHandlersValue?.hoverable ?? !1, n = this.component?.input?.loading?.value ?? this.inputHandlersValue?.loading ?? !1, r = this.component?.input?.size?.value || this.inputHandlersValue?.size || "default";
|
|
57
|
+
return d`
|
|
58
|
+
${this.isViewMode ? this.renderView() : d`
|
|
59
|
+
<nr-card
|
|
60
|
+
${h(this.inputRef)}
|
|
61
|
+
data-component-uuid=${this.component?.uuid}
|
|
62
|
+
data-component-name=${this.component?.name}
|
|
63
|
+
style=${u(t)}
|
|
64
|
+
class=${m({
|
|
65
|
+
"drag-over": this.dragOverSituation
|
|
66
|
+
})}
|
|
67
|
+
.header=${i}
|
|
68
|
+
.size=${r}
|
|
69
|
+
?bordered=${a}
|
|
70
|
+
?hoverable=${o}
|
|
71
|
+
?loading=${n}
|
|
72
|
+
@click=${(e) => {
|
|
73
|
+
f(null), this.executeEvent("onClick", e);
|
|
74
|
+
}}
|
|
75
|
+
>
|
|
76
|
+
<div slot="content" style=${u({ "min-height": this.childrenComponents.length ? "auto" : "100px" })}>
|
|
77
|
+
${this.childrenComponents.length ? v(this.childrenComponents.map((e) => ({ ...e, item: this.item })), this.item, this.isViewMode, { ...this.component, uniqueUUID: this.uniqueUUID }) : d`
|
|
78
|
+
<div
|
|
79
|
+
style="padding: 20px; text-align: center; color: #999;"
|
|
80
|
+
@click="${() => w(this.component?.uuid)}"
|
|
81
|
+
>
|
|
82
|
+
Add or Drag an item into this card
|
|
83
|
+
<drag-wrapper
|
|
84
|
+
.where=${"inside"}
|
|
85
|
+
.message=${"Drop inside"}
|
|
86
|
+
.component=${{ ...this.component }}
|
|
87
|
+
.inputRef=${this.inputRef}
|
|
88
|
+
.isDragInitiator=${this.isDragInitiator}
|
|
89
|
+
>
|
|
90
|
+
</drag-wrapper>
|
|
91
|
+
</div>
|
|
92
|
+
`}
|
|
93
|
+
</div>
|
|
94
|
+
</nr-card>
|
|
95
|
+
`}
|
|
96
|
+
`;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
s.styles = [y``];
|
|
100
|
+
l([
|
|
101
|
+
p({ type: Object })
|
|
102
|
+
], s.prototype, "component", 2);
|
|
103
|
+
l([
|
|
104
|
+
p({ type: Object })
|
|
105
|
+
], s.prototype, "item", 2);
|
|
106
|
+
l([
|
|
107
|
+
p({ type: Boolean })
|
|
108
|
+
], s.prototype, "isViewMode", 2);
|
|
109
|
+
l([
|
|
110
|
+
$()
|
|
111
|
+
], s.prototype, "childrenComponents", 2);
|
|
112
|
+
l([
|
|
113
|
+
$()
|
|
114
|
+
], s.prototype, "dragOverSituation", 2);
|
|
115
|
+
s = l([
|
|
116
|
+
V("card-block")
|
|
117
|
+
], s);
|
|
118
|
+
export {
|
|
119
|
+
s as CardBlock
|
|
120
|
+
};
|