@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.
- package/README.md +31 -2
- package/dist/cjs/chunks/index.js +530 -179
- package/dist/cjs/chunks/p-alert.js +11 -16
- package/dist/cjs/chunks/p-btn.js +1 -1
- package/dist/cjs/chunks/p-input-percent.js +2 -2
- package/dist/cjs/chunks/p-table-header-cell.js +57 -0
- package/dist/cjs/index.js +41 -33
- package/dist/cjs/inputClasses.js +3 -3
- package/dist/cjs/p-icon.js +2 -1
- package/dist/cjs/p-loading.js +2 -2
- package/dist/cjs/p-modal.js +45 -43
- package/dist/cjs/p-table-header-cell.js +2 -116
- package/dist/cjs/p-table.js +2 -0
- package/dist/cjs/usePTableHeaderWrap.js +38 -0
- package/dist/es/chunks/index.js +530 -179
- package/dist/es/chunks/p-alert.js +11 -16
- package/dist/es/chunks/p-btn.js +2 -2
- package/dist/es/chunks/p-input-percent.js +2 -2
- package/dist/es/chunks/p-table-header-cell.js +58 -0
- package/dist/es/index.js +49 -41
- package/dist/es/inputClasses.js +4 -4
- package/dist/es/p-icon.js +2 -1
- package/dist/es/p-loading.js +2 -2
- package/dist/es/p-modal.js +45 -43
- package/dist/es/p-table-header-cell.js +2 -116
- package/dist/es/p-table.js +2 -0
- package/dist/es/usePTableHeaderWrap.js +38 -0
- package/dist/squirrel/components/index.d.ts +1 -2
- package/dist/squirrel/components/p-action-bar/p-action-bar.vue.d.ts +1 -1
- package/dist/squirrel/components/p-alert/p-alert.vue.d.ts +2 -2
- package/dist/squirrel/components/p-avatar/p-avatar.vue.d.ts +1 -1
- package/dist/squirrel/components/p-btn/p-btn.vue.d.ts +3 -3
- package/dist/squirrel/components/p-card/p-card.vue.d.ts +1 -1
- package/dist/squirrel/components/p-checkbox/p-checkbox.vue.d.ts +1 -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 +1 -1
- package/dist/squirrel/components/p-drawer/p-drawer.vue.d.ts +12 -12
- package/dist/squirrel/components/p-dropdown-select/p-dropdown-select.vue.d.ts +1 -1
- package/dist/squirrel/components/p-file-upload/p-file-upload.vue.d.ts +1 -1
- package/dist/squirrel/components/p-icon/p-icon.types.d.ts +1 -0
- package/dist/squirrel/components/p-icon/p-icon.vue.d.ts +1 -1
- package/dist/squirrel/components/p-info-icon/p-info-icon.vue.d.ts +1 -1
- package/dist/squirrel/components/p-inline-date-picker/p-inline-date-picker.vue.d.ts +1 -1
- package/dist/squirrel/components/p-input/p-input.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 +1 -1
- package/dist/squirrel/components/p-link/p-link.vue.d.ts +1 -1
- package/dist/squirrel/components/p-loading/p-loading.vue.d.ts +1 -1
- package/dist/squirrel/components/p-modal/p-modal.vue.d.ts +5 -1
- package/dist/squirrel/components/p-pagination/p-pagination.vue.d.ts +1 -1
- package/dist/squirrel/components/p-pagination-info/p-pagination-info.vue.d.ts +1 -1
- package/dist/squirrel/components/p-progress-bar/p-progress-bar.vue.d.ts +1 -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 +1 -1
- package/dist/squirrel/components/p-select-btn/p-select-btn.vue.d.ts +1 -1
- package/dist/squirrel/components/p-select-list/p-select-list.vue.d.ts +1 -1
- package/dist/squirrel/components/p-steps/p-steps.vue.d.ts +1 -1
- package/dist/squirrel/components/p-table/p-table.types.d.ts +1 -0
- package/dist/squirrel/components/p-table/p-table.vue.d.ts +1 -1
- package/dist/squirrel/components/p-table/usePTableHeaderWrap.d.ts +4 -0
- package/dist/squirrel/components/p-table-header-cell/p-table-header-cell.vue.d.ts +14 -161
- 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 +1 -1
- package/dist/squirrel/components/p-tabs/p-tabs.vue.d.ts +1 -1
- package/dist/squirrel/components/p-tabs-pills/p-tabs-pills.vue.d.ts +1 -1
- 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.css +22 -33
- package/package.json +23 -21
- package/squirrel/components/index.ts +0 -2
- package/squirrel/components/p-alert/p-alert.spec.js +4 -4
- package/squirrel/components/p-alert/p-alert.stories.js +19 -13
- package/squirrel/components/p-alert/p-alert.vue +9 -11
- package/squirrel/components/p-icon/p-icon.types.ts +1 -0
- package/squirrel/components/p-modal/p-modal-basic.spec.js +29 -3
- package/squirrel/components/p-modal/p-modal.vue +44 -33
- package/squirrel/components/p-table/p-table.spec.js +79 -10
- package/squirrel/components/p-table/p-table.types.ts +2 -0
- package/squirrel/components/p-table/p-table.vue +12 -5
- package/squirrel/components/p-table/usePTableHeaderWrap.spec.js +118 -0
- package/squirrel/components/p-table/usePTableHeaderWrap.ts +45 -0
- package/squirrel/components/p-table-header-cell/p-table-header-cell.spec.js +17 -9
- package/squirrel/components/p-table-header-cell/p-table-header-cell.vue +69 -83
- package/dist/cjs/p-table-filter-icon.js +0 -28
- package/dist/es/p-table-filter-icon.js +0 -29
- package/dist/squirrel/components/p-table-header-cell/p-table-filter-icon.vue.d.ts +0 -20
- package/squirrel/assets/filter-icon-active-hover.svg +0 -4
- package/squirrel/assets/filter-icon-active.svg +0 -4
- package/squirrel/assets/filter-icon-hover.svg +0 -7
- package/squirrel/assets/filter-icon.svg +0 -6
- package/squirrel/components/p-table-header-cell/p-filter-icon.spec.js +0 -20
- package/squirrel/components/p-table-header-cell/p-filter-icon.stories.js +0 -33
- package/squirrel/components/p-table-header-cell/p-table-filter-icon.vue +0 -41
package/dist/cjs/p-table.js
CHANGED
|
@@ -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;
|