@abpjs/ui 0.2.0-next.23 → 0.2.0-next.24
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/CHANGELOG.md +12 -0
- package/dist/ai.js +6 -6
- package/dist/ai.js.map +1 -1
- package/dist/index.d.ts +16 -2
- package/dist/index.js +339 -318
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.0-next.24
|
|
4
|
+
|
|
5
|
+
A prerelease under npm's `next` tag.
|
|
6
|
+
|
|
7
|
+
- `AddButton`: the one look for every add action inside a page, a panel or a dialog (Add filter, Add condition, Add
|
|
8
|
+
member, a create row). It draws link-coloured bold text after a plus, with no fill, no border and no chevron, and is
|
|
9
|
+
underlined on hover. A page's one main action stays a `primary` Button.
|
|
10
|
+
- `IconButton remove`: taking a row out of a list or a form. It is gray at rest and turns red, on a light red fill, only
|
|
11
|
+
on hover. A delete (trash) icon stays `danger`, red at all times.
|
|
12
|
+
- `QueryableList`'s Add filter, `FilterBuilder`'s Add condition and ai's Add an alias and Add a limit use `AddButton`.
|
|
13
|
+
Their row icons use `remove`.
|
|
14
|
+
|
|
3
15
|
## 0.2.0-next.23
|
|
4
16
|
|
|
5
17
|
A prerelease under npm's `next` tag.
|
package/dist/ai.js
CHANGED
|
@@ -18,7 +18,7 @@ import { Button as Button2, CheckboxField, DataTable, FormDialog, HostSlot, Inli
|
|
|
18
18
|
import { useState } from "react";
|
|
19
19
|
import { HStack, Input, Stack, Text } from "@chakra-ui/react";
|
|
20
20
|
import { Trash2 } from "lucide-react";
|
|
21
|
-
import { Button, Field, IconButton, InlineAlert, SelectField, useFormatters } from "@abpjs/ui";
|
|
21
|
+
import { AddButton, Button, Field, IconButton, InlineAlert, SelectField, useFormatters } from "@abpjs/ui";
|
|
22
22
|
|
|
23
23
|
// src/areas/ai/texts.ts
|
|
24
24
|
import { createAreaTexts } from "@abpjs/ui";
|
|
@@ -410,11 +410,11 @@ function LimitsEditor({ limits, onSave, onChange, busy, error }) {
|
|
|
410
410
|
) }),
|
|
411
411
|
/* @__PURE__ */ jsx(Field, { label: i === 0 ? t("limitPeriod") : void 0, flex: "1", children: r.kind === "call-tokens" ? /* @__PURE__ */ jsx(Text, { textStyle: "sm", color: "fg.muted", py: "2", children: t("perReply") }) : /* @__PURE__ */ jsx(SelectField, { value: r.period, options: periods, "aria-label": t("limitPeriod"), onChange: (e) => set(i, { period: e.target.value }) }) }),
|
|
412
412
|
/* @__PURE__ */ jsx(Field, { label: i === 0 ? t("limitAmount") : void 0, flex: "1", children: /* @__PURE__ */ jsx(Input, { type: "number", min: 0, step: "any", value: r.amount, dir: "ltr", "aria-label": t("limitAmount"), onChange: (e) => set(i, { amount: e.target.value }) }) }),
|
|
413
|
-
/* @__PURE__ */ jsx(IconButton, { "aria-label": t("removeLimit"), size: "sm", onClick: () => setDraft(rows.filter((_, j) => j !== i)), children: /* @__PURE__ */ jsx(Trash2, {}) })
|
|
413
|
+
/* @__PURE__ */ jsx(IconButton, { remove: true, "aria-label": t("removeLimit"), size: "sm", onClick: () => setDraft(rows.filter((_, j) => j !== i)), children: /* @__PURE__ */ jsx(Trash2, {}) })
|
|
414
414
|
] }, i)),
|
|
415
415
|
rows.length === 0 && /* @__PURE__ */ jsx(Text, { textStyle: "sm", color: "fg.muted", children: t("noLimits") }),
|
|
416
416
|
/* @__PURE__ */ jsxs(HStack, { children: [
|
|
417
|
-
/* @__PURE__ */ jsx(
|
|
417
|
+
/* @__PURE__ */ jsx(AddButton, { onClick: () => setDraft([...rows, { kind: "cost", period: "day", amount: "" }]), children: t("addLimit") }),
|
|
418
418
|
onSave && /* @__PURE__ */ jsx(Button, { size: "sm", loading: busy, disabled: draft === null, onClick: () => void save(), children: t("save") })
|
|
419
419
|
] })
|
|
420
420
|
] });
|
|
@@ -685,7 +685,7 @@ function AccessEditor({ scope, models, onClose, onSaved }) {
|
|
|
685
685
|
import { useMemo as useMemo2, useState as useState3 } from "react";
|
|
686
686
|
import { HStack as HStack2, Input as Input2, Stack as Stack3, Text as Text3 } from "@chakra-ui/react";
|
|
687
687
|
import { Trash2 as Trash22 } from "lucide-react";
|
|
688
|
-
import { Button as Button3, Field as Field2, IconButton as IconButton2, InlineAlert as InlineAlert3, notify as notify2, Panel as Panel2, SelectField as SelectField2, useApiAction as useApiAction2, useAreaRequest as useAreaRequest2 } from "@abpjs/ui";
|
|
688
|
+
import { AddButton as AddButton2, Button as Button3, Field as Field2, IconButton as IconButton2, InlineAlert as InlineAlert3, notify as notify2, Panel as Panel2, SelectField as SelectField2, useApiAction as useApiAction2, useAreaRequest as useAreaRequest2 } from "@abpjs/ui";
|
|
689
689
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
690
690
|
var target = (key) => {
|
|
691
691
|
const at = key.indexOf(":");
|
|
@@ -755,11 +755,11 @@ function AliasesPanel({ scopeId, aliases, inherited, models, onSaved }) {
|
|
|
755
755
|
onChange: (e) => setDraft(rows.map((x, j) => j === i ? { ...x, key: e.target.value } : x))
|
|
756
756
|
}
|
|
757
757
|
) }),
|
|
758
|
-
/* @__PURE__ */ jsx3(IconButton2, { "aria-label": t("removeAlias", { name: r.name || "\u2026" }), size: "sm", onClick: () => setDraft(rows.filter((_, j) => j !== i)), children: /* @__PURE__ */ jsx3(Trash22, {}) })
|
|
758
|
+
/* @__PURE__ */ jsx3(IconButton2, { remove: true, "aria-label": t("removeAlias", { name: r.name || "\u2026" }), size: "sm", onClick: () => setDraft(rows.filter((_, j) => j !== i)), children: /* @__PURE__ */ jsx3(Trash22, {}) })
|
|
759
759
|
] }, i)),
|
|
760
760
|
rows.length === 0 && /* @__PURE__ */ jsx3(Text3, { textStyle: "sm", color: "fg.muted", children: t("noAliases") }),
|
|
761
761
|
/* @__PURE__ */ jsxs3(HStack2, { children: [
|
|
762
|
-
/* @__PURE__ */ jsx3(
|
|
762
|
+
/* @__PURE__ */ jsx3(AddButton2, { onClick: () => setDraft([...rows, { name: "", key: usable[0]?.key ?? "", rest: [] }]), disabled: usable.length === 0, children: t("addAlias") }),
|
|
763
763
|
usable.length === 0 && /* @__PURE__ */ jsx3(Text3, { textStyle: "sm", color: "fg.muted", children: t("noUsable") })
|
|
764
764
|
] }),
|
|
765
765
|
shownInherited.length > 0 && /* @__PURE__ */ jsxs3(Stack3, { gap: "1", children: [
|