@consta/uikit 5.25.1 → 5.26.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.
Files changed (154) hide show
  1. package/FlatSelect/index.d.ts +1 -0
  2. package/FlatSelect/index.js +1 -0
  3. package/__internal__/src/components/Combobox/Combobox.js +1 -1
  4. package/__internal__/src/components/Combobox/Combobox.js.map +1 -1
  5. package/__internal__/src/components/ContextMenu/ContextMenu.js +1 -1
  6. package/__internal__/src/components/ContextMenu/ContextMenu.js.map +1 -1
  7. package/__internal__/src/components/ContextMenu/ContextMenuLevels/ContextMenuLevels.d.ts +2 -2
  8. package/__internal__/src/components/ContextMenu/ContextMenuLevels/ContextMenuLevels.js +1 -1
  9. package/__internal__/src/components/ContextMenu/ContextMenuLevels/ContextMenuLevels.js.map +1 -1
  10. package/__internal__/src/components/ContextMenu/helpers.d.ts +2 -2
  11. package/__internal__/src/components/ContextMenu/types.d.ts +5 -5
  12. package/__internal__/src/components/ContextMenu/types.js.map +1 -1
  13. package/__internal__/src/components/FieldComponents/FieldButton/FieldButton.d.ts +1 -1
  14. package/__internal__/src/components/FieldComponents/FieldButton/FieldButton.js.map +1 -1
  15. package/__internal__/src/components/FieldComponents/FieldClearButton/FieldClearButton.d.ts +1 -0
  16. package/__internal__/src/components/FieldComponents/FieldClearButton/FieldClearButton.js +1 -1
  17. package/__internal__/src/components/FieldComponents/FieldClearButton/FieldClearButton.js.map +1 -1
  18. package/__internal__/src/components/FlatSelect/FlatSelect.css +9 -0
  19. package/__internal__/src/components/FlatSelect/FlatSelect.d.ts +4 -0
  20. package/__internal__/src/components/FlatSelect/FlatSelect.js +2 -0
  21. package/__internal__/src/components/FlatSelect/FlatSelect.js.map +1 -0
  22. package/__internal__/src/components/FlatSelect/FlatSelectControlLayout/FlatSelectControlLayout.d.ts +16 -0
  23. package/__internal__/src/components/FlatSelect/FlatSelectControlLayout/FlatSelectControlLayout.js +2 -0
  24. package/__internal__/src/components/FlatSelect/FlatSelectControlLayout/FlatSelectControlLayout.js.map +1 -0
  25. package/__internal__/src/components/FlatSelect/FlatSelectControlLayout/index.d.ts +1 -0
  26. package/__internal__/src/components/FlatSelect/FlatSelectControlLayout/index.js +2 -0
  27. package/__internal__/src/components/FlatSelect/FlatSelectControlLayout/index.js.map +1 -0
  28. package/__internal__/src/components/FlatSelect/FlatSelectCreateButton/FlatSelectCreateButton.css +1 -0
  29. package/__internal__/src/components/FlatSelect/FlatSelectCreateButton/FlatSelectCreateButton.d.ts +19 -0
  30. package/__internal__/src/components/FlatSelect/FlatSelectCreateButton/FlatSelectCreateButton.js +2 -0
  31. package/__internal__/src/components/FlatSelect/FlatSelectCreateButton/FlatSelectCreateButton.js.map +1 -0
  32. package/__internal__/src/components/FlatSelect/FlatSelectCreateButton/index.d.ts +1 -0
  33. package/__internal__/src/components/FlatSelect/FlatSelectCreateButton/index.js +2 -0
  34. package/__internal__/src/components/FlatSelect/FlatSelectCreateButton/index.js.map +1 -0
  35. package/__internal__/src/components/FlatSelect/FlatSelectFooter/FlatSelectFooter.css +1 -0
  36. package/__internal__/src/components/FlatSelect/FlatSelectFooter/FlatSelectFooter.d.ts +12 -0
  37. package/__internal__/src/components/FlatSelect/FlatSelectFooter/FlatSelectFooter.js +2 -0
  38. package/__internal__/src/components/FlatSelect/FlatSelectFooter/FlatSelectFooter.js.map +1 -0
  39. package/__internal__/src/components/FlatSelect/FlatSelectFooter/index.d.ts +1 -0
  40. package/__internal__/src/components/FlatSelect/FlatSelectFooter/index.js +2 -0
  41. package/__internal__/src/components/FlatSelect/FlatSelectFooter/index.js.map +1 -0
  42. package/__internal__/src/components/FlatSelect/FlatSelectGroupLabel/FlatSelectGroupLabel.d.ts +10 -0
  43. package/__internal__/src/components/FlatSelect/FlatSelectGroupLabel/FlatSelectGroupLabel.js +2 -0
  44. package/__internal__/src/components/FlatSelect/FlatSelectGroupLabel/FlatSelectGroupLabel.js.map +1 -0
  45. package/__internal__/src/components/FlatSelect/FlatSelectGroupLabel/index.d.ts +1 -0
  46. package/__internal__/src/components/FlatSelect/FlatSelectGroupLabel/index.js +2 -0
  47. package/__internal__/src/components/FlatSelect/FlatSelectGroupLabel/index.js.map +1 -0
  48. package/__internal__/src/components/FlatSelect/FlatSelectItem/FlatSelectItem.css +1 -0
  49. package/__internal__/src/components/FlatSelect/FlatSelectItem/FlatSelectItem.d.ts +17 -0
  50. package/__internal__/src/components/FlatSelect/FlatSelectItem/FlatSelectItem.js +2 -0
  51. package/__internal__/src/components/FlatSelect/FlatSelectItem/FlatSelectItem.js.map +1 -0
  52. package/__internal__/src/components/FlatSelect/FlatSelectItem/index.d.ts +1 -0
  53. package/__internal__/src/components/FlatSelect/FlatSelectItem/index.js +2 -0
  54. package/__internal__/src/components/FlatSelect/FlatSelectItem/index.js.map +1 -0
  55. package/__internal__/src/components/FlatSelect/FlatSelectItemAll/FlatSelectItemAll.css +1 -0
  56. package/__internal__/src/components/FlatSelect/FlatSelectItemAll/FlatSelectItemAll.d.ts +17 -0
  57. package/__internal__/src/components/FlatSelect/FlatSelectItemAll/FlatSelectItemAll.js +2 -0
  58. package/__internal__/src/components/FlatSelect/FlatSelectItemAll/FlatSelectItemAll.js.map +1 -0
  59. package/__internal__/src/components/FlatSelect/FlatSelectItemAll/index.d.ts +1 -0
  60. package/__internal__/src/components/FlatSelect/FlatSelectItemAll/index.js +2 -0
  61. package/__internal__/src/components/FlatSelect/FlatSelectItemAll/index.js.map +1 -0
  62. package/__internal__/src/components/FlatSelect/FlatSelectList/FlatSelectList.css +1 -0
  63. package/__internal__/src/components/FlatSelect/FlatSelectList/FlatSelectList.d.ts +53 -0
  64. package/__internal__/src/components/FlatSelect/FlatSelectList/FlatSelectList.js +2 -0
  65. package/__internal__/src/components/FlatSelect/FlatSelectList/FlatSelectList.js.map +1 -0
  66. package/__internal__/src/components/FlatSelect/FlatSelectList/index.d.ts +1 -0
  67. package/__internal__/src/components/FlatSelect/FlatSelectList/index.js +2 -0
  68. package/__internal__/src/components/FlatSelect/FlatSelectList/index.js.map +1 -0
  69. package/__internal__/src/components/FlatSelect/FlatSelectLoader/FlatSelectLoader.css +1 -0
  70. package/__internal__/src/components/FlatSelect/FlatSelectLoader/FlatSelectLoader.d.ts +3 -0
  71. package/__internal__/src/components/FlatSelect/FlatSelectLoader/FlatSelectLoader.js +2 -0
  72. package/__internal__/src/components/FlatSelect/FlatSelectLoader/FlatSelectLoader.js.map +1 -0
  73. package/__internal__/src/components/FlatSelect/FlatSelectLoader/index.d.ts +1 -0
  74. package/__internal__/src/components/FlatSelect/FlatSelectLoader/index.js +2 -0
  75. package/__internal__/src/components/FlatSelect/FlatSelectLoader/index.js.map +1 -0
  76. package/__internal__/src/components/FlatSelect/FlatSelectRenderItem/FlatSelectRenderItem.d.ts +24 -0
  77. package/__internal__/src/components/FlatSelect/FlatSelectRenderItem/FlatSelectRenderItem.js +2 -0
  78. package/__internal__/src/components/FlatSelect/FlatSelectRenderItem/FlatSelectRenderItem.js.map +1 -0
  79. package/__internal__/src/components/FlatSelect/FlatSelectRenderItem/index.d.ts +1 -0
  80. package/__internal__/src/components/FlatSelect/FlatSelectRenderItem/index.js +2 -0
  81. package/__internal__/src/components/FlatSelect/FlatSelectRenderItem/index.js.map +1 -0
  82. package/__internal__/src/components/FlatSelect/FlatSelectRoot/FlatSelectRoot.css +1 -0
  83. package/__internal__/src/components/FlatSelect/FlatSelectRoot/FlatSelectRoot.d.ts +14 -0
  84. package/__internal__/src/components/FlatSelect/FlatSelectRoot/FlatSelectRoot.js +2 -0
  85. package/__internal__/src/components/FlatSelect/FlatSelectRoot/FlatSelectRoot.js.map +1 -0
  86. package/__internal__/src/components/FlatSelect/FlatSelectRoot/index.d.ts +1 -0
  87. package/__internal__/src/components/FlatSelect/FlatSelectRoot/index.js +2 -0
  88. package/__internal__/src/components/FlatSelect/FlatSelectRoot/index.js.map +1 -0
  89. package/__internal__/src/components/FlatSelect/defaultProps.d.ts +22 -0
  90. package/__internal__/src/components/FlatSelect/defaultProps.js +2 -0
  91. package/__internal__/src/components/FlatSelect/defaultProps.js.map +1 -0
  92. package/__internal__/src/components/FlatSelect/index.d.ts +2 -0
  93. package/__internal__/src/components/FlatSelect/index.js +2 -0
  94. package/__internal__/src/components/FlatSelect/index.js.map +1 -0
  95. package/__internal__/src/components/FlatSelect/types.d.ts +133 -0
  96. package/__internal__/src/components/FlatSelect/types.js +2 -0
  97. package/__internal__/src/components/FlatSelect/types.js.map +1 -0
  98. package/__internal__/src/components/FlatSelect/useFlatSelect/helpers.d.ts +4 -0
  99. package/__internal__/src/components/FlatSelect/useFlatSelect/helpers.js +2 -0
  100. package/__internal__/src/components/FlatSelect/useFlatSelect/helpers.js.map +1 -0
  101. package/__internal__/src/components/FlatSelect/useFlatSelect/index.d.ts +1 -0
  102. package/__internal__/src/components/FlatSelect/useFlatSelect/index.js +2 -0
  103. package/__internal__/src/components/FlatSelect/useFlatSelect/index.js.map +1 -0
  104. package/__internal__/src/components/FlatSelect/useFlatSelect/useFlatSelect.d.ts +52 -0
  105. package/__internal__/src/components/FlatSelect/useFlatSelect/useFlatSelect.js +2 -0
  106. package/__internal__/src/components/FlatSelect/useFlatSelect/useFlatSelect.js.map +1 -0
  107. package/__internal__/src/components/FlatSelect/useRenderItem/index.d.ts +1 -0
  108. package/__internal__/src/components/FlatSelect/useRenderItem/index.js +2 -0
  109. package/__internal__/src/components/FlatSelect/useRenderItem/index.js.map +1 -0
  110. package/__internal__/src/components/FlatSelect/useRenderItem/useRenderItem.d.ts +10 -0
  111. package/__internal__/src/components/FlatSelect/useRenderItem/useRenderItem.js +2 -0
  112. package/__internal__/src/components/FlatSelect/useRenderItem/useRenderItem.js.map +1 -0
  113. package/__internal__/src/components/ListCanary/ListBox/ListBox.js +1 -1
  114. package/__internal__/src/components/ListCanary/ListBox/ListBox.js.map +1 -1
  115. package/__internal__/src/components/ListCanary/types.d.ts +1 -0
  116. package/__internal__/src/components/ListCanary/types.js.map +1 -1
  117. package/__internal__/src/components/Pagination/PaginationArrow/PaginationArrow.d.ts +1 -0
  118. package/__internal__/src/components/Pagination/PaginationArrow/PaginationArrow.js +1 -1
  119. package/__internal__/src/components/Pagination/PaginationArrow/PaginationArrow.js.map +1 -1
  120. package/__internal__/src/components/Popover/Popover.d.ts +2 -2
  121. package/__internal__/src/components/Popover/Popover.js.map +1 -1
  122. package/__internal__/src/components/SelectCanary/helpers.d.ts +1 -1
  123. package/__internal__/src/components/Sidebar/Sidebar.d.ts +1 -1
  124. package/__internal__/src/components/Sidebar/Sidebar.js.map +1 -1
  125. package/__internal__/src/components/ThemeToggler/helpers.d.ts +1 -1
  126. package/__internal__/src/components/ThemeToggler/types.d.ts +1 -1
  127. package/__internal__/src/components/ThemeToggler/types.js.map +1 -1
  128. package/__internal__/src/components/Tooltip/types.d.ts +1 -1
  129. package/__internal__/src/components/Tooltip/types.js.map +1 -1
  130. package/__internal__/src/components/TooltipDeprecated/TooltipDeprecated.d.ts +1 -1
  131. package/__internal__/src/components/TooltipDeprecated/TooltipDeprecated.js.map +1 -1
  132. package/__internal__/src/utils/state/useClickOutsideAtom/index.d.ts +1 -0
  133. package/__internal__/src/utils/state/useClickOutsideAtom/index.js +2 -0
  134. package/__internal__/src/utils/state/useClickOutsideAtom/index.js.map +1 -0
  135. package/__internal__/src/utils/state/useClickOutsideAtom/useClickOutside.d.ts +9 -0
  136. package/__internal__/src/utils/state/useClickOutsideAtom/useClickOutside.js +2 -0
  137. package/__internal__/src/utils/state/useClickOutsideAtom/useClickOutside.js.map +1 -0
  138. package/__internal__/src/utils/state/useElementAtomEventListener/index.d.ts +1 -0
  139. package/__internal__/src/utils/state/useElementAtomEventListener/index.js +2 -0
  140. package/__internal__/src/utils/state/useElementAtomEventListener/index.js.map +1 -0
  141. package/__internal__/src/utils/state/useElementAtomEventListener/useElementAtomEventListener.d.ts +2 -0
  142. package/__internal__/src/utils/state/useElementAtomEventListener/useElementAtomEventListener.js +2 -0
  143. package/__internal__/src/utils/state/useElementAtomEventListener/useElementAtomEventListener.js.map +1 -0
  144. package/__internal__/src/utils/state/useKeysAtom/index.d.ts +1 -0
  145. package/__internal__/src/utils/state/useKeysAtom/index.js +2 -0
  146. package/__internal__/src/utils/state/useKeysAtom/index.js.map +1 -0
  147. package/__internal__/src/utils/state/useKeysAtom/useKeysAtom.d.ts +14 -0
  148. package/__internal__/src/utils/state/useKeysAtom/useKeysAtom.js +2 -0
  149. package/__internal__/src/utils/state/useKeysAtom/useKeysAtom.js.map +1 -0
  150. package/__internal__/src/utils/state/useRefAtom/useRefAtom.d.ts +1 -1
  151. package/__internal__/src/utils/state/useRefAtom/useRefAtom.js.map +1 -1
  152. package/__internal__/src/utils/state/withCtx/withCtx.js +1 -1
  153. package/__internal__/src/utils/state/withCtx/withCtx.js.map +1 -1
  154. package/package.json +1 -1
