classcard-ui 0.2.655 → 0.2.658

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "classcard-ui",
3
- "version": "0.2.655",
3
+ "version": "0.2.658",
4
4
  "main": "dist/classcard-ui.umd.min.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -356,6 +356,13 @@ export default {
356
356
  },
357
357
  });
358
358
  sortable.on("sortable:stop", (e) => this.rearrange(e.oldIndex, e.newIndex));
359
+ document.addEventListener("keydown", this.handleControlClick, true);
360
+ document.addEventListener("keyup", this.handleControlRelease, true);
361
+ },
362
+ destroyed() {
363
+ //to remove the event listener
364
+ document.removeEventListener("keydown", this.handleControlClick, true);
365
+ document.removeEventListener("keyup", this.handleControlRelease, true);
359
366
  },
360
367
  data() {
361
368
  return {
@@ -364,9 +371,22 @@ export default {
364
371
  searchTerm: "",
365
372
  paginationRecords: this.paginationData,
366
373
  reorderedArray: [...this.rows],
374
+ controlClick: false,
367
375
  };
368
376
  },
369
377
  methods: {
378
+ handleControlClick(event) {
379
+ if (event.keyCode === 17) {
380
+ event.preventDefault();
381
+ this.controlClick = true;
382
+ }
383
+ },
384
+ handleControlRelease(event) {
385
+ if (event.keyCode === 17) {
386
+ event.preventDefault();
387
+ this.controlClick = false;
388
+ }
389
+ },
370
390
  handleToggle() {
371
391
  this.toggleDropdown = !this.toggleDropdown;
372
392
  },
@@ -417,7 +437,11 @@ export default {
417
437
  },
418
438
  onRowClick(params) {
419
439
  if (params.event.target.type === undefined) {
420
- this.$emit("onRowClickAction", params);
440
+ if (this.controlClick) {
441
+ this.$emit("onRowControlClickAction", params);
442
+ } else {
443
+ this.$emit("onRowClickAction", params);
444
+ }
421
445
  } else {
422
446
  return false;
423
447
  }