Browse Source

Add check-api tools

zhixin 6 years ago
parent
commit
cfd6d5db24

+ 2 - 0
.npmignore

@@ -0,0 +1,2 @@
+tools
+site

+ 7 - 5
site/docs/api/localizations.md

@@ -74,6 +74,8 @@ $('#table').bootstrapTable({
 
 
 - **Default:** `'No matching records found'`
 - **Default:** `'No matching records found'`
 
 
+## formatPaginationSwitch
+
 ## formatRefresh
 ## formatRefresh
 
 
 - **Parameter:** `undefined`
 - **Parameter:** `undefined`
@@ -92,14 +94,14 @@ $('#table').bootstrapTable({
 
 
 - **Default:** `'Columns'`
 - **Default:** `'Columns'`
 
 
-## formatAllRows
+## formatFullscreen
 
 
 - **Parameter:** `undefined`
 - **Parameter:** `undefined`
 
 
-- **Default:** `'All'`
-
-## formatFullscreen
+- **Default:** `'Fullscreen'`
+## formatAllRows
 
 
 - **Parameter:** `undefined`
 - **Parameter:** `undefined`
 
 
-- **Default:** `'Fullscreen'`
+- **Default:** `'All'`
+

+ 116 - 113
site/docs/api/methods.md

@@ -32,22 +32,6 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter)`.
 
 
   Return all selected rows contain search or filter, when no record selected, an empty array will return.
   Return all selected rows contain search or filter, when no record selected, an empty array will return.
 
 
-## showAllColumns
-
-- **Parameter:** `undefined`
-
-- **Detail:**
-
-  Show All the columns.
-
-## hideAllColumns
-
-- **Parameter:** `undefined`
-
-- **Detail:**
-
-  Hide All the columns.
-
 ## getData
 ## getData
 
 
 - **Parameter:** `useCurrentPage`
 - **Parameter:** `useCurrentPage`
@@ -56,14 +40,6 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter)`.
 
 
   Get the loaded data of table at the moment that this method is called. If you set the `useCurrentPage` to `true` the method will return the data in the current page.
   Get the loaded data of table at the moment that this method is called. If you set the `useCurrentPage` to `true` the method will return the data in the current page.
 
 
-## getRowByUniqueId
-
-- **Parameter:** `id`
-
-- **Detail:**
-
-  Get data from table, the row that contains the `id` passed by parameter.
-
 ## load
 ## load
 
 
 - **Parameter:** `data`
 - **Parameter:** `data`
@@ -107,14 +83,6 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter)`.
 
 
   Remove all data from table.
   Remove all data from table.
 
 
-## removeByUniqueId
-
-- **Parameter:** `id`
-
-- **Detail:**
-
-  Remove data from table, the row that contains the `id` passed by parameter.
-
 ## insertRow
 ## insertRow
 
 
 - **Parameter:** `params`
 - **Parameter:** `params`
@@ -137,6 +105,20 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter)`.
   * `index`: the row index to be updated.
   * `index`: the row index to be updated.
   * `row`: the new row data.
   * `row`: the new row data.
 
 
+## updateCell
+
+- **Parameter:** `params`
+
+- **Detail:**
+
+  Update one cell, the params contain following properties:
+
+  * `index`: the row index.
+  * `field`: the field name.
+  * `value`: the new field value.
+
+  To disable table re-initialization you can set `{reinit: false}`.
+
 ## updateByUniqueId
 ## updateByUniqueId
 
 
 - **Parameter:** `params`
 - **Parameter:** `params`
@@ -148,17 +130,21 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter)`.
   * `id`: a row id where the id should be the uniqueid field assigned to the table.
   * `id`: a row id where the id should be the uniqueid field assigned to the table.
   * `row`: the new row data.
   * `row`: the new row data.
 
 
-## updateCellById
+## removeByUniqueId
 
 
-- **Parameter:** `params`
+- **Parameter:** `id`
 
 
 - **Detail:**
 - **Detail:**
 
 
-  Update the cell specified by the id, each params contain following properties:
+  Remove data from table, the row that contains the `id` passed by parameter.
 
 
-  * `id`: row id where the id should be the uniqueid field assigned to the table.
-  * `field`: field name of the cell to be updated.
-  * `value`: new value of the cell.
+## getRowByUniqueId
+
+- **Parameter:** `id`
+
+- **Detail:**
+
+  Get data from table, the row that contains the `id` passed by parameter.
 
 
 ## showRow
 ## showRow
 
 
@@ -203,59 +189,7 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter)`.
   * `rowspan`: the rowspan count to be merged.
   * `rowspan`: the rowspan count to be merged.
   * `colspan`: the colspan count to be merged.
   * `colspan`: the colspan count to be merged.
 
 
-## updateCell
-
-- **Parameter:** `params`
-
-- **Detail:**
-
-  Update one cell, the params contain following properties:
-
-  * `index`: the row index.
-  * `field`: the field name.
-  * `value`: the new field value.
-
-  To disable table re-initialization you can set `{reinit: false}`.
-
-## refresh
-
-- **Parameter:** `params`
-
-- **Detail:**
-
-  Refresh the remote server data, you can set `{silent: true}` to refresh the data silently, and set `{url: newUrl, pageNumber: pageNumber, pageSize: pageSize}` to change the url (optional), page number (optional) and page size (optional). To supply query params specific to this request, set `{query: {foo: 'bar'}}`.
-
-## refreshOptions
-
-- **Parameter:** `options`
-
-- **Detail:**
-
-  Refresh the table `options`.
-
-## resetSearch
-
-- **Parameter:** `text`
-
-- **Detail:**
-
-  Set the search `text`.
-
-## showLoading
-
-- **Parameter:** `undefined`
-
-- **Detail:**
-
-  Show loading status.
-
-## hideLoading
-
-- **Parameter:** `undefined`
-
-- **Detail:**
-
-  Hide loading status.
+## refreshColumnTitle
 
 
 ## checkAll
 ## checkAll
 
 
@@ -319,6 +253,14 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter)`.
   * `field`: name of the field used to find records.
   * `field`: name of the field used to find records.
   * `values`: array of values for rows to uncheck.
   * `values`: array of values for rows to uncheck.
 
 
+## refresh
+
+- **Parameter:** `params`
+
+- **Detail:**
+
+  Refresh the remote server data, you can set `{silent: true}` to refresh the data silently, and set `{url: newUrl, pageNumber: pageNumber, pageSize: pageSize}` to change the url (optional), page number (optional) and page size (optional). To supply query params specific to this request, set `{query: {foo: 'bar'}}`.
+
 ## resetView
 ## resetView
 
 
 - **Parameter:** `params`
 - **Parameter:** `params`
@@ -345,13 +287,29 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter)`.
 
 
   Destroy the Bootstrap Table.
   Destroy the Bootstrap Table.
 
 
