Skip to content

Commit

Permalink
Sandbox (#114)
Browse files Browse the repository at this point in the history
* sandbox
* readme
  • Loading branch information
ukrbublik authored Nov 3, 2019
1 parent d5ab329 commit e1979b8
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 11 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# react-awesome-query-builder
[![npm](https://img.shields.io/npm/v/react-awesome-query-builder.svg)](https://www.npmjs.com/package/react-awesome-query-builder) [![github](https://img.shields.io/github/package-json/v/ukrbublik/react-awesome-query-builder.svg)](https://github.com/ukrbublik/react-awesome-query-builder/packages/48416) [![travis](https://travis-ci.org/ukrbublik/react-awesome-query-builder.svg?branch=master)](https://github.com/ukrbublik/react-awesome-query-builder)

[![Open in codesandbox.io](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/react-awesome-query-builder-demo-64wwx?fontsize=14&module=%2Fdemo%2Fconfig.js)

User-friendly React component to build queries.

Inspired by [jQuery QueryBuilder](http://querybuilder.js.org/)
Expand All @@ -10,8 +12,11 @@ Using awesome [Ant Design](https://ant.design/) for widgets
Master branch uses [antd v3](https://ant.design/docs/react/introduce).
For [antd v2](https://2x.ant.design/docs/react/introduce) (which has more compact style) see [branch antd-2](https://github.com/ukrbublik/react-awesome-query-builder/tree/antd-2) and versions `0.1.*`.

[Demo](https://ukrbublik.github.io/react-awesome-query-builder)


### Features
[![Screenshot](https://ukrbublik.github.io/react-awesome-query-builder/screenshot.png)](https://ukrbublik.github.io/react-awesome-query-builder)
- Highly configurable
- Fields can be of type:
- simple (string, number, bool, date/time/datetime, list)
Expand All @@ -28,12 +33,6 @@ For [antd v2](https://2x.ant.design/docs/react/introduce) (which has more compac
- Export to MongoDb or SQL


### Demo
[Live Demo](https://ukrbublik.github.io/react-awesome-query-builder)

![Screenshot](https://ukrbublik.github.io/react-awesome-query-builder/screenshot.png)


### Install
Install: `npm i react-awesome-query-builder`

Expand Down
15 changes: 15 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# react-awesome-query-builder-demo

Demo app

### Sandbox
[![Open in codesandbox.io](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/react-awesome-query-builder-demo-64wwx?fontsize=14&module=%2Fdemo%2Fconfig.js)

Or create own temaplte on [codesandbox.io](https://codesandbox.io/) by importing from `https://github.com/ukrbublik/react-awesome-query-builder/tree/master/examples`, open `demo/config.js` and play!


### Local
```sh
npm run examples
```
And open localhost:3001 in a browser.
4 changes: 0 additions & 4 deletions examples/demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ import {Query, Builder, Preview, Utils} from 'react-awesome-query-builder';
const {queryBuilderFormat, queryString, mongodbFormat} = Utils;
import config from './config';
var stringify = require('json-stringify-safe');
import '../../css/reset.scss';
import '../../css/styles.scss';
//import '../../css/compact_styles.scss';
import '../../css/denormalize.scss';
const Immutable = require('immutable');
const transit = require('transit-immutable-js');
import { fromJS } from 'immutable';
Expand Down
2 changes: 1 addition & 1 deletion examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<meta charset="utf-8">
<title>React Awesome Query Builder - Examples</title>
</head>
<body></body>
<body><div id="root"></div></body>
<script src="./bundle.js"></script>
</html>

5 changes: 5 additions & 0 deletions examples/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import ReactDOM from 'react-dom';
import Demo from './demo/demo.js';
import { hot } from 'react-hot-loader'

import '../css/reset.scss';
import '../css/styles.scss';
//import '../css/compact_styles.scss';
import '../css/denormalize.scss';

window.React = React;


Expand Down
32 changes: 32 additions & 0 deletions examples/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "react-awesome-query-builder-demo",
"version": "0.2.0",
"description": "Demo for react-awesome-query-builder",
"main": "sandbox.js",
"readme": "README.md",
"repository": {
"type": "git",
"url": "https://github.com/ukrbublik/react-awesome-query-builder.git"
},
"files": [
"demo/config.js",
"demo/demo.js",
"index.html",
"sandbox.js",
"README.md"
],
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"author": "Denis Oblogin <[email protected]> (https://github.com/ukrbublik)",
"homepage": "https://ukrbublik.github.io/react-awesome-query-builder/",
"dependencies": {
"react": "16.8.6",
"react-awesome-query-builder": "^0.2.53",
"react-dom": "16.8.6",
"react-scripts": "3.0.1"
}
}
20 changes: 20 additions & 0 deletions examples/sandbox.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from "react";
import ReactDOM from "react-dom";
import Demo from "./demo/demo.js";


import 'react-awesome-query-builder/css/reset.scss';
import 'react-awesome-query-builder/css/styles.scss';
import 'react-awesome-query-builder/css/denormalize.scss';

function App() {
return (
<div className="App">
<Demo />
</div>
);
}

const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);

0 comments on commit e1979b8

Please sign in to comment.