@measured/puck 0.14.0-canary.22a4182 → 0.14.0-canary.35090d4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{Config-1444273f.d.ts → Config-ab049d49.d.ts} +4 -0
- package/dist/index.css +170 -114
- package/dist/index.d.ts +2 -2
- package/dist/index.js +144 -83
- package/dist/rsc.d.ts +1 -1
- package/package.json +1 -1
@@ -91,11 +91,15 @@ type ExternalField<Props extends {
|
|
91
91
|
placeholder?: string;
|
92
92
|
fetchList: (params: {
|
93
93
|
query: string;
|
94
|
+
filters: Record<string, any>;
|
94
95
|
}) => Promise<any[] | null>;
|
95
96
|
mapProp?: (value: any) => Props;
|
97
|
+
mapRow?: (value: any) => Record<string, string | number>;
|
96
98
|
getItemSummary: (item: Props, index?: number) => string;
|
97
99
|
showSearch?: boolean;
|
98
100
|
initialQuery?: string;
|
101
|
+
filterFields?: Record<string, Field>;
|
102
|
+
initialFilters?: Record<string, any>;
|
99
103
|
};
|
100
104
|
type CustomField<Props extends {
|
101
105
|
[key: string]: any;
|
package/dist/index.css
CHANGED
@@ -137,7 +137,7 @@
|
|
137
137
|
/* styles.css */
|
138
138
|
|
139
139
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/Button/Button.module.css/#css-module-data */
|
140
|
-
.
|
140
|
+
._Button_8fn3a_1 {
|
141
141
|
appearance: none;
|
142
142
|
background: none;
|
143
143
|
border: 1px solid transparent;
|
@@ -159,65 +159,69 @@
|
|
159
159
|
white-space: nowrap;
|
160
160
|
margin: 0;
|
161
161
|
}
|
162
|
-
.
|
163
|
-
.
|
162
|
+
._Button_8fn3a_1:hover,
|
163
|
+
._Button_8fn3a_1:active {
|
164
164
|
transition: none;
|
165
165
|
}
|
166
|
-
._Button--
|
166
|
+
._Button--medium_8fn3a_29 {
|
167
167
|
min-height: 34px;
|
168
168
|
padding-bottom: 7px;
|
169
169
|
padding-left: 19px;
|
170
170
|
padding-right: 19px;
|
171
171
|
padding-top: 7px;
|
172
172
|
}
|
173
|
-
._Button--
|
173
|
+
._Button--large_8fn3a_37 {
|
174
174
|
padding-bottom: 11px;
|
175
175
|
padding-left: 19px;
|
176
176
|
padding-right: 19px;
|
177
177
|
padding-top: 11px;
|
178
178
|
}
|
179
|
-
._Button-
|
179
|
+
._Button-icon_8fn3a_44 {
|
180
180
|
margin-top: 2px;
|
181
181
|
}
|
182
|
-
._Button--
|
182
|
+
._Button--primary_8fn3a_48 {
|
183
183
|
background: var(--puck-color-azure-04);
|
184
184
|
}
|
185
|
-
.
|
185
|
+
._Button_8fn3a_1:focus-visible {
|
186
186
|
outline: 2px solid var(--puck-color-azure-05);
|
187
187
|
outline-offset: 2px;
|
188
188
|
}
|
189
189
|
@media (hover: hover) and (pointer: fine) {
|
190
|
-
._Button--
|
190
|
+
._Button--primary_8fn3a_48:hover {
|
191
191
|
background-color: var(--puck-color-azure-03);
|
192
192
|
}
|
193
193
|
}
|
194
|
-
._Button--
|
194
|
+
._Button--primary_8fn3a_48:active {
|
195
195
|
background-color: var(--puck-color-azure-02);
|
196
196
|
}
|
197
|
-
._Button--
|
197
|
+
._Button--secondary_8fn3a_67 {
|
198
198
|
border: 1px solid var(--puck-color-grey-01);
|
199
199
|
color: var(--puck-color-black);
|
200
200
|
}
|
201
201
|
@media (hover: hover) and (pointer: fine) {
|
202
|
-
._Button--
|
202
|
+
._Button--secondary_8fn3a_67:hover {
|
203
203
|
background-color: var(--puck-color-azure-12);
|
204
204
|
}
|
205
205
|
}
|
206
|
-
._Button--
|
206
|
+
._Button--secondary_8fn3a_67:active {
|
207
207
|
background-color: var(--puck-color-azure-11);
|
208
208
|
}
|
209
|
-
._Button--
|
209
|
+
._Button--flush_8fn3a_82 {
|
210
210
|
border-radius: 0;
|
211
211
|
}
|
212
|
-
._Button--
|
213
|
-
._Button--
|
212
|
+
._Button--disabled_8fn3a_86,
|
213
|
+
._Button--disabled_8fn3a_86:hover {
|
214
214
|
background-color: var(--puck-color-grey-07);
|
215
215
|
color: var(--puck-color-grey-03);
|
216
216
|
cursor: not-allowed;
|
217
217
|
}
|
218
|
-
._Button--
|
218
|
+
._Button--fullWidth_8fn3a_93 {
|
219
|
+
justify-content: center;
|
219
220
|
width: 100%;
|
220
221
|
}
|
222
|
+
._Button-spinner_8fn3a_98 {
|
223
|
+
padding-left: 8px;
|
224
|
+
}
|
221
225
|
|
222
226
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/Drawer/styles.module.css/#css-module-data */
|
223
227
|
._Drawer_6zh0b_1 {
|
@@ -826,43 +830,44 @@
|
|
826
830
|
}
|
827
831
|
|
828
832
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/InputOrGroup/styles.module.css/#css-module-data */
|
829
|
-
.
|
833
|
+
._Input_1qi5b_1 {
|
830
834
|
color: var(--puck-color-grey-04);
|
831
835
|
padding: 16px;
|
832
836
|
padding-bottom: 12px;
|
833
837
|
display: block;
|
834
838
|
}
|
835
|
-
.
|
839
|
+
._Input_1qi5b_1 ._Input_1qi5b_1 {
|
836
840
|
padding: 0px;
|
837
841
|
}
|
838
|
-
.
|
842
|
+
._Input_1qi5b_1 * {
|
839
843
|
box-sizing: border-box;
|
840
844
|
}
|
841
|
-
.
|
845
|
+
._Input_1qi5b_1 + ._Input_1qi5b_1 {
|
842
846
|
border-top: 1px solid var(--puck-color-grey-09);
|
843
847
|
margin-top: 8px;
|
844
848
|
}
|
845
|
-
.
|
849
|
+
._Input_1qi5b_1 ._Input_1qi5b_1 + ._Input_1qi5b_1 {
|
846
850
|
border-top: 0px;
|
847
851
|
margin-top: 12px;
|
848
852
|
}
|
849
|
-
._Input-
|
853
|
+
._Input-label_1qi5b_26 {
|
850
854
|
align-items: center;
|
851
855
|
display: flex;
|
852
856
|
padding-bottom: 12px;
|
853
857
|
font-size: var(--puck-font-size-xxs);
|
854
858
|
font-weight: 600;
|
855
859
|
}
|
856
|
-
._Input-
|
860
|
+
._Input-labelIcon_1qi5b_34 {
|
857
861
|
color: var(--puck-color-grey-07);
|
862
|
+
display: flex;
|
858
863
|
margin-right: 4px;
|
859
864
|
padding-left: 4px;
|
860
865
|
}
|
861
|
-
._Input-
|
866
|
+
._Input-disabledIcon_1qi5b_41 {
|
862
867
|
color: var(--puck-color-grey-05);
|
863
868
|
margin-left: auto;
|
864
869
|
}
|
865
|
-
._Input-
|
870
|
+
._Input-input_1qi5b_46 {
|
866
871
|
background: var(--puck-color-white);
|
867
872
|
border-width: 1px;
|
868
873
|
border-style: solid;
|
@@ -874,7 +879,7 @@
|
|
874
879
|
transition: border-color 50ms ease-in;
|
875
880
|
width: 100%;
|
876
881
|
}
|
877
|
-
select._Input-
|
882
|
+
select._Input-input_1qi5b_46 {
|
878
883
|
appearance: none;
|
879
884
|
background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23c3c3c3'><polygon points='0,0 100,0 50,50'/></svg>") no-repeat;
|
880
885
|
background-size: 12px;
|
@@ -884,25 +889,25 @@ select._Input-input_3msty_45 {
|
|
884
889
|
cursor: pointer;
|
885
890
|
}
|
886
891
|
@media (hover: hover) and (pointer: fine) {
|
887
|
-
.
|
888
|
-
.
|
892
|
+
._Input_1qi5b_1:has(> input):hover ._Input-input_1qi5b_46:not([readonly]),
|
893
|
+
._Input_1qi5b_1:has(> textarea):hover ._Input-input_1qi5b_46:not([readonly]) {
|
889
894
|
border-color: var(--puck-color-grey-05);
|
890
895
|
transition: none;
|
891
896
|
}
|
892
|
-
.
|
897
|
+
._Input_1qi5b_1:has(> select):hover ._Input-input_1qi5b_46:not([disabled]) {
|
893
898
|
background-color: var(--puck-color-azure-12);
|
894
899
|
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%235a5a5a'><polygon points='0,0 100,0 50,50'/></svg>");
|
895
900
|
border-color: var(--puck-color-grey-05);
|
896
901
|
transition: none;
|
897
902
|
}
|
898
903
|
}
|
899
|
-
._Input-
|
904
|
+
._Input-input_1qi5b_46:focus {
|
900
905
|
border-color: var(--puck-color-grey-05);
|
901
906
|
outline: 2px solid var(--puck-color-azure-05);
|
902
907
|
transition: none;
|
903
908
|
}
|
904
|
-
._Input--
|
905
|
-
._Input--
|
909
|
+
._Input--readOnly_1qi5b_90 > ._Input-input_1qi5b_46,
|
910
|
+
._Input--readOnly_1qi5b_90 > select._Input-input_1qi5b_46 {
|
906
911
|
background-color: var(--puck-color-grey-11);
|
907
912
|
border-color: var(--puck-color-grey-09);
|
908
913
|
color: var(--puck-color-grey-04);
|
@@ -911,34 +916,34 @@ select._Input-input_3msty_45 {
|
|
911
916
|
outline: 0;
|
912
917
|
transition: none;
|
913
918
|
}
|
914
|
-
._Input-
|
919
|
+
._Input-radioGroupItems_1qi5b_101 {
|
915
920
|
display: flex;
|
916
921
|
border: 1px solid var(--puck-color-grey-09);
|
917
922
|
border-radius: 4px;
|
918
923
|
flex-wrap: wrap;
|
919
924
|
}
|
920
|
-
._Input-
|
925
|
+
._Input-radio_1qi5b_101 {
|
921
926
|
border-right: 1px solid var(--puck-color-grey-09);
|
922
927
|
flex-grow: 1;
|
923
928
|
}
|
924
|
-
._Input-
|
929
|
+
._Input-radio_1qi5b_101:first-of-type {
|
925
930
|
border-bottom-left-radius: 4px;
|
926
931
|
border-top-left-radius: 4px;
|
927
932
|
}
|
928
|
-
._Input-
|
933
|
+
._Input-radio_1qi5b_101:first-of-type ._Input-radioInner_1qi5b_118 {
|
929
934
|
border-bottom-left-radius: 3px;
|
930
935
|
border-top-left-radius: 3px;
|
931
936
|
}
|
932
|
-
._Input-
|
937
|
+
._Input-radio_1qi5b_101:last-of-type {
|
933
938
|
border-bottom-right-radius: 4px;
|
934
939
|
border-right: 0;
|
935
940
|
border-top-right-radius: 4px;
|
936
941
|
}
|
937
|
-
._Input-
|
942
|
+
._Input-radio_1qi5b_101:last-of-type ._Input-radioInner_1qi5b_118 {
|
938
943
|
border-bottom-right-radius: 3px;
|
939
944
|
border-top-right-radius: 3px;
|
940
945
|
}
|
941
|
-
._Input-
|
946
|
+
._Input-radioInner_1qi5b_118 {
|
942
947
|
background-color: var(--puck-color-white);
|
943
948
|
color: var(--puck-color-grey-04);
|
944
949
|
cursor: pointer;
|
@@ -947,32 +952,32 @@ select._Input-input_3msty_45 {
|
|
947
952
|
text-align: center;
|
948
953
|
transition: background-color 50ms ease-in;
|
949
954
|
}
|
950
|
-
._Input-
|
955
|
+
._Input-radio_1qi5b_101:has(:focus-visible) {
|
951
956
|
outline: 2px solid var(--puck-color-azure-05);
|
952
957
|
outline-offset: 2px;
|
953
958
|
position: relative;
|
954
959
|
}
|
955
960
|
@media (hover: hover) and (pointer: fine) {
|
956
|
-
._Input-
|
961
|
+
._Input-radioInner_1qi5b_118:hover {
|
957
962
|
background-color: var(--puck-color-azure-12);
|
958
963
|
transition: none;
|
959
964
|
}
|
960
965
|
}
|
961
|
-
._Input--
|
966
|
+
._Input--readOnly_1qi5b_90 ._Input-radioInner_1qi5b_118 {
|
962
967
|
background-color: var(--puck-color-white);
|
963
968
|
color: var(--puck-color-grey-04);
|
964
969
|
cursor: default;
|
965
970
|
}
|
966
|
-
._Input-
|
971
|
+
._Input-radio_1qi5b_101 ._Input-radioInput_1qi5b_163:checked ~ ._Input-radioInner_1qi5b_118 {
|
967
972
|
background-color: var(--puck-color-azure-11);
|
968
973
|
color: var(--puck-color-azure-04);
|
969
974
|
font-weight: 500;
|
970
975
|
}
|
971
|
-
._Input--
|
976
|
+
._Input--readOnly_1qi5b_90 ._Input-radioInput_1qi5b_163:checked ~ ._Input-radioInner_1qi5b_118 {
|
972
977
|
background-color: var(--puck-color-grey-11);
|
973
978
|
color: var(--puck-color-grey-04);
|
974
979
|
}
|
975
|
-
._Input-
|
980
|
+
._Input-radio_1qi5b_101 ._Input-radioInput_1qi5b_163 {
|
976
981
|
clip: rect(0 0 0 0);
|
977
982
|
clip-path: inset(100%);
|
978
983
|
height: 1px;
|
@@ -981,7 +986,7 @@ select._Input-input_3msty_45 {
|
|
981
986
|
white-space: nowrap;
|
982
987
|
width: 1px;
|
983
988
|
}
|
984
|
-
textarea._Input-
|
989
|
+
textarea._Input-input_1qi5b_46 {
|
985
990
|
margin-bottom: -4px;
|
986
991
|
}
|
987
992
|
|
@@ -1128,10 +1133,10 @@ textarea._Input-input_3msty_45 {
|
|
1128
1133
|
}
|
1129
1134
|
|
1130
1135
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/ExternalInput/styles.module.css/#css-module-data */
|
1131
|
-
._ExternalInput-
|
1136
|
+
._ExternalInput-actions_q3l5a_1 {
|
1132
1137
|
display: flex;
|
1133
1138
|
}
|
1134
|
-
._ExternalInput-
|
1139
|
+
._ExternalInput-button_q3l5a_5 {
|
1135
1140
|
display: flex;
|
1136
1141
|
gap: 8px;
|
1137
1142
|
align-items: center;
|
@@ -1150,13 +1155,13 @@ textarea._Input-input_3msty_45 {
|
|
1150
1155
|
overflow: hidden;
|
1151
1156
|
flex-grow: 1;
|
1152
1157
|
}
|
1153
|
-
._ExternalInput--
|
1158
|
+
._ExternalInput--dataSelected_q3l5a_25 ._ExternalInput-button_q3l5a_5 {
|
1154
1159
|
color: var(--puck-color-grey-03);
|
1155
1160
|
display: block;
|
1156
1161
|
border-top-right-radius: 0px;
|
1157
1162
|
border-bottom-right-radius: 0px;
|
1158
1163
|
}
|
1159
|
-
._ExternalInput-
|
1164
|
+
._ExternalInput-detachButton_q3l5a_32 {
|
1160
1165
|
border: 1px solid var(--puck-color-grey-09);
|
1161
1166
|
border-top-right-radius: 4px;
|
1162
1167
|
border-bottom-right-radius: 4px;
|
@@ -1172,48 +1177,79 @@ textarea._Input-input_3msty_45 {
|
|
1172
1177
|
transition: background-color 50ms ease-in, color 50ms ease-in;
|
1173
1178
|
margin-left: -1px;
|
1174
1179
|
}
|
1175
|
-
._ExternalInput-
|
1176
|
-
._ExternalInput-
|
1180
|
+
._ExternalInput-button_q3l5a_5:focus-visible,
|
1181
|
+
._ExternalInput-detachButton_q3l5a_32:focus-visible {
|
1177
1182
|
outline: 2px solid var(--puck-color-azure-05);
|
1178
1183
|
outline-offset: 2px;
|
1179
1184
|
z-index: 1;
|
1180
1185
|
}
|
1181
1186
|
@media (hover: hover) and (pointer: fine) {
|
1182
|
-
._ExternalInput-
|
1183
|
-
._ExternalInput-
|
1187
|
+
._ExternalInput-button_q3l5a_5:hover,
|
1188
|
+
._ExternalInput-detachButton_q3l5a_32:hover {
|
1184
1189
|
background: var(--puck-color-azure-12);
|
1185
1190
|
transition: none;
|
1186
1191
|
}
|
1187
|
-
._ExternalInput-
|
1192
|
+
._ExternalInput-detachButton_q3l5a_32:hover {
|
1188
1193
|
color: var(--puck-color-azure-04);
|
1189
1194
|
}
|
1190
1195
|
}
|
1191
|
-
._ExternalInput-
|
1192
|
-
._ExternalInput-
|
1196
|
+
._ExternalInput-button_q3l5a_5:active,
|
1197
|
+
._ExternalInput-detachButton_q3l5a_32:active {
|
1193
1198
|
background: var(--puck-color-azure-11);
|
1194
1199
|
transition: none;
|
1195
1200
|
}
|
1196
|
-
.
|
1201
|
+
._ExternalInputModal_q3l5a_74 {
|
1197
1202
|
color: var(--puck-color-black);
|
1198
|
-
display:
|
1199
|
-
|
1203
|
+
display: grid;
|
1204
|
+
grid-template-rows: min-content minmax(128px, 100%) min-content;
|
1205
|
+
grid-template-columns: 100%;
|
1200
1206
|
position: relative;
|
1207
|
+
min-height: 50vh;
|
1201
1208
|
max-height: 90vh;
|
1202
1209
|
}
|
1203
|
-
._ExternalInputModal-
|
1204
|
-
|
1210
|
+
._ExternalInputModal-grid_q3l5a_84 {
|
1211
|
+
display: flex;
|
1212
|
+
flex-direction: column;
|
1213
|
+
}
|
1214
|
+
@media (min-width: 458px) {
|
1215
|
+
._ExternalInputModal-grid_q3l5a_84 {
|
1216
|
+
display: grid;
|
1217
|
+
grid-template-columns: 100%;
|
1218
|
+
}
|
1219
|
+
._ExternalInputModal--filtersToggled_q3l5a_95 ._ExternalInputModal-grid_q3l5a_84 {
|
1220
|
+
grid-template-columns: 25% 75%;
|
1221
|
+
}
|
1222
|
+
}
|
1223
|
+
._ExternalInputModal-filters_q3l5a_100 {
|
1224
|
+
border-bottom: 1px solid var(--puck-color-grey-09);
|
1225
|
+
}
|
1226
|
+
._ExternalInputModal--filtersToggled_q3l5a_95 ._ExternalInputModal-filters_q3l5a_100 {
|
1227
|
+
display: none;
|
1228
|
+
}
|
1229
|
+
@media (min-width: 458px) {
|
1230
|
+
._ExternalInputModal-filters_q3l5a_100 {
|
1231
|
+
border-right: 1px solid var(--puck-color-grey-09);
|
1232
|
+
display: none;
|
1233
|
+
}
|
1234
|
+
._ExternalInputModal--filtersToggled_q3l5a_95 ._ExternalInputModal-filters_q3l5a_100 {
|
1235
|
+
display: block;
|
1236
|
+
}
|
1237
|
+
}
|
1238
|
+
._ExternalInputModal-masthead_q3l5a_119 {
|
1239
|
+
background-color: var(--puck-color-grey-12);
|
1240
|
+
border-bottom: 1px solid var(--puck-color-grey-09);
|
1205
1241
|
display: flex;
|
1206
1242
|
flex-wrap: wrap;
|
1207
1243
|
gap: 24px;
|
1208
|
-
padding:
|
1244
|
+
padding: 24px;
|
1209
1245
|
}
|
1210
|
-
._ExternalInputModal-
|
1246
|
+
._ExternalInputModal-tableWrapper_q3l5a_128 {
|
1211
1247
|
position: relative;
|
1212
1248
|
overflow-x: auto;
|
1213
1249
|
overflow-y: auto;
|
1214
1250
|
flex-grow: 1;
|
1215
1251
|
}
|
1216
|
-
._ExternalInputModal-
|
1252
|
+
._ExternalInputModal-table_q3l5a_128 {
|
1217
1253
|
border-collapse: unset;
|
1218
1254
|
border-spacing: 0px;
|
1219
1255
|
color: var(--puck-color-grey-02);
|
@@ -1221,50 +1257,51 @@ textarea._Input-input_3msty_45 {
|
|
1221
1257
|
z-index: 0;
|
1222
1258
|
min-width: 100%;
|
1223
1259
|
}
|
1224
|
-
._ExternalInputModal-
|
1260
|
+
._ExternalInputModal-thead_q3l5a_144 {
|
1261
|
+
background-color: var(--puck-color-white);
|
1225
1262
|
position: sticky;
|
1226
1263
|
top: 0;
|
1227
1264
|
z-index: 1;
|
1228
1265
|
}
|
1229
|
-
._ExternalInputModal-
|
1266
|
+
._ExternalInputModal-th_q3l5a_144 {
|
1230
1267
|
border-bottom: 1px solid var(--puck-color-grey-09);
|
1231
|
-
|
1232
|
-
font-weight:
|
1268
|
+
color: var(--puck-color-grey-04);
|
1269
|
+
font-weight: 500;
|
1270
|
+
font-size: 14px;
|
1233
1271
|
padding: 16px 24px;
|
1234
|
-
opacity: 0.9;
|
1235
1272
|
}
|
1236
|
-
._ExternalInputModal-
|
1273
|
+
._ExternalInputModal-td_q3l5a_159 {
|
1274
|
+
border-bottom: 1px solid var(--puck-color-grey-10);
|
1237
1275
|
padding: 16px 24px;
|
1238
1276
|
}
|
1239
|
-
._ExternalInputModal-
|
1240
|
-
background-color: var(--puck-color-white);
|
1241
|
-
}
|
1242
|
-
._ExternalInputModal-tr_oqtaj_124:nth-of-type(2n) {
|
1243
|
-
background-color: var(--puck-color-grey-12);
|
1244
|
-
}
|
1245
|
-
._ExternalInputModal-tr_oqtaj_124 ._ExternalInputModal-td_oqtaj_120:first-of-type {
|
1277
|
+
._ExternalInputModal-tr_q3l5a_164 ._ExternalInputModal-td_q3l5a_159:first-of-type {
|
1246
1278
|
font-weight: 500;
|
1279
|
+
width: 1%;
|
1280
|
+
white-space: nowrap;
|
1247
1281
|
}
|
1248
1282
|
@media (hover: hover) and (pointer: fine) {
|
1249
|
-
._ExternalInputModal-
|
1250
|
-
background: var(--puck-color-
|
1283
|
+
._ExternalInputModal-tbody_q3l5a_171 ._ExternalInputModal-tr_q3l5a_164:hover {
|
1284
|
+
background: var(--puck-color-azure-12);
|
1251
1285
|
color: var(--puck-color-azure-04);
|
1252
1286
|
cursor: pointer;
|
1253
1287
|
position: relative;
|
1254
1288
|
margin-left: -5px;
|
1255
1289
|
}
|
1256
|
-
._ExternalInputModal-
|
1290
|
+
._ExternalInputModal-tbody_q3l5a_171 ._ExternalInputModal-tr_q3l5a_164:hover ._ExternalInputModal-td_q3l5a_159:first-of-type {
|
1257
1291
|
border-left: 4px solid var(--puck-color-azure-04);
|
1258
1292
|
padding-left: 20px;
|
1259
1293
|
}
|
1260
1294
|
}
|
1261
|
-
._ExternalInputModal-
|
1295
|
+
._ExternalInputModal-tbody_q3l5a_171 ._ExternalInputModal-tr_q3l5a_164:last-of-type ._ExternalInputModal-td_q3l5a_159 {
|
1296
|
+
border-bottom: none;
|
1297
|
+
}
|
1298
|
+
._ExternalInputModal-tableWrapper_q3l5a_128 {
|
1262
1299
|
display: none;
|
1263
1300
|
}
|
1264
|
-
._ExternalInputModal--
|
1301
|
+
._ExternalInputModal--hasData_q3l5a_197 ._ExternalInputModal-tableWrapper_q3l5a_128 {
|
1265
1302
|
display: block;
|
1266
1303
|
}
|
1267
|
-
._ExternalInputModal-
|
1304
|
+
._ExternalInputModal-loadingBanner_q3l5a_201 {
|
1268
1305
|
display: none;
|
1269
1306
|
background-color: color-mix(in srgb, var(--puck-color-white) 90%, transparent);
|
1270
1307
|
padding: 64px;
|
@@ -1276,46 +1313,42 @@ textarea._Input-input_3msty_45 {
|
|
1276
1313
|
right: 0;
|
1277
1314
|
bottom: 0;
|
1278
1315
|
}
|
1279
|
-
._ExternalInputModal--
|
1316
|
+
._ExternalInputModal--isLoading_q3l5a_218 ._ExternalInputModal-loadingBanner_q3l5a_201 {
|
1280
1317
|
display: flex;
|
1281
1318
|
}
|
1282
|
-
._ExternalInputModal-
|
1283
|
-
display: none;
|
1284
|
-
border-top: 1px solid var(--puck-color-grey-09);
|
1285
|
-
padding: 24px;
|
1286
|
-
text-align: center;
|
1287
|
-
}
|
1288
|
-
._ExternalInputModal--loaded_oqtaj_185:not(._ExternalInputModal--hasData_oqtaj_157) ._ExternalInputModal-noContentBanner_oqtaj_178 {
|
1289
|
-
display: block;
|
1290
|
-
}
|
1291
|
-
._ExternalInputModal-searchForm_oqtaj_190 {
|
1319
|
+
._ExternalInputModal-searchForm_q3l5a_222 {
|
1292
1320
|
display: flex;
|
1293
|
-
|
1294
|
-
height: 43px;
|
1321
|
+
flex-wrap: wrap;
|
1295
1322
|
gap: 12px;
|
1323
|
+
flex-grow: 1;
|
1296
1324
|
}
|
1297
|
-
|
1325
|
+
@media (min-width: 458px) {
|
1326
|
+
._ExternalInputModal-searchForm_q3l5a_222 {
|
1327
|
+
flex-wrap: nowrap;
|
1328
|
+
}
|
1329
|
+
}
|
1330
|
+
._ExternalInputModal-search_q3l5a_222 {
|
1298
1331
|
display: flex;
|
1299
1332
|
background: var(--puck-color-white);
|
1300
1333
|
border-width: 1px;
|
1301
1334
|
border-style: solid;
|
1302
1335
|
border-color: var(--puck-color-grey-09);
|
1303
1336
|
border-radius: 4px;
|
1337
|
+
flex-grow: 1;
|
1304
1338
|
transition: border-color 50ms ease-in;
|
1305
|
-
width: 100%;
|
1306
1339
|
}
|
1307
|
-
._ExternalInputModal-
|
1340
|
+
._ExternalInputModal-search_q3l5a_222:focus-within {
|
1308
1341
|
border-color: var(--puck-color-grey-05);
|
1309
1342
|
outline: 2px solid var(--puck-color-azure-05);
|
1310
1343
|
transition: none;
|
1311
1344
|
}
|
1312
1345
|
@media (hover: hover) and (pointer: fine) {
|
1313
|
-
._ExternalInputModal-
|
1346
|
+
._ExternalInputModal-search_q3l5a_222:hover {
|
1314
1347
|
border-color: var(--puck-color-grey-05);
|
1315
1348
|
transition: none;
|
1316
1349
|
}
|
1317
1350
|
}
|
1318
|
-
._ExternalInputModal-
|
1351
|
+
._ExternalInputModal-searchIcon_q3l5a_259 {
|
1319
1352
|
align-items: center;
|
1320
1353
|
background: var(--puck-color-grey-12);
|
1321
1354
|
border-bottom-left-radius: 4px;
|
@@ -1327,17 +1360,17 @@ textarea._Input-input_3msty_45 {
|
|
1327
1360
|
padding: 12px 15px;
|
1328
1361
|
transition: color 50ms ease-in;
|
1329
1362
|
}
|
1330
|
-
._ExternalInputModal-
|
1363
|
+
._ExternalInputModal-search_q3l5a_222:focus-within ._ExternalInputModal-searchIcon_q3l5a_259 {
|
1331
1364
|
color: var(--puck-color-grey-04);
|
1332
1365
|
transition: none;
|
1333
1366
|
}
|
1334
1367
|
@media (hover: hover) and (pointer: fine) {
|
1335
|
-
._ExternalInputModal-
|
1368
|
+
._ExternalInputModal-search_q3l5a_222:hover ._ExternalInputModal-searchIcon_q3l5a_259 {
|
1336
1369
|
color: var(--puck-color-grey-04);
|
1337
1370
|
transition: none;
|
1338
1371
|
}
|
1339
1372
|
}
|
1340
|
-
._ExternalInputModal-
|
1373
|
+
._ExternalInputModal-searchIconText_q3l5a_284 {
|
1341
1374
|
clip: rect(0 0 0 0);
|
1342
1375
|
clip-path: inset(100%);
|
1343
1376
|
height: 1px;
|
@@ -1346,7 +1379,7 @@ textarea._Input-input_3msty_45 {
|
|
1346
1379
|
white-space: nowrap;
|
1347
1380
|
width: 1px;
|
1348
1381
|
}
|
1349
|
-
._ExternalInputModal-
|
1382
|
+
._ExternalInputModal-searchInput_q3l5a_294 {
|
1350
1383
|
border: none;
|
1351
1384
|
border-radius: 4px;
|
1352
1385
|
background: var(--puck-color-white);
|
@@ -1355,13 +1388,36 @@ textarea._Input-input_3msty_45 {
|
|
1355
1388
|
padding: 12px 15px;
|
1356
1389
|
width: 100%;
|
1357
1390
|
}
|
1358
|
-
._ExternalInputModal-
|
1391
|
+
._ExternalInputModal-searchInput_q3l5a_294:focus {
|
1359
1392
|
outline: 0;
|
1360
1393
|
}
|
1394
|
+
._ExternalInputModal-searchActions_q3l5a_308 {
|
1395
|
+
display: flex;
|
1396
|
+
gap: 8px;
|
1397
|
+
height: 44px;
|
1398
|
+
width: 100%;
|
1399
|
+
}
|
1400
|
+
@media (min-width: 458px) {
|
1401
|
+
._ExternalInputModal-searchActions_q3l5a_308 {
|
1402
|
+
width: auto;
|
1403
|
+
}
|
1404
|
+
}
|
1405
|
+
._ExternalInputModal-searchActionIcon_q3l5a_321 {
|
1406
|
+
align-self: center;
|
1407
|
+
}
|
1408
|
+
._ExternalInputModal-footer_q3l5a_325 {
|
1409
|
+
background-color: var(--puck-color-grey-12);
|
1410
|
+
border-top: 1px solid var(--puck-color-grey-09);
|
1411
|
+
color: var(--puck-color-grey-04);
|
1412
|
+
font-weight: 500;
|
1413
|
+
font-size: 14px;
|
1414
|
+
padding: 16px;
|
1415
|
+
text-align: right;
|
1416
|
+
}
|
1361
1417
|
|
1362
1418
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/Modal/styles.module.css/#css-module-data */
|
1363
|
-
.
|
1364
|
-
background: color-mix(in srgb, var(--puck-color-black)
|
1419
|
+
._Modal_zud0i_1 {
|
1420
|
+
background: color-mix(in srgb, var(--puck-color-black) 75%, transparent);
|
1365
1421
|
display: none;
|
1366
1422
|
justify-content: center;
|
1367
1423
|
align-items: center;
|
@@ -1371,15 +1427,15 @@ textarea._Input-input_3msty_45 {
|
|
1371
1427
|
bottom: 0;
|
1372
1428
|
right: 0;
|
1373
1429
|
z-index: 1;
|
1374
|
-
padding:
|
1430
|
+
padding: 32px;
|
1375
1431
|
}
|
1376
|
-
._Modal--
|
1432
|
+
._Modal--isOpen_zud0i_15 {
|
1377
1433
|
display: flex;
|
1378
1434
|
}
|
1379
|
-
._Modal-
|
1435
|
+
._Modal-inner_zud0i_19 {
|
1380
1436
|
width: 100%;
|
1381
1437
|
max-width: 1024px;
|
1382
|
-
border-radius:
|
1438
|
+
border-radius: 8px;
|
1383
1439
|
overflow: hidden;
|
1384
1440
|
background: var(--puck-color-white);
|
1385
1441
|
display: flex;
|
package/dist/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { C as Config, D as Data, I as ItemSelector, U as UiState, A as AppState, F as Field, a as DefaultComponentProps, b as DefaultRootProps, M as MappedItem, R as RootDataWithProps, c as RootData } from './Config-
|
2
|
-
export { g as Adaptor, f as ArrayField, r as ArrayState, n as BaseData, B as BaseField, m as ComponentConfig, o as ComponentData, k as Content, i as CustomField, s as DropZone, h as ExternalField, E as ExternalFieldWithAdaptor, j as Fields, q as ItemWithId, N as NumberField, O as ObjectField, P as PuckComponent, l as PuckContext, e as RadioField, p as RootDataWithoutProps, S as SelectField, T as TextField, d as TextareaField } from './Config-
|
1
|
+
import { C as Config, D as Data, I as ItemSelector, U as UiState, A as AppState, F as Field, a as DefaultComponentProps, b as DefaultRootProps, M as MappedItem, R as RootDataWithProps, c as RootData } from './Config-ab049d49.js';
|
2
|
+
export { g as Adaptor, f as ArrayField, r as ArrayState, n as BaseData, B as BaseField, m as ComponentConfig, o as ComponentData, k as Content, i as CustomField, s as DropZone, h as ExternalField, E as ExternalFieldWithAdaptor, j as Fields, q as ItemWithId, N as NumberField, O as ObjectField, P as PuckComponent, l as PuckContext, e as RadioField, p as RootDataWithoutProps, S as SelectField, T as TextField, d as TextareaField } from './Config-ab049d49.js';
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
4
4
|
import * as react from 'react';
|
5
5
|
import { ReactNode, CSSProperties, ReactElement, SyntheticEvent } from 'react';
|
package/dist/index.js
CHANGED
@@ -8084,7 +8084,7 @@ var require_react_dom_development = __commonJS({
|
|
8084
8084
|
var HostPortal = 4;
|
8085
8085
|
var HostComponent = 5;
|
8086
8086
|
var HostText = 6;
|
8087
|
-
var
|
8087
|
+
var Fragment13 = 7;
|
8088
8088
|
var Mode = 8;
|
8089
8089
|
var ContextConsumer = 9;
|
8090
8090
|
var ContextProvider = 10;
|
@@ -9240,7 +9240,7 @@ var require_react_dom_development = __commonJS({
|
|
9240
9240
|
return "DehydratedFragment";
|
9241
9241
|
case ForwardRef:
|
9242
9242
|
return getWrappedName$1(type, type.render, "ForwardRef");
|
9243
|
-
case
|
9243
|
+
case Fragment13:
|
9244
9244
|
return "Fragment";
|
9245
9245
|
case HostComponent:
|
9246
9246
|
return type;
|
@@ -18911,7 +18911,7 @@ var require_react_dom_development = __commonJS({
|
|
18911
18911
|
}
|
18912
18912
|
}
|
18913
18913
|
function updateFragment2(returnFiber, current2, fragment, lanes, key) {
|
18914
|
-
if (current2 === null || current2.tag !==
|
18914
|
+
if (current2 === null || current2.tag !== Fragment13) {
|
18915
18915
|
var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key);
|
18916
18916
|
created.return = returnFiber;
|
18917
18917
|
return created;
|
@@ -19314,7 +19314,7 @@ var require_react_dom_development = __commonJS({
|
|
19314
19314
|
if (child.key === key) {
|
19315
19315
|
var elementType = element.type;
|
19316
19316
|
if (elementType === REACT_FRAGMENT_TYPE) {
|
19317
|
-
if (child.tag ===
|
19317
|
+
if (child.tag === Fragment13) {
|
19318
19318
|
deleteRemainingChildren(returnFiber, child.sibling);
|
19319
19319
|
var existing = useFiber(child, element.props.children);
|
19320
19320
|
existing.return = returnFiber;
|
@@ -23489,7 +23489,7 @@ var require_react_dom_development = __commonJS({
|
|
23489
23489
|
var _resolvedProps2 = workInProgress2.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);
|
23490
23490
|
return updateForwardRef(current2, workInProgress2, type, _resolvedProps2, renderLanes2);
|
23491
23491
|
}
|
23492
|
-
case
|
23492
|
+
case Fragment13:
|
23493
23493
|
return updateFragment(current2, workInProgress2, renderLanes2);
|
23494
23494
|
case Mode:
|
23495
23495
|
return updateMode(current2, workInProgress2, renderLanes2);
|
@@ -23762,7 +23762,7 @@ var require_react_dom_development = __commonJS({
|
|
23762
23762
|
case SimpleMemoComponent:
|
23763
23763
|
case FunctionComponent:
|
23764
23764
|
case ForwardRef:
|
23765
|
-
case
|
23765
|
+
case Fragment13:
|
23766
23766
|
case Mode:
|
23767
23767
|
case Profiler:
|
23768
23768
|
case ContextConsumer:
|
@@ -28021,7 +28021,7 @@ var require_react_dom_development = __commonJS({
|
|
28021
28021
|
return fiber;
|
28022
28022
|
}
|
28023
28023
|
function createFiberFromFragment(elements, mode, lanes, key) {
|
28024
|
-
var fiber = createFiber(
|
28024
|
+
var fiber = createFiber(Fragment13, elements, key, mode);
|
28025
28025
|
fiber.lanes = lanes;
|
28026
28026
|
return fiber;
|
28027
28027
|
}
|
@@ -29173,7 +29173,7 @@ var import_react2 = require("react");
|
|
29173
29173
|
|
29174
29174
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Button/Button.module.css#css-module
|
29175
29175
|
init_react_import();
|
29176
|
-
var Button_module_default = { "Button": "
|
29176
|
+
var Button_module_default = { "Button": "_Button_8fn3a_1", "Button--medium": "_Button--medium_8fn3a_29", "Button--large": "_Button--large_8fn3a_37", "Button-icon": "_Button-icon_8fn3a_44", "Button--primary": "_Button--primary_8fn3a_48", "Button--secondary": "_Button--secondary_8fn3a_67", "Button--flush": "_Button--flush_8fn3a_82", "Button--disabled": "_Button--disabled_8fn3a_86", "Button--fullWidth": "_Button--fullWidth_8fn3a_93", "Button-spinner": "_Button-spinner_8fn3a_98" };
|
29177
29177
|
|
29178
29178
|
// lib/get-class-name-factory.ts
|
29179
29179
|
init_react_import();
|
@@ -29255,10 +29255,7 @@ var Button = ({
|
|
29255
29255
|
children: [
|
29256
29256
|
icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: getClassName("icon"), children: icon }),
|
29257
29257
|
children,
|
29258
|
-
loading && /* @__PURE__ */ (0, import_jsx_runtime.
|
29259
|
-
"\xA0\xA0",
|
29260
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_spinners.ClipLoader, { "aria-label": "loading", color: "inherit", size: "14px" })
|
29261
|
-
] })
|
29258
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: getClassName("spinner"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_spinners.ClipLoader, { "aria-label": "loading", color: "inherit", size: "14px" }) })
|
29262
29259
|
]
|
29263
29260
|
}
|
29264
29261
|
);
|
@@ -29618,6 +29615,20 @@ var Search = createLucideIcon("Search", [
|
|
29618
29615
|
["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
|
29619
29616
|
]);
|
29620
29617
|
|
29618
|
+
// ../../node_modules/lucide-react/dist/esm/icons/sliders-horizontal.js
|
29619
|
+
init_react_import();
|
29620
|
+
var SlidersHorizontal = createLucideIcon("SlidersHorizontal", [
|
29621
|
+
["line", { x1: "21", x2: "14", y1: "4", y2: "4", key: "obuewd" }],
|
29622
|
+
["line", { x1: "10", x2: "3", y1: "4", y2: "4", key: "1q6298" }],
|
29623
|
+
["line", { x1: "21", x2: "12", y1: "12", y2: "12", key: "1iu8h1" }],
|
29624
|
+
["line", { x1: "8", x2: "3", y1: "12", y2: "12", key: "ntss68" }],
|
29625
|
+
["line", { x1: "21", x2: "16", y1: "20", y2: "20", key: "14d8ph" }],
|
29626
|
+
["line", { x1: "12", x2: "3", y1: "20", y2: "20", key: "m0wm8r" }],
|
29627
|
+
["line", { x1: "14", x2: "14", y1: "2", y2: "6", key: "14e1ph" }],
|
29628
|
+
["line", { x1: "8", x2: "8", y1: "10", y2: "14", key: "1i6ji0" }],
|
29629
|
+
["line", { x1: "16", x2: "16", y1: "18", y2: "22", key: "1lctlv" }]
|
29630
|
+
]);
|
29631
|
+
|
29621
29632
|
// ../../node_modules/lucide-react/dist/esm/icons/trash.js
|
29622
29633
|
init_react_import();
|
29623
29634
|
var Trash = createLucideIcon("Trash", [
|
@@ -31151,7 +31162,7 @@ init_react_import();
|
|
31151
31162
|
|
31152
31163
|
// css-module:/home/runner/work/puck/puck/packages/core/components/InputOrGroup/styles.module.css#css-module
|
31153
31164
|
init_react_import();
|
31154
|
-
var styles_module_default9 = { "Input": "
|
31165
|
+
var styles_module_default9 = { "Input": "_Input_1qi5b_1", "Input-label": "_Input-label_1qi5b_26", "Input-labelIcon": "_Input-labelIcon_1qi5b_34", "Input-disabledIcon": "_Input-disabledIcon_1qi5b_41", "Input-input": "_Input-input_1qi5b_46", "Input--readOnly": "_Input--readOnly_1qi5b_90", "Input-radioGroupItems": "_Input-radioGroupItems_1qi5b_101", "Input-radio": "_Input-radio_1qi5b_101", "Input-radioInner": "_Input-radioInner_1qi5b_118", "Input-radioInput": "_Input-radioInput_1qi5b_163" };
|
31155
31166
|
|
31156
31167
|
// components/InputOrGroup/index.tsx
|
31157
31168
|
var import_react18 = require("react");
|
@@ -31476,7 +31487,7 @@ var import_react16 = require("react");
|
|
31476
31487
|
|
31477
31488
|
// css-module:/home/runner/work/puck/puck/packages/core/components/ExternalInput/styles.module.css#css-module
|
31478
31489
|
init_react_import();
|
31479
|
-
var styles_module_default11 = { "ExternalInput-actions": "_ExternalInput-
|
31490
|
+
var styles_module_default11 = { "ExternalInput-actions": "_ExternalInput-actions_q3l5a_1", "ExternalInput-button": "_ExternalInput-button_q3l5a_5", "ExternalInput--dataSelected": "_ExternalInput--dataSelected_q3l5a_25", "ExternalInput-detachButton": "_ExternalInput-detachButton_q3l5a_32", "ExternalInputModal": "_ExternalInputModal_q3l5a_74", "ExternalInputModal-grid": "_ExternalInputModal-grid_q3l5a_84", "ExternalInputModal--filtersToggled": "_ExternalInputModal--filtersToggled_q3l5a_95", "ExternalInputModal-filters": "_ExternalInputModal-filters_q3l5a_100", "ExternalInputModal-masthead": "_ExternalInputModal-masthead_q3l5a_119", "ExternalInputModal-tableWrapper": "_ExternalInputModal-tableWrapper_q3l5a_128", "ExternalInputModal-table": "_ExternalInputModal-table_q3l5a_128", "ExternalInputModal-thead": "_ExternalInputModal-thead_q3l5a_144", "ExternalInputModal-th": "_ExternalInputModal-th_q3l5a_144", "ExternalInputModal-td": "_ExternalInputModal-td_q3l5a_159", "ExternalInputModal-tr": "_ExternalInputModal-tr_q3l5a_164", "ExternalInputModal-tbody": "_ExternalInputModal-tbody_q3l5a_171", "ExternalInputModal--hasData": "_ExternalInputModal--hasData_q3l5a_197", "ExternalInputModal-loadingBanner": "_ExternalInputModal-loadingBanner_q3l5a_201", "ExternalInputModal--isLoading": "_ExternalInputModal--isLoading_q3l5a_218", "ExternalInputModal-searchForm": "_ExternalInputModal-searchForm_q3l5a_222", "ExternalInputModal-search": "_ExternalInputModal-search_q3l5a_222", "ExternalInputModal-searchIcon": "_ExternalInputModal-searchIcon_q3l5a_259", "ExternalInputModal-searchIconText": "_ExternalInputModal-searchIconText_q3l5a_284", "ExternalInputModal-searchInput": "_ExternalInputModal-searchInput_q3l5a_294", "ExternalInputModal-searchActions": "_ExternalInputModal-searchActions_q3l5a_308", "ExternalInputModal-searchActionIcon": "_ExternalInputModal-searchActionIcon_q3l5a_321", "ExternalInputModal-footer": "_ExternalInputModal-footer_q3l5a_325" };
|
31480
31491
|
|
31481
31492
|
// components/Modal/index.tsx
|
31482
31493
|
init_react_import();
|
@@ -31484,7 +31495,7 @@ var import_react15 = require("react");
|
|
31484
31495
|
|
31485
31496
|
// css-module:/home/runner/work/puck/puck/packages/core/components/Modal/styles.module.css#css-module
|
31486
31497
|
init_react_import();
|
31487
|
-
var styles_module_default12 = { "Modal": "
|
31498
|
+
var styles_module_default12 = { "Modal": "_Modal_zud0i_1", "Modal--isOpen": "_Modal--isOpen_zud0i_15", "Modal-inner": "_Modal-inner_zud0i_19" };
|
31488
31499
|
|
31489
31500
|
// components/Modal/index.tsx
|
31490
31501
|
var import_react_dom = __toESM(require_react_dom());
|
@@ -31528,13 +31539,23 @@ var ExternalInput = ({
|
|
31528
31539
|
name,
|
31529
31540
|
id
|
31530
31541
|
}) => {
|
31531
|
-
const {
|
31542
|
+
const {
|
31543
|
+
mapProp = (val) => val,
|
31544
|
+
mapRow = (val) => val,
|
31545
|
+
filterFields
|
31546
|
+
} = field || {};
|
31532
31547
|
const [data, setData] = (0, import_react16.useState)([]);
|
31533
31548
|
const [isOpen, setOpen] = (0, import_react16.useState)(false);
|
31534
31549
|
const [isLoading, setIsLoading] = (0, import_react16.useState)(true);
|
31550
|
+
const hasFilterFields = !!filterFields;
|
31551
|
+
const [filters, setFilters] = (0, import_react16.useState)(field.initialFilters || {});
|
31552
|
+
const [filtersToggled, setFiltersToggled] = (0, import_react16.useState)(hasFilterFields);
|
31553
|
+
const mappedData = (0, import_react16.useMemo)(() => {
|
31554
|
+
return data.map(mapRow);
|
31555
|
+
}, [data]);
|
31535
31556
|
const keys = (0, import_react16.useMemo)(() => {
|
31536
31557
|
const validKeys = /* @__PURE__ */ new Set();
|
31537
|
-
for (const item of
|
31558
|
+
for (const item of mappedData) {
|
31538
31559
|
for (const key of Object.keys(item)) {
|
31539
31560
|
if (typeof item[key] === "string" || typeof item[key] === "number") {
|
31540
31561
|
validKeys.add(key);
|
@@ -31542,13 +31563,13 @@ var ExternalInput = ({
|
|
31542
31563
|
}
|
31543
31564
|
}
|
31544
31565
|
return Array.from(validKeys);
|
31545
|
-
}, [
|
31566
|
+
}, [mappedData]);
|
31546
31567
|
const [searchQuery, setSearchQuery] = (0, import_react16.useState)(field.initialQuery || "");
|
31547
31568
|
const search = (0, import_react16.useCallback)(
|
31548
|
-
(query) => __async(void 0, null, function* () {
|
31569
|
+
(query, filters2) => __async(void 0, null, function* () {
|
31549
31570
|
setIsLoading(true);
|
31550
|
-
const cacheKey = `${id}-${name}-${query}`;
|
31551
|
-
const listData = dataCache[cacheKey] || (yield field.fetchList({ query }));
|
31571
|
+
const cacheKey = `${id}-${name}-${query}-${JSON.stringify(filters2)}`;
|
31572
|
+
const listData = dataCache[cacheKey] || (yield field.fetchList({ query, filters: filters2 }));
|
31552
31573
|
if (listData) {
|
31553
31574
|
setData(listData);
|
31554
31575
|
setIsLoading(false);
|
@@ -31558,7 +31579,7 @@ var ExternalInput = ({
|
|
31558
31579
|
[name, field]
|
31559
31580
|
);
|
31560
31581
|
(0, import_react16.useEffect)(() => {
|
31561
|
-
search(searchQuery);
|
31582
|
+
search(searchQuery, filters);
|
31562
31583
|
}, []);
|
31563
31584
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
31564
31585
|
"div",
|
@@ -31593,78 +31614,109 @@ var ExternalInput = ({
|
|
31593
31614
|
)
|
31594
31615
|
] }),
|
31595
31616
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Modal, { onClose: () => setOpen(false), isOpen, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
31596
|
-
"
|
31617
|
+
"form",
|
31597
31618
|
{
|
31598
31619
|
className: getClassNameModal({
|
31599
31620
|
isLoading,
|
31600
31621
|
loaded: !isLoading,
|
31601
|
-
hasData:
|
31622
|
+
hasData: mappedData.length > 0,
|
31623
|
+
filtersToggled
|
31602
31624
|
}),
|
31625
|
+
onSubmit: (e) => {
|
31626
|
+
e.preventDefault();
|
31627
|
+
search(searchQuery, filters);
|
31628
|
+
},
|
31603
31629
|
children: [
|
31604
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.
|
31605
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.
|
31606
|
-
|
31607
|
-
"
|
31608
|
-
|
31609
|
-
|
31610
|
-
onSubmit: (e) => {
|
31611
|
-
e.preventDefault();
|
31612
|
-
search(searchQuery);
|
31613
|
-
},
|
31614
|
-
children: [
|
31615
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: getClassNameModal("search"), children: [
|
31616
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: getClassNameModal("searchIconText"), children: "Search" }),
|
31617
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: getClassNameModal("searchIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Search, { size: "18" }) }),
|
31618
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
31619
|
-
"input",
|
31620
|
-
{
|
31621
|
-
className: getClassNameModal("searchInput"),
|
31622
|
-
name: "q",
|
31623
|
-
type: "search",
|
31624
|
-
placeholder: "Search",
|
31625
|
-
onChange: (e) => {
|
31626
|
-
setSearchQuery(e.currentTarget.value);
|
31627
|
-
},
|
31628
|
-
autoComplete: "off",
|
31629
|
-
value: searchQuery
|
31630
|
-
}
|
31631
|
-
)
|
31632
|
-
] }),
|
31633
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Button, { type: "submit", loading: isLoading, disabled: isLoading, children: "Search" })
|
31634
|
-
]
|
31635
|
-
}
|
31636
|
-
)
|
31637
|
-
] }),
|
31638
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: getClassNameModal("tableWrapper"), children: [
|
31639
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("table", { className: getClassNameModal("table"), children: [
|
31640
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("thead", { className: getClassNameModal("thead"), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("tr", { className: getClassNameModal("tr"), children: keys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
31641
|
-
"th",
|
31630
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: getClassNameModal("masthead"), children: field.showSearch ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: getClassNameModal("searchForm"), children: [
|
31631
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: getClassNameModal("search"), children: [
|
31632
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: getClassNameModal("searchIconText"), children: "Search" }),
|
31633
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: getClassNameModal("searchIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Search, { size: "18" }) }),
|
31634
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
31635
|
+
"input",
|
31642
31636
|
{
|
31643
|
-
className: getClassNameModal("
|
31644
|
-
|
31645
|
-
|
31637
|
+
className: getClassNameModal("searchInput"),
|
31638
|
+
name: "q",
|
31639
|
+
type: "search",
|
31640
|
+
placeholder: field.placeholder,
|
31641
|
+
onChange: (e) => {
|
31642
|
+
setSearchQuery(e.currentTarget.value);
|
31643
|
+
},
|
31644
|
+
autoComplete: "off",
|
31645
|
+
value: searchQuery
|
31646
|
+
}
|
31647
|
+
)
|
31648
|
+
] }),
|
31649
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: getClassNameModal("searchActions"), children: [
|
31650
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Button, { type: "submit", loading: isLoading, fullWidth: true, children: "Search" }),
|
31651
|
+
hasFilterFields && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: getClassNameModal("searchActionIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
31652
|
+
IconButton,
|
31653
|
+
{
|
31654
|
+
title: "Toggle filters",
|
31655
|
+
onClick: (e) => {
|
31656
|
+
e.preventDefault();
|
31657
|
+
e.stopPropagation();
|
31658
|
+
setFiltersToggled(!filtersToggled);
|
31659
|
+
},
|
31660
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SlidersHorizontal, { size: 20 })
|
31661
|
+
}
|
31662
|
+
) })
|
31663
|
+
] })
|
31664
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Heading, { rank: 2, size: "xs", children: field.placeholder || "Select data" }) }),
|
31665
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: getClassNameModal("grid"), children: [
|
31666
|
+
hasFilterFields && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: getClassNameModal("filters"), children: hasFilterFields && Object.keys(filterFields).map((fieldName) => {
|
31667
|
+
const filterField = filterFields[fieldName];
|
31668
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
31669
|
+
InputOrGroup,
|
31670
|
+
{
|
31671
|
+
field: filterField,
|
31672
|
+
name: fieldName,
|
31673
|
+
id: `external_field_${fieldName}_filter`,
|
31674
|
+
label: filterField.label || fieldName,
|
31675
|
+
value: filters[fieldName],
|
31676
|
+
onChange: (value2) => {
|
31677
|
+
const newFilters = __spreadProps(__spreadValues({}, filters), { [fieldName]: value2 });
|
31678
|
+
setFilters(newFilters);
|
31679
|
+
search(searchQuery, newFilters);
|
31680
|
+
}
|
31646
31681
|
},
|
31647
|
-
|
31648
|
-
)
|
31649
|
-
|
31650
|
-
|
31651
|
-
|
31682
|
+
fieldName
|
31683
|
+
);
|
31684
|
+
}) }),
|
31685
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: getClassNameModal("tableWrapper"), children: [
|
31686
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("table", { className: getClassNameModal("table"), children: [
|
31687
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("thead", { className: getClassNameModal("thead"), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("tr", { className: getClassNameModal("tr"), children: keys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
31688
|
+
"th",
|
31652
31689
|
{
|
31653
|
-
|
31654
|
-
|
31655
|
-
|
31656
|
-
onChange(mapProp(item));
|
31657
|
-
setOpen(false);
|
31658
|
-
},
|
31659
|
-
children: keys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("td", { className: getClassNameModal("td"), children: item[key] }, key))
|
31690
|
+
className: getClassNameModal("th"),
|
31691
|
+
style: { textAlign: "left" },
|
31692
|
+
children: key
|
31660
31693
|
},
|
31661
|
-
|
31662
|
-
)
|
31663
|
-
|
31664
|
-
|
31665
|
-
|
31694
|
+
key
|
31695
|
+
)) }) }),
|
31696
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("tbody", { className: getClassNameModal("tbody"), children: mappedData.map((item, i) => {
|
31697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
31698
|
+
"tr",
|
31699
|
+
{
|
31700
|
+
style: { whiteSpace: "nowrap" },
|
31701
|
+
className: getClassNameModal("tr"),
|
31702
|
+
onClick: () => {
|
31703
|
+
onChange(mapProp(data[i]));
|
31704
|
+
setOpen(false);
|
31705
|
+
},
|
31706
|
+
children: keys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("td", { className: getClassNameModal("td"), children: item[key] }, key))
|
31707
|
+
},
|
31708
|
+
i
|
31709
|
+
);
|
31710
|
+
}) })
|
31711
|
+
] }),
|
31712
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: getClassNameModal("loadingBanner"), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_spinners5.ClipLoader, { size: 24, "aria-label": "Loading" }) })
|
31713
|
+
] })
|
31666
31714
|
] }),
|
31667
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.
|
31715
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: getClassNameModal("footer"), children: [
|
31716
|
+
mappedData.length,
|
31717
|
+
" result",
|
31718
|
+
mappedData.length === 1 ? "" : "s"
|
31719
|
+
] })
|
31668
31720
|
]
|
31669
31721
|
}
|
31670
31722
|
) })
|
@@ -31710,6 +31762,7 @@ var ExternalField = ({
|
|
31710
31762
|
// DEPRECATED
|
31711
31763
|
placeholder: ((_a = deprecatedField.adaptor) == null ? void 0 : _a.name) ? `Select from ${deprecatedField.adaptor.name}` : validField.placeholder || "Select data",
|
31712
31764
|
mapProp: ((_b = deprecatedField.adaptor) == null ? void 0 : _b.mapProp) || validField.mapProp,
|
31765
|
+
mapRow: validField.mapRow,
|
31713
31766
|
fetchList: ((_c = deprecatedField.adaptor) == null ? void 0 : _c.fetchList) ? () => __async(void 0, null, function* () {
|
31714
31767
|
return yield deprecatedField.adaptor.fetchList(
|
31715
31768
|
deprecatedField.adaptorParams
|
@@ -33417,6 +33470,14 @@ lucide-react/dist/esm/icons/search.js:
|
|
33417
33470
|
* See the LICENSE file in the root directory of this source tree.
|
33418
33471
|
*)
|
33419
33472
|
|
33473
|
+
lucide-react/dist/esm/icons/sliders-horizontal.js:
|
33474
|
+
(**
|
33475
|
+
* @license lucide-react v0.298.0 - ISC
|
33476
|
+
*
|
33477
|
+
* This source code is licensed under the ISC license.
|
33478
|
+
* See the LICENSE file in the root directory of this source tree.
|
33479
|
+
*)
|
33480
|
+
|
33420
33481
|
lucide-react/dist/esm/icons/trash.js:
|
33421
33482
|
(**
|
33422
33483
|
* @license lucide-react v0.298.0 - ISC
|
package/dist/rsc.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
2
|
-
import { C as Config, D as Data } from './Config-
|
2
|
+
import { C as Config, D as Data } from './Config-ab049d49.js';
|
3
3
|
import 'react';
|
4
4
|
|
5
5
|
declare function Render<UserConfig extends Config<any, any, any> = Config<any, any, any>>({ config, data }: {
|
package/package.json
CHANGED