@paubox/ui 1.11.7 → 1.13.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/index.esm.js +81 -76
- package/package.json +1 -1
- package/src/lib/Calendar/Calendar.d.ts +2 -0
- package/src/lib/DatePicker/DatePicker.d.ts +2 -0
- package/src/lib/FilterForm/FilterForm.d.ts +6 -3
- package/src/lib/FilterForm/FilterRow.d.ts +4 -4
- package/src/lib/Inputs/MultiInput.d.ts +2 -2
- package/src/lib/Inputs/MultiSelect.d.ts +1 -1
- package/src/lib/Inputs/Select.d.ts +6 -4
- package/src/lib/Table/Table.d.ts +1 -1
package/index.esm.js
CHANGED
|
@@ -21740,13 +21740,15 @@ function _object_spread_props$q(target, source) {
|
|
|
21740
21740
|
return target;
|
|
21741
21741
|
}
|
|
21742
21742
|
var Calendar = function(param) {
|
|
21743
|
-
var _param_rangeSelect = param.rangeSelect, rangeSelect = _param_rangeSelect === void 0 ? false : _param_rangeSelect, selectedDate = param.selectedDate, startDate = param.startDate, endDate = param.endDate, onChange = param.onChange;
|
|
21743
|
+
var _param_rangeSelect = param.rangeSelect, rangeSelect = _param_rangeSelect === void 0 ? false : _param_rangeSelect, selectedDate = param.selectedDate, startDate = param.startDate, endDate = param.endDate, minDate = param.minDate, maxDate = param.maxDate, onChange = param.onChange;
|
|
21744
21744
|
return /*#__PURE__*/ jsx("div", {
|
|
21745
21745
|
children: /*#__PURE__*/ jsx(DatePicker$1, _object_spread$w({}, _object_spread_props$q(_object_spread$w({
|
|
21746
21746
|
onChange: onChange,
|
|
21747
21747
|
selected: rangeSelect ? null : selectedDate,
|
|
21748
21748
|
startDate: startDate || undefined,
|
|
21749
|
-
endDate: endDate || undefined
|
|
21749
|
+
endDate: endDate || undefined,
|
|
21750
|
+
minDate: minDate || undefined,
|
|
21751
|
+
maxDate: maxDate || undefined
|
|
21750
21752
|
}, rangeSelect && {
|
|
21751
21753
|
selectsRange: true
|
|
21752
21754
|
}), {
|
|
@@ -22541,11 +22543,13 @@ function _templateObject$l() {
|
|
|
22541
22543
|
}
|
|
22542
22544
|
var DatePickerButton = styled(Button)(_templateObject$l(), spacing(1), neutral300, spacing(1));
|
|
22543
22545
|
var DatePicker = function(_param) {
|
|
22544
|
-
var _param_rangeSelect = _param.rangeSelect, rangeSelect = _param_rangeSelect === void 0 ? false : _param_rangeSelect, _param_selectedDate = _param.selectedDate, selectedDate = _param_selectedDate === void 0 ? new Date() : _param_selectedDate, _param_startDate = _param.startDate, startDate = _param_startDate === void 0 ? new Date(Date.now() - 7 * 24 * 60 * 60 * 1000) : _param_startDate, _param_endDate = _param.endDate, endDate = _param_endDate === void 0 ? new Date() : _param_endDate, onChange = _param.onChange, rest = _object_without_properties$i(_param, [
|
|
22546
|
+
var _param_rangeSelect = _param.rangeSelect, rangeSelect = _param_rangeSelect === void 0 ? false : _param_rangeSelect, _param_selectedDate = _param.selectedDate, selectedDate = _param_selectedDate === void 0 ? new Date() : _param_selectedDate, _param_startDate = _param.startDate, startDate = _param_startDate === void 0 ? new Date(Date.now() - 7 * 24 * 60 * 60 * 1000) : _param_startDate, _param_endDate = _param.endDate, endDate = _param_endDate === void 0 ? new Date() : _param_endDate, minDate = _param.minDate, maxDate = _param.maxDate, onChange = _param.onChange, rest = _object_without_properties$i(_param, [
|
|
22545
22547
|
"rangeSelect",
|
|
22546
22548
|
"selectedDate",
|
|
22547
22549
|
"startDate",
|
|
22548
22550
|
"endDate",
|
|
22551
|
+
"minDate",
|
|
22552
|
+
"maxDate",
|
|
22549
22553
|
"onChange"
|
|
22550
22554
|
]);
|
|
22551
22555
|
var _useState = _sliced_to_array$g(useState(false), 2), open = _useState[0], setOpen = _useState[1];
|
|
@@ -22613,6 +22617,8 @@ var DatePicker = function(_param) {
|
|
|
22613
22617
|
selectedDate: rangeSelect ? null : selectedDate,
|
|
22614
22618
|
startDate: rangeSelect ? startDate : null,
|
|
22615
22619
|
endDate: rangeSelect ? endDate : null,
|
|
22620
|
+
minDate: minDate,
|
|
22621
|
+
maxDate: maxDate,
|
|
22616
22622
|
onChange: rangeSelect ? handleRangeSelect : handleDateSelect
|
|
22617
22623
|
})
|
|
22618
22624
|
}))
|
|
@@ -22918,7 +22924,7 @@ var SelectContainer = styled.div(_templateObject2$f());
|
|
|
22918
22924
|
var MultiInputContainer = styled.div(_templateObject3$c());
|
|
22919
22925
|
var FilterRow = function(param) {
|
|
22920
22926
|
var filterKey = param.filterKey, rowIndex = param.rowIndex, values = param.values, errors = param.errors, touched = param.touched, onChange = param.onChange, onRemove = param.onRemove, fieldOptions = param.fieldOptions, operatorOptions = param.operatorOptions, showRemove = param.showRemove;
|
|
22921
|
-
var _touched_filters_filterKey_rowIndex, _touched_filters_filterKey, _touched_filters, _errors_filters_filterKey_rowIndex, _errors_filters_filterKey, _errors_filters, _touched_filters_filterKey_rowIndex1, _touched_filters_filterKey1, _touched_filters1, _errors_filters_filterKey_rowIndex1, _errors_filters_filterKey1, _errors_filters1, _touched_filters_filterKey_rowIndex2, _touched_filters_filterKey2, _touched_filters2, _errors_filters_filterKey_rowIndex2, _errors_filters_filterKey2, _errors_filters2;
|
|
22927
|
+
var _touched_filters_filterKey_rowIndex, _touched_filters_filterKey, _touched_filters, _errors_filters_filterKey_rowIndex, _errors_filters_filterKey, _errors_filters, _touched_filters_filterKey_rowIndex1, _touched_filters_filterKey1, _touched_filters1, _errors_filters_filterKey_rowIndex1, _errors_filters_filterKey1, _errors_filters1, _currentFilter_terms, _touched_filters_filterKey_rowIndex2, _touched_filters_filterKey2, _touched_filters2, _errors_filters_filterKey_rowIndex2, _errors_filters_filterKey2, _errors_filters2;
|
|
22922
22928
|
var currentFilter = values.filters[Number(filterKey)][Number(rowIndex)];
|
|
22923
22929
|
var _useState = _sliced_to_array$e(useState(false), 2), isHovered = _useState[0], setIsHovered = _useState[1];
|
|
22924
22930
|
var currentField = fieldOptions.find(function(field) {
|
|
@@ -22944,7 +22950,7 @@ var FilterRow = function(param) {
|
|
|
22944
22950
|
onChange: function(value) {
|
|
22945
22951
|
return onChange("filters.".concat(filterKey, ".").concat(rowIndex, ".field"), value);
|
|
22946
22952
|
},
|
|
22947
|
-
error: (touched === null || touched === void 0 ? void 0 : (_touched_filters = touched.filters) === null || _touched_filters === void 0 ? void 0 : (_touched_filters_filterKey = _touched_filters[filterKey]) === null || _touched_filters_filterKey === void 0 ? void 0 : (_touched_filters_filterKey_rowIndex = _touched_filters_filterKey[rowIndex]) === null || _touched_filters_filterKey_rowIndex === void 0 ? void 0 : _touched_filters_filterKey_rowIndex.field) && (errors === null || errors === void 0 ? void 0 : (_errors_filters = errors.filters) === null || _errors_filters === void 0 ? void 0 : (_errors_filters_filterKey = _errors_filters[filterKey]) === null || _errors_filters_filterKey === void 0 ? void 0 : (_errors_filters_filterKey_rowIndex = _errors_filters_filterKey[rowIndex]) === null || _errors_filters_filterKey_rowIndex === void 0 ? void 0 : _errors_filters_filterKey_rowIndex.field),
|
|
22953
|
+
error: !!(touched === null || touched === void 0 ? void 0 : (_touched_filters = touched.filters) === null || _touched_filters === void 0 ? void 0 : (_touched_filters_filterKey = _touched_filters[filterKey]) === null || _touched_filters_filterKey === void 0 ? void 0 : (_touched_filters_filterKey_rowIndex = _touched_filters_filterKey[rowIndex]) === null || _touched_filters_filterKey_rowIndex === void 0 ? void 0 : _touched_filters_filterKey_rowIndex.field) && !!(errors === null || errors === void 0 ? void 0 : (_errors_filters = errors.filters) === null || _errors_filters === void 0 ? void 0 : (_errors_filters_filterKey = _errors_filters[filterKey]) === null || _errors_filters_filterKey === void 0 ? void 0 : (_errors_filters_filterKey_rowIndex = _errors_filters_filterKey[rowIndex]) === null || _errors_filters_filterKey_rowIndex === void 0 ? void 0 : _errors_filters_filterKey_rowIndex.field),
|
|
22948
22954
|
options: fieldOptions,
|
|
22949
22955
|
sz: "lg"
|
|
22950
22956
|
}),
|
|
@@ -22958,7 +22964,7 @@ var FilterRow = function(param) {
|
|
|
22958
22964
|
onChange: function(value) {
|
|
22959
22965
|
return onChange("filters.".concat(filterKey, ".").concat(rowIndex, ".op"), value);
|
|
22960
22966
|
},
|
|
22961
|
-
error: (touched === null || touched === void 0 ? void 0 : (_touched_filters1 = touched.filters) === null || _touched_filters1 === void 0 ? void 0 : (_touched_filters_filterKey1 = _touched_filters1[filterKey]) === null || _touched_filters_filterKey1 === void 0 ? void 0 : (_touched_filters_filterKey_rowIndex1 = _touched_filters_filterKey1[rowIndex]) === null || _touched_filters_filterKey_rowIndex1 === void 0 ? void 0 : _touched_filters_filterKey_rowIndex1.op) && (errors === null || errors === void 0 ? void 0 : (_errors_filters1 = errors.filters) === null || _errors_filters1 === void 0 ? void 0 : (_errors_filters_filterKey1 = _errors_filters1[filterKey]) === null || _errors_filters_filterKey1 === void 0 ? void 0 : (_errors_filters_filterKey_rowIndex1 = _errors_filters_filterKey1[rowIndex]) === null || _errors_filters_filterKey_rowIndex1 === void 0 ? void 0 : _errors_filters_filterKey_rowIndex1.op),
|
|
22967
|
+
error: !!(touched === null || touched === void 0 ? void 0 : (_touched_filters1 = touched.filters) === null || _touched_filters1 === void 0 ? void 0 : (_touched_filters_filterKey1 = _touched_filters1[filterKey]) === null || _touched_filters_filterKey1 === void 0 ? void 0 : (_touched_filters_filterKey_rowIndex1 = _touched_filters_filterKey1[rowIndex]) === null || _touched_filters_filterKey_rowIndex1 === void 0 ? void 0 : _touched_filters_filterKey_rowIndex1.op) && !!(errors === null || errors === void 0 ? void 0 : (_errors_filters1 = errors.filters) === null || _errors_filters1 === void 0 ? void 0 : (_errors_filters_filterKey1 = _errors_filters1[filterKey]) === null || _errors_filters_filterKey1 === void 0 ? void 0 : (_errors_filters_filterKey_rowIndex1 = _errors_filters_filterKey1[rowIndex]) === null || _errors_filters_filterKey_rowIndex1 === void 0 ? void 0 : _errors_filters_filterKey_rowIndex1.op),
|
|
22962
22968
|
options: operatorOptions,
|
|
22963
22969
|
sz: "lg",
|
|
22964
22970
|
setValue: function(value) {
|
|
@@ -22970,7 +22976,7 @@ var FilterRow = function(param) {
|
|
|
22970
22976
|
/*#__PURE__*/ jsx(MultiInputContainer, {
|
|
22971
22977
|
children: currentFilter.field === 'select' ? /*#__PURE__*/ jsx(Select, {
|
|
22972
22978
|
name: "filters.".concat(filterKey, ".").concat(rowIndex, ".terms"),
|
|
22973
|
-
value: currentFilter === null || currentFilter === void 0 ? void 0 : currentFilter.terms,
|
|
22979
|
+
value: currentFilter === null || currentFilter === void 0 ? void 0 : (_currentFilter_terms = currentFilter.terms) === null || _currentFilter_terms === void 0 ? void 0 : _currentFilter_terms[0],
|
|
22974
22980
|
style: {
|
|
22975
22981
|
width: '100%'
|
|
22976
22982
|
},
|
|
@@ -22985,7 +22991,7 @@ var FilterRow = function(param) {
|
|
|
22985
22991
|
setValues: function(terms) {
|
|
22986
22992
|
return onChange("filters.".concat(filterKey, ".").concat(rowIndex, ".terms"), terms);
|
|
22987
22993
|
},
|
|
22988
|
-
error: (touched === null || touched === void 0 ? void 0 : (_touched_filters2 = touched.filters) === null || _touched_filters2 === void 0 ? void 0 : (_touched_filters_filterKey2 = _touched_filters2[filterKey]) === null || _touched_filters_filterKey2 === void 0 ? void 0 : (_touched_filters_filterKey_rowIndex2 = _touched_filters_filterKey2[rowIndex]) === null || _touched_filters_filterKey_rowIndex2 === void 0 ? void 0 : _touched_filters_filterKey_rowIndex2.terms) && (errors === null || errors === void 0 ? void 0 : (_errors_filters2 = errors.filters) === null || _errors_filters2 === void 0 ? void 0 : (_errors_filters_filterKey2 = _errors_filters2[filterKey]) === null || _errors_filters_filterKey2 === void 0 ? void 0 : (_errors_filters_filterKey_rowIndex2 = _errors_filters_filterKey2[rowIndex]) === null || _errors_filters_filterKey_rowIndex2 === void 0 ? void 0 : _errors_filters_filterKey_rowIndex2.terms),
|
|
22994
|
+
error: !!(touched === null || touched === void 0 ? void 0 : (_touched_filters2 = touched.filters) === null || _touched_filters2 === void 0 ? void 0 : (_touched_filters_filterKey2 = _touched_filters2[filterKey]) === null || _touched_filters_filterKey2 === void 0 ? void 0 : (_touched_filters_filterKey_rowIndex2 = _touched_filters_filterKey2[rowIndex]) === null || _touched_filters_filterKey_rowIndex2 === void 0 ? void 0 : _touched_filters_filterKey_rowIndex2.terms) && !!(errors === null || errors === void 0 ? void 0 : (_errors_filters2 = errors.filters) === null || _errors_filters2 === void 0 ? void 0 : (_errors_filters_filterKey2 = _errors_filters2[filterKey]) === null || _errors_filters_filterKey2 === void 0 ? void 0 : (_errors_filters_filterKey_rowIndex2 = _errors_filters_filterKey2[rowIndex]) === null || _errors_filters_filterKey_rowIndex2 === void 0 ? void 0 : _errors_filters_filterKey_rowIndex2.terms),
|
|
22989
22995
|
sz: "lg"
|
|
22990
22996
|
})
|
|
22991
22997
|
})
|
|
@@ -23234,7 +23240,6 @@ var FilterForm = function(param) {
|
|
|
23234
23240
|
children: [
|
|
23235
23241
|
Object.entries(values.filters).map(function(param, index) {
|
|
23236
23242
|
var _param = _sliced_to_array$d(param, 2), filterKey = _param[0], filterGroup = _param[1];
|
|
23237
|
-
var _errors_filterKey;
|
|
23238
23243
|
return /*#__PURE__*/ jsxs(FilterGroup, {
|
|
23239
23244
|
isHovered: isHovered === index,
|
|
23240
23245
|
children: [
|
|
@@ -23278,7 +23283,7 @@ var FilterForm = function(param) {
|
|
|
23278
23283
|
children: /*#__PURE__*/ jsx(Button, {
|
|
23279
23284
|
type: "button",
|
|
23280
23285
|
color: "secondary",
|
|
23281
|
-
disabled: errors === null || errors === void 0 ? void 0 :
|
|
23286
|
+
disabled: !!(errors === null || errors === void 0 ? void 0 : errors[filterKey]),
|
|
23282
23287
|
title: "Add filter condition",
|
|
23283
23288
|
size: "large",
|
|
23284
23289
|
style: {
|
|
@@ -23295,7 +23300,7 @@ var FilterForm = function(param) {
|
|
|
23295
23300
|
}),
|
|
23296
23301
|
/*#__PURE__*/ jsx(OrButton, {
|
|
23297
23302
|
type: "button",
|
|
23298
|
-
disabled: errors
|
|
23303
|
+
disabled: !!errors,
|
|
23299
23304
|
onClick: handleAddFilter,
|
|
23300
23305
|
title: "Add filter",
|
|
23301
23306
|
children: "Or"
|
|
@@ -23305,7 +23310,7 @@ var FilterForm = function(param) {
|
|
|
23305
23310
|
/*#__PURE__*/ jsx(Button, {
|
|
23306
23311
|
type: "button",
|
|
23307
23312
|
color: "primary",
|
|
23308
|
-
disabled: errors
|
|
23313
|
+
disabled: !!errors,
|
|
23309
23314
|
size: "large",
|
|
23310
23315
|
style: {
|
|
23311
23316
|
width: '100%'
|
|
@@ -23795,11 +23800,9 @@ function _templateObject1$c() {
|
|
|
23795
23800
|
}
|
|
23796
23801
|
function _templateObject2$c() {
|
|
23797
23802
|
var data = _tagged_template_literal$g([
|
|
23798
|
-
"\n flex: 1;\n z-index: 2;\n pointer-events: none;\n border: none;\n background-color: transparent;\n\n -webkit-appearance: none;\n -moz-appearance: none;\n &::-ms-expand {\n display: none;\n }\n
|
|
23799
|
-
";\n }\n color: ",
|
|
23803
|
+
"\n flex: 1;\n z-index: 2;\n pointer-events: none;\n border: none;\n background-color: transparent;\n\n -webkit-appearance: none;\n -moz-appearance: none;\n &::-ms-expand {\n display: none;\n }\n color: ",
|
|
23800
23804
|
";\n padding: ",
|
|
23801
|
-
";\n padding-right: 2rem;\n outline: none;\n
|
|
23802
|
-
";\n opacity: 0.3;\n }\n\n ",
|
|
23805
|
+
";\n padding-right: 2rem;\n outline: none;\n\n ",
|
|
23803
23806
|
"\n"
|
|
23804
23807
|
]);
|
|
23805
23808
|
_templateObject2$c = function _templateObject() {
|
|
@@ -23884,13 +23887,13 @@ var MultiSelectWrapper = styled.div(_templateObject1$c(), function(param) {
|
|
|
23884
23887
|
return disabled || type === 'secondary' ? neutral100 : 'white';
|
|
23885
23888
|
});
|
|
23886
23889
|
// Style for the Select itself
|
|
23887
|
-
var BaseSelect$1 = styled.select(_templateObject2$c(),
|
|
23888
|
-
var
|
|
23889
|
-
return
|
|
23890
|
+
var BaseSelect$1 = styled.select(_templateObject2$c(), function(param) {
|
|
23891
|
+
var hasValue = param.hasValue;
|
|
23892
|
+
return hasValue ? textPrimary : neutral500;
|
|
23890
23893
|
}, function(param) {
|
|
23891
23894
|
var sz = param.sz;
|
|
23892
23895
|
return sz === 'lg' ? '0.5rem 0.563rem' : '0.375rem 0.563rem';
|
|
23893
|
-
},
|
|
23896
|
+
}, function(param) {
|
|
23894
23897
|
var sz = param.sz, type = param.type;
|
|
23895
23898
|
return type === 'primary' ? sz === 'lg' ? $paragraph100Regular : $paragraph200Regular : sz === 'lg' ? $paragraph100Semibold : $paragraph200Semibold;
|
|
23896
23899
|
});
|
|
@@ -23971,19 +23974,19 @@ var MultiSelect = function(_param) {
|
|
|
23971
23974
|
/*#__PURE__*/ jsx(BaseSelect$1, _object_spread_props$j(_object_spread$n({}, props), {
|
|
23972
23975
|
type: type,
|
|
23973
23976
|
sz: sz,
|
|
23974
|
-
value:
|
|
23975
|
-
|
|
23977
|
+
value: "",
|
|
23978
|
+
hasValue: values.length > 0,
|
|
23976
23979
|
disabled: disabled,
|
|
23980
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
23981
|
+
onChange: function() {},
|
|
23977
23982
|
children: !values.length ? /*#__PURE__*/ jsx(PlaceholderOption, {
|
|
23978
23983
|
value: "",
|
|
23979
23984
|
disabled: true,
|
|
23980
23985
|
hidden: true,
|
|
23981
|
-
selected: true,
|
|
23982
23986
|
children: "".concat(placeholder || 'Please select...')
|
|
23983
23987
|
}) : !chips && /*#__PURE__*/ jsx(SelectedOption, {
|
|
23984
23988
|
value: "",
|
|
23985
23989
|
hidden: true,
|
|
23986
|
-
selected: true,
|
|
23987
23990
|
children: "".concat(label || 'Selected', " (").concat(values.length, ")")
|
|
23988
23991
|
})
|
|
23989
23992
|
})),
|
|
@@ -24688,7 +24691,8 @@ function _templateObject$d() {
|
|
|
24688
24691
|
}
|
|
24689
24692
|
function _templateObject1$a() {
|
|
24690
24693
|
var data = _tagged_template_literal$d([
|
|
24691
|
-
"\n display: flex;\n align-items: center;\n width:
|
|
24694
|
+
"\n display: flex;\n align-items: center;\n width: ",
|
|
24695
|
+
";\n position: relative;\n cursor: ",
|
|
24692
24696
|
";\n &:hover {\n background-color: ",
|
|
24693
24697
|
";\n }\n transition: all 150ms ease-in-out;\n\n &:focus-within {\n border-color: ",
|
|
24694
24698
|
";\n }\n\n &:focus {\n background-color: ",
|
|
@@ -24739,6 +24743,9 @@ function _templateObject4$6() {
|
|
|
24739
24743
|
// Wrapper for the Input and Icons
|
|
24740
24744
|
var InputWrapper = styled.div(_templateObject$d());
|
|
24741
24745
|
var SelectWrapper = styled.div(_templateObject1$a(), function(param) {
|
|
24746
|
+
var fullWidth = param.fullWidth;
|
|
24747
|
+
return fullWidth ? '100%' : 'max-content';
|
|
24748
|
+
}, function(param) {
|
|
24742
24749
|
var disabled = param.disabled;
|
|
24743
24750
|
return disabled ? 'not-allowed' : 'pointer';
|
|
24744
24751
|
}, function(param) {
|
|
@@ -24774,7 +24781,7 @@ var IconWrapper$1 = styled.div(_templateObject3$8(), function(param) {
|
|
|
24774
24781
|
});
|
|
24775
24782
|
var SelectOption = styled.option(_templateObject4$6(), $paragraph100Semibold, textPrimary);
|
|
24776
24783
|
var Select = function(_param) {
|
|
24777
|
-
var _param_sz = _param.sz, sz = _param_sz === void 0 ? 'sm' : _param_sz, _param_error = _param.error, error = _param_error === void 0 ? false : _param_error, _param_options = _param.options, options = _param_options === void 0 ? [] : _param_options; _param.checkbox; var _param_placeholder = _param.placeholder, placeholder = _param_placeholder === void 0 ? 'Please select...' : _param_placeholder, value = _param.value, setValue = _param.setValue; _param.initialValue; var _param_type = _param.type, type = _param_type === void 0 ? 'primary' : _param_type, style = _param.style, _param_maxHeight = _param.maxHeight, maxHeight = _param_maxHeight === void 0 ? '14rem' : _param_maxHeight, _param_disabled = _param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, _param_addClearOption = _param.addClearOption, addClearOption = _param_addClearOption === void 0 ? false : _param_addClearOption, _param_clearOptionLabel = _param.clearOptionLabel, clearOptionLabel = _param_clearOptionLabel === void 0 ? 'Clear' : _param_clearOptionLabel, props = _object_without_properties$c(_param, [
|
|
24784
|
+
var _param_sz = _param.sz, sz = _param_sz === void 0 ? 'sm' : _param_sz, _param_error = _param.error, error = _param_error === void 0 ? false : _param_error, _param_options = _param.options, options = _param_options === void 0 ? [] : _param_options; _param.checkbox; var _param_placeholder = _param.placeholder, placeholder = _param_placeholder === void 0 ? 'Please select...' : _param_placeholder, value = _param.value, setValue = _param.setValue; _param.initialValue; var _param_type = _param.type, type = _param_type === void 0 ? 'primary' : _param_type, style = _param.style, _param_maxHeight = _param.maxHeight, maxHeight = _param_maxHeight === void 0 ? '14rem' : _param_maxHeight, _param_disabled = _param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, _param_addClearOption = _param.addClearOption, addClearOption = _param_addClearOption === void 0 ? false : _param_addClearOption, _param_clearOptionLabel = _param.clearOptionLabel, clearOptionLabel = _param_clearOptionLabel === void 0 ? 'Clear' : _param_clearOptionLabel, fullWidth = _param.fullWidth, props = _object_without_properties$c(_param, [
|
|
24778
24785
|
"sz",
|
|
24779
24786
|
"error",
|
|
24780
24787
|
"options",
|
|
@@ -24788,7 +24795,8 @@ var Select = function(_param) {
|
|
|
24788
24795
|
"maxHeight",
|
|
24789
24796
|
"disabled",
|
|
24790
24797
|
"addClearOption",
|
|
24791
|
-
"clearOptionLabel"
|
|
24798
|
+
"clearOptionLabel",
|
|
24799
|
+
"fullWidth"
|
|
24792
24800
|
]);
|
|
24793
24801
|
var _options_find;
|
|
24794
24802
|
var _useState = _sliced_to_array$9(useState(false), 2), open = _useState[0], setOpen = _useState[1];
|
|
@@ -24809,6 +24817,7 @@ var Select = function(_param) {
|
|
|
24809
24817
|
type: type,
|
|
24810
24818
|
error: error,
|
|
24811
24819
|
open: open,
|
|
24820
|
+
fullWidth: fullWidth,
|
|
24812
24821
|
style: style,
|
|
24813
24822
|
onClick: function() {
|
|
24814
24823
|
return !disabled && setOpen(function(prev) {
|
|
@@ -24822,7 +24831,7 @@ var Select = function(_param) {
|
|
|
24822
24831
|
type: type,
|
|
24823
24832
|
disabled: disabled,
|
|
24824
24833
|
sz: sz,
|
|
24825
|
-
value: value,
|
|
24834
|
+
value: value !== null && value !== void 0 ? value : '',
|
|
24826
24835
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
24827
24836
|
onChange: function() {},
|
|
24828
24837
|
error: error,
|
|
@@ -24830,11 +24839,9 @@ var Select = function(_param) {
|
|
|
24830
24839
|
value: "",
|
|
24831
24840
|
disabled: true,
|
|
24832
24841
|
hidden: true,
|
|
24833
|
-
selected: true,
|
|
24834
24842
|
children: placeholder
|
|
24835
24843
|
}) : /*#__PURE__*/ jsx(SelectOption, {
|
|
24836
24844
|
value: value,
|
|
24837
|
-
selected: true,
|
|
24838
24845
|
hidden: true,
|
|
24839
24846
|
children: ((_options_find = options.find(function(option) {
|
|
24840
24847
|
return option.value === value;
|
|
@@ -34117,53 +34124,46 @@ var ClampWrapper = styled.div(_templateObject7(), function(props) {
|
|
|
34117
34124
|
});
|
|
34118
34125
|
var TableBody = function(param) {
|
|
34119
34126
|
var table = param.table, enableRowSelection = param.enableRowSelection, onRowClick = param.onRowClick, getRowDisabled = param.getRowDisabled, dense = param.dense, _param_testId = param.testId, testId = _param_testId === void 0 ? 'table' : _param_testId;
|
|
34120
|
-
return /*#__PURE__*/
|
|
34121
|
-
children:
|
|
34122
|
-
|
|
34123
|
-
|
|
34124
|
-
|
|
34127
|
+
return /*#__PURE__*/ jsx(StyledTableBody, {
|
|
34128
|
+
children: table.getRowModel().rows.map(function(row) {
|
|
34129
|
+
var rowClickEnabled = enableRowSelection || !!onRowClick;
|
|
34130
|
+
var isDisabled = !!(getRowDisabled === null || getRowDisabled === void 0 ? void 0 : getRowDisabled(row.original));
|
|
34131
|
+
return /*#__PURE__*/ jsx(Tr, {
|
|
34132
|
+
role: rowClickEnabled ? 'button' : undefined,
|
|
34133
|
+
disabled: isDisabled,
|
|
34134
|
+
onClick: onRowClick ? function() {
|
|
34135
|
+
return !isDisabled && onRowClick(row.original);
|
|
34136
|
+
} : row.getToggleSelectedHandler(),
|
|
34137
|
+
style: {
|
|
34138
|
+
cursor: rowClickEnabled ? isDisabled ? 'not-allowed' : 'pointer' : undefined,
|
|
34139
|
+
background: row.getIsSelected() ? primary100 : undefined
|
|
34140
|
+
},
|
|
34141
|
+
enableHover: rowClickEnabled,
|
|
34142
|
+
"data-testid": "".concat(testId, "-row-").concat(row.id),
|
|
34143
|
+
children: row.getVisibleCells().map(function(cell) {
|
|
34144
|
+
var cellValue = cell.getValue();
|
|
34145
|
+
var columnDef = cell.column.columnDef;
|
|
34146
|
+
var overflow = columnDef.overflow;
|
|
34147
|
+
var maxLines = columnDef.maxLines;
|
|
34148
|
+
var autoWidth = columnDef.autoWidth;
|
|
34149
|
+
var cellContent = flexRender(cell.column.columnDef.cell, cell.getContext());
|
|
34150
|
+
return /*#__PURE__*/ jsx(Td, {
|
|
34151
|
+
variant: "paragraph200Regular",
|
|
34152
|
+
as: "td",
|
|
34153
|
+
title: typeof cellValue === 'string' ? cellValue : undefined,
|
|
34154
|
+
cellOverflow: overflow,
|
|
34155
|
+
style: {
|
|
34156
|
+
width: autoWidth ? 'auto' : "".concat(cell.column.getSize(), "px"),
|
|
34157
|
+
padding: dense ? "".concat(spacing(1), "px ").concat(spacing(cell.column.id === 'row-select' ? 1 : 1.5), "px") : "".concat(spacing(1.5), "px ").concat(spacing(cell.column.id === 'row-select' ? 1 : 1.5), "px")
|
|
34158
|
+
},
|
|
34159
|
+
children: overflow === 'clamp' && maxLines ? /*#__PURE__*/ jsx(ClampWrapper, {
|
|
34160
|
+
maxLines: maxLines,
|
|
34161
|
+
children: cellContent
|
|
34162
|
+
}) : cellContent
|
|
34163
|
+
}, cell.id);
|
|
34125
34164
|
})
|
|
34126
|
-
})
|
|
34127
|
-
|
|
34128
|
-
var rowClickEnabled = enableRowSelection || !!onRowClick;
|
|
34129
|
-
var isDisabled = !!(getRowDisabled === null || getRowDisabled === void 0 ? void 0 : getRowDisabled(row.original));
|
|
34130
|
-
return /*#__PURE__*/ jsx(Tr, {
|
|
34131
|
-
role: rowClickEnabled ? 'button' : undefined,
|
|
34132
|
-
disabled: isDisabled,
|
|
34133
|
-
onClick: onRowClick ? function() {
|
|
34134
|
-
return !isDisabled && onRowClick(row.original);
|
|
34135
|
-
} : row.getToggleSelectedHandler(),
|
|
34136
|
-
style: {
|
|
34137
|
-
cursor: rowClickEnabled ? isDisabled ? 'not-allowed' : 'pointer' : undefined,
|
|
34138
|
-
background: row.getIsSelected() ? primary100 : undefined
|
|
34139
|
-
},
|
|
34140
|
-
enableHover: rowClickEnabled,
|
|
34141
|
-
"data-testid": "".concat(testId, "-row-").concat(row.id),
|
|
34142
|
-
children: row.getVisibleCells().map(function(cell) {
|
|
34143
|
-
var cellValue = cell.getValue();
|
|
34144
|
-
var columnDef = cell.column.columnDef;
|
|
34145
|
-
var overflow = columnDef.overflow;
|
|
34146
|
-
var maxLines = columnDef.maxLines;
|
|
34147
|
-
var autoWidth = columnDef.autoWidth;
|
|
34148
|
-
var cellContent = flexRender(cell.column.columnDef.cell, cell.getContext());
|
|
34149
|
-
return /*#__PURE__*/ jsx(Td, {
|
|
34150
|
-
variant: "paragraph200Regular",
|
|
34151
|
-
as: "td",
|
|
34152
|
-
title: typeof cellValue === 'string' ? cellValue : undefined,
|
|
34153
|
-
cellOverflow: overflow,
|
|
34154
|
-
style: {
|
|
34155
|
-
width: autoWidth ? 'auto' : "".concat(cell.column.getSize(), "px"),
|
|
34156
|
-
padding: dense ? "".concat(spacing(1), "px ").concat(spacing(cell.column.id === 'row-select' ? 1 : 1.5), "px") : "".concat(spacing(1.5), "px ").concat(spacing(cell.column.id === 'row-select' ? 1 : 1.5), "px")
|
|
34157
|
-
},
|
|
34158
|
-
children: overflow === 'clamp' && maxLines ? /*#__PURE__*/ jsx(ClampWrapper, {
|
|
34159
|
-
maxLines: maxLines,
|
|
34160
|
-
children: cellContent
|
|
34161
|
-
}) : cellContent
|
|
34162
|
-
}, cell.id);
|
|
34163
|
-
})
|
|
34164
|
-
}, row.id);
|
|
34165
|
-
})
|
|
34166
|
-
]
|
|
34165
|
+
}, row.id);
|
|
34166
|
+
})
|
|
34167
34167
|
});
|
|
34168
34168
|
};
|
|
34169
34169
|
|
|
@@ -34653,6 +34653,11 @@ var Table = function(param) {
|
|
|
34653
34653
|
}),
|
|
34654
34654
|
/*#__PURE__*/ jsxs(TableWrapper, {
|
|
34655
34655
|
children: [
|
|
34656
|
+
/*#__PURE__*/ jsx("colgroup", {
|
|
34657
|
+
children: table.getAllColumns().map(function(column) {
|
|
34658
|
+
return /*#__PURE__*/ jsx("col", {}, column.id);
|
|
34659
|
+
})
|
|
34660
|
+
}),
|
|
34656
34661
|
/*#__PURE__*/ jsx(TableHeader, {
|
|
34657
34662
|
table: table,
|
|
34658
34663
|
disableControls: disableControls,
|
package/package.json
CHANGED
|
@@ -4,6 +4,8 @@ export type CalendarProps = {
|
|
|
4
4
|
selectedDate?: Date | null;
|
|
5
5
|
startDate?: Date | null;
|
|
6
6
|
endDate?: Date | null;
|
|
7
|
+
minDate?: Date | null;
|
|
8
|
+
maxDate?: Date | null;
|
|
7
9
|
onChange?: ((date: Date, event?: MouseEvent<HTMLElement> | KeyboardEvent<HTMLElement>) => void) | ((dates: [Date, Date | null], event?: MouseEvent<HTMLElement, MouseEvent> | KeyboardEvent<HTMLElement>) => void);
|
|
8
10
|
};
|
|
9
11
|
export declare const Calendar: FC<CalendarProps>;
|
|
@@ -5,6 +5,8 @@ export interface DatePickerProps {
|
|
|
5
5
|
selectedDate?: Date | null;
|
|
6
6
|
startDate?: Date | null;
|
|
7
7
|
endDate?: Date | null;
|
|
8
|
+
minDate?: Date | null;
|
|
9
|
+
maxDate?: Date | null;
|
|
8
10
|
onChange: ((date: Date | null) => void) | ((dates: [Date, Date | null]) => void);
|
|
9
11
|
side?: AnchorSide;
|
|
10
12
|
align?: AnchorAlign;
|
|
@@ -13,6 +13,9 @@ export interface FieldOption {
|
|
|
13
13
|
export interface FilterFormValues {
|
|
14
14
|
filters: Record<string, Record<string, FilterValue>>;
|
|
15
15
|
}
|
|
16
|
+
export interface NestedFormState {
|
|
17
|
+
[key: string]: NestedFormState | undefined;
|
|
18
|
+
}
|
|
16
19
|
export interface FilterFormProps {
|
|
17
20
|
values: FilterFormValues;
|
|
18
21
|
fieldOptions: FieldOption[];
|
|
@@ -22,8 +25,8 @@ export interface FilterFormProps {
|
|
|
22
25
|
}[];
|
|
23
26
|
onSubmit: () => void;
|
|
24
27
|
onClear?: () => void;
|
|
25
|
-
onChange: (path: string, value:
|
|
26
|
-
errors?:
|
|
27
|
-
touched?:
|
|
28
|
+
onChange: (path: string, value: unknown) => void;
|
|
29
|
+
errors?: NestedFormState;
|
|
30
|
+
touched?: NestedFormState;
|
|
28
31
|
}
|
|
29
32
|
export declare const FilterForm: ({ values, fieldOptions, operatorOptions, onSubmit, onClear, onChange, errors, touched, }: FilterFormProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { FilterFormValues } from './FilterForm';
|
|
1
|
+
import { FilterFormValues, NestedFormState } from './FilterForm';
|
|
2
2
|
interface FilterRowProps {
|
|
3
3
|
filterKey: string;
|
|
4
4
|
rowIndex: string;
|
|
5
5
|
values: FilterFormValues;
|
|
6
|
-
errors?:
|
|
7
|
-
touched?:
|
|
8
|
-
onChange: (path: string, value:
|
|
6
|
+
errors?: NestedFormState;
|
|
7
|
+
touched?: NestedFormState;
|
|
8
|
+
onChange: (path: string, value: unknown) => void;
|
|
9
9
|
onRemove: () => void;
|
|
10
10
|
fieldOptions: {
|
|
11
11
|
label: string;
|
|
@@ -4,8 +4,8 @@ interface MultiInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
|
4
4
|
type?: 'primary' | 'secondary';
|
|
5
5
|
isFocused?: boolean;
|
|
6
6
|
chips?: boolean;
|
|
7
|
-
values?:
|
|
8
|
-
setValues?: (values:
|
|
7
|
+
values?: string[];
|
|
8
|
+
setValues?: (values: string[]) => void;
|
|
9
9
|
}
|
|
10
10
|
export interface MultiInputValues extends MultiInputProps {
|
|
11
11
|
values: string[];
|
|
@@ -3,7 +3,7 @@ export interface MultiSelectOption {
|
|
|
3
3
|
value: string;
|
|
4
4
|
label: string;
|
|
5
5
|
}
|
|
6
|
-
export interface MultiSelectProps extends BaseSelectProps {
|
|
6
|
+
export interface MultiSelectProps extends Omit<BaseSelectProps, 'value'> {
|
|
7
7
|
values: string[];
|
|
8
8
|
setValues: (value: string[], option?: MultiSelectOption) => void;
|
|
9
9
|
options: MultiSelectOption[];
|
|
@@ -2,9 +2,11 @@ export interface SelectOption {
|
|
|
2
2
|
value: string | null;
|
|
3
3
|
label: string;
|
|
4
4
|
}
|
|
5
|
-
export interface BaseSelectProps extends React.InputHTMLAttributes<HTMLSelectElement> {
|
|
5
|
+
export interface BaseSelectProps extends Omit<React.InputHTMLAttributes<HTMLSelectElement>, 'value'> {
|
|
6
|
+
value?: string | null | undefined;
|
|
6
7
|
sz?: 'sm' | 'lg';
|
|
7
8
|
error?: boolean;
|
|
9
|
+
fullWidth?: boolean;
|
|
8
10
|
leftIcon?: React.ElementType;
|
|
9
11
|
rightIcon?: React.ElementType;
|
|
10
12
|
options?: SelectOption[];
|
|
@@ -16,7 +18,7 @@ export interface BaseSelectProps extends React.InputHTMLAttributes<HTMLSelectEle
|
|
|
16
18
|
clearOptionLabel?: string;
|
|
17
19
|
}
|
|
18
20
|
export interface SelectProps extends BaseSelectProps {
|
|
19
|
-
value:
|
|
20
|
-
setValue: (value: string) => void;
|
|
21
|
+
value: string | null | undefined;
|
|
22
|
+
setValue: (value: string | null) => void;
|
|
21
23
|
}
|
|
22
|
-
export declare const Select: ({ sz, error, options, checkbox, placeholder, value, setValue, initialValue, type, style, maxHeight, disabled, addClearOption, clearOptionLabel, ...props }: SelectProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare const Select: ({ sz, error, options, checkbox, placeholder, value, setValue, initialValue, type, style, maxHeight, disabled, addClearOption, clearOptionLabel, fullWidth, ...props }: SelectProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
package/src/lib/Table/Table.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ interface PaginationProps {
|
|
|
46
46
|
pageInfo?: PageInfoPageBased | PageInfoCursorBased;
|
|
47
47
|
subText?: string;
|
|
48
48
|
onPageSizeChange?: (size: number) => void;
|
|
49
|
-
onPageChange?: (page:
|
|
49
|
+
onPageChange?: (page: number | 'next' | 'prev') => void;
|
|
50
50
|
}
|
|
51
51
|
interface TableDataProps<T> {
|
|
52
52
|
columns: TableColumn<T>[];
|