@onereach/ui-components-vue2 23.3.3 → 23.3.4-beta.5642.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.
@@ -820,9 +820,14 @@ var script$8 = defineComponent({
820
820
  setup(props, context) {
821
821
  // Refs & Styles
822
822
  const root = ref();
823
- const rootStyles = computed(() => {
823
+ // const isSortable = computed(() => (props.features?.sorting && !props.column?.sorting === false) || !!props.column?.name);
824
+ const isSortable = computed(() => {
824
825
  var _a, _b, _c;
825
- return ['or-data-grid-table-header-cell-v3', ...DataGridTableHeaderCell, ...(((_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.sorting) && ((_c = props.column) === null || _c === void 0 ? void 0 : _c.name) ? ['interactivity-click'] : [])];
826
+ 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;
827
+ });
828
+ const rootStyles = computed(() => {
829
+ var _a;
830
+ return ['or-data-grid-table-header-cell-v3', ...DataGridTableHeaderCell, ...(((_a = props.column) === null || _a === void 0 ? void 0 : _a.stickiness) ? [`sticky-${props.column.stickiness}`] : []), ...(isSortable.value ? ['interactivity-click'] : [])];
826
831
  });
827
832
  const rootInlineStyles = computed(() => {
828
833
  if (props.column) {
@@ -855,11 +860,11 @@ var script$8 = defineComponent({
855
860
  // State
856
861
  const model = computed({
857
862
  get: () => {
858
- var _a, _b, _c;
859
- if (!((_a = props.features) === null || _a === void 0 ? void 0 : _a.sorting)) {
863
+ var _a, _b;
864
+ if (!isSortable.value) {
860
865
  return;
861
866
  }
862
- return ((_b = props.modelValue) === null || _b === void 0 ? void 0 : _b.column) === ((_c = props.column) === null || _c === void 0 ? void 0 : _c.name) ? props.modelValue : undefined;
867
+ return ((_a = props.modelValue) === null || _a === void 0 ? void 0 : _a.column) === ((_b = props.column) === null || _b === void 0 ? void 0 : _b.name) ? props.modelValue : undefined;
863
868
  },
864
869
  set: value => {
865
870
  context.emit('update:modelValue', value);
@@ -867,8 +872,8 @@ var script$8 = defineComponent({
867
872
  });
868
873
  // Methods
869
874
  function toggleSorting() {
870
- var _a, _b;
871
- if (!((_a = props.features) === null || _a === void 0 ? void 0 : _a.sorting)) {
875
+ var _a;
876
+ if (!isSortable.value) {
872
877
  return;
873
878
  }
874
879
  if (model.value) {
@@ -881,7 +886,7 @@ var script$8 = defineComponent({
881
886
  throw new Error('[OrDataGridTableHeaderCell]: `column` must be specified.');
882
887
  }
883
888
  model.value = {
884
- column: ((_b = props.column) === null || _b === void 0 ? void 0 : _b.name) || '_check',
889
+ column: ((_a = props.column) === null || _a === void 0 ? void 0 : _a.name) || '_check',
885
890
  direction: 'asc'
886
891
  };
887
892
  }
@@ -905,6 +910,7 @@ var script$8 = defineComponent({
905
910
  root,
906
911
  rootStyles,
907
912
  rootInlineStyles,
913
+ isSortable,
908
914
  model,
909
915
  toggleSorting
910
916
  };
@@ -18,6 +18,7 @@ export type DataGridColumn = {
18
18
  width?: string;
19
19
  alignment?: 'start' | 'end' | 'center';
20
20
  stickiness?: 'start' | 'end';
21
+ sorting?: boolean;
21
22
  control?: {
22
23
  type: 'text' | 'number' | 'rating' | 'select' | 'checkbox' | 'switch' | 'date' | 'time' | 'datetime' | 'tags';
23
24
  options?: SelectItem[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/ui-components-vue2",
3
- "version": "23.3.3",
3
+ "version": "23.3.4-beta.5642.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": "^23.3.3",
44
- "@onereach/ui-components-common": "^23.3.3",
43
+ "@onereach/styles": "^23.3.4-beta.5642.0",
44
+ "@onereach/ui-components-common": "^23.3.4-beta.5642.0",
45
45
  "@splidejs/splide": "4.0.6",
46
46
  "@tiptap/core": "2.0.3",
47
47
  "@tiptap/extension-blockquote": "2.0.3",
@@ -102,6 +102,5 @@
102
102
  "publishConfig": {
103
103
  "access": "public"
104
104
  },
105
- "npmUnpacked": "4.15.2",
106
- "gitHead": "717aa5b9d5ebbb20b4abd143c89b6a406ca6286a"
105
+ "npmUnpacked": "4.15.2"
107
106
  }