primereact 8.0.0-rc.2 → 8.0.0
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 +5 -4
- package/button/button.min.css +1 -1
- package/calendar/calendar.d.ts +1 -1
- package/carousel/carousel.cjs.js +4 -4
- package/carousel/carousel.cjs.min.js +1 -1
- package/carousel/carousel.esm.js +4 -4
- package/carousel/carousel.esm.min.js +1 -1
- package/carousel/carousel.js +4 -4
- package/carousel/carousel.min.js +1 -1
- package/chips/chips.cjs.js +6 -2
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.esm.js +6 -2
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +6 -2
- package/chips/chips.min.js +1 -1
- package/core/core.js +52 -0
- package/core/core.min.js +1 -1
- package/hooks/hooks.cjs.js +52 -0
- package/hooks/hooks.cjs.min.js +1 -1
- package/hooks/hooks.d.ts +7 -5
- package/hooks/hooks.esm.js +52 -1
- package/hooks/hooks.esm.min.js +1 -1
- package/hooks/hooks.js +52 -0
- package/hooks/hooks.min.js +1 -1
- package/inputmask/inputmask.cjs.js +0 -2
- package/inputmask/inputmask.cjs.min.js +1 -1
- package/inputmask/inputmask.d.ts +0 -1
- package/inputmask/inputmask.esm.js +0 -2
- package/inputmask/inputmask.esm.min.js +1 -1
- package/inputmask/inputmask.js +0 -2
- package/inputmask/inputmask.min.js +1 -1
- package/package.json +4 -4
- package/primereact.all.cjs.js +65 -11
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +65 -12
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +65 -11
- package/primereact.all.min.js +1 -1
- package/resources/primereact.css +0 -4
- package/resources/primereact.min.css +1 -1
- package/resources/themes/arya-blue/theme.css +10 -0
- package/resources/themes/arya-green/theme.css +10 -0
- package/resources/themes/arya-orange/theme.css +10 -0
- package/resources/themes/arya-purple/theme.css +10 -0
- package/resources/themes/bootstrap4-dark-blue/theme.css +10 -0
- package/resources/themes/bootstrap4-dark-purple/theme.css +10 -0
- package/resources/themes/bootstrap4-light-blue/theme.css +10 -0
- package/resources/themes/bootstrap4-light-purple/theme.css +10 -0
- package/resources/themes/fluent-light/theme.css +10 -0
- package/resources/themes/lara-dark-blue/theme.css +10 -0
- package/resources/themes/lara-dark-indigo/theme.css +10 -0
- package/resources/themes/lara-dark-purple/theme.css +10 -0
- package/resources/themes/lara-dark-teal/theme.css +10 -0
- package/resources/themes/lara-light-blue/theme.css +10 -0
- package/resources/themes/lara-light-indigo/theme.css +10 -0
- package/resources/themes/lara-light-purple/theme.css +10 -0
- package/resources/themes/lara-light-teal/theme.css +10 -0
- package/resources/themes/luna-amber/theme.css +10 -0
- package/resources/themes/luna-blue/theme.css +10 -0
- package/resources/themes/luna-green/theme.css +10 -0
- package/resources/themes/luna-pink/theme.css +10 -0
- package/resources/themes/md-dark-deeppurple/theme.css +10 -0
- package/resources/themes/md-dark-indigo/theme.css +10 -0
- package/resources/themes/md-light-deeppurple/theme.css +10 -0
- package/resources/themes/md-light-indigo/theme.css +10 -0
- package/resources/themes/mdc-dark-deeppurple/theme.css +10 -0
- package/resources/themes/mdc-dark-indigo/theme.css +10 -0
- package/resources/themes/mdc-light-deeppurple/theme.css +10 -0
- package/resources/themes/mdc-light-indigo/theme.css +10 -0
- package/resources/themes/nova/theme.css +10 -0
- package/resources/themes/nova-accent/theme.css +10 -0
- package/resources/themes/nova-alt/theme.css +10 -0
- package/resources/themes/rhea/theme.css +10 -0
- package/resources/themes/saga-blue/theme.css +10 -0
- package/resources/themes/saga-green/theme.css +10 -0
- package/resources/themes/saga-orange/theme.css +10 -0
- package/resources/themes/saga-purple/theme.css +10 -0
- package/resources/themes/tailwind-light/theme.css +10 -0
- package/resources/themes/vela-blue/theme.css +10 -0
- package/resources/themes/vela-green/theme.css +10 -0
- package/resources/themes/vela-orange/theme.css +10 -0
- package/resources/themes/vela-purple/theme.css +10 -0
- package/togglebutton/togglebutton.cjs.js +3 -3
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.d.ts +0 -1
- package/togglebutton/togglebutton.esm.js +3 -3
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +3 -3
- package/togglebutton/togglebutton.min.js +1 -1
- package/treeselect/treeselect.d.ts +4 -5
- package/web-types.json +1 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "primereact",
|
|
3
|
-
"version": "8.0.0
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "PrimeTek Informatics",
|
|
6
6
|
"description": "PrimeReact is an open source UI library for React featuring a rich set of 80+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeBlock, which has 280+ ready to use UI blocks to build spectacular applications in no time.",
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"@types/react": "^17.0.0 || ^18.0.0",
|
|
35
35
|
"react": "^17.0.0 || ^18.0.0",
|
|
36
|
-
"react-dom": "^17.0.0 || ^18.0.0"
|
|
36
|
+
"react-dom": "^17.0.0 || ^18.0.0",
|
|
37
|
+
"primeicons": "^5.0.0"
|
|
37
38
|
},
|
|
38
39
|
"peerDependenciesMeta": {
|
|
39
40
|
"@types/react": {
|
|
@@ -42,8 +43,7 @@
|
|
|
42
43
|
},
|
|
43
44
|
"dependencies": {
|
|
44
45
|
"@types/react-transition-group": "^4.4.1",
|
|
45
|
-
"react-transition-group": "^4.4.1"
|
|
46
|
-
"primeicons": "^5.0.0"
|
|
46
|
+
"react-transition-group": "^4.4.1"
|
|
47
47
|
},
|
|
48
48
|
"sideEffects": false,
|
|
49
49
|
"unpkg": "primereact.all.min.js",
|
package/primereact.all.cjs.js
CHANGED
|
@@ -3021,6 +3021,57 @@ var useInterval = function useInterval(fn) {
|
|
|
3021
3021
|
};
|
|
3022
3022
|
/* eslint-enable */
|
|
3023
3023
|
|
|
3024
|
+
/**
|
|
3025
|
+
* Hook to wrap around useState that stores the value in the browser local/session storage.
|
|
3026
|
+
*
|
|
3027
|
+
* @param {any} initialValue the initial value to store
|
|
3028
|
+
* @param {string} key the key to store the value in local/session storage
|
|
3029
|
+
* @param {string} storage either 'local' or 'session' for what type of storage
|
|
3030
|
+
* @returns a stateful value, and a function to update it.
|
|
3031
|
+
*/
|
|
3032
|
+
|
|
3033
|
+
var useStorage = function useStorage(initialValue, key) {
|
|
3034
|
+
var storage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'local';
|
|
3035
|
+
// Since the local storage API isn't available in server-rendering environments,
|
|
3036
|
+
// we check that typeof window !== 'undefined' to make SSR and SSG work properly.
|
|
3037
|
+
var storageAvailable = typeof window !== 'undefined';
|
|
3038
|
+
|
|
3039
|
+
var _React$useState = React__namespace.useState(function () {
|
|
3040
|
+
if (!storageAvailable) {
|
|
3041
|
+
return initialValue;
|
|
3042
|
+
}
|
|
3043
|
+
|
|
3044
|
+
try {
|
|
3045
|
+
var item = storage === 'local' ? window.localStorage.getItem(key) : window.sessionStorage.getItem(key);
|
|
3046
|
+
return item ? JSON.parse(item) : initialValue;
|
|
3047
|
+
} catch (error) {
|
|
3048
|
+
// If error also return initialValue
|
|
3049
|
+
return initialValue;
|
|
3050
|
+
}
|
|
3051
|
+
}),
|
|
3052
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
3053
|
+
storedValue = _React$useState2[0],
|
|
3054
|
+
setStoredValue = _React$useState2[1];
|
|
3055
|
+
|
|
3056
|
+
var setValue = function setValue(value) {
|
|
3057
|
+
try {
|
|
3058
|
+
// Allow value to be a function so we have same API as useState
|
|
3059
|
+
var valueToStore = value instanceof Function ? value(storedValue) : value;
|
|
3060
|
+
setStoredValue(valueToStore);
|
|
3061
|
+
|
|
3062
|
+
if (storageAvailable) {
|
|
3063
|
+
var serializedValue = JSON.stringify(valueToStore);
|
|
3064
|
+
storage === 'local' ? window.localStorage.setItem(key, serializedValue) : window.sessionStorage.setItem(key, serializedValue);
|
|
3065
|
+
}
|
|
3066
|
+
} catch (error) {
|
|
3067
|
+
throw new Error("PrimeReact useStorage: Failed to serialize the value at key: ".concat(key));
|
|
3068
|
+
}
|
|
3069
|
+
};
|
|
3070
|
+
|
|
3071
|
+
return [storedValue, setValue];
|
|
3072
|
+
};
|
|
3073
|
+
/* eslint-enable */
|
|
3074
|
+
|
|
3024
3075
|
/* eslint-disable */
|
|
3025
3076
|
var useTimeout = function useTimeout(fn) {
|
|
3026
3077
|
var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
@@ -9630,7 +9681,6 @@ var Carousel = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
9630
9681
|
var itemsContainerRef = React__namespace.useRef(null);
|
|
9631
9682
|
var remainingItems = React__namespace.useRef(0);
|
|
9632
9683
|
var allowAutoplay = React__namespace.useRef(!!props.autoplayInterval);
|
|
9633
|
-
var circular = React__namespace.useRef(props.circular || !!props.autoplayInterval);
|
|
9634
9684
|
var attributeSelector = React__namespace.useRef('');
|
|
9635
9685
|
var swipeThreshold = React__namespace.useRef(20);
|
|
9636
9686
|
var startPos = React__namespace.useRef(null);
|
|
@@ -9643,6 +9693,7 @@ var Carousel = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
9643
9693
|
var prevValue = usePrevious(props.value);
|
|
9644
9694
|
var prevPage = usePrevious(props.page);
|
|
9645
9695
|
var isVertical = props.orientation === 'vertical';
|
|
9696
|
+
var circular = props.circular || !!props.autoplayInterval;
|
|
9646
9697
|
var isCircular = circular && props.value.length >= numVisibleState;
|
|
9647
9698
|
var isAutoplay = props.autoplayInterval && allowAutoplay.current;
|
|
9648
9699
|
var currentPage = props.onPageChange ? props.page : pageState;
|
|
@@ -9685,7 +9736,7 @@ var Carousel = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
9685
9736
|
page = 0;
|
|
9686
9737
|
} else if (isCircular && pageState === 0 && dir === 1) {
|
|
9687
9738
|
totalShiftedItems = 0;
|
|
9688
|
-
page =
|
|
9739
|
+
page = totalIndicators - 1;
|
|
9689
9740
|
} else if (page === totalIndicators - 1 && remainingItems.current > 0) {
|
|
9690
9741
|
totalShiftedItems += remainingItems.current * -1 - numScrollState * dir;
|
|
9691
9742
|
isRemainingItemsAdded.current = true;
|
|
@@ -9898,7 +9949,7 @@ var Carousel = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
9898
9949
|
remainingItems.current = (props.value.length - numVisibleState) % numScrollState;
|
|
9899
9950
|
var page = currentPage;
|
|
9900
9951
|
|
|
9901
|
-
if (totalIndicators !== 0 &&
|
|
9952
|
+
if (totalIndicators !== 0 && page >= totalIndicators) {
|
|
9902
9953
|
page = totalIndicators - 1;
|
|
9903
9954
|
|
|
9904
9955
|
if (props.onPageChange) {
|
|
@@ -10111,7 +10162,7 @@ var Carousel = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace
|
|
|
10111
10162
|
|
|
10112
10163
|
var createIndicator = function createIndicator(index) {
|
|
10113
10164
|
var isActive = currentPage === index;
|
|
10114
|
-
var key = '
|
|
10165
|
+
var key = 'carousel-indicator-' + index;
|
|
10115
10166
|
var className = classNames('p-carousel-indicator', {
|
|
10116
10167
|
'p-highlight': isActive
|
|
10117
10168
|
});
|
|
@@ -11138,14 +11189,18 @@ var Chips = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.fo
|
|
|
11138
11189
|
var values = props.value ? _toConsumableArray(props.value) : [];
|
|
11139
11190
|
|
|
11140
11191
|
if (props.allowDuplicate || values.indexOf(item) === -1) {
|
|
11141
|
-
|
|
11192
|
+
var allowAddition = true;
|
|
11142
11193
|
|
|
11143
11194
|
if (props.onAdd) {
|
|
11144
|
-
props.onAdd({
|
|
11195
|
+
allowAddition = props.onAdd({
|
|
11145
11196
|
originalEvent: event,
|
|
11146
11197
|
value: item
|
|
11147
11198
|
});
|
|
11148
11199
|
}
|
|
11200
|
+
|
|
11201
|
+
if (allowAddition !== false) {
|
|
11202
|
+
values.push(item);
|
|
11203
|
+
}
|
|
11149
11204
|
}
|
|
11150
11205
|
|
|
11151
11206
|
updateInput(event, values, preventDefault);
|
|
@@ -26194,7 +26249,6 @@ var InputMask = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespac
|
|
|
26194
26249
|
onInput: onInput,
|
|
26195
26250
|
onPaste: handleInputChange,
|
|
26196
26251
|
required: props.required,
|
|
26197
|
-
"aria-labelledby": props.ariaLabelledBy,
|
|
26198
26252
|
tooltip: props.tooltip,
|
|
26199
26253
|
tooltipOptions: props.tooltipOptions
|
|
26200
26254
|
}));
|
|
@@ -26222,7 +26276,6 @@ InputMask.defaultProps = {
|
|
|
26222
26276
|
required: false,
|
|
26223
26277
|
tooltip: null,
|
|
26224
26278
|
tooltipOptions: null,
|
|
26225
|
-
ariaLabelledBy: null,
|
|
26226
26279
|
onComplete: null,
|
|
26227
26280
|
onChange: null,
|
|
26228
26281
|
onFocus: null,
|
|
@@ -36883,7 +36936,7 @@ var ToggleButton = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__names
|
|
|
36883
36936
|
};
|
|
36884
36937
|
|
|
36885
36938
|
var onKeyDown = function onKeyDown(event) {
|
|
36886
|
-
if (event.
|
|
36939
|
+
if (event.keyCode === 32) {
|
|
36887
36940
|
toggle(event);
|
|
36888
36941
|
event.preventDefault();
|
|
36889
36942
|
}
|
|
@@ -36925,7 +36978,8 @@ var ToggleButton = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__names
|
|
|
36925
36978
|
onBlur: props.onBlur,
|
|
36926
36979
|
onKeyDown: onKeyDown,
|
|
36927
36980
|
tabIndex: tabIndex,
|
|
36928
|
-
"
|
|
36981
|
+
role: "button",
|
|
36982
|
+
"aria-pressed": props.checked
|
|
36929
36983
|
}), iconElement, /*#__PURE__*/React__namespace.createElement("span", {
|
|
36930
36984
|
className: "p-button-label"
|
|
36931
36985
|
}, label), /*#__PURE__*/React__namespace.createElement(Ripple, null)), hasTooltip && /*#__PURE__*/React__namespace.createElement(Tooltip, _extends({
|
|
@@ -36948,7 +37002,6 @@ ToggleButton.defaultProps = {
|
|
|
36948
37002
|
tabIndex: 0,
|
|
36949
37003
|
tooltip: null,
|
|
36950
37004
|
tooltipOptions: null,
|
|
36951
|
-
ariaLabelledBy: null,
|
|
36952
37005
|
onChange: null,
|
|
36953
37006
|
onFocus: null,
|
|
36954
37007
|
onBlur: null
|
|
@@ -41652,6 +41705,7 @@ exports.useOverlayListener = useOverlayListener;
|
|
|
41652
41705
|
exports.useOverlayScrollListener = useOverlayScrollListener;
|
|
41653
41706
|
exports.usePrevious = usePrevious;
|
|
41654
41707
|
exports.useResizeListener = useResizeListener;
|
|
41708
|
+
exports.useStorage = useStorage;
|
|
41655
41709
|
exports.useTimeout = useTimeout;
|
|
41656
41710
|
exports.useUnmountEffect = useUnmountEffect;
|
|
41657
41711
|
exports.useUpdateEffect = useUpdateEffect;
|