Skip to content

Commit 0e7a8f8

Browse files
author
William Troup
authored
Merge pull request #10 from williamtroup/0.5.0
0.5.0
2 parents 9e6ae0e + 091da5c commit 0e7a8f8

17 files changed

+235
-91
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

README.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,22 @@
22
Select.js
33

44
[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Select.js%2C%20a%20free%20JavaScript%select%builder&url=https://github.com/williamtroup/Select.js&hashtags=javascript,html,select)
5-
[![npm](https://img.shields.io/badge/npmjs-v0.4.0-blue)](https://www.npmjs.com/package/jselect.js)
6-
[![nuget](https://img.shields.io/badge/nuget-v0.4.0-purple)](https://www.nuget.org/packages/jSelect.js/)
5+
[![npm](https://img.shields.io/badge/npmjs-v0.5.0-blue)](https://www.npmjs.com/package/jselect.js)
6+
[![nuget](https://img.shields.io/badge/nuget-v0.5.0-purple)](https://www.nuget.org/packages/jSelect.js/)
77
[![license](https://img.shields.io/badge/license-MIT-green)](https://github.com/williamtroup/Select.js/blob/main/LICENSE.txt)
88
[![discussions Welcome](https://img.shields.io/badge/discussions-Welcome-red)](https://github.com/williamtroup/Select.js/discussions)
99
[![coded by William Troup](https://img.shields.io/badge/coded_by-William_Troup-yellow)](https://github.com/williamtroup)
1010
</h1>
1111

1212
> <p align="center">A lightweight, and easy-to-use, JavaScript library for creating multi-select drop-down lists!</p>
13-
> <p align="center">v0.4.0</p>
13+
> <p align="center">v0.5.0</p>
1414
<br />
1515
1616
![Select.js](docs/images/main.png)
1717
<br>
1818
<br>
1919

20+
2021
<h1>What features does Select.js have?</h1>
2122

2223
- Zero-dependencies and extremely lightweight!
@@ -29,24 +30,39 @@ Select.js
2930
<br />
3031
<br />
3132

33+
3234
<h1>What browsers are supported?</h1>
3335

3436
All modern browsers (such as Google Chrome, FireFox, and Opera) are fully supported.
3537
<br>
3638
<br>
3739

40+
3841
<h1>What are the most recent changes?</h1>
3942

4043
To see a list of all the most recent changes, click [here](docs/CHANGE_LOG.md).
4144
<br>
4245
<br>
4346

47+
48+
<h1>How do I install Select.js?</h1>
49+
50+
You can install the library with npm into your local modules directory using the following command:
51+
52+
```markdown
53+
npm install jselect.js
54+
```
55+
<br>
56+
<br>
57+
58+
4459
<h1>How do I get started?</h1>
4560

4661
To get started using Select.js, do the following steps:
4762
<br>
4863
<br>
4964

65+
5066
### 1. Prerequisites:
5167

5268
Make sure you include the "DOCTYPE html" tag at the top of your HTML, as follows:
@@ -56,6 +72,7 @@ Make sure you include the "DOCTYPE html" tag at the top of your HTML, as follows
5672
```
5773
<br>
5874

75+
5976
### 2. Include Files:
6077

6178
```markdown
@@ -64,6 +81,7 @@ Make sure you include the "DOCTYPE html" tag at the top of your HTML, as follows
6481
```
6582
<br>
6683

84+
6785
### 3. DOM Element Binding:
6886

6987
```markdown
@@ -86,6 +104,7 @@ To see a list of all the available custom triggers you can use for "data-select-
86104

87105
<br>
88106

107+
89108
### 4. Finishing Up:
90109

91110
That's it! Nice and simple. Please refer to the code if you need more help (fully documented).
@@ -98,6 +117,7 @@ To customize, and get more out of Select.js, please read through the following d
98117
<br>
99118
<br>
100119

120+
101121
### 1. Public Functions:
102122

103123
To see a list of all the public functions available, click [here](docs/PUBLIC_FUNCTIONS.md).

README_NUGET.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Select.js v0.4.0
1+
# Select.js v0.5.0
22

33
[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Select.js%2C%20a%20free%20JavaScript%select%builder&url=https://github.com/williamtroup/Select.js&hashtags=javascript,html,select)
4-
[![npm](https://img.shields.io/badge/npmjs-v0.4.0-blue)](https://www.npmjs.com/package/jselect.js)
5-
[![nuget](https://img.shields.io/badge/nuget-v0.4.0-purple)](https://www.nuget.org/packages/jSelect.js/)
4+
[![npm](https://img.shields.io/badge/npmjs-v0.5.0-blue)](https://www.npmjs.com/package/jselect.js)
5+
[![nuget](https://img.shields.io/badge/nuget-v0.5.0-purple)](https://www.nuget.org/packages/jSelect.js/)
66
[![license](https://img.shields.io/badge/license-MIT-green)](https://github.com/williamtroup/Select.js/blob/main/LICENSE.txt)
77
[![discussions Welcome](https://img.shields.io/badge/discussions-Welcome-red)](https://github.com/williamtroup/Select.js/discussions)
88
[![coded by William Troup](https://img.shields.io/badge/coded_by-William_Troup-yellow)](https://github.com/williamtroup)
@@ -31,6 +31,15 @@ All modern browsers (such as Google Chrome, FireFox, and Opera) are fully suppor
3131
To see a list of all the most recent changes, click [here](https://github.com/williamtroup/Select.js/blob/main/docs/CHANGE_LOG.md).
3232

3333

34+
## How do I install Select.js?
35+
36+
You can install the library with npm into your local modules directory using the following command:
37+
38+
```markdown
39+
npm install jselect.js
40+
```
41+
42+
3443
## How do I get started?
3544

3645
To get started using Select.js, do the following steps:

dist/select.js

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Select.js v0.4.0 | (c) Bunoon | MIT License */
1+
/*! Select.js v0.5.0 | (c) Bunoon | MIT License */
22
(function() {
33
function render() {
44
var tagTypes = _configuration.domElementTypes;
@@ -340,7 +340,7 @@
340340
var result = null;
341341
try {
342342
if (isDefinedString(objectString)) {
343-
result = JSON.parse(objectString);
343+
result = _parameter_JSON.parse(objectString);
344344
}
345345
} catch (e1) {
346346
try {
@@ -358,29 +358,41 @@
358358
}
359359
return {parsed:parsed, result:result};
360360
}
361-
function buildDefaultConfiguration() {
361+
function buildDefaultConfiguration(newConfiguration) {
362+
_configuration = !isDefinedObject(newConfiguration) ? {} : newConfiguration;
362363
_configuration.safeMode = getDefaultBoolean(_configuration.safeMode, true);
363364
_configuration.domElementTypes = getDefaultStringOrArray(_configuration.domElementTypes, ["select"]);
364365
}
365366
var _parameter_Document = null;
366367
var _parameter_Window = null;
368+
var _parameter_JSON = null;
367369
var _configuration = {};
368370
var _enum_KeyCodes = {escape:27};
369371
var _string = {empty:"", space:" "};
370372
var _elements_Type = {};
371373
var _control_Elements = [];
372374
var _attribute_Name_Options = "data-select-options";
373-
this.setConfiguration = function(newOptions) {
374-
_configuration = !isDefinedObject(newOptions) ? {} : newOptions;
375-
buildDefaultConfiguration();
375+
this.setConfiguration = function(newConfiguration) {
376+
var configurationHasChanged = false;
377+
var propertyName;
378+
for (propertyName in newConfiguration) {
379+
if (newConfiguration.hasOwnProperty(propertyName) && _configuration.hasOwnProperty(propertyName) && _configuration[propertyName] !== newConfiguration[propertyName]) {
380+
_configuration[propertyName] = newConfiguration[propertyName];
381+
configurationHasChanged = true;
382+
}
383+
}
384+
if (configurationHasChanged) {
385+
buildDefaultConfiguration(_configuration);
386+
}
376387
return this;
377388
};
378389
this.getVersion = function() {
379-
return "0.4.0";
390+
return "0.5.0";
380391
};
381-
(function(documentObject, windowObject) {
392+
(function(documentObject, windowObject, jsonObject) {
382393
_parameter_Document = documentObject;
383394
_parameter_Window = windowObject;
395+
_parameter_JSON = jsonObject;
384396
buildDefaultConfiguration();
385397
_parameter_Document.addEventListener("DOMContentLoaded", function() {
386398
render();
@@ -389,5 +401,5 @@
389401
if (!isDefined(_parameter_Window.$select)) {
390402
_parameter_Window.$select = this;
391403
}
392-
})(document, window);
404+
})(document, window, JSON);
393405
})();

dist/select.js.css

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
/*
2-
* Select.js Library v0.4.0
2+
* Select.js Library v0.5.0
33
*
44
* Copyright 2023 Bunoon
55
* Released under the MIT License
66
*/
7-
/*
8-
-------------------------------------------------------------------------
9-
Select.js - Variables
10-
-------------------------------------------------------------------------
11-
*/
127
:root {
8+
--select-js-default-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
139
--select-js-color-black: #3b3a3a;
1410
--select-js-color-white: #F5F5F5;
1511
--select-js-color-gray: #AAAAAA;
@@ -32,17 +28,25 @@
3228
-------------------------------------------------------------------------
3329
*/
3430
div.select-js {
35-
font-family: "Montserrat", sans-serif;
31+
-moz-user-select: none;
32+
-webkit-user-select: none;
33+
-ms-user-select: none;
34+
-o-user-select: none;
35+
user-select: none;
36+
cursor: default;
37+
box-sizing: border-box;
38+
line-height: normal;
39+
font-family: var(--select-js-default-font);
3640
font-size: 0.8rem;
3741
margin-bottom: var(--select-js-spacing);
3842
position: relative;
3943
}
4044
div.select-js * {
41-
box-sizing: content-box;
45+
box-sizing: border-box;
4246
line-height: normal;
4347
}
4448
div.select-js *::before, div.select-js *::after {
45-
box-sizing: content-box;
49+
box-sizing: border-box;
4650
line-height: normal;
4751
}
4852
div.select-js select {
@@ -66,9 +70,6 @@ div.select-js div.drop-down {
6670
background-color: var(--select-js-container-background-color-drop-down);
6771
border: var(--select-js-border-size) solid var(--select-js-container-border-color-drop-down);
6872
border-radius: var(--select-js-border-radius);
69-
-webkit-user-select: none;
70-
-ms-user-select: none;
71-
user-select: none;
7273
position: absolute;
7374
width: 100%;
7475
z-index: 10;
@@ -81,14 +82,14 @@ div.select-js div.drop-down {
8182
div.select-js div.drop-down div.item {
8283
padding: var(--select-js-spacing);
8384
border-bottom: var(--select-js-border-size) var(--select-js-color-black) dotted;
85+
transition: var(--select-js-transition);
8486
}
8587
div.select-js div.drop-down div.item:last-child {
8688
border-bottom: none;
8789
}
8890
div.select-js div.drop-down div.item:hover {
8991
cursor: pointer;
9092
background-color: var(--select-js-color-light-gray);
91-
transition: var(--select-js-transition);
9293
}
9394
div.select-js div.drop-down div.selected {
9495
color: var(--select-js-color-gray);
@@ -101,30 +102,26 @@ div.select-js div.drop-down div.selected {
101102
-------------------------------------------------------------------------
102103
*/
103104
div.select-js div.control {
104-
-webkit-user-select: none;
105-
-ms-user-select: none;
106-
user-select: none;
107105
position: relative;
108106
}
109107
div.select-js div.control div.button {
110108
position: absolute;
111109
border-right: 5px solid var(--select-js-color-black);
112110
border-bottom: 5px solid var(--select-js-color-black);
113-
height: 8px;
114-
width: 8px;
111+
height: 14px;
112+
width: 14px;
115113
right: 14px;
116114
top: 14px;
117115
transform: rotate(45deg);
116+
transition: var(--select-js-transition);
118117
}
119118
div.select-js div.control div.button:hover {
120119
cursor: pointer;
121120
opacity: 0.7;
122-
transition: var(--select-js-transition);
123121
}
124122
div.select-js div.control div.button:active {
125123
cursor: pointer;
126124
opacity: 0.5;
127-
transition: var(--select-js-transition);
128125
}
129126
div.select-js div.control div.button-open {
130127
transform: rotate(-135deg);
@@ -148,11 +145,11 @@ div.select-js div.control div.selected-item div.remove {
148145
margin-left: var(--select-js-spacing);
149146
display: inline-block;
150147
font-weight: bold;
148+
transition: var(--select-js-transition);
151149
}
152150
div.select-js div.control div.selected-item div.remove:hover {
153151
cursor: pointer;
154152
opacity: 0.7;
155-
transition: var(--select-js-transition);
156153
}
157154
div.select-js div.control div.no-items-selected {
158155
background-color: var(--select-js-color-light-gray);

dist/select.js.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)