Skip to content

Commit

Permalink
Add .parcelrc params.
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhuravkov committed Jul 28, 2022
1 parent dddcefb commit 0437570
Show file tree
Hide file tree
Showing 12 changed files with 62 additions and 36 deletions.
6 changes: 6 additions & 0 deletions .parcelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "@parcel/config-default",
"transformers": {
"*.{ts,tsx}": ["@parcel/transformer-typescript-tsc"]
}
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ npm install --save treeselectjs
```
Import treeselectjs (ES)
```
import Treeselect from 'treeselectjs'
import { Treeselect } from 'treeselectjs'
```
Import treeselectjs (CommonJS)
```
const Treeselect = require('treeselectjs').default
const { Treeselect } = require('treeselectjs')
```
Import css file with styles
```
Expand All @@ -29,7 +29,7 @@ Import css file with styles

Example
```
import Treeselect from 'treeselectjs'
import { Treeselect } from 'treeselectjs'
const options = [
{
Expand Down
2 changes: 1 addition & 1 deletion demo/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Treeselect from '../dist/treeselect-js.mjs.js';
import { Treeselect } from '../dist/treeselect-js.mjs.js';

const options = [
{
Expand Down
2 changes: 1 addition & 1 deletion dist/treeselect-js.cjs.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions dist/treeselect-js.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ type IconsType = {
check: string | HTMLElement;
partialCheck: string | HTMLElement;
};
export default class Treeselect implements ITreeslect {
export class Treeselect implements ITreeslect {
#private;
parentHtmlContainer: HTMLElement;
value: ValueOptionType[];
Expand Down Expand Up @@ -97,4 +97,3 @@ export default class Treeselect implements ITreeslect {
blurWindowHandler(): void;
updateListPosition(): void;
}
export default Treeselect;
2 changes: 1 addition & 1 deletion dist/treeselect-js.mjs.js

Large diffs are not rendered by default.

49 changes: 42 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "treeselectjs",
"version": "0.3.2",
"version": "0.3.3",
"description": "Treeselect JS",
"main": "dist/treeselect-js.cjs.js",
"module": "dist/treeselect-js.mjs.js",
Expand Down Expand Up @@ -28,7 +28,6 @@
},
"types": {
"isLibrary": true,
"context": "node",
"source": "src/treeselect-js.ts",
"optimize": true,
"sourceMap": false
Expand Down Expand Up @@ -66,15 +65,13 @@
"homepage": "https://github.com/dipson88/treeselectjs#readme",
"devDependencies": {
"@parcel/packager-ts": "^2.6.2",
"@parcel/transformer-typescript-tsc": "^2.6.2",
"@parcel/transformer-typescript-types": "^2.6.2",
"parcel": "^2.6.2",
"prettier": "^2.7.1",
"typescript": "^4.7.4"
},
"files": [
"dist"
],
"dependencies": {
"@swc/helpers": "^0.4.3"
}
]
}
2 changes: 0 additions & 2 deletions src/input/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,5 +373,3 @@ export class TreeselectInput implements ITreeselectInput {
this.srcElement.dispatchEvent(new CustomEvent('close'))
}
}

export default TreeselectInput
4 changes: 1 addition & 3 deletions src/list/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ const getFlattedOptionByInputId = (inputId: string | null, flattedOptions: Flatt
return flattedOptions.find((fo) => fo.id.toString() === inputId)
}

class TreeselectList implements ITreeselectList {
export class TreeselectList implements ITreeselectList {
// Props
options: OptionType[]
value: ValueOptionType[]
Expand Down Expand Up @@ -595,5 +595,3 @@ class TreeselectList implements ITreeselectList {
this.srcElement.dispatchEvent(new CustomEvent('input', { detail: this.selectedNodes }))
}
}

export default TreeselectList
5 changes: 0 additions & 5 deletions src/svgIcons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,3 @@ export const getDefaultIcons = (iconsFromProps: Partial<IconsType> | undefined)

return newIcons as IconsType
}

export default {
icons,
appendIconToElement
}
8 changes: 3 additions & 5 deletions src/treeselect-js.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ITreeselectInput } from './input/inputTypes'
import { ITreeselectList } from './list/listTypes'
import TreeselectInput from './input/index'
import TreeselectList from './list/index'
import { TreeselectInput } from './input/index'
import { TreeselectList } from './list/index'
import {
ITreeslect,
ITreeslectParams,
Expand All @@ -24,7 +24,7 @@ const validateProps = ({ parentHtmlContainer, staticList, appendToBody }: Partia

const getOnlyIds = (nodes: FlattedOptionType[]) => nodes.map((node) => node.id)

class Treeselect implements ITreeslect {
export class Treeselect implements ITreeslect {
// Props
parentHtmlContainer: HTMLElement
value: ValueOptionType[]
Expand Down Expand Up @@ -460,5 +460,3 @@ class Treeselect implements ITreeslect {
}
}
}

export default Treeselect

0 comments on commit 0437570

Please sign in to comment.