Skip to content

Commit

Permalink
Fix active filter column icon (#1951)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek authored Dec 14, 2022
1 parent c1bc176 commit e0e9b34
Show file tree
Hide file tree
Showing 59 changed files with 338 additions and 200 deletions.
3 changes: 2 additions & 1 deletion demos/basic/breadcrumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
$model = new Country($app->db);
$model->setLimit(15);

if ($id = $crumb->stickyGet('country_id')) {
$id = $crumb->stickyGet('country_id');
if ($id) {
// perhaps we edit individual country?
$model = $model->load($id);
$crumb->addCrumb($model->name, []);
Expand Down
2 changes: 1 addition & 1 deletion demos/collection/table.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/** @var \Atk4\Ui\App $app */
require_once __DIR__ . '/../init-app.php';

if ($id = $_GET['id'] ?? null) {
if ($_GET['id'] ?? null) {
$app->layout->js(true, new JsToast('Details link is in simulation mode.'));
}

Expand Down
8 changes: 6 additions & 2 deletions demos/form-control/lookup-dep.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
$model->addCondition($model->fieldName()->name, 'like', $letter . '%');
}

isset($data['contains']) ? $model->addCondition($model->fieldName()->name, 'like', '%' . $data['contains'] . '%') : null;
if (isset($data['contains'])) {
$model->addCondition($model->fieldName()->name, 'like', '%' . $data['contains'] . '%');
}
},
'placeholder' => 'Selection depends on Dropdown above',
'search' => [Country::hinting()->fieldName()->name, Country::hinting()->fieldName()->iso, Country::hinting()->fieldName()->iso3],
Expand Down Expand Up @@ -72,7 +74,9 @@
Form\Control\Lookup::class,
'model' => new Country($app->db),
'dependency' => function (Country $model, $data) {
isset($data['ends_with']) ? $model->addCondition($model->fieldName()->name, 'like', '%' . $data['ends_with']) : null;
if (isset($data['ends_with'])) {
$model->addCondition($model->fieldName()->name, 'like', '%' . $data['ends_with']);
}
},
'multiple' => true,
'search' => [Country::hinting()->fieldName()->name, Country::hinting()->fieldName()->iso, Country::hinting()->fieldName()->iso3],
Expand Down
3 changes: 2 additions & 1 deletion docs/breadcrumb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ For example the next code will use some logic::

$model = new User($app->db);

if ($id = $app->stickyGet('user_id')) {
$id = $app->stickyGet('user_id');
if ($id) {
// perhaps we edit individual user?
$model = $model->load($id);
$crumb->addCrumb($model->get('name'), []);
Expand Down
2 changes: 0 additions & 2 deletions js/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ module.exports = {
js: 'never',
vue: 'never',
}],
'import/no-unresolved': 'off',
'import/prefer-default-export': 'off',
indent: ['error', 4, {
SwitchCase: 1,
Expand Down Expand Up @@ -81,7 +80,6 @@ module.exports = {
'unicorn/no-this-assignment': 'off',
'unicorn/prefer-module': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/switch-case-braces': ['error', 'avoid'],
'vue/attribute-hyphenation': ['error', 'never'],
'vue/html-indent': ['error', 4],
},
Expand Down
6 changes: 4 additions & 2 deletions js/src/plugins/file-upload.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,24 @@ export default class AtkFileUploadPlugin extends AtkPlugin {
*/
setState(mode) {
switch (mode) {
case 'delete':
case 'delete': {
this.action.html(this.getEraseContent);
setTimeout(() => {
this.bar.progress('reset');
this.bar.hide('fade');
}, 1000);

break;
case 'upload':
}
case 'upload': {
this.action.html(this.actionContent);
this.textInput.val('');
this.fileInput.val('');
this.hiddenInput.val('');
this.$el.data().fileId = null;

break;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion js/src/services/vue.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class VueService {
if (registry[name] === undefined && registry[camelize(name)] === undefined) {
const namePascalized = capitalize(camelize(name));
if (registry[namePascalized] === undefined && vueFomanticUiComponentNamesSet.has(namePascalized)) {
registry[namePascalized] = asyncComponentFactory(namePascalized, () => (import('vue-fomantic-ui')).then((r) => r[namePascalized]));
registry[namePascalized] = asyncComponentFactory(namePascalized, () => (import('vue-fomantic-ui')).then((r) => r[namePascalized])); // eslint-disable-line import/no-unresolved
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,11 @@ export default {
switch (column.type) {
case 'integer':
case 'float':
case 'atk4_money':
case 'atk4_money': {
align = 'right';

break;
}
}
}

Expand Down
20 changes: 15 additions & 5 deletions js/src/vue-components/query-builder/fomantic-ui-rule.component.vue
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,21 @@ export default {
}
switch (type) {
case 'input': return this.isInput;
case 'checkbox': return this.isCheckbox;
case 'select': return this.isSelect;
case 'custom-component': return this.isComponent;
default: return false;
case 'input': {
return this.isInput;
}
case 'checkbox': {
return this.isCheckbox;
}
case 'select': {
return this.isSelect;
}
case 'custom-component': {
return this.isComponent;
}
default: {
return false;
}
}
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,16 @@ export default {
onToggleSelect: function () {
const { options } = this.getRootData();
switch (options.mode) {
case 'single':
case 'single': {
this.handleSingleSelect();

break;
case 'multiple':
}
case 'multiple': {
this.handleMultipleSelect();

break;
}
}
},
/**
Expand Down
2 changes: 1 addition & 1 deletion js/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const path = require('node:path');
const webpack = require('webpack');
const { VueLoaderPlugin } = require('vue-loader');
const TerserPlugin = require('terser-webpack-plugin');
const VueFomanticUi = require('vue-fomantic-ui');
const VueFomanticUi = require('vue-fomantic-ui'); // eslint-disable-line import/no-unresolved

module.exports = (env) => {
const isProduction = env === undefined ? false /* for eslint-import-resolver-webpack */ : env.production;
Expand Down
109 changes: 97 additions & 12 deletions public/external/jquery/dist/jquery.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* jQuery JavaScript Library v3.6.1
* jQuery JavaScript Library v3.6.2
* https://jquery.com/
*
* Includes Sizzle.js
Expand All @@ -9,7 +9,7 @@
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2022-08-26T17:52Z
* Date: 2022-12-13T14:56Z
*/
( function( global, factory ) {

Expand Down Expand Up @@ -151,7 +151,7 @@ function toType( obj ) {


var
version = "3.6.1",
version = "3.6.2",

// Define a local copy of jQuery
jQuery = function( selector, context ) {
Expand Down Expand Up @@ -522,14 +522,14 @@ function isArrayLike( obj ) {
}
var Sizzle =
/*!
* Sizzle CSS Selector Engine v2.3.6
* Sizzle CSS Selector Engine v2.3.8
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://js.foundation/
*
* Date: 2021-02-16
* Date: 2022-11-16
*/
( function( window ) {
var i,
Expand Down Expand Up @@ -879,6 +879,27 @@ function Sizzle( selector, context, results, seed ) {
}

try {

// `qSA` may not throw for unrecognized parts using forgiving parsing:
// https://drafts.csswg.org/selectors/#forgiving-selector
// like the `:has()` pseudo-class:
// https://drafts.csswg.org/selectors/#relational
// `CSS.supports` is still expected to return `false` then:
// https://drafts.csswg.org/css-conditional-4/#typedef-supports-selector-fn
// https://drafts.csswg.org/css-conditional-4/#dfn-support-selector
if ( support.cssSupportsSelector &&

// eslint-disable-next-line no-undef
!CSS.supports( "selector(" + newSelector + ")" ) ) {

// Support: IE 11+
// Throw to get to the same code path as an error directly in qSA.
// Note: once we only support browser supporting
// `CSS.supports('selector(...)')`, we can most likely drop
// the `try-catch`. IE doesn't implement the API.
throw new Error();
}

push.apply( results,
newContext.querySelectorAll( newSelector )
);
Expand Down Expand Up @@ -1174,6 +1195,31 @@ setDocument = Sizzle.setDocument = function( node ) {
!el.querySelectorAll( ":scope fieldset div" ).length;
} );

// Support: Chrome 105+, Firefox 104+, Safari 15.4+
// Make sure forgiving mode is not used in `CSS.supports( "selector(...)" )`.
//
// `:is()` uses a forgiving selector list as an argument and is widely
// implemented, so it's a good one to test against.
support.cssSupportsSelector = assert( function() {
/* eslint-disable no-undef */

return CSS.supports( "selector(*)" ) &&

// Support: Firefox 78-81 only
// In old Firefox, `:is()` didn't use forgiving parsing. In that case,
// fail this test as there's no selector to test against that.
// `CSS.supports` uses unforgiving parsing
document.querySelectorAll( ":is(:jqfake)" ) &&

// `*` is needed as Safari & newer Chrome implemented something in between
// for `:has()` - it throws in `qSA` if it only contains an unsupported
// argument but multiple ones, one of which is supported, are fine.
// We want to play safe in case `:is()` gets the same treatment.
!CSS.supports( "selector(:is(*,:jqfake))" );

/* eslint-enable */
} );

/* Attributes
---------------------------------------------------------------------- */

Expand Down Expand Up @@ -1440,6 +1486,18 @@ setDocument = Sizzle.setDocument = function( node ) {
} );
}

if ( !support.cssSupportsSelector ) {

// Support: Chrome 105+, Safari 15.4+
// `:has()` uses a forgiving selector list as an argument so our regular
// `try-catch` mechanism fails to catch `:has()` with arguments not supported
// natively like `:has(:contains("Foo"))`. Where supported & spec-compliant,
// we now use `CSS.supports("selector(SELECTOR_TO_BE_TESTED)")` but outside
// that, let's mark `:has` as buggy to always use jQuery traversal for
// `:has()`.
rbuggyQSA.push( ":has" );
}

rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );
rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) );

Expand All @@ -1452,7 +1510,14 @@ setDocument = Sizzle.setDocument = function( node ) {
// As in, an element does not contain itself
contains = hasCompare || rnative.test( docElem.contains ) ?
function( a, b ) {
var adown = a.nodeType === 9 ? a.documentElement : a,

// Support: IE <9 only
// IE doesn't have `contains` on `document` so we need to check for
// `documentElement` presence.
// We need to fall back to `a` when `documentElement` is missing
// as `ownerDocument` of elements within `<template/>` may have
// a null one - a default behavior of all modern browsers.
var adown = a.nodeType === 9 && a.documentElement || a,
bup = b && b.parentNode;
return a === bup || !!( bup && bup.nodeType === 1 && (
adown.contains ?
Expand Down Expand Up @@ -2242,7 +2307,7 @@ Expr = Sizzle.selectors = {
return elem.nodeName.toLowerCase() === "input" &&
elem.type === "text" &&

// Support: IE<8
// Support: IE <10 only
// New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
( ( attr = elem.getAttribute( "type" ) ) == null ||
attr.toLowerCase() === "text" );
Expand Down Expand Up @@ -6608,17 +6673,37 @@ function curCSS( elem, name, computed ) {
// .css('filter') (IE 9 only, trac-12537)
// .css('--customProperty) (gh-3144)
if ( computed ) {
ret = computed.getPropertyValue( name ) || computed[ name ];

// trim whitespace for custom property (issue gh-4926)
if ( isCustomProp ) {
// Support: IE <=9 - 11+
// IE only supports `"float"` in `getPropertyValue`; in computed styles
// it's only available as `"cssFloat"`. We no longer modify properties
// sent to `.css()` apart from camelCasing, so we need to check both.
// Normally, this would create difference in behavior: if
// `getPropertyValue` returns an empty string, the value returned
// by `.css()` would be `undefined`. This is usually the case for
// disconnected elements. However, in IE even disconnected elements
// with no styles return `"none"` for `getPropertyValue( "float" )`
ret = computed.getPropertyValue( name ) || computed[ name ];

// rtrim treats U+000D CARRIAGE RETURN and U+000C FORM FEED
if ( isCustomProp && ret ) {

// Support: Firefox 105+, Chrome <=105+
// Spec requires trimming whitespace for custom properties (gh-4926).
// Firefox only trims leading whitespace. Chrome just collapses
// both leading & trailing whitespace to a single space.
//
// Fall back to `undefined` if empty string returned.
// This collapses a missing definition with property defined
// and set to an empty string but there's no standard API
// allowing us to differentiate them without a performance penalty
// and returning `undefined` aligns with older jQuery.
//
// rtrimCSS treats U+000D CARRIAGE RETURN and U+000C FORM FEED
// as whitespace while CSS does not, but this is not a problem
// because CSS preprocessing replaces them with U+000A LINE FEED
// (which *is* CSS whitespace)
// https://www.w3.org/TR/css-syntax-3/#input-preprocessing
ret = ret.replace( rtrimCSS, "$1" );
ret = ret.replace( rtrimCSS, "$1" ) || undefined;
}

if ( ret === "" && !isAttached( elem ) ) {
Expand Down
4 changes: 2 additions & 2 deletions public/external/jquery/dist/jquery.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit e0e9b34

Please sign in to comment.