@onereach/ui-components-vue2 26.4.1-beta.5878.0 → 26.4.1-beta.5879.0
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.
|
@@ -209,7 +209,9 @@ const DataGridTableContentCell = [
|
|
|
209
209
|
// Theme (.sticky-start)
|
|
210
210
|
'[&.sticky-start]:theme-background-default [&.sticky-start]:border-e-disabled [&.sticky-start]:border-solid', 'dark:[&.sticky-start]:theme-background-default-dark dark:[&.sticky-start]:border-e-disabled-dark', 'hover:[&.sticky-start]:theme-background-surface-1 dark:hover:[&.sticky-start]:theme-background-surface-1-dark', 'selected:[&.sticky-start]:theme-background-surface-2 dark:selected:[&.sticky-start]:theme-background-surface-2-dark', 'hover:selected:[&.sticky-start]:theme-background-surface-3 dark:hover:selected:[&.sticky-start]:theme-background-surface-3-dark',
|
|
211
211
|
// Theme (.sticky-end)
|
|
212
|
-
'[&.sticky-end]:theme-background-default [&.sticky-end]:border-s-disabled [&.sticky-end]:border-solid', 'dark:[&.sticky-end]:theme-background-default-dark dark:[&.sticky-end]:border-s-disabled-dark', 'hover:[&.sticky-end]:theme-background-surface-1 dark:hover:[&.sticky-end]:theme-background-surface-1-dark', 'selected:[&.sticky-end]:theme-background-surface-2 dark:selected:[&.sticky-end]:theme-background-surface-2-dark', 'hover:selected:[&.sticky-end]:theme-background-surface-3 dark:hover:selected:[&.sticky-end]:theme-background-surface-3-dark'
|
|
212
|
+
'[&.sticky-end]:theme-background-default [&.sticky-end]:border-s-disabled [&.sticky-end]:border-solid', 'dark:[&.sticky-end]:theme-background-default-dark dark:[&.sticky-end]:border-s-disabled-dark', 'hover:[&.sticky-end]:theme-background-surface-1 dark:hover:[&.sticky-end]:theme-background-surface-1-dark', 'selected:[&.sticky-end]:theme-background-surface-2 dark:selected:[&.sticky-end]:theme-background-surface-2-dark', 'hover:selected:[&.sticky-end]:theme-background-surface-3 dark:hover:selected:[&.sticky-end]:theme-background-surface-3-dark',
|
|
213
|
+
// Theme (.resizable)
|
|
214
|
+
'[&.resizable]:border-e-disabled [&.resizable]:border-solid', 'dark:[&.resizable]:border-e-disabled-dark'];
|
|
213
215
|
const DataGridTableContentCellContent = [
|
|
214
216
|
// interactivity
|
|
215
217
|
'interactivity-select',
|
|
@@ -262,8 +264,8 @@ var script$e = defineComponent({
|
|
|
262
264
|
// Refs & Styles
|
|
263
265
|
const root = ref();
|
|
264
266
|
const rootStyles = computed(() => {
|
|
265
|
-
var _a;
|
|
266
|
-
return ['or-data-grid-table-content-cell-v3', ...DataGridTableContentCell, ...(((_a = props.column) === null || _a === void 0 ? void 0 : _a.stickiness) ? [`sticky-${props.column.stickiness}`] : [])];
|
|
267
|
+
var _a, _b, _c, _d;
|
|
268
|
+
return ['or-data-grid-table-content-cell-v3', ...DataGridTableContentCell, ...(((_a = props.column) === null || _a === void 0 ? void 0 : _a.stickiness) ? [`sticky-${props.column.stickiness}`] : []), ...(!!((_b = props.features) === null || _b === void 0 ? void 0 : _b.resizing) && !!((_c = props.column) === null || _c === void 0 ? void 0 : _c.name) && ((_d = props.column) === null || _d === void 0 ? void 0 : _d.resizing) !== false ? ['resizable'] : [])];
|
|
267
269
|
});
|
|
268
270
|
const rootInlineStyles = computed(() => {
|
|
269
271
|
if (props.column) {
|
|
@@ -823,7 +825,9 @@ const DataGridTableHeaderCell = [
|
|
|
823
825
|
// Theme (.sticky-start)
|
|
824
826
|
'[&.sticky-start]:theme-background-surface-variant-1 [&.sticky-start]:border-e-disabled [&.sticky-start]:border-solid z-20 hover:z-30', 'dark:[&.sticky-start]:theme-background-surface-variant-1-dark dark:[&.sticky-start]:border-e-disabled-dark',
|
|
825
827
|
// Theme (.sticky-end)
|
|
826
|
-
'[&.sticky-end]:theme-background-surface-variant-1 [&.sticky-end]:border-s-disabled [&.sticky-end]:border-solid z-20 hover:z-30', 'dark:[&.sticky-end]:theme-background-surface-variant-1-dark dark:[&.sticky-end]:border-s-disabled-dark'
|
|
828
|
+
'[&.sticky-end]:theme-background-surface-variant-1 [&.sticky-end]:border-s-disabled [&.sticky-end]:border-solid z-20 hover:z-30', 'dark:[&.sticky-end]:theme-background-surface-variant-1-dark dark:[&.sticky-end]:border-s-disabled-dark',
|
|
829
|
+
// Theme (.resizable)
|
|
830
|
+
'[&.resizable]:border-e-disabled [&.resizable]:border-solid', 'dark:[&.resizable]:border-e-disabled-dark'];
|
|
827
831
|
const DataGridTableHeaderCellResizeHandle = [
|
|
828
832
|
// Position
|
|
829
833
|
'absolute top-0 bottom-0 end-0 z-50',
|
|
@@ -866,12 +870,12 @@ var script$8 = defineComponent({
|
|
|
866
870
|
return !!((_a = props.features) === null || _a === void 0 ? void 0 : _a.sorting) && !!((_b = props.column) === null || _b === void 0 ? void 0 : _b.name) && ((_c = props.column) === null || _c === void 0 ? void 0 : _c.sorting) !== false;
|
|
867
871
|
});
|
|
868
872
|
const isResizable = computed(() => {
|
|
869
|
-
var _a, _b;
|
|
870
|
-
return !!((_a = props.features) === null || _a === void 0 ? void 0 : _a.resizing) && !!((_b = props.column) === null || _b === void 0 ? void 0 : _b.name);
|
|
873
|
+
var _a, _b, _c;
|
|
874
|
+
return !!((_a = props.features) === null || _a === void 0 ? void 0 : _a.resizing) && !!((_b = props.column) === null || _b === void 0 ? void 0 : _b.name) && ((_c = props.column) === null || _c === void 0 ? void 0 : _c.resizing) !== false;
|
|
871
875
|
});
|
|
872
876
|
const rootStyles = computed(() => {
|
|
873
877
|
var _a;
|
|
874
|
-
return ['or-data-grid-table-header-cell-v3', 'relative', ...DataGridTableHeaderCell, ...(((_a = props.column) === null || _a === void 0 ? void 0 : _a.stickiness) ? [`sticky-${props.column.stickiness}`] : []), ...(isSortable.value ? ['interactivity-click'] : [])];
|
|
878
|
+
return ['or-data-grid-table-header-cell-v3', 'relative', ...DataGridTableHeaderCell, ...(((_a = props.column) === null || _a === void 0 ? void 0 : _a.stickiness) ? [`sticky-${props.column.stickiness}`] : []), ...(isResizable.value ? ['resizable'] : []), ...(isSortable.value ? ['interactivity-click'] : [])];
|
|
875
879
|
});
|
|
876
880
|
const resizeHandleStyles = computed(() => ['or-data-grid-table-header-cell-resize-handle-v3', ...DataGridTableHeaderCellResizeHandle]);
|
|
877
881
|
const wrapInlineStyle = computed(() => {
|
|
@@ -1783,6 +1787,13 @@ var script = defineComponent({
|
|
|
1783
1787
|
var _a;
|
|
1784
1788
|
return ((_a = pagination.value) === null || _a === void 0 ? void 0 : _a.currentLimit) || 10;
|
|
1785
1789
|
});
|
|
1790
|
+
const columnWidths = ref({});
|
|
1791
|
+
const actualColumns = computed(() => {
|
|
1792
|
+
return props.columns.map(column => ({
|
|
1793
|
+
...column,
|
|
1794
|
+
width: columnWidths.value[column.name] || column.width
|
|
1795
|
+
}));
|
|
1796
|
+
});
|
|
1786
1797
|
// Methods
|
|
1787
1798
|
function updateSearchingModel(value) {
|
|
1788
1799
|
searchingModel.value = value;
|
|
@@ -1835,7 +1846,10 @@ var script = defineComponent({
|
|
|
1835
1846
|
context.emit('click:row', item);
|
|
1836
1847
|
}
|
|
1837
1848
|
function updateColumnWidth(column, width) {
|
|
1838
|
-
|
|
1849
|
+
columnWidths.value = {
|
|
1850
|
+
...columnWidths.value,
|
|
1851
|
+
[column.name]: `${width}px`
|
|
1852
|
+
};
|
|
1839
1853
|
if (props.features.storageKey) {
|
|
1840
1854
|
saveColumnWidths();
|
|
1841
1855
|
}
|
|
@@ -1843,7 +1857,7 @@ var script = defineComponent({
|
|
|
1843
1857
|
function saveColumnWidths() {
|
|
1844
1858
|
if (typeof window === 'undefined' || !props.features.storageKey) return;
|
|
1845
1859
|
const widths = {};
|
|
1846
|
-
|
|
1860
|
+
actualColumns.value.forEach(column => {
|
|
1847
1861
|
if (column.name && column.width) {
|
|
1848
1862
|
widths[column.name] = column.width;
|
|
1849
1863
|
}
|
|
@@ -1856,11 +1870,7 @@ var script = defineComponent({
|
|
|
1856
1870
|
const stored = localStorage.getItem(`or-data-grid-v3-widths-${props.features.storageKey}`);
|
|
1857
1871
|
if (stored) {
|
|
1858
1872
|
const widths = JSON.parse(stored);
|
|
1859
|
-
|
|
1860
|
-
if (column.name && widths[column.name]) {
|
|
1861
|
-
column.width = widths[column.name];
|
|
1862
|
-
}
|
|
1863
|
-
});
|
|
1873
|
+
columnWidths.value = widths;
|
|
1864
1874
|
}
|
|
1865
1875
|
} catch (e) {
|
|
1866
1876
|
console.error('[OrDataGrid]: Failed to load column widths from localStorage', e);
|
|
@@ -1894,6 +1904,7 @@ var script = defineComponent({
|
|
|
1894
1904
|
showSelectingCouter,
|
|
1895
1905
|
selectingDisabled,
|
|
1896
1906
|
skeletonsLength,
|
|
1907
|
+
actualColumns,
|
|
1897
1908
|
handleMouseEnterRow,
|
|
1898
1909
|
handleMouseLeaveRow,
|
|
1899
1910
|
handleMouseEnterCell,
|
|
@@ -1980,7 +1991,7 @@ var __vue_render__ = function () {
|
|
|
1980
1991
|
}],
|
|
1981
1992
|
style: _vm.tableInlineStyles,
|
|
1982
1993
|
attrs: {
|
|
1983
|
-
"columns": _vm.
|
|
1994
|
+
"columns": _vm.actualColumns,
|
|
1984
1995
|
"features": _vm.features
|
|
1985
1996
|
}
|
|
1986
1997
|
}, [_c('OrDataGridTableHeader', [_c('OrDataGridTableHeaderRow', {
|
|
@@ -2010,7 +2021,7 @@ var __vue_render__ = function () {
|
|
|
2010
2021
|
},
|
|
2011
2022
|
expression: "selectingIndicator"
|
|
2012
2023
|
}
|
|
2013
|
-
})], 1)] : _vm._e(), _vm._v(" "), _vm._l(_vm.
|
|
2024
|
+
})], 1)] : _vm._e(), _vm._v(" "), _vm._l(_vm.actualColumns, function (column) {
|
|
2014
2025
|
return _c('OrDataGridTableHeaderCell', {
|
|
2015
2026
|
key: column.name,
|
|
2016
2027
|
attrs: {
|
|
@@ -2069,7 +2080,7 @@ var __vue_render__ = function () {
|
|
|
2069
2080
|
"variant": _vm.variant,
|
|
2070
2081
|
"override": true
|
|
2071
2082
|
}
|
|
2072
|
-
}, [_c('OrSkeletonText')], 1)] : _vm._e(), _vm._v(" "), _vm._l(_vm.
|
|
2083
|
+
}, [_c('OrSkeletonText')], 1)] : _vm._e(), _vm._v(" "), _vm._l(_vm.actualColumns, function (column) {
|
|
2073
2084
|
return _c('OrDataGridTableContentCell', {
|
|
2074
2085
|
key: column.name,
|
|
2075
2086
|
attrs: {
|
|
@@ -2133,7 +2144,7 @@ var __vue_render__ = function () {
|
|
|
2133
2144
|
},
|
|
2134
2145
|
expression: "selectingModel"
|
|
2135
2146
|
}
|
|
2136
|
-
})], 1)] : _vm._e(), _vm._v(" "), _vm._l(_vm.
|
|
2147
|
+
})], 1)] : _vm._e(), _vm._v(" "), _vm._l(_vm.actualColumns, function (column) {
|
|
2137
2148
|
return _c('OrDataGridTableContentCell', {
|
|
2138
2149
|
key: column.name,
|
|
2139
2150
|
attrs: {
|
|
@@ -21,6 +21,7 @@ export type DataGridColumn = {
|
|
|
21
21
|
alignment?: 'start' | 'end' | 'center';
|
|
22
22
|
stickiness?: 'start' | 'end';
|
|
23
23
|
sorting?: boolean;
|
|
24
|
+
resizing?: boolean;
|
|
24
25
|
wrapping?: boolean;
|
|
25
26
|
control?: {
|
|
26
27
|
type: 'text' | 'number' | 'rating' | 'select' | 'checkbox' | 'switch' | 'date' | 'time' | 'datetime' | 'tags';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onereach/ui-components-vue2",
|
|
3
|
-
"version": "26.4.1-beta.
|
|
3
|
+
"version": "26.4.1-beta.5879.0",
|
|
4
4
|
"description": "Vue components library for v2",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"@codemirror/view": "^6",
|
|
41
41
|
"@floating-ui/dom": "1.5.3",
|
|
42
42
|
"@lezer/highlight": "*",
|
|
43
|
-
"@onereach/styles": "^26.4.1-beta.
|
|
44
|
-
"@onereach/ui-components-common": "^26.4.1-beta.
|
|
43
|
+
"@onereach/styles": "^26.4.1-beta.5879.0",
|
|
44
|
+
"@onereach/ui-components-common": "^26.4.1-beta.5879.0",
|
|
45
45
|
"@splidejs/splide": "4.0.6",
|
|
46
46
|
"@tiptap/core": "2.27.1",
|
|
47
47
|
"@tiptap/extension-blockquote": "2.27.1",
|