@pequity/squirrel 1.0.20-beta.2 → 1.0.20-beta.3

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.
Files changed (144) hide show
  1. package/dist/cjs/chunks/_plugin-vue_export-helper.js +9 -1
  2. package/dist/cjs/chunks/p-action-bar.js +60 -1
  3. package/dist/cjs/chunks/p-card.js +28 -1
  4. package/dist/cjs/chunks/p-checkbox.js +24 -1
  5. package/dist/cjs/chunks/p-dropdown-select.js +414 -1
  6. package/dist/cjs/chunks/p-input-percent.js +53 -1
  7. package/dist/cjs/chunks/p-pagination-info.js +66 -1
  8. package/dist/cjs/chunks/p-pagination.js +122 -1
  9. package/dist/cjs/chunks/p-ring-loader.js +81 -1
  10. package/dist/cjs/chunks/p-select-btn.js +97 -1
  11. package/dist/cjs/chunks/p-select.js +123 -1
  12. package/dist/cjs/chunks/p-table-loader.js +70 -1
  13. package/dist/cjs/chunks/p-tabs.js +52 -1
  14. package/dist/cjs/config.js +105 -1
  15. package/dist/cjs/currency.js +9 -1
  16. package/dist/cjs/dom.js +27 -1
  17. package/dist/cjs/index.js +976 -1
  18. package/dist/cjs/inputClassesMixin.js +50 -1
  19. package/dist/cjs/inputClassesShared.js +76 -1
  20. package/dist/cjs/listKeyboardNavigation.js +110 -1
  21. package/dist/cjs/number.js +9 -1
  22. package/dist/cjs/object.js +4 -1
  23. package/dist/cjs/p-action-bar.js +3 -1
  24. package/dist/cjs/p-alert.js +65 -1
  25. package/dist/cjs/p-avatar.js +71 -1
  26. package/dist/cjs/p-btn.js +358 -2
  27. package/dist/cjs/p-card.js +3 -1
  28. package/dist/cjs/p-checkbox.js +3 -1
  29. package/dist/cjs/p-chips.js +110 -1
  30. package/dist/cjs/p-close-btn.js +36 -1
  31. package/dist/cjs/p-date-picker.js +139 -1
  32. package/dist/cjs/p-drawer.js +253 -1
  33. package/dist/cjs/p-dropdown-select.js +3 -1
  34. package/dist/cjs/p-dropdown.js +138 -1
  35. package/dist/cjs/p-file-upload.js +21 -1
  36. package/dist/cjs/p-info-icon.js +35 -1
  37. package/dist/cjs/p-inline-date-picker.js +142 -1
  38. package/dist/cjs/p-input-number.js +146 -1
  39. package/dist/cjs/p-input-percent.js +3 -1
  40. package/dist/cjs/p-input-search.js +110 -1
  41. package/dist/cjs/p-input.js +89 -1
  42. package/dist/cjs/p-loading.js +38 -1
  43. package/dist/cjs/p-modal.js +369 -1
  44. package/dist/cjs/p-pagination-info.js +3 -1
  45. package/dist/cjs/p-pagination.js +3 -1
  46. package/dist/cjs/p-progress-bar.js +41 -1
  47. package/dist/cjs/p-ring-loader.js +3 -1
  48. package/dist/cjs/p-select-btn.js +3 -1
  49. package/dist/cjs/p-select-list.js +4 -1
  50. package/dist/cjs/p-select-pill.js +111 -1
  51. package/dist/cjs/p-select.js +3 -1
  52. package/dist/cjs/p-skeleton-loader.js +73 -1
  53. package/dist/cjs/p-table-filter-icon.js +20 -1
  54. package/dist/cjs/p-table-header-cell.js +75 -1
  55. package/dist/cjs/p-table-loader.js +3 -1
  56. package/dist/cjs/p-table-sort.js +8 -1
  57. package/dist/cjs/p-table-td.js +88 -1
  58. package/dist/cjs/p-table.js +12 -1
  59. package/dist/cjs/p-tabs.js +3 -1
  60. package/dist/cjs/p-textarea.js +73 -1
  61. package/dist/cjs/p-toggle.js +114 -1
  62. package/dist/cjs/pagination.js +29 -1
  63. package/dist/cjs/string.js +12 -1
  64. package/dist/cjs/tailwind.js +4353 -1
  65. package/dist/cjs/text.js +16 -1
  66. package/dist/cjs/useInputClasses.js +44 -1
  67. package/dist/cjs/usePLoading.js +35 -1
  68. package/dist/cjs/usePModal.js +21 -1
  69. package/dist/cjs/usePTableColResize.js +81 -1
  70. package/dist/cjs/usePTableRowVirtualizer.js +31 -1
  71. package/dist/cjs/useSelectList.js +256 -1
  72. package/dist/es/chunks/_plugin-vue_export-helper.js +7 -6
  73. package/dist/es/chunks/p-action-bar.js +45 -36
  74. package/dist/es/chunks/p-card.js +18 -14
  75. package/dist/es/chunks/p-checkbox.js +14 -11
  76. package/dist/es/chunks/p-dropdown-select.js +232 -183
  77. package/dist/es/chunks/p-input-percent.js +34 -25
  78. package/dist/es/chunks/p-pagination-info.js +30 -24
  79. package/dist/es/chunks/p-pagination.js +78 -48
  80. package/dist/es/chunks/p-ring-loader.js +63 -40
  81. package/dist/es/chunks/p-select-btn.js +80 -59
  82. package/dist/es/chunks/p-select.js +81 -54
  83. package/dist/es/chunks/p-table-loader.js +46 -32
  84. package/dist/es/chunks/p-tabs.js +35 -29
  85. package/dist/es/config.js +2 -2
  86. package/dist/es/currency.js +3 -3
  87. package/dist/es/dom.js +24 -12
  88. package/dist/es/index.js +703 -561
  89. package/dist/es/inputClassesMixin.js +20 -14
  90. package/dist/es/inputClassesShared.js +60 -45
  91. package/dist/es/listKeyboardNavigation.js +86 -36
  92. package/dist/es/number.js +7 -2
  93. package/dist/es/object.js +2 -2
  94. package/dist/es/p-action-bar.js +2 -2
  95. package/dist/es/p-alert.js +35 -30
  96. package/dist/es/p-avatar.js +30 -27
  97. package/dist/es/p-btn.js +209 -164
  98. package/dist/es/p-card.js +2 -2
  99. package/dist/es/p-checkbox.js +2 -2
  100. package/dist/es/p-chips.js +60 -40
  101. package/dist/es/p-close-btn.js +20 -16
  102. package/dist/es/p-date-picker.js +66 -58
  103. package/dist/es/p-drawer.js +108 -89
  104. package/dist/es/p-dropdown-select.js +2 -2
  105. package/dist/es/p-dropdown.js +52 -33
  106. package/dist/es/p-file-upload.js +17 -9
  107. package/dist/es/p-info-icon.js +21 -16
  108. package/dist/es/p-inline-date-picker.js +64 -53
  109. package/dist/es/p-input-number.js +84 -66
  110. package/dist/es/p-input-percent.js +2 -2
  111. package/dist/es/p-input-search.js +43 -41
  112. package/dist/es/p-input.js +51 -45
  113. package/dist/es/p-loading.js +31 -22
  114. package/dist/es/p-modal.js +261 -174
  115. package/dist/es/p-pagination-info.js +2 -2
  116. package/dist/es/p-pagination.js +2 -2
  117. package/dist/es/p-progress-bar.js +26 -23
  118. package/dist/es/p-ring-loader.js +2 -2
  119. package/dist/es/p-select-btn.js +2 -2
  120. package/dist/es/p-select-list.js +2 -2
  121. package/dist/es/p-select-pill.js +58 -41
  122. package/dist/es/p-select.js +2 -2
  123. package/dist/es/p-skeleton-loader.js +34 -29
  124. package/dist/es/p-table-filter-icon.js +11 -11
  125. package/dist/es/p-table-header-cell.js +38 -33
  126. package/dist/es/p-table-loader.js +2 -2
  127. package/dist/es/p-table-sort.js +2 -2
  128. package/dist/es/p-table-td.js +76 -29
  129. package/dist/es/p-table.js +10 -6
  130. package/dist/es/p-tabs.js +2 -2
  131. package/dist/es/p-textarea.js +36 -34
  132. package/dist/es/p-toggle.js +53 -48
  133. package/dist/es/pagination.js +25 -8
  134. package/dist/es/string.js +10 -2
  135. package/dist/es/tailwind.js +1660 -1101
  136. package/dist/es/text.js +13 -8
  137. package/dist/es/useInputClasses.js +38 -22
  138. package/dist/es/usePLoading.js +31 -15
  139. package/dist/es/usePModal.js +15 -12
  140. package/dist/es/usePTableColResize.js +71 -39
  141. package/dist/es/usePTableRowVirtualizer.js +24 -15
  142. package/dist/es/useSelectList.js +234 -121
  143. package/dist/style.css +2124 -1
  144. package/package.json +1 -1