+## showLoading
+
+- **Parameter:** `undefined`
+
+- **Detail:**
+
+  Show loading status.
+
+## hideLoading
+
+- **Parameter:** `undefined`
+
+- **Detail:**
+
+  Hide loading status.
+
 ## showColumn
 ## showColumn
 
 
 - **Parameter:** `field`
 - **Parameter:** `field`
 
 
 - **Detail:**
 - **Detail:**
 
 
-  Show the specified `field` column.   
+  Show the specified `field` column.
   The parameter can be a string or a array of fields.
   The parameter can be a string or a array of fields.
 
 
 ## hideColumn
 ## hideColumn
@@ -360,7 +318,7 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter)`.
 
 
 - **Detail:**
 - **Detail:**
 
 
-  Hide the specified `field` column.   
+  Hide the specified `field` column.
   The parameter can be a string or a array of fields.
   The parameter can be a string or a array of fields.
 
 
 ## getHiddenColumns
 ## getHiddenColumns
@@ -379,50 +337,46 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter)`.
 
 
   Get visible columns.
   Get visible columns.
 
 
-## scrollTo
+## showAllColumns
 
 
-- **Parameter:** `value|object`
+- **Parameter:** `undefined`
 
 
 - **Detail:**
 - **Detail:**
 
 
