This commit is contained in:
Josh Johnson 2019-11-07 13:33:18 +00:00
parent 067f904f1b
commit a0b98c4e11
4 changed files with 74 additions and 71 deletions

41
package-lock.json generated
View file

@ -5265,7 +5265,8 @@
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
@ -5286,12 +5287,14 @@
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@ -5306,17 +5309,20 @@
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
@ -5433,7 +5439,8 @@
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
@ -5445,6 +5452,7 @@
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
@ -5459,6 +5467,7 @@
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
@ -5466,12 +5475,14 @@
"minimist": { "minimist": {
"version": "0.0.8", "version": "0.0.8",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"minipass": { "minipass": {
"version": "2.3.5", "version": "2.3.5",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.2", "safe-buffer": "^5.1.2",
"yallist": "^3.0.0" "yallist": "^3.0.0"
@ -5490,6 +5501,7 @@
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
} }
@ -5570,7 +5582,8 @@
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
@ -5582,6 +5595,7 @@
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
@ -5667,7 +5681,8 @@
"safe-buffer": { "safe-buffer": {
"version": "5.1.2", "version": "5.1.2",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
@ -5703,6 +5718,7 @@
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
@ -5722,6 +5738,7 @@
"version": "3.0.1", "version": "3.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
@ -5765,12 +5782,14 @@
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"yallist": { "yallist": {
"version": "3.0.3", "version": "3.0.3",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
} }
} }
}, },

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<browserconfig> <browserconfig>
<msapplication> <msapplication>
<tile> <tile>
<square150x150logo src="/assets/images/mstile-150x150.png"/> <square150x150logo src="/assets/images/mstile-150x150.png"/>
<TileColor>#ffffff</TileColor> <TileColor>#ffffff</TileColor>
</tile> </tile>
</msapplication> </msapplication>
</browserconfig> </browserconfig>

View file

