Skip to content

Commit

Permalink
release/v0.8.5 (#69)
Browse files Browse the repository at this point in the history
* Add re-merging to the iconElements.

* Add ValueType and ValueInputType.

* Remove console.log
  • Loading branch information
dipson88 authored Apr 18, 2023
1 parent a86887b commit 0fc4834
Show file tree
Hide file tree
Showing 8 changed files with 253 additions and 218 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ A multi-select js component with nested options.
- Typescript support

Build data:
- treeselectjs.mjs 48.66 kB │ gzip: 11.04 kB
- treeselectjs.umd.js 39.59 kB │ gzip: 10.13 kB
- treeselectjs.mjs 48.92 kB │ gzip: 11.07 kB
- treeselectjs.umd.js 39.79 kB │ gzip: 10.17 kB
- treeselectjs.css 6.41 kB │ gzip: 1.27 kB

**Live Demo:** https://dipson88.github.io/treeselectjs/
Expand All @@ -29,8 +29,8 @@ import Treeselect from 'treeselectjs'

Import treeselectjs (UMD)
```
<script src="https://cdn.jsdelivr.net/npm/[email protected].4/dist/treeselectjs.umd.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected].4/dist/treeselectjs.css" />
<script src="https://cdn.jsdelivr.net/npm/[email protected].5/dist/treeselectjs.umd.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected].5/dist/treeselectjs.css" />
...
<script>
...
Expand Down
34 changes: 19 additions & 15 deletions dist/treeselectjs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export declare type IconsType = {

declare interface ITreeselect {
parentHtmlContainer: HTMLElement;
value: ValueOptionType[] | ValueOptionType;
value: ValueType;
options: OptionType[];
openLevel: number;
appendToBody: boolean;
Expand Down Expand Up @@ -42,20 +42,20 @@ declare interface ITreeselect {
isListOpened: boolean;
selectedName: string;
srcElement: HTMLElement | null;
inputCallback: ((value: ValueOptionType[] | ValueOptionType) => void) | undefined;
openCallback: ((value: ValueOptionType[] | ValueOptionType) => void) | undefined;
closeCallback: ((value: ValueOptionType[] | ValueOptionType) => void) | undefined;
inputCallback: ((value: ValueType) => void) | undefined;
openCallback: ((value: ValueType) => void) | undefined;
closeCallback: ((value: ValueType) => void) | undefined;
nameChangeCallback: ((name: string) => void) | undefined;
mount: () => void;
updateValue: (newValue: ValueOptionType[] | ValueOptionType) => void;
updateValue: (newValue: ValueInputType) => void;
destroy: () => void;
focus: () => void;
toggleOpenClose: () => void;
}

export declare interface ITreeselectParams {
parentHtmlContainer: HTMLElement;
value?: ValueOptionType[] | ValueOptionType;
value?: ValueInputType;
options?: OptionType[];
openLevel?: number;
appendToBody?: boolean;
Expand All @@ -79,9 +79,9 @@ export declare interface ITreeselectParams {
expandSelected?: boolean;
saveScrollPosition?: boolean;
iconElements?: Partial<IconsType>;
inputCallback?: (value: ValueOptionType[] | ValueOptionType) => void;
openCallback?: (value: ValueOptionType[] | ValueOptionType) => void;
closeCallback?: (value: ValueOptionType[] | ValueOptionType) => void;
inputCallback?: (value: ValueType) => void;
openCallback?: (value: ValueType) => void;
closeCallback?: (value: ValueType) => void;
nameChangeCallback?: (name: string) => void;
}

Expand All @@ -96,7 +96,7 @@ export declare type OptionType = {
declare class Treeselect implements ITreeselect {
#private;
parentHtmlContainer: HTMLElement;
value: ValueOptionType[] | ValueOptionType;
value: ValueType;
options: OptionType[];
openLevel: number;
appendToBody: boolean;
Expand All @@ -120,9 +120,9 @@ declare class Treeselect implements ITreeselect {
expandSelected: boolean;
saveScrollPosition: boolean;
iconElements: IconsType;
inputCallback: ((value: ValueOptionType[] | ValueOptionType) => void) | undefined;
openCallback: ((value: ValueOptionType[] | ValueOptionType) => void) | undefined;
closeCallback: ((value: ValueOptionType[] | ValueOptionType) => void) | undefined;
inputCallback: ((value: ValueType) => void) | undefined;
openCallback: ((value: ValueType) => void) | undefined;
closeCallback: ((value: ValueType) => void) | undefined;
nameChangeCallback: ((name: string) => void) | undefined;
ungroupedValue: ValueOptionType[];
groupedValue: ValueOptionType[];
Expand All @@ -131,7 +131,7 @@ declare class Treeselect implements ITreeselect {
srcElement: HTMLElement | null;
constructor({ parentHtmlContainer, value, options, openLevel, appendToBody, alwaysOpen, showTags, tagsCountText, clearable, searchable, placeholder, grouped, isGroupedValue, listSlotHtmlComponent, disabled, emptyText, staticList, id, isSingleSelect, showCount, disabledBranchNode, direction, expandSelected, saveScrollPosition, iconElements, inputCallback, openCallback, closeCallback, nameChangeCallback }: ITreeselectParams);
mount(): void;
updateValue(newValue: ValueOptionType[] | ValueOptionType): void;
updateValue(newValue: ValueInputType): void;
destroy(): void;
focus(): void;
toggleOpenClose(): void;
Expand All @@ -142,6 +142,10 @@ declare class Treeselect implements ITreeselect {
}
export default Treeselect;

export declare type ValueOptionType = string | number;
export declare type ValueInputType = ValueOptionType[] | ValueOptionType | null | undefined;

declare type ValueOptionType = string | number;

export declare type ValueType = ValueOptionType[] | ValueOptionType | null;

export { }
Loading

0 comments on commit 0fc4834

Please sign in to comment.