@mmlogic/components 0.3.8 → 0.3.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.
Files changed (82) hide show
  1. package/dist/cjs/index.cjs.js +13 -0
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/mosterdcomponents.cjs.js +1 -1
  4. package/dist/cjs/{mrd-boolean-field_20.cjs.entry.js → mrd-boolean-field_23.cjs.entry.js} +1059 -23
  5. package/dist/collection/collection-manifest.json +3 -0
  6. package/dist/collection/components/mrd-boolean-field/mrd-boolean-field.js +1 -1
  7. package/dist/collection/components/mrd-currency-field/mrd-currency-field.js +1 -1
  8. package/dist/collection/components/mrd-date-field/mrd-date-field.js +1 -1
  9. package/dist/collection/components/mrd-datetime-field/mrd-datetime-field.js +1 -1
  10. package/dist/collection/components/mrd-document-container/mrd-document-container.js +375 -0
  11. package/dist/collection/components/mrd-document-container/mrd-document-container.scss +79 -0
  12. package/dist/collection/components/mrd-document-list/mrd-document-list.js +1129 -0
  13. package/dist/collection/components/mrd-document-list/mrd-document-list.scss +181 -0
  14. package/dist/collection/components/mrd-document-view/mrd-document-view.js +177 -0
  15. package/dist/collection/components/mrd-document-view/mrd-document-view.scss +121 -0
  16. package/dist/collection/components/mrd-email-field/mrd-email-field.js +1 -1
  17. package/dist/collection/components/mrd-file-field/mrd-file-field.js +1 -1
  18. package/dist/collection/components/mrd-image-field/mrd-image-field.js +1 -1
  19. package/dist/collection/components/mrd-layout-section/mrd-layout-section.js +288 -14
  20. package/dist/collection/components/mrd-layout-section/mrd-layout-section.scss +2 -3
  21. package/dist/collection/components/mrd-longtext-field/mrd-longtext-field.js +1 -1
  22. package/dist/collection/components/mrd-number-field/mrd-number-field.js +1 -1
  23. package/dist/collection/components/mrd-secret-field/mrd-secret-field.js +2 -2
  24. package/dist/collection/components/mrd-text-field/mrd-text-field.js +1 -1
  25. package/dist/collection/components/mrd-textarea-field/mrd-textarea-field.js +1 -1
  26. package/dist/collection/components/mrd-time-field/mrd-time-field.js +1 -1
  27. package/dist/collection/dev/app.js +66 -2
  28. package/dist/collection/types/client-layout.js +10 -0
  29. package/dist/collection/utils/i18n.js +34 -0
  30. package/dist/components/client-layout.js +1 -1
  31. package/dist/components/format.js +1 -1
  32. package/dist/components/i18n.js +1 -1
  33. package/dist/components/index.js +1 -1
  34. package/dist/components/mrd-boolean-field2.js +1 -1
  35. package/dist/components/mrd-currency-field2.js +1 -1
  36. package/dist/components/mrd-date-field2.js +1 -1
  37. package/dist/components/mrd-datetime-field2.js +1 -1
  38. package/dist/components/mrd-document-container.d.ts +11 -0
  39. package/dist/components/mrd-document-container.js +1 -0
  40. package/dist/components/mrd-document-container2.js +1 -0
  41. package/dist/components/mrd-document-list.d.ts +11 -0
  42. package/dist/components/mrd-document-list.js +1 -0
  43. package/dist/components/mrd-document-list2.js +1 -0
  44. package/dist/components/mrd-document-view.d.ts +11 -0
  45. package/dist/components/mrd-document-view.js +1 -0
  46. package/dist/components/mrd-document-view2.js +1 -0
  47. package/dist/components/mrd-email-field2.js +1 -1
  48. package/dist/components/mrd-file-field2.js +1 -1
  49. package/dist/components/mrd-image-field2.js +1 -1
  50. package/dist/components/mrd-layout-section.js +1 -1
  51. package/dist/components/mrd-longtext-field2.js +1 -1
  52. package/dist/components/mrd-number-field2.js +1 -1
  53. package/dist/components/mrd-secret-field2.js +1 -1
  54. package/dist/components/mrd-table2.js +1 -1
  55. package/dist/components/mrd-text-field2.js +1 -1
  56. package/dist/components/mrd-textarea-field2.js +1 -1
  57. package/dist/components/mrd-time-field2.js +1 -1
  58. package/dist/esm/index.js +11 -1
  59. package/dist/esm/loader.js +1 -1
  60. package/dist/esm/mosterdcomponents.js +1 -1
  61. package/dist/esm/{mrd-boolean-field_20.entry.js → mrd-boolean-field_23.entry.js} +1058 -25
  62. package/dist/mosterdcomponents/{cell-renderer-CbRwLOo8.js.map → cell-renderer-B-AJDBcj.js.map} +1 -1
  63. package/dist/mosterdcomponents/{client-layout-D88nn5zf.js.map → client-layout-ChqRA3AF.js.map} +1 -1
  64. package/dist/mosterdcomponents/i18n-s1XrKcD2.js.map +1 -0
  65. package/dist/mosterdcomponents/index-DkY-NQj0.js.map +1 -0
  66. package/dist/mosterdcomponents/index-DwF_Sp__.js.map +1 -0
  67. package/dist/mosterdcomponents/index.esm.js +1 -1
  68. package/dist/mosterdcomponents/mosterdcomponents.css +1 -1
  69. package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
  70. package/dist/mosterdcomponents/p-69452249.entry.js +1 -0
  71. package/dist/mosterdcomponents/{validation-ixb43cqU.js.map → validation-Br9k2Ztw.js.map} +1 -1
  72. package/dist/types/components/mrd-document-container/mrd-document-container.d.ts +94 -0
  73. package/dist/types/components/mrd-document-list/mrd-document-list.d.ts +210 -0
  74. package/dist/types/components/mrd-document-view/mrd-document-view.d.ts +36 -0
  75. package/dist/types/components/mrd-layout-section/mrd-layout-section.d.ts +57 -6
  76. package/dist/types/components.d.ts +507 -15
  77. package/dist/types/types/client-layout.d.ts +38 -0
  78. package/package.json +1 -1
  79. package/dist/mosterdcomponents/i18n-hoGGKbKU.js.map +0 -1
  80. package/dist/mosterdcomponents/index-6yQUNVww.js.map +0 -1
  81. package/dist/mosterdcomponents/index-I5SuYv7a.js.map +0 -1
  82. package/dist/mosterdcomponents/p-7bfaee51.entry.js +0 -1
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "entries": [
3
+ "components/mrd-document-list/mrd-document-list.js",
3
4
  "components/mrd-boolean-field/mrd-boolean-field.js",
4
5
  "components/mrd-currency-field/mrd-currency-field.js",
5
6
  "components/mrd-date-field/mrd-date-field.js",
6
7
  "components/mrd-datetime-field/mrd-datetime-field.js",
8
+ "components/mrd-document-container/mrd-document-container.js",
9
+ "components/mrd-document-view/mrd-document-view.js",
7
10
  "components/mrd-email-field/mrd-email-field.js",
8
11
  "components/mrd-field/mrd-field.js",
9
12
  "components/mrd-file-field/mrd-file-field.js",
@@ -20,7 +20,7 @@ export class MrdBooleanField {
20
20
  this.checked = !!this.value;
21
21
  }
22
22
  render() {
23
- return (h(Host, { key: 'aed1d936d686870114a12aad9fc4cccb76ecd31e' }, h("div", { key: '5cc8aaa0f12d4195d02fce8a810d7d993e2e8c99', class: "mrd-boolean-field" }, h("label", { key: '41c3b3e0f01778fc2654ba86e3fe4e5a07c8537a', class: "mrd-boolean-field__toggle-label" }, h("input", { key: 'c261e6903e050d2f3d8df8abb90c74d99ed20161', class: "mrd-boolean-field__checkbox", type: "checkbox", name: this.name, checked: this.checked, disabled: this.disabled, onChange: this.handleChange, onBlur: this.handleBlur }), h("span", { key: '079ee220fe692536af15a7fb4286626102ae940e', class: "mrd-boolean-field__toggle", "aria-hidden": "true" }), this.label && (h("span", { key: '1f4f52a41f0bd6ba4c61cf9d4db74ab2f1aa8877', class: `mrd-boolean-field__text${this.required ? ' mrd-boolean-field__text--required' : ''}` }, this.label))))));
23
+ return (h(Host, { key: '38e65a1c7971912f8259d09281b272d7cbd446f2' }, h("div", { key: 'e10919998731d744cc2a13130c5f355c9b8fc9aa', class: "mrd-boolean-field" }, h("label", { key: 'db85a2c80cc62fdfd25237e3f5c7750bf1666819', class: "mrd-boolean-field__toggle-label" }, h("input", { key: 'cddd7004593fa4671abb89f4f805c4a009db99ef', class: "mrd-boolean-field__checkbox", type: "checkbox", name: this.name, checked: this.checked, disabled: this.disabled, onChange: this.handleChange, onBlur: this.handleBlur }), h("span", { key: 'f90f0ed6d74d6688e51b8d85a5397a0597d95ad8', class: "mrd-boolean-field__toggle", "aria-hidden": "true" }), this.label && (h("span", { key: '7e4582b1d9a5b08c00c220bec53baa6c14cbfe43', class: `mrd-boolean-field__text${this.required ? ' mrd-boolean-field__text--required' : ''}` }, this.label))))));
24
24
  }
25
25
  static get is() { return "mrd-boolean-field"; }
26
26
  static get encapsulation() { return "scoped"; }
@@ -48,7 +48,7 @@ export class MrdCurrencyField {
48
48
  }
49
49
  render() {
50
50
  const hasError = !!this.error;
51
- return (h(Host, { key: 'd3450e9c26b1a755d3e6a5a3561d93b2ac566a28' }, h("div", { key: 'b66942cc1953daff728504deef8a9cc1330ef549', class: "mrd-currency-field" }, this.label && (h("label", { key: '3d3f2f06e9ffea944552f0f7cf3150d0246c54f0', class: `mrd-currency-field__label${this.required ? ' mrd-currency-field__label--required' : ''}` }, this.label)), h("div", { key: 'd30a2adfceefdbefef2d4fe6633a163a753b15d0', class: "mrd-currency-field__row" }, h("input", { key: '9af09b19b6cbe24498d6ca8edf7b28f675afdec5', class: `mrd-currency-field__amount${hasError ? ' mrd-currency-field__amount--error' : ''}`, type: "text", inputMode: "decimal", name: `${this.name}_amount`, value: this.amountDisplay, placeholder: "0.00", required: this.required, disabled: this.disabled, onInput: this.handleAmountInput, onBlur: this.handleAmountBlur }), h("select", { key: '21e55b04b7bf16586b5cfaa82d77db45c6dedf21', class: "mrd-currency-field__currency", disabled: this.disabled, onChange: this.handleCurrencyChange }, COMMON_CURRENCIES.map(c => (h("option", { key: c, value: c, selected: c === this.currency }, c))))), hasError && h("span", { key: '7a0006d4230557cf9c58f82f21de73b5d12f7e17', class: "mrd-currency-field__error" }, this.error))));
51
+ return (h(Host, { key: 'fe3520c44d831caf36b388cb5968a9518b16cb8b' }, h("div", { key: '50c1fd2d53038e46da575d3e46e1ec26c2da423b', class: "mrd-currency-field" }, this.label && (h("label", { key: 'a2649d41bf6e3765c8a62ba6559c64c41615027a', class: `mrd-currency-field__label${this.required ? ' mrd-currency-field__label--required' : ''}` }, this.label)), h("div", { key: '952b51f315b4a5c05a8373ce3a3f1041086ba8b8', class: "mrd-currency-field__row" }, h("input", { key: '137a72ffc5d79fc8e0a8cf44c012d84a50c26d5b', class: `mrd-currency-field__amount${hasError ? ' mrd-currency-field__amount--error' : ''}`, type: "text", inputMode: "decimal", name: `${this.name}_amount`, value: this.amountDisplay, placeholder: "0.00", required: this.required, disabled: this.disabled, onInput: this.handleAmountInput, onBlur: this.handleAmountBlur }), h("select", { key: '1755854ca9b76dc4b41ad84b6b788685931ace36', class: "mrd-currency-field__currency", disabled: this.disabled, onChange: this.handleCurrencyChange }, COMMON_CURRENCIES.map(c => (h("option", { key: c, value: c, selected: c === this.currency }, c))))), hasError && h("span", { key: '0f10eb98c2e6444651d79d1de92acd0dbcc7133b', class: "mrd-currency-field__error" }, this.error))));
52
52
  }
53
53
  static get is() { return "mrd-currency-field"; }
54
54
  static get encapsulation() { return "scoped"; }
@@ -27,7 +27,7 @@ export class MrdDateField {
27
27
  }
28
28
  render() {
29
29
  const hasError = !!this.error;
30
- return (h(Host, { key: '84c777fc68a95e0b1ceb08d61e3af7afa199ce94' }, h("div", { key: '6653d94ab79c74342ce792792547018e4464a814', class: "mrd-date-field" }, this.label && (h("label", { key: '2fa7b7ec50c784f9410ca48b93d50e39dc6e0bee', class: `mrd-date-field__label${this.required ? ' mrd-date-field__label--required' : ''}` }, this.label)), h("input", { key: 'f79ebbaf0e28ad7668a5400d1df514b66457b72d', class: `mrd-date-field__input${hasError ? ' mrd-date-field__input--error' : ''}`, type: "date", name: this.name, value: this.value, required: this.required, disabled: this.disabled, onChange: this.handleChange, onBlur: this.handleBlur }), hasError && h("span", { key: 'e52f0b720d76e8ba0586fb40395b6875860762db', class: "mrd-date-field__error" }, this.error))));
30
+ return (h(Host, { key: '2c0dc2311068a5c759fe8efe58a98a71a9cf4b7b' }, h("div", { key: 'ee1cc0e9a2943cc42439825b8f21cd3492eaca05', class: "mrd-date-field" }, this.label && (h("label", { key: '3f836a991e676b6070a8b3800edfce00cc0d3b3d', class: `mrd-date-field__label${this.required ? ' mrd-date-field__label--required' : ''}` }, this.label)), h("input", { key: '575185661987eea3dc91950f51995b2cc75debea', class: `mrd-date-field__input${hasError ? ' mrd-date-field__input--error' : ''}`, type: "date", name: this.name, value: this.value, required: this.required, disabled: this.disabled, onChange: this.handleChange, onBlur: this.handleBlur }), hasError && h("span", { key: '480ec99200989f3dc543d9afc648d83d31992b3c', class: "mrd-date-field__error" }, this.error))));
31
31
  }
32
32
  static get is() { return "mrd-date-field"; }
33
33
  static get encapsulation() { return "scoped"; }
@@ -54,7 +54,7 @@ export class MrdDatetimeField {
54
54
  }
55
55
  render() {
56
56
  const hasError = !!this.error;
57
- return (h(Host, { key: '6052b08238484bee345ae4bb9b3025c7f2474c35' }, h("div", { key: 'f9073be4496e35a7d40405ae4e6a27a5c1607626', class: "mrd-datetime-field" }, this.label && (h("label", { key: '5933c3b2dfcae9bfad378441210ada6b625657a2', class: `mrd-datetime-field__label${this.required ? ' mrd-datetime-field__label--required' : ''}` }, this.label)), h("input", { key: '7a947b104c38960d2326a4877e4ca52db9fd9d84', class: `mrd-datetime-field__input${hasError ? ' mrd-datetime-field__input--error' : ''}`, type: "datetime-local", name: this.name, value: this.localValue, required: this.required, disabled: this.disabled, onChange: this.handleChange, onBlur: this.handleBlur }), hasError && h("span", { key: 'cea3dba7e14e18a3a08394ef3027b661f1808969', class: "mrd-datetime-field__error" }, this.error))));
57
+ return (h(Host, { key: 'ea8b3b68100ffdb316bc5048f82d85d238bb2e4b' }, h("div", { key: 'c192c6998ee474aaf4df7b3b97ae0bd61f6d624d', class: "mrd-datetime-field" }, this.label && (h("label", { key: '1fbd66c17d76508f0d698a2c258be6779e98d85e', class: `mrd-datetime-field__label${this.required ? ' mrd-datetime-field__label--required' : ''}` }, this.label)), h("input", { key: 'fc9612c062a1cab5076a06598cabf227adce996c', class: `mrd-datetime-field__input${hasError ? ' mrd-datetime-field__input--error' : ''}`, type: "datetime-local", name: this.name, value: this.localValue, required: this.required, disabled: this.disabled, onChange: this.handleChange, onBlur: this.handleBlur }), hasError && h("span", { key: '8788ac01739302f6ad61010b238ff38d45e1b68a', class: "mrd-datetime-field__error" }, this.error))));
58
58
  }
59
59
  static get is() { return "mrd-datetime-field"; }
60
60
  static get encapsulation() { return "scoped"; }
@@ -0,0 +1,375 @@
1
+ import { Host, h } from "@stencil/core";
2
+ import { t } from "../../utils/i18n";
3
+ /**
4
+ * Owns a document collection view: a single toolbar (view switch + collection
5
+ * actions like "New folder", and — later — upload / drag-drop) plus the two
6
+ * interchangeable bodies, the folder tree (`mrd-document-list`) and the flat
7
+ * table (`mrd-table`).
8
+ *
9
+ * `mrd-layout-section` renders one of these per document VIEW / RELATED_VIEW and
10
+ * forwards the re-emitted load/navigate/action events to the host. The embedded
11
+ * table/list keep their `data-view` / `data-doclist` attributes so the host's
12
+ * existing `setViewPage` / `setViewDistinct` / `setViewAggregations` lookups
13
+ * (recursive querySelector) still resolve them unchanged.
14
+ */
15
+ export class MrdDocumentContainer {
16
+ constructor() {
17
+ /** The VIEW or RELATED_VIEW layout item (dataClass, fromClass, view config). */
18
+ this.item = null;
19
+ /** Parent record id — required for RELATED_VIEW path building. */
20
+ this.parentId = '';
21
+ /** Lookup key used for the embedded `data-doclist` / `data-view` attributes. */
22
+ this.viewKey = '';
23
+ this.locale = navigator.language;
24
+ /** Active body: folder tree or flat table. */
25
+ this.mode = 'tree';
26
+ /** Whether the folder tree currently has a valid target for "New folder". */
27
+ this.canCreate = false;
28
+ /** Whether the currently mounted table has been init()'d. Reset on every mode switch. */
29
+ this.tableInited = false;
30
+ this.createFolder = () => {
31
+ var _a, _b;
32
+ (_b = (_a = this.listEl) === null || _a === void 0 ? void 0 : _a.createFolder) === null || _b === void 0 ? void 0 : _b.call(_a);
33
+ };
34
+ }
35
+ /** The embedded table does not self-load: like every mrd-table it waits for the
36
+ * host to call init() (which emits mrdLoadPage, and — once page 0 lands —
37
+ * mrdLoadAggregations). The section only init()s tables mounted at load time, so
38
+ * when the user switches to list view we init the freshly mounted table here. */
39
+ componentDidRender() {
40
+ var _a;
41
+ if (this.mode === 'list' && this.tableEl && !this.tableInited) {
42
+ this.tableInited = true;
43
+ const table = this.tableEl;
44
+ Promise.resolve((_a = table.componentOnReady) === null || _a === void 0 ? void 0 : _a.call(table)).then(() => { var _a; return (_a = table.init) === null || _a === void 0 ? void 0 : _a.call(table); });
45
+ }
46
+ }
47
+ setMode(mode) {
48
+ if (mode === this.mode)
49
+ return;
50
+ // The tree remounts on switch and re-emits mrdCanCreate; until then, disable.
51
+ this.canCreate = false;
52
+ // The table remounts on switch; re-init it once it is back in the DOM.
53
+ this.tableInited = false;
54
+ this.mode = mode;
55
+ }
56
+ // ── Toolbar ────────────────────────────────────────────────────────────────
57
+ renderToolbar() {
58
+ return (h("div", { class: "mrd-document-container__toolbar" }, this.mode === 'tree' && (h("button", { type: "button", class: "mrd-document-container__action", disabled: !this.canCreate, onClick: this.createFolder }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { d: "M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }), h("path", { d: "M12 11v4M10 13h4" })), t('new_folder', this.locale))), h("div", { class: "mrd-document-container__seg", role: "group", "aria-label": t('doc_view_switch', this.locale) }, h("button", { class: "mrd-document-container__seg-btn", "aria-pressed": String(this.mode === 'tree'), title: t('doc_view_tree', this.locale), "aria-label": t('doc_view_tree', this.locale), onClick: () => this.setMode('tree') }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { d: "M3 5h6M3 12h9M3 19h6" }), h("circle", { cx: "18", cy: "5", r: "1.6" }), h("circle", { cx: "18", cy: "19", r: "1.6" }), h("path", { d: "M16 12h4" }))), h("button", { class: "mrd-document-container__seg-btn", "aria-pressed": String(this.mode === 'list'), title: t('doc_view_list', this.locale), "aria-label": t('doc_view_list', this.locale), onClick: () => this.setMode('list') }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { d: "M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01" }))))));
59
+ }
60
+ // ── Bodies ───────────────────────────────────────────────────────────────
61
+ renderTree() {
62
+ return (h("mrd-document-list", { "data-doclist": this.viewKey, ref: el => (this.listEl = el), item: this.item, archetype: this.archetype, parentId: this.parentId, locale: this.locale, onMrdLoadDistinct: (e) => {
63
+ e.stopPropagation();
64
+ this.mrdLoadDistinct.emit(e.detail);
65
+ }, onMrdLoadPage: (e) => {
66
+ e.stopPropagation();
67
+ this.mrdLoadPage.emit(e.detail);
68
+ }, onMrdNavigate: (e) => {
69
+ e.stopPropagation();
70
+ this.mrdNavigate.emit(e.detail);
71
+ }, onMrdCanCreate: (e) => {
72
+ e.stopPropagation();
73
+ this.canCreate = e.detail;
74
+ }, onMrdUpdateObject: (e) => {
75
+ e.stopPropagation();
76
+ this.mrdUpdateObject.emit(e.detail);
77
+ }, onMrdUpload: (e) => {
78
+ e.stopPropagation();
79
+ this.mrdUpload.emit(e.detail);
80
+ }, onMrdCreateObject: (e) => {
81
+ e.stopPropagation();
82
+ this.mrdCreateObject.emit(e.detail);
83
+ } }));
84
+ }
85
+ renderList() {
86
+ return (h("mrd-table", { "data-view": this.viewKey, ref: el => (this.tableEl = el), item: this.item, parentId: this.parentId, locale: this.locale, onMrdLoadPage: (e) => {
87
+ e.stopPropagation();
88
+ this.mrdLoadPage.emit(e.detail);
89
+ }, onMrdLoadAggregations: (e) => {
90
+ e.stopPropagation();
91
+ this.mrdLoadAggregations.emit(e.detail);
92
+ }, onMrdRowClick: (e) => {
93
+ var _a, _b, _c;
94
+ e.stopPropagation();
95
+ const row = e.detail;
96
+ this.mrdNavigate.emit({ href: (_b = (_a = row === null || row === void 0 ? void 0 : row._links) === null || _a === void 0 ? void 0 : _a.self) === null || _b === void 0 ? void 0 : _b.href, label: (_c = row === null || row === void 0 ? void 0 : row.name) !== null && _c !== void 0 ? _c : '' });
97
+ }, onMrdAction: (e) => {
98
+ e.stopPropagation();
99
+ this.mrdAction.emit(e.detail);
100
+ } }));
101
+ }
102
+ render() {
103
+ return (h(Host, { key: 'a5393d484bdc202b57c6d32d9ce917e760aff95a' }, this.renderToolbar(), h("div", { key: '52f82de8f7734e13f34d323e3e831e6de5676f46', class: "mrd-document-container__body" }, this.mode === 'tree' ? this.renderTree() : this.renderList())));
104
+ }
105
+ static get is() { return "mrd-document-container"; }
106
+ static get encapsulation() { return "scoped"; }
107
+ static get originalStyleUrls() {
108
+ return {
109
+ "$": ["mrd-document-container.scss"]
110
+ };
111
+ }
112
+ static get styleUrls() {
113
+ return {
114
+ "$": ["mrd-document-container.css"]
115
+ };
116
+ }
117
+ static get properties() {
118
+ return {
119
+ "item": {
120
+ "type": "unknown",
121
+ "mutable": false,
122
+ "complexType": {
123
+ "original": "ClientLayoutItem | null",
124
+ "resolved": "ClientLayoutItem | null",
125
+ "references": {
126
+ "ClientLayoutItem": {
127
+ "location": "import",
128
+ "path": "../../types/client-layout",
129
+ "id": "src/types/client-layout.ts::ClientLayoutItem",
130
+ "referenceLocation": "ClientLayoutItem"
131
+ }
132
+ }
133
+ },
134
+ "required": false,
135
+ "optional": false,
136
+ "docs": {
137
+ "tags": [],
138
+ "text": "The VIEW or RELATED_VIEW layout item (dataClass, fromClass, view config)."
139
+ },
140
+ "getter": false,
141
+ "setter": false,
142
+ "defaultValue": "null"
143
+ },
144
+ "archetype": {
145
+ "type": "unknown",
146
+ "mutable": false,
147
+ "complexType": {
148
+ "original": "ClientArchetype",
149
+ "resolved": "ClientArchetype",
150
+ "references": {
151
+ "ClientArchetype": {
152
+ "location": "import",
153
+ "path": "../../types/client-layout",
154
+ "id": "src/types/client-layout.ts::ClientArchetype",
155
+ "referenceLocation": "ClientArchetype"
156
+ }
157
+ }
158
+ },
159
+ "required": true,
160
+ "optional": false,
161
+ "docs": {
162
+ "tags": [],
163
+ "text": "Resolved `commons.document` archetype binding for the folder tree."
164
+ },
165
+ "getter": false,
166
+ "setter": false
167
+ },
168
+ "parentId": {
169
+ "type": "string",
170
+ "mutable": false,
171
+ "complexType": {
172
+ "original": "string",
173
+ "resolved": "string",
174
+ "references": {}
175
+ },
176
+ "required": false,
177
+ "optional": false,
178
+ "docs": {
179
+ "tags": [],
180
+ "text": "Parent record id \u2014 required for RELATED_VIEW path building."
181
+ },
182
+ "getter": false,
183
+ "setter": false,
184
+ "reflect": false,
185
+ "attribute": "parent-id",
186
+ "defaultValue": "''"
187
+ },
188
+ "viewKey": {
189
+ "type": "string",
190
+ "mutable": false,
191
+ "complexType": {
192
+ "original": "string",
193
+ "resolved": "string",
194
+ "references": {}
195
+ },
196
+ "required": false,
197
+ "optional": false,
198
+ "docs": {
199
+ "tags": [],
200
+ "text": "Lookup key used for the embedded `data-doclist` / `data-view` attributes."
201
+ },
202
+ "getter": false,
203
+ "setter": false,
204
+ "reflect": false,
205
+ "attribute": "view-key",
206
+ "defaultValue": "''"
207
+ },
208
+ "locale": {
209
+ "type": "string",
210
+ "mutable": false,
211
+ "complexType": {
212
+ "original": "string",
213
+ "resolved": "string",
214
+ "references": {}
215
+ },
216
+ "required": false,
217
+ "optional": false,
218
+ "docs": {
219
+ "tags": [],
220
+ "text": ""
221
+ },
222
+ "getter": false,
223
+ "setter": false,
224
+ "reflect": false,
225
+ "attribute": "locale",
226
+ "defaultValue": "navigator.language"
227
+ }
228
+ };
229
+ }
230
+ static get states() {
231
+ return {
232
+ "mode": {},
233
+ "canCreate": {}
234
+ };
235
+ }
236
+ static get events() {
237
+ return [{
238
+ "method": "mrdLoadPage",
239
+ "name": "mrdLoadPage",
240
+ "bubbles": true,
241
+ "cancelable": true,
242
+ "composed": true,
243
+ "docs": {
244
+ "tags": [],
245
+ "text": "Re-emitted from the embedded list/table. `nodeId` present for a folder load."
246
+ },
247
+ "complexType": {
248
+ "original": "{ page: number; sort: string; path: string; qs: string; nodeId?: string }",
249
+ "resolved": "{ page: number; sort: string; path: string; qs: string; nodeId?: string | undefined; }",
250
+ "references": {}
251
+ }
252
+ }, {
253
+ "method": "mrdLoadDistinct",
254
+ "name": "mrdLoadDistinct",
255
+ "bubbles": true,
256
+ "cancelable": true,
257
+ "composed": true,
258
+ "docs": {
259
+ "tags": [],
260
+ "text": "Re-emitted from the embedded folder tree."
261
+ },
262
+ "complexType": {
263
+ "original": "{ nodeId: string; distinct: string; path: string; qs: string }",
264
+ "resolved": "{ nodeId: string; distinct: string; path: string; qs: string; }",
265
+ "references": {}
266
+ }
267
+ }, {
268
+ "method": "mrdLoadAggregations",
269
+ "name": "mrdLoadAggregations",
270
+ "bubbles": true,
271
+ "cancelable": true,
272
+ "composed": true,
273
+ "docs": {
274
+ "tags": [],
275
+ "text": "Re-emitted from the embedded table."
276
+ },
277
+ "complexType": {
278
+ "original": "{ path: string; qs: string; aggQs: string }",
279
+ "resolved": "{ path: string; qs: string; aggQs: string; }",
280
+ "references": {}
281
+ }
282
+ }, {
283
+ "method": "mrdNavigate",
284
+ "name": "mrdNavigate",
285
+ "bubbles": true,
286
+ "cancelable": true,
287
+ "composed": true,
288
+ "docs": {
289
+ "tags": [],
290
+ "text": "A row / document was activated. Host routes to the object page."
291
+ },
292
+ "complexType": {
293
+ "original": "{ href?: string; label: string }",
294
+ "resolved": "{ href?: string | undefined; label: string; }",
295
+ "references": {}
296
+ }
297
+ }, {
298
+ "method": "mrdAction",
299
+ "name": "mrdAction",
300
+ "bubbles": true,
301
+ "cancelable": true,
302
+ "composed": true,
303
+ "docs": {
304
+ "tags": [],
305
+ "text": "A table toolbar action was triggered."
306
+ },
307
+ "complexType": {
308
+ "original": "{ action: string; path?: string; qs?: string; parentPath?: string | null; basicType?: string }",
309
+ "resolved": "{ action: string; path?: string | undefined; qs?: string | undefined; parentPath?: string | null | undefined; basicType?: string | undefined; }",
310
+ "references": {}
311
+ }
312
+ }, {
313
+ "method": "mrdUpdateObject",
314
+ "name": "mrdUpdateObject",
315
+ "bubbles": true,
316
+ "cancelable": true,
317
+ "composed": true,
318
+ "docs": {
319
+ "tags": [],
320
+ "text": "Generic \"update an existing object\" request, re-emitted from the folder tree\n(a document was dragged into another folder/container)."
321
+ },
322
+ "complexType": {
323
+ "original": "{ href: string; values: Record<string, unknown> }",
324
+ "resolved": "{ href: string; values: Record<string, unknown>; }",
325
+ "references": {
326
+ "Record": {
327
+ "location": "global",
328
+ "id": "global::Record"
329
+ }
330
+ }
331
+ }
332
+ }, {
333
+ "method": "mrdUpload",
334
+ "name": "mrdUpload",
335
+ "bubbles": true,
336
+ "cancelable": true,
337
+ "composed": true,
338
+ "docs": {
339
+ "tags": [],
340
+ "text": "An external file was dropped on a folder; host uploads and calls back."
341
+ },
342
+ "complexType": {
343
+ "original": "{ file: File }",
344
+ "resolved": "{ file: File; }",
345
+ "references": {
346
+ "File": {
347
+ "location": "global",
348
+ "id": "global::File"
349
+ }
350
+ }
351
+ }
352
+ }, {
353
+ "method": "mrdCreateObject",
354
+ "name": "mrdCreateObject",
355
+ "bubbles": true,
356
+ "cancelable": true,
357
+ "composed": true,
358
+ "docs": {
359
+ "tags": [],
360
+ "text": "Create a new document from an uploaded file; host POSTs `values` to `path`."
361
+ },
362
+ "complexType": {
363
+ "original": "{ path: string; values: Record<string, unknown> }",
364
+ "resolved": "{ path: string; values: Record<string, unknown>; }",
365
+ "references": {
366
+ "Record": {
367
+ "location": "global",
368
+ "id": "global::Record"
369
+ }
370
+ }
371
+ }
372
+ }];
373
+ }
374
+ static get elementRef() { return "el"; }
375
+ }
@@ -0,0 +1,79 @@
1
+ :host {
2
+ display: block;
3
+ }
4
+
5
+ .mrd-document-container__toolbar {
6
+ display: flex;
7
+ align-items: center;
8
+ justify-content: flex-end;
9
+ gap: var(--mrd-space-2);
10
+ padding: var(--mrd-space-2) var(--mrd-space-4);
11
+ border-bottom: 1px solid var(--mrd-color-neutral-100);
12
+ }
13
+
14
+ .mrd-document-container__action {
15
+ display: inline-flex;
16
+ align-items: center;
17
+ gap: var(--mrd-space-2);
18
+ height: 1.625rem;
19
+ padding: 0 var(--mrd-space-3);
20
+ font-size: var(--mrd-font-size-sm);
21
+ color: var(--mrd-color-neutral-700);
22
+ background: var(--mrd-color-white);
23
+ border: 1px solid var(--mrd-color-neutral-200);
24
+ border-radius: var(--mrd-border-radius);
25
+ cursor: pointer;
26
+ transition: background var(--mrd-transition-fast), border-color var(--mrd-transition-fast);
27
+ }
28
+
29
+ .mrd-document-container__action svg {
30
+ width: 1rem;
31
+ height: 1rem;
32
+ color: #d9a441;
33
+ }
34
+
35
+ .mrd-document-container__action:hover:not(:disabled) {
36
+ background: var(--mrd-color-neutral-50);
37
+ border-color: var(--mrd-color-neutral-300);
38
+ }
39
+
40
+ .mrd-document-container__action:disabled {
41
+ opacity: 0.5;
42
+ cursor: not-allowed;
43
+ }
44
+
45
+ .mrd-document-container__seg {
46
+ display: inline-flex;
47
+ gap: 2px;
48
+ padding: 2px;
49
+ background: var(--mrd-color-neutral-100);
50
+ border-radius: var(--mrd-border-radius);
51
+ }
52
+
53
+ .mrd-document-container__seg-btn {
54
+ width: 1.875rem;
55
+ height: 1.625rem;
56
+ display: grid;
57
+ place-items: center;
58
+ border: none;
59
+ background: none;
60
+ border-radius: var(--mrd-border-radius-sm);
61
+ color: var(--mrd-color-neutral-500);
62
+ cursor: pointer;
63
+ transition: color var(--mrd-transition-fast), background var(--mrd-transition-fast);
64
+ }
65
+
66
+ .mrd-document-container__seg-btn:hover {
67
+ color: var(--mrd-color-neutral-800);
68
+ }
69
+
70
+ .mrd-document-container__seg-btn[aria-pressed='true'] {
71
+ background: var(--mrd-color-white);
72
+ color: var(--mrd-color-primary-dark);
73
+ box-shadow: var(--mrd-shadow-sm);
74
+ }
75
+
76
+ .mrd-document-container__seg-btn svg {
77
+ width: 1rem;
78
+ height: 1rem;
79
+ }