Skip to content

Commit 9301c72

Browse files
committed
v1.3.0
1 parent d31f4ea commit 9301c72

File tree

66 files changed

+810
-727
lines changed

Some content is hidden

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

66 files changed

+810
-727
lines changed

‎CHANGELOG.md‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
## [1.3.0] - [2025-01-03]
2+
3+
## Added
4+
5+
**Combo Box** : [Minimum search Length](https://flyonui.com/docs/advanced-forms/combo-box/#minimum-search-length)
6+
7+
**Datatables** : [Multiple Controls](https://flyonui.com/docs/third-party-plugins/datatables/#multiple-controls)
8+
9+
## Updated
10+
11+
- Preline v2.7.0
12+
- Updated divider component border-color from `base-content/10` to `base-content/20`
13+
- Updated heading color from `text-base-content/90` to `text-base-content`
14+
- You can now invoke overlay methods directly on the overlay itself without linking it to any button. The previous functionality is retained for backward compatibility.
15+
16+
## Fixes and Improvements
17+
18+
- Added: A new parameter `optionAllowEmptyOption` has been added for Advanced Select
19+
- Added: A new parameter `minSearchLength` has been added for Combo Box
20+
- Added: Enhanced support for multiple `prev` and `next` elements, each with its own event listeners, ensuring proper initialization and cleanup in the destroy method. Improved event listener management for `search` and `pagination` controls to prevent memory leaks and support dynamic elements.
21+
- Fixed: Removed `flyonui.mjs` as it was creating issues while using `import`
22+
- Fixed: Improve card style specificity
23+
- Fixed: Typo in select and textarea. [[PR #30]](https://github.com/themeselection/flyonui/pull/30)
24+
- Fixed: Improved label styles for better usability in form elements.
25+
- Fixed: `setValue` method functionality with tags in Advanced Select.
26+
127
## [1.2.0] - [2024-12-11]
228

329
## Added

‎flyonui.d.ts‎

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,15 @@ export declare class HSAccordion extends HSBasePlugin<IAccordionOptions> impleme
8787
hide(): boolean;
8888
update(): boolean;
8989
destroy(): void;
90-
static getInstance(target: HTMLElement | string, isInstance?: boolean): HTMLElement | ICollectionItem<HSAccordion>;
91-
static show(target: HTMLElement): void;
92-
static hide(target: HTMLElement): void;
90+
private static findInCollection;
9391
static autoInit(): void;
92+
static getInstance(target: HTMLElement | string, isInstance?: boolean): HTMLElement | ICollectionItem<HSAccordion>;
93+
static show(target: HSAccordion | HTMLElement | string): void;
94+
static hide(target: HSAccordion | HTMLElement | string): void;
9495
static onSelectableClick: (evt: Event, item: IAccordionTreeView, el: HTMLElement) => void;
9596
static treeView(): boolean;
9697
static toggleSelected(root: IAccordionTreeView, item: HTMLElement): void;
97-
static on(evt: string, target: HTMLElement, cb: Function): void;
98+
static on(evt: string, target: HSAccordion | HTMLElement | string, cb: Function): void;
9899
}
99100
export type TCarouselOptionsSlidesQty = {
100101
[key: string]: number;
@@ -246,16 +247,18 @@ export declare class HSCollapse extends HSBasePlugin<{}> implements ICollapse {
246247
show(): boolean;
247248
hide(): boolean;
248249
destroy(): void;
250+
private static findInCollection;
249251
static getInstance(target: HTMLElement, isInstance?: boolean): HTMLElement | ICollectionItem<HSCollapse>;
250252
static autoInit(): void;
251-
static show(target: HTMLElement): void;
252-
static hide(target: HTMLElement): void;
253-
static on(evt: string, target: HTMLElement, cb: Function): void;
253+
static show(target: HSCollapse | HTMLElement | string): void;
254+
static hide(target: HSCollapse | HTMLElement | string): void;
255+
static on(evt: string, target: HSCollapse | HTMLElement | string, cb: Function): void;
254256
}
255257
export interface IComboBoxOptions {
256258
gap?: number;
257259
viewport?: string | HTMLElement | null;
258260
preventVisibility?: boolean;
261+
minSearchLength?: number;
259262
apiUrl?: string | null;
260263
apiDataPart?: string | null;
261264
apiQuery?: string | null;
@@ -286,6 +289,7 @@ export declare class HSComboBox extends HSBasePlugin<IComboBoxOptions> implement
286289
gap: number;
287290
viewport: string | HTMLElement | null;
288291
preventVisibility: boolean;
292+
minSearchLength: number;
289293
apiUrl: string | null;
290294
apiDataPart: string | null;
291295
apiQuery: string | null;
@@ -321,6 +325,7 @@ export declare class HSComboBox extends HSBasePlugin<IComboBoxOptions> implement
321325
isOpened: boolean;
322326
isCurrent: boolean;
323327
private animationInProcess;
328+
private isSearchLengthExceeded;
324329
private onInputFocusListener;
325330
private onInputInputListener;
326331
private onToggleClickListener;
@@ -436,10 +441,11 @@ export declare class HSDropdown extends HSBasePlugin<{}, IHTMLElementPopper> imp
436441
close(isAnimated?: boolean): boolean;
437442
forceClearState(): void;
438443
destroy(): void;
444+
private static findInCollection;
439445
static getInstance(target: HTMLElement | string, isInstance?: boolean): ICollectionItem<HSDropdown> | IHTMLElementPopper;
440446
static autoInit(): void;
441-
static open(target: HTMLElement): void;
442-
static close(target: HTMLElement): void;
447+
static open(target: HSDropdown | HTMLElement | string): void;
448+
static close(target: HSDropdown | HTMLElement | string): void;
443449
static accessibility(evt: KeyboardEvent): void;
444450
static onEscape(evt: KeyboardEvent): void;
445451
static onEnter(evt: KeyboardEvent): boolean;
@@ -448,7 +454,7 @@ export declare class HSDropdown extends HSBasePlugin<{}, IHTMLElementPopper> imp
448454
static onStartEnd(isStart?: boolean): boolean;
449455
static onFirstLetter(code: string): boolean;
450456
static closeCurrentlyOpened(evtTarget?: HTMLElement | null, isAnimated?: boolean): void;
451-
static on(evt: string, target: HTMLElement, cb: Function): void;
457+
static on(evt: string, target: HSDropdown | HTMLElement | string, cb: Function): void;
452458
}
453459
export interface IInputNumberOptions {
454460
min?: number;
@@ -517,8 +523,7 @@ export declare class HSOverlay extends HSBasePlugin<{}> implements IOverlay {
517523
private readonly animationTarget;
518524
private openNextOverlay;
519525
private autoHide;
520-
private readonly overlayId;
521-
overlay: HTMLElement | null;
526+
private toggleButtons;
522527
initContainer: HTMLElement | null;
523528
isCloseWhenClickInside: boolean;
524529
isTabAccessibilityLimited: boolean;
@@ -538,24 +543,27 @@ export declare class HSOverlay extends HSBasePlugin<{}> implements IOverlay {
538543
private overlayClick;
539544
private backdropClick;
540545
private init;
546+
private buildToggleButtons;
541547
private hideAuto;
542548
private checkTimer;
543549
private buildBackdrop;
544550
private destroyBackdrop;
545551
private focusElement;
546552
private getScrollbarSize;
547-
open(): false | Promise<void>;
553+
private collectToggleParameters;
554+
open(): Promise<void>;
548555
close(forceClose?: boolean): Promise<unknown>;
549556
destroy(): void;
550-
static getInstance(target: HTMLElement, isInstance?: boolean): HTMLElement | ICollectionItem<HSOverlay>;
557+
private static findInCollection;
558+
static getInstance(target: HTMLElement | string, isInstance?: boolean): HTMLElement | ICollectionItem<HSOverlay>;
551559
static autoInit(): void;
552-
static open(target: HTMLElement): void;
553-
static close(target: HTMLElement): void;
560+
static open(target: HSOverlay | HTMLElement | string): void;
561+
static close(target: HSOverlay | HTMLElement | string): void;
554562
static setOpened(breakpoint: number, el: ICollectionItem<HSOverlay>): void;
555563
static accessibility(evt: KeyboardEvent): boolean;
556564
static onEscape(target: ICollectionItem<HSOverlay>): void;
557565
static onTab(target: ICollectionItem<HSOverlay>): boolean;
558-
static on(evt: string, target: HTMLElement, cb: Function): void;
566+
static on(evt: string, target: HSOverlay | HTMLElement | string, cb: Function): void;
559567
}
560568
export interface IPinInputOptions {
561569
availableCharsRE?: RegExp;
@@ -712,6 +720,7 @@ export interface ISelectOptions {
712720
searchNoResultTemplate?: string | null;
713721
searchNoResultText?: string | null;
714722
searchNoResultClasses?: string | null;
723+
optionAllowEmptyOption?: boolean;
715724
optionTemplate?: string;
716725
optionTag?: string;
717726
optionClasses?: string;
@@ -777,6 +786,7 @@ export declare class HSSelect extends HSBasePlugin<ISelectOptions> implements IS
777786
private readonly searchNoResultTemplate;
778787
private readonly searchNoResultText;
779788
private readonly searchNoResultClasses;
789+
private readonly optionAllowEmptyOption;
780790
private readonly optionTag;
781791
private readonly optionTemplate;
782792
private readonly optionClasses;
@@ -1167,11 +1177,12 @@ export declare class HSTooltip extends HSBasePlugin<{}> implements ITooltip {
11671177
show(): void;
11681178
hide(): void;
11691179
destroy(): void;
1180+
private static findInCollection;
11701181
static getInstance(target: HTMLElement | string, isInstance?: boolean): HTMLElement | ICollectionItem<HSTooltip>;
11711182
static autoInit(): void;
1172-
static show(target: HTMLElement): void;
1173-
static hide(target: HTMLElement): void;
1174-
static on(evt: string, target: HTMLElement, cb: Function): void;
1183+
static show(target: HSTooltip | HTMLElement | string): void;
1184+
static hide(target: HSTooltip | HTMLElement | string): void;
1185+
static on(evt: string, target: HSTooltip | HTMLElement | string, cb: Function): void;
11751186
}
11761187
export type ITreeViewOptionsControlBy = "checkbox" | "button";
11771188
export interface ITreeViewItem {
@@ -1219,9 +1230,10 @@ export declare class HSTreeView extends HSBasePlugin<ITreeViewOptions> implement
12191230
getSelectedItems(): ITreeViewItem[];
12201231
changeItemProp(id: string, prop: string, val: any): void;
12211232
destroy(): void;
1233+
private static findInCollection;
12221234
static getInstance(target: HTMLElement | string, isInstance?: boolean): HTMLElement | ICollectionItem<HSTreeView>;
12231235
static autoInit(): void;
1224-
static on(evt: string, target: HTMLElement, cb: Function): void;
1236+
static on(evt: string, target: HSTreeView | HTMLElement | string, cb: Function): void;
12251237
}
12261238
export interface IStaticMethods {
12271239
getClassProperty(el: HTMLElement, prop?: string, val?: string): string;

‎flyonui.js‎

Lines changed: 36 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎flyonui.mjs‎

Lines changed: 0 additions & 173 deletions
This file was deleted.

‎global.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import { ICollectionItem } from './src/js/interfaces'
44

55
import { IStaticMethods } from './src/js/static/interfaces'
66

7-
import type HSCopyMarkup from './src/js/plugins/copy-markup'
87
import type HSAccordion from './src/js/plugins/accordion'
98
import type HSCarousel from './src/js/plugins/carousel'
109
import type HSCollapse from './src/js/plugins/collapse'
1110
import type HSComboBox from './src/js/plugins/combobox'
11+
import type HSCopyMarkup from './src/js/plugins/copy-markup'
1212
import type HSDataTable from './src/js/plugins/datatable'
1313
import type HSDropdown from './src/js/plugins/dropdown'
1414
import type HSFileUpload from './src/js/plugins/file-upload'

‎package.json‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "flyonui",
3-
"version": "1.2.0",
3+
"version": "1.3.0",
44
"description": "The easiest, free and open-source Tailwind CSS component library with semantic classes.",
55
"author": "ThemeSelection",
66
"license": "MIT",
@@ -62,7 +62,6 @@
6262
"./global.d.ts",
6363
"./flyonui.d.ts",
6464
"./flyonui.js",
65-
"./flyonui.mjs",
6665
"./LICENSE",
6766
"./THIRD_PARTY_LICENSES",
6867
"./README.md"

‎plugin.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Plugin
3-
* @version: 2.6.0
3+
* @version: 2.7.0
44
* @author: Preline Labs Ltd.
55
* @requires: tailwindcss ^3.4.1
66
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)

‎plugin.ts‎

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Plugin
3-
* @version: 2.5.1
3+
* @version: 2.7.0
44
* @author: Preline Labs Ltd.
55
* @requires: tailwindcss ^3.4.1
66
* @license: Licensed under MIT and Preline UI Fair Use License (https://preline.co/docs/license.html)
@@ -37,21 +37,56 @@ export default plugin(function ({ addVariant, e }: PluginAPI) {
3737
modifySelectors(({ className }) => {
3838
return `.dropdown.open > .dropdown-menu > .${e(`dropdown-open${separator}${className}`)}`
3939
})
40+
},
41+
({ modifySelectors, separator }: IAddVariantOptions) => {
42+
modifySelectors(({ className }) => {
43+
return `.dropdown-menu.open.${e(`dropdown-open${separator}${className}`)}`
44+
})
4045
}
4146
] as TStringFunc[])
4247

43-
addVariant('removing', (({ modifySelectors, separator }: IAddVariantOptions) => {
48+
addVariant('dropdown-item-disabled', (({ modifySelectors, separator }: IAddVariantOptions) => {
4449
modifySelectors(({ className }) => {
45-
return `.removing.${e(`removing${separator}${className}`)}`
50+
return `.dropdown.open > .dropdown-menu .disabled.${e(`dropdown-item-disabled${separator}${className}`)}`
4651
})
4752
}) as TStringFunc)
4853

49-
addVariant('tooltip-shown', (({ modifySelectors, separator }: IAddVariantOptions) => {
54+
addVariant('dropdown-item-checked', [
55+
({ modifySelectors, separator }: IAddVariantOptions) => {
56+
modifySelectors(({ className }) => {
57+
return `.dropdown.open > .dropdown-menu [aria-checked="true"].${e(
58+
`dropdown-item-checked${separator}${className}`
59+
)}`
60+
})
61+
},
62+
({ modifySelectors, separator }: IAddVariantOptions) => {
63+
modifySelectors(({ className }) => {
64+
return `.dropdown.open > .dropdown-menu [aria-checked="true"] .${e(
65+
`dropdown-item-checked${separator}${className}`
66+
)}`
67+
})
68+
}
69+
] as TStringFunc[])
70+
71+
addVariant('removing', (({ modifySelectors, separator }: IAddVariantOptions) => {
5072
modifySelectors(({ className }) => {
51-
return `.tooltip.show .${e(`tooltip-shown${separator}${className}`)}`
73+
return `.removing.${e(`removing${separator}${className}`)}`
5274
})
5375
}) as TStringFunc)
5476

77+
addVariant('tooltip-shown', [
78+
({ modifySelectors, separator }: IAddVariantOptions) => {
79+
modifySelectors(({ className }) => {
80+
return `.tooltip.show .${e(`tooltip-shown${separator}${className}`)}`
81+
})
82+
},
83+
({ modifySelectors, separator }: IAddVariantOptions) => {
84+
modifySelectors(({ className }) => {
85+
return `.tooltip-content.show.${e(`tooltip-shown${separator}${className}`)}`
86+
})
87+
}
88+
] as TStringFunc[])
89+
5590
addVariant('accordion-item-active', [
5691
({ modifySelectors, separator }: IAddVariantOptions) => {
5792
modifySelectors(({ className }) => {
@@ -86,6 +121,11 @@ export default plugin(function ({ addVariant, e }: PluginAPI) {
86121
`accordion-item-active${separator}${className}`
87122
)}`
88123
})
124+
},
125+
({ modifySelectors, separator }: IAddVariantOptions) => {
126+
modifySelectors(({ className }) => {
127+
return `.accordion-item.active .accordion-force-active.${e(`accordion-item-active${separator}${className}`)}`
128+
})
89129
}
90130
] as TStringFunc[])
91131

‎src/components/styled/accordion.css‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.accordion-toggle {
2-
@apply text-base-content/90 w-full cursor-pointer px-5 py-4 text-lg font-medium disabled:pointer-events-none disabled:opacity-50;
2+
@apply text-base-content w-full cursor-pointer px-5 py-4 text-lg font-medium disabled:pointer-events-none disabled:opacity-50;
33
}
44

55
.accordion-shadow :where(.accordion-item) {

‎src/components/styled/advance-select.css‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.advance-select-toggle {
2-
@apply border-base-content/40 bg-base-100 text-base-content/90 rounded-btn hover:border-base-content/60 border text-base font-normal;
2+
@apply border-base-content/40 bg-base-100 text-base-content rounded-btn hover:border-base-content/60 border text-base font-normal;
33
@apply select-disabled:pointer-events-none select-disabled:border-0 select-disabled:bg-neutral/10 select-disabled:text-neutral/50 select-disabled:py-2;
44

55
&:focus,
@@ -16,15 +16,15 @@
1616
}
1717

1818
.advance-select-option {
19-
@apply hover:bg-neutral/10 focus:bg-neutral/10 text-base-content/90 rounded-btn text-base font-normal focus:outline-none;
19+
@apply hover:bg-neutral/10 focus:bg-neutral/10 text-base-content rounded-btn text-base font-normal focus:outline-none;
2020
&.active,
2121
&:active {
2222
@apply bg-primary/10 text-primary;
2323
}
2424
}
2525

2626
.advance-select-tag {
27-
@apply border-base-content/25 bg-base-100 text-base-content/90 rounded-box hover:border-base-content/60 border text-base font-normal;
27+
@apply border-base-content/25 bg-base-100 text-base-content rounded-box hover:border-base-content/60 border text-base font-normal;
2828
&:focus,
2929
&:focus-within {
3030
@apply ring-primary shadow-primary/22 border-primary shadow-sm ring-1;

0 commit comments

Comments
 (0)