@onereach/ui-components-vue2 26.4.1-beta.5878.0 → 26.4.1-beta.5880.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.
@@ -206,10 +206,14 @@ const DataGridTableContentCell = [
206
206
  'theme-border-transparent border-1', 'dark:theme-border-transparent-dark', 'theme-outline-transparent outline-2 -outline-offset-1', 'dark:theme-outline-transparent-dark',
207
207
  // Theme (focus)
208
208
  'focus-within:theme-border-primary', 'dark:focus-within:theme-border-primary-dark', 'focus-within:theme-outline-primary', 'dark:focus-within:theme-outline-primary-dark',
209
+ // Theme (Stacking)
210
+ 'relative',
209
211
  // Theme (.sticky-start)
210
212
  '[&.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
213
  // 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'];
214
+ '[&.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',
215
+ // Theme (.resizable)
216
+ '[&.resizable]:border-e-disabled [&.resizable]:border-solid', 'dark:[&.resizable]:border-e-disabled-dark'];
213
217
  const DataGridTableContentCellContent = [
214
218
  // interactivity
215
219
  'interactivity-select',
@@ -262,8 +266,8 @@ var script$e = defineComponent({
262
266
  // Refs & Styles
263
267
  const root = ref();
264
268
  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}`] : [])];
269
+ var _a, _b, _c, _d;
270
+ 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
271
  });
268
272
  const rootInlineStyles = computed(() => {
269
273
  if (props.column) {
@@ -272,6 +276,7 @@ var script$e = defineComponent({
272
276
  return {
273
277
  position: 'sticky',
274
278
  insetInlineStart: '0',
279
+ zIndex: '30',
275
280
  flexDirection: props.column.alignment === 'end' ? 'row-reverse' : undefined,
276
281
  justifyContent: props.column.alignment
277
282
  };
@@ -279,6 +284,7 @@ var script$e = defineComponent({
279
284
  return {
280
285
  position: 'sticky',
281
286
  insetInlineEnd: '0',
287
+ zIndex: '30',
282
288
  flexDirection: props.column.alignment === 'end' ? 'row-reverse' : undefined,
283
289
  justifyContent: props.column.alignment
284
290
  };
@@ -476,6 +482,8 @@ var __vue_component__$t = __vue_component__$s;
476
482
  const DataGridTableContentRow = [
477
483
  // Layout
478
484
  'grid grid-cols-[subgrid] col-span-full',
485
+ // Stacking context
486
+ 'relative z-[1]',
479
487
  // Typography
480
488
  'typography-body-2-regular',
481
489
  // Theme
@@ -819,11 +827,13 @@ const DataGridTableHeaderCell = [
819
827
  // Theme
820
828
  'theme-border-transparent border-1', 'dark:theme-border-transparent-dark', 'theme-outline-transparent outline-2 -outline-offset-1', 'dark:theme-outline-transparent-dark',
821
829
  // Theme (Stacking)
822
- 'relative z-1 hover:z-2',
830
+ 'relative hover:z-[2]',
823
831
  // Theme (.sticky-start)
824
- '[&.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',
832
+ '[&.sticky-start]:theme-background-surface-variant-1 [&.sticky-start]:border-e-disabled [&.sticky-start]:border-solid', 'dark:[&.sticky-start]:theme-background-surface-variant-1-dark dark:[&.sticky-start]:border-e-disabled-dark',
825
833
  // 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'];
834
+ '[&.sticky-end]:theme-background-surface-variant-1 [&.sticky-end]:border-s-disabled [&.sticky-end]:border-solid', 'dark:[&.sticky-end]:theme-background-surface-variant-1-dark dark:[&.sticky-end]:border-s-disabled-dark',
835
+ // Theme (.resizable)
836
+ '[&.resizable]:border-e-disabled [&.resizable]:border-solid', 'dark:[&.resizable]:border-e-disabled-dark'];
827
837
  const DataGridTableHeaderCellResizeHandle = [
828
838
  // Position
829
839
  'absolute top-0 bottom-0 end-0 z-50',
@@ -866,12 +876,12 @@ var script$8 = defineComponent({
866
876
  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
877
  });
868
878
  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);
879
+ var _a, _b, _c;
880
+ 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
881
  });
872
882
  const rootStyles = computed(() => {
873
883
  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'] : [])];
884
+ 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
885
  });
876
886
  const resizeHandleStyles = computed(() => ['or-data-grid-table-header-cell-resize-handle-v3', ...DataGridTableHeaderCellResizeHandle]);
877
887
  const wrapInlineStyle = computed(() => {
@@ -888,6 +898,7 @@ var script$8 = defineComponent({
888
898
  return {
889
899
  position: 'sticky',
890
900
  insetInlineStart: '0',
901
+ zIndex: '120',
891
902
  flexDirection: props.column.alignment === 'end' ? 'row-reverse' : undefined,
892
903
  justifyContent: props.column.alignment
893
904
  };
@@ -895,6 +906,7 @@ var script$8 = defineComponent({
895
906
  return {
896
907
  position: 'sticky',
897
908
  insetInlineEnd: '0',
909
+ zIndex: '120',
898
910
  flexDirection: props.column.alignment === 'end' ? 'row-reverse' : undefined,
899
911
  justifyContent: props.column.alignment
900
912
  };
@@ -1062,7 +1074,7 @@ var __vue_component__$h = __vue_component__$g;
1062
1074
 
1063
1075
  const DataGridTableHeaderRow = [
1064
1076
  // Position
1065
- 'sticky top-0 z-10',
1077
+ 'sticky top-0 z-[110]',
1066
1078
  // Layout
1067
1079
  'grid grid-cols-[subgrid] col-span-full',
1068
1080
  // Typography
@@ -1783,6 +1795,13 @@ var script = defineComponent({
1783
1795
  var _a;
1784
1796
  return ((_a = pagination.value) === null || _a === void 0 ? void 0 : _a.currentLimit) || 10;
1785
1797
  });
1798
+ const columnWidths = ref({});
1799
+ const actualColumns = computed(() => {
1800
+ return props.columns.map(column => ({
1801
+ ...column,
1802
+ width: columnWidths.value[column.name] || column.width
1803
+ }));
1804
+ });
1786
1805
  // Methods
1787
1806
  function updateSearchingModel(value) {
1788
1807
  searchingModel.value = value;
@@ -1835,7 +1854,10 @@ var script = defineComponent({
1835
1854
  context.emit('click:row', item);
1836
1855
  }
1837
1856
  function updateColumnWidth(column, width) {
1838
- column.width = `${width}px`;
1857
+ columnWidths.value = {
1858
+ ...columnWidths.value,
1859
+ [column.name]: `${width}px`
1860
+ };
1839
1861
  if (props.features.storageKey) {
1840
1862
  saveColumnWidths();
1841
1863
  }
@@ -1843,7 +1865,7 @@ var script = defineComponent({
1843
1865
  function saveColumnWidths() {
1844
1866
  if (typeof window === 'undefined' || !props.features.storageKey) return;
1845
1867
  const widths = {};
1846
- props.columns.forEach(column => {
1868
+ actualColumns.value.forEach(column => {
1847
1869
  if (column.name && column.width) {
1848
1870
  widths[column.name] = column.width;
1849
1871
  }
@@ -1856,11 +1878,7 @@ var script = defineComponent({
1856
1878
  const stored = localStorage.getItem(`or-data-grid-v3-widths-${props.features.storageKey}`);
1857
1879
  if (stored) {
1858
1880
  const widths = JSON.parse(stored);
1859
- props.columns.forEach(column => {
1860
- if (column.name && widths[column.name]) {
1861
- column.width = widths[column.name];
1862
- }
1863
- });
1881
+ columnWidths.value = widths;
1864
1882
  }
1865
1883
  } catch (e) {
1866
1884
  console.error('[OrDataGrid]: Failed to load column widths from localStorage', e);
@@ -1894,6 +1912,7 @@ var script = defineComponent({
1894
1912
  showSelectingCouter,
1895
1913
  selectingDisabled,
1896
1914
  skeletonsLength,
1915
+ actualColumns,
1897
1916
  handleMouseEnterRow,
1898
1917
  handleMouseLeaveRow,
1899
1918
  handleMouseEnterCell,
@@ -1980,7 +1999,7 @@ var __vue_render__ = function () {
1980
1999
  }],
1981
2000
  style: _vm.tableInlineStyles,
1982
2001
  attrs: {
1983
- "columns": _vm.columns,
2002
+ "columns": _vm.actualColumns,
1984
2003
  "features": _vm.features
1985
2004
  }
1986
2005
  }, [_c('OrDataGridTableHeader', [_c('OrDataGridTableHeaderRow', {
@@ -2010,7 +2029,7 @@ var __vue_render__ = function () {
2010
2029
  },
2011
2030
  expression: "selectingIndicator"
2012
2031
  }
2013
- })], 1)] : _vm._e(), _vm._v(" "), _vm._l(_vm.columns, function (column) {
2032
+ })], 1)] : _vm._e(), _vm._v(" "), _vm._l(_vm.actualColumns, function (column) {
2014
2033
  return _c('OrDataGridTableHeaderCell', {
2015
2034
  key: column.name,
2016
2035
  attrs: {
@@ -2069,7 +2088,7 @@ var __vue_render__ = function () {
2069
2088
  "variant": _vm.variant,
2070
2089
  "override": true
2071
2090
  }
2072
- }, [_c('OrSkeletonText')], 1)] : _vm._e(), _vm._v(" "), _vm._l(_vm.columns, function (column) {
2091
+ }, [_c('OrSkeletonText')], 1)] : _vm._e(), _vm._v(" "), _vm._l(_vm.actualColumns, function (column) {
2073
2092
  return _c('OrDataGridTableContentCell', {
2074
2093
  key: column.name,
2075
2094
  attrs: {
@@ -2133,7 +2152,7 @@ var __vue_render__ = function () {
2133
2152
  },
2134
2153
  expression: "selectingModel"
2135
2154
  }
2136
- })], 1)] : _vm._e(), _vm._v(" "), _vm._l(_vm.columns, function (column) {
2155
+ })], 1)] : _vm._e(), _vm._v(" "), _vm._l(_vm.actualColumns, function (column) {
2137
2156
  return _c('OrDataGridTableContentCell', {
2138
2157
  key: column.name,
2139
2158
  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.5878.0",
3
+ "version": "26.4.1-beta.5880.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.5878.0",
44
- "@onereach/ui-components-common": "^26.4.1-beta.5878.0",
43
+ "@onereach/styles": "^26.4.1-beta.5880.0",
44
+ "@onereach/ui-components-common": "^26.4.1-beta.5880.0",
45
45
  "@splidejs/splide": "4.0.6",
46
46
  "@tiptap/core": "2.27.1",
47
47
  "@tiptap/extension-blockquote": "2.27.1",