@mirai/ui 2.1.91 → 2.1.93
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/README.md +2 -0
- package/build/components/InputList/InputList.js +11 -6
- package/build/components/InputList/InputList.js.map +1 -1
- package/build/components/InputList/InputList.stories.js +1 -0
- package/build/components/InputList/InputList.stories.js.map +1 -1
- package/build/components/Table/Table.ColumnFilter.js +63 -4
- package/build/components/Table/Table.ColumnFilter.js.map +1 -1
- package/build/components/Table/Table.constants.js +3 -1
- package/build/components/Table/Table.constants.js.map +1 -1
- package/build/components/Table/Table.stories.js +12 -1
- package/build/components/Table/Table.stories.js.map +1 -1
- package/build/components/Table/__tests__/__snapshots__/Table.ColumnFilter.test.js.snap +207 -33
- package/build/components/Table/__tests__/__snapshots__/Table.test.js.snap +494 -0
- package/build/components/Table/helpers/select.js +85 -29
- package/build/components/Table/helpers/select.js.map +1 -1
- package/package.json +1 -1
|
@@ -1033,6 +1033,500 @@ exports[`component:<Table> prop:filter 1`] = `
|
|
|
1033
1033
|
</DocumentFragment>
|
|
1034
1034
|
`;
|
|
1035
1035
|
|
|
1036
|
+
exports[`component:<Table> prop:filter with date range 1`] = `
|
|
1037
|
+
<DocumentFragment>
|
|
1038
|
+
<ui-table-container
|
|
1039
|
+
class="scrollview snap vertical notIndicator container"
|
|
1040
|
+
>
|
|
1041
|
+
<ui-table-filter
|
|
1042
|
+
class="view row wide filters"
|
|
1043
|
+
>
|
|
1044
|
+
<ui-view
|
|
1045
|
+
class="view row item"
|
|
1046
|
+
>
|
|
1047
|
+
<ui-text
|
|
1048
|
+
class="text light tiny"
|
|
1049
|
+
>
|
|
1050
|
+
created at
|
|
1051
|
+
</ui-text>
|
|
1052
|
+
<ui-text
|
|
1053
|
+
class="text bold small"
|
|
1054
|
+
>
|
|
1055
|
+
12/03/2026
|
|
1056
|
+
</ui-text>
|
|
1057
|
+
<ui-text
|
|
1058
|
+
class="text bold small"
|
|
1059
|
+
>
|
|
1060
|
+
- 20/03/2026
|
|
1061
|
+
</ui-text>
|
|
1062
|
+
<ui-pressable
|
|
1063
|
+
class="pressable buttonRemove"
|
|
1064
|
+
tabindex="0"
|
|
1065
|
+
>
|
|
1066
|
+
<ui-icon
|
|
1067
|
+
class="icon action"
|
|
1068
|
+
>
|
|
1069
|
+
<svg
|
|
1070
|
+
fill="currentColor"
|
|
1071
|
+
height="1em"
|
|
1072
|
+
stroke="currentColor"
|
|
1073
|
+
stroke-width="0"
|
|
1074
|
+
viewBox="0 0 24 24"
|
|
1075
|
+
width="1em"
|
|
1076
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1077
|
+
>
|
|
1078
|
+
<path
|
|
1079
|
+
d="M0 0h24v24H0V0z"
|
|
1080
|
+
fill="none"
|
|
1081
|
+
/>
|
|
1082
|
+
<path
|
|
1083
|
+
d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
|
|
1084
|
+
/>
|
|
1085
|
+
</svg>
|
|
1086
|
+
</ui-icon>
|
|
1087
|
+
</ui-pressable>
|
|
1088
|
+
</ui-view>
|
|
1089
|
+
</ui-table-filter>
|
|
1090
|
+
<table
|
|
1091
|
+
class="table"
|
|
1092
|
+
>
|
|
1093
|
+
<thead>
|
|
1094
|
+
<tr>
|
|
1095
|
+
<th>
|
|
1096
|
+
<ui-view
|
|
1097
|
+
class="view forceRow column"
|
|
1098
|
+
>
|
|
1099
|
+
User Name
|
|
1100
|
+
<ui-view
|
|
1101
|
+
class="view row icons"
|
|
1102
|
+
>
|
|
1103
|
+
<ui-icon
|
|
1104
|
+
class="icon headline-3 icon disabled"
|
|
1105
|
+
>
|
|
1106
|
+
<svg
|
|
1107
|
+
fill="currentColor"
|
|
1108
|
+
height="1em"
|
|
1109
|
+
stroke="currentColor"
|
|
1110
|
+
stroke-width="0"
|
|
1111
|
+
viewBox="0 0 24 24"
|
|
1112
|
+
width="1em"
|
|
1113
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1114
|
+
>
|
|
1115
|
+
<path
|
|
1116
|
+
d="M0 0h24v24H0V0z"
|
|
1117
|
+
fill="none"
|
|
1118
|
+
/>
|
|
1119
|
+
<path
|
|
1120
|
+
d="m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"
|
|
1121
|
+
/>
|
|
1122
|
+
</svg>
|
|
1123
|
+
</ui-icon>
|
|
1124
|
+
<ui-menu
|
|
1125
|
+
class="container"
|
|
1126
|
+
>
|
|
1127
|
+
<ui-pressable
|
|
1128
|
+
class="pressable"
|
|
1129
|
+
style="position: relative;"
|
|
1130
|
+
tabindex="0"
|
|
1131
|
+
>
|
|
1132
|
+
<ui-icon
|
|
1133
|
+
class="icon headline-3 icon disabled"
|
|
1134
|
+
>
|
|
1135
|
+
<svg
|
|
1136
|
+
fill="currentColor"
|
|
1137
|
+
height="1em"
|
|
1138
|
+
stroke="currentColor"
|
|
1139
|
+
stroke-width="0"
|
|
1140
|
+
viewBox="0 0 24 24"
|
|
1141
|
+
width="1em"
|
|
1142
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1143
|
+
>
|
|
1144
|
+
<path
|
|
1145
|
+
d="M0 0h24v24H0V0z"
|
|
1146
|
+
fill="none"
|
|
1147
|
+
/>
|
|
1148
|
+
<path
|
|
1149
|
+
d="M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"
|
|
1150
|
+
/>
|
|
1151
|
+
</svg>
|
|
1152
|
+
</ui-icon>
|
|
1153
|
+
</ui-pressable>
|
|
1154
|
+
</ui-menu>
|
|
1155
|
+
</ui-view>
|
|
1156
|
+
</ui-view>
|
|
1157
|
+
</th>
|
|
1158
|
+
<th>
|
|
1159
|
+
<ui-view
|
|
1160
|
+
class="view forceRow column"
|
|
1161
|
+
>
|
|
1162
|
+
Email
|
|
1163
|
+
<ui-view
|
|
1164
|
+
class="view row icons"
|
|
1165
|
+
>
|
|
1166
|
+
<ui-icon
|
|
1167
|
+
class="icon headline-3 icon disabled"
|
|
1168
|
+
>
|
|
1169
|
+
<svg
|
|
1170
|
+
fill="currentColor"
|
|
1171
|
+
height="1em"
|
|
1172
|
+
stroke="currentColor"
|
|
1173
|
+
stroke-width="0"
|
|
1174
|
+
viewBox="0 0 24 24"
|
|
1175
|
+
width="1em"
|
|
1176
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1177
|
+
>
|
|
1178
|
+
<path
|
|
1179
|
+
d="M0 0h24v24H0V0z"
|
|
1180
|
+
fill="none"
|
|
1181
|
+
/>
|
|
1182
|
+
<path
|
|
1183
|
+
d="m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"
|
|
1184
|
+
/>
|
|
1185
|
+
</svg>
|
|
1186
|
+
</ui-icon>
|
|
1187
|
+
<ui-menu
|
|
1188
|
+
class="container"
|
|
1189
|
+
>
|
|
1190
|
+
<ui-pressable
|
|
1191
|
+
class="pressable"
|
|
1192
|
+
style="position: relative;"
|
|
1193
|
+
tabindex="0"
|
|
1194
|
+
>
|
|
1195
|
+
<ui-icon
|
|
1196
|
+
class="icon headline-3 icon disabled"
|
|
1197
|
+
>
|
|
1198
|
+
<svg
|
|
1199
|
+
fill="currentColor"
|
|
1200
|
+
height="1em"
|
|
1201
|
+
stroke="currentColor"
|
|
1202
|
+
stroke-width="0"
|
|
1203
|
+
viewBox="0 0 24 24"
|
|
1204
|
+
width="1em"
|
|
1205
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1206
|
+
>
|
|
1207
|
+
<path
|
|
1208
|
+
d="M0 0h24v24H0V0z"
|
|
1209
|
+
fill="none"
|
|
1210
|
+
/>
|
|
1211
|
+
<path
|
|
1212
|
+
d="M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"
|
|
1213
|
+
/>
|
|
1214
|
+
</svg>
|
|
1215
|
+
</ui-icon>
|
|
1216
|
+
</ui-pressable>
|
|
1217
|
+
</ui-menu>
|
|
1218
|
+
</ui-view>
|
|
1219
|
+
</ui-view>
|
|
1220
|
+
</th>
|
|
1221
|
+
<th>
|
|
1222
|
+
<ui-view
|
|
1223
|
+
class="view forceRow column"
|
|
1224
|
+
>
|
|
1225
|
+
Year
|
|
1226
|
+
<ui-view
|
|
1227
|
+
class="view row icons"
|
|
1228
|
+
>
|
|
1229
|
+
<ui-icon
|
|
1230
|
+
class="icon headline-3 icon disabled"
|
|
1231
|
+
>
|
|
1232
|
+
<svg
|
|
1233
|
+
fill="currentColor"
|
|
1234
|
+
height="1em"
|
|
1235
|
+
stroke="currentColor"
|
|
1236
|
+
stroke-width="0"
|
|
1237
|
+
viewBox="0 0 24 24"
|
|
1238
|
+
width="1em"
|
|
1239
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1240
|
+
>
|
|
1241
|
+
<path
|
|
1242
|
+
d="M0 0h24v24H0V0z"
|
|
1243
|
+
fill="none"
|
|
1244
|
+
/>
|
|
1245
|
+
<path
|
|
1246
|
+
d="m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"
|
|
1247
|
+
/>
|
|
1248
|
+
</svg>
|
|
1249
|
+
</ui-icon>
|
|
1250
|
+
<ui-menu
|
|
1251
|
+
class="container"
|
|
1252
|
+
>
|
|
1253
|
+
<ui-pressable
|
|
1254
|
+
class="pressable"
|
|
1255
|
+
style="position: relative;"
|
|
1256
|
+
tabindex="0"
|
|
1257
|
+
>
|
|
1258
|
+
<ui-icon
|
|
1259
|
+
class="icon headline-3 icon disabled"
|
|
1260
|
+
>
|
|
1261
|
+
<svg
|
|
1262
|
+
fill="currentColor"
|
|
1263
|
+
height="1em"
|
|
1264
|
+
stroke="currentColor"
|
|
1265
|
+
stroke-width="0"
|
|
1266
|
+
viewBox="0 0 24 24"
|
|
1267
|
+
width="1em"
|
|
1268
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1269
|
+
>
|
|
1270
|
+
<path
|
|
1271
|
+
d="M0 0h24v24H0V0z"
|
|
1272
|
+
fill="none"
|
|
1273
|
+
/>
|
|
1274
|
+
<path
|
|
1275
|
+
d="M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"
|
|
1276
|
+
/>
|
|
1277
|
+
</svg>
|
|
1278
|
+
</ui-icon>
|
|
1279
|
+
</ui-pressable>
|
|
1280
|
+
</ui-menu>
|
|
1281
|
+
</ui-view>
|
|
1282
|
+
</ui-view>
|
|
1283
|
+
</th>
|
|
1284
|
+
<th>
|
|
1285
|
+
<ui-view
|
|
1286
|
+
class="view forceRow column"
|
|
1287
|
+
>
|
|
1288
|
+
<ui-tooltip
|
|
1289
|
+
class="container"
|
|
1290
|
+
>
|
|
1291
|
+
<ui-primitive
|
|
1292
|
+
class="dispatcher tooltip"
|
|
1293
|
+
>
|
|
1294
|
+
Twitter
|
|
1295
|
+
</ui-primitive>
|
|
1296
|
+
</ui-tooltip>
|
|
1297
|
+
<ui-view
|
|
1298
|
+
class="view row icons"
|
|
1299
|
+
>
|
|
1300
|
+
<ui-icon
|
|
1301
|
+
class="icon headline-3 icon disabled"
|
|
1302
|
+
>
|
|
1303
|
+
<svg
|
|
1304
|
+
fill="currentColor"
|
|
1305
|
+
height="1em"
|
|
1306
|
+
stroke="currentColor"
|
|
1307
|
+
stroke-width="0"
|
|
1308
|
+
viewBox="0 0 24 24"
|
|
1309
|
+
width="1em"
|
|
1310
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1311
|
+
>
|
|
1312
|
+
<path
|
|
1313
|
+
d="M0 0h24v24H0V0z"
|
|
1314
|
+
fill="none"
|
|
1315
|
+
/>
|
|
1316
|
+
<path
|
|
1317
|
+
d="m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"
|
|
1318
|
+
/>
|
|
1319
|
+
</svg>
|
|
1320
|
+
</ui-icon>
|
|
1321
|
+
<ui-menu
|
|
1322
|
+
class="container"
|
|
1323
|
+
>
|
|
1324
|
+
<ui-pressable
|
|
1325
|
+
class="pressable"
|
|
1326
|
+
style="position: relative;"
|
|
1327
|
+
tabindex="0"
|
|
1328
|
+
>
|
|
1329
|
+
<ui-icon
|
|
1330
|
+
class="icon headline-3 icon disabled"
|
|
1331
|
+
>
|
|
1332
|
+
<svg
|
|
1333
|
+
fill="currentColor"
|
|
1334
|
+
height="1em"
|
|
1335
|
+
stroke="currentColor"
|
|
1336
|
+
stroke-width="0"
|
|
1337
|
+
viewBox="0 0 24 24"
|
|
1338
|
+
width="1em"
|
|
1339
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1340
|
+
>
|
|
1341
|
+
<path
|
|
1342
|
+
d="M0 0h24v24H0V0z"
|
|
1343
|
+
fill="none"
|
|
1344
|
+
/>
|
|
1345
|
+
<path
|
|
1346
|
+
d="M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"
|
|
1347
|
+
/>
|
|
1348
|
+
</svg>
|
|
1349
|
+
</ui-icon>
|
|
1350
|
+
</ui-pressable>
|
|
1351
|
+
</ui-menu>
|
|
1352
|
+
</ui-view>
|
|
1353
|
+
</ui-view>
|
|
1354
|
+
</th>
|
|
1355
|
+
<th>
|
|
1356
|
+
<ui-view
|
|
1357
|
+
class="view forceRow column"
|
|
1358
|
+
>
|
|
1359
|
+
Action
|
|
1360
|
+
<ui-view
|
|
1361
|
+
class="view row icons"
|
|
1362
|
+
>
|
|
1363
|
+
<ui-icon
|
|
1364
|
+
class="icon headline-3 icon disabled"
|
|
1365
|
+
>
|
|
1366
|
+
<svg
|
|
1367
|
+
fill="currentColor"
|
|
1368
|
+
height="1em"
|
|
1369
|
+
stroke="currentColor"
|
|
1370
|
+
stroke-width="0"
|
|
1371
|
+
viewBox="0 0 24 24"
|
|
1372
|
+
width="1em"
|
|
1373
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1374
|
+
>
|
|
1375
|
+
<path
|
|
1376
|
+
d="M0 0h24v24H0V0z"
|
|
1377
|
+
fill="none"
|
|
1378
|
+
/>
|
|
1379
|
+
<path
|
|
1380
|
+
d="m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"
|
|
1381
|
+
/>
|
|
1382
|
+
</svg>
|
|
1383
|
+
</ui-icon>
|
|
1384
|
+
<ui-menu
|
|
1385
|
+
class="container"
|
|
1386
|
+
>
|
|
1387
|
+
<ui-pressable
|
|
1388
|
+
class="pressable"
|
|
1389
|
+
style="position: relative;"
|
|
1390
|
+
tabindex="0"
|
|
1391
|
+
>
|
|
1392
|
+
<ui-icon
|
|
1393
|
+
class="icon headline-3 icon disabled"
|
|
1394
|
+
>
|
|
1395
|
+
<svg
|
|
1396
|
+
fill="currentColor"
|
|
1397
|
+
height="1em"
|
|
1398
|
+
stroke="currentColor"
|
|
1399
|
+
stroke-width="0"
|
|
1400
|
+
viewBox="0 0 24 24"
|
|
1401
|
+
width="1em"
|
|
1402
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1403
|
+
>
|
|
1404
|
+
<path
|
|
1405
|
+
d="M0 0h24v24H0V0z"
|
|
1406
|
+
fill="none"
|
|
1407
|
+
/>
|
|
1408
|
+
<path
|
|
1409
|
+
d="M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"
|
|
1410
|
+
/>
|
|
1411
|
+
</svg>
|
|
1412
|
+
</ui-icon>
|
|
1413
|
+
</ui-pressable>
|
|
1414
|
+
</ui-menu>
|
|
1415
|
+
</ui-view>
|
|
1416
|
+
</ui-view>
|
|
1417
|
+
</th>
|
|
1418
|
+
<th>
|
|
1419
|
+
<ui-view
|
|
1420
|
+
class="view forceRow column"
|
|
1421
|
+
>
|
|
1422
|
+
Created At
|
|
1423
|
+
<ui-view
|
|
1424
|
+
class="view row icons"
|
|
1425
|
+
>
|
|
1426
|
+
<ui-icon
|
|
1427
|
+
class="icon headline-3 icon disabled"
|
|
1428
|
+
>
|
|
1429
|
+
<svg
|
|
1430
|
+
fill="currentColor"
|
|
1431
|
+
height="1em"
|
|
1432
|
+
stroke="currentColor"
|
|
1433
|
+
stroke-width="0"
|
|
1434
|
+
viewBox="0 0 24 24"
|
|
1435
|
+
width="1em"
|
|
1436
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1437
|
+
>
|
|
1438
|
+
<path
|
|
1439
|
+
d="M0 0h24v24H0V0z"
|
|
1440
|
+
fill="none"
|
|
1441
|
+
/>
|
|
1442
|
+
<path
|
|
1443
|
+
d="m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"
|
|
1444
|
+
/>
|
|
1445
|
+
</svg>
|
|
1446
|
+
</ui-icon>
|
|
1447
|
+
<ui-menu
|
|
1448
|
+
class="container"
|
|
1449
|
+
>
|
|
1450
|
+
<ui-pressable
|
|
1451
|
+
class="pressable"
|
|
1452
|
+
style="position: relative;"
|
|
1453
|
+
tabindex="0"
|
|
1454
|
+
>
|
|
1455
|
+
<ui-icon
|
|
1456
|
+
class="icon headline-3 icon disabled"
|
|
1457
|
+
>
|
|
1458
|
+
<svg
|
|
1459
|
+
fill="currentColor"
|
|
1460
|
+
height="1em"
|
|
1461
|
+
stroke="currentColor"
|
|
1462
|
+
stroke-width="0"
|
|
1463
|
+
viewBox="0 0 24 24"
|
|
1464
|
+
width="1em"
|
|
1465
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1466
|
+
>
|
|
1467
|
+
<path
|
|
1468
|
+
d="M0 0h24v24H0V0z"
|
|
1469
|
+
fill="none"
|
|
1470
|
+
/>
|
|
1471
|
+
<path
|
|
1472
|
+
d="M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"
|
|
1473
|
+
/>
|
|
1474
|
+
</svg>
|
|
1475
|
+
</ui-icon>
|
|
1476
|
+
</ui-pressable>
|
|
1477
|
+
</ui-menu>
|
|
1478
|
+
</ui-view>
|
|
1479
|
+
</ui-view>
|
|
1480
|
+
</th>
|
|
1481
|
+
</tr>
|
|
1482
|
+
</thead>
|
|
1483
|
+
<tbody>
|
|
1484
|
+
<tr>
|
|
1485
|
+
<td>
|
|
1486
|
+
<ui-view
|
|
1487
|
+
class="view forceRow column text"
|
|
1488
|
+
>
|
|
1489
|
+
mario/1
|
|
1490
|
+
</ui-view>
|
|
1491
|
+
</td>
|
|
1492
|
+
<td>
|
|
1493
|
+
<ui-view
|
|
1494
|
+
class="view forceRow column text"
|
|
1495
|
+
>
|
|
1496
|
+
mario.1@mirai.com
|
|
1497
|
+
</ui-view>
|
|
1498
|
+
</td>
|
|
1499
|
+
<td>
|
|
1500
|
+
<ui-view
|
|
1501
|
+
class="view forceRow column number"
|
|
1502
|
+
>
|
|
1503
|
+
2005
|
|
1504
|
+
</ui-view>
|
|
1505
|
+
</td>
|
|
1506
|
+
<td>
|
|
1507
|
+
<ui-view
|
|
1508
|
+
class="view forceRow column text"
|
|
1509
|
+
/>
|
|
1510
|
+
</td>
|
|
1511
|
+
<td>
|
|
1512
|
+
<ui-view
|
|
1513
|
+
class="view forceRow column text"
|
|
1514
|
+
/>
|
|
1515
|
+
</td>
|
|
1516
|
+
<td>
|
|
1517
|
+
<ui-view
|
|
1518
|
+
class="view forceRow column date"
|
|
1519
|
+
>
|
|
1520
|
+
15/03/2026
|
|
1521
|
+
</ui-view>
|
|
1522
|
+
</td>
|
|
1523
|
+
</tr>
|
|
1524
|
+
</tbody>
|
|
1525
|
+
</table>
|
|
1526
|
+
</ui-table-container>
|
|
1527
|
+
</DocumentFragment>
|
|
1528
|
+
`;
|
|
1529
|
+
|
|
1036
1530
|
exports[`component:<Table> prop:inline (false 1`] = `
|
|
1037
1531
|
<DocumentFragment>
|
|
1038
1532
|
<ui-table-container
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.select = void 0;
|
|
8
|
+
var _locale = require("@mirai/locale");
|
|
8
9
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
10
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
11
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -16,18 +17,41 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
16
17
|
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
17
18
|
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
18
19
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) { n[e] = r[e]; } return n; }
|
|
20
|
+
var DATE_FORMAT_TOKEN = /[DMY]/g;
|
|
21
|
+
var buildFormatRegex = function buildFormatRegex(format) {
|
|
22
|
+
return new RegExp("^".concat(format.replace(DATE_FORMAT_TOKEN, '\\d'), "$"));
|
|
23
|
+
};
|
|
24
|
+
var parseFilterDate = function parseFilterDate(value) {
|
|
25
|
+
var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _locale.DEFAULT_DATE_FORMAT;
|
|
26
|
+
var formatRegex = arguments.length > 2 ? arguments[2] : undefined;
|
|
27
|
+
if (!value) return undefined;
|
|
28
|
+
if (value instanceof Date) return isNaN(value.getTime()) ? undefined : value;
|
|
29
|
+
if (typeof value !== 'string' || value.length !== format.length) return undefined;
|
|
30
|
+
if (!(formatRegex || buildFormatRegex(format)).test(value)) return undefined;
|
|
31
|
+
var parsedValue = (0, _locale.parseDate)(value, format);
|
|
32
|
+
return parsedValue instanceof Date && !isNaN(parsedValue.getTime()) ? parsedValue : undefined;
|
|
33
|
+
};
|
|
34
|
+
var matchesDateFilter = function matchesDateFilter(rawValue, _ref) {
|
|
35
|
+
var format = _ref.format,
|
|
36
|
+
formatRegex = _ref.formatRegex,
|
|
37
|
+
maxDate = _ref.maxDate,
|
|
38
|
+
minDate = _ref.minDate;
|
|
39
|
+
var dateValue = parseFilterDate(rawValue, format, formatRegex);
|
|
40
|
+
if (!dateValue) return false;
|
|
41
|
+
return (!minDate || dateValue >= minDate) && (!maxDate || dateValue <= maxDate);
|
|
42
|
+
};
|
|
19
43
|
var select = function select() {
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
dataSource =
|
|
23
|
-
|
|
24
|
-
filter =
|
|
25
|
-
limit =
|
|
26
|
-
|
|
27
|
-
schema =
|
|
28
|
-
search =
|
|
29
|
-
|
|
30
|
-
sort =
|
|
44
|
+
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
45
|
+
_ref2$dataSource = _ref2.dataSource,
|
|
46
|
+
dataSource = _ref2$dataSource === void 0 ? [] : _ref2$dataSource,
|
|
47
|
+
_ref2$filter = _ref2.filter,
|
|
48
|
+
filter = _ref2$filter === void 0 ? [] : _ref2$filter,
|
|
49
|
+
limit = _ref2.limit,
|
|
50
|
+
_ref2$schema = _ref2.schema,
|
|
51
|
+
schema = _ref2$schema === void 0 ? {} : _ref2$schema,
|
|
52
|
+
search = _ref2.search,
|
|
53
|
+
_ref2$sort = _ref2.sort,
|
|
54
|
+
sort = _ref2$sort === void 0 ? {} : _ref2$sort;
|
|
31
55
|
var has = {
|
|
32
56
|
filter: (filter === null || filter === void 0 ? void 0 : filter.length) > 0,
|
|
33
57
|
search: !!search,
|
|
@@ -37,13 +61,13 @@ var select = function select() {
|
|
|
37
61
|
var flatten = _toConsumableArray(dataSource);
|
|
38
62
|
var values = [];
|
|
39
63
|
if (has.filter) {
|
|
40
|
-
var filterGrouped = _toConsumableArray(filter).filter(function (
|
|
41
|
-
var field =
|
|
64
|
+
var filterGrouped = _toConsumableArray(filter).filter(function (_ref3) {
|
|
65
|
+
var field = _ref3.field;
|
|
42
66
|
return fields.includes(field);
|
|
43
67
|
}).reduce(function (group) {
|
|
44
68
|
var item = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
45
|
-
var itemFound = group.find(function (
|
|
46
|
-
var field =
|
|
69
|
+
var itemFound = group.find(function (_ref4) {
|
|
70
|
+
var field = _ref4.field;
|
|
47
71
|
return item.field === field;
|
|
48
72
|
});
|
|
49
73
|
if (itemFound && item.value) {
|
|
@@ -54,24 +78,56 @@ var select = function select() {
|
|
|
54
78
|
}
|
|
55
79
|
return group;
|
|
56
80
|
}, []);
|
|
81
|
+
var filterParsed = filterGrouped.map(function (entry) {
|
|
82
|
+
var field = entry.field,
|
|
83
|
+
max = entry.max,
|
|
84
|
+
min = entry.min;
|
|
85
|
+
var fieldKey = schema[field].bind || field;
|
|
86
|
+
var _ref5 = schema[fieldKey] || {},
|
|
87
|
+
_ref5$format = _ref5.format,
|
|
88
|
+
format = _ref5$format === void 0 ? _locale.DEFAULT_DATE_FORMAT : _ref5$format,
|
|
89
|
+
type = _ref5.type;
|
|
90
|
+
if (type !== 'date') return _objectSpread(_objectSpread({}, entry), {}, {
|
|
91
|
+
fieldKey: fieldKey,
|
|
92
|
+
format: format,
|
|
93
|
+
type: type
|
|
94
|
+
});
|
|
95
|
+
var formatRegex = buildFormatRegex(format);
|
|
96
|
+
return _objectSpread(_objectSpread({}, entry), {}, {
|
|
97
|
+
fieldKey: fieldKey,
|
|
98
|
+
format: format,
|
|
99
|
+
formatRegex: formatRegex,
|
|
100
|
+
maxDate: parseFilterDate(max, format, formatRegex),
|
|
101
|
+
minDate: parseFilterDate(min, format, formatRegex),
|
|
102
|
+
type: type
|
|
103
|
+
});
|
|
104
|
+
});
|
|
57
105
|
flatten = flatten.filter(function () {
|
|
58
106
|
var row = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
59
|
-
return
|
|
107
|
+
return filterParsed.every(function (_ref6) {
|
|
60
108
|
var _fieldValue$join;
|
|
61
|
-
var
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
109
|
+
var fieldKey = _ref6.fieldKey,
|
|
110
|
+
format = _ref6.format,
|
|
111
|
+
formatRegex = _ref6.formatRegex,
|
|
112
|
+
max = _ref6.max,
|
|
113
|
+
maxDate = _ref6.maxDate,
|
|
114
|
+
min = _ref6.min,
|
|
115
|
+
minDate = _ref6.minDate,
|
|
116
|
+
type = _ref6.type,
|
|
117
|
+
filterValue = _ref6.value,
|
|
118
|
+
_ref6$values = _ref6.values,
|
|
119
|
+
filterValues = _ref6$values === void 0 ? [] : _ref6$values;
|
|
69
120
|
var fieldValue = typeof row[fieldKey] === 'string' ? row[fieldKey].toLowerCase() : row[fieldKey];
|
|
70
121
|
if (type === 'boolean') fieldValue = fieldValue ? 'true' : 'false';else if (type !== 'options' && Array.isArray(fieldValue)) fieldValue = (_fieldValue$join = fieldValue.join(' ')) === null || _fieldValue$join === void 0 ? void 0 : _fieldValue$join.toLowerCase();
|
|
71
122
|
if (fieldValue === undefined) return false;
|
|
72
123
|
return filterValue && type !== 'options' ? !Array.isArray(filterValue) ? fieldValue.includes(filterValue.toLowerCase()) : filterValue.some(function (item) {
|
|
73
124
|
return fieldValue.includes(item.toLowerCase());
|
|
74
|
-
}) : type === 'number' ? fieldValue >= (min || -Infinity) && fieldValue <= (max || Infinity) : type === '
|
|
125
|
+
}) : type === 'number' ? fieldValue >= (min || -Infinity) && fieldValue <= (max || Infinity) : type === 'date' ? matchesDateFilter(row[fieldKey], {
|
|
126
|
+
format: format,
|
|
127
|
+
formatRegex: formatRegex,
|
|
128
|
+
maxDate: maxDate,
|
|
129
|
+
minDate: minDate
|
|
130
|
+
}) : type === 'options' ? filterValues.flat().some(function (item) {
|
|
75
131
|
return Array.isArray(fieldValue) ? fieldValue.includes(item) : fieldValue === item;
|
|
76
132
|
}) : false;
|
|
77
133
|
});
|
|
@@ -97,10 +153,10 @@ var select = function select() {
|
|
|
97
153
|
var fieldKey = schema[key].bind || key;
|
|
98
154
|
var order = sort[key] ? 1 : -1;
|
|
99
155
|
values.sort(function () {
|
|
100
|
-
var
|
|
101
|
-
a =
|
|
102
|
-
var
|
|
103
|
-
b =
|
|
156
|
+
var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
157
|
+
a = _ref7[fieldKey];
|
|
158
|
+
var _ref8 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
159
|
+
b = _ref8[fieldKey];
|
|
104
160
|
return (a === undefined || a < b ? -1 : b === undefined || a > b ? 1 : 0) * order;
|
|
105
161
|
});
|
|
106
162
|
});
|