@pequity/squirrel 8.4.5 → 8.5.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.
Files changed (94) hide show
  1. package/README.md +31 -2
  2. package/dist/cjs/chunks/index.js +530 -179
  3. package/dist/cjs/chunks/p-alert.js +11 -16
  4. package/dist/cjs/chunks/p-btn.js +1 -1
  5. package/dist/cjs/chunks/p-input-percent.js +2 -2
  6. package/dist/cjs/chunks/p-table-header-cell.js +57 -0
  7. package/dist/cjs/index.js +41 -33
  8. package/dist/cjs/inputClasses.js +3 -3
  9. package/dist/cjs/p-icon.js +2 -1
  10. package/dist/cjs/p-loading.js +2 -2
  11. package/dist/cjs/p-modal.js +45 -43
  12. package/dist/cjs/p-table-header-cell.js +2 -116
  13. package/dist/cjs/p-table.js +2 -0
  14. package/dist/cjs/usePTableHeaderWrap.js +38 -0
  15. package/dist/es/chunks/index.js +530 -179
  16. package/dist/es/chunks/p-alert.js +11 -16
  17. package/dist/es/chunks/p-btn.js +2 -2
  18. package/dist/es/chunks/p-input-percent.js +2 -2
  19. package/dist/es/chunks/p-table-header-cell.js +58 -0
  20. package/dist/es/index.js +49 -41
  21. package/dist/es/inputClasses.js +4 -4
  22. package/dist/es/p-icon.js +2 -1
  23. package/dist/es/p-loading.js +2 -2
  24. package/dist/es/p-modal.js +45 -43
  25. package/dist/es/p-table-header-cell.js +2 -116
  26. package/dist/es/p-table.js +2 -0
  27. package/dist/es/usePTableHeaderWrap.js +38 -0
  28. package/dist/squirrel/components/index.d.ts +1 -2
  29. package/dist/squirrel/components/p-action-bar/p-action-bar.vue.d.ts +1 -1
  30. package/dist/squirrel/components/p-alert/p-alert.vue.d.ts +2 -2
  31. package/dist/squirrel/components/p-avatar/p-avatar.vue.d.ts +1 -1
  32. package/dist/squirrel/components/p-btn/p-btn.vue.d.ts +3 -3
  33. package/dist/squirrel/components/p-card/p-card.vue.d.ts +1 -1
  34. package/dist/squirrel/components/p-checkbox/p-checkbox.vue.d.ts +1 -1
  35. package/dist/squirrel/components/p-close-btn/p-close-btn.vue.d.ts +1 -1
  36. package/dist/squirrel/components/p-date-picker/p-date-picker.vue.d.ts +1 -1
  37. package/dist/squirrel/components/p-drawer/p-drawer.vue.d.ts +12 -12
  38. package/dist/squirrel/components/p-dropdown-select/p-dropdown-select.vue.d.ts +1 -1
  39. package/dist/squirrel/components/p-file-upload/p-file-upload.vue.d.ts +1 -1
  40. package/dist/squirrel/components/p-icon/p-icon.types.d.ts +1 -0
  41. package/dist/squirrel/components/p-icon/p-icon.vue.d.ts +1 -1
  42. package/dist/squirrel/components/p-info-icon/p-info-icon.vue.d.ts +1 -1
  43. package/dist/squirrel/components/p-inline-date-picker/p-inline-date-picker.vue.d.ts +1 -1
  44. package/dist/squirrel/components/p-input/p-input.vue.d.ts +1 -1
  45. package/dist/squirrel/components/p-input-percent/p-input-percent.vue.d.ts +1 -1
  46. package/dist/squirrel/components/p-input-search/p-input-search.vue.d.ts +1 -1
  47. package/dist/squirrel/components/p-link/p-link.vue.d.ts +1 -1
  48. package/dist/squirrel/components/p-loading/p-loading.vue.d.ts +1 -1
  49. package/dist/squirrel/components/p-modal/p-modal.vue.d.ts +5 -1
  50. package/dist/squirrel/components/p-pagination/p-pagination.vue.d.ts +1 -1
  51. package/dist/squirrel/components/p-pagination-info/p-pagination-info.vue.d.ts +1 -1
  52. package/dist/squirrel/components/p-progress-bar/p-progress-bar.vue.d.ts +1 -1
  53. package/dist/squirrel/components/p-ring-loader/p-ring-loader.vue.d.ts +1 -1
  54. package/dist/squirrel/components/p-select/p-select.vue.d.ts +1 -1
  55. package/dist/squirrel/components/p-select-btn/p-select-btn.vue.d.ts +1 -1
  56. package/dist/squirrel/components/p-select-list/p-select-list.vue.d.ts +1 -1
  57. package/dist/squirrel/components/p-steps/p-steps.vue.d.ts +1 -1
  58. package/dist/squirrel/components/p-table/p-table.types.d.ts +1 -0
  59. package/dist/squirrel/components/p-table/p-table.vue.d.ts +1 -1
  60. package/dist/squirrel/components/p-table/usePTableHeaderWrap.d.ts +4 -0
  61. package/dist/squirrel/components/p-table-header-cell/p-table-header-cell.vue.d.ts +14 -161
  62. package/dist/squirrel/components/p-table-loader/p-table-loader.vue.d.ts +1 -1
  63. package/dist/squirrel/components/p-table-sort/p-table-sort.vue.d.ts +1 -1
  64. package/dist/squirrel/components/p-table-td/p-table-td.vue.d.ts +1 -1
  65. package/dist/squirrel/components/p-tabs/p-tabs.vue.d.ts +1 -1
  66. package/dist/squirrel/components/p-tabs-pills/p-tabs-pills.vue.d.ts +1 -1
  67. package/dist/squirrel/components/p-textarea/p-textarea.vue.d.ts +1 -1
  68. package/dist/squirrel/components/p-toggle/p-toggle.vue.d.ts +1 -1
  69. package/dist/squirrel.css +22 -33
  70. package/package.json +23 -21
  71. package/squirrel/components/index.ts +0 -2
  72. package/squirrel/components/p-alert/p-alert.spec.js +4 -4
  73. package/squirrel/components/p-alert/p-alert.stories.js +19 -13
  74. package/squirrel/components/p-alert/p-alert.vue +9 -11
  75. package/squirrel/components/p-icon/p-icon.types.ts +1 -0
  76. package/squirrel/components/p-modal/p-modal-basic.spec.js +29 -3
  77. package/squirrel/components/p-modal/p-modal.vue +44 -33
  78. package/squirrel/components/p-table/p-table.spec.js +79 -10
  79. package/squirrel/components/p-table/p-table.types.ts +2 -0
  80. package/squirrel/components/p-table/p-table.vue +12 -5
  81. package/squirrel/components/p-table/usePTableHeaderWrap.spec.js +118 -0
  82. package/squirrel/components/p-table/usePTableHeaderWrap.ts +45 -0
  83. package/squirrel/components/p-table-header-cell/p-table-header-cell.spec.js +17 -9
  84. package/squirrel/components/p-table-header-cell/p-table-header-cell.vue +69 -83
  85. package/dist/cjs/p-table-filter-icon.js +0 -28
  86. package/dist/es/p-table-filter-icon.js +0 -29
  87. package/dist/squirrel/components/p-table-header-cell/p-table-filter-icon.vue.d.ts +0 -20
  88. package/squirrel/assets/filter-icon-active-hover.svg +0 -4
  89. package/squirrel/assets/filter-icon-active.svg +0 -4
  90. package/squirrel/assets/filter-icon-hover.svg +0 -7
  91. package/squirrel/assets/filter-icon.svg +0 -6
  92. package/squirrel/components/p-table-header-cell/p-filter-icon.spec.js +0 -20
  93. package/squirrel/components/p-table-header-cell/p-filter-icon.stories.js +0 -33
  94. package/squirrel/components/p-table-header-cell/p-table-filter-icon.vue +0 -41