@@ -0,0 +1,133 @@
1
+ import { IconComponent } from '@consta/icons/Icon';
2
+ import React from 'react';
3
+ import { FieldPropSize, FieldPropView } from '../FieldComponents';
4
+ import { Direction } from '../Popover';
5
+ import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';
6
+ export type RenderItemProps<ITEM> = {
7
+ item: ITEM;
8
+ active: boolean;
9
+ hovered: boolean;
10
+ onClick: (e: React.MouseEvent) => void;
11
+ onMouseEnter: (e: React.MouseEvent) => void;
12
+ ref: React.Ref<HTMLDivElement>;
13
+ };
14
+ export type FlatSelectItemDefault = {
15
+ label: string;
16
+ id: string | number;
17
+ groupId?: string | number;
18
+ disabled?: boolean;
19
+ };
20
+ export type FlatSelectGroupDefault = {
21
+ label: string;
22
+ id: string | number;
23
+ };
24
+ export type FlatSelectPropGetItemLabel<ITEM> = (item: ITEM) => string;
25
+ export type FlatSelectPropGetItemKey<ITEM> = (item: ITEM) => string | number;
26
+ export type FlatSelectPropGetItemGroupKey<ITEM> = (item: ITEM) => string | number | undefined;
27
+ export type FlatSelectPropGetItemDisabled<ITEM> = (item: ITEM) => boolean | undefined;
28
+ export type FlatSelectPropGetGroupKey<GROUP> = (group: GROUP) => string | number;
29
+ export type FlatSelectPropGetGroupLabel<GROUP> = (group: GROUP) => string;
30
+ export type FlatSelectPropOnChange<ITEM, MULTIPLE extends boolean> = (value: (MULTIPLE extends true ? ITEM[] : ITEM) | null, props: {
31
+ e: React.SyntheticEvent;
32
+ }) => void;
33
+ export type FlatSelectPropValue<ITEM, MULTIPLE extends boolean> = (MULTIPLE extends true ? ITEM[] : ITEM) | null | undefined;
34
+ export type FlatSelectPropRenderItem<ITEM> = (props: RenderItemProps<ITEM>) => React.ReactNode | null;
35
+ export type FlatSelectPropRenderValue<ITEM, MULTIPLE> = MULTIPLE extends true ? (props: {
36
+ value: ITEM[];
37
+ getRemove: (item: ITEM) => (e: React.SyntheticEvent<Element, Event>) => void;
38
+ }) => React.ReactNode | null : (props: {
39
+ value: ITEM;
40
+ }) => React.ReactNode | null;
41
+ export type FlatSelectPropOnCreate = (label: string, props: {
42
+ e: React.SyntheticEvent;
43
+ }) => void;
44
+ export type FlatSelectAllItem = {
45
+ groupKey: string | number;
46
+ __optionSelectAll: true;
47
+ };
48
+ export type Group<ITEM, GROUP> = {
49
+ items: ITEM[];
50
+ key: string | number;
51
+ group?: GROUP;
52
+ };
53
+ export type CountedGroup<ITEM, GROUP> = Omit<Group<ITEM, GROUP>, 'items'> & {
54
+ items: Array<FlatSelectAllItem | ITEM>;
55
+ };
56
+ export type FlatSelectPropForm = 'default' | 'brick' | 'round';
57
+ export type FlatSelectPropsInit<ITEM = FlatSelectItemDefault, GROUP = FlatSelectGroupDefault, MULTIPLE extends boolean = false> = PropsWithHTMLAttributesAndRef<{
58
+ items: ITEM[];
59
+ onChange: FlatSelectPropOnChange<ITEM, MULTIPLE>;
60
+ disabled?: boolean;
61
+ form?: 'default' | 'brick' | 'round';
62
+ placeholder?: string;
63
+ size?: FieldPropSize;
64
+ isLoading?: boolean;
65
+ listRef?: React.Ref<HTMLDivElement>;
66
+ renderItem?: FlatSelectPropRenderItem<ITEM>;
67
+ onInputFocus?: React.FocusEventHandler<HTMLInputElement>;
68
+ onInputBlur?: React.FocusEventHandler<HTMLInputElement>;
69
+ onCreate?: FlatSelectPropOnCreate;
70
+ inputRef?: React.Ref<HTMLInputElement>;
71
+ input?: boolean;
72
+ inputValue?: string;
73
+ inputDefaultValue?: string;
74
+ onInput?: (value: string) => void;
75
+ labelForCreate?: ((label: string | undefined) => React.ReactNode) | React.ReactNode;
76
+ labelForEmptyItems?: string;
77
+ multiple?: MULTIPLE;
78
+ value?: FlatSelectPropValue<ITEM, MULTIPLE>;
79
+ groups?: GROUP[];
80
+ getItemLabel?: FlatSelectPropGetItemLabel<ITEM>;
81
+ getItemKey?: FlatSelectPropGetItemKey<ITEM>;
82
+ getItemGroupKey?: FlatSelectPropGetItemGroupKey<ITEM>;
83
+ getItemDisabled?: FlatSelectPropGetItemDisabled<ITEM>;
84
+ getGroupLabel?: FlatSelectPropGetGroupLabel<GROUP>;
85
+ getGroupKey?: FlatSelectPropGetGroupKey<GROUP>;
86
+ virtualScroll?: boolean;
87
+ onScrollToBottom?: (length: number) => void;
88
+ onOpen?: (isOpen: boolean) => void;
89
+ isOpen?: boolean;
90
+ listClassName?: string;
91
+ ignoreOutsideClicksRefs?: ReadonlyArray<React.RefObject<HTMLElement>>;
92
+ clearButton?: boolean;
93
+ iconClear?: IconComponent;
94
+ iconLeft?: IconComponent;
95
+ selectAll?: MULTIPLE extends true ? boolean : never;
96
+ selectAllLabel?: string;
97
+ footer?: React.ReactNode;
98
+ view?: FieldPropView;
99
+ bordered?: boolean;
100
+ anchorRef?: React.RefObject<HTMLElement>;
101
+ direction?: Direction;
102
+ spareDirection?: Direction;
103
+ possibleDirections?: Direction[];
104
+ }, HTMLDivElement>;
105
+ /**
106
+ * Props for the FlatSelect component.
107
+ *
108
+ * This type defines the props for the FlatSelect component, which is a customizable select component.
109
+ * It allows for single or multiple selection, and supports grouping of items.
110
+ * The component can be customized by providing custom item and group types.
111
+ *
112
+ * @template ITEM The type of the items in the select. Defaults to FlatSelectItemDefault.
113
+ * @template GROUP The type of the groups in the select. Defaults to FlatSelectGroupDefault.
114
+ * @template MULTIPLE Whether the select allows multiple selection. Defaults to false.
115
+ */
116
+ export type FlatSelectProps<ITEM = FlatSelectItemDefault, GROUP = FlatSelectGroupDefault, MULTIPLE extends boolean = false> = FlatSelectPropsInit<ITEM, GROUP, MULTIPLE> & (ITEM extends {
117
+ label: FlatSelectItemDefault['label'];
118
+ } ? {} : {
119
+ getItemLabel: FlatSelectPropGetItemLabel<ITEM>;
120
+ }) & (ITEM extends {
121
+ id: FlatSelectItemDefault['id'];
122
+ } ? {} : {
123
+ getItemKey: FlatSelectPropGetItemKey<ITEM>;
124
+ }) & (GROUP extends {
125
+ label: FlatSelectGroupDefault['label'];
126
+ } ? {} : {
127
+ getGroupLabel: FlatSelectPropGetGroupLabel<GROUP>;
128
+ }) & (GROUP extends {
129
+ id: FlatSelectGroupDefault['id'];
130
+ } ? {} : {
131
+ getGroupKey: FlatSelectPropGetGroupKey<GROUP>;
132
+ });
133
+ export type FlatSelectComponent = <ITEM = FlatSelectItemDefault, GROUP = FlatSelectGroupDefault, MULTIPLE extends boolean = false>(props: FlatSelectProps<ITEM, GROUP, MULTIPLE>) => React.ReactNode | null;
@@ -0,0 +1,2 @@
1
+ export{};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../../src/components/FlatSelect/types.ts"],"sourcesContent":["import { IconComponent } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport { FieldPropSize, FieldPropView } from '##/components/FieldComponents';\nimport { Direction } from '##/components/Popover';\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport type RenderItemProps<ITEM> = {\n item: ITEM;\n active: boolean;\n hovered: boolean;\n onClick: (e: React.MouseEvent) => void;\n onMouseEnter: (e: React.MouseEvent) => void;\n ref: React.Ref<HTMLDivElement>;\n};\n\nexport type FlatSelectItemDefault = {\n label: string;\n id: string | number;\n groupId?: string | number;\n disabled?: boolean;\n};\n\nexport type FlatSelectGroupDefault = {\n label: string;\n id: string | number;\n};\n\nexport type FlatSelectPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type FlatSelectPropGetItemKey<ITEM> = (item: ITEM) => string | number;\nexport type FlatSelectPropGetItemGroupKey<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\nexport type FlatSelectPropGetItemDisabled<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\nexport type FlatSelectPropGetGroupKey<GROUP> = (\n group: GROUP,\n) => string | number;\nexport type FlatSelectPropGetGroupLabel<GROUP> = (group: GROUP) => string;\n\nexport type FlatSelectPropOnChange<ITEM, MULTIPLE extends boolean> = (\n value: (MULTIPLE extends true ? ITEM[] : ITEM) | null,\n props: {\n e: React.SyntheticEvent;\n },\n) => void;\nexport type FlatSelectPropValue<ITEM, MULTIPLE extends boolean> =\n | (MULTIPLE extends true ? ITEM[] : ITEM)\n | null\n | undefined;\n\nexport type FlatSelectPropRenderItem<ITEM> = (\n props: RenderItemProps<ITEM>,\n) => React.ReactNode | null;\n\nexport type FlatSelectPropRenderValue<ITEM, MULTIPLE> = MULTIPLE extends true\n ? (props: {\n value: ITEM[];\n getRemove: (\n item: ITEM,\n ) => (e: React.SyntheticEvent<Element, Event>) => void;\n }) => React.ReactNode | null\n : (props: { value: ITEM }) => React.ReactNode | null;\n\nexport type FlatSelectPropOnCreate = (\n label: string,\n props: { e: React.SyntheticEvent },\n) => void;\n\nexport type FlatSelectAllItem = {\n groupKey: string | number;\n __optionSelectAll: true;\n};\n\nexport type Group<ITEM, GROUP> = {\n items: ITEM[];\n key: string | number;\n group?: GROUP;\n};\n\nexport type CountedGroup<ITEM, GROUP> = Omit<Group<ITEM, GROUP>, 'items'> & {\n items: Array<FlatSelectAllItem | ITEM>;\n};\n\nexport type FlatSelectPropForm = 'default' | 'brick' | 'round';\n\nexport type FlatSelectPropsInit<\n ITEM = FlatSelectItemDefault,\n GROUP = FlatSelectGroupDefault,\n MULTIPLE extends boolean = false,\n> = PropsWithHTMLAttributesAndRef<\n {\n items: ITEM[];\n onChange: FlatSelectPropOnChange<ITEM, MULTIPLE>;\n disabled?: boolean;\n form?: 'default' | 'brick' | 'round';\n placeholder?: string;\n size?: FieldPropSize;\n isLoading?: boolean;\n listRef?: React.Ref<HTMLDivElement>;\n renderItem?: FlatSelectPropRenderItem<ITEM>;\n onInputFocus?: React.FocusEventHandler<HTMLInputElement>;\n onInputBlur?: React.FocusEventHandler<HTMLInputElement>;\n onCreate?: FlatSelectPropOnCreate;\n inputRef?: React.Ref<HTMLInputElement>;\n input?: boolean;\n inputValue?: string;\n inputDefaultValue?: string;\n onInput?: (value: string) => void;\n labelForCreate?:\n | ((label: string | undefined) => React.ReactNode)\n | React.ReactNode;\n labelForEmptyItems?: string;\n multiple?: MULTIPLE;\n value?: FlatSelectPropValue<ITEM, MULTIPLE>;\n groups?: GROUP[];\n getItemLabel?: FlatSelectPropGetItemLabel<ITEM>;\n getItemKey?: FlatSelectPropGetItemKey<ITEM>;\n getItemGroupKey?: FlatSelectPropGetItemGroupKey<ITEM>;\n getItemDisabled?: FlatSelectPropGetItemDisabled<ITEM>;\n getGroupLabel?: FlatSelectPropGetGroupLabel<GROUP>;\n getGroupKey?: FlatSelectPropGetGroupKey<GROUP>;\n virtualScroll?: boolean;\n onScrollToBottom?: (length: number) => void;\n onOpen?: (isOpen: boolean) => void;\n isOpen?: boolean;\n listClassName?: string;\n ignoreOutsideClicksRefs?: ReadonlyArray<React.RefObject<HTMLElement>>;\n clearButton?: boolean;\n iconClear?: IconComponent;\n iconLeft?: IconComponent;\n selectAll?: MULTIPLE extends true ? boolean : never;\n selectAllLabel?: string;\n footer?: React.ReactNode;\n view?: FieldPropView;\n bordered?: boolean;\n anchorRef?: React.RefObject<HTMLElement>;\n direction?: Direction;\n spareDirection?: Direction;\n possibleDirections?: Direction[];\n },\n HTMLDivElement\n>;\n\n/**\n * Props for the FlatSelect component.\n *\n * This type defines the props for the FlatSelect component, which is a customizable select component.\n * It allows for single or multiple selection, and supports grouping of items.\n * The component can be customized by providing custom item and group types.\n *\n * @template ITEM The type of the items in the select. Defaults to FlatSelectItemDefault.\n * @template GROUP The type of the groups in the select. Defaults to FlatSelectGroupDefault.\n * @template MULTIPLE Whether the select allows multiple selection. Defaults to false.\n */\nexport type FlatSelectProps<\n ITEM = FlatSelectItemDefault,\n GROUP = FlatSelectGroupDefault,\n MULTIPLE extends boolean = false,\n> = FlatSelectPropsInit<ITEM, GROUP, MULTIPLE> &\n (ITEM extends { label: FlatSelectItemDefault['label'] }\n ? {}\n : { getItemLabel: FlatSelectPropGetItemLabel<ITEM> }) &\n (ITEM extends { id: FlatSelectItemDefault['id'] }\n ? {}\n : { getItemKey: FlatSelectPropGetItemKey<ITEM> }) &\n (GROUP extends { label: FlatSelectGroupDefault['label'] }\n ? {}\n : { getGroupLabel: FlatSelectPropGetGroupLabel<GROUP> }) &\n (GROUP extends { id: FlatSelectGroupDefault['id'] }\n ? {}\n : { getGroupKey: FlatSelectPropGetGroupKey<GROUP> });\n\nexport type FlatSelectComponent = <\n ITEM = FlatSelectItemDefault,\n GROUP = FlatSelectGroupDefault,\n MULTIPLE extends boolean = false,\n>(\n props: FlatSelectProps<ITEM, GROUP, MULTIPLE>,\n) => React.ReactNode | null;\n"],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ type ScrollToIndexFunctionType = (optionIndex: number, dropdownElement: HTMLDivElement | null, optionsRefs: React.RefObject<HTMLDivElement>[], onFailure?: () => void) => void;
3
+ export declare const scrollToIndex: ScrollToIndexFunctionType;
4
+ export {};
@@ -0,0 +1,2 @@
1
+ import{scrollIntoView}from"../../../utils/scrollIntoView";export var scrollToIndex=function(a,b,c,d){var e;if(b&&!(0>a)){var f=null===(e=c[a])||void 0===e?void 0:e.current;f?scrollIntoView(f,b):null===d||void 0===d?void 0:d()}};
2
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","names":["scrollIntoView","scrollToIndex","index","dropdownElement","optionsRefs","onFailure","element","current"],"sources":["../../../../../../src/components/FlatSelect/useFlatSelect/helpers.ts"],"sourcesContent":["import React from 'react';\n\nimport { scrollIntoView } from '##/utils/scrollIntoView';\n\ntype ScrollToIndexFunctionType = (\n optionIndex: number,\n dropdownElement: HTMLDivElement | null,\n optionsRefs: React.RefObject<HTMLDivElement>[],\n onFailure?: () => void,\n) => void;\n\nexport const scrollToIndex: ScrollToIndexFunctionType = (\n index,\n dropdownElement,\n optionsRefs,\n onFailure,\n): void => {\n if (!dropdownElement || index < 0) {\n return;\n }\n\n const element = optionsRefs[index]?.current;\n\n if (element) {\n scrollIntoView(element, dropdownElement);\n } else {\n onFailure?.();\n }\n};\n"],"mappings":"AAEA,OAASA,cAAT,qCASA,MAAO,IAAMC,cAAwC,CAAG,SACtDC,CADsD,CAEtDC,CAFsD,CAGtDC,CAHsD,CAItDC,CAJsD,CAK7C,OACT,GAAKF,CAAD,IAA4B,CAAR,CAAAD,CAApB,CAAJ,EAIA,GAAMI,EAAO,WAAGF,CAAW,CAACF,CAAD,CAAd,qBAAG,EAAoBK,OAApC,CAEID,CANJ,CAOEN,cAAc,CAACM,CAAD,CAAUH,CAAV,CAPhB,QASEE,CATF,WASEA,CATF,QASEA,CAAS,EATX,CAWD,CAjBM"}
@@ -0,0 +1 @@
1
+ export * from './useFlatSelect';
@@ -0,0 +1,2 @@
1
+ export*from"./useFlatSelect";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../../src/components/FlatSelect/useFlatSelect/index.ts"],"sourcesContent":["export * from './useFlatSelect';\n"],"mappings":"AAAA"}
@@ -0,0 +1,52 @@
1
+ import { AtomMut } from '@reatom/framework';
2
+ import React from 'react';
3
+ import { GetGroupsResult } from '../../../utils/getGroups';
4
+ import { PropsWithDefault } from '../defaultProps';
5
+ import { CountedGroup, FlatSelectAllItem, FlatSelectGroupDefault, FlatSelectItemDefault, Group } from '../types';
6
+ export type OptionForCreate = {
7
+ label: string;
8
+ __optionForCreate: boolean;
9
+ };
10
+ export type UseFlatSelectProps<ITEM = FlatSelectItemDefault, GROUP = FlatSelectGroupDefault, MULTIPLE extends boolean = false> = {
11
+ propsAtom: AtomMut<PropsWithDefault<ITEM, GROUP, MULTIPLE>>;
12
+ };
13
+ export type OptionProps<ITEM> = {
14
+ index: number;
15
+ item: ITEM | OptionForCreate | FlatSelectAllItem;
16
+ };
17
+ export type GetOptionPropsResult = {
18
+ onClick: (e: React.MouseEvent) => void;
19
+ onMouseEnter: (e: React.MouseEvent) => void;
20
+ };
21
+ export declare const isOptionForCreate: <ITEM, GROUP>(params: OptionForCreate | Group<ITEM, GROUP> | ITEM) => params is OptionForCreate;
22
+ export declare const isNotOptionForCreate: <ITEM, GROUP>(params: OptionForCreate | Group<ITEM, GROUP>) => params is Group<ITEM, GROUP>;
23
+ export declare const isOptionForSelectAll: <ITEM>(params: FlatSelectAllItem | ITEM) => params is FlatSelectAllItem;
24
+ export declare function getCountedGroups<ITEM, GROUP>(groups: GetGroupsResult<ITEM, GROUP>, selectAll: boolean): CountedGroup<ITEM, GROUP>[];
25
+ export declare const useFlatSelect: <ITEM = FlatSelectItemDefault, GROUP = FlatSelectItemDefault, MULTIPLE extends boolean = false>({ propsAtom, }: UseFlatSelectProps<ITEM, GROUP, MULTIPLE>) => {
26
+ openAtom: AtomMut<boolean>;
27
+ inputFocusAtom: AtomMut<boolean>;
28
+ inputValueAtom: AtomMut<string>;
29
+ clearButtonAtom: AtomMut<boolean>;
30
+ onInput: import("@reatom/framework").Fn<[value?: string | undefined], void>;
31
+ getOptionActions: import("@reatom/framework").Fn<[OptionProps<ITEM>], GetOptionPropsResult>;
32
+ handleInputBlur: import("@reatom/framework").Fn<[e: React.FocusEvent<HTMLInputElement, Element>], void>;
33
+ getHandleRemoveValue: import("@reatom/framework").Fn<[item: ITEM], (e: React.SyntheticEvent) => void>;
34
+ inputRef: React.RefObject<HTMLInputElement>;
35
+ listRef: React.RefObject<HTMLDivElement>;
36
+ handleInputChange: import("@reatom/framework").Fn<[e: React.ChangeEvent<HTMLInputElement>], void>;
37
+ handleInputFocus: import("@reatom/framework").Fn<[e: React.FocusEvent<HTMLInputElement, Element>], void>;
38
+ visibleItemsAtom: AtomMut<(OptionForCreate | CountedGroup<ITEM, GROUP>)[]>;
39
+ clearValue: import("@reatom/framework").Fn<[], void>;
40
+ optionsRefs: React.RefObject<HTMLDivElement>[];
41
+ highlightedIndexAtom: AtomMut<number>;
42
+ valueAtom: AtomMut<ITEM[]>;
43
+ getItemKeyAtom: AtomMut<import("../types").FlatSelectPropGetItemKey<ITEM>>;
44
+ onChangeAll: import("@reatom/framework").Fn<[e: React.SyntheticEvent<Element, Event>, items: ITEM[]], void>;
45
+ onCreate: import("@reatom/framework").Fn<[e: React.SyntheticEvent<Element, Event>], void>;
46
+ onChange: import("@reatom/framework").Fn<[e: React.SyntheticEvent<Element, Event>, item: ITEM], void>;
47
+ hasItemsAtom: AtomMut<boolean>;
48
+ groupsCounterAtom: AtomMut<Record<string, [number, number]>>;
49
+ dropdownZIndexAtom: AtomMut<number | undefined>;
50
+ rootRef: React.RefCallback<HTMLDivElement | null>;
51
+ disabledAtom: AtomMut<boolean>;
52
+ };
@@ -0,0 +1,2 @@
1
+ import _asyncToGenerator from"@babel/runtime/helpers/asyncToGenerator";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";function _createForOfIteratorHelper(a,b){var c="undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(!c){if(Array.isArray(a)||(c=_unsupportedIterableToArray(a))||b&&a&&"number"==typeof a.length){c&&(a=c);var d=0,e=function(){};return{s:e,n:function n(){return d>=a.length?{done:!0}:{done:!1,value:a[d++]}},e:function(a){function b(){return a.apply(this,arguments)}return b.toString=function(){return a.toString()},b}(function(a){throw a}),f:e}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var f,g=!0,h=!1;return{s:function s(){c=c.call(a)},n:function n(){var a=c.next();return g=a.done,a},e:function(a){function b(){return a.apply(this,arguments)}return b.toString=function(){return a.toString()},b}(function(a){h=!0,f=a}),f:function f(){try{g||null==c["return"]||c["return"]()}finally{if(h)throw f}}}}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}import _regeneratorRuntime from"@babel/runtime/regenerator";import{action,sleep,withConcurrency}from"@reatom/framework";import{useAction,useAtom,useUpdate}from"@reatom/npm-react";import{useRef}from"react";import{useRefs}from"../../../hooks/useRefs";import{animateTimeout}from"../../../mixs/MixPopoverAnimate";import{getGroups}from"../../../utils/getGroups";import{useClickOutsideAtom}from"../../../utils/state/useClickOutsideAtom";import{useCreateAtom}from"../../../utils/state/useCreateAtom";import{useElementAtomEventListener}from"../../../utils/state/useElementAtomEventListener";import{useKeysAtom}from"../../../utils/state/useKeysAtom";import{usePickAtom,usePropAtom}from"../../../utils/state/usePickAtom";import{useRefAtom}from"../../../utils/state/useRefAtom";import{scrollToIndex}from"./helpers";var isMultipleParams=function(a){return!!a.multiple};export var isOptionForCreate=function(a){return a&&Object.prototype.hasOwnProperty.call(a,"__optionForCreate")};export var isNotOptionForCreate=function(a){return a&&!Object.prototype.hasOwnProperty.call(a,"__optionForCreate")};export var isOptionForSelectAll=function(a){return a&&Object.prototype.hasOwnProperty.call(a,"__optionSelectAll")};export function getCountedGroups(a,b){var c=_toConsumableArray(a);return b&&a.forEach(function(a,b){c[b].items=[{__optionSelectAll:!0,groupKey:a.key}].concat(_toConsumableArray(c[b].items))}),c}export var useFlatSelect=function(a){var b=a.propsAtom,c=useRef(null),d=useRef(null),f=usePropAtom(b,"anchorRef"),g=useCreateAtom(function(a){var b=a.spy(f);return null!==b&&void 0!==b&&b.current?b.current:null}),h=useRefAtom(),i=_slicedToArray(h,2),j=i[0],k=i[1],l=useCreateAtom(!1),m=useCreateAtom(!1),n=usePropAtom(b,"items"),o=usePropAtom(b,"selectAll"),p=usePropAtom(b,"value"),q=usePropAtom(b,"disabled"),r=useCreateAtom(function(a){return!!a.spy(q)}),s=usePropAtom(b,"inputValue"),t=usePropAtom(b,"isOpen"),u=useCreateAtom(function(a){return!!a.spy(b).onCreate}),v=useCreateAtom(function(a){var c,d=null===(c=a.spy(b).style)||void 0===c?void 0:c.zIndex;return"number"==typeof d?d+1:void 0}),w=usePropAtom(b,"ignoreOutsideClicksRefs"),x=usePropAtom(b,"getItemKey"),y=useCreateAtom(function(a){var b=a.spy(p);return b&&(Array.isArray(b)?b:[b])||[]}),z=useCreateAtom(!1),A=useCreateAtom(!1),B=useCreateAtom(-1),C=useCreateAtom(""),D=useCreateAtom(function(a){var c=a.spy(b),d=c.clearButton,e=a.spy(C),f=a.spy(y);return!!(d&&(null!==f&&void 0!==f&&f.length||e))}),E=useAction(action(function(){var a=_asyncToGenerator(_regeneratorRuntime.mark(function c(a,b){return _regeneratorRuntime.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,a.schedule(function(){return sleep(5)});case 2:l(a,b);case 3:case"end":return c.stop();}},c)}));return function(){return a.apply(this,arguments)}}()).pipe(withConcurrency())),F=useAction(function(a){return m(a,!0)}),G=useAction(function(a){return m(a,!1)}),H=useAction(function(){return E(!0)}),I=useAction(function(){return E(!1)}),J=useAction(function(a){var d,e,f=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";null===(d=(e=a.get(b)).onInput)||void 0===d?void 0:d.call(e,f),C(a,f),c.current&&(c.current.value=f)}),K=useCreateAtom(function(a){var b=a.spy(u);if(b){var c=a.spy(C);return{label:c,__optionForCreate:!0}}}),L=usePickAtom(b,["selectAll","groups","getItemGroupKey","getGroupKey","getItemKey","items"]),M=useCreateAtom(function(a){var b=a.spy(L),c=b.selectAll,d=b.groups,e=b.getItemGroupKey,f=b.getGroupKey,g=b.items,h=a.spy(K),i=getCountedGroups(getGroups(g,null!==d&&void 0!==d&&d.length?e:void 0,d,f,void 0),c&&g.length&&c);return h?[h].concat(_toConsumableArray(i)):i}),N=useCreateAtom(function(a){var c=a.spy(M),d=a.spy(o),e=a.spy(y),f=a.get(b),g=f.getItemDisabled,h={};return d&&function getFlatSelectedCounter(){var a,b=_createForOfIteratorHelper(c);try{for(b.s();!(a=b.n()).done;){var j=a.value;if(!isOptionForCreate(j)){h[j.key]=[0,j.items.length-1];var d,f=_createForOfIteratorHelper(j.items);try{var i=function(){var a=d.value;isOptionForSelectAll(a)||g(a)||!e.some(function(b){return b===a})||(h[j.key][0]=(h[j.key][0]||0)+1)};for(f.s();!(d=f.n()).done;)i()}catch(a){f.e(a)}finally{f.f()}}}}catch(a){b.e(a)}finally{b.f()}}(),h}),O=useAtom(function(a){var b=a.spy(n),c=a.spy(u),d=a.spy(o),e=a.spy(M);return b.length+(c?1:0)+(d?e.length:0)}),P=_slicedToArray(O,3),Q=P[0],R=P[1],e=P[2],S=useCreateAtom(function(a){var b=a.spy(n),c=a.spy(K);return!!c||!!b.length}),T=useRefs(Q,void 0),U=useAction(function(a){var b=a.get(n),c=a.get(B),e=d.current;0<b.length&&e&&scrollToIndex(c,e,T)}),V=useAction(function(a,b){a.get(r)||B(a,function(c){var d=Math.min(Math.max(0,"function"==typeof b?b(c):b),a.get(e)-1);return d})}),W=useAction(function(a,c,d){c.stopPropagation();var e=a.get(b);if(isMultipleParams(e)){var f=e.getItemDisabled,g=e.getItemKey,h=e.onChange,i=a.get(y).filter(function(a){return!!(null!==f&&void 0!==f&&f(a))||g(a)!==g(d)});h(null!==i&&void 0!==i&&i.length?i:null,{e:c})}}),X=useAction(function(a,c,d){var e=a.get(b),f=e.getItemDisabled,g=e.getItemKey,h=e.onChange,i=e.multiple,j=e.disabled;if(!(j||f&&f(d)))if(i){var k=a.get(y),l=k.some(function(a){return g(a)===g(d)})?k.filter(function(a){return g(a)!==g(d)}):[].concat(_toConsumableArray(k),[d]),m=l.length?l:null;h(m,{e:c})}else h(d,{e:c})}),Y=useAction(function(a,c,d){var e=a.get(y),f=a.get(b),g=f.getItemDisabled,h=f.getItemKey,i=f.multiple,j=f.onChange;if(i){var k=g?d.filter(function(a){return!g(a)}):d,l=[],m=[];if(e.forEach(function(a){k.find(function(b){return h(a)===h(b)})?l.push(a):m.push(a)}),l.length===k.length)j(m.length?m:null,{e:c});else{var n=[].concat(m,_toConsumableArray(k));j(n.length?n:null,{e:c})}}}),Z=useAction(function(a,c){var d=a.get(b),e=d.onCreate;null===e||void 0===e?void 0:e(a.get(C),{e:c}),J("")}),$=useAction(function(a,c){!a.get(r)&&a.get(b).input&&(null===J||void 0===J?void 0:J(c.target.value))}),_=useAction(function(){return J("")}),aa=useAction(function(a,b){return function(a){return W(a,b)}}),ba=useAction(function(a,b){b.preventDefault(),b.stopPropagation(),a.get(r)||(V(function(a){return a-1}),U())}),ca=useAction(function(a,b){b.preventDefault(),b.stopPropagation(),a.get(r)||(V(function(a){return a+1}),U())}),da=useAction(function(a,c){var d=a.get(b),e=d.items,f=a.get(B),g=a.get(C),h=a.get(M);(g||e[f])&&(c.preventDefault(),c.stopPropagation());var i=function getData(a){var b,c=0,d=_createForOfIteratorHelper(h);try{for(d.s();!(b=d.n()).done;){var e=b.value;if(isOptionForCreate(e)){if(c===a)return[void 0,e];c++;continue}if(e.items.length+c>a)return[e,e.items[a-c]];c+=e.items.length}}catch(a){d.e(a)}finally{d.f()}return[void 0,void 0]}(f),j=_slicedToArray(i,2),k=j[0],l=j[1];if(isOptionForCreate(l))return void Z(c);if(isOptionForSelectAll(l)){var m;return void Y(c,null!==(m=null===k||void 0===k?void 0:k.items.filter(function(a){return!isOptionForSelectAll(a)}))&&void 0!==m?m:[])}l&&X(c,l)}),ea=useAction(function(a,b){var c,d;b.preventDefault(),b.stopPropagation(),A(a,!1),null===(c=a.get(f))||void 0===c||null===(d=c.current)||void 0===d?void 0:d.focus()}),fa=useAction(function(a,c){var d,e;a.get(b).input&&!a.get(z)||(a.get(A)&&(c.preventDefault(),c.stopPropagation(),A(a,!1)),null===(d=a.get(f))||void 0===d||null===(e=d.current)||void 0===e?void 0:e.focus())}),ga=useCreateAtom({ArrowUp:ba,ArrowDown:ca,PageUp:ba,PageDown:ca,Home:ba,End:ca,Enter:da,Escape:ea,Tab:fa}),ha=useAction(function(a,b){var c=b.index,d=b.item;if(isOptionForCreate(d))return{onClick:function onClick(a){Z(a),V(c)},onMouseEnter:function onMouseEnter(){return a.get(l)&&V(c)}};if(isOptionForSelectAll(d)){var f=function(){var b,c=a.get(M),e=_createForOfIteratorHelper(c);try{for(e.s();!(b=e.n()).done;){var g=b.value;if(!isOptionForCreate(g)&&g.key===d.groupKey){var f;return null!==(f=null===g||void 0===g?void 0:g.items.filter(function(a){return!isOptionForSelectAll(a)}))&&void 0!==f?f:[]}}}catch(a){e.e(a)}finally{e.f()}return[]};return{onClick:function onClick(a){Y(a,f()),V(c)},onMouseEnter:function onMouseEnter(){return a.get(l)&&V(c)}}}return{onClick:function onClick(a){console.log("onClick",d),V(c),X(a,d)},onMouseEnter:function onMouseEnter(){return a.get(l)&&V(c)}}}),ia=useAction(function(a,c){var d=a.get(b),e=d.disabled,f=d.onInputFocus,g=a.get(z);e||(!g&&z(a,!0),null===f||void 0===f?void 0:f(c))}),ja=useAction(function(a,c){var d,e;a.get(z)&&z(a,!1),null===(d=(e=a.get(b)).onInputBlur)||void 0===d?void 0:d.call(e,c)});useClickOutsideAtom({isActiveAtom:A,ignoreClicksElementsAtom:useCreateAtom(function(a){var b,c=a.spy(j),d=a.spy(g),e=null===(b=a.spy(w))||void 0===b?void 0:b.map(function(a){return a.current});return[c,d].concat(_toConsumableArray(e||[]))}),handler:useAction(function(a){A(a,!1)})}),useClickOutsideAtom({isActiveAtom:l,ignoreClicksElementsAtom:useCreateAtom(function(a){var b=a.spy(j);return[b]}),handler:I}),useUpdate(function(a,b){!b||a.get(m)||-1!==a.get(B)||a.get(r)||B(a,0),b||B(a,-1)},[l]),useUpdate(function(a){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",c=a.get(C);b!==c&&J(b)},[s]),useUpdate(function(a){var b=!!(1<arguments.length&&void 0!==arguments[1])&&arguments[1];return A(a,b)},[t]),useUpdate(function(a){return B(a,-1)},[M]),useUpdate(function(a,b){return b&&B(a,-1)},[r]);var ka=useAction(function(a){return A(a,!a.get(A))});return useElementAtomEventListener(g,"click",ka),useElementAtomEventListener(j,"focus",H),useElementAtomEventListener(j,"click",H),useElementAtomEventListener(j,"blur",I),useElementAtomEventListener(j,"mousedown",F),useElementAtomEventListener(j,"mouseup",G),useKeysAtom({keysAtom:ga,elAtom:j,isActiveAtom:useCreateAtom(function(a){var b;return!!(null!==(b=a.spy(f))&&void 0!==b&&b.current&&a.spy(A))||!a.spy(r)})}),useUpdate(function(){var a=_asyncToGenerator(_regeneratorRuntime.mark(function d(a,c){var e,f,g;return _regeneratorRuntime.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return null===(e=(f=a.get(b)).onOpen)||void 0===e?void 0:e.call(f,c),d.next=3,sleep(animateTimeout);case 3:if(c){d.next=8;break}return J(""),z(a,!1),l(a,!1),d.abrupt("return");case 8:c&&(null===(g=a.get(j))||void 0===g?void 0:g.focus());case 9:case"end":return d.stop();}},d)}));return function(){return a.apply(this,arguments)}}(),[A]),{openAtom:A,inputFocusAtom:z,inputValueAtom:C,clearButtonAtom:D,onInput:J,getOptionActions:ha,handleInputBlur:ja,getHandleRemoveValue:aa,inputRef:c,listRef:d,handleInputChange:$,handleInputFocus:ia,visibleItemsAtom:M,clearValue:_,optionsRefs:T,highlightedIndexAtom:B,valueAtom:y,getItemKeyAtom:x,onChangeAll:Y,onCreate:Z,onChange:X,hasItemsAtom:S,groupsCounterAtom:N,dropdownZIndexAtom:v,rootRef:k,disabledAtom:r}};
2
+ //# sourceMappingURL=useFlatSelect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFlatSelect.js","names":["action","sleep","withConcurrency","useAction","useAtom","useUpdate","useRef","useRefs","animateTimeout","getGroups","useClickOutsideAtom","useCreateAtom","useElementAtomEventListener","useKeysAtom","usePickAtom","usePropAtom","useRefAtom","scrollToIndex","isMultipleParams","params","multiple","isOptionForCreate","Object","prototype","hasOwnProperty","call","isNotOptionForCreate","isOptionForSelectAll","getCountedGroups","groups","selectAll","copyGroups","forEach","group","index","items","__optionSelectAll","groupKey","key","useFlatSelect","propsAtom","inputRef","listRef","anchorRefAtom","anchorElementAtom","ctx","ref","spy","current","rootElementAtom","rootRef","rootFocusAtom","rootMouseDownAtom","itemsAtom","selectAllAtom","valuePropAtom","disabledPropAtom","disabledAtom","inputValuePropAtom","openPropAtom","withOnCreateAtom","onCreate","dropdownZIndexAtom","zIndex","style","ignoreOutsideClicksRefsAtom","getItemKeyAtom","valueAtom","value","Array","isArray","inputFocusAtom","openAtom","highlightedIndexAtom","inputValueAtom","clearButtonAtom","clearButton","inputValue","length","setRootFocus","schedule","pipe","handleRootMouseDown","handleRootMouseUp","handleRootFocus","handleRootBlur","onInput","get","optionForCreateAtom","withOnCreate","label","__optionForCreate","propsForVisibleItemsAtom","visibleItemsAtom","getItemGroupKey","getGroupKey","optionForCreate","resultGroups","groupsCounterAtom","visibleItems","getItemDisabled","groupCounter","getFlatSelectedCounter","groupItems","some","item","maxHighlightIndex","_","maxHighlightIndexAtom","hasItemsAtom","optionsRefs","scrollToHighlightedIndex","highlightedIndex","listElement","highlightIndex","indexForHighlight","state","newIndex","Math","min","max","removeValue","e","valueItem","stopPropagation","props","getItemKey","onChange","newValue","filter","disabled","val","onChangeAll","nonDisabledItems","currentGroupValues","withoutGroupValues","el","find","push","handleInputChange","input","target","clearValue","getHandleRemoveValue","ArrowUp","preventDefault","old","ArrowDown","Enter","getData","counter","Escape","focus","Tab","keysAtom","PageUp","PageDown","Home","End","getOptionActions","onClick","onMouseEnter","getItems","console","log","handleInputFocus","onInputFocus","focused","handleInputBlur","onInputBlur","isActiveAtom","ignoreClicksElementsAtom","rootElement","anchorElement","ignoreOutsideClicksElements","map","handler","inputValueProp","openProp","handleAnchorClick","elAtom","open","onOpen"],"sources":["../../../../../../src/components/FlatSelect/useFlatSelect/useFlatSelect.tsx"],"sourcesContent":["import { action, AtomMut, sleep, withConcurrency } from '@reatom/framework';\nimport { useAction, useAtom, useUpdate } from '@reatom/npm-react';\nimport React, { useRef } from 'react';\n\nimport { useRefs } from '##/hooks/useRefs';\nimport { animateTimeout } from '##/mixs/MixPopoverAnimate';\nimport { getGroups, GetGroupsResult } from '##/utils/getGroups';\nimport { useClickOutsideAtom } from '##/utils/state/useClickOutsideAtom';\nimport { useCreateAtom } from '##/utils/state/useCreateAtom';\nimport { useElementAtomEventListener } from '##/utils/state/useElementAtomEventListener';\nimport { KeyHandlers, useKeysAtom } from '##/utils/state/useKeysAtom';\nimport { usePickAtom, usePropAtom } from '##/utils/state/usePickAtom';\nimport { useRefAtom } from '##/utils/state/useRefAtom';\n\nimport { PropsWithDefault } from '../defaultProps';\nimport {\n CountedGroup,\n FlatSelectAllItem,\n FlatSelectGroupDefault,\n FlatSelectItemDefault,\n FlatSelectPropOnChange,\n Group,\n} from '../types';\nimport { scrollToIndex } from './helpers';\n\ntype IndexForHighlight = number | ((oldIndex: number) => number);\n\nexport type OptionForCreate = {\n label: string;\n __optionForCreate: boolean;\n};\n\nexport type UseFlatSelectProps<\n ITEM = FlatSelectItemDefault,\n GROUP = FlatSelectGroupDefault,\n MULTIPLE extends boolean = false,\n> = {\n propsAtom: AtomMut<PropsWithDefault<ITEM, GROUP, MULTIPLE>>;\n};\n\nexport type OptionProps<ITEM> = {\n index: number;\n item: ITEM | OptionForCreate | FlatSelectAllItem;\n};\n\nexport type GetOptionPropsResult = {\n onClick: (e: React.MouseEvent) => void;\n onMouseEnter: (e: React.MouseEvent) => void;\n};\n\nconst isMultipleParams = <\n ITEM = FlatSelectItemDefault,\n GROUP = FlatSelectGroupDefault,\n>(\n params: PropsWithDefault<ITEM, GROUP, boolean>,\n): params is PropsWithDefault<ITEM, GROUP, true> => {\n return !!params.multiple;\n};\n\nexport const isOptionForCreate = <ITEM, GROUP>(\n params: OptionForCreate | Group<ITEM, GROUP> | ITEM,\n): params is OptionForCreate => {\n return (\n params && Object.prototype.hasOwnProperty.call(params, '__optionForCreate')\n );\n};\n\nexport const isNotOptionForCreate = <ITEM, GROUP>(\n params: OptionForCreate | Group<ITEM, GROUP>,\n): params is Group<ITEM, GROUP> => {\n return (\n params && !Object.prototype.hasOwnProperty.call(params, '__optionForCreate')\n );\n};\n\nexport const isOptionForSelectAll = <ITEM,>(\n params: FlatSelectAllItem | ITEM,\n): params is FlatSelectAllItem => {\n return (\n params && Object.prototype.hasOwnProperty.call(params, '__optionSelectAll')\n );\n};\n\nexport function getCountedGroups<ITEM, GROUP>(\n groups: GetGroupsResult<ITEM, GROUP>,\n selectAll: boolean,\n): CountedGroup<ITEM, GROUP>[] {\n const copyGroups: CountedGroup<ITEM, GROUP>[] = [...groups];\n\n if (selectAll) {\n groups.forEach((group, index) => {\n copyGroups[index].items = [\n {\n __optionSelectAll: true,\n groupKey: group.key,\n },\n ...copyGroups[index].items,\n ];\n });\n }\n return copyGroups;\n}\n\nexport const useFlatSelect = <\n ITEM = FlatSelectItemDefault,\n GROUP = FlatSelectItemDefault,\n MULTIPLE extends boolean = false,\n>({\n propsAtom,\n}: UseFlatSelectProps<ITEM, GROUP, MULTIPLE>) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const listRef = useRef<HTMLDivElement>(null);\n\n const anchorRefAtom = usePropAtom(propsAtom, 'anchorRef');\n const anchorElementAtom = useCreateAtom((ctx) => {\n const ref = ctx.spy(anchorRefAtom);\n return ref?.current ? ref.current : null;\n });\n\n const [rootElementAtom, rootRef] = useRefAtom<HTMLDivElement>();\n\n const rootFocusAtom = useCreateAtom(false);\n\n const rootMouseDownAtom = useCreateAtom(false);\n\n const itemsAtom = usePropAtom(propsAtom, 'items');\n const selectAllAtom = usePropAtom(propsAtom, 'selectAll');\n const valuePropAtom = usePropAtom(propsAtom, 'value');\n const disabledPropAtom = usePropAtom(propsAtom, 'disabled');\n const disabledAtom = useCreateAtom((ctx) => !!ctx.spy(disabledPropAtom));\n const inputValuePropAtom = usePropAtom(propsAtom, 'inputValue');\n const openPropAtom = usePropAtom(propsAtom, 'isOpen');\n const withOnCreateAtom = useCreateAtom(\n (ctx) => !!ctx.spy(propsAtom).onCreate,\n );\n\n const dropdownZIndexAtom = useCreateAtom((ctx) => {\n const zIndex = ctx.spy(propsAtom).style?.zIndex;\n return typeof zIndex === 'number' ? zIndex + 1 : undefined;\n });\n const ignoreOutsideClicksRefsAtom = usePropAtom(\n propsAtom,\n 'ignoreOutsideClicksRefs',\n );\n\n const getItemKeyAtom = usePropAtom(propsAtom, 'getItemKey');\n\n const valueAtom = useCreateAtom((ctx) => {\n const value = ctx.spy(valuePropAtom);\n return (value && (Array.isArray(value) ? value : [value])) || [];\n }) as unknown as AtomMut<ITEM[]>;\n const inputFocusAtom = useCreateAtom(false);\n const openAtom = useCreateAtom(false);\n const highlightedIndexAtom = useCreateAtom(-1);\n const inputValueAtom = useCreateAtom('');\n\n const clearButtonAtom = useCreateAtom((ctx) => {\n const { clearButton } = ctx.spy(propsAtom);\n const inputValue = ctx.spy(inputValueAtom);\n const value = ctx.spy(valueAtom);\n return !!(clearButton && (value?.length || inputValue));\n });\n\n const setRootFocus = useAction(\n action(async (ctx, value: boolean) => {\n await ctx.schedule(() => sleep(5));\n rootFocusAtom(ctx, value);\n }).pipe(withConcurrency()),\n );\n const handleRootMouseDown = useAction((ctx) => rootMouseDownAtom(ctx, true));\n const handleRootMouseUp = useAction((ctx) => rootMouseDownAtom(ctx, false));\n const handleRootFocus = useAction(() => setRootFocus(true));\n const handleRootBlur = useAction(() => setRootFocus(false));\n const onInput = useAction((ctx, value: string | undefined = '') => {\n ctx.get(propsAtom).onInput?.(value);\n inputValueAtom(ctx, value);\n\n if (inputRef.current) {\n inputRef.current.value = value;\n }\n });\n\n const optionForCreateAtom = useCreateAtom<OptionForCreate | undefined>(\n (ctx) => {\n const withOnCreate = ctx.spy(withOnCreateAtom);\n if (!withOnCreate) {\n return undefined;\n }\n const inputValue = ctx.spy(inputValueAtom);\n const optionForCreate: OptionForCreate = {\n label: inputValue,\n __optionForCreate: true,\n };\n return optionForCreate;\n },\n );\n\n const propsForVisibleItemsAtom = usePickAtom(\n propsAtom as AtomMut<PropsWithDefault<ITEM, GROUP, boolean>>,\n [\n 'selectAll',\n 'groups',\n 'getItemGroupKey',\n 'getGroupKey',\n 'getItemKey',\n 'items',\n ],\n );\n\n const visibleItemsAtom = useCreateAtom((ctx) => {\n const { selectAll, groups, getItemGroupKey, getGroupKey, items } = ctx.spy(\n propsForVisibleItemsAtom,\n );\n\n const optionForCreate = ctx.spy(optionForCreateAtom);\n\n const resultGroups = getCountedGroups(\n getGroups(\n items,\n groups?.length ? getItemGroupKey : undefined,\n groups,\n getGroupKey,\n undefined,\n ),\n !!selectAll && items.length ? selectAll : false,\n );\n\n return optionForCreate ? [optionForCreate, ...resultGroups] : resultGroups;\n });\n\n const groupsCounterAtom = useCreateAtom((ctx) => {\n const visibleItems = ctx.spy(visibleItemsAtom);\n const selectAll = ctx.spy(selectAllAtom);\n const value = ctx.spy(valueAtom);\n const { getItemDisabled } = ctx.get(propsAtom);\n\n const groupCounter: Record<string, [number, number]> = {};\n\n const getFlatSelectedCounter = () => {\n for (const group of visibleItems) {\n if (isOptionForCreate(group)) {\n continue;\n }\n groupCounter[group.key] = [0, group.items.length - 1];\n for (const groupItems of group.items) {\n if (\n !isOptionForSelectAll(groupItems) &&\n !getItemDisabled(groupItems) &&\n value.some((item) => item === groupItems)\n ) {\n groupCounter[group.key][0] = (groupCounter[group.key][0] || 0) + 1;\n }\n }\n }\n };\n\n if (selectAll) {\n getFlatSelectedCounter();\n }\n\n return groupCounter;\n });\n\n // eslint-disable-next-line no-unused-vars\n const [maxHighlightIndex, _, maxHighlightIndexAtom] = useAtom((ctx) => {\n const items = ctx.spy(itemsAtom);\n const optionForCreate = ctx.spy(withOnCreateAtom);\n const selectAll = ctx.spy(selectAllAtom);\n const visibleItems = ctx.spy(visibleItemsAtom);\n\n return (\n items.length +\n // кнопка для создания\n (optionForCreate ? 1 : 0) +\n // кнопки выбрать все\n (selectAll ? visibleItems.length : 0)\n );\n });\n\n const hasItemsAtom = useCreateAtom((ctx) => {\n const items = ctx.spy(itemsAtom);\n const optionForCreate = ctx.spy(optionForCreateAtom);\n\n if (optionForCreate) {\n return true;\n }\n\n return !!items.length;\n });\n\n const optionsRefs = useRefs<HTMLDivElement>(maxHighlightIndex, undefined);\n\n const scrollToHighlightedIndex = useAction((ctx) => {\n const items = ctx.get(itemsAtom);\n const highlightedIndex = ctx.get(highlightedIndexAtom);\n const listElement = listRef.current;\n\n if (items.length > 0 && listElement) {\n scrollToIndex(highlightedIndex, listElement, optionsRefs);\n }\n });\n\n const highlightIndex = useAction(\n (ctx, indexForHighlight: IndexForHighlight) => {\n if (ctx.get(disabledAtom)) {\n return;\n }\n\n highlightedIndexAtom(ctx, (state) => {\n const newIndex = Math.min(\n Math.max(\n 0,\n typeof indexForHighlight === 'function'\n ? indexForHighlight(state)\n : indexForHighlight,\n ),\n ctx.get(maxHighlightIndexAtom) - 1,\n );\n\n return newIndex;\n });\n },\n );\n\n const removeValue = useAction(\n (ctx, e: React.SyntheticEvent, valueItem: ITEM) => {\n e.stopPropagation();\n const props = ctx.get(propsAtom);\n\n if (isMultipleParams(props)) {\n const { getItemDisabled, getItemKey, onChange } = props;\n\n const newValue = ctx.get(valueAtom).filter((item) => {\n return getItemDisabled?.(item)\n ? true\n : getItemKey(item) !== getItemKey(valueItem);\n });\n\n onChange(newValue?.length ? newValue : null, {\n e,\n });\n }\n },\n );\n\n const onChange = useAction((ctx, e: React.SyntheticEvent, item: ITEM) => {\n const { getItemDisabled, getItemKey, onChange, multiple, disabled } =\n ctx.get(propsAtom);\n\n if (disabled || (getItemDisabled && getItemDisabled(item))) {\n return;\n }\n\n if (multiple) {\n const value = ctx.get(valueAtom);\n const newValue = value.some(\n (value) => getItemKey(value) === getItemKey(item),\n )\n ? value.filter((value) => getItemKey(value) !== getItemKey(item))\n : [...value, item];\n const val = newValue.length ? newValue : null;\n (onChange as FlatSelectPropOnChange<ITEM, true>)(val, { e });\n } else {\n (onChange as FlatSelectPropOnChange<ITEM, false>)(item, { e });\n }\n });\n\n const onChangeAll = useAction(\n (ctx, e: React.SyntheticEvent, items: ITEM[]) => {\n const value = ctx.get(valueAtom);\n const { getItemDisabled, getItemKey, multiple, onChange } =\n ctx.get(propsAtom);\n\n if (multiple) {\n const nonDisabledItems = getItemDisabled\n ? items.filter((item) => !getItemDisabled(item))\n : items;\n\n const currentGroupValues: ITEM[] = [];\n const withoutGroupValues: ITEM[] = [];\n value.forEach((el) => {\n if (\n nonDisabledItems.find((item) => getItemKey(el) === getItemKey(item))\n ) {\n currentGroupValues.push(el);\n } else {\n withoutGroupValues.push(el);\n }\n });\n if (currentGroupValues.length === nonDisabledItems.length) {\n (onChange as FlatSelectPropOnChange<ITEM, true>)(\n withoutGroupValues.length ? withoutGroupValues : null,\n { e },\n );\n } else {\n const val = [...withoutGroupValues, ...nonDisabledItems];\n (onChange as FlatSelectPropOnChange<ITEM, true>)(\n val.length ? val : null,\n { e },\n );\n }\n }\n },\n );\n\n const onCreate = useAction((ctx, e: React.SyntheticEvent) => {\n const { onCreate } = ctx.get(propsAtom);\n onCreate?.(ctx.get(inputValueAtom), { e });\n onInput('');\n });\n\n // Handlers\n\n const handleInputChange = useAction(\n (ctx, e: React.ChangeEvent<HTMLInputElement>): void => {\n if (!ctx.get(disabledAtom) && ctx.get(propsAtom).input) {\n onInput?.(e.target.value);\n }\n },\n );\n\n const clearValue = useAction(() => onInput(''));\n\n const getHandleRemoveValue = useAction(\n (_, item: ITEM) => (e: React.SyntheticEvent) => removeValue(e, item),\n );\n\n // Prop Getters\n\n const ArrowUp = useAction((ctx, e: KeyboardEvent) => {\n e.preventDefault();\n e.stopPropagation();\n if (!ctx.get(disabledAtom)) {\n highlightIndex((old) => old - 1);\n scrollToHighlightedIndex();\n }\n });\n\n const ArrowDown = useAction((ctx, e: KeyboardEvent) => {\n e.preventDefault();\n e.stopPropagation();\n if (!ctx.get(disabledAtom)) {\n highlightIndex((old) => old + 1);\n scrollToHighlightedIndex();\n }\n });\n\n const Enter = useAction((ctx, e: React.SyntheticEvent) => {\n const { items } = ctx.get(propsAtom);\n const highlightedIndex = ctx.get(highlightedIndexAtom);\n const inputValue = ctx.get(inputValueAtom);\n const visibleItems = ctx.get(visibleItemsAtom);\n\n if (inputValue || items[highlightedIndex]) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n const getData = (\n index: number,\n ): [\n CountedGroup<ITEM, GROUP> | undefined,\n FlatSelectAllItem | OptionForCreate | ITEM | undefined,\n ] => {\n let counter = 0;\n\n for (const group of visibleItems) {\n if (isOptionForCreate(group)) {\n if (counter === index) {\n return [undefined, group];\n }\n counter++;\n continue;\n }\n if (group.items.length + counter > index) {\n return [group, group.items[index - counter]];\n }\n counter += group.items.length;\n }\n return [undefined, undefined];\n };\n\n const [group, item] = getData(highlightedIndex);\n\n if (isOptionForCreate(item)) {\n onCreate(e);\n return;\n }\n\n if (isOptionForSelectAll(item)) {\n onChangeAll(\n e,\n (group?.items.filter((el) => !isOptionForSelectAll(el)) as ITEM[]) ??\n [],\n );\n return;\n }\n\n if (item) {\n onChange(e, item);\n }\n }) as unknown as (e: KeyboardEvent) => void;\n\n const Escape = useAction((ctx, e: KeyboardEvent) => {\n e.preventDefault();\n e.stopPropagation();\n openAtom(ctx, false);\n\n ctx.get(anchorRefAtom)?.current?.focus();\n });\n\n const Tab = useAction((ctx, e: KeyboardEvent) => {\n if (ctx.get(propsAtom).input && !ctx.get(inputFocusAtom)) {\n return;\n }\n if (ctx.get(openAtom)) {\n e.preventDefault();\n e.stopPropagation();\n openAtom(ctx, false);\n }\n\n ctx.get(anchorRefAtom)?.current?.focus();\n });\n\n const keysAtom = useCreateAtom<KeyHandlers>({\n ArrowUp,\n ArrowDown,\n PageUp: ArrowUp,\n PageDown: ArrowDown,\n Home: ArrowUp,\n End: ArrowDown,\n Enter,\n Escape,\n Tab,\n });\n\n const getOptionActions = useAction(\n (ctx, { index, item }: OptionProps<ITEM>): GetOptionPropsResult => {\n if (isOptionForCreate(item)) {\n return {\n onClick: (e) => {\n onCreate(e);\n highlightIndex(index);\n },\n onMouseEnter: () => ctx.get(rootFocusAtom) && highlightIndex(index),\n };\n }\n if (isOptionForSelectAll(item)) {\n const getItems = (): ITEM[] => {\n const visibleItems = ctx.get(visibleItemsAtom);\n for (const group of visibleItems) {\n if (isOptionForCreate(group)) {\n continue;\n }\n if (group.key === item.groupKey) {\n return (\n (group?.items.filter(\n (el) => !isOptionForSelectAll(el),\n ) as ITEM[]) ?? []\n );\n }\n }\n return [];\n };\n return {\n onClick: (e: React.SyntheticEvent) => {\n onChangeAll(e, getItems());\n highlightIndex(index);\n },\n onMouseEnter: () => ctx.get(rootFocusAtom) && highlightIndex(index),\n };\n }\n\n return {\n onClick: (e: React.SyntheticEvent) => {\n console.log('onClick', item);\n highlightIndex(index);\n onChange(e, item);\n },\n onMouseEnter: () => ctx.get(rootFocusAtom) && highlightIndex(index),\n };\n },\n );\n\n const handleInputFocus = useAction(\n (ctx, e: React.FocusEvent<HTMLInputElement>): void => {\n const { disabled, onInputFocus } = ctx.get(propsAtom);\n const focused = ctx.get(inputFocusAtom);\n\n if (!disabled) {\n if (!focused) {\n inputFocusAtom(ctx, true);\n }\n onInputFocus?.(e);\n }\n },\n );\n\n const handleInputBlur = useAction(\n (ctx, e: React.FocusEvent<HTMLInputElement>): void => {\n if (ctx.get(inputFocusAtom)) {\n inputFocusAtom(ctx, false);\n }\n\n ctx.get(propsAtom).onInputBlur?.(e);\n },\n );\n\n useClickOutsideAtom({\n isActiveAtom: openAtom,\n ignoreClicksElementsAtom: useCreateAtom((ctx) => {\n const rootElement = ctx.spy(rootElementAtom);\n const anchorElement = ctx.spy(anchorElementAtom);\n const ignoreOutsideClicksElements = ctx\n .spy(ignoreOutsideClicksRefsAtom)\n ?.map((ref) => ref.current);\n\n return [\n rootElement,\n anchorElement,\n ...(ignoreOutsideClicksElements || []),\n ];\n }),\n handler: useAction((ctx) => {\n openAtom(ctx, false);\n }),\n });\n\n useClickOutsideAtom({\n isActiveAtom: rootFocusAtom,\n ignoreClicksElementsAtom: useCreateAtom((ctx) => {\n const rootElement = ctx.spy(rootElementAtom);\n\n return [rootElement] as (HTMLElement | null)[];\n }),\n handler: handleRootBlur,\n });\n\n useUpdate(\n (ctx, focus) => {\n if (\n focus &&\n !ctx.get(rootMouseDownAtom) &&\n ctx.get(highlightedIndexAtom) === -1 &&\n !ctx.get(disabledAtom)\n ) {\n highlightedIndexAtom(ctx, 0);\n }\n if (!focus) {\n highlightedIndexAtom(ctx, -1);\n }\n },\n [rootFocusAtom],\n );\n\n useUpdate(\n (ctx, inputValueProp = '') => {\n const inputValue = ctx.get(inputValueAtom);\n\n if (inputValueProp !== inputValue) {\n onInput(inputValueProp);\n }\n },\n [inputValuePropAtom],\n );\n\n useUpdate((ctx, openProp = false) => openAtom(ctx, openProp), [openPropAtom]);\n\n useUpdate((ctx) => highlightedIndexAtom(ctx, -1), [visibleItemsAtom]);\n\n useUpdate(\n (ctx, disabledAtom) => disabledAtom && highlightedIndexAtom(ctx, -1),\n [disabledAtom],\n );\n\n const handleAnchorClick = useAction((ctx) =>\n openAtom(ctx, !ctx.get(openAtom)),\n );\n\n useElementAtomEventListener(anchorElementAtom, 'click', handleAnchorClick);\n useElementAtomEventListener(rootElementAtom, 'focus', handleRootFocus);\n useElementAtomEventListener(rootElementAtom, 'click', handleRootFocus);\n useElementAtomEventListener(rootElementAtom, 'blur', handleRootBlur);\n useElementAtomEventListener(\n rootElementAtom,\n 'mousedown',\n handleRootMouseDown,\n );\n useElementAtomEventListener(rootElementAtom, 'mouseup', handleRootMouseUp);\n\n useKeysAtom({\n keysAtom,\n elAtom: rootElementAtom,\n isActiveAtom: useCreateAtom((ctx) => {\n if (ctx.spy(anchorRefAtom)?.current && ctx.spy(openAtom)) {\n return true;\n }\n return !ctx.spy(disabledAtom);\n }),\n });\n\n useUpdate(\n async (ctx, open) => {\n ctx.get(propsAtom).onOpen?.(open);\n await sleep(animateTimeout);\n if (!open) {\n onInput('');\n inputFocusAtom(ctx, false);\n rootFocusAtom(ctx, false);\n return;\n }\n if (open) {\n ctx.get(rootElementAtom)?.focus();\n }\n },\n [openAtom],\n );\n\n return {\n openAtom,\n inputFocusAtom,\n inputValueAtom,\n clearButtonAtom,\n onInput,\n getOptionActions,\n handleInputBlur,\n getHandleRemoveValue,\n inputRef,\n listRef,\n handleInputChange,\n handleInputFocus,\n visibleItemsAtom,\n clearValue,\n optionsRefs,\n highlightedIndexAtom,\n valueAtom,\n getItemKeyAtom,\n onChangeAll,\n onCreate,\n onChange,\n hasItemsAtom,\n groupsCounterAtom,\n dropdownZIndexAtom,\n rootRef,\n disabledAtom,\n };\n};\n"],"mappings":"0nDAAA,OAASA,MAAT,CAA0BC,KAA1B,CAAiCC,eAAjC,KAAwD,mBAAxD,CACA,OAASC,SAAT,CAAoBC,OAApB,CAA6BC,SAA7B,KAA8C,mBAA9C,CACA,OAAgBC,MAAhB,KAA8B,OAA9B,CAEA,OAASC,OAAT,8BACA,OAASC,cAAT,uCACA,OAASC,SAAT,gCACA,OAASC,mBAAT,gDACA,OAASC,aAAT,0CACA,OAASC,2BAAT,wDACA,OAAsBC,WAAtB,wCACA,OAASC,WAAT,CAA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fA,EAPK,CAQLzB,oBAAoB,CAApBA,EARK,CASLtG,QAAQ,CAARA,CATK,CAULC,OAAO,CAAPA,CAVK,CAWLiG,iBAAiB,CAAjBA,CAXK,CAYL0B,gBAAgB,CAAhBA,EAZK,CAaLxE,gBAAgB,CAAhBA,CAbK,CAcLiD,UAAU,CAAVA,CAdK,CAeLhC,WAAW,CAAXA,CAfK,CAgBLrC,oBAAoB,CAApBA,CAhBK,CAiBLN,SAAS,CAATA,CAjBK,CAkBLD,cAAc,CAAdA,CAlBK,CAmBLkE,WAAW,CAAXA,CAnBK,CAoBLvE,QAAQ,CAARA,CApBK,CAqBLkE,QAAQ,CAARA,CArBK,CAsBLlB,YAAY,CAAZA,CAtBK,CAuBLX,iBAAiB,CAAjBA,CAvBK,CAwBLpC,kBAAkB,CAAlBA,CAxBK,CAyBLZ,OAAO,CAAPA,CAzBK,CA0BLO,YAAY,CAAZA,CA1BK,CA4BR,CAnoBM"}
@@ -0,0 +1 @@
1
+ export * from './useRenderItem';
@@ -0,0 +1,2 @@
1
+ export*from"./useRenderItem";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../../src/components/FlatSelect/useRenderItem/index.ts"],"sourcesContent":["export * from './useRenderItem';\n"],"mappings":"AAAA"}
@@ -0,0 +1,10 @@
1
+ import { FieldPropSize } from '../../FieldComponents';
2
+ import { FlatSelectItemDefault, FlatSelectPropGetItemDisabled, FlatSelectPropGetItemLabel, FlatSelectPropRenderItem } from '../types';
3
+ export declare const useRenderItem: <ITEM = FlatSelectItemDefault>({ getItemLabel, getItemDisabled, multiple, disabled: componentDisabled, size, renderItem, }: {
4
+ getItemLabel: FlatSelectPropGetItemLabel<ITEM>;
5
+ getItemDisabled: FlatSelectPropGetItemDisabled<ITEM>;
6
+ multiple?: boolean;
7
+ disabled?: boolean;
8
+ size: FieldPropSize;
9
+ renderItem?: FlatSelectPropRenderItem<ITEM>;
10
+ }) => FlatSelectPropRenderItem<ITEM>;
@@ -0,0 +1,2 @@
1
+ import{useAction}from"@reatom/npm-react";import React from"react";import{Checkbox}from"../../Checkbox";import{ListItem}from"../../ListCanary";import{Radio}from"../../Radio";export var useRenderItem=function(a){var b=a.getItemLabel,c=a.getItemDisabled,d=a.multiple,e=a.disabled,f=a.size,g=a.renderItem,h=useAction(function(a,g){var h=g.item,i=g.active,j=g.hovered,k=g.onClick,l=g.onMouseEnter,m=g.ref,n=c(h)||e;return React.createElement(ListItem,{ref:m,"aria-selected":i,"aria-disabled":n,role:"option",label:b(h),size:f,active:j,onMouseEnter:l,disabled:n,onClick:k,leftSide:d?React.createElement(Checkbox,{checked:i,disabled:n,size:f,tabIndex:-1}):React.createElement(Radio,{checked:i,disabled:n,size:f,tabIndex:-1})})},[b,c,d,e,f]);return g||h};
2
+ //# sourceMappingURL=useRenderItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRenderItem.js","names":["useAction","React","Checkbox","ListItem","Radio","useRenderItem","getItemLabel","getItemDisabled","multiple","componentDisabled","disabled","size","renderItem","renderItemDefault","ctx","item","active","hovered","onClick","onMouseEnter","ref"],"sources":["../../../../../../src/components/FlatSelect/useRenderItem/useRenderItem.tsx"],"sourcesContent":["import { useAction } from '@reatom/npm-react';\nimport React from 'react';\n\nimport { Checkbox } from '##/components/Checkbox';\nimport { FieldPropSize } from '##/components/FieldComponents';\nimport { ListItem } from '##/components/ListCanary';\nimport { Radio } from '##/components/Radio';\n\nimport {\n FlatSelectItemDefault,\n FlatSelectPropGetItemDisabled,\n FlatSelectPropGetItemLabel,\n FlatSelectPropRenderItem,\n RenderItemProps,\n} from '../types';\n\nexport const useRenderItem = <ITEM = FlatSelectItemDefault,>({\n getItemLabel,\n getItemDisabled,\n multiple,\n disabled: componentDisabled,\n size,\n renderItem,\n}: {\n getItemLabel: FlatSelectPropGetItemLabel<ITEM>;\n getItemDisabled: FlatSelectPropGetItemDisabled<ITEM>;\n multiple?: boolean;\n disabled?: boolean;\n size: FieldPropSize;\n renderItem?: FlatSelectPropRenderItem<ITEM>;\n}) => {\n const renderItemDefault: FlatSelectPropRenderItem<ITEM> = useAction(\n (\n ctx,\n {\n item,\n active,\n hovered,\n onClick,\n onMouseEnter,\n ref,\n }: RenderItemProps<ITEM>,\n ) => {\n const disabled = getItemDisabled(item) || componentDisabled;\n\n return (\n <ListItem\n ref={ref}\n aria-selected={active}\n aria-disabled={disabled}\n role=\"option\"\n label={getItemLabel(item)}\n size={size}\n active={hovered}\n onMouseEnter={onMouseEnter}\n disabled={disabled}\n onClick={onClick}\n leftSide={\n multiple ? (\n <Checkbox\n checked={active}\n disabled={disabled}\n size={size}\n tabIndex={-1}\n />\n ) : (\n <Radio\n checked={active}\n disabled={disabled}\n size={size}\n tabIndex={-1}\n />\n )\n }\n />\n );\n },\n [getItemLabel, getItemDisabled, multiple, componentDisabled, size],\n );\n\n return renderItem || renderItemDefault;\n};\n"],"mappings":"AAAA,OAASA,SAAT,KAA0B,mBAA1B,CACA,MAAOC,MAAP,KAAkB,OAAlB,CAEA,OAASC,QAAT,sBAEA,OAASC,QAAT,wBACA,OAASC,KAAT,mBAUA,MAAO,IAAMC,cAAa,CAAG,WAcvB,IAbJC,EAaI,GAbJA,YAaI,CAZJC,CAYI,GAZJA,eAYI,CAXJC,CAWI,GAXJA,QAWI,CAVMC,CAUN,GAVJC,QAUI,CATJC,CASI,GATJA,IASI,CARJC,CAQI,GARJA,UAQI,CACEC,CAAiD,CAAGb,SAAS,CACjE,SACEc,CADF,GAUK,IAPDC,EAOC,GAPDA,IAOC,CANDC,CAMC,GANDA,MAMC,CALDC,CAKC,GALDA,OAKC,CAJDC,CAIC,GAJDA,OAIC,CAHDC,CAGC,GAHDA,YAGC,CAFDC,CAEC,GAFDA,GAEC,CACGV,CAAQ,CAAGH,CAAe,CAACQ,CAAD,CAAf,EAAyBN,CADvC,CAGH,MACE,qBAAC,QAAD,EACE,GAAG,CAAEW,CADP,CAEE,gBAAeJ,CAFjB,CAGE,gBAAeN,CAHjB,CAIE,IAAI,CAAC,QAJP,CAKE,KAAK,CAAEJ,CAAY,CAACS,CAAD,CALrB,CAME,IAAI,CAAEJ,CANR,CAOE,MAAM,CAAEM,CAPV,CAQE,YAAY,CAAEE,CARhB,CASE,QAAQ,CAAET,CATZ,CAUE,OAAO,CAAEQ,CAVX,CAWE,QAAQ,CACNV,CAAQ,CACN,oBAAC,QAAD,EACE,OAAO,CAAEQ,CADX,CAEE,QAAQ,CAAEN,CAFZ,CAGE,IAAI,CAAEC,CAHR,CAIE,QAAQ,CAAE,CAAC,CAJb,EADM,CAQN,oBAAC,KAAD,EACE,OAAO,CAAEK,CADX,CAEE,QAAQ,CAAEN,CAFZ,CAGE,IAAI,CAAEC,CAHR,CAIE,QAAQ,CAAE,CAAC,CAJb,EApBN,EA8BH,CA7CgE,CA8CjE,CAACL,CAAD,CAAeC,CAAf,CAAgCC,CAAhC,CAA0CC,CAA1C,CAA6DE,CAA7D,CA9CiE,CAD/D,CAkDJ,MAAOC,EAAU,EAAIC,CACtB,CAjEM"}
@@ -1,2 +1,2 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["size","form","border","shadow","className"];import React,{forwardRef}from"react";import{cnMixScrollBar}from"../../../mixs/MixScrollBar";import{cnMixSpace}from"../../../mixs/MixSpace";import{defaultListPropSize}from"../types";import{cnListBox}from"./cnListBox";import{mapVerticalSpace}from"./mapVerticalSpace";export var ListBox=forwardRef(function(a,b){var c=a.size,d=void 0===c?defaultListPropSize:c,e=a.form,f=a.border,g=a.shadow,h=a.className,i=_objectWithoutProperties(a,_excluded);return React.createElement("div",Object.assign({},i,{ref:b,className:cnListBox({size:d,form:e,border:f,shadow:g},[cnMixSpace({pV:mapVerticalSpace[d]}),cnMixScrollBar(),h])}))});
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["size","form","border","shadow","className"];import React,{forwardRef}from"react";import{cnMixScrollBar}from"../../../mixs/MixScrollBar";import{cnMixSpace}from"../../../mixs/MixSpace";import{defaultListPropSize}from"../types";import{cnListBox}from"./cnListBox";import{mapVerticalSpace}from"./mapVerticalSpace";export var ListBox=forwardRef(function(a,b){var c=a.size,d=void 0===c?defaultListPropSize:c,e=a.form,f=a.border,g=a.shadow,h=a.className,i=_objectWithoutProperties(a,_excluded);return React.createElement("div",Object.assign({},i,{ref:b,className:cnListBox({size:d,form:e,border:f,shadow:g},[cnMixSpace({pV:mapVerticalSpace[d]}),cnMixScrollBar({size:"xs"}),h])}))});
2
2
  //# sourceMappingURL=ListBox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ListBox.js","names":["React","forwardRef","cnMixScrollBar","cnMixSpace","defaultListPropSize","cnListBox","mapVerticalSpace","ListBox","props","ref","size","form","border","shadow","className","otherProps","pV"],"sources":["../../../../../../src/components/ListCanary/ListBox/ListBox.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { cnMixScrollBar } from '##/mixs/MixScrollBar';\nimport { cnMixSpace } from '##/mixs/MixSpace';\n\nimport { defaultListPropSize, ListBoxProps } from '../types';\nimport { cnListBox } from './cnListBox';\nimport { mapVerticalSpace } from './mapVerticalSpace';\n\nexport const ListBox = forwardRef<HTMLDivElement, ListBoxProps>(\n (props, ref) => {\n const {\n size = defaultListPropSize,\n form,\n border,\n shadow,\n className,\n ...otherProps\n } = props;\n\n return (\n <div\n {...otherProps}\n ref={ref}\n className={cnListBox({ size, form, border, shadow }, [\n cnMixSpace({\n pV: mapVerticalSpace[size],\n }),\n cnMixScrollBar(),\n className,\n ])}\n />\n );\n },\n);\n"],"mappings":"iJAAA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OAASC,cAAT,kCACA,OAASC,UAAT,8BAEA,OAASC,mBAAT,gBACA,OAASC,SAAT,mBACA,OAASC,gBAAT,0BAEA,MAAO,IAAMC,QAAO,CAAGN,UAAU,CAC/B,SAACO,CAAD,CAAQC,CAAR,CAAgB,CACd,MAOID,CAPJ,CACEE,IADF,CACEA,CADF,YACSN,mBADT,GAEEO,CAFF,CAOIH,CAPJ,CAEEG,IAFF,CAGEC,CAHF,CAOIJ,CAPJ,CAGEI,MAHF,CAIEC,CAJF,CAOIL,CAPJ,CAIEK,MAJF,CAKEC,CALF,CAOIN,CAPJ,CAKEM,SALF,CAMKC,CANL,0BAOIP,CAPJ,YASA,MACE,4CACMO,CADN,EAEE,GAAG,CAAEN,CAFP,CAGE,SAAS,CAAEJ,SAAS,CAAC,CAAEK,IAAI,CAAJA,CAAF,CAAQC,IAAI,CAAJA,CAAR,CAAcC,MAAM,CAANA,CAAd,CAAsBC,MAAM,CAANA,CAAtB,CAAD,CAAiC,CACnDV,UAAU,CAAC,CACTa,EAAE,CAAEV,gBAAgB,CAACI,CAAD,CADX,CAAD,CADyC,CAInDR,cAAc,EAJqC,CAKnDY,CALmD,CAAjC,CAHtB,GAYH,CAxB8B,CAA1B"}
