UNPKG

primevue

Version:

PrimeVue is an open source UI library for Vue featuring a rich set of 80+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeBloc

2 lines (1 loc) 9.47 kB
"use strict";var t=require("primevue/base/style"),e=require("primevue/utils"),n=require("vue");function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var o=i(t);function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function r(t,e){return c(t)||d(t,e)||a(t,e)||u()}function u(){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 a(t,e){if(t){if("string"==typeof t)return v(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(t,e):void 0}}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function d(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,o,l,r,u=[],a=!0,v=!1;try{if(l=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;a=!1}else for(;!(a=(i=l.call(n)).done)&&(u.push(i.value),u.length!==e);a=!0);}catch(t){v=!0,o=t}finally{try{if(!a&&null!=n.return&&(r=n.return(),Object(r)!==r))return}finally{if(v)throw o}}return u}}function c(t){if(Array.isArray(t))return t}function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function f(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){g(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function g(t,e,n){var i;return(e="symbol"==l(i=p(e,"string"))?i:String(i))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function p(t,e){if("object"!=l(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=l(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var b={_getMeta:function(){return[e.ObjectUtils.isObject(arguments.length<=0?void 0:arguments[0])||arguments.length<=0?void 0:arguments[0],e.ObjectUtils.getItemValue(e.ObjectUtils.isObject(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:arguments.length<=1?void 0:arguments[1])]},_getConfig:function(t,e){var n,i,o;return null===(n=(null==t||null===(i=t.instance)||void 0===i?void 0:i.$primevue)||(null==e||null===(o=e.ctx)||void 0===o||null===(o=o.appContext)||void 0===o||null===(o=o.config)||void 0===o||null===(o=o.globalProperties)||void 0===o?void 0:o.$primevue))||void 0===n?void 0:n.config},_getOptionValue:function(t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=e.ObjectUtils.toFlatCase(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"").split("."),o=i.shift();return o?e.ObjectUtils.isObject(t)?b._getOptionValue(e.ObjectUtils.getItemValue(t[Object.keys(t).find((function(t){return e.ObjectUtils.toFlatCase(t)===o}))||""],n),i.join("."),n):void 0:e.ObjectUtils.getItemValue(t,n)},_getPTValue:function(){var t,i,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=function(){var t=b._getOptionValue.apply(b,arguments);return e.ObjectUtils.isString(t)||e.ObjectUtils.isArray(t)?{class:t}:t},v="data-pc-",d=(null===(t=o.binding)||void 0===t||null===(t=t.value)||void 0===t?void 0:t.ptOptions)||(null===(i=o.$config)||void 0===i?void 0:i.ptOptions)||{},c=d.mergeSections,s=void 0===c||c,p=d.mergeProps,y=void 0!==p&&p,h=!(arguments.length>4&&void 0!==arguments[4])||arguments[4]?b._useDefaultPT(o,o.defaultPT(),a,r,u):void 0,m=b._usePT(o,b._getPT(l,o.$name),a,r,f(f({},u),{},{global:h||{}})),O=f(f({},"root"===r&&g({},"".concat(v,"name"),e.ObjectUtils.toFlatCase(o.$name))),{},g({},"".concat(v,"section"),e.ObjectUtils.toFlatCase(r)));return s||!s&&m?y?n.mergeProps(h,m,O):f(f(f({},h),m),O):f(f({},m),O)},_getPT:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0,o=function(t){var o,l=i?i(t):t,r=e.ObjectUtils.toFlatCase(n);return null!==(o=null==l?void 0:l[r])&&void 0!==o?o:l};return null!=t&&t.hasOwnProperty("_usept")?{_usept:t._usept,originalValue:o(t.originalValue),value:o(t.value)}:o(t)},_usePT:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,o=arguments.length>2?arguments[2]:void 0,l=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0,u=function(t){return o(t,l,r)};if(null!=i&&i.hasOwnProperty("_usept")){var a,v=i._usept||(null===(a=t.$config)||void 0===a?void 0:a.ptOptions)||{},d=v.mergeSections,c=void 0===d||d,s=v.mergeProps,g=void 0!==s&&s,p=u(i.originalValue),b=u(i.value);if(void 0===p&&void 0===b)return;return e.ObjectUtils.isString(b)?b:e.ObjectUtils.isString(p)?p:c||!c&&b?g?n.mergeProps(p,b):f(f({},p),b):b}return u(i)},_useDefaultPT:function(){return b._usePT(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},arguments.length>2?arguments[2]:void 0,arguments.length>3?arguments[3]:void 0,arguments.length>4?arguments[4]:void 0)},_hook:function(t,n,i,o,l,r){var u,a,v="on".concat(e.ObjectUtils.toCapitalCase(n)),d=b._getConfig(o,l),c=null==i?void 0:i.$instance,s=b._usePT(c,b._getPT(null==o||null===(u=o.value)||void 0===u?void 0:u.pt,t),b._getOptionValue,"hooks.".concat(v)),f=b._useDefaultPT(c,null==d||null===(a=d.pt)||void 0===a||null===(a=a.directives)||void 0===a?void 0:a[t],b._getOptionValue,"hooks.".concat(v)),g={el:i,binding:o,vnode:l,prevVnode:r};null==s||s(c,g),null==f||f(c,g)},_extend:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=function(i,o,l,r,u){var a,v;o._$instances=o._$instances||{};var d=b._getConfig(l,r),c=o._$instances[t]||{},s=e.ObjectUtils.isEmpty(c)?f(f({},n),null==n?void 0:n.methods):{};o._$instances[t]=f(f({},c),{},{$name:t,$host:o,$binding:l,$modifiers:null==l?void 0:l.modifiers,$value:null==l?void 0:l.value,$el:c.$el||o||void 0,$style:f({classes:void 0,inlineStyles:void 0,loadStyle:function(){}},null==n?void 0:n.style),$config:d,defaultPT:function(){return b._getPT(null==d?void 0:d.pt,void 0,(function(e){var n;return null==e||null===(n=e.directives)||void 0===n?void 0:n[t]}))},isUnstyled:function(){var t,e;return void 0!==(null===(t=o.$instance)||void 0===t||null===(t=t.$binding)||void 0===t||null===(t=t.value)||void 0===t?void 0:t.unstyled)?null===(e=o.$instance)||void 0===e||null===(e=e.$binding)||void 0===e||null===(e=e.value)||void 0===e?void 0:e.unstyled:null==d?void 0:d.unstyled},ptm:function(){var t;return b._getPTValue(o.$instance,null===(t=o.$instance)||void 0===t||null===(t=t.$binding)||void 0===t||null===(t=t.value)||void 0===t?void 0:t.pt,arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",f({},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}))},ptmo:function(){return b._getPTValue(o.$instance,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},!1)},cx:function(){var t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null!==(t=o.$instance)&&void 0!==t&&t.isUnstyled()?void 0:b._getOptionValue(null===(e=o.$instance)||void 0===e||null===(e=e.$style)||void 0===e?void 0:e.classes,n,f({},i))},sx:function(){var t;return!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?b._getOptionValue(null===(t=o.$instance)||void 0===t||null===(t=t.$style)||void 0===t?void 0:t.inlineStyles,arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",f({},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})):void 0}},s),o.$instance=o._$instances[t],null===(a=(v=o.$instance)[i])||void 0===a||a.call(v,o,l,r,u),b._hook(t,i,o,l,r,u)};return{created:function(t,e,n,o){i("created",t,e,n,o)},beforeMount:function(t,e,n,l){var r,u,a,v,d=b._getConfig(e,n);o.default.loadStyle(void 0,{nonce:null==d||null===(r=d.csp)||void 0===r?void 0:r.nonce}),(null===(u=t.$instance)||void 0===u||!u.isUnstyled())&&(null===(a=t.$instance)||void 0===a||null===(a=a.$style)||void 0===a||a.loadStyle(void 0,{nonce:null==d||null===(v=d.csp)||void 0===v?void 0:v.nonce})),i("beforeMount",t,e,n,l)},mounted:function(t,e,n,o){i("mounted",t,e,n,o)},beforeUpdate:function(t,e,n,o){i("beforeUpdate",t,e,n,o)},updated:function(t,e,n,o){i("updated",t,e,n,o)},beforeUnmount:function(t,e,n,o){i("beforeUnmount",t,e,n,o)},unmounted:function(t,e,n,o){i("unmounted",t,e,n,o)}}},extend:function(){var t=r(b._getMeta.apply(b,arguments),2),e=t[1];return f({extend:function(){var t=r(b._getMeta.apply(b,arguments),2),n=t[1];return b.extend(t[0],f(f(f({},e),null==e?void 0:e.methods),n))}},b._extend(t[0],e))}};module.exports=b;