@gpustack/core-ui 1.0.3 → 1.0.5

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/dist/index.es.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { o as e, r as t, t as n } from "./rolldown-runtime-BETGA6I9.js";
2
2
  import { i as r, n as i, r as a, t as o } from "./useIntl-BZWVSOXz.js";
3
3
  import { t as s } from "./lodash-k2j6dYGv.js";
4
- import { a as c, i as l, n as u, o as d, r as f, t as p } from "./highlight-code-CyMnhIMR.js";
4
+ import { a as c, i as l, n as u, o as d, r as f, t as p } from "./highlight-code-BGo6UgwT.js";
5
5
  import { A as m, _ as h, a as g, c as _, f as v, g as y, n as b, s as x, y as S } from "./utils-CAmt8TVf.js";
6
- import { t as C } from "./editor-wrap-CMFkPgsW.js";
6
+ import { t as C } from "./editor-wrap-DFbXkvlV.js";
7
7
  import w from "axios";
8
8
  import * as T from "react";
9
9
  import E, { PureComponent as D, createContext as O, createElement as k, forwardRef as A, isValidElement as j, memo as M, useCallback as N, useContext as P, useEffect as F, useImperativeHandle as I, useLayoutEffect as L, useMemo as R, useRef as z, useState as B, version as ee } from "react";
