Skip to content

Commit 8a105ca

Browse files
committed
Merge branch 'develop'
2 parents 728b059 + fbb3198 commit 8a105ca

25 files changed

+1150
-1058
lines changed

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
node_modules/
22
src/vue/node_modules/
3+
src/react/node_modules/
34
.vscode/
45
.github/
56

dist/slimselect.cjs.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ class Optgroup {
9595
this.id = !optgroup.id || optgroup.id === '' ? generateID() : optgroup.id;
9696
this.label = optgroup.label || '';
9797
this.selectAll = optgroup.selectAll === undefined ? false : optgroup.selectAll;
98+
this.selectAllText = optgroup.selectAllText || 'Select All';
9899
this.closable = optgroup.closable || 'off';
99100
this.options = [];
100101
if (optgroup.options) {
@@ -972,7 +973,7 @@ class Render {
972973
selectAll.classList.add(this.classes.selected);
973974
}
974975
const selectAllText = document.createElement('span');
975-
selectAllText.textContent = 'Select All';
976+
selectAllText.textContent = d.selectAllText;
976977
selectAll.appendChild(selectAllText);
977978
const selectAllSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
978979
selectAllSvg.setAttribute('viewBox', '0 0 100 100');
@@ -1001,7 +1002,13 @@ class Render {
10011002
}
10021003
else {
10031004
const newSelected = currentSelected.concat(d.options.map((o) => o.value));
1005+
for (const o of d.options) {
1006+
if (!this.store.getOptionByID(o.id)) {
1007+
this.callbacks.addOption(o);
1008+
}
1009+
}
10041010
this.callbacks.setSelected(newSelected, true);
1011+
return;
10051012
}
10061013
});
10071014
optgroupActions.appendChild(selectAll);
@@ -1352,6 +1359,7 @@ class Select {
13521359
id: optgroup.id,
13531360
label: optgroup.label,
13541361
selectAll: optgroup.dataset ? optgroup.dataset.selectall === 'true' : false,
1362+
selectAllText: optgroup.dataset ? optgroup.dataset.selectalltext : 'Select all',
13551363
closable: optgroup.dataset ? optgroup.dataset.closable : 'off',
13561364
options: [],
13571365
};

dist/slimselect.es.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ class Optgroup {
9393
this.id = !optgroup.id || optgroup.id === '' ? generateID() : optgroup.id;
9494
this.label = optgroup.label || '';
9595
this.selectAll = optgroup.selectAll === undefined ? false : optgroup.selectAll;
96+
this.selectAllText = optgroup.selectAllText || 'Select All';
9697
this.closable = optgroup.closable || 'off';
9798
this.options = [];
9899
if (optgroup.options) {
@@ -970,7 +971,7 @@ class Render {
970971
selectAll.classList.add(this.classes.selected);
971972
}
972973
const selectAllText = document.createElement('span');
973-
selectAllText.textContent = 'Select All';
974+
selectAllText.textContent = d.selectAllText;
974975
selectAll.appendChild(selectAllText);
975976
const selectAllSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
976977
selectAllSvg.setAttribute('viewBox', '0 0 100 100');
@@ -999,7 +1000,13 @@ class Render {
9991000
}
10001001
else {
10011002
const newSelected = currentSelected.concat(d.options.map((o) => o.value));
1003+
for (const o of d.options) {
1004+
if (!this.store.getOptionByID(o.id)) {
1005+
this.callbacks.addOption(o);
1006+
}
1007+
}
10021008
this.callbacks.setSelected(newSelected, true);
1009+
return;
10031010
}
10041011
});
10051012
optgroupActions.appendChild(selectAll);
@@ -1350,6 +1357,7 @@ class Select {
13501357
id: optgroup.id,
13511358
label: optgroup.label,
13521359
selectAll: optgroup.dataset ? optgroup.dataset.selectall === 'true' : false,
1360+
selectAllText: optgroup.dataset ? optgroup.dataset.selectalltext : 'Select all',
13531361
closable: optgroup.dataset ? optgroup.dataset.closable : 'off',
13541362
options: [],
13551363
};

