arengibook 2.0.20-table → 2.0.22-table
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/index.js +19 -42
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -44173,7 +44173,7 @@ var ToastPresets = {
|
|
|
44173
44173
|
}
|
|
44174
44174
|
};
|
|
44175
44175
|
|
|
44176
|
-
var css_248z$1 = ".arengi-table td {\n overflow: visible !important;\n}\n\n.arengi-table .p-cell-editing input,\n.arengi-table .p-cell-editing .p-inputtext,\n.arengi-table .p-cell-editing .p-dropdown,\n.arengi-table .p-cell-editing .p-multiselect,\n.arengi-table .p-cell-editing .p-calendar {\n width: 100%;\n min-width: 0;\n box-sizing: border-box;\n}\n\n.cell-devise {\n display: flex;\n flex-direction: column;\n gap: 0.1rem;\n font-size: 0.875rem;\n}\n.cell-devise--editable {\n cursor: pointer;\n}\n.cell-devise--empty {\n display: block;\n width: 100%;\n height: 1.5rem;\n cursor: pointer;\n}\n.cell-devise .span-sub {\n font-size: 0.75rem;\n color: #71717a;\n}\n\n.devise-editor {\n display: flex;\n flex-direction: column;\n gap: 0.4rem;\n padding: 0.25rem 0;\n}\n.devise-editor-fields {\n display: flex;\n flex-direction: column;\n gap: 0.4rem;\n width: 100%;\n position: relative;\n}\n.devise-editor-fields .p-dropdown-panel {\n position: absolute;\n z-index: 1000;\n top: 100%;\n left: 0;\n width: 100%;\n}\n.devise-editor-save {\n align-self: flex-end;\n}\n\n.arengi-table .p-cell-editing .devise-editor-fields input,\n.arengi-table .p-cell-editing .devise-editor-fields .p-inputtext,\n.arengi-table .p-cell-editing .devise-editor-fields .p-dropdown {\n width: 100%;\n min-width: 0;\n}\n\n.doc-cell-empty {\n color: #aaa;\n font-size: 0.85rem;\n}\n\n.doc-cell {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n}\n.doc-cell-summary {\n display: flex;\n align-items: center;\n gap: 0.35rem;\n font-size: 0.875rem;\n}\n.doc-cell-summary .pi-paperclip {\n color: #71717a;\n font-size: 0.8rem;\n}\n.doc-cell-list {\n display: flex;\n flex-direction: column;\n gap: 0.15rem;\n padding-left: 1.1rem;\n font-size: 0.8rem;\n}\n.doc-cell-list a {\n color: #3b82f6;\n text-decoration: none;\n}\n.doc-cell-list a:hover {\n text-decoration: underline;\n}\n\n.doc-editor {\n display: flex;\n flex-direction: column;\n gap: 0.4rem;\n padding: 0.25rem 0;\n}\n.doc-editor-table {\n width: 100%;\n border-collapse: collapse;\n font-size: 0.8rem;\n}\n.doc-editor-table td {\n padding: 0.2rem 0.35rem;\n vertical-align: middle;\n}\n.doc-editor-table td a {\n color: #3b82f6;\n text-decoration: none;\n word-break: break-all;\n}\n.doc-editor-table td a:hover {\n text-decoration: underline;\n}\n.doc-editor-table td:last-child {\n width: 2rem;\n text-align: center;\n}\n.doc-editor-add {\n display: inline-flex;\n align-items: center;\n gap: 0.3rem;\n cursor: pointer;\n align-self: flex-start;\n}\n\n.tab_label {\n display: inline-block;\n padding: 3px 8px;\n font-size: 12px;\n font-weight: 600;\n line-height: 1;\n text-align: center;\n white-space: nowrap;\n vertical-align: middle;\n border-radius: 10px;\n}";
|
|
44176
|
+
var css_248z$1 = ".arengi-table td {\n overflow: visible !important;\n}\n\n.p-datatable-scrollable .p-datatable-tbody > tr > td.p-frozen-column {\n z-index: 1;\n background-color: var(--surface-0, #ffffff);\n}\n\n.p-datatable-scrollable .p-datatable-tbody > tr.p-row-odd > td.p-frozen-column {\n background-color: var(--surface-b, #f8f9fa);\n}\n\n.arengi-table .p-cell-editing input,\n.arengi-table .p-cell-editing .p-inputtext,\n.arengi-table .p-cell-editing .p-dropdown,\n.arengi-table .p-cell-editing .p-multiselect,\n.arengi-table .p-cell-editing .p-calendar {\n width: 100%;\n min-width: 0;\n box-sizing: border-box;\n}\n\n.cell-devise {\n display: flex;\n flex-direction: column;\n gap: 0.1rem;\n font-size: 0.875rem;\n}\n.cell-devise--editable {\n cursor: pointer;\n}\n.cell-devise--empty {\n display: block;\n width: 100%;\n height: 1.5rem;\n cursor: pointer;\n}\n.cell-devise .span-sub {\n font-size: 0.75rem;\n color: #71717a;\n}\n\n.devise-editor {\n display: flex;\n flex-direction: column;\n gap: 0.4rem;\n padding: 0.25rem 0;\n}\n.devise-editor-fields {\n display: flex;\n flex-direction: column;\n gap: 0.4rem;\n width: 100%;\n position: relative;\n}\n.devise-editor-fields .p-dropdown-panel {\n position: absolute;\n z-index: 1000;\n top: 100%;\n left: 0;\n width: 100%;\n}\n.devise-editor-save {\n align-self: flex-end;\n}\n\n.arengi-table .p-cell-editing .devise-editor-fields input,\n.arengi-table .p-cell-editing .devise-editor-fields .p-inputtext,\n.arengi-table .p-cell-editing .devise-editor-fields .p-dropdown {\n width: 100%;\n min-width: 0;\n}\n\n.doc-cell-empty {\n color: #aaa;\n font-size: 0.85rem;\n}\n\n.doc-cell {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n}\n.doc-cell-summary {\n display: flex;\n align-items: center;\n gap: 0.35rem;\n font-size: 0.875rem;\n}\n.doc-cell-summary .pi-paperclip {\n color: #71717a;\n font-size: 0.8rem;\n}\n.doc-cell-list {\n display: flex;\n flex-direction: column;\n gap: 0.15rem;\n padding-left: 1.1rem;\n font-size: 0.8rem;\n}\n.doc-cell-list a {\n color: #3b82f6;\n text-decoration: none;\n}\n.doc-cell-list a:hover {\n text-decoration: underline;\n}\n\n.doc-editor {\n display: flex;\n flex-direction: column;\n gap: 0.4rem;\n padding: 0.25rem 0;\n}\n.doc-editor-table {\n width: 100%;\n border-collapse: collapse;\n font-size: 0.8rem;\n}\n.doc-editor-table td {\n padding: 0.2rem 0.35rem;\n vertical-align: middle;\n}\n.doc-editor-table td a {\n color: #3b82f6;\n text-decoration: none;\n word-break: break-all;\n}\n.doc-editor-table td a:hover {\n text-decoration: underline;\n}\n.doc-editor-table td:last-child {\n width: 2rem;\n text-align: center;\n}\n.doc-editor-add {\n display: inline-flex;\n align-items: center;\n gap: 0.3rem;\n cursor: pointer;\n align-self: flex-start;\n}\n\n.tab_label {\n display: inline-block;\n padding: 3px 8px;\n font-size: 12px;\n font-weight: 600;\n line-height: 1;\n text-align: center;\n white-space: nowrap;\n vertical-align: middle;\n border-radius: 10px;\n}";
|
|
44177
44177
|
styleInject(css_248z$1);
|
|
44178
44178
|
|
|
44179
44179
|
function _extends$2() {
|
|
@@ -47942,7 +47942,7 @@ var Table = function Table(_ref1) {
|
|
|
47942
47942
|
_ref1$editable = _ref1.editable,
|
|
47943
47943
|
editable = _ref1$editable === void 0 ? false : _ref1$editable,
|
|
47944
47944
|
_ref1$rowEdit = _ref1.rowEdit,
|
|
47945
|
-
rowEdit = _ref1$rowEdit === void 0 ?
|
|
47945
|
+
rowEdit = _ref1$rowEdit === void 0 ? false : _ref1$rowEdit,
|
|
47946
47946
|
onChange = _ref1.onChange,
|
|
47947
47947
|
onCellChange = _ref1.onCellChange,
|
|
47948
47948
|
carto = _ref1.carto;
|
|
@@ -48234,7 +48234,7 @@ var Table = function Table(_ref1) {
|
|
|
48234
48234
|
|
|
48235
48235
|
// --- Cell editors by type ---
|
|
48236
48236
|
|
|
48237
|
-
|
|
48237
|
+
useCallback(function (options) {
|
|
48238
48238
|
var _options$value2;
|
|
48239
48239
|
return /*#__PURE__*/React__default.createElement(InputText, {
|
|
48240
48240
|
value: (_options$value2 = options.value) !== null && _options$value2 !== void 0 ? _options$value2 : '',
|
|
@@ -48244,7 +48244,7 @@ var Table = function Table(_ref1) {
|
|
|
48244
48244
|
autoFocus: true
|
|
48245
48245
|
});
|
|
48246
48246
|
}, []);
|
|
48247
|
-
|
|
48247
|
+
useCallback(function (options) {
|
|
48248
48248
|
// Convertit la valeur (string dd/mm/YYYY ou YYYY-MM-DD) en objet Date pour le DatePicker
|
|
48249
48249
|
// Fallback sur aujourd'hui si la valeur est absente ou invalide (N/A, Invalid Date…)
|
|
48250
48250
|
var dateObj = null;
|
|
@@ -48274,7 +48274,7 @@ var Table = function Table(_ref1) {
|
|
|
48274
48274
|
}
|
|
48275
48275
|
});
|
|
48276
48276
|
}, []);
|
|
48277
|
-
|
|
48277
|
+
useCallback(function (col) {
|
|
48278
48278
|
return function (options) {
|
|
48279
48279
|
return /*#__PURE__*/React__default.createElement(Dropdown, _extends$I({}, DropdownPresets.Base, {
|
|
48280
48280
|
value: options.value,
|
|
@@ -48285,7 +48285,7 @@ var Table = function Table(_ref1) {
|
|
|
48285
48285
|
}));
|
|
48286
48286
|
};
|
|
48287
48287
|
}, []);
|
|
48288
|
-
|
|
48288
|
+
useCallback(function (col) {
|
|
48289
48289
|
return function (options) {
|
|
48290
48290
|
var _options$value3;
|
|
48291
48291
|
return /*#__PURE__*/React__default.createElement(InputText, {
|
|
@@ -48304,7 +48304,7 @@ var Table = function Table(_ref1) {
|
|
|
48304
48304
|
});
|
|
48305
48305
|
};
|
|
48306
48306
|
}, []);
|
|
48307
|
-
|
|
48307
|
+
useCallback(function (col) {
|
|
48308
48308
|
return function (options) {
|
|
48309
48309
|
var _options$value4;
|
|
48310
48310
|
return /*#__PURE__*/React__default.createElement(MultiSelect, _extends$I({}, MultiSelectPresets.Base, {
|
|
@@ -48335,34 +48335,15 @@ var Table = function Table(_ref1) {
|
|
|
48335
48335
|
var getEditorTemplate = useCallback(function (col) {
|
|
48336
48336
|
var colEditable = editable ? col.editable !== false : col.editable === true;
|
|
48337
48337
|
if (!colEditable) return undefined;
|
|
48338
|
-
//
|
|
48339
|
-
|
|
48340
|
-
if (
|
|
48341
|
-
|
|
48342
|
-
|
|
48343
|
-
|
|
48344
|
-
|
|
48345
|
-
|
|
48346
|
-
|
|
48347
|
-
return dateEditor;
|
|
48348
|
-
case 'select':
|
|
48349
|
-
return selectEditor(col);
|
|
48350
|
-
case 'selectMultiple':
|
|
48351
|
-
return selectMultipleEditor(col);
|
|
48352
|
-
case 'numeric':
|
|
48353
|
-
return numericEditor(col);
|
|
48354
|
-
case 'calcul':
|
|
48355
|
-
return undefined;
|
|
48356
|
-
case 'documents':
|
|
48357
|
-
return documentEditor(col);
|
|
48358
|
-
case 'devise':
|
|
48359
|
-
return deviseEditor(col);
|
|
48360
|
-
case 'treeSelect':
|
|
48361
|
-
return treeSelectEditor(col);
|
|
48362
|
-
default:
|
|
48363
|
-
return textEditor;
|
|
48364
|
-
}
|
|
48365
|
-
}, [editable, rowEdit, textEditor, dateEditor, selectEditor, selectMultipleEditor, numericEditor, documentEditor, deviseEditor, treeSelectEditor]);
|
|
48338
|
+
// devise and treeSelect always use their PrimeReact editor (not handled by SelfEditableCell)
|
|
48339
|
+
if (col.type === 'devise') return deviseEditor(col);
|
|
48340
|
+
if (col.type === 'treeSelect') return treeSelectEditor(col);
|
|
48341
|
+
// documents in cell mode keeps its native editor; in rowEdit it's wrapped by DocumentBodyCell
|
|
48342
|
+
if (!rowEdit && col.type === 'documents') return documentEditor(col);
|
|
48343
|
+
// All other editable types (text, select, selectMultiple, date, numeric) are
|
|
48344
|
+
// handled by SelfEditableCell — no PrimeReact editor to avoid click conflict.
|
|
48345
|
+
return undefined;
|
|
48346
|
+
}, [editable, rowEdit, deviseEditor, treeSelectEditor, documentEditor]);
|
|
48366
48347
|
var onCellEditComplete = useCallback(function (e) {
|
|
48367
48348
|
var _onCellChangeRef$curr;
|
|
48368
48349
|
var rowData = e.rowData,
|
|
@@ -48449,8 +48430,8 @@ var Table = function Table(_ref1) {
|
|
|
48449
48430
|
break;
|
|
48450
48431
|
}
|
|
48451
48432
|
|
|
48452
|
-
//
|
|
48453
|
-
if (
|
|
48433
|
+
// Wrap editable columns with SelfEditableCell for click-to-edit (both rowEdit and cell modes)
|
|
48434
|
+
if (colEditable) {
|
|
48454
48435
|
return function (rowData) {
|
|
48455
48436
|
return /*#__PURE__*/React__default.createElement(SelfEditableCell, {
|
|
48456
48437
|
rowData: rowData,
|
|
@@ -48579,11 +48560,7 @@ var Table = function Table(_ref1) {
|
|
|
48579
48560
|
}
|
|
48580
48561
|
}, "Tout s\xE9lectionner"))
|
|
48581
48562
|
})));
|
|
48582
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
48583
|
-
style: {
|
|
48584
|
-
overflow: 'hidden'
|
|
48585
|
-
}
|
|
48586
|
-
}, /*#__PURE__*/React__default.createElement(DataTable, {
|
|
48563
|
+
return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(DataTable, {
|
|
48587
48564
|
value: data,
|
|
48588
48565
|
header: header,
|
|
48589
48566
|
paginator: paginator,
|