kevinchappell on wrapper-plugin
refactor: fix typo (compare)
kevinchappell on wrapper-plugin
merge master -- keep js folder … Move build to ESNext, drop babe… lint:fix and 48 more (compare)
dependabot[bot] on npm_and_yarn
chore(deps-dev): bump semantic-… (compare)
Hello, i got a really bad problem.
I created a multi tabbed builder, i added 2 custom fields based on text type.
When i create a new tab and go back to the prévious one i can't add my custom fields anymore, i got this message : " Please ensure you have registered it, and imported it correctly." .
So my question is : how to register them globally but without creating plugin, just in my js file associated with my HTML ?
hi i was added cutrom attributes visibleIF, how can i render forms from json
const options = {
formData: '[{"type":"smartRadioGroup","label":"SmartTest5","name":"smartRadioGroup-1638175329310","registries":"134"}]'
};
var wrap = $("#slownik2_wrapper");
const formRender = wrap.formRender(options);
ERROR: Uncaught Error: Invalid control type. (Type: smartRadioGroup, Subtype: undefined). Please ensure you have registered it, and imported it correctly.
Hello,
I'm creating SAAS and I would like to use this plugin in it.
However, I'm wondering if it's possible to customize how the fields are displaying, for example to have "required" on first screen and not to show it when you click "edit"
Check the screenshot below so you can know what I'm talking about, I need something like this:
https://i.ibb.co/t8Lrnv3/b543222.png
Thanks
// configure the class for runtime loading
if (!window.fbControls) window.fbControls = []
window.fbControls.push(function(controlClass) {
/**
* data range class
*/
class controlDataRange extends controlClass {
/**
* Class configuration - return the icons & label related to this control
* @returndefinition object
*/
static get definition() {
return {
i18n: {
default: 'Data Range',
},
}
}
/**
* build a text DOM element, supporting other jquery text form-control's
* @return {Object} DOM Element to be injected into the form.
*/
build() {
return this.markup('input', null, {type:"range", min:1, max:10, steps:1, value:0})
}
onRender() {
var valueBubble = '<output class="rangeslider__value-bubble" />';
function updateValueBubble(pos, value, context) {
pos = pos || context.position;
value = value || context.value;
var $valueBubble = $('.rangeslider__value-bubble', context.$range);
var tempPosition = pos + context.grabPos;
var position = (tempPosition <= context.handleDimension) ? context.handleDimension : (tempPosition >= context.maxHandlePos) ? context.maxHandlePos : tempPosition;
if ($valueBubble.length) {
$valueBubble[0].style.left = Math.ceil(position) + 'px';
$valueBubble[0].innerHTML = value;
}
}
$('input[type="range"]').rangeslider({
polyfill: false,
onInit: function() {
this.$range.append($(valueBubble));
updateValueBubble(null, null, this);
},
onSlide: function(pos, value) {
updateValueBubble(pos, value, this);
}
});
}
}
// register this control for the following types & text subtypes
controlClass.register('DataRange', controlDataRange)
return controlDataRange
})
So just to follow up on @bhawana1994 's issue here...when you paste the double quotes into the Label attribute field and save it. On the designer it saves fine until you try to render. The pasted double quotes munge up the formBuilder JSON and it can't render correctly.
So, for some reason, when we replace the input DIV with a standard input type=text, pasting double quotes no longer causes an issue and the double quotes are escaped correctly by formBuilder.
These edits are in the form-builder.js at appx line 900...
if (attribute === 'label' && !opts.disableHTMLLabels) {
//inputConfig.contenteditable = true // replace label div with input by CA
//attributefield += m('div', attrVal, inputConfig).outerHTML
inputConfig.value = attrVal
inputConfig.type = 'text'
attributefield += <input ${attrString(inputConfig)}>
} else {
inputConfig.value = attrVal
inputConfig.type = 'text'
attributefield += <input ${attrString(inputConfig)}>
}