1
+ {"version":3,"file":"ListBox.js","names":["React","forwardRef","cnMixScrollBar","cnMixSpace","defaultListPropSize","cnListBox","mapVerticalSpace","ListBox","props","ref","size","form","border","shadow","className","otherProps","pV"],"sources":["../../../../../../src/components/ListCanary/ListBox/ListBox.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { cnMixScrollBar } from '##/mixs/MixScrollBar';\nimport { cnMixSpace } from '##/mixs/MixSpace';\n\nimport { defaultListPropSize, ListBoxProps } from '../types';\nimport { cnListBox } from './cnListBox';\nimport { mapVerticalSpace } from './mapVerticalSpace';\n\nexport const ListBox = forwardRef<HTMLDivElement, ListBoxProps>(\n (props, ref) => {\n const {\n size = defaultListPropSize,\n form,\n border,\n shadow,\n className,\n ...otherProps\n } = props;\n\n return (\n <div\n {...otherProps}\n ref={ref}\n className={cnListBox({ size, form, border, shadow }, [\n cnMixSpace({\n pV: mapVerticalSpace[size],\n }),\n cnMixScrollBar({ size: 'xs' }),\n className,\n ])}\n />\n );\n },\n);\n"],"mappings":"iJAAA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OAASC,cAAT,kCACA,OAASC,UAAT,8BAEA,OAASC,mBAAT,gBACA,OAASC,SAAT,mBACA,OAASC,gBAAT,0BAEA,MAAO,IAAMC,QAAO,CAAGN,UAAU,CAC/B,SAACO,CAAD,CAAQC,CAAR,CAAgB,CACd,MAOID,CAPJ,CACEE,IADF,CACEA,CADF,YACSN,mBADT,GAEEO,CAFF,CAOIH,CAPJ,CAEEG,IAFF,CAGEC,CAHF,CAOIJ,CAPJ,CAGEI,MAHF,CAIEC,CAJF,CAOIL,CAPJ,CAIEK,MAJF,CAKEC,CALF,CAOIN,CAPJ,CAKEM,SALF,CAMKC,CANL,0BAOIP,CAPJ,YASA,MACE,4CACMO,CADN,EAEE,GAAG,CAAEN,CAFP,CAGE,SAAS,CAAEJ,SAAS,CAAC,CAAEK,IAAI,CAAJA,CAAF,CAAQC,IAAI,CAAJA,CAAR,CAAcC,MAAM,CAANA,CAAd,CAAsBC,MAAM,CAANA,CAAtB,CAAD,CAAiC,CACnDV,UAAU,CAAC,CACTa,EAAE,CAAEV,gBAAgB,CAACI,CAAD,CADX,CAAD,CADyC,CAInDR,cAAc,CAAC,CAAEQ,IAAI,CAAE,IAAR,CAAD,CAJqC,CAKnDI,CALmD,CAAjC,CAHtB,GAYH,CAxB8B,CAA1B"}
@@ -131,4 +131,5 @@ export type ListAddItemProps = PropsWithHTMLAttributesAndRef<{
131
131
  innerOffset?: ListPropInnerOffset;
132
132
  active?: boolean;
133
133
  underLine?: boolean;
134
+ disabled?: boolean;
134
135
  }, HTMLDivElement>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["listPropSize","defaultListPropSize","listPropInnerOffset","defaultListPropInnerOffset","listPropStatus","listPropForm","defaultListPropForm"],"sources":["../../../../../src/components/ListCanary/types.ts"],"sourcesContent":["import { IconComponent, IconPropSize } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport { MixSpaceProps } from '##/mixs/MixSpace';\nimport { Group } from '##/utils/getGroups';\nimport { AsAttributes, AsTags } from '##/utils/types/AsTags';\nimport { PropsWithAsAttributes } from '##/utils/types/PropsWithAsAttributes';\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport const listPropSize = ['m', 'xs', 's', 'l'] as const;\nexport type ListPropSize = typeof listPropSize[number];\nexport const defaultListPropSize = listPropSize[0];\n\nexport const listPropInnerOffset = ['normal', 'increased'] as const;\nexport type ListPropInnerOffset = typeof listPropInnerOffset[number];\nexport const defaultListPropInnerOffset = listPropInnerOffset[0];\n\nexport const listPropStatus = ['alert', 'success', 'warning'] as const;\nexport type ListPropStatus = typeof listPropStatus[number];\n\nexport const listPropForm = ['default', 'brick', 'round'] as const;\nexport type ListPropForm = typeof listPropForm[number];\nexport const defaultListPropForm = listPropForm[0];\n\nexport type DefaultListGroup = {\n id: string | number;\n label?: string;\n rightSide?: React.ReactNode;\n};\n\nexport type DefaultListItem = {\n label: React.ReactNode;\n disabled?: boolean;\n active?: boolean;\n checked?: boolean;\n status?: ListPropStatus;\n groupId?: string | number;\n leftSide?: React.ReactNode;\n leftIcon?: IconComponent;\n rightSide?: React.ReactNode;\n rightIcon?: IconComponent;\n onClick?: React.MouseEventHandler;\n};\n\nexport type ListPropOnItemClick<ITEM> = (\n item: ITEM,\n params: {\n e: React.MouseEvent;\n item: ITEM;\n },\n) => void;\n\nexport type ListPropRenderItem<ITEM> = (item: ITEM) => React.ReactNode | null;\n\n// ITEMS\n\nexport type ListPropGetItemLabel<ITEM> = (item: ITEM) => React.ReactNode;\n\nexport type ListPropGetItemAdditionalClassName<ITEM> = (item: ITEM) => string;\n\nexport type ListPropGetItemDisabled<ITEM> = (item: ITEM) => boolean | undefined;\n\nexport type ListPropGetItemActive<ITEM> = (item: ITEM) => boolean | undefined;\n\nexport type ListPropGetItemChecked<ITEM> = (item: ITEM) => boolean | undefined;\n\nexport type ListPropGetItemStatus<ITEM> = (\n item: ITEM,\n) => ListPropStatus | undefined;\n\nexport type ListPropGetItemGroupId<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\n\nexport type ListPropGetItemLeftSide<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\n\nexport type ListPropGetItemLeftIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\n\nexport type ListPropGetItemRightSide<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\n\nexport type ListPropGetItemRightIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\n\nexport type ListPropGetItemAs<ITEM> = (item: ITEM) => AsTags | undefined;\n\nexport type ListPropGetItemAttributes<ITEM> = (\n item: ITEM,\n) => AsAttributes | undefined;\n\nexport type ListPropGetItemOnClick<ITEM> = (\n item: ITEM,\n) => React.MouseEventHandler | undefined;\n\nexport type ListPropSortGroup<ITEM, GROUP> = (\n a: Group<ITEM, GROUP>,\n b: Group<ITEM, GROUP>,\n) => number;\n\n// GROUPS\nexport type ListPropGetGroupKey<GROUP> = (item: GROUP) => string | number;\nexport type ListPropGetGroupAdditionalClassName<GROUP> = (\n item: GROUP,\n) => string;\n\nexport type ListPropGetGroupLabel<GROUP> = (item: GROUP) => string | undefined;\nexport type ListPropGetGroupRightSide<GROUP> = (\n item: GROUP,\n) => React.ReactNode | undefined;\n\nexport type ListPropGetItemRef<ITEM> = (\n item: ITEM,\n) => React.RefObject<HTMLElement> | undefined;\n\nexport type ListProps<ITEM = DefaultListItem, GROUP = DefaultListGroup> = {\n size?: ListPropSize;\n items: ITEM[];\n innerOffset?: ListPropInnerOffset;\n itemSpace?: MixSpaceProps;\n groupLabelSpace?: MixSpaceProps;\n dividerSpace?: MixSpaceProps;\n onItemClick?: ListPropOnItemClick<ITEM>;\n getItemLabel?: ListPropGetItemLabel<ITEM>;\n getItemDisabled?: ListPropGetItemDisabled<ITEM>;\n getItemActive?: ListPropGetItemActive<ITEM>;\n getItemChecked?: ListPropGetItemActive<ITEM>;\n getItemLeftSide?: ListPropGetItemLeftSide<ITEM>;\n getItemLeftIcon?: ListPropGetItemLeftIcon<ITEM>;\n getItemRightSide?: ListPropGetItemRightSide<ITEM>;\n getItemRightIcon?: ListPropGetItemRightIcon<ITEM>;\n getItemGroupKey?: ListPropGetItemGroupId<ITEM>;\n getItemOnClick?: ListPropGetItemOnClick<ITEM>;\n getItemStatus?: ListPropGetItemStatus<ITEM>;\n getItemAs?: ListPropGetItemAs<ITEM>;\n getItemAttributes?: ListPropGetItemAttributes<ITEM>;\n getItemRef?: ListPropGetItemRef<ITEM>;\n getItemAdditionalClassName?: ListPropGetItemAdditionalClassName<ITEM>;\n renderItem?: ListPropRenderItem<ITEM>;\n groups?: GROUP[];\n getGroupKey?: ListPropGetGroupKey<GROUP>;\n getGroupLabel?: ListPropGetGroupLabel<GROUP>;\n getGroupRightSide?: ListPropGetGroupRightSide<GROUP>;\n sortGroup?: ListPropSortGroup<ITEM, GROUP>;\n getGroupAdditionalClassName?: ListPropGetGroupAdditionalClassName<GROUP>;\n disabled?: boolean;\n} & (ITEM extends { label: DefaultListItem['label'] }\n ? {}\n : { getItemLabel: ListPropGetItemLabel<ITEM> }) &\n (GROUP extends { id: DefaultListGroup['id'] }\n ? {}\n : { getGroupKey: ListPropGetGroupKey<GROUP> });\n\nexport type ListComponent = <ITEM = DefaultListItem, GROUP = DefaultListGroup>(\n props: ListProps<ITEM, GROUP>,\n) => React.ReactNode | null;\n\nexport type ListItemProps<AS extends AsTags = 'div'> = PropsWithAsAttributes<\n Omit<DefaultListItem, 'id' | 'groupId' | 'attributes' | 'onClick'> & {\n size?: ListPropSize;\n innerOffset?: 'normal' | 'increased';\n space?: MixSpaceProps;\n iconSize?: IconPropSize;\n },\n AS\n>;\n\nexport type ListItemComponent = <AS extends AsTags = 'div'>(\n props: ListItemProps<AS>,\n) => React.ReactNode | null;\n\nexport type ListGroupLabelProps = PropsWithHTMLAttributesAndRef<\n {\n size?: ListPropSize;\n label: string;\n innerOffset?: ListPropInnerOffset;\n rightSide?: React.ReactNode;\n space?: MixSpaceProps;\n },\n HTMLDivElement\n>;\n\nexport type ListDividerProps = PropsWithHTMLAttributesAndRef<\n {\n size?: ListPropSize;\n innerOffset?: ListPropInnerOffset;\n space?: MixSpaceProps;\n },\n HTMLDivElement\n>;\n\nexport type ListBoxProps = PropsWithHTMLAttributesAndRef<\n {\n size?: ListPropSize;\n form?: ListPropForm;\n border?: boolean;\n shadow?: boolean;\n },\n HTMLDivElement\n>;\n\nexport type ListAddItemProps = PropsWithHTMLAttributesAndRef<\n {\n size?: ListPropSize;\n label: React.ReactNode;\n innerOffset?: ListPropInnerOffset;\n active?: boolean;\n underLine?: boolean;\n },\n HTMLDivElement\n>;\n"],"mappings":"AASA,MAAO,IAAMA,aAAY,CAAG,CAAC,GAAD,CAAM,IAAN,CAAY,GAAZ,CAAiB,GAAjB,CAArB,CAEP,MAAO,IAAMC,oBAAmB,CAAGD,YAAY,CAAC,CAAD,CAAxC,CAEP,MAAO,IAAME,oBAAmB,CAAG,CAAC,QAAD,CAAW,WAAX,CAA5B,CAEP,MAAO,IAAMC,2BAA0B,CAAGD,mBAAmB,CAAC,CAAD,CAAtD,CAEP,MAAO,IAAME,eAAc,CAAG,CAAC,OAAD,CAAU,SAAV,CAAqB,SAArB,CAAvB,CAGP,MAAO,IAAMC,aAAY,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAqB,OAArB,CAArB,CAEP,MAAO,IAAMC,oBAAmB,CAAGD,YAAY,CAAC,CAAD,CAAxC"}
