@webority/ui-react 0.23.1 → 0.24.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.
@@ -21,9 +21,10 @@ import "@webority/ui-elements";
21
21
  * @param {{ key: string, label: import('react').ReactNode, items: { key: string,
22
22
  * label: import('react').ReactNode, description?: import('react').ReactNode,
23
23
  * icon?: string | import('react').ReactNode, meta?: import('react').ReactNode,
24
- * onSelect?: () => void }[] }[]} [props.groups=[]] Results, rendered in order under
25
- * their group headings. Keys must be unique within their group; groups with no items are
26
- * left out. `icon` is a library icon name or a node; `meta` is short trailing text or a node.
24
+ * disabled?: boolean, onSelect?: () => void }[] }[]} [props.groups=[]] Results, rendered in
25
+ * order under their group headings. Keys must be unique within their group; groups with no
26
+ * items are left out. `icon` is a library icon name or a node; `meta` is short trailing text
27
+ * or a node. A `disabled` item is listed but cannot be chosen: the arrow keys skip it.
27
28
  * @param {boolean} [props.loading=false] Shows the library spinner in the input.
28
29
  * @param {import('react').ReactNode} [props.emptyText='No results'] Shown when the query is
29
30
  * not blank, nothing is loading, and no group has items.
@@ -49,6 +50,7 @@ export default function AppCommandPalette({ open, onClose, query, onQueryChange,
49
50
  description?: import('react').ReactNode;
50
51
  icon?: string | import('react').ReactNode;
51
52
  meta?: import('react').ReactNode;
53
+ disabled?: boolean;
52
54
  onSelect?: () => void;
53
55
  }[];
54
56
  }[];
@@ -4,10 +4,8 @@
4
4
  * A page-size menu ("10 per page") beside the page buttons. It shows no row range and no total:
5
5
  * the page buttons already say where you are.
6
6
  *
7
- * `page` is ONE-BASED, matching `<app-table-pagination page="…">` (the shared 1-based pagination contract). It used to be zero-based here while
8
- * Razor's was one-based — the same prop name meaning different things on the two surfaces,
9
- * which no name-level check can see. `pageCount` is likewise now `totalPages`, the name
10
- * Razor and the shared response shape already use.
7
+ * `page` is ONE-BASED, matching `<app-table-pagination page="…">` and the shared pagination contract.
8
+ * `totalPages` is the page count, the name Razor and the shared response shape use.
11
9
  *
12
10
  * @param {object} props
13
11
  * @param {number} props.page 1-based.
