Skip to content

Commit

Permalink
255656e3a9b77617ee18b47774da06f753491c18
Browse files Browse the repository at this point in the history
Sync to source repo @255656e3a9b77617ee18b47774da06f753491c18
  • Loading branch information
Allan Jardine committed Nov 4, 2022
1 parent 3b49813 commit 9289938
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 7 deletions.
2 changes: 1 addition & 1 deletion css/searchBuilder.foundation.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions datatables.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
"types/types.d.ts"
],
"src-repo": "http://github.com/DataTables/SearchBuilder",
"last-tag": "1.3.4"
}
"last-tag": "1.3.4",
"last-sync": "255656e3a9b77617ee18b47774da06f753491c18"
}
3 changes: 3 additions & 0 deletions js/searchBuilder.foundation.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions js/searchBuilder.foundation.min.mjs
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;
100 changes: 96 additions & 4 deletions types/types.d.ts
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>;
}

0 comments on commit 9289938

Please sign in to comment.