-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
255656e3a9b77617ee18b47774da06f753491c18
Sync to source repo @255656e3a9b77617ee18b47774da06f753491c18
- Loading branch information
Allan Jardine
committed
Nov 4, 2022
1 parent
3b49813
commit 9289938
Showing
5 changed files
with
106 additions
and
7 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
/*! Foundation ui integration for DataTables' SearchBuilder | ||
* © SpryMedia Ltd - datatables.net/license | ||
*/ | ||
import $ from"jquery";import DataTable from"datatables.net-zf";import DataTable from"datatables.net-searchbuilder";$.extend(!0,DataTable.SearchBuilder.classes,{clearAll:"button alert dtsb-clearAll"}),$.extend(!0,DataTable.Group.classes,{add:"button dtsb-add",clearGroup:"button dtsb-clearGroup",logic:"button dtsb-logic"}),$.extend(!0,DataTable.Criteria.classes,{condition:"form-control dtsb-condition",data:"form-control dtsb-data",delete:"button alert dtsb-delete",left:"button dtsb-left",right:"button dtsb-right",value:"form-control dtsb-value"});export default DataTable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,99 @@ | ||
// Type definitions for DataTables SearchBuilder | ||
// | ||
// Project: https://datatables.net/extensions/searchbuilder/, https://datatables.net | ||
|
||
// Dist-DataTables-SearchBuilder-Foundation integration with Foundation exports the DataTables API having | ||
// set default values to complete the ingeration. | ||
import Api from "datatables.net"; | ||
/// <reference types="jquery" /> | ||
|
||
export default Api; | ||
import DataTables, {Api} from 'datatables.net'; | ||
import {IDefaults, IDetails, II18n} from './searchBuilder'; | ||
|
||
export default DataTables; | ||
|
||
type DeepPartial<T> = T extends object ? { | ||
[P in keyof T]?: DeepPartial<T[P]>; | ||
} : T; | ||
|
||
|
||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | ||
* DataTables' types integration | ||
*/ | ||
declare module 'datatables.net' { | ||
interface Config { | ||
/** | ||
* SearchBuilder extension options | ||
*/ | ||
searchBuilder?: boolean | string[] | ConfigSearchBuilder | ConfigSearchBuilder[]; | ||
} | ||
|
||
interface ConfigLanguage { | ||
/** | ||
* SearchBuilder language options | ||
*/ | ||
searchBuilder?: ConfigSearchBuilderLanguage; | ||
} | ||
|
||
interface Api<T> { | ||
/** | ||
* SearchBuilder methods container | ||
* | ||
* @returns Api for chaining with the additional SearchBuilder methods | ||
*/ | ||
searchBuilder: ApiSearchBuilder<T>; | ||
} | ||
|
||
interface ApiStatic { | ||
/** | ||
* SearchBuilder class | ||
*/ | ||
SearchBuilder: { | ||
/** | ||
* Create a new SearchBuilder instance for the target DataTable | ||
*/ | ||
new (dt: Api<any>, settings: string[] | ConfigSearchBuilder | ConfigSearchBuilder[]); | ||
|
||
/** | ||
* SearchBuilder version | ||
*/ | ||
version: string; | ||
|
||
/** | ||
* Default configuration values | ||
*/ | ||
defaults: ConfigSearchBuilder; | ||
} | ||
} | ||
} | ||
|
||
|
||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | ||
* Options | ||
*/ | ||
|
||
interface ConfigSearchBuilder extends Partial<IDefaults> {} | ||
|
||
interface ConfigSearchBuilderLanguage extends DeepPartial<II18n> {} | ||
|
||
|
||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | ||
* API | ||
*/ | ||
interface ApiSearchBuilder<T> extends Api<T> { | ||
/** | ||
* Returns the node of the SearchBuilder Container | ||
*/ | ||
container(): JQuery<HTMLElement>; | ||
|
||
/** | ||
* Gets the details of the current SearchBuilder setup | ||
*/ | ||
getDetails(): IDetails; | ||
|
||
/** | ||
* Rebuild the search to a given state. | ||
* | ||
* @param state Object of the same structure that is returned from searchBuilder.getDetails(). | ||
* This contains all of the details needed to rebuild the state. | ||
* @returns self for chaining | ||
*/ | ||
rebuild(state: IDetails): Api<T>; | ||
} |