@mmlogic/components 0.3.6 → 0.3.8
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/cjs/app-globals-V2Kpy_OQ.js +5 -0
- package/dist/cjs/index-BPj2cBXs.js +1570 -0
- package/dist/cjs/index.cjs.js +66 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/cjs/mosterdcomponents.cjs.js +25 -0
- package/dist/cjs/mrd-boolean-field_20.cjs.entry.js +3961 -0
- package/dist/cjs/quill-DmFfnC1f.js +16272 -0
- package/dist/collection/collection-manifest.json +32 -0
- package/dist/collection/components/mrd-boolean-field/mrd-boolean-field.js +199 -0
- package/dist/collection/components/mrd-boolean-field/mrd-boolean-field.scss +77 -0
- package/dist/collection/components/mrd-currency-field/mrd-currency-field.js +248 -0
- package/dist/collection/components/mrd-currency-field/mrd-currency-field.scss +100 -0
- package/dist/collection/components/mrd-date-field/mrd-date-field.js +206 -0
- package/dist/collection/components/mrd-date-field/mrd-date-field.scss +66 -0
- package/dist/collection/components/mrd-datetime-field/mrd-datetime-field.js +240 -0
- package/dist/collection/components/mrd-datetime-field/mrd-datetime-field.scss +66 -0
- package/dist/collection/components/mrd-email-field/mrd-email-field.js +230 -0
- package/dist/collection/components/mrd-email-field/mrd-email-field.scss +69 -0
- package/dist/{mosterdcomponents/mrd-field.entry.js → collection/components/mrd-field/mrd-field.js} +179 -28
- package/dist/collection/components/mrd-field/mrd-field.scss +118 -0
- package/dist/collection/components/mrd-file-field/mrd-file-field.js +341 -0
- package/dist/collection/components/mrd-file-field/mrd-file-field.scss +153 -0
- package/dist/{mosterdcomponents/mrd-form.entry.js → collection/components/mrd-form/mrd-form.js} +308 -31
- package/dist/collection/components/mrd-form/mrd-form.scss +148 -0
- package/dist/collection/components/mrd-hyperlink-field/mrd-hyperlink-field.js +291 -0
- package/dist/collection/components/mrd-hyperlink-field/mrd-hyperlink-field.scss +91 -0
- package/dist/collection/components/mrd-image-field/mrd-image-field.js +356 -0
- package/dist/collection/components/mrd-image-field/mrd-image-field.scss +190 -0
- package/dist/{mosterdcomponents/mrd-layout-section.entry.js → collection/components/mrd-layout-section/mrd-layout-section.js} +420 -33
- package/dist/collection/components/mrd-layout-section/mrd-layout-section.scss +445 -0
- package/dist/collection/components/mrd-list-field/mrd-list-field.js +313 -0
- package/dist/collection/components/mrd-list-field/mrd-list-field.scss +109 -0
- package/dist/collection/components/mrd-longtext-field/mrd-longtext-field.js +227 -0
- package/dist/collection/components/mrd-longtext-field/mrd-longtext-field.scss +78 -0
- package/dist/collection/components/mrd-number-field/mrd-number-field.js +316 -0
- package/dist/collection/components/mrd-number-field/mrd-number-field.scss +77 -0
- package/dist/collection/components/mrd-relation-field/mrd-relation-field.js +707 -0
- package/dist/collection/components/mrd-relation-field/mrd-relation-field.scss +266 -0
- package/dist/collection/components/mrd-secret-field/mrd-secret-field.js +229 -0
- package/dist/collection/components/mrd-secret-field/mrd-secret-field.scss +73 -0
- package/dist/{mosterdcomponents/mrd-table.entry.js → collection/components/mrd-table/mrd-table.js} +394 -32
- package/dist/collection/components/mrd-table/mrd-table.scss +809 -0
- package/dist/collection/components/mrd-text-field/mrd-text-field.js +227 -0
- package/dist/collection/components/mrd-text-field/mrd-text-field.scss +69 -0
- package/dist/collection/components/mrd-textarea-field/mrd-textarea-field.js +267 -0
- package/dist/collection/components/mrd-textarea-field/mrd-textarea-field.scss +79 -0
- package/dist/collection/components/mrd-time-field/mrd-time-field.js +206 -0
- package/dist/collection/components/mrd-time-field/mrd-time-field.scss +66 -0
- package/dist/collection/dev/api.js +145 -0
- package/dist/collection/dev/app.js +890 -0
- package/dist/collection/dev/auth.js +156 -0
- package/dist/collection/dev/example-data.js +403 -0
- package/dist/collection/dev/sprites.svg +55 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/types/client-layout.js +64 -0
- package/dist/collection/types/index.js +1 -0
- package/dist/{mosterdcomponents/cell-renderer-CbRwLOo8.js → collection/utils/cell-renderer.js} +3 -9
- package/dist/{mosterdcomponents/format-BAfsQfy1.js → collection/utils/format.js} +7 -12
- package/dist/{mosterdcomponents/i18n-hoGGKbKU.js → collection/utils/i18n.js} +1 -6
- package/dist/{mosterdcomponents/validation-ixb43cqU.js → collection/utils/validation.js} +5 -12
- package/dist/components/client-layout.js +1 -0
- package/dist/components/format.js +1 -0
- package/dist/components/i18n.js +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/mrd-boolean-field.js +1 -0
- package/dist/components/mrd-boolean-field2.js +1 -0
- package/dist/components/mrd-currency-field.js +1 -0
- package/dist/components/mrd-currency-field2.js +1 -0
- package/dist/components/mrd-date-field.js +1 -0
- package/dist/components/mrd-date-field2.js +1 -0
- package/dist/components/mrd-datetime-field.js +1 -0
- package/dist/components/mrd-datetime-field2.js +1 -0
- package/dist/components/mrd-email-field.js +1 -0
- package/dist/components/mrd-email-field2.js +1 -0
- package/dist/components/mrd-field.js +1 -0
- package/dist/components/mrd-field2.js +1 -0
- package/dist/components/mrd-file-field.js +1 -0
- package/dist/components/mrd-file-field2.js +1 -0
- package/dist/components/mrd-form.js +1 -0
- package/dist/components/mrd-hyperlink-field.js +1 -0
- package/dist/components/mrd-hyperlink-field2.js +1 -0
- package/dist/components/mrd-image-field.js +1 -0
- package/dist/components/mrd-image-field2.js +1 -0
- package/dist/components/mrd-layout-section.js +1 -0
- package/dist/components/mrd-list-field.js +1 -0
- package/dist/components/mrd-list-field2.js +1 -0
- package/dist/components/mrd-longtext-field.js +1 -0
- package/dist/components/mrd-longtext-field2.js +1 -0
- package/dist/components/mrd-number-field.js +1 -0
- package/dist/components/mrd-number-field2.js +1 -0
- package/dist/components/mrd-relation-field.js +1 -0
- package/dist/components/mrd-relation-field2.js +1 -0
- package/dist/components/mrd-secret-field.js +1 -0
- package/dist/components/mrd-secret-field2.js +1 -0
- package/dist/components/mrd-table.js +1 -0
- package/dist/components/mrd-table2.js +1 -0
- package/dist/components/mrd-text-field.js +1 -0
- package/dist/components/mrd-text-field2.js +1 -0
- package/dist/components/mrd-textarea-field.js +1 -0
- package/dist/components/mrd-textarea-field2.js +1 -0
- package/dist/components/mrd-time-field.js +1 -0
- package/dist/components/mrd-time-field2.js +1 -0
- package/dist/components/quill.js +1 -0
- package/dist/components/validation.js +1 -0
- package/dist/esm/app-globals-DQuL1Twl.js +3 -0
- package/dist/esm/index-_tsCCkAi.js +1561 -0
- package/dist/{mosterdcomponents/client-layout-D88nn5zf.js → esm/index.js} +1 -4
- package/dist/esm/loader.js +11 -0
- package/dist/esm/mosterdcomponents.js +21 -0
- package/dist/esm/mrd-boolean-field_20.entry.js +3940 -0
- package/dist/{mosterdcomponents/quill-C9pgw_k-.js → esm/quill-CiuCgGz_.js} +1347 -16232
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/mosterdcomponents/index-6yQUNVww.js.map +1 -0
- package/dist/mosterdcomponents/index.esm.js +1 -5
- package/dist/mosterdcomponents/mosterdcomponents.css +1 -180
- package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -50
- package/dist/mosterdcomponents/p-7bfaee51.entry.js +1 -0
- package/dist/mosterdcomponents/p-CiuCgGz_.js +1 -0
- package/dist/mosterdcomponents/p-DQuL1Twl.js +1 -0
- package/dist/mosterdcomponents/p-_tsCCkAi.js +2 -0
- package/package.json +1 -1
- package/dist/mosterdcomponents/index-B_tPFIvS.js +0 -4585
- package/dist/mosterdcomponents/index-B_tPFIvS.js.map +0 -1
- package/dist/mosterdcomponents/index-I5SuYv7a.js +0 -4
- package/dist/mosterdcomponents/mrd-boolean-field.entry.js +0 -37
- package/dist/mosterdcomponents/mrd-boolean-field.entry.js.map +0 -1
- package/dist/mosterdcomponents/mrd-currency-field.entry.js +0 -67
- package/dist/mosterdcomponents/mrd-currency-field.entry.js.map +0 -1
- package/dist/mosterdcomponents/mrd-date-field.entry.js +0 -46
- package/dist/mosterdcomponents/mrd-date-field.entry.js.map +0 -1
- package/dist/mosterdcomponents/mrd-datetime-field.entry.js +0 -78
- package/dist/mosterdcomponents/mrd-datetime-field.entry.js.map +0 -1
- package/dist/mosterdcomponents/mrd-email-field.entry.js +0 -50
- package/dist/mosterdcomponents/mrd-email-field.entry.js.map +0 -1
- package/dist/mosterdcomponents/mrd-field.entry.js.map +0 -1
- package/dist/mosterdcomponents/mrd-file-field.entry.js +0 -108
- package/dist/mosterdcomponents/mrd-file-field.entry.js.map +0 -1
- package/dist/mosterdcomponents/mrd-form.entry.js.map +0 -1
- package/dist/mosterdcomponents/mrd-hyperlink-field.entry.js +0 -87
- package/dist/mosterdcomponents/mrd-hyperlink-field.entry.js.map +0 -1
- package/dist/mosterdcomponents/mrd-image-field.entry.js +0 -122
- package/dist/mosterdcomponents/mrd-image-field.entry.js.map +0 -1
- package/dist/mosterdcomponents/mrd-layout-section.entry.js.map +0 -1
- package/dist/mosterdcomponents/mrd-list-field.entry.js +0 -107
- package/dist/mosterdcomponents/mrd-list-field.entry.js.map +0 -1
- package/dist/mosterdcomponents/mrd-longtext-field.entry.js +0 -47
- package/dist/mosterdcomponents/mrd-longtext-field.entry.js.map +0 -1
- package/dist/mosterdcomponents/mrd-number-field.entry.js +0 -87
- package/dist/mosterdcomponents/mrd-number-field.entry.js.map +0 -1
- package/dist/mosterdcomponents/mrd-relation-field.entry.js +0 -267
- package/dist/mosterdcomponents/mrd-relation-field.entry.js.map +0 -1
- package/dist/mosterdcomponents/mrd-secret-field.entry.js +0 -49
- package/dist/mosterdcomponents/mrd-secret-field.entry.js.map +0 -1
- package/dist/mosterdcomponents/mrd-table.entry.js.map +0 -1
- package/dist/mosterdcomponents/mrd-text-field.entry.js +0 -47
- package/dist/mosterdcomponents/mrd-text-field.entry.js.map +0 -1
- package/dist/mosterdcomponents/mrd-textarea-field.entry.js +0 -86
- package/dist/mosterdcomponents/mrd-textarea-field.entry.js.map +0 -1
- package/dist/mosterdcomponents/mrd-time-field.entry.js +0 -46
- package/dist/mosterdcomponents/mrd-time-field.entry.js.map +0 -1
|
@@ -1,21 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t } from
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
const mrdLayoutSectionScss = () => `.mrd-layout-section.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-800)}.mrd-layout-section__field.sc-mrd-layout-section{display:grid;grid-template-columns:200px 1fr;align-items:baseline;gap:0 var(--mrd-space-2);padding:var(--mrd-space-1) 0}.mrd-layout-section__field-label.sc-mrd-layout-section{font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-normal);color:var(--mrd-color-neutral-500);padding-top:1px}.mrd-layout-section__field-value.sc-mrd-layout-section{font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-800);word-break:break-word;display:inline-flex;align-items:center;gap:var(--mrd-space-1)}.mrd-layout-section__history-wrap.sc-mrd-layout-section{position:relative;display:inline-flex;align-items:center}.mrd-layout-section__history-btn.sc-mrd-layout-section{display:inline-flex;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;padding:0;background:transparent;border:none;border-radius:var(--mrd-border-radius-sm);color:var(--mrd-color-neutral-400);cursor:pointer;flex-shrink:0;transition:color var(--mrd-transition-fast), background-color var(--mrd-transition-fast)}.mrd-layout-section__history-btn.sc-mrd-layout-section:hover{color:var(--mrd-color-neutral-700);background-color:var(--mrd-color-neutral-100)}.mrd-layout-section__history-btn.sc-mrd-layout-section:focus{outline:none;box-shadow:var(--mrd-shadow-focus)}.mrd-layout-section__history-icon.sc-mrd-layout-section{width:0.875rem;height:0.875rem}.mrd-layout-section__history-popover.sc-mrd-layout-section{position:absolute;top:calc(100% + 0.25rem);left:0;min-width:24rem;max-width:24rem;background-color:var(--mrd-color-white);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius-md);box-shadow:var(--mrd-shadow-md);padding:var(--mrd-space-1) 0;z-index:var(--mrd-z-dropdown)}.mrd-layout-section__history-entry.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-normal);color:var(--mrd-color-neutral-700);padding:var(--mrd-space-2) var(--mrd-space-3);line-height:var(--mrd-line-height-normal)}.mrd-layout-section__history-entry.sc-mrd-layout-section:not(:last-child){border-bottom:var(--mrd-border-width) solid var(--mrd-color-neutral-100)}.mrd-layout-section__field-header.sc-mrd-layout-section{font-size:var(--mrd-font-size-2xl);font-weight:var(--mrd-font-weight-bold);color:var(--mrd-color-neutral-900);margin:0 0 var(--mrd-space-4) 0;padding:0}.mrd-layout-section__header.sc-mrd-layout-section{font-size:var(--mrd-font-size-xl);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-800);margin:var(--mrd-space-4) 0 var(--mrd-space-2) 0;padding:0}.mrd-layout-section__text.sc-mrd-layout-section{font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-700);line-height:var(--mrd-line-height-relaxed);margin:var(--mrd-space-2) 0}.mrd-layout-section__navigate.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-2);padding:var(--mrd-space-2) var(--mrd-space-3);background:none;border:1px solid var(--mrd-color-neutral-300);border-radius:var(--mrd-border-radius);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-primary);cursor:pointer;margin:var(--mrd-space-2) 0}.mrd-layout-section__navigate.sc-mrd-layout-section:hover{background-color:var(--mrd-color-primary-light);border-color:var(--mrd-color-primary)}.mrd-layout-section__link.sc-mrd-layout-section{color:var(--mrd-color-primary);text-decoration:none}.mrd-layout-section__link.sc-mrd-layout-section:hover{text-decoration:underline}.mrd-layout-section__relation-link.sc-mrd-layout-section{background:none;border:none;padding:0;font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-primary);cursor:pointer;text-align:left}.mrd-layout-section__relation-link.sc-mrd-layout-section:hover{text-decoration:underline}.mrd-layout-section__download-link.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-1);background:none;border:none;padding:0;font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-primary);cursor:pointer;text-align:left}.mrd-layout-section__download-link.sc-mrd-layout-section:hover{text-decoration:underline;color:var(--mrd-color-primary-dark)}.mrd-layout-section__file-icon.sc-mrd-layout-section{flex-shrink:0;width:1rem;height:1rem}.mrd-layout-section__boolean--true.sc-mrd-layout-section{color:var(--mrd-color-success);font-weight:var(--mrd-font-weight-semibold)}.mrd-layout-section__boolean--false.sc-mrd-layout-section{color:var(--mrd-color-neutral-400)}.mrd-layout-section__field--block.sc-mrd-layout-section{grid-template-columns:1fr}.mrd-layout-section__badge.sc-mrd-layout-section{display:inline-block;font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-medium);padding:2px var(--mrd-space-3);border-radius:10px}.mrd-layout-section__badge-dot-row.sc-mrd-layout-section{display:inline-flex;align-items:center;gap:var(--mrd-space-2)}.mrd-layout-section__badge-dot.sc-mrd-layout-section{display:inline-block;width:10px;height:10px;border-radius:50%;flex-shrink:0}.mrd-layout-section__secret-masked.sc-mrd-layout-section{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-label-color);letter-spacing:0.15em;user-select:none;pointer-events:none}.mrd-layout-section__pre.sc-mrd-layout-section{font-family:var(--mrd-font-family-mono);font-size:var(--mrd-font-size-xs);background-color:var(--mrd-color-neutral-50);border:1px solid var(--mrd-color-neutral-200);border-radius:var(--mrd-border-radius);padding:var(--mrd-space-3);margin:0;max-height:calc(10 * 1.5 * var(--mrd-font-size-xs));overflow-x:auto;overflow-y:auto;white-space:pre-wrap;word-break:break-word}.mrd-layout-section__group.sc-mrd-layout-section{margin:var(--mrd-space-4) 0}.mrd-layout-section__group-title.sc-mrd-layout-section{font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-500);margin:0 0 var(--mrd-space-2) 0;padding-bottom:0;text-transform:uppercase;letter-spacing:0.05em}.mrd-layout-section__related-view.sc-mrd-layout-section{margin:var(--mrd-space-4) 0}.mrd-layout-section__related-view-title.sc-mrd-layout-section{font-size:var(--mrd-font-size-lg);font-weight:var(--mrd-font-weight-semibold);color:var(--mrd-color-neutral-800);margin:0 0 var(--mrd-space-3) 0}.mrd-layout-section__search.sc-mrd-layout-section{position:relative;margin:var(--mrd-space-2) 0}.mrd-layout-section__search-wrap.sc-mrd-layout-section{position:relative}.mrd-layout-section__search-icon.sc-mrd-layout-section{position:absolute;left:var(--mrd-input-padding-x);top:50%;transform:translateY(-50%);width:1rem;height:1rem;color:var(--mrd-color-neutral-400);pointer-events:none}.mrd-layout-section__search-input.sc-mrd-layout-section{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x) var(--mrd-input-padding-y) calc(var(--mrd-input-padding-x) + 1rem + var(--mrd-space-2));font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-input-color);background-color:var(--mrd-input-bg);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);outline:none;appearance:none;box-sizing:border-box}.mrd-layout-section__search-input.sc-mrd-layout-section:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-layout-section__search-input.sc-mrd-layout-section::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-layout-section__search-results.sc-mrd-layout-section{position:absolute;top:100%;left:0;right:0;background-color:var(--mrd-color-white);border:1px solid var(--mrd-color-neutral-300);border-top:none;border-radius:0 0 var(--mrd-border-radius) var(--mrd-border-radius);box-shadow:var(--mrd-shadow-sm);z-index:100;max-height:300px;overflow-y:auto;list-style:none;margin:0;padding:var(--mrd-space-1) 0}.mrd-layout-section__search-result.sc-mrd-layout-section{margin:0;padding:0}.mrd-layout-section__search-result-btn.sc-mrd-layout-section{display:flex;flex-direction:column;width:100%;padding:var(--mrd-space-2) var(--mrd-space-3);background:none;border:none;text-align:left;cursor:pointer;font-family:var(--mrd-font-family)}.mrd-layout-section__search-result-btn.sc-mrd-layout-section:hover{background-color:var(--mrd-color-primary-light)}.mrd-layout-section__search-result-label.sc-mrd-layout-section{font-size:var(--mrd-font-size-sm);font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-800)}.mrd-layout-section__search-result-desc.sc-mrd-layout-section{font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);margin-top:var(--mrd-space-1)}.mrd-layout-section__image-thumb-btn.sc-mrd-layout-section{background:none;border:none;padding:0;cursor:pointer;display:inline-block;border-radius:var(--mrd-border-radius);overflow:hidden;line-height:0}.mrd-layout-section__image-thumb-btn.sc-mrd-layout-section:hover .mrd-layout-section__image-thumb.sc-mrd-layout-section{opacity:0.85}.mrd-layout-section__image-thumb.sc-mrd-layout-section{display:block;max-width:160px;max-height:100px;border-radius:var(--mrd-border-radius);object-fit:cover;transition:opacity 0.15s}.mrd-layout-section__modal-backdrop.sc-mrd-layout-section{position:fixed;inset:0;background:rgba(0, 0, 0, 0.6);z-index:300;display:flex;align-items:center;justify-content:center}.mrd-layout-section__modal.sc-mrd-layout-section{position:relative;background:#fff;border-radius:var(--mrd-border-radius);padding:var(--mrd-space-3);max-width:min(90vw, 900px);max-height:90vh;display:flex;align-items:center;justify-content:center;box-shadow:var(--mrd-shadow-lg)}.mrd-layout-section__modal-close.sc-mrd-layout-section{position:absolute;top:var(--mrd-space-2);right:var(--mrd-space-2);background:rgba(0, 0, 0, 0.5);border:none;border-radius:50%;width:28px;height:28px;display:flex;align-items:center;justify-content:center;color:#fff;cursor:pointer;font-size:var(--mrd-font-size-sm);line-height:1;z-index:1}.mrd-layout-section__modal-close.sc-mrd-layout-section:hover{background:rgba(0, 0, 0, 0.8)}.mrd-layout-section__modal-image.sc-mrd-layout-section{display:block;max-width:100%;max-height:calc(90vh - 2rem);border-radius:var(--mrd-border-radius);object-fit:contain}`;
|
|
8
|
-
|
|
9
|
-
const MrdLayoutSection = class {
|
|
10
|
-
constructor(hostRef) {
|
|
11
|
-
registerInstance(this, hostRef);
|
|
12
|
-
this.mrdNavigate = createEvent(this, "mrdNavigate", 7);
|
|
13
|
-
this.mrdSearch = createEvent(this, "mrdSearch", 7);
|
|
14
|
-
this.mrdDownload = createEvent(this, "mrdDownload", 7);
|
|
15
|
-
this.mrdLoadViewPage = createEvent(this, "mrdLoadViewPage", 7);
|
|
16
|
-
this.mrdLoadImage = createEvent(this, "mrdLoadImage", 7);
|
|
17
|
-
this.mrdViewAction = createEvent(this, "mrdViewAction", 7);
|
|
18
|
-
this.mrdLoadViewAggregations = createEvent(this, "mrdLoadViewAggregations", 7);
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { ClientLayoutItemType, ClientLayoutItemFieldDataType, } from "../../types/client-layout";
|
|
3
|
+
import { CellRenderer } from "../../utils/cell-renderer";
|
|
4
|
+
import { t } from "../../utils/i18n";
|
|
5
|
+
import { formatDate } from "../../utils/format";
|
|
6
|
+
export class MrdLayoutSection {
|
|
7
|
+
constructor() {
|
|
19
8
|
/** Items from one layout entry in ClientDashboardMetadata.layouts[]. */
|
|
20
9
|
this.items = [];
|
|
21
10
|
/** Record data object; keys are field names, _links holds relation and related-view links. */
|
|
@@ -159,7 +148,7 @@ const MrdLayoutSection = class {
|
|
|
159
148
|
return (h("a", { class: "mrd-layout-section__link", href: href, target: "_blank", rel: "noopener noreferrer" }, label));
|
|
160
149
|
}
|
|
161
150
|
case ClientLayoutItemFieldDataType.TEXTBLOCK:
|
|
162
|
-
return h("
|
|
151
|
+
return h("div", { class: "mrd-layout-section__prose", innerHTML: String(value) });
|
|
163
152
|
case ClientLayoutItemFieldDataType.LONGTEXT:
|
|
164
153
|
return h("pre", { class: "mrd-layout-section__pre" }, String(value));
|
|
165
154
|
case ClientLayoutItemFieldDataType.JSON:
|
|
@@ -345,18 +334,416 @@ const MrdLayoutSection = class {
|
|
|
345
334
|
return (h("div", { class: "mrd-layout-section__modal-backdrop", onClick: () => { this.imagePreviewUrl = null; } }, h("div", { class: "mrd-layout-section__modal", onClick: (e) => e.stopPropagation() }, h("button", { class: "mrd-layout-section__modal-close", onClick: () => { this.imagePreviewUrl = null; } }, "\u2715"), h("img", { class: "mrd-layout-section__modal-image", src: this.imagePreviewUrl, alt: "" }))));
|
|
346
335
|
}
|
|
347
336
|
render() {
|
|
348
|
-
return (h(Host, { key: '
|
|
337
|
+
return (h(Host, { key: '39d21b05016b901ff73a90dc0c6ef04cc30b4d42' }, h("div", { key: '546d956676d66438930665e97c2ed618fb8d1d4c', class: "mrd-layout-section" }, this.items.map(item => this.renderItem(item))), this.renderImageModal()));
|
|
349
338
|
}
|
|
350
|
-
get
|
|
351
|
-
static get
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
339
|
+
static get is() { return "mrd-layout-section"; }
|
|
340
|
+
static get encapsulation() { return "scoped"; }
|
|
341
|
+
static get originalStyleUrls() {
|
|
342
|
+
return {
|
|
343
|
+
"$": ["mrd-layout-section.scss"]
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
static get styleUrls() {
|
|
347
|
+
return {
|
|
348
|
+
"$": ["mrd-layout-section.css"]
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
static get properties() {
|
|
352
|
+
return {
|
|
353
|
+
"items": {
|
|
354
|
+
"type": "unknown",
|
|
355
|
+
"mutable": false,
|
|
356
|
+
"complexType": {
|
|
357
|
+
"original": "ClientLayoutItem[]",
|
|
358
|
+
"resolved": "ClientLayoutItem[]",
|
|
359
|
+
"references": {
|
|
360
|
+
"ClientLayoutItem": {
|
|
361
|
+
"location": "import",
|
|
362
|
+
"path": "../../types/client-layout",
|
|
363
|
+
"id": "src/types/client-layout.ts::ClientLayoutItem",
|
|
364
|
+
"referenceLocation": "ClientLayoutItem"
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
"required": false,
|
|
369
|
+
"optional": false,
|
|
370
|
+
"docs": {
|
|
371
|
+
"tags": [],
|
|
372
|
+
"text": "Items from one layout entry in ClientDashboardMetadata.layouts[]."
|
|
373
|
+
},
|
|
374
|
+
"getter": false,
|
|
375
|
+
"setter": false,
|
|
376
|
+
"defaultValue": "[]"
|
|
377
|
+
},
|
|
378
|
+
"data": {
|
|
379
|
+
"type": "unknown",
|
|
380
|
+
"mutable": false,
|
|
381
|
+
"complexType": {
|
|
382
|
+
"original": "Record<string, unknown>",
|
|
383
|
+
"resolved": "string | unknown",
|
|
384
|
+
"references": {
|
|
385
|
+
"Record": {
|
|
386
|
+
"location": "global",
|
|
387
|
+
"id": "global::Record"
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
"required": false,
|
|
392
|
+
"optional": false,
|
|
393
|
+
"docs": {
|
|
394
|
+
"tags": [],
|
|
395
|
+
"text": "Record data object; keys are field names, _links holds relation and related-view links."
|
|
396
|
+
},
|
|
397
|
+
"getter": false,
|
|
398
|
+
"setter": false,
|
|
399
|
+
"defaultValue": "{}"
|
|
400
|
+
},
|
|
401
|
+
"views": {
|
|
402
|
+
"type": "unknown",
|
|
403
|
+
"mutable": false,
|
|
404
|
+
"complexType": {
|
|
405
|
+
"original": "Record<string, ClientViewMetadata>",
|
|
406
|
+
"resolved": "ClientViewMetadata | string",
|
|
407
|
+
"references": {
|
|
408
|
+
"Record": {
|
|
409
|
+
"location": "global",
|
|
410
|
+
"id": "global::Record"
|
|
411
|
+
},
|
|
412
|
+
"ClientViewMetadata": {
|
|
413
|
+
"location": "import",
|
|
414
|
+
"path": "../../types/client-layout",
|
|
415
|
+
"id": "src/types/client-layout.ts::ClientViewMetadata",
|
|
416
|
+
"referenceLocation": "ClientViewMetadata"
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
"required": false,
|
|
421
|
+
"optional": false,
|
|
422
|
+
"docs": {
|
|
423
|
+
"tags": [],
|
|
424
|
+
"text": "Legacy: view metadata map (ClientDashboardMetadata.views). Not needed in new flat format."
|
|
425
|
+
},
|
|
426
|
+
"getter": false,
|
|
427
|
+
"setter": false,
|
|
428
|
+
"defaultValue": "{}"
|
|
429
|
+
},
|
|
430
|
+
"links": {
|
|
431
|
+
"type": "unknown",
|
|
432
|
+
"mutable": false,
|
|
433
|
+
"complexType": {
|
|
434
|
+
"original": "Record<string, { href: string }>",
|
|
435
|
+
"resolved": "string | { href: string; }",
|
|
436
|
+
"references": {
|
|
437
|
+
"Record": {
|
|
438
|
+
"location": "global",
|
|
439
|
+
"id": "global::Record"
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
},
|
|
443
|
+
"required": false,
|
|
444
|
+
"optional": false,
|
|
445
|
+
"docs": {
|
|
446
|
+
"tags": [],
|
|
447
|
+
"text": "Legacy: top-level _links from ClientDashboardMetadata. Not needed in new flat format."
|
|
448
|
+
},
|
|
449
|
+
"getter": false,
|
|
450
|
+
"setter": false,
|
|
451
|
+
"defaultValue": "{}"
|
|
452
|
+
},
|
|
453
|
+
"locale": {
|
|
454
|
+
"type": "string",
|
|
455
|
+
"mutable": false,
|
|
456
|
+
"complexType": {
|
|
457
|
+
"original": "string",
|
|
458
|
+
"resolved": "string",
|
|
459
|
+
"references": {}
|
|
460
|
+
},
|
|
461
|
+
"required": false,
|
|
462
|
+
"optional": false,
|
|
463
|
+
"docs": {
|
|
464
|
+
"tags": [],
|
|
465
|
+
"text": ""
|
|
466
|
+
},
|
|
467
|
+
"getter": false,
|
|
468
|
+
"setter": false,
|
|
469
|
+
"reflect": false,
|
|
470
|
+
"attribute": "locale",
|
|
471
|
+
"defaultValue": "navigator.language"
|
|
472
|
+
}
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
static get states() {
|
|
476
|
+
return {
|
|
477
|
+
"searchQueryMap": {},
|
|
478
|
+
"searchResultsMap": {},
|
|
479
|
+
"imagePreviewUrl": {},
|
|
480
|
+
"imagePreviews": {},
|
|
481
|
+
"openHistoryField": {}
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
static get events() {
|
|
485
|
+
return [{
|
|
486
|
+
"method": "mrdNavigate",
|
|
487
|
+
"name": "mrdNavigate",
|
|
488
|
+
"bubbles": true,
|
|
489
|
+
"cancelable": true,
|
|
490
|
+
"composed": true,
|
|
491
|
+
"docs": {
|
|
492
|
+
"tags": [],
|
|
493
|
+
"text": ""
|
|
494
|
+
},
|
|
495
|
+
"complexType": {
|
|
496
|
+
"original": "{ href?: string; label: string; navigate?: ClientLayoutItemNavigate }",
|
|
497
|
+
"resolved": "{ href?: string | undefined; label: string; navigate?: ClientLayoutItemNavigate | undefined; }",
|
|
498
|
+
"references": {
|
|
499
|
+
"ClientLayoutItemNavigate": {
|
|
500
|
+
"location": "import",
|
|
501
|
+
"path": "../../types/client-layout",
|
|
502
|
+
"id": "src/types/client-layout.ts::ClientLayoutItemNavigate",
|
|
503
|
+
"referenceLocation": "ClientLayoutItemNavigate"
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
}, {
|
|
508
|
+
"method": "mrdSearch",
|
|
509
|
+
"name": "mrdSearch",
|
|
510
|
+
"bubbles": true,
|
|
511
|
+
"cancelable": true,
|
|
512
|
+
"composed": true,
|
|
513
|
+
"docs": {
|
|
514
|
+
"tags": [],
|
|
515
|
+
"text": ""
|
|
516
|
+
},
|
|
517
|
+
"complexType": {
|
|
518
|
+
"original": "{ query: string; dataClass: string }",
|
|
519
|
+
"resolved": "{ query: string; dataClass: string; }",
|
|
520
|
+
"references": {}
|
|
521
|
+
}
|
|
522
|
+
}, {
|
|
523
|
+
"method": "mrdDownload",
|
|
524
|
+
"name": "mrdDownload",
|
|
525
|
+
"bubbles": true,
|
|
526
|
+
"cancelable": true,
|
|
527
|
+
"composed": true,
|
|
528
|
+
"docs": {
|
|
529
|
+
"tags": [],
|
|
530
|
+
"text": ""
|
|
531
|
+
},
|
|
532
|
+
"complexType": {
|
|
533
|
+
"original": "{ href: string; fileName: string }",
|
|
534
|
+
"resolved": "{ href: string; fileName: string; }",
|
|
535
|
+
"references": {}
|
|
536
|
+
}
|
|
537
|
+
}, {
|
|
538
|
+
"method": "mrdLoadViewPage",
|
|
539
|
+
"name": "mrdLoadViewPage",
|
|
540
|
+
"bubbles": true,
|
|
541
|
+
"cancelable": true,
|
|
542
|
+
"composed": true,
|
|
543
|
+
"docs": {
|
|
544
|
+
"tags": [],
|
|
545
|
+
"text": "Re-emitted from an embedded mrd-table's mrdLoadPage; host fetches the next page and calls setViewPage()."
|
|
546
|
+
},
|
|
547
|
+
"complexType": {
|
|
548
|
+
"original": "{ name: string; page: number; sort: string; path: string; qs: string }",
|
|
549
|
+
"resolved": "{ name: string; page: number; sort: string; path: string; qs: string; }",
|
|
550
|
+
"references": {}
|
|
551
|
+
}
|
|
552
|
+
}, {
|
|
553
|
+
"method": "mrdLoadImage",
|
|
554
|
+
"name": "mrdLoadImage",
|
|
555
|
+
"bubbles": true,
|
|
556
|
+
"cancelable": true,
|
|
557
|
+
"composed": true,
|
|
558
|
+
"docs": {
|
|
559
|
+
"tags": [],
|
|
560
|
+
"text": "Fired once on load for each IMAGE field that has an href; host resolves the URL and calls setImagePreview()."
|
|
561
|
+
},
|
|
562
|
+
"complexType": {
|
|
563
|
+
"original": "{ fieldName: string; href: string }",
|
|
564
|
+
"resolved": "{ fieldName: string; href: string; }",
|
|
565
|
+
"references": {}
|
|
566
|
+
}
|
|
567
|
+
}, {
|
|
568
|
+
"method": "mrdViewAction",
|
|
569
|
+
"name": "mrdViewAction",
|
|
570
|
+
"bubbles": true,
|
|
571
|
+
"cancelable": true,
|
|
572
|
+
"composed": true,
|
|
573
|
+
"docs": {
|
|
574
|
+
"tags": [],
|
|
575
|
+
"text": "Re-emitted from an embedded mrd-table's mrdAction; host builds the target URL from dataClass."
|
|
576
|
+
},
|
|
577
|
+
"complexType": {
|
|
578
|
+
"original": "{ name: string; action: string; dataClass: string; path?: string; qs?: string; parentPath?: string | null; basicType?: string }",
|
|
579
|
+
"resolved": "{ name: string; action: string; dataClass: string; path?: string | undefined; qs?: string | undefined; parentPath?: string | null | undefined; basicType?: string | undefined; }",
|
|
580
|
+
"references": {}
|
|
581
|
+
}
|
|
582
|
+
}, {
|
|
583
|
+
"method": "mrdLoadViewAggregations",
|
|
584
|
+
"name": "mrdLoadViewAggregations",
|
|
585
|
+
"bubbles": true,
|
|
586
|
+
"cancelable": true,
|
|
587
|
+
"composed": true,
|
|
588
|
+
"docs": {
|
|
589
|
+
"tags": [],
|
|
590
|
+
"text": "Re-emitted from an embedded mrd-table's mrdLoadAggregations; host calls setViewAggregations() with the result."
|
|
591
|
+
},
|
|
592
|
+
"complexType": {
|
|
593
|
+
"original": "{ name: string; dataClass: string; path: string; qs: string; aggQs: string }",
|
|
594
|
+
"resolved": "{ name: string; dataClass: string; path: string; qs: string; aggQs: string; }",
|
|
595
|
+
"references": {}
|
|
596
|
+
}
|
|
597
|
+
}];
|
|
598
|
+
}
|
|
599
|
+
static get methods() {
|
|
600
|
+
return {
|
|
601
|
+
"setSearchResults": {
|
|
602
|
+
"complexType": {
|
|
603
|
+
"signature": "(results: RelationSearchResult[], dataClass?: string) => Promise<void>",
|
|
604
|
+
"parameters": [{
|
|
605
|
+
"name": "results",
|
|
606
|
+
"type": "RelationSearchResult[]",
|
|
607
|
+
"docs": ""
|
|
608
|
+
}, {
|
|
609
|
+
"name": "dataClass",
|
|
610
|
+
"type": "string | undefined",
|
|
611
|
+
"docs": ""
|
|
612
|
+
}],
|
|
613
|
+
"references": {
|
|
614
|
+
"Promise": {
|
|
615
|
+
"location": "global",
|
|
616
|
+
"id": "global::Promise"
|
|
617
|
+
},
|
|
618
|
+
"RelationSearchResult": {
|
|
619
|
+
"location": "import",
|
|
620
|
+
"path": "../../types/client-layout",
|
|
621
|
+
"id": "src/types/client-layout.ts::RelationSearchResult",
|
|
622
|
+
"referenceLocation": "RelationSearchResult"
|
|
623
|
+
}
|
|
624
|
+
},
|
|
625
|
+
"return": "Promise<void>"
|
|
626
|
+
},
|
|
627
|
+
"docs": {
|
|
628
|
+
"text": "Inject search results. Pass dataClass to target a specific SEARCH item; omit when there is only one.",
|
|
629
|
+
"tags": []
|
|
630
|
+
}
|
|
631
|
+
},
|
|
632
|
+
"setViewPage": {
|
|
633
|
+
"complexType": {
|
|
634
|
+
"signature": "(name: string, page: number, rows: any[], totalElements?: number, hasNext?: boolean) => Promise<void>",
|
|
635
|
+
"parameters": [{
|
|
636
|
+
"name": "name",
|
|
637
|
+
"type": "string",
|
|
638
|
+
"docs": ""
|
|
639
|
+
}, {
|
|
640
|
+
"name": "page",
|
|
641
|
+
"type": "number",
|
|
642
|
+
"docs": ""
|
|
643
|
+
}, {
|
|
644
|
+
"name": "rows",
|
|
645
|
+
"type": "any[]",
|
|
646
|
+
"docs": ""
|
|
647
|
+
}, {
|
|
648
|
+
"name": "totalElements",
|
|
649
|
+
"type": "number | undefined",
|
|
650
|
+
"docs": ""
|
|
651
|
+
}, {
|
|
652
|
+
"name": "hasNext",
|
|
653
|
+
"type": "boolean | undefined",
|
|
654
|
+
"docs": ""
|
|
655
|
+
}],
|
|
656
|
+
"references": {
|
|
657
|
+
"Promise": {
|
|
658
|
+
"location": "global",
|
|
659
|
+
"id": "global::Promise"
|
|
660
|
+
}
|
|
661
|
+
},
|
|
662
|
+
"return": "Promise<void>"
|
|
663
|
+
},
|
|
664
|
+
"docs": {
|
|
665
|
+
"text": "Inject data into an embedded mrd-table for a RELATED_VIEW or VIEW item.\nPass totalElements to update the pagination total (safe to pass on every page).\nPass hasNext (from _links.next presence) so the table can decide whether to emit aggregations.",
|
|
666
|
+
"tags": []
|
|
667
|
+
}
|
|
668
|
+
},
|
|
669
|
+
"setViewAggregations": {
|
|
670
|
+
"complexType": {
|
|
671
|
+
"signature": "(name: string, data: any) => Promise<void>",
|
|
672
|
+
"parameters": [{
|
|
673
|
+
"name": "name",
|
|
674
|
+
"type": "string",
|
|
675
|
+
"docs": ""
|
|
676
|
+
}, {
|
|
677
|
+
"name": "data",
|
|
678
|
+
"type": "any",
|
|
679
|
+
"docs": ""
|
|
680
|
+
}],
|
|
681
|
+
"references": {
|
|
682
|
+
"Promise": {
|
|
683
|
+
"location": "global",
|
|
684
|
+
"id": "global::Promise"
|
|
685
|
+
}
|
|
686
|
+
},
|
|
687
|
+
"return": "Promise<void>"
|
|
688
|
+
},
|
|
689
|
+
"docs": {
|
|
690
|
+
"text": "Inject aggregation totals into an embedded mrd-table for a VIEW or RELATED_VIEW item.",
|
|
691
|
+
"tags": []
|
|
692
|
+
}
|
|
693
|
+
},
|
|
694
|
+
"setImagePreview": {
|
|
695
|
+
"complexType": {
|
|
696
|
+
"signature": "(fieldName: string, url: string) => Promise<void>",
|
|
697
|
+
"parameters": [{
|
|
698
|
+
"name": "fieldName",
|
|
699
|
+
"type": "string",
|
|
700
|
+
"docs": ""
|
|
701
|
+
}, {
|
|
702
|
+
"name": "url",
|
|
703
|
+
"type": "string",
|
|
704
|
+
"docs": ""
|
|
705
|
+
}],
|
|
706
|
+
"references": {
|
|
707
|
+
"Promise": {
|
|
708
|
+
"location": "global",
|
|
709
|
+
"id": "global::Promise"
|
|
710
|
+
}
|
|
711
|
+
},
|
|
712
|
+
"return": "Promise<void>"
|
|
713
|
+
},
|
|
714
|
+
"docs": {
|
|
715
|
+
"text": "Provide a resolved URL for an IMAGE field. Shows as thumbnail; clicking opens the lightbox.",
|
|
716
|
+
"tags": []
|
|
717
|
+
}
|
|
718
|
+
},
|
|
719
|
+
"openImagePreview": {
|
|
720
|
+
"complexType": {
|
|
721
|
+
"signature": "(url: string) => Promise<void>",
|
|
722
|
+
"parameters": [{
|
|
723
|
+
"name": "url",
|
|
724
|
+
"type": "string",
|
|
725
|
+
"docs": ""
|
|
726
|
+
}],
|
|
727
|
+
"references": {
|
|
728
|
+
"Promise": {
|
|
729
|
+
"location": "global",
|
|
730
|
+
"id": "global::Promise"
|
|
731
|
+
}
|
|
732
|
+
},
|
|
733
|
+
"return": "Promise<void>"
|
|
734
|
+
},
|
|
735
|
+
"docs": {
|
|
736
|
+
"text": "Open the lightbox directly with a URL (e.g. after mrdDownload on a FILE field).",
|
|
737
|
+
"tags": []
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
};
|
|
741
|
+
}
|
|
742
|
+
static get elementRef() { return "el"; }
|
|
743
|
+
static get watchers() {
|
|
744
|
+
return [{
|
|
745
|
+
"propName": "data",
|
|
746
|
+
"methodName": "dataChanged"
|
|
747
|
+
}];
|
|
748
|
+
}
|
|
749
|
+
}
|