web-mojo 2.2.15 → 2.2.17

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 (43) hide show
  1. package/dist/admin.cjs.js +1 -1
  2. package/dist/admin.es.js +7 -7
  3. package/dist/auth.cjs.js +1 -1
  4. package/dist/auth.es.js +1 -1
  5. package/dist/charts.cjs.js +1 -1
  6. package/dist/charts.es.js +3 -3
  7. package/dist/chunks/{ChatView-BJK6SF8T.js → ChatView-BkNdhS7Y.js} +2 -2
  8. package/dist/chunks/{ChatView-BJK6SF8T.js.map → ChatView-BkNdhS7Y.js.map} +1 -1
  9. package/dist/chunks/{ChatView-BPVE1u2i.js → ChatView-E17fCJ1j.js} +34 -6
  10. package/dist/chunks/{ChatView-BPVE1u2i.js.map → ChatView-E17fCJ1j.js.map} +1 -1
  11. package/dist/chunks/{Dialog-RzLLLfJD.js → Dialog-BGsJJdvU.js} +3 -3
  12. package/dist/chunks/{Dialog-RzLLLfJD.js.map → Dialog-BGsJJdvU.js.map} +1 -1
  13. package/dist/chunks/{Dialog--hl_Uh6X.js → Dialog-Bib7iGr7.js} +2 -2
  14. package/dist/chunks/{Dialog--hl_Uh6X.js.map → Dialog-Bib7iGr7.js.map} +1 -1
  15. package/dist/chunks/{FormView-C1emfj3B.js → FormView-72VleKRt.js} +3 -3
  16. package/dist/chunks/FormView-72VleKRt.js.map +1 -0
  17. package/dist/chunks/{FormView--WuITh01.js → FormView-D_VTD2EY.js} +54 -11
  18. package/dist/chunks/FormView-D_VTD2EY.js.map +1 -0
  19. package/dist/chunks/{MetricsMiniChartWidget-DoxqoF1X.js → MetricsMiniChartWidget-CMplnXWP.js} +2 -2
  20. package/dist/chunks/{MetricsMiniChartWidget-DoxqoF1X.js.map → MetricsMiniChartWidget-CMplnXWP.js.map} +1 -1
  21. package/dist/chunks/{MetricsMiniChartWidget-DyVs4Wt0.js → MetricsMiniChartWidget-DfW7iH5B.js} +2 -2
  22. package/dist/chunks/{MetricsMiniChartWidget-DyVs4Wt0.js.map → MetricsMiniChartWidget-DfW7iH5B.js.map} +1 -1
  23. package/dist/chunks/{PDFViewer-BxFcG82d.js → PDFViewer-BYKfJGbN.js} +2 -2
  24. package/dist/chunks/{PDFViewer-BxFcG82d.js.map → PDFViewer-BYKfJGbN.js.map} +1 -1
  25. package/dist/chunks/{PDFViewer-CHX2NLkG.js → PDFViewer-C9hCxlyT.js} +2 -2
  26. package/dist/chunks/{PDFViewer-CHX2NLkG.js.map → PDFViewer-C9hCxlyT.js.map} +1 -1
  27. package/dist/chunks/{TokenManager-DFWJ-cuN.js → TokenManager-D1R8RZaL.js} +2 -2
  28. package/dist/chunks/{TokenManager-DFWJ-cuN.js.map → TokenManager-D1R8RZaL.js.map} +1 -1
  29. package/dist/chunks/{TokenManager-Bi5eDY8Y.js → TokenManager-DhnHDZlt.js} +2 -2
  30. package/dist/chunks/{TokenManager-Bi5eDY8Y.js.map → TokenManager-DhnHDZlt.js.map} +1 -1
  31. package/dist/chunks/{version-BzRzH4mJ.js → version-AvfnTsnK.js} +2 -2
  32. package/dist/chunks/{version-BzRzH4mJ.js.map → version-AvfnTsnK.js.map} +1 -1
  33. package/dist/chunks/{version-S1OYxk1c.js → version-BrSBoryP.js} +4 -4
  34. package/dist/chunks/{version-S1OYxk1c.js.map → version-BrSBoryP.js.map} +1 -1
  35. package/dist/docit.cjs.js +1 -1
  36. package/dist/docit.es.js +3 -3
  37. package/dist/index.cjs.js +1 -1
  38. package/dist/index.es.js +7 -7
  39. package/dist/lightbox.cjs.js +1 -1
  40. package/dist/lightbox.es.js +4 -4
  41. package/package.json +1 -1
  42. package/dist/chunks/FormView--WuITh01.js.map +0 -1
  43. package/dist/chunks/FormView-C1emfj3B.js.map +0 -1
@@ -5089,11 +5089,12 @@ class DateRangePicker extends View {
5089
5089
  picker.on("hide", () => {
5090
5090
  this.emit("picker:hide");
5091
5091
  });
5092
+ picker.on("ready", () => {
5093
+ this.applyInitialRange(picker);
5094
+ });
5092
5095
  };
5093
5096
  this.picker = new window.easepick.create(config);
