@pequity/squirrel 4.0.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/cjs/chunks/p-link.js +37 -0
  2. package/dist/cjs/index.js +4 -0
  3. package/dist/cjs/link.js +25 -0
  4. package/dist/cjs/p-btn.js +8 -5
  5. package/dist/cjs/p-info-icon.js +6 -3
  6. package/dist/cjs/p-link.js +3 -0
  7. package/dist/cjs/p-modal.js +5 -5
  8. package/dist/cjs/sanitization.js +13 -0
  9. package/dist/es/chunks/p-link.js +38 -0
  10. package/dist/es/index.js +18 -14
  11. package/dist/es/link.js +25 -0
  12. package/dist/es/p-btn.js +8 -5
  13. package/dist/es/p-info-icon.js +6 -3
  14. package/dist/es/p-link.js +4 -0
  15. package/dist/es/p-modal.js +5 -5
  16. package/dist/es/sanitization.js +13 -0
  17. package/dist/squirrel/components/index.d.ts +2 -1
  18. package/dist/squirrel/components/p-btn/p-btn.vue.d.ts +4 -2
  19. package/dist/squirrel/components/p-link/p-link.vue.d.ts +22 -0
  20. package/dist/squirrel/components/p-table/usePTableRowVirtualizer.d.ts +1 -1
  21. package/dist/squirrel/utils/index.d.ts +2 -1
  22. package/dist/squirrel/utils/link.d.ts +1 -0
  23. package/dist/squirrel/utils/sanitization.d.ts +10 -0
  24. package/dist/style.css +15 -15
  25. package/package.json +6 -6
  26. package/squirrel/components/index.ts +2 -0
  27. package/squirrel/components/p-btn/p-btn.spec.js +29 -1
  28. package/squirrel/components/p-btn/p-btn.vue +13 -4
  29. package/squirrel/components/p-close-btn/p-close-btn.spec.js +60 -0
  30. package/squirrel/components/p-info-icon/p-info-icon.spec.js +21 -0
  31. package/squirrel/components/p-info-icon/p-info-icon.stories.js +32 -0
  32. package/squirrel/components/p-info-icon/p-info-icon.vue +1 -1
  33. package/squirrel/components/p-link/p-link.spec.js +62 -0
  34. package/squirrel/components/p-link/p-link.stories.js +38 -0
  35. package/squirrel/components/p-link/p-link.vue +20 -0
  36. package/squirrel/components/p-modal/p-modal-features.spec.js +23 -1
  37. package/squirrel/components/p-modal/p-modal.vue +6 -1
  38. package/squirrel/components/p-table-header-cell/p-table-header-cell.stories.js +2 -2
  39. package/squirrel/utils/index.ts +2 -0
  40. package/squirrel/utils/link.spec.js +24 -0
  41. package/squirrel/utils/link.ts +36 -0
  42. package/squirrel/utils/sanitization.spec.js +57 -0
  43. package/squirrel/utils/sanitization.ts +55 -0
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ const vue = require("vue");
3
+ const vueRouter = require("vue-router");
4
+ const link = require("../link.js");
5
+ const sanitization = require("../sanitization.js");
6
+ const _hoisted_1 = ["href"];
7
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
8
+ ...{
9
+ name: "PLink"
10
+ },
11
+ __name: "p-link",
12
+ props: {
13
+ custom: { type: Boolean },
14
+ activeClass: {},
15
+ exactActiveClass: {},
16
+ ariaCurrentValue: {},
17
+ to: {},
18
+ replace: { type: Boolean }
19
+ },
20
+ setup(__props) {
21
+ return (_ctx, _cache) => {
22
+ return typeof _ctx.to === "string" && vue.unref(link.isExternalLink)(_ctx.to) ? (vue.openBlock(), vue.createElementBlock("a", {
23
+ key: 0,
24
+ href: vue.unref(sanitization.sanitizeUrl)(_ctx.to),
25
+ target: "_blank"
26
+ }, [
27
+ vue.renderSlot(_ctx.$slots, "default")
28
+ ], 8, _hoisted_1)) : (vue.openBlock(), vue.createBlock(vue.unref(vueRouter.RouterLink), vue.normalizeProps(vue.mergeProps({ key: 1 }, _ctx.$props)), {
29
+ default: vue.withCtx(() => [
30
+ vue.renderSlot(_ctx.$slots, "default")
31
+ ]),
32
+ _: 3
33
+ }, 16));
34
+ };
35
+ }
36
+ });
37
+ exports._sfc_main = _sfc_main;
package/dist/cjs/index.js CHANGED
@@ -25,6 +25,7 @@ const pInput = require("./p-input.js");
25
25
  const pInputNumber = require("./p-input-number.js");
26
26
  const pInputPercent_vue_vue_type_script_setup_true_lang = require("./chunks/p-input-percent.js");
27
27
  const pInputSearch = require("./p-input-search.js");
28
+ const pLink_vue_vue_type_script_setup_true_lang = require("./chunks/p-link.js");
28
29
  const pLoading = require("./p-loading.js");