@ -1372,8 +1372,8 @@ var getAdjacentEl = function getAdjacentEl(startEl, selector, direction) {
return sibling; return sibling;
}; };
/** /**
* @param {HTMLElement} element * @param {Element} element
* @param {HTMLElement} parent * @param {Element} parent
* @param {-1 | 1} direction * @param {-1 | 1} direction
* @returns {boolean} * @returns {boolean}
*/ */
@ -1412,7 +1412,7 @@ var sanitise = function sanitise(value) {
return value.replace(/&/g, '&amp;').replace(/>/g, '&rt;').replace(/</g, '&lt;').replace(/"/g, '&quot;'); return value.replace(/&/g, '&amp;').replace(/>/g, '&rt;').replace(/</g, '&lt;').replace(/"/g, '&quot;');
}; };
/** /**
* @returns {function} * @returns {() => (str: string) => Element}
*/ */
var strToEl = function () { var strToEl = function () {
@ -1622,14 +1622,14 @@ function () {
} }
/** /**
* Get group by group id * Get group by group id
* @param {string} id Group ID * @param {number} id Group ID
* @returns {Group | undefined} Group data * @returns {Group | undefined} Group data
*/ */
; ;
_proto.getGroupById = function getGroupById(id) { _proto.getGroupById = function getGroupById(id) {
return this.groups.find(function (group) { return this.groups.find(function (group) {
return group.id === parseInt(id, 10); return group.id === id;
}); });
}; };
@ -2411,7 +2411,7 @@ function () {
this.element.scrollTop = 0; this.element.scrollTop = 0;
} }
/** /**
* @param {HTMLElement} element * @param {Element} element
* @param {1 | -1} direction * @param {1 | -1} direction
*/ */
; ;
@ -3886,13 +3886,13 @@ function () {
this.containerOuter.removeLoadingState(); this.containerOuter.removeLoadingState();
this._setLoading(true); this._startLoading();
choicesArrayOrFetcher.forEach(function (groupOrChoice) { choicesArrayOrFetcher.forEach(function (groupOrChoice) {
if (groupOrChoice.choices) { if (groupOrChoice.choices) {
_this11._addGroup({ _this11._addGroup({
id: parseInt(groupOrChoice.id, 10) || null,
group: groupOrChoice, group: groupOrChoice,
id: groupOrChoice.id || null,
valueKey: value, valueKey: value,
labelKey: label labelKey: label
}); });
@ -3908,7 +3908,7 @@ function () {
} }
}); });
this._setLoading(false); this._stopLoading();
return this; return this;
}; };
@ -4339,8 +4339,12 @@ function () {
} }
}; };
_proto._setLoading = function _setLoading(isLoading) { _proto._startLoading = function _startLoading() {
this._store.dispatch(setIsLoading(isLoading)); this._store.dispatch(setIsLoading(true));
};
_proto._stopLoading = function _stopLoading() {
this._store.dispatch(setIsLoading(false));
}; };
_proto._handleLoadingState = function _handleLoadingState(setLoading) { _proto._handleLoadingState = function _handleLoadingState(setLoading) {
@ -4513,39 +4517,21 @@ function () {
documentElement.removeEventListener('keydown', this._onKeyDown, true); documentElement.removeEventListener('keydown', this._onKeyDown, true);
documentElement.removeEventListener('touchend', this._onTouchEnd, true); documentElement.removeEventListener('touchend', this._onTouchEnd, true);
documentElement.removeEventListener('mousedown', this._onMouseDown, true); documentElement.removeEventListener('mousedown', this._onMouseDown, true);
documentElement.removeEventListener('keyup', this._onKeyUp, { documentElement.removeEventListener('keyup', this._onKeyUp);
passive: true documentElement.removeEventListener('click', this._onClick);
}); documentElement.removeEventListener('touchmove', this._onTouchMove);
documentElement.removeEventListener('click', this._onClick, { documentElement.removeEventListener('mouseover', this._onMouseOver);
passive: true
});
documentElement.removeEventListener('touchmove', this._onTouchMove, {
passive: true
});
documentElement.removeEventListener('mouseover', this._onMouseOver, {
passive: true
});
if (this._isSelectOneElement) { if (this._isSelectOneElement) {
this.containerOuter.element.removeEventListener('focus', this._onFocus, { this.containerOuter.element.removeEventListener('focus', this._onFocus);
passive: true this.containerOuter.element.removeEventListener('blur', this._onBlur);
});
this.containerOuter.element.removeEventListener('blur', this._onBlur, {
passive: true
});
} }
this.input.element.removeEventListener('focus', this._onFocus, { this.input.element.removeEventListener('focus', this._onFocus);
passive: true this.input.element.removeEventListener('blur', this._onBlur);
});
this.input.element.removeEventListener('blur', this._onBlur, {
passive: true
});
if (this.input.element.form) { if (this.input.element.form) {
this.input.element.form.removeEventListener('reset', this._onFormReset, { this.input.element.form.removeEventListener('reset', this._onFormReset);
passive: true
});
} }
this.input.removeEventListeners(); this.input.removeEventListeners();
@ -5035,7 +5021,7 @@ function () {
var passedCustomProperties = customProperties; var passedCustomProperties = customProperties;
var items = this._store.items; var items = this._store.items;
var passedLabel = label || passedValue; var passedLabel = label || passedValue;
var passedOptionId = parseInt(choiceId, 10) || -1; var passedOptionId = choiceId || -1;
var group = groupId >= 0 ? this._store.getGroupById(groupId) : null; var group = groupId >= 0 ? this._store.getGroupById(groupId) : null;
var id = items ? items.length + 1 : 1; // If a prepended value has been passed, prepend it var id = items ? items.length + 1 : 1; // If a prepended value has been passed, prepend it
@ -5135,12 +5121,12 @@ function () {
var choiceElementId = this._baseId + "-" + this._idNames.itemChoice + "-" + choiceId; var choiceElementId = this._baseId + "-" + this._idNames.itemChoice + "-" + choiceId;
this._store.dispatch(choices_addChoice({ this._store.dispatch(choices_addChoice({
value: value,
label: choiceLabel,
id: choiceId, id: choiceId,
groupId: groupId, groupId: groupId,
disabled: isDisabled,
elementId: choiceElementId, elementId: choiceElementId,
value: value,
label: choiceLabel,
disabled: isDisabled,
customProperties: customProperties, customProperties: customProperties,
placeholder: placeholder, placeholder: placeholder,
keyCode: keyCode keyCode: keyCode
@ -5296,7 +5282,7 @@ function () {
this._highlightPosition = 0; this._highlightPosition = 0;
this._isSearching = false; this._isSearching = false;
this._setLoading(true); this._startLoading();
if (this._presetGroups.length) { if (this._presetGroups.length) {
this._addPredefinedGroups(this._presetGroups); this._addPredefinedGroups(this._presetGroups);
@ -5304,7 +5290,7 @@ function () {
this._addPredefinedChoices(this._presetChoices); this._addPredefinedChoices(this._presetChoices);
} }
this._setLoading(false); this._stopLoading();
} }
if (this._isTextElement) { if (this._isTextElement) {
@ -5342,16 +5328,14 @@ function () {
// If sorting is enabled or the user is searching, filter choices // If sorting is enabled or the user is searching, filter choices
if (this.config.shouldSort) { if (this.config.shouldSort) {
choices.sort(this.config.sorter); choices.sort(this.config.sorter);
} // Determine whether there is a selected choice }
var hasSelectedChoice = choices.some(function (choice) { var hasSelectedChoice = choices.some(function (choice) {
return choice.selected; return choice.selected;
}); });
var firstEnabledChoiceIndex = choices.findIndex(function (_choice) { var firstEnabledChoiceIndex = choices.findIndex(function (choice) {
return _choice.disabled === undefined || !_choice.disabled; return choice.disabled === undefined || !choice.disabled;
}); // Add each choice });
choices.forEach(function (choice, index) { choices.forEach(function (choice, index) {
var value = choice.value, var value = choice.value,
label = choice.label, label = choice.label,

File diff suppressed because one or more lines are too long