@ctlyst.id/internal-ui 3.4.4 → 3.4.6

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -1280,6 +1280,7 @@ var getCommonPinningStyles = (column) => {
1280
1280
  const isFirstLeftPinnedColumn = isPinned === "left" && column.getIsFirstColumn("left");
1281
1281
  const isLastLeftPinnedColumn = isPinned === "left" && column.getIsLastColumn("left");
1282
1282
  const isFirstRightPinnedColumn = isPinned === "right" && column.getIsFirstColumn("right");
1283
+ const isLastRightPinnedColumn = isPinned === "right" && column.getIsLastColumn("right");
1283
1284
  return {
1284
1285
  left: isPinned === "left" ? `${column.getStart("left")}px` : void 0,
1285
1286
  right: isPinned === "right" ? `${column.getAfter("right")}px` : void 0,
@@ -1289,6 +1290,9 @@ var getCommonPinningStyles = (column) => {
1289
1290
  ...isFirstLeftPinnedColumn ? {
1290
1291
  pl: "16px"
1291
1292
  } : { pl: "8px" },
1293
+ ...isLastRightPinnedColumn ? {
1294
+ pr: "16px"
1295
+ } : { pr: "8px" },
1292
1296
  ...isLastLeftPinnedColumn ? {
1293
1297
  py: "16px",
1294
1298
  pr: "8px",
@@ -1308,7 +1312,7 @@ var getCommonPinningStyles = (column) => {
1308
1312
  } : {},
1309
1313
  ...isFirstRightPinnedColumn ? {
1310
1314
  py: "16px",
1311
- px: "8px",
1315
+ pl: "8px",
1312
1316
  "&:after": {
1313
1317
  transition: "all 0.3s",
1314
1318
  content: "''",
@@ -1522,17 +1526,17 @@ var DataTable = React5.forwardRef((props, ref) => {
1522
1526
  gap: 2,
1523
1527
  children: [
1524
1528
  (0, import_react_table.flexRender)(header.column.columnDef.header, header.getContext()),
1525
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1529
+ (_b2 = header.column.getCanSort() && {
1530
+ asc: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_icons2.ChevronUpIcon, { h: 4, w: 4, color: "neutral.500" }),
1531
+ desc: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_icons2.ChevronDownIcon, { h: 4, w: 4, color: "neutral.500" })
1532
+ }[header.column.getIsSorted()]) != null ? _b2 : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1526
1533
  import_react28.Box,
1527
1534
  {
1528
1535
  as: "span",
1529
1536
  cursor: header.column.getCanSort() ? "pointer" : "default",
1530
1537
  "data-test-id": `CT_Container_SortingIcon_${header.id}`,
1531
1538
  onClick: header.column.getToggleSortingHandler(),
1532
- children: (_b2 = header.column.getCanSort() && {
1533
- asc: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_icons2.ChevronUpIcon, { h: 4, w: 4, color: "neutral.500" }),
1534
- desc: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_icons2.ChevronDownIcon, { h: 4, w: 4, color: "neutral.500" })
1535
- }[header.column.getIsSorted()]) != null ? _b2 : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react28.Box, { display: "flex", justifyContent: "center", alignItems: "center", boxSize: 4, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_icons2.UpDownIcon, { color: "neutral.500" }) })
1539
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react28.Box, { display: "flex", justifyContent: "center", alignItems: "center", boxSize: 4, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_icons2.UpDownIcon, { color: "neutral.500" }) })
1536
1540
  }
1537
1541
  )
1538
1542
  ]
@@ -5872,7 +5876,6 @@ var Uploader = ({
5872
5876
  onDrop,
5873
5877
  maxFiles: 1,
5874
5878
  noClick: isDisabled,
5875
- disabled: !!filePreview,
5876
5879
  noDrag: isDisabled
5877
5880
  });
5878
5881
  const renderHelperText = () => {
@@ -5975,60 +5978,49 @@ var Uploader = ({
5975
5978
  )
5976
5979
  }
5977
5980
  ) }),
