Skip to content

Commit

Permalink
Merge branch 'develop' into types
Browse files Browse the repository at this point in the history
  • Loading branch information
lubber-de authored Dec 19, 2023
2 parents 1b9d86e + 7694a1b commit 5de2386
Show file tree
Hide file tree
Showing 14 changed files with 988 additions and 261 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"
}
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
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
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
91 changes: 91 additions & 0 deletions src/themes/basic/assets/fonts/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Loading

0 comments on commit 5de2386

Please sign in to comment.