Skip to content

Commit

Permalink
Merge branch 'develop' into dropdownCustomActionSetText
Browse files Browse the repository at this point in the history
  • Loading branch information
lubber-de authored Dec 19, 2023
2 parents 033b682 + e123cb8 commit 66f1a30
Show file tree
Hide file tree
Showing 44 changed files with 1,324 additions and 543 deletions.
21 changes: 20 additions & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -658,10 +658,29 @@
"contributions": [
"security"
]
},
{
"login": "alvarolm",
"name": "Alvaro",
"avatar_url": "https://avatars.githubusercontent.com/u/2561547?v=4",
"profile": "https://twitter.com/alvarofleiva",
"contributions": [
"code"
]
},
{
"login": "Festiis",
"name": "Festim Nuredini",
"avatar_url": "https://avatars.githubusercontent.com/u/44016065?v=4",
"profile": "https://github.com/Festiis",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 4,
"repoType": "github",
"repoHost": "https://github.com",
"skipCi": true
"skipCi": true,
"commitType": "docs"
}
16 changes: 16 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,20 @@ module.exports = {
globals: {
jQuery: true,
},
overrides: [{
files: ['**/*.ts'],
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended',
],
rules: {
// https://typescript-eslint.io/rules/no-use-before-define#how-to-use
'no-use-before-define': 'off',

// TODO rules with a lot of errors to be fixed manually, fix in a separate PR
'@typescript-eslint/ban-types': 'off', // 16 eslint errors only, help wanted!
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/triple-slash-reference': 'off',
},
}],
};
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
- name: Install dependencies
run: yarn && yarn add -D eslint-config-airbnb-base@^15 eslint-plugin-unicorn@^46 eslint-plugin-jest@^26.9.0 @typescript-eslint/eslint-plugin @typescript-eslint/parser typescript
- name: Lint JS and LESS files
Expand All @@ -30,7 +30,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: pre-install
Expand All @@ -48,11 +48,11 @@ jobs:
security-events: write
steps:
- uses: actions/checkout@v4
- uses: github/codeql-action/init@v2
- uses: github/codeql-action/init@v3
with:
languages: 'javascript'
config-file: ./.github/codeql/codeql-config.yml
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: develop
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: master
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org/
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ This is a list of all project contributors powered by [All Contributors](https:/
<tr>
<td align="center" valign="top" width="25%"><a href="http://www.mathieumitchell.com"><img src="https://avatars.githubusercontent.com/u/234168?v=4?s=60" width="60px;" alt="Mathieu Mitchell"/><br /><sub><b>Mathieu Mitchell</b></sub></a><br /><a href="https://github.com/fomantic/Fomantic-UI/commits?author=mat128" title="Code">💻</a></td>
<td align="center" valign="top" width="25%"><a href="https://github.com/brian-codes"><img src="https://avatars.githubusercontent.com/u/37519149?v=4?s=60" width="60px;" alt="Brian McCluskey"/><br /><sub><b>Brian McCluskey</b></sub></a><br /><a href="#security-brian-codes" title="Security">🛡️</a></td>
<td align="center" valign="top" width="25%"><a href="https://twitter.com/alvarofleiva"><img src="https://avatars.githubusercontent.com/u/2561547?v=4?s=60" width="60px;" alt="Alvaro"/><br /><sub><b>Alvaro</b></sub></a><br /><a href="https://github.com/fomantic/Fomantic-UI/commits?author=alvarolm" title="Code">💻</a></td>
<td align="center" valign="top" width="25%"><a href="https://github.com/Festiis"><img src="https://avatars.githubusercontent.com/u/44016065?v=4?s=60" width="60px;" alt="Festim Nuredini"/><br /><sub><b>Festim Nuredini</b></sub></a><br /><a href="https://github.com/fomantic/Fomantic-UI/commits?author=Festiis" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"scripts": {
"build": "gulp build",
"changelog": "auto-changelog -p",
"lint": "eslint --ext .js . && stylelint \"**/*.{css,less,overrides,variables}\"",
"lint-fix": "eslint --ext .js . --fix && stylelint \"**/*.{css,less,overrides,variables}\" --fix"
"lint": "eslint --ext .js,.ts . && stylelint \"**/*.{css,less,overrides,variables}\"",
"lint-fix": "eslint --ext .js,.ts . --fix && stylelint \"**/*.{css,less,overrides,variables}\" --fix"
},
"dependencies": {
"@actions/core": "^1.6.0",
Expand Down
48 changes: 35 additions & 13 deletions src/definitions/behaviors/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,13 @@
fullFields[name].rules.push({ type: rule });
});
}

