@singularsystems/neo-react 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -61,18 +61,18 @@ var Button = /** @class */ (function (_super) {
|
|
|
61
61
|
Button.prototype.render = function () {
|
|
62
62
|
var _this = this;
|
|
63
63
|
var _a;
|
|
64
|
-
var _b = this.props, isSubmit = _b.isSubmit, variant = _b.variant, size = _b.size, isOutline = _b.isOutline,
|
|
64
|
+
var _b = this.props, isSubmit = _b.isSubmit, variant = _b.variant, size = _b.size, isOutline = _b.isOutline, inline = _b.inline, icon = _b.icon, iconAlignment = _b.iconAlignment, text = _b.text, menuItems = _b.menuItems, splitMenu = _b.splitMenu, menuAlignment = _b.menuAlignment, buttonGroupClassName = _b.buttonGroupClassName, tooltip = _b.tooltip, task = _b.task, isBusy = _b.isBusy, pulse = _b.pulse, customVariant = _b.customVariant, native = __rest(_b, ["isSubmit", "variant", "size", "isOutline", "inline", "icon", "iconAlignment", "text", "menuItems", "splitMenu", "menuAlignment", "buttonGroupClassName", "tooltip", "task", "isBusy", "pulse", "customVariant"]);
|
|
65
65
|
native.type = isSubmit ? "submit" : "button";
|
|
66
66
|
var variantClassName = ((_a = customVariant !== null && customVariant !== void 0 ? customVariant : variant) !== null && _a !== void 0 ? _a : "primary");
|
|
67
67
|
var isLoading = isBusy || (task === null || task === void 0 ? void 0 : task.isBusy);
|
|
68
68
|
var isDropDown = menuItems && menuItems.length;
|
|
69
|
-
var buttonClasses = "btn btn-" + ((
|
|
69
|
+
var buttonClasses = "btn btn-" + ((inline || isOutline) ? "outline-" : "") + variantClassName;
|
|
70
70
|
if (size)
|
|
71
71
|
buttonClasses += " btn-" + size;
|
|
72
|
-
if (
|
|
73
|
-
buttonClasses += " btn-
|
|
74
|
-
if (
|
|
75
|
-
buttonClasses += " btn-
|
|
72
|
+
if (inline)
|
|
73
|
+
buttonClasses += " btn-inline";
|
|
74
|
+
if (inline && isOutline)
|
|
75
|
+
buttonClasses += " btn-bordered";
|
|
76
76
|
if (isDropDown && !splitMenu) {
|
|
77
77
|
buttonClasses += " dropdown-toggle";
|
|
78
78
|
native.onClick = this.showMenu;
|
|
@@ -131,8 +131,8 @@ var AutoCompleteDropDown = /** @class */ (function (_super) {
|
|
|
131
131
|
};
|
|
132
132
|
AutoCompleteDropDown.prototype.render = function () {
|
|
133
133
|
var _this = this;
|
|
134
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
135
|
-
var
|
|
134
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
135
|
+
var _k = this.props, bind = _k.bind, bindDisplay = _k.bindDisplay, bindItems = _k.bindItems, bindIds = _k.bindIds, itemSource = _k.itemSource, items = _k.items, displayMember = _k.displayMember, valueMember = _k.valueMember, descriptionMember = _k.descriptionMember, option = _k.option, noRecordsPrompt = _k.noRecordsPrompt, typeToSearchPrompt = _k.typeToSearchPrompt, delayMs = _k.delayMs, minCharacters = _k.minCharacters, onItemSelected = _k.onItemSelected, fieldInfoLimit = _k.fieldInfoLimit, filterPredicate = _k.filterPredicate, inputFilter = _k.inputFilter, otherProps = __rest(_k, ["bind", "bindDisplay", "bindItems", "bindIds", "itemSource", "items", "displayMember", "valueMember", "descriptionMember", "option", "noRecordsPrompt", "typeToSearchPrompt", "delayMs", "minCharacters", "onItemSelected", "fieldInfoLimit", "filterPredicate", "inputFilter"]);
|
|
136
136
|
this.setBindProperty();
|
|
137
137
|
var splitProps = BindPropsHelper.splitCommonEditorProps(otherProps);
|
|
138
138
|
var nativeProps = splitProps.rest;
|
|
@@ -215,9 +215,7 @@ var AutoCompleteDropDown = /** @class */ (function (_super) {
|
|
|
215
215
|
nativeProps.isDisabled = true;
|
|
216
216
|
}
|
|
217
217
|
nativeProps.className = Utils.joinWithSpaces("react-select-bs", nativeProps.className);
|
|
218
|
-
|
|
219
|
-
nativeProps.inputId = this.context.uniqueId;
|
|
220
|
-
}
|
|
218
|
+
nativeProps.inputId = (_g = this.context.uniqueId) !== null && _g !== void 0 ? _g : BindPropsHelper.getUniqueId(this.bindProperty, this);
|
|
221
219
|
var userOnBlur = nativeProps.onBlur;
|
|
222
220
|
nativeProps.onBlur = function (e) {
|
|
223
221
|
_this.bindProperty.validator.hasBlurred = true;
|
|
@@ -231,10 +229,10 @@ var AutoCompleteDropDown = /** @class */ (function (_super) {
|
|
|
231
229
|
};
|
|
232
230
|
}
|
|
233
231
|
if (this.props.itemSource !== undefined) {
|
|
234
|
-
return Tooltip.fromDataAttributes(InputHelpers.surroundWithInputGroup(React.createElement(this.asyncSelectImplementation, __assign({}, nativeProps, { placeholder: (
|
|
232
|
+
return Tooltip.fromDataAttributes(InputHelpers.surroundWithInputGroup(React.createElement(this.asyncSelectImplementation, __assign({}, nativeProps, { placeholder: (_h = this.props.placeholder) !== null && _h !== void 0 ? _h : "", classNamePrefix: "react-select-bs", defaultOptions: defaultItems, loadOptions: this.onKeyPress, isMulti: bindItems !== undefined, noOptionsMessage: function (c) { var _a, _b; return c.inputValue && c.inputValue.length >= (minCharacters !== null && minCharacters !== void 0 ? minCharacters : 1) ? ((_a = _this.props.noRecordsPrompt) !== null && _a !== void 0 ? _a : "No records found") : ((_b = _this.props.typeToSearchPrompt) !== null && _b !== void 0 ? _b : "Type to search..."); }, value: value, onChange: this.onItemSelected, components: components })), splitProps.editor, { disabled: nativeProps.isDisabled }), nativeProps);
|
|
235
233
|
}
|
|
236
234
|
else {
|
|
237
|
-
return Tooltip.fromDataAttributes(InputHelpers.surroundWithInputGroup(React.createElement(this.selectImplementation, __assign({}, nativeProps, { placeholder: (
|
|
235
|
+
return Tooltip.fromDataAttributes(InputHelpers.surroundWithInputGroup(React.createElement(this.selectImplementation, __assign({}, nativeProps, { placeholder: (_j = this.props.placeholder) !== null && _j !== void 0 ? _j : "", classNamePrefix: "react-select-bs", options: defaultItems, isLoading: this.isLoading, isMulti: bindItems !== undefined, noOptionsMessage: function (c) { var _a; return (_a = _this.props.noRecordsPrompt) !== null && _a !== void 0 ? _a : "No records found"; }, value: value, onChange: this.onItemSelected, components: components })), splitProps.editor, { disabled: nativeProps.isDisabled }), nativeProps);
|
|
238
236
|
}
|
|
239
237
|
};
|
|
240
238
|
AutoCompleteDropDown.prototype.getOption = function (content, additionalClass) {
|
|
@@ -145,6 +145,7 @@ export declare class BindPropsHelper {
|
|
|
145
145
|
};
|
|
146
146
|
static normaliseContainerProps<T, TContainerDom = React.HTMLProps<T>, TData = any>(component: IComponentBase, props: IEditorContainerProps<T, TData>, inGroup: boolean, isBootstrap?: boolean): IEditorContainerNormalisedProps<TContainerDom, TData>;
|
|
147
147
|
static normaliseEditorProps<T, TDom = React.HTMLProps<T>>(component: IComponentBase, props: (IEditorAndSelectorProps<T, any> & TDom) | IEditorNormalisedProps<TDom, any>): IEditorNormalisedProps<TDom, any>;
|
|
148
|
+
static getUniqueId(bindProperty: Model.IPropertyInstance, component: IComponentBase): string;
|
|
148
149
|
static getPlaceholderText(placeholder: string | boolean | undefined, property: PropertyInfo): string | undefined;
|
|
149
150
|
static autoSetDomProperties<TDom extends React.HTMLProps<HTMLElement>>(props: IEditorNormalisedProps<TDom, any>, formContext: FormContextParams, componentBlurFn?: (e: React.FocusEvent<HTMLElement>) => void, componentFocusFn?: (e: React.FocusEvent<HTMLElement>) => void): TDom;
|
|
150
151
|
static isReadOnly(editorProps: ICommonEditorProps, formContext: FormContextParams): boolean;
|
|
@@ -179,7 +179,7 @@ var BindPropsHelper = /** @class */ (function () {
|
|
|
179
179
|
fileProps: fileProps,
|
|
180
180
|
radioList: radioList,
|
|
181
181
|
inGroup: inGroup,
|
|
182
|
-
uniqueID: (bindOrDisplay
|
|
182
|
+
uniqueID: this.getUniqueId(bindOrDisplay, component),
|
|
183
183
|
containerDom: containerDom,
|
|
184
184
|
isBootstrap: isBootstrap
|
|
185
185
|
};
|
|
@@ -193,6 +193,9 @@ var BindPropsHelper = /** @class */ (function () {
|
|
|
193
193
|
}
|
|
194
194
|
return nProps;
|
|
195
195
|
};
|
|
196
|
+
BindPropsHelper.getUniqueId = function (bindProperty, component) {
|
|
197
|
+
return (bindProperty === null || bindProperty === void 0 ? void 0 : bindProperty.uniqueID) + "!" + component.uniqueId;
|
|
198
|
+
};
|
|
196
199
|
BindPropsHelper.getPlaceholderText = function (placeholder, property) {
|
|
197
200
|
if (placeholder === true) {
|
|
198
201
|
return property.readableName;
|