@apia/components 4.0.17 → 4.0.19

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/index.d.ts CHANGED
@@ -816,6 +816,7 @@ type AutocompleteProps = {
816
816
  * Por defecto es 100ms.
817
817
  */
818
818
  searchDebounce?: number;
819
+ readOnly?: boolean;
819
820
  } & AutocompleteBoxProps & Partial<Pick<AutocompleteState, 'disabled' | 'value'>>;
820
821
  type AutocompleteBoxProps = Partial<{
821
822
  className: string;
@@ -824,6 +825,7 @@ type AutocompleteBoxProps = Partial<{
824
825
  }>;
825
826
  type AutocompleteState = {
826
827
  disabled: boolean;
828
+ readOnly: boolean;
827
829
  focusedValue?: null | string;
828
830
  loading: boolean;
829
831
  showValue: string;
@@ -1189,23 +1191,26 @@ interface IAccordionProps {
1189
1191
  }
1190
1192
  declare const Accordion: FC<IAccordionProps>;
1191
1193
 
1192
- type TItemState$1 = {
1194
+ type TItemState = {
1193
1195
  isChecked: boolean;
1194
1196
  isExpanded: boolean;
1197
+ disabled?: boolean;
1198
+ toggled?: boolean;
1199
+ isLoading?: boolean;
1195
1200
  };
1196
- type TItemStateListener = (state: TItemState$1) => unknown;
1201
+ type TItemStateListener = (state: TItemState) => unknown;
1197
1202
  type TPropsListener = (props: IAccordionProps) => unknown;
1198
1203
 
1199
1204
  type TSelectionComparator<T> = (prev: T, next: T) => boolean;
1200
- type TItemUpdater = Partial<TItemState$1> | ((currentProps: TItemState$1) => Partial<TItemState$1>);
1205
+ type TItemUpdater = Partial<TItemState> | ((currentProps: TItemState) => Partial<TItemState>);
1201
1206
  declare class AccordionHandler {
1202
1207
  id: string;
1203
1208
  props: IAccordionProps;
1204
- itemsState: Record<TId$1, TItemState$1>;
1209
+ itemsState: Record<TId$1, TItemState>;
1205
1210
  itemsStateListeners: Record<TId$1, TItemStateListener[]>;
1206
1211
  propsListeners: TPropsListener[];
1207
1212
  constructor(id: string, props: IAccordionProps);
1208
- registerItem(itemId: TId$1, initialState: TItemState$1): void;
1213
+ registerItem(itemId: TId$1, initialState: TItemState): void;
1209
1214
  toggleItem(itemId: TId$1, expanded?: boolean): void;
1210
1215
  unregisterItem(itemId: TId$1): void;
1211
1216
  /**
@@ -1221,7 +1226,7 @@ declare class AccordionHandler {
1221
1226
  children: ReactNode;
1222
1227
  }) => React$1.JSX.Element;
1223
1228
  useItemId: () => TId$1;
1224
- useItemStateSelector: <T>(selector: (props: TItemState$1) => T, comparator?: TSelectionComparator<T>) => T;
1229
+ useItemStateSelector: <T>(selector: (props: TItemState) => T, comparator?: TSelectionComparator<T>) => T;
1225
1230
  useItemStateUpdate: (cb: TItemStateListener) => void;
1226
1231
  usePropsSelector: <T_1>(selector: (props: IAccordionProps) => T_1, comparator?: TSelectionComparator<T_1>) => T_1;
1227
1232
  usePropsUpdate: (cb: TPropsListener) => void;
@@ -1860,7 +1865,6 @@ declare const IconsList: {
1860
1865
  declare function importComponent<T = unknown>(path: string): React$1.LazyExoticComponent<ComponentType<T>>;
1861
1866
 
1862
1867
  type TClickListener = () => unknown;
1863
- type TItemState = Pick<TToolbarIconButton, 'disabled' | 'toggled' | 'isLoading'>;
1864
1868
  declare class ToolbarController extends EventEmitter<{
1865
1869
  pressEnter: string;
1866
1870
  updateItemState: string;
package/dist/index.js CHANGED
@@ -3914,6 +3914,7 @@ class AutocompleteController {
3914
3914
  constructor(properties) {
3915
3915
  __publicField$f(this, "state", {
3916
3916
  disabled: false,
3917
+ readOnly: false,
3917
3918
  id: uniqueId$3("autocomplete"),
3918
3919
  loading: false,
3919
3920
  options: [],
@@ -4120,7 +4121,7 @@ class AutocompleteController {
4120
4121
  }
4121
4122
  }
4122
4123
  async setValue(value) {
4123
- if (this.state.disabled) {
4124
+ if (this.state.disabled || this.state.readOnly) {
4124
4125
  return;
4125
4126
  }
4126
4127
  const selectedOption = this.state.options.find((c) => c.value === value);
@@ -4167,7 +4168,7 @@ const SearchBox = observer(() => {
4167
4168
  Input,
4168
4169
  {
4169
4170
  ref: inputRef,
4170
- className: `autocomplete__search ${handler.state.disabled ? "disabled" : ""}`,
4171
+ className: `autocomplete__search ${handler.state.disabled ? "disabled" : ""} ${handler.state.readOnly ? "readOnly" : ""}`,
4171
4172
  onChange: (ev) => {
4172
4173
  handler.search(ev.target.value);
4173
4174
  },
@@ -6011,7 +6012,9 @@ const FileCard = forwardRef(
6011
6012
  key: name,
6012
6013
  className: `fileCard ${className ?? ""}`,
6013
6014
  onDoubleClick,
6014
- onClick
6015
+ onClick,
6016
+ title: name,
6017
+ tabIndex: 0
6015
6018
  },
6016
6019
  /* @__PURE__ */ jsxs(Box, { className: "fileCard__content", children: [
6017
6020
  /* @__PURE__ */ jsx(FileIcon, { docName: name, iconSize: iconsSize }),
@@ -9583,12 +9586,14 @@ const ToolbarIconButton = ({
9583
9586
  if (context.itemsState[id].toggled !== void 0) {
9584
9587
  setInnerIsToggled(!!context.itemsState[id].toggled);
9585
9588
  }
9586
- } else
9589
+ } else {
9590
+ const o = context.itemsState[id];
9587
9591
  context.itemsState[id] = {
9588
9592
  disabled: isDisabled,
9589
9593
  toggled: innerIsToggled,
9590
- ...context.itemsState[id]
9594
+ ...o
9591
9595
  };
9596
+ }
9592
9597
  });
9593
9598
  return /* @__PURE__ */ jsx(
9594
9599
  IconButton,