29
30
  const pModal = require("./p-modal.js");
30
31
  const pPagination_vue_vue_type_script_setup_true_lang = require("./chunks/p-pagination.js");
@@ -58,6 +59,7 @@ const inputClassesShared = require("./inputClassesShared.js");
58
59
  const pagination = require("./pagination.js");
59
60
  const dom = require("./dom.js");
60
61
  const object = require("./object.js");
62
+ const sanitization = require("./sanitization.js");
61
63
  const listKeyboardNavigation = require("./listKeyboardNavigation.js");
62
64
  const number = require("./number.js");
63
65
  const _hoisted_1$4 = { class: "flex h-12 w-max select-none items-center rounded-lg bg-p-purple-60 px-2 text-sm font-medium text-white" };
@@ -1060,6 +1062,7 @@ exports.PInput = pInput;
1060
1062
  exports.PInputNumber = pInputNumber;
1061
1063
  exports.PInputPercent = pInputPercent_vue_vue_type_script_setup_true_lang._sfc_main;
1062
1064
  exports.PInputSearch = pInputSearch;
1065
+ exports.PLink = pLink_vue_vue_type_script_setup_true_lang._sfc_main;
1063
1066
  exports.PLoading = pLoading;
1064
1067
  exports.PModal = pModal;
1065
1068
  exports.PPagination = pPagination_vue_vue_type_script_setup_true_lang._sfc_main;
@@ -1115,6 +1118,7 @@ exports.getNextActiveElement = dom.getNextActiveElement;
1115
1118
  exports.isElement = dom.isElement;
1116
1119
  exports.isVisible = dom.isVisible;
1117
1120
  exports.isObject = object.isObject;
1121
+ exports.sanitizeUrl = sanitization.sanitizeUrl;
1118
1122
  exports.setupListKeyboardNavigation = listKeyboardNavigation.setupListKeyboardNavigation;
1119
1123
  exports.toNumberOrNull = number.toNumberOrNull;
