primereact 10.6.5 → 10.6.6
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/README.md +1 -1
- package/api/api.d.ts +8 -0
- package/chart/chart.d.ts +1 -13
- package/column/column.d.ts +6 -0
- package/core/core.js +94 -30
- package/core/core.min.js +8 -8
- package/datatable/datatable.cjs.js +56 -46
- package/datatable/datatable.cjs.min.js +1 -1
- package/datatable/datatable.esm.js +56 -46
- package/datatable/datatable.esm.min.js +1 -1
- package/datatable/datatable.js +56 -46
- package/datatable/datatable.min.js +1 -1
- package/dialog/dialog.cjs.js +5 -3
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.esm.js +5 -3
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +5 -3
- package/dialog/dialog.min.js +1 -1
- package/dropdown/dropdown.cjs.js +3 -3
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +3 -3
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +3 -3
- package/dropdown/dropdown.min.js +1 -1
- package/galleria/galleria.cjs.js +7 -0
- package/galleria/galleria.cjs.min.js +1 -1
- package/galleria/galleria.esm.js +8 -1
- package/galleria/galleria.esm.min.js +1 -1
- package/galleria/galleria.js +7 -0
- package/galleria/galleria.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +14 -11
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +14 -11
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +14 -11
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputotp/inputotp.cjs.js +25 -1
- package/inputotp/inputotp.cjs.min.js +1 -1
- package/inputotp/inputotp.esm.js +26 -2
- package/inputotp/inputotp.esm.min.js +1 -1
- package/inputotp/inputotp.js +25 -1
- package/inputotp/inputotp.min.js +1 -1
- package/keyfilter/keyfilter.cjs.js +1 -1
- package/keyfilter/keyfilter.cjs.min.js +1 -1
- package/keyfilter/keyfilter.esm.js +1 -1
- package/keyfilter/keyfilter.esm.min.js +1 -1
- package/keyfilter/keyfilter.js +1 -1
- package/keyfilter/keyfilter.min.js +1 -1
- package/metergroup/metergroup.cjs.js +2 -1
- package/metergroup/metergroup.cjs.min.js +1 -1
- package/metergroup/metergroup.esm.js +2 -1
- package/metergroup/metergroup.esm.min.js +1 -1
- package/metergroup/metergroup.js +2 -1
- package/metergroup/metergroup.min.js +1 -1
- package/multiselect/multiselect.cjs.js +2 -2
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.esm.js +2 -2
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +2 -2
- package/multiselect/multiselect.min.js +1 -1
- package/package.json +1 -1
- package/paginator/paginator.cjs.js +1 -1
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +1 -1
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +1 -1
- package/paginator/paginator.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +13 -12
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +13 -12
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +13 -12
- package/panelmenu/panelmenu.min.js +1 -1
- package/password/password.cjs.js +2 -2
- package/password/password.cjs.min.js +1 -1
- package/password/password.esm.js +2 -2
- package/password/password.esm.min.js +1 -1
- package/password/password.js +2 -2
- package/password/password.min.js +1 -1
- package/primereact.all.cjs.js +2859 -1916
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +2856 -1917
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +2859 -1916
- package/primereact.all.min.js +1 -1
- package/resources/themes/arya-blue/theme.css +62 -0
- package/resources/themes/arya-green/theme.css +62 -0
- package/resources/themes/arya-orange/theme.css +62 -0
- package/resources/themes/bootstrap4-dark-blue/theme.css +62 -0
- package/resources/themes/bootstrap4-dark-purple/theme.css +207 -43
- package/resources/themes/bootstrap4-light-blue/theme.css +62 -0
- package/resources/themes/bootstrap4-light-purple/theme.css +207 -43
- package/resources/themes/fluent-light/theme.css +62 -0
- package/resources/themes/lara-dark-amber/theme.css +62 -9
- package/resources/themes/lara-dark-blue/theme.css +62 -9
- package/resources/themes/lara-dark-cyan/theme.css +62 -9
- package/resources/themes/lara-dark-green/theme.css +62 -9
- package/resources/themes/lara-dark-indigo/theme.css +62 -9
- package/resources/themes/lara-dark-pink/theme.css +62 -9
- package/resources/themes/lara-dark-teal/theme.css +62 -9
- package/resources/themes/lara-light-amber/theme.css +62 -9
- package/resources/themes/lara-light-blue/theme.css +62 -9
- package/resources/themes/lara-light-cyan/theme.css +62 -9
- package/resources/themes/lara-light-green/theme.css +62 -9
- package/resources/themes/lara-light-indigo/theme.css +62 -9
- package/resources/themes/lara-light-pink/theme.css +62 -9
- package/resources/themes/lara-light-teal/theme.css +62 -9
- package/resources/themes/luna-amber/theme.css +62 -0
- package/resources/themes/luna-blue/theme.css +62 -0
- package/resources/themes/luna-green/theme.css +62 -0
- package/resources/themes/luna-pink/theme.css +62 -0
- package/resources/themes/md-dark-deeppurple/theme.css +225 -43
- package/resources/themes/md-dark-indigo/theme.css +213 -151
- package/resources/themes/md-light-deeppurple/theme.css +225 -43
- package/resources/themes/md-light-indigo/theme.css +62 -0
- package/resources/themes/mdc-dark-deeppurple/theme.css +225 -43
- package/resources/themes/mdc-dark-indigo/theme.css +213 -151
- package/resources/themes/mdc-light-deeppurple/theme.css +225 -43
- package/resources/themes/mdc-light-indigo/theme.css +62 -0
- package/resources/themes/mira/theme.css +62 -0
- package/resources/themes/nano/theme.css +62 -0
- package/resources/themes/nova/theme.css +62 -0
- package/resources/themes/nova-accent/theme.css +62 -0
- package/resources/themes/nova-alt/theme.css +62 -0
- package/resources/themes/rhea/theme.css +62 -0
- package/resources/themes/saga-blue/theme.css +62 -0
- package/resources/themes/saga-green/theme.css +62 -0
- package/resources/themes/saga-orange/theme.css +62 -0
- package/resources/themes/soho-dark/theme.css +87 -25
- package/resources/themes/soho-light/theme.css +62 -0
- package/resources/themes/tailwind-light/theme.css +62 -0
- package/resources/themes/vela-blue/theme.css +62 -0
- package/resources/themes/vela-green/theme.css +62 -0
- package/resources/themes/vela-orange/theme.css +62 -0
- package/resources/themes/viva-dark/theme.css +62 -0
- package/resources/themes/viva-light/theme.css +62 -0
- package/tabview/tabview.cjs.js +0 -2
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.esm.js +0 -2
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +0 -2
- package/tabview/tabview.min.js +1 -1
- package/tooltip/tooltip.cjs.js +2 -2
- package/tooltip/tooltip.cjs.min.js +1 -1
- package/tooltip/tooltip.esm.js +2 -2
- package/tooltip/tooltip.esm.min.js +1 -1
- package/tooltip/tooltip.js +2 -2
- package/tooltip/tooltip.min.js +1 -1
- package/tree/tree.cjs.js +45 -8
- package/tree/tree.cjs.min.js +1 -1
- package/tree/tree.esm.js +45 -8
- package/tree/tree.esm.min.js +1 -1
- package/tree/tree.js +45 -8
- package/tree/tree.min.js +1 -1
- package/treetable/treetable.cjs.js +240 -7
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.d.ts +29 -0
- package/treetable/treetable.esm.js +240 -7
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +240 -7
- package/treetable/treetable.min.js +1 -1
- package/utils/utils.d.ts +7 -4
- package/virtualscroller/virtualscroller.cjs.js +23 -1
- package/virtualscroller/virtualscroller.cjs.min.js +1 -1
- package/virtualscroller/virtualscroller.esm.js +23 -1
- package/virtualscroller/virtualscroller.esm.min.js +1 -1
- package/virtualscroller/virtualscroller.js +23 -1
- package/virtualscroller/virtualscroller.min.js +1 -1
- package/web-types.json +66 -28
package/datatable/datatable.js
CHANGED
|
@@ -162,6 +162,7 @@ this.primereact.datatable = (function (exports, React, PrimeReact$1, componentba
|
|
|
162
162
|
body: null,
|
|
163
163
|
bodyClassName: null,
|
|
164
164
|
bodyStyle: null,
|
|
165
|
+
cellEditValidateOnClose: false,
|
|
165
166
|
cellEditValidator: null,
|
|
166
167
|
cellEditValidatorEvent: 'click',
|
|
167
168
|
className: null,
|
|
@@ -1151,6 +1152,7 @@ this.primereact.datatable = (function (exports, React, PrimeReact$1, componentba
|
|
|
1151
1152
|
var selfClick = React__namespace.useRef(false);
|
|
1152
1153
|
var tabindexTimeout = React__namespace.useRef(null);
|
|
1153
1154
|
var initFocusTimeout = React__namespace.useRef(null);
|
|
1155
|
+
var editingRowDataStateRef = React__namespace.useRef(null);
|
|
1154
1156
|
var _props$ptCallbacks = props.ptCallbacks,
|
|
1155
1157
|
ptm = _props$ptCallbacks.ptm,
|
|
1156
1158
|
ptmo = _props$ptCallbacks.ptmo,
|
|
@@ -1187,6 +1189,9 @@ this.primereact.datatable = (function (exports, React, PrimeReact$1, componentba
|
|
|
1187
1189
|
var isEditable = function isEditable() {
|
|
1188
1190
|
return getColumnProp('editor');
|
|
1189
1191
|
};
|
|
1192
|
+
var cellEditValidateOnClose = function cellEditValidateOnClose() {
|
|
1193
|
+
return getColumnProp('cellEditValidateOnClose');
|
|
1194
|
+
};
|
|
1190
1195
|
var _useEventListener = hooks.useEventListener({
|
|
1191
1196
|
type: 'click',
|
|
1192
1197
|
listener: function listener(e) {
|
|
@@ -1269,40 +1274,37 @@ this.primereact.datatable = (function (exports, React, PrimeReact$1, componentba
|
|
|
1269
1274
|
unbindDocumentClickListener();
|
|
1270
1275
|
overlayservice.OverlayService.off('overlay-click', overlayEventListener.current);
|
|
1271
1276
|
overlayEventListener.current = null;
|
|
1277
|
+
editingRowDataStateRef.current = null;
|
|
1272
1278
|
selfClick.current = false;
|
|
1273
1279
|
}, 1);
|
|
1274
1280
|
};
|
|
1275
1281
|
var switchCellToViewMode = function switchCellToViewMode(event, submit) {
|
|
1276
1282
|
var callbackParams = getCellCallbackParams(event);
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
newValue: newValue
|
|
1283
|
-
});
|
|
1284
|
-
var onCellEditCancel = getColumnProp('onCellEditCancel');
|
|
1285
|
-
var cellEditValidator = getColumnProp('cellEditValidator');
|
|
1286
|
-
var onCellEditComplete = getColumnProp('onCellEditComplete');
|
|
1287
|
-
if (!submit && onCellEditCancel) {
|
|
1288
|
-
onCellEditCancel(params);
|
|
1289
|
-
}
|
|
1290
|
-
var valid = true;
|
|
1291
|
-
if (!submit && cellEditValidator) {
|
|
1292
|
-
valid = cellEditValidator(params);
|
|
1293
|
-
}
|
|
1294
|
-
if (valid) {
|
|
1295
|
-
if (submit && onCellEditComplete) {
|
|
1296
|
-
setTimeout(function () {
|
|
1297
|
-
return onCellEditComplete(params);
|
|
1298
|
-
});
|
|
1299
|
-
}
|
|
1300
|
-
closeCell(event);
|
|
1301
|
-
} else {
|
|
1302
|
-
event.preventDefault();
|
|
1303
|
-
}
|
|
1304
|
-
return newRowData;
|
|
1283
|
+
var newRowData = _objectSpread$a({}, editingRowDataStateRef.current);
|
|
1284
|
+
var newValue = resolveFieldData(newRowData);
|
|
1285
|
+
var params = _objectSpread$a(_objectSpread$a({}, callbackParams), {}, {
|
|
1286
|
+
newRowData: newRowData,
|
|
1287
|
+
newValue: newValue
|
|
1305
1288
|
});
|
|
1289
|
+
var onCellEditCancel = getColumnProp('onCellEditCancel');
|
|
1290
|
+
var cellEditValidator = getColumnProp('cellEditValidator');
|
|
1291
|
+
var onCellEditComplete = getColumnProp('onCellEditComplete');
|
|
1292
|
+
if (!submit && onCellEditCancel) {
|
|
1293
|
+
onCellEditCancel(params);
|
|
1294
|
+
}
|
|
1295
|
+
var valid = true;
|
|
1296
|
+
if ((!submit || cellEditValidateOnClose()) && cellEditValidator) {
|
|
1297
|
+
valid = cellEditValidator(params);
|
|
1298
|
+
}
|
|
1299
|
+
if (valid) {
|
|
1300
|
+
if (submit && onCellEditComplete) {
|
|
1301
|
+
onCellEditComplete(params);
|
|
1302
|
+
}
|
|
1303
|
+
closeCell(event);
|
|
1304
|
+
} else {
|
|
1305
|
+
event.preventDefault();
|
|
1306
|
+
}
|
|
1307
|
+
setEditingRowDataState(newRowData);
|
|
1306
1308
|
};
|
|
1307
1309
|
var findNextSelectableCell = function findNextSelectableCell(cell) {
|
|
1308
1310
|
var nextCell = cell.nextElementSibling;
|
|
@@ -1573,6 +1575,11 @@ this.primereact.datatable = (function (exports, React, PrimeReact$1, componentba
|
|
|
1573
1575
|
setEditingRowDataState(getEditingRowData());
|
|
1574
1576
|
}
|
|
1575
1577
|
}, [props.editingMeta]);
|
|
1578
|
+
React__namespace.useEffect(function () {
|
|
1579
|
+
if (editingRowDataState) {
|
|
1580
|
+
editingRowDataStateRef.current = editingRowDataState;
|
|
1581
|
+
}
|
|
1582
|
+
}, [editingRowDataState]);
|
|
1576
1583
|
React__namespace.useEffect(function () {
|
|
1577
1584
|
if (props.editMode === 'cell' || props.editMode === 'row') {
|
|
1578
1585
|
var callbackParams = getCellCallbackParams();
|
|
@@ -1683,10 +1690,11 @@ this.primereact.datatable = (function (exports, React, PrimeReact$1, componentba
|
|
|
1683
1690
|
rowIndex: props.rowIndex,
|
|
1684
1691
|
props: props.tableProps
|
|
1685
1692
|
}) : true;
|
|
1693
|
+
var customIcon = getColumnProp('rowReorderIcon');
|
|
1686
1694
|
var rowReorderIconProps = mergeProps({
|
|
1687
1695
|
className: cx('rowReorderIcon')
|
|
1688
|
-
}, getColumnPTOptions('rowReorderIcon'));
|
|
1689
|
-
var rowReorderIcon =
|
|
1696
|
+
}, customIcon ? null : getColumnPTOptions('rowReorderIcon'));
|
|
1697
|
+
var rowReorderIcon = customIcon || /*#__PURE__*/React__namespace.createElement(bars.BarsIcon, rowReorderIconProps);
|
|
1690
1698
|
content = showReorder ? utils.IconUtils.getJSXIcon(rowReorderIcon, _objectSpread$a({}, rowReorderIconProps), {
|
|
1691
1699
|
props: props
|
|
1692
1700
|
}) : null;
|
|
@@ -2130,7 +2138,7 @@ this.primereact.datatable = (function (exports, React, PrimeReact$1, componentba
|
|
|
2130
2138
|
focusedItem && focusedItem !== firstSelectedRow && (focusedItem.tabIndex = '-1');
|
|
2131
2139
|
} else {
|
|
2132
2140
|
rows[0].tabIndex = '0';
|
|
2133
|
-
focusedItem !== rows[0] && (rows[rowIndex].tabIndex = '-1');
|
|
2141
|
+
focusedItem !== rows[0] && (rows[props.rowIndex].tabIndex = '-1');
|
|
2134
2142
|
}
|
|
2135
2143
|
}
|
|
2136
2144
|
};
|
|
@@ -3030,6 +3038,7 @@ this.primereact.datatable = (function (exports, React, PrimeReact$1, componentba
|
|
|
3030
3038
|
var event = e.originalEvent;
|
|
3031
3039
|
if (!isUnsyled && utils.DomHandler.hasClass(event.target, 'p-datatable-reorderablerow-handle')) {
|
|
3032
3040
|
event.currentTarget.draggable = true;
|
|
3041
|
+
event.target.draggable = false;
|
|
3033
3042
|
} else {
|
|
3034
3043
|
event.currentTarget.draggable = false;
|
|
3035
3044
|
}
|
|
@@ -5611,6 +5620,19 @@ this.primereact.datatable = (function (exports, React, PrimeReact$1, componentba
|
|
|
5611
5620
|
});
|
|
5612
5621
|
TableHeader.displayName = 'TableHeader';
|
|
5613
5622
|
|
|
5623
|
+
var getStorage = function getStorage(stateStorageProp) {
|
|
5624
|
+
switch (stateStorageProp) {
|
|
5625
|
+
case 'local':
|
|
5626
|
+
return window.localStorage;
|
|
5627
|
+
case 'session':
|
|
5628
|
+
return window.sessionStorage;
|
|
5629
|
+
case 'custom':
|
|
5630
|
+
return null;
|
|
5631
|
+
default:
|
|
5632
|
+
throw new Error(stateStorageProp + ' is not a valid value for the state storage, supported values are "local", "session" and "custom".');
|
|
5633
|
+
}
|
|
5634
|
+
};
|
|
5635
|
+
|
|
5614
5636
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
5615
5637
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5616
5638
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
@@ -5795,18 +5817,6 @@ this.primereact.datatable = (function (exports, React, PrimeReact$1, componentba
|
|
|
5795
5817
|
}
|
|
5796
5818
|
return columns;
|
|
5797
5819
|
};
|
|
5798
|
-
var getStorage = function getStorage() {
|
|
5799
|
-
switch (props.stateStorage) {
|
|
5800
|
-
case 'local':
|
|
5801
|
-
return window.localStorage;
|
|
5802
|
-
case 'session':
|
|
5803
|
-
return window.sessionStorage;
|
|
5804
|
-
case 'custom':
|
|
5805
|
-
return null;
|
|
5806
|
-
default:
|
|
5807
|
-
throw new Error(props.stateStorage + ' is not a valid value for the state storage, supported values are "local", "session" and "custom".');
|
|
5808
|
-
}
|
|
5809
|
-
};
|
|
5810
5820
|
var saveState = function saveState() {
|
|
5811
5821
|
var state = {};
|
|
5812
5822
|
if (props.paginator) {
|
|
@@ -5842,7 +5852,7 @@ this.primereact.datatable = (function (exports, React, PrimeReact$1, componentba
|
|
|
5842
5852
|
props.customSaveState(state);
|
|
5843
5853
|
}
|
|
5844
5854
|
} else {
|
|
5845
|
-
var storage = getStorage();
|
|
5855
|
+
var storage = getStorage(props.stateStorage);
|
|
5846
5856
|
if (utils.ObjectUtils.isNotEmpty(state)) {
|
|
5847
5857
|
storage.setItem(props.stateKey, JSON.stringify(state));
|
|
5848
5858
|
}
|
|
@@ -5852,7 +5862,7 @@ this.primereact.datatable = (function (exports, React, PrimeReact$1, componentba
|
|
|
5852
5862
|
}
|
|
5853
5863
|
};
|
|
5854
5864
|
var clearState = function clearState() {
|
|
5855
|
-
var storage = getStorage();
|
|
5865
|
+
var storage = getStorage(props.stateStorage);
|
|
5856
5866
|
if (storage && props.stateKey) {
|
|
5857
5867
|
storage.removeItem(props.stateKey);
|
|
5858
5868
|
}
|
|
@@ -5864,7 +5874,7 @@ this.primereact.datatable = (function (exports, React, PrimeReact$1, componentba
|
|
|
5864
5874
|
restoredState = props.customRestoreState();
|
|
5865
5875
|
}
|
|
5866
5876
|
} else {
|
|
5867
|
-
var storage = getStorage();
|
|
5877
|
+
var storage = getStorage(props.stateStorage);
|
|
5868
5878
|
var stateString = storage.getItem(props.stateKey);
|
|
5869
5879
|
var dateFormat = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/;
|
|
5870
5880
|
var reviver = function reviver(key, value) {
|