@mmlogic/components 0.5.5 → 0.5.7

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 (84) hide show
  1. package/dist/cjs/{cell-renderer-Mx3pwONr.js → cell-renderer-pwUGEDql.js} +8 -261
  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_25.cjs.entry.js +234 -262
  5. package/dist/cjs/mrd-merge-view.cjs.entry.js +3 -3
  6. package/dist/collection/components/fields/mrd-date-field/mrd-date-field.css +4 -55
  7. package/dist/collection/components/fields/mrd-date-field/mrd-date-field.js +8 -118
  8. package/dist/collection/components/fields/mrd-datetime-field/mrd-datetime-field.css +4 -55
  9. package/dist/collection/components/fields/mrd-datetime-field/mrd-datetime-field.js +15 -117
  10. package/dist/collection/components/fields/mrd-email-field/mrd-email-field.js +1 -1
  11. package/dist/collection/components/fields/mrd-file-field/mrd-file-field.js +1 -1
  12. package/dist/collection/components/fields/mrd-image-field/mrd-image-field.js +1 -1
  13. package/dist/collection/components/fields/mrd-longtext-field/mrd-longtext-field.js +1 -1
  14. package/dist/collection/components/fields/mrd-number-field/mrd-number-field.js +1 -1
  15. package/dist/collection/components/fields/mrd-secret-field/mrd-secret-field.js +2 -2
  16. package/dist/collection/components/fields/mrd-text-field/mrd-text-field.js +1 -1
  17. package/dist/collection/components/fields/mrd-textarea-field/mrd-textarea-field.js +1 -1
  18. package/dist/collection/components/fields/mrd-time-field/mrd-time-field.js +1 -1
  19. package/dist/collection/components/form/mrd-field/mrd-field.js +11 -11
  20. package/dist/collection/components/invoice/mrd-invoice-view/mrd-invoice-view.js +1 -1
  21. package/dist/collection/components/layout/mrd-layout-section/mrd-layout-section.js +1 -1
  22. package/dist/collection/components/merge/mrd-merge-view/mrd-merge-view.js +2 -2
  23. package/dist/collection/components/table/mrd-table/mrd-table.css +52 -22
  24. package/dist/collection/components/table/mrd-table/mrd-table.js +175 -45
  25. package/dist/collection/components/table/mrd-table/table-parts.js +6 -3
  26. package/dist/collection/components/table/mrd-table/virtual-scroll.js +8 -3
  27. package/dist/collection/utils/format.js +0 -160
  28. package/dist/collection/utils/i18n.js +8 -96
  29. package/dist/components/cell-renderer.js +1 -1
  30. package/dist/components/format.js +1 -1
  31. package/dist/components/i18n.js +1 -1
  32. package/dist/components/mrd-date-field2.js +1 -1
  33. package/dist/components/mrd-datetime-field2.js +1 -1
  34. package/dist/components/mrd-document-list2.js +1 -1
  35. package/dist/components/mrd-document-view2.js +1 -1
  36. package/dist/components/mrd-email-field2.js +1 -1
  37. package/dist/components/mrd-email-view2.js +1 -1
  38. package/dist/components/mrd-field2.js +1 -1
  39. package/dist/components/mrd-file-field2.js +1 -1
  40. package/dist/components/mrd-image-field2.js +1 -1
  41. package/dist/components/mrd-invoice-view2.js +1 -1
  42. package/dist/components/mrd-layout-section.js +1 -1
  43. package/dist/components/mrd-longtext-field2.js +1 -1
  44. package/dist/components/mrd-merge-view.js +1 -1
  45. package/dist/components/mrd-number-field2.js +1 -1
  46. package/dist/components/mrd-secret-field2.js +1 -1
  47. package/dist/components/mrd-table2.js +1 -1
  48. package/dist/components/mrd-text-field2.js +1 -1
  49. package/dist/components/mrd-textarea-field2.js +1 -1
  50. package/dist/components/mrd-time-field2.js +1 -1
  51. package/dist/esm/{cell-renderer-UQOYlDv7.js → cell-renderer-B8rJpnq8.js} +9 -257
  52. package/dist/esm/loader.js +1 -1
  53. package/dist/esm/mosterdcomponents.js +1 -1
  54. package/dist/esm/mrd-boolean-field_25.entry.js +234 -262
  55. package/dist/esm/mrd-merge-view.entry.js +3 -3
  56. package/dist/mosterdcomponents/cell-renderer-B8u5BCK-.js.map +1 -0
  57. package/dist/mosterdcomponents/client-layout-Bc42CfJB.js.map +1 -0
  58. package/dist/mosterdcomponents/document-attachments-BufPmMRv.js.map +1 -0
  59. package/dist/mosterdcomponents/field-helpers-CUJsHr1V.js.map +1 -0
  60. package/dist/mosterdcomponents/file-upload-common-DdTDuxEU.js.map +1 -0
  61. package/dist/mosterdcomponents/format-gcecItcD.js.map +1 -0
  62. package/dist/mosterdcomponents/i18n-Ba7_jO9I.js.map +1 -0
  63. package/dist/mosterdcomponents/index-1ayBojyN.js.map +1 -0
  64. package/dist/mosterdcomponents/index-DhffneUF.js.map +1 -0
  65. package/dist/mosterdcomponents/index.esm.js.map +1 -0
  66. package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
  67. package/dist/mosterdcomponents/mosterdcomponents.esm.js.map +1 -0
  68. package/dist/mosterdcomponents/p-5614d8f5.entry.js +3 -0
  69. package/dist/mosterdcomponents/{p-d31b71d9.entry.js → p-e540de6a.entry.js} +1 -1
  70. package/dist/mosterdcomponents/p-rTM1tU_M.js +1 -0
  71. package/dist/mosterdcomponents/purify.es-_duHfPgC.js.map +1 -0
  72. package/dist/mosterdcomponents/query-params-BZbQoeYF.js.map +1 -0
  73. package/dist/mosterdcomponents/quill-C9pgw_k-.js.map +1 -0
  74. package/dist/mosterdcomponents/validation-CjjTt66G.js.map +1 -0
  75. package/dist/types/components/fields/mrd-date-field/mrd-date-field.d.ts +1 -22
  76. package/dist/types/components/fields/mrd-datetime-field/mrd-datetime-field.d.ts +2 -21
  77. package/dist/types/components/table/mrd-table/mrd-table.d.ts +47 -5
  78. package/dist/types/components/table/mrd-table/table-parts.d.ts +0 -2
  79. package/dist/types/components/table/mrd-table/virtual-scroll.d.ts +6 -1
  80. package/dist/types/components.d.ts +0 -26
  81. package/dist/types/utils/format.d.ts +0 -34
  82. package/package.json +1 -1
  83. package/dist/mosterdcomponents/p-8cc374e0.entry.js +0 -3
  84. package/dist/mosterdcomponents/p-CF--ScWr.js +0 -1
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-DVbdkYO3.js');
4
- var cellRenderer = require('./cell-renderer-Mx3pwONr.js');
4
+ var cellRenderer = require('./cell-renderer-pwUGEDql.js');
5
5
  var clientLayout = require('./client-layout-CqVuJumR.js');
6
6
 
7
7
  const mrdBooleanFieldCss = () => `.sc-mrd-boolean-field-h{display:block}.mrd-boolean-field.sc-mrd-boolean-field{display:flex;align-items:center;width:100%}.mrd-boolean-field__toggle-label.sc-mrd-boolean-field{display:flex;align-items:center;gap:var(--mrd-space-3);cursor:pointer;user-select:none}.mrd-boolean-field__checkbox.sc-mrd-boolean-field{position:absolute;opacity:0;width:0;height:0;pointer-events:none}.mrd-boolean-field__checkbox.sc-mrd-boolean-field:checked+.mrd-boolean-field__toggle.sc-mrd-boolean-field{background-color:var(--mrd-color-primary)}.mrd-boolean-field__checkbox.sc-mrd-boolean-field:checked+.mrd-boolean-field__toggle.sc-mrd-boolean-field::after{transform:translateX(20px)}.mrd-boolean-field__checkbox.sc-mrd-boolean-field:focus+.mrd-boolean-field__toggle.sc-mrd-boolean-field{box-shadow:var(--mrd-shadow-focus)}.mrd-boolean-field__checkbox.sc-mrd-boolean-field:disabled+.mrd-boolean-field__toggle.sc-mrd-boolean-field{opacity:0.5;cursor:not-allowed}.mrd-boolean-field__toggle.sc-mrd-boolean-field{position:relative;display:inline-block;width:44px;height:24px;background-color:var(--mrd-color-neutral-300);border-radius:var(--mrd-border-radius-full);transition:background-color var(--mrd-transition);flex-shrink:0}.mrd-boolean-field__toggle.sc-mrd-boolean-field::after{content:"";position:absolute;top:2px;left:2px;width:20px;height:20px;background-color:var(--mrd-color-white);border-radius:50%;transition:transform var(--mrd-transition);box-shadow:var(--mrd-shadow-sm)}.mrd-boolean-field__text.sc-mrd-boolean-field{font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-color-neutral-800)}.mrd-boolean-field__text--required.sc-mrd-boolean-field::after{content:" *";color:var(--mrd-color-danger)}`;
@@ -201,7 +201,7 @@ const MrdCurrencyField = class {
201
201
  };
202
202
  MrdCurrencyField.style = mrdCurrencyFieldCss();
203
203
 
204
- const mrdDateFieldCss = () => `.sc-mrd-date-field-h{display:block}.mrd-date-field.sc-mrd-date-field{display:flex;flex-direction:column;gap:var(--mrd-space-1);width:100%}.mrd-date-field__label.sc-mrd-date-field{display:block;font-family:var(--mrd-font-family);font-size:var(--mrd-label-font-size);font-weight:var(--mrd-label-font-weight);color:var(--mrd-label-color)}.mrd-date-field__label--required.sc-mrd-date-field::after{content:" *";color:var(--mrd-color-danger)}.mrd-date-field__control.sc-mrd-date-field{position:relative;display:block}.mrd-date-field__input.sc-mrd-date-field{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x);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);transition:border-color var(--mrd-transition), box-shadow var(--mrd-transition);outline:none;appearance:none;box-sizing:border-box}.mrd-date-field__input.sc-mrd-date-field::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-date-field__input.sc-mrd-date-field:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-date-field__input.sc-mrd-date-field:disabled{background-color:var(--mrd-input-bg-disabled);cursor:not-allowed;opacity:0.7}.mrd-date-field__input--error.sc-mrd-date-field{border-color:var(--mrd-border-color-error)}.mrd-date-field__input--error.sc-mrd-date-field:focus{box-shadow:var(--mrd-shadow-focus-error)}.mrd-date-field__input.sc-mrd-date-field{padding-inline-end:calc(var(--mrd-input-padding-x) + 1.75rem)}.mrd-date-field__picker.sc-mrd-date-field{position:absolute;inset-inline-end:var(--mrd-space-1);top:50%;transform:translateY(-50%);width:1.75rem;height:1.75rem}.mrd-date-field__picker-button.sc-mrd-date-field{display:inline-flex;align-items:center;justify-content:center;width:100%;height:100%;padding:0;border:0;border-radius:var(--mrd-border-radius-sm);background:transparent;color:var(--mrd-color-neutral-500);cursor:pointer;transition:color var(--mrd-transition), background-color var(--mrd-transition)}.mrd-date-field__picker-button.sc-mrd-date-field svg.sc-mrd-date-field{width:1.125rem;height:1.125rem}.mrd-date-field__picker-button.sc-mrd-date-field:hover:not(:disabled){color:var(--mrd-color-primary);background-color:var(--mrd-color-neutral-100)}.mrd-date-field__picker-button.sc-mrd-date-field:focus-visible{outline:2px solid var(--mrd-border-color-focus);outline-offset:1px}.mrd-date-field__picker-button.sc-mrd-date-field:disabled{cursor:not-allowed;opacity:0.5}.mrd-date-field__picker-native.sc-mrd-date-field{position:absolute;inset:0;width:100%;height:100%;padding:0;border:0;opacity:0;pointer-events:none}.mrd-date-field__error.sc-mrd-date-field{font-family:var(--mrd-font-family);font-size:var(--mrd-error-font-size);color:var(--mrd-error-color)}`;
204
+ const mrdDateFieldCss = () => `.sc-mrd-date-field-h{display:block}.mrd-date-field.sc-mrd-date-field{display:flex;flex-direction:column;gap:var(--mrd-space-1);width:100%}.mrd-date-field__label.sc-mrd-date-field{display:block;font-family:var(--mrd-font-family);font-size:var(--mrd-label-font-size);font-weight:var(--mrd-label-font-weight);color:var(--mrd-label-color)}.mrd-date-field__label--required.sc-mrd-date-field::after{content:" *";color:var(--mrd-color-danger)}.mrd-date-field__input.sc-mrd-date-field{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x);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);transition:border-color var(--mrd-transition), box-shadow var(--mrd-transition);outline:none;appearance:none;box-sizing:border-box}.mrd-date-field__input.sc-mrd-date-field::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-date-field__input.sc-mrd-date-field:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-date-field__input.sc-mrd-date-field:disabled{background-color:var(--mrd-input-bg-disabled);cursor:not-allowed;opacity:0.7}.mrd-date-field__input--error.sc-mrd-date-field{border-color:var(--mrd-border-color-error)}.mrd-date-field__input--error.sc-mrd-date-field:focus{box-shadow:var(--mrd-shadow-focus-error)}.mrd-date-field__error.sc-mrd-date-field{font-family:var(--mrd-font-family);font-size:var(--mrd-error-font-size);color:var(--mrd-error-color)}.mrd-date-field__input.sc-mrd-date-field{cursor:pointer}`;
205
205
 
