Skip to content

Commit

Permalink
Merge branch 'develop' into simplifyTemplatesParameters
Browse files Browse the repository at this point in the history
  • Loading branch information
lubber-de committed Oct 30, 2024
2 parents 217042a + 14bf847 commit 8ab2fa9
Show file tree
Hide file tree
Showing 25 changed files with 1,135 additions and 254 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [12, 14, 16, 18, latest]
node-version: [12, 14, 16, 18, 20, 22]
steps:
- uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
Expand Down
23 changes: 20 additions & 3 deletions src/definitions/behaviors/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
element = this,

formErrors = [],
formErrorsTracker = {},
keyHeldDown = false,

// set at run-time
Expand Down Expand Up @@ -948,7 +949,7 @@
$prompt.css('display', 'none');
}
$prompt
.appendTo($fieldGroup)
.appendTo($fieldGroup.filter('.' + className.error))
;
}
$prompt
Expand Down Expand Up @@ -1285,6 +1286,7 @@
$module.removeClass(className.initial);
// reset errors
formErrors = [];
formErrorsTracker = {};
if (module.determine.isValid()) {
module.debug('Form has no validation errors, submitting');
module.set.success();
Expand Down Expand Up @@ -1388,7 +1390,22 @@
var invalidFields = module.validate.rule(field, rule, true) || [];
if (invalidFields.length > 0) {
module.debug('Field is invalid', identifier, rule.type);
fieldErrors.push(module.get.prompt(rule, field));
var fieldError = module.get.prompt(rule, field);
if (!settings.inline) {
if (
// Always allow the first error prompt for new field identifiers
(!(identifier in formErrorsTracker)
// Also allow multiple error prompts per field identifier but make sure each prompt is unique
|| formErrorsTracker[identifier].indexOf(fieldError) === -1)
// Limit the number of unique error prompts for every field identifier if specified
&& (!errorLimit || (formErrorsTracker[identifier] || []).length < errorLimit)
) {
fieldErrors.push(fieldError);
(formErrorsTracker[identifier] = formErrorsTracker[identifier] || []).push(fieldError);
}
} else {
fieldErrors.push(fieldError);
}
fieldValid = false;
if (showErrors) {
$(invalidFields).closest($group).addClass(className.error);
Expand All @@ -1403,7 +1420,7 @@
settings.onValid.call($field);
}
} else {
if (showErrors) {
if (showErrors && fieldErrors.length > 0) {
formErrors = formErrors.concat(fieldErrors);
module.add.prompt(identifier, fieldErrors, true);
settings.onInvalid.call($field, fieldErrors);
Expand Down
10 changes: 8 additions & 2 deletions src/definitions/collections/form.less
Original file line number Diff line number Diff line change
Expand Up @@ -653,13 +653,15 @@
}

/* Placeholder */
.ui.form .@{state} .ui.dropdown > .default.text,
.ui.form .@{state} ::placeholder {
color: @formStates[@@state][inputPlaceholderColor];
}
.ui.form .@{state} :-ms-input-placeholder when (@supportIE) {
color: @formStates[@@state][inputPlaceholderColor] !important;
}

.ui.form .@{state} .ui.dropdown > input:focus ~ .default.text,
.ui.form .@{state} :focus::placeholder {
color: @formStates[@@state][inputPlaceholderFocusColor];
}
Expand Down Expand Up @@ -847,12 +849,16 @@
}
}

.ui.ui.ui.ui.form .fields > label:empty::after,
.ui.ui.ui.ui.form .field > label:empty::after {
.ui.ui.ui.ui.form .fields:not(.required) > label:empty::after,
.ui.ui.ui.ui.form .fields:not(.grouped):not(.inline) > .field:not(.required) > label:empty::after {
content: " ";
display: inline-block;
}

.ui.ui.ui.ui.form .inline.fields .field:not(.required) > label:empty {
display: none;
}

/*******************************
Variations
*******************************/
Expand Down
1 change: 1 addition & 0 deletions src/definitions/collections/message.less
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@

.ui.compact.message {
display: inline-block;
max-width: 100%;
}
.ui.compact.icon.message {
display: inline-flex;
Expand Down
1 change: 1 addition & 0 deletions src/definitions/elements/button.less
Original file line number Diff line number Diff line change
Expand Up @@ -1098,6 +1098,7 @@
.ui.ui.circular.buttons .button,
.ui.ui.ui.ui.circular.button {
border-radius: @circularBorderRadius;
min-width: @circularMinWidth;
}

.ui.circular.buttons .button > .icon,
Expand Down
5 changes: 5 additions & 0 deletions src/definitions/elements/label.less
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ a.ui.label {
Types
*******************************/
& when (@variationLabelImage) {
.ui.image.labels .label,
.ui.image.label {
width: auto;
margin-top: 0;
Expand All @@ -199,6 +200,10 @@ a.ui.label {
padding: @imageLabelPadding;
}
}
.ui.labels .image.label,
.ui.image.labels .label {
margin-bottom: @groupVerticalMargin;
}

.ui.image.label img {
display: inline-block;
Expand Down
5 changes: 4 additions & 1 deletion src/definitions/modules/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,9 @@
if (module.is.searchSelection()) {
module.remove.searchTerm();
}
module.hide();
if (settings.collapseOnClearable) {
module.hide();
}
event.stopPropagation();
},
},
Expand Down Expand Up @@ -4096,6 +4098,7 @@
headerDivider: true, // whether option headers should have an additional divider line underneath when converted from <select> <optgroup>

collapseOnActionable: true, // whether the dropdown should collapse upon selection of an actionable item
collapseOnClearable: false, // whether the dropdown should collapse upon clicking the clearable icon

// label settings on multi-select
label: {
Expand Down
7 changes: 5 additions & 2 deletions src/definitions/modules/dropdown.less
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ select.ui.dropdown {
opacity: @selectionTextUnderlayIconOpacity;
}
.ui.active.search.dropdown input.search:focus + .text {
color: @selectionTextUnderlayColor !important;
color: @selectionTextUnderlayColor;
}

.ui.search.dropdown.button > span.sizer {
Expand Down Expand Up @@ -922,6 +922,9 @@ select.ui.dropdown {
padding: inherit;
margin: @multipleSelectionChildMargin;
line-height: @multipleSelectionChildLineHeight;
&.default {
z-index: -1;
}
}

.ui.multiple.search.dropdown > .label ~ .text {
Expand Down Expand Up @@ -1976,7 +1979,7 @@ select.ui.dropdown {
opacity: @invertedSelectionTextUnderlayIconOpacity;
}
.ui.inverted.active.search.dropdown input.search:focus + .text {
color: @invertedSelectionTextUnderlayColor !important;
color: @invertedSelectionTextUnderlayColor;
}

.ui.dropdown .inverted.menu > .message:not(.ui),
Expand Down
6 changes: 3 additions & 3 deletions src/definitions/modules/shape.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
set: {

defaultSide: function () {
$activeSide = $side.filter('.' + settings.className.active);
$activeSide = $side.filter('.' + className.active);
$nextSide = $activeSide.next(selector.side).length > 0
? $activeSide.next(selector.side)
: $side.first();
Expand All @@ -211,7 +211,7 @@

currentStageSize: function () {
var
$activeSide = $side.filter('.' + settings.className.active),
$activeSide = $side.filter('.' + className.active),
width = $activeSide.outerWidth(true),
height = $activeSide.outerHeight(true)
;
Expand All @@ -227,7 +227,7 @@
var
$clone = $module.clone().addClass(className.loading),
$side = $clone.find('>' + selector.sides + '>' + selector.side),
$activeSide = $side.filter('.' + settings.className.active),
$activeSide = $side.filter('.' + className.active),
$nextSide = nextIndex
? $side.eq(nextIndex)
: ($activeSide.next(selector.side).length > 0
Expand Down
1 change: 1 addition & 0 deletions src/themes/default/elements/button.variables
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@
/* Circular */
@circularBorderRadius: 10em;
@circularIconWidth: 1em;
@circularMinWidth: 2.5em;
@circularGroupMargin: 0.25em;
@circularVerticalGroupMargin: @circularGroupMargin;

Expand Down
Loading

0 comments on commit 8ab2fa9

Please sign in to comment.