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
|
@@ -168,6 +168,7 @@ var ColumnBase = ComponentBase.extend({
|
|
|
168
168
|
body: null,
|
|
169
169
|
bodyClassName: null,
|
|
170
170
|
bodyStyle: null,
|
|
171
|
+
cellEditValidateOnClose: false,
|
|
171
172
|
cellEditValidator: null,
|
|
172
173
|
cellEditValidatorEvent: 'click',
|
|
173
174
|
className: null,
|
|
@@ -1157,6 +1158,7 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
1157
1158
|
var selfClick = React.useRef(false);
|
|
1158
1159
|
var tabindexTimeout = React.useRef(null);
|
|
1159
1160
|
var initFocusTimeout = React.useRef(null);
|
|
1161
|
+
var editingRowDataStateRef = React.useRef(null);
|
|
1160
1162
|
var _props$ptCallbacks = props.ptCallbacks,
|
|
1161
1163
|
ptm = _props$ptCallbacks.ptm,
|
|
1162
1164
|
ptmo = _props$ptCallbacks.ptmo,
|
|
@@ -1193,6 +1195,9 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
1193
1195
|
var isEditable = function isEditable() {
|
|
1194
1196
|
return getColumnProp('editor');
|
|
1195
1197
|
};
|
|
1198
|
+
var cellEditValidateOnClose = function cellEditValidateOnClose() {
|
|
1199
|
+
return getColumnProp('cellEditValidateOnClose');
|
|
1200
|
+
};
|
|
1196
1201
|
var _useEventListener = useEventListener({
|
|
1197
1202
|
type: 'click',
|
|
1198
1203
|
listener: function listener(e) {
|
|
@@ -1275,40 +1280,37 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
1275
1280
|
unbindDocumentClickListener();
|
|
1276
1281
|
OverlayService.off('overlay-click', overlayEventListener.current);
|
|
1277
1282
|
overlayEventListener.current = null;
|
|
1283
|
+
editingRowDataStateRef.current = null;
|
|
1278
1284
|
selfClick.current = false;
|
|
1279
1285
|
}, 1);
|
|
1280
1286
|
};
|
|
1281
1287
|
var switchCellToViewMode = function switchCellToViewMode(event, submit) {
|
|
1282
1288
|
var callbackParams = getCellCallbackParams(event);
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
newValue: newValue
|
|
1289
|
-
});
|
|
1290
|
-
var onCellEditCancel = getColumnProp('onCellEditCancel');
|
|
1291
|
-
var cellEditValidator = getColumnProp('cellEditValidator');
|
|
1292
|
-
var onCellEditComplete = getColumnProp('onCellEditComplete');
|
|
1293
|
-
if (!submit && onCellEditCancel) {
|
|
1294
|
-
onCellEditCancel(params);
|
|
1295
|
-
}
|
|
1296
|
-
var valid = true;
|
|
1297
|
-
if (!submit && cellEditValidator) {
|
|
1298
|
-
valid = cellEditValidator(params);
|
|
1299
|
-
}
|
|
1300
|
-
if (valid) {
|
|
1301
|
-
if (submit && onCellEditComplete) {
|
|
1302
|
-
setTimeout(function () {
|
|
1303
|
-
return onCellEditComplete(params);
|
|
1304
|
-
});
|
|
1305
|
-
}
|
|
1306
|
-
closeCell(event);
|
|
1307
|
-
} else {
|
|
1308
|
-
event.preventDefault();
|
|
1309
|
-
}
|
|
1310
|
-
return newRowData;
|
|
1289
|
+
var newRowData = _objectSpread$a({}, editingRowDataStateRef.current);
|
|
1290
|
+
var newValue = resolveFieldData(newRowData);
|
|
1291
|
+
var params = _objectSpread$a(_objectSpread$a({}, callbackParams), {}, {
|
|
1292
|
+
newRowData: newRowData,
|
|
1293
|
+
newValue: newValue
|
|
1311
1294
|
});
|
|
1295
|
+
var onCellEditCancel = getColumnProp('onCellEditCancel');
|
|
1296
|
+
var cellEditValidator = getColumnProp('cellEditValidator');
|
|
1297
|
+
var onCellEditComplete = getColumnProp('onCellEditComplete');
|
|
1298
|
+
if (!submit && onCellEditCancel) {
|
|
1299
|
+
onCellEditCancel(params);
|
|
1300
|
+
}
|
|
1301
|
+
var valid = true;
|
|
1302
|
+
if ((!submit || cellEditValidateOnClose()) && cellEditValidator) {
|
|
1303
|
+
valid = cellEditValidator(params);
|
|
1304
|
+
}
|
|
1305
|
+
if (valid) {
|
|
1306
|
+
if (submit && onCellEditComplete) {
|
|
1307
|
+
onCellEditComplete(params);
|
|
1308
|
+
}
|
|
1309
|
+
closeCell(event);
|
|
1310
|
+
} else {
|
|
1311
|
+
event.preventDefault();
|
|
1312
|
+
}
|
|
1313
|
+
setEditingRowDataState(newRowData);
|
|
1312
1314
|
};
|
|
1313
1315
|
var findNextSelectableCell = function findNextSelectableCell(cell) {
|
|
1314
1316
|
var nextCell = cell.nextElementSibling;
|
|
@@ -1579,6 +1581,11 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
1579
1581
|
setEditingRowDataState(getEditingRowData());
|
|
1580
1582
|
}
|
|
1581
1583
|
}, [props.editingMeta]);
|
|
1584
|
+
React.useEffect(function () {
|
|
1585
|
+
if (editingRowDataState) {
|
|
1586
|
+
editingRowDataStateRef.current = editingRowDataState;
|
|
1587
|
+
}
|
|
1588
|
+
}, [editingRowDataState]);
|
|
1582
1589
|
React.useEffect(function () {
|
|
1583
1590
|
if (props.editMode === 'cell' || props.editMode === 'row') {
|
|
1584
1591
|
var callbackParams = getCellCallbackParams();
|
|
@@ -1689,10 +1696,11 @@ var BodyCell = /*#__PURE__*/React.memo(function (props) {
|
|
|
1689
1696
|
rowIndex: props.rowIndex,
|
|
1690
1697
|
props: props.tableProps
|
|
1691
1698
|
}) : true;
|
|
1699
|
+
var customIcon = getColumnProp('rowReorderIcon');
|
|
1692
1700
|
var rowReorderIconProps = mergeProps({
|
|
1693
1701
|
className: cx('rowReorderIcon')
|
|
1694
|
-
}, getColumnPTOptions('rowReorderIcon'));
|
|
1695
|
-
var rowReorderIcon =
|
|
1702
|
+
}, customIcon ? null : getColumnPTOptions('rowReorderIcon'));
|
|
1703
|
+
var rowReorderIcon = customIcon || /*#__PURE__*/React.createElement(BarsIcon, rowReorderIconProps);
|
|
1696
1704
|
content = showReorder ? IconUtils.getJSXIcon(rowReorderIcon, _objectSpread$a({}, rowReorderIconProps), {
|
|
1697
1705
|
props: props
|
|
1698
1706
|
}) : null;
|
|
@@ -2136,7 +2144,7 @@ var BodyRow = /*#__PURE__*/React.memo(function (props) {
|
|
|
2136
2144
|
focusedItem && focusedItem !== firstSelectedRow && (focusedItem.tabIndex = '-1');
|
|
2137
2145
|
} else {
|
|
2138
2146
|
rows[0].tabIndex = '0';
|
|
2139
|
-
focusedItem !== rows[0] && (rows[rowIndex].tabIndex = '-1');
|
|
2147
|
+
focusedItem !== rows[0] && (rows[props.rowIndex].tabIndex = '-1');
|
|
2140
2148
|
}
|
|
2141
2149
|
}
|
|
2142
2150
|
};
|
|
@@ -3036,6 +3044,7 @@ var TableBody = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function
|
|
|
3036
3044
|
var event = e.originalEvent;
|
|
3037
3045
|
if (!isUnsyled && DomHandler.hasClass(event.target, 'p-datatable-reorderablerow-handle')) {
|
|
3038
3046
|
event.currentTarget.draggable = true;
|
|
3047
|
+
event.target.draggable = false;
|
|
3039
3048
|
} else {
|
|
3040
3049
|
event.currentTarget.draggable = false;
|
|
3041
3050
|
}
|
|
@@ -5617,6 +5626,19 @@ var TableHeader = /*#__PURE__*/React.memo(function (props) {
|
|
|
5617
5626
|
});
|
|
5618
5627
|
TableHeader.displayName = 'TableHeader';
|
|
5619
5628
|
|
|
5629
|
+
var getStorage = function getStorage(stateStorageProp) {
|
|
5630
|
+
switch (stateStorageProp) {
|
|
5631
|
+
case 'local':
|
|
5632
|
+
return window.localStorage;
|
|
5633
|
+
case 'session':
|
|
5634
|
+
return window.sessionStorage;
|
|
5635
|
+
case 'custom':
|
|
5636
|
+
return null;
|
|
5637
|
+
default:
|
|
5638
|
+
throw new Error(stateStorageProp + ' is not a valid value for the state storage, supported values are "local", "session" and "custom".');
|
|
5639
|
+
}
|
|
5640
|
+
};
|
|
5641
|
+
|
|
5620
5642
|
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; } } }; }
|
|
5621
5643
|
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); }
|
|
5622
5644
|
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; }
|
|
@@ -5801,18 +5823,6 @@ var DataTable = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
5801
5823
|
}
|
|
5802
5824
|
return columns;
|
|
5803
5825
|
};
|
|
5804
|
-
var getStorage = function getStorage() {
|
|
5805
|
-
switch (props.stateStorage) {
|
|
5806
|
-
case 'local':
|
|
5807
|
-
return window.localStorage;
|
|
5808
|
-
case 'session':
|
|
5809
|
-
return window.sessionStorage;
|
|
5810
|
-
case 'custom':
|
|
5811
|
-
return null;
|
|
5812
|
-
default:
|
|
5813
|
-
throw new Error(props.stateStorage + ' is not a valid value for the state storage, supported values are "local", "session" and "custom".');
|
|
5814
|
-
}
|
|
5815
|
-
};
|
|
5816
5826
|
var saveState = function saveState() {
|
|
5817
5827
|
var state = {};
|
|
5818
5828
|
if (props.paginator) {
|
|
@@ -5848,7 +5858,7 @@ var DataTable = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
5848
5858
|
props.customSaveState(state);
|
|
5849
5859
|
}
|
|
5850
5860
|
} else {
|
|
5851
|
-
var storage = getStorage();
|
|
5861
|
+
var storage = getStorage(props.stateStorage);
|
|
5852
5862
|
if (ObjectUtils.isNotEmpty(state)) {
|
|
5853
5863
|
storage.setItem(props.stateKey, JSON.stringify(state));
|
|
5854
5864
|
}
|
|
@@ -5858,7 +5868,7 @@ var DataTable = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
5858
5868
|
}
|
|
5859
5869
|
};
|
|
5860
5870
|
var clearState = function clearState() {
|
|
5861
|
-
var storage = getStorage();
|
|
5871
|
+
var storage = getStorage(props.stateStorage);
|
|
5862
5872
|
if (storage && props.stateKey) {
|
|
5863
5873
|
storage.removeItem(props.stateKey);
|
|
5864
5874
|
}
|
|
@@ -5870,7 +5880,7 @@ var DataTable = /*#__PURE__*/React.forwardRef(function (inProps, ref) {
|
|
|
5870
5880
|
restoredState = props.customRestoreState();
|
|
5871
5881
|
}
|
|
5872
5882
|
} else {
|
|
5873
|
-
var storage = getStorage();
|
|
5883
|
+
var storage = getStorage(props.stateStorage);
|
|
5874
5884
|
var stateString = storage.getItem(props.stateKey);
|
|
5875
5885
|
var dateFormat = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/;
|
|
5876
5886
|
var reviver = function reviver(key, value) {
|