primereact 8.1.0 → 8.1.1
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/autocomplete/autocomplete.cjs.js +8 -3
- package/autocomplete/autocomplete.cjs.min.js +1 -1
- package/autocomplete/autocomplete.esm.js +8 -3
- package/autocomplete/autocomplete.esm.min.js +1 -1
- package/autocomplete/autocomplete.js +8 -3
- package/autocomplete/autocomplete.min.js +1 -1
- package/calendar/calendar.cjs.js +1 -1
- package/calendar/calendar.cjs.min.js +1 -1
- package/calendar/calendar.esm.js +1 -1
- package/calendar/calendar.esm.min.js +1 -1
- package/calendar/calendar.js +1 -1
- package/calendar/calendar.min.js +1 -1
- package/core/core.js +54 -4
- package/core/core.min.js +3 -3
- package/dialog/dialog.cjs.js +5 -1
- package/dialog/dialog.cjs.min.js +1 -1
- package/dialog/dialog.d.ts +2 -0
- package/dialog/dialog.esm.js +5 -1
- package/dialog/dialog.esm.min.js +1 -1
- package/dialog/dialog.js +5 -1
- package/dialog/dialog.min.js +1 -1
- package/dropdown/dropdown.cjs.js +1 -1
- package/dropdown/dropdown.cjs.min.js +1 -1
- package/dropdown/dropdown.esm.js +1 -1
- package/dropdown/dropdown.esm.min.js +1 -1
- package/dropdown/dropdown.js +1 -1
- package/dropdown/dropdown.min.js +1 -1
- package/hooks/hooks.cjs.js +48 -2
- package/hooks/hooks.cjs.min.js +1 -1
- package/hooks/hooks.d.ts +3 -1
- package/hooks/hooks.esm.js +47 -3
- package/hooks/hooks.esm.min.js +1 -1
- package/hooks/hooks.js +48 -2
- package/hooks/hooks.min.js +1 -1
- package/package.json +1 -1
- package/primereact.all.cjs.js +80 -30
- package/primereact.all.cjs.min.js +1 -1
- package/primereact.all.esm.js +79 -31
- package/primereact.all.esm.min.js +1 -1
- package/primereact.all.js +80 -30
- package/primereact.all.min.js +1 -1
- package/resources/primereact.css +113 -113
- package/resources/primereact.min.css +1 -1
- package/styleclass/styleclass.cjs.js +12 -17
- package/styleclass/styleclass.cjs.min.js +1 -1
- package/styleclass/styleclass.esm.js +12 -17
- package/styleclass/styleclass.esm.min.js +1 -1
- package/styleclass/styleclass.js +12 -17
- package/styleclass/styleclass.min.js +1 -1
- package/treetable/treetable.cjs.js +5 -5
- package/treetable/treetable.cjs.min.js +1 -1
- package/treetable/treetable.d.ts +1 -1
- package/treetable/treetable.esm.js +5 -5
- package/treetable/treetable.esm.min.js +1 -1
- package/treetable/treetable.js +5 -5
- package/treetable/treetable.min.js +1 -1
- package/web-types.json +14 -2
package/core/core.js
CHANGED
|
@@ -3207,9 +3207,25 @@ this.primereact.hooks = (function (exports, React, utils) {
|
|
|
3207
3207
|
|
|
3208
3208
|
var useStorage = function useStorage(initialValue, key) {
|
|
3209
3209
|
var storage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'local';
|
|
3210
|
-
// Since the local storage API isn't available in server-rendering environments,
|
|
3210
|
+
// Since the local storage API isn't available in server-rendering environments,
|
|
3211
3211
|
// we check that typeof window !== 'undefined' to make SSR and SSG work properly.
|
|
3212
|
-
var storageAvailable = typeof window !== 'undefined';
|
|
3212
|
+
var storageAvailable = typeof window !== 'undefined'; // subscribe to window storage event so changes in one tab to a stored value
|
|
3213
|
+
// are properly reflected in all tabs
|
|
3214
|
+
|
|
3215
|
+
var _useEventListener = useEventListener({
|
|
3216
|
+
target: 'window',
|
|
3217
|
+
type: 'storage',
|
|
3218
|
+
listener: function listener(event) {
|
|
3219
|
+
var area = storage === 'local' ? window.localStorage : window.sessionStorage;
|
|
3220
|
+
|
|
3221
|
+
if (event.storageArea === area && event.key === key) {
|
|
3222
|
+
setStoredValue(event.newValue || undefined);
|
|
3223
|
+
}
|
|
3224
|
+
}
|
|
3225
|
+
}),
|
|
3226
|
+
_useEventListener2 = _slicedToArray(_useEventListener, 2),
|
|
3227
|
+
bindWindowStorageListener = _useEventListener2[0],
|
|
3228
|
+
unbindWindowStorageListener = _useEventListener2[1];
|
|
3213
3229
|
|
|
3214
3230
|
var _React$useState = React__namespace.useState(function () {
|
|
3215
3231
|
if (!storageAvailable) {
|
|
@@ -3243,8 +3259,36 @@ this.primereact.hooks = (function (exports, React, utils) {
|
|
|
3243
3259
|
}
|
|
3244
3260
|
};
|
|
3245
3261
|
|
|
3262
|
+
React__namespace.useEffect(function () {
|
|
3263
|
+
bindWindowStorageListener();
|
|
3264
|
+
return function () {
|
|
3265
|
+
return unbindWindowStorageListener();
|
|
3266
|
+
};
|
|
3267
|
+
}, []);
|
|
3246
3268
|
return [storedValue, setValue];
|
|
3247
3269
|
};
|
|
3270
|
+
/**
|
|
3271
|
+
* Hook to wrap around useState that stores the value in the browser local storage.
|
|
3272
|
+
*
|
|
3273
|
+
* @param {any} initialValue the initial value to store
|
|
3274
|
+
* @param {string} key the key to store the value in local storage
|
|
3275
|
+
* @returns a stateful value, and a function to update it.
|
|
3276
|
+
*/
|
|
3277
|
+
|
|
3278
|
+
var useLocalStorage = function useLocalStorage(initialValue, key) {
|
|
3279
|
+
return useStorage(initialValue, key, 'local');
|
|
3280
|
+
};
|
|
3281
|
+
/**
|
|
3282
|
+
* Hook to wrap around useState that stores the value in the browser session storage.
|
|
3283
|
+
*
|
|
3284
|
+
* @param {any} initialValue the initial value to store
|
|
3285
|
+
* @param {string} key the key to store the value in session storage
|
|
3286
|
+
* @returns a stateful value, and a function to update it.
|
|
3287
|
+
*/
|
|
3288
|
+
|
|
3289
|
+
var useSessionStorage = function useSessionStorage(initialValue, key) {
|
|
3290
|
+
return useStorage(initialValue, key, 'session');
|
|
3291
|
+
};
|
|
3248
3292
|
/* eslint-enable */
|
|
3249
3293
|
|
|
3250
3294
|
/* eslint-disable */
|
|
@@ -3280,11 +3324,13 @@ this.primereact.hooks = (function (exports, React, utils) {
|
|
|
3280
3324
|
|
|
3281
3325
|
exports.useEventListener = useEventListener;
|
|
3282
3326
|
exports.useInterval = useInterval;
|
|
3327
|
+
exports.useLocalStorage = useLocalStorage;
|
|
3283
3328
|
exports.useMountEffect = useMountEffect;
|
|
3284
3329
|
exports.useOverlayListener = useOverlayListener;
|
|
3285
3330
|
exports.useOverlayScrollListener = useOverlayScrollListener;
|
|
3286
3331
|
exports.usePrevious = usePrevious;
|
|
3287
3332
|
exports.useResizeListener = useResizeListener;
|
|
3333
|
+
exports.useSessionStorage = useSessionStorage;
|
|
3288
3334
|
exports.useStorage = useStorage;
|
|
3289
3335
|
exports.useTimeout = useTimeout;
|
|
3290
3336
|
exports.useUnmountEffect = useUnmountEffect;
|
|
@@ -8517,7 +8563,7 @@ this.primereact.dropdown = (function (exports, React, PrimeReact, hooks, overlay
|
|
|
8517
8563
|
if (highlightItem && highlightItem.scrollIntoView) {
|
|
8518
8564
|
highlightItem.scrollIntoView({
|
|
8519
8565
|
block: 'nearest',
|
|
8520
|
-
inline: '
|
|
8566
|
+
inline: 'nearest'
|
|
8521
8567
|
});
|
|
8522
8568
|
}
|
|
8523
8569
|
};
|
|
@@ -9438,9 +9484,11 @@ this.primereact.dialog = (function (exports, React, PrimeReact, csstransition, h
|
|
|
9438
9484
|
var icons = utils.ObjectUtils.getJSXElement(props.icons, props);
|
|
9439
9485
|
var header = utils.ObjectUtils.getJSXElement(props.header, props);
|
|
9440
9486
|
var headerId = idState + '_header';
|
|
9487
|
+
var headerClassName = utils.classNames('p-dialog-header', props.headerClassName);
|
|
9441
9488
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
9442
9489
|
ref: headerRef,
|
|
9443
|
-
|
|
9490
|
+
style: props.headerStyle,
|
|
9491
|
+
className: headerClassName,
|
|
9444
9492
|
onMouseDown: onDragStart
|
|
9445
9493
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
9446
9494
|
id: headerId,
|
|
@@ -9562,6 +9610,8 @@ this.primereact.dialog = (function (exports, React, PrimeReact, csstransition, h
|
|
|
9562
9610
|
modal: true,
|
|
9563
9611
|
onHide: null,
|
|
9564
9612
|
onShow: null,
|
|
9613
|
+
headerStyle: null,
|
|
9614
|
+
headerClassName: null,
|
|
9565
9615
|
contentStyle: null,
|
|
9566
9616
|
contentClassName: null,
|
|
9567
9617
|
closeOnEscape: true,
|
package/core/core.min.js
CHANGED
|
@@ -2,7 +2,7 @@ this.primereact=this.primereact||{},this.primereact.utils=function(e,t){"use str
|
|
|
2
2
|
|
|
3
3
|
this.primereact=this.primereact||{},this.primereact.api=function(i,e){"use strict";function t(i,e){for(var t=0;t<e.length;t++){var p=e[t];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(i,p.key,p)}}function p(i,e,p){return e&&t(i.prototype,e),p&&t(i,p),i}function r(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function n(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var o=Object.freeze({STARTS_WITH:"startsWith",CONTAINS:"contains",NOT_CONTAINS:"notContains",ENDS_WITH:"endsWith",EQUALS:"equals",NOT_EQUALS:"notEquals",IN:"in",LESS_THAN:"lt",LESS_THAN_OR_EQUAL_TO:"lte",GREATER_THAN:"gt",GREATER_THAN_OR_EQUAL_TO:"gte",BETWEEN:"between",DATE_IS:"dateIs",DATE_IS_NOT:"dateIsNot",DATE_BEFORE:"dateBefore",DATE_AFTER:"dateAfter",CUSTOM:"custom"}),a=p((function i(){r(this,i)}));function l(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(i);e&&(p=p.filter((function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),t.push.apply(t,p)}return t}function c(i){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?l(Object(t),!0).forEach((function(e){n(i,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(t,e))}))}return i}n(a,"ripple",!1),n(a,"inputStyle","outlined"),n(a,"locale","en"),n(a,"appendTo",null),n(a,"cssTransition",!0),n(a,"autoZIndex",!0),n(a,"nonce",null),n(a,"zIndex",{modal:1100,overlay:1e3,menu:1e3,tooltip:1100,toast:1200}),n(a,"filterMatchModeOptions",{text:[o.STARTS_WITH,o.CONTAINS,o.NOT_CONTAINS,o.ENDS_WITH,o.EQUALS,o.NOT_EQUALS],numeric:[o.EQUALS,o.NOT_EQUALS,o.LESS_THAN,o.LESS_THAN_OR_EQUAL_TO,o.GREATER_THAN,o.GREATER_THAN_OR_EQUAL_TO],date:[o.DATE_IS,o.DATE_IS_NOT,o.DATE_BEFORE,o.DATE_AFTER]});var s={en:{startsWith:"Starts with",contains:"Contains",notContains:"Not contains",endsWith:"Ends with",equals:"Equals",notEquals:"Not equals",noFilter:"No Filter",lt:"Less than",lte:"Less than or equal to",gt:"Greater than",gte:"Greater than or equal to",dateIs:"Date is",dateIsNot:"Date is not",dateBefore:"Date is before",dateAfter:"Date is after",custom:"Custom",clear:"Clear",apply:"Apply",matchAll:"Match All",matchAny:"Match Any",addRule:"Add Rule",removeRule:"Remove Rule",accept:"Yes",reject:"No",choose:"Choose",upload:"Upload",cancel:"Cancel",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",weekHeader:"Wk",firstDayOfWeek:0,dateFormat:"mm/dd/yy",weak:"Weak",medium:"Medium",strong:"Strong",passwordPrompt:"Enter a password",emptyFilterMessage:"No available options",emptyMessage:"No results found",aria:{trueLabel:"True",falseLabel:"False",nullLabel:"Not Selected",pageLabel:"Page",firstPageLabel:"First Page",lastPageLabel:"Last Page",nextPageLabel:"Next Page",previousPageLabel:"Previous Page"}}};function u(i){return s[i||a.locale]}var E=Object.freeze({ALIGN_CENTER:"pi pi-align-center",ALIGN_JUSTIFY:"pi pi-align-justify",ALIGN_LEFT:"pi pi-align-left",ALIGN_RIGHT:"pi pi-align-right",AMAZON:"pi pi-amazon",ANDROID:"pi pi-android",ANGLE_DOUBLE_DOWN:"pi pi-angle-double-down",ANGLE_DOUBLE_LEFT:"pi pi-angle-double-left",ANGLE_DOUBLE_RIGHT:"pi pi-angle-double-right",ANGLE_DOUBLE_UP:"pi pi-angle-double-up",ANGLE_DOWN:"pi pi-angle-down",ANGLE_LEFT:"pi pi-angle-left",ANGLE_RIGHT:"pi pi-angle-right",ANGLE_UP:"pi pi-angle-up",APPLE:"pi pi-apple",ARROW_CIRCLE_DOWN:"pi pi-arrow-circle-down",ARROW_CIRCLE_LEFT:"pi pi-arrow-circle-left",ARROW_CIRCLE_RIGHT:"pi pi-arrow-circle-right",ARROW_CIRCLE_UP:"pi pi-arrow-circle-up",ARROW_DOWN:"pi pi-arrow-down",ARROW_DOWN_LEFT:"pi pi-arrow-down-left",ARROW_DOWN_RIGHT:"pi pi-arrow-down-right",ARROW_LEFT:"pi pi-arrow-left",ARROW_RIGHT:"pi pi-arrow-right",ARROW_UP:"pi pi-arrow-up",ARROW_UP_LEFT:"pi pi-arrow-up-left",ARROW_UP_RIGHT:"pi pi-arrow-up-right",ARROWS_H:"pi pi-arrows-h",ARROWS_V:"pi pi-arrows-v",AT:"pi pi-at",BACKWARD:"pi pi-backward",BAN:"pi pi-ban",BARS:"pi pi-bars",BELL:"pi pi-bell",BOLT:"pi pi-bolt",BOOK:"pi pi-book",BOOKMARK:"pi pi-bookmark",BOOKMARK_FILL:"pi pi-bookmark-fill",BOX:"pi pi-box",BRIEFCASE:"pi pi-briefcase",BUILDING:"pi pi-building",CALENDAR:"pi pi-calendar",CALENDAR_MINUS:"pi pi-calendar-minus",CALENDAR_PLUS:"pi pi-calendar-plus",CALENDAR_TIMES:"pi pi-calendar-times",CAMERA:"pi pi-camera",CAR:"pi pi-car",CARET_DOWN:"pi pi-caret-down",CARET_LEFT:"pi pi-caret-left",CARET_RIGHT:"pi pi-caret-right",CARET_UP:"pi pi-caret-up",CHART_BAR:"pi pi-chart-bar",CHART_LINE:"pi pi-chart-line",CHART_PIE:"pi pi-chart-pie",CHECK:"pi pi-check",CHECK_CIRCLE:"pi pi-check-circle",CHECK_SQUARE:"pi pi-check-square",CHEVRON_CIRCLE_DOWN:"pi pi-chevron-circle-down",CHEVRON_CIRCLE_LEFT:"pi pi-chevron-circle-left",CHEVRON_CIRCLE_RIGHT:"pi pi-chevron-circle-right",CHEVRON_CIRCLE_UP:"pi pi-chevron-circle-up",CHEVRON_DOWN:"pi pi-chevron-down",CHEVRON_LEFT:"pi pi-chevron-left",CHEVRON_RIGHT:"pi pi-chevron-right",CHEVRON_UP:"pi pi-chevron-up",CIRCLE:"pi pi-circle",CIRCLE_FILL:"pi pi-circle-fill",CLOCK:"pi pi-clock",CLONE:"pi pi-clone",CLOUD:"pi pi-cloud",CLOUD_DOWNLOAD:"pi pi-cloud-download",CLOUD_UPLOAD:"pi pi-cloud-upload",CODE:"pi pi-code",COG:"pi pi-cog",COMMENT:"pi pi-comment",COMMENTS:"pi pi-comments",COMPASS:"pi pi-compass",COPY:"pi pi-copy",CREDIT_CARD:"pi pi-credit-card",DATABASE:"pi pi-database",DESKTOP:"pi pi-desktop",DIRECTIONS:"pi pi-directions",DIRECTIONS_ALT:"pi pi-directions-alt",DISCORD:"pi pi-discord",DOLLAR:"pi pi-dollar",DOWNLOAD:"pi pi-download",EJECT:"pi pi-eject",ELLIPSIS_H:"pi pi-ellipsis-h",ELLIPSIS_V:"pi pi-ellipsis-v",ENVELOPE:"pi pi-envelope",EURO:"pi pi-euro",EXCLAMATION_CIRCLE:"pi pi-exclamation-circle",EXCLAMATION_TRIANGLE:"pi pi-exclamation-triangle",EXTERNAL_LINK:"pi pi-external-link",EYE:"pi pi-eye",EYE_SLASH:"pi pi-eye-slash",FACEBOOK:"pi pi-facebook",FAST_BACKWARD:"pi pi-fast-backward",FAST_FORWARD:"pi pi-fast-forward",FILE:"pi pi-file",FILE_EXCEL:"pi pi-file-excel",FILE_PDF:"pi pi-file-pdf",FILTER:"pi pi-filter",FILTER_FILL:"pi pi-filter-fill",FILTER_SLASH:"pi pi-filter-slash",FLAG:"pi pi-flag",FLAG_FILL:"pi pi-flag-fill",FOLDER:"pi pi-folder",FOLDER_OPEN:"pi pi-folder-open",FORWARD:"pi pi-forward",GITHUB:"pi pi-github",GLOBE:"pi pi-globe",GOOGLE:"pi pi-google",HASHTAG:"pi pi-hashtag",HEART:"pi pi-heart",HEART_FILL:"pi pi-heart-fill",HISTORY:"pi pi-history",HOME:"pi pi-home",ID_CARD:"pi pi-id-card",IMAGE:"pi pi-image",IMAGES:"pi pi-images",INBOX:"pi pi-inbox",INFO:"pi pi-info",INFO_CIRCLE:"pi pi-info-circle",INSTAGRAM:"pi pi-instagram",KEY:"pi pi-key",LINK:"pi pi-link",LINKEDIN:"pi pi-linkedin",LIST:"pi pi-list",LOCK:"pi pi-lock",LOCK_OPEN:"pi pi-lock-open",MAP:"pi pi-map",MAP_MARKER:"pi pi-map-marker",MICROSOFT:"pi pi-microsoft",MINUS:"pi pi-minus",MINUS_CIRCLE:"pi pi-minus-circle",MOBILE:"pi pi-mobile",MONEY_BILL:"pi pi-money-bill",MOON:"pi pi-moon",PALETTE:"pi pi-palette",PAPERCLIP:"pi pi-paperclip",PAUSE:"pi pi-pause",PAYPAL:"pi pi-paypal",PENCIL:"pi pi-pencil",PERCENTAGE:"pi pi-percentage",PHONE:"pi pi-phone",PLAY:"pi pi-play",PLUS:"pi pi-plus",PLUS_CIRCLE:"pi pi-plus-circle",POUND:"pi pi-pound",POWER_OFF:"pi pi-power-off",PRIME:"pi pi-prime",PRINT:"pi pi-print",QRCODE:"pi pi-qrcode",QUESTION:"pi pi-question",QUESTION_CIRCLE:"pi pi-question-circle",REDDIT:"pi pi-reddit",REFRESH:"pi pi-refresh",REPLAY:"pi pi-replay",REPLY:"pi pi-reply",SAVE:"pi pi-save",SEARCH:"pi pi-search",SEARCH_MINUS:"pi pi-search-minus",SEARCH_PLUS:"pi pi-search-plus",SEND:"pi pi-send",SERVER:"pi pi-server",SHARE_ALT:"pi pi-share-alt",SHIELD:"pi pi-shield",SHOPPING_BAG:"pi pi-shopping-bag",SHOPPING_CART:"pi pi-shopping-cart",SIGN_IN:"pi pi-sign-in",SIGN_OUT:"pi pi-sign-out",SITEMAP:"pi pi-sitemap",SLACK:"pi pi-slack",SLIDERS_H:"pi pi-sliders-h",SLIDERS_V:"pi pi-sliders-v",SORT:"pi pi-sort",SORT_ALPHA_DOWN:"pi pi-sort-alpha-down",SORT_ALPHA_ALT_DOWN:"pi pi-sort-alpha-alt-down",SORT_ALPHA_UP:"pi pi-sort-alpha-up",SORT_ALPHA_ALT_UP:"pi pi-sort-alpha-alt-up",SORT_ALT:"pi pi-sort-alt",SORT_ALT_SLASH:"pi pi-sort-slash",SORT_AMOUNT_DOWN:"pi pi-sort-amount-down",SORT_AMOUNT_DOWN_ALT:"pi pi-sort-amount-down-alt",SORT_AMOUNT_UP:"pi pi-sort-amount-up",SORT_AMOUNT_UP_ALT:"pi pi-sort-amount-up-alt",SORT_DOWN:"pi pi-sort-down",SORT_NUMERIC_DOWN:"pi pi-sort-numeric-down",SORT_NUMERIC_ALT_DOWN:"pi pi-sort-numeric-alt-down",SORT_NUMERIC_UP:"pi pi-sort-numeric-up",SORT_NUMERIC_ALT_UP:"pi pi-sort-numeric-alt-up",SORT_UP:"pi pi-sort-up",SPINNER:"pi pi-spinner",STAR:"pi pi-star",STAR_FILL:"pi pi-star-fill",STEP_BACKWARD:"pi pi-step-backward",STEP_BACKWARD_ALT:"pi pi-step-backward-alt",STEP_FORWARD:"pi pi-step-forward",STEP_FORWARD_ALT:"pi pi-step-forward-alt",STOP:"pi pi-stop",STOP_CIRCLE:"pi pi-stop-circle",SUN:"pi pi-sun",SYNC:"pi pi-sync",TABLE:"pi pi-table",TABLET:"pi pi-tablet",TAG:"pi pi-tag",TAGS:"pi pi-tags",TELEGRAM:"pi pi-telegram",TH_LARGE:"pi pi-th-large",THUMBS_DOWN:"pi pi-thumbs-down",THUMBS_UP:"pi pi-thumbs-up",TICKET:"pi pi-ticket",TIMES:"pi pi-times",TIMES_CIRCLE:"pi pi-times-circle",TRASH:"pi pi-trash",TWITTER:"pi pi-twitter",UNDO:"pi pi-undo",UNLOCK:"pi pi-unlock",UPLOAD:"pi pi-upload",USER:"pi pi-user",USER_EDIT:"pi pi-user-edit",USER_MINUS:"pi pi-user-minus",USER_PLUS:"pi pi-user-plus",USERS:"pi pi-users",VIDEO:"pi pi-video",VIMEO:"pi pi-vimeo",VOLUME_DOWN:"pi pi-volume-down",VOLUME_OFF:"pi pi-volume-off",VOLUME_UP:"pi pi-volume-up",WALLET:"pi pi-wallet",WHATSAPP:"pi pi-whatsapp",WIFI:"pi pi-wifi",WINDOW_MAXIMIZE:"pi pi-window-maximize",WINDOW_MINIMIZE:"pi pi-window-minimize",YOUTUBE:"pi pi-youtube"}),A=Object.freeze({SUCCESS:"success",INFO:"info",WARN:"warn",ERROR:"error"}),O=Object.freeze({AND:"and",OR:"or"});function T(i,e){var t="undefined"!=typeof Symbol&&i[Symbol.iterator]||i["@@iterator"];if(!t){if(Array.isArray(i)||(t=L(i))||e&&i&&"number"==typeof i.length){t&&(i=t);var p=0,r=function(){};return{s:r,n:function(){return p>=i.length?{done:!0}:{done:!1,value:i[p++]}},e:function(i){throw i},f:r}}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 n,o=!0,a=!1;return{s:function(){t=t.call(i)},n:function(){var i=t.next();return o=i.done,i},e:function(i){a=!0,n=i},f:function(){try{o||null==t.return||t.return()}finally{if(a)throw n}}}}function L(i,e){if(i){if("string"==typeof i)return R(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);return"Object"===t&&i.constructor&&(t=i.constructor.name),"Map"===t||"Set"===t?Array.from(i):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?R(i,e):void 0}}function R(i,e){(null==e||e>i.length)&&(e=i.length);for(var t=0,p=new Array(e);t<e;t++)p[t]=i[t];return p}var _={filter:function(i,t,p,r,n){var o=[];if(i){var a,l=T(i);try{for(l.s();!(a=l.n()).done;){var c,s=a.value,u=T(t);try{for(u.s();!(c=u.n()).done;){var E=e.ObjectUtils.resolveFieldData(s,c.value);if(this.filters[r](E,p,n)){o.push(s);break}}}catch(i){u.e(i)}finally{u.f()}}}catch(i){l.e(i)}finally{l.f()}}return o},filters:{startsWith:function(i,t,p){if(null==t||""===t.trim())return!0;if(null==i)return!1;var r=e.ObjectUtils.removeAccents(t.toString()).toLocaleLowerCase(p);return e.ObjectUtils.removeAccents(i.toString()).toLocaleLowerCase(p).slice(0,r.length)===r},contains:function(i,t,p){if(null==t||"string"==typeof t&&""===t.trim())return!0;if(null==i)return!1;var r=e.ObjectUtils.removeAccents(t.toString()).toLocaleLowerCase(p);return-1!==e.ObjectUtils.removeAccents(i.toString()).toLocaleLowerCase(p).indexOf(r)},notContains:function(i,t,p){if(null==t||"string"==typeof t&&""===t.trim())return!0;if(null==i)return!1;var r=e.ObjectUtils.removeAccents(t.toString()).toLocaleLowerCase(p);return-1===e.ObjectUtils.removeAccents(i.toString()).toLocaleLowerCase(p).indexOf(r)},endsWith:function(i,t,p){if(null==t||""===t.trim())return!0;if(null==i)return!1;var r=e.ObjectUtils.removeAccents(t.toString()).toLocaleLowerCase(p),n=e.ObjectUtils.removeAccents(i.toString()).toLocaleLowerCase(p);return-1!==n.indexOf(r,n.length-r.length)},equals:function(i,t,p){return null==t||"string"==typeof t&&""===t.trim()||null!=i&&(i.getTime&&t.getTime?i.getTime()===t.getTime():e.ObjectUtils.removeAccents(i.toString()).toLocaleLowerCase(p)===e.ObjectUtils.removeAccents(t.toString()).toLocaleLowerCase(p))},notEquals:function(i,t,p){return null!=t&&("string"!=typeof t||""!==t.trim())&&(null==i||(i.getTime&&t.getTime?i.getTime()!==t.getTime():e.ObjectUtils.removeAccents(i.toString()).toLocaleLowerCase(p)!==e.ObjectUtils.removeAccents(t.toString()).toLocaleLowerCase(p)))},in:function(i,t){if(null==t||0===t.length)return!0;for(var p=0;p<t.length;p++)if(e.ObjectUtils.equals(i,t[p]))return!0;return!1},between:function(i,e){return null==e||null==e[0]||null==e[1]||null!=i&&(i.getTime?e[0].getTime()<=i.getTime()&&i.getTime()<=e[1].getTime():e[0]<=i&&i<=e[1])},lt:function(i,e){return null==e||null!=i&&(i.getTime&&e.getTime?i.getTime()<e.getTime():i<e)},lte:function(i,e){return null==e||null!=i&&(i.getTime&&e.getTime?i.getTime()<=e.getTime():i<=e)},gt:function(i,e){return null==e||null!=i&&(i.getTime&&e.getTime?i.getTime()>e.getTime():i>e)},gte:function(i,e){return null==e||null!=i&&(i.getTime&&e.getTime?i.getTime()>=e.getTime():i>=e)},dateIs:function(i,e){return null==e||null!=i&&i.toDateString()===e.toDateString()},dateIsNot:function(i,e){return null==e||null!=i&&i.toDateString()!==e.toDateString()},dateBefore:function(i,e){return null==e||null!=i&&i.getTime()<e.getTime()},dateAfter:function(i,e){return null==e||null!=i&&i.getTime()>e.getTime()}},register:function(i,e){this.filters[i]=e}};return i.FilterMatchMode=o,i.FilterOperator=O,i.FilterService=_,i.MessageSeverity=A,i.PrimeIcons=E,i.addLocale=function(i,e){s[i]=c(c({},s.en),e)},i.ariaLabel=function(i){var e=a.locale;try{return u(e).aria[i]}catch(t){throw new Error("The ".concat(i," option is not found in the current locale('").concat(e,"')."))}},i.default=a,i.locale=function(i){return i&&(a.locale=i),{locale:a.locale,options:s[a.locale]}},i.localeOption=function(i,e){var t=e||a.locale;try{return u(t)[i]}catch(e){throw new Error("The ".concat(i," option is not found in the current locale('").concat(t,"')."))}},i.localeOptions=u,i.updateLocaleOption=function(i,e,t){u(t)[i]=e},i.updateLocaleOptions=function(i,e){var t=e||a.locale;s[t]=c(c({},s[t]),i)},Object.defineProperty(i,"__esModule",{value:!0}),i}({},primereact.utils);
|
|
4
4
|
|
|
5
|
-
this.primereact=this.primereact||{},this.primereact.hooks=function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var u=n(t),c=function(e){var t=u.useRef(void 0);return u.useEffect((function(){t.current=e})),t.current},o=function(e){return u.useEffect((function(){return e}),[])},i=function(e){var t=e.target,n=void 0===t?"document":t,i=e.type,l=e.listener,
|
|
5
|
+
this.primereact=this.primereact||{},this.primereact.hooks=function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var u=n(t),c=function(e){var t=u.useRef(void 0);return u.useEffect((function(){t.current=e})),t.current},o=function(e){return u.useEffect((function(){return e}),[])},i=function(e){var t=e.target,n=void 0===t?"document":t,i=e.type,l=e.listener,a=e.options,f=e.when,s=void 0===f||f,v=u.useRef(null),d=u.useRef(null),g=c(a),m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r.ObjectUtils.isNotEmpty(e.target)&&(y(),(e.when||s)&&(v.current=r.DomHandler.getTargetElement(e.target))),!d.current&&v.current&&(d.current=function(e){return l&&l(e)},v.current.addEventListener(i,d.current,a))},y=function(){d.current&&(v.current.removeEventListener(i,d.current,a),d.current=null)};return u.useEffect((function(){s?v.current=r.DomHandler.getTargetElement(n):(y(),v.current=null)}),[n,s]),u.useEffect((function(){!d.current||d.current===l&&g===a||(y(),s&&m())}),[l,a]),o((function(){y()})),[m,y]};function l(e){if(Array.isArray(e))return e}function a(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,u,c=[],o=!0,i=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(c.push(n.value),!t||c.length!==t);o=!0);}catch(e){i=!0,u=e}finally{try{o||null==r.return||r.return()}finally{if(i)throw u}}return c}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function s(e,t){if(e){if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(e,t):void 0}}function v(){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 l(e)||a(e,t)||s(e,t)||v()}var g=function(e){var t=e.target,n=e.listener,i=e.options,l=e.when,a=void 0===l||l,f=u.useRef(null),s=u.useRef(null),v=u.useRef([]),d=c(i),g=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(r.ObjectUtils.isNotEmpty(e.target)&&(m(),(e.when||a)&&(f.current=r.DomHandler.getTargetElement(e.target))),!s.current&&f.current){var t=v.current=r.DomHandler.getScrollableParents(f.current);s.current=function(e){return n&&n(e)},t.forEach((function(e){return e.addEventListener("scroll",s.current,i)}))}},m=function(){s.current&&(v.current.forEach((function(e){return e.removeEventListener("scroll",s.current,i)})),s.current=null)};return u.useEffect((function(){a?f.current=r.DomHandler.getTargetElement(t):(m(),f.current=null)}),[t,a]),u.useEffect((function(){!s.current||s.current===n&&d===i||(m(),a&&g())}),[n,i]),o((function(){m()})),[g,m]},m=function(e){return i({target:"window",type:"resize",listener:e.listener})},y=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"local",n="undefined"!=typeof window,c=i({target:"window",type:"storage",listener:function(e){var n="local"===r?window.localStorage:window.sessionStorage;e.storageArea===n&&e.key===t&&g(e.newValue||void 0)}}),o=d(c,2),l=o[0],a=o[1],f=u.useState((function(){if(!n)return e;try{var u="local"===r?window.localStorage.getItem(t):window.sessionStorage.getItem(t);return u?JSON.parse(u):e}catch(t){return e}})),s=d(f,2),v=s[0],g=s[1],m=function(e){try{var u=e instanceof Function?e(v):e;if(g(u),n){var c=JSON.stringify(u);"local"===r?window.localStorage.setItem(t,c):window.sessionStorage.setItem(t,c)}}catch(e){throw new Error("PrimeReact useStorage: Failed to serialize the value at key: ".concat(t))}};return u.useEffect((function(){return l(),function(){return a()}}),[]),[v,m]};return e.useEventListener=i,e.useInterval=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=u.useRef(null),c=u.useRef(null),i=u.useCallback((function(){return clearInterval(n.current)}),[n.current]);return u.useEffect((function(){c.current=e})),u.useEffect((function(){if(r)return n.current=setInterval((function(){c.current()}),t),i;i()}),[t,r]),o((function(){i()})),[i]},e.useLocalStorage=function(e,t){return y(e,t,"local")},e.useMountEffect=function(e){return u.useEffect(e,[])},e.useOverlayListener=function(e){var t=e.target,n=e.overlay,c=e.listener,l=e.when,a=void 0===l||l,f=u.useRef(null),s=u.useRef(null),v=d(i({type:"click",listener:function(e){c&&c(e,{type:"outside",valid:3!==e.which&&O(e)})}}),2),y=v[0],E=v[1],h=d(m({listener:function(e){c&&c(e,{type:"resize",valid:!r.DomHandler.isTouchDevice()})}}),2),w=h[0],p=h[1],S=d(g({target:f,listener:function(e){c&&c(e,{type:"scroll",valid:!0})}}),2),b=S[0],R=S[1],O=function(e){return f.current&&!(f.current.isSameNode(e.target)||f.current.contains(e.target)||s.current&&s.current.contains(e.target))},j=function(){E(),p(),R()};return u.useEffect((function(){a?(f.current=r.DomHandler.getTargetElement(t),s.current=r.DomHandler.getTargetElement(n)):(j(),f.current=s.current=null)}),[t,n,a]),u.useEffect((function(){j()}),[a]),o((function(){j()})),[function(){y(),w(),b()},j]},e.useOverlayScrollListener=g,e.usePrevious=c,e.useResizeListener=m,e.useSessionStorage=function(e,t){return y(e,t,"session")},e.useStorage=y,e.useTimeout=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=u.useRef(null),c=u.useRef(null),i=u.useCallback((function(){return clearTimeout(n.current)}),[n.current]);return u.useEffect((function(){c.current=e})),u.useEffect((function(){if(r)return n.current=setTimeout((function(){c.current()}),t),i;i()}),[t,r]),o((function(){i()})),[i]},e.useUnmountEffect=o,e.useUpdateEffect=function(e,t){var r=u.useRef(!1);return u.useEffect((function(){if(r.current)return e&&e();r.current=!0}),t)},Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.utils);
|
|
6
6
|
|
|
7
7
|
this.primereact=this.primereact||{},this.primereact.ripple=function(e,t,r,n,u){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var i=o(t),a=c(r),l=i.memo(i.forwardRef((function(){var e=i.useRef(null),t=i.useRef(null),r=function(){return e.current&&e.current.parentElement},c=function(){t.current&&t.current.addEventListener("mousedown",o)},o=function(r){if(e.current&&"none"!==getComputedStyle(e.current,null).display){if(u.DomHandler.removeClass(e.current,"p-ink-active"),!u.DomHandler.getHeight(e.current)&&!u.DomHandler.getWidth(e.current)){var n=Math.max(u.DomHandler.getOuterWidth(t.current),u.DomHandler.getOuterHeight(t.current));e.current.style.height=n+"px",e.current.style.width=n+"px"}var c=u.DomHandler.getOffset(t.current),o=r.pageX-c.left+document.body.scrollTop-u.DomHandler.getWidth(e.current)/2,i=r.pageY-c.top+document.body.scrollLeft-u.DomHandler.getHeight(e.current)/2;e.current.style.top=i+"px",e.current.style.left=o+"px",u.DomHandler.addClass(e.current,"p-ink-active")}};return n.useMountEffect((function(){e.current&&(t.current=r(),c())})),n.useUpdateEffect((function(){e.current&&!t.current&&(t.current=r(),c())})),n.useUnmountEffect((function(){e.current&&(t.current=null,t.current&&t.current.removeEventListener("mousedown",o))})),a.default.ripple?i.createElement("span",{role:"presentation",ref:e,className:"p-ink",onAnimationEnd:function(e){u.DomHandler.removeClass(e.currentTarget,"p-ink-active")}}):null})));return l.displayName="Ripple",l.defaultProps={__TYPE:"Ripple"},e.Ripple=l,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.api,primereact.hooks,primereact.utils);
|
|
8
8
|
|
|
@@ -32,9 +32,9 @@ this.primereact=this.primereact||{},this.primereact.messages=function(e,t,r,n,a,
|
|
|
32
32
|
|
|
33
33
|
this.primereact=this.primereact||{},this.primereact.progressbar=function(e,r,a){"use strict";function t(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var t=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(r,a,t.get?t:{enumerable:!0,get:function(){return e[a]}})}})),r.default=e,Object.freeze(r)}var l=t(r);function s(){return s=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var a=arguments[r];for(var t in a)Object.prototype.hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e},s.apply(this,arguments)}var n=l.memo(l.forwardRef((function(e,r){var t,i,o,u=function(){if(e.showValue&&null!=e.value){var r=e.displayValueTemplate?e.displayValueTemplate(e.value):e.value+e.unit;return l.createElement("div",{className:"p-progressbar-label"},r)}return null};if("determinate"===e.mode)return t=a.ObjectUtils.findDiffKeys(e,n.defaultProps),i=a.classNames("p-progressbar p-component p-progressbar-determinate",e.className),o=u(),l.createElement("div",s({role:"progressbar",id:e.id,className:i,style:e.style,"aria-valuemin":"0","aria-valuenow":e.value,"aria-valuemax":"100"},t),l.createElement("div",{className:"p-progressbar-value p-progressbar-value-animate",style:{width:e.value+"%",display:"block",backgroundColor:e.color}}),o);if("indeterminate"===e.mode)return function(){var r=a.ObjectUtils.findDiffKeys(e,n.defaultProps),t=a.classNames("p-progressbar p-component p-progressbar-indeterminate",e.className);return l.createElement("div",s({role:"progressbar",id:e.id,className:t,style:e.style},r),l.createElement("div",{className:"p-progressbar-indeterminate-container"},l.createElement("div",{className:"p-progressbar-value p-progressbar-value-animate",style:{backgroundColor:e.color}})))}();throw new Error(e.mode+" is not a valid mode for the ProgressBar. Valid values are 'determinate' and 'indeterminate'")})));return n.displayName="ProgressBar",n.defaultProps={__TYPE:"ProgressBar",id:null,value:null,showValue:!0,unit:"%",style:null,className:null,mode:"determinate",displayValueTemplate:null,color:null},e.ProgressBar=n,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.utils);
|
|
34
34
|
|
|
35
|
-
this.primereact=this.primereact||{},this.primereact.dropdown=function(e,t,n,r,l,o,i,a,u,c,p){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function f(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var d=f(t),m=s(n);function b(){return b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},b.apply(this,arguments)}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e){if(Array.isArray(e))return e}function y(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,l,o=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){a=!0,l=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw l}}return o}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function O(e,t){if(e){if("string"==typeof e)return h(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)?h(e,t):void 0}}function w(){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 E(e,t){return g(e)||y(e,t)||O(e,t)||w()}var j=d.memo((function(e){var t=i.classNames("p-dropdown-item",{"p-highlight":e.selected,"p-disabled":e.disabled,"p-dropdown-item-empty":!e.label||0===e.label.length},e.option&&e.option.className),n=e.template?i.ObjectUtils.getJSXElement(e.template,e.option):e.label;return d.createElement("li",{className:t,onClick:function(t){e.onClick&&e.onClick({originalEvent:t,option:e.option})},"aria-label":e.label,key:e.label,role:"option","aria-selected":e.selected},n,d.createElement(p.Ripple,null))}));function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function D(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}j.displayName="DropdownItem";var F=d.memo(d.forwardRef((function(e,t){var r,l,o,p=d.useRef(null),s=d.useRef(null),f=!(e.visibleOptions&&e.visibleOptions.length)&&e.hasFilter,m=function(){e.onEnter((function(){if(p.current){var t=e.getSelectedOptionIndex();-1!==t&&setTimeout((function(){return p.current.scrollToIndex(t)}),0)}}))},v=function(){e.onEntered((function(){e.filter&&e.filterInputAutoFocus&&s.current.focus()}))},g=function(t){p.current&&p.current.scrollToIndex(0),e.onFilterInputChange&&e.onFilterInputChange(t)},y=function(t,r){var l=i.ObjectUtils.getJSXElement(t,e)||n.localeOption(r?"emptyFilterMessage":"emptyMessage");return d.createElement("li",{className:"p-dropdown-empty-message"},l)},h=function(t,n){if(e.optionGroupLabel){var r=e.optionGroupTemplate?i.ObjectUtils.getJSXElement(e.optionGroupTemplate,t,n):e.getOptionGroupLabel(t),l=e.getOptionGroupChildren(t).map((function(t,n){var r=e.getOptionLabel(t),l=n+"_"+e.getOptionRenderKey(t),o=e.isOptionDisabled(t);return d.createElement(j,{key:l,label:r,option:t,template:e.itemTemplate,selected:e.isSelected(t),disabled:o,onClick:e.onOptionClick})})),o=n+"_"+e.getOptionGroupRenderKey(t);return d.createElement(d.Fragment,{key:o},d.createElement("li",{className:"p-dropdown-item-group"},r),l)}var a=e.getOptionLabel(t),u=n+"_"+e.getOptionRenderKey(t),c=e.isOptionDisabled(t);return d.createElement(j,{key:u,label:a,option:t,template:e.itemTemplate,selected:e.isSelected(t),disabled:c,onClick:e.onOptionClick})},O=function(){if(e.filter){var t=e.showFilterClear&&e.filterValue?d.createElement("i",{className:"p-dropdown-filter-clear-icon pi pi-times",onClick:function(){return e.onFilterClearIconClick((function(){return s.current.focus()}))}}):null,n=i.classNames("p-dropdown-filter-container",{"p-dropdown-clearable-filter":!!t});return d.createElement("div",{className:"p-dropdown-header"},d.createElement("div",{className:n},d.createElement("input",{ref:s,type:"text",autoComplete:"off",className:"p-dropdown-filter p-inputtext p-component",placeholder:e.filterPlaceholder,onKeyDown:e.onFilterInputKeyDown,onChange:g,value:e.filterValue}),t,d.createElement("i",{className:"p-dropdown-filter-icon pi pi-search"})))}return null},w=function(){if(e.virtualScrollerOptions){var t=D(D({},e.virtualScrollerOptions),{style:D(D({},e.virtualScrollerOptions.style),{height:e.scrollHeight}),className:i.classNames("p-dropdown-items-wrapper",e.virtualScrollerOptions.className),items:e.visibleOptions,onLazyLoad:function(t){return e.virtualScrollerOptions.onLazyLoad(D(D({},t),{filter:e.filterValue}))},itemTemplate:function(e,t){return e&&h(e,t.index)},contentTemplate:function(e){var t=i.classNames("p-dropdown-items",e.className),n=f?y():e.children;return d.createElement("ul",{ref:e.contentRef,className:t,role:"listbox"},n)}});return d.createElement(c.VirtualScroller,b({ref:p},t))}var n=i.ObjectUtils.isNotEmpty(e.visibleOptions)?e.visibleOptions.map(h):e.hasFilter?y(e.emptyFilterMessage,!0):y(e.emptyMessage);return d.createElement("div",{className:"p-dropdown-items-wrapper",style:{maxHeight:e.scrollHeight||"auto"}},d.createElement("ul",{className:"p-dropdown-items",role:"listbox"},n))},E=(r=i.classNames("p-dropdown-panel p-component",e.panelClassName),l=O(),o=w(),d.createElement(a.CSSTransition,{nodeRef:t,classNames:"p-connected-overlay",in:e.in,timeout:{enter:120,exit:100},options:e.transitionOptions,unmountOnExit:!0,onEnter:m,onEntering:e.onEntering,onEntered:v,onExit:e.onExit,onExited:e.onExited},d.createElement("div",{ref:t,className:r,style:e.panelStyle,onClick:e.onClick},l,o)));return d.createElement(u.Portal,{element:E,appendTo:e.appendTo})})));function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function S(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=L(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,l=function(){};return{s:l,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:l}}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 o,i=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw o}}}}function L(e,t){if(e){if("string"==typeof e)return I(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)?I(e,t):void 0}}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}F.displayName="DropdownPanel";var k=d.memo(d.forwardRef((function(e,t){var a=E(d.useState(""),2),u=a[0],c=a[1],p=E(d.useState(!1),2),s=p[0],f=p[1],v=E(d.useState(!1),2),g=v[0],y=v[1],h=d.useRef(null),O=d.useRef(null),w=d.useRef(e.inputRef),j=d.useRef(null),C=d.useRef(null),D=d.useRef(null),N=d.useRef(null),L=e.virtualScrollerOptions&&e.virtualScrollerOptions.lazy,I=i.ObjectUtils.isNotEmpty(u),P=e.appendTo||m.default.appendTo,U=E(r.useOverlayListener({target:h,overlay:O,listener:function(e,t){t.valid&&("outside"===t.type?!M(e)&&ae():ae())},when:g}),2),T=U[0],R=U[1],M=function(e){return i.DomHandler.hasClass(e.target,"p-dropdown-clear-icon")||i.DomHandler.hasClass(e.target,"p-dropdown-filter-clear-icon")},G=function(t){e.showOnFocus&&!g&&ie(),f(!0),e.onFocus&&e.onFocus(t)},K=function(t){f(!1),e.onBlur&&e.onBlur(t)},A=function(e){switch(e.which){case 40:V(e);break;case 38:H(e);break;case 32:case 13:g?ae():ie(),e.preventDefault();break;case 27:case 9:ae();break;default:J(e)}},H=function(e){if(he){var t=q(re());t&&ne({originalEvent:e,option:t})}e.preventDefault()},V=function(e){if(he)if(!g&&e.altKey)ie();else{var t=B(re());t&&ne({originalEvent:e,option:t})}e.preventDefault()},B=function t(n){if(e.optionGroupLabel){var r=-1===n?0:n.group,l=-1===n?-1:n.option,o=_(de(he[r]),l);return o||(r+1!==he.length?t({group:r+1,option:-1}):null)}return _(he,n)},_=function e(t,n){var r=n+1;if(r===t.length)return null;var l=t[r];return fe(l)?e(r):l},q=function t(n){if(-1===n)return null;if(e.optionGroupLabel){var r=n.group,l=n.option,o=z(de(he[r]),l);return o||(r>0?t({group:r-1,option:de(he[r-1]).length}):null)}return z(he,n)},z=function(e,t){var n=t-1;if(n<0)return null;var r=e[n];return fe(r)?q(n):r},J=function(t){C.current&&clearTimeout(C.current);var n=t.key;if(D.current=N.current===n?n:D.current?D.current+n:n,N.current=n,D.current){var r=re(),l=e.optionGroupLabel?$(r):X(r+1);l&&ne({originalEvent:t,option:l})}C.current=setTimeout((function(){D.current=null}),250)},X=function(e){return D.current?Z(e,he.length)||Z(0,e):null},Z=function(e,t){for(var n=e;n<t;n++){var r=he[n];if(W(r))return r}return null},$=function(e){for(var t=-1===e?{group:0,option:-1}:e,n=t.group;n<he.length;n++)for(var r=de(he[n]),l=t.group===n?t.option+1:0;l<r.length;l++)if(W(r[l]))return r[l];for(var o=0;o<=t.group;o++)for(var i=de(he[o]),a=0;a<(t.group===o?t.option:i.length);a++)if(W(i[a]))return i[a];return null},W=function(t){return pe(t).toLocaleLowerCase(e.filterLocale).startsWith(D.current.toLocaleLowerCase(e.filterLocale))},Y=function(t){e.onChange&&e.onChange({originalEvent:t.originalEvent,value:t.target.value,stopPropagation:function(){},preventDefault:function(){},target:{name:e.name,id:e.id,value:t.target.value}})},Q=function(t){f(!0),ae(),e.onFocus&&e.onFocus(t)},ee=function(t){c(""),e.onFilter&&e.onFilter({filter:""}),t&&t()},te=function(t){e.onChange&&e.onChange({originalEvent:t,value:void 0,stopPropagation:function(){},preventDefault:function(){},target:{name:e.name,id:e.id,value:void 0}}),ce()},ne=function(t){if(Oe!==t.option){ce(t.option);var n=se(t.option);e.onChange&&e.onChange({originalEvent:t.originalEvent,value:n,stopPropagation:function(){},preventDefault:function(){},target:{name:e.name,id:e.id,value:n}})}},re=function(){if(null!=e.value&&he){if(!e.optionGroupLabel)return oe(e.value,he);for(var t=0;t<he.length;t++){var n=oe(e.value,de(he[t]));if(-1!==n)return{group:t,option:n}}}return-1},le=function(){return e.optionValue?null:e.dataKey},oe=function(e,t){var n=le();return t.findIndex((function(t){return i.ObjectUtils.equals(e,se(t),n)}))},ie=function(){y(!0)},ae=function(){y(!1)},ue=function(){i.DomHandler.alignOverlay(O.current,w.current.parentElement,e.appendTo||m.default.appendTo)},ce=function(t){w.current&&(w.current.value=t?pe(t):e.value||"")},pe=function(t){return e.optionLabel?i.ObjectUtils.resolveFieldData(t,e.optionLabel):t&&void 0!==t.label?t.label:t},se=function(t){return e.optionValue?i.ObjectUtils.resolveFieldData(t,e.optionValue):t&&void 0!==t.value?t.value:t},fe=function(t){return e.optionDisabled?i.ObjectUtils.isFunction(e.optionDisabled)?e.optionDisabled(t):i.ObjectUtils.resolveFieldData(t,e.optionDisabled):!(!t||void 0===t.disabled)&&t.disabled},de=function(t){return i.ObjectUtils.resolveFieldData(t,e.optionGroupChildren)},me=function(){if(e.editable&&w.current){var t=Oe?pe(Oe):null;w.current.value=t||e.value||""}};d.useEffect((function(){i.ObjectUtils.combinedRefs(w,e.inputRef)}),[w,e.inputRef]),r.useMountEffect((function(){e.autoFocus&&j.current&&j.current.focus()})),r.useUpdateEffect((function(){var t;g&&e.value&&(t=i.DomHandler.findSingle(O.current,"li.p-highlight"))&&t.scrollIntoView&&t.scrollIntoView({block:"nearest",inline:"start"})}),[g,e.value]),r.useUpdateEffect((function(){g&&e.filter&&ue()}),[g,e.filter]),r.useUpdateEffect((function(){!u||e.options&&0!==e.options.length||c(""),me(),w.current&&(w.current.selectedIndex=1)})),r.useUnmountEffect((function(){i.ZIndexUtils.clear(O.current)}));var be,ve,ge,ye,he=function(){if(I&&!L){var t=u.trim().toLocaleLowerCase(e.filterLocale),r=e.filterBy?e.filterBy.split(","):[e.optionLabel||"label"];if(e.optionGroupLabel){var l,o=[],i=S(e.options);try{for(i.s();!(l=i.n()).done;){var a=l.value,c=n.FilterService.filter(de(a),r,t,e.filterMatchMode,e.filterLocale);c&&c.length&&o.push(x(x({},a),{items:c}))}}catch(e){i.e(e)}finally{i.f()}return o}return n.FilterService.filter(e.options,r,t,e.filterMatchMode,e.filterLocale)}return e.options}(),Oe=-1!==(be=re())?e.optionGroupLabel?de(he[be.group])[be.option]:he[be]:null,we=i.ObjectUtils.isNotEmpty(e.tooltip),Ee=i.ObjectUtils.findDiffKeys(e,k.defaultProps),je=i.classNames("p-dropdown p-component p-inputwrapper",{"p-disabled":e.disabled,"p-focus":s,"p-dropdown-clearable":e.showClear&&!e.disabled,"p-inputwrapper-filled":i.ObjectUtils.isNotEmpty(e.value),"p-inputwrapper-focus":s||g},e.className),Ce=(ve=d.createElement("option",{value:""},e.placeholder),ge=Oe?d.createElement("option",{value:Oe.value},pe(Oe)):null,d.createElement("div",{className:"p-hidden-accessible p-dropdown-hidden-select"},d.createElement("select",{ref:w,required:e.required,name:e.name,tabIndex:-1,"aria-hidden":"true"},ve,ge))),De=d.createElement("div",{className:"p-hidden-accessible"},d.createElement("input",{ref:j,id:e.inputId,type:"text",readOnly:!0,"aria-haspopup":"listbox",onFocus:G,onBlur:K,onKeyDown:A,disabled:e.disabled,tabIndex:e.tabIndex,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledBy})),Fe=function(){var t=i.ObjectUtils.isNotEmpty(Oe)?pe(Oe):null;if(e.editable)return d.createElement("input",{ref:w,type:"text",defaultValue:t||e.value||"",className:"p-dropdown-label p-inputtext",disabled:e.disabled,placeholder:e.placeholder,maxLength:e.maxLength,onInput:Y,onFocus:Q,onBlur:K,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledBy,"aria-haspopup":"listbox"});var n=i.classNames("p-dropdown-label p-inputtext",{"p-placeholder":null===t&&e.placeholder,"p-dropdown-label-empty":null===t&&!e.placeholder}),r=e.valueTemplate?i.ObjectUtils.getJSXElement(e.valueTemplate,Oe,e):t||e.placeholder||"empty";return d.createElement("span",{ref:w,className:n},r)}(),Ne=(ye=i.classNames("p-dropdown-trigger-icon p-clickable",e.dropdownIcon),d.createElement("div",{className:"p-dropdown-trigger",role:"button","aria-haspopup":"listbox","aria-expanded":g},d.createElement("span",{className:ye}))),xe=null!=e.value&&e.showClear&&!e.disabled?d.createElement("i",{className:"p-dropdown-clear-icon pi pi-times",onClick:te}):null;return d.createElement(d.Fragment,null,d.createElement("div",b({ref:h,id:e.id,className:je,style:e.style},Ee,{onClick:function(t){e.disabled||i.DomHandler.hasClass(t.target,"p-dropdown-clear-icon")||"INPUT"===t.target.tagName||O.current&&O.current&&O.current.contains(t.target)||(j.current.focus(),g?ae():ie())},onMouseDown:e.onMouseDown,onContextMenu:e.onContextMenu}),De,Ce,Fe,xe,Ne,d.createElement(F,b({ref:O,visibleOptions:he},e,{appendTo:P,onClick:function(e){l.OverlayService.emit("overlay-click",{originalEvent:e,target:h.current})},onOptionClick:function(e){e.option.disabled||(ne(e),j.current.focus()),ae()},filterValue:u,hasFilter:I,onFilterClearIconClick:function(e){ee(e)},onFilterInputKeyDown:function(e){switch(e.which){case 40:V(e);break;case 38:H(e);break;case 13:case 27:ae(),e.preventDefault()}},onFilterInputChange:function(t){var n=t.target.value;c(n),e.onFilter&&e.onFilter({originalEvent:t,filter:n})},getOptionLabel:pe,getOptionRenderKey:function(t){return e.dataKey?i.ObjectUtils.resolveFieldData(t,e.dataKey):pe(t)},isOptionDisabled:fe,getOptionGroupChildren:de,getOptionGroupLabel:function(t){return i.ObjectUtils.resolveFieldData(t,e.optionGroupLabel)},getOptionGroupRenderKey:function(t){return i.ObjectUtils.resolveFieldData(t,e.optionGroupLabel)},isSelected:function(t){return i.ObjectUtils.equals(e.value,se(t),le())},getSelectedOptionIndex:re,in:g,onEnter:function(e){i.ZIndexUtils.set("overlay",O.current,m.default.autoZIndex,m.default.zIndex.overlay),ue(),e&&e()},onEntered:function(t){t&&t(),T(),e.onShow&&e.onShow()},onExit:function(){R()},onExited:function(){e.filter&&e.resetFilterOnHide&&ee(),i.ZIndexUtils.clear(O.current),e.onHide&&e.onHide()}}))),we&&d.createElement(o.Tooltip,b({target:h,content:e.tooltip},e.tooltipOptions)))})));return k.displayName="Dropdown",k.defaultProps={__TYPE:"Dropdown",id:null,inputRef:null,name:null,value:null,options:null,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,optionGroupTemplate:null,valueTemplate:null,itemTemplate:null,style:null,className:null,virtualScrollerOptions:null,scrollHeight:"200px",filter:!1,filterBy:null,filterMatchMode:"contains",filterPlaceholder:null,filterLocale:void 0,emptyMessage:null,emptyFilterMessage:null,editable:!1,placeholder:null,required:!1,disabled:!1,appendTo:null,tabIndex:null,autoFocus:!1,filterInputAutoFocus:!0,resetFilterOnHide:!1,showFilterClear:!1,panelClassName:null,panelStyle:null,dataKey:null,inputId:null,showClear:!1,maxLength:null,tooltip:null,tooltipOptions:null,ariaLabel:null,ariaLabelledBy:null,transitionOptions:null,dropdownIcon:"pi pi-chevron-down",showOnFocus:!1,onChange:null,onFocus:null,onBlur:null,onMouseDown:null,onContextMenu:null,onShow:null,onHide:null,onFilter:null},e.Dropdown=k,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.api,primereact.hooks,primereact.overlayservice,primereact.tooltip,primereact.utils,primereact.csstransition,primereact.portal,primereact.virtualscroller,primereact.ripple);
|
|
35
|
+
this.primereact=this.primereact||{},this.primereact.dropdown=function(e,t,n,r,l,o,i,a,u,c,p){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function f(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var d=f(t),m=s(n);function b(){return b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},b.apply(this,arguments)}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e){if(Array.isArray(e))return e}function y(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,l,o=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){a=!0,l=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw l}}return o}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function O(e,t){if(e){if("string"==typeof e)return h(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)?h(e,t):void 0}}function w(){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 E(e,t){return g(e)||y(e,t)||O(e,t)||w()}var j=d.memo((function(e){var t=i.classNames("p-dropdown-item",{"p-highlight":e.selected,"p-disabled":e.disabled,"p-dropdown-item-empty":!e.label||0===e.label.length},e.option&&e.option.className),n=e.template?i.ObjectUtils.getJSXElement(e.template,e.option):e.label;return d.createElement("li",{className:t,onClick:function(t){e.onClick&&e.onClick({originalEvent:t,option:e.option})},"aria-label":e.label,key:e.label,role:"option","aria-selected":e.selected},n,d.createElement(p.Ripple,null))}));function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function D(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}j.displayName="DropdownItem";var F=d.memo(d.forwardRef((function(e,t){var r,l,o,p=d.useRef(null),s=d.useRef(null),f=!(e.visibleOptions&&e.visibleOptions.length)&&e.hasFilter,m=function(){e.onEnter((function(){if(p.current){var t=e.getSelectedOptionIndex();-1!==t&&setTimeout((function(){return p.current.scrollToIndex(t)}),0)}}))},v=function(){e.onEntered((function(){e.filter&&e.filterInputAutoFocus&&s.current.focus()}))},g=function(t){p.current&&p.current.scrollToIndex(0),e.onFilterInputChange&&e.onFilterInputChange(t)},y=function(t,r){var l=i.ObjectUtils.getJSXElement(t,e)||n.localeOption(r?"emptyFilterMessage":"emptyMessage");return d.createElement("li",{className:"p-dropdown-empty-message"},l)},h=function(t,n){if(e.optionGroupLabel){var r=e.optionGroupTemplate?i.ObjectUtils.getJSXElement(e.optionGroupTemplate,t,n):e.getOptionGroupLabel(t),l=e.getOptionGroupChildren(t).map((function(t,n){var r=e.getOptionLabel(t),l=n+"_"+e.getOptionRenderKey(t),o=e.isOptionDisabled(t);return d.createElement(j,{key:l,label:r,option:t,template:e.itemTemplate,selected:e.isSelected(t),disabled:o,onClick:e.onOptionClick})})),o=n+"_"+e.getOptionGroupRenderKey(t);return d.createElement(d.Fragment,{key:o},d.createElement("li",{className:"p-dropdown-item-group"},r),l)}var a=e.getOptionLabel(t),u=n+"_"+e.getOptionRenderKey(t),c=e.isOptionDisabled(t);return d.createElement(j,{key:u,label:a,option:t,template:e.itemTemplate,selected:e.isSelected(t),disabled:c,onClick:e.onOptionClick})},O=function(){if(e.filter){var t=e.showFilterClear&&e.filterValue?d.createElement("i",{className:"p-dropdown-filter-clear-icon pi pi-times",onClick:function(){return e.onFilterClearIconClick((function(){return s.current.focus()}))}}):null,n=i.classNames("p-dropdown-filter-container",{"p-dropdown-clearable-filter":!!t});return d.createElement("div",{className:"p-dropdown-header"},d.createElement("div",{className:n},d.createElement("input",{ref:s,type:"text",autoComplete:"off",className:"p-dropdown-filter p-inputtext p-component",placeholder:e.filterPlaceholder,onKeyDown:e.onFilterInputKeyDown,onChange:g,value:e.filterValue}),t,d.createElement("i",{className:"p-dropdown-filter-icon pi pi-search"})))}return null},w=function(){if(e.virtualScrollerOptions){var t=D(D({},e.virtualScrollerOptions),{style:D(D({},e.virtualScrollerOptions.style),{height:e.scrollHeight}),className:i.classNames("p-dropdown-items-wrapper",e.virtualScrollerOptions.className),items:e.visibleOptions,onLazyLoad:function(t){return e.virtualScrollerOptions.onLazyLoad(D(D({},t),{filter:e.filterValue}))},itemTemplate:function(e,t){return e&&h(e,t.index)},contentTemplate:function(e){var t=i.classNames("p-dropdown-items",e.className),n=f?y():e.children;return d.createElement("ul",{ref:e.contentRef,className:t,role:"listbox"},n)}});return d.createElement(c.VirtualScroller,b({ref:p},t))}var n=i.ObjectUtils.isNotEmpty(e.visibleOptions)?e.visibleOptions.map(h):e.hasFilter?y(e.emptyFilterMessage,!0):y(e.emptyMessage);return d.createElement("div",{className:"p-dropdown-items-wrapper",style:{maxHeight:e.scrollHeight||"auto"}},d.createElement("ul",{className:"p-dropdown-items",role:"listbox"},n))},E=(r=i.classNames("p-dropdown-panel p-component",e.panelClassName),l=O(),o=w(),d.createElement(a.CSSTransition,{nodeRef:t,classNames:"p-connected-overlay",in:e.in,timeout:{enter:120,exit:100},options:e.transitionOptions,unmountOnExit:!0,onEnter:m,onEntering:e.onEntering,onEntered:v,onExit:e.onExit,onExited:e.onExited},d.createElement("div",{ref:t,className:r,style:e.panelStyle,onClick:e.onClick},l,o)));return d.createElement(u.Portal,{element:E,appendTo:e.appendTo})})));function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function S(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=L(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,l=function(){};return{s:l,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:l}}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 o,i=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw o}}}}function L(e,t){if(e){if("string"==typeof e)return I(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)?I(e,t):void 0}}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}F.displayName="DropdownPanel";var k=d.memo(d.forwardRef((function(e,t){var a=E(d.useState(""),2),u=a[0],c=a[1],p=E(d.useState(!1),2),s=p[0],f=p[1],v=E(d.useState(!1),2),g=v[0],y=v[1],h=d.useRef(null),O=d.useRef(null),w=d.useRef(e.inputRef),j=d.useRef(null),C=d.useRef(null),D=d.useRef(null),N=d.useRef(null),L=e.virtualScrollerOptions&&e.virtualScrollerOptions.lazy,I=i.ObjectUtils.isNotEmpty(u),P=e.appendTo||m.default.appendTo,U=E(r.useOverlayListener({target:h,overlay:O,listener:function(e,t){t.valid&&("outside"===t.type?!M(e)&&ae():ae())},when:g}),2),T=U[0],R=U[1],M=function(e){return i.DomHandler.hasClass(e.target,"p-dropdown-clear-icon")||i.DomHandler.hasClass(e.target,"p-dropdown-filter-clear-icon")},G=function(t){e.showOnFocus&&!g&&ie(),f(!0),e.onFocus&&e.onFocus(t)},K=function(t){f(!1),e.onBlur&&e.onBlur(t)},A=function(e){switch(e.which){case 40:V(e);break;case 38:H(e);break;case 32:case 13:g?ae():ie(),e.preventDefault();break;case 27:case 9:ae();break;default:J(e)}},H=function(e){if(he){var t=q(re());t&&ne({originalEvent:e,option:t})}e.preventDefault()},V=function(e){if(he)if(!g&&e.altKey)ie();else{var t=B(re());t&&ne({originalEvent:e,option:t})}e.preventDefault()},B=function t(n){if(e.optionGroupLabel){var r=-1===n?0:n.group,l=-1===n?-1:n.option,o=_(de(he[r]),l);return o||(r+1!==he.length?t({group:r+1,option:-1}):null)}return _(he,n)},_=function e(t,n){var r=n+1;if(r===t.length)return null;var l=t[r];return fe(l)?e(r):l},q=function t(n){if(-1===n)return null;if(e.optionGroupLabel){var r=n.group,l=n.option,o=z(de(he[r]),l);return o||(r>0?t({group:r-1,option:de(he[r-1]).length}):null)}return z(he,n)},z=function(e,t){var n=t-1;if(n<0)return null;var r=e[n];return fe(r)?q(n):r},J=function(t){C.current&&clearTimeout(C.current);var n=t.key;if(D.current=N.current===n?n:D.current?D.current+n:n,N.current=n,D.current){var r=re(),l=e.optionGroupLabel?$(r):X(r+1);l&&ne({originalEvent:t,option:l})}C.current=setTimeout((function(){D.current=null}),250)},X=function(e){return D.current?Z(e,he.length)||Z(0,e):null},Z=function(e,t){for(var n=e;n<t;n++){var r=he[n];if(W(r))return r}return null},$=function(e){for(var t=-1===e?{group:0,option:-1}:e,n=t.group;n<he.length;n++)for(var r=de(he[n]),l=t.group===n?t.option+1:0;l<r.length;l++)if(W(r[l]))return r[l];for(var o=0;o<=t.group;o++)for(var i=de(he[o]),a=0;a<(t.group===o?t.option:i.length);a++)if(W(i[a]))return i[a];return null},W=function(t){return pe(t).toLocaleLowerCase(e.filterLocale).startsWith(D.current.toLocaleLowerCase(e.filterLocale))},Y=function(t){e.onChange&&e.onChange({originalEvent:t.originalEvent,value:t.target.value,stopPropagation:function(){},preventDefault:function(){},target:{name:e.name,id:e.id,value:t.target.value}})},Q=function(t){f(!0),ae(),e.onFocus&&e.onFocus(t)},ee=function(t){c(""),e.onFilter&&e.onFilter({filter:""}),t&&t()},te=function(t){e.onChange&&e.onChange({originalEvent:t,value:void 0,stopPropagation:function(){},preventDefault:function(){},target:{name:e.name,id:e.id,value:void 0}}),ce()},ne=function(t){if(Oe!==t.option){ce(t.option);var n=se(t.option);e.onChange&&e.onChange({originalEvent:t.originalEvent,value:n,stopPropagation:function(){},preventDefault:function(){},target:{name:e.name,id:e.id,value:n}})}},re=function(){if(null!=e.value&&he){if(!e.optionGroupLabel)return oe(e.value,he);for(var t=0;t<he.length;t++){var n=oe(e.value,de(he[t]));if(-1!==n)return{group:t,option:n}}}return-1},le=function(){return e.optionValue?null:e.dataKey},oe=function(e,t){var n=le();return t.findIndex((function(t){return i.ObjectUtils.equals(e,se(t),n)}))},ie=function(){y(!0)},ae=function(){y(!1)},ue=function(){i.DomHandler.alignOverlay(O.current,w.current.parentElement,e.appendTo||m.default.appendTo)},ce=function(t){w.current&&(w.current.value=t?pe(t):e.value||"")},pe=function(t){return e.optionLabel?i.ObjectUtils.resolveFieldData(t,e.optionLabel):t&&void 0!==t.label?t.label:t},se=function(t){return e.optionValue?i.ObjectUtils.resolveFieldData(t,e.optionValue):t&&void 0!==t.value?t.value:t},fe=function(t){return e.optionDisabled?i.ObjectUtils.isFunction(e.optionDisabled)?e.optionDisabled(t):i.ObjectUtils.resolveFieldData(t,e.optionDisabled):!(!t||void 0===t.disabled)&&t.disabled},de=function(t){return i.ObjectUtils.resolveFieldData(t,e.optionGroupChildren)},me=function(){if(e.editable&&w.current){var t=Oe?pe(Oe):null;w.current.value=t||e.value||""}};d.useEffect((function(){i.ObjectUtils.combinedRefs(w,e.inputRef)}),[w,e.inputRef]),r.useMountEffect((function(){e.autoFocus&&j.current&&j.current.focus()})),r.useUpdateEffect((function(){var t;g&&e.value&&(t=i.DomHandler.findSingle(O.current,"li.p-highlight"))&&t.scrollIntoView&&t.scrollIntoView({block:"nearest",inline:"nearest"})}),[g,e.value]),r.useUpdateEffect((function(){g&&e.filter&&ue()}),[g,e.filter]),r.useUpdateEffect((function(){!u||e.options&&0!==e.options.length||c(""),me(),w.current&&(w.current.selectedIndex=1)})),r.useUnmountEffect((function(){i.ZIndexUtils.clear(O.current)}));var be,ve,ge,ye,he=function(){if(I&&!L){var t=u.trim().toLocaleLowerCase(e.filterLocale),r=e.filterBy?e.filterBy.split(","):[e.optionLabel||"label"];if(e.optionGroupLabel){var l,o=[],i=S(e.options);try{for(i.s();!(l=i.n()).done;){var a=l.value,c=n.FilterService.filter(de(a),r,t,e.filterMatchMode,e.filterLocale);c&&c.length&&o.push(x(x({},a),{items:c}))}}catch(e){i.e(e)}finally{i.f()}return o}return n.FilterService.filter(e.options,r,t,e.filterMatchMode,e.filterLocale)}return e.options}(),Oe=-1!==(be=re())?e.optionGroupLabel?de(he[be.group])[be.option]:he[be]:null,we=i.ObjectUtils.isNotEmpty(e.tooltip),Ee=i.ObjectUtils.findDiffKeys(e,k.defaultProps),je=i.classNames("p-dropdown p-component p-inputwrapper",{"p-disabled":e.disabled,"p-focus":s,"p-dropdown-clearable":e.showClear&&!e.disabled,"p-inputwrapper-filled":i.ObjectUtils.isNotEmpty(e.value),"p-inputwrapper-focus":s||g},e.className),Ce=(ve=d.createElement("option",{value:""},e.placeholder),ge=Oe?d.createElement("option",{value:Oe.value},pe(Oe)):null,d.createElement("div",{className:"p-hidden-accessible p-dropdown-hidden-select"},d.createElement("select",{ref:w,required:e.required,name:e.name,tabIndex:-1,"aria-hidden":"true"},ve,ge))),De=d.createElement("div",{className:"p-hidden-accessible"},d.createElement("input",{ref:j,id:e.inputId,type:"text",readOnly:!0,"aria-haspopup":"listbox",onFocus:G,onBlur:K,onKeyDown:A,disabled:e.disabled,tabIndex:e.tabIndex,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledBy})),Fe=function(){var t=i.ObjectUtils.isNotEmpty(Oe)?pe(Oe):null;if(e.editable)return d.createElement("input",{ref:w,type:"text",defaultValue:t||e.value||"",className:"p-dropdown-label p-inputtext",disabled:e.disabled,placeholder:e.placeholder,maxLength:e.maxLength,onInput:Y,onFocus:Q,onBlur:K,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledBy,"aria-haspopup":"listbox"});var n=i.classNames("p-dropdown-label p-inputtext",{"p-placeholder":null===t&&e.placeholder,"p-dropdown-label-empty":null===t&&!e.placeholder}),r=e.valueTemplate?i.ObjectUtils.getJSXElement(e.valueTemplate,Oe,e):t||e.placeholder||"empty";return d.createElement("span",{ref:w,className:n},r)}(),Ne=(ye=i.classNames("p-dropdown-trigger-icon p-clickable",e.dropdownIcon),d.createElement("div",{className:"p-dropdown-trigger",role:"button","aria-haspopup":"listbox","aria-expanded":g},d.createElement("span",{className:ye}))),xe=null!=e.value&&e.showClear&&!e.disabled?d.createElement("i",{className:"p-dropdown-clear-icon pi pi-times",onClick:te}):null;return d.createElement(d.Fragment,null,d.createElement("div",b({ref:h,id:e.id,className:je,style:e.style},Ee,{onClick:function(t){e.disabled||i.DomHandler.hasClass(t.target,"p-dropdown-clear-icon")||"INPUT"===t.target.tagName||O.current&&O.current&&O.current.contains(t.target)||(j.current.focus(),g?ae():ie())},onMouseDown:e.onMouseDown,onContextMenu:e.onContextMenu}),De,Ce,Fe,xe,Ne,d.createElement(F,b({ref:O,visibleOptions:he},e,{appendTo:P,onClick:function(e){l.OverlayService.emit("overlay-click",{originalEvent:e,target:h.current})},onOptionClick:function(e){e.option.disabled||(ne(e),j.current.focus()),ae()},filterValue:u,hasFilter:I,onFilterClearIconClick:function(e){ee(e)},onFilterInputKeyDown:function(e){switch(e.which){case 40:V(e);break;case 38:H(e);break;case 13:case 27:ae(),e.preventDefault()}},onFilterInputChange:function(t){var n=t.target.value;c(n),e.onFilter&&e.onFilter({originalEvent:t,filter:n})},getOptionLabel:pe,getOptionRenderKey:function(t){return e.dataKey?i.ObjectUtils.resolveFieldData(t,e.dataKey):pe(t)},isOptionDisabled:fe,getOptionGroupChildren:de,getOptionGroupLabel:function(t){return i.ObjectUtils.resolveFieldData(t,e.optionGroupLabel)},getOptionGroupRenderKey:function(t){return i.ObjectUtils.resolveFieldData(t,e.optionGroupLabel)},isSelected:function(t){return i.ObjectUtils.equals(e.value,se(t),le())},getSelectedOptionIndex:re,in:g,onEnter:function(e){i.ZIndexUtils.set("overlay",O.current,m.default.autoZIndex,m.default.zIndex.overlay),ue(),e&&e()},onEntered:function(t){t&&t(),T(),e.onShow&&e.onShow()},onExit:function(){R()},onExited:function(){e.filter&&e.resetFilterOnHide&&ee(),i.ZIndexUtils.clear(O.current),e.onHide&&e.onHide()}}))),we&&d.createElement(o.Tooltip,b({target:h,content:e.tooltip},e.tooltipOptions)))})));return k.displayName="Dropdown",k.defaultProps={__TYPE:"Dropdown",id:null,inputRef:null,name:null,value:null,options:null,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,optionGroupTemplate:null,valueTemplate:null,itemTemplate:null,style:null,className:null,virtualScrollerOptions:null,scrollHeight:"200px",filter:!1,filterBy:null,filterMatchMode:"contains",filterPlaceholder:null,filterLocale:void 0,emptyMessage:null,emptyFilterMessage:null,editable:!1,placeholder:null,required:!1,disabled:!1,appendTo:null,tabIndex:null,autoFocus:!1,filterInputAutoFocus:!0,resetFilterOnHide:!1,showFilterClear:!1,panelClassName:null,panelStyle:null,dataKey:null,inputId:null,showClear:!1,maxLength:null,tooltip:null,tooltipOptions:null,ariaLabel:null,ariaLabelledBy:null,transitionOptions:null,dropdownIcon:"pi pi-chevron-down",showOnFocus:!1,onChange:null,onFocus:null,onBlur:null,onMouseDown:null,onContextMenu:null,onShow:null,onHide:null,onFilter:null},e.Dropdown=k,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.api,primereact.hooks,primereact.overlayservice,primereact.tooltip,primereact.utils,primereact.csstransition,primereact.portal,primereact.virtualscroller,primereact.ripple);
|
|
36
36
|
|
|
37
|
-
this.primereact=this.primereact||{},this.primereact.dialog=function(e,t,n,r,a,o,l,i){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function u(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var s=u(t),d=c(n);function m(){return m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m.apply(this,arguments)}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function f(e){if(Array.isArray(e))return p(e)}function g(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function b(e,t){if(e){if("string"==typeof e)return p(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)?p(e,t):void 0}}function y(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(e){if(Array.isArray(e))return e}function v(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],l=!0,i=!1;try{for(n=n.call(e);!(l=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);l=!0);}catch(e){i=!0,a=e}finally{try{l||null==n.return||n.return()}finally{if(i)throw a}}return o}}function E(){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 h(e)||v(e,t)||b(e,t)||E()}var w=s.forwardRef((function(e,t){var n=D(s.useState(e.id),2),c=n[0],u=n[1],p=D(s.useState(!1),2),h=p[0],v=p[1],E=D(s.useState(!1),2),x=E[0],S=E[1],k=D(s.useState(e.maximized),2),z=k[0],C=k[1],H=s.useRef(null),O=s.useRef(null),R=s.useRef(null),I=s.useRef(null),N=s.useRef(null),P=s.useRef(null),j=s.useRef(!1),M=s.useRef(!1),U=s.useRef(null),X=s.useRef(null),A=s.useRef(null),Y=s.useRef(""),_=e.onMaximize?e.maximized:z,T=D(a.useEventListener({type:"keydown",listener:function(e){return oe(e)}}),2),L=T[0],Z=T[1],B=D(a.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return de(e)}}),2),V=B[0],J=B[1],W=D(a.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return me(e)}}),2),q=W[0],K=W[1],$=D(a.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return ie(e)}}),2),F=$[0],G=$[1],Q=D(a.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return ce(e)}}),2),ee=Q[0],te=Q[1],ne=function(t){e.onHide(),t.preventDefault()},re=function(t){e.dismissableMask&&e.modal&&O.current===t.target&&ne(t),e.onMaskClick&&e.onMaskClick(t)},ae=function(t){e.onMaximize?e.onMaximize({originalEvent:t,maximized:!_}):C((function(e){return!e})),t.preventDefault()},oe=function(t){var n=t.currentTarget;if(n&&n.primeDialogParams){var r=n.primeDialogParams,a=r.length,o=r[a-1]?r[a-1].id:void 0;if(o===c&&e.closeOnEscape){var l=document.getElementById(o);if(27===t.which)ne(t),t.stopImmediatePropagation(),r.splice(a-1,1);else if(9===t.which){t.preventDefault();var u=i.DomHandler.getFocusableElements(l);if(u&&u.length>0)if(document.activeElement){var s=u.indexOf(document.activeElement);t.shiftKey?-1===s||0===s?u[u.length-1].focus():u[s-1].focus():-1===s||s===u.length-1?u[0].focus():u[s+1].focus()}else u[0].focus()}}}},le=function(t){i.DomHandler.hasClass(t.target,"p-dialog-header-icon")||i.DomHandler.hasClass(t.target.parentElement,"p-dialog-header-icon")||e.draggable&&(j.current=!0,U.current=t.pageX,X.current=t.pageY,H.current.style.margin="0",i.DomHandler.addClass(document.body,"p-unselectable-text"),e.onDragStart&&e.onDragStart(t))},ie=function(t){if(j.current){var n=i.DomHandler.getOuterWidth(H.current),r=i.DomHandler.getOuterHeight(H.current),a=t.pageX-U.current,o=t.pageY-X.current,l=H.current.getBoundingClientRect(),c=l.left+a,u=l.top+o,s=i.DomHandler.getViewport();H.current.style.position="fixed",e.keepInViewport?(c>=e.minX&&c+n<s.width&&(U.current=t.pageX,H.current.style.left=c+"px"),u>=e.minY&&u+r<s.height&&(X.current=t.pageY,H.current.style.top=u+"px")):(U.current=t.pageX,H.current.style.left=c+"px",X.current=t.pageY,H.current.style.top=u+"px"),e.onDrag&&e.onDrag(t)}},ce=function(t){j.current&&(j.current=!1,i.DomHandler.removeClass(document.body,"p-unselectable-text"),e.onDragEnd&&e.onDragEnd(t))},ue=function(t){e.resizable&&(M.current=!0,U.current=t.pageX,X.current=t.pageY,i.DomHandler.addClass(document.body,"p-unselectable-text"),e.onResizeStart&&e.onResizeStart(t))},se=function(e,t,n){!n&&(n=i.DomHandler.getViewport());var r=parseInt(e);return/^(\d+|(\.\d+))(\.\d+)?%$/.test(e)?r*(n[t]/100):r},de=function(t){if(M.current){var n=t.pageX-U.current,r=t.pageY-X.current,a=i.DomHandler.getOuterWidth(H.current),o=i.DomHandler.getOuterHeight(H.current),l=H.current.getBoundingClientRect(),c=i.DomHandler.getViewport(),u=!parseInt(H.current.style.top)||!parseInt(H.current.style.left),s=se(H.current.style.minWidth,"width",c),d=se(H.current.style.minHeight,"height",c),m=a+n,p=o+r;u&&(m+=n,p+=r),(!s||m>s)&&l.left+m<c.width&&(H.current.style.width=m+"px"),(!d||p>d)&&l.top+p<c.height&&(H.current.style.height=p+"px"),U.current=t.pageX,X.current=t.pageY,e.onResize&&e.onResize(t)}},me=function(t){M.current&&(M.current=!1,i.DomHandler.removeClass(document.body,"p-unselectable-text"),e.onResizeEnd&&e.onResizeEnd(t))},pe=function(){H.current.style.position="",H.current.style.left="",H.current.style.top="",H.current.style.margin=""},fe=function(){H.current.setAttribute(Y.current,"")},ge=function(){var t;e.onShow&&e.onShow(),e.focusOnShow&&!((t=document.activeElement)&&H.current&&H.current.contains(t))&&e.closable&&e.showHeader&&P.current.focus(),he()},be=function(){e.modal&&i.DomHandler.addClass(O.current,"p-component-overlay-leave")},ye=function(){j.current=!1,i.ZIndexUtils.clear(O.current),v(!1),ve()},he=function(){Ee(),(e.blockScroll||e.maximizable&&_)&&i.DomHandler.addClass(document.body,"p-overflow-hidden")},ve=function(){(De(),e.modal)?document.primeDialogParams&&document.primeDialogParams.some((function(e){return e.hasBlockScroll}))||i.DomHandler.removeClass(document.body,"p-overflow-hidden"):(e.blockScroll||e.maximizable&&_)&&i.DomHandler.removeClass(document.body,"p-overflow-hidden")},Ee=function(){if(e.draggable&&(F(),ee()),e.resizable&&(V(),q()),e.closable){L();var t={id:c,hasBlockScroll:e.blockScroll};document.primeDialogParams=document.primeDialogParams?[].concat(f(n=document.primeDialogParams)||g(n)||b(n)||y(),[t]):[t]}var n},De=function(){G(),te(),J(),K(),Z(),document.primeDialogParams=document.primeDialogParams&&document.primeDialogParams.filter((function(e){return e.id!==c}))},we=function(){if(!A.current){A.current=i.DomHandler.createInlineStyle(d.default.nonce);var t="";for(var n in e.breakpoints)t+="\n @media screen and (max-width: ".concat(n,") {\n .p-dialog[").concat(Y.current,"] {\n width: ").concat(e.breakpoints[n]," !important;\n }\n }\n ");A.current.innerHTML=t}};a.useMountEffect((function(){c||u(i.UniqueComponentId()),Y.current=i.UniqueComponentId(),e.visible&&v(!0),e.breakpoints&&we()})),a.useUpdateEffect((function(){e.visible&&!h&&v(!0),e.visible!==x&&h&&S(e.visible)})),a.useUpdateEffect((function(){h&&(i.ZIndexUtils.set("modal",O.current,d.default.autoZIndex,e.baseZIndex||d.default.zIndex.modal),S(!0))}),[h]),a.useUpdateEffect((function(){e.blockScroll||i.DomHandler[_?"addClass":"removeClass"](document.body,"p-overflow-hidden")}),[e.maximized,z]),a.useUnmountEffect((function(){ve(),i.DomHandler.removeInlineStyle(A.current),i.ZIndexUtils.clear(O.current)})),s.useImperativeHandle(t,(function(){return{resetPosition:pe}}));var xe,Se,ke,ze,Ce,He,Oe,Re,Ie,Ne=function(){if(e.showHeader){var t=e.closable?s.createElement("button",{ref:P,type:"button",className:"p-dialog-header-icon p-dialog-header-close p-link","aria-label":e.ariaCloseIconLabel,onClick:ne},s.createElement("span",{className:"p-dialog-header-close-icon pi pi-times"}),s.createElement(l.Ripple,null)):null,n=(o=i.classNames("p-dialog-header-maximize-icon pi",{"pi-window-maximize":!_,"pi-window-minimize":_}),e.maximizable?s.createElement("button",{type:"button",className:"p-dialog-header-icon p-dialog-header-maximize p-link",onClick:ae},s.createElement("span",{className:o}),s.createElement(l.Ripple,null)):null),r=i.ObjectUtils.getJSXElement(e.icons,e),a=i.ObjectUtils.getJSXElement(e.header,e);return s.createElement("div",{ref:I,className:"p-dialog-header",onMouseDown:le},s.createElement("div",{id:c+"_header",className:"p-dialog-title"},a),s.createElement("div",{className:"p-dialog-header-icons"},r,n,t))}var o;return null},Pe=function(){var t=i.classNames("p-dialog-content",e.contentClassName);return s.createElement("div",{id:c+"_content",ref:R,className:t,style:e.contentStyle},e.children)},je=function(){var t=i.ObjectUtils.getJSXElement(e.footer,e);return t&&s.createElement("div",{ref:N,className:"p-dialog-footer"},t)};return h&&(Se=i.ObjectUtils.findDiffKeys(e,w.defaultProps),ke=i.classNames("p-dialog p-component",e.className,{"p-dialog-rtl":e.rtl,"p-dialog-maximized":_}),ze=i.classNames("p-dialog-mask",(xe=["center","left","right","top","top-left","top-right","bottom","bottom-left","bottom-right"].find((function(t){return t===e.position||t.replace("-","")===e.position})))?"p-dialog-".concat(xe):"",{"p-component-overlay p-component-overlay-enter":e.modal,"p-dialog-visible":h,"p-dialog-draggable":e.draggable,"p-dialog-resizable":e.resizable},e.maskClassName),Ce=Ne(),He=Pe(),Oe=je(),Re=e.resizable?s.createElement("div",{className:"p-resizable-handle",style:{zIndex:90},onMouseDown:ue}):null,Ie=s.createElement("div",{ref:O,style:e.maskStyle,className:ze,onClick:re},s.createElement(r.CSSTransition,{nodeRef:H,classNames:"p-dialog",timeout:{enter:"center"===e.position?150:300,exit:"center"===e.position?150:300},in:x,options:e.transitionOptions,unmountOnExit:!0,onEnter:fe,onEntered:ge,onExiting:be,onExited:ye},s.createElement("div",m({ref:H,id:c,className:ke,style:e.style,onClick:e.onClick,role:"dialog"},Se,{"aria-labelledby":c+"_header","aria-describedby":c+"_content","aria-modal":e.modal}),Ce,He,Oe,Re))),s.createElement(o.Portal,{element:Ie,appendTo:e.appendTo,visible:!0}))}));return w.displayName="Dialog",w.defaultProps={__TYPE:"Dialog",id:null,header:null,footer:null,visible:!1,position:"center",draggable:!0,resizable:!0,modal:!0,onHide:null,onShow:null,contentStyle:null,contentClassName:null,closeOnEscape:!0,dismissableMask:!1,rtl:!1,closable:!0,style:null,className:null,maskStyle:null,maskClassName:null,showHeader:!0,appendTo:null,baseZIndex:0,maximizable:!1,blockScroll:!1,icons:null,ariaCloseIconLabel:"Close",focusOnShow:!0,minX:0,minY:0,keepInViewport:!0,maximized:!1,breakpoints:null,transitionOptions:null,onMaximize:null,onDragStart:null,onDrag:null,onDragEnd:null,onResizeStart:null,onResize:null,onResizeEnd:null,onClick:null,onMaskClick:null},e.Dialog=w,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.api,primereact.csstransition,primereact.hooks,primereact.portal,primereact.ripple,primereact.utils);
|
|
37
|
+
this.primereact=this.primereact||{},this.primereact.dialog=function(e,t,n,r,a,o,l,i){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function u(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var s=u(t),d=c(n);function m(){return m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m.apply(this,arguments)}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function f(e){if(Array.isArray(e))return p(e)}function g(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function b(e,t){if(e){if("string"==typeof e)return p(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)?p(e,t):void 0}}function y(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(e){if(Array.isArray(e))return e}function v(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],l=!0,i=!1;try{for(n=n.call(e);!(l=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);l=!0);}catch(e){i=!0,a=e}finally{try{l||null==n.return||n.return()}finally{if(i)throw a}}return o}}function E(){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 h(e)||v(e,t)||b(e,t)||E()}var w=s.forwardRef((function(e,t){var n=D(s.useState(e.id),2),c=n[0],u=n[1],p=D(s.useState(!1),2),h=p[0],v=p[1],E=D(s.useState(!1),2),x=E[0],S=E[1],k=D(s.useState(e.maximized),2),z=k[0],C=k[1],H=s.useRef(null),O=s.useRef(null),R=s.useRef(null),I=s.useRef(null),N=s.useRef(null),P=s.useRef(null),j=s.useRef(!1),M=s.useRef(!1),U=s.useRef(null),X=s.useRef(null),A=s.useRef(null),Y=s.useRef(""),_=e.onMaximize?e.maximized:z,T=D(a.useEventListener({type:"keydown",listener:function(e){return oe(e)}}),2),L=T[0],Z=T[1],B=D(a.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return de(e)}}),2),V=B[0],J=B[1],W=D(a.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return me(e)}}),2),q=W[0],K=W[1],$=D(a.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return ie(e)}}),2),F=$[0],G=$[1],Q=D(a.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return ce(e)}}),2),ee=Q[0],te=Q[1],ne=function(t){e.onHide(),t.preventDefault()},re=function(t){e.dismissableMask&&e.modal&&O.current===t.target&&ne(t),e.onMaskClick&&e.onMaskClick(t)},ae=function(t){e.onMaximize?e.onMaximize({originalEvent:t,maximized:!_}):C((function(e){return!e})),t.preventDefault()},oe=function(t){var n=t.currentTarget;if(n&&n.primeDialogParams){var r=n.primeDialogParams,a=r.length,o=r[a-1]?r[a-1].id:void 0;if(o===c&&e.closeOnEscape){var l=document.getElementById(o);if(27===t.which)ne(t),t.stopImmediatePropagation(),r.splice(a-1,1);else if(9===t.which){t.preventDefault();var u=i.DomHandler.getFocusableElements(l);if(u&&u.length>0)if(document.activeElement){var s=u.indexOf(document.activeElement);t.shiftKey?-1===s||0===s?u[u.length-1].focus():u[s-1].focus():-1===s||s===u.length-1?u[0].focus():u[s+1].focus()}else u[0].focus()}}}},le=function(t){i.DomHandler.hasClass(t.target,"p-dialog-header-icon")||i.DomHandler.hasClass(t.target.parentElement,"p-dialog-header-icon")||e.draggable&&(j.current=!0,U.current=t.pageX,X.current=t.pageY,H.current.style.margin="0",i.DomHandler.addClass(document.body,"p-unselectable-text"),e.onDragStart&&e.onDragStart(t))},ie=function(t){if(j.current){var n=i.DomHandler.getOuterWidth(H.current),r=i.DomHandler.getOuterHeight(H.current),a=t.pageX-U.current,o=t.pageY-X.current,l=H.current.getBoundingClientRect(),c=l.left+a,u=l.top+o,s=i.DomHandler.getViewport();H.current.style.position="fixed",e.keepInViewport?(c>=e.minX&&c+n<s.width&&(U.current=t.pageX,H.current.style.left=c+"px"),u>=e.minY&&u+r<s.height&&(X.current=t.pageY,H.current.style.top=u+"px")):(U.current=t.pageX,H.current.style.left=c+"px",X.current=t.pageY,H.current.style.top=u+"px"),e.onDrag&&e.onDrag(t)}},ce=function(t){j.current&&(j.current=!1,i.DomHandler.removeClass(document.body,"p-unselectable-text"),e.onDragEnd&&e.onDragEnd(t))},ue=function(t){e.resizable&&(M.current=!0,U.current=t.pageX,X.current=t.pageY,i.DomHandler.addClass(document.body,"p-unselectable-text"),e.onResizeStart&&e.onResizeStart(t))},se=function(e,t,n){!n&&(n=i.DomHandler.getViewport());var r=parseInt(e);return/^(\d+|(\.\d+))(\.\d+)?%$/.test(e)?r*(n[t]/100):r},de=function(t){if(M.current){var n=t.pageX-U.current,r=t.pageY-X.current,a=i.DomHandler.getOuterWidth(H.current),o=i.DomHandler.getOuterHeight(H.current),l=H.current.getBoundingClientRect(),c=i.DomHandler.getViewport(),u=!parseInt(H.current.style.top)||!parseInt(H.current.style.left),s=se(H.current.style.minWidth,"width",c),d=se(H.current.style.minHeight,"height",c),m=a+n,p=o+r;u&&(m+=n,p+=r),(!s||m>s)&&l.left+m<c.width&&(H.current.style.width=m+"px"),(!d||p>d)&&l.top+p<c.height&&(H.current.style.height=p+"px"),U.current=t.pageX,X.current=t.pageY,e.onResize&&e.onResize(t)}},me=function(t){M.current&&(M.current=!1,i.DomHandler.removeClass(document.body,"p-unselectable-text"),e.onResizeEnd&&e.onResizeEnd(t))},pe=function(){H.current.style.position="",H.current.style.left="",H.current.style.top="",H.current.style.margin=""},fe=function(){H.current.setAttribute(Y.current,"")},ge=function(){var t;e.onShow&&e.onShow(),e.focusOnShow&&!((t=document.activeElement)&&H.current&&H.current.contains(t))&&e.closable&&e.showHeader&&P.current.focus(),he()},be=function(){e.modal&&i.DomHandler.addClass(O.current,"p-component-overlay-leave")},ye=function(){j.current=!1,i.ZIndexUtils.clear(O.current),v(!1),ve()},he=function(){Ee(),(e.blockScroll||e.maximizable&&_)&&i.DomHandler.addClass(document.body,"p-overflow-hidden")},ve=function(){(De(),e.modal)?document.primeDialogParams&&document.primeDialogParams.some((function(e){return e.hasBlockScroll}))||i.DomHandler.removeClass(document.body,"p-overflow-hidden"):(e.blockScroll||e.maximizable&&_)&&i.DomHandler.removeClass(document.body,"p-overflow-hidden")},Ee=function(){if(e.draggable&&(F(),ee()),e.resizable&&(V(),q()),e.closable){L();var t={id:c,hasBlockScroll:e.blockScroll};document.primeDialogParams=document.primeDialogParams?[].concat(f(n=document.primeDialogParams)||g(n)||b(n)||y(),[t]):[t]}var n},De=function(){G(),te(),J(),K(),Z(),document.primeDialogParams=document.primeDialogParams&&document.primeDialogParams.filter((function(e){return e.id!==c}))},we=function(){if(!A.current){A.current=i.DomHandler.createInlineStyle(d.default.nonce);var t="";for(var n in e.breakpoints)t+="\n @media screen and (max-width: ".concat(n,") {\n .p-dialog[").concat(Y.current,"] {\n width: ").concat(e.breakpoints[n]," !important;\n }\n }\n ");A.current.innerHTML=t}};a.useMountEffect((function(){c||u(i.UniqueComponentId()),Y.current=i.UniqueComponentId(),e.visible&&v(!0),e.breakpoints&&we()})),a.useUpdateEffect((function(){e.visible&&!h&&v(!0),e.visible!==x&&h&&S(e.visible)})),a.useUpdateEffect((function(){h&&(i.ZIndexUtils.set("modal",O.current,d.default.autoZIndex,e.baseZIndex||d.default.zIndex.modal),S(!0))}),[h]),a.useUpdateEffect((function(){e.blockScroll||i.DomHandler[_?"addClass":"removeClass"](document.body,"p-overflow-hidden")}),[e.maximized,z]),a.useUnmountEffect((function(){ve(),i.DomHandler.removeInlineStyle(A.current),i.ZIndexUtils.clear(O.current)})),s.useImperativeHandle(t,(function(){return{resetPosition:pe}}));var xe,Se,ke,ze,Ce,He,Oe,Re,Ie,Ne=function(){if(e.showHeader){var t=e.closable?s.createElement("button",{ref:P,type:"button",className:"p-dialog-header-icon p-dialog-header-close p-link","aria-label":e.ariaCloseIconLabel,onClick:ne},s.createElement("span",{className:"p-dialog-header-close-icon pi pi-times"}),s.createElement(l.Ripple,null)):null,n=(d=i.classNames("p-dialog-header-maximize-icon pi",{"pi-window-maximize":!_,"pi-window-minimize":_}),e.maximizable?s.createElement("button",{type:"button",className:"p-dialog-header-icon p-dialog-header-maximize p-link",onClick:ae},s.createElement("span",{className:d}),s.createElement(l.Ripple,null)):null),r=i.ObjectUtils.getJSXElement(e.icons,e),a=i.ObjectUtils.getJSXElement(e.header,e),o=c+"_header",u=i.classNames("p-dialog-header",e.headerClassName);return s.createElement("div",{ref:I,style:e.headerStyle,className:u,onMouseDown:le},s.createElement("div",{id:o,className:"p-dialog-title"},a),s.createElement("div",{className:"p-dialog-header-icons"},r,n,t))}var d;return null},Pe=function(){var t=i.classNames("p-dialog-content",e.contentClassName);return s.createElement("div",{id:c+"_content",ref:R,className:t,style:e.contentStyle},e.children)},je=function(){var t=i.ObjectUtils.getJSXElement(e.footer,e);return t&&s.createElement("div",{ref:N,className:"p-dialog-footer"},t)};return h&&(Se=i.ObjectUtils.findDiffKeys(e,w.defaultProps),ke=i.classNames("p-dialog p-component",e.className,{"p-dialog-rtl":e.rtl,"p-dialog-maximized":_}),ze=i.classNames("p-dialog-mask",(xe=["center","left","right","top","top-left","top-right","bottom","bottom-left","bottom-right"].find((function(t){return t===e.position||t.replace("-","")===e.position})))?"p-dialog-".concat(xe):"",{"p-component-overlay p-component-overlay-enter":e.modal,"p-dialog-visible":h,"p-dialog-draggable":e.draggable,"p-dialog-resizable":e.resizable},e.maskClassName),Ce=Ne(),He=Pe(),Oe=je(),Re=e.resizable?s.createElement("div",{className:"p-resizable-handle",style:{zIndex:90},onMouseDown:ue}):null,Ie=s.createElement("div",{ref:O,style:e.maskStyle,className:ze,onClick:re},s.createElement(r.CSSTransition,{nodeRef:H,classNames:"p-dialog",timeout:{enter:"center"===e.position?150:300,exit:"center"===e.position?150:300},in:x,options:e.transitionOptions,unmountOnExit:!0,onEnter:fe,onEntered:ge,onExiting:be,onExited:ye},s.createElement("div",m({ref:H,id:c,className:ke,style:e.style,onClick:e.onClick,role:"dialog"},Se,{"aria-labelledby":c+"_header","aria-describedby":c+"_content","aria-modal":e.modal}),Ce,He,Oe,Re))),s.createElement(o.Portal,{element:Ie,appendTo:e.appendTo,visible:!0}))}));return w.displayName="Dialog",w.defaultProps={__TYPE:"Dialog",id:null,header:null,footer:null,visible:!1,position:"center",draggable:!0,resizable:!0,modal:!0,onHide:null,onShow:null,headerStyle:null,headerClassName:null,contentStyle:null,contentClassName:null,closeOnEscape:!0,dismissableMask:!1,rtl:!1,closable:!0,style:null,className:null,maskStyle:null,maskClassName:null,showHeader:!0,appendTo:null,baseZIndex:0,maximizable:!1,blockScroll:!1,icons:null,ariaCloseIconLabel:"Close",focusOnShow:!0,minX:0,minY:0,keepInViewport:!0,maximized:!1,breakpoints:null,transitionOptions:null,onMaximize:null,onDragStart:null,onDrag:null,onDragEnd:null,onResizeStart:null,onResize:null,onResizeEnd:null,onClick:null,onMaskClick:null},e.Dialog=w,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.api,primereact.csstransition,primereact.hooks,primereact.portal,primereact.ripple,primereact.utils);
|
|
38
38
|
|
|
39
39
|
this.primereact=this.primereact||{},this.primereact.paginator=function(e,t,a,n,r,l,o,i){"use strict";function s(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}var p=s(t);function c(){return c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},c.apply(this,arguments)}function u(e){if(Array.isArray(e))return e}function m(e,t){var a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var n,r,l=[],o=!0,i=!1;try{for(a=a.call(e);!(o=(n=a.next()).done)&&(l.push(n.value),!t||l.length!==t);o=!0);}catch(e){i=!0,r=e}finally{try{o||null==a.return||a.return()}finally{if(i)throw r}}return l}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a<t;a++)n[a]=e[a];return n}function d(e,t){if(e){if("string"==typeof e)return g(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?g(e,t):void 0}}function f(){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 b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}function P(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function v(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function y(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?v(Object(a),!0).forEach((function(t){P(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):v(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var k=p.memo((function(e){var t={currentPage:e.page+1,totalPages:e.pageCount,first:Math.min(e.first+1,e.totalRecords),last:Math.min(e.first+e.rows,e.totalRecords),rows:e.rows,totalRecords:e.totalRecords},a=e.reportTemplate.replace("{currentPage}",t.currentPage).replace("{totalPages}",t.totalPages).replace("{first}",t.first).replace("{last}",t.last).replace("{rows}",t.rows).replace("{totalRecords}",t.totalRecords),r=p.createElement("span",{className:"p-paginator-current"},a);if(e.template){var l=y(y({},t),{className:"p-paginator-current",element:r,props:e});return n.ObjectUtils.getJSXElement(e.template,l)}return r}));k.displayName="CurrentPageReport",k.defaultProps={__TYPE:"CurrentPageReport",pageCount:null,page:null,first:null,rows:null,totalRecords:null,reportTemplate:"({currentPage} of {totalPages})",template:null};var w=p.memo((function(e){var t=n.classNames("p-paginator-first p-paginator-element p-link",{"p-disabled":e.disabled}),a="p-paginator-icon pi pi-angle-double-left",o=p.createElement(l.Button,{type:"button",className:t,icon:a,onClick:e.onClick,disabled:e.disabled,"aria-label":r.ariaLabel("firstPageLabel")});return e.template?n.ObjectUtils.getJSXElement(e.template,{onClick:e.onClick,className:t,iconClassName:a,disabled:e.disabled,element:o,props:e}):o}));w.displayName="FirstPageLink",w.defaultProps={__TYPE:"FirstPageLink",disabled:!1,onClick:null,template:null};var C=p.memo((function(e){var t=function(t){e.onChange&&e.onChange(e.rows*(t.value-1),e.rows)},a=e.pageCount>0?e.page+1:0,r=p.createElement(o.InputNumber,{value:a,onChange:t,className:"p-paginator-page-input",disabled:e.disabled});return e.template?n.ObjectUtils.getJSXElement(e.template,{value:a,onChange:t,disabled:e.disabled,className:"p-paginator-page-input",element:r,props:e}):r}));C.displayName="JumpToPageInput",C.defaultProps={__TYPE:"JumbToPageInput",page:null,rows:null,pageCount:null,disabled:!1,template:null,onChange:null};var h=p.memo((function(e){var t=n.classNames("p-paginator-last p-paginator-element p-link",{"p-disabled":e.disabled}),a="p-paginator-icon pi pi-angle-double-right",o=p.createElement(l.Button,{type:"button",className:t,icon:a,onClick:e.onClick,disabled:e.disabled,"aria-label":r.ariaLabel("lastPageLabel")});return e.template?n.ObjectUtils.getJSXElement(e.template,{onClick:e.onClick,className:t,iconClassName:a,disabled:e.disabled,element:o,props:e}):o}));h.displayName="LastPageLink",h.defaultProps={__TYPE:"LastPageLink",disabled:!1,onClick:null,template:null};var E=p.memo((function(e){var t=n.classNames("p-paginator-next p-paginator-element p-link",{"p-disabled":e.disabled}),a="p-paginator-icon pi pi-angle-right",o=p.createElement(l.Button,{type:"button",className:t,icon:a,onClick:e.onClick,disabled:e.disabled,"aria-label":r.ariaLabel("nextPageLabel")});return e.template?n.ObjectUtils.getJSXElement(e.template,{onClick:e.onClick,className:t,iconClassName:a,disabled:e.disabled,element:o,props:e}):o}));E.displayName="NextPageLink",E.defaultProps={__TYPE:"NextPageLink",disabled:!1,onClick:null,template:null};var N=p.memo((function(e){var t,a=function(t,a){e.onClick&&e.onClick({originalEvent:t,value:a}),t.preventDefault()};if(e.value){var o=e.value[0],i=e.value[e.value.length-1];t=e.value.map((function(t){var s=n.classNames("p-paginator-page p-paginator-element p-link",{"p-paginator-page-start":t===o,"p-paginator-page-end":t===i,"p-highlight":t-1===e.page}),c=p.createElement(l.Button,{type:"button",className:s,onClick:function(e){return a(e,t)},"aria-label":"".concat(r.ariaLabel("pageLabel")," ").concat(t+1)},t);e.template&&(c=n.ObjectUtils.getJSXElement(e.template,{onClick:function(e){return a(e,t)},className:s,view:{startPage:o-1,endPage:i-1},page:t-1,currentPage:e.page,totalPages:e.pageCount,element:c,props:e}));return p.createElement(p.Fragment,{key:t},c)}))}return p.createElement("span",{className:"p-paginator-pages"},t)}));N.displayName="PageLinks",N.defaultProps={__TYPE:"PageLinks",value:null,page:null,rows:null,pageCount:null,links:null,template:null};var O=p.memo((function(e){var t=n.classNames("p-paginator-prev p-paginator-element p-link",{"p-disabled":e.disabled}),a="p-paginator-icon pi pi-angle-left",o=p.createElement(l.Button,{type:"button",className:t,icon:a,onClick:e.onClick,disabled:e.disabled,"aria-label":r.ariaLabel("previousPageLabel")});return e.template?n.ObjectUtils.getJSXElement(e.template,{onClick:e.onClick,className:t,iconClassName:a,disabled:e.disabled,element:o,props:e}):o}));O.displayName="PrevPageLink",O.defaultProps={__TYPE:"PrevPageLink",disabled:!1,onClick:null,template:null};var L=p.memo((function(e){var t=e.options&&e.options.length>0,a=t?e.options.map((function(e){return{label:String(e),value:e}})):[],r=t?p.createElement(i.Dropdown,{value:e.value,options:a,onChange:e.onChange,appendTo:e.appendTo,disabled:e.disabled}):null;return e.template?n.ObjectUtils.getJSXElement(e.template,{value:e.value,options:a,onChange:e.onChange,appendTo:e.appendTo,currentPage:e.page,totalPages:e.pageCount,totalRecords:e.totalRecords,disabled:e.disabled,element:r,props:e}):r}));L.displayName="RowsPerPageDropdown",L.defaultProps={__TYPE:"RowsPerPageDropdown",options:null,value:null,page:null,pageCount:null,totalRecords:0,appendTo:null,onChange:null,template:null,disabled:!1};var j=p.memo(p.forwardRef((function(e,t){var r=p.useRef(!1),l=Math.floor(e.first/e.rows),o=Math.ceil(e.totalRecords/e.rows),i=0===l,s=l===o-1,g=0===o,P=function(){var t=o,a=Math.min(e.pageLinkSize,t),n=Math.max(0,Math.ceil(l-a/2)),r=Math.min(t-1,n+a-1);return[n=Math.max(0,n-(e.pageLinkSize-(r-n+1))),r]},v=function(){for(var e=[],t=P(),a=t[1],n=t[0];n<=a;n++)e.push(n+1);return e},y=function(t,a){var n=o,r=Math.floor(t/a);r>=0&&r<n&&(e.onPageChange&&e.onPageChange({first:t,rows:a,page:r,pageCount:n}))},R=function(t){y(0,e.rows),t.preventDefault()},S=function(t){y(e.first-e.rows,e.rows),t.preventDefault()},T=function(t){y((t.value-1)*e.rows,e.rows)},_=function(t){y(e.first+e.rows,e.rows),t.preventDefault()},D=function(t){y((o-1)*e.rows,e.rows),t.preventDefault()},U=function(t){var a=t.value;r.current=a!==e.rows,y(0,a)};a.useUpdateEffect((function(){r.current||y(0,e.rows),r.current=!1}),[e.rows]),a.useUpdateEffect((function(){l>0&&e.first>=e.totalRecords&&y((o-1)*e.rows,e.rows)}),[e.totalRecords]);var J,M=function(t,a){var n;switch(t){case"FirstPageLink":n=p.createElement(w,{key:t,onClick:R,disabled:i||g,template:a});break;case"PrevPageLink":n=p.createElement(O,{key:t,onClick:S,disabled:i||g,template:a});break;case"NextPageLink":n=p.createElement(E,{key:t,onClick:_,disabled:s||g,template:a});break;case"LastPageLink":n=p.createElement(h,{key:t,onClick:D,disabled:s||g,template:a});break;case"PageLinks":n=p.createElement(N,{key:t,value:v(),page:l,rows:e.rows,pageCount:o,onClick:T,template:a});break;case"RowsPerPageDropdown":n=p.createElement(L,{key:t,value:e.rows,page:l,pageCount:o,totalRecords:e.totalRecords,options:e.rowsPerPageOptions,onChange:U,appendTo:e.dropdownAppendTo,template:a,disabled:g});break;case"CurrentPageReport":n=p.createElement(k,{reportTemplate:e.currentPageReportTemplate,key:t,page:l,pageCount:o,first:e.first,rows:e.rows,totalRecords:e.totalRecords,template:a});break;case"JumpToPageInput":n=p.createElement(C,{key:t,rows:e.rows,page:l,pageCount:o,onChange:y,disabled:g,template:a});break;default:n=null}return n};if(e.alwaysShow||1!==o){var X=n.ObjectUtils.findDiffKeys(e,j.defaultProps),x=n.classNames("p-paginator p-component",e.className),Y=n.ObjectUtils.getJSXElement(e.leftContent,e),A=n.ObjectUtils.getJSXElement(e.rightContent,e),I=(J=e.template)?"object"===b(J)?J.layout?J.layout.split(" ").map((function(e){var t=e.trim();return M(t,J[t])})):Object.entries(J).map((function(e){var t,a,n=(a=2,u(t=e)||m(t,a)||d(t,a)||f());return M(n[0],n[1])})):J.split(" ").map((function(e){return M(e.trim())})):null,B=Y&&p.createElement("div",{className:"p-paginator-left-content"},Y),F=A&&p.createElement("div",{className:"p-paginator-right-content"},A);return p.createElement("div",c({className:x,style:e.style},X),B,I,F)}return null})));return j.displayName="Paginator",j.defaultProps={__TYPE:"Paginator",totalRecords:0,rows:0,first:0,pageLinkSize:5,rowsPerPageOptions:null,alwaysShow:!0,style:null,className:null,template:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown",onPageChange:null,leftContent:null,rightContent:null,dropdownAppendTo:null,currentPageReportTemplate:"({currentPage} of {totalPages})"},e.Paginator=j,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.hooks,primereact.utils,primereact.api,primereact.button,primereact.inputnumber,primereact.dropdown);
|
|
40
40
|
|
package/dialog/dialog.cjs.js
CHANGED
|
@@ -621,9 +621,11 @@ var Dialog = /*#__PURE__*/React__namespace.forwardRef(function (props, ref) {
|
|
|
621
621
|
var icons = utils.ObjectUtils.getJSXElement(props.icons, props);
|
|
622
622
|
var header = utils.ObjectUtils.getJSXElement(props.header, props);
|
|
623
623
|
var headerId = idState + '_header';
|
|
624
|
+
var headerClassName = utils.classNames('p-dialog-header', props.headerClassName);
|
|
624
625
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
625
626
|
ref: headerRef,
|
|
626
|
-
|
|
627
|
+
style: props.headerStyle,
|
|
628
|
+
className: headerClassName,
|
|
627
629
|
onMouseDown: onDragStart
|
|
628
630
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
629
631
|
id: headerId,
|
|
@@ -745,6 +747,8 @@ Dialog.defaultProps = {
|
|
|
745
747
|
modal: true,
|
|
746
748
|
onHide: null,
|
|
747
749
|
onShow: null,
|
|
750
|
+
headerStyle: null,
|
|
751
|
+
headerClassName: null,
|
|
748
752
|
contentStyle: null,
|
|
749
753
|
contentClassName: null,
|
|
750
754
|
closeOnEscape: true,
|
package/dialog/dialog.cjs.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/api"),n=require("primereact/csstransition"),r=require("primereact/hooks"),a=require("primereact/portal"),o=require("primereact/ripple"),l=require("primereact/utils");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function u(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var c=u(e),s=i(t);function d(){return d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d.apply(this,arguments)}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function p(e){if(Array.isArray(e))return m(e)}function f(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function g(e,t){if(e){if("string"==typeof e)return m(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)?m(e,t):void 0}}function b(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function y(e){if(Array.isArray(e))return e}function v(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],l=!0,i=!1;try{for(n=n.call(e);!(l=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);l=!0);}catch(e){i=!0,a=e}finally{try{l||null==n.return||n.return()}finally{if(i)throw a}}return o}}function h(){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 E(e,t){return y(e)||v(e,t)||g(e,t)||h()}var D=c.forwardRef((function(e,t){var i=E(c.useState(e.id),2),u=i[0],m=i[1],y=E(c.useState(!1),2),v=y[0],h=y[1],w=E(c.useState(!1),2),x=w[0],S=w[1],k=E(c.useState(e.maximized),2),z=k[0],C=k[1],H=c.useRef(null),O=c.useRef(null),I=c.useRef(null),R=c.useRef(null),N=c.useRef(null),P=c.useRef(null),j=c.useRef(!1),M=c.useRef(!1),U=c.useRef(null),X=c.useRef(null),A=c.useRef(null),Y=c.useRef(""),_=e.onMaximize?e.maximized:z,q=E(r.useEventListener({type:"keydown",listener:function(e){return oe(e)}}),2),T=q[0],L=q[1],Z=E(r.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return de(e)}}),2),B=Z[0],V=Z[1],J=E(r.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return me(e)}}),2),W=J[0],K=J[1],$=E(r.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return ie(e)}}),2),F=$[0],G=$[1],Q=E(r.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return ue(e)}}),2),ee=Q[0],te=Q[1],ne=function(t){e.onHide(),t.preventDefault()},re=function(t){e.dismissableMask&&e.modal&&O.current===t.target&&ne(t),e.onMaskClick&&e.onMaskClick(t)},ae=function(t){e.onMaximize?e.onMaximize({originalEvent:t,maximized:!_}):C((function(e){return!e})),t.preventDefault()},oe=function(t){var n=t.currentTarget;if(n&&n.primeDialogParams){var r=n.primeDialogParams,a=r.length,o=r[a-1]?r[a-1].id:void 0;if(o===u&&e.closeOnEscape){var i=document.getElementById(o);if(27===t.which)ne(t),t.stopImmediatePropagation(),r.splice(a-1,1);else if(9===t.which){t.preventDefault();var c=l.DomHandler.getFocusableElements(i);if(c&&c.length>0)if(document.activeElement){var s=c.indexOf(document.activeElement);t.shiftKey?-1===s||0===s?c[c.length-1].focus():c[s-1].focus():-1===s||s===c.length-1?c[0].focus():c[s+1].focus()}else c[0].focus()}}}},le=function(t){l.DomHandler.hasClass(t.target,"p-dialog-header-icon")||l.DomHandler.hasClass(t.target.parentElement,"p-dialog-header-icon")||e.draggable&&(j.current=!0,U.current=t.pageX,X.current=t.pageY,H.current.style.margin="0",l.DomHandler.addClass(document.body,"p-unselectable-text"),e.onDragStart&&e.onDragStart(t))},ie=function(t){if(j.current){var n=l.DomHandler.getOuterWidth(H.current),r=l.DomHandler.getOuterHeight(H.current),a=t.pageX-U.current,o=t.pageY-X.current,i=H.current.getBoundingClientRect(),u=i.left+a,c=i.top+o,s=l.DomHandler.getViewport();H.current.style.position="fixed",e.keepInViewport?(u>=e.minX&&u+n<s.width&&(U.current=t.pageX,H.current.style.left=u+"px"),c>=e.minY&&c+r<s.height&&(X.current=t.pageY,H.current.style.top=c+"px")):(U.current=t.pageX,H.current.style.left=u+"px",X.current=t.pageY,H.current.style.top=c+"px"),e.onDrag&&e.onDrag(t)}},ue=function(t){j.current&&(j.current=!1,l.DomHandler.removeClass(document.body,"p-unselectable-text"),e.onDragEnd&&e.onDragEnd(t))},ce=function(t){e.resizable&&(M.current=!0,U.current=t.pageX,X.current=t.pageY,l.DomHandler.addClass(document.body,"p-unselectable-text"),e.onResizeStart&&e.onResizeStart(t))},se=function(e,t,n){!n&&(n=l.DomHandler.getViewport());var r=parseInt(e);return/^(\d+|(\.\d+))(\.\d+)?%$/.test(e)?r*(n[t]/100):r},de=function(t){if(M.current){var n=t.pageX-U.current,r=t.pageY-X.current,a=l.DomHandler.getOuterWidth(H.current),o=l.DomHandler.getOuterHeight(H.current),i=H.current.getBoundingClientRect(),u=l.DomHandler.getViewport(),c=!parseInt(H.current.style.top)||!parseInt(H.current.style.left),s=se(H.current.style.minWidth,"width",u),d=se(H.current.style.minHeight,"height",u),m=a+n,p=o+r;c&&(m+=n,p+=r),(!s||m>s)&&i.left+m<u.width&&(H.current.style.width=m+"px"),(!d||p>d)&&i.top+p<u.height&&(H.current.style.height=p+"px"),U.current=t.pageX,X.current=t.pageY,e.onResize&&e.onResize(t)}},me=function(t){M.current&&(M.current=!1,l.DomHandler.removeClass(document.body,"p-unselectable-text"),e.onResizeEnd&&e.onResizeEnd(t))},pe=function(){H.current.style.position="",H.current.style.left="",H.current.style.top="",H.current.style.margin=""},fe=function(){H.current.setAttribute(Y.current,"")},ge=function(){var t;e.onShow&&e.onShow(),e.focusOnShow&&!((t=document.activeElement)&&H.current&&H.current.contains(t))&&e.closable&&e.showHeader&&P.current.focus(),ve()},be=function(){e.modal&&l.DomHandler.addClass(O.current,"p-component-overlay-leave")},ye=function(){j.current=!1,l.ZIndexUtils.clear(O.current),h(!1),he()},ve=function(){Ee(),(e.blockScroll||e.maximizable&&_)&&l.DomHandler.addClass(document.body,"p-overflow-hidden")},he=function(){(De(),e.modal)?document.primeDialogParams&&document.primeDialogParams.some((function(e){return e.hasBlockScroll}))||l.DomHandler.removeClass(document.body,"p-overflow-hidden"):(e.blockScroll||e.maximizable&&_)&&l.DomHandler.removeClass(document.body,"p-overflow-hidden")},Ee=function(){if(e.draggable&&(F(),ee()),e.resizable&&(B(),W()),e.closable){T();var t={id:u,hasBlockScroll:e.blockScroll};document.primeDialogParams=document.primeDialogParams?[].concat(p(n=document.primeDialogParams)||f(n)||g(n)||b(),[t]):[t]}var n},De=function(){G(),te(),V(),K(),L(),document.primeDialogParams=document.primeDialogParams&&document.primeDialogParams.filter((function(e){return e.id!==u}))},we=function(){if(!A.current){A.current=l.DomHandler.createInlineStyle(s.default.nonce);var t="";for(var n in e.breakpoints)t+="\n @media screen and (max-width: ".concat(n,") {\n .p-dialog[").concat(Y.current,"] {\n width: ").concat(e.breakpoints[n]," !important;\n }\n }\n ");A.current.innerHTML=t}};r.useMountEffect((function(){u||m(l.UniqueComponentId()),Y.current=l.UniqueComponentId(),e.visible&&h(!0),e.breakpoints&&we()})),r.useUpdateEffect((function(){e.visible&&!v&&h(!0),e.visible!==x&&v&&S(e.visible)})),r.useUpdateEffect((function(){v&&(l.ZIndexUtils.set("modal",O.current,s.default.autoZIndex,e.baseZIndex||s.default.zIndex.modal),S(!0))}),[v]),r.useUpdateEffect((function(){e.blockScroll||l.DomHandler[_?"addClass":"removeClass"](document.body,"p-overflow-hidden")}),[e.maximized,z]),r.useUnmountEffect((function(){he(),l.DomHandler.removeInlineStyle(A.current),l.ZIndexUtils.clear(O.current)})),c.useImperativeHandle(t,(function(){return{resetPosition:pe}}));var xe,Se,ke,ze,Ce,He,Oe,Ie,Re,Ne=function(){if(e.showHeader){var t=e.closable?c.createElement("button",{ref:P,type:"button",className:"p-dialog-header-icon p-dialog-header-close p-link","aria-label":e.ariaCloseIconLabel,onClick:ne},c.createElement("span",{className:"p-dialog-header-close-icon pi pi-times"}),c.createElement(o.Ripple,null)):null,n=(i=l.classNames("p-dialog-header-maximize-icon pi",{"pi-window-maximize":!_,"pi-window-minimize":_}),e.maximizable?c.createElement("button",{type:"button",className:"p-dialog-header-icon p-dialog-header-maximize p-link",onClick:ae},c.createElement("span",{className:i}),c.createElement(o.Ripple,null)):null),r=l.ObjectUtils.getJSXElement(e.icons,e),a=l.ObjectUtils.getJSXElement(e.header,e);return c.createElement("div",{ref:R,className:"p-dialog-header",onMouseDown:le},c.createElement("div",{id:u+"_header",className:"p-dialog-title"},a),c.createElement("div",{className:"p-dialog-header-icons"},r,n,t))}var i;return null},Pe=function(){var t=l.classNames("p-dialog-content",e.contentClassName);return c.createElement("div",{id:u+"_content",ref:I,className:t,style:e.contentStyle},e.children)},je=function(){var t=l.ObjectUtils.getJSXElement(e.footer,e);return t&&c.createElement("div",{ref:N,className:"p-dialog-footer"},t)};return v&&(Se=l.ObjectUtils.findDiffKeys(e,D.defaultProps),ke=l.classNames("p-dialog p-component",e.className,{"p-dialog-rtl":e.rtl,"p-dialog-maximized":_}),ze=l.classNames("p-dialog-mask",(xe=["center","left","right","top","top-left","top-right","bottom","bottom-left","bottom-right"].find((function(t){return t===e.position||t.replace("-","")===e.position})))?"p-dialog-".concat(xe):"",{"p-component-overlay p-component-overlay-enter":e.modal,"p-dialog-visible":v,"p-dialog-draggable":e.draggable,"p-dialog-resizable":e.resizable},e.maskClassName),Ce=Ne(),He=Pe(),Oe=je(),Ie=e.resizable?c.createElement("div",{className:"p-resizable-handle",style:{zIndex:90},onMouseDown:ce}):null,Re=c.createElement("div",{ref:O,style:e.maskStyle,className:ze,onClick:re},c.createElement(n.CSSTransition,{nodeRef:H,classNames:"p-dialog",timeout:{enter:"center"===e.position?150:300,exit:"center"===e.position?150:300},in:x,options:e.transitionOptions,unmountOnExit:!0,onEnter:fe,onEntered:ge,onExiting:be,onExited:ye},c.createElement("div",d({ref:H,id:u,className:ke,style:e.style,onClick:e.onClick,role:"dialog"},Se,{"aria-labelledby":u+"_header","aria-describedby":u+"_content","aria-modal":e.modal}),Ce,He,Oe,Ie))),c.createElement(a.Portal,{element:Re,appendTo:e.appendTo,visible:!0}))}));D.displayName="Dialog",D.defaultProps={__TYPE:"Dialog",id:null,header:null,footer:null,visible:!1,position:"center",draggable:!0,resizable:!0,modal:!0,onHide:null,onShow:null,contentStyle:null,contentClassName:null,closeOnEscape:!0,dismissableMask:!1,rtl:!1,closable:!0,style:null,className:null,maskStyle:null,maskClassName:null,showHeader:!0,appendTo:null,baseZIndex:0,maximizable:!1,blockScroll:!1,icons:null,ariaCloseIconLabel:"Close",focusOnShow:!0,minX:0,minY:0,keepInViewport:!0,maximized:!1,breakpoints:null,transitionOptions:null,onMaximize:null,onDragStart:null,onDrag:null,onDragEnd:null,onResizeStart:null,onResize:null,onResizeEnd:null,onClick:null,onMaskClick:null},exports.Dialog=D;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/api"),n=require("primereact/csstransition"),r=require("primereact/hooks"),a=require("primereact/portal"),o=require("primereact/ripple"),l=require("primereact/utils");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function u(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var c=u(e),s=i(t);function d(){return d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d.apply(this,arguments)}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function p(e){if(Array.isArray(e))return m(e)}function f(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function g(e,t){if(e){if("string"==typeof e)return m(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)?m(e,t):void 0}}function b(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function y(e){if(Array.isArray(e))return e}function h(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],l=!0,i=!1;try{for(n=n.call(e);!(l=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);l=!0);}catch(e){i=!0,a=e}finally{try{l||null==n.return||n.return()}finally{if(i)throw a}}return o}}function v(){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 E(e,t){return y(e)||h(e,t)||g(e,t)||v()}var D=c.forwardRef((function(e,t){var i=E(c.useState(e.id),2),u=i[0],m=i[1],y=E(c.useState(!1),2),h=y[0],v=y[1],w=E(c.useState(!1),2),x=w[0],S=w[1],k=E(c.useState(e.maximized),2),z=k[0],C=k[1],H=c.useRef(null),O=c.useRef(null),I=c.useRef(null),N=c.useRef(null),R=c.useRef(null),P=c.useRef(null),j=c.useRef(!1),M=c.useRef(!1),U=c.useRef(null),X=c.useRef(null),A=c.useRef(null),Y=c.useRef(""),_=e.onMaximize?e.maximized:z,q=E(r.useEventListener({type:"keydown",listener:function(e){return oe(e)}}),2),T=q[0],L=q[1],Z=E(r.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return de(e)}}),2),B=Z[0],V=Z[1],J=E(r.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return me(e)}}),2),W=J[0],K=J[1],$=E(r.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return ie(e)}}),2),F=$[0],G=$[1],Q=E(r.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return ue(e)}}),2),ee=Q[0],te=Q[1],ne=function(t){e.onHide(),t.preventDefault()},re=function(t){e.dismissableMask&&e.modal&&O.current===t.target&&ne(t),e.onMaskClick&&e.onMaskClick(t)},ae=function(t){e.onMaximize?e.onMaximize({originalEvent:t,maximized:!_}):C((function(e){return!e})),t.preventDefault()},oe=function(t){var n=t.currentTarget;if(n&&n.primeDialogParams){var r=n.primeDialogParams,a=r.length,o=r[a-1]?r[a-1].id:void 0;if(o===u&&e.closeOnEscape){var i=document.getElementById(o);if(27===t.which)ne(t),t.stopImmediatePropagation(),r.splice(a-1,1);else if(9===t.which){t.preventDefault();var c=l.DomHandler.getFocusableElements(i);if(c&&c.length>0)if(document.activeElement){var s=c.indexOf(document.activeElement);t.shiftKey?-1===s||0===s?c[c.length-1].focus():c[s-1].focus():-1===s||s===c.length-1?c[0].focus():c[s+1].focus()}else c[0].focus()}}}},le=function(t){l.DomHandler.hasClass(t.target,"p-dialog-header-icon")||l.DomHandler.hasClass(t.target.parentElement,"p-dialog-header-icon")||e.draggable&&(j.current=!0,U.current=t.pageX,X.current=t.pageY,H.current.style.margin="0",l.DomHandler.addClass(document.body,"p-unselectable-text"),e.onDragStart&&e.onDragStart(t))},ie=function(t){if(j.current){var n=l.DomHandler.getOuterWidth(H.current),r=l.DomHandler.getOuterHeight(H.current),a=t.pageX-U.current,o=t.pageY-X.current,i=H.current.getBoundingClientRect(),u=i.left+a,c=i.top+o,s=l.DomHandler.getViewport();H.current.style.position="fixed",e.keepInViewport?(u>=e.minX&&u+n<s.width&&(U.current=t.pageX,H.current.style.left=u+"px"),c>=e.minY&&c+r<s.height&&(X.current=t.pageY,H.current.style.top=c+"px")):(U.current=t.pageX,H.current.style.left=u+"px",X.current=t.pageY,H.current.style.top=c+"px"),e.onDrag&&e.onDrag(t)}},ue=function(t){j.current&&(j.current=!1,l.DomHandler.removeClass(document.body,"p-unselectable-text"),e.onDragEnd&&e.onDragEnd(t))},ce=function(t){e.resizable&&(M.current=!0,U.current=t.pageX,X.current=t.pageY,l.DomHandler.addClass(document.body,"p-unselectable-text"),e.onResizeStart&&e.onResizeStart(t))},se=function(e,t,n){!n&&(n=l.DomHandler.getViewport());var r=parseInt(e);return/^(\d+|(\.\d+))(\.\d+)?%$/.test(e)?r*(n[t]/100):r},de=function(t){if(M.current){var n=t.pageX-U.current,r=t.pageY-X.current,a=l.DomHandler.getOuterWidth(H.current),o=l.DomHandler.getOuterHeight(H.current),i=H.current.getBoundingClientRect(),u=l.DomHandler.getViewport(),c=!parseInt(H.current.style.top)||!parseInt(H.current.style.left),s=se(H.current.style.minWidth,"width",u),d=se(H.current.style.minHeight,"height",u),m=a+n,p=o+r;c&&(m+=n,p+=r),(!s||m>s)&&i.left+m<u.width&&(H.current.style.width=m+"px"),(!d||p>d)&&i.top+p<u.height&&(H.current.style.height=p+"px"),U.current=t.pageX,X.current=t.pageY,e.onResize&&e.onResize(t)}},me=function(t){M.current&&(M.current=!1,l.DomHandler.removeClass(document.body,"p-unselectable-text"),e.onResizeEnd&&e.onResizeEnd(t))},pe=function(){H.current.style.position="",H.current.style.left="",H.current.style.top="",H.current.style.margin=""},fe=function(){H.current.setAttribute(Y.current,"")},ge=function(){var t;e.onShow&&e.onShow(),e.focusOnShow&&!((t=document.activeElement)&&H.current&&H.current.contains(t))&&e.closable&&e.showHeader&&P.current.focus(),he()},be=function(){e.modal&&l.DomHandler.addClass(O.current,"p-component-overlay-leave")},ye=function(){j.current=!1,l.ZIndexUtils.clear(O.current),v(!1),ve()},he=function(){Ee(),(e.blockScroll||e.maximizable&&_)&&l.DomHandler.addClass(document.body,"p-overflow-hidden")},ve=function(){(De(),e.modal)?document.primeDialogParams&&document.primeDialogParams.some((function(e){return e.hasBlockScroll}))||l.DomHandler.removeClass(document.body,"p-overflow-hidden"):(e.blockScroll||e.maximizable&&_)&&l.DomHandler.removeClass(document.body,"p-overflow-hidden")},Ee=function(){if(e.draggable&&(F(),ee()),e.resizable&&(B(),W()),e.closable){T();var t={id:u,hasBlockScroll:e.blockScroll};document.primeDialogParams=document.primeDialogParams?[].concat(p(n=document.primeDialogParams)||f(n)||g(n)||b(),[t]):[t]}var n},De=function(){G(),te(),V(),K(),L(),document.primeDialogParams=document.primeDialogParams&&document.primeDialogParams.filter((function(e){return e.id!==u}))},we=function(){if(!A.current){A.current=l.DomHandler.createInlineStyle(s.default.nonce);var t="";for(var n in e.breakpoints)t+="\n @media screen and (max-width: ".concat(n,") {\n .p-dialog[").concat(Y.current,"] {\n width: ").concat(e.breakpoints[n]," !important;\n }\n }\n ");A.current.innerHTML=t}};r.useMountEffect((function(){u||m(l.UniqueComponentId()),Y.current=l.UniqueComponentId(),e.visible&&v(!0),e.breakpoints&&we()})),r.useUpdateEffect((function(){e.visible&&!h&&v(!0),e.visible!==x&&h&&S(e.visible)})),r.useUpdateEffect((function(){h&&(l.ZIndexUtils.set("modal",O.current,s.default.autoZIndex,e.baseZIndex||s.default.zIndex.modal),S(!0))}),[h]),r.useUpdateEffect((function(){e.blockScroll||l.DomHandler[_?"addClass":"removeClass"](document.body,"p-overflow-hidden")}),[e.maximized,z]),r.useUnmountEffect((function(){ve(),l.DomHandler.removeInlineStyle(A.current),l.ZIndexUtils.clear(O.current)})),c.useImperativeHandle(t,(function(){return{resetPosition:pe}}));var xe,Se,ke,ze,Ce,He,Oe,Ie,Ne,Re=function(){if(e.showHeader){var t=e.closable?c.createElement("button",{ref:P,type:"button",className:"p-dialog-header-icon p-dialog-header-close p-link","aria-label":e.ariaCloseIconLabel,onClick:ne},c.createElement("span",{className:"p-dialog-header-close-icon pi pi-times"}),c.createElement(o.Ripple,null)):null,n=(d=l.classNames("p-dialog-header-maximize-icon pi",{"pi-window-maximize":!_,"pi-window-minimize":_}),e.maximizable?c.createElement("button",{type:"button",className:"p-dialog-header-icon p-dialog-header-maximize p-link",onClick:ae},c.createElement("span",{className:d}),c.createElement(o.Ripple,null)):null),r=l.ObjectUtils.getJSXElement(e.icons,e),a=l.ObjectUtils.getJSXElement(e.header,e),i=u+"_header",s=l.classNames("p-dialog-header",e.headerClassName);return c.createElement("div",{ref:N,style:e.headerStyle,className:s,onMouseDown:le},c.createElement("div",{id:i,className:"p-dialog-title"},a),c.createElement("div",{className:"p-dialog-header-icons"},r,n,t))}var d;return null},Pe=function(){var t=l.classNames("p-dialog-content",e.contentClassName);return c.createElement("div",{id:u+"_content",ref:I,className:t,style:e.contentStyle},e.children)},je=function(){var t=l.ObjectUtils.getJSXElement(e.footer,e);return t&&c.createElement("div",{ref:R,className:"p-dialog-footer"},t)};return h&&(Se=l.ObjectUtils.findDiffKeys(e,D.defaultProps),ke=l.classNames("p-dialog p-component",e.className,{"p-dialog-rtl":e.rtl,"p-dialog-maximized":_}),ze=l.classNames("p-dialog-mask",(xe=["center","left","right","top","top-left","top-right","bottom","bottom-left","bottom-right"].find((function(t){return t===e.position||t.replace("-","")===e.position})))?"p-dialog-".concat(xe):"",{"p-component-overlay p-component-overlay-enter":e.modal,"p-dialog-visible":h,"p-dialog-draggable":e.draggable,"p-dialog-resizable":e.resizable},e.maskClassName),Ce=Re(),He=Pe(),Oe=je(),Ie=e.resizable?c.createElement("div",{className:"p-resizable-handle",style:{zIndex:90},onMouseDown:ce}):null,Ne=c.createElement("div",{ref:O,style:e.maskStyle,className:ze,onClick:re},c.createElement(n.CSSTransition,{nodeRef:H,classNames:"p-dialog",timeout:{enter:"center"===e.position?150:300,exit:"center"===e.position?150:300},in:x,options:e.transitionOptions,unmountOnExit:!0,onEnter:fe,onEntered:ge,onExiting:be,onExited:ye},c.createElement("div",d({ref:H,id:u,className:ke,style:e.style,onClick:e.onClick,role:"dialog"},Se,{"aria-labelledby":u+"_header","aria-describedby":u+"_content","aria-modal":e.modal}),Ce,He,Oe,Ie))),c.createElement(a.Portal,{element:Ne,appendTo:e.appendTo,visible:!0}))}));D.displayName="Dialog",D.defaultProps={__TYPE:"Dialog",id:null,header:null,footer:null,visible:!1,position:"center",draggable:!0,resizable:!0,modal:!0,onHide:null,onShow:null,headerStyle:null,headerClassName:null,contentStyle:null,contentClassName:null,closeOnEscape:!0,dismissableMask:!1,rtl:!1,closable:!0,style:null,className:null,maskStyle:null,maskClassName:null,showHeader:!0,appendTo:null,baseZIndex:0,maximizable:!1,blockScroll:!1,icons:null,ariaCloseIconLabel:"Close",focusOnShow:!0,minX:0,minY:0,keepInViewport:!0,maximized:!1,breakpoints:null,transitionOptions:null,onMaximize:null,onDragStart:null,onDrag:null,onDragEnd:null,onResizeStart:null,onResize:null,onResizeEnd:null,onClick:null,onMaskClick:null},exports.Dialog=D;
|
package/dialog/dialog.d.ts
CHANGED
package/dialog/dialog.esm.js
CHANGED
|
@@ -594,9 +594,11 @@ var Dialog = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
594
594
|
var icons = ObjectUtils.getJSXElement(props.icons, props);
|
|
595
595
|
var header = ObjectUtils.getJSXElement(props.header, props);
|
|
596
596
|
var headerId = idState + '_header';
|
|
597
|
+
var headerClassName = classNames('p-dialog-header', props.headerClassName);
|
|
597
598
|
return /*#__PURE__*/React.createElement("div", {
|
|
598
599
|
ref: headerRef,
|
|
599
|
-
|
|
600
|
+
style: props.headerStyle,
|
|
601
|
+
className: headerClassName,
|
|
600
602
|
onMouseDown: onDragStart
|
|
601
603
|
}, /*#__PURE__*/React.createElement("div", {
|
|
602
604
|
id: headerId,
|
|
@@ -718,6 +720,8 @@ Dialog.defaultProps = {
|
|
|
718
720
|
modal: true,
|
|
719
721
|
onHide: null,
|
|
720
722
|
onShow: null,
|
|
723
|
+
headerStyle: null,
|
|
724
|
+
headerClassName: null,
|
|
721
725
|
contentStyle: null,
|
|
722
726
|
contentClassName: null,
|
|
723
727
|
closeOnEscape: true,
|
package/dialog/dialog.esm.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import t from"primereact/api";import{CSSTransition as n}from"primereact/csstransition";import{useEventListener as r,useMountEffect as o,useUpdateEffect as a,useUnmountEffect as i}from"primereact/hooks";import{Portal as l}from"primereact/portal";import{Ripple as c}from"primereact/ripple";import{DomHandler as u,UniqueComponentId as s,ZIndexUtils as m,ObjectUtils as d,classNames as p}from"primereact/utils";function f(){return f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f.apply(this,arguments)}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function b(e){if(Array.isArray(e))return g(e)}function y(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function h(e,t){if(e){if("string"==typeof e)return g(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)?g(e,t):void 0}}function v(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(e){if(Array.isArray(e))return e}function E(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw o}}return a}}function x(){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 S(e,t){return w(e)||E(e,t)||h(e,t)||x()}var k=e.forwardRef((function(g,w){var E=S(e.useState(g.id),2),x=E[0],z=E[1],C=S(e.useState(!1),2),D=C[0],R=C[1],I=S(e.useState(!1),2),N=I[0],O=I[1],P=S(e.useState(g.maximized),2),M=P[0],X=P[1],A=e.useRef(null),H=e.useRef(null),Y=e.useRef(null),T=e.useRef(null),j=e.useRef(null),_=e.useRef(null),B=e.useRef(!1),V=e.useRef(!1),J=e.useRef(null),L=e.useRef(null),W=e.useRef(null),Z=e.useRef(""),K=g.onMaximize?g.maximized:M,$=S(r({type:"keydown",listener:function(e){return de(e)}}),2),F=$[0],U=$[1],q=S(r({type:"mousemove",target:function(){return window.document},listener:function(e){return he(e)}}),2),G=q[0],Q=q[1],ee=S(r({type:"mouseup",target:function(){return window.document},listener:function(e){return ve(e)}}),2),te=ee[0],ne=ee[1],re=S(r({type:"mousemove",target:function(){return window.document},listener:function(e){return fe(e)}}),2),oe=re[0],ae=re[1],ie=S(r({type:"mouseup",target:function(){return window.document},listener:function(e){return ge(e)}}),2),le=ie[0],ce=ie[1],ue=function(e){g.onHide(),e.preventDefault()},se=function(e){g.dismissableMask&&g.modal&&H.current===e.target&&ue(e),g.onMaskClick&&g.onMaskClick(e)},me=function(e){g.onMaximize?g.onMaximize({originalEvent:e,maximized:!K}):X((function(e){return!e})),e.preventDefault()},de=function(e){var t=e.currentTarget;if(t&&t.primeDialogParams){var n=t.primeDialogParams,r=n.length,o=n[r-1]?n[r-1].id:void 0;if(o===x&&g.closeOnEscape){var a=document.getElementById(o);if(27===e.which)ue(e),e.stopImmediatePropagation(),n.splice(r-1,1);else if(9===e.which){e.preventDefault();var i=u.getFocusableElements(a);if(i&&i.length>0)if(document.activeElement){var l=i.indexOf(document.activeElement);e.shiftKey?-1===l||0===l?i[i.length-1].focus():i[l-1].focus():-1===l||l===i.length-1?i[0].focus():i[l+1].focus()}else i[0].focus()}}}},pe=function(e){u.hasClass(e.target,"p-dialog-header-icon")||u.hasClass(e.target.parentElement,"p-dialog-header-icon")||g.draggable&&(B.current=!0,J.current=e.pageX,L.current=e.pageY,A.current.style.margin="0",u.addClass(document.body,"p-unselectable-text"),g.onDragStart&&g.onDragStart(e))},fe=function(e){if(B.current){var t=u.getOuterWidth(A.current),n=u.getOuterHeight(A.current),r=e.pageX-J.current,o=e.pageY-L.current,a=A.current.getBoundingClientRect(),i=a.left+r,l=a.top+o,c=u.getViewport();A.current.style.position="fixed",g.keepInViewport?(i>=g.minX&&i+t<c.width&&(J.current=e.pageX,A.current.style.left=i+"px"),l>=g.minY&&l+n<c.height&&(L.current=e.pageY,A.current.style.top=l+"px")):(J.current=e.pageX,A.current.style.left=i+"px",L.current=e.pageY,A.current.style.top=l+"px"),g.onDrag&&g.onDrag(e)}},ge=function(e){B.current&&(B.current=!1,u.removeClass(document.body,"p-unselectable-text"),g.onDragEnd&&g.onDragEnd(e))},be=function(e){g.resizable&&(V.current=!0,J.current=e.pageX,L.current=e.pageY,u.addClass(document.body,"p-unselectable-text"),g.onResizeStart&&g.onResizeStart(e))},ye=function(e,t,n){!n&&(n=u.getViewport());var r=parseInt(e);return/^(\d+|(\.\d+))(\.\d+)?%$/.test(e)?r*(n[t]/100):r},he=function(e){if(V.current){var t=e.pageX-J.current,n=e.pageY-L.current,r=u.getOuterWidth(A.current),o=u.getOuterHeight(A.current),a=A.current.getBoundingClientRect(),i=u.getViewport(),l=!parseInt(A.current.style.top)||!parseInt(A.current.style.left),c=ye(A.current.style.minWidth,"width",i),s=ye(A.current.style.minHeight,"height",i),m=r+t,d=o+n;l&&(m+=t,d+=n),(!c||m>c)&&a.left+m<i.width&&(A.current.style.width=m+"px"),(!s||d>s)&&a.top+d<i.height&&(A.current.style.height=d+"px"),J.current=e.pageX,L.current=e.pageY,g.onResize&&g.onResize(e)}},ve=function(e){V.current&&(V.current=!1,u.removeClass(document.body,"p-unselectable-text"),g.onResizeEnd&&g.onResizeEnd(e))},we=function(){A.current.style.position="",A.current.style.left="",A.current.style.top="",A.current.style.margin=""},Ee=function(){A.current.setAttribute(Z.current,"")},xe=function(){var e;g.onShow&&g.onShow(),g.focusOnShow&&!((e=document.activeElement)&&A.current&&A.current.contains(e))&&g.closable&&g.showHeader&&_.current.focus(),ze()},Se=function(){g.modal&&u.addClass(H.current,"p-component-overlay-leave")},ke=function(){B.current=!1,m.clear(H.current),R(!1),Ce()},ze=function(){De(),(g.blockScroll||g.maximizable&&K)&&u.addClass(document.body,"p-overflow-hidden")},Ce=function(){(Re(),g.modal)?document.primeDialogParams&&document.primeDialogParams.some((function(e){return e.hasBlockScroll}))||u.removeClass(document.body,"p-overflow-hidden"):(g.blockScroll||g.maximizable&&K)&&u.removeClass(document.body,"p-overflow-hidden")},De=function(){if(g.draggable&&(oe(),le()),g.resizable&&(G(),te()),g.closable){F();var e={id:x,hasBlockScroll:g.blockScroll};document.primeDialogParams=document.primeDialogParams?[].concat(b(t=document.primeDialogParams)||y(t)||h(t)||v(),[e]):[e]}var t},Re=function(){ae(),ce(),Q(),ne(),U(),document.primeDialogParams=document.primeDialogParams&&document.primeDialogParams.filter((function(e){return e.id!==x}))},Ie=function(){if(!W.current){W.current=u.createInlineStyle(t.nonce);var e="";for(var n in g.breakpoints)e+="\n @media screen and (max-width: ".concat(n,") {\n .p-dialog[").concat(Z.current,"] {\n width: ").concat(g.breakpoints[n]," !important;\n }\n }\n ");W.current.innerHTML=e}};o((function(){x||z(s()),Z.current=s(),g.visible&&R(!0),g.breakpoints&&Ie()})),a((function(){g.visible&&!D&&R(!0),g.visible!==N&&D&&O(g.visible)})),a((function(){D&&(m.set("modal",H.current,t.autoZIndex,g.baseZIndex||t.zIndex.modal),O(!0))}),[D]),a((function(){g.blockScroll||u[K?"addClass":"removeClass"](document.body,"p-overflow-hidden")}),[g.maximized,M]),i((function(){Ce(),u.removeInlineStyle(W.current),m.clear(H.current)})),e.useImperativeHandle(w,(function(){return{resetPosition:we}}));var Ne,Oe,Pe,Me,Xe,Ae,He,Ye,Te,je=function(){if(g.showHeader){var t=g.closable?e.createElement("button",{ref:_,type:"button",className:"p-dialog-header-icon p-dialog-header-close p-link","aria-label":g.ariaCloseIconLabel,onClick:ue},e.createElement("span",{className:"p-dialog-header-close-icon pi pi-times"}),e.createElement(c,null)):null,n=(a=p("p-dialog-header-maximize-icon pi",{"pi-window-maximize":!K,"pi-window-minimize":K}),g.maximizable?e.createElement("button",{type:"button",className:"p-dialog-header-icon p-dialog-header-maximize p-link",onClick:me},e.createElement("span",{className:a}),e.createElement(c,null)):null),r=d.getJSXElement(g.icons,g),o=d.getJSXElement(g.header,g);return e.createElement("div",{ref:T,className:"p-dialog-header",onMouseDown:pe},e.createElement("div",{id:x+"_header",className:"p-dialog-title"},o),e.createElement("div",{className:"p-dialog-header-icons"},r,n,t))}var a;return null},_e=function(){var t=p("p-dialog-content",g.contentClassName);return e.createElement("div",{id:x+"_content",ref:Y,className:t,style:g.contentStyle},g.children)},Be=function(){var t=d.getJSXElement(g.footer,g);return t&&e.createElement("div",{ref:j,className:"p-dialog-footer"},t)};return D&&(Oe=d.findDiffKeys(g,k.defaultProps),Pe=p("p-dialog p-component",g.className,{"p-dialog-rtl":g.rtl,"p-dialog-maximized":K}),Me=p("p-dialog-mask",(Ne=["center","left","right","top","top-left","top-right","bottom","bottom-left","bottom-right"].find((function(e){return e===g.position||e.replace("-","")===g.position})))?"p-dialog-".concat(Ne):"",{"p-component-overlay p-component-overlay-enter":g.modal,"p-dialog-visible":D,"p-dialog-draggable":g.draggable,"p-dialog-resizable":g.resizable},g.maskClassName),Xe=je(),Ae=_e(),He=Be(),Ye=g.resizable?e.createElement("div",{className:"p-resizable-handle",style:{zIndex:90},onMouseDown:be}):null,Te=e.createElement("div",{ref:H,style:g.maskStyle,className:Me,onClick:se},e.createElement(n,{nodeRef:A,classNames:"p-dialog",timeout:{enter:"center"===g.position?150:300,exit:"center"===g.position?150:300},in:N,options:g.transitionOptions,unmountOnExit:!0,onEnter:Ee,onEntered:xe,onExiting:Se,onExited:ke},e.createElement("div",f({ref:A,id:x,className:Pe,style:g.style,onClick:g.onClick,role:"dialog"},Oe,{"aria-labelledby":x+"_header","aria-describedby":x+"_content","aria-modal":g.modal}),Xe,Ae,He,Ye))),e.createElement(l,{element:Te,appendTo:g.appendTo,visible:!0}))}));k.displayName="Dialog",k.defaultProps={__TYPE:"Dialog",id:null,header:null,footer:null,visible:!1,position:"center",draggable:!0,resizable:!0,modal:!0,onHide:null,onShow:null,contentStyle:null,contentClassName:null,closeOnEscape:!0,dismissableMask:!1,rtl:!1,closable:!0,style:null,className:null,maskStyle:null,maskClassName:null,showHeader:!0,appendTo:null,baseZIndex:0,maximizable:!1,blockScroll:!1,icons:null,ariaCloseIconLabel:"Close",focusOnShow:!0,minX:0,minY:0,keepInViewport:!0,maximized:!1,breakpoints:null,transitionOptions:null,onMaximize:null,onDragStart:null,onDrag:null,onDragEnd:null,onResizeStart:null,onResize:null,onResizeEnd:null,onClick:null,onMaskClick:null};export{k as Dialog};
|
|
1
|
+
import*as e from"react";import t from"primereact/api";import{CSSTransition as n}from"primereact/csstransition";import{useEventListener as r,useMountEffect as o,useUpdateEffect as a,useUnmountEffect as l}from"primereact/hooks";import{Portal as i}from"primereact/portal";import{Ripple as c}from"primereact/ripple";import{DomHandler as u,UniqueComponentId as s,ZIndexUtils as m,ObjectUtils as d,classNames as p}from"primereact/utils";function f(){return f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f.apply(this,arguments)}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function b(e){if(Array.isArray(e))return g(e)}function y(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function h(e,t){if(e){if("string"==typeof e)return g(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)?g(e,t):void 0}}function v(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(e){if(Array.isArray(e))return e}function E(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a=[],l=!0,i=!1;try{for(n=n.call(e);!(l=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);l=!0);}catch(e){i=!0,o=e}finally{try{l||null==n.return||n.return()}finally{if(i)throw o}}return a}}function x(){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 S(e,t){return w(e)||E(e,t)||h(e,t)||x()}var k=e.forwardRef((function(g,w){var E=S(e.useState(g.id),2),x=E[0],z=E[1],C=S(e.useState(!1),2),D=C[0],R=C[1],I=S(e.useState(!1),2),N=I[0],O=I[1],P=S(e.useState(g.maximized),2),M=P[0],X=P[1],A=e.useRef(null),H=e.useRef(null),Y=e.useRef(null),T=e.useRef(null),j=e.useRef(null),_=e.useRef(null),B=e.useRef(!1),V=e.useRef(!1),J=e.useRef(null),L=e.useRef(null),W=e.useRef(null),Z=e.useRef(""),K=g.onMaximize?g.maximized:M,$=S(r({type:"keydown",listener:function(e){return de(e)}}),2),F=$[0],U=$[1],q=S(r({type:"mousemove",target:function(){return window.document},listener:function(e){return he(e)}}),2),G=q[0],Q=q[1],ee=S(r({type:"mouseup",target:function(){return window.document},listener:function(e){return ve(e)}}),2),te=ee[0],ne=ee[1],re=S(r({type:"mousemove",target:function(){return window.document},listener:function(e){return fe(e)}}),2),oe=re[0],ae=re[1],le=S(r({type:"mouseup",target:function(){return window.document},listener:function(e){return ge(e)}}),2),ie=le[0],ce=le[1],ue=function(e){g.onHide(),e.preventDefault()},se=function(e){g.dismissableMask&&g.modal&&H.current===e.target&&ue(e),g.onMaskClick&&g.onMaskClick(e)},me=function(e){g.onMaximize?g.onMaximize({originalEvent:e,maximized:!K}):X((function(e){return!e})),e.preventDefault()},de=function(e){var t=e.currentTarget;if(t&&t.primeDialogParams){var n=t.primeDialogParams,r=n.length,o=n[r-1]?n[r-1].id:void 0;if(o===x&&g.closeOnEscape){var a=document.getElementById(o);if(27===e.which)ue(e),e.stopImmediatePropagation(),n.splice(r-1,1);else if(9===e.which){e.preventDefault();var l=u.getFocusableElements(a);if(l&&l.length>0)if(document.activeElement){var i=l.indexOf(document.activeElement);e.shiftKey?-1===i||0===i?l[l.length-1].focus():l[i-1].focus():-1===i||i===l.length-1?l[0].focus():l[i+1].focus()}else l[0].focus()}}}},pe=function(e){u.hasClass(e.target,"p-dialog-header-icon")||u.hasClass(e.target.parentElement,"p-dialog-header-icon")||g.draggable&&(B.current=!0,J.current=e.pageX,L.current=e.pageY,A.current.style.margin="0",u.addClass(document.body,"p-unselectable-text"),g.onDragStart&&g.onDragStart(e))},fe=function(e){if(B.current){var t=u.getOuterWidth(A.current),n=u.getOuterHeight(A.current),r=e.pageX-J.current,o=e.pageY-L.current,a=A.current.getBoundingClientRect(),l=a.left+r,i=a.top+o,c=u.getViewport();A.current.style.position="fixed",g.keepInViewport?(l>=g.minX&&l+t<c.width&&(J.current=e.pageX,A.current.style.left=l+"px"),i>=g.minY&&i+n<c.height&&(L.current=e.pageY,A.current.style.top=i+"px")):(J.current=e.pageX,A.current.style.left=l+"px",L.current=e.pageY,A.current.style.top=i+"px"),g.onDrag&&g.onDrag(e)}},ge=function(e){B.current&&(B.current=!1,u.removeClass(document.body,"p-unselectable-text"),g.onDragEnd&&g.onDragEnd(e))},be=function(e){g.resizable&&(V.current=!0,J.current=e.pageX,L.current=e.pageY,u.addClass(document.body,"p-unselectable-text"),g.onResizeStart&&g.onResizeStart(e))},ye=function(e,t,n){!n&&(n=u.getViewport());var r=parseInt(e);return/^(\d+|(\.\d+))(\.\d+)?%$/.test(e)?r*(n[t]/100):r},he=function(e){if(V.current){var t=e.pageX-J.current,n=e.pageY-L.current,r=u.getOuterWidth(A.current),o=u.getOuterHeight(A.current),a=A.current.getBoundingClientRect(),l=u.getViewport(),i=!parseInt(A.current.style.top)||!parseInt(A.current.style.left),c=ye(A.current.style.minWidth,"width",l),s=ye(A.current.style.minHeight,"height",l),m=r+t,d=o+n;i&&(m+=t,d+=n),(!c||m>c)&&a.left+m<l.width&&(A.current.style.width=m+"px"),(!s||d>s)&&a.top+d<l.height&&(A.current.style.height=d+"px"),J.current=e.pageX,L.current=e.pageY,g.onResize&&g.onResize(e)}},ve=function(e){V.current&&(V.current=!1,u.removeClass(document.body,"p-unselectable-text"),g.onResizeEnd&&g.onResizeEnd(e))},we=function(){A.current.style.position="",A.current.style.left="",A.current.style.top="",A.current.style.margin=""},Ee=function(){A.current.setAttribute(Z.current,"")},xe=function(){var e;g.onShow&&g.onShow(),g.focusOnShow&&!((e=document.activeElement)&&A.current&&A.current.contains(e))&&g.closable&&g.showHeader&&_.current.focus(),ze()},Se=function(){g.modal&&u.addClass(H.current,"p-component-overlay-leave")},ke=function(){B.current=!1,m.clear(H.current),R(!1),Ce()},ze=function(){De(),(g.blockScroll||g.maximizable&&K)&&u.addClass(document.body,"p-overflow-hidden")},Ce=function(){(Re(),g.modal)?document.primeDialogParams&&document.primeDialogParams.some((function(e){return e.hasBlockScroll}))||u.removeClass(document.body,"p-overflow-hidden"):(g.blockScroll||g.maximizable&&K)&&u.removeClass(document.body,"p-overflow-hidden")},De=function(){if(g.draggable&&(oe(),ie()),g.resizable&&(G(),te()),g.closable){F();var e={id:x,hasBlockScroll:g.blockScroll};document.primeDialogParams=document.primeDialogParams?[].concat(b(t=document.primeDialogParams)||y(t)||h(t)||v(),[e]):[e]}var t},Re=function(){ae(),ce(),Q(),ne(),U(),document.primeDialogParams=document.primeDialogParams&&document.primeDialogParams.filter((function(e){return e.id!==x}))},Ie=function(){if(!W.current){W.current=u.createInlineStyle(t.nonce);var e="";for(var n in g.breakpoints)e+="\n @media screen and (max-width: ".concat(n,") {\n .p-dialog[").concat(Z.current,"] {\n width: ").concat(g.breakpoints[n]," !important;\n }\n }\n ");W.current.innerHTML=e}};o((function(){x||z(s()),Z.current=s(),g.visible&&R(!0),g.breakpoints&&Ie()})),a((function(){g.visible&&!D&&R(!0),g.visible!==N&&D&&O(g.visible)})),a((function(){D&&(m.set("modal",H.current,t.autoZIndex,g.baseZIndex||t.zIndex.modal),O(!0))}),[D]),a((function(){g.blockScroll||u[K?"addClass":"removeClass"](document.body,"p-overflow-hidden")}),[g.maximized,M]),l((function(){Ce(),u.removeInlineStyle(W.current),m.clear(H.current)})),e.useImperativeHandle(w,(function(){return{resetPosition:we}}));var Ne,Oe,Pe,Me,Xe,Ae,He,Ye,Te,je=function(){if(g.showHeader){var t=g.closable?e.createElement("button",{ref:_,type:"button",className:"p-dialog-header-icon p-dialog-header-close p-link","aria-label":g.ariaCloseIconLabel,onClick:ue},e.createElement("span",{className:"p-dialog-header-close-icon pi pi-times"}),e.createElement(c,null)):null,n=(i=p("p-dialog-header-maximize-icon pi",{"pi-window-maximize":!K,"pi-window-minimize":K}),g.maximizable?e.createElement("button",{type:"button",className:"p-dialog-header-icon p-dialog-header-maximize p-link",onClick:me},e.createElement("span",{className:i}),e.createElement(c,null)):null),r=d.getJSXElement(g.icons,g),o=d.getJSXElement(g.header,g),a=x+"_header",l=p("p-dialog-header",g.headerClassName);return e.createElement("div",{ref:T,style:g.headerStyle,className:l,onMouseDown:pe},e.createElement("div",{id:a,className:"p-dialog-title"},o),e.createElement("div",{className:"p-dialog-header-icons"},r,n,t))}var i;return null},_e=function(){var t=p("p-dialog-content",g.contentClassName);return e.createElement("div",{id:x+"_content",ref:Y,className:t,style:g.contentStyle},g.children)},Be=function(){var t=d.getJSXElement(g.footer,g);return t&&e.createElement("div",{ref:j,className:"p-dialog-footer"},t)};return D&&(Oe=d.findDiffKeys(g,k.defaultProps),Pe=p("p-dialog p-component",g.className,{"p-dialog-rtl":g.rtl,"p-dialog-maximized":K}),Me=p("p-dialog-mask",(Ne=["center","left","right","top","top-left","top-right","bottom","bottom-left","bottom-right"].find((function(e){return e===g.position||e.replace("-","")===g.position})))?"p-dialog-".concat(Ne):"",{"p-component-overlay p-component-overlay-enter":g.modal,"p-dialog-visible":D,"p-dialog-draggable":g.draggable,"p-dialog-resizable":g.resizable},g.maskClassName),Xe=je(),Ae=_e(),He=Be(),Ye=g.resizable?e.createElement("div",{className:"p-resizable-handle",style:{zIndex:90},onMouseDown:be}):null,Te=e.createElement("div",{ref:H,style:g.maskStyle,className:Me,onClick:se},e.createElement(n,{nodeRef:A,classNames:"p-dialog",timeout:{enter:"center"===g.position?150:300,exit:"center"===g.position?150:300},in:N,options:g.transitionOptions,unmountOnExit:!0,onEnter:Ee,onEntered:xe,onExiting:Se,onExited:ke},e.createElement("div",f({ref:A,id:x,className:Pe,style:g.style,onClick:g.onClick,role:"dialog"},Oe,{"aria-labelledby":x+"_header","aria-describedby":x+"_content","aria-modal":g.modal}),Xe,Ae,He,Ye))),e.createElement(i,{element:Te,appendTo:g.appendTo,visible:!0}))}));k.displayName="Dialog",k.defaultProps={__TYPE:"Dialog",id:null,header:null,footer:null,visible:!1,position:"center",draggable:!0,resizable:!0,modal:!0,onHide:null,onShow:null,headerStyle:null,headerClassName:null,contentStyle:null,contentClassName:null,closeOnEscape:!0,dismissableMask:!1,rtl:!1,closable:!0,style:null,className:null,maskStyle:null,maskClassName:null,showHeader:!0,appendTo:null,baseZIndex:0,maximizable:!1,blockScroll:!1,icons:null,ariaCloseIconLabel:"Close",focusOnShow:!0,minX:0,minY:0,keepInViewport:!0,maximized:!1,breakpoints:null,transitionOptions:null,onMaximize:null,onDragStart:null,onDrag:null,onDragEnd:null,onResizeStart:null,onResize:null,onResizeEnd:null,onClick:null,onMaskClick:null};export{k as Dialog};
|
package/dialog/dialog.js
CHANGED
|
@@ -613,9 +613,11 @@ this.primereact.dialog = (function (exports, React, PrimeReact, csstransition, h
|
|
|
613
613
|
var icons = utils.ObjectUtils.getJSXElement(props.icons, props);
|
|
614
614
|
var header = utils.ObjectUtils.getJSXElement(props.header, props);
|
|
615
615
|
var headerId = idState + '_header';
|
|
616
|
+
var headerClassName = utils.classNames('p-dialog-header', props.headerClassName);
|
|
616
617
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
617
618
|
ref: headerRef,
|
|
618
|
-
|
|
619
|
+
style: props.headerStyle,
|
|
620
|
+
className: headerClassName,
|
|
619
621
|
onMouseDown: onDragStart
|
|
620
622
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
621
623
|
id: headerId,
|
|
@@ -737,6 +739,8 @@ this.primereact.dialog = (function (exports, React, PrimeReact, csstransition, h
|
|
|
737
739
|
modal: true,
|
|
738
740
|
onHide: null,
|
|
739
741
|
onShow: null,
|
|
742
|
+
headerStyle: null,
|
|
743
|
+
headerClassName: null,
|
|
740
744
|
contentStyle: null,
|
|
741
745
|
contentClassName: null,
|
|
742
746
|
closeOnEscape: true,
|