@easyvision/easyvision-ui 1.7.4 → 1.7.6
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/easyvision.css +13 -0
- package/dist/index.cjs +29 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +29 -11
- package/dist/index.js.map +1 -1
- package/package.json +6 -3
package/dist/easyvision.css
CHANGED
|
@@ -214,6 +214,7 @@
|
|
|
214
214
|
|
|
215
215
|
/* ---------- Checkbox ---------- */
|
|
216
216
|
.ev-checkbox {
|
|
217
|
+
position: relative;
|
|
217
218
|
display: inline-flex;
|
|
218
219
|
align-items: center;
|
|
219
220
|
justify-content: center;
|
|
@@ -226,6 +227,14 @@
|
|
|
226
227
|
color: hsl(var(--primary, 222 47% 11%));
|
|
227
228
|
cursor: pointer;
|
|
228
229
|
}
|
|
230
|
+
/* Expand the click target without changing the visual size. The pseudo-element
|
|
231
|
+
* is part of the button, so clicks on it trigger the checkbox and any
|
|
232
|
+
* stopPropagation handler the consumer attached (e.g. table rows). */
|
|
233
|
+
.ev-checkbox::before {
|
|
234
|
+
content: "";
|
|
235
|
+
position: absolute;
|
|
236
|
+
inset: -0.75rem;
|
|
237
|
+
}
|
|
229
238
|
.ev-checkbox:focus-visible {
|
|
230
239
|
outline: 2px solid hsl(var(--ring, 215 20% 65%));
|
|
231
240
|
outline-offset: 2px;
|
|
@@ -1168,6 +1177,10 @@
|
|
|
1168
1177
|
color: hsl(var(--muted-foreground, 215 16% 47%));
|
|
1169
1178
|
white-space: nowrap;
|
|
1170
1179
|
}
|
|
1180
|
+
.ev-mf-chip-label.is-clickable {
|
|
1181
|
+
cursor: pointer;
|
|
1182
|
+
user-select: none;
|
|
1183
|
+
}
|
|
1171
1184
|
.ev-mf-chip-required {
|
|
1172
1185
|
margin-left: 0.125rem;
|
|
1173
1186
|
color: hsl(var(--destructive, 0 84% 60%));
|
package/dist/index.cjs
CHANGED
|
@@ -618,6 +618,7 @@ function TextWidget({ definition, value, onChange, onRemove }) {
|
|
|
618
618
|
}
|
|
619
619
|
var SENTINEL = "__easyvision_undef__";
|
|
620
620
|
function SelectorWidget({ definition, value, onChange, onRemove }) {
|
|
621
|
+
const [open, setOpen] = React8.useState(false);
|
|
621
622
|
const [resolved, setResolved] = React8.useState(
|
|
622
623
|
Array.isArray(definition.options) ? definition.options : null
|
|
623
624
|
);
|
|
@@ -631,14 +632,23 @@ function SelectorWidget({ definition, value, onChange, onRemove }) {
|
|
|
631
632
|
const opts = resolved ?? [];
|
|
632
633
|
const selectValue = value === void 0 || value === "" ? SENTINEL : String(value);
|
|
633
634
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ev-mf-chip is-wrap", children: [
|
|
634
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
635
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
636
|
+
"span",
|
|
637
|
+
{
|
|
638
|
+
className: "ev-mf-chip-label is-clickable",
|
|
639
|
+
onClick: () => setOpen(true),
|
|
640
|
+
children: [
|
|
641
|
+
definition.label,
|
|
642
|
+
definition.mandatory && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ev-mf-chip-required", children: "*" }),
|
|
643
|
+
":"
|
|
644
|
+
]
|
|
645
|
+
}
|
|
646
|
+
),
|
|
639
647
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
640
648
|
Select,
|
|
641
649
|
{
|
|
650
|
+
open,
|
|
651
|
+
onOpenChange: setOpen,
|
|
642
652
|
value: selectValue,
|
|
643
653
|
onValueChange: (raw) => {
|
|
644
654
|
if (raw === SENTINEL) onChange(void 0);
|
|
@@ -681,6 +691,7 @@ function MultiSelectWidget({
|
|
|
681
691
|
onRemove
|
|
682
692
|
}) {
|
|
683
693
|
const [search, setSearch] = React8.useState("");
|
|
694
|
+
const [open, setOpen] = React8.useState(false);
|
|
684
695
|
const searchFn = definition.searchOptions;
|
|
685
696
|
const hasSearchOptions = typeof searchFn === "function";
|
|
686
697
|
const [resolved, setResolved] = React8.useState(
|
|
@@ -734,11 +745,18 @@ function MultiSelectWidget({
|
|
|
734
745
|
const removeOne = (v) => onChange(selected.filter((x) => x !== v));
|
|
735
746
|
const labelOf = (v) => labelCache.current.get(v) ?? baseOpts.find((o) => o.value === v)?.label ?? String(v);
|
|
736
747
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ev-mf-chip is-wrap", children: [
|
|
737
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
748
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
749
|
+
"span",
|
|
750
|
+
{
|
|
751
|
+
className: "ev-mf-chip-label is-clickable",
|
|
752
|
+
onClick: () => setOpen(true),
|
|
753
|
+
children: [
|
|
754
|
+
definition.label,
|
|
755
|
+
definition.mandatory && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ev-mf-chip-required", children: "*" }),
|
|
756
|
+
":"
|
|
757
|
+
]
|
|
758
|
+
}
|
|
759
|
+
),
|
|
742
760
|
selected.map((v) => /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ev-mf-chip-badge", children: [
|
|
743
761
|
labelOf(v),
|
|
744
762
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -751,7 +769,7 @@ function MultiSelectWidget({
|
|
|
751
769
|
}
|
|
752
770
|
)
|
|
753
771
|
] }, String(v))),
|
|
754
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Popover, { children: [
|
|
772
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
755
773
|
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "ev-mf-chip-caret", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, {}) }) }),
|
|
756
774
|
/* @__PURE__ */ jsxRuntime.jsxs(PopoverContent, { className: "ev-mf-ms-popover", align: "start", children: [
|
|
757
775
|
/* @__PURE__ */ jsxRuntime.jsx(
|