primereact 10.4.0 → 10.5.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/calendar/calendar.cjs.js +12 -4
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +12 -4
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +12 -4
- package/calendar/calendar.min.js +1 -1
- package/checkbox/checkbox.cjs.js +2 -0
- package/checkbox/checkbox.cjs.min.js +1 -1
- package/checkbox/checkbox.esm.js +2 -0
- package/checkbox/checkbox.esm.min.js +1 -1
- package/checkbox/checkbox.js +2 -0
- package/checkbox/checkbox.min.js +1 -1
- package/chips/chips.cjs.js +109 -20
- package/chips/chips.cjs.min.js +1 -1
- package/chips/chips.esm.js +109 -20
- package/chips/chips.esm.min.js +1 -1
- package/chips/chips.js +109 -20
- package/chips/chips.min.js +1 -1
- package/core/core.js +643 -465
- package/core/core.min.js +4 -4
- package/dropdown/dropdown.cjs.js +313 -141
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +313 -141
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +313 -141
- package/dropdown/dropdown.min.js +1 -1
- package/inputnumber/inputnumber.cjs.js +21 -17
- package/inputnumber/inputnumber.cjs.min.js +1 -1
- package/inputnumber/inputnumber.esm.js +21 -17
- package/inputnumber/inputnumber.esm.min.js +1 -1
- package/inputnumber/inputnumber.js +21 -17
- package/inputnumber/inputnumber.min.js +1 -1
- package/inputswitch/inputswitch.cjs.js +3 -1
- package/inputswitch/inputswitch.cjs.min.js +1 -1
- package/inputswitch/inputswitch.esm.js +3 -1
- package/inputswitch/inputswitch.esm.min.js +1 -1
- package/inputswitch/inputswitch.js +3 -1
- package/inputswitch/inputswitch.min.js +1 -1
- package/knob/knob.cjs.js +62 -0
- package/knob/knob.cjs.min.js +1 -1
- package/knob/knob.esm.js +62 -0
- package/knob/knob.esm.min.js +1 -1
- package/knob/knob.js +62 -0
- package/knob/knob.min.js +1 -1
- package/listbox/listbox.cjs.js +362 -92
- package/listbox/listbox.cjs.min.js +1 -1
- package/listbox/listbox.esm.js +363 -93
- package/listbox/listbox.esm.min.js +1 -1
- package/listbox/listbox.js +362 -92
- package/listbox/listbox.min.js +1 -1
- package/menu/menu.cjs.js +4 -2
- package/menu/menu.cjs.min.js +1 -1
- package/menu/menu.esm.js +4 -2
- package/menu/menu.esm.min.js +1 -1
- package/menu/menu.js +5 -4
- package/menu/menu.min.js +1 -1
- package/multiselect/multiselect.cjs.js +377 -107
- package/multiselect/multiselect.cjs.min.js +1 -1
- package/multiselect/multiselect.esm.js +377 -107
- package/multiselect/multiselect.esm.min.js +1 -1
- package/multiselect/multiselect.js +377 -107
- package/multiselect/multiselect.min.js +1 -1
- package/package.json +1 -1
- package/paginator/paginator.cjs.js +251 -251
- package/paginator/paginator.cjs.min.js +1 -1
- package/paginator/paginator.esm.js +258 -258
- package/paginator/paginator.esm.min.js +1 -1
- package/paginator/paginator.js +251 -251
- package/paginator/paginator.min.js +1 -1
- package/panelmenu/panelmenu.cjs.js +2 -1
- package/panelmenu/panelmenu.cjs.min.js +1 -1
- package/panelmenu/panelmenu.esm.js +2 -1
- package/panelmenu/panelmenu.esm.min.js +1 -1
- package/panelmenu/panelmenu.js +3 -3
- package/panelmenu/panelmenu.min.js +1 -1
- package/passthrough/tailwind/index.cjs.js +3 -2
- package/passthrough/tailwind/index.cjs.min.js +1 -1
- package/passthrough/tailwind/index.esm.js +3 -2
- package/passthrough/tailwind/index.esm.min.js +1 -1
- package/passthrough/tailwind/index.js +3 -2
- package/passthrough/tailwind/index.min.js +1 -1
- package/password/password.cjs.js +22 -20
- package/password/password.cjs.min.js +1 -1
- package/password/password.esm.js +22 -20
- package/password/password.esm.min.js +1 -1
- package/password/password.js +22 -20
- package/password/password.min.js +1 -1
- package/primereact.all.cjs.js +1473 -485
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +1473 -485
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +1473 -485
- package/primereact.all.min.js +1 -1
- package/radiobutton/radiobutton.cjs.js +1 -0
- package/radiobutton/radiobutton.cjs.min.js +1 -1
- package/radiobutton/radiobutton.esm.js +1 -0
- package/radiobutton/radiobutton.esm.min.js +1 -1
- package/radiobutton/radiobutton.js +1 -0
- package/radiobutton/radiobutton.min.js +1 -1
- package/rating/rating.cjs.js +103 -4
- package/rating/rating.cjs.min.js +1 -1
- package/rating/rating.esm.js +103 -4
- package/rating/rating.esm.min.js +1 -1
- package/rating/rating.js +103 -4
- package/rating/rating.min.js +1 -1
- package/resources/themes/arya-blue/theme.css +328 -67
- package/resources/themes/arya-green/theme.css +328 -67
- package/resources/themes/arya-orange/theme.css +328 -67
- package/resources/themes/arya-purple/theme.css +26 -6
- package/resources/themes/bootstrap4-dark-blue/theme.css +328 -67
- package/resources/themes/bootstrap4-dark-purple/theme.css +26 -6
- package/resources/themes/bootstrap4-light-blue/theme.css +328 -67
- package/resources/themes/bootstrap4-light-purple/theme.css +26 -6
- package/resources/themes/fluent-light/theme.css +327 -66
- package/resources/themes/lara-dark-amber/theme.css +328 -67
- package/resources/themes/lara-dark-blue/theme.css +328 -67
- package/resources/themes/lara-dark-cyan/theme.css +328 -67
- package/resources/themes/lara-dark-green/theme.css +328 -67
- package/resources/themes/lara-dark-indigo/theme.css +328 -67
- package/resources/themes/lara-dark-pink/theme.css +328 -67
- package/resources/themes/lara-dark-purple/theme.css +26 -6
- package/resources/themes/lara-dark-teal/theme.css +328 -67
- package/resources/themes/lara-light-amber/theme.css +328 -67
- package/resources/themes/lara-light-blue/theme.css +328 -67
- package/resources/themes/lara-light-cyan/theme.css +328 -67
- package/resources/themes/lara-light-green/theme.css +328 -67
- package/resources/themes/lara-light-indigo/theme.css +328 -67
- package/resources/themes/lara-light-pink/theme.css +328 -67
- package/resources/themes/lara-light-purple/theme.css +26 -6
- package/resources/themes/lara-light-teal/theme.css +328 -67
- package/resources/themes/luna-amber/theme.css +328 -67
- package/resources/themes/luna-blue/theme.css +328 -67
- package/resources/themes/luna-green/theme.css +328 -67
- package/resources/themes/luna-pink/theme.css +328 -67
- package/resources/themes/md-dark-deeppurple/theme.css +158 -138
- package/resources/themes/md-dark-indigo/theme.css +454 -193
- package/resources/themes/md-light-deeppurple/theme.css +26 -6
- package/resources/themes/md-light-indigo/theme.css +328 -67
- package/resources/themes/mdc-dark-deeppurple/theme.css +158 -138
- package/resources/themes/mdc-dark-indigo/theme.css +454 -193
- package/resources/themes/mdc-light-deeppurple/theme.css +26 -6
- package/resources/themes/mdc-light-indigo/theme.css +328 -67
- package/resources/themes/mira/theme.css +328 -67
- package/resources/themes/nano/theme.css +328 -67
- package/resources/themes/nova/theme.css +328 -67
- package/resources/themes/nova-accent/theme.css +328 -67
- package/resources/themes/nova-alt/theme.css +328 -67
- package/resources/themes/rhea/theme.css +328 -67
- package/resources/themes/saga-blue/theme.css +328 -67
- package/resources/themes/saga-green/theme.css +328 -67
- package/resources/themes/saga-orange/theme.css +328 -67
- package/resources/themes/saga-purple/theme.css +26 -6
- package/resources/themes/soho-dark/theme.css +353 -92
- package/resources/themes/soho-light/theme.css +328 -67
- package/resources/themes/tailwind-light/theme.css +329 -71
- package/resources/themes/vela-blue/theme.css +328 -67
- package/resources/themes/vela-green/theme.css +328 -67
- package/resources/themes/vela-orange/theme.css +328 -67
- package/resources/themes/vela-purple/theme.css +26 -6
- package/resources/themes/viva-dark/theme.css +328 -67
- package/resources/themes/viva-light/theme.css +328 -67
- package/selectbutton/selectbutton.cjs.js +96 -50
- package/selectbutton/selectbutton.cjs.min.js +1 -1
- package/selectbutton/selectbutton.esm.js +96 -50
- package/selectbutton/selectbutton.esm.min.js +1 -1
- package/selectbutton/selectbutton.js +96 -50
- package/selectbutton/selectbutton.min.js +1 -1
- package/slider/slider.cjs.js +25 -4
- package/slider/slider.cjs.min.js +1 -1
- package/slider/slider.esm.js +25 -4
- package/slider/slider.esm.min.js +1 -1
- package/slider/slider.js +25 -4
- package/slider/slider.min.js +1 -1
- package/splitter/splitter.cjs.js +16 -15
- package/splitter/splitter.cjs.min.js +1 -1
- package/splitter/splitter.esm.js +16 -15
- package/splitter/splitter.esm.min.js +1 -1
- package/splitter/splitter.js +16 -15
- package/splitter/splitter.min.js +1 -1
- package/tabview/tabview.cjs.js +6 -5
- package/tabview/tabview.cjs.min.js +1 -1
- package/tabview/tabview.d.ts +39 -34
- package/tabview/tabview.esm.js +6 -5
- package/tabview/tabview.esm.min.js +1 -1
- package/tabview/tabview.js +6 -5
- package/tabview/tabview.min.js +1 -1
- package/togglebutton/togglebutton.cjs.js +15 -14
- package/togglebutton/togglebutton.cjs.min.js +1 -1
- package/togglebutton/togglebutton.esm.js +14 -13
- package/togglebutton/togglebutton.esm.min.js +1 -1
- package/togglebutton/togglebutton.js +15 -14
- package/togglebutton/togglebutton.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.cjs.js +3 -2
- package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.esm.js +3 -2
- package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
- package/tristatecheckbox/tristatecheckbox.js +3 -2
- package/tristatecheckbox/tristatecheckbox.min.js +1 -1
- package/web-types.json +1 -1
package/knob/knob.js
CHANGED
|
@@ -88,6 +88,7 @@ this.primereact.knob = (function (exports, React, api, componentbase, hooks, uti
|
|
|
88
88
|
disabled: false,
|
|
89
89
|
readOnly: false,
|
|
90
90
|
showValue: true,
|
|
91
|
+
tabIndex: 0,
|
|
91
92
|
step: 1,
|
|
92
93
|
min: 0,
|
|
93
94
|
max: 100,
|
|
@@ -251,6 +252,15 @@ this.primereact.knob = (function (exports, React, api, componentbase, hooks, uti
|
|
|
251
252
|
});
|
|
252
253
|
}
|
|
253
254
|
};
|
|
255
|
+
var updateModelValue = function updateModelValue(newValue) {
|
|
256
|
+
var currentValue;
|
|
257
|
+
if (newValue > props.max) currentValue = props.max;else if (newValue < props.min) currentValue = props.min;else currentValue = newValue;
|
|
258
|
+
if (props.onChange) {
|
|
259
|
+
props.onChange({
|
|
260
|
+
value: currentValue
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
};
|
|
254
264
|
var _onClick = function onClick(event) {
|
|
255
265
|
if (!props.disabled && !props.readOnly) {
|
|
256
266
|
updateValue(event.nativeEvent.offsetX, event.nativeEvent.offsetY);
|
|
@@ -273,6 +283,48 @@ this.primereact.knob = (function (exports, React, api, componentbase, hooks, uti
|
|
|
273
283
|
unbindWindowTouchMoveListener();
|
|
274
284
|
unbindWindowTouchEndListener();
|
|
275
285
|
};
|
|
286
|
+
var _onKeyDown = function onKeyDown(event) {
|
|
287
|
+
if (!props.disabled && !props.readonly) {
|
|
288
|
+
switch (event.code) {
|
|
289
|
+
case 'ArrowRight':
|
|
290
|
+
case 'ArrowUp':
|
|
291
|
+
event.preventDefault();
|
|
292
|
+
updateModelValue(props.value + 1);
|
|
293
|
+
break;
|
|
294
|
+
case 'ArrowLeft':
|
|
295
|
+
case 'ArrowDown':
|
|
296
|
+
{
|
|
297
|
+
event.preventDefault();
|
|
298
|
+
updateModelValue(props.value - 1);
|
|
299
|
+
break;
|
|
300
|
+
}
|
|
301
|
+
case 'Home':
|
|
302
|
+
{
|
|
303
|
+
event.preventDefault();
|
|
304
|
+
updateModelValue(props.min);
|
|
305
|
+
break;
|
|
306
|
+
}
|
|
307
|
+
case 'End':
|
|
308
|
+
{
|
|
309
|
+
event.preventDefault();
|
|
310
|
+
updateModelValue(props.max);
|
|
311
|
+
break;
|
|
312
|
+
}
|
|
313
|
+
case 'PageUp':
|
|
314
|
+
{
|
|
315
|
+
event.preventDefault();
|
|
316
|
+
updateModelValue(props.value + 10);
|
|
317
|
+
break;
|
|
318
|
+
}
|
|
319
|
+
case 'PageDown':
|
|
320
|
+
{
|
|
321
|
+
event.preventDefault();
|
|
322
|
+
updateModelValue(props.value - 10);
|
|
323
|
+
break;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
};
|
|
276
328
|
React__namespace.useImperativeHandle(ref, function () {
|
|
277
329
|
return {
|
|
278
330
|
props: props,
|
|
@@ -300,6 +352,13 @@ this.primereact.knob = (function (exports, React, api, componentbase, hooks, uti
|
|
|
300
352
|
viewBox: '0 0 100 100',
|
|
301
353
|
width: props.size,
|
|
302
354
|
height: props.size,
|
|
355
|
+
'aria-valuemin': props.min,
|
|
356
|
+
'aria-valuemax': props.max,
|
|
357
|
+
'aria-valuenow': props.value,
|
|
358
|
+
'aria-labelledby': props.ariaLabelledby,
|
|
359
|
+
'aria-label': props.ariaLabel,
|
|
360
|
+
role: 'slider',
|
|
361
|
+
tabIndex: props.readonly || props.disabled ? -1 : props.tabIndex,
|
|
303
362
|
onClick: function onClick(e) {
|
|
304
363
|
return _onClick(e);
|
|
305
364
|
},
|
|
@@ -314,6 +373,9 @@ this.primereact.knob = (function (exports, React, api, componentbase, hooks, uti
|
|
|
314
373
|
},
|
|
315
374
|
onTouchEnd: function onTouchEnd(e) {
|
|
316
375
|
return _onTouchEnd();
|
|
376
|
+
},
|
|
377
|
+
onKeyDown: function onKeyDown(e) {
|
|
378
|
+
return _onKeyDown(e);
|
|
317
379
|
}
|
|
318
380
|
}, ptm('svg'));
|
|
319
381
|
var rangeProps = mergeProps({
|
package/knob/knob.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
this.primereact=this.primereact||{},this.primereact.knob=function(e,t,n,r,
|
|
1
|
+
this.primereact=this.primereact||{},this.primereact.knob=function(e,t,n,a,r,o){"use strict";function l(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var i=l(t);function s(e){if(Array.isArray(e))return e}function u(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,o,l,i=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(a=o.call(n)).done)&&(i.push(a.value),i.length!==t);s=!0);}catch(e){u=!0,r=e}finally{try{if(!s&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw r}}return i}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function f(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}function m(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(e,t){return s(e)||u(e,t)||f(e,t)||m()}var v=a.ComponentBase.extend({defaultProps:{__TYPE:"Knob",id:null,style:null,className:null,value:null,size:100,disabled:!1,readOnly:!1,showValue:!0,tabIndex:0,step:1,min:0,max:100,strokeWidth:14,name:null,valueColor:"var(--primary-color, Black)",rangeColor:"var(--surface-border, LightGray)",textColor:"var(--text-color-secondary, Black)",valueTemplate:"{value}",onChange:null,children:void 0},css:{classes:{range:"p-knob-range",value:"p-knob-value",label:"p-knob-text",root:function(e){var t=e.props;return o.classNames("p-knob p-component",{"p-disabled":t.disabled},t.className)}},styles:"\n @keyframes dash-frame {\n 100% {\n stroke-dashoffset: 0;\n }\n }\n @layer primereact {\n .p-knob-range {\n fill: none;\n transition: stroke .1s ease-in;\n }\n .p-knob-value {\n animation-name: dash-frame;\n animation-fill-mode: forwards;\n fill: none;\n }\n .p-knob-text {\n font-size: 1.3rem;\n text-align: center;\n }\n }\n "}}),p=40,h=4*Math.PI/3,b=-Math.PI/3,y=i.memo(i.forwardRef((function(e,t){var o=r.useMergeProps(),l=i.useContext(n.PrimeReactContext),s=v.getProps(e,l),u=v.setMetaData({props:s}),c=u.ptm,f=u.cx;a.useHandleStyle(v.css.styles,u.isUnstyled,{name:"knob"});var m=i.useRef(null),y=!s.disabled&&!s.readOnly,g=d(r.useEventListener({target:"window",type:"mousemove",listener:function(e){T(e.offsetX,e.offsetY),e.preventDefault()},when:y}),2),w=g[0],k=g[1],x=d(r.useEventListener({target:"window",type:"mouseup",listener:function(e){k(),C(),e.preventDefault()},when:y}),2),M=x[0],C=x[1],E=d(r.useEventListener({target:"window",type:"touchmove",listener:function(e){if(1===e.touches.length){var t=m.current.getBoundingClientRect(),n=e.targetTouches.item(0);T(n.clientX-t.left,n.clientY-t.top),e.preventDefault()}},when:y}),2),D=E[0],P=E[1],O=d(r.useEventListener({target:"window",type:"touchend",listener:function(){P(),I()},when:y}),2),A=O[0],I=O[1],j=function(e,t,n,a,r){return(e-t)*(r-a)/(n-t)+a},L=function(){return j(s.min>0&&s.max>0?s.min:0,s.min,s.max,h,b)},N=function(){return j(s.value,s.min,s.max,h,b)},S="M ".concat(50+Math.cos(h)*p," ").concat(50-Math.sin(h)*p," A ").concat(p," ").concat(p," 0 1 1 ").concat(50+Math.cos(b)*p," ").concat(50-Math.sin(b)*p),z="M ".concat(50+Math.cos(L())*p," ").concat(50-Math.sin(L())*p," A ").concat(p," ").concat(p," 0 ").concat(Math.abs(L()-N())<Math.PI?0:1," ").concat(N()>L()?0:1," ").concat(50+Math.cos(N())*p," ").concat(50-Math.sin(N())*p),T=function(e,t){var n=Math.atan2(s.size/2-t,e-s.size/2),a=-Math.PI/2-Math.PI/6;R(n,a)},R=function(e,t){var n;if(e>b)n=j(e,h,b,s.min,s.max);else{if(!(e<t))return;n=j(e+2*Math.PI,h,b,s.min,s.max)}s.onChange&&s.onChange({value:Math.round((n-s.min)/s.step)*s.step+s.min})},_=function(e){var t;t=e>s.max?s.max:e<s.min?s.min:e,s.onChange&&s.onChange({value:t})},B=function(e){if(!s.disabled&&!s.readonly)switch(e.code){case"ArrowRight":case"ArrowUp":e.preventDefault(),_(s.value+1);break;case"ArrowLeft":case"ArrowDown":e.preventDefault(),_(s.value-1);break;case"Home":e.preventDefault(),_(s.min);break;case"End":e.preventDefault(),_(s.max);break;case"PageUp":e.preventDefault(),_(s.value+10);break;case"PageDown":e.preventDefault(),_(s.value-10)}};i.useImperativeHandle(t,(function(){return{props:s,getElement:function(){return m.current}}}));var U=o({x:50,y:57,textAnchor:"middle",fill:s.textColor,className:f("label"),name:s.name},c("label")),W=s.showValue&&i.createElement("text",U,s.valueTemplate.replace("{value}",s.value.toString())),K=o({ref:m,id:s.id,className:f("root"),style:s.style},c("root")),Y=o({viewBox:"0 0 100 100",width:s.size,height:s.size,"aria-valuemin":s.min,"aria-valuemax":s.max,"aria-valuenow":s.value,"aria-labelledby":s.ariaLabelledby,"aria-label":s.ariaLabel,role:"slider",tabIndex:s.readonly||s.disabled?-1:s.tabIndex,onClick:function(e){return t=e,void(s.disabled||s.readOnly||T(t.nativeEvent.offsetX,t.nativeEvent.offsetY));var t},onMouseDown:function(e){return t=e,w(),M(),void t.preventDefault();var t},onMouseUp:function(e){return k(),void C()},onTouchStart:function(e){return D(),void A()},onTouchEnd:function(e){return P(),void I()},onKeyDown:function(e){return B(e)}},c("svg")),H=o({d:S,strokeWidth:s.strokeWidth,stroke:s.rangeColor,className:f("range")},c("range")),X=o({d:z,strokeWidth:s.strokeWidth,stroke:s.valueColor,className:f("value")},c("value"));return i.createElement("div",K,i.createElement("svg",Y,i.createElement("path",H),i.createElement("path",X),W))})));return y.displayName="Knob",e.Knob=y,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.api,primereact.componentbase,primereact.hooks,primereact.utils);
|