$.each(fullFields[name].rules, function (index, rule) {
var ruleName = module.get.ruleName(rule);
if (ruleName === 'empty') {
module.warn('*** DEPRECATED *** : Rule "empty" for field "' + name + '" will be removed in a future version. -> Use "notEmpty" rule instead.');
}
});
});

return fullFields;
Expand All @@ -552,7 +559,7 @@
$field = module.get.field(field.identifier),
value = $field.val(),
prompt = isFunction(rule.prompt)
? rule.prompt(value)
? rule.prompt.call($field[0], value)
: rule.prompt || settings.prompt[ruleName] || settings.text.unspecifiedRule,
requiresValue = prompt.search('{value}') !== -1,
requiresName = prompt.search('{name}') !== -1,
Expand Down Expand Up @@ -591,10 +598,10 @@
},
settings: function () {
if ($.isPlainObject(parameters)) {
if (parameters.fields) {
parameters.fields = module.get.fieldsFromShorthand(parameters.fields);
}
settings = $.extend(true, {}, $.fn.form.settings, parameters);
if (settings.fields) {
settings.fields = module.get.fieldsFromShorthand(settings.fields);
}
validation = $.extend(true, {}, $.fn.form.settings.defaults, settings.fields);
module.verbose('Extending settings', validation, settings);
} else {
Expand Down Expand Up @@ -711,7 +718,7 @@
var
$field = $(field),
$calendar = $field.closest(selector.uiCalendar),
name = $field.prop('name'),
name = $field.prop('name') || $field.prop('id'),
value = $field.val(),
isCheckbox = $field.is(selector.checkbox),
isRadio = $field.is(selector.radio),
Expand Down Expand Up @@ -1237,20 +1244,20 @@
isRequired = $el.prop('required') || $elGroup.hasClass(className.required) || $elGroup.parent().hasClass(className.required),
isDisabled = $el.is(':disabled') || $elGroup.hasClass(className.disabled) || $elGroup.parent().hasClass(className.disabled),
validation = module.get.validation($el),
hasEmptyRule = validation
hasNotEmptyRule = validation
? $.grep(validation.rules, function (rule) {
return rule.type === 'empty';
}) !== 0
return ['notEmpty', 'checked', 'empty'].indexOf(rule.type) >= 0;
}).length > 0
: false,
identifier = module.get.identifier(validation, $el)
;
if (isRequired && !isDisabled && !hasEmptyRule && identifier !== undefined) {
if (isRequired && !isDisabled && !hasNotEmptyRule && identifier !== undefined) {
if (isCheckbox) {
module.verbose("Adding 'checked' rule on field", identifier);
module.add.rule(identifier, 'checked');
} else {
module.verbose("Adding 'empty' rule on field", identifier);
module.add.rule(identifier, 'empty');
module.verbose("Adding 'notEmpty' rule on field", identifier);
module.add.rule(identifier, 'notEmpty');
}
}
});
Expand Down Expand Up @@ -1349,13 +1356,14 @@
fieldErrors = [],
isDisabled = $field.filter(':not(:disabled)').length === 0,
validationMessage = $field[0].validationMessage,
noNativeValidation = field.noNativeValidation || settings.noNativeValidation || $field.filter('[formnovalidate],[novalidate]').length > 0 || $module.filter('[novalidate]').length > 0,
errorLimit
;
if (!field.identifier) {
module.debug('Using field name as identifier', identifier);
field.identifier = identifier;
}
if (validationMessage) {
if (validationMessage && !noNativeValidation) {
module.debug('Field is natively invalid', identifier);
fieldErrors.push(validationMessage);
fieldValid = false;
Expand Down Expand Up @@ -1491,6 +1499,12 @@
module.error.apply(console, arguments);
}
},
warn: function () {
if (!settings.silent) {
module.warn = Function.prototype.bind.call(console.warn, console, settings.name + ':');
module.warn.apply(console, arguments);
}
},
performance: {
log: function (message) {
var
Expand Down Expand Up @@ -1605,6 +1619,7 @@
name: 'Form',
namespace: 'form',

silent: false,
debug: false,
verbose: false,
performance: true,
Expand All @@ -1627,6 +1642,7 @@
errorFocus: true,
dateHandling: 'date', // 'date', 'input', 'formatter'
errorLimit: 0,
noNativeValidation: false,

onValid: function () {},
onInvalid: function () {},
Expand Down Expand Up @@ -1669,6 +1685,7 @@
maxValue: '{name} must have a maximum value of {ruleValue}',
minValue: '{name} must have a minimum value of {ruleValue}',
empty: '{name} must have a value',
notEmpty: '{name} must have a value',
checked: '{name} must be checked',
email: '{name} must be a valid e-mail',
url: '{name} must be a valid url',
Expand Down Expand Up @@ -1801,10 +1818,15 @@
rules: {

// is not empty or blank string
empty: function (value) {
notEmpty: function (value) {
return !(value === undefined || value === '' || (Array.isArray(value) && value.length === 0));
},

/* Deprecated */
empty: function (value) {
return $.fn.form.settings.rules.notEmpty(value);
},

// checkbox checked
checked: function () {
return $(this).filter(':checked').length > 0;
Expand Down
1 change: 1 addition & 0 deletions src/definitions/collections/form.less
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,7 @@
.ui.form .inverted.segment label,
.ui.form .inverted.segment .ui.checkbox label,
.ui.inverted.form .ui.checkbox label,
.ui.inverted.form .grouped.fields > label,
.ui.inverted.form .inline.fields > label,
.ui.inverted.form .inline.fields .field > label,
.ui.inverted.form .inline.fields .field > p,
Expand Down
28 changes: 25 additions & 3 deletions src/definitions/elements/button.less
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@
border-top: @basicGroupBorder;
}

.ui.basic.vertical.buttons:not(.spaced) .button:first-child {
.ui.basic.vertical.buttons:not(.spaced):not(.circular) .button:first-child {
border-top: none;
}
}
Expand Down Expand Up @@ -1095,15 +1095,37 @@
/* --------------
Circular
--------------- */

.ui.circular.button {
.ui.ui.circular.buttons .button,
.ui.ui.ui.ui.circular.button {
border-radius: @circularBorderRadius;
}

.ui.circular.button > .icon {
width: @circularIconWidth;
vertical-align: baseline;
}

.ui.circular.buttons:not(.vertical) .button {
margin-right: @circularGroupMargin;
}

& when (@variationButtonVertical) {
.ui.vertical.circular.buttons .button {
margin-bottom: @circularVerticalGroupMargin;
}
}

& when (@variationButtonBasic) {
.ui.circular.basic.buttons {
border: none;
& .button {
border: @basicGroupBorder;
&.basic {
border: none;
}
}
}
}
}

& when (@variationButtonOr) {
Expand Down
4 changes: 2 additions & 2 deletions src/definitions/modules/dropdown.less
Original file line number Diff line number Diff line change
Expand Up @@ -1853,8 +1853,8 @@ select.ui.dropdown {
& when not (@variationDropdownSizes = false) {
each(@variationDropdownSizes, {
@s: @@value;
.ui.@{value}.dropdown,
.ui.@{value}.dropdown .menu > .item {
.ui.ui.@{value}.dropdown,
.ui.ui.@{value}.dropdown .menu > .item {
font-size: @s;
}
});
Expand Down
Loading

0 comments on commit 66f1a30

Please sign in to comment.