package/dist/ui-react.js CHANGED
@@ -2021,6 +2021,7 @@ function $t({ baseId: e, query: t, onQueryChange: n, placeholder: r, groups: i,
2021
2021
  id: `${r}-${tn(e.key)}`,
2022
2022
  "data-group-key": String(n.key),
2023
2023
  "data-key": String(e.key),
2024
+ "aria-disabled": e.disabled ? "true" : void 0,
2024
2025
  children: [
2025
2026
  e.icon != null && /* @__PURE__ */ E("span", {
2026
2027
  className: "wui-cmd-item-icon",
@@ -3899,11 +3900,45 @@ function fr(e, t) {
3899
3900
  }
3900
3901
  return [];
3901
3902
  }
3902
- function pr({ facet: e, value: t, onChange: n }) {
3903
+ function pr({ facets: e, value: t, onChange: n, className: r = "", ...i }) {
3904
+ K("AppFilterBar", i);
3905
+ for (let t of e) J("AppFilterBar", "facets[].type", t.type, lr);
3906
+ let a = e.flatMap((e) => fr(e, t[e.key]).map((t) => ({
3907
+ ...t,
3908
+ facet: e
3909
+ }))), o = e.filter((e) => $n(e, t[e.key]));
3910
+ return /* @__PURE__ */ D("div", {
3911
+ className: `wui-filter-bar d-flex flex-wrap align-items-center gap-2${r ? ` ${r}` : ""}`,
3912
+ ...i,
3913
+ children: [
3914
+ e.map((e) => /* @__PURE__ */ E(mr, {
3915
+ facet: e,
3916
+ value: t[e.key],
3917
+ onChange: (t) => n(e.key, t)
3918
+ }, e.key)),
3919
+ a.map((e) => /* @__PURE__ */ E(Pt, {
3920
+ size: "sm",
3921
+ label: `${e.facet.label}: ${e.text}`,
3922
+ removeLabel: `Remove ${e.facet.label} filter ${e.text}`,
3923
+ onRemove: () => n(e.facet.key, e.clear())
3924
+ }, e.id)),
3925
+ o.length > 1 && /* @__PURE__ */ E(et, {
3926
+ variant: "ghost",
3927
+ size: "sm",
3928
+ onClick: () => {
3929
+ for (let e of o) n(e.key, Qn(e));
3930
+ },
3931
+ children: "Clear all"
3932
+ })
3933
+ ]
3934
+ });
3935
+ }
3936
+ function mr({ facet: e, value: t, onChange: n }) {
3903
3937
  if (e.type === "enum") {
3904
3938
  let r = e.options ?? [];
3905
3939
  return r.length < ur ? /* @__PURE__ */ E(or, {
3906
3940
  label: e.label,
3941
+ name: e.key,
3907
3942
  size: "sm",
3908
3943
  value: t ?? "",
3909
3944
  onChange: n,
@@ -3913,6 +3948,7 @@ function pr({ facet: e, value: t, onChange: n }) {
3913
3948
  }, ...r]
3914
3949
  }) : /* @__PURE__ */ E(cr, {
3915
3950
  "aria-label": e.label,
3951
+ name: e.key,
3916
3952
  placeholder: e.label,
3917
3953
  size: "sm",
3918
3954
  clearable: !0,
@@ -3923,6 +3959,7 @@ function pr({ facet: e, value: t, onChange: n }) {
3923
3959
  }
3924
3960
  return e.type === "multiEnum" ? /* @__PURE__ */ E(rr, {
3925
3961
  "aria-label": e.label,
3962
+ name: e.key,
3926
3963
  placeholder: e.label,
3927
3964
  size: "sm",
3928
3965
  collapseChips: !0,
@@ -3931,6 +3968,8 @@ function pr({ facet: e, value: t, onChange: n }) {
3931
3968
  options: e.options ?? []
3932
3969
  }) : e.type === "dateRange" ? /* @__PURE__ */ E(Dn, {
3933
3970
  ariaLabel: e.label,
3971
+ startName: `${e.key}From`,
3972
+ endName: `${e.key}To`,
3934
3973
  placeholder: e.label,
3935
3974
  size: "sm",
3936
3975
  start: t?.from ?? "",
@@ -3941,45 +3980,13 @@ function pr({ facet: e, value: t, onChange: n }) {
3941
3980
  })
3942
3981
  }) : /* @__PURE__ */ E(ir, {
3943
3982
  ariaLabel: e.label,
3983
+ name: e.key,
3944
3984
  placeholder: e.label,
3945
3985
  size: "sm",
3946
3986
  value: t ?? "",
3947
3987
  onChange: n
3948
3988
  });
3949
3989
  }
3950
- function mr({ facets: e, value: t, onChange: n, className: r = "", ...i }) {
3951
- K("AppFilterBar", i);
3952
- for (let t of e) J("AppFilterBar", "facets[].type", t.type, lr);
3953
- let a = e.flatMap((e) => fr(e, t[e.key]).map((t) => ({
3954
- ...t,
3955
- facet: e
3956
- }))), o = e.filter((e) => $n(e, t[e.key]));
3957
- return /* @__PURE__ */ D("div", {
3958
- className: `wui-filter-bar d-flex flex-wrap align-items-center gap-2${r ? ` ${r}` : ""}`,
3959
- ...i,
3960
- children: [
3961
- e.map((e) => /* @__PURE__ */ E(pr, {
3962
- facet: e,
3963
- value: t[e.key],
3964
- onChange: (t) => n(e.key, t)
3965
- }, e.key)),
3966
- a.map((e) => /* @__PURE__ */ E(Pt, {
3967
- size: "sm",
3968
- label: `${e.facet.label}: ${e.text}`,
3969
- removeLabel: `Remove ${e.facet.label} filter ${e.text}`,
3970
- onRemove: () => n(e.facet.key, e.clear())
3971
- }, e.id)),
3972
- o.length > 1 && /* @__PURE__ */ E(et, {
3973
- variant: "ghost",
3974
- size: "sm",
3975
- onClick: () => {
3976
- for (let e of o) n(e.key, Qn(e));
3977
- },
3978
- children: "Clear all"
3979
- })
3980
- ]
3981
- });
3982
- }
3983
3990
  //#endregion
3984
3991
  //#region src/components/AppFloatingDock.jsx
3985
3992
  function hr({ items: e = [], linkComponent: t, ariaLabel: n = "Quick navigation", magnify: r = !0, maxScale: i, radius: a, className: o = "", ...s }) {
@@ -7571,4 +7578,4 @@ function Va(e, { sort: t } = {}) {
7571
7578
  };
7572
7579
  }
7573
7580
  //#endregion
7574
- export { Ue as AppAccordion, Ge as AppActionIcon, Xe as AppAlert, rt as AppAsyncBlock, gt as AppAutocomplete, St as AppAvatar, Tt as AppAvatarGroup, Et as AppBadge, Ot as AppBanner, kt as AppBreadcrumbs, et as AppButton, jt as AppCard, Nt as AppCheckbox, Pt as AppChip, Rt as AppChoiceCard, zt as AppChoiceChip, Bt as AppColorField, Gt as AppColumnMenu, Qt as AppCommandPalette, rn as AppCompareTable, cn as AppConfirmDialog, un as AppConsentBanner, fn as AppCopyButton, mn as AppCountrySelect, Tn as AppDataTable, En as AppDatePicker, Dn as AppDateRangePicker, On as AppDescriptions, Ut as AppDropdown, tt as AppEmptyState, jn as AppErrorSummary, Ln as AppFileAttachment, Bn as AppFilePicker, Wn as AppFileViewer, mr as AppFilterBar, hr as AppFloatingDock, gr as AppFormActions, _r as AppFormRow, xr as AppFormSection, Y as AppIcon, Sr as AppInfoList, st as AppInfoTip, an as AppInput, Dr as AppKpiTile, jr as AppLink, Nr as AppLogoPicker, Lr as AppMeter, Xt as AppModal, rr as AppMultiSelect, Rr as AppNumberInput, zr as AppOtpInput, Vr as AppPageHeader, Hr as AppPagination, Ur as AppPhoneNumberInput, at as AppPopover, Wr as AppPricingCard, qr as AppProgress, Si as AppQrCode, Ci as AppRadio, wi as AppRadioGroup, Ti as AppRepeater, Z as AppRequiredMark, Ei as AppResourceCard, Oi as AppResult, ki as AppScrollbar, ir as AppSearch, or as AppSegmented, cr as AppSelect, yn as AppSelectMini, Ai as AppShell, Ni as AppSidebarMenu, hn as AppSkeleton, gn as AppSkeletonRows, Pi as AppSlider, nt as AppSpinner, Ii as AppSplash, Li as AppStatusBadge, Ri as AppStepper, Bi as AppSwitch, Vi as AppTableEmptyState, xn as AppTablePagination, Hi as AppTableToolbar, Ki as AppTabs, qi as AppTagInput, Ji as AppTextarea, Qi as AppThemeToggle, ta as AppTimePicker, ea as AppTimeline, xa as AppToast, Ca as AppToolbar, be as AppTooltip, wa as AppWizard, Ea as AppWorkspaceSwitcher, sn as MODAL_ICONS, Zn as buildListQuery, ja as dismissAll, Pa as errorToast, Be as iconNames, nr as parseListQuery, He as registerIcons, Na as toast, Fa as useCommandPaletteShortcut, La as useListQuery, Ra as usePagination, Va as useTableView };
7581
+ export { Ue as AppAccordion, Ge as AppActionIcon, Xe as AppAlert, rt as AppAsyncBlock, gt as AppAutocomplete, St as AppAvatar, Tt as AppAvatarGroup, Et as AppBadge, Ot as AppBanner, kt as AppBreadcrumbs, et as AppButton, jt as AppCard, Nt as AppCheckbox, Pt as AppChip, Rt as AppChoiceCard, zt as AppChoiceChip, Bt as AppColorField, Gt as AppColumnMenu, Qt as AppCommandPalette, rn as AppCompareTable, cn as AppConfirmDialog, un as AppConsentBanner, fn as AppCopyButton, mn as AppCountrySelect, Tn as AppDataTable, En as AppDatePicker, Dn as AppDateRangePicker, On as AppDescriptions, Ut as AppDropdown, tt as AppEmptyState, jn as AppErrorSummary, Ln as AppFileAttachment, Bn as AppFilePicker, Wn as AppFileViewer, pr as AppFilterBar, hr as AppFloatingDock, gr as AppFormActions, _r as AppFormRow, xr as AppFormSection, Y as AppIcon, Sr as AppInfoList, st as AppInfoTip, an as AppInput, Dr as AppKpiTile, jr as AppLink, Nr as AppLogoPicker, Lr as AppMeter, Xt as AppModal, rr as AppMultiSelect, Rr as AppNumberInput, zr as AppOtpInput, Vr as AppPageHeader, Hr as AppPagination, Ur as AppPhoneNumberInput, at as AppPopover, Wr as AppPricingCard, qr as AppProgress, Si as AppQrCode, Ci as AppRadio, wi as AppRadioGroup, Ti as AppRepeater, Z as AppRequiredMark, Ei as AppResourceCard, Oi as AppResult, ki as AppScrollbar, ir as AppSearch, or as AppSegmented, cr as AppSelect, yn as AppSelectMini, Ai as AppShell, Ni as AppSidebarMenu, hn as AppSkeleton, gn as AppSkeletonRows, Pi as AppSlider, nt as AppSpinner, Ii as AppSplash, Li as AppStatusBadge, Ri as AppStepper, Bi as AppSwitch, Vi as AppTableEmptyState, xn as AppTablePagination, Hi as AppTableToolbar, Ki as AppTabs, qi as AppTagInput, Ji as AppTextarea, Qi as AppThemeToggle, ta as AppTimePicker, ea as AppTimeline, xa as AppToast, Ca as AppToolbar, be as AppTooltip, wa as AppWizard, Ea as AppWorkspaceSwitcher, sn as MODAL_ICONS, Zn as buildListQuery, ja as dismissAll, Pa as errorToast, Be as iconNames, nr as parseListQuery, He as registerIcons, Na as toast, Fa as useCommandPaletteShortcut, La as useListQuery, Ra as usePagination, Va as useTableView };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/ui-react",
3
- "version": "0.23.1",
3
+ "version": "0.24.0",
4
4
  "description": "Webority shared React component library — App* primitives on react-bootstrap + the @webority/theme design system.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -29,8 +29,8 @@
29
29
  },
30
30
  "sideEffects": false,
31
31
  "dependencies": {
32
- "@webority/theme": "0.23.1",
33
- "@webority/ui-elements": "0.23.1"
32
+ "@webority/theme": "0.24.0",
33
+ "@webority/ui-elements": "0.24.0"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "@webority/analytics": "^0.6.0 || ^0.7.0 || ^0.8.0",