fis-component 0.0.65 → 0.0.67

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.
@@ -11,6 +11,8 @@ export interface SelectFieldProps extends Omit<ComponentPropsWithoutRef<"input">
11
11
  actived?: boolean;
12
12
  /**active-dropdown for current field*/
13
13
  activeDropdown?: boolean;
14
+ /**negative for current field*/
15
+ negative?: boolean;
14
16
  }
15
17
  declare const FISSelectItem: import("react").ForwardRefExoticComponent<SelectFieldProps & import("react").RefAttributes<HTMLInputElement>>;
16
18
  export default FISSelectItem;
package/dist/esm/index.js CHANGED
@@ -73300,12 +73300,35 @@ const DivContainerSC = styled.div `
73300
73300
  color: ${getTheme("com/select/field/default/icon/color-icon/active")};
73301
73301
  }
73302
73302
  }
73303
+
73304
+ // Design chưa có negative
73305
+ &.negative {
73306
+ outline-color: ${getTheme("com/input/field/negative/border/default")};
73307
+ background-color: ${getTheme("com/input/field/negative/background/default")};
73308
+
73309
+ &:hover {
73310
+ outline-color: ${getTheme("com/input/field/negative/border/hover")};
73311
+ background-color: ${getTheme("com/input/field/negative/background/hover")};
73312
+ }
73313
+
73314
+ &:has(${InputSC}:focus) {
73315
+ outline-color: ${getTheme("com/input/field/negative/border/active")};
73316
+ background-color: ${getTheme("com/input/field/negative/background/active")};
73317
+ box-shadow: 0 0 0 ${getTheme("com/actived-mark/gap-spacing")}
73318
+ ${getTheme("com/actived-mark/color-gap-spacing-negative")};
73319
+ }
73320
+
73321
+ &::placeholder {
73322
+ color: ${getTheme("com/input/field/negative/label/color-text/placeholder")};
73323
+ }
73324
+ }
73303
73325
  `;
73304
73326
 
73305
73327
  const FISSelectItem = forwardRef((props, ref) => {
73306
- const { size = "md", iconPrefix, iconSuffix, disabled, activeDropdown, ...rest } = props;
73328
+ const { size = "md", iconPrefix, iconSuffix, disabled, activeDropdown, negative, ...rest } = props;
73307
73329
  return (jsx(DivContainerSC, { className: classNames({
73308
73330
  iconPrefix: iconPrefix,
73331
+ negative: negative,
73309
73332
  }), "$size": size, children: jsxs(DivWrapperSC, { children: [iconPrefix && (jsx(DivIconPrefixSC, { "$size": size, children: iconPrefix })), jsx(InputSC, { ...rest, ref: ref, disabled: disabled, "$size": size }), iconSuffix && (jsx(DivIconSuffixSC, { "$size": size, children: iconSuffix }))] }) }));
73310
73333
  });
73311
73334
  FISSelectItem.displayName = "FISSelectItem";
@@ -73449,7 +73472,7 @@ const FISSelect = forwardRef(({ className, style, size = "md", options, value, d
73449
73472
  document.addEventListener("mousedown", handleClickOutside);
73450
73473
  return () => document.removeEventListener("mousedown", handleClickOutside);
73451
73474
  }, [referenceElement, popperElement]);
73452
- return (jsxs(DivWrapperSC$1, { className: className, style: style, children: [(textLabel || iconLabel) && (jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsx(DivInputWrapperSC, { ref: setReferenceElement, onClick: handleToggle, children: jsx(FISSelectItem, { ...restProps, ref: ref, size: size, iconSuffix: isOpen ? jsx(ArrowUpIcon, {}) : jsx(ArrowDownIcon, {}), value: computedDisplayValue(), disabled: disabled, activeDropdown: isOpen }) }), message && (jsx(SpanHintSC$3, { className: classNames({ disabled, negative, positive }), children: message })), multi && value.length > 0 && (jsx(SelectedTagsWrapper, { children: jsx(MultipleValue, { options: selectedItems, onRemove: handleOptionRemove }) })), isOpen && (jsx(Portal, { portal: portal, children: jsx(DivDropdownMenuSC, { ref: setPopperElement, style: {
73475
+ return (jsxs(DivWrapperSC$1, { className: className, style: style, children: [(textLabel || iconLabel) && (jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsx(DivInputWrapperSC, { ref: setReferenceElement, onClick: handleToggle, children: jsx(FISSelectItem, { ...restProps, ref: ref, size: size, iconSuffix: isOpen ? jsx(ArrowUpIcon, {}) : jsx(ArrowDownIcon, {}), value: computedDisplayValue(), disabled: disabled, activeDropdown: isOpen, negative: negative }) }), message && (jsx(SpanHintSC$3, { className: classNames({ disabled, negative, positive }), children: message })), multi && value.length > 0 && (jsx(SelectedTagsWrapper, { children: jsx(MultipleValue, { options: selectedItems, onRemove: handleOptionRemove }) })), isOpen && (jsx(Portal, { portal: portal, children: jsx(DivDropdownMenuSC, { ref: setPopperElement, style: {
73453
73476
  ...styles.popper,
73454
73477
  width: referenceElement?.offsetWidth,
73455
73478
  zIndex: 9999,
@@ -73601,7 +73624,10 @@ const SpanTotalSC = styled.span `
73601
73624
  const LIMIT_DEFAULT = 10;
73602
73625
  const FISPagination = ({ pageSize = LIMIT_DEFAULT, current = 1, total = 0, minimize, recordCounted, onIconPageRecordClick, showTotal, ...rest }) => {
73603
73626
  const rangeRecords = useMemo$1(() => {
73604
- return [(current - 1) * pageSize + 1, current * pageSize];
73627
+ return [
73628
+ (current - 1) * pageSize + 1,
73629
+ current * pageSize > total ? total : current * pageSize,
73630
+ ];
73605
73631
  }, [current, pageSize, total]);
73606
73632
  const defaultShowTotal = (jsxs(Fragment, { children: ["Hi\u1EC3n th\u1ECB ", rangeRecords[0], "-", rangeRecords[1], recordCounted ? (`trong ${total} bản ghi`) : (jsx(FISIconButton, { size: "xs", icon: jsx(InfoIcon, {}), variant: "tertiary-invisible", onClick: onIconPageRecordClick }))] }));
73607
73633
  // Merge the default props with the provided props