Skip to content

Commit

Permalink
Finish v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
brianvoe committed Nov 20, 2022
2 parents 8dcbebf + 37f3b32 commit 61dd471
Show file tree
Hide file tree
Showing 156 changed files with 14,718 additions and 34,688 deletions.
4 changes: 0 additions & 4 deletions .browserslistrc

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.DS_Store
.idea
node_modules
coverage

# local env files
.env.local
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.12.1
5 changes: 0 additions & 5 deletions .postcssrc.js

This file was deleted.

6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": false,
"singleQuote": true,
"trailingComma": "all",
"printWidth": 120
}
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["Vue.volar", "orta.vscode-jest"]
}
20 changes: 15 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
{
"editor.formatOnSave": false,
"extensions.ignoreRecommendations": false,
"editor.detectIndentation": false,
"editor.formatOnSave": true,
"editor.insertSpaces": true,
"editor.tabSize": 2,
"tslint.autoFixOnSave": true
}
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": false,
"source.sortMembers": true
}
}
5 changes: 0 additions & 5 deletions babel.config.js

This file was deleted.

83 changes: 0 additions & 83 deletions dist/config.d.ts

This file was deleted.

50 changes: 0 additions & 50 deletions dist/data.d.ts

This file was deleted.

5 changes: 1 addition & 4 deletions dist/helper.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
export declare function generateID(): string;
export declare function hasClassInTree(element: HTMLElement, className: string): any;
export declare function ensureElementInView(container: HTMLElement, element: HTMLElement): void;
export declare function putContent(el: HTMLElement, currentPosition: string, isOpen: boolean): string;
export declare function debounce(func: (...params: any[]) => void, wait?: number, immediate?: boolean): () => void;
export declare function isValueInArrayOfObjects(selected: any, key: string, value: string): boolean;
export declare function highlight(str: string, search: any, className: string): any;
export declare function kebabCase(str: string): string;
96 changes: 38 additions & 58 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,71 +1,51 @@
import { Config } from './config';
import { Select } from './select';
import { Slim } from './slim';
import { Data, dataArray, Option } from './data';
interface Constructor {
import Render from './render';
import Select from './select';
import Settings, { SettingsPartial } from './settings';
import Store, { DataArray, DataArrayPartial, Option, OptionOptional } from './store';
export * from './helper';
export * from './settings';
export * from './select';
export * from './store';
export * from './render';
export { Settings, Select, Store, Render };
export interface Config {
select: string | Element;
data?: dataArray;
showSearch?: boolean;
searchPlaceholder?: string;
searchText?: string;
searchingText?: string;
searchFocus?: boolean;
searchHighlight?: boolean;
searchFilter?: (opt: Option, search: string) => boolean;
closeOnSelect?: boolean;
showContent?: string;
placeholder?: string;
allowDeselect?: boolean;
allowDeselectOption?: boolean;
hideSelectedOption?: boolean;
deselectLabel?: string;
isEnabled?: boolean;
valuesUseText?: boolean;
showOptionTooltips?: boolean;
selectByGroup?: boolean;
limit?: number;
timeoutDelay?: number;
addToBody?: boolean;
ajax?: (value: string, func: (info: any) => void) => void;
addable?: (value: string) => Option | string;
beforeOnChange?: (info: Option | Option[]) => void | boolean;
onChange?: (info: Option | Option[]) => void;
data?: DataArrayPartial;
settings?: SettingsPartial;
events?: Events;
}
export interface Events {
search?: (searchValue: string, currentData: DataArray) => Promise<DataArrayPartial> | DataArrayPartial;
searchFilter?: (option: Option, search: string) => boolean;
addable?: (value: string) => OptionOptional | string;
beforeChange?: (newVal: Option[], oldVal: Option[]) => boolean | void;
afterChange?: (newVal: Option[]) => void;
beforeOpen?: () => void;
afterOpen?: () => void;
beforeClose?: () => void;
afterClose?: () => void;
error?: (err: Error) => void;
}
export default class SlimSelect {
config: Config;
selectEl: HTMLSelectElement;
settings: Settings;
select: Select;
data: Data;
slim: Slim;
ajax: ((value: string, func: (info: any) => void) => void) | null;
addable: ((value: string) => Option | string) | null;
beforeOnChange: ((info: Option) => void | boolean) | null;
onChange: ((info: Option) => void) | null;
beforeOpen: (() => void) | null;
afterOpen: (() => void) | null;
beforeClose: (() => void) | null;
afterClose: (() => void) | null;
private windowScroll;
constructor(info: Constructor);
validate(info: Constructor): HTMLSelectElement;
selected(): string | string[];
set(value: string | string[], type?: string, close?: boolean, render?: boolean): void;
setSelected(value: string | string[], type?: string, close?: boolean, render?: boolean): void;
setData(data: dataArray): void;
addData(data: Option): void;
open(): void;
close(): void;
moveContentAbove(): void;
moveContentBelow(): void;
store: Store;
render: Render;
events: Events;
constructor(config: Config);
enable(): void;
disable(): void;
getData(): DataArray;
setData(data: DataArrayPartial): void;
getSelected(): string[];
setSelected(value: string | string[]): void;
addOption(option: OptionOptional): void;
open(): void;
close(): void;
search(value: string): void;
setSearchText(text: string): void;
render(): void;
destroy(id?: string | null): void;
destroy(): void;
private windowResize;
private windowScroll;
private documentClick;
}
export {};
Loading

0 comments on commit 61dd471

Please sign in to comment.