fis-component 0.1.34 → 0.1.36

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/esm/index.js CHANGED
@@ -9275,14 +9275,14 @@ const defaultGetPrefixCls = (suffixCls, customizePrefixCls) => {
9275
9275
  return suffixCls ? `${defaultPrefixCls}-${suffixCls}` : defaultPrefixCls;
9276
9276
  };
9277
9277
  // zombieJ: 🚨 Do not pass `defaultRenderEmpty` here since it will cause circular dependency.
9278
- const ConfigContext = /*#__PURE__*/React.createContext({
9278
+ const ConfigContext$1 = /*#__PURE__*/React.createContext({
9279
9279
  // We provide a default function for Context without provider
9280
9280
  getPrefixCls: defaultGetPrefixCls,
9281
9281
  iconPrefixCls: defaultIconPrefixCls
9282
9282
  });
9283
9283
  const {
9284
9284
  Consumer: ConfigConsumer
9285
- } = ConfigContext;
9285
+ } = ConfigContext$1;
9286
9286
  const EMPTY_OBJECT = {};
9287
9287
  /**
9288
9288
  * Get ConfigProvider configured component props.
@@ -9293,7 +9293,7 @@ const EMPTY_OBJECT = {};
9293
9293
  * which will waste both compare calculation & memory.
9294
9294
  */
9295
9295
  function useComponentConfig(propName) {
9296
- const context = React.useContext(ConfigContext);
9296
+ const context = React.useContext(ConfigContext$1);
9297
9297
  const {
9298
9298
  getPrefixCls,
9299
9299
  direction,
@@ -10647,7 +10647,7 @@ const {
10647
10647
  const {
10648
10648
  getPrefixCls,
10649
10649
  iconPrefixCls
10650
- } = useContext$1(ConfigContext);
10650
+ } = useContext$1(ConfigContext$1);
10651
10651
  const rootPrefixCls = getPrefixCls();
10652
10652
  return {
10653
10653
  rootPrefixCls,
@@ -10667,7 +10667,7 @@ const {
10667
10667
  useCSP: () => {
10668
10668
  const {
10669
10669
  csp
10670
- } = useContext$1(ConfigContext);
10670
+ } = useContext$1(ConfigContext$1);
10671
10671
  return csp !== null && csp !== void 0 ? csp : {};
10672
10672
  },
10673
10673
  getResetStyles: (token, config) => {
@@ -12008,19 +12008,19 @@ const ProviderChildren = props => {
12008
12008
  disabled: componentDisabled
12009
12009
  }, childNode);
12010
12010
  }
12011
- return /*#__PURE__*/React.createElement(ConfigContext.Provider, {
12011
+ return /*#__PURE__*/React.createElement(ConfigContext$1.Provider, {
12012
12012
  value: memoedConfig
12013
12013
  }, childNode);
12014
12014
  };
12015
12015
  const ConfigProvider = props => {
12016
- const context = React.useContext(ConfigContext);
12016
+ const context = React.useContext(ConfigContext$1);
12017
12017
  const antLocale = React.useContext(LocaleContext);
12018
12018
  return /*#__PURE__*/React.createElement(ProviderChildren, Object.assign({
12019
12019
  parentContext: context,
12020
12020
  legacyLocale: antLocale
12021
12021
  }, props));
12022
12022
  };
12023
- ConfigProvider.ConfigContext = ConfigContext;
12023
+ ConfigProvider.ConfigContext = ConfigContext$1;
12024
12024
  ConfigProvider.SizeContext = SizeContext;
12025
12025
  ConfigProvider.config = setGlobalConfig;
12026
12026
  ConfigProvider.useConfig = useConfig;
@@ -14137,7 +14137,7 @@ const showWaveEffect = (target, info) => {
14137
14137
  const useWave = (nodeRef, className, component) => {
14138
14138
  const {
14139
14139
  wave
14140
- } = React.useContext(ConfigContext);
14140
+ } = React.useContext(ConfigContext$1);
14141
14141
  const [, token, hashId] = useToken();
14142
14142
  const showWave = useEvent(event => {
14143
14143
  const node = nodeRef.current;
@@ -14176,7 +14176,7 @@ const Wave = props => {
14176
14176
  } = props;
14177
14177
  const {
14178
14178
  getPrefixCls
14179
- } = useContext$1(ConfigContext);
14179
+ } = useContext$1(ConfigContext$1);
14180
14180
  const containerRef = useRef(null);
14181
14181
  // ============================== Style ===============================
14182
14182
  const prefixCls = getPrefixCls('wave');
@@ -14316,7 +14316,7 @@ const Compact$1 = props => {
14316
14316
  const {
14317
14317
  getPrefixCls,
14318
14318
  direction: directionConfig
14319
- } = React.useContext(ConfigContext);
14319
+ } = React.useContext(ConfigContext$1);
14320
14320
  const {
14321
14321
  size,
14322
14322
  direction,
@@ -14369,7 +14369,7 @@ const ButtonGroup = props => {
14369
14369
  const {
14370
14370
  getPrefixCls,
14371
14371
  direction
14372
- } = React.useContext(ConfigContext);
14372
+ } = React.useContext(ConfigContext$1);
14373
14373
  const {
14374
14374
  prefixCls: customizePrefixCls,
14375
14375
  size,
@@ -15681,7 +15681,7 @@ const CollapsePanel = /*#__PURE__*/React.forwardRef((props, ref) => {
15681
15681
  }
15682
15682
  const {
15683
15683
  getPrefixCls
15684
- } = React.useContext(ConfigContext);
15684
+ } = React.useContext(ConfigContext$1);
15685
15685
  const {
15686
15686
  prefixCls: customizePrefixCls,
15687
15687
  className,
@@ -17365,7 +17365,7 @@ const InternalCompoundedButton = /*#__PURE__*/React__default.forwardRef((props,
17365
17365
  const mergedType = type || 'default';
17366
17366
  const {
17367
17367
  button
17368
- } = React__default.useContext(ConfigContext);
17368
+ } = React__default.useContext(ConfigContext$1);
17369
17369
  const shape = customizeShape || (button === null || button === void 0 ? void 0 : button.shape) || 'default';
17370
17370
  const [mergedColor, mergedVariant] = useMemo$1(() => {
17371
17371
  // >>>>> Local
@@ -22164,7 +22164,7 @@ const PurePanel$5 = props => {
22164
22164
  restProps = __rest$n(props, ["prefixCls", "className", "icon", "type", "message", "description", "btn", "actions", "closable", "closeIcon", "className"]);
22165
22165
  const {
22166
22166
  getPrefixCls
22167
- } = React.useContext(ConfigContext);
22167
+ } = React.useContext(ConfigContext$1);
22168
22168
  const mergedActions = actions !== null && actions !== void 0 ? actions : btn;
22169
22169
  if (process.env.NODE_ENV !== 'production') {
22170
22170
  const warning = devUseWarning('Notification');
@@ -22314,7 +22314,7 @@ const Holder = /*#__PURE__*/React__default.forwardRef((props, ref) => {
22314
22314
  getPopupContainer,
22315
22315
  notification,
22316
22316
  direction
22317
- } = useContext$1(ConfigContext);
22317
+ } = useContext$1(ConfigContext$1);
22318
22318
  const [, token] = useToken();
22319
22319
  const prefixCls = staticPrefixCls || getPrefixCls('notification');
22320
22320
  // =============================== Style ===============================
@@ -22471,7 +22471,7 @@ const genPurePanel = (Component, alignPropName, postProps, defaultPrefixCls, get
22471
22471
  });
22472
22472
  const {
22473
22473
  getPrefixCls
22474
- } = React.useContext(ConfigContext);
22474
+ } = React.useContext(ConfigContext$1);
22475
22475
  const prefixCls = getPrefixCls(defaultPrefixCls || 'select', customizePrefixCls);
22476
22476
  React.useEffect(() => {
22477
22477
  // We do not care about ssr
@@ -29197,7 +29197,7 @@ const DefaultRenderEmpty = props => {
29197
29197
  } = props;
29198
29198
  const {
29199
29199
  getPrefixCls
29200
- } = useContext$1(ConfigContext);
29200
+ } = useContext$1(ConfigContext$1);
29201
29201
  const prefix = getPrefixCls('empty');
29202
29202
  switch (componentName) {
29203
29203
  case 'Table':
@@ -29236,7 +29236,7 @@ const useVariant = (component, variant, legacyBordered) => {
29236
29236
  const {
29237
29237
  variant: configVariant,
29238
29238
  [component]: componentConfig
29239
- } = React.useContext(ConfigContext);
29239
+ } = React.useContext(ConfigContext$1);
29240
29240
  const ctxVariant = React.useContext(VariantContext);
29241
29241
  const configComponentVariant = componentConfig === null || componentConfig === void 0 ? void 0 : componentConfig.variant;
29242
29242
  let mergedVariant;
@@ -30597,7 +30597,7 @@ const InternalSelect = (props, ref) => {
30597
30597
  virtual,
30598
30598
  popupMatchSelectWidth: contextPopupMatchSelectWidth,
30599
30599
  popupOverflow
30600
- } = React.useContext(ConfigContext);
30600
+ } = React.useContext(ConfigContext$1);
30601
30601
  const {
30602
30602
  showSearch,
30603
30603
  style: contextStyle,
@@ -31664,7 +31664,7 @@ const PurePanel$3 = props => {
31664
31664
  } = props;
31665
31665
  const {
31666
31666
  getPrefixCls
31667
- } = React.useContext(ConfigContext);
31667
+ } = React.useContext(ConfigContext$1);
31668
31668
  const prefixCls = getPrefixCls('tooltip', customizePrefixCls);
31669
31669
  const [wrapCSSVar, hashId, cssVarCls] = useStyle$d(prefixCls);
31670
31670
  // Color
@@ -34376,7 +34376,7 @@ const Sider = /*#__PURE__*/React.forwardRef((props, ref) => {
34376
34376
  const {
34377
34377
  getPrefixCls,
34378
34378
  direction
34379
- } = useContext$1(ConfigContext);
34379
+ } = useContext$1(ConfigContext$1);
34380
34380
  const prefixCls = getPrefixCls('layout-sider', customizePrefixCls);
34381
34381
  const [wrapCSSVar, hashId, cssVarCls] = useStyle$c(prefixCls);
34382
34382
  // ========================= Responsive =========================
@@ -34504,7 +34504,7 @@ const MenuDivider = props => {
34504
34504
  restProps = __rest$h(props, ["prefixCls", "className", "dashed"]);
34505
34505
  const {
34506
34506
  getPrefixCls
34507
- } = React.useContext(ConfigContext);
34507
+ } = React.useContext(ConfigContext$1);
34508
34508
  const prefixCls = getPrefixCls('menu', customizePrefixCls);
34509
34509
  const classString = classNames({
34510
34510
  [`${prefixCls}-item-divider-dashed`]: !!dashed
@@ -35705,7 +35705,7 @@ const InternalMenu = /*#__PURE__*/forwardRef((props, ref) => {
35705
35705
  getPopupContainer,
35706
35706
  direction,
35707
35707
  menu
35708
- } = React.useContext(ConfigContext);
35708
+ } = React.useContext(ConfigContext$1);
35709
35709
  const rootPrefixCls = getPrefixCls();
35710
35710
  const {
35711
35711
  prefixCls: customizePrefixCls,
@@ -36184,7 +36184,7 @@ const Dropdown$1 = props => {
36184
36184
  getPrefixCls,
36185
36185
  direction,
36186
36186
  dropdown
36187
- } = React.useContext(ConfigContext);
36187
+ } = React.useContext(ConfigContext$1);
36188
36188
  const mergedPopupRender = popupRender || dropdownRender;
36189
36189
  // Warning for deprecated usage
36190
36190
  const warning = devUseWarning('Dropdown');
@@ -43266,7 +43266,7 @@ const InternalRadio = (props, ref) => {
43266
43266
  getPrefixCls,
43267
43267
  direction,
43268
43268
  radio
43269
- } = React.useContext(ConfigContext);
43269
+ } = React.useContext(ConfigContext$1);
43270
43270
  const innerRef = React.useRef(null);
43271
43271
  const mergedRef = composeRef(ref, innerRef);
43272
43272
  const {
@@ -43369,7 +43369,7 @@ const RadioGroup$1 = /*#__PURE__*/React.forwardRef((props, ref) => {
43369
43369
  const {
43370
43370
  getPrefixCls,
43371
43371
  direction
43372
- } = React.useContext(ConfigContext);
43372
+ } = React.useContext(ConfigContext$1);
43373
43373
  const {
43374
43374
  name: formItemName
43375
43375
  } = React.useContext(FormItemInputContext);
@@ -43486,7 +43486,7 @@ var __rest$d = undefined && undefined.__rest || function (s, e) {
43486
43486
  const RadioButton = (props, ref) => {
43487
43487
  const {
43488
43488
  getPrefixCls
43489
- } = React.useContext(ConfigContext);
43489
+ } = React.useContext(ConfigContext$1);
43490
43490
  const {
43491
43491
  prefixCls: customizePrefixCls
43492
43492
  } = props,
@@ -46696,7 +46696,7 @@ const InternalCheckbox = (props, ref) => {
46696
46696
  getPrefixCls,
46697
46697
  direction,
46698
46698
  checkbox
46699
- } = React.useContext(ConfigContext);
46699
+ } = React.useContext(ConfigContext$1);
46700
46700
  const checkboxGroup = React.useContext(GroupContext);
46701
46701
  const {
46702
46702
  isFormItemInput
@@ -46808,7 +46808,7 @@ const CheckboxGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
46808
46808
  const {
46809
46809
  getPrefixCls,
46810
46810
  direction
46811
- } = React.useContext(ConfigContext);
46811
+ } = React.useContext(ConfigContext$1);
46812
46812
  const [value, setValue] = React.useState(restProps.value || defaultValue || []);
46813
46813
  const [registeredValues, setRegisteredValues] = React.useState([]);
46814
46814
  React.useEffect(() => {
@@ -47771,7 +47771,7 @@ const generateRangePicker = generateConfig => {
47771
47771
  direction,
47772
47772
  getPopupContainer,
47773
47773
  rangePicker
47774
- } = useContext$1(ConfigContext);
47774
+ } = useContext$1(ConfigContext$1);
47775
47775
  const prefixCls = getPrefixCls('picker', customizePrefixCls);
47776
47776
  const {
47777
47777
  compactSize,
@@ -47924,7 +47924,7 @@ const generatePicker$1 = generateConfig => {
47924
47924
  getPopupContainer,
47925
47925
  // Consume different styles according to different names
47926
47926
  [consumerName]: consumerStyle
47927
- } = useContext$1(ConfigContext);
47927
+ } = useContext$1(ConfigContext$1);
47928
47928
  const prefixCls = getPrefixCls('picker', customizePrefixCls);
47929
47929
  const {
47930
47930
  compactSize,
@@ -48187,7 +48187,7 @@ const SpaceAddon = /*#__PURE__*/React__default.forwardRef((props, ref) => {
48187
48187
  const {
48188
48188
  getPrefixCls,
48189
48189
  direction: directionConfig
48190
- } = React__default.useContext(ConfigContext);
48190
+ } = React__default.useContext(ConfigContext$1);
48191
48191
  const prefixCls = getPrefixCls('space-addon', customizePrefixCls);
48192
48192
  const [wrapCSSVar, hashId, cssVarCls] = useStyle$5(prefixCls);
48193
48193
  const {
@@ -48421,7 +48421,7 @@ const DropdownButton = props => {
48421
48421
  getPopupContainer: getContextPopupContainer,
48422
48422
  getPrefixCls,
48423
48423
  direction
48424
- } = React.useContext(ConfigContext);
48424
+ } = React.useContext(ConfigContext$1);
48425
48425
  const {
48426
48426
  prefixCls: customizePrefixCls,
48427
48427
  type = 'default',
@@ -50531,7 +50531,7 @@ const GlobalHolder = /*#__PURE__*/React__default.forwardRef((props, ref) => {
50531
50531
  } = props;
50532
50532
  const {
50533
50533
  getPrefixCls
50534
- } = useContext$1(ConfigContext);
50534
+ } = useContext$1(ConfigContext$1);
50535
50535
  const prefixCls = defaultGlobalConfig.prefixCls || getPrefixCls('notification');
50536
50536
  const appConfig = useContext$1(AppConfigContext);
50537
50537
  const [api, holder] = useInternalNotification(Object.assign(Object.assign(Object.assign({}, notificationConfig), {
@@ -57611,7 +57611,7 @@ const Tree$1 = /*#__PURE__*/React__default.forwardRef((props, ref) => {
57611
57611
  direction,
57612
57612
  virtual,
57613
57613
  tree
57614
- } = React__default.useContext(ConfigContext);
57614
+ } = React__default.useContext(ConfigContext$1);
57615
57615
  const {
57616
57616
  prefixCls: customizePrefixCls,
57617
57617
  className,
@@ -57902,7 +57902,7 @@ const DirectoryTree = (_a, ref) => {
57902
57902
  const {
57903
57903
  getPrefixCls,
57904
57904
  direction
57905
- } = React.useContext(ConfigContext);
57905
+ } = React.useContext(ConfigContext$1);
57906
57906
  const {
57907
57907
  prefixCls: customizePrefixCls,
57908
57908
  className,
@@ -58246,7 +58246,7 @@ const FilterDropdown = props => {
58246
58246
  const {
58247
58247
  direction,
58248
58248
  renderEmpty
58249
- } = React.useContext(ConfigContext);
58249
+ } = React.useContext(ConfigContext$1);
58250
58250
  if (typeof column.filterDropdown === 'function') {
58251
58251
  dropdownContent = column.filterDropdown({
58252
58252
  prefixCls: `${dropdownPrefixCls}-custom`,
@@ -60569,7 +60569,7 @@ const InternalTable$1 = (props, ref) => {
60569
60569
  renderEmpty,
60570
60570
  getPrefixCls,
60571
60571
  getPopupContainer: getContextPopupContainer
60572
- } = React.useContext(ConfigContext);
60572
+ } = React.useContext(ConfigContext$1);
60573
60573
  const mergedSize = useSize(customizeSize);
60574
60574
  const tableLocale = Object.assign(Object.assign({}, contextLocale.Table), locale);
60575
60575
  const rawData = dataSource || EMPTY_LIST;
@@ -63657,7 +63657,20 @@ const ToastProvider = ({ children, }) => {
63657
63657
  return (jsxs(ToastContext.Provider, { value: { showToast }, children: [children, toasts.length > 0 && (jsx(ToastWrapper, { "$position": toasts[0].position || "top-right", children: toasts.map((toast, index) => (jsx(FISToast, { ...toast }, index))) }))] }));
63658
63658
  };
63659
63659
 
63660
- const FISThemeProvider = ({ theme: theme$1 = theme, children, }) => (jsxs(ThemeProvider, { theme: theme$1, children: [jsx(GlobalStyle, { theme: theme$1 }), jsx(NotificationProvider, { children: jsx(ToastProvider, { children: children }) })] }));
63660
+ const ConfigContext = createContext$1({});
63661
+ /** Có thể lồng nhau, config bên trong ghi đè config bên ngoài theo từng component */
63662
+ const FISConfigProvider = ({ config, children, }) => {
63663
+ const parent = useContext$1(ConfigContext);
63664
+ const value = useMemo$1(() => ({
63665
+ ...parent,
63666
+ ...config,
63667
+ select: { ...parent.select, ...config?.select },
63668
+ }), [parent, config]);
63669
+ return (jsx(ConfigContext.Provider, { value: value, children: children }));
63670
+ };
63671
+ const useFISConfig = () => useContext$1(ConfigContext);
63672
+
63673
+ const FISThemeProvider = ({ theme: theme$1 = theme, config, children, }) => (jsxs(ThemeProvider, { theme: theme$1, children: [jsx(GlobalStyle, { theme: theme$1 }), jsx(FISConfigProvider, { config: config, children: jsx(NotificationProvider, { children: jsx(ToastProvider, { children: children }) }) })] }));
63661
63674
 
63662
63675
  const DivSwitchLabelContainerSC = styled.div `
63663
63676
  display: flex;
@@ -67176,10 +67189,6 @@ const DivContainerSC$4 = styled.div `
67176
67189
  background-color: ${getTheme("com/input/field/disable/background-color")};
67177
67190
  }
67178
67191
 
67179
- &:has(${InputSC$1}:disabled) {
67180
- pointer-events: none;
67181
- }
67182
-
67183
67192
  &.negative {
67184
67193
  outline-color: ${getTheme("com/input/field/negative/border/default")};
67185
67194
  background-color: ${getTheme("com/input/field/negative/background/default")};
@@ -72324,7 +72333,7 @@ const DivContainer = styled.div `
72324
72333
  }
72325
72334
  }}
72326
72335
 
72327
- &:hover:not(:has(.button-icon:hover)) {
72336
+ &:hover:not(:has(.button-icon:hover)):not(.disabled) {
72328
72337
  outline-offset: -${getTheme("com/chips-button/stroke-width/hover")};
72329
72338
  ${(props) => {
72330
72339
  switch (props.$theme) {
@@ -72569,7 +72578,6 @@ const DivContainer = styled.div `
72569
72578
  if ($disabled) {
72570
72579
  return css `
72571
72580
  cursor: not-allowed;
72572
- pointer-events: none;
72573
72581
  background-color: ${getTheme("com/chips-button/disable/background-color")};
72574
72582
  outline: ${getTheme("com/chips-button/stroke-width/default")} solid
72575
72583
  ${getTheme("com/chips-button/disable/color-stroke")};
@@ -72660,11 +72668,11 @@ const DivIcon$1 = styled.div `
72660
72668
  }
72661
72669
  }}
72662
72670
 
72663
- ${DivContainer}:hover:not(:has(.button-icon:hover)) & {
72671
+ ${DivContainer}:hover:not(:has(.button-icon:hover)):not(.disabled) & {
72664
72672
  ${iconStateColor("hover")}
72665
72673
  }
72666
72674
 
72667
- ${DivContainer}:active & {
72675
+ ${DivContainer}:active:not(.disabled) & {
72668
72676
  ${iconStateColor("pressed")}
72669
72677
  }
72670
72678
 
@@ -72775,11 +72783,11 @@ const SpanLabel$1 = styled.span `
72775
72783
  }
72776
72784
  }}
72777
72785
 
72778
- ${DivContainer}:hover:not(:has(.button-icon:hover)) & {
72786
+ ${DivContainer}:hover:not(:has(.button-icon:hover)):not(.disabled) & {
72779
72787
  ${labelStateColor("hover")}
72780
72788
  }
72781
72789
 
72782
- ${DivContainer}:active & {
72790
+ ${DivContainer}:active:not(.disabled) & {
72783
72791
  ${labelStateColor("pressed")}
72784
72792
  }
72785
72793
 
@@ -72848,7 +72856,8 @@ const FISChipButton = forwardRef((props, ref) => {
72848
72856
  : size === "md"
72849
72857
  ? "sm"
72850
72858
  : "md";
72851
- return (jsxs(DivContainer, { ...rest, ref: ref, "$size": size, "$theme": theme, "$rounded": rounded, "$disabled": disabled, className: classNames(className, {
72859
+ return (jsxs(DivContainer, { ...rest, ref: ref, "$size": size, "$theme": theme, "$rounded": rounded, "$disabled": disabled, onClick: disabled ? undefined : rest.onClick, className: classNames(className, {
72860
+ disabled,
72852
72861
  selected,
72853
72862
  "no-padding": closeable,
72854
72863
  // "no-padding-horizontal": !closeable && !icon && !srcAvatar,
@@ -73784,8 +73793,10 @@ const DivColumnCellContainerSC = styled.div `
73784
73793
  background-color: transparent;
73785
73794
  }
73786
73795
  background-color: ${getTheme("com/table/row-cell/disable/background-color")};
73787
- pointer-events: none;
73788
73796
  cursor: not-allowed;
73797
+ .icon-box {
73798
+ pointer-events: none;
73799
+ }
73789
73800
  .content {
73790
73801
  color: ${getTheme("com/table/row-cell/disable/label/color-text")};
73791
73802
  }
@@ -73891,7 +73902,7 @@ const DivIconSC = styled.div `
73891
73902
  `;
73892
73903
 
73893
73904
  const FISTableCell = forwardRef(({ className, textAlign, variant = COLUMN_VARIANT.PRIMARY, content, description, icon, disabled, hasBorder, onChange, contentWrapText = false, tooltip = false, placement = "top", variantTooltip = "primary", ...rest }, ref) => {
73894
- return (jsx(FISTooltip, { variant: variantTooltip, placement: placement, title: tooltip ? content || "" : undefined, children: jsx(DivColumnCellContainerSC, { "$hasBorder": hasBorder, "$disabled": disabled, "$variant": variant, "$textAlign": textAlign, "$contentWrapText": contentWrapText, "$hasContent": content ? "true" : undefined, "$hasDescription": description, ref: ref, className: classNames("column-cell-container", className), ...rest, children: textAlign === COLUMN_TEXT_ALIGN.SINGLE_LINE ? (jsxs("div", { className: "single-line-content", children: [icon && (jsx("div", { className: "icon-box", children: jsx(DivIconSC, { "$textAlign": textAlign, "$variant": variant, "$disabled": disabled, "$hasContent": content ? "true" : undefined, "$hasDescription": description, children: icon }) })), (content || description) && (jsxs("div", { className: "content-box", children: [content && jsx("div", { className: "content", children: content }), description && (jsx("div", { className: "description", children: description }))] }))] })) : (jsxs("div", { className: "left-right-content", children: [(icon || content) && (jsxs("div", { className: "content-box", children: [icon && (jsx(DivIconSC, { "$textAlign": textAlign, "$variant": variant, "$disabled": disabled, "$hasContent": content ? "true" : undefined, "$hasDescription": description, children: icon })), content && jsx("div", { className: "content", children: content })] })), description && jsx("div", { className: "description", children: description })] })) }) }));
73905
+ return (jsx(FISTooltip, { variant: variantTooltip, placement: placement, title: tooltip ? content || "" : undefined, children: jsx(DivColumnCellContainerSC, { "$hasBorder": hasBorder, "$disabled": disabled, "$variant": variant, "$textAlign": textAlign, "$contentWrapText": contentWrapText, "$hasContent": content ? "true" : undefined, "$hasDescription": description, ref: ref, className: classNames("column-cell-container", className), ...rest, onClick: disabled ? undefined : rest.onClick, children: textAlign === COLUMN_TEXT_ALIGN.SINGLE_LINE ? (jsxs("div", { className: "single-line-content", children: [icon && (jsx("div", { className: "icon-box", children: jsx(DivIconSC, { "$textAlign": textAlign, "$variant": variant, "$disabled": disabled, "$hasContent": content ? "true" : undefined, "$hasDescription": description, children: icon }) })), (content || description) && (jsxs("div", { className: "content-box", children: [content && jsx("div", { className: "content", children: content }), description && (jsx("div", { className: "description", children: description }))] }))] })) : (jsxs("div", { className: "left-right-content", children: [(icon || content) && (jsxs("div", { className: "content-box", children: [icon && (jsx(DivIconSC, { "$textAlign": textAlign, "$variant": variant, "$disabled": disabled, "$hasContent": content ? "true" : undefined, "$hasDescription": description, children: icon })), content && jsx("div", { className: "content", children: content })] })), description && jsx("div", { className: "description", children: description })] })) }) }));
73895
73906
  });
73896
73907
  FISTableCell.displayName = "FISTableCell";
73897
73908
 
@@ -75729,13 +75740,25 @@ const SelectedTagsWrapper = styled.div `
75729
75740
  ${getTheme("com/combo-box/selected-data/horizontal-gap")}
75730
75741
  );
75731
75742
  `;
75743
+ const SpanClearIconSC = styled.span `
75744
+ display: flex;
75745
+ align-items: center;
75746
+ justify-content: center;
75747
+ width: 100%;
75748
+ height: 100%;
75749
+ cursor: pointer;
75750
+ pointer-events: auto;
75751
+ `;
75732
75752
 
75733
75753
  function isMenuSize(value) {
75734
75754
  return value === "sm" || value === "md";
75735
75755
  }
75736
75756
 
75737
- const FISSelect = forwardRef(({ className, style, size = "md", options, value, disabled = false, textLabel = "", iconLabel, required, negative, message, positive, multi, placeholder, placeholderSearch, loading, onChange, renderOption, onClickIconLabel, displayValue, multiDisplayText, searchValue, onSearchChange, portal = true, maxHeight, onPopupScroll, onOpen, hideChip, tooltipTitle, tooltipVariant = "primary", noData, noResult, noDataText, noResultText, footer, searchDebounce, showSearch, onSearchInput, virtualized, virtualItemHeight, removeSelectedText, selectedGroupLabel, ...restProps }, ref) => {
75757
+ const FISSelect = forwardRef(({ className, style, size = "md", options, value, disabled = false, textLabel = "", iconLabel, required, negative, message, positive, multi, placeholder, placeholderSearch, loading, onChange, renderOption, onClickIconLabel, displayValue, multiDisplayText, searchValue, onSearchChange, portal = true, maxHeight, onPopupScroll, onOpen, hideChip, tooltipTitle, tooltipVariant = "primary", noData, noResult, noDataText, noResultText, footer, searchDebounce, showSearch, onSearchInput, virtualized, virtualItemHeight, removeSelectedText, selectedGroupLabel, allowClear: allowClearProp, onClear, ...restProps }, ref) => {
75758
+ const config = useFISConfig();
75759
+ const allowClear = allowClearProp ?? config.select?.allowClear ?? false;
75738
75760
  const [isOpen, setIsOpen] = useState(false);
75761
+ const [isHovered, setIsHovered] = useState(false);
75739
75762
  const [referenceElement, setReferenceElement] = useState(null);
75740
75763
  const [popperElement, setPopperElement] = useState(null);
75741
75764
  const [cachedSelectedItem, setCachedSelectedItem] = useState(null);
@@ -75825,6 +75848,23 @@ const FISSelect = forwardRef(({ className, style, size = "md", options, value, d
75825
75848
  onOpen?.();
75826
75849
  }
75827
75850
  }, [disabled, onOpen]);
75851
+ const hasSelectedValue = multi
75852
+ ? Array.isArray(value) && value.length > 0
75853
+ : value !== undefined && value !== null && value !== "";
75854
+ const showClearIcon = allowClear && !disabled && hasSelectedValue && isHovered;
75855
+ const handleClear = useCallback((event) => {
75856
+ // Không để click lan lên wrapper làm mở dropdown
75857
+ event.stopPropagation();
75858
+ setIsOpen(false);
75859
+ if (multi) {
75860
+ onChange([]);
75861
+ }
75862
+ else {
75863
+ onChange(undefined);
75864
+ }
75865
+ setCachedSelectedItem(null);
75866
+ onClear?.();
75867
+ }, [multi, onChange, onClear]);
75828
75868
  const handleOptionRemove = useCallback((option) => {
75829
75869
  if (multi && Array.isArray(value)) {
75830
75870
  const newValues = value.filter((v) => v !== option.value);
@@ -75946,7 +75986,7 @@ const FISSelect = forwardRef(({ className, style, size = "md", options, value, d
75946
75986
  }
75947
75987
  }, [isOpen, multi]);
75948
75988
  const renderSelectInput = () => {
75949
- const selectInput = (jsx(DivInputWrapperSC, { ref: setReferenceElement, onClick: handleToggle, "$hasValue": !!value, children: jsx(FISSelectItem, { ...restProps, onBlur: handleBlur, ref: inputRef, size: size, placeholder: placeholder, iconSuffix: isOpen ? jsx(ArrowUpIcon, {}) : jsx(ArrowDownIcon, {}), value: computedDisplayValue, onChange: () => undefined, disabled: disabled, activeDropdown: isOpen, negative: negative }) }));
75989
+ const selectInput = (jsx(DivInputWrapperSC, { ref: setReferenceElement, onClick: handleToggle, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), "$hasValue": !!value && !disabled, children: jsx(FISSelectItem, { ...restProps, onBlur: handleBlur, ref: inputRef, size: size, placeholder: placeholder, iconSuffix: showClearIcon ? (jsx(SpanClearIconSC, { role: "button", "aria-label": "Xo\u00E1", onMouseDown: (e) => e.preventDefault(), onClick: handleClear, children: jsx(CloseIcon, {}) })) : isOpen ? (jsx(ArrowUpIcon, {})) : (jsx(ArrowDownIcon, {})), value: computedDisplayValue, onChange: () => undefined, disabled: disabled, activeDropdown: isOpen, negative: negative }) }));
75950
75990
  if (tooltipTitle) {
75951
75991
  return (jsx(FISTooltip, { title: tooltipTitle, variant: tooltipVariant, smartPlacement: true, children: selectInput }));
75952
75992
  }
@@ -76646,5 +76686,5 @@ const TextSC = styled.p `
76646
76686
  const FISText = forwardRef(({ tag, as, variant, children, color, ...rest }, ref) => (jsx(TextSC, { as: as ?? tag, "$variant": variant, "$color": color ? getTheme(color) : "", ref: ref, ...rest, children: children })));
76647
76687
  FISText.displayName = "FISText";
76648
76688
 
76649
- export { FISAlertBanner, FISApiSelect, FISAvatar, FISBadge, FISBreadcrumb, FISButton, FISButtonGroup, FISCheckbox, FISCheckboxGroup, FISChipButton, FISCollapse, FISCombobox, FISDateRange, FISDivider, FISIconButton, FISInputArea, FISInputDate, FISInputField, FISInputLabel, FISInputStepper, FISInputText, FISInputTime, FISLinkButton, FISMenuItem, FISMenuSection, FISMenuSelect, FISMenuSelectDropdown, FISPagination, FISProgressCircular, FISProgressLinear, FISRadio, RadioGroup as FISRadioGroup, FISSegmented, FISSelect, FISSelectItem, FISSorter, FISSplitButton, FISSwitch, FISTab, FISTable, FISTableCell, FISTableHeaderCell, FISText, FISThemeProvider, FISToast, FISTooltip, SegmentedPanelItem, TabPanelItem, useNotification, useToast };
76689
+ export { FISAlertBanner, FISApiSelect, FISAvatar, FISBadge, FISBreadcrumb, FISButton, FISButtonGroup, FISCheckbox, FISCheckboxGroup, FISChipButton, FISCollapse, FISCombobox, FISConfigProvider, FISDateRange, FISDivider, FISIconButton, FISInputArea, FISInputDate, FISInputField, FISInputLabel, FISInputStepper, FISInputText, FISInputTime, FISLinkButton, FISMenuItem, FISMenuSection, FISMenuSelect, FISMenuSelectDropdown, FISPagination, FISProgressCircular, FISProgressLinear, FISRadio, RadioGroup as FISRadioGroup, FISSegmented, FISSelect, FISSelectItem, FISSorter, FISSplitButton, FISSwitch, FISTab, FISTable, FISTableCell, FISTableHeaderCell, FISText, FISThemeProvider, FISToast, FISTooltip, SegmentedPanelItem, TabPanelItem, useFISConfig, useNotification, useToast };
76650
76690
  //# sourceMappingURL=index.js.map