@ansible/ansible-ui-framework 0.0.721 → 0.0.722

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,3 +11,4 @@ export declare function usePageAlertToaster(): IPageAlertToaster;
11
11
  export declare function PageAlertToasterProvider(props: {
12
12
  children: ReactNode;
13
13
  }): JSX.Element;
14
+ export declare function errorToAlertProps(err: unknown): AlertProps;
package/index.js CHANGED
@@ -3135,6 +3135,17 @@ function Sm(t) {
3135
3135
  t.children
3136
3136
  ] });
3137
3137
  }
3138
+ function tb(t) {
3139
+ return t instanceof Error ? {
3140
+ title: t.message,
3141
+ variant: "danger",
3142
+ timeout: 2e3
3143
+ } : {
3144
+ title: "Unknown",
3145
+ variant: "danger",
3146
+ timeout: 2e3
3147
+ };
3148
+ }
3138
3149
  class yc extends hd {
3139
3150
  constructor() {
3140
3151
  super(...arguments), this.state = {
@@ -3184,14 +3195,14 @@ function vc(t) {
3184
3195
  }
3185
3196
  ) });
3186
3197
  }
3187
- function tb(t) {
3198
+ function rb(t) {
3188
3199
  const { bytes: e } = t;
3189
3200
  if (!+e)
3190
3201
  return /* @__PURE__ */ f.jsx(f.Fragment, {});
3191
3202
  const r = 1024, n = t.decimals ? t.decimals : 0, s = n < 0 ? 0 : n, i = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], a = Math.floor(Math.log(e) / Math.log(r));
3192
3203
  return /* @__PURE__ */ f.jsx(f.Fragment, { children: `${parseFloat((e / Math.pow(r, a)).toFixed(s))} ${i[a]}` });
3193
3204
  }
3194
- const rb = Pr(void 0), nb = Pr(() => null), bc = Pr([void 0, () => alert("Use PageDialogProvider")]);
3205
+ const nb = Pr(void 0), sb = Pr(() => null), bc = Pr([void 0, () => alert("Use PageDialogProvider")]);
3195
3206
  function $m(t) {
3196
3207
  const e = ge();
3197
3208
  return /* @__PURE__ */ f.jsxs(bc.Provider, { value: e, children: [
@@ -3289,7 +3300,7 @@ function Em(t) {
3289
3300
  }, []);
3290
3301
  return /* @__PURE__ */ f.jsx(Vn.Provider, { value: [e, n], children: t.children });
3291
3302
  }
3292
- function sb(t) {
3303
+ function ib(t) {
3293
3304
  const [e, r] = ge(!1), n = pe(() => r(!0), []), [s, i] = Hr();
3294
3305
  return Pe(() => {
3295
3306
  i(e ? /* @__PURE__ */ f.jsx(_m, { open: e, setOpen: r }) : void 0);
@@ -3380,7 +3391,7 @@ function _m(t) {
3380
3391
  }
3381
3392
  );
3382
3393
  }
3383
- function ib(t) {
3394
+ function ab(t) {
3384
3395
  const [e] = bt(), r = Ln(), n = t.used / t.capacity;
3385
3396
  if (t.capacity === 0)
3386
3397
  return /* @__PURE__ */ f.jsx(f.Fragment, {});
@@ -3421,7 +3432,7 @@ function ib(t) {
3421
3432
  ] })
3422
3433
  ] });
3423
3434
  }
