@pequity/squirrel 10.0.0 → 10.0.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/p-action-bar.js +3 -3
- package/dist/cjs/chunks/p-btn.js +1 -1
- package/dist/cjs/chunks/p-icon.js +1 -1
- package/dist/cjs/chunks/p-info-icon.js +2 -2
- package/dist/cjs/chunks/p-inline-date-picker.js +6 -6
- package/dist/cjs/chunks/p-input-number.js +1 -1
- package/dist/cjs/chunks/p-link.js +2 -2
- package/dist/cjs/chunks/p-progress-bar.js +2 -2
- package/dist/cjs/chunks/p-select-btn.js +11 -11
- package/dist/cjs/chunks/p-steps.js +4 -4
- package/dist/cjs/chunks/p-table-header-cell.js +9 -9
- package/dist/cjs/chunks/p-tabs-pills.js +8 -8
- package/dist/cjs/index.js +13 -13
- package/dist/cjs/p-drawer.js +1 -1
- package/dist/es/chunks/p-action-bar.js +3 -3
- package/dist/es/chunks/p-btn.js +1 -1
- package/dist/es/chunks/p-icon.js +1 -1
- package/dist/es/chunks/p-info-icon.js +2 -2
- package/dist/es/chunks/p-inline-date-picker.js +6 -6
- package/dist/es/chunks/p-input-number.js +1 -1
- package/dist/es/chunks/p-link.js +2 -2
- package/dist/es/chunks/p-progress-bar.js +2 -2
- package/dist/es/chunks/p-select-btn.js +11 -11
- package/dist/es/chunks/p-steps.js +4 -4
- package/dist/es/chunks/p-table-header-cell.js +9 -9
- package/dist/es/chunks/p-tabs-pills.js +8 -8
- package/dist/es/index.js +13 -13
- package/dist/es/p-drawer.js +1 -1
- package/dist/squirrel/components/p-action-bar/p-action-bar.vue.d.ts +2 -1
- package/dist/squirrel/components/p-alert/p-alert.vue.d.ts +2 -1
- package/dist/squirrel/components/p-avatar/p-avatar.vue.d.ts +2 -1
- package/dist/squirrel/components/p-btn/p-btn.vue.d.ts +5 -4
- package/dist/squirrel/components/p-card/p-card.vue.d.ts +3 -2
- package/dist/squirrel/components/p-checkbox/p-checkbox.vue.d.ts +3 -2
- package/dist/squirrel/components/p-chips/p-chips.vue.d.ts +10 -9
- package/dist/squirrel/components/p-close-btn/p-close-btn.vue.d.ts +2 -1
- package/dist/squirrel/components/p-date-picker/p-date-picker.vue.d.ts +4 -2
- package/dist/squirrel/components/p-drawer/p-drawer.vue.d.ts +9 -8
- package/dist/squirrel/components/p-dropdown/p-dropdown.vue.d.ts +9 -8
- package/dist/squirrel/components/p-dropdown-select/p-dropdown-select.vue.d.ts +3 -2
- package/dist/squirrel/components/p-file-upload/p-file-upload.vue.d.ts +2 -1
- package/dist/squirrel/components/p-icon/p-icon.vue.d.ts +2 -1
- package/dist/squirrel/components/p-info-icon/p-info-icon.vue.d.ts +3 -2
- package/dist/squirrel/components/p-inline-date-picker/p-inline-date-picker.vue.d.ts +5 -3
- package/dist/squirrel/components/p-input/p-input.vue.d.ts +2 -1
- package/dist/squirrel/components/p-input-number/p-input-number.vue.d.ts +3 -2
- package/dist/squirrel/components/p-input-percent/p-input-percent.vue.d.ts +2 -1
- package/dist/squirrel/components/p-input-search/p-input-search.vue.d.ts +2 -1
- package/dist/squirrel/components/p-link/p-link.vue.d.ts +3 -2
- package/dist/squirrel/components/p-loading/p-loading.vue.d.ts +2 -1
- package/dist/squirrel/components/p-modal/p-modal.vue.d.ts +3 -2
- package/dist/squirrel/components/p-pagination/p-pagination.vue.d.ts +2 -1
- package/dist/squirrel/components/p-pagination-info/p-pagination-info.vue.d.ts +3 -2
- package/dist/squirrel/components/p-progress-bar/p-progress-bar.vue.d.ts +2 -1
- package/dist/squirrel/components/p-ring-loader/p-ring-loader.vue.d.ts +2 -1
- package/dist/squirrel/components/p-select/p-select.vue.d.ts +3 -2
- package/dist/squirrel/components/p-select-btn/p-select-btn.vue.d.ts +3 -2
- package/dist/squirrel/components/p-select-list/p-select-list.vue.d.ts +3 -2
- package/dist/squirrel/components/p-select-pill/p-select-pill.vue.d.ts +9 -8
- package/dist/squirrel/components/p-skeleton-loader/p-skeleton-loader.vue.d.ts +10 -9
- package/dist/squirrel/components/p-steps/p-steps.vue.d.ts +2 -1
- package/dist/squirrel/components/p-table/p-table.vue.d.ts +10 -9
- package/dist/squirrel/components/p-table-header-cell/p-table-header-cell.vue.d.ts +3 -2
- package/dist/squirrel/components/p-table-loader/p-table-loader.vue.d.ts +2 -1
- package/dist/squirrel/components/p-table-sort/p-table-sort.vue.d.ts +2 -1
- package/dist/squirrel/components/p-table-td/p-table-td.vue.d.ts +3 -2
- package/dist/squirrel/components/p-tabs/p-tabs.vue.d.ts +2 -1
- package/dist/squirrel/components/p-tabs-pills/p-tabs-pills.vue.d.ts +2 -1
- package/dist/squirrel/components/p-textarea/p-textarea.vue.d.ts +3 -2
- package/dist/squirrel/components/p-toggle/p-toggle.vue.d.ts +2 -1
- package/dist/squirrel.css +1 -1
- package/package.json +24 -24
- package/squirrel/components/p-action-bar/p-action-bar.spec.ts +4 -4
- package/squirrel/components/p-btn/p-btn.spec.js +3 -0
- package/squirrel/components/p-btn/p-btn.vue +1 -1
- package/squirrel/components/p-dropdown-select/p-dropdown-select.spec.js +1 -1
- package/squirrel/components/p-input-number/p-input-number.spec.js +1 -1
- package/squirrel/components/p-input-number/p-input-number.vue +1 -3
- package/squirrel/components/p-modal/p-modal-features.spec.js +20 -16
- package/squirrel/components/p-select-btn/p-select-btn.spec.js +2 -2
- package/squirrel/components/p-select-btn/p-select-btn.vue +1 -1
- package/squirrel/components/p-select-list/p-select-list.spec.js +1 -1
- package/squirrel/components/p-table-sort/p-table-sort.spec.js +40 -21
- package/squirrel/utils/listKeyboardNavigation.spec.js +3 -1
- package/squirrel/utils/sanitization.spec.js +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
v-for="(item, index) in items"
|
|
5
5
|
:key="String(item[itemValue])"
|
|
6
6
|
v-tooltip="{ content: tooltipText(item) }"
|
|
7
|
-
:class="['inline-flex', { '
|
|
7
|
+
:class="['inline-flex', { '[&_*]:px-0 [&_*]:py-0': noPadding, grow }]"
|
|
8
8
|
>
|
|
9
9
|
<PBtn
|
|
10
10
|
:size="size"
|
|
@@ -525,7 +525,7 @@ describe('PSelectList.vue', () => {
|
|
|
525
525
|
const pSelectListCmp = wrapper.findComponent(PSelectList);
|
|
526
526
|
|
|
527
527
|
expect(wrapper.vm.$data.selected).toEqual([]);
|
|
528
|
-
expect(console.warn).
|
|
528
|
+
expect(console.warn).toHaveBeenCalledExactlyOnceWith(
|
|
529
529
|
`[p-select-list] Some values in the modelValue are not in the items list.`
|
|
530
530
|
);
|
|
531
531
|
expect(pSelectListCmp.emitted()['update:modelValue'][0][0]).toEqual([]);
|
|
@@ -32,19 +32,29 @@ describe('PTableSort.vue', () => {
|
|
|
32
32
|
let selected;
|
|
33
33
|
|
|
34
34
|
await wrapper.setData({ selected: SORTING_TYPES.ASC });
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
expect(
|
|
35
|
+
// Use specific selector to target the inner div with text-sm class
|
|
36
|
+
selected = wrapper.findByText('Sort ascending', '.text-sm');
|
|
37
|
+
expect(selected.exists()).toBe(true);
|
|
38
|
+
expect(selected.classes()).toContain('text-primary');
|
|
39
|
+
expect(wrapper.find('.cursor-pointer.opacity-100').exists()).toBe(true);
|
|
38
40
|
|
|
39
41
|
await wrapper.setData({ selected: SORTING_TYPES.DESC });
|
|
40
|
-
selected = wrapper.
|
|
41
|
-
expect(selected.
|
|
42
|
-
expect(
|
|
42
|
+
selected = wrapper.findByText('Sort descending', '.text-sm');
|
|
43
|
+
expect(selected.exists()).toBe(true);
|
|
44
|
+
expect(selected.classes()).toContain('text-primary');
|
|
45
|
+
expect(wrapper.find('.cursor-pointer.opacity-100').exists()).toBe(true);
|
|
43
46
|
|
|
44
47
|
await wrapper.setData({ selected: SORTING_TYPES.NO_SORTING });
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
// When NO_SORTING is set, no sort option should have text-primary class
|
|
49
|
+
const ascendingOption = wrapper.findByText('Sort ascending', '.text-sm');
|
|
50
|
+
const descendingOption = wrapper.findByText('Sort descending', '.text-sm');
|
|
51
|
+
expect(ascendingOption.classes()).not.toContain('text-primary');
|
|
52
|
+
expect(descendingOption.classes()).not.toContain('text-primary');
|
|
53
|
+
// Check that the Clear button has opacity-50 (not cursor-pointer and opacity-100)
|
|
54
|
+
const clearButton = wrapper.findByText('Clear');
|
|
55
|
+
expect(clearButton.classes()).toContain('opacity-50');
|
|
56
|
+
expect(clearButton.classes()).not.toContain('cursor-pointer');
|
|
57
|
+
expect(clearButton.classes()).not.toContain('opacity-100');
|
|
48
58
|
});
|
|
49
59
|
|
|
50
60
|
it(`updates the value bound with v-model when an option is clicked`, async () => {
|
|
@@ -60,19 +70,28 @@ describe('PTableSort.vue', () => {
|
|
|
60
70
|
|
|
61
71
|
let selected;
|
|
62
72
|
|
|
63
|
-
await wrapper.findAll('
|
|
64
|
-
selected = wrapper.
|
|
65
|
-
expect(selected.
|
|
66
|
-
expect(
|
|
73
|
+
await wrapper.findAll('.cursor-pointer.justify-between')[0].trigger('click');
|
|
74
|
+
selected = wrapper.findByText('Sort ascending', '.text-sm');
|
|
75
|
+
expect(selected.exists()).toBe(true);
|
|
76
|
+
expect(selected.classes()).toContain('text-primary');
|
|
77
|
+
expect(wrapper.find('.cursor-pointer.opacity-100').exists()).toBe(true);
|
|
67
78
|
|
|
68
|
-
await wrapper.findAll('
|
|
69
|
-
selected = wrapper.
|
|
70
|
-
expect(selected.
|
|
71
|
-
expect(
|
|
79
|
+
await wrapper.findAll('.cursor-pointer.justify-between')[1].trigger('click');
|
|
80
|
+
selected = wrapper.findByText('Sort descending', '.text-sm');
|
|
81
|
+
expect(selected.exists()).toBe(true);
|
|
82
|
+
expect(selected.classes()).toContain('text-primary');
|
|
83
|
+
expect(wrapper.find('.cursor-pointer.opacity-100').exists()).toBe(true);
|
|
72
84
|
|
|
73
|
-
await wrapper.find('
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
85
|
+
await wrapper.find('.cursor-pointer.opacity-100').trigger('click');
|
|
86
|
+
// After clearing, no sort option should have text-primary class
|
|
87
|
+
const ascendingOption = wrapper.findByText('Sort ascending', '.text-sm');
|
|
88
|
+
const descendingOption = wrapper.findByText('Sort descending', '.text-sm');
|
|
89
|
+
expect(ascendingOption.classes()).not.toContain('text-primary');
|
|
90
|
+
expect(descendingOption.classes()).not.toContain('text-primary');
|
|
91
|
+
// Check that the Clear button has opacity-50 (not cursor-pointer and opacity-100)
|
|
92
|
+
const clearButton = wrapper.findByText('Clear');
|
|
93
|
+
expect(clearButton.classes()).toContain('opacity-50');
|
|
94
|
+
expect(clearButton.classes()).not.toContain('cursor-pointer');
|
|
95
|
+
expect(clearButton.classes()).not.toContain('opacity-100');
|
|
77
96
|
});
|
|
78
97
|
});
|
|
@@ -198,7 +198,9 @@ describe('listKeyboardNavigation', () => {
|
|
|
198
198
|
const navigationSvc1 = createTestSvc();
|
|
199
199
|
const navigationSvc2 = createTestSvc();
|
|
200
200
|
|
|
201
|
-
expect(consoleWarnSpy).
|
|
201
|
+
expect(consoleWarnSpy).toHaveBeenCalledExactlyOnceWith(
|
|
202
|
+
'There can only be one instance of list navigation active at a time.'
|
|
203
|
+
);
|
|
202
204
|
|
|
203
205
|
navigationSvc1.destroy();
|
|
204
206
|
navigationSvc2.destroy();
|
|
@@ -11,7 +11,7 @@ describe('sanitizeUrl', () => {
|
|
|
11
11
|
const unsafeUrl = 'javascript:evil()';
|
|
12
12
|
|
|
13
13
|
expect(sanitizeUrl(unsafeUrl)).toBe(`unsafe:${unsafeUrl}`);
|
|
14
|
-
expect(consoleMock).
|
|
14
|
+
expect(consoleMock).toHaveBeenCalledExactlyOnceWith(
|
|
15
15
|
expect.stringContaining(`WARNING: sanitizing unsafe URL value ${unsafeUrl}`)
|
|
16
16
|
);
|
|
17
17
|
});
|