dist/slimselect.global.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ var SlimSelect = (function () {
9696
this.id = !optgroup.id || optgroup.id === '' ? generateID() : optgroup.id;
9797
this.label = optgroup.label || '';
9898
this.selectAll = optgroup.selectAll === undefined ? false : optgroup.selectAll;
99+
this.selectAllText = optgroup.selectAllText || 'Select All';
99100
this.closable = optgroup.closable || 'off';
100101
this.options = [];
101102
if (optgroup.options) {
@@ -973,7 +974,7 @@ var SlimSelect = (function () {
973974
selectAll.classList.add(this.classes.selected);
974975
}
975976
const selectAllText = document.createElement('span');
976-
selectAllText.textContent = 'Select All';
977+
selectAllText.textContent = d.selectAllText;
977978
selectAll.appendChild(selectAllText);
978979
const selectAllSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
979980
selectAllSvg.setAttribute('viewBox', '0 0 100 100');
@@ -1002,7 +1003,13 @@ var SlimSelect = (function () {
10021003
}
10031004
else {
10041005
const newSelected = currentSelected.concat(d.options.map((o) => o.value));
1006+
for (const o of d.options) {
1007+
if (!this.store.getOptionByID(o.id)) {
1008+
this.callbacks.addOption(o);
1009+
}
1010+
}
10051011
this.callbacks.setSelected(newSelected, true);
1012+
return;
10061013
}
10071014
});
10081015
optgroupActions.appendChild(selectAll);
@@ -1353,6 +1360,7 @@ var SlimSelect = (function () {
13531360
id: optgroup.id,
13541361
label: optgroup.label,
13551362
selectAll: optgroup.dataset ? optgroup.dataset.selectall === 'true' : false,
1363+
selectAllText: optgroup.dataset ? optgroup.dataset.selectalltext : 'Select all',
13561364
closable: optgroup.dataset ? optgroup.dataset.closable : 'off',
13571365
options: [],
13581366
};

dist/slimselect.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
this.id = !optgroup.id || optgroup.id === '' ? generateID() : optgroup.id;
100100
this.label = optgroup.label || '';
101101
this.selectAll = optgroup.selectAll === undefined ? false : optgroup.selectAll;
102+
this.selectAllText = optgroup.selectAllText || 'Select All';
102103
this.closable = optgroup.closable || 'off';
103104
this.options = [];
104105
if (optgroup.options) {
@@ -976,7 +977,7 @@
976977
selectAll.classList.add(this.classes.selected);
977978
}
978979
const selectAllText = document.createElement('span');
979-
selectAllText.textContent = 'Select All';
980+
selectAllText.textContent = d.selectAllText;
980981
selectAll.appendChild(selectAllText);
981982
const selectAllSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
982983
selectAllSvg.setAttribute('viewBox', '0 0 100 100');
@@ -1005,7 +1006,13 @@
10051006
}
10061007
else {
10071008
const newSelected = currentSelected.concat(d.options.map((o) => o.value));
1009+
for (const o of d.options) {
1010+
if (!this.store.getOptionByID(o.id)) {
1011+
this.callbacks.addOption(o);
1012+
}
1013+
}
10081014
this.callbacks.setSelected(newSelected, true);
1015+
return;
10091016
}
10101017
});
10111018
optgroupActions.appendChild(selectAll);
@@ -1356,6 +1363,7 @@
13561363
id: optgroup.id,
13571364
label: optgroup.label,
13581365
selectAll: optgroup.dataset ? optgroup.dataset.selectall === 'true' : false,
1366+
selectAllText: optgroup.dataset ? optgroup.dataset.selectalltext : 'Select all',
13591367
closable: optgroup.dataset ? optgroup.dataset.closable : 'off',
13601368
options: [],
13611369
};

dist/slimselect.min.js

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

dist/slimselect.umd.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
this.id = !optgroup.id || optgroup.id === '' ? generateID() : optgroup.id;
100100
this.label = optgroup.label || '';
101101
this.selectAll = optgroup.selectAll === undefined ? false : optgroup.selectAll;
102+
this.selectAllText = optgroup.selectAllText || 'Select All';
102103
this.closable = optgroup.closable || 'off';
103104
this.options = [];
104105
if (optgroup.options) {
@@ -976,7 +977,7 @@
976977
selectAll.classList.add(this.classes.selected);
977978
}
978979
const selectAllText = document.createElement('span');
979-
selectAllText.textContent = 'Select All';
980+
selectAllText.textContent = d.selectAllText;
980981
selectAll.appendChild(selectAllText);
981982
const selectAllSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
982983
selectAllSvg.setAttribute('viewBox', '0 0 100 100');
@@ -1005,7 +1006,13 @@
10051006
}
10061007
else {
10071008
const newSelected = currentSelected.concat(d.options.map((o) => o.value));
1009+
for (const o of d.options) {
1010+
if (!this.store.getOptionByID(o.id)) {
1011+
this.callbacks.addOption(o);
1012+
}
1013+
}
10081014
this.callbacks.setSelected(newSelected, true);
1015+
return;
10091016
}
10101017
});
10111018
optgroupActions.appendChild(selectAll);
@@ -1356,6 +1363,7 @@
13561363
id: optgroup.id,
13571364
label: optgroup.label,
13581365
selectAll: optgroup.dataset ? optgroup.dataset.selectall === 'true' : false,
1366+
selectAllText: optgroup.dataset ? optgroup.dataset.selectalltext : 'Select all',
13591367
closable: optgroup.dataset ? optgroup.dataset.closable : 'off',
13601368
options: [],
13611369
};

dist/slimselect.umd.min.js

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

dist/store.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ export interface OptgroupOptional {
77
id?: string;
88
label: string;
99
selectAll?: boolean;
10+
selectAllText?: string;
1011
closable?: 'off' | 'open' | 'close';
1112
options?: OptionOptional[];
1213
}
1314
export declare class Optgroup {
1415
id: string;
1516
label: string;
1617
selectAll: boolean;
18+
selectAllText: string;
1719
closable: 'off' | 'open' | 'close';
1820
options: Option[];
1921
constructor(optgroup: OptgroupOptional);

docs/assets/index.css

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)