1120
1124
  exports.PActionBar = _sfc_main$4;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const normalizeUrl = (url) => {
4
+ if (url.indexOf("//") === 0) {
5
+ url = location.protocol + url;
6
+ }
7
+ return url;
8
+ };
9
+ const isValidUrl = (url) => {
10
+ url = normalizeUrl(url);
11
+ try {
12
+ return Boolean(new URL(url));
13
+ } catch (e) {
14
+ return false;
15
+ }
16
+ };
17
+ const checkDomain = function(url) {
18
+ url = normalizeUrl(url);
19
+ return url.toLowerCase().replace(/([a-z])?:\/\//, "$1").split("/")[0];
20
+ };
21
+ const isExternalLink = function(url) {
22
+ url = String(url);
23
+ return isValidUrl(url) && (url.indexOf(":") > -1 || url.indexOf("//") > -1) && checkDomain(location.href) !== checkDomain(url);
24
+ };
25
+ exports.isExternalLink = isExternalLink;
package/dist/cjs/p-btn.js CHANGED
@@ -3,6 +3,8 @@ const pRingLoader_vue_vue_type_script_setup_true_lang = require("./chunks/p-ring
3
3
  const tailwind = require("./tailwind.js");
4
4
  const vue = require("vue");
5
5
  const vueRouter = require("vue-router");
6
+ const link = require("./link.js");
7
+ const sanitization = require("./sanitization.js");
6
8
  const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
7
9
  const BUTTON_TYPES = {
8
10
  PRIMARY: "primary",
@@ -128,17 +130,18 @@ const _sfc_main = vue.defineComponent({
128
130
  loaderColor() {
129
131
  const type = LOADER_COLORS[this.type];
130
132
  return tailwind.getColorDeep(type);
131
- },
132
- isExternalLink() {
133
- return typeof this.to === "string" && this.to.startsWith("http");
134
133
  }
134
+ },
135
+ methods: {
136
+ isExternalLink: link.isExternalLink,
137
+ sanitizeUrl: sanitization.sanitizeUrl
135
138
  }
136
139
  });
137
140
  const _hoisted_1 = ["href"];
138
141
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
139
142
  const _component_PRingLoader = vue.resolveComponent("PRingLoader");
140
- return _ctx.isExternalLink ? (vue.openBlock(), vue.createElementBlock("a", vue.mergeProps({ key: 0 }, _ctx.$attrs, {
141
- href: _ctx.to,
143
+ return typeof _ctx.to === "string" && _ctx.isExternalLink(_ctx.to) ? (vue.openBlock(), vue.createElementBlock("a", vue.mergeProps({ key: 0 }, _ctx.$attrs, {
144
+ href: _ctx.sanitizeUrl(_ctx.to),
142
145
  target: "_blank",
143
146
  class: _ctx.classes
144
147
  }), [
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const vue = require("vue");
3
3
  const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
4
- const _withScopeId = (n) => (vue.pushScopeId("data-v-189b159e"), n = n(), vue.popScopeId(), n);
4
+ const _withScopeId = (n) => (vue.pushScopeId("data-v-2662da21"), n = n(), vue.popScopeId(), n);
5
5
  const _hoisted_1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "bg-info-circle-icon block h-3 w-3" }, null, -1));
6
6
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
7
7
  ...{
@@ -17,7 +17,10 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
17
17
  setup(__props) {
18
18
  return (_ctx, _cache) => {
19
19
  const _component_VTooltip = vue.resolveComponent("VTooltip");
20
- return vue.openBlock(), vue.createBlock(_component_VTooltip, null, {
20
+ return vue.openBlock(), vue.createBlock(_component_VTooltip, {
21
+ "popper-triggers": ["hover"],
22
+ delay: { show: 750, hide: 0 }
23
+ }, {
21
24
  popper: vue.withCtx(() => [
22
25
  vue.renderSlot(_ctx.$slots, "default", {}, () => [
23
26
  vue.createTextVNode(vue.toDisplayString(__props.text), 1)
@@ -31,5 +34,5 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
31
34
  };
32
35
  }
33
36
  });
34
- const PInfoIcon = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-189b159e"]]);
37
+ const PInfoIcon = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-2662da21"]]);
35
38
  module.exports = PInfoIcon;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ const pLink_vue_vue_type_script_setup_true_lang = require("./chunks/p-link.js");
3
+ module.exports = pLink_vue_vue_type_script_setup_true_lang._sfc_main;
@@ -111,7 +111,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
111
111
  ],
112
112
  setup(__props, { emit: __emit }) {
113
113
  vue.useCssVars((_ctx) => ({
114
- "8a536574": __props.maxWidth
114
+ "4d751ed2": __props.maxWidth
115
115
  }));
116
116
  let animatingZIndex = 0;
117
117
  const emit = __emit;
@@ -321,12 +321,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
321
321
  class: "mr-auto pt-4 text-xl font-semibold"
322
322
  }, vue.toDisplayString(__props.title), 9, _hoisted_5)) : vue.createCommentVNode("", true),
323
323
  vue.createElementVNode("div", _hoisted_6, [
324
- __props.enableClose ? (vue.openBlock(), vue.createBlock(pCloseBtn, {
325
- key: 0,
324
+ vue.createVNode(pCloseBtn, {
326
325
  disabled: __props.disabled,
326
+ class: vue.normalizeClass({ invisible: !__props.enableClose }),
327
327
  "aria-label": __props.closeLabel,
328
328
  onClick: vue.withModifiers(close, ["prevent"])
329
- }, null, 8, ["disabled", "aria-label"])) : vue.createCommentVNode("", true)
329
+ }, null, 8, ["disabled", "class", "aria-label"])
330
330
  ])
331
331
  ])
332
332
  ], true),
@@ -365,5 +365,5 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
365
365
  };
366
366
  }
367
367
  });
368
- const pModal = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-ee599a02"]]);
368
+ const pModal = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-fb5dbd9f"]]);
369
369
  module.exports = pModal;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const XSS_SECURITY_URL = "https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html";
4
+ const SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;
5
+ const sanitizeUrl = (url) => {
6
+ url = String(url);
7
+ if (url.match(SAFE_URL_PATTERN)) {
8
+ return url;
9
+ }
10
+ console.warn(`WARNING: sanitizing unsafe URL value ${url} (see ${XSS_SECURITY_URL})`);
11
+ return "unsafe:" + url;
12
+ };
13
+ exports.sanitizeUrl = sanitizeUrl;
@@ -0,0 +1,38 @@
1
+ import { defineComponent, unref, openBlock, createElementBlock, renderSlot, createBlock, normalizeProps, mergeProps, withCtx } from "vue";
2
+ import { RouterLink } from "vue-router";
3
+ import { isExternalLink } from "../link.js";
4
+ import { sanitizeUrl } from "../sanitization.js";
5
+ const _hoisted_1 = ["href"];
6
+ const _sfc_main = /* @__PURE__ */ defineComponent({
7
+ ...{
8
+ name: "PLink"
9
+ },
10
+ __name: "p-link",
11
+ props: {
12
+ custom: { type: Boolean },
13
+ activeClass: {},
14
+ exactActiveClass: {},
15
+ ariaCurrentValue: {},
16
+ to: {},
17
+ replace: { type: Boolean }
18
+ },
19
+ setup(__props) {
20
+ return (_ctx, _cache) => {
21
+ return typeof _ctx.to === "string" && unref(isExternalLink)(_ctx.to) ? (openBlock(), createElementBlock("a", {
22
+ key: 0,
23
+ href: unref(sanitizeUrl)(_ctx.to),
24
+ target: "_blank"
25
+ }, [
26
+ renderSlot(_ctx.$slots, "default")
27
+ ], 8, _hoisted_1)) : (openBlock(), createBlock(unref(RouterLink), normalizeProps(mergeProps({ key: 1 }, _ctx.$props)), {
28
+ default: withCtx(() => [
29
+ renderSlot(_ctx.$slots, "default")
30
+ ]),
31
+ _: 3
32
+ }, 16));
33
+ };
34
+ }
35
+ });
36
+ export {
37
+ _sfc_main as _
38
+ };
package/dist/es/index.js CHANGED
@@ -24,14 +24,15 @@ import { default as default11 } from "./p-input.js";
24
24
  import { default as default12 } from "./p-input-number.js";
25
25
  import { _ as _3 } from "./chunks/p-input-percent.js";
26
26
  import PInputSearch from "./p-input-search.js";
27
+ import { _ as _4 } from "./chunks/p-link.js";
27
28
  import { default as default13 } from "./p-loading.js";
28
29
  import { default as default14 } from "./p-modal.js";
29
- import { _ as _4 } from "./chunks/p-pagination.js";
30
- import { _ as _5 } from "./chunks/p-pagination-info.js";
30
+ import { _ as _5 } from "./chunks/p-pagination.js";
31
+ import { _ as _6 } from "./chunks/p-pagination-info.js";
31
32
  import { default as default15 } from "./p-progress-bar.js";
32
- import { _ as _6 } from "./chunks/p-ring-loader.js";
33
- import { _ as _7 } from "./chunks/p-select.js";
34
- import { _ as _8 } from "./chunks/p-select-btn.js";
33
+ import { _ as _7 } from "./chunks/p-ring-loader.js";
34
+ import { _ as _8 } from "./chunks/p-select.js";
35
+ import { _ as _9 } from "./chunks/p-select-btn.js";
35
36
  import { SIZES } from "./p-select-list.js";
36
37
  import { splitStringForHighlight } from "./text.js";
37
38
  import { toString } from "./string.js";
@@ -42,10 +43,10 @@ import PTableHeaderCell from "./p-table-header-cell.js";
42
43
  import { colsInjectionKey, isFirstColFixedInjectionKey, isLastColFixedInjectionKey, isColsResizableInjectionKey } from "./p-table.js";
43
44
  import { MIN_WIDTH_COL_RESIZE } from "./p-table.js";
44
45
  import { usePTableColResize } from "./usePTableColResize.js";
45
- import { _ as _9 } from "./chunks/p-table-loader.js";
46
+ import { _ as _10 } from "./chunks/p-table-loader.js";
46
47
  import { SORTING_TYPES } from "./p-table-sort.js";
47
48
  import { default as default18 } from "./p-table-td.js";
48
- import { _ as _10 } from "./chunks/p-tabs.js";
49
+ import { _ as _11 } from "./chunks/p-tabs.js";
49
50
  import { default as default19 } from "./p-textarea.js";
50
51
  import { default as default20 } from "./p-toggle.js";
51
52
  import { usePLoading } from "./usePLoading.js";
@@ -58,6 +59,7 @@ import { ERROR_MSG, INPUT_BASE, INPUT_ERROR, INPUT_NORMAL, INPUT_SIZES, LABEL_BA
58
59
  import { createPagingRange } from "./pagination.js";
59
60
  import { getNextActiveElement, isElement, isVisible } from "./dom.js";
60
61
  import { isObject } from "./object.js";
62
+ import { sanitizeUrl } from "./sanitization.js";
61
63
  import { setupListKeyboardNavigation } from "./listKeyboardNavigation.js";
62
64
  import { toNumberOrNull } from "./number.js";
63
65
  const _hoisted_1$4 = { class: "flex h-12 w-max select-none items-center rounded-lg bg-p-purple-60 px-2 text-sm font-medium text-white" };
@@ -1071,23 +1073,24 @@ export {
1071
1073
  default12 as PInputNumber,
1072
1074
  _3 as PInputPercent,
1073
1075
  PInputSearch,
1076
+ _4 as PLink,
1074
1077
  default13 as PLoading,
1075
1078
  default14 as PModal,
1076
- _4 as PPagination,
1077
- _5 as PPaginationInfo,
1079
+ _5 as PPagination,
1080
+ _6 as PPaginationInfo,
1078
1081
  default15 as PProgressBar,
1079
- _6 as PRingLoader,
1080
- _7 as PSelect,
1081
- _8 as PSelectBtn,
1082
+ _7 as PRingLoader,
1083
+ _8 as PSelect,
1084
+ _9 as PSelectBtn,
1082
1085
  _sfc_main$2 as PSelectList,
1083
1086
  default16 as PSelectPill,
1084
1087
  default17 as PSkeletonLoader,
1085
1088
  pTable as PTable,
1086
1089
  PTableHeaderCell,
1087
- _9 as PTableLoader,
1090
+ _10 as PTableLoader,
1088
1091
  pTableSort as PTableSort,
1089
1092
  default18 as PTableTd,
1090
- _10 as PTabs,
1093
+ _11 as PTabs,
1091
1094
  default19 as PTextarea,
1092
1095
  default20 as PToggle,
1093
1096
  SELECT_ARROW,
@@ -1113,6 +1116,7 @@ export {
1113
1116
  isLastColFixedInjectionKey,
1114
1117
  isObject,
1115
1118
  isVisible,
1119
+ sanitizeUrl,
1116
1120
  setupListKeyboardNavigation,
1117
1121
  splitStringForHighlight,
1118
1122
  toNumberOrNull,
@@ -0,0 +1,25 @@
1
+ const normalizeUrl = (url) => {
2
+ if (url.indexOf("//") === 0) {
3
+ url = location.protocol + url;
4
+ }
5
+ return url;
6
+ };
7
+ const isValidUrl = (url) => {
8
+ url = normalizeUrl(url);
9
+ try {
10
+ return Boolean(new URL(url));
11
+ } catch (e) {
12
+ return false;
13
+ }
14
+ };
15
+ const checkDomain = function(url) {
16
+ url = normalizeUrl(url);
17
+ return url.toLowerCase().replace(/([a-z])?:\/\//, "$1").split("/")[0];
18
+ };
19
+ const isExternalLink = function(url) {
20
+ url = String(url);
21
+ return isValidUrl(url) && (url.indexOf(":") > -1 || url.indexOf("//") > -1) && checkDomain(location.href) !== checkDomain(url);
22
+ };
23
+ export {
24
+ isExternalLink
25
+ };
package/dist/es/p-btn.js CHANGED
@@ -2,6 +2,8 @@ import { _ as _sfc_main$1 } from "./chunks/p-ring-loader.js";
2
2
  import { getColorDeep } from "./tailwind.js";
3
3
  import { defineComponent, resolveComponent, openBlock, createElementBlock, mergeProps, renderSlot, createBlock, resolveDynamicComponent, withCtx, createElementVNode, normalizeClass, normalizeStyle, createCommentVNode } from "vue";
4
4
  import { RouterLink } from "vue-router";
5
+ import { isExternalLink } from "./link.js";
6
+ import { sanitizeUrl } from "./sanitization.js";
5
7
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
6
8
  const BUTTON_TYPES = {
7
9
  PRIMARY: "primary",
@@ -127,17 +129,18 @@ const _sfc_main = defineComponent({
127
129
  loaderColor() {
128
130
  const type = LOADER_COLORS[this.type];
129
131
  return getColorDeep(type);
130
- },
131
- isExternalLink() {
132
- return typeof this.to === "string" && this.to.startsWith("http");
133
132
  }
133
+ },
134
+ methods: {
135
+ isExternalLink,
136
+ sanitizeUrl
134
137
  }
135
138
  });
136
139
  const _hoisted_1 = ["href"];
137
140
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
138
141
  const _component_PRingLoader = resolveComponent("PRingLoader");
139
- return _ctx.isExternalLink ? (openBlock(), createElementBlock("a", mergeProps({ key: 0 }, _ctx.$attrs, {
140
- href: _ctx.to,
142
+ return typeof _ctx.to === "string" && _ctx.isExternalLink(_ctx.to) ? (openBlock(), createElementBlock("a", mergeProps({ key: 0 }, _ctx.$attrs, {
143
+ href: _ctx.sanitizeUrl(_ctx.to),
141
144
  target: "_blank",
142
145
  class: _ctx.classes
143
146
  }), [
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, resolveComponent, openBlock, createBlock, withCtx, renderSlot, createTextVNode, toDisplayString, pushScopeId, popScopeId, createElementVNode } from "vue";
2
2
  import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
3
- const _withScopeId = (n) => (pushScopeId("data-v-189b159e"), n = n(), popScopeId(), n);
3
+ const _withScopeId = (n) => (pushScopeId("data-v-2662da21"), n = n(), popScopeId(), n);
4
4
  const _hoisted_1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("i", { class: "bg-info-circle-icon block h-3 w-3" }, null, -1));
5
5
  const _sfc_main = /* @__PURE__ */ defineComponent({
6
6
  ...{
@@ -16,7 +16,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
16
16
  setup(__props) {
17
17
  return (_ctx, _cache) => {
18
18
  const _component_VTooltip = resolveComponent("VTooltip");
19
- return openBlock(), createBlock(_component_VTooltip, null, {
19
+ return openBlock(), createBlock(_component_VTooltip, {
20
+ "popper-triggers": ["hover"],
21
+ delay: { show: 750, hide: 0 }
22
+ }, {
20
23
  popper: withCtx(() => [
21
24
  renderSlot(_ctx.$slots, "default", {}, () => [
22
25
  createTextVNode(toDisplayString(__props.text), 1)
@@ -30,7 +33,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
30
33
  };
31
34
  }
32
35
  });
33
- const PInfoIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-189b159e"]]);
36
+ const PInfoIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2662da21"]]);
34
37
  export {
35
38
  PInfoIcon as default
36
39
  };
@@ -0,0 +1,4 @@
1
+ import { _ as _sfc_main } from "./chunks/p-link.js";
2
+ export {
3
+ _sfc_main as default
4
+ };
@@ -110,7 +110,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
110
110
  ],
111
111
  setup(__props, { emit: __emit }) {
112
112
  useCssVars((_ctx) => ({
113
- "8a536574": __props.maxWidth
113
+ "4d751ed2": __props.maxWidth
114
114
  }));
115
115
  let animatingZIndex = 0;
116
116
  const emit = __emit;
@@ -320,12 +320,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
320
320
  class: "mr-auto pt-4 text-xl font-semibold"
321
321
  }, toDisplayString(__props.title), 9, _hoisted_5)) : createCommentVNode("", true),
322
322
  createElementVNode("div", _hoisted_6, [
323
- __props.enableClose ? (openBlock(), createBlock(PCloseBtn, {
324
- key: 0,
323
+ createVNode(PCloseBtn, {
325
324
  disabled: __props.disabled,
325
+ class: normalizeClass({ invisible: !__props.enableClose }),
326
326
  "aria-label": __props.closeLabel,
327
327
  onClick: withModifiers(close, ["prevent"])
328
- }, null, 8, ["disabled", "aria-label"])) : createCommentVNode("", true)
328
+ }, null, 8, ["disabled", "class", "aria-label"])
329
329
  ])
330
330
  ])
331
331
  ], true),
@@ -364,7 +364,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
364
364
  };
365
365
  }
366
366
  });
367
- const pModal = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ee599a02"]]);
367
+ const pModal = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-fb5dbd9f"]]);
368
368
  export {
369
369
  pModal as default
370
370
  };
@@ -0,0 +1,13 @@
1
+ const XSS_SECURITY_URL = "https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html";
2
+ const SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;
3
+ const sanitizeUrl = (url) => {
4
+ url = String(url);
5
+ if (url.match(SAFE_URL_PATTERN)) {
6
+ return url;
7
+ }
8
+ console.warn(`WARNING: sanitizing unsafe URL value ${url} (see ${XSS_SECURITY_URL})`);
9
+ return "unsafe:" + url;
10
+ };
11
+ export {
12
+ sanitizeUrl
13
+ };
@@ -18,6 +18,7 @@ import PInput from './p-input/p-input.vue';
18
18
  import PInputNumber from './p-input-number/p-input-number.vue';
19
19
  import PInputPercent from './p-input-percent/p-input-percent.vue';
20
20
  import PInputSearch from './p-input-search/p-input-search.vue';
21
+ import PLink from './p-link/p-link.vue';
21
22
  import PLoading from './p-loading/p-loading.vue';
22
23
  import PModal from './p-modal/p-modal.vue';
23
24
  import PPagination from './p-pagination/p-pagination.vue';
@@ -47,4 +48,4 @@ import { usePModal } from './p-modal/usePModal';
47
48
  import { usePTableColResize } from './p-table/usePTableColResize';
48
49
  import { usePTableRowVirtualizer } from './p-table/usePTableRowVirtualizer';
49
50
  import { useSelectList } from './p-select-list/useSelectList';
50
- export { PActionBar, PActionBarAction, PAlert, PAvatar, PBtn, PCard, PCheckbox, PChips, PCloseBtn, PDatePicker, PDrawer, PDropdown, PDropdownSelect, PFileUpload, PFilterIcon, PInfoIcon, PInlineDatePicker, PInput, PInputNumber, PInputPercent, PInputSearch, PLoading, PModal, PPagination, PPaginationInfo, PProgressBar, PRingLoader, PSelect, PSelectBtn, PSelectList, PSelectPill, PSkeletonLoader, PTable, PTableHeaderCell, PTableLoader, PTableSort, PTableTd, PTabs, PTextarea, PToggle, SORTING_TYPES, MIN_WIDTH_COL_RESIZE, colsInjectionKey, isColsResizableInjectionKey, isFirstColFixedInjectionKey, isLastColFixedInjectionKey, usePModal, usePTableColResize, usePTableRowVirtualizer, useSelectList, usePLoading, SortingType, SortingTypeWithoutNoSorting, Size, FileUploadFile, HeaderCellAttrs, TableCol, ThAttrs, };
51
+ export { PActionBar, PActionBarAction, PAlert, PAvatar, PBtn, PCard, PCheckbox, PChips, PCloseBtn, PDatePicker, PDrawer, PDropdown, PDropdownSelect, PFileUpload, PFilterIcon, PInfoIcon, PInlineDatePicker, PInput, PInputNumber, PInputPercent, PInputSearch, PLink, PLoading, PModal, PPagination, PPaginationInfo, PProgressBar, PRingLoader, PSelect, PSelectBtn, PSelectList, PSelectPill, PSkeletonLoader, PTable, PTableHeaderCell, PTableLoader, PTableSort, PTableTd, PTabs, PTextarea, PToggle, SORTING_TYPES, MIN_WIDTH_COL_RESIZE, colsInjectionKey, isColsResizableInjectionKey, isFirstColFixedInjectionKey, isLastColFixedInjectionKey, usePModal, usePTableColResize, usePTableRowVirtualizer, useSelectList, usePLoading, SortingType, SortingTypeWithoutNoSorting, Size, FileUploadFile, HeaderCellAttrs, TableCol, ThAttrs, };
@@ -72,8 +72,10 @@ declare const _default: import("vue").DefineComponent<{
72
72
  classes(): string;
73
73
  loaderSize(): number;
74
74
  loaderColor(): undefined;
75
- isExternalLink(): boolean;
76
- }, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
75
+ }, {
76
+ isExternalLink: (url: string) => boolean;
77
+ sanitizeUrl: (url: string) => string;
78
+ }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
77
79
  /**
78
80
  * The button style e.g primary, secondary, primary-outline, secondary-outline, error, success, primary-link
79
81
  */
@@ -0,0 +1,22 @@
1
+ import { type RouterLinkProps } from 'vue-router';
2
+ declare function __VLS_template(): {
3
+ default?(_: {}): any;
4
+ default?(_: {}): any;
5
+ };
6
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_TypePropsToOption<RouterLinkProps>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<RouterLinkProps>>>, {}, {}>;
7
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
8
+ export default _default;
9
+ type __VLS_WithTemplateSlots<T, S> = T & {
10
+ new (): {
11
+ $slots: S;
12
+ };
13
+ };
14
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
15
+ type __VLS_TypePropsToOption<T> = {
16
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
17
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
18
+ } : {
19
+ type: import('vue').PropType<T[K]>;
20
+ required: true;
21
+ };
22
+ };
@@ -17,7 +17,7 @@ export declare const usePTableRowVirtualizer: (options: Options) => {
17
17
  measureElement: () => Ref<undefined>;
18
18
  } | {
19
19
  virtualizer: Ref<import("@tanstack/vue-virtual").Virtualizer<HTMLElement, Element>>;
20
- virtualRows: ComputedRef<import("@tanstack/vue-virtual").VirtualItem<Element>[]>;
20
+ virtualRows: ComputedRef<import("@tanstack/vue-virtual").VirtualItem[]>;
21
21
  paddingTop: ComputedRef<number>;
22
22
  paddingBottom: ComputedRef<number>;
23
23
  measureElement: (cmp: ComponentPublicInstance | Ref<HTMLElement>) => undefined;
@@ -5,8 +5,9 @@ import { ERROR_MSG, INPUT_BASE, INPUT_ERROR, INPUT_NORMAL, INPUT_SIZES, type Inp
5
5
  import { createPagingRange } from './pagination';
6
6
  import { getNextActiveElement, isElement, isVisible } from './dom';
7
7
  import { isObject } from './object';
8
+ import { sanitizeUrl } from './sanitization';
8
9
  import { setupListKeyboardNavigation } from './listKeyboardNavigation';
9
10
  import { splitStringForHighlight } from './text';
10
11
  import { toNumberOrNull } from './number';
11
12
  import { toString } from './string';
12
- export { inputClassesMixin, CURRENCY_INPUT_DEFAULTS, Color, getColor, getColorDeep, getScreen, ERROR_MSG, INPUT_BASE, INPUT_ERROR, INPUT_NORMAL, INPUT_SIZES, InputSize, LABEL_BASE, LABEL_REQUIRED, LABEL_SIZES, SELECT_ARROW, SELECT_BASE, SELECT_SIZES, SPACING_LEFT, SPACING_PREFIX, SPACING_RIGHT, SPACING_SUFFIX, TEXTAREA_BASE, createPagingRange, getNextActiveElement, isElement, isVisible, isObject, setupListKeyboardNavigation, splitStringForHighlight, toNumberOrNull, toString, };
13
+ export { inputClassesMixin, CURRENCY_INPUT_DEFAULTS, Color, getColor, getColorDeep, getScreen, ERROR_MSG, INPUT_BASE, INPUT_ERROR, INPUT_NORMAL, INPUT_SIZES, InputSize, LABEL_BASE, LABEL_REQUIRED, LABEL_SIZES, SELECT_ARROW, SELECT_BASE, SELECT_SIZES, SPACING_LEFT, SPACING_PREFIX, SPACING_RIGHT, SPACING_SUFFIX, TEXTAREA_BASE, createPagingRange, getNextActiveElement, isElement, isVisible, isObject, sanitizeUrl, setupListKeyboardNavigation, splitStringForHighlight, toNumberOrNull, toString, };
@@ -0,0 +1 @@
1
+ export declare const isExternalLink: (url: string) => boolean;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This is a port of the Angular url_sanitizer module.
3
+ * https://github.com/angular/angular/blob/main/packages/core/src/sanitization/url_sanitizer.ts
4
+ *
5
+ * TL;DR
6
+ * The function sanitizeUrl is designed to ensure that a given URL is safe,
7
+ * by checking it against a regular expression pattern (SAFE_URL_PATTERN).
8
+ * If the URL is considered unsafe, it returns a version of the URL prefixed with "unsafe:".
9
+ */
10
+ export declare const sanitizeUrl: (url: string) => string;
package/dist/style.css CHANGED
@@ -7,7 +7,7 @@
7
7
  transform: translateX(100%);
8
8
  }
9
9
  }
10
- .bg-info-circle-icon[data-v-189b159e] {
10
+ .bg-info-circle-icon[data-v-2662da21] {
11
11
  background-image: url("data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_4002_33291)'%3e%3cpath%20d='M0.5%206C0.5%207.45869%201.07946%208.85764%202.11091%209.88909C3.14236%2010.9205%204.54131%2011.5%206%2011.5C7.45869%2011.5%208.85764%2010.9205%209.88909%209.88909C10.9205%208.85764%2011.5%207.45869%2011.5%206C11.5%204.54131%2010.9205%203.14236%209.88909%202.11091C8.85764%201.07946%207.45869%200.5%206%200.5C4.54131%200.5%203.14236%201.07946%202.11091%202.11091C1.07946%203.14236%200.5%204.54131%200.5%206Z'%20stroke='%231A123B'%20stroke-miterlimit='10'/%3e%3cpath%20d='M6.5%203.5H5.5V2.5H6.5V3.5Z'%20fill='%231A123B'/%3e%3cpath%20d='M4.5%205H6V9M4.5%208.5H7.5'%20stroke='%231A123B'%20stroke-miterlimit='10'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_4002_33291'%3e%3crect%20width='12'%20height='12'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e");
12
12
  }
13
13
  div[id^=popper_].dropdown {
@@ -409,33 +409,33 @@ to {
409
409
  opacity: 0;
410
410
  transform: translate3d(0, -100%, 0);
411
411
  }
412
- }.pm[data-v-ee599a02] {
412
+ }.pm[data-v-fb5dbd9f] {
413
413
  width: calc(100% - 32px);
414
414
  min-width: 110px;
415
- max-width: var(--8a536574);
415
+ max-width: var(--4d751ed2);
416
416
  max-height: calc(100vh - 32px);
417
417
  }
418
- .fadeIn[data-v-ee599a02] {
418
+ .fadeIn[data-v-fb5dbd9f] {
419
419
  animation-duration: 0.4s;
420
- animation-name: fadeInFrames-ee599a02;
420
+ animation-name: fadeInFrames-fb5dbd9f;
421
421
  animation-fill-mode: both;
422
422
  }
423
- .fadeOut[data-v-ee599a02] {
423
+ .fadeOut[data-v-fb5dbd9f] {
424
424
  animation-duration: 0.2s;
425
- animation-name: fadeOutFrames-ee599a02;
425
+ animation-name: fadeOutFrames-fb5dbd9f;
426
426
  animation-fill-mode: both;
427
427
  }
428
- .slideInTop[data-v-ee599a02] {
428
+ .slideInTop[data-v-fb5dbd9f] {
429
429
  animation-duration: 0.4s;
430
- animation-name: fadeInFrames-ee599a02,slideInTopFrames-ee599a02;
430
+ animation-name: fadeInFrames-fb5dbd9f,slideInTopFrames-fb5dbd9f;
431
431
  animation-fill-mode: both;
432
432
  }
433
- .slideOutTop[data-v-ee599a02] {
433
+ .slideOutTop[data-v-fb5dbd9f] {
434
434
  animation-duration: 0.2s;
435
- animation-name: fadeOutFrames-ee599a02,slideOutTopFrames-ee599a02;
435
+ animation-name: fadeOutFrames-fb5dbd9f,slideOutTopFrames-fb5dbd9f;
436
436
  animation-fill-mode: both;
437
437
  }
438
- @keyframes slideInTopFrames-ee599a02 {
438
+ @keyframes slideInTopFrames-fb5dbd9f {
439
439
  from {
440
440
  transform: translate(0, -12px);
441
441
  animation-timing-function: cubic-bezier(0, 0, 0, 1);
@@ -444,7 +444,7 @@ to {
444
444
  transform: translate(0, 0);
445
445
  }
446
446
  }
447
- @keyframes slideOutTopFrames-ee599a02 {
447
+ @keyframes slideOutTopFrames-fb5dbd9f {
448
448
  from {
449
449
  transform: translate(0, 0);
450
450
  animation-timing-function: cubic-bezier(0.33, 0, 0.67, 1);
@@ -453,7 +453,7 @@ to {
453
453
  transform: translate(0, -12px);
454
454
  }
455
455
  }
456
- @keyframes fadeInFrames-ee599a02 {
456
+ @keyframes fadeInFrames-fb5dbd9f {
457
457
  from {
458
458
  opacity: 0;
459
459
  animation-timing-function: cubic-bezier(0, 0, 1, 1);
@@ -462,7 +462,7 @@ to {
462
462
  opacity: 1;
463
463
  }
464
464
  }
465
- @keyframes fadeOutFrames-ee599a02 {
465
+ @keyframes fadeOutFrames-fb5dbd9f {
466
466
  from {
467
467
  opacity: 1;
468
468
  animation-timing-function: cubic-bezier(0.33, 0, 0.67, 1);