toggle-components-library 1.25.1 → 1.25.3

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.
@@ -1,8 +1,11 @@
1
1
  import styleInfo from '../../../src/sass/includes/_as_variables.scss';
2
+ import jsonCharCodesData from '../json/char_list.json';
2
3
 
3
4
  export const mixins = {
4
5
  data(){
5
- return {}
6
+ return {
7
+ jsonCharCodes: jsonCharCodesData
8
+ }
6
9
  },
7
10
  methods:{
8
11
 
@@ -59,6 +62,20 @@ export const mixins = {
59
62
 
60
63
  //converts a character into an HTML entity
61
64
  const char2Html = (char) => {
65
+ // Check for special characters first
66
+ let codepointVals = Object.values(this.jsonCharCodes).map(value => value.codepoints[0]);
67
+
68
+ let codesArray = Object.entries(this.jsonCharCodes)
69
+
70
+ if (codepointVals.includes(char.codePointAt())) {
71
+
72
+ let namedChar = codesArray.filter(nestedArr => {
73
+ return nestedArr[1].codepoints[0] == char.codePointAt()
74
+ })
75
+ // If it's a special character return now
76
+ return `${namedChar[0][0]}`
77
+ }
78
+
62
79
  let item = `${char}`;
63
80
 
64
81
  //spread operator can detect emoji surrogate pairs
@@ -45,7 +45,16 @@ export default {
45
45
  window.getSelection().removeAllRanges();
46
46
  window.getSelection().addRange(range);
47
47
  document.execCommand("copy");
48
- }
48
+ this.click();
49
+ },
50
+ click(){
51
+ /**
52
+ * Emitted when the button is clicked.
53
+ * @event click
54
+ * @type {Event}
55
+ */
56
+ this.$emit('click');
57
+ }
49
58
  }
50
59
  };
51
60
  </script>
@@ -507,20 +507,20 @@ $iconWidth:20px;
507
507
  background-size: cover !important;
508
508
  background-position: center;
509
509
  border-radius:4px;
510
- cursor: move;
511
510
  }
512
- .toggle-item-img::after{
511
+ .toggle-center {
512
+ display: flex;
513
+ align-items: center;
514
+ justify-content: center;
515
+ }
516
+ .toggle-move-icon::after {
513
517
  position: absolute;
514
518
  content:'';
515
519
  height: 100%;
516
520
  width: 100%;
521
+ background-size: $iconWidth!important;
517
522
  background: url('../assets/icons/draggable.svg') no-repeat center center;
518
- background-size: $iconWidth;
519
- }
520
- .toggle-center {
521
- display: flex;
522
- align-items: center;
523
- justify-content: center;
523
+ cursor: move;
524
524
  }
525
525
 
526
526
  }
@@ -51,7 +51,7 @@ a {
51
51
  background-position: center;
52
52
  background-size: contain;
53
53
  background-repeat: no-repeat;
54
- cursor:pointer;
54
+ cursor:copy;
55
55
  }
56
56
  }
57
57
  }
package/src/.DS_Store DELETED
Binary file