@stella-source/stellasource-dsl 5.1.0 → 5.2.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/dist/cjs/index.js +32 -16
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/Table/styles.d.ts +7 -2
- package/dist/cjs/types/components/TextField/NumberInput/NumberInput.d.ts +1 -1
- package/dist/cjs/types/components/TextField/NumberInput/types.d.ts +1 -0
- package/dist/cjs/types/components/TextField/PasswordInput/PasswordInput.d.ts +1 -1
- package/dist/cjs/types/components/TextField/PasswordInput/types.d.ts +1 -0
- package/dist/cjs/types/components/TextField/TextFieldContainer.d.ts +1 -1
- package/dist/cjs/types/components/TextField/TextInput/TextInput.d.ts +1 -1
- package/dist/cjs/types/components/TextField/TextInput/types.d.ts +1 -0
- package/dist/cjs/types/components/TextField/styles.d.ts +8 -2
- package/dist/cjs/types/components/TextField/types.d.ts +1 -0
- package/dist/esm/index.esm.js +32 -16
- package/dist/esm/index.esm.js.map +1 -1
- package/dist/esm/types/components/Table/styles.d.ts +7 -2
- package/dist/esm/types/components/TextField/NumberInput/NumberInput.d.ts +1 -1
- package/dist/esm/types/components/TextField/NumberInput/types.d.ts +1 -0
- package/dist/esm/types/components/TextField/PasswordInput/PasswordInput.d.ts +1 -1
- package/dist/esm/types/components/TextField/PasswordInput/types.d.ts +1 -0
- package/dist/esm/types/components/TextField/TextFieldContainer.d.ts +1 -1
- package/dist/esm/types/components/TextField/TextInput/TextInput.d.ts +1 -1
- package/dist/esm/types/components/TextField/TextInput/types.d.ts +1 -0
- package/dist/esm/types/components/TextField/styles.d.ts +8 -2
- package/dist/esm/types/components/TextField/types.d.ts +1 -0
- package/dist/index.d.ts +6 -3
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -18177,12 +18177,24 @@ const IconButton = a$n.forwardRef(({ iconName, onClick, disabled, variant = "pri
|
|
|
18177
18177
|
|
|
18178
18178
|
const Wrapper = styled.div `
|
|
18179
18179
|
display: flex;
|
|
18180
|
-
flex-direction: column;
|
|
18180
|
+
flex-direction: ${({ $labelPosition }) => $labelPosition === "left" ? "row" : "column"};
|
|
18181
|
+
align-items: ${({ $labelPosition }) => $labelPosition === "left" ? "flex-start" : "stretch"};
|
|
18182
|
+
gap: ${({ $labelPosition }) => ($labelPosition === "left" ? "10px" : "0")};
|
|
18181
18183
|
min-width: 60px;
|
|
18182
18184
|
max-width: 400px;
|
|
18183
18185
|
position: relative;
|
|
18184
18186
|
width: 100%;
|
|
18185
18187
|
`;
|
|
18188
|
+
const InputColumn = styled.div `
|
|
18189
|
+
display: flex;
|
|
18190
|
+
flex-direction: column;
|
|
18191
|
+
flex: 1;
|
|
18192
|
+
`;
|
|
18193
|
+
const LabelAligner = styled.div `
|
|
18194
|
+
height: 32px;
|
|
18195
|
+
display: flex;
|
|
18196
|
+
align-items: center;
|
|
18197
|
+
`;
|
|
18186
18198
|
const TextFieldWrapper = styled.div.attrs({
|
|
18187
18199
|
className: "DSL-stella-textfield",
|
|
18188
18200
|
}) `
|
|
@@ -18194,7 +18206,7 @@ const TextFieldWrapper = styled.div.attrs({
|
|
|
18194
18206
|
border: 1px solid ${Styles.color.grey.medium};
|
|
18195
18207
|
border-radius: 6px;
|
|
18196
18208
|
overflow: hidden;
|
|
18197
|
-
margin-top: 3px;
|
|
18209
|
+
margin-top: ${({ $labelPosition }) => $labelPosition === "left" ? "0" : "3px"};
|
|
18198
18210
|
background-color: ${({ $isDisabled }) => $isDisabled ? Styles.color.grey.pale : "white"};
|
|
18199
18211
|
outline: ${({ $hasError }) => $hasError && `${Styles.color.states.error} auto 1px`};
|
|
18200
18212
|
cursor: ${({ $isDisabled, $isLoading }) => {
|
|
@@ -18253,10 +18265,9 @@ const IconContainer = styled.div `
|
|
|
18253
18265
|
margin-right: 5px;
|
|
18254
18266
|
`;
|
|
18255
18267
|
|
|
18256
|
-
const TextFieldContainer = ({ id, label, children, tooltipText, endIcon, className, rightCategory, leftCategory, helperText, dataTestId, helperTextAffectLayout = true, disabled = false, hideLabel = false, isLoading = false, hasError = false, isRequired = false, }) => {
|
|
18257
|
-
|
|
18258
|
-
a$n.createElement(
|
|
18259
|
-
a$n.createElement(TextFieldWrapper, { id: id, "$hasError": hasError, "$isDisabled": disabled, "$isLoading": isLoading, "data-testid": "text-input-wrapper" },
|
|
18268
|
+
const TextFieldContainer = ({ id, label, children, tooltipText, endIcon, className, rightCategory, leftCategory, helperText, dataTestId, helperTextAffectLayout = true, disabled = false, hideLabel = false, isLoading = false, hasError = false, isRequired = false, labelPosition = "top", }) => {
|
|
18269
|
+
const inputAndHelper = (a$n.createElement(a$n.Fragment, null,
|
|
18270
|
+
a$n.createElement(TextFieldWrapper, { id: id, "$hasError": hasError, "$isDisabled": disabled, "$isLoading": isLoading, "$labelPosition": labelPosition, "data-testid": "text-input-wrapper" },
|
|
18260
18271
|
leftCategory && a$n.createElement(Category, null, leftCategory),
|
|
18261
18272
|
children,
|
|
18262
18273
|
isLoading && (a$n.createElement(IconContainer, null,
|
|
@@ -18265,9 +18276,13 @@ const TextFieldContainer = ({ id, label, children, tooltipText, endIcon, classNa
|
|
|
18265
18276
|
a$n.createElement(StellaIcon, { dataTestId: "end-icon", iconName: endIcon }))),
|
|
18266
18277
|
rightCategory && a$n.createElement(Category, null, rightCategory)),
|
|
18267
18278
|
helperText && (a$n.createElement(HelperText, { id: `${id}-helper-text`, text: helperText, affectLayout: helperTextAffectLayout, type: hasError ? "error" : "info" }))));
|
|
18279
|
+
return (a$n.createElement(Wrapper, { "data-testid": dataTestId, className: className, "$labelPosition": labelPosition },
|
|
18280
|
+
labelPosition === "left" ? (a$n.createElement(LabelAligner, null,
|
|
18281
|
+
a$n.createElement(Label, { tooltipText: tooltipText, required: isRequired, labelValue: label, hideLabel: hideLabel, id: `${id}-label`, htmlFor: `${id}-text-field` }))) : (a$n.createElement(Label, { tooltipText: tooltipText, required: isRequired, labelValue: label, hideLabel: hideLabel, id: `${id}-label`, htmlFor: `${id}-text-field` })),
|
|
18282
|
+
labelPosition === "left" ? (a$n.createElement(InputColumn, null, inputAndHelper)) : (inputAndHelper)));
|
|
18268
18283
|
};
|
|
18269
18284
|
|
|
18270
|
-
const TextInput = ({ id, className, htmlProps, label, onChange, onBlur, onFocus, value, isRequired, maxLength, tooltipText, helperText, endIcon, placeholder = "", textAlign = "left", helperTextAffectLayout = true, hideLabel = false, disabled = false, hasError = false, isLoading = false, ariaDescribedBy, enableAutocomplete = false, }) => {
|
|
18285
|
+
const TextInput = ({ id, className, htmlProps, label, onChange, onBlur, onFocus, value, isRequired, maxLength, tooltipText, helperText, endIcon, placeholder = "", textAlign = "left", helperTextAffectLayout = true, hideLabel = false, disabled = false, hasError = false, isLoading = false, ariaDescribedBy, enableAutocomplete = false, labelPosition, }) => {
|
|
18271
18286
|
const containerProps = {
|
|
18272
18287
|
id,
|
|
18273
18288
|
label,
|
|
@@ -18283,6 +18298,7 @@ const TextInput = ({ id, className, htmlProps, label, onChange, onBlur, onFocus,
|
|
|
18283
18298
|
endIcon,
|
|
18284
18299
|
disabled,
|
|
18285
18300
|
isLoading,
|
|
18301
|
+
labelPosition,
|
|
18286
18302
|
};
|
|
18287
18303
|
const [inputValue, setInputValue] = a$n.useState("");
|
|
18288
18304
|
const valueToUse = value ?? inputValue;
|
|
@@ -18299,7 +18315,7 @@ const CustomIconButton$2 = styled(IconButton) `
|
|
|
18299
18315
|
margin-right: 2px;
|
|
18300
18316
|
`;
|
|
18301
18317
|
|
|
18302
|
-
const PasswordInput = ({ id, className, htmlProps, label, placeholder = "Enter Password", onChange, onBlur, onFocus, value, isRequired, maxLength, tooltipText, helperText, textAlign = "left", isHidden = true, helperTextAffectLayout = true, hideLabel = false, disabled = false, hasError = false, ariaDescribedBy, enableAutocomplete = false, }) => {
|
|
18318
|
+
const PasswordInput = ({ id, className, htmlProps, label, placeholder = "Enter Password", onChange, onBlur, onFocus, value, isRequired, maxLength, tooltipText, helperText, textAlign = "left", isHidden = true, helperTextAffectLayout = true, hideLabel = false, disabled = false, hasError = false, ariaDescribedBy, enableAutocomplete = false, labelPosition, }) => {
|
|
18303
18319
|
const containerProps = {
|
|
18304
18320
|
id,
|
|
18305
18321
|
label,
|
|
@@ -18313,6 +18329,7 @@ const PasswordInput = ({ id, className, htmlProps, label, placeholder = "Enter P
|
|
|
18313
18329
|
leftCategory: undefined,
|
|
18314
18330
|
hideLabel,
|
|
18315
18331
|
disabled,
|
|
18332
|
+
labelPosition,
|
|
18316
18333
|
};
|
|
18317
18334
|
const [inputValue, setInputValue] = a$n.useState("");
|
|
18318
18335
|
const [show, setShow] = a$n.useState(!isHidden);
|
|
@@ -18351,7 +18368,7 @@ const formatDynamicNumbersWithCommas = (num, decimalPlaces, isDegrees) => {
|
|
|
18351
18368
|
: "";
|
|
18352
18369
|
};
|
|
18353
18370
|
|
|
18354
|
-
const NumberInput = ({ id, className, htmlProps, leftCategory, rightCategory, label, onChange, onBlur, onFocus, value, isRequired, maxLength, tooltipText, helperText, endIcon, placeholder = "0", textAlign = "left", isTruncated = false, helperTextAffectLayout = true, hideLabel = false, disabled = false, isLoading = false, hasError = false, thousandSeparator = true, decimalPlaces = 0, allowNegativeNumbers = false, ariaDescribedBy, enableAutocomplete = false, isDegrees = false, }) => {
|
|
18371
|
+
const NumberInput = ({ id, className, htmlProps, leftCategory, rightCategory, label, onChange, onBlur, onFocus, value, isRequired, maxLength, tooltipText, helperText, endIcon, placeholder = "0", textAlign = "left", isTruncated = false, helperTextAffectLayout = true, hideLabel = false, disabled = false, isLoading = false, hasError = false, thousandSeparator = true, decimalPlaces = 0, allowNegativeNumbers = false, ariaDescribedBy, enableAutocomplete = false, isDegrees = false, labelPosition, }) => {
|
|
18355
18372
|
const containerProps = {
|
|
18356
18373
|
id,
|
|
18357
18374
|
label,
|
|
@@ -18367,6 +18384,7 @@ const NumberInput = ({ id, className, htmlProps, leftCategory, rightCategory, la
|
|
|
18367
18384
|
leftCategory,
|
|
18368
18385
|
hideLabel,
|
|
18369
18386
|
disabled,
|
|
18387
|
+
labelPosition,
|
|
18370
18388
|
};
|
|
18371
18389
|
const [inputValue, setInputValue] = a$n.useState("");
|
|
18372
18390
|
const [placeholderText, setPlaceholderText] = a$n.useState(placeholder);
|
|
@@ -22115,6 +22133,7 @@ const HeaderRow = styled.tr `
|
|
|
22115
22133
|
background-color: ${Styles.color.grey.pale};
|
|
22116
22134
|
min-height: 50px;
|
|
22117
22135
|
height: 50px;
|
|
22136
|
+
display: ${({ $isEmpty }) => ($isEmpty ? "none" : "table-row")};
|
|
22118
22137
|
`;
|
|
22119
22138
|
const CellRow = styled.tr `
|
|
22120
22139
|
min-height: 50px;
|
|
@@ -22328,6 +22347,7 @@ const LoadingShimmer = styled.div `
|
|
|
22328
22347
|
`;
|
|
22329
22348
|
const CustomPagination = styled(Pagination) `
|
|
22330
22349
|
border-top: ${({ $hasData }) => $hasData ? "0px" : `1px solid ${Styles.color.grey.light}`};
|
|
22350
|
+
display: ${({ $isEmpty }) => ($isEmpty ? "none" : "flex")};
|
|
22331
22351
|
`;
|
|
22332
22352
|
const KebabAlign = styled.div `
|
|
22333
22353
|
display: flex;
|
|
@@ -22344,12 +22364,8 @@ const EmptyTableSection = styled.section `
|
|
|
22344
22364
|
flex-direction: column;
|
|
22345
22365
|
justify-content: center;
|
|
22346
22366
|
align-items: center;
|
|
22347
|
-
position: absolute;
|
|
22348
22367
|
gap: 20px;
|
|
22349
|
-
|
|
22350
|
-
left: 0;
|
|
22351
|
-
right: 0;
|
|
22352
|
-
margin: 80px auto 0;
|
|
22368
|
+
margin: 0 auto;
|
|
22353
22369
|
`;
|
|
22354
22370
|
const EmptyTableHeader = styled.p `
|
|
22355
22371
|
display: flex;
|
|
@@ -23001,7 +23017,7 @@ function Table({ columns, data, isLoading, serverSide = false, onPageChange, onS
|
|
|
23001
23017
|
}, key: index + "loading-row" }, Array.from({
|
|
23002
23018
|
length: 10,
|
|
23003
23019
|
}).map((_, i) => (a$n.createElement(LoadingShimmer, { key: `${i}-loading`, "$width": "110px", "$height": "25px" }))))))))) : (a$n.createElement(StyledTable, { id: `${id}-table`, ...htmlProps },
|
|
23004
|
-
a$n.createElement("thead", null, table.getHeaderGroups().map((headerGroup) => (a$n.createElement(HeaderRow, { key: headerGroup.id }, headerGroup.headers.map((header, i) => {
|
|
23020
|
+
a$n.createElement("thead", null, table.getHeaderGroups().map((headerGroup) => (a$n.createElement(HeaderRow, { key: headerGroup.id, "$isEmpty": table.getRowModel().rows.length === 0 }, headerGroup.headers.map((header, i) => {
|
|
23005
23021
|
return (a$n.createElement(TableHeaderCell, { key: header.id, serverSide: serverSide, header: header, filters: filters, sorting: sorting, scrollPosition: scrollState, onFilterMenuInteraction: (id, active) => {
|
|
23006
23022
|
setFilterMenuOpen((prev) => ({
|
|
23007
23023
|
...prev,
|
|
@@ -23067,7 +23083,7 @@ function Table({ columns, data, isLoading, serverSide = false, onPageChange, onS
|
|
|
23067
23083
|
renderExpandedRow &&
|
|
23068
23084
|
!!renderExpandedRow(row) && (a$n.createElement(ExpandedContentRow, null,
|
|
23069
23085
|
a$n.createElement(ExpandedContentCell, { colSpan: table.getVisibleLeafColumns().length }, renderExpandedRow(row))))))))))),
|
|
23070
|
-
showPagination && paginationDetails?.totalRows > 0 && (a$n.createElement(CustomPagination, { "$hasData": table.getRowModel().rows.length > 0, totalRows: serverSide ? totalData : table.getFilteredRowModel().rows.length, isLoading: isLoading, rowsPerPage: paginationDetails?.rowsPerPage, startingPage: pageIndex, onPageChange: (page, pageSize) => {
|
|
23086
|
+
showPagination && paginationDetails?.totalRows > 0 && (a$n.createElement(CustomPagination, { "$hasData": table.getRowModel().rows.length > 0, "$isEmpty": table.getRowModel().rows.length === 0, totalRows: serverSide ? totalData : table.getFilteredRowModel().rows.length, isLoading: isLoading, rowsPerPage: paginationDetails?.rowsPerPage, startingPage: pageIndex, onPageChange: (page, pageSize) => {
|
|
23071
23087
|
table.toggleAllRowsSelected(false);
|
|
23072
23088
|
setPageIndex(page);
|
|
23073
23089
|
setPagination((prev) => ({
|