5978
- !filePreview && /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_jsx_runtime66.Fragment, { children: [
5979
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
5980
- "input",
5981
- {
5982
- "data-test-id": `CT_component_base-image-uploader_input-file${testId ? `_${testId}` : ""}`,
5983
- ...getInputProps()
5984
- }
5985
- ),
5986
- isDragActive ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_react88.Text, { children: dragActiveText != null ? dragActiveText : messages.dragActive }) : /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_react88.Flex, { gap: 2, flexDirection: "column", alignItems: "center", color: isError ? "danger.500" : color, children: [
5987
- size2 === "sm" && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_internal_icon11.Plus, { size: 6, color }),
5988
- /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_react88.Box, { children: [
5989
- !filePreview && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
5990
- import_react88.Heading,
5991
- {
5992
- fontWeight: "400",
5993
- fontSize: size2 === "sm" ? "text.md" : "text.xl",
5994
- mb: size2 === "sm" ? "0" : "2",
5995
- textAlign: "center",
5996
- children: uploadFileText && size2 === "lg" ? uploadFileText : "Upload"
5997
- }
5998
- ),
5999
- size2 === "lg" && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_react88.Text, { fontSize: 12, children: filePreview ? dragReplaceText != null ? dragReplaceText : messages.dragReplace : dragInActiveText != null ? dragInActiveText : messages.dragInActive })
6000
- ] })
5981
+ !filePreview && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_jsx_runtime66.Fragment, { children: isDragActive ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_react88.Text, { children: dragActiveText != null ? dragActiveText : messages.dragActive }) : /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_react88.Flex, { gap: 2, flexDirection: "column", alignItems: "center", color: isError ? "danger.500" : color, children: [
5982
+ size2 === "sm" && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_internal_icon11.Plus, { size: 6, color }),
5983
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_react88.Box, { children: [
5984
+ !filePreview && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
5985
+ import_react88.Heading,
5986
+ {
5987
+ fontWeight: "400",
5988
+ fontSize: size2 === "sm" ? "text.md" : "text.xl",
5989
+ mb: size2 === "sm" ? "0" : "2",
5990
+ textAlign: "center",
5991
+ children: uploadFileText && size2 === "lg" ? uploadFileText : "Upload"
5992
+ }
5993
+ ),
5994
+ size2 === "lg" && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_react88.Text, { fontSize: 12, children: filePreview ? dragReplaceText != null ? dragReplaceText : messages.dragReplace : dragInActiveText != null ? dragInActiveText : messages.dragInActive })
6001
5995
  ] })
6002
- ] })
5996
+ ] }) })
6003
5997
  ]
6004
5998
  }
6005
5999
  ),
6006
- filePreview && !isSmall && /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_react88.Flex, { align: "center", justify: "center", my: 2, children: [
6007
- /* @__PURE__ */ (0, import_react90.createElement)(
6008
- "input",
6009
- {
6010
- ...getInputProps(),
6011
- key: Math.random(),
6012
- ref: inputRef,
6013
- accept: "image/*",
6014
- "data-test-id": `CT_component_base-image-uploader_change-img${testId ? `_${testId}` : ""}`
6015
- }
6016
- ),
6017
- isShowReupload && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
6018
- import_react88.Button,
6019
- {
6020
- "data-test-id": `CT_component_base-image-uploader_change-img-btn${testId ? `_${testId}` : ""}`,
6021
- type: "button",
6022
- size: "sm",
6023
- variant: "outline",
6024
- onClick: () => {
6025
- var _a;
6026
- (_a = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a.click();
6027
- },
6028
- children: "Ubah Foto"
6029
- }
6030
- )
6031
- ] }),
6000
+ /* @__PURE__ */ (0, import_react90.createElement)(
6001
+ "input",
6002
+ {
6003
+ ...getInputProps(),
6004
+ key: Math.random(),
6005
+ ref: inputRef,
6006
+ accept: "image/*",
6007
+ "data-test-id": `CT_component_base-image-uploader_change-img${testId ? `_${testId}` : ""}`
6008
+ }
6009
+ ),
6010
+ filePreview && !isSmall && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_react88.Flex, { align: "center", justify: "center", my: 2, children: isShowReupload && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
6011
+ import_react88.Button,
6012
+ {
6013
+ "data-test-id": `CT_component_base-image-uploader_change-img-btn${testId ? `_${testId}` : ""}`,
6014
+ type: "button",
6015
+ size: "sm",
6016
+ variant: "outline",
6017
+ onClick: () => {
6018
+ var _a;
6019
+ (_a = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a.click();
6020
+ },
6021
+ children: "Ubah Foto"
6022
+ }
6023
+ ) }),
6032
6024
  renderErrorText(errorText),
6033
6025
  renderHelperText()
6034
6026
  ] });