-  - value
-    - Scroll to the number `value` position, the unit is `'px'`, set `'bottom'` means scroll to the bottom.
-  - object
-    -  Scroll to the unit (`px` or `rows (index starts by 0)`)   
-    Default: `{unit: 'px', value: 0}`
-    
-## getScrollPosition
+  Show All the columns.
+
+## hideAllColumns
 
 
 - **Parameter:** `undefined`
 - **Parameter:** `undefined`
 
 
 - **Detail:**
 - **Detail:**
 
 
-  Get the current scroll position, the unit is `'px'`.
+  Hide All the columns.
 
 
 ## filterBy
 ## filterBy
 
 
 - **Parameter:**
 - **Parameter:**
-    - `filter - An Object of filter`   
+    - `filter - An Object of filter`
     Default: `{}`
     Default: `{}`
-    - `options - An Object of options`   
+    - `options - An Object of options`
     Default:
     Default:
         ```
         ```
         {
         {
             'filterAlgorithm': 'and'
             'filterAlgorithm': 'and'
         }
         }
         ```
         ```
-       
+
 
 
 - **Detail:**
 - **Detail:**
-  
-  (Can use only in client-side) Filter data in table.   
+
+  (Can use only in client-side) Filter data in table.
   There are multiple ways to filter:
   There are multiple ways to filter:
   - Leave the options blank to use the `and` filter.
   - Leave the options blank to use the `and` filter.
   - Set the `filterAlgorithm` (see at parameter) to `or` to use the `or` filter.
   - Set the `filterAlgorithm` (see at parameter) to `or` to use the `or` filter.
   - Pass a function to the `filterAlgorithm` (see at parameter) to use a `custom` filter.
   - Pass a function to the `filterAlgorithm` (see at parameter) to use a `custom` filter.
-    
+
   #####Filter Algorithm
   #####Filter Algorithm
-  
+
   - And
   - And
     - Filter `{age: 10}` to show the data only age is equal to 10.  You can also filter with an array of values, as in: `{age: 10, hairColor: ['blue', 'red', 'green']}` to find data where age is equal to 10 and hairColor is either blue, red, or green.
     - Filter `{age: 10}` to show the data only age is equal to 10.  You can also filter with an array of values, as in: `{age: 10, hairColor: ['blue', 'red', 'green']}` to find data where age is equal to 10 and hairColor is either blue, red, or green.
   - Or
   - Or
@@ -435,6 +389,26 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter)`.
     - Return `true` to keep the row and return `false` to filter the row.
     - Return `true` to keep the row and return `false` to filter the row.
 
 
 
 
+## scrollTo
+
+- **Parameter:** `value|object`
+
+- **Detail:**
+
+  - value
+    - Scroll to the number `value` position, the unit is `'px'`, set `'bottom'` means scroll to the bottom.
+  - object
+    -  Scroll to the unit (`px` or `rows (index starts by 0)`)
+    Default: `{unit: 'px', value: 0}`
+
+## getScrollPosition
+
+- **Parameter:** `undefined`
+
+- **Detail:**
+
+  Get the current scroll position, the unit is `'px'`.
+
 ## selectPage
 ## selectPage
 
 
 - **Parameter:** `page`
 - **Parameter:** `page`
@@ -475,13 +449,21 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter)`.
 
 
   Toggle the card/table view.
   Toggle the card/table view.
 
 
-## toggleDetailView
+## refreshOptions
 
 
-- **Parameter:** `index`
+- **Parameter:** `options`
 
 
 - **Detail:**
 - **Detail:**
 
 
-  Toggle the row that has the `index` passed by parameter if the detail view option is set to `true`.
+  Refresh the table `options`.
+
+## resetSearch
+
+- **Parameter:** `text`
+
+- **Detail:**
+
+  Set the search `text`.
 
 
 ## expandRow
 ## expandRow
 
 
@@ -499,6 +481,14 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter)`.
 
 
   Collapse the row that has the `index` passed by parameter if the detail view option is set to `true`.
   Collapse the row that has the `index` passed by parameter if the detail view option is set to `true`.
 
 
+## toggleDetailView
+
+- **Parameter:** `index`
+
+- **Detail:**
+
+  Toggle the row that has the `index` passed by parameter if the detail view option is set to `true`.
+
 ## expandAllRows
 ## expandAllRows
 
 
 - **Detail:**
 - **Detail:**
@@ -510,3 +500,16 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter)`.
 - **Detail:**
 - **Detail:**
 
 
   Collapse all rows if the detail view option is set to `true`.
   Collapse all rows if the detail view option is set to `true`.