206
206
  const MrdDateField = class {
207
207
  constructor(hostRef) {
@@ -210,114 +210,28 @@ const MrdDateField = class {
210
210
  this.mrdBlur = index.createEvent(this, "mrdBlur");
211
211
  this.name = '';
212
212
  this.label = '';
213
- /** ISO date, 'YYYY-MM-DD'. */
214
213
  this.value = '';
215
- /** Overrides the locale-derived pattern placeholder (e.g. 'dd-mm-jjjj'). */
216
- this.placeholder = '';
217
214
  this.required = false;
218
215
  this.disabled = false;
219
216
  this.locale = navigator.language;
220
- /** What the user sees: the value formatted for `locale`, or their raw typing. */
221
- this.displayValue = '';
222
217
  this.error = '';
223
- /** While focused the user owns the text; prop updates must not overwrite it. */
224
- this.focused = false;
225
- this.handleFocus = () => {
226
- this.focused = true;
227
- };
228
- this.handleInput = (e) => {
229
- this.displayValue = e.target.value;
218
+ this.handleChange = (e) => {
219
+ const val = e.target.value;
220
+ this.error = requiredError(val, this.required, this.locale);
221
+ this.mrdChange.emit({ name: this.name, value: val });
230
222
  };
231
223
  this.handleBlur = (e) => {
232
- this.focused = false;
233
- const value = this.commit(e.target.value);
234
- this.mrdChange.emit({ name: this.name, value });
235
- this.mrdBlur.emit({ name: this.name, value });
236
- };
237
- this.handleKeyDown = (e) => {
238
- // Submitting with Enter never fires blur, so commit the typed text here too.
239
- if (e.key !== 'Enter')
240
- return;
241
- const value = this.commit(e.target.value);
242
- this.mrdChange.emit({ name: this.name, value });
243
- };
244
- this.openPicker = () => {
245
- const native = this.nativeInput;
246
- if (!native || this.disabled)
247
- return;
248
- // The blur commit that precedes this click re-renders asynchronously, so sync by hand first.
249
- native.value = this.currentIso();
250
- try {
251
- native.showPicker();
252
- }
253
- catch (_a) {
254
- // Browsers without showPicker(): focusing at least surfaces the platform control.
255
- native.focus();
256
- }
257
- };
258
- this.handlePickerChange = (e) => {
259
- const iso = e.target.value; // native inputs always yield 'YYYY-MM-DD'
260
- this.displayValue = cellRenderer.formatIsoDate(iso, this.locale);
261
- this.error = requiredError(iso, this.required, this.locale);
262
- this.mrdChange.emit({ name: this.name, value: iso });
263
- this.mrdBlur.emit({ name: this.name, value: iso });
224
+ const val = e.target.value;
225
+ this.mrdBlur.emit({ name: this.name, value: val });
264
226
  };
265
227
  }
266
- componentWillLoad() {
267
- this.displayValue = cellRenderer.formatIsoDate(this.value, this.locale);
268
- }
269
- valueChanged(newValue) {
270
- if (!this.focused)
271
- this.displayValue = cellRenderer.formatIsoDate(newValue, this.locale);
272
- }
273
- localeChanged() {
274
- if (!this.focused)
275
- this.displayValue = cellRenderer.formatIsoDate(this.value, this.locale);
276
- }
277
- patternPlaceholder() {
278
- if (this.placeholder)
279
- return this.placeholder;
280
- return cellRenderer.localeDatePattern(this.locale, {
281
- day: cellRenderer.t('date_token_day', this.locale),
282
- month: cellRenderer.t('date_token_month', this.locale),
283
- year: cellRenderer.t('date_token_year', this.locale),
284
- });
285
- }
286
- /** Parse the typed text, reformat it, and emit the ISO value. */
287
- commit(raw) {
288
- const trimmed = raw.trim();
289
- const iso = trimmed ? cellRenderer.parseLocalizedDate(trimmed, this.locale) : '';
290
- if (trimmed && iso === null) {
291
- // Keep the raw text so the user can correct it instead of retyping.
292
- this.error = cellRenderer.t('invalid_date', this.locale);
293
- this.displayValue = trimmed;
294
- }
295
- else {
296
- this.error = requiredError(iso, this.required, this.locale);
297
- this.displayValue = iso ? cellRenderer.formatIsoDate(iso, this.locale) : '';
298
- }
299
- return iso !== null && iso !== void 0 ? iso : '';
300
- }
301
- /** The ISO value currently shown, so the picker opens on the right date. */
302
- currentIso() {
303
- var _a;
304
- return (_a = (this.displayValue ? cellRenderer.parseLocalizedDate(this.displayValue, this.locale) : '')) !== null && _a !== void 0 ? _a : '';
305
- }
306
228
  render() {
307
- return (index.h(index.Host, { key: '06ba48bd538ee4c8de4e071285535451f783c259' }, index.h("div", { key: '73ea6ea23c85fe3325bb151afb755cc11a13cf58', class: "mrd-date-field" }, index.h(FieldLabel, { key: '527848cf72323aef176fc7d5bcd47dcf2f7e46f6', base: "mrd-date-field", label: this.label, required: this.required }), index.h("div", { key: '2ff7586f4e6298d1f9b9b131106044533de82c6d', class: "mrd-date-field__control" }, index.h("input", { key: '68fdf2f1f7961ca049ab6493494c8c0707e6a4af', class: controlClass('mrd-date-field', !!this.error), type: "text", name: this.name, value: this.displayValue, placeholder: this.patternPlaceholder(), autocomplete: "off", required: this.required, disabled: this.disabled, onFocus: this.handleFocus, onInput: this.handleInput, onBlur: this.handleBlur, onKeyDown: this.handleKeyDown }), index.h("span", { key: '9557b7a3f6780b8a05030ab8e7c941c44df9f4a5', class: "mrd-date-field__picker" }, index.h("button", { key: '586973e0440ed0b74e1fa0affae9e462257024c3', type: "button", class: "mrd-date-field__picker-button", title: cellRenderer.t('open_calendar', this.locale), "aria-label": cellRenderer.t('open_calendar', this.locale), disabled: this.disabled, onClick: this.openPicker }, index.h("svg", { key: '144319d3a50d0d38c75c59dd3321d4b9097322a6', viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", "stroke-width": "1.5", "aria-hidden": "true" }, index.h("rect", { key: 'aec01ca5c620bf3116705b7a28052eb3bc210cfd', x: "3", y: "4.5", width: "14", height: "12", rx: "2" }), index.h("path", { key: 'a0e13dd3a2005bfbee40f5a071b6760270d0d58d', d: "M3 8.5h14M7 2.5v3M13 2.5v3", "stroke-linecap": "round" }))), index.h("input", { key: 'be02df44f31a59a26ce166ab9a9eab9db2635d89', class: "mrd-date-field__picker-native", type: "date", ref: el => (this.nativeInput = el), value: this.currentIso(), disabled: this.disabled, tabIndex: -1, "aria-hidden": "true", onChange: this.handlePickerChange }))), index.h(FieldError, { key: '2f8b2072bee32170a35f98ec5c962018774c7e8c', base: "mrd-date-field", error: this.error }))));
229
+ return (index.h(index.Host, { key: 'd83beef11c2b9402e251a50885b92e7a057f02ee' }, index.h("div", { key: '6a26e4969e9bde8c5c87771d7b8c7b4d6c1dd942', class: "mrd-date-field" }, index.h(FieldLabel, { key: 'a7bc1b1c56e933a51f6b1b1feb794a4678d9d334', base: "mrd-date-field", label: this.label, required: this.required }), index.h("input", { key: '82e3855654f3b3c554f80d647e783234cca8dae1', class: controlClass('mrd-date-field', !!this.error), type: "date", name: this.name, value: this.value, required: this.required, disabled: this.disabled, onChange: this.handleChange, onBlur: this.handleBlur }), index.h(FieldError, { key: '294b3cdc1004725267aa8265366f5009ab324203', base: "mrd-date-field", error: this.error }))));
308
230
  }
309
- static get watchers() { return {
310
- "value": [{
311
- "valueChanged": 0
312
- }],
313
- "locale": [{
314
- "localeChanged": 0
315
- }]
316
- }; }
317
231
  };
318
232
  MrdDateField.style = mrdDateFieldCss();
319
233
 
320
- const mrdDatetimeFieldCss = () => `.sc-mrd-datetime-field-h{display:block}.mrd-datetime-field.sc-mrd-datetime-field{display:flex;flex-direction:column;gap:var(--mrd-space-1);width:100%}.mrd-datetime-field__label.sc-mrd-datetime-field{display:block;font-family:var(--mrd-font-family);font-size:var(--mrd-label-font-size);font-weight:var(--mrd-label-font-weight);color:var(--mrd-label-color)}.mrd-datetime-field__label--required.sc-mrd-datetime-field::after{content:" *";color:var(--mrd-color-danger)}.mrd-datetime-field__control.sc-mrd-datetime-field{position:relative;display:block}.mrd-datetime-field__input.sc-mrd-datetime-field{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x);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);transition:border-color var(--mrd-transition), box-shadow var(--mrd-transition);outline:none;appearance:none;box-sizing:border-box}.mrd-datetime-field__input.sc-mrd-datetime-field::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-datetime-field__input.sc-mrd-datetime-field:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-datetime-field__input.sc-mrd-datetime-field:disabled{background-color:var(--mrd-input-bg-disabled);cursor:not-allowed;opacity:0.7}.mrd-datetime-field__input--error.sc-mrd-datetime-field{border-color:var(--mrd-border-color-error)}.mrd-datetime-field__input--error.sc-mrd-datetime-field:focus{box-shadow:var(--mrd-shadow-focus-error)}.mrd-datetime-field__input.sc-mrd-datetime-field{padding-inline-end:calc(var(--mrd-input-padding-x) + 1.75rem)}.mrd-datetime-field__picker.sc-mrd-datetime-field{position:absolute;inset-inline-end:var(--mrd-space-1);top:50%;transform:translateY(-50%);width:1.75rem;height:1.75rem}.mrd-datetime-field__picker-button.sc-mrd-datetime-field{display:inline-flex;align-items:center;justify-content:center;width:100%;height:100%;padding:0;border:0;border-radius:var(--mrd-border-radius-sm);background:transparent;color:var(--mrd-color-neutral-500);cursor:pointer;transition:color var(--mrd-transition), background-color var(--mrd-transition)}.mrd-datetime-field__picker-button.sc-mrd-datetime-field svg.sc-mrd-datetime-field{width:1.125rem;height:1.125rem}.mrd-datetime-field__picker-button.sc-mrd-datetime-field:hover:not(:disabled){color:var(--mrd-color-primary);background-color:var(--mrd-color-neutral-100)}.mrd-datetime-field__picker-button.sc-mrd-datetime-field:focus-visible{outline:2px solid var(--mrd-border-color-focus);outline-offset:1px}.mrd-datetime-field__picker-button.sc-mrd-datetime-field:disabled{cursor:not-allowed;opacity:0.5}.mrd-datetime-field__picker-native.sc-mrd-datetime-field{position:absolute;inset:0;width:100%;height:100%;padding:0;border:0;opacity:0;pointer-events:none}.mrd-datetime-field__error.sc-mrd-datetime-field{font-family:var(--mrd-font-family);font-size:var(--mrd-error-font-size);color:var(--mrd-error-color)}`;
234
+ const mrdDatetimeFieldCss = () => `.sc-mrd-datetime-field-h{display:block}.mrd-datetime-field.sc-mrd-datetime-field{display:flex;flex-direction:column;gap:var(--mrd-space-1);width:100%}.mrd-datetime-field__label.sc-mrd-datetime-field{display:block;font-family:var(--mrd-font-family);font-size:var(--mrd-label-font-size);font-weight:var(--mrd-label-font-weight);color:var(--mrd-label-color)}.mrd-datetime-field__label--required.sc-mrd-datetime-field::after{content:" *";color:var(--mrd-color-danger)}.mrd-datetime-field__input.sc-mrd-datetime-field{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x);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);transition:border-color var(--mrd-transition), box-shadow var(--mrd-transition);outline:none;appearance:none;box-sizing:border-box}.mrd-datetime-field__input.sc-mrd-datetime-field::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-datetime-field__input.sc-mrd-datetime-field:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-datetime-field__input.sc-mrd-datetime-field:disabled{background-color:var(--mrd-input-bg-disabled);cursor:not-allowed;opacity:0.7}.mrd-datetime-field__input--error.sc-mrd-datetime-field{border-color:var(--mrd-border-color-error)}.mrd-datetime-field__input--error.sc-mrd-datetime-field:focus{box-shadow:var(--mrd-shadow-focus-error)}.mrd-datetime-field__error.sc-mrd-datetime-field{font-family:var(--mrd-font-family);font-size:var(--mrd-error-font-size);color:var(--mrd-error-color)}.mrd-datetime-field__input.sc-mrd-datetime-field{cursor:pointer}`;
321
235
 
322
236
  const MrdDatetimeField = class {
323
237
  constructor(hostRef) {
@@ -326,72 +240,30 @@ const MrdDatetimeField = class {
326
240
  this.mrdBlur = index.createEvent(this, "mrdBlur");
327
241
  this.name = '';
328
242
  this.label = '';
329
- /** UTC ISO string, e.g. '2026-07-06T12:30:00Z'. */
330
243
  this.value = '';
331
- /** Overrides the locale-derived pattern placeholder (e.g. 'dd-mm-jjjj uu:mm'). */
332
- this.placeholder = '';
333
244
  this.required = false;
334
245
  this.disabled = false;
335
246
  this.locale = navigator.language;
336
- /** What the user sees: the value formatted for `locale`, or their raw typing. */
337
- this.displayValue = '';
338
247
  this.error = '';
339
- /** While focused the user owns the text; prop updates must not overwrite it. */
340
- this.focused = false;
341
- this.handleFocus = () => {
342
- this.focused = true;
343
- };
344
- this.handleInput = (e) => {
345
- this.displayValue = e.target.value;
248
+ this.localValue = '';
249
+ this.handleChange = (e) => {
250
+ const localVal = e.target.value;
251
+ this.localValue = localVal;
252
+ this.error = requiredError(localVal, this.required, this.locale);
253
+ this.mrdChange.emit({ name: this.name, value: this.localToUtc(localVal) });
346
254
  };
347
255
  this.handleBlur = (e) => {
348
- this.focused = false;
349
- const value = this.commit(e.target.value);
350
- this.mrdChange.emit({ name: this.name, value });
351
- this.mrdBlur.emit({ name: this.name, value });
352
- };
353
- this.handleKeyDown = (e) => {
354
- // Submitting with Enter never fires blur, so commit the typed text here too.
355
- if (e.key !== 'Enter')
356
- return;
357
- const value = this.commit(e.target.value);
358
- this.mrdChange.emit({ name: this.name, value });
359
- };
360
- this.openPicker = () => {
361
- const native = this.nativeInput;
362
- if (!native || this.disabled)
363
- return;
364
- // The blur commit that precedes this click re-renders asynchronously, so sync by hand first.
365
- native.value = this.currentLocal();
366
- try {
367
- native.showPicker();
368
- }
369
- catch (_a) {
370
- // Browsers without showPicker(): focusing at least surfaces the platform control.
371
- native.focus();
372
- }
373
- };
374
- this.handlePickerChange = (e) => {
375
- const local = e.target.value; // native inputs always yield 'YYYY-MM-DDTHH:mm'
376
- this.displayValue = cellRenderer.formatLocalDateTime(local, this.locale);
377
- this.error = requiredError(local, this.required, this.locale);
378
- const value = this.localToUtc(local);
379
- this.mrdChange.emit({ name: this.name, value });
380
- this.mrdBlur.emit({ name: this.name, value });
256
+ const localVal = e.target.value;
257
+ this.mrdBlur.emit({ name: this.name, value: this.localToUtc(localVal) });
381
258
  };
382
259
  }
383
260
  componentWillLoad() {
384
- this.displayValue = this.toDisplay(this.value);
261
+ this.localValue = this.utcToLocal(this.value);
385
262
  }
386
263
  valueChanged(newVal) {
387
- if (!this.focused)
388
- this.displayValue = this.toDisplay(newVal);
264
+ this.localValue = this.utcToLocal(newVal);
389
265
  }
390
- localeChanged() {
391
- if (!this.focused)
392
- this.displayValue = this.toDisplay(this.value);
393
- }
394
- // UTC ISO string → "YYYY-MM-DDTHH:mm" in local timezone
266
+ // UTC ISO string → "YYYY-MM-DDTHH:mm" in local timezone (for datetime-local input)
395
267
  utcToLocal(utcStr) {
396
268
  if (!utcStr)
397
269
  return '';
@@ -410,50 +282,12 @@ const MrdDatetimeField = class {
410
282
  return '';
411
283
  return d.toISOString().replace(/\.\d{3}Z$/, 'Z');
412
284
  }
413
- // UTC ISO string → locale-formatted text for the input
414
- toDisplay(utcStr) {
415
- return cellRenderer.formatLocalDateTime(this.utcToLocal(utcStr), this.locale);
416
- }
417
- patternPlaceholder() {
418
- if (this.placeholder)
419
- return this.placeholder;
420
- return cellRenderer.localeDatePattern(this.locale, {
421
- day: cellRenderer.t('date_token_day', this.locale),
422
- month: cellRenderer.t('date_token_month', this.locale),
423
- year: cellRenderer.t('date_token_year', this.locale),
424
- hour: cellRenderer.t('time_token_hour', this.locale),
425
- minute: cellRenderer.t('time_token_minute', this.locale),
426
- });
427
- }
428
- /** Parse the typed text, reformat it, and return the UTC value to emit. */
429
- commit(raw) {
430
- const trimmed = raw.trim();
431
- const local = trimmed ? cellRenderer.parseLocalizedDateTime(trimmed, this.locale) : '';
432
- if (trimmed && local === null) {
433
- // Keep the raw text so the user can correct it instead of retyping.
434
- this.error = cellRenderer.t('invalid_datetime', this.locale);
435
- this.displayValue = trimmed;
436
- return '';
437
- }
438
- const localValue = local !== null && local !== void 0 ? local : '';
439
- this.error = requiredError(localValue, this.required, this.locale);
440
- this.displayValue = localValue ? cellRenderer.formatLocalDateTime(localValue, this.locale) : '';
441
- return this.localToUtc(localValue);
442
- }
443
- /** The local 'YYYY-MM-DDTHH:mm' currently shown, so the picker opens on the right moment. */
444
- currentLocal() {
445
- var _a;
446
- return (_a = (this.displayValue ? cellRenderer.parseLocalizedDateTime(this.displayValue, this.locale) : '')) !== null && _a !== void 0 ? _a : '';
447
- }
448
285
  render() {
449
- return (index.h(index.Host, { key: 'e075e65c76a627a8f19db488c07704e2b1a7270b' }, index.h("div", { key: 'a6b5a5df3168272f1f775933dfc372e1b2ccbd95', class: "mrd-datetime-field" }, index.h(FieldLabel, { key: '39e232c066b8c354eeda7df9bcba4e3f95c18ee5', base: "mrd-datetime-field", label: this.label, required: this.required }), index.h("div", { key: '4ffac4089cbb9e5506aa0854c8b1f15862bc8456', class: "mrd-datetime-field__control" }, index.h("input", { key: 'd33400133173c7f3e8b045339f44fbeba7f0b35a', class: controlClass('mrd-datetime-field', !!this.error), type: "text", name: this.name, value: this.displayValue, placeholder: this.patternPlaceholder(), autocomplete: "off", required: this.required, disabled: this.disabled, onFocus: this.handleFocus, onInput: this.handleInput, onBlur: this.handleBlur, onKeyDown: this.handleKeyDown }), index.h("span", { key: '54d8d3b1f508d6226d1341d87c1fec19d5914a10', class: "mrd-datetime-field__picker" }, index.h("button", { key: '27cd3977984eedd9e3471dd039fc73798f1c7abc', type: "button", class: "mrd-datetime-field__picker-button", title: cellRenderer.t('open_calendar', this.locale), "aria-label": cellRenderer.t('open_calendar', this.locale), disabled: this.disabled, onClick: this.openPicker }, index.h("svg", { key: '634ca817fa001263933795e35e1a215a06da7a77', viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", "stroke-width": "1.5", "aria-hidden": "true" }, index.h("rect", { key: '66eadf6b2cfee53376f6ea0f50dbd2ec04fc5663', x: "3", y: "4.5", width: "14", height: "12", rx: "2" }), index.h("path", { key: '4bb61793e0501bd18bb16c4e203b20f509692970', d: "M3 8.5h14M7 2.5v3M13 2.5v3", "stroke-linecap": "round" }))), index.h("input", { key: '8877da44e4dc527e7c05244359a0caf9d2e81fdd', class: "mrd-datetime-field__picker-native", type: "datetime-local", ref: el => (this.nativeInput = el), value: this.currentLocal(), disabled: this.disabled, tabIndex: -1, "aria-hidden": "true", onChange: this.handlePickerChange }))), index.h(FieldError, { key: '4ee97180614972c4dd334d68873a9fb7f91e48f5', base: "mrd-datetime-field", error: this.error }))));
286
+ return (index.h(index.Host, { key: '6f8020590ac879992058aa9547b90c11250fa303' }, index.h("div", { key: '76abff48cae58d156540181a6577729a449bb888', class: "mrd-datetime-field" }, index.h(FieldLabel, { key: 'a8c3688980347a27d6467987f11a3c4135ac5234', base: "mrd-datetime-field", label: this.label, required: this.required }), index.h("input", { key: '1bb1aa7536a6a82313f51240030c828028cafd76', class: controlClass('mrd-datetime-field', !!this.error), type: "datetime-local", name: this.name, value: this.localValue, required: this.required, disabled: this.disabled, onChange: this.handleChange, onBlur: this.handleBlur }), index.h(FieldError, { key: 'c97301640980bf04311751124fc8e87023d59f87', base: "mrd-datetime-field", error: this.error }))));
450
287
  }
451
288
  static get watchers() { return {
452
289
  "value": [{
453
290
  "valueChanged": 0
454
- }],
455
- "locale": [{
456
- "localeChanged": 0
457
291
  }]
458
292
  }; }
459
293
  };
@@ -1677,7 +1511,7 @@ const MrdEmailField = class {
1677
1511
  };
1678
1512
  }
1679
1513
  render() {
1680
- return (index.h(index.Host, { key: 'e185145e628e3a23dd338d93dd8e42bf11569728' }, index.h("div", { key: '7d77dd982543a8add5fa1f47aa7985cc15079080', class: "mrd-email-field" }, index.h(FieldLabel, { key: '14eb00a535a052ebe3cb2793cc7dfc05168c402b', base: "mrd-email-field", label: this.label, required: this.required }), index.h("input", { key: '11fb9856144f7da30a054b4433350d80d316de64', class: controlClass('mrd-email-field', !!this.error), type: "email", name: this.name, value: this.value, placeholder: this.placeholder || 'name@example.com', required: this.required, disabled: this.disabled, onInput: this.handleInput, onBlur: this.handleBlur }), index.h(FieldError, { key: 'be33c0a43cd99a7152c1d10b7067ea5e52834742', base: "mrd-email-field", error: this.error }))));
1514
+ return (index.h(index.Host, { key: '3253124dadc7f0b3f120c11f8c35604a2f671b0a' }, index.h("div", { key: 'db820652452145c30f21b41a65942c0a4c6f45f1', class: "mrd-email-field" }, index.h(FieldLabel, { key: '8b1c5a84afce9fd18c3f644e5c92f07363e116d4', base: "mrd-email-field", label: this.label, required: this.required }), index.h("input", { key: 'dc4bada3208aa6cb7585b1872f53605177371493', class: controlClass('mrd-email-field', !!this.error), type: "email", name: this.name, value: this.value, placeholder: this.placeholder || 'name@example.com', required: this.required, disabled: this.disabled, onInput: this.handleInput, onBlur: this.handleBlur }), index.h(FieldError, { key: 'c44377d1b6a4a4c468b080b23eecd4ba9ca326e1', base: "mrd-email-field", error: this.error }))));
1681
1515
  }
1682
1516
  };
1683
1517
  MrdEmailField.style = mrdEmailFieldCss();
@@ -4310,7 +4144,7 @@ const MrdField = class {
4310
4144
  return (index.h("div", { class: "mrd-field__history-editor" }, this.historyEntries.length > 0 && (index.h("span", { class: "mrd-field__history-editor-label" }, cellRenderer.t('history_badge_tooltip', locale))), this.historyEntries.map((entry, i) => (index.h("div", { key: String(i), class: "mrd-field__history-editor-row" }, index.h("input", { class: "mrd-field__history-editor-value", type: valueType, value: entry.value, onInput: (e) => updateEntry(i, 'value', e.target.value) }), index.h("span", { class: "mrd-field__history-editor-sep" }, cellRenderer.t('history_until', locale)), index.h("input", { class: "mrd-field__history-editor-until", type: "date", value: entry.until, onInput: (e) => updateEntry(i, 'until', e.target.value) }), index.h("button", { type: "button", class: "mrd-field__history-editor-remove", onClick: () => removeEntry(i), "aria-label": cellRenderer.t('remove', locale) }, index.h("svg", { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true" }, index.h("path", { "fill-rule": "evenodd", d: "M8.75 1A2.75 2.75 0 006 3.75v.443c-.795.077-1.584.176-2.365.298a.75.75 0 10.23 1.482l.149-.022.841 10.518A2.75 2.75 0 007.596 19h4.807a2.75 2.75 0 002.742-2.53l.841-10.52.149.023a.75.75 0 00.23-1.482A41.03 41.03 0 0014 4.193V3.75A2.75 2.75 0 0011.25 1h-2.5zM10 4c.84 0 1.673.025 2.5.075V3.75c0-.69-.56-1.25-1.25-1.25h-2.5c-.69 0-1.25.56-1.25 1.25v.325C8.327 4.025 9.16 4 10 4zM8.58 7.72a.75.75 0 00-1.5.06l.3 7.5a.75.75 0 101.5-.06l-.3-7.5zm4.34.06a.75.75 0 10-1.5-.06l-.3 7.5a.75.75 0 101.5.06l.3-7.5z", "clip-rule": "evenodd" })))))), index.h("button", { type: "button", class: "mrd-field__history-editor-add", onClick: addEntry }, "+ ", cellRenderer.t('add', locale))));
4311
4145
  }
4312
4146
  renderLeafField(displayValue) {
4313
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8;
4147
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6;
4314
4148
  const { item, locale } = this;
4315
4149
  const commonProps = {
4316
4150
  name: item.name,
@@ -4335,25 +4169,25 @@ const MrdField = class {
4335
4169
  case clientLayout.ClientLayoutItemFieldDataType.BOOLEAN:
4336
4170
  return (index.h("mrd-boolean-field", Object.assign({}, commonProps, { value: (_l = displayValue) !== null && _l !== void 0 ? _l : false })));
4337
4171
  case clientLayout.ClientLayoutItemFieldDataType.DATE:
4338
- return (index.h("mrd-date-field", Object.assign({}, commonProps, { value: (_m = displayValue) !== null && _m !== void 0 ? _m : '', placeholder: (_o = item.placeholder) !== null && _o !== void 0 ? _o : '' })));
4172
+ return (index.h("mrd-date-field", Object.assign({}, commonProps, { value: (_m = displayValue) !== null && _m !== void 0 ? _m : '' })));
4339
4173
  case clientLayout.ClientLayoutItemFieldDataType.DATETIME:
4340
- return (index.h("mrd-datetime-field", Object.assign({}, commonProps, { value: (_p = displayValue) !== null && _p !== void 0 ? _p : '', placeholder: (_q = item.placeholder) !== null && _q !== void 0 ? _q : '' })));
4174
+ return (index.h("mrd-datetime-field", Object.assign({}, commonProps, { value: (_o = displayValue) !== null && _o !== void 0 ? _o : '' })));
4341
4175
  case clientLayout.ClientLayoutItemFieldDataType.TIME:
4342
- return (index.h("mrd-time-field", Object.assign({}, commonProps, { value: (_r = displayValue) !== null && _r !== void 0 ? _r : '' })));
4176
+ return (index.h("mrd-time-field", Object.assign({}, commonProps, { value: (_p = displayValue) !== null && _p !== void 0 ? _p : '' })));
4343
4177
  case clientLayout.ClientLayoutItemFieldDataType.EMAIL:
4344
- return (index.h("mrd-email-field", Object.assign({}, commonProps, { value: (_s = displayValue) !== null && _s !== void 0 ? _s : '', placeholder: (_t = item.placeholder) !== null && _t !== void 0 ? _t : '' })));
4178
+ return (index.h("mrd-email-field", Object.assign({}, commonProps, { value: (_q = displayValue) !== null && _q !== void 0 ? _q : '', placeholder: (_r = item.placeholder) !== null && _r !== void 0 ? _r : '' })));
4345
4179
  case clientLayout.ClientLayoutItemFieldDataType.HYPERLINK:
4346
- return (index.h("mrd-hyperlink-field", Object.assign({}, commonProps, { value: (_u = displayValue) !== null && _u !== void 0 ? _u : '', placeholder: (_v = item.placeholder) !== null && _v !== void 0 ? _v : '' })));
4180
+ return (index.h("mrd-hyperlink-field", Object.assign({}, commonProps, { value: (_s = displayValue) !== null && _s !== void 0 ? _s : '', placeholder: (_t = item.placeholder) !== null && _t !== void 0 ? _t : '' })));
4347
4181
  case clientLayout.ClientLayoutItemFieldDataType.LIST:
4348
- return (index.h("mrd-list-field", Object.assign({}, commonProps, { value: (_w = displayValue) !== null && _w !== void 0 ? _w : '', multiple: (_x = item.multiple) !== null && _x !== void 0 ? _x : false, listItems: (_y = item.listItems) !== null && _y !== void 0 ? _y : [] })));
4182
+ return (index.h("mrd-list-field", Object.assign({}, commonProps, { value: (_u = displayValue) !== null && _u !== void 0 ? _u : '', multiple: (_v = item.multiple) !== null && _v !== void 0 ? _v : false, listItems: (_w = item.listItems) !== null && _w !== void 0 ? _w : [] })));
4349
4183
  case clientLayout.ClientLayoutItemFieldDataType.FILE:
4350
- return (index.h("mrd-file-field", Object.assign({}, commonProps, { value: displayValue, accept: (_z = item.accept) !== null && _z !== void 0 ? _z : '', maxSize: (_0 = item.maxSize) !== null && _0 !== void 0 ? _0 : 0, multiple: (_1 = item.multiple) !== null && _1 !== void 0 ? _1 : false, onMrdUpload: this.handleUpload })));
4184
+ return (index.h("mrd-file-field", Object.assign({}, commonProps, { value: displayValue, accept: (_x = item.accept) !== null && _x !== void 0 ? _x : '', maxSize: (_y = item.maxSize) !== null && _y !== void 0 ? _y : 0, multiple: (_z = item.multiple) !== null && _z !== void 0 ? _z : false, onMrdUpload: this.handleUpload })));
4351
4185
  case clientLayout.ClientLayoutItemFieldDataType.IMAGE:
4352
- return (index.h("mrd-image-field", Object.assign({}, commonProps, { value: displayValue, accept: (_2 = item.accept) !== null && _2 !== void 0 ? _2 : 'image/*', maxSize: (_3 = item.maxSize) !== null && _3 !== void 0 ? _3 : 0, multiple: (_4 = item.multiple) !== null && _4 !== void 0 ? _4 : false, onMrdUpload: this.handleUpload })));
4186
+ return (index.h("mrd-image-field", Object.assign({}, commonProps, { value: displayValue, accept: (_0 = item.accept) !== null && _0 !== void 0 ? _0 : 'image/*', maxSize: (_1 = item.maxSize) !== null && _1 !== void 0 ? _1 : 0, multiple: (_2 = item.multiple) !== null && _2 !== void 0 ? _2 : false, onMrdUpload: this.handleUpload })));
4353
4187
  case clientLayout.ClientLayoutItemFieldDataType.LONGTEXT:
4354
- return (index.h("mrd-longtext-field", Object.assign({}, commonProps, { value: (_5 = displayValue) !== null && _5 !== void 0 ? _5 : '', placeholder: (_6 = item.placeholder) !== null && _6 !== void 0 ? _6 : '' })));
4188
+ return (index.h("mrd-longtext-field", Object.assign({}, commonProps, { value: (_3 = displayValue) !== null && _3 !== void 0 ? _3 : '', placeholder: (_4 = item.placeholder) !== null && _4 !== void 0 ? _4 : '' })));
4355
4189
  case clientLayout.ClientLayoutItemFieldDataType.SECRET:
4356
- return (index.h("mrd-secret-field", Object.assign({}, commonProps, { value: (_7 = displayValue) !== null && _7 !== void 0 ? _7 : '', placeholder: (_8 = item.placeholder) !== null && _8 !== void 0 ? _8 : '' })));
4190
+ return (index.h("mrd-secret-field", Object.assign({}, commonProps, { value: (_5 = displayValue) !== null && _5 !== void 0 ? _5 : '', placeholder: (_6 = item.placeholder) !== null && _6 !== void 0 ? _6 : '' })));
4357
4191
  default:
4358
4192
  return null;
4359
4193
  }
@@ -4549,7 +4383,7 @@ const MrdFileField = class {
4549
4383
  error: hasError,
4550
4384
  disabled: this.disabled || this.zoneBusy,
4551
4385
  });
4552
- return (index.h(index.Host, { key: '36f9660fd297e7b2e7b2ac1816f4dcbc70d5cfcb' }, index.h("div", { key: 'a33534d3fedae04bad0eefc9d2d297ea148c5784', class: "mrd-file-field" }, index.h(FieldLabel, { key: '833f8ff178ec259c8066ddf542bdd1930bac486f', base: "mrd-file-field", label: this.label, required: this.required }), index.h("div", { key: 'd3bd00b25329b8cc716c5fcc526919d8f2c14bce', class: zoneClass, onClick: this.handleZoneClick, onDragOver: this.drag.onDragOver, onDragLeave: this.drag.onDragLeave, onDrop: this.drag.onDrop }, index.h("input", { key: '4b98ee338e8a5e4e6f94e5b5614ca88c90f802ee', ref: el => (this.fileInputRef = el), class: "mrd-file-field__input", type: "file", name: this.name, accept: this.accept, multiple: this.multiple, disabled: this.disabled || this.zoneBusy, required: this.required && !hasEntries, onChange: this.handleInputChange }), hasEntries && !this.multiple ? (index.h("div", { class: "mrd-file-field__selected" }, this.renderEntry(this.entries[0], 0))) : (index.h("div", { class: "mrd-file-field__prompt" }, index.h("svg", { class: "mrd-file-field__upload-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, index.h("polyline", { points: "16 16 12 12 8 16" }), index.h("line", { x1: "12", y1: "12", x2: "12", y2: "21" }), index.h("path", { d: "M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3" })), index.h("span", null, cellRenderer.t('drop_file_here', this.locale), ' ', index.h("span", { class: "mrd-file-field__browse" }, cellRenderer.t('browse', this.locale)))))), this.multiple && hasEntries && (index.h("ul", { key: '6e6e1d62738d0a824eb86e0dbb01b63a0227580d', class: "mrd-file-field__list" }, this.entries.map((entry, index$1) => (index.h("li", { class: "mrd-file-field__item", key: `${index$1}-${entryLabel(entry)}` }, this.renderEntry(entry, index$1)))))), index.h(FieldError, { key: 'df6427015d3f813a72e8998f9fa6152f6caef90e', base: "mrd-file-field", error: this.error }))));
4386
+ return (index.h(index.Host, { key: '2e740a0857b069740a6a13616d0a0dfee2b945be' }, index.h("div", { key: '069b25ced3b2f1ce547819086dadbd53ade2378c', class: "mrd-file-field" }, index.h(FieldLabel, { key: 'd13f3cb0af766d6328772dab865b2079c85ec075', base: "mrd-file-field", label: this.label, required: this.required }), index.h("div", { key: '9ffdbb508e3934854034c46e6f719a88d4175920', class: zoneClass, onClick: this.handleZoneClick, onDragOver: this.drag.onDragOver, onDragLeave: this.drag.onDragLeave, onDrop: this.drag.onDrop }, index.h("input", { key: 'c5d6954b8fa050889b5b65e15fde229dd64d7cc7', ref: el => (this.fileInputRef = el), class: "mrd-file-field__input", type: "file", name: this.name, accept: this.accept, multiple: this.multiple, disabled: this.disabled || this.zoneBusy, required: this.required && !hasEntries, onChange: this.handleInputChange }), hasEntries && !this.multiple ? (index.h("div", { class: "mrd-file-field__selected" }, this.renderEntry(this.entries[0], 0))) : (index.h("div", { class: "mrd-file-field__prompt" }, index.h("svg", { class: "mrd-file-field__upload-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, index.h("polyline", { points: "16 16 12 12 8 16" }), index.h("line", { x1: "12", y1: "12", x2: "12", y2: "21" }), index.h("path", { d: "M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3" })), index.h("span", null, cellRenderer.t('drop_file_here', this.locale), ' ', index.h("span", { class: "mrd-file-field__browse" }, cellRenderer.t('browse', this.locale)))))), this.multiple && hasEntries && (index.h("ul", { key: '910a3e89f74d93ab16fb9f677a4276d5ad88897d', class: "mrd-file-field__list" }, this.entries.map((entry, index$1) => (index.h("li", { class: "mrd-file-field__item", key: `${index$1}-${entryLabel(entry)}` }, this.renderEntry(entry, index$1)))))), index.h(FieldError, { key: '4f0f071b0a1460ea1d6067a8fa4f588ebc620f2a', base: "mrd-file-field", error: this.error }))));
4553
4387
  }
4554
4388
  static get watchers() { return {
4555
4389
  "value": [{
@@ -5177,7 +5011,7 @@ const MrdImageField = class {
5177
5011
  error: hasError,
5178
5012
  disabled: this.disabled || this.zoneBusy,
5179
5013
  });
5180
- return (index.h(index.Host, { key: '5009b2db845c8f85f395c7230e2d5c464c56ea14' }, index.h("div", { key: 'fcae7821876ee3d71aac576cdea44c3c4f169890', class: "mrd-image-field" }, index.h(FieldLabel, { key: '834638e3f7b2073508d98b6dd5ecb437b0bb52ad', base: "mrd-image-field", label: this.label, required: this.required }), index.h("div", { key: '50e9bdaa1ebb3ec87f36e0d37dc6c2f8dc79848d', class: zoneClass, onClick: this.handleZoneClick, onDragOver: this.drag.onDragOver, onDragLeave: this.drag.onDragLeave, onDrop: this.drag.onDrop }, index.h("input", { key: '38e115fae5b3e2c3371857d284fbd54ea23812df', ref: el => (this.fileInputRef = el), class: "mrd-image-field__input", type: "file", name: this.name, accept: this.accept, multiple: this.multiple, disabled: this.disabled || this.zoneBusy, required: this.required && !hasEntries, onChange: this.handleInputChange }), hasEntries && !this.multiple ? (this.renderSingle(this.entries[0])) : (index.h("div", { class: "mrd-image-field__prompt" }, index.h("svg", { class: "mrd-image-field__upload-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, index.h("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }), index.h("circle", { cx: "8.5", cy: "8.5", r: "1.5" }), index.h("polyline", { points: "21 15 16 10 5 21" })), index.h("span", null, cellRenderer.t('drop_file_here', this.locale), ' ', index.h("span", { class: "mrd-image-field__browse" }, cellRenderer.t('browse', this.locale)))))), this.multiple && hasEntries && (index.h("ul", { key: '67bad2f2142f78d7f25b8f35819b6adba48ea597', class: "mrd-image-field__grid" }, this.entries.map((entry, index) => this.renderGridItem(entry, index)))), index.h(FieldError, { key: 'ef07863946f0b4c94aa30b97d0ecb9616303e793', base: "mrd-image-field", error: this.error }))));
5014
+ return (index.h(index.Host, { key: '51d39ea80195565a5dc780ff6a7923a976cfb0a7' }, index.h("div", { key: 'd76edb7ac9f1efea8c7c3d5b04e906ad4ab4c761', class: "mrd-image-field" }, index.h(FieldLabel, { key: 'b46a67a76188047677c40ce3f406daed7d8de141', base: "mrd-image-field", label: this.label, required: this.required }), index.h("div", { key: '0156a9722ea48d84e3ea1a829e4266425a594a6a', class: zoneClass, onClick: this.handleZoneClick, onDragOver: this.drag.onDragOver, onDragLeave: this.drag.onDragLeave, onDrop: this.drag.onDrop }, index.h("input", { key: '1b8e41da71bb57254bfd2e5527b05e1aeb32eb2f', ref: el => (this.fileInputRef = el), class: "mrd-image-field__input", type: "file", name: this.name, accept: this.accept, multiple: this.multiple, disabled: this.disabled || this.zoneBusy, required: this.required && !hasEntries, onChange: this.handleInputChange }), hasEntries && !this.multiple ? (this.renderSingle(this.entries[0])) : (index.h("div", { class: "mrd-image-field__prompt" }, index.h("svg", { class: "mrd-image-field__upload-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, index.h("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }), index.h("circle", { cx: "8.5", cy: "8.5", r: "1.5" }), index.h("polyline", { points: "21 15 16 10 5 21" })), index.h("span", null, cellRenderer.t('drop_file_here', this.locale), ' ', index.h("span", { class: "mrd-image-field__browse" }, cellRenderer.t('browse', this.locale)))))), this.multiple && hasEntries && (index.h("ul", { key: '9211b5212eae0629f7c9b2b49d80e2b658a9ddd3', class: "mrd-image-field__grid" }, this.entries.map((entry, index) => this.renderGridItem(entry, index)))), index.h(FieldError, { key: '5f49c03156ed18e7c8307adff679b149658ca4a6', base: "mrd-image-field", error: this.error }))));
5181
5015
  }
5182
5016
  static get watchers() { return {
5183
5017
  "value": [{
@@ -5282,7 +5116,7 @@ const MrdInvoiceView = class {
5282
5116
  const invoiceDateRaw = this.slotValue('invoiceDate');
5283
5117
  const dueDateRaw = this.slotValue('dueDate');
5284
5118
  const hasLines = !!((_b = (_a = this.archetype) === null || _a === void 0 ? void 0 : _a.slots) === null || _b === void 0 ? void 0 : _b['lines']);
5285
- return (index.h(index.Host, { key: '8005640e6d13004ae2fdf5f48129214fbc8c55fc' }, index.h("div", { key: '992f925691e2455c8888df76f93176cec5866210', class: "mrd-invoice-view" }, index.h("div", { key: 'aa418658cfe830be4e0f8bf77af42a898c9170db', class: "mrd-invoice-view__header" }, index.h("div", { key: 'ce10fef2072c26a0eb8f7ead620cb460af6646f0', class: "mrd-invoice-view__title-row" }, invoiceNumber && index.h("h1", { key: '992486cd5dc0bfb9761bdc94bcd237e6bd6e3d24', class: "mrd-invoice-view__title" }, cellRenderer.t('invoice_title', this.locale), " ", invoiceNumber), this.renderStatus()), index.h("div", { key: 'a8c5d2516b737d4dcd5d0f966aadcda4d47a63ad', class: "mrd-invoice-view__dates" }, invoiceDateRaw != null && invoiceDateRaw !== '' && (index.h("span", { key: 'dd728929fc408c280ad81e212bdfac5905cda02d' }, cellRenderer.t('invoice_date', this.locale), ": ", cellRenderer.formatDate(invoiceDateRaw, this.locale))), dueDateRaw != null && dueDateRaw !== '' && (index.h("span", { key: 'd4226d5cc37f0152950f44a3b63a88f0454919bd' }, cellRenderer.t('invoice_due_date', this.locale), ": ", cellRenderer.formatDate(dueDateRaw, this.locale)))), this.renderContainer()), index.h("div", { key: 'c40b00c852d005963be7b5006e13804e72ba032a', class: "mrd-invoice-view__parties" }, this.renderPartyLink('customer', cellRenderer.t('invoice_customer', this.locale)), this.renderPartyLink('supplier', cellRenderer.t('invoice_supplier', this.locale))), hasLines && (index.h("div", { key: '000e991c64daa582194631b2eac6b1acba418e97', class: "mrd-invoice-view__lines" }, index.h("slot", { key: '97ba2acb750137eeb5ed6b5e9e5d277f638d4f0a', name: "lines" }))), this.renderAmounts(), this.renderAttachments())));
5119
+ return (index.h(index.Host, { key: 'a97c51e53e39ace913c902ad2ba6813eb85e4561' }, index.h("div", { key: '6938267848bceed5b28b56c3cdd6d6693e57cdbf', class: "mrd-invoice-view" }, index.h("div", { key: '7a0b3346232abfc1e35805e4e92c19d35698f881', class: "mrd-invoice-view__header" }, index.h("div", { key: '5c0471dd8ebd94dd9b374897268c7c03bec66ec7', class: "mrd-invoice-view__title-row" }, invoiceNumber && index.h("h1", { key: '86b4c0ebd0a5b83ae03b731b7e41394645aae954', class: "mrd-invoice-view__title" }, cellRenderer.t('invoice_title', this.locale), " ", invoiceNumber), this.renderStatus()), index.h("div", { key: 'd209bc34d989146b5f510f2bcdc4c484d723378c', class: "mrd-invoice-view__dates" }, invoiceDateRaw != null && invoiceDateRaw !== '' && (index.h("span", { key: '8fffcd1ab10e511c9d939c351ea93e4d8a902688' }, cellRenderer.t('invoice_date', this.locale), ": ", cellRenderer.formatDate(invoiceDateRaw, this.locale))), dueDateRaw != null && dueDateRaw !== '' && (index.h("span", { key: '8d13c6660798108cc2f54137c8415173326d5bf2' }, cellRenderer.t('invoice_due_date', this.locale), ": ", cellRenderer.formatDate(dueDateRaw, this.locale)))), this.renderContainer()), index.h("div", { key: 'cb08c6fd7e6b46a46a69f11aafa960ab5cb35544', class: "mrd-invoice-view__parties" }, this.renderPartyLink('customer', cellRenderer.t('invoice_customer', this.locale)), this.renderPartyLink('supplier', cellRenderer.t('invoice_supplier', this.locale))), hasLines && (index.h("div", { key: '8321e74171fe933a4e10fc202b66cd3720ba959e', class: "mrd-invoice-view__lines" }, index.h("slot", { key: 'eb31d97080173413e74e5b0024984a4b06aa5bdd', name: "lines" }))), this.renderAmounts(), this.renderAttachments())));
5286
5120
  }
5287
5121
  static get watchers() { return {
5288
5122
  "data": [{
@@ -5810,7 +5644,7 @@ const MrdLayoutSection = class {
5810
5644
  const docArchetype = clientLayout.resolveArchetype(this.archetypes, clientLayout.ARCHETYPE_DOCUMENT);
5811
5645
  const invoiceArchetype = !docArchetype ? clientLayout.resolveArchetype(this.archetypes, clientLayout.ARCHETYPE_INVOICE) : undefined;
5812
5646
  const emailArchetype = !docArchetype && !invoiceArchetype ? clientLayout.resolveArchetype(this.archetypes, clientLayout.ARCHETYPE_EMAIL) : undefined;
5813
- return (index.h(index.Host, { key: '8c4e0a0e71d777295010702584b4aa8f7817cafb' }, index.h("div", { key: 'fe021021eba48acad3d52ee4849ebe355e83c348', class: "mrd-layout-section" }, docArchetype && this.renderDocumentObject(docArchetype), invoiceArchetype && this.renderInvoiceObject(invoiceArchetype), emailArchetype && this.renderEmailObject(emailArchetype), !docArchetype && !invoiceArchetype && !emailArchetype && this.items.map(item => this.renderItem(item))), this.renderImageModal()));
5647
+ return (index.h(index.Host, { key: 'ccae8e82b4dd549ab24239fe685a6830a508061d' }, index.h("div", { key: '4072cc4ecdd2b087c54a5515e653f7f713b2150f', class: "mrd-layout-section" }, docArchetype && this.renderDocumentObject(docArchetype), invoiceArchetype && this.renderInvoiceObject(invoiceArchetype), emailArchetype && this.renderEmailObject(emailArchetype), !docArchetype && !invoiceArchetype && !emailArchetype && this.items.map(item => this.renderItem(item))), this.renderImageModal()));
5814
5648
  }
5815
5649
  get el() { return index.getElement(this); }
5816
5650
  static get watchers() { return {
@@ -5929,7 +5763,7 @@ const MrdLongtextField = class {
5929
5763
  };
5930
5764
  }
5931
5765
  render() {
5932
- return (index.h(index.Host, { key: 'a43ce67cb05e96853193e56c175d99e51d07cbab' }, index.h("div", { key: 'eb7d09bcae010736dd17b5f17bcb1cb32a6b1c4e', class: "mrd-longtext-field" }, index.h(FieldLabel, { key: 'd3a47993cc977c06b845eda4575b93d238eaf15a', base: "mrd-longtext-field", label: this.label, required: this.required }), this.disabled ? (index.h("pre", { class: "mrd-longtext-field__content" }, this.value)) : (index.h("textarea", { class: controlClass('mrd-longtext-field', !!this.error), name: this.name, placeholder: this.placeholder, required: this.required, rows: 10, onInput: this.handleInput, onBlur: this.handleBlur }, this.value)), index.h(FieldError, { key: '89f801af61fc0b874db44dbfca6eb33ffe285a84', base: "mrd-longtext-field", error: this.error }))));
5766
+ return (index.h(index.Host, { key: 'e53fec4d4eafbd68d9cffb1f064d8e0c4c37839c' }, index.h("div", { key: '8843a23e42b0545c269fc6c924e7ae295770064e', class: "mrd-longtext-field" }, index.h(FieldLabel, { key: '8767676dd35f25f9bf5ebdb26887edc0882582e0', base: "mrd-longtext-field", label: this.label, required: this.required }), this.disabled ? (index.h("pre", { class: "mrd-longtext-field__content" }, this.value)) : (index.h("textarea", { class: controlClass('mrd-longtext-field', !!this.error), name: this.name, placeholder: this.placeholder, required: this.required, rows: 10, onInput: this.handleInput, onBlur: this.handleBlur }, this.value)), index.h(FieldError, { key: '54dc790173575e8a02764e5b14040b900c2eb609', base: "mrd-longtext-field", error: this.error }))));
5933
5767
  }
5934
5768
  };
5935
5769
  MrdLongtextField.style = mrdLongtextFieldCss();
@@ -6021,7 +5855,7 @@ const MrdNumberField = class {
6021
5855
  const hasError = !!this.error;
6022
5856
  const suffix = this.dataType === clientLayout.ClientLayoutItemFieldDataType.PERCENTAGE ? '%' :
6023
5857
  this.dataType === clientLayout.ClientLayoutItemFieldDataType.DECIMAL ? '' : '';
6024
- return (index.h(index.Host, { key: 'bd5eb25cf7b97ef2ddb67a6bc6d6d96c9bff7510' }, index.h("div", { key: '68b15887a045f743a7f177e7a178146a9f4e0400', class: "mrd-number-field" }, index.h(FieldLabel, { key: '72e88a34a390e36ee11f5840d87dedd9d4d7fb12', base: "mrd-number-field", label: this.label, required: this.required }), index.h("div", { key: 'd97dae69eedf4c0ed1c872065754327dbffb5ba7', class: "mrd-number-field__input-wrapper" }, index.h("input", { key: '5767f6c34a08f503a1a157390c679382c857ff01', class: controlClass('mrd-number-field', hasError), type: "text", inputMode: "decimal", name: this.name, value: this.displayValue, placeholder: this.placeholder || (suffix ? `0${suffix}` : '0'), required: this.required, disabled: this.disabled, onInput: this.handleInput, onBlur: this.handleBlur, onFocus: this.handleFocus })), index.h(FieldError, { key: '1d4f8ffd3fcdf2ae2e8eb1eb68c051619d66c954', base: "mrd-number-field", error: this.error }))));
5858
+ return (index.h(index.Host, { key: '7343dbca882b5054f22de17672ac748a8e3eca11' }, index.h("div", { key: 'cef10b39515b48fc9c44e651910c6a0c2a847628', class: "mrd-number-field" }, index.h(FieldLabel, { key: '66f178cf20f1f2f0587bd9614db150d6ae63023e', base: "mrd-number-field", label: this.label, required: this.required }), index.h("div", { key: 'c57c22e663a570f6e5a70b07b817970f135e850c', class: "mrd-number-field__input-wrapper" }, index.h("input", { key: '388b20ac11fa4aaf78df124c858b579e12f53619', class: controlClass('mrd-number-field', hasError), type: "text", inputMode: "decimal", name: this.name, value: this.displayValue, placeholder: this.placeholder || (suffix ? `0${suffix}` : '0'), required: this.required, disabled: this.disabled, onInput: this.handleInput, onBlur: this.handleBlur, onFocus: this.handleFocus })), index.h(FieldError, { key: 'f99bb85668b047a97162ffee2582eb45dc0589ae', base: "mrd-number-field", error: this.error }))));
6025
5859
  }
6026
5860
  static get watchers() { return {
6027
5861
  "value": [{
@@ -6317,9 +6151,9 @@ const MrdSecretField = class {
6317
6151
  };
6318
6152
  }
6319
6153
  render() {
6320
- return (index.h(index.Host, { key: 'd3d204242898c1f258b088e7b5428421cde8d7a7' }, index.h("div", { key: '11d284625cdd1e0def58cc31eab9bbe59346649d', class: "mrd-secret-field" }, index.h(FieldLabel, { key: '333e5b23d2379125a393f555b936be7bc521fdb4', base: "mrd-secret-field", label: this.label, required: this.required }), this.disabled
6154
+ return (index.h(index.Host, { key: 'e06d04fdae34b42441976e21605fe94ad935382e' }, index.h("div", { key: '2889e1eb1b6d0887ae531523a0b9b43c49ef6f99', class: "mrd-secret-field" }, index.h(FieldLabel, { key: 'c40907905292cdef8bb0b8b9b0c03e05650bef37', base: "mrd-secret-field", label: this.label, required: this.required }), this.disabled
6321
6155
  ? (index.h("span", { class: "mrd-secret-field__masked", "aria-label": this.label }, this.value ? '••••••••' : ''))
6322
- : (index.h("input", { class: controlClass('mrd-secret-field', !!this.error), type: "password", name: this.name, value: this.value, placeholder: this.placeholder, required: this.required, autocomplete: "new-password", onInput: this.handleInput, onBlur: this.handleBlur })), index.h(FieldError, { key: 'cc202197fdab62da7b5083e078e69efd86e673ca', base: "mrd-secret-field", error: this.error }))));
6156
+ : (index.h("input", { class: controlClass('mrd-secret-field', !!this.error), type: "password", name: this.name, value: this.value, placeholder: this.placeholder, required: this.required, autocomplete: "new-password", onInput: this.handleInput, onBlur: this.handleBlur })), index.h(FieldError, { key: '6353e4b40566852dbc1994c7c9c409d0d0aa1b37', base: "mrd-secret-field", error: this.error }))));
6323
6157
  }
6324
6158
  };
6325
6159
  MrdSecretField.style = mrdSecretFieldCss();
@@ -6541,7 +6375,10 @@ const TableCell = ({ col, row, locale, onDownload, onOpenTextblock, onOpenJson }
6541
6375
  return (index.h("td", { class: "mrd-table__cell" }, preview, index.h("button", { class: "mrd-table__textblock-btn", onClick: (e) => { e.stopPropagation(); onOpenTextblock(full); }, "aria-label": cellRenderer.t('textblock_show_more', locale) }, "\u22EF")));
6542
6376
  }
6543
6377
  const value = cellRenderer.CellRenderer.render(col, row, locale);
6544
- return (index.h("td", { class: `mrd-table__cell${isNumeric ? ' mrd-table__cell--numeric' : ''}` }, value));
6378
+ return (
6379
+ // title: columns are locked to the width measured on page 0, so a longer value on a
6380
+ // later page is ellipsised rather than widening the column — the tooltip keeps it readable.
6381
+ index.h("td", { class: `mrd-table__cell${isNumeric ? ' mrd-table__cell--numeric' : ''}`, title: value || undefined }, value));
6545
6382
  };
6546
6383
  /** Formats the aggregation total for one column, '' when not applicable. */
6547
6384
  function formatAggregationValue(col, aggregations, locale) {
@@ -6583,11 +6420,11 @@ const JsonModal = ({ html, locale, onClose }) => {
6583
6420
  return null;
6584
6421
  return (index.h("div", { class: "mrd-table__modal-backdrop", onClick: onClose, role: "dialog", "aria-modal": "true" }, index.h("div", { class: "mrd-table__modal", onClick: (e) => e.stopPropagation() }, index.h("button", { class: "mrd-table__modal-close", onClick: onClose, "aria-label": cellRenderer.t('close', locale) }, "\u2715"), index.h("pre", { class: "mrd-table__modal-json", innerHTML: html }))));
6585
6422
  };
6586
- const Toolbar = ({ locale, filterMode, filterCount, actions, views, activeViewIdx, viewPopoverOpen, createPickerOpen, createTypes, cb }) => {
6423
+ const Toolbar = ({ locale, filterCount, actions, views, activeViewIdx, viewPopoverOpen, createPickerOpen, createTypes, cb }) => {
6587
6424
  var _a;
6588
6425
  const hasActions = actions.length > 0;
6589
6426
  const hasViewSwitcher = views.length > 1;
6590
- return (index.h("div", { class: "mrd-table__toolbar" }, index.h("div", { class: "mrd-table__toolbar-left" }, index.h("button", { class: `mrd-table__action mrd-table__action--secondary mrd-table__filter-toggle${filterMode ? ' mrd-table__filter-toggle--active' : ''}`, onClick: cb.onFilterToggle }, index.h("svg", { class: "mrd-table__action-icon", viewBox: "0 0 24 24", "aria-hidden": "true" }, index.h("path", { fill: "currentColor", d: "M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z" })), filterCount > 0 && index.h("span", { class: "mrd-table__filter-badge" }, filterCount), index.h("span", { class: "mrd-table__action-tooltip" }, filterMode ? cellRenderer.t('table_filter_hide', locale) : cellRenderer.t('table_filter', locale), filterCount > 0 ? ` (${filterCount} ${cellRenderer.t('table_filter_active', locale)})` : '')), filterCount > 0 && (index.h("button", { class: "mrd-table__action mrd-table__action--secondary", onClick: cb.onClearAllFilters }, index.h("svg", { class: "mrd-table__action-icon", viewBox: "0 0 24 24", "aria-hidden": "true" }, index.h("path", { fill: "currentColor", d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" })), index.h("span", { class: "mrd-table__action-tooltip" }, cellRenderer.t('table_filter_clear_all', locale))))), hasViewSwitcher && (index.h("div", { class: "mrd-table__toolbar-center" }, index.h("div", { class: "mrd-table__view-switcher" }, index.h("button", { class: "mrd-table__view-arrow", "aria-label": "Previous view", onClick: () => cb.onViewSwitch((activeViewIdx - 1 + views.length) % views.length) }, "\u25C0"), index.h("div", { class: "mrd-table__view-title-wrap" }, index.h("button", { class: "mrd-table__view-title", onClick: (e) => cb.onToggleViewPopover(e) }, (_a = views[activeViewIdx]) === null || _a === void 0 ? void 0 : _a.label), viewPopoverOpen && (index.h("div", { class: "mrd-table__view-popover", onClick: (e) => e.stopPropagation() }, views.map((v, i) => (index.h("button", { key: String(i), class: `mrd-table__view-popover-item${i === activeViewIdx ? ' mrd-table__view-popover-item--active' : ''}`, onClick: () => {
6427
+ return (index.h("div", { class: "mrd-table__toolbar" }, index.h("div", { class: "mrd-table__toolbar-left" }, filterCount > 0 && (index.h("button", { class: "mrd-table__action mrd-table__action--secondary mrd-table__filter-clear", onClick: cb.onClearAllFilters }, index.h("svg", { class: "mrd-table__action-icon", viewBox: "0 0 24 24", "aria-hidden": "true" }, index.h("path", { fill: "currentColor", d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" })), index.h("span", { class: "mrd-table__filter-clear-label" }, cellRenderer.t('table_filter_clear_all', locale), " (", filterCount, ")")))), hasViewSwitcher && (index.h("div", { class: "mrd-table__toolbar-center" }, index.h("div", { class: "mrd-table__view-switcher" }, index.h("button", { class: "mrd-table__view-arrow", "aria-label": "Previous view", onClick: () => cb.onViewSwitch((activeViewIdx - 1 + views.length) % views.length) }, "\u25C0"), index.h("div", { class: "mrd-table__view-title-wrap" }, index.h("button", { class: "mrd-table__view-title", onClick: (e) => cb.onToggleViewPopover(e) }, (_a = views[activeViewIdx]) === null || _a === void 0 ? void 0 : _a.label), viewPopoverOpen && (index.h("div", { class: "mrd-table__view-popover", onClick: (e) => e.stopPropagation() }, views.map((v, i) => (index.h("button", { key: String(i), class: `mrd-table__view-popover-item${i === activeViewIdx ? ' mrd-table__view-popover-item--active' : ''}`, onClick: () => {
6591
6428
  if (i !== activeViewIdx)
6592
6429
  cb.onViewSwitch(i);
6593
6430
  cb.onCloseViewPopover();
@@ -6704,13 +6541,18 @@ const MAX_RETRY_ATTEMPTS = 3;
6704
6541
  function visibleCount(tableHeight, rowHeight) {
6705
6542
  return Math.ceil(tableHeight / rowHeight);
6706
6543
  }
6707
- /** Render window (with buffer) for the given scroll offset. */
6544
+ /** Render window (with buffer) for the given scroll offset.
6545
+ * total <= 0 means "not known yet" (no totalElements prop, no aggregation total and no page
6546
+ * loaded — e.g. right after a filter reset), *not* "no rows". Clamping to total - 1 would
6547
+ * collapse the window to renderEnd = -1, so nothing renders and no page is ever requested;
6548
+ * the window is left unclamped instead and the render pass clamps it against
6549
+ * effectiveTotal once real data has landed. */
6708
6550
  function computeWindow(scrollTop, rowHeight, tableHeight, total) {
6709
6551
  const visStart = Math.floor(scrollTop / rowHeight);
6710
- const visEnd = Math.min(visStart + visibleCount(tableHeight, rowHeight), total - 1);
6552
+ const unclamped = visStart + visibleCount(tableHeight, rowHeight) + BUFFER;
6711
6553
  return {
6712
6554
  renderStart: Math.max(0, visStart - BUFFER),
6713
- renderEnd: Math.min(total - 1, visEnd + BUFFER),
6555
+ renderEnd: total > 0 ? Math.min(total - 1, unclamped) : unclamped,
6714
6556
  };
6715
6557
  }
6716
6558
  /** First/last page (0-based) covering the given row window. */
@@ -6752,12 +6594,16 @@ function getStalePages(requestedAt, now, timeoutMs) {
6752
6594
  return stale;
6753
6595
  }
6754
6596
 
6755
- const mrdTableCss = () => `.sc-mrd-table-h{display:block;width:100%}.mrd-table.sc-mrd-table{overflow-x:auto}.mrd-table__scroll.sc-mrd-table{overflow-y:auto;overflow-x:auto;border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);overflow-anchor:none}.mrd-table__table.sc-mrd-table{width:auto;min-width:100%;border-collapse:collapse;font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-900)}.mrd-table__scroll.sc-mrd-table .mrd-table__table.sc-mrd-table{min-width:max-content}.mrd-table__header.sc-mrd-table{position:sticky;top:0;z-index:1;background:var(--mrd-color-white);text-align:left;padding:var(--mrd-space-2) var(--mrd-space-4);border-bottom:2px solid var(--mrd-border-color);color:var(--mrd-color-neutral-600);font-weight:var(--mrd-font-weight-medium);white-space:nowrap;font-size:var(--mrd-font-size-xs);text-transform:uppercase;letter-spacing:0.04em}.mrd-table__header--sortable.sc-mrd-table{cursor:pointer;user-select:none}.mrd-table__header--sortable.sc-mrd-table:hover{background:var(--mrd-color-neutral-50);color:var(--mrd-color-neutral-800)}.mrd-table__header--sorted-asc.sc-mrd-table,.mrd-table__header--sorted-desc.sc-mrd-table{color:var(--mrd-color-primary);border-bottom-color:var(--mrd-color-primary)}.mrd-table__header--filtered.sc-mrd-table{color:var(--mrd-color-primary);border-bottom-color:var(--mrd-color-primary)}.mrd-table__header-label.sc-mrd-table{margin-right:var(--mrd-space-1)}.mrd-table__sort-icon.sc-mrd-table{font-size:0.85rem;opacity:0.4;vertical-align:middle}.mrd-table__header--sorted-asc.sc-mrd-table .mrd-table__sort-icon.sc-mrd-table,.mrd-table__header--sorted-desc.sc-mrd-table .mrd-table__sort-icon.sc-mrd-table{opacity:1;color:var(--mrd-color-primary)}.mrd-table__filter-icon.sc-mrd-table{display:inline-flex;align-items:center;vertical-align:middle;margin-left:var(--mrd-space-1);color:var(--mrd-color-primary)}.mrd-table__row.sc-mrd-table{border-bottom:1px solid var(--mrd-border-color)}.mrd-table__row.sc-mrd-table:hover{background:var(--mrd-color-neutral-200) !important}.mrd-table__row--clickable.sc-mrd-table{cursor:pointer}.mrd-table__row--loading.sc-mrd-table{background:transparent}.mrd-table__row--failed.sc-mrd-table{background:transparent}.mrd-table__spacer.sc-mrd-table{border:none}.mrd-table__spacer.sc-mrd-table td.sc-mrd-table{padding:0;border:none}.mrd-table__cell.sc-mrd-table{padding:var(--mrd-space-2) var(--mrd-space-4);vertical-align:top;white-space:nowrap}.mrd-table__cell--numeric.sc-mrd-table{text-align:right;font-variant-numeric:tabular-nums}.mrd-table__cell--placeholder.sc-mrd-table{padding:var(--mrd-space-2) var(--mrd-space-4);border-bottom:1px solid var(--mrd-border-color)}.mrd-table__cell--failed.sc-mrd-table{padding:var(--mrd-space-2) var(--mrd-space-4);border-bottom:1px solid var(--mrd-border-color)}.mrd-table__placeholder-bar.sc-mrd-table{display:block;height:0.75rem;width:55%;border-radius:var(--mrd-border-radius-sm);background:linear-gradient(90deg, var(--mrd-color-neutral-200) 25%, var(--mrd-color-neutral-100) 50%, var(--mrd-color-neutral-200) 75%);background-size:200% 100%;animation:mrd-shimmer 1.4s ease infinite}.mrd-table__retry-button.sc-mrd-table{border:none;background:none;padding:0;color:var(--mrd-color-danger);font-size:inherit;cursor:pointer;text-decoration:underline}.mrd-table__toolbar.sc-mrd-table{display:flex;align-items:center;justify-content:space-between;padding-bottom:var(--mrd-space-2)}.mrd-table__toolbar-left.sc-mrd-table,.mrd-table__toolbar-right.sc-mrd-table{display:flex;gap:var(--mrd-space-2);align-items:center}.mrd-table__toolbar-center.sc-mrd-table{flex:1;display:flex;justify-content:center;align-items:center;gap:var(--mrd-space-1)}.mrd-table__view-switcher.sc-mrd-table{display:flex;align-items:center;gap:var(--mrd-space-1)}.mrd-table__view-arrow.sc-mrd-table{background:none;border:none;cursor:pointer;padding:0 var(--mrd-space-1);color:var(--mrd-color-neutral-500);font-size:var(--mrd-font-size-xs);line-height:1}.mrd-table__view-arrow.sc-mrd-table:hover{color:var(--mrd-color-neutral-800)}.mrd-table__view-title-wrap.sc-mrd-table{position:relative}.mrd-table__view-title.sc-mrd-table{font-size:var(--mrd-font-size-sm);font-weight:600;color:var(--mrd-color-neutral-800);font-family:var(--mrd-font-family);background:none;border:none;outline:none;cursor:pointer;padding:0 var(--mrd-space-1);max-width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mrd-table__view-title.sc-mrd-table:hover{color:var(--mrd-color-primary)}.mrd-table__view-popover.sc-mrd-table{position:absolute;top:calc(100% + var(--mrd-space-1));left:50%;transform:translateX(-50%);background:var(--mrd-color-white);border:1px solid var(--mrd-color-neutral-200);border-radius:var(--mrd-radius-md);box-shadow:var(--mrd-shadow-md);z-index:100;min-width:160px;padding:var(--mrd-space-1) 0}.mrd-table__view-popover-item.sc-mrd-table{display:block;width:100%;text-align:left;background:none;border:none;cursor:pointer;padding:var(--mrd-space-2) var(--mrd-space-3);font-size:var(--mrd-font-size-sm);font-family:var(--mrd-font-family);color:var(--mrd-color-neutral-700);white-space:nowrap}.mrd-table__view-popover-item.sc-mrd-table:hover{background:var(--mrd-color-neutral-50)}.mrd-table__view-popover-item--active.sc-mrd-table{font-weight:600;color:var(--mrd-color-primary)}.mrd-table__action.sc-mrd-table{position:relative;display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;padding:0;background:transparent;border:1px solid transparent;border-radius:var(--mrd-border-radius);cursor:pointer;color:var(--mrd-color-neutral-400);transition:background-color 0.15s, border-color 0.15s, color 0.15s}.mrd-table__action.sc-mrd-table:hover{background-color:var(--mrd-color-neutral-100);border-color:var(--mrd-color-neutral-300);color:var(--mrd-color-neutral-700)}.mrd-table__action.sc-mrd-table:hover .mrd-table__action-tooltip.sc-mrd-table{display:block}.mrd-table__action.sc-mrd-table:disabled{opacity:0.4;cursor:not-allowed}.mrd-table__action--primary.sc-mrd-table{color:var(--mrd-color-neutral-500)}.mrd-table__action--primary.sc-mrd-table:hover{background:var(--mrd-color-primary);border-color:var(--mrd-color-primary);color:var(--mrd-color-white)}.mrd-table__action--danger.sc-mrd-table{color:var(--mrd-color-error)}.mrd-table__action--danger.sc-mrd-table:hover{background-color:var(--mrd-color-error-light, #fef2f2);border-color:var(--mrd-color-error)}.mrd-table__action-icon.sc-mrd-table{width:1.25rem;height:1.25rem;pointer-events:none;fill:currentColor}.mrd-table__action-tooltip.sc-mrd-table{display:none;position:absolute;bottom:calc(100% + 6px);right:0;padding:var(--mrd-space-1) var(--mrd-space-2);font-size:var(--mrd-font-size-xs);white-space:nowrap;background:var(--mrd-color-tooltip, #fffce1);color:var(--mrd-color-neutral-900);border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius-sm, var(--mrd-border-radius));pointer-events:none;z-index:10}.mrd-table__create-picker-wrap.sc-mrd-table{position:relative}.mrd-table__create-picker.sc-mrd-table{position:absolute;right:0;top:calc(100% + 4px);background:var(--mrd-color-white, #fff);border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);box-shadow:var(--mrd-shadow-md, 0 4px 12px rgba(0, 0, 0, 0.12));z-index:10;min-width:10rem;padding:var(--mrd-space-1) 0}.mrd-table__create-picker-item.sc-mrd-table{display:block;width:100%;text-align:left;padding:var(--mrd-space-2) var(--mrd-space-3);background:none;border:none;cursor:pointer;font-size:var(--mrd-font-size-sm);font-family:var(--mrd-font-family);color:var(--mrd-color-neutral-800)}.mrd-table__create-picker-item.sc-mrd-table:hover{background:var(--mrd-color-neutral-50);color:var(--mrd-color-neutral-900)}.mrd-table__filter-toggle--active.sc-mrd-table{background:var(--mrd-color-primary);border-color:var(--mrd-color-primary);color:var(--mrd-color-white)}.mrd-table__filter-toggle--active.sc-mrd-table:hover{background:var(--mrd-color-primary-dark, var(--mrd-color-primary));border-color:var(--mrd-color-primary-dark, var(--mrd-color-primary));color:var(--mrd-color-white)}.mrd-table__filter-badge.sc-mrd-table{position:absolute;top:-6px;right:-6px;min-width:1.25rem;height:1.25rem;padding:0 3px;background:var(--mrd-color-error, #e53e3e);color:var(--mrd-color-white);border-radius:9999px;font-size:0.65rem;font-weight:var(--mrd-font-weight-medium);line-height:1.25rem;text-align:center;pointer-events:none}.mrd-table__filter-popup.sc-mrd-table{position:fixed;width:280px;background:var(--mrd-color-white);border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);box-shadow:var(--mrd-shadow-md, 0 4px 12px rgba(0, 0, 0, 0.12));z-index:var(--mrd-z-dropdown, 200);font-size:var(--mrd-font-size-sm)}.mrd-table__filter-popup-header.sc-mrd-table{display:flex;align-items:center;justify-content:space-between;padding:var(--mrd-space-2) var(--mrd-space-3);border-bottom:1px solid var(--mrd-border-color)}.mrd-table__filter-popup-title.sc-mrd-table{font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-800);font-size:var(--mrd-font-size-sm)}.mrd-table__filter-close.sc-mrd-table{background:transparent;border:none;cursor:pointer;color:var(--mrd-color-neutral-500);font-size:0.9rem;padding:2px 4px;border-radius:3px;line-height:1}.mrd-table__filter-close.sc-mrd-table:hover{background:var(--mrd-color-neutral-100);color:var(--mrd-color-neutral-800)}.mrd-table__filter-section.sc-mrd-table{padding:var(--mrd-space-2) var(--mrd-space-3)}.mrd-table__filter-section-label.sc-mrd-table{font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-medium);text-transform:uppercase;letter-spacing:0.04em;color:var(--mrd-color-neutral-500);margin-bottom:var(--mrd-space-2)}.mrd-table__filter-sort-buttons.sc-mrd-table{display:flex;gap:var(--mrd-space-2)}.mrd-table__filter-sort-btn.sc-mrd-table{flex:1;padding:var(--mrd-space-1) var(--mrd-space-2);background:transparent;border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);cursor:pointer;font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-700)}.mrd-table__filter-sort-btn.sc-mrd-table:hover{background:var(--mrd-color-neutral-100)}.mrd-table__filter-sort-btn--active.sc-mrd-table{background:var(--mrd-color-primary);border-color:var(--mrd-color-primary);color:var(--mrd-color-white)}.mrd-table__filter-divider.sc-mrd-table{height:1px;background:var(--mrd-border-color);margin:0}.mrd-table__filter-editor.sc-mrd-table{display:flex;flex-direction:column;gap:var(--mrd-space-2)}.mrd-table__filter-select.sc-mrd-table,.mrd-table__filter-input.sc-mrd-table{width:100%;padding:var(--mrd-space-1) var(--mrd-space-2);border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-900);background:var(--mrd-color-white);box-sizing:border-box}.mrd-table__filter-select.sc-mrd-table:focus,.mrd-table__filter-input.sc-mrd-table:focus{outline:none;border-color:var(--mrd-color-primary);box-shadow:0 0 0 2px rgba(0, 0, 0, 0.06)}.mrd-table__filter-range.sc-mrd-table{display:flex;align-items:center;gap:var(--mrd-space-1)}.mrd-table__filter-range.sc-mrd-table .mrd-table__filter-input.sc-mrd-table{flex:1;min-width:0}.mrd-table__filter-range--stacked.sc-mrd-table{flex-direction:column;align-items:stretch;gap:var(--mrd-space-2)}.mrd-table__filter-range-sep.sc-mrd-table{color:var(--mrd-color-neutral-400);flex-shrink:0}.mrd-table__filter-range-label.sc-mrd-table{font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);margin-bottom:2px}.mrd-table__filter-radio-group.sc-mrd-table{display:flex;flex-direction:column;gap:var(--mrd-space-1)}.mrd-table__filter-radio-group--inline.sc-mrd-table{flex-direction:row;gap:var(--mrd-space-3)}.mrd-table__filter-radio-label.sc-mrd-table{display:flex;align-items:center;gap:var(--mrd-space-1);cursor:pointer;font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-800)}.mrd-table__filter-list.sc-mrd-table{display:flex;flex-direction:column;gap:var(--mrd-space-1);max-height:180px;overflow-y:auto}.mrd-table__filter-list-controls.sc-mrd-table{display:flex;gap:var(--mrd-space-2);margin-bottom:var(--mrd-space-1)}.mrd-table__filter-list-btn.sc-mrd-table{font-size:var(--mrd-font-size-xs);color:var(--mrd-color-primary);background:transparent;border:none;cursor:pointer;padding:0;text-decoration:underline}.mrd-table__filter-checkbox-label.sc-mrd-table{display:flex;align-items:center;gap:var(--mrd-space-1);cursor:pointer;font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-800)}.mrd-table__filter-no-support.sc-mrd-table{font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-500);margin:0;font-style:italic}.mrd-table__filter-popup-footer.sc-mrd-table{display:flex;justify-content:flex-end;gap:var(--mrd-space-2);padding:var(--mrd-space-2) var(--mrd-space-3);border-top:1px solid var(--mrd-border-color)}.mrd-table__filter-btn.sc-mrd-table{padding:var(--mrd-space-1) var(--mrd-space-3);border-radius:var(--mrd-border-radius);border:1px solid var(--mrd-border-color);font-size:var(--mrd-font-size-sm);cursor:pointer}.mrd-table__filter-btn--clear.sc-mrd-table{background:transparent;color:var(--mrd-color-neutral-600)}.mrd-table__filter-btn--clear.sc-mrd-table:hover{background:var(--mrd-color-neutral-100)}.mrd-table__filter-btn--apply.sc-mrd-table{background:var(--mrd-color-primary);border-color:var(--mrd-color-primary);color:var(--mrd-color-white)}.mrd-table__filter-btn--apply.sc-mrd-table:hover{background:var(--mrd-color-primary-dark, var(--mrd-color-primary));border-color:var(--mrd-color-primary-dark, var(--mrd-color-primary))}.mrd-table__totals-row.sc-mrd-table{border-top:2px solid var(--mrd-border-color)}.mrd-table__totals-cell.sc-mrd-table{position:sticky;bottom:0;z-index:2;padding:var(--mrd-space-2) var(--mrd-space-4);background:var(--mrd-color-white);font-weight:var(--mrd-font-weight-medium);font-variant-numeric:tabular-nums;white-space:nowrap;border-top:2px solid var(--mrd-border-color)}.mrd-table__totals-cell--numeric.sc-mrd-table{text-align:right}.mrd-table__footer.sc-mrd-table{padding:var(--mrd-space-1) var(--mrd-space-2);font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);text-align:right}.mrd-table__empty.sc-mrd-table{padding:var(--mrd-space-4) var(--mrd-space-3);color:var(--mrd-color-neutral-500);font-size:var(--mrd-font-size-sm);text-align:center;margin:0}.mrd-table__file-btn.sc-mrd-table{display:inline-flex;align-items:center;gap:var(--mrd-space-1);background:none;border:none;padding:0;cursor:pointer;color:var(--mrd-color-primary);font-size:var(--mrd-font-size-sm);font-family:inherit;max-width:100%;overflow:hidden}.mrd-table__file-btn.sc-mrd-table:hover{text-decoration:underline;color:var(--mrd-color-primary-dark)}.mrd-table__file-icon.sc-mrd-table{flex-shrink:0;width:1rem;height:1rem}.mrd-table__textblock-btn.sc-mrd-table{display:inline;background:none;border:none;padding:0 0 0 var(--mrd-space-1);cursor:pointer;color:var(--mrd-color-primary);font-size:var(--mrd-font-size-sm);font-family:inherit;line-height:inherit;vertical-align:middle}.mrd-table__textblock-btn.sc-mrd-table:hover{color:var(--mrd-color-primary-dark)}.mrd-table__modal-backdrop.sc-mrd-table{position:fixed;inset:0;background:rgba(0, 0, 0, 0.4);z-index:var(--mrd-z-modal, 300);display:flex;align-items:center;justify-content:center}.mrd-table__modal.sc-mrd-table{background:#fff;border-radius:var(--mrd-radius-md, 0.5rem);padding:var(--mrd-space-6);max-width:min(600px, 90vw);max-height:70vh;overflow-y:auto;position:relative;box-shadow:var(--mrd-shadow-lg)}.mrd-table__modal-close.sc-mrd-table{position:absolute;top:var(--mrd-space-3);right:var(--mrd-space-3);background:none;border:none;cursor:pointer;font-size:1.25rem;line-height:1;color:var(--mrd-color-text-muted, #6b7280);padding:0}.mrd-table__modal-close.sc-mrd-table:hover{color:var(--mrd-color-text, #111827)}.mrd-table__modal-text.sc-mrd-table{margin:0;padding-right:var(--mrd-space-6);white-space:pre-wrap;word-break:break-word;font-size:var(--mrd-font-size-sm);line-height:1.6}.mrd-table__json-preview.sc-mrd-table{font-family:var(--mrd-font-family-mono);font-size:var(--mrd-font-size-xs);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:inline-block;max-width:calc(100% - 1.5rem);vertical-align:middle}.mrd-table__modal-json.sc-mrd-table{margin:0;padding-right:var(--mrd-space-6);font-family:var(--mrd-font-family-mono);font-size:var(--mrd-font-size-xs);white-space:pre-wrap;word-break:break-word;line-height:1.6;background:none;border:none}@keyframes mrd-shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}`;
6597
+ const mrdTableCss = () => `.sc-mrd-table-h{display:block;width:100%}.mrd-table.sc-mrd-table{overflow-x:auto}.mrd-table__scroll.sc-mrd-table{overflow-y:auto;overflow-x:auto;border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);overflow-anchor:none}.mrd-table__table.sc-mrd-table{width:auto;min-width:100%;border-collapse:collapse;font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-900)}.mrd-table__scroll.sc-mrd-table .mrd-table__table.sc-mrd-table{min-width:max-content}.mrd-table__header.sc-mrd-table{position:sticky;top:0;z-index:1;background:var(--mrd-color-white);text-align:left;padding:var(--mrd-space-2) var(--mrd-space-4);border-bottom:2px solid var(--mrd-border-color);color:var(--mrd-color-neutral-600);font-weight:var(--mrd-font-weight-medium);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:var(--mrd-font-size-xs);text-transform:uppercase;letter-spacing:0.04em}.mrd-table__header--sortable.sc-mrd-table{cursor:pointer;user-select:none}.mrd-table__header--sortable.sc-mrd-table:hover{background:var(--mrd-color-neutral-50);color:var(--mrd-color-neutral-800)}.mrd-table__header--sorted-asc.sc-mrd-table,.mrd-table__header--sorted-desc.sc-mrd-table{color:var(--mrd-color-primary);border-bottom-color:var(--mrd-color-primary)}.mrd-table__header--filtered.sc-mrd-table{color:var(--mrd-color-primary);border-bottom-color:var(--mrd-color-primary)}.mrd-table__header-label.sc-mrd-table{margin-right:var(--mrd-space-1)}.mrd-table__col-resizer.sc-mrd-table{position:absolute;top:0;right:0;width:9px;height:100%;cursor:col-resize;touch-action:none;user-select:none}.mrd-table__col-resizer.sc-mrd-table::after{content:"";position:absolute;top:25%;right:4px;width:1px;height:50%;background:var(--mrd-border-color)}.mrd-table__col-resizer.sc-mrd-table:hover::after{width:2px;right:3px;background:var(--mrd-color-primary)}.mrd-table__col-resizer--active.sc-mrd-table::after{width:2px;right:3px;height:100%;top:0;background:var(--mrd-color-primary)}.mrd-table--resizing.sc-mrd-table{cursor:col-resize;user-select:none}.mrd-table__sort-icon.sc-mrd-table{font-size:0.85rem;opacity:0.4;vertical-align:middle}.mrd-table__header--sorted-asc.sc-mrd-table .mrd-table__sort-icon.sc-mrd-table,.mrd-table__header--sorted-desc.sc-mrd-table .mrd-table__sort-icon.sc-mrd-table{opacity:1;color:var(--mrd-color-primary)}.mrd-table__filter-icon.sc-mrd-table{display:inline-flex;align-items:center;vertical-align:middle;margin-left:var(--mrd-space-1);color:var(--mrd-color-primary)}.mrd-table__row.sc-mrd-table{border-bottom:1px solid var(--mrd-border-color)}.mrd-table__row.sc-mrd-table:hover{background:var(--mrd-color-neutral-200) !important}.mrd-table__row--clickable.sc-mrd-table{cursor:pointer}.mrd-table__row--loading.sc-mrd-table{background:transparent}.mrd-table__row--failed.sc-mrd-table{background:transparent}.mrd-table__spacer.sc-mrd-table{border:none}.mrd-table__spacer.sc-mrd-table td.sc-mrd-table{padding:0;border:none}.mrd-table__cell.sc-mrd-table{padding:var(--mrd-space-2) var(--mrd-space-4);vertical-align:top;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mrd-table__cell--numeric.sc-mrd-table{text-align:right;font-variant-numeric:tabular-nums}.mrd-table__cell--placeholder.sc-mrd-table{padding:var(--mrd-space-2) var(--mrd-space-4);border-bottom:1px solid var(--mrd-border-color)}.mrd-table__cell--failed.sc-mrd-table{padding:var(--mrd-space-2) var(--mrd-space-4);border-bottom:1px solid var(--mrd-border-color)}.mrd-table__placeholder-bar.sc-mrd-table{display:block;height:0.75rem;width:55%;border-radius:var(--mrd-border-radius-sm);background:linear-gradient(90deg, var(--mrd-color-neutral-200) 25%, var(--mrd-color-neutral-100) 50%, var(--mrd-color-neutral-200) 75%);background-size:200% 100%;animation:mrd-shimmer 1.4s ease infinite}.mrd-table__retry-button.sc-mrd-table{border:none;background:none;padding:0;color:var(--mrd-color-danger);font-size:inherit;cursor:pointer;text-decoration:underline}.mrd-table__toolbar.sc-mrd-table{display:flex;align-items:center;justify-content:space-between;padding-bottom:var(--mrd-space-2)}.mrd-table__toolbar-left.sc-mrd-table,.mrd-table__toolbar-right.sc-mrd-table{display:flex;gap:var(--mrd-space-2);align-items:center}.mrd-table__toolbar-center.sc-mrd-table{flex:1;display:flex;justify-content:center;align-items:center;gap:var(--mrd-space-1)}.mrd-table__view-switcher.sc-mrd-table{display:flex;align-items:center;gap:var(--mrd-space-1)}.mrd-table__view-arrow.sc-mrd-table{background:none;border:none;cursor:pointer;padding:0 var(--mrd-space-1);color:var(--mrd-color-neutral-500);font-size:var(--mrd-font-size-xs);line-height:1}.mrd-table__view-arrow.sc-mrd-table:hover{color:var(--mrd-color-neutral-800)}.mrd-table__view-title-wrap.sc-mrd-table{position:relative}.mrd-table__view-title.sc-mrd-table{font-size:var(--mrd-font-size-sm);font-weight:600;color:var(--mrd-color-neutral-800);font-family:var(--mrd-font-family);background:none;border:none;outline:none;cursor:pointer;padding:0 var(--mrd-space-1);max-width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mrd-table__view-title.sc-mrd-table:hover{color:var(--mrd-color-primary)}.mrd-table__view-popover.sc-mrd-table{position:absolute;top:calc(100% + var(--mrd-space-1));left:50%;transform:translateX(-50%);background:var(--mrd-color-white);border:1px solid var(--mrd-color-neutral-200);border-radius:var(--mrd-radius-md);box-shadow:var(--mrd-shadow-md);z-index:100;min-width:160px;padding:var(--mrd-space-1) 0}.mrd-table__view-popover-item.sc-mrd-table{display:block;width:100%;text-align:left;background:none;border:none;cursor:pointer;padding:var(--mrd-space-2) var(--mrd-space-3);font-size:var(--mrd-font-size-sm);font-family:var(--mrd-font-family);color:var(--mrd-color-neutral-700);white-space:nowrap}.mrd-table__view-popover-item.sc-mrd-table:hover{background:var(--mrd-color-neutral-50)}.mrd-table__view-popover-item--active.sc-mrd-table{font-weight:600;color:var(--mrd-color-primary)}.mrd-table__action.sc-mrd-table{position:relative;display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;padding:0;background:transparent;border:1px solid transparent;border-radius:var(--mrd-border-radius);cursor:pointer;color:var(--mrd-color-neutral-400);transition:background-color 0.15s, border-color 0.15s, color 0.15s}.mrd-table__action.sc-mrd-table:hover{background-color:var(--mrd-color-neutral-100);border-color:var(--mrd-color-neutral-300);color:var(--mrd-color-neutral-700)}.mrd-table__action.sc-mrd-table:hover .mrd-table__action-tooltip.sc-mrd-table{display:block}.mrd-table__action.sc-mrd-table:disabled{opacity:0.4;cursor:not-allowed}.mrd-table__action--primary.sc-mrd-table{color:var(--mrd-color-neutral-500)}.mrd-table__action--primary.sc-mrd-table:hover{background:var(--mrd-color-primary);border-color:var(--mrd-color-primary);color:var(--mrd-color-white)}.mrd-table__action--danger.sc-mrd-table{color:var(--mrd-color-error)}.mrd-table__action--danger.sc-mrd-table:hover{background-color:var(--mrd-color-error-light, #fef2f2);border-color:var(--mrd-color-error)}.mrd-table__action-icon.sc-mrd-table{width:1.25rem;height:1.25rem;pointer-events:none;fill:currentColor}.mrd-table__action-tooltip.sc-mrd-table{display:none;position:absolute;bottom:calc(100% + 6px);right:0;padding:var(--mrd-space-1) var(--mrd-space-2);font-size:var(--mrd-font-size-xs);white-space:nowrap;background:var(--mrd-color-tooltip, #fffce1);color:var(--mrd-color-neutral-900);border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius-sm, var(--mrd-border-radius));pointer-events:none;z-index:10}.mrd-table__create-picker-wrap.sc-mrd-table{position:relative}.mrd-table__create-picker.sc-mrd-table{position:absolute;right:0;top:calc(100% + 4px);background:var(--mrd-color-white, #fff);border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);box-shadow:var(--mrd-shadow-md, 0 4px 12px rgba(0, 0, 0, 0.12));z-index:10;min-width:10rem;padding:var(--mrd-space-1) 0}.mrd-table__create-picker-item.sc-mrd-table{display:block;width:100%;text-align:left;padding:var(--mrd-space-2) var(--mrd-space-3);background:none;border:none;cursor:pointer;font-size:var(--mrd-font-size-sm);font-family:var(--mrd-font-family);color:var(--mrd-color-neutral-800)}.mrd-table__create-picker-item.sc-mrd-table:hover{background:var(--mrd-color-neutral-50);color:var(--mrd-color-neutral-900)}.mrd-table__filter-clear.sc-mrd-table{width:auto;gap:var(--mrd-space-1);padding:0 var(--mrd-space-2);color:var(--mrd-color-primary);border-color:var(--mrd-color-primary)}.mrd-table__filter-clear.sc-mrd-table:hover{color:var(--mrd-color-primary);border-color:var(--mrd-color-primary)}.mrd-table__filter-clear-label.sc-mrd-table{font-size:var(--mrd-font-size-sm);white-space:nowrap}.mrd-table__filter-popup.sc-mrd-table{position:fixed;width:280px;background:var(--mrd-color-white);border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);box-shadow:var(--mrd-shadow-md, 0 4px 12px rgba(0, 0, 0, 0.12));z-index:var(--mrd-z-dropdown, 200);font-size:var(--mrd-font-size-sm)}.mrd-table__filter-popup-header.sc-mrd-table{display:flex;align-items:center;justify-content:space-between;padding:var(--mrd-space-2) var(--mrd-space-3);border-bottom:1px solid var(--mrd-border-color)}.mrd-table__filter-popup-title.sc-mrd-table{font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-800);font-size:var(--mrd-font-size-sm)}.mrd-table__filter-close.sc-mrd-table{background:transparent;border:none;cursor:pointer;color:var(--mrd-color-neutral-500);font-size:0.9rem;padding:2px 4px;border-radius:3px;line-height:1}.mrd-table__filter-close.sc-mrd-table:hover{background:var(--mrd-color-neutral-100);color:var(--mrd-color-neutral-800)}.mrd-table__filter-section.sc-mrd-table{padding:var(--mrd-space-2) var(--mrd-space-3)}.mrd-table__filter-section-label.sc-mrd-table{font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-medium);text-transform:uppercase;letter-spacing:0.04em;color:var(--mrd-color-neutral-500);margin-bottom:var(--mrd-space-2)}.mrd-table__filter-sort-buttons.sc-mrd-table{display:flex;gap:var(--mrd-space-2)}.mrd-table__filter-sort-btn.sc-mrd-table{flex:1;padding:var(--mrd-space-1) var(--mrd-space-2);background:transparent;border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);cursor:pointer;font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-700)}.mrd-table__filter-sort-btn.sc-mrd-table:hover{background:var(--mrd-color-neutral-100)}.mrd-table__filter-sort-btn--active.sc-mrd-table{background:var(--mrd-color-primary);border-color:var(--mrd-color-primary);color:var(--mrd-color-white)}.mrd-table__filter-divider.sc-mrd-table{height:1px;background:var(--mrd-border-color);margin:0}.mrd-table__filter-editor.sc-mrd-table{display:flex;flex-direction:column;gap:var(--mrd-space-2)}.mrd-table__filter-select.sc-mrd-table,.mrd-table__filter-input.sc-mrd-table{width:100%;padding:var(--mrd-space-1) var(--mrd-space-2);border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-900);background:var(--mrd-color-white);box-sizing:border-box}.mrd-table__filter-select.sc-mrd-table:focus,.mrd-table__filter-input.sc-mrd-table:focus{outline:none;border-color:var(--mrd-color-primary);box-shadow:0 0 0 2px rgba(0, 0, 0, 0.06)}.mrd-table__filter-range.sc-mrd-table{display:flex;align-items:center;gap:var(--mrd-space-1)}.mrd-table__filter-range.sc-mrd-table .mrd-table__filter-input.sc-mrd-table{flex:1;min-width:0}.mrd-table__filter-range--stacked.sc-mrd-table{flex-direction:column;align-items:stretch;gap:var(--mrd-space-2)}.mrd-table__filter-range-sep.sc-mrd-table{color:var(--mrd-color-neutral-400);flex-shrink:0}.mrd-table__filter-range-label.sc-mrd-table{font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);margin-bottom:2px}.mrd-table__filter-radio-group.sc-mrd-table{display:flex;flex-direction:column;gap:var(--mrd-space-1)}.mrd-table__filter-radio-group--inline.sc-mrd-table{flex-direction:row;gap:var(--mrd-space-3)}.mrd-table__filter-radio-label.sc-mrd-table{display:flex;align-items:center;gap:var(--mrd-space-1);cursor:pointer;font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-800)}.mrd-table__filter-list.sc-mrd-table{display:flex;flex-direction:column;gap:var(--mrd-space-1);max-height:180px;overflow-y:auto}.mrd-table__filter-list-controls.sc-mrd-table{display:flex;gap:var(--mrd-space-2);margin-bottom:var(--mrd-space-1)}.mrd-table__filter-list-btn.sc-mrd-table{font-size:var(--mrd-font-size-xs);color:var(--mrd-color-primary);background:transparent;border:none;cursor:pointer;padding:0;text-decoration:underline}.mrd-table__filter-checkbox-label.sc-mrd-table{display:flex;align-items:center;gap:var(--mrd-space-1);cursor:pointer;font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-800)}.mrd-table__filter-no-support.sc-mrd-table{font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-500);margin:0;font-style:italic}.mrd-table__filter-popup-footer.sc-mrd-table{display:flex;justify-content:flex-end;gap:var(--mrd-space-2);padding:var(--mrd-space-2) var(--mrd-space-3);border-top:1px solid var(--mrd-border-color)}.mrd-table__filter-btn.sc-mrd-table{padding:var(--mrd-space-1) var(--mrd-space-3);border-radius:var(--mrd-border-radius);border:1px solid var(--mrd-border-color);font-size:var(--mrd-font-size-sm);cursor:pointer}.mrd-table__filter-btn--clear.sc-mrd-table{background:transparent;color:var(--mrd-color-neutral-600)}.mrd-table__filter-btn--clear.sc-mrd-table:hover{background:var(--mrd-color-neutral-100)}.mrd-table__filter-btn--apply.sc-mrd-table{background:var(--mrd-color-primary);border-color:var(--mrd-color-primary);color:var(--mrd-color-white)}.mrd-table__filter-btn--apply.sc-mrd-table:hover{background:var(--mrd-color-primary-dark, var(--mrd-color-primary));border-color:var(--mrd-color-primary-dark, var(--mrd-color-primary))}.mrd-table__totals-row.sc-mrd-table{border-top:2px solid var(--mrd-border-color)}.mrd-table__totals-cell.sc-mrd-table{position:sticky;bottom:0;z-index:2;padding:var(--mrd-space-2) var(--mrd-space-4);background:var(--mrd-color-white);font-weight:var(--mrd-font-weight-medium);font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border-top:2px solid var(--mrd-border-color)}.mrd-table__totals-cell--numeric.sc-mrd-table{text-align:right}.mrd-table__footer.sc-mrd-table{padding:var(--mrd-space-1) var(--mrd-space-2);font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);text-align:right}.mrd-table__empty.sc-mrd-table{padding:var(--mrd-space-4) var(--mrd-space-3);color:var(--mrd-color-neutral-500);font-size:var(--mrd-font-size-sm);text-align:center;margin:0}.mrd-table__file-btn.sc-mrd-table{display:inline-flex;align-items:center;gap:var(--mrd-space-1);background:none;border:none;padding:0;cursor:pointer;color:var(--mrd-color-primary);font-size:var(--mrd-font-size-sm);font-family:inherit;max-width:100%;overflow:hidden}.mrd-table__file-btn.sc-mrd-table:hover{text-decoration:underline;color:var(--mrd-color-primary-dark)}.mrd-table__file-icon.sc-mrd-table{flex-shrink:0;width:1rem;height:1rem}.mrd-table__textblock-btn.sc-mrd-table{display:inline;background:none;border:none;padding:0 0 0 var(--mrd-space-1);cursor:pointer;color:var(--mrd-color-primary);font-size:var(--mrd-font-size-sm);font-family:inherit;line-height:inherit;vertical-align:middle}.mrd-table__textblock-btn.sc-mrd-table:hover{color:var(--mrd-color-primary-dark)}.mrd-table__modal-backdrop.sc-mrd-table{position:fixed;inset:0;background:rgba(0, 0, 0, 0.4);z-index:var(--mrd-z-modal, 300);display:flex;align-items:center;justify-content:center}.mrd-table__modal.sc-mrd-table{background:#fff;border-radius:var(--mrd-radius-md, 0.5rem);padding:var(--mrd-space-6);max-width:min(600px, 90vw);max-height:70vh;overflow-y:auto;position:relative;box-shadow:var(--mrd-shadow-lg)}.mrd-table__modal-close.sc-mrd-table{position:absolute;top:var(--mrd-space-3);right:var(--mrd-space-3);background:none;border:none;cursor:pointer;font-size:1.25rem;line-height:1;color:var(--mrd-color-text-muted, #6b7280);padding:0}.mrd-table__modal-close.sc-mrd-table:hover{color:var(--mrd-color-text, #111827)}.mrd-table__modal-text.sc-mrd-table{margin:0;padding-right:var(--mrd-space-6);white-space:pre-wrap;word-break:break-word;font-size:var(--mrd-font-size-sm);line-height:1.6}.mrd-table__json-preview.sc-mrd-table{font-family:var(--mrd-font-family-mono);font-size:var(--mrd-font-size-xs);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:inline-block;max-width:calc(100% - 1.5rem);vertical-align:middle}.mrd-table__modal-json.sc-mrd-table{margin:0;padding-right:var(--mrd-space-6);font-family:var(--mrd-font-family-mono);font-size:var(--mrd-font-size-xs);white-space:pre-wrap;word-break:break-word;line-height:1.6;background:none;border:none}@keyframes mrd-shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}`;
6756
6598
 
6757
6599
  /** How often (ms) to scan outstanding page requests for staleness. */
6758
6600
  const STALE_CHECK_INTERVAL_MS = 2000;
6759
6601
  /** Breedte van de filterpopup in px — voor overflow-correctie. */
6760
6602
  const POPUP_WIDTH = 280;
6603
+ /** Smallest column width (px) a user can drag a column down to. */
6604
+ const MIN_COL_WIDTH = 48;
6605
+ /** Upper bound (px) for a double-click auto-fit, so one huge value can't blow up the layout. */
6606
+ const MAX_AUTOFIT_WIDTH = 600;
6761
6607
  const MrdTable = class {
6762
6608
  constructor(hostRef) {
6763
6609
  index.registerInstance(this, hostRef);
@@ -6781,6 +6627,13 @@ const MrdTable = class {
6781
6627
  this.viewPopoverClickHandler = null;
6782
6628
  /** Guards against scheduling more than one column-width measurement per freeze. */
6783
6629
  this.colWidthMeasureScheduled = false;
6630
+ /** Drag origin of the running column resize (null = no drag in progress). */
6631
+ this.resizeOrigin = null;
6632
+ /** True once the user has dragged (or auto-fitted) a column — see colWidthsUserSet usages. */
6633
+ this.colWidthsUserSet = false;
6634
+ /** Set once the host drives this table through init()/setPage(). Never cleared: it has to
6635
+ * survive resetPages(), which empties loadedPages — see the isPaginated getter. */
6636
+ this.paginationActivated = false;
6784
6637
  // ── Props ──────────────────────────────────────────────────────────────────
6785
6638
  /** The VIEW or RELATED_VIEW layout item. Contains view config, dataClass, fromClass, actions etc. */
6786
6639
  this.item = null;
@@ -6810,10 +6663,10 @@ const MrdTable = class {
6810
6663
  this.renderStart = 0;
6811
6664
  this.renderEnd = 0;
6812
6665
  this.colWidths = [];
6666
+ /** Index of the column currently being dragged by its resize handle (null = not resizing). */
6667
+ this.resizingCol = null;
6813
6668
  this.sortField = '';
6814
6669
  this.sortDir = 'asc';
6815
- /** Whether the filter UI is visible on column headers. */
6816
- this.filterMode = false;
6817
6670
  /** Active filters keyed by field name. */
6818
6671
  this.activeFilters = new Map();
6819
6672
  /** Field name of the currently open filter popup (null = closed). */
@@ -6850,15 +6703,24 @@ const MrdTable = class {
6850
6703
  };
6851
6704
  }
6852
6705
  // ── Prop watchers ─────────────────────────────────────────────────────────
6853
- /** Clamp renderEnd when totalElements shrinks (e.g. after a filter is applied). */
6706
+ /** Clamp renderEnd when totalElements shrinks (e.g. after a filter is applied).
6707
+ * 0 means "unknown" (hosts that rely on minKnownTotal never set it, and some reset it
6708
+ * while a filter is being applied) — clamping to it would collapse the window to a
6709
+ * single row, so leave the window alone and let the render pass clamp it. */
6854
6710
  totalElementsChanged(newVal) {
6855
- this.renderEnd = Math.min(this.renderEnd, Math.max(0, newVal - 1));
6711
+ if (newVal > 0)
6712
+ this.renderEnd = Math.min(this.renderEnd, newVal - 1);
6856
6713
  }
6857
6714
  /** Reset to primary view when the item prop is replaced from outside. */
6858
6715
  itemChanged(newVal) {
6859
6716
  var _a, _b;
6860
6717
  this.activeViewIdx = 0;
6861
6718
  this.applyDefaultSort((_b = (_a = newVal === null || newVal === void 0 ? void 0 : newVal.view) === null || _a === void 0 ? void 0 : _a.defaultSort) !== null && _b !== void 0 ? _b : '');
6719
+ // The columns getter derives from item/activeViewIdx: locked widths belong to the old
6720
+ // column set and would otherwise be applied by index to the new one.
6721
+ this.colWidths = [];
6722
+ this.colWidthMeasureScheduled = false;
6723
+ this.colWidthsUserSet = false;
6862
6724
  }
6863
6725
  // ── Lifecycle ──────────────────────────────────────────────────────────────
6864
6726
  componentWillLoad() {
@@ -6893,6 +6755,7 @@ const MrdTable = class {
6893
6755
  this.retryAttempts.clear();
6894
6756
  this.colWidths = [];
6895
6757
  this.colWidthMeasureScheduled = false;
6758
+ this.colWidthsUserSet = false;
6896
6759
  this.scrollTop = 0;
6897
6760
  this.renderStart = 0;
6898
6761
  // Always fill the visible viewport on init — totalElements may be stale from a
@@ -6905,6 +6768,7 @@ const MrdTable = class {
6905
6768
  this.aggregationsTotal = null;
6906
6769
  this.aggregationsPending = true;
6907
6770
  this.minKnownTotal = 0;
6771
+ this.paginationActivated = true;
6908
6772
  // Always request page 0 — totalElements may be unknown (0) on first load.
6909
6773
  this.emitLoadPage(0);
6910
6774
  this.requestedPages = new Set([0]);
@@ -6921,6 +6785,7 @@ const MrdTable = class {
6921
6785
  * detection even when rows.length === pageSize (exact multiple of page size).
6922
6786
  */
6923
6787
  async setPage(pageNumber, rows, hasNext) {
6788
+ this.paginationActivated = true;
6924
6789
  const isLastPage = hasNext !== undefined ? !hasNext : rows.length < this.pageSize;
6925
6790
  if (isLastPage) {
6926
6791
  // lastRowIdx is -1 when the page is empty; clamp renderEnd to -1 so the
@@ -6937,6 +6802,13 @@ const MrdTable = class {
6937
6802
  const next = new Map(this.loadedPages);
6938
6803
  next.set(pageNumber, rows);
6939
6804
  this.loadedPages = next;
6805
+ // Repair a window that renders nothing. renderEnd is only ever clamped *down* (here and
6806
+ // in totalElementsChanged), so a window computed while the total was still unknown stays
6807
+ // collapsed and the rows sit in loadedPages without ever reaching the screen until the
6808
+ // user scrolls. Stays collapsed when the data really is empty (minKnownTotal 0).
6809
+ if (this.renderEnd < this.renderStart) {
6810
+ this.renderEnd = Math.min(this.renderStart + this.visibleCount() - 1, this.minKnownTotal - 1);
6811
+ }
6940
6812
  this.requestedAt.delete(pageNumber);
6941
6813
  this.retryAttempts.delete(pageNumber);
6942
6814
  if (this.failedPages.has(pageNumber)) {
@@ -6987,23 +6859,118 @@ const MrdTable = class {
6987
6859
  // re-render *during* the render cycle if done synchronously here. Defer it to a
6988
6860
  // writeTask so the state mutation happens outside the render pass (avoids the
6989
6861
  // Stencil "state/prop changed during rendering" warning and potential loops).
6862
+ // NB: the freeze must not depend on the totalElements prop — hosts may omit it
6863
+ // and rely on minKnownTotal, in which case the widths would never be locked and
6864
+ // every incoming page would re-flow all columns.
6990
6865
  if (this.colWidths.length === 0 &&
6991
6866
  !this.colWidthMeasureScheduled &&
6992
- this.loadedPages.size > 0 &&
6993
- this.totalElements > 0) {
6867
+ this.loadedPages.size > 0) {
6994
6868
  this.colWidthMeasureScheduled = true;
6995
6869
  index.writeTask(() => {
6996
6870
  this.colWidthMeasureScheduled = false;
6997
6871
  // Re-check: state may have changed (e.g. a reset) between scheduling and running.
6998
6872
  if (this.colWidths.length !== 0)
6999
6873
  return;
7000
- const ths = this.el.querySelectorAll('.mrd-table__header');
7001
- if (ths.length > 0) {
7002
- this.colWidths = Array.from(ths).map(th => th.offsetWidth);
7003
- }
6874
+ const measured = this.measureColWidths();
6875
+ if (measured)
6876
+ this.colWidths = measured;
7004
6877
  });
7005
6878
  }
7006
6879
  }
6880
+ // ── Column resizing (drag the header border, Excel-style) ──────────────────
6881
+ /** Current rendered header widths, or null when they can't be trusted (header not laid out yet). */
6882
+ measureColWidths() {
6883
+ const ths = this.el.querySelectorAll('.mrd-table__header');
6884
+ if (ths.length === 0 || ths.length !== this.columns.length)
6885
+ return null;
6886
+ return Array.from(ths).map(th => Math.round(th.getBoundingClientRect().width));
6887
+ }
6888
+ /** Locks the columns at their current rendered widths if they aren't locked yet. */
6889
+ ensureColWidths() {
6890
+ if (this.colWidths.length === this.columns.length)
6891
+ return true;
6892
+ const measured = this.measureColWidths();
6893
+ if (!measured)
6894
+ return false;
6895
+ this.colWidths = measured;
6896
+ return true;
6897
+ }
6898
+ setColWidth(idx, width) {
6899
+ const next = [...this.colWidths];
6900
+ next[idx] = Math.max(MIN_COL_WIDTH, Math.round(width));
6901
+ this.colWidths = next;
6902
+ this.colWidthsUserSet = true;
6903
+ }
6904
+ handleResizeStart(e, idx) {
6905
+ var _a, _b;
6906
+ // Stop the header's own click/sort handling; the drag owns this gesture.
6907
+ e.preventDefault();
6908
+ e.stopPropagation();
6909
+ if (!this.ensureColWidths())
6910
+ return;
6911
+ this.resizeOrigin = { idx, startX: e.clientX, startWidth: this.colWidths[idx] };
6912
+ this.resizingCol = idx;
6913
+ // Pointer capture keeps move/up events on the handle even when the cursor runs
6914
+ // ahead of it — no document-level listeners to register and clean up.
6915
+ (_b = (_a = e.currentTarget).setPointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, e.pointerId);
6916
+ }
6917
+ handleResizeMove(e) {
6918
+ if (!this.resizeOrigin)
6919
+ return;
6920
+ const { idx, startX, startWidth } = this.resizeOrigin;
6921
+ this.setColWidth(idx, startWidth + (e.clientX - startX));
6922
+ }
6923
+ handleResizeEnd(e) {
6924
+ var _a, _b;
6925
+ if (!this.resizeOrigin)
6926
+ return;
6927
+ this.resizeOrigin = null;
6928
+ this.resizingCol = null;
6929
+ (_b = (_a = e.currentTarget).releasePointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, e.pointerId);
6930
+ }
6931
+ /** Double-click on the handle: widen the column to fit its widest *rendered* cell.
6932
+ * Only rows currently in the virtual-scroll window are measured — off-screen pages
6933
+ * aren't in the DOM at all, so this is "fit what you can see", not "fit all data". */
6934
+ handleResizeAutoFit(e, idx) {
6935
+ e.preventDefault();
6936
+ e.stopPropagation();
6937
+ if (!this.ensureColWidths())
6938
+ return;
6939
+ // .mrd-table__cell only matches real data cells — the shimmer/retry rows render a single
6940
+ // colSpan cell (without that class) which would otherwise measure as the full table width.
6941
+ const cells = this.el.querySelectorAll(`.mrd-table__header:nth-child(${idx + 1}), .mrd-table__cell:nth-child(${idx + 1})`);
6942
+ let widest = 0;
6943
+ cells.forEach(cell => {
6944
+ // scrollWidth is the untruncated content width; cells clip with overflow: hidden.
6945
+ const style = getComputedStyle(cell);
6946
+ const padding = parseFloat(style.paddingLeft || '0') + parseFloat(style.paddingRight || '0');
6947
+ widest = Math.max(widest, cell.scrollWidth + padding);
6948
+ });
6949
+ if (widest > 0)
6950
+ this.setColWidth(idx, Math.min(widest, MAX_AUTOFIT_WIDTH));
6951
+ }
6952
+ /** Inline table style once the column widths are locked, undefined while still auto-layout.
6953
+ * Once locked the table gets an explicit pixel width (the sum of the columns) instead of
6954
+ * the stylesheet's `min-width: max-content`. max-content is re-derived from the cell
6955
+ * contents, so every page that scrolled in with a longer value widened the table and
6956
+ * re-proportioned all columns — the jitter this replaces.
6957
+ * `minWidth: 100%` keeps an auto-measured table stretched to its container, but is dropped
6958
+ * once the user resizes by hand: with it, the space freed by narrowing a column is
6959
+ * redistributed over all columns, so a drag would partly spring back. */
6960
+ lockedTableStyle() {
6961
+ if (this.colWidths.length === 0)
6962
+ return undefined;
6963
+ const total = this.colWidths.reduce((sum, w) => sum + (w || 0), 0);
6964
+ return Object.assign({ tableLayout: 'fixed', width: `${total}px` }, (this.colWidthsUserSet ? {} : { minWidth: '100%' }));
6965
+ }
6966
+ /** The resize handle rendered in the right edge of every header cell. */
6967
+ renderColResizer(idx) {
6968
+ const cls = 'mrd-table__col-resizer' + (this.resizingCol === idx ? ' mrd-table__col-resizer--active' : '');
6969
+ return (index.h("span", { class: cls, role: "separator", "aria-orientation": "vertical", title: cellRenderer.t('column_resize', this.locale), "on-pointerdown": (e) => this.handleResizeStart(e, idx), "on-pointermove": (e) => this.handleResizeMove(e), "on-pointerup": (e) => this.handleResizeEnd(e), "on-pointercancel": (e) => this.handleResizeEnd(e), "on-dblclick": (e) => this.handleResizeAutoFit(e, idx),
6970
+ // The click that follows the drag targets this handle; swallow it so it never
6971
+ // bubbles to the header and triggers a sort or the filter popup.
6972
+ onClick: (e) => e.stopPropagation() }));
6973
+ }
7007
6974
  // ── Paging / scroll helpers ────────────────────────────────────────────────
7008
6975
  visibleCount() {
7009
6976
  return visibleCount(this.tableHeight, this.rowHeight);
@@ -7087,6 +7054,17 @@ const MrdTable = class {
7087
7054
  activeFilters: this.activeFilters.values(),
7088
7055
  });
7089
7056
  }
7057
+ /** True when the table is in paginated / virtual-scroll mode rather than driven by the
7058
+ * rows prop. Mirrors the branch taken in render().
7059
+ *
7060
+ * The filter handlers gate their reload on this. They used to test minKnownTotal, which is
7061
+ * 0 after a filter returned no rows at all — so clearing that filter reloaded nothing and
7062
+ * the table stayed empty. Hosts that omit totalElements have the same problem, hence the
7063
+ * sticky flag rather than loadedPages.size: resetPages() clears the loaded pages, and the
7064
+ * mode must not flip back to the rows prop (and its "no results") while page 0 is in flight. */
7065
+ get isPaginated() {
7066
+ return this.totalElements > 0 || this.paginationActivated;
7067
+ }
7090
7068
  get columns() {
7091
7069
  var _a, _b, _c;
7092
7070
  return ((_c = (_b = (_a = this.allViews[this.activeViewIdx]) === null || _a === void 0 ? void 0 : _a.view) === null || _b === void 0 ? void 0 : _b.values) !== null && _c !== void 0 ? _c : []);
@@ -7168,8 +7146,13 @@ const MrdTable = class {
7168
7146
  this.failedPages = new Set();
7169
7147
  this.requestedAt.clear();
7170
7148
  this.retryAttempts.clear();
7171
- this.colWidths = [];
7172
- this.colWidthMeasureScheduled = false;
7149
+ // A sort or filter change keeps the same columns, so hand-set widths survive it —
7150
+ // re-measuring would throw away what the user just dragged. Auto-measured widths are
7151
+ // dropped so they can be re-derived from the new first page.
7152
+ if (!this.colWidthsUserSet) {
7153
+ this.colWidths = [];
7154
+ this.colWidthMeasureScheduled = false;
7155
+ }
7173
7156
  this.scrollTop = 0;
7174
7157
  this.renderStart = 0;
7175
7158
  this.minKnownTotal = 0;
@@ -7180,18 +7163,8 @@ const MrdTable = class {
7180
7163
  if (scroller)
7181
7164
  scroller.scrollTop = 0;
7182
7165
  }
7183
- handleSortClick(col) {
7184
- const name = this.colName(col);
7185
- if (this.sortField === name) {
7186
- this.sortDir = this.sortDir === 'asc' ? 'desc' : 'asc';
7187
- }
7188
- else {
7189
- this.sortField = name;
7190
- this.sortDir = 'asc';
7191
- }
7192
- this.resetPages();
7193
- this.emitPagesForWindow(this.renderStart, this.renderEnd);
7194
- }
7166
+ /** Sorting runs through the column popup's sort section (applySort); there is no
7167
+ * separate click-to-sort mode any more. */
7195
7168
  applySort(col, dir) {
7196
7169
  this.sortField = this.colName(col);
7197
7170
  this.sortDir = dir;
@@ -7297,11 +7270,6 @@ const MrdTable = class {
7297
7270
  this.requestedPages = requested;
7298
7271
  }
7299
7272
  // ── Filter helpers ─────────────────────────────────────────────────────────
7300
- handleFilterToggle() {
7301
- this.filterMode = !this.filterMode;
7302
- if (!this.filterMode)
7303
- this.closeFilterPopup();
7304
- }
7305
7273
  handleFilterOpen(col, e) {
7306
7274
  e.stopPropagation();
7307
7275
  const btn = e.currentTarget;
@@ -7408,7 +7376,7 @@ const MrdTable = class {
7408
7376
  this.aggregations = null;
7409
7377
  this.aggregationsTotal = null;
7410
7378
  this.aggregationsPending = true;
7411
- if (this.totalElements > 0 || this.minKnownTotal > 0) {
7379
+ if (this.isPaginated) {
7412
7380
  this.resetPages();
7413
7381
  this.emitPagesForWindow(this.renderStart, this.renderEnd);
7414
7382
  }
@@ -7423,7 +7391,7 @@ const MrdTable = class {
7423
7391
  this.aggregations = null;
7424
7392
  this.aggregationsTotal = null;
7425
7393
  this.aggregationsPending = true;
7426
- if (this.totalElements > 0 || this.minKnownTotal > 0) {
7394
+ if (this.isPaginated) {
7427
7395
  this.resetPages();
7428
7396
  this.emitPagesForWindow(this.renderStart, this.renderEnd);
7429
7397
  }
@@ -7433,7 +7401,7 @@ const MrdTable = class {
7433
7401
  this.aggregations = null;
7434
7402
  this.aggregationsTotal = null;
7435
7403
  this.aggregationsPending = true;
7436
- if (this.totalElements > 0 || this.minKnownTotal > 0) {
7404
+ if (this.isPaginated) {
7437
7405
  this.resetPages();
7438
7406
  this.emitPagesForWindow(this.renderStart, this.renderEnd);
7439
7407
  }
@@ -7469,8 +7437,7 @@ const MrdTable = class {
7469
7437
  // ── Render: toolbar ────────────────────────────────────────────────────────
7470
7438
  renderToolbar() {
7471
7439
  var _a;
7472
- return (index.h(Toolbar, { locale: this.locale, filterMode: this.filterMode, filterCount: this.activeFilters.size, actions: this.tableActions, views: this.allViews, activeViewIdx: this.activeViewIdx, viewPopoverOpen: this.viewPopoverOpen, createPickerOpen: this.createPickerOpen, createTypes: (_a = this.item) === null || _a === void 0 ? void 0 : _a.createTypes, cb: {
7473
- onFilterToggle: () => this.handleFilterToggle(),
7440
+ return (index.h(Toolbar, { locale: this.locale, filterCount: this.activeFilters.size, actions: this.tableActions, views: this.allViews, activeViewIdx: this.activeViewIdx, viewPopoverOpen: this.viewPopoverOpen, createPickerOpen: this.createPickerOpen, createTypes: (_a = this.item) === null || _a === void 0 ? void 0 : _a.createTypes, cb: {
7474
7441
  onClearAllFilters: () => this.clearAllFilters(),
7475
7442
  onViewSwitch: idx => this.handleViewSwitch(idx),
7476
7443
  onToggleViewPopover: e => this.toggleViewPopover(e),
@@ -7503,7 +7470,7 @@ const MrdTable = class {
7503
7470
  // ── Render: footer ────────────────────────────────────────────────────────
7504
7471
  renderFooter(rowCount, effectiveTotal, isTotalKnown = true) {
7505
7472
  // Non-paginated mode: totalElements=0 and no paginated data loaded yet
7506
- if (this.totalElements === 0 && this.loadedPages.size === 0) {
7473
+ if (!this.isPaginated) {
7507
7474
  const count = rowCount !== null && rowCount !== void 0 ? rowCount : 0;
7508
7475
  if (count === 0)
7509
7476
  return null;
@@ -7537,17 +7504,18 @@ const MrdTable = class {
7537
7504
  // ── Non-paginated mode ──────────────────────────────────────────────────
7538
7505
  // Only enter non-paginated mode when totalElements is 0 AND no paginated data
7539
7506
  // has been loaded yet — prevents the wrong branch when the host omits totalElements.
7540
- if (this.totalElements === 0 && this.loadedPages.size === 0) {
7541
- return (index.h(index.Host, null, this.renderToolbar(), index.h("div", { class: "mrd-table" }, index.h("table", { class: "mrd-table__table" }, index.h("thead", null, index.h("tr", null, this.columns.map(col => {
7507
+ if (!this.isPaginated) {
7508
+ return (index.h(index.Host, { class: { 'mrd-table--resizing': this.resizingCol !== null } }, this.renderToolbar(), index.h("div", { class: "mrd-table" }, index.h("table", { class: "mrd-table__table", style: this.lockedTableStyle() }, index.h("thead", null, index.h("tr", null, this.columns.map((col, idx) => {
7542
7509
  var _a;
7543
7510
  const name = this.colName(col);
7544
7511
  const isFiltered = this.activeFilters.has(name);
7512
+ const isInteractive = !NON_INTERACTIVE_TYPES.has(this.colDataType(col));
7545
7513
  const cls = [
7546
7514
  'mrd-table__header',
7547
7515
  isFiltered ? 'mrd-table__header--filtered' : '',
7548
- this.filterMode ? 'mrd-table__header--sortable' : '',
7516
+ isInteractive ? 'mrd-table__header--sortable' : '',
7549
7517
  ].filter(Boolean).join(' ');
7550
- return (index.h("th", { class: cls, onClick: this.filterMode ? (e) => this.handleFilterOpen(col, e) : undefined }, index.h("span", { class: "mrd-table__header-label" }, (_a = col.label) !== null && _a !== void 0 ? _a : ''), isFiltered && index.h(FilterIcon, null)));
7518
+ return (index.h("th", { class: cls, style: this.colWidths[idx] ? { width: `${this.colWidths[idx]}px` } : undefined, onClick: isInteractive ? (e) => this.handleFilterOpen(col, e) : undefined }, index.h("span", { class: "mrd-table__header-label" }, (_a = col.label) !== null && _a !== void 0 ? _a : ''), isFiltered && index.h(FilterIcon, null), this.renderColResizer(idx)));
7551
7519
  }))), index.h("tbody", null, (_b = this.rows) === null || _b === void 0 ? void 0 : _b.map((row, i) => (index.h("tr", { class: "mrd-table__row mrd-table__row--clickable", style: { background: i % 2 === 0 ? '' : 'var(--mrd-color-neutral-100)' }, onClick: () => this.mrdRowClick.emit({ row }) }, this.columns.map(col => this.renderCell(col, row)))))), this.renderTotalsRow()), (!this.rows || this.rows.length === 0) && (index.h("p", { class: "mrd-table__empty" }, cellRenderer.t('no_results', this.locale)))), this.renderFooter((_c = this.rows) === null || _c === void 0 ? void 0 : _c.length), this.renderFilterPopup(), this.renderTextblockModal(), this.renderJsonModal()));
7552
7520
  }
7553
7521
  // ── Paginated / virtual-scroll mode ────────────────────────────────────
@@ -7561,9 +7529,13 @@ const MrdTable = class {
7561
7529
  const colCount = this.columns.length;
7562
7530
  const topSpacerHeight = this.renderStart * this.rowHeight;
7563
7531
  const bottomSpacerHeight = Math.max(0, (effectiveTotal - 1 - clampedEnd) * this.rowHeight);
7564
- const tableStyle = this.colWidths.length > 0
7565
- ? { tableLayout: 'fixed' }
7566
- : undefined;
7532
+ // Once the widths are frozen the table gets an explicit pixel width (the sum of the
7533
+ // locked columns) instead of the stylesheet's `min-width: max-content`. max-content is
7534
+ // re-derived from the cell contents, so every page that scrolled in with a longer value
7535
+ // widened the table and re-proportioned all columns — the jitter this replaces.
7536
+ // `minWidth: 100%` keeps a narrow table stretched to the container (and still responsive
7537
+ // to container resizes) without ever consulting the content again.
7538
+ const tableStyle = this.lockedTableStyle();
7567
7539
  const renderedRows = [];
7568
7540
  for (let i = this.renderStart; i <= clampedEnd; i++) {
7569
7541
  const row = this.getRow(i);
@@ -7588,7 +7560,7 @@ const MrdTable = class {
7588
7560
  }) }, this.columns.map(col => this.renderCell(col, row))));
7589
7561
  }
7590
7562
  }
7591
- return (index.h(index.Host, null, this.renderToolbar(), index.h("div", { class: "mrd-table__scroll", style: { height: `${this.tableHeight}px` }, onScroll: this.handleScroll }, index.h("table", { class: "mrd-table__table", style: tableStyle }, index.h("thead", null, index.h("tr", null, this.columns.map((col, idx) => {
7563
+ return (index.h(index.Host, { class: { 'mrd-table--resizing': this.resizingCol !== null } }, this.renderToolbar(), index.h("div", { class: "mrd-table__scroll", style: { height: `${this.tableHeight}px` }, onScroll: this.handleScroll }, index.h("table", { class: "mrd-table__table", style: tableStyle }, index.h("thead", null, index.h("tr", null, this.columns.map((col, idx) => {
7592
7564
  var _a;
7593
7565
  const name = this.colName(col);
7594
7566
  const isActive = this.sortField === name;
@@ -7600,7 +7572,7 @@ const MrdTable = class {
7600
7572
  isActive ? `mrd-table__header--sorted-${this.sortDir}` : '',
7601
7573
  isFiltered ? 'mrd-table__header--filtered' : '',
7602
7574
  ].filter(Boolean).join(' ');
7603
- return (index.h("th", { class: cls, style: this.colWidths[idx] ? { width: `${this.colWidths[idx]}px` } : undefined, onClick: isInteractive ? ((e) => this.filterMode ? this.handleFilterOpen(col, e) : this.handleSortClick(col)) : undefined }, index.h("span", { class: "mrd-table__header-label" }, (_a = col.label) !== null && _a !== void 0 ? _a : ''), isInteractive && isActive && (index.h("span", { class: "mrd-table__sort-icon", "aria-hidden": "true" }, this.sortDir === 'asc' ? '▲' : '▼')), isInteractive && !isActive && !this.filterMode && (index.h("span", { class: "mrd-table__sort-icon", "aria-hidden": "true" }, "\u21C5")), isInteractive && isFiltered && index.h(FilterIcon, null)));
7575
+ return (index.h("th", { class: cls, style: this.colWidths[idx] ? { width: `${this.colWidths[idx]}px` } : undefined, onClick: isInteractive ? ((e) => this.handleFilterOpen(col, e)) : undefined }, index.h("span", { class: "mrd-table__header-label" }, (_a = col.label) !== null && _a !== void 0 ? _a : ''), isInteractive && isActive && (index.h("span", { class: "mrd-table__sort-icon", "aria-hidden": "true" }, this.sortDir === 'asc' ? '▲' : '▼')), isInteractive && !isActive && (index.h("span", { class: "mrd-table__sort-icon", "aria-hidden": "true" }, "\u21C5")), isInteractive && isFiltered && index.h(FilterIcon, null), this.renderColResizer(idx)));
7604
7576
  }))), index.h("tbody", null, topSpacerHeight > 0 && (index.h("tr", { class: "mrd-table__spacer", style: { height: `${topSpacerHeight}px` } }, index.h("td", { colSpan: colCount }))), renderedRows, bottomSpacerHeight > 0 && (index.h("tr", { class: "mrd-table__spacer", style: { height: `${bottomSpacerHeight}px` } }, index.h("td", { colSpan: colCount })))), this.renderTotalsRow())), effectiveTotal === 0 && this.loadedPages.has(0) && (index.h("p", { class: "mrd-table__empty" }, cellRenderer.t('no_results', this.locale))), effectiveTotal > 0 && this.renderFooter(undefined, effectiveTotal, this.isTotalKnown()), this.renderFilterPopup(), this.renderTextblockModal(), this.renderJsonModal()));
7605
7577
  }
7606
7578
  renderTextblockModal() {
@@ -7647,7 +7619,7 @@ const MrdTextField = class {
7647
7619
  };
7648
7620
  }
7649
7621
  render() {
7650
- return (index.h(index.Host, { key: '145aa80d06459fe85650702ced893e102762afa8' }, index.h("div", { key: '8f08af9acff56e704d216dc185a5d344b5b9f671', class: "mrd-text-field" }, index.h(FieldLabel, { key: '4e0204ffe7e8460eaf9a4be1535252cc11d0bab7', base: "mrd-text-field", label: this.label, required: this.required }), index.h("input", { key: '4d519077ad96c121ede51e188a2151efe72811db', class: controlClass('mrd-text-field', !!this.error), type: "text", name: this.name, value: this.value, placeholder: this.placeholder, required: this.required, disabled: this.disabled, onInput: this.handleInput, onBlur: this.handleBlur }), index.h(FieldError, { key: '3c5af47037f6d6851503d769429d6c0f786d389d', base: "mrd-text-field", error: this.error }))));
7622
+ return (index.h(index.Host, { key: '3153f0c6f8ab4d9dae93306f7507399aeda75eaf' }, index.h("div", { key: '5d9c28023fdfb5472fc115c66bc3df509506e10f', class: "mrd-text-field" }, index.h(FieldLabel, { key: '1e21139aae0cc1ae95aa3297271b618a40043e77', base: "mrd-text-field", label: this.label, required: this.required }), index.h("input", { key: '46f98d5e39bb834075449fac7096b077a1ae7bb3', class: controlClass('mrd-text-field', !!this.error), type: "text", name: this.name, value: this.value, placeholder: this.placeholder, required: this.required, disabled: this.disabled, onInput: this.handleInput, onBlur: this.handleBlur }), index.h(FieldError, { key: '10b6ddae9cd9f36dc9d7176167d79df8e4102c03', base: "mrd-text-field", error: this.error }))));
7651
7623
  }
7652
7624
  };
7653
7625
  MrdTextField.style = mrdTextFieldCss();
@@ -7719,7 +7691,7 @@ const MrdTextareaField = class {
7719
7691
  return purify.sanitize(html);
7720
7692
  }
7721
7693
  render() {
7722
- return (index.h(index.Host, { key: 'e7c53e9cf54bd4138b42ca3bc7bb5381aad3e4ac' }, index.h("div", { key: 'bf580a74d2233704852c7d3083ec91c9bbe868ad', class: "mrd-textarea-field" }, index.h(FieldLabel, { key: '7de50cb2865e83c7fe1ef9b6b099b639e165909c', base: "mrd-textarea-field", label: this.label, required: this.required }), index.h("div", { key: 'c78e914091cd70b52c1e9cd0046e7c97bcc7e799', class: controlClass('mrd-textarea-field', !!this.error, 'container') }, index.h("div", { key: '604a157e82ca8a4d98bbd1c928e9f8b41d031227', class: "mrd-textarea-field__editor" })), index.h(FieldError, { key: 'd0263a7285b928be6ed377e7e0fa3f53a555dadd', base: "mrd-textarea-field", error: this.error }))));
7694
+ return (index.h(index.Host, { key: 'e132531881f68f373e700617aac8033c8ebccb47' }, index.h("div", { key: 'fec0cf56cd7868d3fcd5a4e8a382b2dcdb6e5c50', class: "mrd-textarea-field" }, index.h(FieldLabel, { key: '333aa2ff57cce9e3178f0c4be4a1df1077884248', base: "mrd-textarea-field", label: this.label, required: this.required }), index.h("div", { key: '40025207580eb5768981b85aaa0a8ff95fce7234', class: controlClass('mrd-textarea-field', !!this.error, 'container') }, index.h("div", { key: '621987b3b2b1d8b4836bff065075ba527a82db81', class: "mrd-textarea-field__editor" })), index.h(FieldError, { key: 'ac2d8de22f008cd1c91842137ccd0cd36eb9ce19', base: "mrd-textarea-field", error: this.error }))));
7723
7695
  }
7724
7696
  get el() { return index.getElement(this); }
7725
7697
  };
@@ -7750,7 +7722,7 @@ const MrdTimeField = class {
7750
7722
  };
7751
7723
  }
7752
7724
  render() {
7753
- return (index.h(index.Host, { key: 'ef3876dd5c1d72bdbdb65cba00ea0992ba2ab2b6' }, index.h("div", { key: '6b217f6c6ec0dbb8b3249dfab6443b8f6140891c', class: "mrd-time-field" }, index.h(FieldLabel, { key: '87adbcc4bf1ccad07d899a315cb14a00650af09c', base: "mrd-time-field", label: this.label, required: this.required }), index.h("input", { key: '870fcf7e0df2ee2804f95fdc79c890b3e27bba3f', class: controlClass('mrd-time-field', !!this.error), type: "time", name: this.name, value: this.value, required: this.required, disabled: this.disabled, onChange: this.handleChange, onBlur: this.handleBlur }), index.h(FieldError, { key: '03c21d23fbc039ffd79856134d181dffcb9e3621', base: "mrd-time-field", error: this.error }))));
7725
+ return (index.h(index.Host, { key: 'd521c654bc7beda71a31542a25198edaaf53b838' }, index.h("div", { key: '084ab16ac8aed952bd0ec50e0430591d4db5bd4b', class: "mrd-time-field" }, index.h(FieldLabel, { key: '43938ad7c5a9765353f6523d399d4b74cbb9ec6f', base: "mrd-time-field", label: this.label, required: this.required }), index.h("input", { key: 'e46eda620e7a5f1bb3b433a4c051e913675c33f9', class: controlClass('mrd-time-field', !!this.error), type: "time", name: this.name, value: this.value, required: this.required, disabled: this.disabled, onChange: this.handleChange, onBlur: this.handleBlur }), index.h(FieldError, { key: '34bc1eaa1b969951dffaaacad73af532b6d290fb', base: "mrd-time-field", error: this.error }))));
7754
7726
  }
7755
7727
  };
7756
7728
  MrdTimeField.style = mrdTimeFieldCss();