Skip to content

Commit

Permalink
Blueprintjs - Rename method 'create' to 'component'.
Browse files Browse the repository at this point in the history
  • Loading branch information
csavelief committed Aug 20, 2024
1 parent 1a43b78 commit cb720a5
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 41 deletions.
8 changes: 4 additions & 4 deletions dist/cjs/main.js

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

2 changes: 1 addition & 1 deletion dist/cjs/main.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/esm/main.js

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

2 changes: 1 addition & 1 deletion dist/esm/main.js.map

Large diffs are not rendered by default.

50 changes: 25 additions & 25 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
${nextRow}, 100
`;

const tbl = com.computablefacts.blueprintjs.Blueprintjs.create(document, {
const tbl = com.computablefacts.blueprintjs.Blueprintjs.component(document, {
type: 'Table',
container: 'table',
columns: ['NIDEAD', 'CAGCOM', 'NESCAL', 'NUEXPL', 'CSOCTE', 'ATYPEP', 'NBATIM', 'CAGEXP'],
Expand Down Expand Up @@ -198,7 +198,7 @@
select.el.items = itemz;
};

const select = com.computablefacts.blueprintjs.Blueprintjs.create(document, {
const select = com.computablefacts.blueprintjs.Blueprintjs.component(document, {
type: 'Select',
container: 'select-with-filter',
items: items,
Expand All @@ -215,7 +215,7 @@
root.style.width = '300px';
root.style.height = '50px';

const select = com.computablefacts.blueprintjs.Blueprintjs.create(document, {
const select = com.computablefacts.blueprintjs.Blueprintjs.component(document, {
type: 'Select',
container: 'select-without-filter',
filterable: false,
Expand All @@ -231,7 +231,7 @@
root.style.width = '300px';
root.style.height = '50px';

const slider = com.computablefacts.blueprintjs.Blueprintjs.create(document, {
const slider = com.computablefacts.blueprintjs.Blueprintjs.component(document, {
type: 'Slider',
container: 'slider',
min: 0,
Expand All @@ -248,7 +248,7 @@
root.style.width = '300px';
root.style.height = '50px';

const slider = com.computablefacts.blueprintjs.Blueprintjs.create(document, {
const slider = com.computablefacts.blueprintjs.Blueprintjs.component(document, {
type: 'RangeSlider',
container: 'range-slider',
min: 0,
Expand All @@ -263,7 +263,7 @@

function testDrawer() {

const drawer = com.computablefacts.blueprintjs.Blueprintjs.create(document, {
const drawer = com.computablefacts.blueprintjs.Blueprintjs.component(document, {
type: 'Drawer', container: 'drawer', on_open: el => {
const div = document.createElement('div');
div.style.textAlign = 'center';
Expand All @@ -281,7 +281,7 @@

function testTabs() {

const tabs = com.computablefacts.blueprintjs.Blueprintjs.create(document, {
const tabs = com.computablefacts.blueprintjs.Blueprintjs.component(document, {
type: 'Tabs', container: 'tabs', on_selection_change: (tabName, tabBody) => {
if (document.querySelector('#tab').firstChild) {
document.querySelector('#tab').firstChild.remove();
Expand Down Expand Up @@ -315,7 +315,7 @@
}

function testSpinner() {
const spinner = com.computablefacts.blueprintjs.Blueprintjs.create(document, {
const spinner = com.computablefacts.blueprintjs.Blueprintjs.component(document, {
type: 'Spinner', container: 'spinner'
});
}
Expand All @@ -325,7 +325,7 @@
const root = document.getElementById('switch');
root.style.width = '200px';

const switchz = com.computablefacts.blueprintjs.Blueprintjs.create(document, {
const switchz = com.computablefacts.blueprintjs.Blueprintjs.component(document, {
type: 'Switch',
container: 'switch',
checked: true,
Expand All @@ -339,7 +339,7 @@

function testToaster() {

const toaster = com.computablefacts.blueprintjs.Blueprintjs.create(document, {
const toaster = com.computablefacts.blueprintjs.Blueprintjs.component(document, {
type: 'Toaster', container: 'toaster',
});

Expand All @@ -358,19 +358,19 @@
body.style.padding = '10px';
body.innerText = 'Hello world!';

const card = com.computablefacts.blueprintjs.Blueprintjs.create(document, {
const card = com.computablefacts.blueprintjs.Blueprintjs.component(document, {
type: 'Card', container: 'card', body: body, interactive: true, on_click: () => console.log('Card clicked!'),
});
}

function testIcon() {
const icon = com.computablefacts.blueprintjs.Blueprintjs.create(document, {
const icon = com.computablefacts.blueprintjs.Blueprintjs.component(document, {
type: 'Icon', container: 'icon', icon: 'graph', intent: 'danger', on_click: () => console.log('Icon clicked!'),
});
}

function testCheckbox() {
const checkbox = com.computablefacts.blueprintjs.Blueprintjs.create(document, {
const checkbox = com.computablefacts.blueprintjs.Blueprintjs.component(document, {
type: 'Checkbox',
container: 'icon',
checked: false,
Expand All @@ -381,7 +381,7 @@
}

function testDate() {
const date = com.computablefacts.blueprintjs.Blueprintjs.create(document, {
const date = com.computablefacts.blueprintjs.Blueprintjs.component(document, {
type: 'Date',
container: 'date',
format: 'dd/MM/yyyy',
Expand All @@ -392,7 +392,7 @@
}

function testDatetime() {
const date = com.computablefacts.blueprintjs.Blueprintjs.create(document, {
const date = com.computablefacts.blueprintjs.Blueprintjs.component(document, {
type: 'Datetime',
container: 'datetime',
format: 'dd/MM/yyyy HH:mm',
Expand All @@ -407,7 +407,7 @@
const date = new Date();
date.setDate(new Date().getDate() + 3); // add three days to today

const daterange = com.computablefacts.blueprintjs.Blueprintjs.create(document, {
const daterange = com.computablefacts.blueprintjs.Blueprintjs.component(document, {
type: 'DateRange',
container: 'daterange',
date_min: new Date(),
Expand Down Expand Up @@ -484,7 +484,7 @@
return query;
}

const multiselect = com.computablefacts.blueprintjs.Blueprintjs.create(document, {
const multiselect = com.computablefacts.blueprintjs.Blueprintjs.component(document, {
type: 'MultiSelect',
container: 'multiselect',
item_create: createItem,
Expand All @@ -503,7 +503,7 @@

const items = ['A', 'B', 'C'];

const suggest = com.computablefacts.blueprintjs.Blueprintjs.create(document, {
const suggest = com.computablefacts.blueprintjs.Blueprintjs.component(document, {
type: 'Suggest',
container: 'suggest',
items: items,
Expand All @@ -517,7 +517,7 @@
const root = document.getElementById('file-input');
root.style.width = '500px';

const fileInput = com.computablefacts.blueprintjs.Blueprintjs.create(document, {
const fileInput = com.computablefacts.blueprintjs.Blueprintjs.component(document, {
type: 'FileInput',
container: 'file-input',
text: 'Sélectionner un fichier...',
Expand All @@ -527,7 +527,7 @@
}

function testRadioGroup() {
const radioGroup = com.computablefacts.blueprintjs.Blueprintjs.create(document, {
const radioGroup = com.computablefacts.blueprintjs.Blueprintjs.component(document, {
type: 'RadioGroup', container: 'radio-group', label: 'A Group of Radio Buttons :', inline: true, items: [{
label: 'Option A', value: 'a', disabled: false
}, {
Expand All @@ -543,7 +543,7 @@
const root = document.getElementById('text-input');
root.style.width = '300px';

const textInput = com.computablefacts.blueprintjs.Blueprintjs.create(document, {
const textInput = com.computablefacts.blueprintjs.Blueprintjs.component(document, {
type: 'TextInput',
container: 'text-input',
default_value: 'john.doe@example.com',
Expand All @@ -558,7 +558,7 @@
const root = document.getElementById('numeric-input');
root.style.width = '300px';

const numericInput = com.computablefacts.blueprintjs.Blueprintjs.create(document, {
const numericInput = com.computablefacts.blueprintjs.Blueprintjs.component(document, {
type: 'NumericInput',
container: 'numeric-input',
min: -5,
Expand All @@ -573,7 +573,7 @@
}

function testButtonLeftIcon() {
const button = com.computablefacts.blueprintjs.Blueprintjs.create(document, {
const button = com.computablefacts.blueprintjs.Blueprintjs.component(document, {
type: 'Button',
container: 'button-left-icon',
label: 'Click me!',
Expand All @@ -584,7 +584,7 @@
}

function testButtonRightIcon() {
const button = com.computablefacts.blueprintjs.Blueprintjs.create(document, {
const button = com.computablefacts.blueprintjs.Blueprintjs.component(document, {
type: 'Button',
container: 'button-right-icon',
label: 'Click me!',
Expand All @@ -595,7 +595,7 @@
}

function testButtonLoading() {
const button = com.computablefacts.blueprintjs.Blueprintjs.create(document, {
const button = com.computablefacts.blueprintjs.Blueprintjs.component(document, {
type: 'Button',
container: 'button-loading',
label: 'Click me!',
Expand Down
2 changes: 1 addition & 1 deletion dist/main.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/main.min.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/blueprintjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ blueprintjs.Blueprintjs = class extends widgets.Widget {
}

/**
* Create a Blueprintjs widget from a JSON object.
* Create a Blueprintjs component from a JSON object.
*
* @param template
* @param obj
* @param template the DOM element where the component will be added.
* @param obj the component properties.
*/
static create(template, obj) {
static component(template, obj) {

// {
// type: '<string>',
Expand Down

0 comments on commit cb720a5

Please sign in to comment.