@gravitee/graphene-core 3.46.0 → 3.47.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/USAGE_GUIDE.md +16 -0
- package/dist/composed/FacetedFilter/FacetedFilter.d.ts +12 -1
- package/dist/composed/FacetedFilter/FacetedFilter.d.ts.map +1 -1
- package/dist/composed/FileUpload/FileUpload.d.ts +7 -1
- package/dist/composed/FileUpload/FileUpload.d.ts.map +1 -1
- package/dist/composed/FileUpload/FileUploadItem.d.ts +9 -0
- package/dist/composed/FileUpload/FileUploadItem.d.ts.map +1 -1
- package/dist/index.js +49 -34
- package/package.json +1 -1
package/USAGE_GUIDE.md
CHANGED
|
@@ -1075,6 +1075,17 @@ The components that derive ids from yours. A part exists only when you pass an i
|
|
|
1075
1075
|
| --------------------- | ------------------------ | ---------------------------------------------------------------------------------------------------------- |
|
|
1076
1076
|
| `FileUploadInput` | `${id}-input` | Hidden file input |
|
|
1077
1077
|
| `FileUploadInput` | `${id}-trigger` | Trigger button, when `triggerLabel` renders one |
|
|
1078
|
+
| `FileUpload` | `${id}-dropzone` | Drop zone root |
|
|
1079
|
+
| `FileUpload` | `${id}-dropzone-input` | Hidden file input |
|
|
1080
|
+
| `FileUpload` | `${id}-dropzone-trigger` | Trigger button, when `triggerLabel` renders one |
|
|
1081
|
+
| `FileUpload` | `${id}-error` | Field error list, while `errors` is not empty (an item's error is `${id}-item-<item.id>-error`) |
|
|
1082
|
+
| `FileUpload` | `${id}-item-<item.id>` | Item root; `item.id` verbatim, not ending with `-remove`, `-error` or `-progress` |
|
|
1083
|
+
| `FileUpload` | `${id}-item-<item.id>-remove` | The item's remove button |
|
|
1084
|
+
| `FileUpload` | `${id}-item-<item.id>-error` | The item's error, while it has one |
|
|
1085
|
+
| `FileUpload` | `${id}-item-<item.id>-progress` | The item's progress bar, while it has a `progress` and is not in error |
|
|
1086
|
+
| `FileUploadItem` | `${id}-remove` | Remove button, with `onRemove` |
|
|
1087
|
+
| `FileUploadItem` | `${id}-error` | Error text, while the item has an `error` |
|
|
1088
|
+
| `FileUploadItem` | `${id}-progress` | Progress bar, while the item has a `progress` and is not in error |
|
|
1078
1089
|
| `Calendar` | `${id}-previous` | Previous month button |
|
|
1079
1090
|
| `Calendar` | `${id}-next` | Next month button |
|
|
1080
1091
|
| `Calendar` | `${id}-day-<yyyy-MM-dd>` | Day button, with `mode` or `onDayClick`; an outside day too, unless another displayed month shows its date |
|
|
@@ -1120,6 +1131,11 @@ The components that derive ids from yours. A part exists only when you pass an i
|
|
|
1120
1131
|
| `DataTableViewOptions` | `${id}-clear` | Clear button, with `searchable`, while the search field has text |
|
|
1121
1132
|
| `ElCheatSheetTrigger` | `${id}-content` | Popover content, while the popover is open |
|
|
1122
1133
|
| `ElCheatSheetTrigger` | `${id}-copy-<key>` | Copy button of an example: `plan-level`, `path-prefix` or `attribute-lookup` |
|
|
1134
|
+
| `FacetedFilter` | `${id}-content` | Popover content, while the popover is open |
|
|
1135
|
+
| `FacetedFilter` | `${id}-search` | Search input, while the popover is open |
|
|
1136
|
+
| `FacetedFilter` | `${id}-count` | Count badge, while a value is selected |
|
|
1137
|
+
| `FacetedFilter` | `${id}-option-<value>` | Option, while the popover is open and the search shows it; `value` verbatim, not ending with `-select` |
|
|
1138
|
+
| `FacetedFilter` | `${id}-option-<value>-select` | The option's checkbox, present with its option; read-only: read `aria-checked`, click `${id}-option-<value>` to select (a click on the checkbox fails, the option intercepts it) |
|
|
1123
1139
|
| `CodeEditor` | `${id}-loading` | Skeleton, while Monaco loads |
|
|
1124
1140
|
| `CodeEditor` | `${id}-fallback` | Plain textarea, when Monaco fails to load |
|
|
1125
1141
|
| `JsonSchemaForm` | `${id}-<path>` | The control of the field at the react-hook-form path, verbatim (`headers.0.name`); a code editor field: its container, with `-loading` while Monaco loads and `-fallback` when it fails |
|
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
interface FacetedFilterOption<T extends string> {
|
|
2
|
+
/**
|
|
3
|
+
* A stable key, never a display label. It is the option's test id key, verbatim (`${id}-option-<value>`), so it
|
|
4
|
+
* must not end with `-select`.
|
|
5
|
+
*/
|
|
2
6
|
value: T;
|
|
3
7
|
label: string;
|
|
4
8
|
}
|
|
5
9
|
interface FacetedFilterProps<T extends string> {
|
|
10
|
+
/**
|
|
11
|
+
* Lands on the trigger button. Popover content: `${id}-content`, search input: `${id}-search`, count badge (while
|
|
12
|
+
* a value is selected): `${id}-count`, each option: `${id}-option-<value>`, its checkbox: `${id}-option-<value>-select`.
|
|
13
|
+
* The checkbox is read-only: read the checked state from its `aria-checked`, and click `${id}-option-<value>` to
|
|
14
|
+
* select it. A `click()` or `check()` on the checkbox fails, because the option intercepts the click.
|
|
15
|
+
*/
|
|
16
|
+
readonly 'data-testid'?: string;
|
|
6
17
|
readonly title: string;
|
|
7
18
|
readonly options: FacetedFilterOption<T>[];
|
|
8
19
|
readonly selected: T[];
|
|
9
20
|
readonly onChange: (values: T[]) => void;
|
|
10
21
|
}
|
|
11
|
-
declare function FacetedFilter<T extends string>({ title, options, selected, onChange }: FacetedFilterProps<T>): import("react").JSX.Element;
|
|
22
|
+
declare function FacetedFilter<T extends string>({ title, options, selected, onChange, 'data-testid': testId, }: FacetedFilterProps<T>): import("react").JSX.Element;
|
|
12
23
|
export { FacetedFilter };
|
|
13
24
|
export type { FacetedFilterOption, FacetedFilterProps };
|
|
14
25
|
//# sourceMappingURL=FacetedFilter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FacetedFilter.d.ts","sourceRoot":"","sources":["../../../src/composed/FacetedFilter/FacetedFilter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FacetedFilter.d.ts","sourceRoot":"","sources":["../../../src/composed/FacetedFilter/FacetedFilter.tsx"],"names":[],"mappings":"AAgBA,UAAU,mBAAmB,CAAC,CAAC,SAAS,MAAM;IAC5C;;;OAGG;IACH,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,kBAAkB,CAAC,CAAC,SAAS,MAAM;IAC3C;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3C,QAAQ,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;CAC1C;AAED,iBAAS,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,EACvC,KAAK,EACL,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,aAAa,EAAE,MAAM,GACtB,EAAE,kBAAkB,CAAC,CAAC,CAAC,+BAyDvB;AAED,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -2,6 +2,12 @@ import { Accept, FileRejection, FileUploadInputProps } from '../../base/FileUplo
|
|
|
2
2
|
import { FileUploadItemValue } from './FileUploadItem';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
interface FileUploadProps extends Pick<FileUploadInputProps, 'icon' | 'triggerLabel'> {
|
|
5
|
+
/**
|
|
6
|
+
* Lands on the root. Drop zone: `${id}-dropzone`, with `${id}-dropzone-input` and `${id}-dropzone-trigger`. Field
|
|
7
|
+
* error list (while `errors` is not empty): `${id}-error`. Each item: `${id}-item-<item.id>`, with `-remove`, `-error`
|
|
8
|
+
* and `-progress` after it (see `FileUploadItem`).
|
|
9
|
+
*/
|
|
10
|
+
readonly 'data-testid'?: string;
|
|
5
11
|
accept?: Accept;
|
|
6
12
|
className?: string;
|
|
7
13
|
disabled?: boolean;
|
|
@@ -17,7 +23,7 @@ interface FileUploadProps extends Pick<FileUploadInputProps, 'icon' | 'triggerLa
|
|
|
17
23
|
onFilesAdd?: (files: File[]) => void;
|
|
18
24
|
onFilesReject?: (rejections: FileRejection[]) => void;
|
|
19
25
|
}
|
|
20
|
-
declare function FileUpload({ className, errors, invalid, items, onFileRemove, onFilesAdd, onFilesReject, ...inputProps }: FileUploadProps): React.JSX.Element;
|
|
26
|
+
declare function FileUpload({ className, 'data-testid': testId, errors, invalid, items, onFileRemove, onFilesAdd, onFilesReject, ...inputProps }: FileUploadProps): React.JSX.Element;
|
|
21
27
|
export { FileUpload };
|
|
22
28
|
export type { FileUploadProps };
|
|
23
29
|
//# sourceMappingURL=FileUpload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUpload.d.ts","sourceRoot":"","sources":["../../../src/composed/FileUpload/FileUpload.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,KAAK,MAAM,EACX,KAAK,aAAa,EAElB,KAAK,oBAAoB,EAC1B,MAAM,8CAA8C,CAAC;
|
|
1
|
+
{"version":3,"file":"FileUpload.d.ts","sourceRoot":"","sources":["../../../src/composed/FileUpload/FileUpload.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,KAAK,MAAM,EACX,KAAK,aAAa,EAElB,KAAK,oBAAoB,EAC1B,MAAM,8CAA8C,CAAC;AAGtD,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5E,UAAU,eAAgB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,MAAM,GAAG,cAAc,CAAC;IACnF;;;;OAIG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IACrC,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;CACvD;AAED,iBAAS,UAAU,CAAC,EAClB,SAAS,EACT,aAAa,EAAE,MAAM,EACrB,MAAM,EACN,OAAO,EACP,KAAK,EACL,YAAY,EACZ,UAAU,EACV,aAAa,EACb,GAAG,UAAU,EACd,EAAE,eAAe,qBAwFjB;AAED,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -3,11 +3,20 @@ type FileUploadStatus = 'error' | 'idle' | 'success' | 'uploading';
|
|
|
3
3
|
interface FileUploadItemValue {
|
|
4
4
|
error?: string;
|
|
5
5
|
file: File;
|
|
6
|
+
/**
|
|
7
|
+
* A stable key. `FileUpload` uses it verbatim as the item's test id key (`${id}-item-<id>`), so it must not end with
|
|
8
|
+
* `-remove`, `-error` or `-progress`.
|
|
9
|
+
*/
|
|
6
10
|
id: string;
|
|
7
11
|
progress?: number;
|
|
8
12
|
status?: FileUploadStatus;
|
|
9
13
|
}
|
|
10
14
|
interface FileUploadItemProps extends Omit<React.ComponentProps<'div'>, 'children' | 'id'> {
|
|
15
|
+
/**
|
|
16
|
+
* Lands on the root. Remove button: `${id}-remove`, error (while it shows): `${id}-error`, progress bar (while it
|
|
17
|
+
* shows): `${id}-progress`.
|
|
18
|
+
*/
|
|
19
|
+
'data-testid'?: string;
|
|
11
20
|
item: FileUploadItemValue;
|
|
12
21
|
onRemove?: (id: string) => void;
|
|
13
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUploadItem.d.ts","sourceRoot":"","sources":["../../../src/composed/FileUpload/FileUploadItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FileUploadItem.d.ts","sourceRoot":"","sources":["../../../src/composed/FileUpload/FileUploadItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,KAAK,gBAAgB,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,CAAC;AAEnE,UAAU,mBAAmB;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,IAAI,CAAC;IACX;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B;AAED,UAAU,mBAAoB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IACxF;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,mBAAmB,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC;AAiCD,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,qBAsDnF;AAED,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1B,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -29197,19 +29197,21 @@ function EJ({ "data-testid": e } = {}) {
|
|
|
29197
29197
|
}
|
|
29198
29198
|
//#endregion
|
|
29199
29199
|
//#region src/composed/FacetedFilter/FacetedFilter.tsx
|
|
29200
|
-
function DJ({ title: e, options: t, selected: n, onChange: r }) {
|
|
29201
|
-
let
|
|
29200
|
+
function DJ({ title: e, options: t, selected: n, onChange: r, "data-testid": i }) {
|
|
29201
|
+
let a = Ke(() => new Set(n), [n]);
|
|
29202
29202
|
return /* @__PURE__ */ G(fB, { children: [/* @__PURE__ */ W(pB, {
|
|
29203
29203
|
asChild: !0,
|
|
29204
29204
|
children: /* @__PURE__ */ G(iy, {
|
|
29205
29205
|
variant: "outline",
|
|
29206
29206
|
size: "sm",
|
|
29207
|
+
"data-testid": i,
|
|
29207
29208
|
children: [
|
|
29208
29209
|
/* @__PURE__ */ W(xe, {}),
|
|
29209
29210
|
e,
|
|
29210
29211
|
n.length > 0 && /* @__PURE__ */ W(Yv, {
|
|
29211
29212
|
variant: "secondary",
|
|
29212
29213
|
className: "ml-1 rounded-full px-1.5 text-xs",
|
|
29214
|
+
"data-testid": xC(i, "count"),
|
|
29213
29215
|
children: n.length
|
|
29214
29216
|
})
|
|
29215
29217
|
]
|
|
@@ -29217,20 +29219,26 @@ function DJ({ title: e, options: t, selected: n, onChange: r }) {
|
|
|
29217
29219
|
}), /* @__PURE__ */ W(mB, {
|
|
29218
29220
|
className: "w-48 p-0",
|
|
29219
29221
|
align: "start",
|
|
29222
|
+
"data-testid": xC(i, "content"),
|
|
29220
29223
|
children: /* @__PURE__ */ G(FF, {
|
|
29221
29224
|
className: "border-none bg-transparent p-0 shadow-none",
|
|
29222
|
-
children: [/* @__PURE__ */ W(LF, {
|
|
29223
|
-
|
|
29225
|
+
children: [/* @__PURE__ */ W(LF, {
|
|
29226
|
+
placeholder: `Filter ${e.toLowerCase()}...`,
|
|
29227
|
+
"data-testid": xC(i, "search")
|
|
29228
|
+
}), /* @__PURE__ */ G(RF, { children: [/* @__PURE__ */ W(zF, { children: "No results." }), /* @__PURE__ */ W(BF, { children: t.map((e) => {
|
|
29229
|
+
let t = a.has(e.value), n = xC(i, `option-${e.value}`);
|
|
29224
29230
|
return /* @__PURE__ */ G(HF, {
|
|
29231
|
+
"data-testid": n,
|
|
29225
29232
|
onSelect: () => {
|
|
29226
|
-
let n = new Set(
|
|
29233
|
+
let n = new Set(a);
|
|
29227
29234
|
t ? n.delete(e.value) : n.add(e.value), r(Array.from(n));
|
|
29228
29235
|
},
|
|
29229
29236
|
children: [/* @__PURE__ */ W(BC, {
|
|
29230
29237
|
checked: t,
|
|
29231
29238
|
className: "pointer-events-none",
|
|
29232
29239
|
tabIndex: -1,
|
|
29233
|
-
"aria-label": e.label
|
|
29240
|
+
"aria-label": e.label,
|
|
29241
|
+
"data-testid": xC(n, "select")
|
|
29234
29242
|
}), e.label]
|
|
29235
29243
|
}, e.value);
|
|
29236
29244
|
}) })] })]
|
|
@@ -29255,11 +29263,11 @@ function AJ({ className: e, file: t }) {
|
|
|
29255
29263
|
}
|
|
29256
29264
|
}
|
|
29257
29265
|
function jJ({ className: e, item: n, onRemove: r, ...i }) {
|
|
29258
|
-
let a = Ue(), o = n.status ?? "idle",
|
|
29266
|
+
let a = Ue(), o = i["data-testid"], s = n.status ?? "idle", c = n.progress !== void 0 && s !== "error";
|
|
29259
29267
|
return /* @__PURE__ */ G(Gz, {
|
|
29260
29268
|
variant: "outline",
|
|
29261
29269
|
size: "sm",
|
|
29262
|
-
"data-status":
|
|
29270
|
+
"data-status": s,
|
|
29263
29271
|
"aria-describedby": n.error ? a : void 0,
|
|
29264
29272
|
className: t("rounded-lg data-[status=error]:border-destructive", e),
|
|
29265
29273
|
...i,
|
|
@@ -29293,14 +29301,16 @@ function jJ({ className: e, item: n, onRemove: r, ...i }) {
|
|
|
29293
29301
|
})
|
|
29294
29302
|
]
|
|
29295
29303
|
}),
|
|
29296
|
-
|
|
29304
|
+
c ? /* @__PURE__ */ W(yB, {
|
|
29297
29305
|
value: n.progress,
|
|
29298
29306
|
"aria-label": `Upload progress: ${n.file.name}`,
|
|
29299
|
-
|
|
29307
|
+
"data-testid": xC(o, "progress"),
|
|
29308
|
+
className: t("h-0.5", s === "success" && "**:data-[slot=progress-indicator]:bg-success")
|
|
29300
29309
|
}) : null,
|
|
29301
29310
|
n.error ? /* @__PURE__ */ W("p", {
|
|
29302
29311
|
id: a,
|
|
29303
29312
|
className: "text-xs text-destructive",
|
|
29313
|
+
"data-testid": xC(o, "error"),
|
|
29304
29314
|
children: n.error
|
|
29305
29315
|
}) : null
|
|
29306
29316
|
]
|
|
@@ -29310,6 +29320,7 @@ function jJ({ className: e, item: n, onRemove: r, ...i }) {
|
|
|
29310
29320
|
size: "icon",
|
|
29311
29321
|
onClick: () => r(n.id),
|
|
29312
29322
|
"aria-label": `Remove ${n.file.name}`,
|
|
29323
|
+
"data-testid": xC(o, "remove"),
|
|
29313
29324
|
className: "text-muted-foreground",
|
|
29314
29325
|
children: /* @__PURE__ */ W(Ce, {})
|
|
29315
29326
|
}) }) : null
|
|
@@ -29318,48 +29329,52 @@ function jJ({ className: e, item: n, onRemove: r, ...i }) {
|
|
|
29318
29329
|
}
|
|
29319
29330
|
//#endregion
|
|
29320
29331
|
//#region src/composed/FileUpload/FileUpload.tsx
|
|
29321
|
-
function MJ({ className: e,
|
|
29322
|
-
let
|
|
29323
|
-
e.length === 1 ?
|
|
29324
|
-
}, h = (e) => {
|
|
29325
|
-
e.length === 1 ? f(`${e[0].file.name} rejected`) : e.length > 1 && f(`${e.length} files rejected`), s?.(e);
|
|
29332
|
+
function MJ({ className: e, "data-testid": n, errors: r, invalid: i, items: a, onFileRemove: o, onFilesAdd: s, onFilesReject: c, ...l }) {
|
|
29333
|
+
let u = H.useRef(null), d = H.useId(), [f, p] = H.useState(""), m = r !== void 0 && r.length > 0, h = (e) => {
|
|
29334
|
+
e.length === 1 ? p(`Added ${e[0].name}`) : e.length > 1 && p(`Added ${e.length} files`), s?.(e);
|
|
29326
29335
|
}, g = (e) => {
|
|
29327
|
-
|
|
29328
|
-
|
|
29329
|
-
let
|
|
29336
|
+
e.length === 1 ? p(`${e[0].file.name} rejected`) : e.length > 1 && p(`${e.length} files rejected`), c?.(e);
|
|
29337
|
+
}, v = (e) => {
|
|
29338
|
+
let t = a.findIndex((t) => t.id === e), n = a[t];
|
|
29339
|
+
n && p(`Removed ${n.file.name}`);
|
|
29340
|
+
let r = a[t + 1] ?? a[t - 1];
|
|
29330
29341
|
requestAnimationFrame(r ? () => {
|
|
29331
|
-
Array.from(
|
|
29332
|
-
} : () =>
|
|
29342
|
+
Array.from(u.current?.querySelectorAll("[data-file-upload-item-id]") ?? []).find((e) => e.getAttribute("data-file-upload-item-id") === r.id)?.querySelector("button")?.focus();
|
|
29343
|
+
} : () => u.current?.querySelector("[data-slot=\"file-upload-trigger\"]")?.focus()), o?.(e);
|
|
29333
29344
|
};
|
|
29334
29345
|
return /* @__PURE__ */ G("div", {
|
|
29335
|
-
ref:
|
|
29346
|
+
ref: u,
|
|
29336
29347
|
"data-slot": "file-upload",
|
|
29348
|
+
"data-testid": n,
|
|
29337
29349
|
className: t("flex flex-col gap-3", e),
|
|
29338
29350
|
children: [
|
|
29339
29351
|
/* @__PURE__ */ W(Fz, {
|
|
29340
|
-
...
|
|
29341
|
-
|
|
29342
|
-
|
|
29343
|
-
|
|
29344
|
-
|
|
29352
|
+
...l,
|
|
29353
|
+
"data-testid": xC(n, "dropzone"),
|
|
29354
|
+
invalid: i || m,
|
|
29355
|
+
describedById: m ? d : void 0,
|
|
29356
|
+
onFilesAccepted: h,
|
|
29357
|
+
onFilesRejected: g
|
|
29345
29358
|
}),
|
|
29346
|
-
|
|
29347
|
-
id:
|
|
29348
|
-
errors:
|
|
29359
|
+
m ? /* @__PURE__ */ W(_, {
|
|
29360
|
+
id: d,
|
|
29361
|
+
errors: r.map((e) => ({ message: e })),
|
|
29362
|
+
"data-testid": xC(n, "error")
|
|
29349
29363
|
}) : null,
|
|
29350
|
-
|
|
29364
|
+
a.length > 0 ? /* @__PURE__ */ W("ul", {
|
|
29351
29365
|
className: "flex flex-col gap-2",
|
|
29352
|
-
children:
|
|
29366
|
+
children: a.map((e) => /* @__PURE__ */ W("li", { children: /* @__PURE__ */ W(jJ, {
|
|
29353
29367
|
item: e,
|
|
29354
|
-
onRemove:
|
|
29355
|
-
"data-file-upload-item-id": e.id
|
|
29368
|
+
onRemove: v,
|
|
29369
|
+
"data-file-upload-item-id": e.id,
|
|
29370
|
+
"data-testid": xC(n, `item-${e.id}`)
|
|
29356
29371
|
}) }, e.id))
|
|
29357
29372
|
}) : null,
|
|
29358
29373
|
/* @__PURE__ */ W("div", {
|
|
29359
29374
|
role: "status",
|
|
29360
29375
|
"aria-live": "polite",
|
|
29361
29376
|
className: "sr-only",
|
|
29362
|
-
children:
|
|
29377
|
+
children: f
|
|
29363
29378
|
})
|
|
29364
29379
|
]
|
|
29365
29380
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravitee/graphene-core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.47.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Gravitee's Graphene design system: accessible React components, design tokens, icons, and shared ESLint/TypeScript configs. Built on shadcn/ui and Tailwind.",
|
|
6
6
|
"keywords": [
|