lib
This commit is contained in:
parent
85b44d6236
commit
748f787f96
File diff suppressed because one or more lines are too long
|
@ -3376,8 +3376,7 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
|
||||||
}
|
}
|
||||||
if (Array.isArray(config.buttons)) for (let button of config.buttons) {
|
if (Array.isArray(config.buttons)) for (let button of config.buttons) {
|
||||||
let contents = typeof button.contents == 'string' ? button.contents : null;
|
let contents = typeof button.contents == 'string' ? button.contents : null;
|
||||||
let type = typeof button.type == 'string' ? button.type : null;
|
if (contents) {
|
||||||
if (contents || type) {
|
|
||||||
let color = typeof button.color == 'string' && LibraryComponents.Button.Colors[button.color.toUpperCase()];
|
let color = typeof button.color == 'string' && LibraryComponents.Button.Colors[button.color.toUpperCase()];
|
||||||
let look = typeof button.look == 'string' && LibraryComponents.Button.Looks[button.look.toUpperCase()];
|
let look = typeof button.look == 'string' && LibraryComponents.Button.Looks[button.look.toUpperCase()];
|
||||||
let click = typeof button.click == 'function' ? button.click : _ => {};
|
let click = typeof button.click == 'function' ? button.click : _ => {};
|
||||||
|
@ -3386,7 +3385,6 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
|
||||||
|
|
||||||
footerchildren.push(BDFDB.React.createElement(LibraryComponents.Button, {
|
footerchildren.push(BDFDB.React.createElement(LibraryComponents.Button, {
|
||||||
type: 'button',
|
type: 'button',
|
||||||
className: type || "",
|
|
||||||
look: look || (color ? LibraryComponents.Button.Looks.FILLED : LibraryComponents.Button.Looks.LINK),
|
look: look || (color ? LibraryComponents.Button.Looks.FILLED : LibraryComponents.Button.Looks.LINK),
|
||||||
color: color ? color : LibraryComponents.Button.Colors.PRIMARY,
|
color: color ? color : LibraryComponents.Button.Colors.PRIMARY,
|
||||||
onClick: _ => {
|
onClick: _ => {
|
||||||
|
@ -3396,9 +3394,7 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
|
||||||
closeModal();
|
closeModal();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
children: [
|
children: contents
|
||||||
contents || 'placeholder'
|
|
||||||
]
|
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3436,16 +3432,12 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
|
||||||
children: [
|
children: [
|
||||||
BDFDB.React.createElement(LibraryComponents.FormComponents.FormTitle, {
|
BDFDB.React.createElement(LibraryComponents.FormComponents.FormTitle, {
|
||||||
tag: LibraryComponents.FormComponents.FormTitle.Tags.H4,
|
tag: LibraryComponents.FormComponents.FormTitle.Tags.H4,
|
||||||
children: [
|
children: typeof config.header == 'string' ? config.header : ""
|
||||||
typeof config.header == 'string' ? config.header : ""
|
|
||||||
]
|
|
||||||
}),
|
}),
|
||||||
BDFDB.React.createElement(LibraryComponents.TextElement, {
|
BDFDB.React.createElement(LibraryComponents.TextElement, {
|
||||||
size: LibraryComponents.TextElement.Sizes.SMALL,
|
size: LibraryComponents.TextElement.Sizes.SMALL,
|
||||||
color: LibraryComponents.TextElement.Colors.PRIMARY,
|
color: LibraryComponents.TextElement.Colors.PRIMARY,
|
||||||
children: [
|
children: typeof config.subheader == 'string' ? config.subheader : (name || "")
|
||||||
typeof config.subheader == 'string' ? config.subheader : (name || "")
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
|
@ -3479,8 +3471,8 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
|
||||||
if (!BDFDB.isObject(plugin) || typeof text != 'string') return;
|
if (!BDFDB.isObject(plugin) || typeof text != 'string') return;
|
||||||
callback = typeof callback == 'function' ? callback : _ => {};
|
callback = typeof callback == 'function' ? callback : _ => {};
|
||||||
BDFDB.openModal(plugin, {text, header:'Are you sure?', selector:'BDFDB-confirmmodal', buttons:[
|
BDFDB.openModal(plugin, {text, header:'Are you sure?', selector:'BDFDB-confirmmodal', buttons:[
|
||||||
{type:"btn-ok", close:true, color:"RED", click:callback},
|
{contents: BDFDB.LanguageStrings.OKAY, close:true, color:"RED", click:callback},
|
||||||
{type:"btn-cancel", close:true}
|
{contents: BDFDB.LanguageStrings.CANCEL, close:true}
|
||||||
]});
|
]});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -5559,6 +5551,27 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
|
||||||
|
|
||||||
var LibraryComponents = {};
|
var LibraryComponents = {};
|
||||||
LibraryComponents.Button = BDFDB.WebModules.findByProperties('Colors', 'Hovers', 'Looks');
|
LibraryComponents.Button = BDFDB.WebModules.findByProperties('Colors', 'Hovers', 'Looks');
|
||||||
|
LibraryComponents.ButtonItem = class ButtonItem extends BDFDB.React.Component {
|
||||||
|
render() {
|
||||||
|
return BDFDB.React.createElement(LibraryComponents.Flex, {
|
||||||
|
align: LibraryComponents.Flex.Align.START,
|
||||||
|
children: [
|
||||||
|
BDFDB.React.createElement(LibraryComponents.Flex.Child, {
|
||||||
|
wrap: true,
|
||||||
|
children: BDFDB.React.createElement("label", {
|
||||||
|
className: BDFDB.disCN.titledefault,
|
||||||
|
children: this.props.label
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
BDFDB.React.createElement(LibraryComponents.Flex.Child, {
|
||||||
|
grow: 0,
|
||||||
|
shrink: 0,
|
||||||
|
children: BDFDB.React.createElement(LibraryComponents.Button, Object.assign({}, this.props))
|
||||||
|
})
|
||||||
|
]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
};
|
||||||
LibraryComponents.ColorSwatches = class ColorSwatches extends BDFDB.React.Component {
|
LibraryComponents.ColorSwatches = class ColorSwatches extends BDFDB.React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
Loading…
Reference in New Issue