toggle-components-library 1.25.0 → 1.25.2

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.
@@ -104,7 +104,7 @@ export default {
104
104
  */
105
105
  trend_impact_base :{
106
106
  type: Number,
107
- default: 5
107
+ default: 0.5
108
108
  },
109
109
  /**
110
110
  * This prop will inverse the trend impact
@@ -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
package/src/.DS_Store DELETED
Binary file