Skip to content

Commit

Permalink
Fix Compatibility with CommonJS
Browse files Browse the repository at this point in the history
  • Loading branch information
taufik-nurrohman committed Jul 9, 2022
1 parent 2da1f43 commit 74b3334
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .github/factory/index.html.pug
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ block content
p Functions and methods in this application are mostly native JavaScript and are intended for use by the browser. Node.js doesn’t know about the DOM, so this kind of practice will probably be used more often to build new browser packages than to be used directly in the Node.js server.
h4 CommonJS
pre: code
| const OP = require('@taufik-nurrohman/option-picker');
| const OP = require('@taufik-nurrohman/option-picker').default;
|
| const picker = new OP(document.querySelector('select'));
h4 ECMAScript
Expand Down
31 changes: 1 addition & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,33 +49,4 @@ This project exists thanks to all the people who contribute.
<a href="https://opencollective.com/option-picker/organization/6/website"><img src="https://opencollective.com/option-picker/organization/6/avatar.svg"></a>
<a href="https://opencollective.com/option-picker/organization/7/website"><img src="https://opencollective.com/option-picker/organization/7/avatar.svg"></a>
<a href="https://opencollective.com/option-picker/organization/8/website"><img src="https://opencollective.com/option-picker/organization/8/avatar.svg"></a>
<a href="https://opencollective.com/option-picker/organization/9/website"><img src="https://opencollective.com/option-picker/organization/9/avatar.svg"></a>

---

Release Notes
-------------

### 1.3.7

- Added ability to convert `<input>` element with `list` attribute.
- Allowed user to input any value using the `<input>` mode.
- Fixed the custom select box insertion node that does not consider the text node.

### 1.2.4

- Added CSS variables for easy integration with third-party applications.

### 1.1.4

- Changed CSS classes to follow the [BEM](http://getbem.com) approach.
- Maintenance.

### 1.0.1

- Fixed broken `picker.pop()` response.
- Removed `picker.value` property.

### 1.0.0

- Initial release.
<a href="https://opencollective.com/option-picker/organization/9/website"><img src="https://opencollective.com/option-picker/organization/9/avatar.svg"></a>
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta content="#000" name="theme-color">
<meta content="width=device-width" name="viewport">
<meta content="Just a generic custom `&lt;select&gt;` element with accessibility in mind." name="description">
<title>Option Picker 1.3.7</title>
<title>Option Picker 1.3.8</title>
<link href="index.min.css" rel="stylesheet">
<style>
* {
Expand Down Expand Up @@ -76,7 +76,7 @@
<body>
<p role="alert">Do you like this project? Please support my <a href="https://github.com/mecha-cms">Mecha CMS</a> project too. Thank you!</p>
<header>
<h1>Option Picker 1.3.7</h1>
<h1>Option Picker 1.3.8</h1>
<p>Just a generic custom <code>&lt;select&gt;</code> element with accessibility in mind.</p>
<hr>
</header>
Expand Down Expand Up @@ -138,7 +138,7 @@ <h3>Browser</h3>
<h3>Node.js</h3>
<p>Functions and methods in this application are mostly native JavaScript and are intended for use by the browser. Node.js doesn&rsquo;t know about the DOM, so this kind of practice will probably be used more often to build new browser packages than to be used directly in the Node.js server.</p>
<h4>CommonJS</h4>
<pre><code>const OP = require('@taufik-nurrohman/option-picker');
<pre><code>const OP = require('@taufik-nurrohman/option-picker').default;

const picker = new OP(document.querySelector('select'));</code></pre>
<h4>ECMAScript</h4>
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1212,6 +1212,6 @@
'parent': null,
'size': 5
};
OP.version = '1.3.7';
OP.version = '1.3.8';
return OP;
});
2 changes: 1 addition & 1 deletion index.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,6 @@ OP.state = {
'size': 5
};

OP.version = '1.3.7';
OP.version = '1.3.8';

export default OP;
25 changes: 12 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
"browser": "index.min.js",
"bugs": "https://github.com/taufik-nurrohman/option-picker/issues",
"dependencies": {
"@taufik-nurrohman/document": "^0.3.1",
"@taufik-nurrohman/event": "^0.3.1",
"@taufik-nurrohman/from": "^0.0.10",
"@taufik-nurrohman/has": "^0.0.3",
"@taufik-nurrohman/hook": "^0.1.2",
"@taufik-nurrohman/is": "^0.1.2",
"@taufik-nurrohman/pattern": "^0.1.7",
"@taufik-nurrohman/rect": "0.0.11",
"@taufik-nurrohman/tick": "^0.0.2",
"@taufik-nurrohman/to": "^0.0.18"
"@taufik-nurrohman/document": "*",
"@taufik-nurrohman/event": "*",
"@taufik-nurrohman/from": "*",
"@taufik-nurrohman/has": "*",
"@taufik-nurrohman/hook": "*",
"@taufik-nurrohman/is": "*",
"@taufik-nurrohman/pattern": "*",
"@taufik-nurrohman/rect": "*",
"@taufik-nurrohman/tick": "*",
"@taufik-nurrohman/to": "*"
},
"description": "Just a generic custom `<select>` element with accessibility in mind.",
"devDependencies": {
"@taufik-nurrohman/factory": "^1.0.8"
"@taufik-nurrohman/factory": "*"
},
"exports": {
"import": "./index.mjs",
Expand Down Expand Up @@ -54,6 +54,5 @@
"scripts": {
"pack": "pack --clean=false --from=.github/factory --js-format=umd --js-name=OP --js-top='%(js.license)' --mjs=true --scss=true --to=."
},
"type": "module",
"version": "1.3.7"
"version": "1.3.8"
}

0 comments on commit 74b3334

Please sign in to comment.