+## updateFormatText
+
+## updateCellById
+
+- **Parameter:** `params`
+
+- **Detail:**
+
+  Update the cell specified by the id, each params contain following properties:
+
+  * `id`: row id where the id should be the uniqueid field assigned to the table.
+  * `field`: field name of the cell to be updated.
+  * `value`: new value of the cell.

+ 36 - 30
site/docs/api/table-options.md

@@ -306,12 +306,12 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
 
 
 - **Default:** `undefined`
 - **Default:** `undefined`
 
 
+- **Example:** [From URL](https://examples.bootstrap-table.com/#welcomes/from-url.html)
+
 - **Error handling**
 - **Error handling**
 
 
   To get loading errors please use [onLoadError](https://bootstrap-table.com/docs/api/events/#onloaderror)
   To get loading errors please use [onLoadError](https://bootstrap-table.com/docs/api/events/#onloaderror)
 
 
-- **Example:** [From URL](https://examples.bootstrap-table.com/#welcomes/from-url.html)
-
 ## method
 ## method
 
 
 - **Attribute:** `data-method`
 - **Attribute:** `data-method`
@@ -460,6 +460,20 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
 
 
 - **Example:** [Total/Data Field](https://examples.bootstrap-table.com/#options/total-data-field.html)
 - **Example:** [Total/Data Field](https://examples.bootstrap-table.com/#options/total-data-field.html)
 
 
+## totalNotFilteredField
+
+- **Attribute:** `data-total-not-filtered-field`
+
+- **Type:** `string`
+
+- **Detail:**
+
+  The field from the json response which will used for showExtendedPagination.
+
+- **Default:** `totalNotFiltered`
+
+- **Example:** [Total Not Filtered Field](https://examples.bootstrap-table.com/#options/total-not-filtered-field.html)
+
 ## dataField
 ## dataField
 
 
 - **Attribute:** `data-data-field`
 - **Attribute:** `data-data-field`
@@ -517,20 +531,6 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
 
 
 - **Example:** [Show Extended Pagination](https://examples.bootstrap-table.com/#options/show-extended-pagination.html)
 - **Example:** [Show Extended Pagination](https://examples.bootstrap-table.com/#options/show-extended-pagination.html)
 
 
-## totalNotFilteredField
-
-- **Attribute:** `data-total-not-filtered-field`
-
-- **Type:** `string`
-
-- **Detail:**
-
-  The field from the json response which will used for showExtendedPagination.
-
-- **Default:** `totalNotFiltered`
-
-- **Example:** [Total Not Filtered Field](https://examples.bootstrap-table.com/#options/total-not-filtered-field.html)
-
 ## paginationLoop
 ## paginationLoop
 
 
 - **Attribute:** `data-pagination-loop`
 - **Attribute:** `data-pagination-loop`
@@ -577,6 +577,8 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
 
 
 - **Default:** `0`
 - **Default:** `0`
 
 
+## totalNotFiltered
+
 ## pageNumber
 ## pageNumber
 
 
 - **Attribute:** `data-page-number`
 - **Attribute:** `data-page-number`
@@ -1032,6 +1034,8 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
 
 
 - **Example:** [Table Escape](https://examples.bootstrap-table.com/#options/table-escape.html)
 - **Example:** [Table Escape](https://examples.bootstrap-table.com/#options/table-escape.html)
 
 
+## filterOptions
+
 ## idField
 ## idField
 
 
 - **Attribute:** `data-id-field`
 - **Attribute:** `data-id-field`
@@ -1206,6 +1210,20 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
 
 
 - **Example:** [Detail View Icon](https://examples.bootstrap-table.com/#options/detail-view-icon.html)
 - **Example:** [Detail View Icon](https://examples.bootstrap-table.com/#options/detail-view-icon.html)
 
 
+## detailViewByClick
+
+- **Attribute:** `data-detail-view-by-click`
+
+- **Type:** `Boolean`
+
+- **Detail:**
+
+  Set `true` to toggle the detail view, when a cell is clicked.
+
+- **Default:** `false`
+
+- **Example:** [Detail View Icon](https://examples.bootstrap-table.com/#options/detail-view-icon.html)
+
 ## detailFormatter
 ## detailFormatter
 
 
 - **Attribute:** `data-detail-formatter`
 - **Attribute:** `data-detail-formatter`
@@ -1234,20 +1252,6 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
 
 
 - **Example:** [Detail Filter](https://examples.bootstrap-table.com/#options/detail-filter.html)
 - **Example:** [Detail Filter](https://examples.bootstrap-table.com/#options/detail-filter.html)
 
 
-## detailViewByClick
-
-- **Attribute:** `data-detail-view-by-click`
-
-- **Type:** `Boolean`
-
-- **Detail:**
-
-  Set `true` to toggle the detail view, when a cell is clicked.
-
-- **Default:** `false`
-
-- **Example:** [Detail View Icon](https://examples.bootstrap-table.com/#options/detail-view-icon.html)
-
 ## toolbar
 ## toolbar
 
 
 - **Attribute:** `data-toolbar`
 - **Attribute:** `data-toolbar`
@@ -1304,6 +1308,8 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
 
 
 - **Example:** [Buttons Align](https://examples.bootstrap-table.com/#options/buttons-align.html)
 - **Example:** [Buttons Align](https://examples.bootstrap-table.com/#options/buttons-align.html)
 
 
+## buttonsPrefix
+
 ## buttonsClass
 ## buttonsClass
 
 
 - **Attribute:** `data-buttons-class`
 - **Attribute:** `data-buttons-class`

+ 3 - 34
src/bootstrap-table.js

@@ -2680,43 +2680,12 @@ BootstrapTable.VERSION = Constants.VERSION
 BootstrapTable.DEFAULTS = Constants.DEFAULTS
 BootstrapTable.DEFAULTS = Constants.DEFAULTS
 BootstrapTable.LOCALES = Constants.LOCALES
 BootstrapTable.LOCALES = Constants.LOCALES
 BootstrapTable.COLUMN_DEFAULTS = Constants.COLUMN_DEFAULTS
 BootstrapTable.COLUMN_DEFAULTS = Constants.COLUMN_DEFAULTS
+BootstrapTable.METHODS = Constants.METHODS
 BootstrapTable.EVENTS = Constants.EVENTS
 BootstrapTable.EVENTS = Constants.EVENTS
 
 
 // BOOTSTRAP TABLE PLUGIN DEFINITION
 // BOOTSTRAP TABLE PLUGIN DEFINITION
 // =======================
 // =======================
 
 
-const allowedMethods = [
-  'getOptions',
-  'getSelections', 'getAllSelections', 'getData',
-  'load', 'append', 'prepend', 'remove', 'removeAll',
-  'insertRow', 'updateRow', 'updateCell',
-  'updateByUniqueId', 'removeByUniqueId',
-  'getRowByUniqueId', 'showRow', 'hideRow', 'getHiddenRows',
-  'mergeCells', 'refreshColumnTitle',
-  'checkAll', 'uncheckAll', 'checkInvert',
-  'check', 'uncheck',
-  'checkBy', 'uncheckBy',
-  'refresh',
-  'resetView',
-  'resetWidth',
-  'destroy',
-  'showLoading', 'hideLoading',
-  'showColumn', 'hideColumn',
-  'getHiddenColumns', 'getVisibleColumns',
-  'showAllColumns', 'hideAllColumns',
-  'filterBy',
-  'scrollTo',
-  'getScrollPosition',
-  'selectPage', 'prevPage', 'nextPage',
-  'togglePagination',
-  'toggleView',
-  'refreshOptions',
-  'resetSearch',
-  'expandRow', 'collapseRow', 'toggleDetailView',
-  'expandAllRows', 'collapseAllRows',
-  'updateFormatText', 'updateCellById'
-]
-
 $.BootstrapTable = BootstrapTable
 $.BootstrapTable = BootstrapTable
 $.fn.bootstrapTable = function (option, ...args) {
 $.fn.bootstrapTable = function (option, ...args) {
   let value
   let value
@@ -2727,7 +2696,7 @@ $.fn.bootstrapTable = function (option, ...args) {
       typeof option === 'object' && option)
       typeof option === 'object' && option)
 
 
     if (typeof option === 'string') {
     if (typeof option === 'string') {
-      if (!allowedMethods.includes(option)) {
+      if (!Constants.METHODS.includes(option)) {
         throw new Error(`Unknown method: ${option}`)
         throw new Error(`Unknown method: ${option}`)
       }
       }
 
 
@@ -2757,7 +2726,7 @@ $.fn.bootstrapTable.defaults = BootstrapTable.DEFAULTS
 $.fn.bootstrapTable.columnDefaults = BootstrapTable.COLUMN_DEFAULTS
 $.fn.bootstrapTable.columnDefaults = BootstrapTable.COLUMN_DEFAULTS
 $.fn.bootstrapTable.events = BootstrapTable.EVENTS
 $.fn.bootstrapTable.events = BootstrapTable.EVENTS
 $.fn.bootstrapTable.locales = BootstrapTable.LOCALES
 $.fn.bootstrapTable.locales = BootstrapTable.LOCALES
-$.fn.bootstrapTable.methods = allowedMethods
+$.fn.bootstrapTable.methods = BootstrapTable.METHODS
 $.fn.bootstrapTable.utils = Utils
 $.fn.bootstrapTable.utils = Utils
 
 
 // BOOTSTRAP TABLE INIT
 // BOOTSTRAP TABLE INIT

+ 36 - 2
src/constants/index.js

@@ -369,12 +369,44 @@ const COLUMN_DEFAULTS = {
   events: undefined
   events: undefined
 }
 }
 
 
+const METHODS = [
+  'getOptions',
+  'getSelections', 'getAllSelections', 'getData',
+  'load', 'append', 'prepend', 'remove', 'removeAll',
+  'insertRow', 'updateRow', 'updateCell',
+  'updateByUniqueId', 'removeByUniqueId',
+  'getRowByUniqueId', 'showRow', 'hideRow', 'getHiddenRows',
+  'mergeCells', 'refreshColumnTitle',
+  'checkAll', 'uncheckAll', 'checkInvert',
+  'check', 'uncheck',
+  'checkBy', 'uncheckBy',
+  'refresh',
+  'resetView',
+  'resetWidth',
+  'destroy',
+  'showLoading', 'hideLoading',
+  'showColumn', 'hideColumn',
+  'getHiddenColumns', 'getVisibleColumns',
+  'showAllColumns', 'hideAllColumns',
+  'filterBy',
+  'scrollTo',
+  'getScrollPosition',
+  'selectPage', 'prevPage', 'nextPage',
+  'togglePagination',
+  'toggleView',
+  'refreshOptions',
+  'resetSearch',
+  'expandRow', 'collapseRow', 'toggleDetailView',
+  'expandAllRows', 'collapseAllRows',
+  'updateFormatText', 'updateCellById'
+]
+
 const EVENTS = {
 const EVENTS = {
   'all.bs.table': 'onAll',
   'all.bs.table': 'onAll',
-  'click-cell.bs.table': 'onClickCell',
-  'dbl-click-cell.bs.table': 'onDblClickCell',
   'click-row.bs.table': 'onClickRow',
   'click-row.bs.table': 'onClickRow',
   'dbl-click-row.bs.table': 'onDblClickRow',
   'dbl-click-row.bs.table': 'onDblClickRow',
+  'click-cell.bs.table': 'onClickCell',
+  'dbl-click-cell.bs.table': 'onDblClickCell',
   'sort.bs.table': 'onSort',
   'sort.bs.table': 'onSort',
   'check.bs.table': 'onCheck',
   'check.bs.table': 'onCheck',
   'uncheck.bs.table': 'onUncheck',
   'uncheck.bs.table': 'onUncheck',
@@ -413,6 +445,8 @@ export default {
 
 
   COLUMN_DEFAULTS,
   COLUMN_DEFAULTS,
 
 
+  METHODS,
+
   EVENTS,
   EVENTS,
 
 
   LOCALES: {
   LOCALES: {

+ 7 - 0
tools/README.md

@@ -0,0 +1,7 @@
+# Tools
+
+## check-api
+
+```
+node --experimental-modules --loader ./loader.mjs check-api.js
+```

+ 98 - 0
tools/check-api.js

@@ -0,0 +1,98 @@
+import fs from 'fs'
+import Constants from '../src/constants/index.js'
+
+class API {
+  constructor () {
+    this.init()
+    this.check()
+  }
+
+  check () {
+    const file = `../site/docs/api/${this.file}`
+    const md = {}
+    const content = fs.readFileSync(file).toString()
+    const lines = content.split('## ')
+    const outLines = lines.slice(0, 1)
+
+    console.log(`Checking file: ${file}`)
+
+    for (const item of lines.slice(1)) {
+      md[item.split('\n')[0]] = item
+    }
+
+    const mds = Object.keys(md)
+    for (const [i, key] of this.options.entries()) {
+      if (md[key]) {
+        outLines.push(md[key])
+        const details = md[key].split('\n\n- ')
+
+        for (let i = 0; i < this.attributes.length; i++) {
+          const name = this.attributes[i]
+          if (this.ignore && this.ignore[key] && this.ignore[key].includes(name)) {
+            continue
+          }
+          if (!details[i + 1] || details[i + 1].indexOf(`**${name}:**`) === -1) {
+            console.log(`${key} missing ${name}`)
+          }
+        }
+      } else {
+        outLines.push(key + '\n\n')
+      }
+    }
+
+    fs.writeFile(file, outLines.join('## '), () => {})
+  }
+}
+
+class TableOptions extends API {
+  init () {
+    this.file = 'table-options.md'
+    this.options = Object.keys(Constants.DEFAULTS).filter(it => {
+      return !/^(on|format)[A-Z]/.test(it)
+    })
+    this.options.unshift('-')
+    this.attributes = ['Attribute', 'Type', 'Detail', 'Default', 'Example']
+    this.ignore = {
+      totalRows: ['Example'],
+      totalNotFiltered: ['Example']
+    }
+  }
+}
+
+class ColumnOptions extends API {
+  init () {
+    this.file = 'column-options.md'
+    this.options = Object.keys(Constants.COLUMN_DEFAULTS)
+    this.attributes = ['Attribute', 'Type', 'Detail', 'Default']// , 'Example']
+  }
+}
+
+class Methods extends API {
+  init () {
+    this.file = 'methods.md'
+    this.options = Constants.METHODS
+    this.attributes = ['Parameter', 'Detail']// , 'Example']
+  }
+}
+
+class Events extends API {
+  init () {
+    this.file = 'events.md'
+    this.options = Object.values(Constants.EVENTS)
+    this.attributes = ['jQuery Event', 'Parameter', 'Detail']
+  }
+}
+
+class Localizations extends API {
+  init () {
+    this.file = 'localizations.md'
+    this.options = Object.keys(Constants.LOCALES.en)
+    this.attributes = ['Parameter', 'Default']
+  }
+}
+
+new TableOptions()
+new ColumnOptions()
+new Methods()
+new Events()
+new Localizations()

+ 34 - 0
tools/loader.mjs

@@ -0,0 +1,34 @@
+import path from 'path'
+import process from 'process'
+import Module from 'module'
+
+const builtins = Module.builtinModules
+const JS_EXTENSIONS = new Set(['.js', '.mjs'])
+
+const baseURL = new URL('file://')
+baseURL.pathname = `${process.cwd()}/`
+
+export function resolve (specifier, parentModuleURL = baseURL, defaultResolve) {
+  if (builtins.includes(specifier)) {
+    return {
+      url: specifier,
+      format: 'builtin'
+    }
+  }
+  if (/^\.{0,2}[/]/.test(specifier) !== true && !specifier.startsWith('file:')) {
+    // For node_modules support:
+    // return defaultResolve(specifier, parentModuleURL);
+    throw new Error(
+      `imports must begin with '/', './', or '../'; '${specifier}' does not`)
+  }
+  const resolved = new URL(specifier, parentModuleURL)
+  const ext = path.extname(resolved.pathname)
+  if (!JS_EXTENSIONS.has(ext)) {
+    throw new Error(
+      `Cannot load file with non-JavaScript file extension ${ext}.`)
+  }
+  return {
+    url: resolved.href,
+    format: 'esm'
+  }
+}