From 8c919c20fa1afd91aeffc8cbdd1434f6a983bb32 Mon Sep 17 00:00:00 2001 From: Ali Elkhateeb Date: Thu, 29 Aug 2019 09:43:03 +0800 Subject: [PATCH] #447-Search box - Default Text Deleted examples/customize-search-placeholder Added searchPlaceholder to examples/customize-search instead --- .../customize-search-placeholder/index.js | 96 ------------------- examples/customize-search/index.js | 1 + webpack.config.js | 2 +- 3 files changed, 2 insertions(+), 97 deletions(-) delete mode 100644 examples/customize-search-placeholder/index.js diff --git a/examples/customize-search-placeholder/index.js b/examples/customize-search-placeholder/index.js deleted file mode 100644 index 5b267efd8..000000000 --- a/examples/customize-search-placeholder/index.js +++ /dev/null @@ -1,96 +0,0 @@ -import React, { Fragment } from 'react'; -import ReactDOM from 'react-dom'; -import MUIDataTable from '../../src/'; - -class Example extends React.Component { - state = { - searchText: 'Computer' - }; - - render() { - const columns = [ - { - name: 'Name', - options: { - filter: true, - display: 'excluded', - }, - }, - { - label: 'Modified Title Label', - name: 'Title', - options: { - filter: true, - }, - }, - { - name: 'Location', - options: { - filter: false, - }, - }, - { - name: 'Age', - options: { - filter: true, - }, - }, - { - name: 'Salary', - options: { - filter: true, - sort: false, - }, - }, - ]; - - const data = [ - ['Gabby George', 'Business Analyst', 'Minneapolis', 30, '$100,000'], - ['Aiden Lloyd', 'Business Consultant', 'Dallas', 55, '$200,000'], - ['Jaden Collins', 'Attorney', 'Santa Ana', 27, '$500,000'], - ['Franky Rees', 'Business Analyst', 'St. Petersburg', 22, '$50,000'], - ['Aaren Rose', 'Business Consultant', 'Toledo', 28, '$75,000'], - ['Blake Duncan', 'Business Management Analyst', 'San Diego', 65, '$94,000'], - ['Frankie Parry', 'Agency Legal Counsel', 'Jacksonville', 71, '$210,000'], - ['Lane Wilson', 'Commercial Specialist', 'Omaha', 19, '$65,000'], - ['Robin Duncan', 'Business Analyst', 'Los Angeles', 20, '$77,000'], - ['Mel Brooks', 'Business Consultant', 'Oklahoma City', 37, '$135,000'], - ['Harper White', 'Attorney', 'Pittsburgh', 52, '$420,000'], - ['Kris Humphrey', 'Agency Legal Counsel', 'Laredo', 30, '$150,000'], - ['Frankie Long', 'Industrial Analyst', 'Austin', 31, '$170,000'], - ['Brynn Robbins', 'Business Analyst', 'Norfolk', 22, '$90,000'], - ['Justice Mann', 'Business Consultant', 'Chicago', 24, '$133,000'], - ['Addison Navarro', 'Business Management Analyst', 'New York', 50, '$295,000'], - ['Jesse Welch', 'Agency Legal Counsel', 'Seattle', 28, '$200,000'], - ['Eli Mejia', 'Commercial Specialist', 'Long Beach', 65, '$400,000'], - ['Gene Leblanc', 'Industrial Analyst', 'Hartford', 34, '$110,000'], - ['Danny Leon', 'Computer Scientist', 'Newark', 60, '$220,000'], - ['Lane Lee', 'Corporate Counselor', 'Cincinnati', 52, '$180,000'], - ['Jesse Hall', 'Business Analyst', 'Baltimore', 44, '$99,000'], - ['Danni Hudson', 'Agency Legal Counsel', 'Tampa', 37, '$90,000'], - ['Terry Macdonald', 'Commercial Specialist', 'Miami', 39, '$140,000'], - ['Justice Mccarthy', 'Attorney', 'Tucson', 26, '$330,000'], - ['Silver Carey', 'Computer Scientist', 'Memphis', 47, '$250,000'], - ['Franky Miles', 'Industrial Analyst', 'Buffalo', 49, '$190,000'], - ['Glen Nixon', 'Corporate Counselor', 'Arlington', 44, '$80,000'], - ['Gabby Strickland', 'Business Process Consultant', 'Scottsdale', 26, '$45,000'], - ['Mason Ray', 'Computer Scientist', 'San Francisco', 39, '$142,000'], - ]; - - const options = { - filter: true, - filterType: 'dropdown', - responsive: 'stacked', - page: 1, - searchPlaceholder: 'This is a search placeholder', - }; - - return ( - - - - ); - } -} - -ReactDOM.render(, document.getElementById('app-root')); diff --git a/examples/customize-search/index.js b/examples/customize-search/index.js index 8ff17015e..a95835839 100644 --- a/examples/customize-search/index.js +++ b/examples/customize-search/index.js @@ -83,6 +83,7 @@ class Example extends React.Component { responsive: 'stacked', page: 1, searchText: this.state.searchText, + searchPlaceholder: 'Your Custom Search Placeholder', customSearch: (searchQuery, currentRow, columns) => { let isFound = false; currentRow.forEach(col => { diff --git a/webpack.config.js b/webpack.config.js index 34fb39515..e507b2ab7 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -3,7 +3,7 @@ const webpack = require('webpack'); module.exports = { entry: { - app: "./examples/customize-search-placeholder/index.js" + app: "./examples/customize-search/index.js" }, stats: "verbose", context: __dirname,