Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
oyejorge authored Oct 19, 2023
2 parents 9171f7d + c9e3c81 commit df76748
Show file tree
Hide file tree
Showing 26 changed files with 337 additions and 310 deletions.
8 changes: 4 additions & 4 deletions .config/babel.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
[
"@babel/preset-env",
{
loose: true,
bugfixes: true,
modules: false
"loose": true,
"bugfixes": true,
"modules": false
}
],
"@babel/typescript"
],
"plugins": [
["@babel/plugin-proposal-class-properties", { "loose": true }]
["@babel/plugin-transform-class-properties", { "loose": true }]
]
}
19 changes: 16 additions & 3 deletions .config/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,18 @@ module.exports = function(config) {
'HeadlessChrome': ['HeadlessChrome']
};

var reporters = ['mocha','coverage','aChecker'];
var reporters = [
'mocha',
'coverage',
//'aChecker'
];
if( process.env.TRAVIS_CI ){
reporters = ['mocha', 'coverage', 'coveralls','aChecker']
reporters = [
'mocha',
'coverage',
'coveralls',
//'aChecker'
]
}

var target = process.env.TARGET;
Expand All @@ -133,7 +142,11 @@ module.exports = function(config) {

config.set({
basePath: '../',
frameworks: ['mocha', 'chai','aChecker'],
frameworks: [
'mocha',
'chai',
//'aChecker'
],
files: [
{
pattern: 'test/tests/esm-module.js',
Expand Down
11 changes: 9 additions & 2 deletions .config/rollup.config.js → .config/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import {nodeResolve} from '@rollup/plugin-node-resolve'; // so Rollup can resolve imports without file extensions and `node_modules`
import babel from '@rollup/plugin-babel';
import { terser } from 'rollup-plugin-terser';
import pkg from '../package.json';
import terser from '@rollup/plugin-terser';
import pkg from '../package.json' assert { type: "json" };
import path from 'path';
import fs from 'fs';
import { fileURLToPath } from 'url';
import { dirname } from 'path';

const tom_select_path_js = path.resolve( 'src/tom-select.js' );
const tom_select_path_ts = path.resolve( 'src/tom-select.ts' );
const configs = [];


const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

const banner = `/**
* Tom Select v${pkg.version}
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -76,6 +82,7 @@ inputs.forEach((slug)=>{
});



var terser_config = terser({
mangle: true,
//toplevel: true, // removes tomSelect footer
Expand Down
9 changes: 8 additions & 1 deletion .config/rollup.docs.js → .config/rollup.docs.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import alias from '@rollup/plugin-alias';
import resolve from '@rollup/plugin-node-resolve'; // so Rollup can resolve imports without file extensions and `node_modules`
import babel from '@rollup/plugin-babel';
import { terser } from 'rollup-plugin-terser';
import terser from '@rollup/plugin-terser';
import path from 'path';
import { fileURLToPath } from 'url';
import { dirname } from 'path';

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

var configs = [];

Expand All @@ -21,6 +26,7 @@ var resolve_config = resolve({
extensions: extensions,
});


var terser_config = terser({
mangle: true,
toplevel: true, // removes tomSelect footer
Expand All @@ -29,6 +35,7 @@ var terser_config = terser({
},
});


// bootstrap tabs for docs
configs.push({
input: 'doc_src/js/index.js',
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/eleventy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

strategy:
matrix:
node-version: [14.x]
node-version: [16.x]

steps:
- uses: actions/checkout@v2
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/stylelint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: StyleLint

on:
pull_request:
branches:
- '*'
push:
branches:
- main

jobs:
prettier:
name: StyleLint Check Action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Yarn install
run: yarn
- name: Run Stylelint Check
run: yarn stylelint
12 changes: 12 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": [
"stylelint-config-standard-scss",
"stylelint-config-prettier-scss"
],

"rules": {
"selector-class-pattern": null,
"scss/no-global-function-names": null,
"scss/dollar-variable-pattern": null
}
}
4 changes: 2 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,10 @@ module.exports = function(grunt) {
command: 'npx @11ty/eleventy --config=.config/eleventy.js',
},
rollupdocs: {
command: 'npx rollup -c .config/rollup.docs.js',
command: 'npx rollup -c .config/rollup.docs.mjs',
},
buildjs: {
command: 'npx rollup -c .config/rollup.config.js',
command: 'npx rollup -c .config/rollup.config.mjs',
},
},

Expand Down
6 changes: 6 additions & 0 deletions doc_src/pages/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,12 @@ Weights can be given to each field to improve search results
searchField: [{field:'text',weight:2},{field:'text2',weight:0.5}]
```

To completely disable the client side filtering (if youre getting the search results from an external source), set the `searchField` to an empty array.

```js
searchField: []
```

</td>
<td><code>array</code></td>
<td><code>['text']</code></td>
Expand Down
76 changes: 40 additions & 36 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,73 +31,77 @@
"url": "https://github.com/orchidjs/tom-select.git"
},
"devDependencies": {
"@11ty/eleventy": "^1.0.0",
"@11ty/eleventy-plugin-syntaxhighlight": "^4.0.0",
"@babel/core": "^7.13.1",
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/preset-env": "^7.14.7",
"@babel/preset-typescript": "^7.14.5",
"@11ty/eleventy": "^2.0.1",
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0",
"@babel/core": "^7.23.2",
"@babel/plugin-transform-class-properties": "^7.22.5",
"@babel/preset-env": "^7.23.2",
"@babel/preset-typescript": "^7.23.2",
"@lodder/grunt-postcss": "^3.0.0",
"@orchidjs/eleventy-plugin-ids": "^0.1.0",
"@popperjs/core": "^2.9.2",
"@rollup/plugin-alias": "^4.0.2",
"@popperjs/core": "^2.11.8",
"@rollup/plugin-alias": "^5.0.1",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-node-resolve": "^15.0.1",
"@types/jquery": "^3.5.14",
"@types/jqueryui": "^1.12.14",
"autoprefixer": "^10.2.4",
"@rollup/plugin-terser": "^0.4.4",
"@types/jquery": "^3.5.24",
"@types/jqueryui": "^1.12.19",
"autoprefixer": "^10.4.16",
"bootstrap": "npm:bootstrap@4",
"bootstrap-sass": "^3.4.3",
"bootstrap5": "npm:bootstrap@^5.0.2",
"bootstrap5": "npm:bootstrap@^5.3.2",
"broken-link-checker": "^0.7.8",
"chai": "^4.3.0",
"cssnano": "^5.0.1",
"grunt": "^1.3.0",
"chai": "^4.3.10",
"cssnano": "^6.0.0",
"grunt": "^1.6.1",
"grunt-cli": "^1.3.2",
"grunt-contrib-clean": "^2.0.0",
"grunt-contrib-connect": "^3.0.0",
"grunt-contrib-clean": "^2.0.1",
"grunt-contrib-connect": "^4.0.0",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-watch": "^1.1.0",
"grunt-replace": "^2.0.0",
"grunt-sass": "^3.1.0",
"grunt-shell": "^4.0.0",
"husky": "^8.0.1",
"husky": "^8.0.3",
"icon-blender": "^1.0.0-beta.4",
"jquery": "^3.6.0",
"jsdom": "^20.0.0",
"karma": "^6.3.17",
"karma-accessibility-checker": "^3.1.5",
"jquery": "^3.7.1",
"jsdom": "^22.1.0",
"karma": "^6.4.2",
"karma-browserstack-launcher": "^1.6.0",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^3.1.0",
"karma-coverage": "^2.0.3",
"karma-chrome-launcher": "^3.2.0",
"karma-coverage": "^2.2.1",
"karma-coveralls": "^2.1.0",
"karma-firefox-launcher": "^2.1.0",
"karma-mocha": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
"karma-safari-launcher": "^1.0.0",
"karma-sourcemap-loader": "^0.3.8",
"karma-sourcemap-loader": "^0.4.0",
"load-grunt-tasks": "^5.1.0",
"mocha": "^10.0.0",
"postcss": "^8.4.7",
"puppeteer": "^19.4.0",
"rollup": "^2.79.0",
"mocha": "^10.2.0",
"postcss": "^8.4.31",
"puppeteer": "^21.3.8",
"rollup": "^4.1.4",
"rollup-plugin-insert": "^1.3.2",
"rollup-plugin-terser": "^7.0.2",
"sass": "^1.49.9",
"sass": "^1.69.4",
"stylelint": "^15.11.0",
"stylelint-config-prettier-scss": "^1.0.0",
"stylelint-config-standard": "^34.0.0",
"stylelint-config-standard-scss": "^11.0.0",
"syn": "^0.15.0",
"tslib": "^2.4.0",
"typescript": "^4.8.3"
"tslib": "^2.6.2",
"typescript": "^5.2.2"
},
"scripts": {
"build": "grunt build",
"build:types": "tsc -p .config --emitDeclarationOnly",
"build:types": "npx typescript -p .config --emitDeclarationOnly",
"test": "karma start",
"test:one": "karma start --test_one",
"test:typescript": "tsc -p .config --noemit",
"test:typescript": "npx typescript -p .config --noemit",
"start": "grunt serve",
"pretest": "grunt build",
"prepare": "husky install"
"prepare": "husky install",
"stylelint": "stylelint 'src/**/*.scss'"
},
"engines": {
"node": "*"
Expand Down
30 changes: 16 additions & 14 deletions src/plugins/clear_button/plugin.scss
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
.plugin-clear_button{
/* stylelint-disable function-name-case */

.plugin-clear_button {
--ts-pr-clear-button: 1em;

.clear-button{
opacity: 0;
position: absolute;
top: 50%;
transform: translateY(-50%);
right: calc(#{$select-padding-x} - #{$select-padding-item-x});
margin-right: 0 !important;
background: transparent !important;
transition: opacity 0.5s;
cursor: pointer;
opacity: 0;
position: absolute;
top: 50%;
transform: translateY(-50%);
right: calc(#{$select-padding-x} - #{$select-padding-item-x});
margin-right: 0 !important;
background: transparent !important;
transition: opacity 0.5s;
cursor: pointer;
}

&.form-select .clear-button,
&.single .clear-button{
&.single .clear-button {

@if variable-exists(select-padding-dropdown-item-x) {
right: Max( var(--ts-pr-caret), #{$select-padding-dropdown-item-x});
right: Max(var(--ts-pr-caret), #{$select-padding-dropdown-item-x});
}
@else{
right: Max( var(--ts-pr-caret), calc(#{$select-padding-x} - #{$select-padding-item-x}) );
right: Max(var(--ts-pr-caret), calc(#{$select-padding-x} - #{$select-padding-item-x}));
}
}

&.focus.has-items .clear-button,
&:not(.disabled):hover.has-items .clear-button{
opacity: 1;
opacity: 1;
}
}
6 changes: 4 additions & 2 deletions src/plugins/drag_drop/plugin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
&.multi > .#{$select-ns}-control > div.ui-sortable-placeholder {
visibility: visible !important;
background: #f2f2f2 !important;
background: rgba(0,0,0,0.06) !important;
background: rgb(0 0 0 / 6%) !important;
border: 0 none !important;
box-shadow: inset 0 0 12px 4px #fff;
}

.ui-sortable-placeholder::after {
content: '!';
visibility: hidden;
}

.ui-sortable-helper {
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
box-shadow: 0 2px 5px rgb(0 0 0 / 20%);
}
}
Loading

0 comments on commit df76748

Please sign in to comment.