@postxl/generators 1.11.5 → 1.11.6
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.
|
@@ -14,6 +14,7 @@ export const AdminSlicer = <TField extends FilterFieldName, TFilters extends Fil
|
|
|
14
14
|
title,
|
|
15
15
|
optionsHeight,
|
|
16
16
|
className,
|
|
17
|
+
__e2e_test_id__,
|
|
17
18
|
}: {
|
|
18
19
|
field: TField
|
|
19
20
|
filters: TFilters
|
|
@@ -23,6 +24,7 @@ export const AdminSlicer = <TField extends FilterFieldName, TFilters extends Fil
|
|
|
23
24
|
title?: string
|
|
24
25
|
optionsHeight?: number
|
|
25
26
|
className?: string
|
|
27
|
+
__e2e_test_id__?: string
|
|
26
28
|
}) => {
|
|
27
29
|
const fieldConfig = config[field]
|
|
28
30
|
const { filterKey, valueType: fieldType } = fieldConfig
|
|
@@ -183,6 +185,7 @@ export const AdminSlicer = <TField extends FilterFieldName, TFilters extends Fil
|
|
|
183
185
|
isLoading={isLoading}
|
|
184
186
|
optionsHeight={optionsHeight}
|
|
185
187
|
className={className}
|
|
188
|
+
__e2e_test_id__={__e2e_test_id__}
|
|
186
189
|
/>
|
|
187
190
|
)
|
|
188
191
|
}
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
Popover,
|
|
24
24
|
PopoverContent,
|
|
25
25
|
PopoverTrigger,
|
|
26
|
+
testId,
|
|
26
27
|
} from '@postxl/ui-components'
|
|
27
28
|
|
|
28
29
|
export const TableFilter = <TField extends FilterFieldName, TFilters extends FilterState>({
|
|
@@ -32,6 +33,7 @@ export const TableFilter = <TField extends FilterFieldName, TFilters extends Fil
|
|
|
32
33
|
onChange,
|
|
33
34
|
config,
|
|
34
35
|
getFilterOptions,
|
|
36
|
+
__e2e_test_id__,
|
|
35
37
|
}: {
|
|
36
38
|
open?: boolean
|
|
37
39
|
field: TField
|
|
@@ -39,6 +41,7 @@ export const TableFilter = <TField extends FilterFieldName, TFilters extends Fil
|
|
|
39
41
|
onChange: (val: FilterValue) => void
|
|
40
42
|
config: FilterConfig<TField, TFilters>
|
|
41
43
|
getFilterOptions: (args: { field: TField; filters: TFilters }) => any
|
|
44
|
+
__e2e_test_id__?: string
|
|
42
45
|
}) => {
|
|
43
46
|
const fieldConfig = config[field]
|
|
44
47
|
const { filterKey, valueType: fieldType } = fieldConfig
|
|
@@ -270,11 +273,12 @@ export const TableFilter = <TField extends FilterFieldName, TFilters extends Fil
|
|
|
270
273
|
}
|
|
271
274
|
|
|
272
275
|
return (
|
|
273
|
-
<div className="w-full flex flex-col">
|
|
276
|
+
<div className="w-full flex flex-col" data-test-id={__e2e_test_id__}>
|
|
274
277
|
{/* Clear filter button */}
|
|
275
278
|
<Button
|
|
276
279
|
variant="ghost"
|
|
277
280
|
size="xs"
|
|
281
|
+
__e2e_test_id__={testId(__e2e_test_id__, 'clear')}
|
|
278
282
|
disabled={
|
|
279
283
|
selectedValues.size === 0 &&
|
|
280
284
|
minVal === '' &&
|
|
@@ -318,6 +322,7 @@ export const TableFilter = <TField extends FilterFieldName, TFilters extends Fil
|
|
|
318
322
|
label="At least"
|
|
319
323
|
placeholder="min"
|
|
320
324
|
onCommit={commitMinMax}
|
|
325
|
+
data-test-id={testId(__e2e_test_id__, 'min')}
|
|
321
326
|
/>
|
|
322
327
|
<NumberMinMaxInput
|
|
323
328
|
value={maxVal}
|
|
@@ -325,6 +330,7 @@ export const TableFilter = <TField extends FilterFieldName, TFilters extends Fil
|
|
|
325
330
|
label="At most"
|
|
326
331
|
placeholder="max"
|
|
327
332
|
onCommit={commitMinMax}
|
|
333
|
+
data-test-id={testId(__e2e_test_id__, 'max')}
|
|
328
334
|
/>
|
|
329
335
|
</>
|
|
330
336
|
)}
|
|
@@ -341,6 +347,7 @@ export const TableFilter = <TField extends FilterFieldName, TFilters extends Fil
|
|
|
341
347
|
handleDateChange(Array.from(selectedValues).map(String), '', maxVal)
|
|
342
348
|
}}
|
|
343
349
|
onCommit={commitMinMax}
|
|
350
|
+
data-test-id={testId(__e2e_test_id__, 'from')}
|
|
344
351
|
/>
|
|
345
352
|
<DateMinMaxInput
|
|
346
353
|
value={maxVal}
|
|
@@ -354,6 +361,7 @@ export const TableFilter = <TField extends FilterFieldName, TFilters extends Fil
|
|
|
354
361
|
setTime={(date: Date) => {
|
|
355
362
|
date.setHours(23, 59, 59, 999)
|
|
356
363
|
}}
|
|
364
|
+
data-test-id={testId(__e2e_test_id__, 'to')}
|
|
357
365
|
/>
|
|
358
366
|
</>
|
|
359
367
|
)}
|
|
@@ -367,6 +375,7 @@ export const TableFilter = <TField extends FilterFieldName, TFilters extends Fil
|
|
|
367
375
|
label="Contains"
|
|
368
376
|
placeholder="text"
|
|
369
377
|
onCommit={commitStringFilter}
|
|
378
|
+
data-test-id={testId(__e2e_test_id__, 'contains')}
|
|
370
379
|
/>
|
|
371
380
|
<StringFilterInput
|
|
372
381
|
value={startsWithVal}
|
|
@@ -374,6 +383,7 @@ export const TableFilter = <TField extends FilterFieldName, TFilters extends Fil
|
|
|
374
383
|
label="Starts with"
|
|
375
384
|
placeholder="prefix"
|
|
376
385
|
onCommit={commitStringFilter}
|
|
386
|
+
data-test-id={testId(__e2e_test_id__, 'starts-with')}
|
|
377
387
|
/>
|
|
378
388
|
<StringFilterInput
|
|
379
389
|
value={endsWithVal}
|
|
@@ -381,6 +391,7 @@ export const TableFilter = <TField extends FilterFieldName, TFilters extends Fil
|
|
|
381
391
|
label="Ends with"
|
|
382
392
|
placeholder="suffix"
|
|
383
393
|
onCommit={commitStringFilter}
|
|
394
|
+
data-test-id={testId(__e2e_test_id__, 'ends-with')}
|
|
384
395
|
/>
|
|
385
396
|
<StringFilterInput
|
|
386
397
|
value={excludeVal}
|
|
@@ -388,6 +399,7 @@ export const TableFilter = <TField extends FilterFieldName, TFilters extends Fil
|
|
|
388
399
|
label="Exclude"
|
|
389
400
|
placeholder="text"
|
|
390
401
|
onCommit={commitStringFilter}
|
|
402
|
+
data-test-id={testId(__e2e_test_id__, 'exclude')}
|
|
391
403
|
/>
|
|
392
404
|
</>
|
|
393
405
|
)}
|
|
@@ -401,6 +413,7 @@ export const TableFilter = <TField extends FilterFieldName, TFilters extends Fil
|
|
|
401
413
|
placeholder="Search..."
|
|
402
414
|
value={searchQuery}
|
|
403
415
|
onChange={(e) => setSearchQuery(e.target.value)}
|
|
416
|
+
data-test-id={testId(__e2e_test_id__, 'search')}
|
|
404
417
|
/>
|
|
405
418
|
</div>
|
|
406
419
|
|
|
@@ -413,6 +426,7 @@ export const TableFilter = <TField extends FilterFieldName, TFilters extends Fil
|
|
|
413
426
|
variant="ghost"
|
|
414
427
|
size="xs"
|
|
415
428
|
className="w-full justify-start px-2 py-1 rounded-sm text-sm font-normal"
|
|
429
|
+
__e2e_test_id__={testId(__e2e_test_id__, 'select-all')}
|
|
416
430
|
onClick={() => {
|
|
417
431
|
let newVals: string[] = []
|
|
418
432
|
if (searchQuery.length > 0) {
|
|
@@ -494,12 +508,14 @@ const NumberMinMaxInput = ({
|
|
|
494
508
|
label,
|
|
495
509
|
placeholder,
|
|
496
510
|
onCommit,
|
|
511
|
+
'data-test-id': dataTestId,
|
|
497
512
|
}: {
|
|
498
513
|
value: string
|
|
499
514
|
setValue: (val: string) => void
|
|
500
515
|
label: string
|
|
501
516
|
placeholder: string
|
|
502
517
|
onCommit: () => void
|
|
518
|
+
'data-test-id'?: string
|
|
503
519
|
}) => {
|
|
504
520
|
return (
|
|
505
521
|
<div className="flex items-center gap-2 px-2 pt-0.5">
|
|
@@ -514,6 +530,7 @@ const NumberMinMaxInput = ({
|
|
|
514
530
|
onChange={(e) => setValue(e === undefined ? '' : String(e))}
|
|
515
531
|
onBlur={onCommit}
|
|
516
532
|
onEnter={onCommit}
|
|
533
|
+
data-test-id={dataTestId}
|
|
517
534
|
/>
|
|
518
535
|
</div>
|
|
519
536
|
)
|
|
@@ -538,6 +555,7 @@ const DateMinMaxInput = ({
|
|
|
538
555
|
onCommit,
|
|
539
556
|
onDelete,
|
|
540
557
|
setTime, // to use last ms of the day for 'To' field
|
|
558
|
+
'data-test-id': dataTestId,
|
|
541
559
|
}: {
|
|
542
560
|
value: string
|
|
543
561
|
setValue: (val: string) => void
|
|
@@ -545,6 +563,7 @@ const DateMinMaxInput = ({
|
|
|
545
563
|
onCommit: () => void
|
|
546
564
|
onDelete: () => void
|
|
547
565
|
setTime?: (date: Date) => void
|
|
566
|
+
'data-test-id'?: string
|
|
548
567
|
}) => {
|
|
549
568
|
return (
|
|
550
569
|
<div className="flex items-center gap-2 px-2 pt-0.5">
|
|
@@ -565,6 +584,7 @@ const DateMinMaxInput = ({
|
|
|
565
584
|
}}
|
|
566
585
|
onBlur={onCommit}
|
|
567
586
|
onEnter={onCommit}
|
|
587
|
+
data-test-id={dataTestId}
|
|
568
588
|
/>
|
|
569
589
|
<Popover
|
|
570
590
|
onOpenChange={(open) => {
|
|
@@ -622,12 +642,14 @@ const StringFilterInput = ({
|
|
|
622
642
|
label,
|
|
623
643
|
placeholder,
|
|
624
644
|
onCommit,
|
|
645
|
+
'data-test-id': dataTestId,
|
|
625
646
|
}: {
|
|
626
647
|
value: string
|
|
627
648
|
setValue: (val: string) => void
|
|
628
649
|
label: string
|
|
629
650
|
placeholder: string
|
|
630
651
|
onCommit: () => void
|
|
652
|
+
'data-test-id'?: string
|
|
631
653
|
}) => {
|
|
632
654
|
return (
|
|
633
655
|
<div className="flex items-center gap-2 px-2 pt-0.5">
|
|
@@ -641,6 +663,7 @@ const StringFilterInput = ({
|
|
|
641
663
|
onChange={(e) => setValue(e.target.value)}
|
|
642
664
|
onBlur={onCommit}
|
|
643
665
|
onEnter={onCommit}
|
|
666
|
+
data-test-id={dataTestId}
|
|
644
667
|
/>
|
|
645
668
|
</div>
|
|
646
669
|
)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@postxl/generators",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.6",
|
|
4
4
|
"description": "Code generators for PXL - generates backend, frontend, Prisma schemas, and more",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"exceljs": "^4.4.0",
|
|
47
47
|
"@postxl/generator": "^1.3.3",
|
|
48
48
|
"@postxl/schema": "^1.3.1",
|
|
49
|
-
"@postxl/ui-components": "^1.3.
|
|
49
|
+
"@postxl/ui-components": "^1.3.6",
|
|
50
50
|
"@postxl/utils": "^1.3.1"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {},
|