web-mojo 2.1.715 → 2.1.758
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin.cjs.js +1 -1
- package/dist/admin.cjs.js.map +1 -1
- package/dist/admin.es.js +38 -10
- package/dist/admin.es.js.map +1 -1
- package/dist/auth.cjs.js +1 -1
- package/dist/auth.cjs.js.map +1 -1
- package/dist/auth.es.js +3 -3
- package/dist/auth.es.js.map +1 -1
- package/dist/charts.cjs.js +1 -1
- package/dist/charts.es.js +2 -2
- package/dist/chunks/{ChatView-7Tl6j0_F.js → ChatView-CoCylKpB.js} +6 -6
- package/dist/chunks/{ChatView-7Tl6j0_F.js.map → ChatView-CoCylKpB.js.map} +1 -1
- package/dist/chunks/{ChatView-CE-aPq-f.js → ChatView-S4pMSPhI.js} +2 -2
- package/dist/chunks/{ChatView-CE-aPq-f.js.map → ChatView-S4pMSPhI.js.map} +1 -1
- package/dist/chunks/{ContextMenu-CvnzcVHB.js → ContextMenu-BKUnE3JT.js} +2 -2
- package/dist/chunks/{ContextMenu-CvnzcVHB.js.map → ContextMenu-BKUnE3JT.js.map} +1 -1
- package/dist/chunks/{ContextMenu-Cii4P-GY.js → ContextMenu-C5RTltSd.js} +2 -2
- package/dist/chunks/{ContextMenu-Cii4P-GY.js.map → ContextMenu-C5RTltSd.js.map} +1 -1
- package/dist/chunks/{DataView-CcrHGiuV.js → DataView-D7CYJ31b.js} +2 -2
- package/dist/chunks/{DataView-CcrHGiuV.js.map → DataView-D7CYJ31b.js.map} +1 -1
- package/dist/chunks/{DataView-ZL2WzpAF.js → DataView-idgJVB89.js} +2 -2
- package/dist/chunks/{DataView-ZL2WzpAF.js.map → DataView-idgJVB89.js.map} +1 -1
- package/dist/chunks/{Dialog-C6aTVGxC.js → Dialog-4ra2w2tV.js} +2 -2
- package/dist/chunks/{Dialog-C6aTVGxC.js.map → Dialog-4ra2w2tV.js.map} +1 -1
- package/dist/chunks/{Dialog-BN3tLJrQ.js → Dialog-BPhwGiQx.js} +5 -5
- package/dist/chunks/{Dialog-BN3tLJrQ.js.map → Dialog-BPhwGiQx.js.map} +1 -1
- package/dist/chunks/{FormView-DtnOoMzi.js → FormView-C1ljUoea.js} +3 -3
- package/dist/chunks/FormView-C1ljUoea.js.map +1 -0
- package/dist/chunks/{FormView-sG1KQVJ8.js → FormView-a7Rl2bmm.js} +108 -78
- package/dist/chunks/FormView-a7Rl2bmm.js.map +1 -0
- package/dist/chunks/{MetricsMiniChartWidget-Yaiay78O.js → MetricsMiniChartWidget-hdDNDf7M.js} +3 -3
- package/dist/chunks/{MetricsMiniChartWidget-Yaiay78O.js.map → MetricsMiniChartWidget-hdDNDf7M.js.map} +1 -1
- package/dist/chunks/{MetricsMiniChartWidget-CUDzMBUf.js → MetricsMiniChartWidget-m_U_ucCF.js} +2 -2
- package/dist/chunks/{MetricsMiniChartWidget-CUDzMBUf.js.map → MetricsMiniChartWidget-m_U_ucCF.js.map} +1 -1
- package/dist/chunks/{PDFViewer-BpxaCqau.js → PDFViewer-DwJDeXQH.js} +3 -3
- package/dist/chunks/{PDFViewer-BpxaCqau.js.map → PDFViewer-DwJDeXQH.js.map} +1 -1
- package/dist/chunks/{PDFViewer-BGkd1E_i.js → PDFViewer-OvkZ_4H3.js} +2 -2
- package/dist/chunks/{PDFViewer-BGkd1E_i.js.map → PDFViewer-OvkZ_4H3.js.map} +1 -1
- package/dist/chunks/{Page-DCQIIrE5.js → Page-CbWUdARI.js} +2 -2
- package/dist/chunks/{Page-DCQIIrE5.js.map → Page-CbWUdARI.js.map} +1 -1
- package/dist/chunks/{Page-bKLxXw4z.js → Page-D7lbK30W.js} +2 -2
- package/dist/chunks/{Page-bKLxXw4z.js.map → Page-D7lbK30W.js.map} +1 -1
- package/dist/chunks/{TopNav-CPyGSny9.js → TopNav-B7o7jhkD.js} +5 -5
- package/dist/chunks/{TopNav-CPyGSny9.js.map → TopNav-B7o7jhkD.js.map} +1 -1
- package/dist/chunks/{TopNav-LA4BgF6l.js → TopNav-CKfu-goV.js} +2 -2
- package/dist/chunks/{TopNav-LA4BgF6l.js.map → TopNav-CKfu-goV.js.map} +1 -1
- package/dist/chunks/{WebApp-CPQTGurF.js → WebApp-CYCNA3GB.js} +13 -13
- package/dist/chunks/{WebApp-CPQTGurF.js.map → WebApp-CYCNA3GB.js.map} +1 -1
- package/dist/chunks/{WebApp-PnDZlAh-.js → WebApp-Cnkm2125.js} +2 -2
- package/dist/chunks/{WebApp-PnDZlAh-.js.map → WebApp-Cnkm2125.js.map} +1 -1
- package/dist/core.css +12 -0
- package/dist/css/web-mojo.css +1 -1
- package/dist/docit.cjs.js +1 -1
- package/dist/docit.es.js +5 -5
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +11 -11
- package/dist/lightbox.cjs.js +1 -1
- package/dist/lightbox.es.js +4 -4
- package/package.json +1 -1
- package/dist/chunks/FormView-DtnOoMzi.js.map +0 -1
- package/dist/chunks/FormView-sG1KQVJ8.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as Mustache, h as MOJOUtils, V as View } from "./WebApp-
|
|
1
|
+
import { M as Mustache, h as MOJOUtils, V as View } from "./WebApp-CYCNA3GB.js";
|
|
2
2
|
class FormBuilder {
|
|
3
3
|
constructor(config = {}) {
|
|
4
4
|
this.fields = config.fields || [];
|
|
@@ -3282,35 +3282,32 @@ class CollectionMultiSelectView extends View {
|
|
|
3282
3282
|
{{label}}{{#required}}<span class="text-danger">*</span>{{/required}}
|
|
3283
3283
|
</label>
|
|
3284
3284
|
{{/label}}
|
|
3285
|
-
|
|
3286
|
-
{{#
|
|
3285
|
+
|
|
3286
|
+
{{#loading}}
|
|
3287
3287
|
<div class="text-center py-3">
|
|
3288
3288
|
<div class="spinner-border spinner-border-sm" role="status">
|
|
3289
3289
|
<span class="visually-hidden">Loading...</span>
|
|
3290
3290
|
</div>
|
|
3291
3291
|
</div>
|
|
3292
|
-
{{/
|
|
3293
|
-
|
|
3294
|
-
{{^
|
|
3295
|
-
{{#
|
|
3296
|
-
<div class="collection-multiselect-list border rounded" style="max-height: {{maxHeight}}px; overflow-y: auto;">
|
|
3297
|
-
{{#
|
|
3298
|
-
<div class="
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
<label class="form-check-label w-100" for="{{fieldId}}_{{valueField}}">
|
|
3308
|
-
{{labelField}}
|
|
3309
|
-
</label>
|
|
3292
|
+
{{/loading}}
|
|
3293
|
+
|
|
3294
|
+
{{^loading}}
|
|
3295
|
+
{{#items.length}}
|
|
3296
|
+
<div class="collection-multiselect-list border rounded p-3" style="max-height: {{maxHeight}}px; overflow-y: auto; background: #fff;">
|
|
3297
|
+
{{#items}}
|
|
3298
|
+
<div class="d-flex align-items-center mb-2 py-1 px-2 rounded {{^disabled}}hover-bg{{/disabled}}"
|
|
3299
|
+
style="cursor: {{^disabled}}pointer{{/disabled}}{{#disabled}}not-allowed{{/disabled}}; user-select: none; transition: background-color 0.15s;"
|
|
3300
|
+
data-action="{{^disabled}}toggle-item{{/disabled}}"
|
|
3301
|
+
data-value="{{value}}"
|
|
3302
|
+
data-index="{{index}}"
|
|
3303
|
+
{{#disabled}}data-disabled="true"{{/disabled}}>
|
|
3304
|
+
<i class="bi {{#isSelected}}bi-check-square-fill text-primary{{/isSelected}}{{^isSelected}}bi-square{{/isSelected}} me-2"
|
|
3305
|
+
style="font-size: 1.25rem;"></i>
|
|
3306
|
+
<span {{#disabled}}class="text-muted"{{/disabled}}>{{label}}</span>
|
|
3310
3307
|
</div>
|
|
3311
|
-
{{/
|
|
3308
|
+
{{/items}}
|
|
3312
3309
|
</div>
|
|
3313
|
-
|
|
3310
|
+
|
|
3314
3311
|
{{#showSelectAll}}
|
|
3315
3312
|
<div class="mt-2">
|
|
3316
3313
|
<button type="button" class="btn btn-sm btn-outline-secondary me-2" data-action="select-all">
|
|
@@ -3321,15 +3318,15 @@ class CollectionMultiSelectView extends View {
|
|
|
3321
3318
|
</button>
|
|
3322
3319
|
</div>
|
|
3323
3320
|
{{/showSelectAll}}
|
|
3324
|
-
{{/
|
|
3325
|
-
|
|
3326
|
-
{{^
|
|
3321
|
+
{{/items.length}}
|
|
3322
|
+
|
|
3323
|
+
{{^items.length}}
|
|
3327
3324
|
<div class="text-muted text-center py-3 border rounded">
|
|
3328
3325
|
No items available
|
|
3329
3326
|
</div>
|
|
3330
|
-
{{/^
|
|
3331
|
-
{{/
|
|
3332
|
-
|
|
3327
|
+
{{/^items.length}}
|
|
3328
|
+
{{/loading}}
|
|
3329
|
+
|
|
3333
3330
|
{{#help}}
|
|
3334
3331
|
<div class="form-text">{{help}}</div>
|
|
3335
3332
|
{{/help}}
|
|
@@ -3357,8 +3354,14 @@ class CollectionMultiSelectView extends View {
|
|
|
3357
3354
|
this.showSelectAll = options.showSelectAll !== false;
|
|
3358
3355
|
this.selectedValues = Array.isArray(options.value) ? options.value : [];
|
|
3359
3356
|
this.loading = false;
|
|
3357
|
+
this.items = [];
|
|
3358
|
+
this.lastClickedIndex = -1;
|
|
3360
3359
|
this.fieldId = options.fieldId || `field_${this.name}`;
|
|
3361
|
-
|
|
3360
|
+
}
|
|
3361
|
+
onInit() {
|
|
3362
|
+
if (this.collection) {
|
|
3363
|
+
this.setupCollection();
|
|
3364
|
+
}
|
|
3362
3365
|
}
|
|
3363
3366
|
setupCollection() {
|
|
3364
3367
|
if (!this.collection) {
|
|
@@ -3374,46 +3377,43 @@ class CollectionMultiSelectView extends View {
|
|
|
3374
3377
|
this.collection.params.group = app.activeGroup.id;
|
|
3375
3378
|
}
|
|
3376
3379
|
}
|
|
3377
|
-
this.collection.on("
|
|
3378
|
-
this.loading =
|
|
3379
|
-
this.render();
|
|
3380
|
+
this.collection.on("fetch:start", () => {
|
|
3381
|
+
this.loading = true;
|
|
3382
|
+
this.render(false);
|
|
3380
3383
|
});
|
|
3381
|
-
this.collection.on("
|
|
3384
|
+
this.collection.on("fetch:end", () => {
|
|
3382
3385
|
this.loading = false;
|
|
3383
|
-
|
|
3384
|
-
this.render();
|
|
3386
|
+
this.updateItems();
|
|
3387
|
+
this.render(false);
|
|
3385
3388
|
});
|
|
3386
|
-
if (this.collection.isEmpty()) {
|
|
3387
|
-
this.
|
|
3389
|
+
if (!this.collection.isEmpty()) {
|
|
3390
|
+
this.updateItems();
|
|
3391
|
+
}
|
|
3392
|
+
}
|
|
3393
|
+
onAfterMount() {
|
|
3394
|
+
if (this.collection && this.collection.isEmpty()) {
|
|
3388
3395
|
this.collection.fetch();
|
|
3389
3396
|
}
|
|
3390
3397
|
}
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3398
|
+
/**
|
|
3399
|
+
* Update items array from collection
|
|
3400
|
+
*/
|
|
3401
|
+
updateItems() {
|
|
3402
|
+
const filteredModels = this.collection.models.filter((model) => {
|
|
3403
|
+
const modelId = this.getFieldValue(model, this.valueField);
|
|
3404
|
+
return !this.excludeIds.some((id) => id == modelId);
|
|
3405
|
+
});
|
|
3406
|
+
this.items = filteredModels.map((model, index) => {
|
|
3397
3407
|
const labelValue = this.getFieldValue(model, this.labelField);
|
|
3398
3408
|
const fieldValue = this.getFieldValue(model, this.valueField);
|
|
3399
3409
|
return {
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3410
|
+
label: labelValue,
|
|
3411
|
+
value: fieldValue,
|
|
3412
|
+
index,
|
|
3413
|
+
isSelected: this.selectedValues.some((v) => v == fieldValue),
|
|
3403
3414
|
disabled: this.disabled
|
|
3404
3415
|
};
|
|
3405
3416
|
});
|
|
3406
|
-
return {
|
|
3407
|
-
loading: this.loading,
|
|
3408
|
-
items,
|
|
3409
|
-
label: this.label,
|
|
3410
|
-
help: this.help,
|
|
3411
|
-
error: this.error,
|
|
3412
|
-
required: this.required,
|
|
3413
|
-
showSelectAll: this.showSelectAll && items.length > 0,
|
|
3414
|
-
maxHeight: this.maxHeight,
|
|
3415
|
-
fieldId: this.fieldId
|
|
3416
|
-
};
|
|
3417
3417
|
}
|
|
3418
3418
|
/**
|
|
3419
3419
|
* Get field value from model or object, supporting dot notation
|
|
@@ -3430,18 +3430,48 @@ class CollectionMultiSelectView extends View {
|
|
|
3430
3430
|
return MOJOUtils.getNestedValue(item, fieldPath);
|
|
3431
3431
|
}
|
|
3432
3432
|
/**
|
|
3433
|
-
* Handle
|
|
3433
|
+
* Handle item toggle with shift-click range selection support
|
|
3434
3434
|
*/
|
|
3435
|
-
|
|
3435
|
+
handleActionToggleItem(event, element) {
|
|
3436
3436
|
const value = element.getAttribute("data-value");
|
|
3437
|
-
const
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3437
|
+
const clickedIndex = parseInt(element.getAttribute("data-index"), 10);
|
|
3438
|
+
const numValue = Number(value);
|
|
3439
|
+
const typedValue = !isNaN(numValue) && String(numValue) === value ? numValue : value;
|
|
3440
|
+
if (event.shiftKey && this.lastClickedIndex !== -1 && this.lastClickedIndex !== clickedIndex) {
|
|
3441
|
+
const isCurrentlySelected = this.selectedValues.some((v) => v == typedValue);
|
|
3442
|
+
const shouldSelect = !isCurrentlySelected;
|
|
3443
|
+
const start = Math.min(this.lastClickedIndex, clickedIndex);
|
|
3444
|
+
const end = Math.max(this.lastClickedIndex, clickedIndex);
|
|
3445
|
+
for (let i = start; i <= end; i++) {
|
|
3446
|
+
const item = this.items[i];
|
|
3447
|
+
if (item && !item.disabled) {
|
|
3448
|
+
const itemNumValue = Number(item.value);
|
|
3449
|
+
const itemTypedValue = !isNaN(itemNumValue) && String(itemNumValue) === String(item.value) ? itemNumValue : item.value;
|
|
3450
|
+
if (shouldSelect) {
|
|
3451
|
+
if (!this.selectedValues.some((v) => v == itemTypedValue)) {
|
|
3452
|
+
this.selectedValues.push(itemTypedValue);
|
|
3453
|
+
}
|
|
3454
|
+
item.isSelected = true;
|
|
3455
|
+
} else {
|
|
3456
|
+
this.selectedValues = this.selectedValues.filter((v) => v != itemTypedValue);
|
|
3457
|
+
item.isSelected = false;
|
|
3458
|
+
}
|
|
3459
|
+
}
|
|
3441
3460
|
}
|
|
3442
3461
|
} else {
|
|
3443
|
-
|
|
3462
|
+
const isCurrentlySelected = this.selectedValues.some((v) => v == typedValue);
|
|
3463
|
+
if (isCurrentlySelected) {
|
|
3464
|
+
this.selectedValues = this.selectedValues.filter((v) => v != typedValue);
|
|
3465
|
+
} else {
|
|
3466
|
+
this.selectedValues.push(typedValue);
|
|
3467
|
+
}
|
|
3468
|
+
const item = this.items.find((i) => i.value == value);
|
|
3469
|
+
if (item) {
|
|
3470
|
+
item.isSelected = !isCurrentlySelected;
|
|
3471
|
+
}
|
|
3444
3472
|
}
|
|
3473
|
+
this.lastClickedIndex = clickedIndex;
|
|
3474
|
+
this.render(false);
|
|
3445
3475
|
this.emit("change", {
|
|
3446
3476
|
value: this.selectedValues,
|
|
3447
3477
|
name: this.name
|
|
@@ -3452,14 +3482,13 @@ class CollectionMultiSelectView extends View {
|
|
|
3452
3482
|
*/
|
|
3453
3483
|
async handleActionSelectAll(event, element) {
|
|
3454
3484
|
event.preventDefault();
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
this.selectedValues.push(value);
|
|
3485
|
+
this.selectedValues = this.items.filter((item) => !item.disabled).map((item) => item.value);
|
|
3486
|
+
this.items.forEach((item) => {
|
|
3487
|
+
if (!item.disabled) {
|
|
3488
|
+
item.isSelected = true;
|
|
3460
3489
|
}
|
|
3461
|
-
cb.checked = true;
|
|
3462
3490
|
});
|
|
3491
|
+
this.render(false);
|
|
3463
3492
|
this.emit("change", {
|
|
3464
3493
|
value: this.selectedValues,
|
|
3465
3494
|
name: this.name
|
|
@@ -3470,11 +3499,11 @@ class CollectionMultiSelectView extends View {
|
|
|
3470
3499
|
*/
|
|
3471
3500
|
async handleActionDeselectAll(event, element) {
|
|
3472
3501
|
event.preventDefault();
|
|
3473
|
-
const checkboxes = this.element.querySelectorAll('input[type="checkbox"]');
|
|
3474
|
-
checkboxes.forEach((cb) => {
|
|
3475
|
-
cb.checked = false;
|
|
3476
|
-
});
|
|
3477
3502
|
this.selectedValues = [];
|
|
3503
|
+
this.items.forEach((item) => {
|
|
3504
|
+
item.isSelected = false;
|
|
3505
|
+
});
|
|
3506
|
+
this.render(false);
|
|
3478
3507
|
this.emit("change", {
|
|
3479
3508
|
value: this.selectedValues,
|
|
3480
3509
|
name: this.name
|
|
@@ -3491,6 +3520,7 @@ class CollectionMultiSelectView extends View {
|
|
|
3491
3520
|
*/
|
|
3492
3521
|
setValue(values) {
|
|
3493
3522
|
this.selectedValues = Array.isArray(values) ? values : [];
|
|
3523
|
+
this.updateItems();
|
|
3494
3524
|
this.render();
|
|
3495
3525
|
}
|
|
3496
3526
|
/**
|
|
@@ -3498,14 +3528,13 @@ class CollectionMultiSelectView extends View {
|
|
|
3498
3528
|
*/
|
|
3499
3529
|
setExcludeIds(ids) {
|
|
3500
3530
|
this.excludeIds = Array.isArray(ids) ? ids : [];
|
|
3531
|
+
this.updateItems();
|
|
3501
3532
|
this.render();
|
|
3502
3533
|
}
|
|
3503
3534
|
/**
|
|
3504
3535
|
* Refresh the collection
|
|
3505
3536
|
*/
|
|
3506
3537
|
async refresh() {
|
|
3507
|
-
this.loading = true;
|
|
3508
|
-
this.render();
|
|
3509
3538
|
await this.collection.fetch();
|
|
3510
3539
|
}
|
|
3511
3540
|
/**
|
|
@@ -4966,6 +4995,7 @@ class FormView extends View {
|
|
|
4966
4995
|
this.handleFieldChange(fieldName, data.value);
|
|
4967
4996
|
});
|
|
4968
4997
|
} catch (error) {
|
|
4998
|
+
console.error("CollectionMultiSelect initialization failed:", error);
|
|
4969
4999
|
}
|
|
4970
5000
|
});
|
|
4971
5001
|
}
|
|
@@ -6566,4 +6596,4 @@ export {
|
|
|
6566
6596
|
applyFileDropMixin as a,
|
|
6567
6597
|
FormView$1 as b
|
|
6568
6598
|
};
|
|
6569
|
-
//# sourceMappingURL=FormView-
|
|
6599
|
+
//# sourceMappingURL=FormView-a7Rl2bmm.js.map
|