@pequity/squirrel 5.4.6 → 5.4.8
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-date-picker.js +2 -2
- package/dist/cjs/chunks/p-dropdown-select.js +4 -4
- package/dist/cjs/chunks/p-inline-date-picker.js +1 -1
- package/dist/cjs/chunks/p-link.js +1 -1
- package/dist/cjs/chunks/p-select.js +1 -1
- package/dist/cjs/index.js +37 -37
- package/dist/cjs/p-btn.js +2 -2
- package/dist/cjs/p-checkbox.js +1 -1
- package/dist/cjs/p-chips.js +2 -2
- package/dist/cjs/p-input-number.js +3 -3
- package/dist/cjs/p-input-search.js +1 -1
- package/dist/cjs/p-loading.js +2 -2
- package/dist/cjs/p-modal.js +2 -2
- package/dist/cjs/p-select-pill.js +8 -0
- package/dist/cjs/p-skeleton-loader.js +1 -1
- package/dist/cjs/p-table-td.js +1 -1
- package/dist/cjs/p-toggle.js +1 -1
- package/dist/cjs/tailwind.js +2 -2
- package/dist/cjs/usePTableRowVirtualizer.js +1 -1
- package/dist/cjs/useSelectList.js +3 -3
- package/dist/es/chunks/p-date-picker.js +2 -2
- package/dist/es/chunks/p-dropdown-select.js +4 -4
- package/dist/es/chunks/p-inline-date-picker.js +1 -1
- package/dist/es/chunks/p-link.js +1 -1
- package/dist/es/chunks/p-select.js +1 -1
- package/dist/es/index.js +35 -35
- package/dist/es/p-btn.js +2 -2
- package/dist/es/p-checkbox.js +1 -1
- package/dist/es/p-chips.js +2 -2
- package/dist/es/p-input-number.js +3 -3
- package/dist/es/p-input-search.js +1 -1
- package/dist/es/p-loading.js +2 -2
- package/dist/es/p-modal.js +2 -2
- package/dist/es/p-select-pill.js +8 -0
- package/dist/es/p-skeleton-loader.js +1 -1
- package/dist/es/p-table-td.js +1 -1
- package/dist/es/p-toggle.js +1 -1
- package/dist/es/tailwind.js +2 -2
- package/dist/es/usePTableRowVirtualizer.js +1 -1
- package/dist/es/useSelectList.js +3 -3
- package/dist/squirrel/components/index.d.ts +13 -13
- package/dist/squirrel/components/p-btn/p-btn.vue.d.ts +2 -2
- package/dist/squirrel/components/p-card/p-card.vue.d.ts +3 -2
- package/dist/squirrel/components/p-checkbox/p-checkbox.vue.d.ts +2 -1
- package/dist/squirrel/components/p-close-btn/p-close-btn.vue.d.ts +1 -1
- package/dist/squirrel/components/p-date-picker/p-date-picker.vue.d.ts +2 -1
- package/dist/squirrel/components/p-drawer/p-drawer.vue.d.ts +1 -1
- package/dist/squirrel/components/p-dropdown-select/p-dropdown-select.vue.d.ts +7 -6
- package/dist/squirrel/components/p-file-upload/p-file-upload.vue.d.ts +1 -1
- package/dist/squirrel/components/p-icon/p-icon.vue.d.ts +2 -2
- package/dist/squirrel/components/p-info-icon/p-info-icon.vue.d.ts +2 -1
- 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 +1 -1
- package/dist/squirrel/components/p-input-percent/p-input-percent.vue.d.ts +1 -1
- package/dist/squirrel/components/p-input-search/p-input-search.vue.d.ts +2 -2
- package/dist/squirrel/components/p-link/p-link.vue.d.ts +2 -1
- package/dist/squirrel/components/p-modal/p-modal.vue.d.ts +2 -1
- package/dist/squirrel/components/p-pagination-info/p-pagination-info.vue.d.ts +2 -1
- package/dist/squirrel/components/p-ring-loader/p-ring-loader.vue.d.ts +1 -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 +6 -5
- package/dist/squirrel/components/p-select-pill/p-select-pill.vue.d.ts +1 -1
- package/dist/squirrel/components/p-table/p-table.vue.d.ts +3 -2
- package/dist/squirrel/components/p-table-loader/p-table-loader.vue.d.ts +1 -1
- package/dist/squirrel/components/p-table-sort/p-table-sort.vue.d.ts +1 -1
- package/dist/squirrel/components/p-table-td/p-table-td.vue.d.ts +2 -1
- package/dist/squirrel/components/p-tabs/p-tabs.vue.d.ts +2 -2
- package/dist/squirrel/components/p-textarea/p-textarea.vue.d.ts +1 -1
- package/dist/squirrel/components/p-toggle/p-toggle.vue.d.ts +1 -1
- package/dist/squirrel/index.d.ts +1 -1
- package/dist/squirrel/utils/index.d.ts +8 -8
- package/dist/squirrel/utils/inputClassesMixin.d.ts +1 -1
- package/dist/style.css +61 -61
- package/package.json +25 -25
- package/squirrel/components/index.ts +37 -37
- package/squirrel/components/p-action-bar/p-action-bar.spec.ts +1 -1
- package/squirrel/components/p-action-bar/p-action-bar.stories.js +2 -2
- package/squirrel/components/p-action-bar/p-action-bar.vue +1 -1
- package/squirrel/components/p-alert/p-alert.vue +1 -1
- package/squirrel/components/p-btn/p-btn.spec.js +2 -2
- package/squirrel/components/p-btn/p-btn.vue +4 -4
- package/squirrel/components/p-checkbox/p-checkbox.vue +1 -1
- package/squirrel/components/p-chips/p-chips.vue +1 -1
- package/squirrel/components/p-date-picker/p-date-picker.stories.js +1 -1
- package/squirrel/components/p-date-picker/p-date-picker.vue +3 -3
- package/squirrel/components/p-dropdown/p-dropdown.spec.js +1 -1
- package/squirrel/components/p-dropdown/p-dropdown.vue +1 -1
- package/squirrel/components/p-dropdown-select/p-dropdown-select.spec.js +4 -4
- package/squirrel/components/p-dropdown-select/p-dropdown-select.stories.js +2 -2
- package/squirrel/components/p-dropdown-select/p-dropdown-select.vue +8 -8
- package/squirrel/components/p-file-upload/p-file-upload.vue +2 -2
- package/squirrel/components/p-icon/p-icon.spec.js +1 -1
- package/squirrel/components/p-icon/p-icon.stories.js +1 -1
- package/squirrel/components/p-icon/p-icon.vue +2 -2
- package/squirrel/components/p-inline-date-picker/p-inline-date-picker.spec.js +1 -1
- package/squirrel/components/p-inline-date-picker/p-inline-date-picker.stories.js +1 -1
- package/squirrel/components/p-inline-date-picker/p-inline-date-picker.vue +3 -3
- package/squirrel/components/p-input/p-input.stories.js +1 -1
- package/squirrel/components/p-input/p-input.vue +1 -1
- package/squirrel/components/p-input-number/p-input-number.stories.js +1 -1
- package/squirrel/components/p-input-number/p-input-number.vue +3 -3
- package/squirrel/components/p-input-percent/p-input-percent.stories.js +1 -1
- package/squirrel/components/p-input-percent/p-input-percent.vue +1 -1
- package/squirrel/components/p-input-search/p-input-search.stories.js +1 -1
- package/squirrel/components/p-input-search/p-input-search.vue +1 -1
- package/squirrel/components/p-link/p-link.spec.js +1 -1
- package/squirrel/components/p-link/p-link.vue +1 -1
- package/squirrel/components/p-loading/p-loading.spec.js +2 -2
- package/squirrel/components/p-loading/p-loading.stories.js +2 -2
- package/squirrel/components/p-loading/p-loading.vue +1 -1
- package/squirrel/components/p-loading/usePLoading.ts +1 -1
- 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 +3 -3
- package/squirrel/components/p-pagination/p-pagination.vue +1 -1
- package/squirrel/components/p-progress-bar/p-progess-bar.spec.js +1 -1
- package/squirrel/components/p-progress-bar/p-progress-bar.vue +1 -1
- package/squirrel/components/p-select/p-select.spec.js +1 -1
- package/squirrel/components/p-select/p-select.stories.js +1 -1
- package/squirrel/components/p-select/p-select.vue +1 -1
- package/squirrel/components/p-select-btn/p-select-btn.spec.js +1 -1
- package/squirrel/components/p-select-btn/p-select-btn.stories.js +1 -1
- package/squirrel/components/p-select-btn/p-select-btn.vue +1 -1
- package/squirrel/components/p-select-list/p-select-list.spec.js +4 -4
- package/squirrel/components/p-select-list/p-select-list.vue +5 -5
- package/squirrel/components/p-select-list/useSelectList.ts +3 -3
- package/squirrel/components/p-select-pill/p-select-pill.spec.js +1 -1
- package/squirrel/components/p-select-pill/p-select-pill.stories.js +2 -2
- package/squirrel/components/p-select-pill/p-select-pill.vue +9 -1
- package/squirrel/components/p-skeleton-loader/p-skeleton-loader.vue +1 -1
- package/squirrel/components/p-table/p-table.spec.js +2 -2
- package/squirrel/components/p-table/p-table.vue +4 -4
- package/squirrel/components/p-table/usePTableColResize.spec.js +1 -1
- package/squirrel/components/p-table/usePTableColResize.ts +1 -1
- package/squirrel/components/p-table/usePTableRowVirtualizer.ts +1 -1
- package/squirrel/components/p-table-sort/p-table-sort.spec.js +1 -1
- package/squirrel/components/p-table-sort/p-table-sort.stories.js +1 -1
- package/squirrel/components/p-table-sort/p-table-sort.vue +1 -1
- package/squirrel/components/p-table-td/p-table-td.spec.js +3 -3
- package/squirrel/components/p-table-td/p-table-td.stories.js +1 -1
- package/squirrel/components/p-table-td/p-table-td.vue +2 -2
- package/squirrel/components/p-tabs/p-tabs.vue +1 -1
- package/squirrel/components/p-textarea/p-textarea.stories.js +1 -1
- package/squirrel/components/p-textarea/p-textarea.vue +1 -1
- package/squirrel/components/p-toggle/p-toggle.stories.js +1 -1
- package/squirrel/components/p-toggle/p-toggle.vue +1 -1
- package/squirrel/composables/useInputClasses.spec.js +1 -1
- package/squirrel/index.ts +1 -1
- package/squirrel/utils/component.ts +1 -1
- package/squirrel/utils/index.ts +18 -18
- package/squirrel/utils/inputClassesMixin.ts +1 -1
- package/squirrel/utils/pagination.spec.js +2 -2
- package/squirrel/utils/sanitization.spec.js +1 -1
- package/squirrel/utils/tailwind.ts +3 -2
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { type PActionBarAction } from '@squirrel/components/p-action-bar/p-action-bar.types';
|
|
1
2
|
import PActionBar from '@squirrel/components/p-action-bar/p-action-bar.vue';
|
|
2
3
|
import PAlert from '@squirrel/components/p-alert/p-alert.vue';
|
|
3
4
|
import PAvatar from '@squirrel/components/p-avatar/p-avatar.vue';
|
|
5
|
+
import { type Size } from '@squirrel/components/p-btn/p-btn.types';
|
|
4
6
|
import PBtn from '@squirrel/components/p-btn/p-btn.vue';
|
|
5
7
|
import PCard from '@squirrel/components/p-card/p-card.vue';
|
|
6
8
|
import PCheckbox from '@squirrel/components/p-checkbox/p-checkbox.vue';
|
|
@@ -10,8 +12,9 @@ import PDatePicker from '@squirrel/components/p-date-picker/p-date-picker.vue';
|
|
|
10
12
|
import PDrawer from '@squirrel/components/p-drawer/p-drawer.vue';
|
|
11
13
|
import PDropdown from '@squirrel/components/p-dropdown/p-dropdown.vue';
|
|
12
14
|
import PDropdownSelect from '@squirrel/components/p-dropdown-select/p-dropdown-select.vue';
|
|
15
|
+
import { type FileUploadFile } from '@squirrel/components/p-file-upload/p-file-upload.types';
|
|
13
16
|
import PFileUpload from '@squirrel/components/p-file-upload/p-file-upload.vue';
|
|
14
|
-
import
|
|
17
|
+
import { P_ICON_ALIASES, type PIconAlias } from '@squirrel/components/p-icon/p-icon.types';
|
|
15
18
|
import PIcon from '@squirrel/components/p-icon/p-icon.vue';
|
|
16
19
|
import PInfoIcon from '@squirrel/components/p-info-icon/p-info-icon.vue';
|
|
17
20
|
import PInlineDatePicker from '@squirrel/components/p-inline-date-picker/p-inline-date-picker.vue';
|
|
@@ -21,7 +24,9 @@ import PInputPercent from '@squirrel/components/p-input-percent/p-input-percent.
|
|
|
21
24
|
import PInputSearch from '@squirrel/components/p-input-search/p-input-search.vue';
|
|
22
25
|
import PLink from '@squirrel/components/p-link/p-link.vue';
|
|
23
26
|
import PLoading from '@squirrel/components/p-loading/p-loading.vue';
|
|
27
|
+
import { usePLoading } from '@squirrel/components/p-loading/usePLoading';
|
|
24
28
|
import PModal from '@squirrel/components/p-modal/p-modal.vue';
|
|
29
|
+
import { usePModal } from '@squirrel/components/p-modal/usePModal';
|
|
25
30
|
import PPagination from '@squirrel/components/p-pagination/p-pagination.vue';
|
|
26
31
|
import PPaginationInfo from '@squirrel/components/p-pagination-info/p-pagination-info.vue';
|
|
27
32
|
import PProgressBar from '@squirrel/components/p-progress-bar/p-progress-bar.vue';
|
|
@@ -29,42 +34,45 @@ import PRingLoader from '@squirrel/components/p-ring-loader/p-ring-loader.vue';
|
|
|
29
34
|
import PSelect from '@squirrel/components/p-select/p-select.vue';
|
|
30
35
|
import PSelectBtn from '@squirrel/components/p-select-btn/p-select-btn.vue';
|
|
31
36
|
import PSelectList from '@squirrel/components/p-select-list/p-select-list.vue';
|
|
37
|
+
import { useSelectList } from '@squirrel/components/p-select-list/useSelectList';
|
|
32
38
|
import PSelectPill from '@squirrel/components/p-select-pill/p-select-pill.vue';
|
|
33
39
|
import PSkeletonLoader from '@squirrel/components/p-skeleton-loader/p-skeleton-loader.vue';
|
|
34
|
-
import PTable from '@squirrel/components/p-table/p-table.vue';
|
|
35
|
-
import PTableHeaderCell from '@squirrel/components/p-table-header-cell/p-table-header-cell.vue';
|
|
36
|
-
import PTableLoader from '@squirrel/components/p-table-loader/p-table-loader.vue';
|
|
37
|
-
import PTableSort from '@squirrel/components/p-table-sort/p-table-sort.vue';
|
|
38
|
-
import PTableTd from '@squirrel/components/p-table-td/p-table-td.vue';
|
|
39
|
-
import PTabs from '@squirrel/components/p-tabs/p-tabs.vue';
|
|
40
|
-
import PTextarea from '@squirrel/components/p-textarea/p-textarea.vue';
|
|
41
|
-
import PToggle from '@squirrel/components/p-toggle/p-toggle.vue';
|
|
42
|
-
import { type FileUploadFile } from '@squirrel/components/p-file-upload/p-file-upload.types';
|
|
43
40
|
import {
|
|
44
|
-
type HeaderCellAttrs,
|
|
45
|
-
MIN_WIDTH_COL_RESIZE,
|
|
46
|
-
type TableCol,
|
|
47
|
-
type ThAttrs,
|
|
48
41
|
colsInjectionKey,
|
|
42
|
+
type HeaderCellAttrs,
|
|
49
43
|
isColsResizableInjectionKey,
|
|
50
44
|
isFirstColFixedInjectionKey,
|
|
51
45
|
isLastColFixedInjectionKey,
|
|
46
|
+
MIN_WIDTH_COL_RESIZE,
|
|
47
|
+
type TableCol,
|
|
48
|
+
type ThAttrs,
|
|
52
49
|
} from '@squirrel/components/p-table/p-table.types';
|
|
53
|
-
import
|
|
54
|
-
import {
|
|
50
|
+
import PTable from '@squirrel/components/p-table/p-table.vue';
|
|
51
|
+
import { usePTableColResize } from '@squirrel/components/p-table/usePTableColResize';
|
|
52
|
+
import { usePTableRowVirtualizer } from '@squirrel/components/p-table/usePTableRowVirtualizer';
|
|
53
|
+
import PFilterIcon from '@squirrel/components/p-table-header-cell/p-table-filter-icon.vue';
|
|
54
|
+
import PTableHeaderCell from '@squirrel/components/p-table-header-cell/p-table-header-cell.vue';
|
|
55
|
+
import PTableLoader from '@squirrel/components/p-table-loader/p-table-loader.vue';
|
|
55
56
|
import {
|
|
56
57
|
SORTING_TYPES,
|
|
57
58
|
type SortingType,
|
|
58
59
|
type SortingTypeWithoutNoSorting,
|
|
59
60
|
} from '@squirrel/components/p-table-sort/p-table-sort.config';
|
|
60
|
-
import
|
|
61
|
-
import
|
|
62
|
-
import
|
|
63
|
-
import
|
|
64
|
-
import
|
|
65
|
-
import { useSelectList } from '@squirrel/components/p-select-list/useSelectList';
|
|
61
|
+
import PTableSort from '@squirrel/components/p-table-sort/p-table-sort.vue';
|
|
62
|
+
import PTableTd from '@squirrel/components/p-table-td/p-table-td.vue';
|
|
63
|
+
import PTabs from '@squirrel/components/p-tabs/p-tabs.vue';
|
|
64
|
+
import PTextarea from '@squirrel/components/p-textarea/p-textarea.vue';
|
|
65
|
+
import PToggle from '@squirrel/components/p-toggle/p-toggle.vue';
|
|
66
66
|
|
|
67
67
|
export {
|
|
68
|
+
colsInjectionKey,
|
|
69
|
+
FileUploadFile,
|
|
70
|
+
HeaderCellAttrs,
|
|
71
|
+
isColsResizableInjectionKey,
|
|
72
|
+
isFirstColFixedInjectionKey,
|
|
73
|
+
isLastColFixedInjectionKey,
|
|
74
|
+
MIN_WIDTH_COL_RESIZE,
|
|
75
|
+
P_ICON_ALIASES,
|
|
68
76
|
PActionBar,
|
|
69
77
|
PActionBarAction,
|
|
70
78
|
PAlert,
|
|
@@ -81,6 +89,7 @@ export {
|
|
|
81
89
|
PFileUpload,
|
|
82
90
|
PFilterIcon,
|
|
83
91
|
PIcon,
|
|
92
|
+
PIconAlias,
|
|
84
93
|
PInfoIcon,
|
|
85
94
|
PInlineDatePicker,
|
|
86
95
|
PInput,
|
|
@@ -107,24 +116,15 @@ export {
|
|
|
107
116
|
PTabs,
|
|
108
117
|
PTextarea,
|
|
109
118
|
PToggle,
|
|
119
|
+
Size,
|
|
110
120
|
SORTING_TYPES,
|
|
111
|
-
MIN_WIDTH_COL_RESIZE,
|
|
112
|
-
P_ICON_ALIASES,
|
|
113
|
-
colsInjectionKey,
|
|
114
|
-
isColsResizableInjectionKey,
|
|
115
|
-
isFirstColFixedInjectionKey,
|
|
116
|
-
isLastColFixedInjectionKey,
|
|
117
|
-
usePModal,
|
|
118
|
-
usePTableColResize,
|
|
119
|
-
usePTableRowVirtualizer,
|
|
120
|
-
useSelectList,
|
|
121
|
-
usePLoading,
|
|
122
121
|
SortingType,
|
|
123
122
|
SortingTypeWithoutNoSorting,
|
|
124
|
-
Size,
|
|
125
|
-
FileUploadFile,
|
|
126
|
-
HeaderCellAttrs,
|
|
127
123
|
TableCol,
|
|
128
124
|
ThAttrs,
|
|
129
|
-
|
|
125
|
+
usePLoading,
|
|
126
|
+
usePModal,
|
|
127
|
+
usePTableColResize,
|
|
128
|
+
usePTableRowVirtualizer,
|
|
129
|
+
useSelectList,
|
|
130
130
|
};
|
|
@@ -135,7 +135,7 @@ describe('PActionBar.vue', () => {
|
|
|
135
135
|
expect(icons[2].attributes().icon).toBe('test-icon-3');
|
|
136
136
|
});
|
|
137
137
|
|
|
138
|
-
it('attrs fall through
|
|
138
|
+
it('attrs fall through', async () => {
|
|
139
139
|
const wrapper = createComponentWrapper({
|
|
140
140
|
props: {
|
|
141
141
|
show: true,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import FileUploadIcon from '@squirrel/assets/file-upload-upload-icon.svg?inline';
|
|
2
|
-
import PActionBar from '@squirrel/components/p-action-bar/p-action-bar.vue';
|
|
3
|
-
import PBtn from '@squirrel/components/p-btn/p-btn.vue';
|
|
4
2
|
import PaginateLeftIcon from '@squirrel/assets/pagination-left-icon.svg?inline';
|
|
5
3
|
import PaginateRightIcon from '@squirrel/assets/pagination-right-icon.svg?inline';
|
|
4
|
+
import PActionBar from '@squirrel/components/p-action-bar/p-action-bar.vue';
|
|
5
|
+
import PBtn from '@squirrel/components/p-btn/p-btn.vue';
|
|
6
6
|
import { action } from '@storybook/addon-actions';
|
|
7
7
|
import { expect, fn, userEvent, waitFor, within } from '@storybook/test';
|
|
8
8
|
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
</template>
|
|
57
57
|
|
|
58
58
|
<script setup lang="ts">
|
|
59
|
+
import { type PActionBarAction } from '@squirrel/components/p-action-bar/p-action-bar.types';
|
|
59
60
|
import PBtn from '@squirrel/components/p-btn/p-btn.vue';
|
|
60
61
|
import PCloseBtn from '@squirrel/components/p-close-btn/p-close-btn.vue';
|
|
61
62
|
import PDropdown from '@squirrel/components/p-dropdown/p-dropdown.vue';
|
|
62
63
|
import PIcon from '@squirrel/components/p-icon/p-icon.vue';
|
|
63
|
-
import { type PActionBarAction } from '@squirrel/components/p-action-bar/p-action-bar.types';
|
|
64
64
|
import { isComponent } from '@squirrel/utils/component';
|
|
65
65
|
import { isString } from '@squirrel/utils/string';
|
|
66
66
|
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
<script lang="ts">
|
|
22
22
|
import { type Color, getColor } from '@squirrel/utils/tailwind';
|
|
23
|
-
import { type PropType
|
|
23
|
+
import { defineComponent, type PropType } from 'vue';
|
|
24
24
|
|
|
25
25
|
const ALERT_TYPES = {
|
|
26
26
|
info: `bg-info text-on-info`,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import PBtn from '@squirrel/components/p-btn/p-btn.vue';
|
|
2
|
-
import { createWrapperFor } from '@tests/vitest.helpers';
|
|
3
2
|
import { sanitizeUrl } from '@squirrel/utils/sanitization';
|
|
3
|
+
import { createWrapperFor } from '@tests/vitest.helpers';
|
|
4
4
|
|
|
5
5
|
vi.mock('@squirrel/utils/sanitization', () => {
|
|
6
6
|
return {
|
|
@@ -223,7 +223,7 @@ describe('PBtn.vue', () => {
|
|
|
223
223
|
expect(button.attributes()['aria-selected']).toBe('true');
|
|
224
224
|
});
|
|
225
225
|
|
|
226
|
-
it('
|
|
226
|
+
it('sanitizes an invalid link', async () => {
|
|
227
227
|
const wrapper = createWrapperFor(PBtn, {
|
|
228
228
|
props: {
|
|
229
229
|
to: 'javascript:evil()',
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
</template>
|
|
34
34
|
|
|
35
35
|
<script lang="ts">
|
|
36
|
-
import PRingLoader from '@squirrel/components/p-ring-loader/p-ring-loader.vue';
|
|
37
|
-
import { type Color, getColorDeep } from '@squirrel/utils/tailwind';
|
|
38
|
-
import { type PropType, defineComponent } from 'vue';
|
|
39
|
-
import { type RouteLocationRaw, RouterLink } from 'vue-router';
|
|
40
36
|
import { type Size } from '@squirrel/components/p-btn/p-btn.types';
|
|
37
|
+
import PRingLoader from '@squirrel/components/p-ring-loader/p-ring-loader.vue';
|
|
41
38
|
import { isExternalLink } from '@squirrel/utils/link';
|
|
42
39
|
import { sanitizeUrl } from '@squirrel/utils/sanitization';
|
|
40
|
+
import { type Color, getColorDeep } from '@squirrel/utils/tailwind';
|
|
41
|
+
import { defineComponent, type PropType } from 'vue';
|
|
42
|
+
import { type RouteLocationRaw, RouterLink } from 'vue-router';
|
|
43
43
|
|
|
44
44
|
const BUTTON_TYPES = {
|
|
45
45
|
PRIMARY: 'primary',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import PDatePicker from '@squirrel/components/p-date-picker/p-date-picker.vue';
|
|
2
1
|
import { fieldArgTypes } from '@root/stories/common/field';
|
|
2
|
+
import PDatePicker from '@squirrel/components/p-date-picker/p-date-picker.vue';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: 'Components/PDatePicker',
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
|
|
30
30
|
<script setup lang="ts">
|
|
31
31
|
import PInput from '@squirrel/components/p-input/p-input.vue';
|
|
32
|
+
import { useInputClasses } from '@squirrel/composables/useInputClasses';
|
|
32
33
|
import dayjs from 'dayjs';
|
|
33
|
-
import { DatePicker } from 'v-calendar';
|
|
34
|
-
import { type StyleValue, computed, nextTick, ref, useAttrs, watch } from 'vue';
|
|
35
34
|
import { isDate, isString } from 'lodash-es';
|
|
36
|
-
import {
|
|
35
|
+
import { DatePicker } from 'v-calendar';
|
|
36
|
+
import { computed, nextTick, ref, type StyleValue, useAttrs, watch } from 'vue';
|
|
37
37
|
|
|
38
38
|
defineOptions({
|
|
39
39
|
name: 'PDatePicker',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import PDropdown from '@squirrel/components/p-dropdown/p-dropdown.vue';
|
|
2
|
-
import { createWrapperFor } from '@tests/vitest.helpers';
|
|
3
2
|
import { setupListKeyboardNavigation } from '@squirrel/utils/listKeyboardNavigation';
|
|
3
|
+
import { createWrapperFor } from '@tests/vitest.helpers';
|
|
4
4
|
|
|
5
5
|
vi.mock('@squirrel/utils/listKeyboardNavigation', () => {
|
|
6
6
|
return {
|
|
@@ -88,7 +88,7 @@ import {
|
|
|
88
88
|
type ListKeyboardNavigationInstance,
|
|
89
89
|
setupListKeyboardNavigation,
|
|
90
90
|
} from '@squirrel/utils/listKeyboardNavigation';
|
|
91
|
-
import { type PropType
|
|
91
|
+
import { defineComponent, type PropType } from 'vue';
|
|
92
92
|
|
|
93
93
|
type VPopper = {
|
|
94
94
|
$refs: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import PDropdownSelect from '@squirrel/components/p-dropdown-select/p-dropdown-select.vue';
|
|
2
1
|
import filterListItems from '@squirrel/components/p-dropdown-select/p-dropdown-select.mock.json';
|
|
3
|
-
import
|
|
2
|
+
import PDropdownSelect from '@squirrel/components/p-dropdown-select/p-dropdown-select.vue';
|
|
3
|
+
import { useVirtualizer } from '@tanstack/vue-virtual';
|
|
4
4
|
import { createWrapperFor, sleep, waitRAF } from '@tests/vitest.helpers';
|
|
5
|
+
import { cloneDeep } from 'lodash-es';
|
|
5
6
|
import { ref } from 'vue';
|
|
6
|
-
import { useVirtualizer } from '@tanstack/vue-virtual';
|
|
7
7
|
|
|
8
8
|
vi.mock('@tanstack/vue-virtual', () => ({
|
|
9
9
|
useVirtualizer: vi.fn(),
|
|
@@ -415,7 +415,7 @@ describe('PDropdownSelect.vue', () => {
|
|
|
415
415
|
cleanup(wrapper);
|
|
416
416
|
});
|
|
417
417
|
|
|
418
|
-
it.each([true, false])('renders correctly when "multiple" is set to %s
|
|
418
|
+
it.each([true, false])('renders correctly when "multiple" is set to %s', async (val) => {
|
|
419
419
|
const items = cloneDeep(filterListItems).slice(0, 20);
|
|
420
420
|
const wrapper = createWrapper({ items }, { multiple: val });
|
|
421
421
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { fieldArgTypes } from '@root/stories/common/field';
|
|
2
2
|
import filterListItems from '@squirrel/components/p-dropdown-select/p-dropdown-select.mock.json';
|
|
3
|
+
import PDropdownSelect from '@squirrel/components/p-dropdown-select/p-dropdown-select.vue';
|
|
3
4
|
import { cloneDeep } from 'lodash-es';
|
|
4
|
-
import { fieldArgTypes } from '@root/stories/common/field';
|
|
5
5
|
import { ref } from 'vue';
|
|
6
6
|
|
|
7
7
|
const items1 = filterListItems.slice(0, 999);
|
|
@@ -160,23 +160,23 @@
|
|
|
160
160
|
import PDropdown from '@squirrel/components/p-dropdown/p-dropdown.vue';
|
|
161
161
|
import PIcon from '@squirrel/components/p-icon/p-icon.vue';
|
|
162
162
|
import PInputSearch from '@squirrel/components/p-input-search/p-input-search.vue';
|
|
163
|
+
import { type ModelValue, type Size, SIZES } from '@squirrel/components/p-select-list/p-select-list.types';
|
|
164
|
+
import { useSelectList } from '@squirrel/components/p-select-list/useSelectList';
|
|
165
|
+
import { useInputClasses } from '@squirrel/composables/useInputClasses';
|
|
166
|
+
import { toString } from '@squirrel/utils/string';
|
|
167
|
+
import { splitStringForHighlight } from '@squirrel/utils/text';
|
|
168
|
+
import { omit } from 'lodash-es';
|
|
163
169
|
import {
|
|
164
170
|
type ComponentPublicInstance,
|
|
165
|
-
type PropType,
|
|
166
|
-
type StyleValue,
|
|
167
171
|
computed,
|
|
168
172
|
onMounted,
|
|
169
173
|
onUnmounted,
|
|
174
|
+
type PropType,
|
|
170
175
|
ref,
|
|
176
|
+
type StyleValue,
|
|
171
177
|
useAttrs,
|
|
172
178
|
watch,
|
|
173
179
|
} from 'vue';
|
|
174
|
-
import { type ModelValue, SIZES, type Size } from '@squirrel/components/p-select-list/p-select-list.types';
|
|
175
|
-
import { omit } from 'lodash-es';
|
|
176
|
-
import { splitStringForHighlight } from '@squirrel/utils/text';
|
|
177
|
-
import { toString } from '@squirrel/utils/string';
|
|
178
|
-
import { useInputClasses } from '@squirrel/composables/useInputClasses';
|
|
179
|
-
import { useSelectList } from '@squirrel/components/p-select-list/useSelectList';
|
|
180
180
|
|
|
181
181
|
type AnyValue = string | number | boolean | null | undefined | Record<string, unknown>;
|
|
182
182
|
type AnyObject = Record<string, AnyValue>;
|
|
@@ -70,10 +70,10 @@
|
|
|
70
70
|
|
|
71
71
|
<script setup lang="ts">
|
|
72
72
|
import { type FileUploadFile } from '@squirrel/components/p-file-upload/p-file-upload.types';
|
|
73
|
-
import { type PropType, computed, onMounted, ref, shallowRef } from 'vue';
|
|
74
73
|
import { formatBytes, getFileExtension } from '@squirrel/components/p-file-upload/p-file-upload.utils';
|
|
75
|
-
import { uniq } from 'lodash-es';
|
|
76
74
|
import { useInputClasses } from '@squirrel/composables/useInputClasses';
|
|
75
|
+
import { uniq } from 'lodash-es';
|
|
76
|
+
import { computed, onMounted, type PropType, ref, shallowRef } from 'vue';
|
|
77
77
|
import { useToast } from 'vue-toastification';
|
|
78
78
|
|
|
79
79
|
defineOptions({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import PIcon from '@squirrel/components/p-icon/p-icon.vue';
|
|
2
1
|
import { P_ICON_ALIASES } from '@squirrel/components/p-icon/p-icon.types';
|
|
2
|
+
import PIcon from '@squirrel/components/p-icon/p-icon.vue';
|
|
3
3
|
import { createWrapperFor } from '@tests/vitest.helpers';
|
|
4
4
|
|
|
5
5
|
const createWrapper = (props, attrs) => {
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script setup lang="ts">
|
|
6
|
-
import { type IconifyIconAttributes } from 'iconify-icon';
|
|
7
|
-
import { type PIconAlias, P_ICON_ALIASES } from '@squirrel/components/p-icon/p-icon.types';
|
|
8
6
|
import 'iconify-icon';
|
|
7
|
+
import { P_ICON_ALIASES, type PIconAlias } from '@squirrel/components/p-icon/p-icon.types';
|
|
8
|
+
import { type IconifyIconAttributes } from 'iconify-icon';
|
|
9
9
|
|
|
10
10
|
defineOptions({
|
|
11
11
|
name: 'PIcon',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import PInlineDatePicker from '@squirrel/components/p-inline-date-picker/p-inline-date-picker.vue';
|
|
2
|
-
import { DatePicker } from 'v-calendar';
|
|
3
2
|
import { createWrapperFor } from '@tests/vitest.helpers';
|
|
3
|
+
import { DatePicker } from 'v-calendar';
|
|
4
4
|
|
|
5
5
|
const createWrapper = (props) => {
|
|
6
6
|
return createWrapperFor(PInlineDatePicker, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// import PBtn from '@squirrel/components/p-btn/p-btn.vue';
|
|
2
2
|
// import PDropdown from '@squirrel/components/p-dropdown/p-dropdown.vue';
|
|
3
|
-
import PInlineDatePicker from '@squirrel/components/p-inline-date-picker/p-inline-date-picker.vue';
|
|
4
3
|
import { fieldArgTypes } from '@root/stories/common/field';
|
|
4
|
+
import PInlineDatePicker from '@squirrel/components/p-inline-date-picker/p-inline-date-picker.vue';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: 'Components/PInlineDatePicker',
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
</template>
|
|
24
24
|
|
|
25
25
|
<script setup lang="ts">
|
|
26
|
+
import { useInputClasses } from '@squirrel/composables/useInputClasses';
|
|
26
27
|
import dayjs from 'dayjs';
|
|
27
|
-
import { type AttributeConfig } from 'v-calendar/dist/types/src/utils/attribute.d';
|
|
28
28
|
import { DatePicker } from 'v-calendar';
|
|
29
|
-
import { type
|
|
30
|
-
import {
|
|
29
|
+
import { type AttributeConfig } from 'v-calendar/dist/types/src/utils/attribute.d';
|
|
30
|
+
import { computed, ref, type StyleValue, useAttrs, watch } from 'vue';
|
|
31
31
|
|
|
32
32
|
defineOptions({
|
|
33
33
|
name: 'PInlineDatePicker',
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
|
|
27
27
|
<script lang="ts">
|
|
28
28
|
import inputClassesMixin from '@squirrel/utils/inputClassesMixin';
|
|
29
|
-
import { type PropType, type StyleValue
|
|
29
|
+
import { defineComponent, type PropType, type StyleValue } from 'vue';
|
|
30
30
|
|
|
31
31
|
const INPUT_TYPES = { TEXT: 'text', PASSWORD: 'password' };
|
|
32
32
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import PInputNumber from '@squirrel/components/p-input-number/p-input-number.vue';
|
|
2
1
|
import { fieldArgTypes } from '@root/stories/common/field';
|
|
2
|
+
import PInputNumber from '@squirrel/components/p-input-number/p-input-number.vue';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: 'Components/PInputNumber',
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
<script lang="ts">
|
|
22
22
|
import PInfoIcon from '@squirrel/components/p-info-icon/p-info-icon.vue';
|
|
23
23
|
import inputClassesMixin from '@squirrel/utils/inputClassesMixin';
|
|
24
|
-
import { type CurrencyDisplay, type CurrencyInputOptions, useCurrencyInput } from 'vue-currency-input';
|
|
25
|
-
import { type PropType, type StyleValue, computed, defineComponent, watch } from 'vue';
|
|
26
|
-
import { kebabCase } from 'lodash-es';
|
|
27
24
|
import { toNumberOrNull } from '@squirrel/utils/number';
|
|
25
|
+
import { kebabCase } from 'lodash-es';
|
|
26
|
+
import { computed, defineComponent, type PropType, type StyleValue, watch } from 'vue';
|
|
27
|
+
import { type CurrencyDisplay, type CurrencyInputOptions, useCurrencyInput } from 'vue-currency-input';
|
|
28
28
|
|
|
29
29
|
const ALL_OPTIONS = [
|
|
30
30
|
'locale',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import PInputPercent from '@squirrel/components/p-input-percent/p-input-percent.vue';
|
|
2
1
|
import { fieldArgTypes } from '@root/stories/common/field';
|
|
2
|
+
import PInputPercent from '@squirrel/components/p-input-percent/p-input-percent.vue';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: 'Components/PInputPercent',
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
<script setup lang="ts">
|
|
12
12
|
import PInputNumber from '@squirrel/components/p-input-number/p-input-number.vue';
|
|
13
13
|
import { type InputSize } from '@squirrel/utils/inputClassesShared';
|
|
14
|
-
import { type PropType, computed } from 'vue';
|
|
15
14
|
import { isNumber } from 'lodash-es';
|
|
15
|
+
import { computed, type PropType } from 'vue';
|
|
16
16
|
|
|
17
17
|
const prefixClasses: Record<InputSize, string> = {
|
|
18
18
|
sm: 'text-sm h-8 left-2',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import PInputSearch from '@squirrel/components/p-input-search/p-input-search.vue';
|
|
2
1
|
import { fieldArgTypes } from '@root/stories/common/field';
|
|
2
|
+
import PInputSearch from '@squirrel/components/p-input-search/p-input-search.vue';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: 'Components/PInputSearch',
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
<script lang="ts">
|
|
36
36
|
import PInput from '@squirrel/components/p-input/p-input.vue';
|
|
37
37
|
import { INPUT_SIZES, type InputSize } from '@squirrel/utils/inputClassesShared';
|
|
38
|
-
import { type PropType
|
|
38
|
+
import { defineComponent, type PropType } from 'vue';
|
|
39
39
|
|
|
40
40
|
type PInputInstance = InstanceType<typeof PInput>;
|
|
41
41
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import PLink from '@squirrel/components/p-link/p-link.vue';
|
|
2
|
-
import { createWrapperFor } from '@tests/vitest.helpers';
|
|
3
2
|
import { isExternalLink } from '@squirrel/utils/link';
|
|
4
3
|
import { sanitizeUrl } from '@squirrel/utils/sanitization';
|
|
4
|
+
import { createWrapperFor } from '@tests/vitest.helpers';
|
|
5
5
|
|
|
6
6
|
vi.mock('@squirrel/utils/sanitization');
|
|
7
7
|
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
</template>
|
|
9
9
|
|
|
10
10
|
<script setup lang="ts">
|
|
11
|
-
import { RouterLink, type RouterLinkProps } from 'vue-router';
|
|
12
11
|
import { isExternalLink } from '@squirrel/utils/link';
|
|
13
12
|
import { sanitizeUrl } from '@squirrel/utils/sanitization';
|
|
13
|
+
import { RouterLink, type RouterLinkProps } from 'vue-router';
|
|
14
14
|
|
|
15
15
|
defineOptions({
|
|
16
16
|
name: 'PLink',
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import PLoading from '@squirrel/components/p-loading/p-loading.vue';
|
|
2
|
+
import { usePLoading } from '@squirrel/components/p-loading/usePLoading';
|
|
2
3
|
import PSkeletonLoader from '@squirrel/components/p-skeleton-loader/p-skeleton-loader.vue';
|
|
3
4
|
import { createWrapperFor, waitNT } from '@tests/vitest.helpers';
|
|
4
5
|
import { defineComponent, ref } from 'vue';
|
|
5
|
-
import { usePLoading } from '@squirrel/components/p-loading/usePLoading';
|
|
6
6
|
|
|
7
7
|
const createAppWrapper = () =>
|
|
8
8
|
createWrapperFor({
|
|
@@ -131,7 +131,7 @@ describe('PLoading.vue', () => {
|
|
|
131
131
|
expect(appWrapper.find('[aria-busy]').exists()).toBe(false);
|
|
132
132
|
});
|
|
133
133
|
|
|
134
|
-
it(`
|
|
134
|
+
it(`waits for the queue to clear in order to hide the loading indicator`, async () => {
|
|
135
135
|
const wrapper = createWrapper({ delay: 200 });
|
|
136
136
|
|
|
137
137
|
await wrapper.find('.request-1-sec').trigger('click');
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import ComputationStatus1 from '@/playground/components/ComputationStatus1.vue';
|
|
2
1
|
import PBtn from '@squirrel/components/p-btn/p-btn.vue';
|
|
3
2
|
import PLoading from '@squirrel/components/p-loading/p-loading.vue';
|
|
4
|
-
import { defineComponent, ref } from 'vue';
|
|
5
3
|
import { usePLoading } from '@squirrel/components/p-loading/usePLoading';
|
|
4
|
+
import { defineComponent, ref } from 'vue';
|
|
5
|
+
import ComputationStatus1 from '@/playground/components/ComputationStatus1.vue';
|
|
6
6
|
|
|
7
7
|
const TestComponent = defineComponent({
|
|
8
8
|
name: 'TestComponent',
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
</template>
|
|
29
29
|
|
|
30
30
|
<script setup lang="ts">
|
|
31
|
+
import { usePLoading } from '@squirrel/components/p-loading/usePLoading';
|
|
31
32
|
import { isComponent } from '@squirrel/utils/component';
|
|
32
33
|
import { onBeforeUnmount, ref, toValue, watch } from 'vue';
|
|
33
|
-
import { usePLoading } from '@squirrel/components/p-loading/usePLoading';
|
|
34
34
|
|
|
35
35
|
const textDivClass = `overflow-hidden whitespace-nowrap px-4 pt-1 h-8 text-center text-sm font-semibold text-p-purple-60`;
|
|
36
36
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import PModal from '@squirrel/components/p-modal/p-modal.vue';
|
|
2
|
-
import { mount } from '@vue/test-utils';
|
|
3
2
|
import { waitRAF } from '@tests/vitest.helpers';
|
|
3
|
+
import { mount } from '@vue/test-utils';
|
|
4
4
|
|
|
5
5
|
const createWrapperContainer = (componentArgs) => {
|
|
6
6
|
const args = componentArgs || {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import PModal from '@squirrel/components/p-modal/p-modal.vue';
|
|
2
|
-
import { mount } from '@vue/test-utils';
|
|
3
2
|
import { sleep, waitNT } from '@tests/vitest.helpers';
|
|
3
|
+
import { mount } from '@vue/test-utils';
|
|
4
4
|
|
|
5
5
|
const originalOffsetHeight = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'offsetHeight');
|
|
6
6
|
const originalOffsetWidth = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'offsetWidth');
|
|
@@ -73,18 +73,18 @@
|
|
|
73
73
|
<script setup lang="ts">
|
|
74
74
|
import PAlert from '@squirrel/components/p-alert/p-alert.vue';
|
|
75
75
|
import PCloseBtn from '@squirrel/components/p-close-btn/p-close-btn.vue';
|
|
76
|
+
import { usePModal } from '@squirrel/components/p-modal/usePModal';
|
|
76
77
|
import {
|
|
77
|
-
type PropType,
|
|
78
|
-
type StyleValue,
|
|
79
78
|
getCurrentInstance,
|
|
80
79
|
nextTick,
|
|
81
80
|
onBeforeMount,
|
|
82
81
|
onBeforeUnmount,
|
|
83
82
|
onMounted,
|
|
83
|
+
type PropType,
|
|
84
84
|
ref,
|
|
85
|
+
type StyleValue,
|
|
85
86
|
watch,
|
|
86
87
|
} from 'vue';
|
|
87
|
-
import { usePModal } from '@squirrel/components/p-modal/usePModal';
|
|
88
88
|
|
|
89
89
|
const FOCUSABLE_ELEMENTS =
|
|
90
90
|
'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex="-1"])';
|