jb-select 4.8.8 → 5.0.0

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.
package/lib/types.ts ADDED
@@ -0,0 +1,26 @@
1
+ export type JBSelectCallbacks<TOption,TValue> = {
2
+ getOptionTitle: (option:TOption) => string;
3
+ getOptionValue?: (option:TOption) => TValue;
4
+ getOptionDOM: null | ((option:TOption, onSelectCallback:(e:MouseEvent)=>void, isSelected:boolean) => HTMLElement);
5
+ getSelectedValueDOM: null | ((option:TOption) => HTMLElement);
6
+ }
7
+ export type JBSelectOptionElement<TOption> = HTMLElement & {value?: TOption};
8
+ export type JBSelectElements = {
9
+ input: HTMLInputElement,
10
+ componentWrapper: HTMLDivElement,
11
+ selectedValueWrapper: HTMLDivElement,
12
+ messageBox:HTMLDivElement,
13
+ optionList: HTMLDivElement,
14
+ optionListWrapper: HTMLDivElement,
15
+ arrowIcon: HTMLDivElement,
16
+ label:{
17
+ wrapper: HTMLLabelElement,
18
+ text: HTMLSpanElement
19
+ },
20
+ emptyListPlaceholder: HTMLDivElement,
21
+ }
22
+ export type ValidationValue<TOption,TValue> = {
23
+ selectedOption:TOption | null,
24
+ value:TValue | null,
25
+ inputtedText:string
26
+ }
package/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "select",
13
13
  "web component"
14
14
  ],
15
- "version": "4.8.8",
15
+ "version": "5.0.0",
16
16
  "bugs": "https://github.com/javadbat/jb-select/issues",
17
17
  "license": "MIT",
18
18
  "files": [
@@ -21,10 +21,16 @@
21
21
  "lib/",
22
22
  "dist/"
23
23
  ],
24
- "types": "./dist/JBSelect.d.ts",
24
+ "types": "./dist/dist/web-component/jb-select/lib/jb-select.d.ts",
25
25
  "main": "index.js",
26
26
  "repository": {
27
27
  "type": "git",
28
28
  "url": "git@github.com:javadbat/jb-select.git"
29
+ },
30
+ "dependencies": {
31
+ "jb-validation": ">=0.0.3"
32
+ },
33
+ "devDependencies": {
34
+ "jb-form":">=0.0.8"
29
35
  }
30
36
  }
@@ -1,62 +0,0 @@
1
- import { JBSelectCallbacks, JBSelectElements, JBSelectOptionElement } from './Types';
2
- export declare class JBSelectWebComponent extends HTMLElement {
3
- #private;
4
- required: boolean;
5
- callbacks: JBSelectCallbacks;
6
- elements: JBSelectElements;
7
- get value(): any;
8
- set value(value: any);
9
- get textValue(): string;
10
- set textValue(value: string);
11
- get selectedOptionTitle(): string;
12
- get optionList(): any[];
13
- set optionList(value: any[]);
14
- get placeholder(): string;
15
- set placeholder(value: string);
16
- get searchPlaceholder(): string;
17
- set searchPlaceholder(value: string);
18
- get displayOptionList(): any[];
19
- set displayOptionList(value: any[]);
20
- get isMobileDevice(): boolean;
21
- get isOpen(): boolean;
22
- constructor();
23
- connectedCallback(): void;
24
- callOnInitEvent(): void;
25
- callOnLoadEvent(): void;
26
- initWebComponent(): void;
27
- registerEventListener(): void;
28
- initProp(): void;
29
- static get observedAttributes(): string[];
30
- attributeChangedCallback(name: any, oldValue: any, newValue: any): void;
31
- onAttributeChange(name: string, value: string): void;
32
- _setValueOnOptionListChanged(): void;
33
- onArrowKeyClick(): void;
34
- onInputKeyPress(): void;
35
- onInputBeforeInput(e: InputEvent): void;
36
- onInputInput(e: InputEvent): void;
37
- onInputKeyup(e: KeyboardEvent): void;
38
- handleSelectedValueDisplay(inputValue: string): void;
39
- triggerOnInputKeyup(e: KeyboardEvent): void;
40
- onInputChange(e: Event): void;
41
- onInputFocus(): void;
42
- onInputBlur(e: FocusEvent): void;
43
- focus(): void;
44
- blur(): void;
45
- showOptionList(): void;
46
- hideOptionList(): void;
47
- updateOptionList(filterText: string): void;
48
- updateOptionListDOM(): void;
49
- createOptionDOM(item: any): JBSelectOptionElement;
50
- _createOptionDom(item: any, isSelected: boolean): JBSelectOptionElement;
51
- onOptionClicked(e: MouseEvent): void;
52
- selectOption(value: any): void;
53
- filterOptionList(filterString: string): any[];
54
- triggerInputValidation(showError?: boolean): {
55
- isAllValid: boolean;
56
- };
57
- showValidationError(errorType: any): void;
58
- clearValidationError(): void;
59
- _triggerOnChangeEvent(): void;
60
- setSelectedOptionDom(value: any): void;
61
- private createSelectedValueDom;
62
- }