Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v2.2.1 #563

Merged
merged 35 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
8a53446
(enhancement) eslint coding standards - automated fixes #506
gselderslaghs Dec 17, 2024
f6375da
enhancement(Autocomplete) coding standards eslint fixes #506
gselderslaghs Dec 18, 2024
dcffec3
enhancement(Buttons) coding standards eslint fixes #506
gselderslaghs Dec 18, 2024
bf40157
enhancement(Carousel) coding standards eslint fixes #506
gselderslaghs Dec 18, 2024
29e92a7
enhancement(Chips) coding standards eslint fixes #506
gselderslaghs Dec 18, 2024
add76d6
enhancement(Dropdown) coding standards eslint fixes #506
gselderslaghs Dec 18, 2024
5f93e5d
enhancement(Materialbox) coding standards eslint fixes #506
gselderslaghs Dec 18, 2024
4dd3913
enhancement(Parallax) coding standards eslint fixes #506
gselderslaghs Dec 18, 2024
838a9bd
enhancement(Pushpin) coding standards eslint fixes #506
gselderslaghs Dec 18, 2024
56752e9
enhancement(Sidenav) coding standards eslint fixes; refactor duplicat…
gselderslaghs Dec 18, 2024
ea59cdc
enhancement(Select) coding standards eslint fixes #506
gselderslaghs Dec 18, 2024
7f72601
enhancement(Tabs) coding standards eslint fixes #506
gselderslaghs Dec 18, 2024
82a9d7c
enhancement(Timepicker) coding standards eslint fixes; refactor dupli…
gselderslaghs Dec 18, 2024
759ea60
fix(Chips) refactored handling removal of static chips, fixes chips n…
gselderslaghs Dec 19, 2024
3a89be1
fix(Autocomplete) unsupported FocusEvent in _handleInputKeyupAndFocus…
gselderslaghs Dec 19, 2024
5f8a1ac
enhancement(Carousel) eslint coding standards, fixes unexpected any #506
gselderslaghs Dec 19, 2024
28123ec
eslint config: allow baseoptions as empty object type
gselderslaghs Dec 19, 2024
5240b2f
enhancement(CharacterCounter) eslint coding standards, use base optio…
gselderslaghs Dec 19, 2024
6b782a8
enhancement(Toasts) eslint coding standards, fix additional no explic…
gselderslaghs Dec 19, 2024
ef35166
enhancement(Datepicker) eslint coding standards #506
gselderslaghs Dec 19, 2024
3472297
enhancement(Dropdown) eslint coding standards, fixes no explicit any …
gselderslaghs Dec 19, 2024
d0e84e0
enhancement(Forms) eslint coding standards, refactor textareaAutoResi…
gselderslaghs Dec 19, 2024
eb347bb
enhancement(Tooltip) fixes unreachable code fragment #506
gselderslaghs Dec 19, 2024
e023654
enhancement(Utils) eslint coding standards fixes no unsafe function t…
gselderslaghs Dec 19, 2024
0b7c8c5
eslint coding standards: fixes prefer const #506
gselderslaghs Dec 19, 2024
c0522b7
eslint coding standards: ignore eslint lines as to allow external imp…
gselderslaghs Dec 19, 2024
d4d05f6
fix(CharacterCounter) disable options as they are defined by base opt…
gselderslaghs Dec 19, 2024
24daf93
chore: do no upload archives to npm
wuda-io Dec 23, 2024
4afb62e
chore: merge
wuda-io Dec 23, 2024
34593d0
Merge branch 'gselderslaghs-eslint-coding-standards' into v2-dev
wuda-io Dec 23, 2024
562a542
style: fix linter issues
wuda-io Dec 23, 2024
800255c
style: fix linter issues from tests
wuda-io Dec 23, 2024
182a808
fix: lint errors and tests
wuda-io Dec 24, 2024
c887f6d
ci: add node setup
wuda-io Dec 24, 2024
65ddf18
chore: release 2.2.1
wuda-io Dec 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ jobs:
steps:
- uses: actions/checkout@master