@@ -4158,7 +4158,7 @@ var da = J.div`
4158
4158
  }
4159
4159
 
4160
4160
  .ant-select .ant-select-input {
4161
- top: -5px !important;
4161
+ top: -1px !important;
4162
4162
  }
4163
4163
  .ant-select-placeholder {
4164
4164
  position: absolute;
@@ -5403,36 +5403,39 @@ var jo = ({ height: e, title: t }) => /* @__PURE__ */ U("div", {
5403
5403
  children: /* @__PURE__ */ H(pt, { image: pt.PRESENTED_IMAGE_SIMPLE })
5404
5404
  })]
5405
5405
  }), Mo = M((e) => {
5406
- let { seriesData: t, xAxisData: n, height: r, width: i, labelFormatter: a, legendData: o, title: s } = e, { barItemConfig: c, grid: l, legend: u, title: d, tooltip: f, xAxis: p, yAxis: m } = Ao(), h = R(() => {
5406
+ let { seriesData: t, xAxisData: n, height: r, width: i, labelFormatter: a, legendData: o, title: s, stack: c = "total" } = e, { barItemConfig: l, grid: u, legend: d, title: f, tooltip: p, xAxis: m, yAxis: h } = Ao(), g = R(() => {
5407
5407
  let e = {
5408
5408
  title: { text: "" },
5409
- grid: l,
5410
- tooltip: { ...f },
5409
+ grid: u,
5410
+ tooltip: { ...p },
5411
5411
  xAxis: {
5412
- ...p,
5412
+ ...m,
5413
5413
  axisLabel: {
5414
- ...p.axisLabel,
5414
+ ...m.axisLabel,
5415
5415
  formatter: a
5416
5416
  },
5417
5417
  data: []
5418
5418
  },
5419
- yAxis: m,
5419
+ yAxis: h,
5420
5420
  legend: {
5421
- ...u,
5421
+ ...d,
5422
5422
  data: []
5423
5423
  },
5424
5424
  series: []
5425
- }, r = Z.default.map(t, (e) => ({
5426
- ...e,
5427
- ...c,
5428
- stack: "total",
5429
- itemStyle: { color: e.color }
5430
- }));
5425
+ }, r = Z.default.map(t, (e) => {
5426
+ let { stack: t, ...n } = e, r = t ?? c;
5427
+ return {
5428
+ ...n,
5429
+ ...l,
5430
+ ...r === !1 ? {} : { stack: r },
5431
+ itemStyle: { color: e.color }
5432
+ };
5433
+ });
5431
5434
  return {
5432
5435
  ...e,
5433
5436
  animation: !1,
5434
5437
  title: {
5435
- ...d,
5438
+ ...f,
5436
5439
  text: s
5437
5440
  },
5438
5441
  yAxis: { ...e.yAxis },
@@ -5447,16 +5450,17 @@ var jo = ({ height: e, title: t }) => /* @__PURE__ */ U("div", {
5447
5450
  n,
5448
5451
  s,
5449
5452
  a,
5450
- f,
5451
- l,
5452
5453
  p,
5453
- m,
5454
5454
  u,
5455
+ m,
5456
+ h,
5457
+ d,
5458
+ l,
5455
5459
  c
5456
5460
  ]);
5457
5461
  return /* @__PURE__ */ H(V, { children: t.length ? /* @__PURE__ */ H(Oo, {
5458
5462
  height: r,
5459
- options: h,
5463
+ options: g,
5460
5464
  width: i || "100%"
5461
5465
  }) : /* @__PURE__ */ H(jo, {
5462
5466
  height: r,
@@ -6451,7 +6455,7 @@ var Es = (e) => {
6451
6455
  padding: "16px 24px 8px",
6452
6456
  display: "flex",
6453
6457
  justifyContent: "flex-end"
6454
- }, Os = ({ title: e, open: t, onCancel: n, onSubmit: r, children: i, width: a = 600, subTitle: o, footer: s }) => /* @__PURE__ */ H(Es, {
6458
+ }, Os = ({ title: e, open: t, onCancel: n, onSubmit: r, children: i, width: a = 600, subTitle: o, footer: s, loading: c }) => /* @__PURE__ */ H(Es, {
6455
6459
  title: /* @__PURE__ */ U(V, { children: [e, o && /* @__PURE__ */ H(Mt, {
6456
6460
  variant: "outlined",
6457
6461
  style: {
@@ -6477,6 +6481,7 @@ var Es = (e) => {
6477
6481
  footer: s ?? /* @__PURE__ */ H(Ko, {
6478
6482
  onOk: r,
6479
6483
  onCancel: n,
6484
+ loading: c,
6480
6485
  style: Ds
6481
6486
  }),
6482
6487
  children: i
@@ -8238,18 +8243,19 @@ var Cc = (e) => {
8238
8243
  onBlur: (e, t) => a?.(e, t, n)
8239
8244
  }, n)) })
8240
8245
  });
8241
- }, Pc = ({ labels: e, onChange: t, onBlur: n, onDelete: r, disabled: i, label: a, btnText: s, description: c, isAutoComplete: l, enablePaste: u = !0 }) => {
8246
+ }, Pc = ({ value: e, onChange: t, onBlur: n, onDelete: r, disabled: i, label: a, btnText: s, description: c, isAutoComplete: l, enablePaste: u = !0 }) => {
8242
8247
  let d = o(), [f, p] = B({}), [m, h] = B([]);
8243
8248
  F(() => {
8244
- Z.default.isEqual(e, f) || (p(e || {}), h(Z.default.map(Z.default.keys(e), (t) => ({
8245
- key: t,
8246
- value: e[t]
8249
+ let t = e ?? {};
8250
+ Z.default.isEqual(t, f) || (p(t), h(Z.default.map(Z.default.keys(t), (e) => ({
8251
+ key: e,
8252
+ value: t[e]
8247
8253
  }))));
8248
8254
  }, [e]);
8249
8255
  let g = (e) => {
8250
8256
  h(e);
8251
8257
  }, _ = (e) => {
8252
- console.log("handleLabelsChange", e), p(e), t?.(e);
8258
+ p(e), t?.(e);
8253
8259
  }, v = (e) => {
8254
8260
  let n = Z.default.reduce(e, (e, t) => (t.key && (e[t.key] = t.value), e), {});
8255
8261
  t?.(n);
@@ -8270,10 +8276,10 @@ var Cc = (e) => {
8270
8276
  if (!n || n.indexOf("=") === -1) return;
8271
8277
  e.preventDefault();
8272
8278
  let r = Z.default.split(n, /\r?\n/).map((e) => e.trim()).filter((e) => e && e.includes("=")).map((e) => {
8273
- let [t, n] = e.split(/=(.+)/).map((e) => e.trim());
8279
+ let [t = "", n = ""] = e.split(/=(.+)/);
8274
8280
  return {
8275
- key: t,
8276
- value: n
8281
+ key: t.trim(),
8282
+ value: n.trim()
8277
8283
  };
8278
8284
  }), i = [...m];
8279
8285
  i.splice(t, 1, ...r), v(i), h(i);
@@ -8357,18 +8363,18 @@ var Cc = (e) => {
8357
8363
  })]
8358
8364
  });
8359
8365
  }, zc = (e) => {
8360
- let { dataList: t, label: n, description: r, onChange: i, onBlur: a, onDelete: o, btnText: s, options: c, labelExtra: l, trim: u = !0, styles: d, required: f, renderItem: p } = e, [m, h] = E.useState([]), g = E.useRef(0), _ = () => {
8366
+ let { value: t, label: n, description: r, onChange: i, onBlur: a, onDelete: o, btnText: s, options: c, labelExtra: l, trim: u = !0, styles: d, required: f, renderItem: p } = e, [m, h] = E.useState([]), g = E.useRef(0), _ = () => {
8361
8367
  g.current += 1;
8362
8368
  }, v = (e) => {
8363
8369
  let t = Z.default.cloneDeep(m);
8364
8370
  t.splice(e, 1);
8365
8371
  let n = Z.default.map(t, "value").filter((e) => !!e);
8366
- h(t), i(n), o?.(e);
8372
+ h(t), i?.(n), o?.(e);
8367
8373
  }, b = (e, t) => {
8368
8374
  let n = Z.default.cloneDeep(m);
8369
8375
  n[t].value = e;
8370
8376
  let r = Z.default.map(n, "value").filter((e) => !!e);
8371
- h(n), i(r);
8377
+ h(n), i?.(r);
8372
8378
  }, x = () => {
8373
8379
  _();
8374
8380
  let e = Z.default.cloneDeep(m);
@@ -8382,18 +8388,22 @@ var Cc = (e) => {
8382
8388
  let r = y(n);
8383
8389
  if (r.length <= 1) return;
8384
8390
  e.preventDefault();
8385
- let a = Z.default.cloneDeep(m);
8386
- a[t].value = u ? r[0].trim() : r[0];
8387
- for (let e = 1; e < r.length; e++) _(), a.splice(t + e, 0, {
8388
- value: u ? r[e].trim() : r[e],
8389
- uid: g.current
8390
- });
8391
- let o = Z.default.map(a, "value").filter((e) => !!e);
8392
- h(a), i(o);
8391
+ let a = Z.default.cloneDeep(m), o = u ? r[0]?.trim() : r[0];
8392
+ a[t].value = o || "";
8393
+ for (let e = 1; e < r.length; e++) {
8394
+ _();
8395
+ let n = u ? r[e]?.trim() : r[e];
8396
+ a.splice(t + e, 0, {
8397
+ value: n || "",
8398
+ uid: g.current
8399
+ });
8400
+ }
8401
+ let s = Z.default.map(a, "value").filter((e) => !!e);
8402
+ h(a), i?.(s);
8393
8403
  };
8394
8404
  return E.useEffect(() => {
8395
- let e = Z.default.map(m, "value").filter((e) => !!e);
8396
- Z.default.isEqual(e, t) || h(Z.default.map(t, (e) => (_(), {
8405
+ let e = t ?? [], n = Z.default.map(m, "value").filter((e) => !!e);
8406
+ Z.default.isEqual(n, e) || h(Z.default.map(e, (e) => (_(), {
8397
8407
  value: e,
8398
8408
  uid: g.current
8399
8409
  })));
@@ -1,6 +1,6 @@
1
1
  import { o as e, r as t, t as n } from "./rolldown-runtime-BETGA6I9.js";
2
2
  import { t as r } from "./lodash-k2j6dYGv.js";
3
- import { t as i } from "./highlight-code-CyMnhIMR.js";
3
+ import { t as i } from "./highlight-code-BGo6UgwT.js";
4
4
  import a, { Fragment as o, useCallback as s, useEffect as c, useMemo as l } from "react";
5
5
  import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
6
6
  import { EyeOutlined as p } from "@ant-design/icons";
@@ -26,6 +26,7 @@ export interface ChartProps {
26
26
  smooth?: boolean;
27
27
  color?: string;
28
28
  yAxisName?: string;
29
+ stack?: string | false;
29
30
  gaugeConfig?: {
30
31
  radius?: string;
31
32
  center?: string[];
@@ -8,6 +8,7 @@ type AddModalProps = {
8
8
  width?: number | string;
9
9
  footer?: React.ReactNode;
10
10
  subTitle?: React.ReactNode;
11
+ loading?: boolean;
11
12
  };
12
13
  declare const FormDrawer: React.FC<AddModalProps>;
13
14
  export default FormDrawer;
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  interface LabelSelectorProps {
3
- labels: Record<string, any>;
3
+ value?: Record<string, any>;
4
4
  label?: string;
5
5
  btnText?: string;
6
6
  description?: React.ReactNode;
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
2
  interface ListInputProps {
3
3
  required?: boolean;
4
- dataList: string[];
4
+ value?: string[];
5
5
  label?: React.ReactNode;
6
6
  description?: React.ReactNode;
7
7
  btnText?: string;
@@ -13,7 +13,7 @@ interface ListInputProps {
13
13
  wrapper?: React.CSSProperties;
14
14
  item?: React.CSSProperties;
15
15
  };
16
- onChange: (data: string[]) => void;
16
+ onChange?: (data: string[]) => void;
17
17
  onBlur?: (e: any, index: number) => void;
18
18
  onDelete?: (index: number) => void;
19
19
  renderItem?: (data: any, props: {
@@ -1,3 +1,4 @@
1
+ import { SelectProps } from 'antd';
1
2
  import { default as React } from 'react';
2
3
  type PageToolsProps = {
3
4
  left?: React.ReactNode;
@@ -48,7 +49,7 @@ interface FilterBarProps {
48
49
  onClear: () => void;
49
50
  };
50
51
  select?: {
51
- showSearch?: boolean;
52
+ showSearch?: SelectProps['showSearch'];
52
53
  };
53
54
  widths?: {
54
55
  input?: number;
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./useIntl-BZWVSOXz.js";
2
- import { t } from "./editor-wrap-CMFkPgsW.js";
2
+ import { t } from "./editor-wrap-DFbXkvlV.js";
3
3
  import { forwardRef as n, useEffect as r, useImperativeHandle as i, useRef as a } from "react";
4
4
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
5
5
  import { ImportOutlined as c, LoadingOutlined as l } from "@ant-design/icons";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gpustack/core-ui",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "private": false,
5
5
  "sideEffects": [
6
6
  "**/*.css",
@@ -1 +0,0 @@
1
- .editor-wrap{border-radius:var(--border-radius-mini);font-size:0;overflow:hidden}.editor-wrap .code-pre{margin-bottom:0}.editor-wrap .editor-header{background-color:var(--color-editor-header-bg);justify-content:space-between;align-items:center;padding-block:0;padding-inline:12px 10px;display:flex}.editor-wrap .scrollbar .slider{border-radius:6px}
@@ -1 +0,0 @@
1
- .index-module__wrapper___AP3Au{width:100%;padding-inline:8px;overflow-y:auto}.code-pre.dark .hljs{color:#abb2bf;background:var(--color-editor-dark)}.code-pre.dark .hljs-comment,.code-pre.dark .hljs-quote{color:#5c6370;font-style:italic}.code-pre.dark .hljs-doctag,.code-pre.dark .hljs-keyword,.code-pre.dark .hljs-formula{color:#c678dd}.code-pre.dark .hljs-section,.code-pre.dark .hljs-name,.code-pre.dark .hljs-selector-tag,.code-pre.dark .hljs-deletion,.code-pre.dark .hljs-subst{color:#e06c75}.code-pre.dark .hljs-literal{color:#56b6c2}.code-pre.dark .hljs-string,.code-pre.dark .hljs-regexp,.code-pre.dark .hljs-addition,.code-pre.dark .hljs-attribute,.code-pre.dark .hljs-meta .hljs-string{color:#98c379}.code-pre.dark .hljs-attr,.code-pre.dark .hljs-variable,.code-pre.dark .hljs-template-variable,.code-pre.dark .hljs-type,.code-pre.dark .hljs-selector-class,.code-pre.dark .hljs-selector-attr,.code-pre.dark .hljs-selector-pseudo,.code-pre.dark .hljs-number{color:#d19a66}.code-pre.dark .hljs-symbol,.code-pre.dark .hljs-bullet,.code-pre.dark .hljs-link,.code-pre.dark .hljs-meta,.code-pre.dark .hljs-selector-id,.code-pre.dark .hljs-title{color:#61aeee}.code-pre.dark .hljs-built_in,.code-pre.dark .hljs-title.class_,.code-pre.dark .hljs-class .hljs-title{color:#e6c07b}.code-pre.dark .hljs-emphasis{font-style:italic}.code-pre.dark .hljs-strong{font-weight:700}.code-pre.dark .hljs-link{text-decoration:underline}pre code.hljs{padding:1em;display:block;overflow-x:auto}code.hljs{padding:3px 5px}.code-pre.light .hljs{color:#383a42;background:var(--color-editor-light)}.code-pre.light .hljs-comment,.code-pre.light .hljs-quote{color:#a0a1a7;font-style:italic}.code-pre.light .hljs-doctag,.code-pre.light .hljs-keyword,.code-pre.light .hljs-formula{color:#a626a4}.code-pre.light .hljs-section,.code-pre.light .hljs-name,.code-pre.light .hljs-selector-tag,.code-pre.light .hljs-deletion,.code-pre.light .hljs-subst{color:#e45649}.code-pre.light .hljs-literal{color:#0184bb}.code-pre.light .hljs-string,.code-pre.light .hljs-regexp,.code-pre.light .hljs-addition,.code-pre.light .hljs-attribute,.code-pre.light .hljs-meta .hljs-string{color:#50a14f}.code-pre.light .hljs-attr,.code-pre.light .hljs-variable,.code-pre.light .hljs-template-variable,.code-pre.light .hljs-type,.code-pre.light .hljs-selector-class,.code-pre.light .hljs-selector-attr,.code-pre.light .hljs-selector-pseudo,.code-pre.light .hljs-number{color:#986801}.code-pre.light .hljs-symbol,.code-pre.light .hljs-bullet,.code-pre.light .hljs-link,.code-pre.light .hljs-meta,.code-pre.light .hljs-selector-id,.code-pre.light .hljs-title{color:#4078f2}.code-pre.light .hljs-built_in,.code-pre.light .hljs-title.class_,.code-pre.light .hljs-class .hljs-title{color:#c18401}.code-pre.light .hljs-emphasis{font-style:italic}.code-pre.light .hljs-strong{font-weight:700}.code-pre.light .hljs-link{text-decoration:underline}.high-light-wrapper{text-align:left;font-size:var(--font-size-code)}.high-light-wrapper .hljs{font-weight:var(--font-weight-normal);padding-block:1.2em;padding-inline:0}.high-light-wrapper .hljs::-webkit-scrollbar{height:var(--scrollbar-size)}.high-light-wrapper .hljs::-webkit-scrollbar-thumb{background-color:#0000;border-radius:4px}.high-light-wrapper .hljs::-webkit-scrollbar-track{background-color:#0000}.high-light-wrapper .hljs.light:hover::-webkit-scrollbar-thumb{background-color:var(--color-scrollbar-thumb);border-radius:4px}.high-light-wrapper .hljs.dark:hover::-webkit-scrollbar-thumb{background-color:var(--scrollbar-handle-light-bg);border-radius:4px}.high-light-wrapper .code-pre{border-radius:0 0 var(--border-radius-mini) var(--border-radius-mini);white-space:pre-wrap;padding-inline:12px;position:relative}.high-light-wrapper .code-pre code{line-height:1.6}.high-light-wrapper .code-pre.copyable{padding-inline:12px 32px}.high-light-wrapper .code-pre .copy-button{position:absolute;top:6px;right:6px}.high-light-wrapper .code-pre.dark{background-color:var(--color-editor-dark)}.high-light-wrapper .code-pre.dark:hover::-webkit-scrollbar-thumb{background-color:var(--scrollbar-handle-light-bg);border-radius:4px}.high-light-wrapper .code-pre.light{background-color:#fafafa}.high-light-wrapper .code-pre.light:hover::-webkit-scrollbar-thumb{background-color:var(--color-scrollbar-thumb);border-radius:4px}