3424
- function ab(t) {
3435
+ function ob(t) {
3425
3436
  return t.text ? /* @__PURE__ */ f.jsx(
3426
3437
  wd,
3427
3438
  {
@@ -8325,7 +8336,7 @@ function $n(t) {
8325
8336
  function _g(t) {
8326
8337
  return typeof t == "string" && (t = new Date(t)), t.toLocaleString();
8327
8338
  }
8328
- function ob(t) {
8339
+ function lb(t) {
8329
8340
  const e = new Date(t.value);
8330
8341
  return /* @__PURE__ */ f.jsxs(An, { hasGutter: !0, children: [
8331
8342
  /* @__PURE__ */ f.jsx(tr, { children: e.toLocaleDateString() }),
@@ -8355,7 +8366,7 @@ function Cg(t) {
8355
8366
  n ? /* @__PURE__ */ f.jsx(Xe, { variant: "link", isInline: !0, onClick: n, children: r }) : /* @__PURE__ */ f.jsx("span", { children: r })
8356
8367
  ] });
8357
8368
  }
8358
- function lb(t) {
8369
+ function cb(t) {
8359
8370
  const e = Te(() => new Date(t.start ?? 0).valueOf(), [t.start]), r = Te(() => new Date(t.finish ?? 0).valueOf(), [t.finish]), [n, s] = ge(Math.max(0, r - e.valueOf()));
8360
8371
  Pe(() => {
8361
8372
  const d = setInterval(() => {
@@ -8600,7 +8611,7 @@ function Ug(t) {
8600
8611
  [t]
8601
8612
  );
8602
8613
  }
8603
- function cb(t) {
8614
+ function ub(t) {
8604
8615
  return Te(
8605
8616
  () => t.filter(
8606
8617
  (e) => e.modal !== "hidden"
@@ -8609,7 +8620,7 @@ function cb(t) {
8609
8620
  [t]
8610
8621
  );
8611
8622
  }
8612
- function ub(t, e) {
8623
+ function db(t, e) {
8613
8624
  const r = Cu(t), n = zg(t), s = Ug(t);
8614
8625
  switch (e) {
8615
8626
  case at.Table:
@@ -9722,7 +9733,7 @@ const Iy = Nr.div`
9722
9733
  `, Dy = Nr.span`
9723
9734
  opacity: 0.7;
9724
9735
  `;
9725
- function db(t) {
9736
+ function fb(t) {
9726
9737
  if (!t)
9727
9738
  return !1;
9728
9739
  for (const e of t)
@@ -10442,7 +10453,7 @@ function Xi(t, e, r) {
10442
10453
  }
10443
10454
  Xi.debounce = Xi;
10444
10455
  var By = Xi;
10445
- function fb(t, e, r) {
10456
+ function hb(t, e, r) {
10446
10457
  const {
10447
10458
  selectedItems: n,
10448
10459
  selectItem: s,
@@ -11065,7 +11076,7 @@ function ev() {
11065
11076
  e(void 0);
11066
11077
  }, [r, e]), n;
11067
11078
  }
11068
- function hb() {
11079
+ function mb() {
11069
11080
  const t = ev(), e = Yy();
11070
11081
  return pe(
11071
11082
  (r) => {
@@ -11080,7 +11091,7 @@ function hb() {
11080
11091
  [e, t]
11081
11092
  );
11082
11093
  }
11083
- function mb(t) {
11094
+ function pb(t) {
11084
11095
  const { title: e, view: r, tableColumns: n, toolbarFilters: s, confirmText: i, cancelText: a, onSelect: o } = t, [l, c] = Hr(), d = pe(() => c(void 0), [c]), [h] = bt();
11085
11096
  return /* @__PURE__ */ f.jsx(
11086
11097
  dn,
@@ -11425,7 +11436,7 @@ function Qo(t) {
11425
11436
  let e = "collapsed";
11426
11437
  return t.open && (e += " expanded"), /* @__PURE__ */ f.jsx("div", { className: e, children: t.children });
11427
11438
  }
11428
- function pb(t) {
11439
+ function gb(t) {
11429
11440
  const { view: e, tableColumns: r, toolbarFilters: n, confirm: s, cancel: i, selected: a, isMultiple: o } = t, [l, c] = ge(""), [d, h] = ge(), u = pe((y, v) => {
11430
11441
  c(v ?? ""), h(() => y);
11431
11442
  }, []), [m, p] = Hr();
@@ -12616,7 +12627,7 @@ function Bv(t = {}) {
12616
12627
  s._state.mount || (s._updateValid(), s._state.mount = !0), s._state.watch && (s._state.watch = !1, s._subjects.state.next({ ...s._formState })), s._removeUnmounted();
12617
12628
  }), e.current.formState = Lu(r, s), e.current;
12618
12629
  }
12619
- function gb(t) {
12630
+ function yb(t) {
12620
12631
  const { name: e, readOnly: r, validate: n, ...s } = t, {
12621
12632
  control: i,
12622
12633
  formState: { isSubmitting: a }
@@ -12647,7 +12658,7 @@ function gb(t) {
12647
12658
  function jr(t) {
12648
12659
  return t.charAt(0).toUpperCase() + t.slice(1);
12649
12660
  }
12650
- function yb(t) {
12661
+ function vb(t) {
12651
12662
  const { isReadOnly: e, validate: r, ...n } = t, { label: s, name: i, isRequired: a } = t, {
12652
12663
  control: o,
12653
12664
  formState: { isSubmitting: l, isValidating: c }
@@ -12752,7 +12763,7 @@ function Wv(t) {
12752
12763
  }
12753
12764
  );
12754
12765
  }
12755
- function vb(t) {
12766
+ function bb(t) {
12756
12767
  const {
12757
12768
  control: e,
12758
12769
  formState: { isSubmitting: r }
@@ -12776,7 +12787,7 @@ function vb(t) {
12776
12787
  }
12777
12788
  );
12778
12789
  }
12779
- function bb(t) {
12790
+ function wb(t) {
12780
12791
  const { label: e, isRequired: r, validate: n } = t, {
12781
12792
  control: s,
12782
12793
  formState: { isSubmitting: i }
@@ -12808,7 +12819,7 @@ function bb(t) {
12808
12819
  }
12809
12820
  );
12810
12821
  }
12811
- function wb(t) {
12822
+ function xb(t) {
12812
12823
  const {
12813
12824
  name: e,
12814
12825
  id: r,
@@ -12853,7 +12864,7 @@ function wb(t) {
12853
12864
  }
12854
12865
  );
12855
12866
  }
12856
- function xb(t) {
12867
+ function Sb(t) {
12857
12868
  const { name: e, label: r, isReadOnly: n, isRequired: s, minLength: i, maxLength: a, pattern: o, validate: l } = t, {
12858
12869
  control: c,
12859
12870
  formState: { isSubmitting: d }
@@ -12900,7 +12911,7 @@ function xb(t) {
12900
12911
  }
12901
12912
  );
12902
12913
  }
12903
- function Sb(t) {
12914
+ function $b(t) {
12904
12915
  const {
12905
12916
  name: e,
12906
12917
  isReadOnly: r,
@@ -12983,7 +12994,7 @@ function Sb(t) {
12983
12994
  }
12984
12995
  );
12985
12996
  }
12986
- function $b(t) {
12997
+ function Eb(t) {
12987
12998
  const {
12988
12999
  register: e,
12989
13000
  setValue: r,
@@ -16285,7 +16296,7 @@ var P0 = /* @__PURE__ */ Object.defineProperty({ default: O0 }, "__esModule", {
16285
16296
  }
16286
16297
  };
16287
16298
  };
16288
- function Eb(t) {
16299
+ function _b(t) {
16289
16300
  const { schema: e, defaultValue: r, disableBody: n, disablePadding: s } = t, i = Bv({
16290
16301
  defaultValues: r ?? {},
16291
16302
  resolver: e ? A0(
@@ -16370,7 +16381,7 @@ function gl(t) {
16370
16381
  function M0(t) {
16371
16382
  return /* @__PURE__ */ f.jsx(Xe, { type: "button", variant: "link", onClick: t.onCancel, children: t.children });
16372
16383
  }
16373
- function _b(t) {
16384
+ function Cb(t) {
16374
16385
  return /* @__PURE__ */ f.jsx(gh, { children: /* @__PURE__ */ f.jsx(Em, { children: /* @__PURE__ */ f.jsx($m, { children: /* @__PURE__ */ f.jsx(Sm, { children: /* @__PURE__ */ f.jsx(Ig, { callback: t.navigate, children: t.children }) }) }) }) });
16375
16386
  }
16376
16387
  function F0(t) {
@@ -16395,7 +16406,7 @@ function F0(t) {
16395
16406
  r.id ?? r.label ?? n
16396
16407
  ) : /* @__PURE__ */ f.jsx(Or, {}, n)) }) : /* @__PURE__ */ f.jsx(Or, {});
16397
16408
  }
16398
- function Cb(t) {
16409
+ function Tb(t) {
16399
16410
  const { navigation: e, breadcrumbs: r, title: n, description: s, controls: i, headerActions: a, footer: o } = t, l = ar("lg"), c = ar("xl"), d = ar("md"), [h] = bt();
16400
16411
  return /* @__PURE__ */ f.jsxs(f.Fragment, { children: [
16401
16412
  e && /* @__PURE__ */ f.jsx(
@@ -16486,7 +16497,7 @@ function Cb(t) {
16486
16497
  )
16487
16498
  ] });
16488
16499
  }
16489
- function Tb(t) {
16500
+ function kb(t) {
16490
16501
  const [e] = bt();
16491
16502
  return /* @__PURE__ */ f.jsx(yc, { message: e.errorText, children: /* @__PURE__ */ f.jsx(
16492
16503
  "div",
@@ -16558,7 +16569,7 @@ function V0(t) {
16558
16569
  function yl(t) {
16559
16570
  return /* @__PURE__ */ f.jsx(f.Fragment, { children: t.children });
16560
16571
  }
16561
- function kb(t) {
16572
+ function jb(t) {
16562
16573
  const { activeKey: e, setActiveKey: r } = t, n = pe(
16563
16574
  (s, i) => r(i),
16564
16575
  [r]
@@ -16787,7 +16798,7 @@ function G0(t, e) {
16787
16798
  [p, u, s, a, l, d]
16788
16799
  );
16789
16800
  }
16790
- function jb(t) {
16801
+ function Ob(t) {
16791
16802
  const { items: e, keyFn: r, tableColumns: n, toolbarFilters: s, disableQueryString: i } = t, a = G0(
16792
16803
  {
16793
16804
  sort: n && n.length ? n[0].sort : void 0
@@ -16835,29 +16846,29 @@ function jb(t) {
16835
16846
  }
16836
16847
  export {
16837
16848
  Ny as BulkSelector,
16838
- tb as BytesCell,
16839
- ib as CapacityCell,
16849
+ rb as BytesCell,
16850
+ ab as CapacityCell,
16840
16851
  Qo as Collapse,
16841
16852
  Vg as ColumnCardOption,
16842
16853
  Fg as ColumnListOption,
16843
16854
  Lg as ColumnModalOption,
16844
16855
  Mg as ColumnTableOption,
16845
- ab as CopyCell,
16846
- ob as DateCell,
16856
+ ob as CopyCell,
16857
+ lb as DateCell,
16847
16858
  Cg as DateTimeCell,
16848
- rb as DialogContext,
16849
- lb as ElapsedTimeCell,
16859
+ nb as DialogContext,
16860
+ cb as ElapsedTimeCell,
16850
16861
  Ar as FormGroupSelect,
16851
16862
  Cv as FormGroupSelectOption,
16852
16863
  Tv as FormGroupTextArea,
16853
16864
  kv as FormGroupTextInput,
16854
- $b as FormTextSelect,
16865
+ Eb as FormTextSelect,
16855
16866
  gh as FrameworkTranslationsProvider,
16856
16867
  wc as Help,
16857
16868
  Pg as LabelColorE,
16858
16869
  Tg as LabelsCell,
16859
16870
  Wv as MonacoEditor,
16860
- mb as MultiSelectDialog,
16871
+ pb as MultiSelectDialog,
16861
16872
  kg as PFColorE,
16862
16873
  nt as PageActionSelection,
16863
16874
  jt as PageActionType,
@@ -16869,30 +16880,30 @@ export {
16869
16880
  Ag as PageDetails,
16870
16881
  Hg as PageDetailsFromColumns,
16871
16882
  $m as PageDialogProvider,
16872
- Eb as PageForm,
16883
+ _b as PageForm,
16873
16884
  M0 as PageFormCancelButton,
16874
- gb as PageFormCheckbox,
16875
- yb as PageFormCodeEditor,
16885
+ yb as PageFormCheckbox,
16886
+ vb as PageFormCodeEditor,
16876
16887
  pl as PageFormGrid,
16877
- vb as PageFormSelect,
16878
- bb as PageFormSelectOption,
16888
+ bb as PageFormSelect,
16889
+ wb as PageFormSelectOption,
16879
16890
  gl as PageFormSubmitButton,
16880
- wb as PageFormSwitch,
16881
- xb as PageFormTextArea,
16882
- Sb as PageFormTextInput,
16883
- _b as PageFramework,
16884
- Cb as PageHeader,
16885
- Tb as PageLayout,
16891
+ xb as PageFormSwitch,
16892
+ Sb as PageFormTextArea,
16893
+ $b as PageFormTextInput,
16894
+ Cb as PageFramework,
16895
+ Tb as PageHeader,
16896
+ kb as PageLayout,
16886
16897
  yl as PageTab,
16887
16898
  ei as PageTable,
16888
16899
  jy as PageTableCards,
16889
16900
  Ry as PageTableToolbar,
16890
16901
  V0 as PageTabs,
16891
- kb as PageTabsOld,
16902
+ jb as PageTabsOld,
16892
16903
  z0 as RunningIcon,
16893
16904
  Go as Scrollable,
16894
16905
  _v as SelectDialog,
16895
- nb as SetDialogContext,
16906
+ sb as SetDialogContext,
16896
16907
  Vn as SettingsContext,
16897
16908
  _m as SettingsDialog,
16898
16909
  Em as SettingsProvider,
@@ -16901,37 +16912,38 @@ export {
16901
16912
  Ky as compareNumbers,
16902
16913
  bs as compareStrings,
16903
16914
  Zy as compareUnknowns,
16915
+ tb as errorToAlertProps,
16904
16916
  wu as getPatternflyColor,
16905
16917
  Su as pfDanger,
16906
16918
  Og as pfDisabled,
16907
16919
  $u as pfInfo,
16908
16920
  xu as pfSuccess,
16909
16921
  jg as pfWarning,
16910
- db as toolbarActionsHaveBulkActions,
16922
+ fb as toolbarActionsHaveBulkActions,
16911
16923
  ar as useBreakpoint,
16912
16924
  Yy as useBulkActionDialog,
16913
- hb as useBulkConfirmation,
16925
+ mb as useBulkConfirmation,
16914
16926
  Bg as useDescriptionColumns,
16915
16927
  Wg as useExpandedColumns,
16916
16928
  Du as useFiltered,
16917
16929
  bt as useFrameworkTranslations,
16918
- jb as useInMemoryView,
16930
+ Ob as useInMemoryView,
16919
16931
  Q0 as useOrientation,
16920
16932
  eb as usePageAlertToaster,
16921
16933
  Hr as usePageDialog,
16922
16934
  ti as usePaged,
16923
- pb as useSelectDialog,
16935
+ gb as useSelectDialog,
16924
16936
  Wy as useSelected,
16925
16937
  Hy as useSelectedInMemory,
16926
16938
  Ln as useSettings,
16927
- sb as useSettingsDialog,
16939
+ ib as useSettingsDialog,
16928
16940
  Iu as useSorted,
16929
- fb as useTableItems,
16941
+ hb as useTableItems,
16930
16942
  G0 as useView,
16931
16943
  Ug as useVisibleCardColumns,
16932
- ub as useVisibleColumns,
16944
+ db as useVisibleColumns,
16933
16945
  zg as useVisibleListColumns,
16934
- cb as useVisibleModalColumns,
16946
+ ub as useVisibleModalColumns,
16935
16947
  Cu as useVisibleTableColumns,
16936
16948
  Nf as useWindowSize
16937
16949
  };