@true-engineering/true-react-common-ui-kit 2.0.1 → 2.1.0
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/README.md +17 -0
- package/dist/components/Button/Button.d.ts +35 -0
- package/dist/components/Checkbox/Checkbox.d.ts +15 -2
- package/dist/components/DatePicker/DatePicker.d.ts +3 -4
- package/dist/components/DatePicker/types.d.ts +1 -1
- package/dist/components/FiltersPane/FilterSelect/FilterSelect.d.ts +12 -0
- package/dist/components/Input/Input.d.ts +17 -0
- package/dist/components/MoreMenu/MoreMenu.d.ts +3 -0
- package/dist/components/Notification/Notification.d.ts +6 -0
- package/dist/components/RadioButton/RadioButton.d.ts +4 -3
- package/dist/components/Switch/Switch.d.ts +10 -4
- package/dist/components/ThemedPreloader/ThemedPreloader.d.ts +3 -0
- package/dist/components/Toaster/Toaster.d.ts +13 -0
- package/dist/components/Tooltip/Tooltip.d.ts +6 -0
- package/dist/helpers/utils.d.ts +14 -0
- package/dist/true-react-common-ui-kit.js +11 -13
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +11 -13
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/dist/types.d.ts +3 -0
- package/package.json +91 -91
- package/src/components/Checkbox/Checkbox.tsx +3 -2
- package/src/components/DatePicker/DatePicker.tsx +2 -4
- package/src/components/DatePicker/types.ts +5 -0
- package/src/components/FlexibleTable/FlexibleTable.stories.tsx +86 -86
- package/src/components/RadioButton/RadioButton.tsx +5 -4
- package/src/components/Select/Select.tsx +634 -634
- package/src/components/Switch/Switch.tsx +10 -16
|
@@ -9283,7 +9283,7 @@
|
|
|
9283
9283
|
});
|
|
9284
9284
|
};
|
|
9285
9285
|
var DatePicker = /* @__PURE__ */ React.forwardRef(function(_param, ref) {
|
|
9286
|
-
var data = _param.data, _param_selectedDate = _param.selectedDate, selectedDate = _param_selectedDate === void 0 ? null : _param_selectedDate, minDate = _param.minDate, maxDate = _param.maxDate, _param_endDate = _param.endDate, endDate = _param_endDate === void 0 ? null : _param_endDate, _param_startDate = _param.startDate, startDate = _param_startDate === void 0 ? null : _param_startDate, locale2 = _param.locale, months = _param.months, _param_topPosition = _param.topPosition, topPosition = _param_topPosition === void 0 ? 0 : _param_topPosition, _param_leftPosition = _param.leftPosition, leftPosition = _param_leftPosition === void 0 ? 0 : _param_leftPosition, _param_calendarStartDay = _param.calendarStartDay, calendarStartDay = _param_calendarStartDay === void 0 ? 1 : _param_calendarStartDay, _param_dateFormat = _param.dateFormat, dateFormat = _param_dateFormat === void 0 ? DEFAULT_DATE_FORMAT$2 : _param_dateFormat, monthsShown = _param.monthsShown, placeholder = _param.placeholder, isRange = _param.isRange, isInline = _param.isInline, isDisabled = _param.isDisabled, isClearable = _param.isClearable, focusSelectedMonth = _param.focusSelectedMonth, disabledKeyboardNavigation = _param.disabledKeyboardNavigation, shouldRenderPopperInBody = _param.shouldRenderPopperInBody, _param_allowSameDay = _param.allowSameDay, allowSameDay = _param_allowSameDay === void 0 ? false : _param_allowSameDay, shouldCloseOnSelect = _param.shouldCloseOnSelect, showPreviousMonths = _param.showPreviousMonths, preventOpenOnFocus = _param.preventOpenOnFocus, popperModifiers = _param.popperModifiers, popperPlacement = _param.popperPlacement, todayButton = _param.todayButton, calendarContainer = _param.calendarContainer, dayClassName = _param.dayClassName, tmp = _param.customInput, CustomInput = tmp === void 0 ? DateInput : tmp, customInputRef = _param.customInputRef, renderCustomHeader = _param.renderCustomHeader, filterDate = _param.filterDate, onYearChange = _param.onYearChange, onMonthChange = _param.onMonthChange, onCalendarOpen = _param.onCalendarOpen, onCalendarClose = _param.onCalendarClose, onChangeDate = _param.onChangeDate, onChangeRange = _param.onChangeRange, onBlur = _param.onBlur, onFocus = _param.onFocus, onKeyDown = _param.onKeyDown, tweakStyles = _param.tweakStyles, inputProps = _object_without_properties$4(_param, [
|
|
9286
|
+
var data = _param.data, _param_selectedDate = _param.selectedDate, selectedDate = _param_selectedDate === void 0 ? null : _param_selectedDate, minDate = _param.minDate, maxDate = _param.maxDate, _param_endDate = _param.endDate, endDate = _param_endDate === void 0 ? null : _param_endDate, _param_startDate = _param.startDate, startDate = _param_startDate === void 0 ? null : _param_startDate, locale2 = _param.locale, months = _param.months, _param_topPosition = _param.topPosition, topPosition = _param_topPosition === void 0 ? 0 : _param_topPosition, _param_leftPosition = _param.leftPosition, leftPosition = _param_leftPosition === void 0 ? 0 : _param_leftPosition, _param_calendarStartDay = _param.calendarStartDay, calendarStartDay = _param_calendarStartDay === void 0 ? 1 : _param_calendarStartDay, _param_dateFormat = _param.dateFormat, dateFormat = _param_dateFormat === void 0 ? DEFAULT_DATE_FORMAT$2 : _param_dateFormat, monthsShown = _param.monthsShown, placeholder = _param.placeholder, isRange = _param.isRange, isInline = _param.isInline, isDisabled = _param.isDisabled, isClearable = _param.isClearable, strictParsing = _param.strictParsing, focusSelectedMonth = _param.focusSelectedMonth, disabledKeyboardNavigation = _param.disabledKeyboardNavigation, shouldRenderPopperInBody = _param.shouldRenderPopperInBody, _param_allowSameDay = _param.allowSameDay, allowSameDay = _param_allowSameDay === void 0 ? false : _param_allowSameDay, shouldCloseOnSelect = _param.shouldCloseOnSelect, showPreviousMonths = _param.showPreviousMonths, preventOpenOnFocus = _param.preventOpenOnFocus, popperModifiers = _param.popperModifiers, popperPlacement = _param.popperPlacement, todayButton = _param.todayButton, calendarContainer = _param.calendarContainer, dayClassName = _param.dayClassName, tmp = _param.customInput, CustomInput = tmp === void 0 ? DateInput : tmp, customInputRef = _param.customInputRef, renderCustomHeader = _param.renderCustomHeader, filterDate = _param.filterDate, onYearChange = _param.onYearChange, onMonthChange = _param.onMonthChange, onCalendarOpen = _param.onCalendarOpen, onCalendarClose = _param.onCalendarClose, onChangeDate = _param.onChangeDate, onChangeRange = _param.onChangeRange, onBlur = _param.onBlur, onFocus = _param.onFocus, onKeyDown = _param.onKeyDown, tweakStyles = _param.tweakStyles, inputProps = _object_without_properties$4(_param, [
|
|
9287
9287
|
"data",
|
|
9288
9288
|
"selectedDate",
|
|
9289
9289
|
"minDate",
|
|
@@ -9302,6 +9302,7 @@
|
|
|
9302
9302
|
"isInline",
|
|
9303
9303
|
"isDisabled",
|
|
9304
9304
|
"isClearable",
|
|
9305
|
+
"strictParsing",
|
|
9305
9306
|
"focusSelectedMonth",
|
|
9306
9307
|
"disabledKeyboardNavigation",
|
|
9307
9308
|
"shouldRenderPopperInBody",
|
|
@@ -9475,6 +9476,7 @@
|
|
|
9475
9476
|
popperModifiers,
|
|
9476
9477
|
popperPlacement,
|
|
9477
9478
|
selectsRange: isRange,
|
|
9479
|
+
strictParsing,
|
|
9478
9480
|
preventOpenOnFocus,
|
|
9479
9481
|
shouldCloseOnSelect,
|
|
9480
9482
|
customInputRef,
|
|
@@ -26713,7 +26715,7 @@
|
|
|
26713
26715
|
return target;
|
|
26714
26716
|
}
|
|
26715
26717
|
function RadioButton(param) {
|
|
26716
|
-
var children = param.children, value = param.value, groupName = param.groupName, isChecked = param.isChecked, isDisabled = param.isDisabled, isInvalid = param.isInvalid,
|
|
26718
|
+
var children = param.children, value = param.value, groupName = param.groupName, isChecked = param.isChecked, isDisabled = param.isDisabled, isInvalid = param.isInvalid, data = param.data, tweakStyles = param.tweakStyles, onChange = param.onChange;
|
|
26717
26719
|
var classes = useTheme("RadioButton", styles$6, tweakStyles).classes;
|
|
26718
26720
|
var _obj;
|
|
26719
26721
|
return /* @__PURE__ */ jsxs("label", _object_spread_props$6(_object_spread$6({
|
|
@@ -26853,10 +26855,8 @@
|
|
|
26853
26855
|
return target;
|
|
26854
26856
|
}
|
|
26855
26857
|
var Switch = function(param) {
|
|
26856
|
-
var isDisabled = param.isDisabled, isChecked = param.isChecked, isInvalid = param.isInvalid,
|
|
26858
|
+
var isDisabled = param.isDisabled, isChecked = param.isChecked, isInvalid = param.isInvalid, value = param.value, children = param.children, _param_labelPosition = param.labelPosition, labelPosition = _param_labelPosition === void 0 ? "right" : _param_labelPosition, _param_color = param.color, color = _param_color === void 0 ? "primary" : _param_color, data = param.data, tweakStyles = param.tweakStyles, testId = param.testId, onChange = param.onChange;
|
|
26857
26859
|
var classes = useTheme("Switch", styles$5, tweakStyles).classes;
|
|
26858
|
-
var hasLabel = isNotEmpty(label);
|
|
26859
|
-
var hasChild = isNotEmpty(children);
|
|
26860
26860
|
var handleChange = function() {
|
|
26861
26861
|
return onChange({
|
|
26862
26862
|
name: value,
|
|
@@ -26866,24 +26866,22 @@
|
|
|
26866
26866
|
var _obj;
|
|
26867
26867
|
return /* @__PURE__ */ jsxs("label", _object_spread_props$5(_object_spread$5({
|
|
26868
26868
|
className: clsx(classes.root, classes[color], (_obj = {}, _define_property$5(_obj, classes.disabled, isDisabled), _define_property$5(_obj, classes.checked, isChecked), _define_property$5(_obj, classes.invalid, isInvalid), _obj))
|
|
26869
|
-
}, addDataAttributes(data)), {
|
|
26870
|
-
"data-testid": testId,
|
|
26869
|
+
}, addDataTestId(testId), addDataAttributes(data)), {
|
|
26871
26870
|
children: [
|
|
26872
26871
|
/* @__PURE__ */ jsx("span", {
|
|
26873
26872
|
className: classes.switch,
|
|
26874
|
-
children: /* @__PURE__ */ jsx("input", {
|
|
26873
|
+
children: /* @__PURE__ */ jsx("input", _object_spread$5({
|
|
26875
26874
|
type: "checkbox",
|
|
26876
26875
|
name: value,
|
|
26877
26876
|
className: classes.input,
|
|
26878
26877
|
onChange: isDisabled ? void 0 : handleChange,
|
|
26879
26878
|
checked: isChecked,
|
|
26880
|
-
disabled: isDisabled
|
|
26881
|
-
|
|
26882
|
-
})
|
|
26879
|
+
disabled: isDisabled
|
|
26880
|
+
}, addDataTestId(testId, "input")))
|
|
26883
26881
|
}),
|
|
26884
|
-
(
|
|
26882
|
+
isNotEmpty(children) && /* @__PURE__ */ jsx("span", {
|
|
26885
26883
|
className: clsx(classes.label, classes[labelPosition === "left" ? "labelLeft" : "labelRight"]),
|
|
26886
|
-
children
|
|
26884
|
+
children
|
|
26887
26885
|
})
|
|
26888
26886
|
]
|
|
26889
26887
|
}));
|