infinite-autocomplete
Advanced tools
Comparing version 4.0.0-rc to 4.0.0-rc2
{ | ||
"name": "infinite-autocomplete", | ||
"version": "4.0.0-rc", | ||
"version": "4.0.0-rc2", | ||
"description": "infinite-autocomplete", | ||
@@ -15,3 +15,2 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"lodash": "^4.17.11", | ||
"@babel/core": "7.2.0", | ||
@@ -22,5 +21,5 @@ "babel-eslint": "^10.0.1", | ||
"ghooks": "^2.0.4", | ||
"lodash": "^4.17.11", | ||
"parcel-bundler": "^1.6.1", | ||
"rimraf": "^2.6.3", | ||
"sass": "^1.17.3" | ||
"rimraf": "^2.6.3" | ||
}, | ||
@@ -27,0 +26,0 @@ "config": { |
export const DEFAULT_FETCH_SIZE = 10; | ||
export const DEFAULT_DATA = []; | ||
export const noop = () => {}; | ||
export const STYLES_ID = 'infinite-autocomplete-style'; |
import { curry, flow, get, debounce, each, throttle } from 'lodash/fp'; | ||
import mainTemplate from './templates/mainTemplate'; | ||
import './templates/style.scss'; | ||
import styles from './templates/styles'; | ||
import { | ||
@@ -13,3 +13,4 @@ setInnerHTML, | ||
pushToHandlers, | ||
setOptionsScrollHandler | ||
setOptionsScrollHandler, | ||
applyStyles | ||
} from './utils'; | ||
@@ -28,2 +29,4 @@ import onInputChange from './onInputChange'; | ||
applyStyles(styles); | ||
const templateCreationPipeline = flow([ | ||
@@ -30,0 +33,0 @@ mainTemplate, |
import { curry, isFunction, constant, get, flow } from 'lodash/fp'; | ||
import optionsTemplate from '../templates/optionsTemplate'; | ||
import { STYLES_ID } from '../constants'; | ||
@@ -16,2 +17,12 @@ export const setInnerHTML = curry((containerEle, htmlTemplate) => { | ||
export const applyStyles = (styles) => { | ||
const isMainWrapperStyleApplied = document.head.querySelector(`#${STYLES_ID}`); | ||
if (!isMainWrapperStyleApplied) { | ||
const mainWrapperStyle = document.createElement('style'); | ||
mainWrapperStyle.id = STYLES_ID; | ||
mainWrapperStyle.innerHTML = styles; | ||
document.head.appendChild(mainWrapperStyle); | ||
} | ||
}; | ||
export const setInputChangeHandler = (handler, inputEle) => () => { | ||
@@ -18,0 +29,0 @@ inputEle.addEventListener('input', handler); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
616713
8
8651
2
22