@onereach/ui-components-vue2 26.4.1-beta.5880.0 → 26.4.1-beta.5881.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.
@@ -258,6 +258,10 @@ var script$e = defineComponent({
258
258
  override: {
259
259
  type: Boolean,
260
260
  default: false
261
+ },
262
+ stickyOffset: {
263
+ type: Number,
264
+ default: 0
261
265
  }
262
266
  },
263
267
  emits: ['input'],
@@ -267,7 +271,7 @@ var script$e = defineComponent({
267
271
  const root = ref();
268
272
  const rootStyles = computed(() => {
269
273
  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'] : [])];
274
+ return ['or-data-grid-table-content-cell-v3', ...DataGridTableContentCell, ...(((_a = props.column) === null || _a === void 0 ? void 0 : _a.stickiness) ? [`sticky-${props.column.stickiness}`, 'overflow-hidden'] : []), ...(!!((_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'] : [])];
271
275
  });
272
276
  const rootInlineStyles = computed(() => {
273
277
  if (props.column) {
@@ -275,7 +279,7 @@ var script$e = defineComponent({
275
279
  case 'start':
276
280
  return {
277
281
  position: 'sticky',
278
- insetInlineStart: '0',
282
+ insetInlineStart: `${props.stickyOffset}px`,
279
283
  zIndex: '30',
280
284
  flexDirection: props.column.alignment === 'end' ? 'row-reverse' : undefined,
281
285
  justifyContent: props.column.alignment
@@ -283,7 +287,7 @@ var script$e = defineComponent({
283
287
  case 'end':
284
288
  return {
285
289
  position: 'sticky',
286
- insetInlineEnd: '0',
290
+ insetInlineEnd: `${props.stickyOffset}px`,
287
291
  zIndex: '30',
288
292
  flexDirection: props.column.alignment === 'end' ? 'row-reverse' : undefined,
289
293
  justifyContent: props.column.alignment
@@ -300,9 +304,11 @@ var script$e = defineComponent({
300
304
  };
301
305
  });
302
306
  const contentStyles = computed(() => {
303
- var _a, _b, _c;
307
+ var _a, _b, _c, _d, _e, _f;
304
308
  const isWrapping = (_b = (_a = props.column) === null || _a === void 0 ? void 0 : _a.wrapping) !== null && _b !== void 0 ? _b : props.variant === DataGridVariant.Dynamic && !((_c = props.column) === null || _c === void 0 ? void 0 : _c.control);
305
- return [...DataGridTableContentCellContent.filter(style => style !== 'truncate'), ...(isWrapping ? ['whitespace-pre-wrap break-words'] : ['truncate'])];
309
+ const isSticky = !!((_d = props.column) === null || _d === void 0 ? void 0 : _d.stickiness);
310
+ const isTags = ((_f = (_e = props.column) === null || _e === void 0 ? void 0 : _e.control) === null || _f === void 0 ? void 0 : _f.type) === 'tags';
311
+ return ['layout-row items-center w-full min-w-0', ...(isSticky || isTags ? ['overflow-hidden'] : []), ...DataGridTableContentCellContent.filter(style => style !== 'truncate'), ...(isWrapping ? ['whitespace-pre-wrap break-words'] : ['truncate'])];
306
312
  });
307
313
  const contentInlineStyles = computed(() => ({
308
314
  minWidth: props.column && props.column.minWidth || DATA_GRID_DEFAULT_MIN_WIDTH,
@@ -344,7 +350,10 @@ var __vue_render__$e = function () {
344
350
  ref: 'root',
345
351
  class: _vm.rootStyles,
346
352
  style: _vm.rootInlineStyles
347
- }, [_vm.override ? [_vm._t("default")] : _vm.control ? [_vm.control.type === 'text' ? [_c('OrInput', {
353
+ }, [_vm.override ? [_vm._t("default")] : _vm.control ? [_c('div', {
354
+ class: _vm.contentStyles,
355
+ style: _vm.contentInlineStyles
356
+ }, [_vm.control.type === 'text' ? [_c('OrInput', {
348
357
  attrs: {
349
358
  "type": 'text',
350
359
  "variant": 'embedded'
@@ -442,6 +451,7 @@ var __vue_render__$e = function () {
442
451
  expression: "model"
443
452
  }
444
453
  })] : _vm._e(), _vm._v(" "), _vm.control.type === 'tags' ? [_c('OrTagInput', {
454
+ class: ['grow min-w-0'],
445
455
  attrs: {
446
456
  "variant": 'embedded'
447
457
  },
@@ -452,7 +462,7 @@ var __vue_render__$e = function () {
452
462
  },
453
463
  expression: "model"
454
464
  }
455
- })] : _vm._e()] : [_c('div', {
465
+ })] : _vm._e()], 2)] : [_c('div', {
456
466
  class: _vm.contentStyles,
457
467
  style: _vm.contentInlineStyles
458
468
  }, [_vm._t("default")], 2)]], 2);
@@ -863,6 +873,10 @@ var script$8 = defineComponent({
863
873
  features: {
864
874
  type: Object,
865
875
  default: undefined
876
+ },
877
+ stickyOffset: {
878
+ type: Number,
879
+ default: 0
866
880
  }
867
881
  },
868
882
  emits: ['update:modelValue', 'update:scrollOffset', 'remove:scrollOffset', 'update:column-width'],
@@ -881,7 +895,7 @@ var script$8 = defineComponent({
881
895
  });
882
896
  const rootStyles = computed(() => {
883
897
  var _a;
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'] : [])];
898
+ 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}`, 'overflow-hidden'] : []), ...(isResizable.value ? ['resizable'] : []), ...(isSortable.value ? ['interactivity-click'] : [])];
885
899
  });
886
900
  const resizeHandleStyles = computed(() => ['or-data-grid-table-header-cell-resize-handle-v3', ...DataGridTableHeaderCellResizeHandle]);
887
901
  const wrapInlineStyle = computed(() => {
@@ -897,7 +911,7 @@ var script$8 = defineComponent({
897
911
  case 'start':
898
912
  return {
899
913
  position: 'sticky',
900
- insetInlineStart: '0',
914
+ insetInlineStart: `${props.stickyOffset}px`,
901
915
  zIndex: '120',
902
916
  flexDirection: props.column.alignment === 'end' ? 'row-reverse' : undefined,
903
917
  justifyContent: props.column.alignment
@@ -905,7 +919,7 @@ var script$8 = defineComponent({
905
919
  case 'end':
906
920
  return {
907
921
  position: 'sticky',
908
- insetInlineEnd: '0',
922
+ insetInlineEnd: `${props.stickyOffset}px`,
909
923
  zIndex: '120',
910
924
  flexDirection: props.column.alignment === 'end' ? 'row-reverse' : undefined,
911
925
  justifyContent: props.column.alignment
@@ -1783,8 +1797,6 @@ var script = defineComponent({
1783
1797
  });
1784
1798
  }
1785
1799
  });
1786
- const scrollOffsetStart = ref(new Map());
1787
- const scrollOffsetEnd = ref(new Map());
1788
1800
  const showSelectingCouter = computed(() => {
1789
1801
  return props.features.selecting && (typeof props.features.selecting === 'object' ? props.features.selecting.showCounter !== false : true);
1790
1802
  });
@@ -1802,6 +1814,42 @@ var script = defineComponent({
1802
1814
  width: columnWidths.value[column.name] || column.width
1803
1815
  }));
1804
1816
  });
1817
+ const scrollOffsetStart = ref(new Map());
1818
+ const scrollOffsetEnd = ref(new Map());
1819
+ const stickyOffsets = computed(() => {
1820
+ const start = new Map();
1821
+ const end = new Map();
1822
+ const startColumns = [];
1823
+ const endColumns = [];
1824
+ if (props.features.selecting) {
1825
+ startColumns.push({
1826
+ name: '_check',
1827
+ stickiness: 'start'
1828
+ });
1829
+ }
1830
+ actualColumns.value.forEach(column => {
1831
+ if (column.stickiness === 'start') {
1832
+ startColumns.push(column);
1833
+ } else if (column.stickiness === 'end') {
1834
+ endColumns.push(column);
1835
+ }
1836
+ });
1837
+ let currentStartOffset = 0;
1838
+ startColumns.forEach(column => {
1839
+ start.set(column.name, currentStartOffset);
1840
+ currentStartOffset += scrollOffsetStart.value.get(column.name) || 0;
1841
+ });
1842
+ let currentEndOffset = 0;
1843
+ // End columns are stacked from right to left
1844
+ [...endColumns].reverse().forEach(column => {
1845
+ end.set(column.name, currentEndOffset);
1846
+ currentEndOffset += scrollOffsetEnd.value.get(column.name) || 0;
1847
+ });
1848
+ return {
1849
+ start,
1850
+ end
1851
+ };
1852
+ });
1805
1853
  // Methods
1806
1854
  function updateSearchingModel(value) {
1807
1855
  searchingModel.value = value;
@@ -1809,19 +1857,19 @@ var script = defineComponent({
1809
1857
  function updateScrollOffset(header, offset, column) {
1810
1858
  switch (column.stickiness) {
1811
1859
  case 'start':
1812
- scrollOffsetStart.value.set(header, offset);
1860
+ scrollOffsetStart.value.set(column.name, offset);
1813
1861
  scrollOffsetStart.value = new Map(scrollOffsetStart.value);
1814
- scrollOffsetEnd.value.delete(header);
1862
+ scrollOffsetEnd.value.delete(column.name);
1815
1863
  scrollOffsetEnd.value = new Map(scrollOffsetEnd.value);
1816
1864
  break;
1817
1865
  case 'end':
1818
- scrollOffsetStart.value.delete(header);
1866
+ scrollOffsetStart.value.delete(column.name);
1819
1867
  scrollOffsetStart.value = new Map(scrollOffsetStart.value);
1820
- scrollOffsetEnd.value.set(header, offset);
1868
+ scrollOffsetEnd.value.set(column.name, offset);
1821
1869
  scrollOffsetEnd.value = new Map(scrollOffsetEnd.value);
1822
1870
  break;
1823
1871
  default:
1824
- removeScrollOffset(header);
1872
+ removeScrollOffset(column.name);
1825
1873
  break;
1826
1874
  }
1827
1875
  }
@@ -1891,10 +1939,10 @@ var script = defineComponent({
1891
1939
  // if (!props.interactiveRows) return;
1892
1940
  // context.emit('click:cell', { item, columnName, value });
1893
1941
  // }
1894
- function removeScrollOffset(header) {
1895
- scrollOffsetStart.value.delete(header);
1942
+ function removeScrollOffset(name) {
1943
+ scrollOffsetStart.value.delete(name);
1896
1944
  scrollOffsetStart.value = new Map(scrollOffsetStart.value);
1897
- scrollOffsetEnd.value.delete(header);
1945
+ scrollOffsetEnd.value.delete(name);
1898
1946
  scrollOffsetEnd.value = new Map(scrollOffsetEnd.value);
1899
1947
  }
1900
1948
  // Helpers
@@ -1924,6 +1972,7 @@ var script = defineComponent({
1924
1972
  searchingModel,
1925
1973
  sortingModel,
1926
1974
  pagingModel,
1975
+ stickyOffsets,
1927
1976
  updateScrollOffset,
1928
1977
  removeScrollOffset,
1929
1978
  updateSearchingModel,
@@ -2010,8 +2059,10 @@ var __vue_render__ = function () {
2010
2059
  staticClass: "md:!py-none",
2011
2060
  attrs: {
2012
2061
  "column": {
2062
+ name: '_check',
2013
2063
  stickiness: 'start'
2014
- }
2064
+ },
2065
+ "sticky-offset": _vm.stickyOffsets.start.get('_check')
2015
2066
  },
2016
2067
  on: {
2017
2068
  "update:scroll-offset": _vm.updateScrollOffset,
@@ -2034,7 +2085,8 @@ var __vue_render__ = function () {
2034
2085
  key: column.name,
2035
2086
  attrs: {
2036
2087
  "column": column,
2037
- "features": _vm.features
2088
+ "features": _vm.features,
2089
+ "sticky-offset": column.stickiness === 'start' ? _vm.stickyOffsets.start.get(column.name) : column.stickiness === 'end' ? _vm.stickyOffsets.end.get(column.name) : undefined
2038
2090
  },
2039
2091
  on: {
2040
2092
  "update:scroll-offset": _vm.updateScrollOffset,
@@ -2083,8 +2135,10 @@ var __vue_render__ = function () {
2083
2135
  }, [_vm.features.selecting ? [_c('OrDataGridTableContentCell', {
2084
2136
  attrs: {
2085
2137
  "column": {
2138
+ name: '_check',
2086
2139
  stickiness: 'start'
2087
2140
  },
2141
+ "sticky-offset": _vm.stickyOffsets.start.get('_check'),
2088
2142
  "variant": _vm.variant,
2089
2143
  "override": true
2090
2144
  }
@@ -2094,6 +2148,7 @@ var __vue_render__ = function () {
2094
2148
  attrs: {
2095
2149
  "column": column,
2096
2150
  "features": _vm.features,
2151
+ "sticky-offset": column.stickiness === 'start' ? _vm.stickyOffsets.start.get(column.name) : column.stickiness === 'end' ? _vm.stickyOffsets.end.get(column.name) : undefined,
2097
2152
  "variant": _vm.variant,
2098
2153
  "override": true
2099
2154
  }
@@ -2126,8 +2181,10 @@ var __vue_render__ = function () {
2126
2181
  staticClass: "md:!py-none",
2127
2182
  attrs: {
2128
2183
  "column": {
2184
+ name: '_check',
2129
2185
  stickiness: 'start'
2130
2186
  },
2187
+ "sticky-offset": _vm.stickyOffsets.start.get('_check'),
2131
2188
  "variant": _vm.variant,
2132
2189
  "override": true,
2133
2190
  "force-state": 'none'
@@ -2159,6 +2216,7 @@ var __vue_render__ = function () {
2159
2216
  "model-value": item[column.name],
2160
2217
  "column": column,
2161
2218
  "features": _vm.features,
2219
+ "sticky-offset": column.stickiness === 'start' ? _vm.stickyOffsets.start.get(column.name) : column.stickiness === 'end' ? _vm.stickyOffsets.end.get(column.name) : undefined,
2162
2220
  "variant": _vm.variant
2163
2221
  },
2164
2222
  on: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/ui-components-vue2",
3
- "version": "26.4.1-beta.5880.0",
3
+ "version": "26.4.1-beta.5881.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.5880.0",
44
- "@onereach/ui-components-common": "^26.4.1-beta.5880.0",
43
+ "@onereach/styles": "^26.4.1-beta.5881.0",
44
+ "@onereach/ui-components-common": "^26.4.1-beta.5881.0",
45
45
  "@splidejs/splide": "4.0.6",
46
46
  "@tiptap/core": "2.27.1",
47
47
  "@tiptap/extension-blockquote": "2.27.1",