@hh.ru/magritte-ui-select 12.9.26 → 13.0.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.
- package/ApplyChangesButton.d.ts +17 -0
- package/ApplyChangesButton.js +55 -0
- package/ApplyChangesButton.js.map +1 -0
- package/ClearButton.d.ts +15 -0
- package/ClearButton.js +42 -0
- package/ClearButton.js.map +1 -0
- package/ClearCard.d.ts +5 -0
- package/ClearCard.js +28 -0
- package/ClearCard.js.map +1 -0
- package/Select.d.ts +47 -6
- package/Select.js +77 -283
- package/Select.js.map +1 -1
- package/SelectBottomSheet.d.ts +6 -5
- package/SelectBottomSheet.js +62 -167
- package/SelectBottomSheet.js.map +1 -1
- package/SelectBottomSheetHeader.d.ts +10 -0
- package/SelectBottomSheetHeader.js +35 -0
- package/SelectBottomSheetHeader.js.map +1 -0
- package/SelectDrop.d.ts +16 -6
- package/SelectDrop.js +90 -139
- package/SelectDrop.js.map +1 -1
- package/SelectEmptyHint.d.ts +26 -3
- package/SelectEmptyHint.js +13 -4
- package/SelectEmptyHint.js.map +1 -1
- package/SelectOptions.d.ts +30 -0
- package/SelectOptions.js +104 -0
- package/SelectOptions.js.map +1 -0
- package/SelectPickerCloseIcon.d.ts +6 -0
- package/SelectPickerCloseIcon.js +31 -0
- package/SelectPickerCloseIcon.js.map +1 -0
- package/SelectPickerContext.d.ts +33 -0
- package/SelectPickerContext.js +106 -0
- package/SelectPickerContext.js.map +1 -0
- package/SelectSearchInput.d.ts +8 -0
- package/SelectSearchInput.js +20 -0
- package/SelectSearchInput.js.map +1 -0
- package/SelectSearchTrigger.d.ts +4 -0
- package/SelectSearchTrigger.js +71 -0
- package/SelectSearchTrigger.js.map +1 -0
- package/SelectTrigger.d.ts +4 -0
- package/SelectTrigger.js +48 -0
- package/SelectTrigger.js.map +1 -0
- package/UncontrolledSelect.d.ts +1 -1
- package/UncontrolledSelect.js +56 -28
- package/UncontrolledSelect.js.map +1 -1
- package/index.css +116 -102
- package/index.d.ts +16 -5
- package/index.js +60 -26
- package/index.js.map +1 -1
- package/index.mock.d.ts +46 -4
- package/index.mock.js +63 -7
- package/index.mock.js.map +1 -1
- package/internal/ConfigContext.d.ts +27 -0
- package/internal/ConfigContext.js +51 -0
- package/internal/ConfigContext.js.map +1 -0
- package/internal/NavigationManagement.d.ts +9 -0
- package/internal/NavigationManagement.js +65 -0
- package/internal/NavigationManagement.js.map +1 -0
- package/internal/Option.d.ts +26 -0
- package/internal/Option.js +70 -0
- package/internal/Option.js.map +1 -0
- package/internal/OptionControl.d.ts +18 -0
- package/internal/OptionControl.js +17 -0
- package/internal/OptionControl.js.map +1 -0
- package/internal/SearchStateContext.d.ts +9 -0
- package/internal/SearchStateContext.js +25 -0
- package/internal/SearchStateContext.js.map +1 -0
- package/internal/SelectDataProvider.d.ts +11 -0
- package/internal/SelectDataProvider.js +28 -0
- package/internal/SelectDataProvider.js.map +1 -0
- package/internal/SelectError.d.ts +3 -0
- package/internal/SelectError.js +41 -0
- package/internal/SelectError.js.map +1 -0
- package/internal/SelectReloadButton.d.ts +4 -0
- package/internal/SelectReloadButton.js +22 -0
- package/internal/SelectReloadButton.js.map +1 -0
- package/internal/SelectStateContext.d.ts +19 -0
- package/internal/SelectStateContext.js +61 -0
- package/internal/SelectStateContext.js.map +1 -0
- package/internal/SelectStore.d.ts +16 -0
- package/internal/SelectStore.js +59 -0
- package/internal/SelectStore.js.map +1 -0
- package/internal/VisibilityContext.d.ts +13 -0
- package/internal/VisibilityContext.js +17 -0
- package/internal/VisibilityContext.js.map +1 -0
- package/internal/focusOrchestrator.d.ts +26 -0
- package/internal/focusOrchestrator.js +67 -0
- package/internal/focusOrchestrator.js.map +1 -0
- package/internal/slots.d.ts +40 -0
- package/internal/slots.js +8 -0
- package/internal/slots.js.map +1 -0
- package/internal/useDataProvider.d.ts +11 -0
- package/internal/useDataProvider.js +116 -0
- package/internal/useDataProvider.js.map +1 -0
- package/internal/useFocusWithin.d.ts +1 -0
- package/internal/useFocusWithin.js +54 -0
- package/internal/useFocusWithin.js.map +1 -0
- package/internal/utils.d.ts +18 -0
- package/internal/utils.js +70 -0
- package/internal/utils.js.map +1 -0
- package/legacy/SelectLegacy.d.ts +10 -0
- package/legacy/SelectLegacy.js +122 -0
- package/legacy/SelectLegacy.js.map +1 -0
- package/legacy/UncontrolledSelectLegacy.d.ts +9 -0
- package/legacy/UncontrolledSelectLegacy.js +88 -0
- package/legacy/UncontrolledSelectLegacy.js.map +1 -0
- package/legacy/internal/BottomSheetHeaderLegacy.d.ts +11 -0
- package/legacy/internal/BottomSheetHeaderLegacy.js +66 -0
- package/legacy/internal/BottomSheetHeaderLegacy.js.map +1 -0
- package/legacy/internal/ContentBeforeLegacy.d.ts +10 -0
- package/legacy/internal/ContentBeforeLegacy.js +42 -0
- package/legacy/internal/ContentBeforeLegacy.js.map +1 -0
- package/legacy/internal/FooterLegacy.d.ts +14 -0
- package/legacy/internal/FooterLegacy.js +59 -0
- package/legacy/internal/FooterLegacy.js.map +1 -0
- package/legacy/internal/OptionLayoutLegacy.d.ts +12 -0
- package/legacy/internal/OptionLayoutLegacy.js +42 -0
- package/legacy/internal/OptionLayoutLegacy.js.map +1 -0
- package/legacy/internal/TriggerLegacy.d.ts +12 -0
- package/legacy/internal/TriggerLegacy.js +60 -0
- package/legacy/internal/TriggerLegacy.js.map +1 -0
- package/legacy/internal/UnsavedChangesAlertLegacy.d.ts +8 -0
- package/legacy/internal/UnsavedChangesAlertLegacy.js +27 -0
- package/legacy/internal/UnsavedChangesAlertLegacy.js.map +1 -0
- package/legacy/types.d.ts +191 -0
- package/legacy/types.js +3 -0
- package/legacy/types.js.map +1 -0
- package/package.json +17 -16
- package/types.d.ts +57 -291
- package/useDataProvider.d.ts +5 -0
- package/useDataProvider.js +19 -0
- package/useDataProvider.js.map +1 -0
- package/usePickerRef.d.ts +3 -0
- package/usePickerRef.js +14 -0
- package/usePickerRef.js.map +1 -0
- package/useSearchState.d.ts +4 -0
- package/useSearchState.js +15 -0
- package/useSearchState.js.map +1 -0
- package/useSelectConfig.d.ts +3 -0
- package/useSelectConfig.js +13 -0
- package/useSelectConfig.js.map +1 -0
- package/useSelectContentState.d.ts +16 -0
- package/useSelectContentState.js +43 -0
- package/useSelectContentState.js.map +1 -0
- package/useSelectError.d.ts +3 -0
- package/useSelectError.js +13 -0
- package/useSelectError.js.map +1 -0
- package/useSelectHint.d.ts +3 -0
- package/useSelectHint.js +13 -0
- package/useSelectHint.js.map +1 -0
- package/useSelectTrigger.d.ts +12 -0
- package/useSelectTrigger.js +137 -0
- package/useSelectTrigger.js.map +1 -0
- package/useVisibility.d.ts +3 -0
- package/useVisibility.js +13 -0
- package/useVisibility.js.map +1 -0
- package/SelectError.d.ts +0 -6
- package/SelectError.js +0 -21
- package/SelectError.js.map +0 -1
- package/SelectModal.d.ts +0 -4
- package/SelectModal.js +0 -155
- package/SelectModal.js.map +0 -1
- package/SelectOption.d.ts +0 -4
- package/SelectOption.js +0 -88
- package/SelectOption.js.map +0 -1
- package/getChecked.d.ts +0 -2
- package/getChecked.js +0 -7
- package/getChecked.js.map +0 -1
- package/isArraysEquals.d.ts +0 -1
- package/isArraysEquals.js +0 -5
- package/isArraysEquals.js.map +0 -1
- package/useSelectOptionsList.d.ts +0 -11
- package/useSelectOptionsList.js +0 -48
- package/useSelectOptionsList.js.map +0 -1
- package/useSelectSearch.d.ts +0 -3
- package/useSelectSearch.js +0 -131
- package/useSelectSearch.js.map +0 -1
- package/useSelectState.d.ts +0 -3
- package/useSelectState.js +0 -122
- package/useSelectState.js.map +0 -1
package/index.css
CHANGED
|
@@ -1,141 +1,60 @@
|
|
|
1
|
-
.magritte-error-
|
|
1
|
+
.magritte-error-container___ICGpQ_13-0-0{
|
|
2
2
|
display:flex;
|
|
3
3
|
flex-direction:column;
|
|
4
4
|
align-items:center;
|
|
5
|
-
height:100%;
|
|
6
5
|
justify-content:center;
|
|
6
|
+
height:100%;
|
|
7
|
+
text-align:center;
|
|
7
8
|
}
|
|
8
9
|
@media (min-width: 1020px){
|
|
9
|
-
body.magritte-old-layout .magritte-error-
|
|
10
|
+
body.magritte-old-layout .magritte-error-container___ICGpQ_13-0-0{
|
|
10
11
|
min-height:320px;
|
|
11
12
|
height:auto;
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
15
|
@media (min-width: 1024px){
|
|
15
|
-
body:not(.magritte-old-layout) .magritte-error-
|
|
16
|
+
body:not(.magritte-old-layout) .magritte-error-container___ICGpQ_13-0-0{
|
|
16
17
|
min-height:320px;
|
|
17
18
|
height:auto;
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
--magritte-color-component-input-stroke-state-accent-focused-accessible-v25-0-0:#0070ff7a;
|
|
23
|
-
}
|
|
24
|
-
.magritte-select-option-plain___dfz4a_12-9-26{
|
|
25
|
-
border-radius:8px;
|
|
26
|
-
}
|
|
27
|
-
.magritte-select-option-plain___dfz4a_12-9-26.focus-visible{
|
|
28
|
-
outline:var(--magritte-color-component-input-stroke-state-accent-focused-accessible-v25-0-0) solid 4px;
|
|
29
|
-
}
|
|
30
|
-
.magritte-select-option-plain___dfz4a_12-9-26:hover{
|
|
31
|
-
cursor:default;
|
|
32
|
-
}
|
|
33
|
-
.magritte-select-option-plain_active___AQSQS_12-9-26:hover{
|
|
34
|
-
cursor:pointer;
|
|
35
|
-
}
|
|
36
|
-
.magritte-select-delimiter___WyeR6_12-9-26{
|
|
37
|
-
padding-left:16px;
|
|
38
|
-
padding-top:12px;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.magritte-select-bottom-sheet___1RZDJ_12-9-26{
|
|
42
|
-
display:flex;
|
|
43
|
-
flex-direction:column;
|
|
44
|
-
padding:0 16px;
|
|
45
|
-
padding-bottom:16px;
|
|
46
|
-
}
|
|
47
|
-
.magritte-select-bottom-sheet_checkbox___hwTgo_12-9-26,
|
|
48
|
-
.magritte-select-bottom-sheet_radio___qvFFV_12-9-26{
|
|
49
|
-
gap:12px;
|
|
50
|
-
}
|
|
51
|
-
.magritte-select-bottom-sheet_without-header___KOKVh_12-9-26{
|
|
52
|
-
padding-top:16px;
|
|
53
|
-
}
|
|
54
|
-
.magritte-full-screen-placeholder___zPC8k_12-9-26{
|
|
22
|
+
.magritte-content-placeholder___rOCxd_13-0-0{
|
|
55
23
|
display:flex;
|
|
56
24
|
flex-direction:column;
|
|
57
25
|
align-items:center;
|
|
58
|
-
height:100%;
|
|
59
26
|
justify-content:center;
|
|
60
|
-
}
|
|
61
|
-
.magritte-error-wrapper___P7jYg_12-9-26{
|
|
62
27
|
height:100%;
|
|
28
|
+
text-align:center;
|
|
29
|
+
}
|
|
30
|
+
.magritte-select-bottom-sheet_without-header___KOKVh_13-0-0{
|
|
31
|
+
padding-top:16px;
|
|
63
32
|
}
|
|
64
33
|
|
|
65
|
-
.magritte-select-drop-container-
|
|
34
|
+
.magritte-select-drop-container-wrapper___OHM0q_13-0-0{
|
|
66
35
|
display:flex;
|
|
67
36
|
flex-direction:column;
|
|
68
37
|
}
|
|
69
|
-
.magritte-select-drop-
|
|
38
|
+
.magritte-select-drop-container___hee1p_13-0-0{
|
|
70
39
|
display:flex;
|
|
71
40
|
flex-direction:column;
|
|
72
41
|
padding:12px;
|
|
73
42
|
margin:calc(-1 * 12px);
|
|
74
43
|
}
|
|
75
|
-
.magritte-select-drop-
|
|
44
|
+
.magritte-select-drop-container_plain___766zl_13-0-0{
|
|
76
45
|
padding:24px;
|
|
77
46
|
margin:calc(-1 * 24px);
|
|
78
47
|
}
|
|
79
|
-
.magritte-select-drop-container_with-footer___6wp-
|
|
48
|
+
.magritte-select-drop-container_with-footer___6wp-L_13-0-0{
|
|
80
49
|
margin-bottom:0;
|
|
81
50
|
padding-bottom:0;
|
|
82
51
|
}
|
|
83
|
-
.magritte-select-
|
|
84
|
-
display:flex;
|
|
85
|
-
flex-direction:column;
|
|
86
|
-
gap:8px;
|
|
87
|
-
}
|
|
88
|
-
.magritte-select-drop-header___fMmio_12-9-26{
|
|
89
|
-
display:flex;
|
|
90
|
-
flex-direction:column;
|
|
91
|
-
margin-bottom:8px;
|
|
92
|
-
}
|
|
93
|
-
.magritte-select-drop_plain___VL8Fz_12-9-26{
|
|
94
|
-
gap:16px;
|
|
95
|
-
}
|
|
96
|
-
.magritte-label-option___2N7t9_12-9-26{
|
|
97
|
-
display:flex;
|
|
98
|
-
justify-content:center;
|
|
99
|
-
}
|
|
100
|
-
.magritte-loading___AMiuq_12-9-26{
|
|
52
|
+
.magritte-select-drop-loading___KsNuw_13-0-0{
|
|
101
53
|
display:flex;
|
|
102
54
|
align-items:center;
|
|
103
55
|
height:150px;
|
|
104
56
|
justify-content:center;
|
|
105
57
|
}
|
|
106
|
-
.magritte-hint___6qaFl_12-9-26{
|
|
107
|
-
display:flex;
|
|
108
|
-
flex-direction:column;
|
|
109
|
-
align-items:center;
|
|
110
|
-
min-height:320px;
|
|
111
|
-
justify-content:center;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.magritte-select-modal-wrapper___5BhtC_12-9-26{
|
|
115
|
-
display:flex;
|
|
116
|
-
flex-direction:column;
|
|
117
|
-
flex-grow:1;
|
|
118
|
-
}
|
|
119
|
-
.magritte-select-modal___f9wc6_12-9-26{
|
|
120
|
-
display:flex;
|
|
121
|
-
flex-direction:column;
|
|
122
|
-
gap:12px;
|
|
123
|
-
}
|
|
124
|
-
.magritte-select-modal_plain___0rP39_12-9-26{
|
|
125
|
-
gap:0;
|
|
126
|
-
}
|
|
127
|
-
.magritte-label-option___kFAuR_12-9-26{
|
|
128
|
-
display:flex;
|
|
129
|
-
justify-content:center;
|
|
130
|
-
}
|
|
131
|
-
.magritte-layer-full-height___cJX-K_12-9-26{
|
|
132
|
-
display:flex;
|
|
133
|
-
flex-direction:column;
|
|
134
|
-
align-items:center;
|
|
135
|
-
justify-content:center;
|
|
136
|
-
margin-top:auto;
|
|
137
|
-
margin-bottom:auto;
|
|
138
|
-
}
|
|
139
58
|
|
|
140
59
|
:root{
|
|
141
60
|
--magritte-color-background-secondary-v25-0-0:#F1F4F9;
|
|
@@ -155,14 +74,27 @@
|
|
|
155
74
|
--magritte-color-background-accent-secondary-v25-0-0:#F1F4F7;
|
|
156
75
|
--magritte-color-icon-accent-v25-0-0:#7195AF;
|
|
157
76
|
}
|
|
158
|
-
.magritte-select-empty-
|
|
77
|
+
.magritte-select-empty-hint___B39XJ_13-0-0{
|
|
159
78
|
display:flex;
|
|
160
79
|
flex-direction:column;
|
|
161
|
-
justify-content:center;
|
|
162
|
-
align-content:center;
|
|
163
80
|
align-items:center;
|
|
81
|
+
justify-content:center;
|
|
82
|
+
height:100%;
|
|
83
|
+
text-align:center;
|
|
84
|
+
}
|
|
85
|
+
@media (min-width: 1020px){
|
|
86
|
+
body.magritte-old-layout .magritte-select-empty-hint___B39XJ_13-0-0{
|
|
87
|
+
min-height:320px;
|
|
88
|
+
height:auto;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
@media (min-width: 1024px){
|
|
92
|
+
body:not(.magritte-old-layout) .magritte-select-empty-hint___B39XJ_13-0-0{
|
|
93
|
+
min-height:320px;
|
|
94
|
+
height:auto;
|
|
95
|
+
}
|
|
164
96
|
}
|
|
165
|
-
.magritte-
|
|
97
|
+
.magritte-icon___F0GQx_13-0-0{
|
|
166
98
|
display:flex;
|
|
167
99
|
align-items:center;
|
|
168
100
|
justify-content:center;
|
|
@@ -170,11 +102,93 @@
|
|
|
170
102
|
height:48px;
|
|
171
103
|
border-radius:50%;
|
|
172
104
|
}
|
|
173
|
-
.magritte-icon-
|
|
105
|
+
.magritte-icon-empty___sAFRT_13-0-0{
|
|
174
106
|
background-color:var(--magritte-color-background-accent-secondary-v25-0-0);
|
|
175
107
|
--magritte-ui-icon-color-override:var(--magritte-color-icon-accent-v25-0-0);
|
|
176
108
|
}
|
|
177
|
-
.magritte-icon-
|
|
109
|
+
.magritte-icon-empty-search___O0pus_13-0-0{
|
|
178
110
|
background-color:var(--magritte-color-background-secondary-v25-0-0);
|
|
179
111
|
--magritte-ui-icon-color-override:var(--magritte-color-icon-tertiary-v25-0-0);
|
|
180
112
|
}
|
|
113
|
+
|
|
114
|
+
:root{
|
|
115
|
+
--magritte-color-component-input-stroke-state-accent-focused-accessible-v25-0-0:#0070ff7a;
|
|
116
|
+
}
|
|
117
|
+
.magritte-select-option-plain___u9kSx_13-0-0{
|
|
118
|
+
border-radius:8px;
|
|
119
|
+
}
|
|
120
|
+
.magritte-select-option-plain___u9kSx_13-0-0.focus-visible{
|
|
121
|
+
outline:var(--magritte-color-component-input-stroke-state-accent-focused-accessible-v25-0-0) solid 4px;
|
|
122
|
+
}
|
|
123
|
+
@media (min-width: 1020px){
|
|
124
|
+
body.magritte-old-layout .magritte-select-option-plain___u9kSx_13-0-0:hover{
|
|
125
|
+
cursor:default;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
@media (min-width: 1024px){
|
|
129
|
+
body:not(.magritte-old-layout) .magritte-select-option-plain___u9kSx_13-0-0:hover{
|
|
130
|
+
cursor:default;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
@media (min-width: 1020px){
|
|
134
|
+
body.magritte-old-layout .magritte-select-option-plain_active___ynHQP_13-0-0:hover{
|
|
135
|
+
cursor:pointer;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
@media (min-width: 1024px){
|
|
139
|
+
body:not(.magritte-old-layout) .magritte-select-option-plain_active___ynHQP_13-0-0:hover{
|
|
140
|
+
cursor:pointer;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
.magritte-select-label-option___wyUhk_13-0-0{
|
|
144
|
+
display:flex;
|
|
145
|
+
justify-content:center;
|
|
146
|
+
}
|
|
147
|
+
.magritte-select-delimiter___SsBtb_13-0-0{
|
|
148
|
+
padding-left:16px;
|
|
149
|
+
padding-top:12px;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.magritte-options___E0JN-_13-0-0{
|
|
153
|
+
display:flex;
|
|
154
|
+
flex-direction:column;
|
|
155
|
+
padding:0 16px;
|
|
156
|
+
padding-bottom:16px;
|
|
157
|
+
gap:12px;
|
|
158
|
+
}
|
|
159
|
+
.magritte-options_plain___-ihU5_13-0-0{
|
|
160
|
+
gap:0;
|
|
161
|
+
}
|
|
162
|
+
.magritte-options_desktop___gz7kx_13-0-0{
|
|
163
|
+
gap:8px;
|
|
164
|
+
padding:0;
|
|
165
|
+
}
|
|
166
|
+
.magritte-options_desktop-plain___L0WIC_13-0-0{
|
|
167
|
+
gap:16px;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.magritte-select-layout___3THUn_13-0-0{
|
|
171
|
+
display:contents;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.magritte-anchor___0KOBD_13-0-0{
|
|
175
|
+
position:relative;
|
|
176
|
+
width:fit-content;
|
|
177
|
+
}
|
|
178
|
+
.magritte-anchor-stretched___h7y6m_13-0-0{
|
|
179
|
+
width:100%;
|
|
180
|
+
}
|
|
181
|
+
.magritte-default-view___3ptpo_13-0-0{
|
|
182
|
+
min-width:0;
|
|
183
|
+
}
|
|
184
|
+
.magritte-input-view___ZeEKh_13-0-0{
|
|
185
|
+
position:absolute;
|
|
186
|
+
top:0;
|
|
187
|
+
left:0;
|
|
188
|
+
width:100%;
|
|
189
|
+
display:flex;
|
|
190
|
+
min-width:0;
|
|
191
|
+
}
|
|
192
|
+
.magritte-hidden-view___stvzX_13-0-0{
|
|
193
|
+
visibility:hidden;
|
|
194
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export {
|
|
4
|
-
export
|
|
5
|
-
export
|
|
1
|
+
export { Select } from '@hh.ru/magritte-ui-select/Select';
|
|
2
|
+
export { UncontrolledSelect } from '@hh.ru/magritte-ui-select/UncontrolledSelect';
|
|
3
|
+
export { useSelectTrigger, useTriggerRef } from '@hh.ru/magritte-ui-select/useSelectTrigger';
|
|
4
|
+
export { useSearchState, type SearchContextValue } from '@hh.ru/magritte-ui-select/useSearchState';
|
|
5
|
+
export { useSelectContentState, type SelectContentState } from '@hh.ru/magritte-ui-select/useSelectContentState';
|
|
6
|
+
export { useDataProvider, type UseDataProvider } from '@hh.ru/magritte-ui-select/useDataProvider';
|
|
7
|
+
export { useVisibility } from '@hh.ru/magritte-ui-select/useVisibility';
|
|
8
|
+
export { useSelectError } from '@hh.ru/magritte-ui-select/useSelectError';
|
|
9
|
+
export { useSelectHint } from '@hh.ru/magritte-ui-select/useSelectHint';
|
|
10
|
+
export { useSelectPicker, useSelectUnsavedChangesAlert } from '@hh.ru/magritte-ui-select/SelectPickerContext';
|
|
11
|
+
export { usePickerRef } from '@hh.ru/magritte-ui-select/usePickerRef';
|
|
12
|
+
export { useSelectConfig } from '@hh.ru/magritte-ui-select/useSelectConfig';
|
|
13
|
+
export type { OptionsProps, OptionCustomLayoutComponent, OptionCustomLayoutProps, OnChangeAction, } from '@hh.ru/magritte-ui-select/SelectOptions';
|
|
14
|
+
export type { SelectProps, UncontrolledSelectProps, SelectOptionType, SelectOption, SelectControlledTriggerProps, SelectUncontrolledTriggerProps, OptionsCount, OnOptionsChangeCallback, } from '@hh.ru/magritte-ui-select/types';
|
|
15
|
+
export { SelectLegacy } from '@hh.ru/magritte-ui-select/legacy/SelectLegacy';
|
|
16
|
+
export { UncontrolledSelectLegacy } from '@hh.ru/magritte-ui-select/legacy/UncontrolledSelectLegacy';
|
package/index.js
CHANGED
|
@@ -1,43 +1,77 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
export { Select } from './Select.js';
|
|
3
|
-
export { RenderHeaderDefault } from './SelectBottomSheet.js';
|
|
4
3
|
export { UncontrolledSelect } from './UncontrolledSelect.js';
|
|
5
|
-
export {
|
|
4
|
+
export { useSelectTrigger, useTriggerRef } from './useSelectTrigger.js';
|
|
5
|
+
export { useSearchState } from './useSearchState.js';
|
|
6
|
+
export { useSelectContentState } from './useSelectContentState.js';
|
|
7
|
+
export { useDataProvider } from './useDataProvider.js';
|
|
8
|
+
export { useVisibility } from './useVisibility.js';
|
|
9
|
+
export { useSelectError } from './useSelectError.js';
|
|
10
|
+
export { useSelectHint } from './useSelectHint.js';
|
|
11
|
+
export { useSelectPicker, useSelectUnsavedChangesAlert } from './SelectPickerContext.js';
|
|
12
|
+
export { usePickerRef } from './usePickerRef.js';
|
|
13
|
+
export { useSelectConfig } from './useSelectConfig.js';
|
|
14
|
+
export { SelectLegacy } from './legacy/SelectLegacy.js';
|
|
15
|
+
export { UncontrolledSelectLegacy } from './legacy/UncontrolledSelectLegacy.js';
|
|
6
16
|
import 'react/jsx-runtime';
|
|
7
17
|
import 'react';
|
|
8
|
-
import '
|
|
9
|
-
import '@hh.ru/magritte-common-use-disabled';
|
|
10
|
-
import '@hh.ru/magritte-common-use-multiple-refs';
|
|
11
|
-
import '@hh.ru/magritte-ui-breakpoint';
|
|
12
|
-
import '@hh.ru/magritte-ui-input/BaseInput';
|
|
13
|
-
import './SelectDrop.js';
|
|
14
|
-
import 'classnames';
|
|
18
|
+
import './ApplyChangesButton.js';
|
|
15
19
|
import '@hh.ru/magritte-common-use-translation';
|
|
16
|
-
import '@hh.ru/magritte-ui-
|
|
20
|
+
import '@hh.ru/magritte-ui-breakpoint';
|
|
21
|
+
import './internal/SelectStateContext.js';
|
|
22
|
+
import './internal/SelectStore.js';
|
|
23
|
+
import './internal/utils.js';
|
|
24
|
+
import './internal/slots.js';
|
|
25
|
+
import '@hh.ru/magritte-internal-slot-registry';
|
|
26
|
+
import './ClearButton.js';
|
|
27
|
+
import './ClearCard.js';
|
|
28
|
+
import '@hh.ru/magritte-ui-card';
|
|
17
29
|
import '@hh.ru/magritte-ui-cell';
|
|
18
|
-
import '@hh.ru/magritte-ui-drop';
|
|
19
30
|
import '@hh.ru/magritte-ui-icon/icon';
|
|
31
|
+
import './SelectBottomSheet.js';
|
|
32
|
+
import 'classnames';
|
|
33
|
+
import '@hh.ru/magritte-common-use-multiple-refs';
|
|
34
|
+
import '@hh.ru/magritte-ui-action-bar';
|
|
35
|
+
import '@hh.ru/magritte-ui-bottom-sheet';
|
|
20
36
|
import '@hh.ru/magritte-ui-loader';
|
|
21
|
-
import './SelectError.js';
|
|
37
|
+
import './internal/SelectError.js';
|
|
38
|
+
import './internal/SelectReloadButton.js';
|
|
22
39
|
import '@hh.ru/magritte-ui-button';
|
|
23
|
-
import '@hh.ru/magritte-ui-icon/variants/icon';
|
|
24
40
|
import '@hh.ru/magritte-ui-spacing';
|
|
25
41
|
import '@hh.ru/magritte-ui-title';
|
|
26
42
|
import '@hh.ru/magritte-ui-typography';
|
|
27
|
-
import './
|
|
43
|
+
import './SelectBottomSheetHeader.js';
|
|
44
|
+
import '@hh.ru/magritte-ui-nav-bar';
|
|
45
|
+
import './SelectPickerCloseIcon.js';
|
|
46
|
+
import './SelectSearchInput.js';
|
|
47
|
+
import '@hh.ru/magritte-ui-input';
|
|
48
|
+
import './SelectDrop.js';
|
|
49
|
+
import '@hh.ru/magritte-ui-drop';
|
|
50
|
+
import './SelectEmptyHint.js';
|
|
51
|
+
import './SelectOptions.js';
|
|
52
|
+
import './internal/Option.js';
|
|
53
|
+
import '@hh.ru/magritte-common-keyboard';
|
|
54
|
+
import '@hh.ru/magritte-common-use-disabled';
|
|
28
55
|
import '@hh.ru/magritte-ui-checkable-card/CheckableCardElement';
|
|
56
|
+
import './internal/OptionControl.js';
|
|
29
57
|
import '@hh.ru/magritte-ui-checkbox-radio';
|
|
30
|
-
import './
|
|
31
|
-
import './
|
|
32
|
-
import '@hh.ru/magritte-ui-
|
|
33
|
-
import '
|
|
34
|
-
import '
|
|
35
|
-
import '@hh.ru/magritte-ui-nav-bar';
|
|
36
|
-
import './isArraysEquals.js';
|
|
37
|
-
import './useSelectOptionsList.js';
|
|
38
|
-
import './useSelectSearch.js';
|
|
39
|
-
import '@hh.ru/magritte-common-data-provider';
|
|
40
|
-
import './useSelectState.js';
|
|
58
|
+
import './internal/focusOrchestrator.js';
|
|
59
|
+
import './SelectSearchTrigger.js';
|
|
60
|
+
import '@hh.ru/magritte-ui-input/BaseInput';
|
|
61
|
+
import './internal/NavigationManagement.js';
|
|
62
|
+
import './internal/useFocusWithin.js';
|
|
41
63
|
import '@hh.ru/magritte-ui-trigger';
|
|
42
|
-
import '
|
|
64
|
+
import './SelectTrigger.js';
|
|
65
|
+
import './internal/ConfigContext.js';
|
|
66
|
+
import './internal/SearchStateContext.js';
|
|
67
|
+
import './internal/SelectDataProvider.js';
|
|
68
|
+
import '@hh.ru/magritte-common-data-provider';
|
|
69
|
+
import './internal/useDataProvider.js';
|
|
70
|
+
import './internal/VisibilityContext.js';
|
|
71
|
+
import './legacy/internal/BottomSheetHeaderLegacy.js';
|
|
72
|
+
import './legacy/internal/ContentBeforeLegacy.js';
|
|
73
|
+
import './legacy/internal/FooterLegacy.js';
|
|
74
|
+
import './legacy/internal/OptionLayoutLegacy.js';
|
|
75
|
+
import './legacy/internal/TriggerLegacy.js';
|
|
76
|
+
import './legacy/internal/UnsavedChangesAlertLegacy.js';
|
|
43
77
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/index.mock.d.ts
CHANGED
|
@@ -1,4 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
export declare const Select: import("react").ForwardRefExoticComponent<Record<string, unknown>> & {
|
|
2
|
+
ApplyChangesButton: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
3
|
+
BottomSheet: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
4
|
+
PickerCloseIcon: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
5
|
+
BottomSheetHeader: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
6
|
+
ClearButton: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
7
|
+
ClearCard: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
8
|
+
Drop: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
9
|
+
EmptyHint: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
10
|
+
Options: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
11
|
+
PickerProvider: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
12
|
+
SearchInput: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
13
|
+
SearchTrigger: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
14
|
+
Trigger: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
15
|
+
};
|
|
16
|
+
export declare const UncontrolledSelect: import("react").ForwardRefExoticComponent<Record<string, unknown>> & {
|
|
17
|
+
ApplyChangesButton: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
18
|
+
BottomSheet: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
19
|
+
PickerCloseIcon: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
20
|
+
BottomSheetHeader: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
21
|
+
ClearButton: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
22
|
+
ClearCard: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
23
|
+
Drop: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
24
|
+
EmptyHint: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
25
|
+
Options: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
26
|
+
PickerProvider: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
27
|
+
SearchInput: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
28
|
+
SearchTrigger: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
29
|
+
Trigger: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
30
|
+
};
|
|
31
|
+
export { useSelectTrigger, useTriggerRef } from '@hh.ru/magritte-ui-select/useSelectTrigger';
|
|
32
|
+
export { useSearchState, type SearchContextValue } from '@hh.ru/magritte-ui-select/useSearchState';
|
|
33
|
+
export { useSelectContentState, type SelectContentState } from '@hh.ru/magritte-ui-select/useSelectContentState';
|
|
34
|
+
export { useDataProvider, type UseDataProvider } from '@hh.ru/magritte-ui-select/useDataProvider';
|
|
35
|
+
export { useVisibility } from '@hh.ru/magritte-ui-select/useVisibility';
|
|
36
|
+
export { useSelectError } from '@hh.ru/magritte-ui-select/useSelectError';
|
|
37
|
+
export { useSelectHint } from '@hh.ru/magritte-ui-select/useSelectHint';
|
|
38
|
+
export { useSelectPicker, useSelectUnsavedChangesAlert } from '@hh.ru/magritte-ui-select/SelectPickerContext';
|
|
39
|
+
export { usePickerRef } from '@hh.ru/magritte-ui-select/usePickerRef';
|
|
40
|
+
export { useSelectConfig } from '@hh.ru/magritte-ui-select/useSelectConfig';
|
|
41
|
+
export type { OptionsProps, OptionCustomLayoutComponent, OptionCustomLayoutProps, OnChangeAction, } from '@hh.ru/magritte-ui-select/SelectOptions';
|
|
42
|
+
export type { SelectProps, UncontrolledSelectProps, SelectOptionType, SelectOption, SelectControlledTriggerProps, SelectUncontrolledTriggerProps, OptionsCount, OnOptionsChangeCallback, } from '@hh.ru/magritte-ui-select/types';
|
|
43
|
+
/** @deprecated Адаптер старого API */
|
|
44
|
+
export declare const SelectLegacy: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
45
|
+
/** @deprecated Адаптер старого API */
|
|
46
|
+
export declare const UncontrolledSelectLegacy: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
package/index.mock.js
CHANGED
|
@@ -1,12 +1,68 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
import { mockComponent } from '@hh.ru/magritte-ui-mock-component';
|
|
3
|
+
export { useSelectTrigger, useTriggerRef } from './useSelectTrigger.js';
|
|
4
|
+
export { useSearchState } from './useSearchState.js';
|
|
5
|
+
export { useSelectContentState } from './useSelectContentState.js';
|
|
6
|
+
export { useDataProvider } from './useDataProvider.js';
|
|
7
|
+
export { useVisibility } from './useVisibility.js';
|
|
8
|
+
export { useSelectError } from './useSelectError.js';
|
|
9
|
+
export { useSelectHint } from './useSelectHint.js';
|
|
10
|
+
export { useSelectPicker, useSelectUnsavedChangesAlert } from './SelectPickerContext.js';
|
|
11
|
+
export { usePickerRef } from './usePickerRef.js';
|
|
12
|
+
export { useSelectConfig } from './useSelectConfig.js';
|
|
13
|
+
import 'react';
|
|
14
|
+
import '@hh.ru/magritte-common-keyboard';
|
|
15
|
+
import './internal/SelectStateContext.js';
|
|
16
|
+
import 'react/jsx-runtime';
|
|
17
|
+
import './internal/SelectStore.js';
|
|
18
|
+
import './internal/utils.js';
|
|
19
|
+
import './internal/focusOrchestrator.js';
|
|
20
|
+
import './internal/slots.js';
|
|
21
|
+
import '@hh.ru/magritte-internal-slot-registry';
|
|
22
|
+
import './internal/SearchStateContext.js';
|
|
23
|
+
import './internal/SelectDataProvider.js';
|
|
24
|
+
import '@hh.ru/magritte-common-data-provider';
|
|
25
|
+
import './internal/useDataProvider.js';
|
|
26
|
+
import './internal/VisibilityContext.js';
|
|
27
|
+
import './internal/ConfigContext.js';
|
|
3
28
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
29
|
+
const withChildren = { withChildren: true };
|
|
30
|
+
const ApplyChangesButton = mockComponent('SelectApplyChangesButton', undefined, withChildren);
|
|
31
|
+
const BottomSheet = mockComponent('SelectBottomSheet', undefined, withChildren);
|
|
32
|
+
const PickerCloseIcon = mockComponent('SelectPickerCloseIcon');
|
|
33
|
+
const BottomSheetHeader = mockComponent('SelectBottomSheetHeader');
|
|
34
|
+
const ClearButton = mockComponent('SelectClearButton', undefined, withChildren);
|
|
35
|
+
const ClearCard = mockComponent('SelectClearCard', undefined, withChildren);
|
|
36
|
+
const Drop = mockComponent('SelectDrop', undefined, withChildren);
|
|
37
|
+
const EmptyHint = mockComponent('SelectEmptyHint', undefined, withChildren);
|
|
38
|
+
const Options = mockComponent('SelectOptions');
|
|
39
|
+
const PickerProvider = mockComponent('SelectPickerProvider', undefined, withChildren);
|
|
40
|
+
const SearchInput = mockComponent('SelectSearchInput');
|
|
41
|
+
const SearchTrigger = mockComponent('SelectSearchTrigger');
|
|
42
|
+
const Trigger = mockComponent('SelectTrigger');
|
|
43
|
+
const SELECT_COMPONENTS = {
|
|
44
|
+
ApplyChangesButton,
|
|
45
|
+
BottomSheet,
|
|
46
|
+
PickerCloseIcon,
|
|
47
|
+
BottomSheetHeader,
|
|
48
|
+
ClearButton,
|
|
49
|
+
ClearCard,
|
|
50
|
+
Drop,
|
|
51
|
+
EmptyHint,
|
|
52
|
+
Options,
|
|
53
|
+
PickerProvider,
|
|
54
|
+
SearchInput,
|
|
55
|
+
SearchTrigger,
|
|
56
|
+
Trigger,
|
|
57
|
+
};
|
|
58
|
+
// core компоненты
|
|
59
|
+
const Select = Object.assign(mockComponent('Select', undefined, withChildren), SELECT_COMPONENTS);
|
|
60
|
+
const UncontrolledSelect = Object.assign(mockComponent('UncontrolledSelect', undefined, withChildren), SELECT_COMPONENTS);
|
|
61
|
+
// legacy компоненты
|
|
62
|
+
/** @deprecated Адаптер старого API */
|
|
63
|
+
const SelectLegacy = mockComponent('SelectLegacy');
|
|
64
|
+
/** @deprecated Адаптер старого API */
|
|
65
|
+
const UncontrolledSelectLegacy = mockComponent('UncontrolledSelectLegacy');
|
|
10
66
|
|
|
11
|
-
export { Select, UncontrolledSelect };
|
|
67
|
+
export { Select, SelectLegacy, UncontrolledSelect, UncontrolledSelectLegacy };
|
|
12
68
|
//# sourceMappingURL=index.mock.js.map
|
package/index.mock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mock.js","sources":["src/index.mock.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"index.mock.js","sources":["src/index.mock.ts"],"sourcesContent":["import { mockComponent } from '@hh.ru/magritte-ui-mock-component';\n\nconst withChildren = { withChildren: true };\n\nconst ApplyChangesButton = mockComponent('SelectApplyChangesButton', undefined, withChildren);\nconst BottomSheet = mockComponent('SelectBottomSheet', undefined, withChildren);\nconst PickerCloseIcon = mockComponent('SelectPickerCloseIcon');\nconst BottomSheetHeader = mockComponent('SelectBottomSheetHeader');\nconst ClearButton = mockComponent('SelectClearButton', undefined, withChildren);\nconst ClearCard = mockComponent('SelectClearCard', undefined, withChildren);\nconst Drop = mockComponent('SelectDrop', undefined, withChildren);\nconst EmptyHint = mockComponent('SelectEmptyHint', undefined, withChildren);\nconst Options = mockComponent('SelectOptions');\nconst PickerProvider = mockComponent('SelectPickerProvider', undefined, withChildren);\nconst SearchInput = mockComponent('SelectSearchInput');\nconst SearchTrigger = mockComponent('SelectSearchTrigger');\nconst Trigger = mockComponent('SelectTrigger');\n\nconst SELECT_COMPONENTS = {\n ApplyChangesButton,\n BottomSheet,\n PickerCloseIcon,\n BottomSheetHeader,\n ClearButton,\n ClearCard,\n Drop,\n EmptyHint,\n Options,\n PickerProvider,\n SearchInput,\n SearchTrigger,\n Trigger,\n};\n\n// core компоненты\nexport const Select = Object.assign(mockComponent('Select', undefined, withChildren), SELECT_COMPONENTS);\nexport const UncontrolledSelect = Object.assign(\n mockComponent('UncontrolledSelect', undefined, withChildren),\n SELECT_COMPONENTS\n);\n\n// хуки для кастома\nexport { useSelectTrigger, useTriggerRef } from '@hh.ru/magritte-ui-select/useSelectTrigger';\nexport { useSearchState, type SearchContextValue } from '@hh.ru/magritte-ui-select/useSearchState';\nexport { useSelectContentState, type SelectContentState } from '@hh.ru/magritte-ui-select/useSelectContentState';\nexport { useDataProvider, type UseDataProvider } from '@hh.ru/magritte-ui-select/useDataProvider';\nexport { useVisibility } from '@hh.ru/magritte-ui-select/useVisibility';\nexport { useSelectError } from '@hh.ru/magritte-ui-select/useSelectError';\nexport { useSelectHint } from '@hh.ru/magritte-ui-select/useSelectHint';\nexport { useSelectPicker, useSelectUnsavedChangesAlert } from '@hh.ru/magritte-ui-select/SelectPickerContext';\nexport { usePickerRef } from '@hh.ru/magritte-ui-select/usePickerRef';\nexport { useSelectConfig } from '@hh.ru/magritte-ui-select/useSelectConfig';\n\n// свойства списка опций и кастомный layout опции\nexport type {\n OptionsProps,\n OptionCustomLayoutComponent,\n OptionCustomLayoutProps,\n OnChangeAction,\n} from '@hh.ru/magritte-ui-select/SelectOptions';\n\nexport type {\n SelectProps,\n UncontrolledSelectProps,\n SelectOptionType,\n SelectOption,\n SelectControlledTriggerProps,\n SelectUncontrolledTriggerProps,\n OptionsCount,\n OnOptionsChangeCallback,\n} from '@hh.ru/magritte-ui-select/types';\n\n// legacy компоненты\n/** @deprecated Адаптер старого API */\nexport const SelectLegacy = mockComponent('SelectLegacy');\n/** @deprecated Адаптер старого API */\nexport const UncontrolledSelectLegacy = mockComponent('UncontrolledSelectLegacy');\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,YAAY,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;AAE5C,MAAM,kBAAkB,GAAG,aAAa,CAAC,0BAA0B,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;AAC9F,MAAM,WAAW,GAAG,aAAa,CAAC,mBAAmB,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;AAChF,MAAM,eAAe,GAAG,aAAa,CAAC,uBAAuB,CAAC,CAAC;AAC/D,MAAM,iBAAiB,GAAG,aAAa,CAAC,yBAAyB,CAAC,CAAC;AACnE,MAAM,WAAW,GAAG,aAAa,CAAC,mBAAmB,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;AAChF,MAAM,SAAS,GAAG,aAAa,CAAC,iBAAiB,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;AAC5E,MAAM,IAAI,GAAG,aAAa,CAAC,YAAY,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;AAClE,MAAM,SAAS,GAAG,aAAa,CAAC,iBAAiB,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;AAC5E,MAAM,OAAO,GAAG,aAAa,CAAC,eAAe,CAAC,CAAC;AAC/C,MAAM,cAAc,GAAG,aAAa,CAAC,sBAAsB,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;AACtF,MAAM,WAAW,GAAG,aAAa,CAAC,mBAAmB,CAAC,CAAC;AACvD,MAAM,aAAa,GAAG,aAAa,CAAC,qBAAqB,CAAC,CAAC;AAC3D,MAAM,OAAO,GAAG,aAAa,CAAC,eAAe,CAAC,CAAC;AAE/C,MAAM,iBAAiB,GAAG;IACtB,kBAAkB;IAClB,WAAW;IACX,eAAe;IACf,iBAAiB;IACjB,WAAW;IACX,SAAS;IACT,IAAI;IACJ,SAAS;IACT,OAAO;IACP,cAAc;IACd,WAAW;IACX,aAAa;IACb,OAAO;CACV,CAAC;AAEF;AACa,MAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,EAAE,SAAS,EAAE,YAAY,CAAC,EAAE,iBAAiB,EAAE;AAC5F,MAAA,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAC3C,aAAa,CAAC,oBAAoB,EAAE,SAAS,EAAE,YAAY,CAAC,EAC5D,iBAAiB,EACnB;AAiCF;AACA;MACa,YAAY,GAAG,aAAa,CAAC,cAAc,EAAE;AAC1D;MACa,wBAAwB,GAAG,aAAa,CAAC,0BAA0B;;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ReactElement, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import { ErrorState, ProviderErrorState } from '@hh.ru/magritte-ui-select/types';
|
|
3
|
+
interface ConfigContextBaseProps {
|
|
4
|
+
maxSelectedOptions?: number;
|
|
5
|
+
multiple?: boolean;
|
|
6
|
+
name?: string;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface ConfigContextProps extends ConfigContextBaseProps {
|
|
10
|
+
hasExternalError: boolean;
|
|
11
|
+
hasProviderError: boolean;
|
|
12
|
+
hasEmptyHint: boolean;
|
|
13
|
+
hasEmptySearchHint: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface ErrorContextProps {
|
|
16
|
+
error?: ErrorState;
|
|
17
|
+
providerError?: ProviderErrorState;
|
|
18
|
+
}
|
|
19
|
+
export interface HintContextProps {
|
|
20
|
+
emptyHint?: ReactNode;
|
|
21
|
+
emptySearchHint?: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
export declare const ConfigContext: import("react").Context<ConfigContextProps | null>;
|
|
24
|
+
export declare const ErrorContext: import("react").Context<ErrorContextProps | null>;
|
|
25
|
+
export declare const HintContext: import("react").Context<HintContextProps | null>;
|
|
26
|
+
export declare const ConfigProvider: ({ children, maxSelectedOptions, multiple, name, loading, error, providerError, emptyHint, emptySearchHint, }: ConfigContextBaseProps & ErrorContextProps & HintContextProps & PropsWithChildren) => ReactElement;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import './../index.css';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { createContext, useMemo } from 'react';
|
|
4
|
+
|
|
5
|
+
const ConfigContext = createContext(null);
|
|
6
|
+
const ErrorContext = createContext(null);
|
|
7
|
+
const HintContext = createContext(null);
|
|
8
|
+
// провайдер внешних/глобальных свойств select
|
|
9
|
+
const ConfigProvider = ({ children, maxSelectedOptions, multiple, name, loading, error, providerError, emptyHint, emptySearchHint, }) => {
|
|
10
|
+
// свойства-примитивы
|
|
11
|
+
const hasExternalError = Boolean(error);
|
|
12
|
+
const hasProviderError = Boolean(providerError);
|
|
13
|
+
const hasEmptyHint = Boolean(emptyHint);
|
|
14
|
+
const hasEmptySearchHint = Boolean(emptySearchHint);
|
|
15
|
+
const configValue = useMemo(() => ({
|
|
16
|
+
maxSelectedOptions,
|
|
17
|
+
multiple,
|
|
18
|
+
name,
|
|
19
|
+
loading,
|
|
20
|
+
hasExternalError,
|
|
21
|
+
hasProviderError,
|
|
22
|
+
hasEmptyHint,
|
|
23
|
+
hasEmptySearchHint,
|
|
24
|
+
}), [
|
|
25
|
+
maxSelectedOptions,
|
|
26
|
+
multiple,
|
|
27
|
+
name,
|
|
28
|
+
loading,
|
|
29
|
+
hasExternalError,
|
|
30
|
+
hasProviderError,
|
|
31
|
+
hasEmptyHint,
|
|
32
|
+
hasEmptySearchHint,
|
|
33
|
+
]);
|
|
34
|
+
// свойства-обьекты ошибок (используются в компонентах ошибок/bs)
|
|
35
|
+
const errorValue = useMemo(() => ({
|
|
36
|
+
error,
|
|
37
|
+
providerError,
|
|
38
|
+
}),
|
|
39
|
+
// providerError добавляем как перечисление свойств, а не весь обьект
|
|
40
|
+
// eslint-disable-next-line disable-autofix/react-hooks/exhaustive-deps
|
|
41
|
+
[error, providerError?.title, providerError?.description, providerError?.reloadButton]);
|
|
42
|
+
// свойства-обьекты подсказок (используются в компонентах подсказок)
|
|
43
|
+
const hintValue = useMemo(() => ({
|
|
44
|
+
emptyHint,
|
|
45
|
+
emptySearchHint,
|
|
46
|
+
}), [emptyHint, emptySearchHint]);
|
|
47
|
+
return (jsx(ConfigContext.Provider, { value: configValue, children: jsx(ErrorContext.Provider, { value: errorValue, children: jsx(HintContext.Provider, { value: hintValue, children: children }) }) }));
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export { ConfigContext, ConfigProvider, ErrorContext, HintContext };
|
|
51
|
+
//# sourceMappingURL=ConfigContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigContext.js","sources":["src/internal/ConfigContext.tsx"],"sourcesContent":["import { createContext, useMemo, type ReactElement, PropsWithChildren, ReactNode } from 'react';\n\nimport { ErrorState, ProviderErrorState } from '@hh.ru/magritte-ui-select/types';\n\ninterface ConfigContextBaseProps {\n maxSelectedOptions?: number;\n multiple?: boolean;\n name?: string;\n loading?: boolean;\n}\n\nexport interface ConfigContextProps extends ConfigContextBaseProps {\n hasExternalError: boolean;\n hasProviderError: boolean;\n hasEmptyHint: boolean;\n hasEmptySearchHint: boolean;\n}\n\nexport interface ErrorContextProps {\n error?: ErrorState;\n providerError?: ProviderErrorState;\n}\n\nexport interface HintContextProps {\n emptyHint?: ReactNode;\n emptySearchHint?: ReactNode;\n}\n\nexport const ConfigContext = createContext<ConfigContextProps | null>(null);\n\nexport const ErrorContext = createContext<ErrorContextProps | null>(null);\n\nexport const HintContext = createContext<HintContextProps | null>(null);\n\n// провайдер внешних/глобальных свойств select\nexport const ConfigProvider = ({\n children,\n maxSelectedOptions,\n multiple,\n name,\n loading,\n error,\n providerError,\n emptyHint,\n emptySearchHint,\n}: ConfigContextBaseProps & ErrorContextProps & HintContextProps & PropsWithChildren): ReactElement => {\n // свойства-примитивы\n const hasExternalError = Boolean(error);\n const hasProviderError = Boolean(providerError);\n const hasEmptyHint = Boolean(emptyHint);\n const hasEmptySearchHint = Boolean(emptySearchHint);\n const configValue = useMemo<ConfigContextProps>(\n () => ({\n maxSelectedOptions,\n multiple,\n name,\n loading,\n hasExternalError,\n hasProviderError,\n hasEmptyHint,\n hasEmptySearchHint,\n }),\n [\n maxSelectedOptions,\n multiple,\n name,\n loading,\n hasExternalError,\n hasProviderError,\n hasEmptyHint,\n hasEmptySearchHint,\n ]\n );\n\n // свойства-обьекты ошибок (используются в компонентах ошибок/bs)\n const errorValue = useMemo<ErrorContextProps>(\n () => ({\n error,\n providerError,\n }),\n // providerError добавляем как перечисление свойств, а не весь обьект\n // eslint-disable-next-line disable-autofix/react-hooks/exhaustive-deps\n [error, providerError?.title, providerError?.description, providerError?.reloadButton]\n );\n\n // свойства-обьекты подсказок (используются в компонентах подсказок)\n const hintValue = useMemo<HintContextProps>(\n () => ({\n emptyHint,\n emptySearchHint,\n }),\n [emptyHint, emptySearchHint]\n );\n\n return (\n <ConfigContext.Provider value={configValue}>\n <ErrorContext.Provider value={errorValue}>\n <HintContext.Provider value={hintValue}>{children}</HintContext.Provider>\n </ErrorContext.Provider>\n </ConfigContext.Provider>\n );\n};\n"],"names":["_jsx"],"mappings":";;;MA4Ba,aAAa,GAAG,aAAa,CAA4B,IAAI,EAAE;MAE/D,YAAY,GAAG,aAAa,CAA2B,IAAI,EAAE;MAE7D,WAAW,GAAG,aAAa,CAA0B,IAAI,EAAE;AAExE;AACa,MAAA,cAAc,GAAG,CAAC,EAC3B,QAAQ,EACR,kBAAkB,EAClB,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,KAAK,EACL,aAAa,EACb,SAAS,EACT,eAAe,GACiE,KAAkB;;AAElG,IAAA,MAAM,gBAAgB,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AACxC,IAAA,MAAM,gBAAgB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AAChD,IAAA,MAAM,YAAY,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AACxC,IAAA,MAAM,kBAAkB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AACpD,IAAA,MAAM,WAAW,GAAG,OAAO,CACvB,OAAO;QACH,kBAAkB;QAClB,QAAQ;QACR,IAAI;QACJ,OAAO;QACP,gBAAgB;QAChB,gBAAgB;QAChB,YAAY;QACZ,kBAAkB;AACrB,KAAA,CAAC,EACF;QACI,kBAAkB;QAClB,QAAQ;QACR,IAAI;QACJ,OAAO;QACP,gBAAgB;QAChB,gBAAgB;QAChB,YAAY;QACZ,kBAAkB;AACrB,KAAA,CACJ,CAAC;;AAGF,IAAA,MAAM,UAAU,GAAG,OAAO,CACtB,OAAO;QACH,KAAK;QACL,aAAa;KAChB,CAAC;;;AAGF,IAAA,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,CAAC,CACzF,CAAC;;AAGF,IAAA,MAAM,SAAS,GAAG,OAAO,CACrB,OAAO;QACH,SAAS;QACT,eAAe;AAClB,KAAA,CAAC,EACF,CAAC,SAAS,EAAE,eAAe,CAAC,CAC/B,CAAC;AAEF,IAAA,QACIA,GAAA,CAAC,aAAa,CAAC,QAAQ,EAAC,EAAA,KAAK,EAAE,WAAW,EACtC,QAAA,EAAAA,GAAA,CAAC,YAAY,CAAC,QAAQ,EAAC,EAAA,KAAK,EAAE,UAAU,EACpC,QAAA,EAAAA,GAAA,CAAC,WAAW,CAAC,QAAQ,EAAC,EAAA,KAAK,EAAE,SAAS,YAAG,QAAQ,EAAA,CAAwB,EACrD,CAAA,EAAA,CACH,EAC3B;AACN;;;;"}
|