5094
- if (this.currentStartDate && this.currentEndDate) {
5095
- this.picker.setDateRange(this.currentStartDate, this.currentEndDate);
5096
- }
5097
+ this.applyInitialRange(this.picker);
5097
5098
  } catch (error) {
5098
5099
  console.error("Failed to initialize Easepick range picker:", error);
5099
5100
  this.useNative = true;
@@ -5367,7 +5368,9 @@ class DateRangePicker extends View {
5367
5368
  this.currentStartDate = startDate;
5368
5369
  this.currentEndDate = endDate;
5369
5370
  if (this.picker && this.easepickLoaded) {
5370
- this.picker.setDateRange(startDate || null, endDate || null);
5371
+ const start = this.normalizeDateValue(startDate);
5372
+ const end = this.normalizeDateValue(endDate);
5373
+ this.picker.setDateRange(start || null, end || null);
5371
5374
  } else if (this.useNative) {
5372
5375
  const startInput = this.element?.querySelector(`[name="${this.name}_start"]`);
5373
5376
  const endInput = this.element?.querySelector(`[name="${this.name}_end"]`);
@@ -5382,6 +5385,37 @@ class DateRangePicker extends View {
5382
5385
  this.updateHiddenInputs();
5383
5386
  this.emit("range:set", { startDate, endDate });
5384
5387
  }
5388
+ applyInitialRange(picker) {
5389
+ if (!picker || !(this.currentStartDate || this.currentEndDate)) {
5390
+ return;
5391
+ }
5392
+ const start = this.normalizeDateValue(this.currentStartDate);
5393
+ const end = this.normalizeDateValue(this.currentEndDate);
5394
+ if (start || end) {
5395
+ picker.setDateRange(start || null, end || null);
5396
+ }
5397
+ }
5398
+ normalizeDateValue(value) {
5399
+ if (!value && value !== 0) return null;
5400
+ if (value instanceof Date) {
5401
+ return isNaN(value) ? null : value;
5402
+ }
5403
+ const str = String(value).trim();
5404
+ if (!str) return null;
5405
+ if (/^\d{4}-\d{2}-\d{2}$/.test(str)) {
5406
+ const [year, month, day] = str.split("-").map(Number);
5407
+ const date2 = new Date(year, month - 1, day);
5408
+ return isNaN(date2) ? null : date2;
5409
+ }
5410
+ if (/^-?\d+$/.test(str)) {
5411
+ const num = Number(str);
5412
+ const ms = str.length <= 10 ? num * 1e3 : num;
5413
+ const date2 = new Date(ms);
5414
+ return isNaN(date2) ? null : date2;
5415
+ }
5416
+ const date = new Date(str);
5417
+ return isNaN(date) ? null : date;
5418
+ }
5385
5419
  /**
5386
5420
  * Get the current date range
5387
5421
  */
@@ -6128,7 +6162,16 @@ class ComboBox extends View {
6128
6162
  this.name = options.name || "combo";
6129
6163
  this.placeholder = options.placeholder || options.placeHolder || "Type or select...";
6130
6164
  this.value = options.value || "";
6131
- this.options = options.options || [];
6165
+ this.options = (options.options || []).map((option) => {
6166
+ if (typeof option === "string") {
6167
+ return { label: option, value: option };
6168
+ }
6169
+ if (typeof option === "object" && option !== null) {
6170
+ return option;
6171
+ } else {
6172
+ return { label: option, value: option };
6173
+ }
6174
+ });
6132
6175
  this.allowCustom = options.allowCustom !== false;
6133
6176
  this.disabled = options.disabled || false;
6134
6177
  this.required = options.required || false;
@@ -6139,22 +6182,22 @@ class ComboBox extends View {
6139
6182
  this.template = `
6140
6183
  <div class="combobox-container">
6141
6184
  <div class="input-group">
6142
- <input type="text"
6143
- class="form-control combobox-input"
6185
+ <input type="text"
6186
+ class="form-control combobox-input"
6144
6187
  placeholder="{{placeholder}}"
6145
6188
  value="{{value}}"
6146
6189
  {{#disabled}}disabled{{/disabled}}
6147
6190
  {{#required}}required{{/required}}
6148
6191
  data-action="combobox-input"
6149
6192
  autocomplete="off">
6150
- <button class="btn btn-outline-secondary combobox-toggle"
6193
+ <button class="btn btn-outline-secondary combobox-toggle"
6151
6194
  type="button"
6152
6195
  data-action="combobox-toggle"
6153
6196
  {{#disabled}}disabled{{/disabled}}>
6154
6197
  <i class="bi bi-chevron-down"></i>
6155
6198
  </button>
6156
6199
  </div>
6157
- <div class="dropdown-menu combobox-dropdown"
6200
+ <div class="dropdown-menu combobox-dropdown"
6158
6201
  style="max-height: {{maxHeight}}px; overflow-y: auto; width: 100%;">
6159
6202
  <div data-region="dropdown-items"></div>
6160
6203
  {{^allowCustom}}
@@ -6167,7 +6210,7 @@ class ComboBox extends View {
6167
6210
  `;
6168
6211
  this.itemTemplate = `
6169
6212
  {{#items}}
6170
- <button type="button"
6213
+ <button type="button"
6171
6214
  class="dropdown-item combobox-item {{#highlighted}}active{{/highlighted}}"
6172
6215
  data-action="select-item"
6173
6216
  data-value="{{value}}"
@@ -8549,4 +8592,4 @@ export {
8549
8592
  applyFileDropMixin as a,
8550
8593
  FormView$1 as b
8551
8594
  };
8552
- //# sourceMappingURL=FormView--WuITh01.js.map
8595
+ //# sourceMappingURL=FormView-D_VTD2EY.js.map