├── README.md
├── ace
├── ace.js
├── package.json
└── sample.html
├── apexcharts
├── apexchart.js
├── package.json
└── sample.html
├── ckeditor
├── ckeditor.js
├── package.json
└── sample.html
├── ckeditor5
├── ckeditor5.js
├── document_style.css
├── package.json
└── sample.html
├── codemirror
├── codemirror.js
├── package.json
└── sample.html
├── codemirrormerge
├── codemirror_merge.js
├── package.json
└── sample.html
├── d3
├── d3.js
├── data
│ └── flare.json
├── package.json
└── sample.html
├── dhtmlx_v5
├── dhtmlx.js
├── package.json
└── sample.html
├── dndlist
├── dndlist.js
├── package.json
└── sample.html
├── fabricjs
├── fabric.js
├── package.json
└── sample.html
├── formeditor
├── form_editor.css
├── form_editor.js
├── package.json
└── sample.html
├── fusion
├── data
│ └── data.js
├── fusion.js
├── package.json
├── readme.md
└── sample.html
├── gantt
├── gantt.js
├── package.json
└── sample.html
├── heremap
├── heremap.js
├── package.json
└── sample.html
├── highcharts
├── hcharts.js
├── package.json
└── sample.html
├── hipchat
├── hipchat.js
├── package.json
└── sample.html
├── justgage
├── justgage.js
├── package.json
└── sample.html
├── konva
├── konva.js
├── package.json
└── sample.html
├── monaco
├── monaco.js
├── package.json
└── sample.html
├── nicedit
├── nicedit.js
├── package.json
└── sample.html
├── openmap
├── openmap.js
├── package.json
└── sample.html
├── paper
├── package.json
├── paper.js
└── sample.html
├── plyr
├── package.json
├── plyr.js
└── sample.html
├── raphael
├── data
│ └── chart.json
├── package.json
├── raphael.js
└── sample.html
├── ribbon
├── images
│ ├── copy.gif
│ ├── cut.gif
│ ├── new.JPG
│ ├── open.gif
│ ├── paste.gif
│ ├── print.JPG
│ ├── redo.JPG
│ ├── save.gif
│ └── undo.JPG
├── package.json
├── ribbon.css
├── ribbon.js
├── sample.html
└── sample_tabs.html
├── richtext
├── package.json
├── richtext.js
└── sample.html
├── scheduler
├── package.json
├── sample.html
├── scheduler.js
└── scheduler_data.json
├── selectdialog
├── package.json
├── sample.html
├── selectdialog.css
└── selectdialog.js
├── sigma
├── package.json
├── sample.html
└── sigma.js
├── tinymce
├── package.json
├── sample.html
└── tinymce.js
├── tinymce5
├── package.json
├── sample.html
└── tinymce5.js
├── vis
├── package.json
├── sample.html
└── vis.js
└── yandexmap
├── package.json
├── sample.html
└── yandexmap.js
/README.md:
--------------------------------------------------------------------------------
1 | Webix Components
2 | ==================
3 |
4 | [](https://gitter.im/webix-hub/webix)
5 |
6 | Collection of custom components
7 |
8 | - [Double list](http://webix-hub.github.io/components/dndlist/sample.html) (dndlist)
9 | - [Select dialog](http://webix-hub.github.io/components/selectdialog/sample.html) (select-dialog)
10 | - [Form Editor tool](http://webix-hub.github.io/components/formeditor/sample.html) (form-editor)
11 | - [Ribbon Control](http://webix-hub.github.io/components/ribbon/sample_tabs.html) (ribbon)
12 |
13 | Third Party Integrations
14 | ========================
15 |
16 | Collection of third party integrations for the Webix UI
17 |
18 | Maps
19 | ------
20 | - [Open Street Maps](http://webix-hub.github.io/components/openmap/sample.html) (open-map)
21 | - [Yandex Maps](http://webix-hub.github.io/components/yandexmap/sample.html) (yandex-map)
22 | - [Here Maps](http://webix-hub.github.io/components/heremap/sample.html), also known as Nokia Maps (here-map)
23 |
24 |
25 | Editors
26 | ---------
27 | - [CKEditor 4](http://webix-hub.github.io/components/ckeditor/sample.html) (ckeditor)
28 | - [CKEditor 5](http://webix-hub.github.io/components/ckeditor5/sample.html) (ckeditor5)
29 | - [Tiny MCE 4](http://webix-hub.github.io/components/tinymce/sample.html) (tinymce-editor)
30 | - [Tiny MCE 5](http://webix-hub.github.io/components/tinymce5/sample.html) (tinymce5-editor)
31 | - [Nic Edit](http://webix-hub.github.io/components/nicedit/sample.html) (nic-editor)
32 | - [Code Mirror](http://webix-hub.github.io/components/codemirror/sample.html) (codemirror-editor)
33 | - [Monaco](http://webix-hub.github.io/components/monaco/sample.html) (monaco-editor)
34 | - [Ace](http://webix-hub.github.io/components/ace/sample.html) (ace-editor)
35 |
36 | Charts
37 | -------
38 | - [Raphael](http://webix-hub.github.io/components/raphael/sample.html) (raphael-chart)
39 | - [D3](http://webix-hub.github.io/components/d3/sample.html) (d3-chart)
40 | - [Sigma Chart](http://webix-hub.github.io/components/sigma/sample.html) (sigma-chart)
41 | - [Just Gage](http://webix-hub.github.io/components/justgage/sample.html) (justgage-chart)
42 | - [Fusion](http://webix-hub.github.io/components/fusion/sample.html) (fusion-chart)
43 | - [Vis](http://webix-hub.github.io/components/vis/sample.html) (vis-chart)
44 | - [Highcharts](http://webix-hub.github.io/components/highcharts/sample.html) (highchart)
45 | - [ApexCharts](http://webix-hub.github.io/components/apexcharts/sample.html) (apexchart)
46 |
47 | DHTMLX components
48 | -------------------
49 | - [DHTMLX Scheduler](http://webix-hub.github.io/components/scheduler/sample.html) (dhx-scheduler)
50 | - [DHTMLX Gantt](http://webix-hub.github.io/components/gantt/sample.html) (dhx-gantt)
51 | - [DHTMLX Richtext](http://webix-hub.github.io/components/richtext/sample.html) (dhx-richtext)
52 | - [Using Webix with DHTMLX components](http://webix-hub.github.io/components/dhtmlx_v5/sample.html)
53 |
54 | Other
55 | ------
56 | - [Hipchat](http://webix-hub.github.io/components/hipchat/sample.html) (hipchat)
57 | - [Konva](http://webix-hub.github.io/components/konva/sample.html) (konva)
58 | - [Paper](http://webix-hub.github.io/components/paper/sample.html) (paper)
59 | - [Fabric.js](http://webix-hub.github.io/components/fabricjs/sample.html) (fabric)
60 | - [Plyr](http://webix-hub.github.io/components/plyr/sample.html) (plyr-player)
61 |
62 | Thanks
63 | ------
64 | - [MLukman](https://github.com/MLukman): FusionCharts integration and dndlist component
65 | - [franck34](https://github.com/franck34): ApexCharts
66 | - [jbruwes](https://github.com/jbruwes): Fabric.js
--------------------------------------------------------------------------------
/ace/ace.js:
--------------------------------------------------------------------------------
1 | webix.protoUI({
2 | name:"ace-editor",
3 | defaults:{
4 | mode:"javascript",
5 | theme:"monokai"
6 | },
7 | $init:function(config){
8 | this.$view.innerHTML = "
";
9 | this._waitEditor = webix.promise.defer();
10 | this.$ready.push(this._render_cm_editor);
11 | },
12 | $setSize: function(w, h) {
13 | if (webix.ui.view.prototype.$setSize.call(this, w, h)) {
14 | if (this._editor) {
15 | this._editor.resize();
16 | }
17 | }
18 | },
19 | _render_cm_editor:function(){
20 | if (this.config.cdn === false){
21 | this._render_when_ready();
22 | return;
23 | };
24 |
25 | this._cdn = this.config.cdn || "https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.6";
26 |
27 | webix.require([
28 | this._cdn + "/ace.js"
29 | ]).then( webix.bind(this._render_when_ready, this) ).catch(function(e){
30 | console.log(e);
31 | });
32 | },
33 | _render_when_ready:function(){
34 |
35 | if (this._cdn){
36 | ace.config.set("basePath", this._cdn);
37 | ace.config.set("modePath", this._cdn);
38 | ace.config.set("workerPath", this._cdn);
39 | ace.config.set("themePath", this._cdn);
40 | };
41 |
42 | this._editor = ace.edit(this.$view.firstChild);
43 |
44 |
45 | this._editor.$blockScrolling = Infinity;
46 | this._editor.setOptions({
47 | fontFamily: "consolas,monospace",
48 | fontSize: "12pt"
49 | });
50 |
51 | if(this.config.theme)
52 | this._editor.setTheme("ace/theme/"+this.config.theme);
53 | if(this.config.mode)
54 | this._editor.getSession().setMode("ace/mode/"+this.config.mode);
55 | if(this.config.value)
56 | this.setValue(this.config.value);
57 | if (this._focus_await)
58 | this.focus();
59 |
60 | this._editor.navigateFileStart();
61 | this._waitEditor.resolve(this._editor);
62 | },
63 | setValue:function(value){
64 | if(!value && value !== 0)
65 | value = "";
66 |
67 | this.config.value = value;
68 | if(this._editor){
69 | this._editor.setValue(value);
70 | }
71 | },
72 | getValue:function(){
73 | return this._editor ? this._editor.getValue() : this.config.value;
74 | },
75 | focus:function(){
76 | this._focus_await = true;
77 | if (this._editor)
78 | this._editor.focus();
79 | },
80 | getEditor:function(waitEditor){
81 | return waitEditor?this._waitEditor:this._editor;
82 | }
83 | }, webix.ui.view);
--------------------------------------------------------------------------------
/ace/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@wbx/view-ace-editor",
3 | "version": "1.4.6",
4 | "description": "Ace editor as Webix view",
5 | "main": "ace.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "git+https://github.com/webix-hub/components.git"
12 | },
13 | "keywords": [
14 | "webix",
15 | "ace",
16 | "editor",
17 | "view"
18 | ],
19 | "author": "XB Software",
20 | "license": "MIT",
21 | "bugs": {
22 | "url": "https://github.com/webix-hub/components/issues"
23 | },
24 | "homepage": "https://github.com/webix-hub/components#readme"
25 | }
--------------------------------------------------------------------------------
/ace/sample.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
18 |
19 |
20 |
21 |
22 |
43 |
44 |
--------------------------------------------------------------------------------
/apexcharts/apexchart.js:
--------------------------------------------------------------------------------
1 | webix.protoUI({
2 | name:"apexchart",
3 | $init:function(){
4 | this.uid = "chart"+webix.uid();
5 | this.$view.innerHTML = "
";
6 |
7 | this._chart = null;
8 | this._waitChart = webix.promise.defer();
9 | this.$ready.push(this._request_sources);
10 | },
11 | _request_sources:function(){
12 | var c = this.config;
13 | if (c.cdn === false){
14 | webix.delay(this._render, this);
15 | return;
16 | };
17 |
18 | var cdn = c.cdn || "https://cdnjs.cloudflare.com/ajax/libs/apexcharts/3.8.6";
19 | var sources = [];
20 |
21 | sources.push(cdn+"/apexcharts.js");
22 |
23 | webix.require(sources)
24 | .then(webix.bind( this._render, this ))
25 | .catch(function(e){
26 | this._waitChart.reject(e);
27 | });
28 | },
29 | _render:function(){
30 | try {
31 | var config = this.config.settings;
32 | this._chart = new ApexCharts(this.$view.firstChild, config);
33 | this._chart.render();
34 | this._waitChart.resolve(this._chart);
35 | } catch(e) {
36 | console.log(e);
37 | this._waitChart.reject(e);
38 | }
39 | },
40 | getChart:function(wait){
41 | return wait ? this._waitChart : this._chart;
42 | }
43 | }, webix.ui.view);
44 |
--------------------------------------------------------------------------------
/apexcharts/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@wbx/view-apexchart",
3 | "version": "3.8.6",
4 | "description": "apexcharts as Webix component",
5 | "main": "apexchart.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "git+https://github.com/webix-hub/components.git"
12 | },
13 | "keywords": [
14 | "webix",
15 | "apexchart",
16 | "apexcharts",
17 | "chart",
18 | "view"
19 | ],
20 | "author": "Apexcharts",
21 | "license": "MIT",
22 | "bugs": {
23 | "url": "https://github.com/webix-hub/components/issues"
24 | },
25 | "homepage": "https://github.com/webix-hub/components#readme"
26 | }
27 |
--------------------------------------------------------------------------------
/apexcharts/sample.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Apexcharts in Webix
9 |
10 |
11 |
12 |
121 |
122 |
123 |
--------------------------------------------------------------------------------
/ckeditor/ckeditor.js:
--------------------------------------------------------------------------------
1 | webix.protoUI({
2 | name:"ckeditor",
3 | $init:function(config){
4 | this.$view.className += " webix_selectable";
5 | this._waitEditor = webix.promise.defer();
6 |
7 | var tid = config.textAreaID = "t"+webix.uid();
8 | this.$view.innerHTML = "";
9 |
10 | this.$ready.push(this._init_ckeditor_once);
11 | },
12 | defaults:{
13 | language:"en",
14 | toolbar: [
15 | [ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink' ],
16 | [ 'FontSize', 'TextColor', 'BGColor' ]
17 | ],
18 | editorConfig: {}
19 | },
20 | _init_ckeditor_once:function(){
21 | if (this.config.cdn === false){
22 | webix.delay( webix.bind( this._render_ckeditor, this) );
23 | return;
24 | };
25 |
26 | var cdn = this.config.cdn || "//cdn.ckeditor.com/4.13.0/standard/";
27 |
28 | window.CKEDITOR_BASEPATH = cdn;
29 | webix.require([cdn+"/ckeditor.js"])
30 | .then( webix.bind(this._render_ckeditor, this) )
31 | .catch(function(e){
32 | console.log(e);
33 | });
34 | },
35 | _render_ckeditor:function(){
36 | var initMethod = "replace";
37 | if(this.config.editorType === "inline") {
38 | CKEDITOR.disableAutoInline = true;
39 | initMethod = "inline";
40 | this.$view.style["overflow-y"] = "auto";
41 | };
42 |
43 | var barHeight = 70; // toolbar + bottombar, as initial sizes are set to the editable area
44 | var config = webix.extend({
45 | toolbar: this.config.toolbar,
46 | language: this.config.language,
47 | width:this.$width,
48 | height:this.$height-barHeight,
49 | resize_enabled:false
50 | }, this.config.editorConfig);
51 |
52 | this._editor = CKEDITOR[initMethod](this.config.textAreaID, config);
53 | this._waitEditor.resolve(this._editor);
54 | },
55 | _set_inner_size:function(x, y){
56 | if (!this._editor || !this._editor.container || !this.$width || this.config.editorType === "inline") return;
57 | this._editor.resize(x, y);
58 | },
59 | $setSize:function(x,y){
60 | if (webix.ui.view.prototype.$setSize.call(this, x, y)){
61 | this._set_inner_size(x,y);
62 | }
63 | },
64 | setValue:function(value){
65 | this.config.value = value;
66 |
67 | if (this._editor && this._editor.status === "ready")
68 | this._editor.setData(value);
69 | else webix.delay(function(){
70 | this.setValue(value);
71 | },this,[],100);
72 | },
73 | getValue:function(){
74 | return this._editor?this._editor.getData():this.config.value;
75 | },
76 | focus:function(){
77 | this._focus_await = true;
78 | if (this._editor)
79 | this._editor.focus();
80 | },
81 | getEditor:function(waitEditor){
82 | return waitEditor?this._waitEditor:this._editor;
83 | }
84 | }, webix.ui.view);
85 |
--------------------------------------------------------------------------------
/ckeditor/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@wbx/view-ckeditor",
3 | "version": "4.13.0",
4 | "description": "CKEditor as Webix view",
5 | "main": "ckeditor.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "git+https://github.com/webix-hub/components.git"
12 | },
13 | "keywords": [
14 | "webix",
15 | "ckeditor",
16 | "editor",
17 | "view"
18 | ],
19 | "author": "XB Software",
20 | "license": "MIT",
21 | "bugs": {
22 | "url": "https://github.com/webix-hub/components/issues"
23 | },
24 | "homepage": "https://github.com/webix-hub/components#readme"
25 | }
--------------------------------------------------------------------------------
/ckeditor/sample.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
14 |
15 |
16 |
17 |
18 |
19 |
38 |
39 |
--------------------------------------------------------------------------------
/ckeditor5/ckeditor5.js:
--------------------------------------------------------------------------------
1 | webix.protoUI({
2 | name:"ckeditor5",
3 | $init:function(config){
4 | var html = "
";
5 | var editor = "
";
6 | html += config.mode == "document" ? (""+editor+"
") : editor;
7 |
8 | this.$view.innerHTML = html;
9 | this._waitEditor = webix.promise.defer();
10 | this.$ready.push(this._require_ckeditor);
11 | },
12 | defaults:{
13 | config:{}
14 | },
15 | _require_ckeditor:function(){
16 | if (this.config.cdn === false){
17 | this._render_ckeditor();
18 | return;
19 | };
20 |
21 | // we use DecoupledEditor only
22 | var cdn = this.config.cdn || "https://cdn.ckeditor.com/ckeditor5/18.0.0/decoupled-document";
23 |
24 | webix.require([cdn+"/ckeditor.js"])
25 | .then( webix.bind(this._render_ckeditor, this) )
26 | .catch(function(e){
27 | console.log(e);
28 | });
29 | },
30 | _render_ckeditor:function(){
31 | var config = webix.extend({
32 | toolbar: {
33 | shouldNotGroupWhenFull: true
34 | }
35 | }, this.config.config, true);
36 |
37 | var editor = !window.DecoupledDocumentEditor ? DecoupledEditor : DecoupledDocumentEditor; //support Document Editor built with online builder
38 |
39 | editor.create(this.$view.querySelector(".webix_ck_editor"), config)
40 | .then(webix.bind(this._finalize_init, this))
41 | .catch(function(e){
42 | console.error(e);
43 | });
44 | },
45 | _finalize_init:function(editor){
46 | this._tools_container = this.$view.querySelector(".webix_ck_toolbar");
47 | this._tools_container.appendChild(editor.ui.view.toolbar.element);
48 | this._body_container = this.$view.childNodes[1];
49 |
50 | this._editor = editor;
51 | this._waitEditor.resolve(this._editor);
52 |
53 | // correct height on focus/blur
54 | editor.ui.focusTracker.on("change:isFocused", webix.bind(function(){
55 | this._set_height(this.$height);
56 | }, this));
57 |
58 | this._set_height(this.$height);
59 | this.setValue(this.config.value);
60 | },
61 | $setSize:function(x,y){
62 | if (webix.ui.view.prototype.$setSize.call(this, x, y) && this._body_container)
63 | this._set_height(y);
64 | },
65 | _set_height:function(y){
66 | var toolbar = this._tools_container,
67 | toolH = toolbar ? toolbar.clientHeight+2 : 2; // 2px for borders
68 | var height = (y-toolH)+"px";
69 | this._body_container.style.height = height;
70 |
71 | },
72 | getEditor:function(wait){
73 | return wait ? this._waitEditor : this._editor;
74 | },
75 | setValue:function(value){
76 | this.config.value = value;
77 | this.getEditor(true).then(function(editor){
78 | editor.setData(value);
79 | });
80 | },
81 | getValue:function(value){
82 | return this._editor ? this._editor.getData() : this.config.value;
83 | }
84 | }, webix.ui.view);
--------------------------------------------------------------------------------
/ckeditor5/document_style.css:
--------------------------------------------------------------------------------
1 | /* CSS is taken from the related CKEditor5 tutorial
2 | https://ckeditor.com/docs/ckeditor5/latest/framework/guides/deep-dive/ui/document-editor.html
3 | */
4 |
5 | .webix_ck_body {
6 | background: var(--ck-color-base-foreground);
7 | overflow-y: scroll;
8 | }
9 |
10 | .webix_ck_body>.ck-editor__editable {
11 | width: 15.8cm;
12 | min-height: 21cm;
13 |
14 | padding: 1cm 2cm 2cm 1cm;
15 |
16 | border: 1px hsl( 0,0%,82.7% ) solid;
17 | border-radius: var(--ck-border-radius);
18 | background: white;
19 |
20 | box-shadow: 0 0 5px hsla( 0,0%,0%,.1 );
21 |
22 | margin: 1cm auto;
23 | }
--------------------------------------------------------------------------------
/ckeditor5/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@wbx/view-ckeditor5",
3 | "version": "12.4.0",
4 | "description": "CKEditor5 as Webix view",
5 | "main": "ckeditor5.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "git+https://github.com/webix-hub/components.git"
12 | },
13 | "keywords": [
14 | "webix",
15 | "ckeditor",
16 | "ckeditor5",
17 | "text-editor",
18 | "editor"
19 | ],
20 | "author": "XB Software",
21 | "license": "MIT",
22 | "bugs": {
23 | "url": "https://github.com/webix-hub/components/issues"
24 | },
25 | "homepage": "https://github.com/webix-hub/components#readme"
26 | }
27 |
--------------------------------------------------------------------------------
/ckeditor5/sample.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
83 |
84 |
--------------------------------------------------------------------------------
/codemirror/codemirror.js:
--------------------------------------------------------------------------------
1 | webix.protoUI({
2 | name: "codemirror-editor",
3 | defaults: {
4 | mode: "javascript",
5 | lineNumbers: true,
6 | matchBrackets: true,
7 | theme: "default"
8 | },
9 | $init: function (config) {
10 | this.$view.innerHTML = "";
11 | this._textarea = this.$view.firstChild;
12 | this._waitEditor = webix.promise.defer();
13 | this.$ready.push(this._render_cm_editor);
14 | },
15 | complex_types: {
16 | php: {
17 | mode: ["xml", "javascript", "css", "htmlmixed", "clike"]
18 | },
19 | htmlembedded: {
20 | mode: ["xml", "javascript", "css", "htmlmixed"],
21 | addon: ["mode/multiplex"]
22 | },
23 | htmlmixed: {
24 | mode: ["xml", "javascript", "css"]
25 | },
26 | dockerfile: {
27 | addon: ["mode/simple"]
28 | }
29 | },
30 | _render_cm_editor: function () {
31 |
32 | if (this.config.cdn === false) {
33 | this._render_when_ready();
34 | return;
35 | };
36 |
37 | var cdn = this.config.cdn || "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.48.4/";
38 | // basic
39 | var sources = [
40 | cdn + "/codemirror.css",
41 | cdn + "/codemirror.js"
42 | ];
43 |
44 | // mode
45 | var mode = this.config.mode ? this.config.mode : "javascript";
46 | // complex modes based on others: htmlmixed, htmlembedded, php
47 | var extras = this.complex_types[mode];
48 | if (extras) {
49 | if (extras["mode"]) {
50 | extras["mode"].forEach(function (name) {
51 | var path = "/mode/" + name + "/" + name + ".js";
52 | sources.push(cdn + path);
53 | });
54 | };
55 | if (extras["addon"]) {
56 | extras["addon"].forEach(function (name) {
57 | var path = "/addon/" + name + ".js";
58 | sources.push(cdn + path);
59 | });
60 | };
61 | };
62 | sources.push(cdn + "/mode/" + mode + "/" + mode + ".js");
63 |
64 | // theme
65 | if (this.config.theme && this.config.theme !== "default") {
66 | sources.push(cdn + "/theme/" + this.config.theme + ".css")
67 | };
68 |
69 | // matchbrackets add-on
70 | if (this.config.matchBrackets) {
71 | sources.push(cdn + "/addon/edit/matchbrackets.js")
72 | };
73 |
74 | webix.require(sources)
75 | .then(webix.bind(this._render_when_ready, this))
76 | .catch(function (e) {
77 | console.log(e);
78 | });
79 | },
80 | _render_when_ready: function () {
81 | this._editor = CodeMirror.fromTextArea(this._textarea, {
82 | mode: this.config.mode,
83 | lineNumbers: this.config.lineNumbers,
84 | matchBrackets: this.config.matchBrackets,
85 | theme: this.config.theme
86 | });
87 |
88 | this._waitEditor.resolve(this._editor);
89 |
90 | this.setValue(this.config.value);
91 | if (this._focus_await)
92 | this.focus();
93 | },
94 | _set_inner_size: function () {
95 | if (!this._editor || !this.$width) return;
96 |
97 | this._updateScrollSize();
98 | this._editor.scrollTo(0, 0); //force repaint, mandatory for IE
99 | },
100 | _updateScrollSize: function () {
101 | var box = this._editor.getWrapperElement();
102 | var height = (this.$height || 0) + "px";
103 |
104 | box.style.height = height;
105 | box.style.width = (this.$width || 0) + "px";
106 |
107 | var scroll = this._editor.getScrollerElement();
108 | if (scroll.style.height != height) {
109 | scroll.style.height = height;
110 | this._editor.refresh();
111 | }
112 | },
113 | $setSize: function (x, y) {
114 | if (webix.ui.view.prototype.$setSize.call(this, x, y)) {
115 | this._set_inner_size();
116 | }
117 | },
118 | setValue: function (value) {
119 | if (!value && value !== 0)
120 | value = "";
121 |
122 | this.config.value = value;
123 | if (this._editor) {
124 | this._editor.setValue(value);
125 | //by default - clear editor's undo history when setting new value
126 | if (!this.config.preserveUndoHistory)
127 | this._editor.clearHistory();
128 | this._updateScrollSize();
129 | }
130 | },
131 | getValue: function () {
132 | return this._editor ? this._editor.getValue() : this.config.value;
133 | },
134 | focus: function () {
135 | this._focus_await = true;
136 | if (this._editor)
137 | this._editor.focus();
138 | },
139 | getEditor: function (waitEditor) {
140 | return waitEditor ? this._waitEditor : this._editor;
141 | },
142 | //undo, redo, etc
143 | undo: function () {
144 | this._editor.undo();
145 | },
146 | redo: function () {
147 | this._editor.redo();
148 | },
149 | undoLength: function () {
150 | return this._editor.historySize().undo;
151 | }
152 | }, webix.ui.view);
--------------------------------------------------------------------------------
/codemirror/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@wbx/view-codemirror-editor",
3 | "version": "5.48.4-e",
4 | "description": "CodeMirror as Webix view",
5 | "main": "codemirror.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "git+https://github.com/webix-hub/components.git"
12 | },
13 | "keywords": [
14 | "webix",
15 | "codemirror",
16 | "editor",
17 | "view"
18 | ],
19 | "author": "XB Software",
20 | "license": "MIT",
21 | "bugs": {
22 | "url": "https://github.com/webix-hub/components/issues"
23 | },
24 | "homepage": "https://github.com/webix-hub/components#readme"
25 | }
--------------------------------------------------------------------------------
/codemirror/sample.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
32 |
33 |
--------------------------------------------------------------------------------
/codemirrormerge/codemirror_merge.js:
--------------------------------------------------------------------------------
1 | webix.protoUI({
2 | name: "codemirror-merge-editor",
3 | defaults: {
4 | mode: "javascript",
5 | lineNumbers: true,
6 | matchBrackets: true,
7 | theme: "default",
8 | highlightDifferences: true,
9 | connect: "align",
10 | collapseIdentical: false,
11 | },
12 | $init: function (config) {
13 | this._waitEditor = webix.promise.defer();
14 | this.$ready.push(this._render_cm_editor);
15 | },
16 | complex_types: {
17 | php: {
18 | mode: ["xml", "javascript", "css", "htmlmixed", "clike"],
19 | },
20 | htmlembedded: {
21 | mode: ["xml", "javascript", "css", "htmlmixed"],
22 | addon: ["mode/multiplex"],
23 | },
24 | htmlmixed: {
25 | mode: ["xml", "javascript", "css"],
26 | },
27 | dockerfile: {
28 | addon: ["mode/simple"],
29 | },
30 | },
31 | _render_cm_editor: function () {
32 |
33 | if (this.config.cdn === false) {
34 | this._render_when_ready();
35 | return;
36 | }
37 |
38 | const cdn = this.config.cdn || "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.48.4/";
39 | // basic
40 | const sources = [
41 | cdn + "/codemirror.css",
42 | cdn + "/codemirror.js",
43 | // merge add-on
44 | // This addon depends on the google-diff-match-patch library to compute the diffs
45 | cdn + "/addon/merge/merge.css",
46 | cdn + "/addon/merge/merge.js",
47 | "https://cdnjs.cloudflare.com/ajax/libs/diff_match_patch/20121119/diff_match_patch.js",
48 | ];
49 |
50 | // mode
51 | const mode = this.config.mode ? this.config.mode : "javascript";
52 | // complex modes based on others: htmlmixed, htmlembedded, php
53 | const extras = this.complex_types[mode];
54 | if (extras) {
55 | if (extras["mode"]) {
56 | extras["mode"].forEach(function (name) {
57 | const path = "/mode/" + name + "/" + name + ".js";
58 | sources.push(cdn + path);
59 | });
60 | }
61 | if (extras["addon"]) {
62 | extras["addon"].forEach(function (name) {
63 | const path = "/addon/" + name + ".js";
64 | sources.push(cdn + path);
65 | });
66 | }
67 | }
68 | sources.push(cdn + "/mode/" + mode + "/" + mode + ".js");
69 |
70 | // theme
71 | if (this.config.theme && this.config.theme !== "default") {
72 | sources.push(cdn + "/theme/" + this.config.theme + ".css");
73 | }
74 |
75 | // matchbrackets add-on
76 | if (this.config.matchBrackets) {
77 | sources.push(cdn + "/addon/edit/matchbrackets.js");
78 | }
79 |
80 | webix.require(sources)
81 | .then(webix.bind(this._render_when_ready, this))
82 | .catch(function (e) {
83 | console.log(e);
84 | });
85 | },
86 | _render_when_ready: function () {
87 | this._editor = CodeMirror.MergeView(this.$view, {
88 | value: "",
89 | orig: "",
90 | origLeft: null, //2 panes by default
91 | lineNumbers: this.config.lineNumbers,
92 | mode: this.config.mode,
93 | highlightDifferences: this.config.highlightDifferences,
94 | connect: this.config.connect,
95 | collapseIdentical: this.config.collapseIdentical,
96 | });
97 |
98 | this._waitEditor.resolve(this._editor);
99 |
100 | this._editorLeft = this._editor.editor();
101 | this._editorRight = this._editor.rightOriginal();
102 |
103 | this.setValues(this.config.value);
104 | if (this._focus_await) this.focus();
105 | },
106 | setValues: function (value) {
107 | if (!value) {
108 | value = { editorLeft: "", editorRight: "" };
109 | }
110 | this.config.value = value;
111 | if (this._editor) {
112 | this._editorLeft.setValue(value.editorLeft || "");
113 | this._editorRight.setValue(value.editorRight || "");
114 | //by default - clear editor's undo history when setting new value
115 | if (!this.config.preserveUndoHistory) {
116 | this._editorLeft.clearHistory();
117 | this._editorRight.clearHistory();
118 | }
119 | }
120 | },
121 | getValues: function () {
122 | if (this._editor) {
123 | const data = {
124 | editorLeft: this._editorLeft.getValue(),
125 | editorRight: this._editorRight.getValue(),
126 | };
127 | return data;
128 | }
129 | return this.config.value;
130 | },
131 | focus: function () {
132 | this._focus_await = true;
133 | if (this._editor && this._editorLeft) this._editorLeft.focus();
134 | },
135 | getEditor: function (waitEditor) {
136 | return waitEditor ? this._waitEditor : this._editor;
137 | },
138 | }, webix.ui.view);
139 |
--------------------------------------------------------------------------------
/codemirrormerge/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@wbx/view-codemirror-merge-editor",
3 | "version": "5.48.4-e",
4 | "description": "CodeMirror with merge addon as Webix view",
5 | "main": "codemirror_merge.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "git+https://github.com/webix-hub/components.git"
12 | },
13 | "keywords": [
14 | "webix",
15 | "codemirror",
16 | "merge",
17 | "editor",
18 | "view"
19 | ],
20 | "author": "XB Software",
21 | "license": "MIT",
22 | "bugs": {
23 | "url": "https://github.com/webix-hub/components/issues"
24 | },
25 | "homepage": "https://github.com/webix-hub/components#readme"
26 | }
--------------------------------------------------------------------------------
/codemirrormerge/sample.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
16 |
17 |
18 |
35 |
36 |
--------------------------------------------------------------------------------
/d3/d3.js:
--------------------------------------------------------------------------------
1 | webix.protoUI({
2 | name:"d3-chart",
3 | defaults:{
4 | minified:true,
5 | version:"5"
6 | },
7 | $init:function(){
8 | this._waitContent = webix.promise.defer();
9 | this.attachEvent("onAfterLoad", function(){
10 | this._data_ready();
11 | });
12 |
13 | webix.delay(this._render_once, this);
14 | },
15 | _render_once:function(){
16 |
17 | if (this.config.cdn === false){
18 | this._finalize_init();
19 | return;
20 | };
21 |
22 | var cdn = this.config.cdn ? this.config.cdn : "https://d3js.org";
23 | // get the minified file by default
24 | var isMin = this.config.minified ? ".min" : "";
25 | var version = this.config.version.toString();
26 |
27 | var source = cdn+"/d3.v"+version+isMin+".js";
28 |
29 | webix.require([ source ])
30 | .then( webix.bind(this._finalize_init, this) )
31 | .catch(function(e){
32 | console.log(e);
33 | });
34 | },
35 | _finalize_init:function(){
36 | this._waitContent.resolve(d3.select(this.$view));
37 | if (this.config.init)
38 | this.config.init.call(this);
39 | },
40 | _data_ready:function(){
41 | webix.promise.all([
42 | this._waitContent,
43 | this.waitData
44 | ])
45 | .then( webix.bind(this.renderData, this) );
46 | },
47 | $setSize:function(x,y){
48 | if (webix.ui.view.prototype.$setSize.call(this,x,y)){
49 | this._data_ready();
50 | }
51 | },
52 | renderData:function(){
53 | if (this.config.ready){
54 | this.$view.innerHTML = "";
55 | this.config.ready.call(this, this.data);
56 | }
57 | },
58 | getSelection:function(wait){
59 | return wait ? this._waitContent : d3.select(this.$view)
60 | }
61 | }, webix.AtomDataLoader, webix.EventSystem, webix.ui.view );
--------------------------------------------------------------------------------
/d3/data/flare.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "flare",
3 | "children": [
4 | {
5 | "name": "analytics",
6 | "children": [
7 | {
8 | "name": "cluster",
9 | "children": [
10 | {"name": "AgglomerativeCluster", "size": 3938},
11 | {"name": "CommunityStructure", "size": 3812},
12 | {"name": "HierarchicalCluster", "size": 6714},
13 | {"name": "MergeEdge", "size": 743}
14 | ]
15 | },
16 | {
17 | "name": "graph",
18 | "children": [
19 | {"name": "BetweennessCentrality", "size": 3534},
20 | {"name": "LinkDistance", "size": 5731},
21 | {"name": "MaxFlowMinCut", "size": 7840},
22 | {"name": "ShortestPaths", "size": 5914},
23 | {"name": "SpanningTree", "size": 3416}
24 | ]
25 | },
26 | {
27 | "name": "optimization",
28 | "children": [
29 | {"name": "AspectRatioBanker", "size": 7074}
30 | ]
31 | }
32 | ]
33 | },
34 | {
35 | "name": "data",
36 | "children": [
37 | {
38 | "name": "converters",
39 | "children": [
40 | {"name": "Converters", "size": 721},
41 | {"name": "DelimitedTextConverter", "size": 4294},
42 | {"name": "GraphMLConverter", "size": 9800},
43 | {"name": "IDataConverter", "size": 1314},
44 | {"name": "JSONConverter", "size": 2220}
45 | ]
46 | },
47 | {"name": "DataField", "size": 1759},
48 | {"name": "DataSchema", "size": 2165},
49 | {"name": "DataSet", "size": 586},
50 | {"name": "DataSource", "size": 3331},
51 | {"name": "DataTable", "size": 772},
52 | {"name": "DataUtil", "size": 3322}
53 | ]
54 | },
55 | {
56 | "name": "display",
57 | "children": [
58 | {"name": "DirtySprite", "size": 8833},
59 | {"name": "LineSprite", "size": 1732},
60 | {"name": "RectSprite", "size": 3623},
61 | {"name": "TextSprite", "size": 10066}
62 | ]
63 | },
64 | {
65 | "name": "flex",
66 | "children": [
67 | {"name": "FlareVis", "size": 4116}
68 | ]
69 | },
70 | {
71 | "name": "physics",
72 | "children": [
73 | {"name": "DragForce", "size": 1082},
74 | {"name": "GravityForce", "size": 1336},
75 | {"name": "IForce", "size": 319},
76 | {"name": "NBodyForce", "size": 10498},
77 | {"name": "Particle", "size": 2822},
78 | {"name": "Simulation", "size": 9983},
79 | {"name": "Spring", "size": 2213},
80 | {"name": "SpringForce", "size": 1681}
81 | ]
82 | },
83 | {
84 | "name": "scale",
85 | "children": [
86 | {"name": "IScaleMap", "size": 2105},
87 | {"name": "LinearScale", "size": 1316},
88 | {"name": "LogScale", "size": 3151},
89 | {"name": "OrdinalScale", "size": 3770},
90 | {"name": "QuantileScale", "size": 2435},
91 | {"name": "QuantitativeScale", "size": 4839},
92 | {"name": "RootScale", "size": 1756},
93 | {"name": "Scale", "size": 4268},
94 | {"name": "ScaleType", "size": 1821},
95 | {"name": "TimeScale", "size": 5833}
96 | ]
97 | },
98 | {
99 | "name": "util",
100 | "children": [
101 | {"name": "Arrays", "size": 8258},
102 | {"name": "Colors", "size": 10001},
103 | {"name": "Dates", "size": 8217},
104 | {"name": "Displays", "size": 12555},
105 | {"name": "Filter", "size": 2324},
106 | {"name": "Geometry", "size": 10993},
107 | {
108 | "name": "math",
109 | "children": [
110 | {"name": "DenseMatrix", "size": 3165},
111 | {"name": "IMatrix", "size": 2815},
112 | {"name": "SparseMatrix", "size": 3366}
113 | ]
114 | },
115 | {"name": "Maths", "size": 17705},
116 | {"name": "Orientation", "size": 1486},
117 | {
118 | "name": "palette",
119 | "children": [
120 | {"name": "ColorPalette", "size": 6367},
121 | {"name": "Palette", "size": 1229},
122 | {"name": "ShapePalette", "size": 2059},
123 | {"name": "SizePalette", "size": 2291}
124 | ]
125 | },
126 | {"name": "Property", "size": 5559},
127 | {"name": "Shapes", "size": 19118},
128 | {"name": "Sort", "size": 6887},
129 | {"name": "Stats", "size": 6557},
130 | {"name": "Strings", "size": 22026}
131 | ]
132 | }
133 | ]
134 | }
--------------------------------------------------------------------------------
/d3/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@wbx/view-d3-chart",
3 | "version": "5.12.0",
4 | "description": "D3 chart as Webix view",
5 | "main": "d3.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "git+https://github.com/webix-hub/components.git"
12 | },
13 | "keywords": [
14 | "webix",
15 | "d3",
16 | "chart",
17 | "view"
18 | ],
19 | "author": "XB Software",
20 | "license": "MIT",
21 | "bugs": {
22 | "url": "https://github.com/webix-hub/components/issues"
23 | },
24 | "homepage": "https://github.com/webix-hub/components#readme"
25 | }
--------------------------------------------------------------------------------
/d3/sample.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | D3 Chart
8 |
9 |
10 |
11 |
71 |
72 |
73 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/dhtmlx_v5/dhtmlx.js:
--------------------------------------------------------------------------------
1 | if (typeof(window.dhtmlXCellObject) != "undefined") {
2 |
3 | dhtmlXCellObject.prototype.attachWebix = function(conf) {
4 |
5 | this.callEvent("_onBeforeContentAttach",["webix"]);
6 |
7 | var obj = document.createElement("DIV");
8 | var id = obj.id = "webix_" + webix.uid();
9 |
10 | obj.style.width = "100%";
11 | obj.style.height = "100%";
12 | obj.style.position = "relative";
13 | obj.style.overflow = "hidden";
14 |
15 | this._attachObject(obj);
16 |
17 | //mimic dhtmlxGrid API
18 | this.dataType = "grid";
19 | this.dataObj = new webix.ui(conf, id);
20 | this.dataObj.setSizes = function(){
21 | if (this.resize) this.resize();
22 | else this.render();
23 | };
24 |
25 |
26 | // fix layout cell for material
27 | if (this.conf.skin == "material" && typeof(window.dhtmlXLayoutCell) == "function" && this instanceof window.dhtmlXLayoutCell) {
28 | this.cell.childNodes[this.conf.idx.cont].style.overflow = "hidden";
29 | }
30 |
31 | obj = null;
32 |
33 |
34 | this.callEvent("_onContentAttach",[]);
35 |
36 | return this.dataObj;
37 | };
38 | }
--------------------------------------------------------------------------------
/dhtmlx_v5/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@wbx/view-dhxlayout-webix",
3 | "version": "5.1.0",
4 | "description": "Webix view in DHTMLX layout",
5 | "main": "dhtmlx.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "git+https://github.com/webix-hub/components.git"
12 | },
13 | "keywords": [
14 | "webix",
15 | "dhtmlx",
16 | "layout",
17 | "view"
18 | ],
19 | "author": "XB Software",
20 | "license": "MIT",
21 | "bugs": {
22 | "url": "https://github.com/webix-hub/components/issues"
23 | },
24 | "homepage": "https://github.com/webix-hub/components#readme"
25 | }
--------------------------------------------------------------------------------
/dhtmlx_v5/sample.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | DHTMLX 5 layouts
13 |
22 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/dndlist/dndlist.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Webix Component "dndlist"
3 | * Version 1.0
4 | * By Muhammad Lukman Nasaruddin (https://github.com/MLukman/webix-components)
5 | *
6 | * Requires Webix >= 3.1.1
7 | */
8 | webix.protoUI({
9 | name: "dndlist",
10 | defaults: {
11 | label: "",
12 | labelWidth: 80,
13 | height: 200,
14 | choicesHeader: "Choices",
15 | valueHeader: "Selected",
16 | choices: [],
17 | value: [],
18 | swap: false
19 | },
20 | $formElement: true,
21 | $init: function (cfg) {
22 | var dnd = this;
23 | config = webix.extend(this.defaults, cfg, true);
24 | var dtCommon = {view: "datatable", scrollX: false, drag: true};
25 | var value = [];
26 | for (var i = 0; i < config.value.length; i++) {
27 | value.push({value: config.value[i]});
28 | }
29 | var choicesDt = webix.extend(webix.copy(dtCommon), {
30 | id: 'choices',
31 | columns: [
32 | {
33 | id: "value",
34 | header: {
35 | text: config.choicesHeader,
36 | colspan: 2
37 | },
38 | fillspace: true
39 | },
40 | {
41 | id: "_actions",
42 | header: " ",
43 | width: 35,
44 | template: function (row) {
45 | return " ";
46 | }
47 | }
48 | ],
49 | onClick: {
50 | 'mdi-plus-box': function (e, i) {
51 | var row = this.getItem(i.row);
52 | dnd.addValue(row.value);
53 | }
54 | },
55 | on: {
56 | onItemDblClick: function (id) {
57 | dnd.addValue(this.getItem(id).value);
58 | }
59 | }
60 | }, true);
61 | var valueDt = webix.extend(webix.copy(dtCommon), {
62 | id: 'value',
63 | columns: [
64 | {
65 | id: "value",
66 | header: {
67 | text: config.valueHeader,
68 | colspan: 2
69 | },
70 | fillspace: true
71 | },
72 | {
73 | id: "_actions",
74 | header: " ",
75 | width: 35,
76 | template: function (row) {
77 | return " ";
78 | }
79 | }
80 | ],
81 | onClick: {
82 | 'mdi-minus-box': function (e, i) {
83 | var row = this.getItem(i.row);
84 | dnd.removeValue(row.value);
85 | }
86 | },
87 | on: {
88 | onItemDblClick: function (id) {
89 | dnd.removeValue(this.getItem(id).value);
90 | }
91 | }
92 | }, true);
93 |
94 | var spacer = {view: 'spacer', width: 10};
95 | var cols = {cols: (config.swap ? [valueDt, spacer, choicesDt] : [choicesDt, spacer, valueDt])};
96 | var label = (config.label != "" ?
97 | {id: 'label', view: 'label', label: config.label, width: config.labelWidth, align: config.labelAlign} :
98 | {width: 1, height: 1});
99 | if (config.labelPosition === 'top') {
100 | config.rows = [
101 | label,
102 | cols
103 | ];
104 | } else {
105 | label.css = {padding: "1px 7.5px 0px 0px"};
106 | config.cols = [
107 | {
108 | rows: [label]
109 | },
110 | cols
111 | ];
112 | }
113 |
114 | this.$ready.push(function () {
115 | this.setValue(config.value);
116 | this.setChoices(config.choices);
117 | });
118 | },
119 | setChoices: function (choices) {
120 | var choicesDt = this.$$('choices');
121 | choicesDt.clearAll();
122 | var values = this.getValue();
123 | for (var i = 0; i < choices.length; i++) {
124 | if (values.indexOf(choices[i]) === -1) {
125 | choicesDt.add({value: choices[i]});
126 | }
127 | }
128 | },
129 | setValue: function (values) {
130 | var existVal = this.getValue();
131 | for (var i = 0; i < existVal.length; i++) {
132 | if (values.indexOf(existVal[i]) === -1) {
133 | this.removeValue(existVal[i]);
134 | }
135 | }
136 | for (var j = 0; j < values.length; j++) {
137 | this.addValue(values[j]);
138 | }
139 | },
140 | getValue: function () {
141 | var value = [];
142 | var valueDt = this.$$('value');
143 | valueDt.eachRow(function (row) {
144 | value.push(valueDt.getItem(row).value);
145 | }, true);
146 | return value;
147 | },
148 | addValue: function (value) {
149 | var valueDt = this.$$('value');
150 | var choicesDt = this.$$('choices');
151 | var rowFinder = (function (row) {
152 | return row.value === value;
153 | });
154 | if (!valueDt.find(rowFinder, true)) {
155 | valueDt.add({value: value});
156 | }
157 | var choices = choicesDt.find(rowFinder);
158 | for (var i = 0; i < choices.length; i++) {
159 | choicesDt.remove(choices[i].id);
160 | }
161 | },
162 | removeValue: function (val) {
163 | var valueDt = this.$$('value');
164 | var choicesDt = this.$$('choices');
165 | var rowFinder = (function (row) {
166 | return row.value === val;
167 | });
168 | var value = valueDt.find(rowFinder);
169 | if (value.length === 0) {
170 | return;
171 | }
172 | for (var i = 0; i < value.length; i++) {
173 | valueDt.remove(value[i].id);
174 | }
175 | if (!choicesDt.find(rowFinder, true)) {
176 | choicesDt.add({value: val});
177 | }
178 | }
179 | }, webix.IdSpace, webix.ui.layout);
--------------------------------------------------------------------------------
/dndlist/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@wbx/view-dndlist",
3 | "version": "1.0.0",
4 | "description": "Webix Component: Drag & Drop List",
5 | "main": "dndlist.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "git+https://github.com/webix-hub/components.git"
12 | },
13 | "keywords": [
14 | "webix",
15 | "drag-n-drop",
16 | "dnd",
17 | "view"
18 | ],
19 | "author": "Muhammad Lukman",
20 | "license": "MIT",
21 | "bugs": {
22 | "url": "https://github.com/webix-hub/components/issues"
23 | },
24 | "homepage": "https://github.com/webix-hub/components#readme"
25 | }
--------------------------------------------------------------------------------
/dndlist/sample.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | Webix Component: Drag & Drop List (dndlist)
11 | By MLukman (https://github.com/MLukman)
12 |
13 | Parameters:
14 |
15 |
16 | choices
17 | Array of strings that user can choose from
18 |
19 | value
20 | Array of strings that user have chosen
21 |
22 | choicesHeader
23 | The title for the choices list
24 |
25 | valueHeader
26 | The title for the selected values
27 |
28 | swap
29 | If true, the choices will be on the right and chosen values will be on the left. By default is false, which is choices on the left and chosen values on the right.
30 |
31 |
32 | p/s: Standard parameters: name, height, label, labelWidth, labelAlign, labelPosition
33 |
34 | Functions:
35 |
36 |
37 | setChoices(array)
38 | Sets the choices
39 |
40 | addValue(string)
41 | Add a value to the chosen values list (even if the value is not in the choices list)
42 |
43 | removeValue(string)
44 | Remove a value from the chosen values list and add it to the choices list. The value must exist in the chosen list.
45 |
46 |
47 | p/s: Standard form control functions: getValue(), setValue(array)
48 |
49 |
93 |
94 |
95 |
--------------------------------------------------------------------------------
/fabricjs/fabric.js:
--------------------------------------------------------------------------------
1 | webix.protoUI({
2 | name: "fabric",
3 | $init: function() {
4 | this._waitCanvas = webix.promise.defer();
5 | this.$ready.push(this.render);
6 | },
7 | render: function() {
8 | if (this.config.cdn === false) {
9 | webix.delay(this._initCanvas, this);
10 | return;
11 | }
12 | var cdn = this.config.cdn ? this.config.cdn : "https://cdnjs.cloudflare.com/ajax/libs/fabric.js/3.4.0";
13 | webix.require([cdn + "/fabric.min.js"])
14 | .then(webix.bind(this._initCanvas, this))
15 | .catch(function(e) {
16 | console.log(e);
17 | });
18 | },
19 | _initCanvas: function() {
20 | var elm = webix.html.create("canvas");
21 | elm.id = this.config.canvas;
22 | this._canvas = this.$view.appendChild(elm);
23 | this._canvas = new fabric.Canvas(this._canvas, {
24 | renderOnAddRemove: false,
25 | selection: false,
26 | preserveObjectStacking: true
27 | });
28 | this._waitCanvas.resolve(this._canvas);
29 | if (this.config.ready) this.config.ready.call(this, this._canvas);
30 | },
31 | $setSize: function(x, y) {
32 | webix.ui.view.prototype.$setSize.call(this, x, y);
33 | this._waitCanvas.then(_ => {
34 | this._canvas.setWidth(x);
35 | this._canvas.setHeight(y);
36 | });
37 | },
38 | getCanvas: function(waitCanvas) {
39 | return waitCanvas ? this._waitCanvas : this._canvas;
40 | }
41 | }, webix.ui.view);
--------------------------------------------------------------------------------
/fabricjs/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@wbx/view-fabricjs",
3 | "version": "3.4.0",
4 | "description": "Fabric.js widget as Webix view",
5 | "main": "fabric.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "git+https://github.com/webix-hub/components.git"
12 | },
13 | "keywords": [
14 | "webix",
15 | "fabric",
16 | "canvas",
17 | "vector-graphics",
18 | "view"
19 | ],
20 | "author": "Wenig Web Werkstatt",
21 | "contributors": [
22 | "Jerry Bruwes (https://w--w--w.com)"
23 | ],
24 | "license": "MIT",
25 | "bugs": {
26 | "url": "https://github.com/webix-hub/components/issues"
27 | },
28 | "homepage": "https://github.com/webix-hub/components#readme"
29 | }
30 |
--------------------------------------------------------------------------------
/fabricjs/sample.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Fabric.js
7 |
8 |
9 |
10 |
45 |
46 |
--------------------------------------------------------------------------------
/formeditor/form_editor.css:
--------------------------------------------------------------------------------
1 | .webix_view.webix_form_editor .webix_editor_top{
2 | position:relative;
3 | }
4 | .webix_view.webix_form_editor .webix_icon.wxi-plus-circle {
5 | color:#475466;
6 | }
7 | .webix_view.webix_form_editor .webix_icon.wxi-trash:hover,
8 | .webix_view.webix_form_editor .webix_icon.wxi-plus-circle:hover {
9 | cursor:pointer;
10 | color:#3498db;
11 | }
12 | .webix_view.webix_form_editor .webix_dtable_subview{
13 | background-color:initial;
14 | padding-left:0px !important;
15 | }
16 | .webix_view.webix_form_editor .webix_dtable{
17 | border-width:1px !important;
18 | }
19 | .webix_view.webix_form_editor .webix_ss_footer .webix_hcell{
20 | background-color:initial;
21 | }
22 | .webix_view.webix_form_editor .webix_ss_footer .webix_icon{
23 | margin-left:2px;
24 | }
25 | .webix_view.webix_form_editor .group_header{
26 | border:none;
27 | font-weight:bold;
28 | }
29 | .group_header div{
30 | padding:10px;
31 | margin-left:10px;
32 | }
33 | .group_header:before{
34 | position: absolute;
35 | content: "\F001";
36 | margin-top: 9px;
37 | margin-left: -3px;
38 | font-family:"Webix Awesome Icons";
39 | font-size:20px;
40 | font-weight:400;
41 | }
42 | .webix_view.webix_form_editor .webix_form .webix_scroll_cont{
43 | border-width: 0 0 0 2px !important;
44 | border-left: 2px solid #D2E3EF;
45 | }
46 | .webix_view.webix_form_editor .webix_form.webix_editor_top > .webix_scroll_cont{
47 | border-width: 0px !important;
48 | }
49 | .webix_view.webix_form_editor .webix_el_text{
50 | margin-left: 14px !important;
51 | }
--------------------------------------------------------------------------------
/formeditor/form_editor.js:
--------------------------------------------------------------------------------
1 | webix.i18n.formEditor = {
2 | removeWarning: "You are going to remove this record. Are you sure?",
3 | ok:"OK",
4 | cancel:"Cancel"
5 | };
6 |
7 | webix.protoUI({
8 | name:"subform",
9 | defaults:{
10 | borderless:true,
11 | paddingX:20,
12 | paddingY:0
13 | },
14 | $init:function(){
15 | this.attachEvent("onChange", function(newv, oldv){
16 | if(!this.getParentView().getValue){
17 | var top = webix.$$(this.config.$editor);
18 | top.callEvent("onChange", [top.getValues()]);
19 | }
20 | });
21 | },
22 | $setSize:function(x, y){
23 | //need only left padding for non-top views
24 | if(!this.config.scroll)
25 | x += this.config.paddingX;
26 | webix.ui.form.prototype.$setSize.call(this, x, y);
27 | },
28 | clear:function(){
29 | webix.ui.form.prototype.clear.call(this);
30 | for(var i in this.elements)
31 | if(this.elements[i].clear)
32 | this.elements[i].clear();
33 | },
34 | getValue:function(){
35 | return this.getValues();
36 | },
37 | setValue:function(values){
38 | this.setValues(values);
39 | },
40 | }, webix.ui.form);
41 |
42 | webix.protoUI({
43 | name:"subgrid",
44 | defaults:{ paddingY:2 },
45 | $init:function(){
46 | this.$ready.push(function(){
47 | var grid = this.getChildViews()[0];
48 | grid.data.attachEvent("onStoreUpdated", webix.bind(function(id, obj, operation){
49 | if(operation && operation !== "paint")
50 | this.callEvent("onChange", [arguments, grid]);
51 | }, this));
52 | });
53 | },
54 | clear:function(){
55 | this.getChildViews()[0].clearAll();
56 | },
57 | getValue:function(){
58 | return this.getChildViews()[0].serialize();
59 | },
60 | setValue:function(values){
61 | this.getChildViews()[0].parse(values);
62 | }
63 | }, webix.ui.subform);
64 |
65 | webix.protoUI({
66 | name:"form-editor",
67 | _resizeMaster:function(view){
68 | webix.delay(function(){
69 | if(view.getMasterView){
70 | var master = view.getMasterView();
71 | if(master){
72 | master.data.each(function(obj){
73 | if(obj.$subopen) master.resizeSubView(obj.id);
74 | });
75 | this._resizeMaster(master);
76 | }
77 | }
78 | else if(view.getParentView())
79 | this._resizeMaster(view.getParentView());
80 | else
81 | this.callEvent("onMasterResize", []);
82 | }, this);
83 | },
84 | _resizeSub:function(){
85 | for(var i=0; i