1
+ {"version":3,"file":"types.js","names":["listPropSize","defaultListPropSize","listPropInnerOffset","defaultListPropInnerOffset","listPropStatus","listPropForm","defaultListPropForm"],"sources":["../../../../../src/components/ListCanary/types.ts"],"sourcesContent":["import { IconComponent, IconPropSize } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport { MixSpaceProps } from '##/mixs/MixSpace';\nimport { Group } from '##/utils/getGroups';\nimport { AsAttributes, AsTags } from '##/utils/types/AsTags';\nimport { PropsWithAsAttributes } from '##/utils/types/PropsWithAsAttributes';\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport const listPropSize = ['m', 'xs', 's', 'l'] as const;\nexport type ListPropSize = typeof listPropSize[number];\nexport const defaultListPropSize = listPropSize[0];\n\nexport const listPropInnerOffset = ['normal', 'increased'] as const;\nexport type ListPropInnerOffset = typeof listPropInnerOffset[number];\nexport const defaultListPropInnerOffset = listPropInnerOffset[0];\n\nexport const listPropStatus = ['alert', 'success', 'warning'] as const;\nexport type ListPropStatus = typeof listPropStatus[number];\n\nexport const listPropForm = ['default', 'brick', 'round'] as const;\nexport type ListPropForm = typeof listPropForm[number];\nexport const defaultListPropForm = listPropForm[0];\n\nexport type DefaultListGroup = {\n id: string | number;\n label?: string;\n rightSide?: React.ReactNode;\n};\n\nexport type DefaultListItem = {\n label: React.ReactNode;\n disabled?: boolean;\n active?: boolean;\n checked?: boolean;\n status?: ListPropStatus;\n groupId?: string | number;\n leftSide?: React.ReactNode;\n leftIcon?: IconComponent;\n rightSide?: React.ReactNode;\n rightIcon?: IconComponent;\n onClick?: React.MouseEventHandler;\n};\n\nexport type ListPropOnItemClick<ITEM> = (\n item: ITEM,\n params: {\n e: React.MouseEvent;\n item: ITEM;\n },\n) => void;\n\nexport type ListPropRenderItem<ITEM> = (item: ITEM) => React.ReactNode | null;\n\n// ITEMS\n\nexport type ListPropGetItemLabel<ITEM> = (item: ITEM) => React.ReactNode;\n\nexport type ListPropGetItemAdditionalClassName<ITEM> = (item: ITEM) => string;\n\nexport type ListPropGetItemDisabled<ITEM> = (item: ITEM) => boolean | undefined;\n\nexport type ListPropGetItemActive<ITEM> = (item: ITEM) => boolean | undefined;\n\nexport type ListPropGetItemChecked<ITEM> = (item: ITEM) => boolean | undefined;\n\nexport type ListPropGetItemStatus<ITEM> = (\n item: ITEM,\n) => ListPropStatus | undefined;\n\nexport type ListPropGetItemGroupId<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\n\nexport type ListPropGetItemLeftSide<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\n\nexport type ListPropGetItemLeftIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\n\nexport type ListPropGetItemRightSide<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\n\nexport type ListPropGetItemRightIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\n\nexport type ListPropGetItemAs<ITEM> = (item: ITEM) => AsTags | undefined;\n\nexport type ListPropGetItemAttributes<ITEM> = (\n item: ITEM,\n) => AsAttributes | undefined;\n\nexport type ListPropGetItemOnClick<ITEM> = (\n item: ITEM,\n) => React.MouseEventHandler | undefined;\n\nexport type ListPropSortGroup<ITEM, GROUP> = (\n a: Group<ITEM, GROUP>,\n b: Group<ITEM, GROUP>,\n) => number;\n\n// GROUPS\nexport type ListPropGetGroupKey<GROUP> = (item: GROUP) => string | number;\nexport type ListPropGetGroupAdditionalClassName<GROUP> = (\n item: GROUP,\n) => string;\n\nexport type ListPropGetGroupLabel<GROUP> = (item: GROUP) => string | undefined;\nexport type ListPropGetGroupRightSide<GROUP> = (\n item: GROUP,\n) => React.ReactNode | undefined;\n\nexport type ListPropGetItemRef<ITEM> = (\n item: ITEM,\n) => React.RefObject<HTMLElement> | undefined;\n\nexport type ListProps<ITEM = DefaultListItem, GROUP = DefaultListGroup> = {\n size?: ListPropSize;\n items: ITEM[];\n innerOffset?: ListPropInnerOffset;\n itemSpace?: MixSpaceProps;\n groupLabelSpace?: MixSpaceProps;\n dividerSpace?: MixSpaceProps;\n onItemClick?: ListPropOnItemClick<ITEM>;\n getItemLabel?: ListPropGetItemLabel<ITEM>;\n getItemDisabled?: ListPropGetItemDisabled<ITEM>;\n getItemActive?: ListPropGetItemActive<ITEM>;\n getItemChecked?: ListPropGetItemActive<ITEM>;\n getItemLeftSide?: ListPropGetItemLeftSide<ITEM>;\n getItemLeftIcon?: ListPropGetItemLeftIcon<ITEM>;\n getItemRightSide?: ListPropGetItemRightSide<ITEM>;\n getItemRightIcon?: ListPropGetItemRightIcon<ITEM>;\n getItemGroupKey?: ListPropGetItemGroupId<ITEM>;\n getItemOnClick?: ListPropGetItemOnClick<ITEM>;\n getItemStatus?: ListPropGetItemStatus<ITEM>;\n getItemAs?: ListPropGetItemAs<ITEM>;\n getItemAttributes?: ListPropGetItemAttributes<ITEM>;\n getItemRef?: ListPropGetItemRef<ITEM>;\n getItemAdditionalClassName?: ListPropGetItemAdditionalClassName<ITEM>;\n renderItem?: ListPropRenderItem<ITEM>;\n groups?: GROUP[];\n getGroupKey?: ListPropGetGroupKey<GROUP>;\n getGroupLabel?: ListPropGetGroupLabel<GROUP>;\n getGroupRightSide?: ListPropGetGroupRightSide<GROUP>;\n sortGroup?: ListPropSortGroup<ITEM, GROUP>;\n getGroupAdditionalClassName?: ListPropGetGroupAdditionalClassName<GROUP>;\n disabled?: boolean;\n} & (ITEM extends { label: DefaultListItem['label'] }\n ? {}\n : { getItemLabel: ListPropGetItemLabel<ITEM> }) &\n (GROUP extends { id: DefaultListGroup['id'] }\n ? {}\n : { getGroupKey: ListPropGetGroupKey<GROUP> });\n\nexport type ListComponent = <ITEM = DefaultListItem, GROUP = DefaultListGroup>(\n props: ListProps<ITEM, GROUP>,\n) => React.ReactNode | null;\n\nexport type ListItemProps<AS extends AsTags = 'div'> = PropsWithAsAttributes<\n Omit<DefaultListItem, 'id' | 'groupId' | 'attributes' | 'onClick'> & {\n size?: ListPropSize;\n innerOffset?: 'normal' | 'increased';\n space?: MixSpaceProps;\n iconSize?: IconPropSize;\n },\n AS\n>;\n\nexport type ListItemComponent = <AS extends AsTags = 'div'>(\n props: ListItemProps<AS>,\n) => React.ReactNode | null;\n\nexport type ListGroupLabelProps = PropsWithHTMLAttributesAndRef<\n {\n size?: ListPropSize;\n label: string;\n innerOffset?: ListPropInnerOffset;\n rightSide?: React.ReactNode;\n space?: MixSpaceProps;\n },\n HTMLDivElement\n>;\n\nexport type ListDividerProps = PropsWithHTMLAttributesAndRef<\n {\n size?: ListPropSize;\n innerOffset?: ListPropInnerOffset;\n space?: MixSpaceProps;\n },\n HTMLDivElement\n>;\n\nexport type ListBoxProps = PropsWithHTMLAttributesAndRef<\n {\n size?: ListPropSize;\n form?: ListPropForm;\n border?: boolean;\n shadow?: boolean;\n },\n HTMLDivElement\n>;\n\nexport type ListAddItemProps = PropsWithHTMLAttributesAndRef<\n {\n size?: ListPropSize;\n label: React.ReactNode;\n innerOffset?: ListPropInnerOffset;\n active?: boolean;\n underLine?: boolean;\n disabled?: boolean;\n },\n HTMLDivElement\n>;\n"],"mappings":"AASA,MAAO,IAAMA,aAAY,CAAG,CAAC,GAAD,CAAM,IAAN,CAAY,GAAZ,CAAiB,GAAjB,CAArB,CAEP,MAAO,IAAMC,oBAAmB,CAAGD,YAAY,CAAC,CAAD,CAAxC,CAEP,MAAO,IAAME,oBAAmB,CAAG,CAAC,QAAD,CAAW,WAAX,CAA5B,CAEP,MAAO,IAAMC,2BAA0B,CAAGD,mBAAmB,CAAC,CAAD,CAAtD,CAEP,MAAO,IAAME,eAAc,CAAG,CAAC,OAAD,CAAU,SAAV,CAAqB,SAArB,CAAvB,CAGP,MAAO,IAAMC,aAAY,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAqB,OAArB,CAArB,CAEP,MAAO,IAAMC,oBAAmB,CAAGD,YAAY,CAAC,CAAD,CAAxC"}
@@ -1,5 +1,6 @@
1
1
  import './PaginationArrow.css';
