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
|
@@ -195,6 +195,7 @@ var ColumnBase = componentbase.ComponentBase.extend({
|
|
|
195
195
|
body: null,
|
|
196
196
|
bodyClassName: null,
|
|
197
197
|
bodyStyle: null,
|
|
198
|
+
cellEditValidateOnClose: false,
|
|
198
199
|
cellEditValidator: null,
|
|
199
200
|
cellEditValidatorEvent: 'click',
|
|
200
201
|
className: null,
|
|
@@ -1184,6 +1185,7 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
1184
1185
|
var selfClick = React__namespace.useRef(false);
|
|
1185
1186
|
var tabindexTimeout = React__namespace.useRef(null);
|
|
1186
1187
|
var initFocusTimeout = React__namespace.useRef(null);
|
|
1188
|
+
var editingRowDataStateRef = React__namespace.useRef(null);
|
|
1187
1189
|
var _props$ptCallbacks = props.ptCallbacks,
|
|
1188
1190
|
ptm = _props$ptCallbacks.ptm,
|
|
1189
1191
|
ptmo = _props$ptCallbacks.ptmo,
|
|
@@ -1220,6 +1222,9 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
1220
1222
|
var isEditable = function isEditable() {
|
|
1221
1223
|
return getColumnProp('editor');
|
|
1222
1224
|
};
|
|
1225
|
+
var cellEditValidateOnClose = function cellEditValidateOnClose() {
|
|
1226
|
+
return getColumnProp('cellEditValidateOnClose');
|
|
1227
|
+
};
|
|
1223
1228
|
var _useEventListener = hooks.useEventListener({
|
|
1224
1229
|
type: 'click',
|
|
1225
1230
|
listener: function listener(e) {
|
|
@@ -1302,40 +1307,37 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
1302
1307
|
unbindDocumentClickListener();
|
|
1303
1308
|
overlayservice.OverlayService.off('overlay-click', overlayEventListener.current);
|
|
1304
1309
|
overlayEventListener.current = null;
|
|
1310
|
+
editingRowDataStateRef.current = null;
|
|
1305
1311
|
selfClick.current = false;
|
|
1306
1312
|
}, 1);
|
|
1307
1313
|
};
|
|
1308
1314
|
var switchCellToViewMode = function switchCellToViewMode(event, submit) {
|
|
1309
1315
|
var callbackParams = getCellCallbackParams(event);
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
newValue: newValue
|
|
1316
|
-
});
|
|
1317
|
-
var onCellEditCancel = getColumnProp('onCellEditCancel');
|
|
1318
|
-
var cellEditValidator = getColumnProp('cellEditValidator');
|
|
1319
|
-
var onCellEditComplete = getColumnProp('onCellEditComplete');
|
|
1320
|
-
if (!submit && onCellEditCancel) {
|
|
1321
|
-
onCellEditCancel(params);
|
|
1322
|
-
}
|
|
1323
|
-
var valid = true;
|
|
1324
|
-
if (!submit && cellEditValidator) {
|
|
1325
|
-
valid = cellEditValidator(params);
|
|
1326
|
-
}
|
|
1327
|
-
if (valid) {
|
|
1328
|
-
if (submit && onCellEditComplete) {
|
|
1329
|
-
setTimeout(function () {
|
|
1330
|
-
return onCellEditComplete(params);
|
|
1331
|
-
});
|
|
1332
|
-
}
|
|
1333
|
-
closeCell(event);
|
|
1334
|
-
} else {
|
|
1335
|
-
event.preventDefault();
|
|
1336
|
-
}
|
|
1337
|
-
return newRowData;
|
|
1316
|
+
var newRowData = _objectSpread$a({}, editingRowDataStateRef.current);
|
|
1317
|
+
var newValue = resolveFieldData(newRowData);
|
|
1318
|
+
var params = _objectSpread$a(_objectSpread$a({}, callbackParams), {}, {
|
|
1319
|
+
newRowData: newRowData,
|
|
1320
|
+
newValue: newValue
|
|
1338
1321
|
});
|
|
1322
|
+
var onCellEditCancel = getColumnProp('onCellEditCancel');
|
|
1323
|
+
var cellEditValidator = getColumnProp('cellEditValidator');
|
|
1324
|
+
var onCellEditComplete = getColumnProp('onCellEditComplete');
|
|
1325
|
+
if (!submit && onCellEditCancel) {
|
|
1326
|
+
onCellEditCancel(params);
|
|
1327
|
+
}
|
|
1328
|
+
var valid = true;
|
|
1329
|
+
if ((!submit || cellEditValidateOnClose()) && cellEditValidator) {
|
|
1330
|
+
valid = cellEditValidator(params);
|
|
1331
|
+
}
|
|
1332
|
+
if (valid) {
|
|
1333
|
+
if (submit && onCellEditComplete) {
|
|
1334
|
+
onCellEditComplete(params);
|
|
1335
|
+
}
|
|
1336
|
+
closeCell(event);
|
|
1337
|
+
} else {
|
|
1338
|
+
event.preventDefault();
|
|
1339
|
+
}
|
|
1340
|
+
setEditingRowDataState(newRowData);
|
|
1339
1341
|
};
|
|
1340
1342
|
var findNextSelectableCell = function findNextSelectableCell(cell) {
|
|
1341
1343
|
var nextCell = cell.nextElementSibling;
|
|
@@ -1606,6 +1608,11 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
1606
1608
|
setEditingRowDataState(getEditingRowData());
|
|
1607
1609
|
}
|
|
1608
1610
|
}, [props.editingMeta]);
|
|
1611
|
+
React__namespace.useEffect(function () {
|
|
1612
|
+
if (editingRowDataState) {
|
|
1613
|
+
editingRowDataStateRef.current = editingRowDataState;
|
|
1614
|
+
}
|
|
1615
|
+
}, [editingRowDataState]);
|
|
1609
1616
|
React__namespace.useEffect(function () {
|
|
1610
1617
|
if (props.editMode === 'cell' || props.editMode === 'row') {
|
|
1611
1618
|
var callbackParams = getCellCallbackParams();
|
|
@@ -1716,10 +1723,11 @@ var BodyCell = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
1716
1723
|
rowIndex: props.rowIndex,
|
|
1717
1724
|
props: props.tableProps
|
|
1718
1725
|
}) : true;
|
|
1726
|
+
var customIcon = getColumnProp('rowReorderIcon');
|
|
1719
1727
|
var rowReorderIconProps = mergeProps({
|
|
1720
1728
|
className: cx('rowReorderIcon')
|
|
1721
|
-
}, getColumnPTOptions('rowReorderIcon'));
|
|
1722
|
-
var rowReorderIcon =
|
|
1729
|
+
}, customIcon ? null : getColumnPTOptions('rowReorderIcon'));
|
|
1730
|
+
var rowReorderIcon = customIcon || /*#__PURE__*/React__namespace.createElement(bars.BarsIcon, rowReorderIconProps);
|
|
1723
1731
|
content = showReorder ? utils.IconUtils.getJSXIcon(rowReorderIcon, _objectSpread$a({}, rowReorderIconProps), {
|
|
1724
1732
|
props: props
|
|
1725
1733
|
}) : null;
|
|
@@ -2163,7 +2171,7 @@ var BodyRow = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
2163
2171
|
focusedItem && focusedItem !== firstSelectedRow && (focusedItem.tabIndex = '-1');
|
|
2164
2172
|
} else {
|
|
2165
2173
|
rows[0].tabIndex = '0';
|
|
2166
|
-
focusedItem !== rows[0] && (rows[rowIndex].tabIndex = '-1');
|
|
2174
|
+
focusedItem !== rows[0] && (rows[props.rowIndex].tabIndex = '-1');
|
|
2167
2175
|
}
|
|
2168
2176
|
}
|
|
2169
2177
|
};
|
|
@@ -3063,6 +3071,7 @@ var TableBody = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespac
|
|
|
3063
3071
|
var event = e.originalEvent;
|
|
3064
3072
|
if (!isUnsyled && utils.DomHandler.hasClass(event.target, 'p-datatable-reorderablerow-handle')) {
|
|
3065
3073
|
event.currentTarget.draggable = true;
|
|
3074
|
+
event.target.draggable = false;
|
|
3066
3075
|
} else {
|
|
3067
3076
|
event.currentTarget.draggable = false;
|
|
3068
3077
|
}
|
|
@@ -5644,6 +5653,19 @@ var TableHeader = /*#__PURE__*/React__namespace.memo(function (props) {
|
|
|
5644
5653
|
});
|
|
5645
5654
|
TableHeader.displayName = 'TableHeader';
|
|
5646
5655
|
|
|
5656
|
+
var getStorage = function getStorage(stateStorageProp) {
|
|
5657
|
+
switch (stateStorageProp) {
|
|
5658
|
+
case 'local':
|
|
5659
|
+
return window.localStorage;
|
|
5660
|
+
case 'session':
|
|
5661
|
+
return window.sessionStorage;
|
|
5662
|
+
case 'custom':
|
|
5663
|
+
return null;
|
|
5664
|
+
default:
|
|
5665
|
+
throw new Error(stateStorageProp + ' is not a valid value for the state storage, supported values are "local", "session" and "custom".');
|
|
5666
|
+
}
|
|
5667
|
+
};
|
|
5668
|
+
|
|
5647
5669
|
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; } } }; }
|
|
5648
5670
|
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); }
|
|
5649
5671
|
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; }
|
|
@@ -5828,18 +5850,6 @@ var DataTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
5828
5850
|
}
|
|
5829
5851
|
return columns;
|
|
5830
5852
|
};
|
|
5831
|
-
var getStorage = function getStorage() {
|
|
5832
|
-
switch (props.stateStorage) {
|
|
5833
|
-
case 'local':
|
|
5834
|
-
return window.localStorage;
|
|
5835
|
-
case 'session':
|
|
5836
|
-
return window.sessionStorage;
|
|
5837
|
-
case 'custom':
|
|
5838
|
-
return null;
|
|
5839
|
-
default:
|
|
5840
|
-
throw new Error(props.stateStorage + ' is not a valid value for the state storage, supported values are "local", "session" and "custom".');
|
|
5841
|
-
}
|
|
5842
|
-
};
|
|
5843
5853
|
var saveState = function saveState() {
|
|
5844
5854
|
var state = {};
|
|
5845
5855
|
if (props.paginator) {
|
|
@@ -5875,7 +5885,7 @@ var DataTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
5875
5885
|
props.customSaveState(state);
|
|
5876
5886
|
}
|
|
5877
5887
|
} else {
|
|
5878
|
-
var storage = getStorage();
|
|
5888
|
+
var storage = getStorage(props.stateStorage);
|
|
5879
5889
|
if (utils.ObjectUtils.isNotEmpty(state)) {
|
|
5880
5890
|
storage.setItem(props.stateKey, JSON.stringify(state));
|
|
5881
5891
|
}
|
|
@@ -5885,7 +5895,7 @@ var DataTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
5885
5895
|
}
|
|
5886
5896
|
};
|
|
5887
5897
|
var clearState = function clearState() {
|
|
5888
|
-
var storage = getStorage();
|
|
5898
|
+
var storage = getStorage(props.stateStorage);
|
|
5889
5899
|
if (storage && props.stateKey) {
|
|
5890
5900
|
storage.removeItem(props.stateKey);
|
|
5891
5901
|
}
|
|
@@ -5897,7 +5907,7 @@ var DataTable = /*#__PURE__*/React__namespace.forwardRef(function (inProps, ref)
|
|
|
5897
5907
|
restoredState = props.customRestoreState();
|
|
5898
5908
|
}
|
|
5899
5909
|
} else {
|
|
5900
|
-
var storage = getStorage();
|
|
5910
|
+
var storage = getStorage(props.stateStorage);
|
|
5901
5911
|
var stateString = storage.getItem(props.stateKey);
|
|
5902
5912
|
var dateFormat = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/;
|
|
5903
5913
|
var reviver = function reviver(key, value) {
|