@omnigrid/resize-plugin 0.1.0 → 0.1.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.
Files changed (2) hide show
  1. package/dist/index.js +31 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -206,6 +206,26 @@ export class ColumnResizePlugin {
206
206
  const contentStyle = column.pinned === "right"
207
207
  ? "position:relative; display:flex; align-items:center; width:calc(100% + 12px); margin-left:-12px; padding-left:12px; min-width:0;"
208
208
  : "position:relative; display:flex; align-items:center; width:calc(100% + 12px); margin-right:-12px; min-width:0;";
209
+ const sortIndicator = column.sortState && this.api
210
+ ? {
211
+ type: "node",
212
+ tag: "span",
213
+ attrs: { class: "omnigrid-sort-indicator", "aria-hidden": true },
214
+ children: [
215
+ this.api.icons.get(column.sortState === "asc" ? "arrow-up" : "arrow-down"),
216
+ ...(column.sortIndex !== undefined
217
+ ? [
218
+ {
219
+ type: "node",
220
+ tag: "span",
221
+ attrs: { class: "omnigrid-sort-priority" },
222
+ children: [String(column.sortIndex)],
223
+ },
224
+ ]
225
+ : []),
226
+ ],
227
+ }
228
+ : undefined;
209
229
  return {
210
230
  type: "node",
211
231
  tag: "span",
@@ -220,6 +240,16 @@ export class ColumnResizePlugin {
220
240
  attrs: { class: "omnigrid-header-label", style: "overflow:hidden; text-overflow:ellipsis; white-space:nowrap;" },
221
241
  children: [content],
222
242
  },
243
+ ...(sortIndicator
244
+ ? [
245
+ {
246
+ type: "node",
247
+ tag: "span",
248
+ attrs: { class: "omnigrid-header-tools" },
249
+ children: [sortIndicator],
250
+ },
251
+ ]
252
+ : []),
223
253
  {
224
254
  type: "node",
225
255
  tag: "span",
@@ -237,6 +267,7 @@ export class ColumnResizePlugin {
237
267
  dblclick: (_context) => {
238
268
  this.autoSizeColumn(column.id);
239
269
  },
270
+ click: () => undefined,
240
271
  },
241
272
  },
242
273
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omnigrid/resize-plugin",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Headless column resize plugin for OmniGrid",
5
5
  "keywords": [
6
6
  "omnigrid",