@pequity/squirrel 8.4.0 → 8.4.2
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/chunks/index.js +3 -4
- package/dist/cjs/chunks/p-dropdown-select.js +13 -14
- package/dist/cjs/chunks/p-icon.js +13 -16
- package/dist/cjs/chunks/p-steps.js +58 -0
- package/dist/cjs/dom.js +1 -2
- package/dist/cjs/index.js +36 -89
- package/dist/cjs/listKeyboardNavigation.js +2 -2
- package/dist/cjs/p-dropdown.js +1 -2
- package/dist/cjs/p-file-upload.js +1 -2
- package/dist/cjs/p-input-search.js +1 -2
- package/dist/cjs/p-modal.js +4 -7
- package/dist/cjs/p-skeleton-loader.js +1 -4
- package/dist/cjs/p-steps.js +2 -0
- package/dist/cjs/usePLoading.js +2 -8
- package/dist/cjs/usePTableColResize.js +1 -2
- package/dist/cjs/usePTableRowVirtualizer.js +2 -2
- package/dist/cjs/useSelectList.js +13 -21
- package/dist/es/chunks/index.js +3 -4
- package/dist/es/chunks/p-dropdown-select.js +15 -16
- package/dist/es/chunks/p-icon.js +13 -16
- package/dist/es/chunks/p-steps.js +59 -0
- package/dist/es/dom.js +1 -2
- package/dist/es/index.js +69 -122
- package/dist/es/listKeyboardNavigation.js +2 -2
- package/dist/es/p-dropdown-select.js +1 -1
- package/dist/es/p-dropdown.js +1 -2
- package/dist/es/p-file-upload.js +1 -2
- package/dist/es/p-input-search.js +1 -2
- package/dist/es/p-modal.js +4 -7
- package/dist/es/p-skeleton-loader.js +1 -4
- package/dist/es/p-steps.js +4 -1
- package/dist/es/usePLoading.js +2 -8
- package/dist/es/usePTableColResize.js +1 -2
- package/dist/es/usePTableRowVirtualizer.js +2 -2
- package/dist/es/useSelectList.js +13 -21
- package/dist/squirrel/components/p-btn/p-btn.vue.d.ts +2 -2
- package/dist/squirrel/components/p-info-icon/p-info-icon.vue.d.ts +2 -2
- package/dist/squirrel/components/p-input/p-input.vue.d.ts +1 -1
- package/dist/squirrel/components/p-input-number/p-input-number.vue.d.ts +2 -2
- package/dist/squirrel/components/p-link/p-link.vue.d.ts +2 -2
- package/dist/squirrel/components/p-modal/p-modal.vue.d.ts +6 -6
- package/dist/squirrel/components/p-pagination-info/p-pagination-info.vue.d.ts +2 -2
- package/dist/squirrel/components/p-table/p-table.vue.d.ts +1 -1
- package/dist/squirrel.css +74 -74
- package/package.json +30 -33
- package/squirrel/components/p-action-bar/p-action-bar.stories.js +4 -3
- package/squirrel/components/p-dropdown-select/p-dropdown-select.spec.js +38 -29
- package/squirrel/components/p-dropdown-select/p-dropdown-select.vue +4 -7
- package/squirrel/components/p-input-number/p-input-number.stories.js +2 -1
- package/squirrel/components/p-select-list/p-select-list.spec.js +22 -4
- package/squirrel/components/p-select-list/p-select-list.vue +3 -2
- package/squirrel/components/p-select-list/useSelectList.ts +2 -2
- package/squirrel/components/p-tabs/p-tabs.stories.js +2 -1
|
@@ -96,7 +96,7 @@ export const WithPrefix = {
|
|
|
96
96
|
},
|
|
97
97
|
template: `
|
|
98
98
|
<div class="space-y-4">
|
|
99
|
-
<PInputNumber v-bind="args"
|
|
99
|
+
<PInputNumber v-bind="args" prefixString="$" label="Using prefix prop" />
|
|
100
100
|
<PInputNumber v-bind="args" label="Using prefix slot">
|
|
101
101
|
<template #prefix>
|
|
102
102
|
<span class="text-primary font-semibold">$</span>
|
|
@@ -107,6 +107,7 @@ export const WithPrefix = {
|
|
|
107
107
|
}),
|
|
108
108
|
args: {
|
|
109
109
|
modelValue: 1234,
|
|
110
|
+
prefixString: '$',
|
|
110
111
|
},
|
|
111
112
|
parameters: {
|
|
112
113
|
docs: {
|
|
@@ -332,6 +332,20 @@ describe('PSelectList.vue', () => {
|
|
|
332
332
|
cleanup(wrapper);
|
|
333
333
|
});
|
|
334
334
|
|
|
335
|
+
it('displays a spacer on non-selected items', async () => {
|
|
336
|
+
useVirtualizer.mockImplementation(() => createMockedVirtualizer(20));
|
|
337
|
+
|
|
338
|
+
const wrapper = createWrapper({ selected: [] }, { multiple: true });
|
|
339
|
+
|
|
340
|
+
const checkIcons = wrapper.findAll('[p-select-list-option-item] img');
|
|
341
|
+
const spacers = wrapper.findAll('[p-select-list-option-item] .w-\\[26px\\].pl-2');
|
|
342
|
+
|
|
343
|
+
expect(checkIcons.length).toBe(0);
|
|
344
|
+
expect(spacers.length).toBe(20);
|
|
345
|
+
|
|
346
|
+
cleanup(wrapper);
|
|
347
|
+
});
|
|
348
|
+
|
|
335
349
|
it('works with an object for v-model', async () => {
|
|
336
350
|
useVirtualizer.mockImplementation(() => createMockedVirtualizer(20));
|
|
337
351
|
|
|
@@ -531,9 +545,11 @@ describe('PSelectList.vue', () => {
|
|
|
531
545
|
|
|
532
546
|
listItems.forEach((item, i) => {
|
|
533
547
|
if (i === 0 || i === 1) {
|
|
534
|
-
expect(item.classes()).toContain('
|
|
548
|
+
expect(item.classes()).toContain('cursor-default');
|
|
549
|
+
expect(item.classes()).not.toContain('cursor-pointer');
|
|
535
550
|
} else {
|
|
536
|
-
expect(item.classes()).
|
|
551
|
+
expect(item.classes()).toContain('cursor-pointer');
|
|
552
|
+
expect(item.classes()).not.toContain('cursor-default');
|
|
537
553
|
}
|
|
538
554
|
});
|
|
539
555
|
|
|
@@ -553,9 +569,11 @@ describe('PSelectList.vue', () => {
|
|
|
553
569
|
|
|
554
570
|
listItems.forEach((item, i) => {
|
|
555
571
|
if (i === 0 || i === 1) {
|
|
556
|
-
expect(item.classes()).toContain('
|
|
572
|
+
expect(item.classes()).toContain('cursor-default');
|
|
573
|
+
expect(item.classes()).not.toContain('cursor-pointer');
|
|
557
574
|
} else {
|
|
558
|
-
expect(item.classes()).
|
|
575
|
+
expect(item.classes()).toContain('cursor-pointer');
|
|
576
|
+
expect(item.classes()).not.toContain('cursor-default');
|
|
559
577
|
}
|
|
560
578
|
});
|
|
561
579
|
|
|
@@ -75,12 +75,12 @@
|
|
|
75
75
|
LIST_ITEM_CLASS,
|
|
76
76
|
{
|
|
77
77
|
[LIST_ITEM_ACTIVE_CLASS]: isSelected(getValue(row.index)),
|
|
78
|
-
[LIST_ITEM_DISABLED_CLASS]: isDisabled(computedItems[row.index]),
|
|
79
78
|
},
|
|
79
|
+
isDisabled(computedItems[row.index]) ? LIST_ITEM_DISABLED_CLASS : 'cursor-pointer',
|
|
80
80
|
]"
|
|
81
81
|
p-select-list-option-item
|
|
82
82
|
:style="listItemStyle"
|
|
83
|
-
@click="select($event, getValue(row.index))"
|
|
83
|
+
@click="!isDisabled(computedItems[row.index]) && select($event, getValue(row.index))"
|
|
84
84
|
>
|
|
85
85
|
<div :class="['flex items-center', { [SIZES[size]]: !itemSize }]">
|
|
86
86
|
<slot
|
|
@@ -104,6 +104,7 @@
|
|
|
104
104
|
class="ml-auto fill-p-purple-60 pl-2"
|
|
105
105
|
src="@squirrel/assets/select-check.svg"
|
|
106
106
|
/>
|
|
107
|
+
<div v-else class="ml-auto h-4 w-[26px] pl-2"></div>
|
|
107
108
|
</div>
|
|
108
109
|
</div>
|
|
109
110
|
</div>
|
|
@@ -44,9 +44,9 @@ const nextLoop = (ms?: number) => new Promise((resolve) => setTimeout(resolve, m
|
|
|
44
44
|
// Constants
|
|
45
45
|
const LIST_ITEM_SIZES = { sm: 32, md: 40, lg: 48 };
|
|
46
46
|
const LIST_ITEM_CLASS =
|
|
47
|
-
'clear-both block w-full
|
|
47
|
+
'clear-both block w-full whitespace-nowrap py-1 px-3 text-left text-sm font-medium hover:bg-p-blue-10';
|
|
48
48
|
const LIST_ITEM_ACTIVE_CLASS = 'selected';
|
|
49
|
-
const LIST_ITEM_DISABLED_CLASS = 'opacity-30
|
|
49
|
+
const LIST_ITEM_DISABLED_CLASS = 'opacity-30 cursor-default';
|
|
50
50
|
|
|
51
51
|
export const useSelectList = (props: Props, inputSearch: InputSearch, virtualizerRef: VirtualizerRef, emit: Emits) => {
|
|
52
52
|
// Data
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import PaginateRightIcon from '@squirrel/assets/pagination-right-icon.svg?inline';
|
|
2
2
|
import PTabs from '@squirrel/components/p-tabs/p-tabs.vue';
|
|
3
3
|
import { action } from 'storybook/actions';
|
|
4
|
+
import { markRaw } from 'vue';
|
|
4
5
|
|
|
5
6
|
export default {
|
|
6
7
|
title: 'Components/PTabs',
|
|
@@ -34,7 +35,7 @@ export const Default = {
|
|
|
34
35
|
{
|
|
35
36
|
title: 'Tab 2',
|
|
36
37
|
name: 'tab2',
|
|
37
|
-
icon: PaginateRightIcon,
|
|
38
|
+
icon: markRaw(PaginateRightIcon),
|
|
38
39
|
},
|
|
39
40
|
{
|
|
40
41
|
title: 'Tab 3',
|