@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.
Files changed (85) hide show
  1. package/dist/cjs/chunks/p-action-bar.js +3 -3
  2. package/dist/cjs/chunks/p-btn.js +1 -1
  3. package/dist/cjs/chunks/p-icon.js +1 -1
  4. package/dist/cjs/chunks/p-info-icon.js +2 -2
  5. package/dist/cjs/chunks/p-inline-date-picker.js +6 -6
  6. package/dist/cjs/chunks/p-input-number.js +1 -1
  7. package/dist/cjs/chunks/p-link.js +2 -2
  8. package/dist/cjs/chunks/p-progress-bar.js +2 -2
  9. package/dist/cjs/chunks/p-select-btn.js +11 -11
  10. package/dist/cjs/chunks/p-steps.js +4 -4
  11. package/dist/cjs/chunks/p-table-header-cell.js +9 -9
  12. package/dist/cjs/chunks/p-tabs-pills.js +8 -8
  13. package/dist/cjs/index.js +13 -13
  14. package/dist/cjs/p-drawer.js +1 -1
  15. package/dist/es/chunks/p-action-bar.js +3 -3
  16. package/dist/es/chunks/p-btn.js +1 -1
  17. package/dist/es/chunks/p-icon.js +1 -1
  18. package/dist/es/chunks/p-info-icon.js +2 -2
  19. package/dist/es/chunks/p-inline-date-picker.js +6 -6
  20. package/dist/es/chunks/p-input-number.js +1 -1
  21. package/dist/es/chunks/p-link.js +2 -2
  22. package/dist/es/chunks/p-progress-bar.js +2 -2
  23. package/dist/es/chunks/p-select-btn.js +11 -11
  24. package/dist/es/chunks/p-steps.js +4 -4
  25. package/dist/es/chunks/p-table-header-cell.js +9 -9
  26. package/dist/es/chunks/p-tabs-pills.js +8 -8
  27. package/dist/es/index.js +13 -13
  28. package/dist/es/p-drawer.js +1 -1
  29. package/dist/squirrel/components/p-action-bar/p-action-bar.vue.d.ts +2 -1
  30. package/dist/squirrel/components/p-alert/p-alert.vue.d.ts +2 -1
  31. package/dist/squirrel/components/p-avatar/p-avatar.vue.d.ts +2 -1
  32. package/dist/squirrel/components/p-btn/p-btn.vue.d.ts +5 -4
  33. package/dist/squirrel/components/p-card/p-card.vue.d.ts +3 -2
  34. package/dist/squirrel/components/p-checkbox/p-checkbox.vue.d.ts +3 -2
  35. package/dist/squirrel/components/p-chips/p-chips.vue.d.ts +10 -9
  36. package/dist/squirrel/components/p-close-btn/p-close-btn.vue.d.ts +2 -1
  37. package/dist/squirrel/components/p-date-picker/p-date-picker.vue.d.ts +4 -2
  38. package/dist/squirrel/components/p-drawer/p-drawer.vue.d.ts +9 -8
  39. package/dist/squirrel/components/p-dropdown/p-dropdown.vue.d.ts +9 -8
  40. package/dist/squirrel/components/p-dropdown-select/p-dropdown-select.vue.d.ts +3 -2
  41. package/dist/squirrel/components/p-file-upload/p-file-upload.vue.d.ts +2 -1
  42. package/dist/squirrel/components/p-icon/p-icon.vue.d.ts +2 -1
  43. package/dist/squirrel/components/p-info-icon/p-info-icon.vue.d.ts +3 -2
  44. package/dist/squirrel/components/p-inline-date-picker/p-inline-date-picker.vue.d.ts +5 -3
  45. package/dist/squirrel/components/p-input/p-input.vue.d.ts +2 -1
  46. package/dist/squirrel/components/p-input-number/p-input-number.vue.d.ts +3 -2
  47. package/dist/squirrel/components/p-input-percent/p-input-percent.vue.d.ts +2 -1
  48. package/dist/squirrel/components/p-input-search/p-input-search.vue.d.ts +2 -1
  49. package/dist/squirrel/components/p-link/p-link.vue.d.ts +3 -2
  50. package/dist/squirrel/components/p-loading/p-loading.vue.d.ts +2 -1
  51. package/dist/squirrel/components/p-modal/p-modal.vue.d.ts +3 -2
  52. package/dist/squirrel/components/p-pagination/p-pagination.vue.d.ts +2 -1
  53. package/dist/squirrel/components/p-pagination-info/p-pagination-info.vue.d.ts +3 -2
  54. package/dist/squirrel/components/p-progress-bar/p-progress-bar.vue.d.ts +2 -1
  55. package/dist/squirrel/components/p-ring-loader/p-ring-loader.vue.d.ts +2 -1
  56. package/dist/squirrel/components/p-select/p-select.vue.d.ts +3 -2
  57. package/dist/squirrel/components/p-select-btn/p-select-btn.vue.d.ts +3 -2
  58. package/dist/squirrel/components/p-select-list/p-select-list.vue.d.ts +3 -2
  59. package/dist/squirrel/components/p-select-pill/p-select-pill.vue.d.ts +9 -8
  60. package/dist/squirrel/components/p-skeleton-loader/p-skeleton-loader.vue.d.ts +10 -9
  61. package/dist/squirrel/components/p-steps/p-steps.vue.d.ts +2 -1
  62. package/dist/squirrel/components/p-table/p-table.vue.d.ts +10 -9
  63. package/dist/squirrel/components/p-table-header-cell/p-table-header-cell.vue.d.ts +3 -2
  64. package/dist/squirrel/components/p-table-loader/p-table-loader.vue.d.ts +2 -1
  65. package/dist/squirrel/components/p-table-sort/p-table-sort.vue.d.ts +2 -1
  66. package/dist/squirrel/components/p-table-td/p-table-td.vue.d.ts +3 -2
  67. package/dist/squirrel/components/p-tabs/p-tabs.vue.d.ts +2 -1
  68. package/dist/squirrel/components/p-tabs-pills/p-tabs-pills.vue.d.ts +2 -1
  69. package/dist/squirrel/components/p-textarea/p-textarea.vue.d.ts +3 -2
  70. package/dist/squirrel/components/p-toggle/p-toggle.vue.d.ts +2 -1
  71. package/dist/squirrel.css +1 -1
  72. package/package.json +24 -24
  73. package/squirrel/components/p-action-bar/p-action-bar.spec.ts +4 -4
  74. package/squirrel/components/p-btn/p-btn.spec.js +3 -0
  75. package/squirrel/components/p-btn/p-btn.vue +1 -1
  76. package/squirrel/components/p-dropdown-select/p-dropdown-select.spec.js +1 -1
  77. package/squirrel/components/p-input-number/p-input-number.spec.js +1 -1
  78. package/squirrel/components/p-input-number/p-input-number.vue +1 -3
  79. package/squirrel/components/p-modal/p-modal-features.spec.js +20 -16
  80. package/squirrel/components/p-select-btn/p-select-btn.spec.js +2 -2
  81. package/squirrel/components/p-select-btn/p-select-btn.vue +1 -1
  82. package/squirrel/components/p-select-list/p-select-list.spec.js +1 -1
  83. package/squirrel/components/p-table-sort/p-table-sort.spec.js +40 -21
  84. package/squirrel/utils/listKeyboardNavigation.spec.js +3 -1
  85. 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', { '*:px-0 *:py-0': noPadding, grow }]"
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).toHaveBeenCalledWith(
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
- selected = wrapper.find('div.text-sm.font-semibold.text-p-purple-60.text-primary');
36
- expect(selected.text()).toBe('Sort ascending');
37
- expect(wrapper.find('div.cursor-pointer.opacity-100').exists()).toBe(true);
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.find('div.text-sm.font-semibold.text-p-purple-60.text-primary');
41
- expect(selected.text()).toBe('Sort descending');
42
- expect(wrapper.find('div.cursor-pointer.opacity-100').exists()).toBe(true);
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
- selected = wrapper.find('div.text-sm.font-semibold.text-p-purple-60.text-primary');
46
- expect(selected.exists()).toBe(false);
47
- expect(wrapper.find('div.cursor-pointer.opacity-100').exists()).toBe(false);
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('div.cursor-pointer.justify-between')[0].trigger('click');
64
- selected = wrapper.find('div.text-sm.font-semibold.text-p-purple-60.text-primary');
65
- expect(selected.text()).toBe('Sort ascending');
66
- expect(wrapper.find('div.cursor-pointer.opacity-100').exists()).toBe(true);
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('div.cursor-pointer.justify-between')[1].trigger('click');
69
- selected = wrapper.find('div.text-sm.font-semibold.text-p-purple-60.text-primary');
70
- expect(selected.text()).toBe('Sort descending');
71
- expect(wrapper.find('div.cursor-pointer.opacity-100').exists()).toBe(true);
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('div.cursor-pointer.opacity-100').trigger('click');
74
- selected = wrapper.find('div.text-sm.font-semibold.text-p-purple-60.text-primary');
75
- expect(selected.exists()).toBe(false);
76
- expect(wrapper.find('div.cursor-pointer.opacity-100').exists()).toBe(false);
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).toHaveBeenCalledWith('There can only be one instance of list navigation active at a time.');
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).toHaveBeenCalledWith(
14
+ expect(consoleMock).toHaveBeenCalledExactlyOnceWith(
15
15
  expect.stringContaining(`WARNING: sanitizing unsafe URL value ${unsafeUrl}`)
16
16
  );
17
17
  });