Skip to content

Commit a8da9d4

Browse files
committed
Updated to all new v4
1 parent 4e37b02 commit a8da9d4

81 files changed

Lines changed: 20319 additions & 10570 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.npmignore

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
.DS_Store
44
.git
55
.github
6+
.gitignore
67
.hg
78
.lock-wscript
89
.svn
@@ -24,6 +25,7 @@ work
2425
build
2526
src
2627
test
28+
examples
2729
spec
2830
pids
2931
logs
@@ -58,7 +60,14 @@ Thumbs.db
5860
.Spotlight-V100
5961
.Trashes
6062

61-
/ref.txt
6263
/node_modules/
6364
/bower_components/
6465
/vendor/
66+
67+
/ref.txt
68+
/CODE_OF_CONDUCT.md
69+
/CONTRIBUTING.md
70+
/composer.json
71+
/gulpfile.js
72+
/karma.conf.js
73+
/.travis.yml

CHANGELOG.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
CHANGELOG
2+
=========
3+
4+
v4.0.1
5+
-----
6+
- **Added:** Support for jQuery Slim version
7+
- **Added:** Public function `fixHeight`. See http://techlaboratory.net/jquery-smarttab#func-fixheight
8+
- **Added:** Public function `getInfo` to get tab index and tota tabs. See http://techlaboratory.net/jquery-smarttab#func-getinfo
9+
- **Added:** `goToTab` function with force parameter. See http://techlaboratory.net/jquery-smarttab#func-gototab
10+
- **Added:** New themes
11+
- **Added:** Colors are changable dynamically using CSS variables.
12+
- **Added:** Bootstrap 5 support
13+
- **Added:** `initialized` event . See http://techlaboratory.net/jquery-smarttab#event-initialized
14+
- **Added:** Move CSS class names to options
15+
- **Added:** Transition animations can be extended
16+
- **Added:** CSS Animations support on transition animations. Supports [Animate.css](https://animate.style/)
17+
- **Changed:** JavaScript and CSS code is rewritten
18+
- **Changed:** Imporoved all CSS themes
19+
- **Changed:** Made most of the options can changed with `setOptions` function
20+
- **Changed:** Rewritten option names and properties with minimal and meaningful names
21+
- **Changed:** Improved transition animations
22+
- **Removed:** Dark mode is removed. Added CSS variable support to change any colors. See example for dark colors.
23+
- **Removed:** Removed orientation option, instead add `st-vertical` CSS class to the main element
24+
25+
26+
v3.1.1
27+
-----
28+
- **Changed:** Updated themes and demos, and a few optimizations
29+
30+
v3.0.1
31+
-----
32+
- **Added:** Init method optimised
33+
34+
v3.0.0
35+
-----
36+
- **Changed:** Completely rewritten the code from scratch
37+
- **Added:** More speed and optimised performance
38+
- **Added:** Stand alone CSS
39+
- **Added:** Sass is used for CSS generation
40+
- **Added:** Improved themes with vertical and horizontal layouts
41+
- **Added:** Responsive themes
42+
- **Added:** External ajax call support

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
- Add new test cases.
88
- Add documentation.
99
- Add a demo page.
10-
- [Donate](https://www.paypal.me/dipuraj) money for the project on [![Paypal](https://img.shields.io/badge/PayPal-dipuraj-blue.svg)](https://www.paypal.me/dipuraj)
10+
- [GitHub Sponsor](https://github.com/sponsors/techlab) - Sponsor on GitHub.
11+
- [Donate on Paypal](https://www.paypal.me/dipuraj)
1112

1213
## How to contribute code?
1314
Here are the basic steps to get started contributing code:

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Dipu Raj
3+
Copyright (c) 2022 Dipu Raj
44
http://techlaboratory.net
55

66
Permission is hereby granted, free of charge, to any person obtaining a copy

README.md

Lines changed: 103 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
# jQuery Smart Tab v3
1+
# jQuery Smart Tab v4
22
#### The flexible jQuery tab control plugin
33

44
[![Build Status](https://travis-ci.org/techlab/jquery-smarttab.svg?branch=master)](https://travis-ci.org/techlab/jquery-smarttab)
55
[![npm version](https://badge.fury.io/js/jquery-smarttab.svg)](https://badge.fury.io/js/jquery-smarttab)
66
[![Latest Stable Version](https://poser.pugx.org/techlab/jquery-smarttab/v/stable)](https://packagist.org/packages/techlab/jquery-smarttab)
77
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/techlab/jquery-smarttab/master/LICENSE)
8+
[![GitHub Sponsor](https://img.shields.io/badge/Sponsor-techlab-blue.svg?logo=github)](https://github.com/sponsors/techlab)
89
[![Donate on Paypal](https://img.shields.io/badge/PayPal-dipuraj-blue.svg)](https://www.paypal.me/dipuraj)
910

1011
Smart Tab is a flexible and heavily customizable **jQuery Tab control plugin**.
@@ -19,23 +20,25 @@ Smart Tab is a flexible and heavily customizable **jQuery Tab control plugin**.
1920

2021
Demos
2122
-----
22-
+ [Basic Example](http://techlaboratory.net/projects/demo/jquery-smart-tab/v3)
23-
+ [Ajax Contents](http://techlaboratory.net/projects/demo/jquery-smart-tab/v3/ajax)
24-
+ [Multiple Tabs](http://techlaboratory.net/projects/demo/jquery-smart-tab/v3/multiple)
23+
+ [Basic Example](http://techlaboratory.net/projects/demo/jquery-smart-tab/v4)
24+
+ [Ajax Contents](http://techlaboratory.net/projects/demo/jquery-smart-tab/v4/ajax)
25+
+ [Multiple Tabs](http://techlaboratory.net/projects/demo/jquery-smart-tab/v4/multiple)
26+
+ [Vertical Tab Layout](http://techlaboratory.net/projects/demo/jquery-smart-tab/v4/vertical)
27+
+ [Bootstrap Modal Example](http://techlaboratory.net/projects/demo/jquery-smart-tab/v4/bootstrap-modal)
2528

2629
Screenshots
2730
-----
28-
![jQuery Smart Tab default](http://techlaboratory.net/assets/media/jquery-smart-tab/smarttab-v3-default.png)
31+
![jQuery Smart Tab](https://techlaboratory.net/assets/media/jquery-smart-tab/v4/st-v4-basic.gif)
2932

30-
![jQuery Smart Tab dark](http://techlaboratory.net/assets/media/jquery-smart-tab/smarttab-v3-dark.png)
33+
![jQuery Smart Tab](https://techlaboratory.net/assets/media/jquery-smart-tab/v4/st-v6-brick.png)
3134

32-
![jQuery Smart Tab tabs](http://techlaboratory.net/assets/media/jquery-smart-tab/smarttab-v3-tabs.png)
35+
![jQuery Smart Tab](https://techlaboratory.net/assets/media/jquery-smart-tab/v4/st-v6-basic.png)
3336

34-
![jQuery Smart Tab brick](http://techlaboratory.net/assets/media/jquery-smart-tab/smarttab-v3-brick.png)
37+
![jQuery Smart Tab](https://techlaboratory.net/assets/media/jquery-smart-tab/v4/st-v6-pills.png)
3538

3639
Requirements
3740
-----
38-
+ [jQuery](http://jquery.com/) (supports from jQuery-1.11.1+ to the latest jQuery-3.5.0)
41+
+ [jQuery](http://jquery.com/) (supports jQuery 1.11.1+ to jQuery 3.6+ and jQuery Slim versions)
3942

4043
Installation
4144
-----
@@ -46,49 +49,79 @@ Installation
4649
### [Yarn](https://yarn.pm/jquery-smarttab)
4750
yarn add jquery-smarttab
4851

49-
### [Composer](https://packagist.org/packages/techlab/jquery-smarttab)
50-
composer require techlab/jquery-smarttab
51-
5252
### [CDN - jsDelivr](https://www.jsdelivr.com/package/npm/jquery-smarttab)
5353
```html
5454
<!-- CSS -->
55-
<link href="https://cdn.jsdelivr.net/npm/jquery-smarttab@3.1.1/dist/css/smart_tab_all.min.css" rel="stylesheet" type="text/css" />
55+
<link href="https://cdn.jsdelivr.net/npm/jquery-smarttab@4/dist/css/smart_tab_all.min.css" rel="stylesheet" type="text/css" />
5656

5757
<!-- JavaScript -->
58-
<script src="https://cdn.jsdelivr.net/npm/jquery-smarttab@3.1.1/dist/js/jquery.smartTab.min.js" type="text/javascript"></script>
58+
<script src="https://cdn.jsdelivr.net/npm/jquery-smarttab@4/dist/js/jquery.smartTab.min.js" type="text/javascript"></script>
5959
```
6060

6161
### [CDN - UNPKG](https://unpkg.com/browse/jquery-smarttab/)
6262
```html
6363
<!-- CSS -->
64-
<link href="https://unpkg.com/jquery-smarttab@3.1.1/dist/css/smart_tab_all.min.css" rel="stylesheet" type="text/css" />
64+
<link href="https://unpkg.com/jquery-smarttab@4/dist/css/smart_tab_all.min.css" rel="stylesheet" type="text/css" />
6565

6666
<!-- JavaScript -->
67-
<script src="https://unpkg.com/jquery-smarttab@3.1.1/dist/js/jquery.smartTab.min.js" type="text/javascript"></script>
67+
<script src="https://unpkg.com/jquery-smarttab@4/dist/js/jquery.smartTab.min.js" type="text/javascript"></script>
68+
```
69+
70+
### Common JS/Webpack
71+
```js
72+
var $ = require("jquery");
73+
require( "jquery-smarttab/dist/css/smart_tab_all.css");
74+
const smartTab = require("jquery-smarttab");
75+
76+
$(function() {
77+
$('#smarttab').smartTab();
78+
});
79+
```
80+
### ES6/Babel
81+
```js
82+
import $ from "jquery";
83+
import "jquery-smarttab/dist/css/smart_tab_all.css";
84+
import smartTab from 'jquery-smarttab';
85+
86+
$(function() {
87+
$('#smarttab').smartTab();
88+
});
89+
```
90+
91+
#### Note: you may have to install the required dependencies
92+
```bash
93+
npm i jquery
94+
npm i jquery-smarttab
95+
96+
// If you are using Webpack, install
97+
npm i webpack webpack-cli style-loader css-loader --save-dev
6898
```
6999

70100
### Download
71101
#### [Download from GitHub](https://github.com/techlab/jquery-smarttab/archive/master.zip)
72102

73103
Features
74104
-----
75-
76-
+ Responsive design
77-
+ Standalone CSS
78-
+ Bootstrap compatible
79-
+ Various themes included
80-
+ Customizable CSS
81-
+ Cool transition animations (fade/slide-horizontal/slide-vertical/slide-swing)
82-
+ URL navigation and tab selection
83-
+ Compatible with all jQuery versions (jQuery 1.11.1+, jQuery 2+, jQuery 3.5+)
84-
+ Auto content height adjustment
85-
+ Auto Progress (automatic navigation of tabs)
86-
+ Ajax content loading support
87-
+ Keyboard navigation
88-
+ External anchor support
89-
+ Custom events
90-
+ Supports all modern browsers
91-
+ Easy to implement and minimal HTML required
105+
- Easy to implement and minimal HTML required
106+
- Supports all modern browsers
107+
- Responsive CSS design
108+
- Bootstrap compatible
109+
- Cool themes included and can be easly customize
110+
- Easy color cusomization using CSS variables
111+
- Built-in transition animations (none|fade|slideHorizontal|slideVertical|slideSwing|css)
112+
- Transition animations can be added easly by extending
113+
- CSS Animations support for transition animations (Supports [Animate.css](https://animate.style/))
114+
- Accessible controls
115+
- External controls support
116+
- Easy ajax content integration
117+
- Keyboard navigation
118+
- Auto content height adjustment
119+
- Buit-in loader
120+
- Buit-in events
121+
- UMD (Universal Module Definition) support
122+
- Compatible with all jQuery versions (jQuery 1.11.1+, jQuery 3.6+, and jQuery Slim)
123+
- URL navigation and tab selection
124+
- Auto Progress (automatic navigation of tabs)
92125

93126
Usage
94127
-----
@@ -150,15 +183,11 @@ Include jQuery SmartTab JavaScript
150183
<script type="text/javascript" src="../dist/js/jquery.smartTab.min.js"></script>
151184
```
152185
Initialize the jQuery SmartTab
153-
```html
154-
<script type="text/javascript">
155-
$(document).ready(function(){
156-
157-
// SmartTab initialize
158-
$('#smarttab').smartTab();
159-
160-
});
161-
</script>
186+
```js
187+
$(function() {
188+
// SmartTab initialize
189+
$('#smarttab').smartTab();
190+
});
162191
```
163192
That's it!
164193

@@ -169,27 +198,46 @@ Please see the [documentation](http://techlaboratory.net/jquery-smarttab#documen
169198
// SmartTab initialize
170199
$('#smarttab').smartTab({
171200
selected: 0, // Initial selected tab, 0 = first tab
172-
theme: 'default', // theme for the tab, related css need to include for other than default theme
173-
orientation: 'horizontal', // Nav menu orientation. horizontal/vertical
201+
theme: 'basic', // theme, related css need to include for other than default theme
174202
justified: true, // Nav menu justification. true/false
175203
autoAdjustHeight: true, // Automatically adjust content height
176204
backButtonSupport: true, // Enable the back button support
177-
enableURLhash: true, // Enable selection of the tab based on url hash
205+
enableUrlHash: true, // Enable selection of the step based on url hash
178206
transition: {
179-
animation: 'none', // Effect on navigation, none/fade/slide-horizontal/slide-vertical/slide-swing
180-
speed: '400', // Transion animation speed
181-
easing:'' // Transition animation easing. Not supported without a jQuery easing plugin
207+
animation: 'none', // Animation effect on navigation, none|fade|slideHorizontal|slideVertical|slideSwing|css(Animation CSS class also need to specify)
208+
speed: '400', // Animation speed. Not used if animation is 'css'
209+
easing: '', // Animation easing. Not supported without a jQuery easing plugin. Not used if animation is 'css'
210+
prefixCss: '', // Only used if animation is 'css'. Animation CSS prefix
211+
fwdShowCss: '', // Only used if animation is 'css'. Step show Animation CSS on forward direction
212+
fwdHideCss: '', // Only used if animation is 'css'. Step hide Animation CSS on forward direction
213+
bckShowCss: '', // Only used if animation is 'css'. Step show Animation CSS on backward direction
214+
bckHideCss: '', // Only used if animation is 'css'. Step hide Animation CSS on backward direction
182215
},
183216
autoProgress: { // Auto navigate tabs on interval
184217
enabled: false, // Enable/Disable Auto navigation
185218
interval: 3500, // Auto navigate Interval (used only if "autoProgress" is enabled)
186219
stopOnFocus: true, // Stop auto navigation on focus and resume on outfocus
187220
},
188-
keyboardSettings: {
221+
keyboard: {
189222
keyNavigation: true, // Enable/Disable keyboard navigation(left and right keys are used if enabled)
190-
keyLeft: [37], // Left key code
191-
keyRight: [39] // Right key code
192-
}
223+
keyLeft: [37, 38], // Left key code
224+
keyRight: [39, 40], // Right key code
225+
keyHome: [36], // Home key code
226+
keyEnd: [35] // End key code
227+
},
228+
style: { // CSS Class settings
229+
mainCss: 'st',
230+
navCss: 'nav',
231+
navLinkCss: 'nav-link',
232+
contentCss: 'tab-content',
233+
contentPanelCss: 'tab-pane',
234+
themePrefixCss: 'st-theme-',
235+
justifiedCss: 'st-justified',
236+
anchorDefaultCss: 'default',
237+
anchorActiveCss: 'active',
238+
loaderCss: 'st-loading'
239+
},
240+
getContent: null
193241
});
194242
```
195243

@@ -201,6 +249,8 @@ Contribute
201249
----
202250
If you like the project please support with your contribution.
203251

252+
[GitHub Sponsor](https://github.com/sponsors/techlab)
204253
[Donate on Paypal](https://www.paypal.me/dipuraj)
205254

206-
Thank you and Happy Coding!
255+
Happy Coding :heart:
256+

0 commit comments

Comments
 (0)