@pequity/squirrel 3.1.2 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +4 -2
- package/dist/cjs/p-info-icon.js +6 -3
- package/dist/cjs/p-modal.js +5 -5
- package/dist/es/index.js +5 -3
- package/dist/es/p-info-icon.js +6 -3
- package/dist/es/p-modal.js +5 -5
- package/dist/squirrel/components/p-action-bar/p-action-bar.vue.d.ts +1 -0
- package/dist/style.css +15 -15
- package/package.json +10 -11
- package/squirrel/components/p-action-bar/p-action-bar.spec.js +16 -1
- package/squirrel/components/p-action-bar/p-action-bar.stories.js +14 -7
- package/squirrel/components/p-action-bar/p-action-bar.vue +2 -1
- package/squirrel/components/p-info-icon/p-info-icon.spec.js +21 -0
- package/squirrel/components/p-info-icon/p-info-icon.stories.js +32 -0
- package/squirrel/components/p-info-icon/p-info-icon.vue +1 -1
- package/squirrel/components/p-modal/p-modal-features.spec.js +23 -1
- package/squirrel/components/p-modal/p-modal.vue +6 -1
- package/squirrel/components/p-table-header-cell/p-table-header-cell.stories.js +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -75,6 +75,7 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
75
75
|
},
|
|
76
76
|
__name: "p-action-bar",
|
|
77
77
|
props: {
|
|
78
|
+
show: { type: Boolean },
|
|
78
79
|
label: {},
|
|
79
80
|
actions: {}
|
|
80
81
|
},
|
|
@@ -82,7 +83,8 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
82
83
|
setup(__props) {
|
|
83
84
|
return (_ctx, _cache) => {
|
|
84
85
|
return vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
|
|
85
|
-
vue.
|
|
86
|
+
_ctx.show ? (vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
|
|
87
|
+
key: 0,
|
|
86
88
|
class: "fixed bottom-6 left-1/2 z-[100] -translate-x-2/4",
|
|
87
89
|
role: "alertdialog"
|
|
88
90
|
}, _ctx.$attrs), [
|
|
@@ -169,7 +171,7 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
169
171
|
}), 128))
|
|
170
172
|
])
|
|
171
173
|
])
|
|
172
|
-
], 16)
|
|
174
|
+
], 16)) : vue.createCommentVNode("", true)
|
|
173
175
|
]);
|
|
174
176
|
};
|
|
175
177
|
}
|
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-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,
|
|
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-
|
|
37
|
+
const PInfoIcon = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-2662da21"]]);
|
|
35
38
|
module.exports = PInfoIcon;
|
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
|
+
"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
|
-
|
|
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"])
|
|
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-
|
|
368
|
+
const pModal = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-fb5dbd9f"]]);
|
|
369
369
|
module.exports = pModal;
|
package/dist/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { config } from "./config.js";
|
|
2
|
-
import { defineComponent, openBlock, createBlock, Teleport,
|
|
2
|
+
import { defineComponent, openBlock, createBlock, Teleport, createElementBlock, mergeProps, createElementVNode, createVNode, toDisplayString, Fragment, renderList, withCtx, resolveDynamicComponent, createCommentVNode, shallowRef, ref, computed, onMounted, normalizeClass, unref, withModifiers, createTextVNode, withDirectives, vShow, pushScopeId, popScopeId, useAttrs, resolveDirective, normalizeStyle, isRef, renderSlot, provide, onBeforeUnmount, watch, toHandlers } from "vue";
|
|
3
3
|
import PBtn from "./p-btn.js";
|
|
4
4
|
import PCloseBtn from "./p-close-btn.js";
|
|
5
5
|
import PDropdown from "./p-dropdown.js";
|
|
@@ -75,6 +75,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
75
75
|
},
|
|
76
76
|
__name: "p-action-bar",
|
|
77
77
|
props: {
|
|
78
|
+
show: { type: Boolean },
|
|
78
79
|
label: {},
|
|
79
80
|
actions: {}
|
|
80
81
|
},
|
|
@@ -82,7 +83,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
82
83
|
setup(__props) {
|
|
83
84
|
return (_ctx, _cache) => {
|
|
84
85
|
return openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
85
|
-
|
|
86
|
+
_ctx.show ? (openBlock(), createElementBlock("div", mergeProps({
|
|
87
|
+
key: 0,
|
|
86
88
|
class: "fixed bottom-6 left-1/2 z-[100] -translate-x-2/4",
|
|
87
89
|
role: "alertdialog"
|
|
88
90
|
}, _ctx.$attrs), [
|
|
@@ -169,7 +171,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
169
171
|
}), 128))
|
|
170
172
|
])
|
|
171
173
|
])
|
|
172
|
-
], 16)
|
|
174
|
+
], 16)) : createCommentVNode("", true)
|
|
173
175
|
]);
|
|
174
176
|
};
|
|
175
177
|
}
|
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-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,
|
|
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-
|
|
36
|
+
const PInfoIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2662da21"]]);
|
|
34
37
|
export {
|
|
35
38
|
PInfoIcon as default
|
|
36
39
|
};
|
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
|
+
"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
|
-
|
|
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"])
|
|
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-
|
|
367
|
+
const pModal = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-fb5dbd9f"]]);
|
|
368
368
|
export {
|
|
369
369
|
pModal as default
|
|
370
370
|
};
|
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-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-
|
|
412
|
+
}.pm[data-v-fb5dbd9f] {
|
|
413
413
|
width: calc(100% - 32px);
|
|
414
414
|
min-width: 110px;
|
|
415
|
-
max-width: var(--
|
|
415
|
+
max-width: var(--4d751ed2);
|
|
416
416
|
max-height: calc(100vh - 32px);
|
|
417
417
|
}
|
|
418
|
-
.fadeIn[data-v-
|
|
418
|
+
.fadeIn[data-v-fb5dbd9f] {
|
|
419
419
|
animation-duration: 0.4s;
|
|
420
|
-
animation-name: fadeInFrames-
|
|
420
|
+
animation-name: fadeInFrames-fb5dbd9f;
|
|
421
421
|
animation-fill-mode: both;
|
|
422
422
|
}
|
|
423
|
-
.fadeOut[data-v-
|
|
423
|
+
.fadeOut[data-v-fb5dbd9f] {
|
|
424
424
|
animation-duration: 0.2s;
|
|
425
|
-
animation-name: fadeOutFrames-
|
|
425
|
+
animation-name: fadeOutFrames-fb5dbd9f;
|
|
426
426
|
animation-fill-mode: both;
|
|
427
427
|
}
|
|
428
|
-
.slideInTop[data-v-
|
|
428
|
+
.slideInTop[data-v-fb5dbd9f] {
|
|
429
429
|
animation-duration: 0.4s;
|
|
430
|
-
animation-name: fadeInFrames-
|
|
430
|
+
animation-name: fadeInFrames-fb5dbd9f,slideInTopFrames-fb5dbd9f;
|
|
431
431
|
animation-fill-mode: both;
|
|
432
432
|
}
|
|
433
|
-
.slideOutTop[data-v-
|
|
433
|
+
.slideOutTop[data-v-fb5dbd9f] {
|
|
434
434
|
animation-duration: 0.2s;
|
|
435
|
-
animation-name: fadeOutFrames-
|
|
435
|
+
animation-name: fadeOutFrames-fb5dbd9f,slideOutTopFrames-fb5dbd9f;
|
|
436
436
|
animation-fill-mode: both;
|
|
437
437
|
}
|
|
438
|
-
@keyframes slideInTopFrames-
|
|
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-
|
|
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-
|
|
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-
|
|
465
|
+
@keyframes fadeOutFrames-fb5dbd9f {
|
|
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
|
-
"packageManager": "pnpm@
|
|
4
|
+
"version": "4.0.1",
|
|
5
|
+
"packageManager": "pnpm@9.7.1",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"preinstall": "npx only-allow pnpm",
|
|
@@ -71,11 +71,11 @@
|
|
|
71
71
|
"@storybook/theming": "^8.2.9",
|
|
72
72
|
"@storybook/vue3": "^8.2.9",
|
|
73
73
|
"@storybook/vue3-vite": "^8.2.9",
|
|
74
|
-
"@tanstack/vue-virtual": "3.
|
|
74
|
+
"@tanstack/vue-virtual": "3.10.1",
|
|
75
75
|
"@types/jest": "^29.5.12",
|
|
76
76
|
"@types/jsdom": "^21.1.7",
|
|
77
77
|
"@types/lodash-es": "^4.17.12",
|
|
78
|
-
"@types/node": "^22.4.
|
|
78
|
+
"@types/node": "^22.4.2",
|
|
79
79
|
"@vitejs/plugin-vue": "^5.1.2",
|
|
80
80
|
"@vue/compiler-sfc": "3.4.38",
|
|
81
81
|
"@vue/test-utils": "^2.4.6",
|
|
@@ -83,13 +83,13 @@
|
|
|
83
83
|
"autoprefixer": "^10.4.20",
|
|
84
84
|
"babel-jest": "^29.7.0",
|
|
85
85
|
"concurrently": "^8.2.2",
|
|
86
|
-
"dayjs": "1.11.
|
|
86
|
+
"dayjs": "1.11.13",
|
|
87
87
|
"eslint": "^8.57.0",
|
|
88
88
|
"eslint-plugin-storybook": "^0.8.0",
|
|
89
89
|
"floating-vue": "5.2.2",
|
|
90
|
-
"glob": "^
|
|
90
|
+
"glob": "^11.0.0",
|
|
91
91
|
"http-server": "^14.1.1",
|
|
92
|
-
"husky": "^9.1.
|
|
92
|
+
"husky": "^9.1.5",
|
|
93
93
|
"jest": "^29.7.0",
|
|
94
94
|
"jest-environment-jsdom": "^29.7.0",
|
|
95
95
|
"lint-staged": "^15.2.9",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"prettier": "^3.3.3",
|
|
100
100
|
"prettier-plugin-tailwindcss": "^0.6.6",
|
|
101
101
|
"resolve-tspaths": "^0.8.19",
|
|
102
|
-
"rimraf": "^
|
|
102
|
+
"rimraf": "^6.0.1",
|
|
103
103
|
"sass": "^1.77.8",
|
|
104
104
|
"semantic-release": "^24.1.0",
|
|
105
105
|
"storybook": "^8.2.9",
|
|
@@ -108,12 +108,11 @@
|
|
|
108
108
|
"ts-jest": "^29.2.4",
|
|
109
109
|
"typescript": "5.5.4",
|
|
110
110
|
"v-calendar": "3.1.2",
|
|
111
|
-
"vite": "^5.4.
|
|
111
|
+
"vite": "^5.4.2",
|
|
112
112
|
"vue": "3.4.38",
|
|
113
113
|
"vue-currency-input": "3.1.0",
|
|
114
114
|
"vue-router": "4.4.3",
|
|
115
115
|
"vue-toastification": "2.0.0-rc.5",
|
|
116
|
-
"vue-tsc": "2.0.29"
|
|
117
|
-
"wait-on": "^7.2.0"
|
|
116
|
+
"vue-tsc": "2.0.29"
|
|
118
117
|
}
|
|
119
118
|
}
|
|
@@ -48,9 +48,22 @@ const createComponentWrapper = (args = {}) =>
|
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
describe('PActionBar.vue', () => {
|
|
51
|
+
it.each([true, false])('shows/hides when the show prop is %s', async (val) => {
|
|
52
|
+
const wrapper = createComponentWrapper({
|
|
53
|
+
props: { show: false, label: 'Hello World', actions: [{ label: 'Say Hi', name: 'greet' }] },
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
await wrapper.setProps({ show: val });
|
|
57
|
+
|
|
58
|
+
const mainDiv = wrapper.find('.teleport-stub > .fixed.bottom-6');
|
|
59
|
+
|
|
60
|
+
expect(mainDiv.exists()).toBe(val);
|
|
61
|
+
});
|
|
62
|
+
|
|
51
63
|
it('renders correctly', async () => {
|
|
52
64
|
const wrapper = createComponentWrapper({
|
|
53
65
|
props: {
|
|
66
|
+
show: true,
|
|
54
67
|
label: 'Hello World',
|
|
55
68
|
actions: [
|
|
56
69
|
{ label: 'Say Hi', name: 'greet' },
|
|
@@ -93,6 +106,7 @@ describe('PActionBar.vue', () => {
|
|
|
93
106
|
it('attrs fall through ', async () => {
|
|
94
107
|
const wrapper = createComponentWrapper({
|
|
95
108
|
props: {
|
|
109
|
+
show: true,
|
|
96
110
|
label: 'Hello World',
|
|
97
111
|
actions: [
|
|
98
112
|
{ label: 'Say Hi', name: 'greet' },
|
|
@@ -114,7 +128,7 @@ describe('PActionBar.vue', () => {
|
|
|
114
128
|
|
|
115
129
|
it('emits a click:dismiss event', async () => {
|
|
116
130
|
const wrapper = createComponentWrapper({
|
|
117
|
-
props: { label: 'Hello World', actions: [{ label: 'Say Hi', name: 'greet' }] },
|
|
131
|
+
props: { show: true, label: 'Hello World', actions: [{ label: 'Say Hi', name: 'greet' }] },
|
|
118
132
|
});
|
|
119
133
|
|
|
120
134
|
const button = await wrapper.find('button.inline-flex');
|
|
@@ -127,6 +141,7 @@ describe('PActionBar.vue', () => {
|
|
|
127
141
|
it('emits a click:action event with the correct name', async () => {
|
|
128
142
|
const wrapper = createComponentWrapper({
|
|
129
143
|
props: {
|
|
144
|
+
show: true,
|
|
130
145
|
label: 'Hello World',
|
|
131
146
|
actions: [
|
|
132
147
|
{ label: 'Say Hi', name: 'greet' },
|
|
@@ -5,12 +5,11 @@ import PaginateLeftIcon from '@squirrel/assets/pagination-left-icon.svg?inline';
|
|
|
5
5
|
import PaginateRightIcon from '@squirrel/assets/pagination-right-icon.svg?inline';
|
|
6
6
|
import { action } from '@storybook/addon-actions';
|
|
7
7
|
import { expect, fn, userEvent, waitFor, within } from '@storybook/test';
|
|
8
|
-
import { shallowRef } from 'vue';
|
|
9
8
|
|
|
10
9
|
const actionBarActions = [
|
|
11
10
|
{
|
|
12
11
|
label: 'Upload',
|
|
13
|
-
icon:
|
|
12
|
+
icon: FileUploadIcon,
|
|
14
13
|
name: 'upload',
|
|
15
14
|
},
|
|
16
15
|
{
|
|
@@ -23,12 +22,12 @@ const actionBarActions = [
|
|
|
23
22
|
{
|
|
24
23
|
label: 'Subaction 1',
|
|
25
24
|
name: 'subaction1',
|
|
26
|
-
icon:
|
|
25
|
+
icon: PaginateLeftIcon,
|
|
27
26
|
},
|
|
28
27
|
{
|
|
29
28
|
label: 'Subaction 2',
|
|
30
29
|
name: 'subaction2',
|
|
31
|
-
icon:
|
|
30
|
+
icon: PaginateRightIcon,
|
|
32
31
|
},
|
|
33
32
|
],
|
|
34
33
|
},
|
|
@@ -49,22 +48,29 @@ export default {
|
|
|
49
48
|
|
|
50
49
|
export const Default = {
|
|
51
50
|
render: (args) => ({
|
|
52
|
-
components: { PActionBar },
|
|
51
|
+
components: { PActionBar, PBtn },
|
|
53
52
|
setup() {
|
|
54
53
|
const onDismiss = action('dismiss');
|
|
54
|
+
|
|
55
55
|
const onAction = action('action');
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
const setShow = (val) => {
|
|
58
|
+
args.show = val;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
return { args, onAction, onDismiss, setShow };
|
|
58
62
|
},
|
|
59
63
|
template: `
|
|
60
64
|
<div class="h-20">
|
|
61
|
-
<
|
|
65
|
+
<PBtn class="mr-2" @click="setShow(!args.show)">Toggle action bar</PBtn>
|
|
66
|
+
<PActionBar v-bind="args" @click:dismiss="onDismiss(), setShow(false)" @click:action="onAction" />
|
|
62
67
|
</div>
|
|
63
68
|
`,
|
|
64
69
|
}),
|
|
65
70
|
args: {
|
|
66
71
|
label: 'Hello World',
|
|
67
72
|
actions: actionBarActions,
|
|
73
|
+
show: false,
|
|
68
74
|
},
|
|
69
75
|
};
|
|
70
76
|
|
|
@@ -89,6 +95,7 @@ export const WithAnElementBehind = {
|
|
|
89
95
|
args: {
|
|
90
96
|
label: 'Hello World',
|
|
91
97
|
actions: actionBarActions,
|
|
98
|
+
show: true,
|
|
92
99
|
onClick: fn(),
|
|
93
100
|
},
|
|
94
101
|
play: async ({ args, canvasElement }) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Teleport to="body">
|
|
3
|
-
<div class="fixed bottom-6 left-1/2 z-[100] -translate-x-2/4" role="alertdialog" v-bind="$attrs">
|
|
3
|
+
<div v-if="show" class="fixed bottom-6 left-1/2 z-[100] -translate-x-2/4" role="alertdialog" v-bind="$attrs">
|
|
4
4
|
<div
|
|
5
5
|
class="flex h-12 w-max select-none items-center rounded-lg bg-p-purple-60 px-2 text-sm font-medium text-white"
|
|
6
6
|
>
|
|
@@ -64,6 +64,7 @@ defineOptions({
|
|
|
64
64
|
});
|
|
65
65
|
|
|
66
66
|
type Props = {
|
|
67
|
+
show: boolean;
|
|
67
68
|
label: string;
|
|
68
69
|
actions: PActionBarAction[];
|
|
69
70
|
};
|
|
@@ -55,4 +55,25 @@ describe('PInfoIcon.vue', () => {
|
|
|
55
55
|
|
|
56
56
|
expect(wrapper.text()).toBe('Lorem ipsum dolor sit amet.');
|
|
57
57
|
});
|
|
58
|
+
|
|
59
|
+
it('tooltip should stay visible on hover', async () => {
|
|
60
|
+
const wrapper = createWrapperFor(PInfoIcon, {
|
|
61
|
+
props: {
|
|
62
|
+
text: '',
|
|
63
|
+
},
|
|
64
|
+
slots: {
|
|
65
|
+
default: 'Lorem ipsum dolor sit amet.',
|
|
66
|
+
},
|
|
67
|
+
global: {
|
|
68
|
+
stubs: {
|
|
69
|
+
VTooltip: true,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
const tooltip = wrapper.findComponent('v-tooltip-stub');
|
|
75
|
+
|
|
76
|
+
expect(tooltip.props().popperTriggers).toEqual(['hover']);
|
|
77
|
+
expect(tooltip.props().delay).toEqual({ show: 750, hide: 0 });
|
|
78
|
+
});
|
|
58
79
|
});
|
|
@@ -55,3 +55,35 @@ export const DifferentPlacements = {
|
|
|
55
55
|
},
|
|
56
56
|
},
|
|
57
57
|
};
|
|
58
|
+
|
|
59
|
+
export const WithBigText = {
|
|
60
|
+
render: (args) => ({
|
|
61
|
+
components: { PInfoIcon },
|
|
62
|
+
setup() {
|
|
63
|
+
return { args };
|
|
64
|
+
},
|
|
65
|
+
template: `
|
|
66
|
+
<div class="w-full pt-60 pb-20 flex justify-center">
|
|
67
|
+
<PInfoIcon v-bind="args" />
|
|
68
|
+
</div>`,
|
|
69
|
+
}),
|
|
70
|
+
args: {
|
|
71
|
+
text: `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed malesuada convallis ultricies.
|
|
72
|
+
Pellentesque rhoncus felis et neque pellentesque pretium.
|
|
73
|
+
|
|
74
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed malesuada convallis ultricies.
|
|
75
|
+
Pellentesque rhoncus felis et neque pellentesque pretium.
|
|
76
|
+
|
|
77
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed malesuada convallis ultricies.
|
|
78
|
+
Pellentesque rhoncus felis et neque pellentesque pretium.
|
|
79
|
+
`,
|
|
80
|
+
placement: 'top',
|
|
81
|
+
},
|
|
82
|
+
parameters: {
|
|
83
|
+
docs: {
|
|
84
|
+
description: {
|
|
85
|
+
story: `The info tooltip allows for long text and the ability to scroll.`,
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
};
|
|
@@ -9,7 +9,7 @@ const ModalParent = {
|
|
|
9
9
|
template: `
|
|
10
10
|
<div>
|
|
11
11
|
<button type="button" class="open-modal-1" @click="showModal1 = true">Open modal 1</button>
|
|
12
|
-
<Modal1 wrapperClass="modal-1" v-model="showModal1" :title="title" :live="live">
|
|
12
|
+
<Modal1 wrapperClass="modal-1" v-model="showModal1" :title="title" :live="live" :enable-close="enableClose">
|
|
13
13
|
<div>
|
|
14
14
|
<input v-if="showInput" type="text" value="" autofocus class="text-input" />
|
|
15
15
|
<button type="button" class="open-modal-2" @click="showModal2 = true">Open modal 2</button>
|
|
@@ -52,6 +52,7 @@ const createModalsWrapper = (data) => {
|
|
|
52
52
|
title: 'Test title',
|
|
53
53
|
showModal1: false,
|
|
54
54
|
showModal2: false,
|
|
55
|
+
enableClose: true,
|
|
55
56
|
},
|
|
56
57
|
...data,
|
|
57
58
|
};
|
|
@@ -321,4 +322,25 @@ describe('Modal features', () => {
|
|
|
321
322
|
|
|
322
323
|
wrapper.unmount();
|
|
323
324
|
});
|
|
325
|
+
|
|
326
|
+
it('makes the close button invisible instead of hidden, when enableClose is false', async () => {
|
|
327
|
+
const wrapper = createModalsWrapper({
|
|
328
|
+
enableClose: false,
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
await waitNT(wrapper.vm);
|
|
332
|
+
|
|
333
|
+
await wrapper.find('.open-modal-1').trigger('click');
|
|
334
|
+
|
|
335
|
+
await sleep(100);
|
|
336
|
+
|
|
337
|
+
const modal1 = wrapper.getComponent('.modal-1');
|
|
338
|
+
|
|
339
|
+
const closeBtn = modal1.find('button[aria-label="Close"]');
|
|
340
|
+
|
|
341
|
+
expect(closeBtn.isVisible()).toBe(true);
|
|
342
|
+
expect(closeBtn.classes()).toContain('invisible');
|
|
343
|
+
|
|
344
|
+
wrapper.unmount();
|
|
345
|
+
});
|
|
324
346
|
});
|
|
@@ -36,7 +36,12 @@
|
|
|
36
36
|
{{ title }}
|
|
37
37
|
</h3>
|
|
38
38
|
<div class="ml-auto">
|
|
39
|
-
<PCloseBtn
|
|
39
|
+
<PCloseBtn
|
|
40
|
+
:disabled="disabled"
|
|
41
|
+
:class="{ invisible: !enableClose }"
|
|
42
|
+
:aria-label="closeLabel"
|
|
43
|
+
@click.prevent="close"
|
|
44
|
+
/>
|
|
40
45
|
</div>
|
|
41
46
|
</div>
|
|
42
47
|
</slot>
|