@agility/plenum-ui 1.1.61 → 1.1.71
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.
- package/coverage/agility-component-lib-react/index.html +1 -1
- package/coverage/agility-component-lib-react/src/components/Button/Button.tsx.html +23 -17
- package/coverage/agility-component-lib-react/src/components/Button/index.html +5 -5
- package/coverage/agility-component-lib-react/src/components/Forms/BaseField/BaseField.tsx.html +18 -6
- package/coverage/agility-component-lib-react/src/components/Forms/BaseField/index.html +11 -11
- package/coverage/agility-component-lib-react/src/components/Forms/Checkbox/Checkbox.tsx.html +63 -12
- package/coverage/agility-component-lib-react/src/components/Forms/Checkbox/index.html +19 -19
- package/coverage/agility-component-lib-react/src/components/Forms/InputCounter/InputCounter.tsx.html +1 -1
- package/coverage/agility-component-lib-react/src/components/Forms/InputCounter/index.html +1 -1
- package/coverage/agility-component-lib-react/src/components/Forms/InputLabel/InputLabel.tsx.html +1 -1
- package/coverage/agility-component-lib-react/src/components/Forms/InputLabel/index.html +1 -1
- package/coverage/agility-component-lib-react/src/components/Forms/InputLabel/index.ts.html +1 -1
- package/coverage/agility-component-lib-react/src/components/Forms/Radio/Radio.tsx.html +90 -12
- package/coverage/agility-component-lib-react/src/components/Forms/Radio/index.html +21 -21
- package/coverage/agility-component-lib-react/src/components/Forms/Select/Select.tsx.html +6 -6
- package/coverage/agility-component-lib-react/src/components/Forms/Select/index.html +1 -1
- package/coverage/agility-component-lib-react/src/components/Forms/TextInputAddon/InputCta/InputCta.tsx.html +4 -4
- package/coverage/agility-component-lib-react/src/components/Forms/TextInputAddon/InputCta/index.html +1 -1
- package/coverage/agility-component-lib-react/src/components/Forms/TextInputSelect/InputSelect/InputSelect.tsx.html +2 -2
- package/coverage/agility-component-lib-react/src/components/Forms/TextInputSelect/InputSelect/index.html +1 -1
- package/coverage/agility-component-lib-react/src/components/Switch/Switch.tsx.html +37 -10
- package/coverage/agility-component-lib-react/src/components/Switch/index.html +9 -9
- package/coverage/agility-component-lib-react/src/util/DynamicIcons.tsx.html +5 -5
- package/coverage/agility-component-lib-react/src/util/Loader.tsx.html +1 -1
- package/coverage/agility-component-lib-react/src/util/index.html +1 -1
- package/coverage/agility-component-lib-react/styleMock.js.html +1 -1
- package/coverage/coverage-final.json +12 -2
- package/coverage/index.html +147 -12
- package/lib/components/Forms/BaseField/BaseField.d.ts +2 -0
- package/lib/components/Forms/TextInput/TextInput.d.ts +4 -3
- package/lib/components/Forms/TextInputAddon/TextInputAddon.d.ts +5 -2
- package/lib/components/Forms/TextInputSelect/TextInputSelect.d.ts +2 -0
- package/lib/index.esm.js +29 -18
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +30 -19
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/lib/index.esm.js
CHANGED
|
@@ -12273,7 +12273,7 @@ var InputCounter = function (_a) {
|
|
|
12273
12273
|
var defaultStyles = 'border py-2 px-3 rounded-md text-sm leading-5 font-normal w-full border-gray-300 shadow-sm';
|
|
12274
12274
|
/** Base input field component */
|
|
12275
12275
|
var BaseField = function (_a, ref) {
|
|
12276
|
-
var onFocus = _a.onFocus, onBlur = _a.onBlur, id = _a.id, name = _a.name, type = _a.type, defaultValue = _a.defaultValue, isDisabled = _a.isDisabled, _b = _a.maxLength, maxLength = _b === void 0 ? 100 : _b, placeholder = _a.placeholder, _c = _a.inputStyles, inputStyles = _c === void 0 ? defaultStyles : _c, onChange = _a.onChange, onValueChange = _a.onValueChange;
|
|
12276
|
+
var onFocus = _a.onFocus, onBlur = _a.onBlur, id = _a.id, name = _a.name, type = _a.type, value = _a.value, defaultValue = _a.defaultValue, isDisabled = _a.isDisabled, _b = _a.maxLength, maxLength = _b === void 0 ? 100 : _b, placeholder = _a.placeholder, _c = _a.inputStyles, inputStyles = _c === void 0 ? defaultStyles : _c, onChange = _a.onChange, onValueChange = _a.onValueChange;
|
|
12277
12277
|
var handleChange = function (e) {
|
|
12278
12278
|
var targetValue = e.currentTarget.value;
|
|
12279
12279
|
onChange && onChange(targetValue);
|
|
@@ -12291,16 +12291,19 @@ var BaseField = function (_a, ref) {
|
|
|
12291
12291
|
});
|
|
12292
12292
|
return (React__default.createElement("input", { onFocus: handleFocus, onBlur: handleBlur, onChange: function (e) {
|
|
12293
12293
|
handleChange(e);
|
|
12294
|
-
}, placeholder: placeholder, ref: ref, type: type, name: name, id: id, className: scopedtyles, disabled: isDisabled, defaultValue: defaultValue, maxLength: maxLength, autoComplete: "off" }));
|
|
12294
|
+
}, placeholder: placeholder, ref: ref, type: type, name: name, id: id, className: scopedtyles, disabled: isDisabled, value: value, defaultValue: defaultValue, maxLength: maxLength, autoComplete: "off" }));
|
|
12295
12295
|
};
|
|
12296
12296
|
var _BaseField = forwardRef(BaseField);
|
|
12297
12297
|
|
|
12298
|
-
var TextInput = function (_a) {
|
|
12299
|
-
var label = _a.label, isFocused = _a.isFocused, isError = _a.isError, id = _a.id, name = _a.name, isRequired = _a.isRequired, type = _a.type, defaultValue = _a.defaultValue, isDisabled = _a.isDisabled, message = _a.message, isShowCounter = _a.isShowCounter, _b = _a.maxLength, maxLength = _b === void 0 ? 100 : _b, onChange = _a.onChange;
|
|
12298
|
+
var TextInput = function (_a, ref) {
|
|
12299
|
+
var label = _a.label, isFocused = _a.isFocused, isError = _a.isError, id = _a.id, name = _a.name, isRequired = _a.isRequired, type = _a.type, defaultValue = _a.defaultValue, isDisabled = _a.isDisabled, message = _a.message, isShowCounter = _a.isShowCounter, _b = _a.maxLength, maxLength = _b === void 0 ? 100 : _b, onChange = _a.onChange, externalValue = _a.value;
|
|
12300
12300
|
var _c = useState(Boolean(isFocused)), isFocus = _c[0], setIsFocus = _c[1];
|
|
12301
|
-
var _d = useState(false)
|
|
12302
|
-
var _e = useState(defaultValue), value = _e[0], setValue = _e[1];
|
|
12301
|
+
var _d = useState(false); _d[0]; var setIsActive = _d[1];
|
|
12302
|
+
var _e = useState(defaultValue || ''), value = _e[0], setValue = _e[1];
|
|
12303
12303
|
var inputRef = useRef(null);
|
|
12304
|
+
useEffect(function () {
|
|
12305
|
+
setValue(externalValue);
|
|
12306
|
+
}, [externalValue]);
|
|
12304
12307
|
// set force focus
|
|
12305
12308
|
useEffect(function () {
|
|
12306
12309
|
var input = inputRef.current;
|
|
@@ -12333,14 +12336,15 @@ var TextInput = function (_a) {
|
|
|
12333
12336
|
var inputStyles = cn$1('border py-2 px-3 rounded-md text-sm leading-5 font-normal w-full', { 'border-gray-300 shadow-sm': !isFocus && !isError }, { 'focus:ring-purple-500 border-purple-500 outline-purple-500 shadow-none': isFocus && !isError }, { 'focus:ring-red-500 !border-red-500 shadow-none': isError });
|
|
12334
12337
|
var discriptionStyles = cn$1('text-sm mt-1 block', { 'text-gray-500': !isError }, { 'text-red-500': isError });
|
|
12335
12338
|
return (React__default.createElement("div", null,
|
|
12336
|
-
React__default.createElement(InputLabel, { isPlaceholder: true, label: label, isRequired: isRequired, id: id, isError: isError, isActive:
|
|
12339
|
+
React__default.createElement(InputLabel, { isPlaceholder: true, label: label, isRequired: isRequired, id: id, isError: isError, isActive: true, isDisabled: isDisabled }),
|
|
12337
12340
|
React__default.createElement("div", null,
|
|
12338
|
-
React__default.createElement(_BaseField, { onFocus: handleInputFocus, onBlur: handleInputBlur, onChange: onChange, onValueChange: setValue, ref:
|
|
12341
|
+
React__default.createElement(_BaseField, { onFocus: handleInputFocus, onBlur: handleInputBlur, onChange: onChange, onValueChange: setValue, ref: ref, type: type, name: name, id: id, inputStyles: inputStyles, isDisabled: isDisabled, value: value, defaultValue: defaultValue, maxLength: maxLength }),
|
|
12339
12342
|
React__default.createElement("div", { className: "flex flex-row space-x-3" },
|
|
12340
12343
|
React__default.createElement("div", { className: "grow" }, message && React__default.createElement("span", { className: discriptionStyles }, message)),
|
|
12341
12344
|
isShowCounter && (React__default.createElement("div", { className: "shrink-0" },
|
|
12342
12345
|
React__default.createElement(InputCounter, { current: Number(value === null || value === void 0 ? void 0 : value.length), limit: maxLength })))))));
|
|
12343
|
-
};
|
|
12346
|
+
};
|
|
12347
|
+
var _TextInput = forwardRef(TextInput);
|
|
12344
12348
|
|
|
12345
12349
|
/** Comment */
|
|
12346
12350
|
var InputCta = function (_a) {
|
|
@@ -12370,11 +12374,14 @@ var InputCta = function (_a) {
|
|
|
12370
12374
|
ctaLabel && React__default.createElement("span", null, ctaLabel)));
|
|
12371
12375
|
};
|
|
12372
12376
|
|
|
12373
|
-
var TextInputAddon = function (_a) {
|
|
12374
|
-
var label = _a.label, isFocused = _a.isFocused, isError = _a.isError, id = _a.id, name = _a.name, isRequired = _a.isRequired, type = _a.type, defaultValue = _a.defaultValue, isDisabled = _a.isDisabled, message = _a.message, isShowCounter = _a.isShowCounter, _b = _a.maxLength, maxLength = _b === void 0 ? 100 : _b, placeholder = _a.placeholder, leadIcon = _a.leadIcon, trailIcon = _a.trailIcon, inlineIcon = _a.inlineIcon, trailLabel = _a.trailLabel, leadLabel = _a.leadLabel, _c = _a.clearCta, clearCta = _c === void 0 ? 'none' : _c, onChange = _a.onChange, onCtaClick = _a.onCtaClick;
|
|
12377
|
+
var TextInputAddon = function (_a, ref) {
|
|
12378
|
+
var label = _a.label, isFocused = _a.isFocused, isError = _a.isError, id = _a.id, name = _a.name, isRequired = _a.isRequired, type = _a.type, defaultValue = _a.defaultValue, isDisabled = _a.isDisabled, message = _a.message, isShowCounter = _a.isShowCounter, _b = _a.maxLength, maxLength = _b === void 0 ? 100 : _b, placeholder = _a.placeholder, leadIcon = _a.leadIcon, trailIcon = _a.trailIcon, inlineIcon = _a.inlineIcon, trailLabel = _a.trailLabel, leadLabel = _a.leadLabel, _c = _a.clearCta, clearCta = _c === void 0 ? 'none' : _c, onChange = _a.onChange, onCtaClick = _a.onCtaClick, externalValue = _a.value;
|
|
12375
12379
|
var _d = useState(Boolean(isFocused)), isFocus = _d[0], setIsFocus = _d[1];
|
|
12376
|
-
var _e = useState(defaultValue), value = _e[0], setValue = _e[1];
|
|
12380
|
+
var _e = useState(defaultValue || ''), value = _e[0], setValue = _e[1];
|
|
12377
12381
|
var inputRef = useRef(null);
|
|
12382
|
+
useEffect(function () {
|
|
12383
|
+
setValue(externalValue);
|
|
12384
|
+
}, [externalValue]);
|
|
12378
12385
|
// set force focus
|
|
12379
12386
|
useEffect(function () {
|
|
12380
12387
|
var input = inputRef.current;
|
|
@@ -12410,13 +12417,14 @@ var TextInputAddon = function (_a) {
|
|
|
12410
12417
|
React__default.createElement("div", { className: "flex-grow focus-within:z-20 relative" },
|
|
12411
12418
|
inlineIcon && (React__default.createElement("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none" },
|
|
12412
12419
|
React__default.createElement(DynamicIcons, { icon: inlineIcon, className: "h-5 w-5 text-gray-400", outline: false }))),
|
|
12413
|
-
React__default.createElement(_BaseField, { onFocus: handleInputFocus, onBlur: handleInputBlur, onChange: onChange, onValueChange: setValue, ref:
|
|
12420
|
+
React__default.createElement(_BaseField, { onFocus: handleInputFocus, onBlur: handleInputBlur, onChange: onChange, onValueChange: setValue, ref: ref, type: type, name: name, id: id, inputStyles: inputStyles, isDisabled: isDisabled, value: value, defaultValue: defaultValue, maxLength: maxLength, placeholder: placeholder })),
|
|
12414
12421
|
(trailIcon || trailLabel) && (React__default.createElement(InputCta, { icon: trailIcon, ctaLabel: trailLabel, align: "right", isClear: clearCta === 'right' || clearCta === 'both', onClickHandler: onCtaClick }))),
|
|
12415
12422
|
React__default.createElement("div", { className: "flex flex-row space-x-3" },
|
|
12416
12423
|
React__default.createElement("div", { className: "grow" }, message && React__default.createElement("span", { className: discriptionStyles }, message)),
|
|
12417
12424
|
isShowCounter && (React__default.createElement("div", { className: "shrink-0" },
|
|
12418
12425
|
React__default.createElement(InputCounter, { current: Number(value === null || value === void 0 ? void 0 : value.length), limit: maxLength }))))));
|
|
12419
|
-
};
|
|
12426
|
+
};
|
|
12427
|
+
var _TextInputAddon = forwardRef(TextInputAddon);
|
|
12420
12428
|
|
|
12421
12429
|
/** Comment */
|
|
12422
12430
|
var InputSelect = function (_a) {
|
|
@@ -12434,10 +12442,13 @@ var InputSelect = function (_a) {
|
|
|
12434
12442
|
};
|
|
12435
12443
|
|
|
12436
12444
|
var TextInputSelect = function (_a) {
|
|
12437
|
-
var label = _a.label, isFocused = _a.isFocused, isError = _a.isError, id = _a.id, name = _a.name, isRequired = _a.isRequired, type = _a.type, defaultValue = _a.defaultValue, isDisabled = _a.isDisabled, message = _a.message, isShowCounter = _a.isShowCounter, _b = _a.maxLength, maxLength = _b === void 0 ? 100 : _b, placeholder = _a.placeholder, inputOptions = _a.inputOptions, _c = _a.selectLocation, selectLocation = _c === void 0 ? 'right' : _c, prefix = _a.prefix, onChange = _a.onChange, onSelectOption = _a.onSelectOption;
|
|
12445
|
+
var label = _a.label, isFocused = _a.isFocused, isError = _a.isError, id = _a.id, name = _a.name, isRequired = _a.isRequired, type = _a.type, defaultValue = _a.defaultValue, isDisabled = _a.isDisabled, message = _a.message, isShowCounter = _a.isShowCounter, _b = _a.maxLength, maxLength = _b === void 0 ? 100 : _b, placeholder = _a.placeholder, inputOptions = _a.inputOptions, _c = _a.selectLocation, selectLocation = _c === void 0 ? 'right' : _c, prefix = _a.prefix, onChange = _a.onChange, onSelectOption = _a.onSelectOption, externalValue = _a.value;
|
|
12438
12446
|
var _d = useState(Boolean(isFocused)), isFocus = _d[0], setIsFocus = _d[1];
|
|
12439
|
-
var _e = useState(defaultValue), value = _e[0], setValue = _e[1];
|
|
12447
|
+
var _e = useState(defaultValue || ''), value = _e[0], setValue = _e[1];
|
|
12440
12448
|
var inputRef = useRef(null);
|
|
12449
|
+
useEffect(function () {
|
|
12450
|
+
setValue(externalValue);
|
|
12451
|
+
}, [externalValue]);
|
|
12441
12452
|
// set force focus
|
|
12442
12453
|
useEffect(function () {
|
|
12443
12454
|
var input = inputRef.current;
|
|
@@ -12478,7 +12489,7 @@ var TextInputSelect = function (_a) {
|
|
|
12478
12489
|
React__default.createElement("div", { className: "flex-grow focus-within:z-20 relative" },
|
|
12479
12490
|
prefix && (React__default.createElement("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none" },
|
|
12480
12491
|
React__default.createElement("span", { className: "text-gray-500 sm:text-sm" }, prefix))),
|
|
12481
|
-
React__default.createElement(_BaseField, { onFocus: handleInputFocus, onBlur: handleInputBlur, onChange: onChange, onValueChange: setValue, ref: inputRef, type: type, name: name, id: id, inputStyles: inputStyles, isDisabled: isDisabled, defaultValue: defaultValue, maxLength: maxLength, placeholder: placeholder })),
|
|
12492
|
+
React__default.createElement(_BaseField, { onFocus: handleInputFocus, onBlur: handleInputBlur, onChange: onChange, onValueChange: setValue, ref: inputRef, type: type, name: name, id: id, inputStyles: inputStyles, isDisabled: isDisabled, defaultValue: defaultValue, value: value, maxLength: maxLength, placeholder: placeholder })),
|
|
12482
12493
|
(inputOptions === null || inputOptions === void 0 ? void 0 : inputOptions.length) && selectLocation === 'right' && (React__default.createElement(InputSelect, { inputOptions: inputOptions, align: 'right', onSelectOption: onSelectOption }))),
|
|
12483
12494
|
React__default.createElement("div", { className: "flex flex-row space-x-3" },
|
|
12484
12495
|
React__default.createElement("div", { className: "grow" }, message && React__default.createElement("span", { className: discriptionStyles }, message)),
|
|
@@ -12577,5 +12588,5 @@ var Checkbox = function (_a) {
|
|
|
12577
12588
|
message && (React__default.createElement("p", { id: "".concat(id, "-description"), className: "text-gray-500" }, message)))));
|
|
12578
12589
|
};
|
|
12579
12590
|
|
|
12580
|
-
export { Avatar, Button, Checkbox, Combobox, Dropdown, Placeholder, Radio, Select, Switch, TextInput, TextInputAddon, TextInputSelect, _Textarea as Textarea, _TreeView as TreeView };
|
|
12591
|
+
export { Avatar, Button, Checkbox, Combobox, Dropdown, Placeholder, Radio, Select, Switch, _TextInput as TextInput, _TextInputAddon as TextInputAddon, TextInputSelect, _Textarea as Textarea, _TreeView as TreeView };
|
|
12581
12592
|
//# sourceMappingURL=index.esm.js.map
|