- uses: actions/setup-node@v4
with:
node-version: 23

- name: Run tests
run: |
npm i
Expand Down
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default [
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-unused-expressions': 'error',
'@typescript-eslint/no-this-alias': 'warn',
'@typescript-eslint/no-empty-object-type': 'error',
'@typescript-eslint/no-empty-object-type': ['error' , { allowWithName: 'BaseOptions$' }],
'@typescript-eslint/no-require-imports': 'error',
'@typescript-eslint/no-unsafe-function-type': 'error'
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "The responsive front-end library based on Material Design from Google.",
"author": "The Materialize Team",
"homepage": "https://materializeweb.com",
"version": "2.2.0",
"version": "2.2.1",
"style": "dist/css/materialize.css",
"sass": "sass/materialize.scss",
"typings": "dist/js/materialize.d.ts",
Expand Down Expand Up @@ -37,7 +37,7 @@
"build": "rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
"release": "npm run lint && npm run build && node ci/compress.js",
"preversion": "npm run lint && npm test",
"version": "npm run build && node ci/compress.js && git add -A dist src/index.ts"
"version": "npm run build && node ci/compress.js && git add ."
},
"lint-staged": {
"js/*.js": [
Expand Down Expand Up @@ -71,7 +71,8 @@
"typescript-eslint": "^8.6.0"
},
"files": [
"dist",
"dist/css",
"dist/js",
"sass/**/*.scss",
"LICENSE"
]
Expand Down
18 changes: 7 additions & 11 deletions spec/helpers/helper.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/* eslint-disable no-undef */
/* eslint-disable no-unused-vars */

const KEYMAP = {
'27': 'Escape',
'32': 'Space',
Expand Down Expand Up @@ -121,28 +118,27 @@ const KEYMAP = {
'105': '9'
};

// eslint-disable-next-line @typescript-eslint/no-unused-vars
function XloadHtml(html, options) {
options = options ? options : {};
const defaultOptions = { insertionType: 'append' };
options = {
...defaultOptions,
...options
};

const div = document.createElement('div');
div.classList.add('please-delete-me');
div.innerHTML = html;

if (options.insertionType === 'append') {
document.body.appendChild(div);
} else if (options.insertionType === 'prepend') {
document.body.prepend(div);
}
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
function XunloadFixtures() {
document.querySelectorAll('.please-delete-me').forEach((el) => el.remove());
//
document.querySelectorAll('.material-tooltip').forEach((el) => el.remove());
document.querySelectorAll('.dropdown-content').forEach((el) => el.remove());
}
Expand All @@ -152,7 +148,7 @@ beforeEach(() => {
toExist: (util, customEqualityTesters) => {
return {
compare: (actual) => {
let result = {};
const result = {};
result.pass = util.equals(!!actual, true, customEqualityTesters);
return result;
}
Expand Down Expand Up @@ -190,7 +186,7 @@ beforeEach(() => {
return {
compare: (actual) => {
const style = getComputedStyle(actual);
let result = {};
const result = {};
result.pass = util.equals(
style.getPropertyValue('display'),
'none',
Expand All @@ -204,7 +200,7 @@ beforeEach(() => {
return {
compare: (actual) => {
const style = getComputedStyle(actual);
let result = {};
const result = {};
result.pass = !util.equals(
style.getPropertyValue('display'),
'none',
Expand All @@ -224,7 +220,7 @@ beforeEach(() => {
toHaveClass: (util, customEqualityTesters) => {
return {
compare: (actual, expected) => {
let result = {};
const result = {};
result.pass = util.equals(
actual.classList.contains(expected),
true,
Expand All @@ -237,7 +233,7 @@ beforeEach(() => {
toNotHaveClass: (util, customEqualityTesters) => {
return {
compare: function (actual, expected) {
let result = {};
const result = {};
result.pass = util.equals(
actual.classList.contains(expected),
false,
Expand Down
10 changes: 5 additions & 5 deletions spec/tests/autocomplete/autocompleteSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ describe('Autocomplete Plugin', () => {
}
const limitedInstance = M.Autocomplete.getInstance(limited);
const limit = 20;
limitedInstance.options.onSearch = (text) => {
limitedInstance.options.onSearch = () => {
const filteredItems = data.slice(0, limit);
limitedInstance.setMenuItems(filteredItems);
};
Expand All @@ -114,8 +114,8 @@ describe('Autocomplete Plugin', () => {
});

it('should open correctly from typing', (done) => {
let normal = document.querySelector('#normal-autocomplete');
let autocompleteEl = normal.parentNode.querySelector('.autocomplete-content');
const normal = document.querySelector('#normal-autocomplete');
const autocompleteEl = normal.parentNode.querySelector('.autocomplete-content');
focus(normal);
normal.value = 'e';
keyup(normal, 69);
Expand All @@ -129,8 +129,8 @@ describe('Autocomplete Plugin', () => {
});

it('should open correctly from keyboard focus', (done) => {
let normal = document.querySelector('#normal-autocomplete');
let autocompleteEl = normal.parentNode.querySelector('.autocomplete-content');
const normal = document.querySelector('#normal-autocomplete');
const autocompleteEl = normal.parentNode.querySelector('.autocomplete-content');
normal.value = 'e';
keyup(normal, 9);
focus(normal);
Expand Down
46 changes: 22 additions & 24 deletions spec/tests/cards/cardsSpec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable no-undef */

describe('Cards', () => {
const fixture = `<div class="row">
<div class="col s12 m6">
Expand Down Expand Up @@ -91,13 +89,13 @@ describe('Cards', () => {

beforeEach(() => {
revealCard = document.querySelector('.card.reveal');
M.Cards.init(document.querySelectorAll('.card'));
});

it('should have a hidden card-reveal', (done) => {
const revealDiv = revealCard.querySelector('.card-reveal');
const activator = revealCard.querySelector('.activator');
expect(revealDiv).toBeHidden('reveal div should be hidden initially');

click(activator);
setTimeout(() => {
expect(revealDiv).toBeVisible('reveal did not appear after activator was clicked.');
Expand Down Expand Up @@ -150,13 +148,13 @@ describe('Cards', () => {
});

it('should have small card dimensions', () => {
let cardImage = small.querySelector('.card-image');
let cardContent = small.querySelector('.card-content');
let cardAction = small.querySelector('.card-action');
let smallRect = small.getBoundingClientRect();
let cardImageRect = cardImage.getBoundingClientRect();
let cardContentRect = cardContent.getBoundingClientRect();
let cardActionRect = cardAction.getBoundingClientRect();
const cardImage = small.querySelector('.card-image');
const cardContent = small.querySelector('.card-content');
const cardAction = small.querySelector('.card-action');
const smallRect = small.getBoundingClientRect();
const cardImageRect = cardImage.getBoundingClientRect();
const cardContentRect = cardContent.getBoundingClientRect();
const cardActionRect = cardAction.getBoundingClientRect();

expect(smallRect.height).toEqual(300, 'small card should be 300px high');
expect(cardImageRect.height).toBeLessThan(181, 'small image should be <= 180px or 60% high');
Expand All @@ -171,13 +169,13 @@ describe('Cards', () => {
});

it('should have medium card dimensions', () => {
let cardImage = medium.querySelector('.card-image');
let cardContent = medium.querySelector('.card-content');
let cardAction = medium.querySelector('.card-action');
let mediumRect = medium.getBoundingClientRect();
let cardImageRect = cardImage.getBoundingClientRect();
let cardContentRect = cardContent.getBoundingClientRect();
let cardActionRect = cardAction.getBoundingClientRect();
const cardImage = medium.querySelector('.card-image');
const cardContent = medium.querySelector('.card-content');
const cardAction = medium.querySelector('.card-action');
const mediumRect = medium.getBoundingClientRect();
const cardImageRect = cardImage.getBoundingClientRect();
const cardContentRect = cardContent.getBoundingClientRect();
const cardActionRect = cardAction.getBoundingClientRect();

expect(mediumRect.height).toEqual(400, 'medium card should be 400px high');
expect(cardImageRect.height).toBeLessThan(241, 'medium image should be <= 240 or 60% high');
Expand All @@ -192,13 +190,13 @@ describe('Cards', () => {
});

it('should have large card dimensions', () => {
let cardImage = large.querySelector('.card-image');
let cardContent = large.querySelector('.card-content');
let cardAction = large.querySelector('.card-action');
let largeRect = large.getBoundingClientRect();
let cardImageRect = cardImage.getBoundingClientRect();
let cardContentRect = cardContent.getBoundingClientRect();
let cardActionRect = cardAction.getBoundingClientRect();
const cardImage = large.querySelector('.card-image');
const cardContent = large.querySelector('.card-content');
const cardAction = large.querySelector('.card-action');
const largeRect = large.getBoundingClientRect();
const cardImageRect = cardImage.getBoundingClientRect();
const cardContentRect = cardContent.getBoundingClientRect();
const cardActionRect = cardAction.getBoundingClientRect();

expect(largeRect.height).toEqual(500, 'large card should be 500px high');
expect(cardImageRect.height).toBeLessThan(301, 'large image should be <= 300 or 60% high');
Expand Down
8 changes: 4 additions & 4 deletions spec/tests/carousel/carouselSpec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable no-undef */

describe('Carousel', () => {
const fixture = `<div class="carousel carousel-slider" id="slider-no-wrap">
<div class="carousel-item">
Expand Down Expand Up @@ -52,10 +50,12 @@ describe('Carousel', () => {

document.querySelectorAll('.indicator-item')[1].click();
setTimeout(() => {
expect(carousel.center).toEqual(1, 'carousel item was not visible after indicator interaction');
expect(carousel.center).toEqual(
1,
'carousel item was not visible after indicator interaction'
);
done();
}, 30);
});

});
});
10 changes: 4 additions & 6 deletions spec/tests/chips/chipsSpec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable no-undef */

describe('Chips', () => {
const fixture = `<div class="chips"></div>
<div class="chips chips-initial"></div>
Expand Down Expand Up @@ -66,7 +64,7 @@ describe('Chips', () => {
M.Chips.init(chips);
M.Chips.init(chips);
chipsUserInput = document.querySelector('.chips.input-field');
M.Chips.init(chips, {allowUserInput: true});
M.Chips.init(chips, { allowUserInput: true });
input = chipsUserInput.querySelectorAll('input');
expect(input.length).toEqual(1, 'Should dynamically generate chips structure.');
});
Expand All @@ -77,8 +75,8 @@ describe('Chips', () => {
input.value = 'one';
keydown(input, 13);
setTimeout(() => {
let numChips = chips.querySelectorAll('.chip').length;
let oneChip = chips.querySelector('.chip');
const numChips = chips.querySelectorAll('.chip').length;
const oneChip = chips.querySelector('.chip');
expect(numChips).toEqual(1, 'one chip should have been added');
for (let i = oneChip.children.length - 1; i >= 0; i--) {
oneChip.children[i].remove();
Expand All @@ -92,7 +90,7 @@ describe('Chips', () => {
chips = document.querySelector('.chips.chips-initial.input-field');
let numChips = chips.querySelectorAll('.chip').length;
expect(numChips).toEqual(3, '3 initial chips should have been added');
let chipCloseButton = chips.querySelectorAll('.chip .close');
const chipCloseButton = chips.querySelectorAll('.chip .close');
expect(chipCloseButton.length).toEqual(3, 'expected all chips to have close button');
click(chipCloseButton[0]);
setTimeout(() => {
Expand Down
Loading
Loading