package/dist/cjs/p-btn.js CHANGED
@@ -1,5 +1,361 @@
1
- "use strict";const N=require("./chunks/p-ring-loader.js"),k=require("./tailwind.js"),t=require("vue"),L=require("./chunks/_plugin-vue_export-helper.js");/*!
1
+ "use strict";
2
+ const pRingLoader_vue_vue_type_script_setup_true_lang = require("./chunks/p-ring-loader.js");
3
+ const tailwind = require("./tailwind.js");
4
+ const vue = require("vue");
5
+ const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
6
+ /*!
2
7
  * vue-router v4.3.0
3
8
  * (c) 2024 Eduardo San Martin Morote
4
9
  * @license MIT
5
- */const D=typeof document<"u",I=()=>{},d=Array.isArray;function m(e,r){return(e.aliasOf||e)===(r.aliasOf||r)}function T(e,r){if(Object.keys(e).length!==Object.keys(r).length)return!1;for(const n in e)if(!Y(e[n],r[n]))return!1;return!0}function Y(e,r){return d(e)?b(e,r):d(r)?b(r,e):e===r}function b(e,r){return d(r)?e.length===r.length&&e.every((n,a)=>n===r[a]):e.length===1&&e[0]===r}var E;(function(e){e.pop="pop",e.push="push"})(E||(E={}));var y;(function(e){e.back="back",e.forward="forward",e.unknown=""})(y||(y={}));Symbol(process.env.NODE_ENV!=="production"?"navigation failure":"");var h;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(h||(h={}));Symbol(process.env.NODE_ENV!=="production"?"router view location matched":"");Symbol(process.env.NODE_ENV!=="production"?"router view depth":"");const _=Symbol(process.env.NODE_ENV!=="production"?"router":""),P=Symbol(process.env.NODE_ENV!=="production"?"route location":"");Symbol(process.env.NODE_ENV!=="production"?"router view location":"");function S(e){const r=t.inject(_),n=t.inject(P),a=t.computed(()=>r.resolve(t.unref(e.to))),s=t.computed(()=>{const{matched:l}=a.value,{length:i}=l,f=l[i-1],p=n.matched;if(!f||!p.length)return-1;const v=p.findIndex(m.bind(null,f));if(v>-1)return v;const g=R(l[i-2]);return i>1&&R(f)===g&&p[p.length-1].path!==g?p.findIndex(m.bind(null,l[i-2])):v}),u=t.computed(()=>s.value>-1&&V(n.params,a.value.params)),c=t.computed(()=>s.value>-1&&s.value===n.matched.length-1&&T(n.params,a.value.params));function C(l={}){return x(l)?r[t.unref(e.replace)?"replace":"push"](t.unref(e.to)).catch(I):Promise.resolve()}if(process.env.NODE_ENV!=="production"&&D){const l=t.getCurrentInstance();if(l){const i={route:a.value,isActive:u.value,isExactActive:c.value};l.__vrl_devtools=l.__vrl_devtools||[],l.__vrl_devtools.push(i),t.watchEffect(()=>{i.route=a.value,i.isActive=u.value,i.isExactActive=c.value},{flush:"post"})}}return{route:a,href:t.computed(()=>a.value.href),isActive:u,isExactActive:c,navigate:C}}const B=t.defineComponent({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:S,setup(e,{slots:r}){const n=t.reactive(S(e)),{options:a}=t.inject(_),s=t.computed(()=>({[O(e.activeClass,a.linkActiveClass,"router-link-active")]:n.isActive,[O(e.exactActiveClass,a.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const u=r.default&&r.default(n);return e.custom?u:t.h("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},u)}}}),U=B;function x(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const r=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(r))return}return e.preventDefault&&e.preventDefault(),!0}}function V(e,r){for(const n in r){const a=r[n],s=e[n];if(typeof a=="string"){if(a!==s)return!1}else if(!d(s)||s.length!==a.length||a.some((u,c)=>u!==s[c]))return!1}return!0}function R(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const O=(e,r,n)=>e??r??n,o={PRIMARY:"primary",SECONDARY:"secondary",PRIMARY_OUTLINE:"primary-outline",SECONDARY_OUTLINE:"secondary-outline",SECONDARY_OUTLINE_BLUE:"secondary-outline-blue",ERROR:"error",SUCCESS:"success",PRIMARY_LINK:"primary-link",SECONDARY_GHOST:"secondary-ghost",SECONDARY_GHOST_DARK:"secondary-ghost-dark"},w=["button","submit","reset"],$="relative inline-block outline-none disabled:opacity-50 disabled:cursor-default disabled:pointer-events-none",K={[o.PRIMARY]:"text-surface bg-primary hover:bg-accent active:bg-p-blue-80",[o.SECONDARY]:"bg-p-gray-20 hover:bg-p-gray-30 active:bg-p-gray-40",[o.PRIMARY_OUTLINE]:"text-p-purple-60 bg-p-blue-10 border border-p-purple-60 hover:bg-p-gray-20 focus:ring-1 focus:ring-p-purple-60",[o.SECONDARY_OUTLINE]:"text-p-purple-60 bg-surface border border-p-gray-30 hover:bg-p-blue-10 aria-selected:bg-p-blue-10",[o.SECONDARY_OUTLINE_BLUE]:"text-p-purple-60 bg-surface border border-p-gray-30 hover:bg-p-blue-10 aria-selected:bg-p-blue-15 aria-selected:text-p-blue-60",[o.ERROR]:"text-white bg-p-red-40 hover:bg-p-red-50",[o.SUCCESS]:"text-white bg-p-green-40 hover:bg-p-green-50",[o.PRIMARY_LINK]:"text-primary bg-transparent hover:text-accent underline",[o.SECONDARY_GHOST]:"text-on-surface hover:bg-p-gray-20",[o.SECONDARY_GHOST_DARK]:"text-white hover:bg-p-purple-50"},A={sm:"py-1 px-2 rounded font-medium text-sm",md:"py-2 px-6 rounded font-medium text-base",lg:"py-3 px-6 rounded font-medium text-lg"},M={sm:24,md:30,lg:40},j={[o.PRIMARY]:"p-blue-15",[o.SECONDARY]:"p-purple-60",[o.PRIMARY_OUTLINE]:"p-blue-60",[o.SECONDARY_OUTLINE]:"p-purple-60",[o.SECONDARY_OUTLINE_BLUE]:"p-purple-60",[o.ERROR]:"p-blue-15",[o.SUCCESS]:"p-blue-15",[o.PRIMARY_LINK]:"p-blue-60",[o.SECONDARY_GHOST]:"p-purple-60",[o.SECONDARY_GHOST_DARK]:"p-blue-15"},z=t.defineComponent({name:"PBtn",components:{PRingLoader:N._sfc_main,RouterLink:U},inheritAttrs:!1,props:{type:{type:String,default:"primary",validator(e){return Object.values(o).includes(e)}},nativeType:{type:String,default:"button",validator(e){return w.includes(e)}},size:{type:String,default:"md",validator(e){return Object.keys(A).includes(e)}},loading:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},to:{type:[Object,String],default:""}},data(){return{loaderStyle:{position:"absolute"}}},computed:{classes(){return`${$} ${A[this.size]} ${K[this.type]}`},loaderSize(){return+`${M[this.size]}`},loaderColor(){const e=j[this.type];return k.getColorDeep(e)},isExternalLink(){return typeof this.to=="string"&&this.to.startsWith("http")}}}),H=["href"];function q(e,r,n,a,s,u){const c=t.resolveComponent("PRingLoader");return e.isExternalLink?(t.openBlock(),t.createElementBlock("a",t.mergeProps({key:0},e.$attrs,{href:e.to,target:"_blank",class:e.classes}),[t.renderSlot(e.$slots,"default")],16,H)):(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.to?"RouterLink":"button"),t.mergeProps({key:1,type:e.to?null:e.nativeType,to:e.to?e.to:null,"aria-selected":e.selected,class:e.classes},e.$attrs,{disabled:e.$attrs.disabled||e.loading}),{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass({invisible:e.loading})},[t.renderSlot(e.$slots,"default")],2),e.loading?(t.openBlock(),t.createBlock(c,{key:0,style:t.normalizeStyle(e.loaderStyle),color:e.loaderColor,size:e.loaderSize,class:"left-0 right-0 top-0 ml-auto mr-auto pt-1"},null,8,["style","color","size"])):t.createCommentVNode("",!0)]),_:3},16,["type","to","aria-selected","class","disabled"]))}const G=L._export_sfc(z,[["render",q]]);module.exports=G;
10
+ */
11
+ const isBrowser = typeof document !== "undefined";
12
+ const noop = () => {
13
+ };
14
+ const isArray = Array.isArray;
15
+ function isSameRouteRecord(a, b) {
16
+ return (a.aliasOf || a) === (b.aliasOf || b);
17
+ }
18
+ function isSameRouteLocationParams(a, b) {
19
+ if (Object.keys(a).length !== Object.keys(b).length)
20
+ return false;
21
+ for (const key in a) {
22
+ if (!isSameRouteLocationParamsValue(a[key], b[key]))
23
+ return false;
24
+ }
25
+ return true;
26
+ }
27
+ function isSameRouteLocationParamsValue(a, b) {
28
+ return isArray(a) ? isEquivalentArray(a, b) : isArray(b) ? isEquivalentArray(b, a) : a === b;
29
+ }
30
+ function isEquivalentArray(a, b) {
31
+ return isArray(b) ? a.length === b.length && a.every((value, i) => value === b[i]) : a.length === 1 && a[0] === b;
32
+ }
33
+ var NavigationType;
34
+ (function(NavigationType2) {
35
+ NavigationType2["pop"] = "pop";
36
+ NavigationType2["push"] = "push";
37
+ })(NavigationType || (NavigationType = {}));
38
+ var NavigationDirection;
39
+ (function(NavigationDirection2) {
40
+ NavigationDirection2["back"] = "back";
41
+ NavigationDirection2["forward"] = "forward";
42
+ NavigationDirection2["unknown"] = "";
43
+ })(NavigationDirection || (NavigationDirection = {}));
44
+ Symbol(process.env.NODE_ENV !== "production" ? "navigation failure" : "");
45
+ var NavigationFailureType;
46
+ (function(NavigationFailureType2) {
47
+ NavigationFailureType2[NavigationFailureType2["aborted"] = 4] = "aborted";
48
+ NavigationFailureType2[NavigationFailureType2["cancelled"] = 8] = "cancelled";
49
+ NavigationFailureType2[NavigationFailureType2["duplicated"] = 16] = "duplicated";
50
+ })(NavigationFailureType || (NavigationFailureType = {}));
51
+ Symbol(process.env.NODE_ENV !== "production" ? "router view location matched" : "");
52
+ Symbol(process.env.NODE_ENV !== "production" ? "router view depth" : "");
53
+ const routerKey = Symbol(process.env.NODE_ENV !== "production" ? "router" : "");
54
+ const routeLocationKey = Symbol(process.env.NODE_ENV !== "production" ? "route location" : "");
55
+ Symbol(process.env.NODE_ENV !== "production" ? "router view location" : "");
56
+ function useLink(props) {
57
+ const router = vue.inject(routerKey);
58
+ const currentRoute = vue.inject(routeLocationKey);
59
+ const route = vue.computed(() => router.resolve(vue.unref(props.to)));
60
+ const activeRecordIndex = vue.computed(() => {
61
+ const { matched } = route.value;
62
+ const { length } = matched;
63
+ const routeMatched = matched[length - 1];
64
+ const currentMatched = currentRoute.matched;
65
+ if (!routeMatched || !currentMatched.length)
66
+ return -1;
67
+ const index = currentMatched.findIndex(isSameRouteRecord.bind(null, routeMatched));
68
+ if (index > -1)
69
+ return index;
70
+ const parentRecordPath = getOriginalPath(matched[length - 2]);
71
+ return (
72
+ // we are dealing with nested routes
73
+ length > 1 && // if the parent and matched route have the same path, this link is
74
+ // referring to the empty child. Or we currently are on a different
75
+ // child of the same parent
76
+ getOriginalPath(routeMatched) === parentRecordPath && // avoid comparing the child with its parent
77
+ currentMatched[currentMatched.length - 1].path !== parentRecordPath ? currentMatched.findIndex(isSameRouteRecord.bind(null, matched[length - 2])) : index
78
+ );
79
+ });
80
+ const isActive = vue.computed(() => activeRecordIndex.value > -1 && includesParams(currentRoute.params, route.value.params));
81
+ const isExactActive = vue.computed(() => activeRecordIndex.value > -1 && activeRecordIndex.value === currentRoute.matched.length - 1 && isSameRouteLocationParams(currentRoute.params, route.value.params));
82
+ function navigate(e = {}) {
83
+ if (guardEvent(e)) {
84
+ return router[vue.unref(props.replace) ? "replace" : "push"](
85
+ vue.unref(props.to)
86
+ // avoid uncaught errors are they are logged anyway
87
+ ).catch(noop);
88
+ }
89
+ return Promise.resolve();
90
+ }
91
+ if ((process.env.NODE_ENV !== "production" || false) && isBrowser) {
92
+ const instance = vue.getCurrentInstance();
93
+ if (instance) {
94
+ const linkContextDevtools = {
95
+ route: route.value,
96
+ isActive: isActive.value,
97
+ isExactActive: isExactActive.value
98
+ };
99
+ instance.__vrl_devtools = instance.__vrl_devtools || [];
100
+ instance.__vrl_devtools.push(linkContextDevtools);
101
+ vue.watchEffect(() => {
102
+ linkContextDevtools.route = route.value;
103
+ linkContextDevtools.isActive = isActive.value;
104
+ linkContextDevtools.isExactActive = isExactActive.value;
105
+ }, { flush: "post" });
106
+ }
107
+ }
108
+ return {
109
+ route,
110
+ href: vue.computed(() => route.value.href),
111
+ isActive,
112
+ isExactActive,
113
+ navigate
114
+ };
115
+ }
116
+ const RouterLinkImpl = /* @__PURE__ */ vue.defineComponent({
117
+ name: "RouterLink",
118
+ compatConfig: { MODE: 3 },
119
+ props: {
120
+ to: {
121
+ type: [String, Object],
122
+ required: true
123
+ },
124
+ replace: Boolean,
125
+ activeClass: String,
126
+ // inactiveClass: String,
127
+ exactActiveClass: String,
128
+ custom: Boolean,
129
+ ariaCurrentValue: {
130
+ type: String,
131
+ default: "page"
132
+ }
133
+ },
134
+ useLink,
135
+ setup(props, { slots }) {
136
+ const link = vue.reactive(useLink(props));
137
+ const { options } = vue.inject(routerKey);
138
+ const elClass = vue.computed(() => ({
139
+ [getLinkClass(props.activeClass, options.linkActiveClass, "router-link-active")]: link.isActive,
140
+ // [getLinkClass(
141
+ // props.inactiveClass,
142
+ // options.linkInactiveClass,
143
+ // 'router-link-inactive'
144
+ // )]: !link.isExactActive,
145
+ [getLinkClass(props.exactActiveClass, options.linkExactActiveClass, "router-link-exact-active")]: link.isExactActive
146
+ }));
147
+ return () => {
148
+ const children = slots.default && slots.default(link);
149
+ return props.custom ? children : vue.h("a", {
150
+ "aria-current": link.isExactActive ? props.ariaCurrentValue : null,
151
+ href: link.href,
152
+ // this would override user added attrs but Vue will still add
153
+ // the listener, so we end up triggering both
154
+ onClick: link.navigate,
155
+ class: elClass.value
156
+ }, children);
157
+ };
158
+ }
159
+ });
160
+ const RouterLink = RouterLinkImpl;
161
+ function guardEvent(e) {
162
+ if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)
163
+ return;
164
+ if (e.defaultPrevented)
165
+ return;
166
+ if (e.button !== void 0 && e.button !== 0)
167
+ return;
168
+ if (e.currentTarget && e.currentTarget.getAttribute) {
169
+ const target = e.currentTarget.getAttribute("target");
170
+ if (/\b_blank\b/i.test(target))
171
+ return;
172
+ }
173
+ if (e.preventDefault)
174
+ e.preventDefault();
175
+ return true;
176
+ }
177
+ function includesParams(outer, inner) {
178
+ for (const key in inner) {
179
+ const innerValue = inner[key];
180
+ const outerValue = outer[key];
181
+ if (typeof innerValue === "string") {
182
+ if (innerValue !== outerValue)
183
+ return false;
184
+ } else {
185
+ if (!isArray(outerValue) || outerValue.length !== innerValue.length || innerValue.some((value, i) => value !== outerValue[i]))
186
+ return false;
187
+ }
188
+ }
189
+ return true;
190
+ }
191
+ function getOriginalPath(record) {
192
+ return record ? record.aliasOf ? record.aliasOf.path : record.path : "";
193
+ }
194
+ const getLinkClass = (propClass, globalClass, defaultClass) => propClass != null ? propClass : globalClass != null ? globalClass : defaultClass;
195
+ const BUTTON_TYPES = {
196
+ PRIMARY: "primary",
197
+ SECONDARY: "secondary",
198
+ PRIMARY_OUTLINE: "primary-outline",
199
+ SECONDARY_OUTLINE: "secondary-outline",
200
+ SECONDARY_OUTLINE_BLUE: "secondary-outline-blue",
201
+ ERROR: "error",
202
+ SUCCESS: "success",
203
+ PRIMARY_LINK: "primary-link",
204
+ SECONDARY_GHOST: "secondary-ghost",
205
+ SECONDARY_GHOST_DARK: "secondary-ghost-dark"
206
+ };
207
+ const BUTTON_NATIVE_TYPES = ["button", "submit", "reset"];
208
+ const DEFAULT_CLASSES = `relative inline-block outline-none disabled:opacity-50 disabled:cursor-default disabled:pointer-events-none`;
209
+ const BUTTON_CLASSES = {
210
+ [BUTTON_TYPES.PRIMARY]: "text-surface bg-primary hover:bg-accent active:bg-p-blue-80",
211
+ [BUTTON_TYPES.SECONDARY]: "bg-p-gray-20 hover:bg-p-gray-30 active:bg-p-gray-40",
212
+ [BUTTON_TYPES.PRIMARY_OUTLINE]: "text-p-purple-60 bg-p-blue-10 border border-p-purple-60 hover:bg-p-gray-20 focus:ring-1 focus:ring-p-purple-60",
213
+ [BUTTON_TYPES.SECONDARY_OUTLINE]: "text-p-purple-60 bg-surface border border-p-gray-30 hover:bg-p-blue-10 aria-selected:bg-p-blue-10",
214
+ [BUTTON_TYPES.SECONDARY_OUTLINE_BLUE]: "text-p-purple-60 bg-surface border border-p-gray-30 hover:bg-p-blue-10 aria-selected:bg-p-blue-15 aria-selected:text-p-blue-60",
215
+ [BUTTON_TYPES.ERROR]: "text-white bg-p-red-40 hover:bg-p-red-50",
216
+ [BUTTON_TYPES.SUCCESS]: "text-white bg-p-green-40 hover:bg-p-green-50",
217
+ [BUTTON_TYPES.PRIMARY_LINK]: "text-primary bg-transparent hover:text-accent underline",
218
+ [BUTTON_TYPES.SECONDARY_GHOST]: "text-on-surface hover:bg-p-gray-20",
219
+ [BUTTON_TYPES.SECONDARY_GHOST_DARK]: "text-white hover:bg-p-purple-50"
220
+ };
221
+ const BUTTON_SIZES = {
222
+ sm: "py-1 px-2 rounded font-medium text-sm",
223
+ md: "py-2 px-6 rounded font-medium text-base",
224
+ lg: "py-3 px-6 rounded font-medium text-lg"
225
+ };
226
+ const LOADER_SIZES = {
227
+ sm: 24,
228
+ md: 30,
229
+ lg: 40
230
+ };
231
+ const LOADER_COLORS = {
232
+ [BUTTON_TYPES.PRIMARY]: "p-blue-15",
233
+ [BUTTON_TYPES.SECONDARY]: "p-purple-60",
234
+ [BUTTON_TYPES.PRIMARY_OUTLINE]: "p-blue-60",
235
+ [BUTTON_TYPES.SECONDARY_OUTLINE]: "p-purple-60",
236
+ [BUTTON_TYPES.SECONDARY_OUTLINE_BLUE]: "p-purple-60",
237
+ [BUTTON_TYPES.ERROR]: "p-blue-15",
238
+ [BUTTON_TYPES.SUCCESS]: "p-blue-15",
239
+ [BUTTON_TYPES.PRIMARY_LINK]: "p-blue-60",
240
+ [BUTTON_TYPES.SECONDARY_GHOST]: "p-purple-60",
241
+ [BUTTON_TYPES.SECONDARY_GHOST_DARK]: "p-blue-15"
242
+ };
243
+ const _sfc_main = vue.defineComponent({
244
+ name: "PBtn",
245
+ components: {
246
+ PRingLoader: pRingLoader_vue_vue_type_script_setup_true_lang._sfc_main,
247
+ RouterLink
248
+ },
249
+ inheritAttrs: false,
250
+ props: {
251
+ /**
252
+ * The button style e.g primary, secondary, primary-outline, secondary-outline, error, success, primary-link
253
+ */
254
+ type: {
255
+ type: String,
256
+ default: "primary",
257
+ validator(value) {
258
+ return Object.values(BUTTON_TYPES).includes(value);
259
+ }
260
+ },
261
+ /**
262
+ * The button native type e.g button, submit, reset
263
+ */
264
+ nativeType: {
265
+ type: String,
266
+ default: "button",
267
+ validator(value) {
268
+ return BUTTON_NATIVE_TYPES.includes(value);
269
+ }
270
+ },
271
+ /**
272
+ * The button size e.g sm, md, lg
273
+ */
274
+ size: {
275
+ type: String,
276
+ default: "md",
277
+ validator(value) {
278
+ return Object.keys(BUTTON_SIZES).includes(value);
279
+ }
280
+ },
281
+ /**
282
+ * Whether the button is loading
283
+ */
284
+ loading: {
285
+ type: Boolean,
286
+ default: false
287
+ },
288
+ /**
289
+ * Whether the button is selected (sets aria-selected attribute)
290
+ */
291
+ selected: {
292
+ type: Boolean,
293
+ default: false
294
+ },
295
+ /**
296
+ * Exactly as the `to` prop in `RouterLink`, when used, it renders a link that triggers a navigation on click.
297
+ * See https://router.vuejs.org/api/#RouteLocationRaw
298
+ */
299
+ to: {
300
+ type: [Object, String],
301
+ default: ""
302
+ }
303
+ },
304
+ data() {
305
+ return {
306
+ loaderStyle: { position: "absolute" }
307
+ };
308
+ },
309
+ computed: {
310
+ classes() {
311
+ return `${DEFAULT_CLASSES} ${BUTTON_SIZES[this.size]} ${BUTTON_CLASSES[this.type]}`;
312
+ },
313
+ loaderSize() {
314
+ return Number(`${LOADER_SIZES[this.size]}`);
315
+ },
316
+ loaderColor() {
317
+ const type = LOADER_COLORS[this.type];
318
+ return tailwind.getColorDeep(type);
319
+ },
320
+ isExternalLink() {
321
+ return typeof this.to === "string" && this.to.startsWith("http");
322
+ }
323
+ }
324
+ });
325
+ const _hoisted_1 = ["href"];
326
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
327
+ const _component_PRingLoader = vue.resolveComponent("PRingLoader");
328
+ return _ctx.isExternalLink ? (vue.openBlock(), vue.createElementBlock("a", vue.mergeProps({ key: 0 }, _ctx.$attrs, {
329
+ href: _ctx.to,
330
+ target: "_blank",
331
+ class: _ctx.classes
332
+ }), [
333
+ vue.renderSlot(_ctx.$slots, "default")
334
+ ], 16, _hoisted_1)) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.to ? "RouterLink" : "button"), vue.mergeProps({
335
+ key: 1,
336
+ type: _ctx.to ? null : _ctx.nativeType,
337
+ to: _ctx.to ? _ctx.to : null,
338
+ "aria-selected": _ctx.selected,
339
+ class: _ctx.classes
340
+ }, _ctx.$attrs, {
341
+ disabled: _ctx.$attrs.disabled || _ctx.loading
342
+ }), {
343
+ default: vue.withCtx(() => [
344
+ vue.createElementVNode("div", {
345
+ class: vue.normalizeClass({ invisible: _ctx.loading })
346
+ }, [
347
+ vue.renderSlot(_ctx.$slots, "default")
348
+ ], 2),
349
+ _ctx.loading ? (vue.openBlock(), vue.createBlock(_component_PRingLoader, {
350
+ key: 0,
351
+ style: vue.normalizeStyle(_ctx.loaderStyle),
352
+ color: _ctx.loaderColor,
353
+ size: _ctx.loaderSize,
354
+ class: "left-0 right-0 top-0 ml-auto mr-auto pt-1"
355
+ }, null, 8, ["style", "color", "size"])) : vue.createCommentVNode("", true)
356
+ ]),
357
+ _: 3
358
+ }, 16, ["type", "to", "aria-selected", "class", "disabled"]));
359
+ }
360
+ const PBtn = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render]]);
361
+ module.exports = PBtn;
@@ -1 +1,3 @@
1
- "use strict";const e=require("./chunks/p-card.js");module.exports=e._sfc_main;
1
+ "use strict";
2
+ const pCard_vue_vue_type_script_setup_true_lang = require("./chunks/p-card.js");
3
+ module.exports = pCard_vue_vue_type_script_setup_true_lang._sfc_main;
@@ -1 +1,3 @@
1
- "use strict";const e=require("./chunks/p-checkbox.js");module.exports=e._sfc_main;
1
+ "use strict";
2
+ const pCheckbox_vue_vue_type_script_setup_true_lang = require("./chunks/p-checkbox.js");
3
+ module.exports = pCheckbox_vue_vue_type_script_setup_true_lang._sfc_main;
@@ -1 +1,110 @@
1
- "use strict";const t=require("vue"),h=require("lodash-es"),c=require("./chunks/_plugin-vue_export-helper.js"),a=t.defineComponent({name:"PChips",props:{items:{type:Array,default:()=>[],required:!0},itemText:{type:String,default:"text"}},emits:["click:chip","click:overflow"],data(){return{maxChipsDisplayed:1}},watch:{items(){this.resizeFilterChips()}},mounted(){this.resizeFilterChips(),this.$nextTick(()=>{window.addEventListener("resize",this.resizeFilterChips)})},beforeUnmount(){window.removeEventListener("resize",this.resizeFilterChips)},methods:{resizeFilterChips(){this.maxChipsDisplayed=this.items.length,this.$nextTick(()=>{if(!this.$refs.filterChipsRowInner)return;const e=this.$refs.filterChipsRow,r=this.$refs.filterChipsRowInner,d=this.$refs.afterSlotContainer,p=this.$refs.beforeSlotContainer,o=r.children;let n=0;const l=p.offsetWidth+d.offsetWidth+42;for(let s=0;s<o.length;s++)if(n+=o[s].offsetWidth,n+l>=e.offsetWidth){this.maxChipsDisplayed=s;break}})},getItemText(e){return typeof e=="string"?e:h.isObject(e)?e[this.itemText]:""}}}),f=e=>(t.pushScopeId("data-v-40bc335f"),e=e(),t.popScopeId(),e),m={ref:"filterChipsRow",class:"flex w-full items-center"},u={ref:"beforeSlotContainer"},C={ref:"filterChipsRowInner",class:"flex divide-x divide-p-blue-30 overflow-hidden rounded-md border border-p-blue-30 text-xs font-medium text-p-purple-60"},v=["onClick"],w={class:"inline-block truncate"},b=f(()=>t.createElementVNode("i",{class:"bg-cross ml-2 inline-block h-1.5 w-1.5"},null,-1)),k={ref:"afterSlotContainer"};function $(e,r,d,p,o,n){return t.openBlock(),t.createElementBlock("div",m,[t.createElementVNode("div",u,[t.renderSlot(e.$slots,"before",{},void 0,!0)],512),t.createElementVNode("div",C,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.items.slice(0,e.maxChipsDisplayed),(i,l)=>(t.openBlock(),t.createElementBlock("div",{key:`${e.getItemText(i)}_${l}`,class:"flex cursor-pointer items-center px-3 py-1 hover:bg-p-blue-20",onClick:s=>e.$emit("click:chip",i)},[t.createElementVNode("div",w,t.toDisplayString(e.getItemText(i)),1),b],8,v))),128)),t.withDirectives(t.createElementVNode("div",{class:"cursor-pointer px-3 py-1 hover:bg-p-blue-20",onClick:r[0]||(r[0]=i=>e.$emit("click:overflow"))}," +"+t.toDisplayString(e.items.length-e.maxChipsDisplayed),513),[[t.vShow,e.items.length>e.maxChipsDisplayed]])],512),t.createElementVNode("div",k,[t.renderSlot(e.$slots,"after",{},void 0,!0)],512)],512)}const E=c._export_sfc(a,[["render",$],["__scopeId","data-v-40bc335f"]]);module.exports=E;
1
+ "use strict";
2
+ const vue = require("vue");
3
+ const lodashEs = require("lodash-es");
4
+ const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
5
+ const _sfc_main = vue.defineComponent({
6
+ name: "PChips",
7
+ props: {
8
+ items: {
9
+ type: Array,
10
+ default: () => [],
11
+ required: true
12
+ },
13
+ itemText: {
14
+ type: String,
15
+ default: "text"
16
+ }
17
+ },
18
+ emits: ["click:chip", "click:overflow"],
19
+ data() {
20
+ return {
21
+ maxChipsDisplayed: 1
22
+ };
23
+ },
24
+ watch: {
25
+ items() {
26
+ this.resizeFilterChips();
27
+ }
28
+ },
29
+ mounted() {
30
+ this.resizeFilterChips();
31
+ this.$nextTick(() => {
32
+ window.addEventListener("resize", this.resizeFilterChips);
33
+ });
34
+ },
35
+ beforeUnmount() {
36
+ window.removeEventListener("resize", this.resizeFilterChips);
37
+ },
38
+ methods: {
39
+ resizeFilterChips() {
40
+ this.maxChipsDisplayed = this.items.length;
41
+ this.$nextTick(() => {
42
+ if (!this.$refs.filterChipsRowInner) {
43
+ return;
44
+ }
45
+ const filterChipsRowElement = this.$refs.filterChipsRow;
46
+ const filterChipsRowInnerElement = this.$refs.filterChipsRowInner;
47
+ const afterSlotContainerElement = this.$refs.afterSlotContainer;
48
+ const beforeSlotContainerElement = this.$refs.beforeSlotContainer;
49
+ const chips = filterChipsRowInnerElement.children;
50
+ let totalInnerWidth = 0;
51
+ const overflowChipWidth = 42;
52
+ const totalExtraWidth = beforeSlotContainerElement.offsetWidth + afterSlotContainerElement.offsetWidth + overflowChipWidth;
53
+ for (let i = 0; i < chips.length; i++) {
54
+ totalInnerWidth += chips[i].offsetWidth;
55
+ if (totalInnerWidth + totalExtraWidth >= filterChipsRowElement.offsetWidth) {
56
+ this.maxChipsDisplayed = i;
57
+ break;
58
+ }
59
+ }
60
+ });
61
+ },
62
+ getItemText(item) {
63
+ return typeof item === "string" ? item : lodashEs.isObject(item) ? item[this.itemText] : "";
64
+ }
65
+ }
66
+ });
67
+ const _withScopeId = (n) => (vue.pushScopeId("data-v-40bc335f"), n = n(), vue.popScopeId(), n);
68
+ const _hoisted_1 = {
69
+ ref: "filterChipsRow",
70
+ class: "flex w-full items-center"
71
+ };
72
+ const _hoisted_2 = { ref: "beforeSlotContainer" };
73
+ const _hoisted_3 = {
74
+ ref: "filterChipsRowInner",
75
+ class: "flex divide-x divide-p-blue-30 overflow-hidden rounded-md border border-p-blue-30 text-xs font-medium text-p-purple-60"
76
+ };
77
+ const _hoisted_4 = ["onClick"];
78
+ const _hoisted_5 = { class: "inline-block truncate" };
79
+ const _hoisted_6 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "bg-cross ml-2 inline-block h-1.5 w-1.5" }, null, -1));
80
+ const _hoisted_7 = { ref: "afterSlotContainer" };
81
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
82
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
83
+ vue.createElementVNode("div", _hoisted_2, [
84
+ vue.renderSlot(_ctx.$slots, "before", {}, void 0, true)
85
+ ], 512),
86
+ vue.createElementVNode("div", _hoisted_3, [
87
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.items.slice(0, _ctx.maxChipsDisplayed), (item, idx) => {
88
+ return vue.openBlock(), vue.createElementBlock("div", {
89
+ key: `${_ctx.getItemText(item)}_${idx}`,
90
+ class: "flex cursor-pointer items-center px-3 py-1 hover:bg-p-blue-20",
91
+ onClick: ($event) => _ctx.$emit("click:chip", item)
92
+ }, [
93
+ vue.createElementVNode("div", _hoisted_5, vue.toDisplayString(_ctx.getItemText(item)), 1),
94
+ _hoisted_6
95
+ ], 8, _hoisted_4);
96
+ }), 128)),
97
+ vue.withDirectives(vue.createElementVNode("div", {
98
+ class: "cursor-pointer px-3 py-1 hover:bg-p-blue-20",
99
+ onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click:overflow"))
100
+ }, " +" + vue.toDisplayString(_ctx.items.length - _ctx.maxChipsDisplayed), 513), [
101
+ [vue.vShow, _ctx.items.length > _ctx.maxChipsDisplayed]
102
+ ])
103
+ ], 512),
104
+ vue.createElementVNode("div", _hoisted_7, [
105
+ vue.renderSlot(_ctx.$slots, "after", {}, void 0, true)
106
+ ], 512)
107
+ ], 512);
108
+ }
109
+ const pChips = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-40bc335f"]]);
110
+ module.exports = pChips;
@@ -1 +1,36 @@
1
- "use strict";const e=require("vue"),a=require("./chunks/_plugin-vue_export-helper.js"),s=e.defineComponent({__name:"p-close-btn",props:{variant:{type:String,default:"transparent"}},setup(t){const n={transparent:["bg-transparent","hover:bg-p-gray-20"],gray:["bg-p-gray-10","hover:bg-p-gray-20"],dark:["bg-transparent"]},r={transparent:"x-black-icon",gray:"x-black-icon",dark:"x-white-icon"};return(c,i)=>(e.openBlock(),e.createElementBlock("button",{type:"button",class:e.normalizeClass(["inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded focus:outline-none disabled:cursor-default disabled:opacity-30 disabled:hover:bg-white",n[t.variant]])},[e.createElementVNode("i",{class:e.normalizeClass(["block h-3 w-3 bg-center bg-no-repeat",r[t.variant]])},null,2)],2))}}),o=a._export_sfc(s,[["__scopeId","data-v-f61993bb"]]);module.exports=o;
1
+ "use strict";
2
+ const vue = require("vue");
3
+ const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
4
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
5
+ __name: "p-close-btn",
6
+ props: {
7
+ variant: {
8
+ type: String,
9
+ default: "transparent"
10
+ }
11
+ },
12
+ setup(__props) {
13
+ const variantClasses = {
14
+ transparent: ["bg-transparent", "hover:bg-p-gray-20"],
15
+ gray: ["bg-p-gray-10", "hover:bg-p-gray-20"],
16
+ dark: ["bg-transparent"]
17
+ };
18
+ const iconClass = {
19
+ transparent: "x-black-icon",
20
+ gray: "x-black-icon",
21
+ dark: "x-white-icon"
22
+ };
23
+ return (_ctx, _cache) => {
24
+ return vue.openBlock(), vue.createElementBlock("button", {
25
+ type: "button",
26
+ class: vue.normalizeClass(["inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded focus:outline-none disabled:cursor-default disabled:opacity-30 disabled:hover:bg-white", variantClasses[__props.variant]])
27
+ }, [
28
+ vue.createElementVNode("i", {
29
+ class: vue.normalizeClass(["block h-3 w-3 bg-center bg-no-repeat", iconClass[__props.variant]])
30
+ }, null, 2)
31
+ ], 2);
32
+ };
33
+ }
34
+ });
35
+ const PCloseBtn = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-f61993bb"]]);
36
+ module.exports = PCloseBtn;