@@ -5,6 +5,8 @@ const isFirstColFixedInjectionKey = Symbol("isFirstColFixed");
5
5
  const isLastColFixedInjectionKey = Symbol("isLastColFixed");
6
6
  const isColsResizableInjectionKey = Symbol("isColsResizable");
7
7
  const MIN_WIDTH_COL_RESIZE = 80;
8
+ const HEADER_CELL_ONE_LINE_HEIGHT = 20;
9
+ exports.HEADER_CELL_ONE_LINE_HEIGHT = HEADER_CELL_ONE_LINE_HEIGHT;
8
10
  exports.MIN_WIDTH_COL_RESIZE = MIN_WIDTH_COL_RESIZE;
9
11
  exports.colsInjectionKey = colsInjectionKey;
10
12
  exports.isColsResizableInjectionKey = isColsResizableInjectionKey;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const pTable = require("./p-table.js");
4
+ const vue = require("vue");
5
+ const usePTableHeaderWrap = (theadRef) => {
6
+ let headerObserver = null;
7
+ const hasWrap = vue.ref(false);
8
+ const setupObserver = () => {
9
+ if (!theadRef.value) return;
10
+ headerObserver = new ResizeObserver(() => {
11
+ if (theadRef.value) {
12
+ const textDivs = theadRef.value.querySelectorAll("[data-p-table-header-text]");
13
+ for (const div of textDivs) {
14
+ if (div.offsetHeight > pTable.HEADER_CELL_ONE_LINE_HEIGHT) {
15
+ hasWrap.value = true;
16
+ return;
17
+ }
18
+ }
19
+ hasWrap.value = false;
20
+ }
21
+ });
22
+ headerObserver.observe(theadRef.value);
23
+ };
24
+ const cleanupObserver = () => {
25
+ if (headerObserver) {
26
+ headerObserver.disconnect();
27
+ headerObserver = null;
28
+ }
29
+ };
30
+ vue.onMounted(() => {
31
+ setupObserver();
32
+ });
33
+ vue.onBeforeUnmount(() => {
34
+ cleanupObserver();
35
+ });
36
+ return { hasWrap };
37
+ };
38
+ exports.usePTableHeaderWrap = usePTableHeaderWrap;