@pequity/squirrel 5.2.1 → 5.2.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.
- package/README.md +22 -0
- package/dist/cjs/p-info-icon.js +3 -3
- package/dist/cjs/p-input-search.js +3 -2
- package/dist/cjs/p-modal.js +5 -2
- package/dist/es/p-info-icon.js +3 -3
- package/dist/es/p-input-search.js +3 -2
- package/dist/es/p-modal.js +5 -2
- package/dist/squirrel/components/p-info-icon/p-info-icon.vue.d.ts +1 -1
- package/dist/style.css +28 -28
- package/package.json +25 -30
- package/squirrel/components/p-action-bar/p-action-bar.spec.js +1 -1
- package/squirrel/components/p-alert/p-alert.spec.js +1 -1
- package/squirrel/components/p-avatar/p-avatar.spec.js +1 -1
- package/squirrel/components/p-btn/p-btn.spec.js +3 -7
- package/squirrel/components/p-card/p-card.spec.js +1 -1
- package/squirrel/components/p-checkbox/p-checkbox.spec.js +1 -1
- package/squirrel/components/p-chips/p-chips.spec.js +1 -1
- package/squirrel/components/p-close-btn/p-close-btn.spec.js +1 -1
- package/squirrel/components/p-dropdown/p-dropdown.spec.js +5 -9
- package/squirrel/components/p-dropdown-select/p-dropdown-select.spec.js +4 -5
- package/squirrel/components/p-file-upload/p-file-upload.spec.js +1 -1
- package/squirrel/components/p-icon/p-icon.spec.js +16 -29
- package/squirrel/components/p-info-icon/p-info-icon.spec.js +2 -1
- package/squirrel/components/p-info-icon/p-info-icon.vue +2 -2
- package/squirrel/components/p-inline-date-picker/p-inline-date-picker.spec.js +4 -4
- package/squirrel/components/p-input/p-input.spec.js +1 -1
- package/squirrel/components/p-input-number/p-input-number.spec.js +1 -1
- package/squirrel/components/p-input-percent/p-input-percent.spec.js +1 -1
- package/squirrel/components/p-input-search/p-input-search.spec.js +1 -1
- package/squirrel/components/p-input-search/p-input-search.vue +1 -1
- package/squirrel/components/p-link/p-link.spec.js +3 -7
- package/squirrel/components/p-loading/p-loading.spec.js +23 -23
- package/squirrel/components/p-modal/p-modal-basic.spec.js +1 -1
- package/squirrel/components/p-modal/p-modal-events.spec.js +1 -1
- package/squirrel/components/p-modal/p-modal-features.spec.js +1 -1
- package/squirrel/components/p-modal/p-modal.vue +4 -0
- package/squirrel/components/p-pagination/p-pagination.spec.js +1 -1
- package/squirrel/components/p-pagination-info/p-pagination-info.spec.js +1 -1
- package/squirrel/components/p-progress-bar/p-progess-bar.spec.js +1 -1
- package/squirrel/components/p-ring-loader/p-ring-loader.spec.js +1 -1
- package/squirrel/components/p-select/p-select.spec.js +1 -1
- package/squirrel/components/p-select-btn/p-select-btn.spec.js +1 -1
- package/squirrel/components/p-select-list/p-select-list.spec.js +4 -5
- package/squirrel/components/p-select-pill/p-select-pill.spec.js +1 -1
- package/squirrel/components/p-skeleton-loader/p-skeleton-loader.spec.js +1 -1
- package/squirrel/components/p-table/p-table.spec.js +1 -1
- package/squirrel/components/p-table-header-cell/p-filter-icon.spec.js +1 -1
- package/squirrel/components/p-table-header-cell/p-table-header-cell.spec.js +1 -1
- package/squirrel/components/p-table-loader/p-table-loader.spec.js +1 -1
- package/squirrel/components/p-table-sort/p-table-sort.spec.js +1 -1
- package/squirrel/components/p-table-td/p-table-td.spec.js +36 -1
- package/squirrel/components/p-tabs/p-tabs.spec.js +1 -1
- package/squirrel/components/p-textarea/p-textarea.spec.js +1 -1
- package/squirrel/components/p-toggle/p-toggle.spec.js +1 -1
- package/squirrel/composables/useInputClasses.spec.js +41 -0
- package/squirrel/index.spec.js +21 -0
- package/squirrel/utils/dom.spec.js +2 -3
- package/squirrel/utils/listKeyboardNavigation.spec.js +5 -9
- package/squirrel/utils/sanitization.spec.js +1 -1
- package/squirrel/utils/tailwind.spec.js +27 -0
package/README.md
CHANGED
|
@@ -19,6 +19,28 @@ Install Tailwind CSS:
|
|
|
19
19
|
pnpm i -D tailwindcss
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
+
Squirrel uses [iconify-icon](https://iconify.design/docs/iconify-icon/) for icons.
|
|
23
|
+
In our consumer project, we need to tell Vue that `<iconify-icon>` is a web component.
|
|
24
|
+
|
|
25
|
+
Example of how to do this in a Vite project:
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
import { defineConfig } from 'vite';
|
|
29
|
+
import vue from '@vitejs/plugin-vue';
|
|
30
|
+
|
|
31
|
+
export default defineConfig({
|
|
32
|
+
plugins: [
|
|
33
|
+
vue({
|
|
34
|
+
template: {
|
|
35
|
+
compilerOptions: {
|
|
36
|
+
isCustomElement: (tag) => tag === 'iconify-icon',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
}),
|
|
40
|
+
],
|
|
41
|
+
});
|
|
42
|
+
```
|
|
43
|
+
|
|
22
44
|
Import the Squirrel CSS to your project's `main.css` file:
|
|
23
45
|
|
|
24
46
|
```css
|
package/dist/cjs/p-info-icon.js
CHANGED
|
@@ -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-
|
|
4
|
+
const _withScopeId = (n) => (vue.pushScopeId("data-v-804e74f5"), 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,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
17
17
|
return vue.openBlock(), vue.createBlock(_component_VTooltip, {
|
|
18
18
|
"popper-triggers": ["hover"],
|
|
19
19
|
delay: { show: 750, hide: 0 },
|
|
20
|
-
disabled: !_ctx.text
|
|
20
|
+
disabled: !_ctx.$slots.default && !_ctx.text
|
|
21
21
|
}, {
|
|
22
22
|
popper: vue.withCtx(() => [
|
|
23
23
|
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
@@ -32,5 +32,5 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
|
-
const PInfoIcon = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
35
|
+
const PInfoIcon = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-804e74f5"]]);
|
|
36
36
|
module.exports = PInfoIcon;
|
|
@@ -56,7 +56,8 @@ const _sfc_main = vue.defineComponent({
|
|
|
56
56
|
clearSearch() {
|
|
57
57
|
this.query = "";
|
|
58
58
|
requestAnimationFrame(() => {
|
|
59
|
-
|
|
59
|
+
var _a;
|
|
60
|
+
(_a = this.$refs.searchInput) == null ? void 0 : _a.$el.querySelector("input").focus();
|
|
60
61
|
});
|
|
61
62
|
},
|
|
62
63
|
keydownEnter() {
|
|
@@ -107,5 +108,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
107
108
|
_: 1
|
|
108
109
|
}, 16, ["modelValue", "size", "onKeydown"]);
|
|
109
110
|
}
|
|
110
|
-
const PInputSearch = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
|
|
111
|
+
const PInputSearch = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-60b13ffe"]]);
|
|
111
112
|
module.exports = PInputSearch;
|
package/dist/cjs/p-modal.js
CHANGED
|
@@ -111,7 +111,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
111
111
|
],
|
|
112
112
|
setup(__props, { emit: __emit }) {
|
|
113
113
|
vue.useCssVars((_ctx) => ({
|
|
114
|
-
"
|
|
114
|
+
"4046568f": __props.maxWidth
|
|
115
115
|
}));
|
|
116
116
|
let animatingZIndex = 0;
|
|
117
117
|
const emit = __emit;
|
|
@@ -195,6 +195,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
195
195
|
}, 0);
|
|
196
196
|
};
|
|
197
197
|
const handleFocus = (wrapper) => {
|
|
198
|
+
if (!wrapper) {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
198
201
|
const autofocus = wrapper.querySelector("[autofocus]");
|
|
199
202
|
if (autofocus) {
|
|
200
203
|
autofocus.focus();
|
|
@@ -365,5 +368,5 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
365
368
|
};
|
|
366
369
|
}
|
|
367
370
|
});
|
|
368
|
-
const pModal = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
371
|
+
const pModal = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-7e6a0b8d"]]);
|
|
369
372
|
module.exports = pModal;
|
package/dist/es/p-info-icon.js
CHANGED
|
@@ -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-
|
|
3
|
+
const _withScopeId = (n) => (pushScopeId("data-v-804e74f5"), 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,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
16
16
|
return openBlock(), createBlock(_component_VTooltip, {
|
|
17
17
|
"popper-triggers": ["hover"],
|
|
18
18
|
delay: { show: 750, hide: 0 },
|
|
19
|
-
disabled: !_ctx.text
|
|
19
|
+
disabled: !_ctx.$slots.default && !_ctx.text
|
|
20
20
|
}, {
|
|
21
21
|
popper: withCtx(() => [
|
|
22
22
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
@@ -31,7 +31,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
|
-
const PInfoIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
34
|
+
const PInfoIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-804e74f5"]]);
|
|
35
35
|
export {
|
|
36
36
|
PInfoIcon as default
|
|
37
37
|
};
|
|
@@ -55,7 +55,8 @@ const _sfc_main = defineComponent({
|
|
|
55
55
|
clearSearch() {
|
|
56
56
|
this.query = "";
|
|
57
57
|
requestAnimationFrame(() => {
|
|
58
|
-
|
|
58
|
+
var _a;
|
|
59
|
+
(_a = this.$refs.searchInput) == null ? void 0 : _a.$el.querySelector("input").focus();
|
|
59
60
|
});
|
|
60
61
|
},
|
|
61
62
|
keydownEnter() {
|
|
@@ -106,7 +107,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
106
107
|
_: 1
|
|
107
108
|
}, 16, ["modelValue", "size", "onKeydown"]);
|
|
108
109
|
}
|
|
109
|
-
const PInputSearch = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
|
|
110
|
+
const PInputSearch = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-60b13ffe"]]);
|
|
110
111
|
export {
|
|
111
112
|
PInputSearch as default
|
|
112
113
|
};
|
package/dist/es/p-modal.js
CHANGED
|
@@ -110,7 +110,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
110
110
|
],
|
|
111
111
|
setup(__props, { emit: __emit }) {
|
|
112
112
|
useCssVars((_ctx) => ({
|
|
113
|
-
"
|
|
113
|
+
"4046568f": __props.maxWidth
|
|
114
114
|
}));
|
|
115
115
|
let animatingZIndex = 0;
|
|
116
116
|
const emit = __emit;
|
|
@@ -194,6 +194,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
194
194
|
}, 0);
|
|
195
195
|
};
|
|
196
196
|
const handleFocus = (wrapper) => {
|
|
197
|
+
if (!wrapper) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
197
200
|
const autofocus = wrapper.querySelector("[autofocus]");
|
|
198
201
|
if (autofocus) {
|
|
199
202
|
autofocus.focus();
|
|
@@ -364,7 +367,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
364
367
|
};
|
|
365
368
|
}
|
|
366
369
|
});
|
|
367
|
-
const pModal = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
370
|
+
const pModal = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-7e6a0b8d"]]);
|
|
368
371
|
export {
|
|
369
372
|
pModal as default
|
|
370
373
|
};
|
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-
|
|
10
|
+
.bg-info-circle-icon[data-v-804e74f5] {
|
|
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 {
|
|
@@ -145,77 +145,77 @@ div[id^=popper_].dropdown .v-popper__inner .dropdown-menu .dropdown-divider {
|
|
|
145
145
|
border-color: var(--color-p-gray-30);
|
|
146
146
|
|
|
147
147
|
opacity: 1
|
|
148
|
-
}.icon.clear[data-v-
|
|
148
|
+
}.icon.clear[data-v-60b13ffe] {
|
|
149
149
|
background-image: url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1634_880)'%3e%3cpath%20d='M16%208C16%206.41775%2015.5308%204.87104%2014.6518%203.55544C13.7727%202.23985%2012.5233%201.21447%2011.0615%200.608967C9.59966%200.00346629%207.99113%20-0.15496%206.43928%200.153721C4.88743%200.462403%203.46197%201.22433%202.34315%202.34315C1.22433%203.46197%200.462403%204.88743%200.153721%206.43928C-0.15496%207.99113%200.00346629%209.59966%200.608967%2011.0615C1.21447%2012.5233%202.23985%2013.7727%203.55544%2014.6518C4.87104%2015.5308%206.41775%2016%208%2016C10.1217%2016%2012.1566%2015.1571%2013.6569%2013.6569C15.1571%2012.1566%2016%2010.1217%2016%208ZM11.14%2010.1867C11.2642%2010.3116%2011.3339%2010.4805%2011.3339%2010.6567C11.3339%2010.8328%2011.2642%2011.0018%2011.14%2011.1267C11.078%2011.1892%2011.0043%2011.2388%2010.9231%2011.2726C10.8418%2011.3064%2010.7547%2011.3239%2010.6667%2011.3239C10.5787%2011.3239%2010.4915%2011.3064%2010.4103%2011.2726C10.329%2011.2388%2010.2553%2011.1892%2010.1933%2011.1267L8.12%209.05334C8.08809%209.02429%208.04649%209.0082%208.00334%209.0082C7.96019%209.0082%207.91858%209.02429%207.88667%209.05334L5.81334%2011.1267C5.6858%2011.2359%205.52175%2011.293%205.35397%2011.2865C5.18618%2011.28%205.02702%2011.2104%204.90829%2011.0917C4.78957%2010.973%204.72001%2010.8138%204.71353%2010.646C4.70705%2010.4783%204.76412%2010.3142%204.87334%2010.1867L6.94667%208.11334C6.97572%208.08142%206.99181%208.03982%206.99181%207.99667C6.99181%207.95352%206.97572%207.91192%206.94667%207.88L4.87334%205.80667C4.81085%205.7447%204.76126%205.67096%204.72741%205.58972C4.69356%205.50848%204.67614%205.42135%204.67614%205.33334C4.67614%205.24533%204.69356%205.15819%204.72741%205.07695C4.76126%204.99571%204.81085%204.92198%204.87334%204.86C4.99825%204.73584%205.16721%204.66614%205.34334%204.66614C5.51946%204.66614%205.68843%204.73584%205.81334%204.86L7.88667%206.93334C7.90163%206.94928%207.91971%206.96199%207.93977%206.97068C7.95984%206.97936%207.98147%206.98384%208.00334%206.98384C8.0252%206.98384%208.04684%206.97936%208.0669%206.97068C8.08697%206.96199%208.10504%206.94928%208.12%206.93334L10.1933%204.86C10.2555%204.79784%2010.3293%204.74854%2010.4105%204.7149C10.4917%204.68126%2010.5788%204.66394%2010.6667%204.66394C10.7546%204.66394%2010.8416%204.68126%2010.9228%204.7149C11.0041%204.74854%2011.0778%204.79784%2011.14%204.86C11.2022%204.92216%2011.2515%204.99596%2011.2851%205.07717C11.3188%205.15839%2011.3361%205.24543%2011.3361%205.33334C11.3361%205.42124%2011.3188%205.50829%2011.2851%205.5895C11.2515%205.67072%2011.2022%205.74451%2011.14%205.80667L9.06667%207.88C9.05073%207.89497%209.03802%207.91304%209.02933%207.93311C9.02065%207.95317%209.01616%207.97481%209.01616%207.99667C9.01616%208.01854%209.02065%208.04017%209.02933%208.06024C9.03802%208.0803%209.05073%208.09837%209.06667%208.11334L11.14%2010.1867Z'%20fill='%23A0AEC0'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1634_880'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e");
|
|
150
150
|
background-position: center center;
|
|
151
151
|
transition: background-image 0.4s;
|
|
152
152
|
}
|
|
153
|
-
.icon.clear-sm[data-v-
|
|
153
|
+
.icon.clear-sm[data-v-60b13ffe] {
|
|
154
154
|
background-size: 0.875rem 0.875rem;
|
|
155
155
|
width: 0.875rem;
|
|
156
156
|
height: 0.875rem;
|
|
157
157
|
bottom: 0.5rem;
|
|
158
158
|
right: 0.375rem;
|
|
159
159
|
}
|
|
160
|
-
.icon.clear-md[data-v-
|
|
160
|
+
.icon.clear-md[data-v-60b13ffe] {
|
|
161
161
|
background-size: 1rem 1rem;
|
|
162
162
|
height: 1rem;
|
|
163
163
|
width: 1rem;
|
|
164
164
|
bottom: 0.75rem;
|
|
165
165
|
right: 0.5rem;
|
|
166
166
|
}
|
|
167
|
-
.icon.clear-lg[data-v-
|
|
167
|
+
.icon.clear-lg[data-v-60b13ffe] {
|
|
168
168
|
background-size: 1rem 1rem;
|
|
169
169
|
height: 1rem;
|
|
170
170
|
width: 1rem;
|
|
171
171
|
bottom: 1rem;
|
|
172
172
|
right: 0.5rem;
|
|
173
173
|
}
|
|
174
|
-
.icon.clear[data-v-
|
|
174
|
+
.icon.clear[data-v-60b13ffe]:hover {
|
|
175
175
|
background-image: url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1634_896)'%3e%3cpath%20d='M16%208C16%206.41775%2015.5308%204.87104%2014.6518%203.55544C13.7727%202.23985%2012.5233%201.21447%2011.0615%200.608967C9.59966%200.00346629%207.99113%20-0.15496%206.43928%200.153721C4.88743%200.462403%203.46197%201.22433%202.34315%202.34315C1.22433%203.46197%200.462403%204.88743%200.153721%206.43928C-0.15496%207.99113%200.00346629%209.59966%200.608967%2011.0615C1.21447%2012.5233%202.23985%2013.7727%203.55544%2014.6518C4.87104%2015.5308%206.41775%2016%208%2016C10.1217%2016%2012.1566%2015.1571%2013.6569%2013.6569C15.1571%2012.1566%2016%2010.1217%2016%208ZM11.14%2010.1867C11.2642%2010.3116%2011.3339%2010.4805%2011.3339%2010.6567C11.3339%2010.8328%2011.2642%2011.0018%2011.14%2011.1267C11.078%2011.1892%2011.0043%2011.2388%2010.9231%2011.2726C10.8418%2011.3064%2010.7547%2011.3239%2010.6667%2011.3239C10.5787%2011.3239%2010.4915%2011.3064%2010.4103%2011.2726C10.329%2011.2388%2010.2553%2011.1892%2010.1933%2011.1267L8.12%209.05334C8.08809%209.02429%208.04649%209.0082%208.00334%209.0082C7.96019%209.0082%207.91858%209.02429%207.88667%209.05334L5.81334%2011.1267C5.6858%2011.2359%205.52175%2011.293%205.35397%2011.2865C5.18618%2011.28%205.02702%2011.2104%204.90829%2011.0917C4.78957%2010.973%204.72001%2010.8138%204.71353%2010.646C4.70705%2010.4783%204.76412%2010.3142%204.87334%2010.1867L6.94667%208.11334C6.97572%208.08142%206.99181%208.03982%206.99181%207.99667C6.99181%207.95352%206.97572%207.91192%206.94667%207.88L4.87334%205.80667C4.81085%205.7447%204.76126%205.67096%204.72741%205.58972C4.69356%205.50848%204.67614%205.42135%204.67614%205.33334C4.67614%205.24533%204.69356%205.15819%204.72741%205.07695C4.76126%204.99571%204.81085%204.92198%204.87334%204.86C4.99825%204.73584%205.16721%204.66614%205.34334%204.66614C5.51946%204.66614%205.68843%204.73584%205.81334%204.86L7.88667%206.93334C7.90163%206.94928%207.91971%206.96199%207.93977%206.97068C7.95984%206.97936%207.98147%206.98384%208.00334%206.98384C8.0252%206.98384%208.04684%206.97936%208.0669%206.97068C8.08697%206.96199%208.10504%206.94928%208.12%206.93334L10.1933%204.86C10.2555%204.79784%2010.3293%204.74854%2010.4105%204.7149C10.4917%204.68126%2010.5788%204.66394%2010.6667%204.66394C10.7546%204.66394%2010.8416%204.68126%2010.9228%204.7149C11.0041%204.74854%2011.0778%204.79784%2011.14%204.86C11.2022%204.92216%2011.2515%204.99596%2011.2851%205.07717C11.3188%205.15839%2011.3361%205.24543%2011.3361%205.33334C11.3361%205.42124%2011.3188%205.50829%2011.2851%205.5895C11.2515%205.67072%2011.2022%205.74451%2011.14%205.80667L9.06667%207.88C9.05073%207.89497%209.03802%207.91304%209.02933%207.93311C9.02065%207.95317%209.01616%207.97481%209.01616%207.99667C9.01616%208.01854%209.02065%208.04017%209.02933%208.06024C9.03802%208.0803%209.05073%208.09837%209.06667%208.11334L11.14%2010.1867Z'%20fill='%23424E6E'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1634_896'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e");
|
|
176
176
|
}
|
|
177
|
-
.icon.search[data-v-
|
|
177
|
+
.icon.search[data-v-60b13ffe] {
|
|
178
178
|
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_9127_330342)'%3e%3cpath%20d='M11.705%2010.295L9.38501%208.00004C10.0193%207.0497%2010.3178%205.91467%2010.2331%204.77526C10.1484%203.63584%209.68546%202.5574%208.91771%201.71124C8.14996%200.86508%207.12147%200.299735%205.99563%200.105014C4.8698%20-0.0897079%203.71117%200.0973621%202.70383%200.636506C1.69648%201.17565%200.898177%202.03595%200.435738%203.08073C-0.0267015%204.12552%20-0.126757%205.29487%200.151467%206.40303C0.429691%207.51119%201.07024%208.4946%201.97135%209.19704C2.87246%209.89948%203.98246%2010.2807%205.12501%2010.28C6.13901%2010.2811%207.13002%209.97801%207.97001%209.41004L10.295%2011.735C10.4824%2011.9213%2010.7358%2012.0258%2011%2012.0258C11.2642%2012.0258%2011.5176%2011.9213%2011.705%2011.735C11.8018%2011.6418%2011.8788%2011.5299%2011.9314%2011.4062C11.9839%2011.2825%2012.011%2011.1495%2012.011%2011.015C12.011%2010.8806%2011.9839%2010.7476%2011.9314%2010.6239C11.8788%2010.5002%2011.8018%2010.3883%2011.705%2010.295ZM5.12501%201.50004C5.84176%201.50004%206.54241%201.71251%207.13843%202.11061C7.73445%202.50871%208.19908%203.07456%208.47359%203.73666C8.74811%204.39875%208.82019%205.12736%208.68072%205.8304C8.54125%206.53345%208.1965%207.17937%207.69004%207.68653C7.18357%208.19369%206.53813%208.53934%205.83527%208.67977C5.13242%208.82021%204.40371%208.74913%203.74125%208.47553C3.07878%208.20193%202.51228%207.73808%202.11336%207.14261C1.71444%206.54714%201.501%205.84678%201.50001%205.13004C1.50001%204.16817%201.88177%203.24562%202.56145%202.565C3.24112%201.88439%204.16314%201.50136%205.12501%201.50004Z'%20fill='%23718096'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_9127_330342'%3e%3crect%20width='12'%20height='12'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e");
|
|
179
179
|
}
|
|
180
|
-
.icon.search-sm[data-v-
|
|
180
|
+
.icon.search-sm[data-v-60b13ffe] {
|
|
181
181
|
background-size: 0.75rem 0.75rem;
|
|
182
182
|
left: 0.5rem;
|
|
183
183
|
bottom: 0.625rem;
|
|
184
184
|
width: 0.75rem;
|
|
185
185
|
height: 0.75rem;
|
|
186
186
|
}
|
|
187
|
-
.icon.search-md[data-v-
|
|
187
|
+
.icon.search-md[data-v-60b13ffe] {
|
|
188
188
|
background-size: 1rem 1rem;
|
|
189
189
|
width: 1rem;
|
|
190
190
|
height: 1rem;
|
|
191
191
|
left: 0.75rem;
|
|
192
192
|
bottom: 0.75rem;
|
|
193
193
|
}
|
|
194
|
-
.icon.search-lg[data-v-
|
|
194
|
+
.icon.search-lg[data-v-60b13ffe] {
|
|
195
195
|
background-size: 1rem 1rem;
|
|
196
196
|
width: 1rem;
|
|
197
197
|
height: 1rem;
|
|
198
198
|
left: 1.125rem;
|
|
199
199
|
bottom: 1rem;
|
|
200
200
|
}
|
|
201
|
-
.icon.enter[data-v-
|
|
201
|
+
.icon.enter[data-v-60b13ffe] {
|
|
202
202
|
background-image: url("data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1627_786)'%3e%3crect%20width='24'%20height='24'%20rx='5'%20fill='%23ECF1FF'/%3e%3cpath%20d='M19.17%201.03744e-05H4.83C4.19619%20-0.00130459%203.56834%200.122398%202.98239%200.364037C2.39645%200.605676%201.86392%200.960506%201.41528%201.40822C0.966641%201.85592%200.610708%202.38772%200.367855%202.97316C0.125002%203.55861%20-1.36406e-06%204.1862%200%204.82001L0%2019.17C0%2020.451%200.508874%2021.6795%201.41467%2022.5853C2.32048%2023.4911%203.549%2024%204.83%2024H19.17C20.4502%2023.9974%2021.6772%2023.4876%2022.5824%2022.5824C23.4876%2021.6772%2023.9974%2020.4502%2024%2019.17V4.82001C23.9974%203.54075%2023.4873%202.31479%2022.5818%201.41115C21.6763%200.507508%2020.4493%207.63258e-06%2019.17%201.03744e-05ZM22%2019.17C22%2019.9206%2021.7018%2020.6404%2021.1711%2021.1711C20.6404%2021.7018%2019.9206%2022%2019.17%2022H4.83C4.07944%2022%203.35962%2021.7018%202.82889%2021.1711C2.29816%2020.6404%202%2019.9206%202%2019.17V4.82001C2.00265%204.07118%202.30197%203.35393%202.83242%202.82536C3.36286%202.29679%204.08117%202.00001%204.83%202.00001H19.17C19.9188%202.00001%2020.6371%202.29679%2021.1676%202.82536C21.698%203.35393%2021.9974%204.07118%2022%204.82001V19.17Z'%20fill='%234750EB'/%3e%3cpath%20d='M17.5%207.5C17.2348%207.5%2016.9804%207.60536%2016.7929%207.79289C16.6054%207.98043%2016.5%208.23478%2016.5%208.5V11.25C16.5%2011.3163%2016.4737%2011.3799%2016.4268%2011.4268C16.3799%2011.4737%2016.3163%2011.5%2016.25%2011.5H10.75C10.6837%2011.5%2010.6201%2011.4737%2010.5732%2011.4268C10.5263%2011.3799%2010.5%2011.3163%2010.5%2011.25V9.5C10.5012%209.30138%2010.4431%209.10691%2010.3333%208.94139C10.2235%208.77587%2010.0669%208.6468%209.88348%208.57063C9.70004%208.49446%209.49807%208.47465%209.30332%208.51372C9.10857%208.55279%208.92987%208.64897%208.79%208.79L5.79%2011.79C5.60375%2011.9774%205.49921%2012.2308%205.49921%2012.495C5.49921%2012.7592%205.60375%2013.0126%205.79%2013.2L8.79%2016.2C8.88261%2016.2945%208.99306%2016.3697%209.11493%2016.4212C9.23681%2016.4727%209.36769%2016.4995%209.5%2016.5C9.76522%2016.5%2010.0196%2016.3946%2010.2071%2016.2071C10.3946%2016.0196%2010.5%2015.7652%2010.5%2015.5V13.75C10.5%2013.6837%2010.5263%2013.6201%2010.5732%2013.5732C10.6201%2013.5263%2010.6837%2013.5%2010.75%2013.5H16.5C17.0304%2013.5%2017.5391%2013.2893%2017.9142%2012.9142C18.2893%2012.5391%2018.5%2012.0304%2018.5%2011.5V8.5C18.5%208.23478%2018.3946%207.98043%2018.2071%207.79289C18.0196%207.60536%2017.7652%207.5%2017.5%207.5Z'%20fill='%234750EB'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1627_786'%3e%3crect%20width='24'%20height='24'%20rx='5'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e");
|
|
203
203
|
}
|
|
204
|
-
.icon.enter-sm[data-v-
|
|
204
|
+
.icon.enter-sm[data-v-60b13ffe] {
|
|
205
205
|
background-size: 1rem 1rem;
|
|
206
206
|
width: 1rem;
|
|
207
207
|
height: 1rem;
|
|
208
208
|
right: 1.5rem;
|
|
209
209
|
bottom: 0.5rem;
|
|
210
210
|
}
|
|
211
|
-
.icon.enter-md[data-v-
|
|
211
|
+
.icon.enter-md[data-v-60b13ffe] {
|
|
212
212
|
background-size: 1.5rem 1.5rem;
|
|
213
213
|
width: 1.5rem;
|
|
214
214
|
height: 1.5rem;
|
|
215
215
|
right: 2.0625rem;
|
|
216
216
|
bottom: 0.5rem;
|
|
217
217
|
}
|
|
218
|
-
.icon.enter-lg[data-v-
|
|
218
|
+
.icon.enter-lg[data-v-60b13ffe] {
|
|
219
219
|
background-size: 1.5rem 1.5rem;
|
|
220
220
|
width: 1.5rem;
|
|
221
221
|
height: 1.5rem;
|
|
@@ -409,33 +409,33 @@ to {
|
|
|
409
409
|
opacity: 0;
|
|
410
410
|
transform: translate3d(0, -100%, 0);
|
|
411
411
|
}
|
|
412
|
-
}.pm[data-v-
|
|
412
|
+
}.pm[data-v-7e6a0b8d] {
|
|
413
413
|
width: calc(100% - 32px);
|
|
414
414
|
min-width: 110px;
|
|
415
|
-
max-width: var(--
|
|
415
|
+
max-width: var(--4046568f);
|
|
416
416
|
max-height: calc(100vh - 32px);
|
|
417
417
|
}
|
|
418
|
-
.fadeIn[data-v-
|
|
418
|
+
.fadeIn[data-v-7e6a0b8d] {
|
|
419
419
|
animation-duration: 0.4s;
|
|
420
|
-
animation-name: fadeInFrames-
|
|
420
|
+
animation-name: fadeInFrames-7e6a0b8d;
|
|
421
421
|
animation-fill-mode: both;
|
|
422
422
|
}
|
|
423
|
-
.fadeOut[data-v-
|
|
423
|
+
.fadeOut[data-v-7e6a0b8d] {
|
|
424
424
|
animation-duration: 0.2s;
|
|
425
|
-
animation-name: fadeOutFrames-
|
|
425
|
+
animation-name: fadeOutFrames-7e6a0b8d;
|
|
426
426
|
animation-fill-mode: both;
|
|
427
427
|
}
|
|
428
|
-
.slideInTop[data-v-
|
|
428
|
+
.slideInTop[data-v-7e6a0b8d] {
|
|
429
429
|
animation-duration: 0.4s;
|
|
430
|
-
animation-name: fadeInFrames-
|
|
430
|
+
animation-name: fadeInFrames-7e6a0b8d,slideInTopFrames-7e6a0b8d;
|
|
431
431
|
animation-fill-mode: both;
|
|
432
432
|
}
|
|
433
|
-
.slideOutTop[data-v-
|
|
433
|
+
.slideOutTop[data-v-7e6a0b8d] {
|
|
434
434
|
animation-duration: 0.2s;
|
|
435
|
-
animation-name: fadeOutFrames-
|
|
435
|
+
animation-name: fadeOutFrames-7e6a0b8d,slideOutTopFrames-7e6a0b8d;
|
|
436
436
|
animation-fill-mode: both;
|
|
437
437
|
}
|
|
438
|
-
@keyframes slideInTopFrames-
|
|
438
|
+
@keyframes slideInTopFrames-7e6a0b8d {
|
|
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-
|
|
447
|
+
@keyframes slideOutTopFrames-7e6a0b8d {
|
|
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-
|
|
456
|
+
@keyframes fadeInFrames-7e6a0b8d {
|
|
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-
|
|
465
|
+
@keyframes fadeOutFrames-7e6a0b8d {
|
|
466
466
|
from {
|
|
467
467
|
opacity: 1;
|
|
468
468
|
animation-timing-function: cubic-bezier(0.33, 0, 0.67, 1);
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pequity/squirrel",
|
|
3
3
|
"description": "Squirrel component library",
|
|
4
|
-
"version": "5.2.
|
|
5
|
-
"packageManager": "pnpm@9.
|
|
4
|
+
"version": "5.2.3",
|
|
5
|
+
"packageManager": "pnpm@9.11.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"preinstall": "npx only-allow pnpm",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"preview": "vite preview",
|
|
14
14
|
"lint": "eslint \"**/*.{vue,ts,js}\"",
|
|
15
15
|
"lint-fix": "eslint --fix \"**/*.{vue,ts,js}\"",
|
|
16
|
-
"test:unit": "
|
|
17
|
-
"test:unit-coverage": "
|
|
16
|
+
"test:unit": "vitest",
|
|
17
|
+
"test:unit-coverage": "vitest run --coverage && make-coverage-badge",
|
|
18
18
|
"typecheck": "vue-tsc --noEmit",
|
|
19
19
|
"storybook": "storybook dev -p 6006",
|
|
20
20
|
"build-storybook": "storybook build",
|
|
@@ -50,38 +50,34 @@
|
|
|
50
50
|
"vue-toastification": "^2.0.0-rc.5"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@babel/core": "^7.25.2",
|
|
54
|
-
"@babel/preset-env": "^7.25.4",
|
|
55
53
|
"@commitlint/cli": "^19.5.0",
|
|
56
54
|
"@commitlint/config-conventional": "^19.5.0",
|
|
57
55
|
"@pequity/eslint-config": "^0.0.13",
|
|
58
|
-
"@playwright/test": "^1.47.
|
|
56
|
+
"@playwright/test": "^1.47.2",
|
|
59
57
|
"@popperjs/core": "2.11.8",
|
|
60
58
|
"@semantic-release/changelog": "^6.0.3",
|
|
61
59
|
"@semantic-release/git": "^10.0.1",
|
|
62
|
-
"@storybook/addon-a11y": "^8.3.
|
|
63
|
-
"@storybook/addon-actions": "^8.3.
|
|
64
|
-
"@storybook/addon-essentials": "^8.3.
|
|
65
|
-
"@storybook/addon-interactions": "^8.3.
|
|
66
|
-
"@storybook/addon-links": "^8.3.
|
|
67
|
-
"@storybook/blocks": "^8.3.
|
|
68
|
-
"@storybook/manager-api": "^8.3.
|
|
69
|
-
"@storybook/test": "^8.3.
|
|
60
|
+
"@storybook/addon-a11y": "^8.3.3",
|
|
61
|
+
"@storybook/addon-actions": "^8.3.3",
|
|
62
|
+
"@storybook/addon-essentials": "^8.3.3",
|
|
63
|
+
"@storybook/addon-interactions": "^8.3.3",
|
|
64
|
+
"@storybook/addon-links": "^8.3.3",
|
|
65
|
+
"@storybook/blocks": "^8.3.3",
|
|
66
|
+
"@storybook/manager-api": "^8.3.3",
|
|
67
|
+
"@storybook/test": "^8.3.3",
|
|
70
68
|
"@storybook/test-runner": "^0.19.1",
|
|
71
|
-
"@storybook/theming": "^8.3.
|
|
72
|
-
"@storybook/vue3": "^8.3.
|
|
73
|
-
"@storybook/vue3-vite": "^8.3.
|
|
69
|
+
"@storybook/theming": "^8.3.3",
|
|
70
|
+
"@storybook/vue3": "^8.3.3",
|
|
71
|
+
"@storybook/vue3-vite": "^8.3.3",
|
|
74
72
|
"@tanstack/vue-virtual": "3.10.8",
|
|
75
|
-
"@types/jest": "^29.5.13",
|
|
76
73
|
"@types/jsdom": "^21.1.7",
|
|
77
74
|
"@types/lodash-es": "^4.17.12",
|
|
78
|
-
"@types/node": "^22.
|
|
75
|
+
"@types/node": "^22.7.0",
|
|
79
76
|
"@vitejs/plugin-vue": "^5.1.4",
|
|
77
|
+
"@vitest/coverage-v8": "^2.1.1",
|
|
80
78
|
"@vue/compiler-sfc": "3.4.38",
|
|
81
79
|
"@vue/test-utils": "^2.4.6",
|
|
82
|
-
"@vue/vue3-jest": "^29.2.6",
|
|
83
80
|
"autoprefixer": "^10.4.20",
|
|
84
|
-
"babel-jest": "^29.7.0",
|
|
85
81
|
"dayjs": "1.11.13",
|
|
86
82
|
"eslint": "^8.57.0",
|
|
87
83
|
"eslint-plugin-storybook": "^0.8.0",
|
|
@@ -89,25 +85,24 @@
|
|
|
89
85
|
"glob": "^11.0.0",
|
|
90
86
|
"husky": "^9.1.6",
|
|
91
87
|
"iconify-icon": "^2.1.0",
|
|
92
|
-
"
|
|
93
|
-
"jest-environment-jsdom": "^29.7.0",
|
|
88
|
+
"jsdom": "^25.0.1",
|
|
94
89
|
"lint-staged": "^15.2.10",
|
|
95
90
|
"lodash-es": "4.17.21",
|
|
96
91
|
"make-coverage-badge": "^1.2.0",
|
|
97
92
|
"postcss": "^8.4.47",
|
|
98
93
|
"prettier": "^3.3.3",
|
|
99
|
-
"prettier-plugin-tailwindcss": "^0.6.
|
|
94
|
+
"prettier-plugin-tailwindcss": "^0.6.8",
|
|
100
95
|
"resolve-tspaths": "^0.8.22",
|
|
101
96
|
"rimraf": "^6.0.1",
|
|
102
|
-
"sass": "^1.79.
|
|
97
|
+
"sass": "^1.79.3",
|
|
103
98
|
"semantic-release": "^24.1.1",
|
|
104
|
-
"storybook": "^8.3.
|
|
99
|
+
"storybook": "^8.3.3",
|
|
105
100
|
"svgo": "^3.3.2",
|
|
106
|
-
"tailwindcss": "^3.4.
|
|
107
|
-
"ts-jest": "^29.2.5",
|
|
101
|
+
"tailwindcss": "^3.4.13",
|
|
108
102
|
"typescript": "5.6.2",
|
|
109
103
|
"v-calendar": "3.1.2",
|
|
110
|
-
"vite": "^5.4.
|
|
104
|
+
"vite": "^5.4.8",
|
|
105
|
+
"vitest": "^2.1.1",
|
|
111
106
|
"vue": "3.4.38",
|
|
112
107
|
"vue-currency-input": "3.1.0",
|
|
113
108
|
"vue-router": "4.4.5",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import PAvatar from '@squirrel/components/p-avatar/p-avatar.vue';
|
|
2
|
-
import { createWrapperFor } from '@tests/
|
|
2
|
+
import { createWrapperFor } from '@tests/vitest.helpers';
|
|
3
3
|
|
|
4
4
|
describe('PAvatar.vue', () => {
|
|
5
5
|
it('renders label when no imageSrc is provided', () => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import PBtn from '@squirrel/components/p-btn/p-btn.vue';
|
|
2
|
-
import { createWrapperFor } from '@tests/
|
|
2
|
+
import { createWrapperFor } from '@tests/vitest.helpers';
|
|
3
3
|
import { sanitizeUrl } from '@squirrel/utils/sanitization';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
vi.mock('@squirrel/utils/sanitization', () => {
|
|
6
6
|
return {
|
|
7
|
-
sanitizeUrl:
|
|
7
|
+
sanitizeUrl: vi.fn((str) => `sanitized-${str}`),
|
|
8
8
|
};
|
|
9
9
|
});
|
|
10
10
|
|
|
@@ -15,10 +15,6 @@ const ELEMENTS_MAP = {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
describe('PBtn.vue', () => {
|
|
18
|
-
afterEach(() => {
|
|
19
|
-
jest.clearAllMocks();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
18
|
Object.keys(ELEMENTS_MAP).forEach((el) => {
|
|
23
19
|
const to = ELEMENTS_MAP[el];
|
|
24
20
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import PDropdown from '@squirrel/components/p-dropdown/p-dropdown.vue';
|
|
2
|
-
import { createWrapperFor } from '@tests/
|
|
2
|
+
import { createWrapperFor } from '@tests/vitest.helpers';
|
|
3
3
|
import { setupListKeyboardNavigation } from '@squirrel/utils/listKeyboardNavigation';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
vi.mock('@squirrel/utils/listKeyboardNavigation', () => {
|
|
6
6
|
return {
|
|
7
|
-
setupListKeyboardNavigation:
|
|
7
|
+
setupListKeyboardNavigation: vi.fn(),
|
|
8
8
|
};
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
-
const destroyFn =
|
|
12
|
-
const initFn =
|
|
11
|
+
const destroyFn = vi.fn();
|
|
12
|
+
const initFn = vi.fn();
|
|
13
13
|
|
|
14
14
|
const createMockedKbdNavigationSvc = () => {
|
|
15
15
|
return {
|
|
@@ -52,10 +52,6 @@ const createVDropdownStub = () => {
|
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
describe('PDropdown.vue', () => {
|
|
55
|
-
afterEach(() => {
|
|
56
|
-
jest.clearAllMocks();
|
|
57
|
-
});
|
|
58
|
-
|
|
59
55
|
it('renders correctly', async () => {
|
|
60
56
|
const wrapper = createWrapperFor(PDropdown, {
|
|
61
57
|
props: {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import PDropdownSelect from '@squirrel/components/p-dropdown-select/p-dropdown-select.vue';
|
|
2
2
|
import filterListItems from '@squirrel/components/p-dropdown-select/p-dropdown-select.mock.json';
|
|
3
3
|
import { cloneDeep } from 'lodash-es';
|
|
4
|
-
import { createWrapperFor, sleep, waitRAF } from '@tests/
|
|
4
|
+
import { createWrapperFor, sleep, waitRAF } from '@tests/vitest.helpers';
|
|
5
5
|
import { ref } from 'vue';
|
|
6
6
|
import { useVirtualizer } from '@tanstack/vue-virtual';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
useVirtualizer:
|
|
8
|
+
vi.mock('@tanstack/vue-virtual', () => ({
|
|
9
|
+
useVirtualizer: vi.fn(),
|
|
10
10
|
}));
|
|
11
11
|
|
|
12
12
|
const createMockedVirtualizer = (count) => {
|
|
@@ -96,13 +96,12 @@ const cleanup = async (wrapper) => {
|
|
|
96
96
|
|
|
97
97
|
describe('PDropdownSelect.vue', () => {
|
|
98
98
|
beforeEach(() => {
|
|
99
|
-
|
|
99
|
+
vi.spyOn(console, 'warn').mockImplementation(() => {});
|
|
100
100
|
});
|
|
101
101
|
|
|
102
102
|
// When using `attachTo: document.body` we have to cleanup the DOM and call `wrapper.destroy()` after each test
|
|
103
103
|
afterEach(() => {
|
|
104
104
|
document.body.innerHTML = '';
|
|
105
|
-
jest.clearAllMocks();
|
|
106
105
|
});
|
|
107
106
|
|
|
108
107
|
it('renders correctly', async () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import PFileUpload from '@squirrel/components/p-file-upload/p-file-upload.vue';
|
|
2
|
-
import { createWrapperFor } from '@tests/
|
|
2
|
+
import { createWrapperFor } from '@tests/vitest.helpers';
|
|
3
3
|
|
|
4
4
|
const createFile = () => {
|
|
5
5
|
const file = new File(['filename'], 'filename.txt', {
|