2
2
  import React from 'react';
3
+ export declare const cnPaginationArrow: import("@bem-react/classname").ClassNameFormatter;
3
4
  export declare const PaginationArrow: React.ForwardRefExoticComponent<{
4
5
  icon?: import("@consta/icons/Icon").IconComponent;
5
6
  form?: import("../types").PaginationPropForm;
@@ -1,2 +1,2 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["size","form","label","caption","icon","orientation","disabled","className","children"];import"./PaginationArrow.css";import React,{forwardRef}from"react";import{Button}from"../../Button";import{Text}from"../../Text";import{cnMixFlex}from"../../../mixs/MixFlex";import{cn}from"../../../utils/bem";import{paginationPropFormDefault,paginationPropSizeDefault}from"../types";var cnPaginationArrow=cn("PaginationArrow");export var PaginationArrow=forwardRef(function(a,b){var c=a.size,d=void 0===c?paginationPropSizeDefault:c,e=a.form,f=void 0===e?paginationPropFormDefault:e,g=a.label,h=a.caption,i=a.icon,j=a.orientation,k=a.disabled,l=a.className,m=a.children,n=_objectWithoutProperties(a,_excluded);return g?React.createElement("div",{className:cnPaginationArrow("Wrapper",[cnMixFlex({flex:"inline-flex",align:"start"===j?"flex-end":"flex-start",direction:"column"})])},React.createElement(Button,Object.assign({size:d,form:f,className:cnPaginationArrow(null,[l]),ref:b,view:"clear",disabled:k,label:g,iconLeft:"start"===j?i:void 0,iconRight:"end"===j?i:void 0},n)),h&&React.createElement(Text,{view:"ghost",size:"xs",lineHeight:"m",className:cnPaginationArrow("Caption",{size:d,orientation:j})},h)):React.createElement(Button,Object.assign({size:d,form:f,disabled:k,onlyIcon:!0,view:"clear",iconLeft:i,className:cnPaginationArrow(null,[l]),ref:b},n))});
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["size","form","label","caption","icon","orientation","disabled","className","children"];import"./PaginationArrow.css";import React,{forwardRef}from"react";import{Button}from"../../Button";import{Text}from"../../Text";import{cnMixFlex}from"../../../mixs/MixFlex";import{cn}from"../../../utils/bem";import{paginationPropFormDefault,paginationPropSizeDefault}from"../types";export var cnPaginationArrow=cn("PaginationArrow");export var PaginationArrow=forwardRef(function(a,b){var c=a.size,d=void 0===c?paginationPropSizeDefault:c,e=a.form,f=void 0===e?paginationPropFormDefault:e,g=a.label,h=a.caption,i=a.icon,j=a.orientation,k=a.disabled,l=a.className,m=a.children,n=_objectWithoutProperties(a,_excluded);return g?React.createElement("div",{className:cnPaginationArrow("Wrapper",[cnMixFlex({flex:"inline-flex",align:"start"===j?"flex-end":"flex-start",direction:"column"})])},React.createElement(Button,Object.assign({size:d,form:f,className:cnPaginationArrow(null,[l]),ref:b,view:"clear",disabled:k,label:g,iconLeft:"start"===j?i:void 0,iconRight:"end"===j?i:void 0},n)),h&&React.createElement(Text,{view:"ghost",size:"xs",lineHeight:"m",className:cnPaginationArrow("Caption",{size:d,orientation:j})},h)):React.createElement(Button,Object.assign({size:d,form:f,disabled:k,onlyIcon:!0,view:"clear",iconLeft:i,className:cnPaginationArrow(null,[l]),ref:b},n))});
2
2
  //# sourceMappingURL=PaginationArrow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PaginationArrow.js","names":["React","forwardRef","Button","Text","cnMixFlex","cn","paginationPropFormDefault","paginationPropSizeDefault","cnPaginationArrow","PaginationArrow","props","ref","size","form","label","caption","icon","orientation","disabled","className","children","otherProps","flex","align","direction"],"sources":["../../../../../../src/components/Pagination/PaginationArrow/PaginationArrow.tsx"],"sourcesContent":["import './PaginationArrow.css';\n\nimport React, { forwardRef } from 'react';\n\nimport { Button } from '##/components/Button';\nimport { Text } from '##/components/Text';\nimport { cnMixFlex } from '##/mixs/MixFlex';\nimport { cn } from '##/utils/bem';\n\nimport {\n PaginationArrowProps,\n paginationPropFormDefault,\n paginationPropSizeDefault,\n} from '../types';\n\nconst cnPaginationArrow = cn('PaginationArrow');\n\nexport const PaginationArrow = forwardRef<\n HTMLButtonElement,\n PaginationArrowProps\n>((props, ref) => {\n const {\n size = paginationPropSizeDefault,\n form = paginationPropFormDefault,\n label,\n caption,\n icon,\n orientation,\n disabled,\n className,\n children,\n ...otherProps\n } = props;\n\n if (label) {\n return (\n <div\n className={cnPaginationArrow('Wrapper', [\n cnMixFlex({\n flex: 'inline-flex',\n align: orientation === 'start' ? 'flex-end' : 'flex-start',\n direction: 'column',\n }),\n ])}\n >\n <Button\n size={size}\n form={form}\n className={cnPaginationArrow(null, [className])}\n ref={ref}\n view=\"clear\"\n disabled={disabled}\n label={label}\n iconLeft={orientation === 'start' ? icon : undefined}\n iconRight={orientation === 'end' ? icon : undefined}\n {...otherProps}\n />\n {caption && (\n <Text\n view=\"ghost\"\n size=\"xs\"\n lineHeight=\"m\"\n className={cnPaginationArrow('Caption', { size, orientation })}\n >\n {caption}\n </Text>\n )}\n </div>\n );\n }\n\n return (\n <Button\n size={size}\n form={form}\n disabled={disabled}\n onlyIcon\n view=\"clear\"\n iconLeft={icon}\n className={cnPaginationArrow(null, [className])}\n ref={ref}\n {...otherProps}\n />\n );\n});\n"],"mappings":"4LAAA,8BAEA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OAASC,MAAT,oBACA,OAASC,IAAT,kBACA,OAASC,SAAT,6BACA,OAASC,EAAT,0BAEA,OAEEC,yBAFF,CAGEC,yBAHF,gBAMA,GAAMC,kBAAiB,CAAGH,EAAE,CAAC,iBAAD,CAA5B,CAEA,MAAO,IAAMI,gBAAe,CAAGR,UAAU,CAGvC,SAACS,CAAD,CAAQC,CAAR,CAAgB,CAChB,MAWID,CAXJ,CACEE,IADF,CACEA,CADF,YACSL,yBADT,KAWIG,CAXJ,CAEEG,IAFF,CAEEA,CAFF,YAESP,yBAFT,GAGEQ,CAHF,CAWIJ,CAXJ,CAGEI,KAHF,CAIEC,CAJF,CAWIL,CAXJ,CAIEK,OAJF,CAKEC,CALF,CAWIN,CAXJ,CAKEM,IALF,CAMEC,CANF,CAWIP,CAXJ,CAMEO,WANF,CAOEC,CAPF,CAWIR,CAXJ,CAOEQ,QAPF,CAQEC,CARF,CAWIT,CAXJ,CAQES,SARF,CASEC,CATF,CAWIV,CAXJ,CASEU,QATF,CAUKC,CAVL,0BAWIX,CAXJ,YADgB,MAcZI,EAdY,CAgBZ,2BACE,SAAS,CAAEN,iBAAiB,CAAC,SAAD,CAAY,CACtCJ,SAAS,CAAC,CACRkB,IAAI,CAAE,aADE,CAERC,KAAK,CAAkB,OAAhB,GAAAN,CAAW,CAAe,UAAf,CAA4B,YAFtC,CAGRO,SAAS,CAAE,QAHH,CAAD,CAD6B,CAAZ,CAD9B,EASE,oBAAC,MAAD,gBACE,IAAI,CAAEZ,CADR,CAEE,IAAI,CAAEC,CAFR,CAGE,SAAS,CAAEL,iBAAiB,CAAC,IAAD,CAAO,CAACW,CAAD,CAAP,CAH9B,CAIE,GAAG,CAAER,CAJP,CAKE,IAAI,CAAC,OALP,CAME,QAAQ,CAAEO,CANZ,CAOE,KAAK,CAAEJ,CAPT,CAQE,QAAQ,CAAkB,OAAhB,GAAAG,CAAW,CAAeD,CAAf,OARvB,CASE,SAAS,CAAkB,KAAhB,GAAAC,CAAW,CAAaD,CAAb,OATxB,EAUMK,CAVN,EATF,CAqBGN,CAAO,EACN,oBAAC,IAAD,EACE,IAAI,CAAC,OADP,CAEE,IAAI,CAAC,IAFP,CAGE,UAAU,CAAC,GAHb,CAIE,SAAS,CAAEP,iBAAiB,CAAC,SAAD,CAAY,CAAEI,IAAI,CAAJA,CAAF,CAAQK,WAAW,CAAXA,CAAR,CAAZ,CAJ9B,EAMGF,CANH,CAtBJ,CAhBY,CAoDd,oBAAC,MAAD,gBACE,IAAI,CAAEH,CADR,CAEE,IAAI,CAAEC,CAFR,CAGE,QAAQ,CAAEK,CAHZ,CAIE,QAAQ,GAJV,CAKE,IAAI,CAAC,OALP,CAME,QAAQ,CAAEF,CANZ,CAOE,SAAS,CAAER,iBAAiB,CAAC,IAAD,CAAO,CAACW,CAAD,CAAP,CAP9B,CAQE,GAAG,CAAER,CARP,EASMU,CATN,EAYH,CAnEwC,CAAlC"}
1
+ {"version":3,"file":"PaginationArrow.js","names":["React","forwardRef","Button","Text","cnMixFlex","cn","paginationPropFormDefault","paginationPropSizeDefault","cnPaginationArrow","PaginationArrow","props","ref","size","form","label","caption","icon","orientation","disabled","className","children","otherProps","flex","align","direction"],"sources":["../../../../../../src/components/Pagination/PaginationArrow/PaginationArrow.tsx"],"sourcesContent":["import './PaginationArrow.css';\n\nimport React, { forwardRef } from 'react';\n\nimport { Button } from '##/components/Button';\nimport { Text } from '##/components/Text';\nimport { cnMixFlex } from '##/mixs/MixFlex';\nimport { cn } from '##/utils/bem';\n\nimport {\n PaginationArrowProps,\n paginationPropFormDefault,\n paginationPropSizeDefault,\n} from '../types';\n\nexport const cnPaginationArrow = cn('PaginationArrow');\n\nexport const PaginationArrow = forwardRef<\n HTMLButtonElement,\n PaginationArrowProps\n>((props, ref) => {\n const {\n size = paginationPropSizeDefault,\n form = paginationPropFormDefault,\n label,\n caption,\n icon,\n orientation,\n disabled,\n className,\n children,\n ...otherProps\n } = props;\n\n if (label) {\n return (\n <div\n className={cnPaginationArrow('Wrapper', [\n cnMixFlex({\n flex: 'inline-flex',\n align: orientation === 'start' ? 'flex-end' : 'flex-start',\n direction: 'column',\n }),\n ])}\n >\n <Button\n size={size}\n form={form}\n className={cnPaginationArrow(null, [className])}\n ref={ref}\n view=\"clear\"\n disabled={disabled}\n label={label}\n iconLeft={orientation === 'start' ? icon : undefined}\n iconRight={orientation === 'end' ? icon : undefined}\n {...otherProps}\n />\n {caption && (\n <Text\n view=\"ghost\"\n size=\"xs\"\n lineHeight=\"m\"\n className={cnPaginationArrow('Caption', { size, orientation })}\n >\n {caption}\n </Text>\n )}\n </div>\n );\n }\n\n return (\n <Button\n size={size}\n form={form}\n disabled={disabled}\n onlyIcon\n view=\"clear\"\n iconLeft={icon}\n className={cnPaginationArrow(null, [className])}\n ref={ref}\n {...otherProps}\n />\n );\n});\n"],"mappings":"4LAAA,8BAEA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OAASC,MAAT,oBACA,OAASC,IAAT,kBACA,OAASC,SAAT,6BACA,OAASC,EAAT,0BAEA,OAEEC,yBAFF,CAGEC,yBAHF,gBAMA,MAAO,IAAMC,kBAAiB,CAAGH,EAAE,CAAC,iBAAD,CAA5B,CAEP,MAAO,IAAMI,gBAAe,CAAGR,UAAU,CAGvC,SAACS,CAAD,CAAQC,CAAR,CAAgB,CAChB,MAWID,CAXJ,CACEE,IADF,CACEA,CADF,YACSL,yBADT,KAWIG,CAXJ,CA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AAEH,CADR,CAEE,IAAI,CAAEC,CAFR,CAGE,QAAQ,CAAEK,CAHZ,CAIE,QAAQ,GAJV,CAKE,IAAI,CAAC,OALP,CAME,QAAQ,CAAEF,CANZ,CAOE,SAAS,CAAER,iBAAiB,CAAC,IAAD,CAAO,CAACW,CAAD,CAAP,CAP9B,CAQE,GAAG,CAAER,CARP,EASMU,CATN,EAYH,CAnEwC,CAAlC"}
@@ -29,11 +29,11 @@ type ChildrenRenderProp = (direction: Direction) => React.ReactNode;
29
29
  export type PopoverProps = PropsWithJsxAttributes<{
30
30
  direction?: Direction;
31
31
  spareDirection?: Direction;
32
+ possibleDirections?: Direction[];
32
33
  offset?: PopoverPropOffset;
33
34
  arrowOffset?: number;
34
- possibleDirections?: readonly Direction[];
35
35
  isInteractive?: boolean;
36
- children: React.ReactNode | ChildrenRenderProp;
36
+ children?: React.ReactNode | ChildrenRenderProp;
37
37
  onClickOutside?: ClickOutsideHandler;
38
38
  onSetDirection?: (direction: Direction) => void;
39
39
  viewportRef?: React.RefObject<HTMLElement>;