@revolist/ui 4.0.1-rc → 4.0.2-rc
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/README.md +6 -5
- package/_chunks/calendar-CpaUK7w1.js +248 -0
- package/_chunks/chart-frame-BC99KjGa.js +127 -0
- package/_chunks/choice-chips-Cs4D-3nH.js +110 -0
- package/_chunks/{color-palette-BmZ7kH9R.js → color-palette-BBMFmUNA.js} +41 -41
- package/_chunks/color-picker-D90Jg-M8.js +138 -0
- package/_chunks/compat.module-DDB2pm9O.js +229 -0
- package/_chunks/component-YDcfoOLz.js +859 -0
- package/_chunks/{control-tooltip-BCNzQCXE.js → control-tooltip-ztgmsG7H.js} +29 -29
- package/_chunks/{controller-CmLo-Ajc.js → controller-hRBm_Lfz.js} +15 -15
- package/_chunks/{controls-NEL5tDaz.js → controls-DIum-E66.js} +192 -192
- package/_chunks/{date-control-CYCkb1aQ.js → date-control-BJSzu79z.js} +21 -21
- package/_chunks/date-time-BxPJusp9.js +770 -0
- package/_chunks/{delete-button-DnpmDNEJ.js → delete-button-Bblyah10.js} +1 -1
- package/_chunks/dialog.parts-DBqo3Qwb.js +134 -0
- package/_chunks/{dropdown-CkGQBm1Q.js → dropdown-voWqmwAe.js} +102 -102
- package/_chunks/duration-87U2EoMS.js +271 -0
- package/_chunks/editor-commit-Bq3wSgvr.js +12 -0
- package/_chunks/{editor-popup-B7fu_A_T.js → editor-popup-D3JdS8l3.js} +8 -8
- package/_chunks/framework-mount-C-Zwm44H.js +54 -0
- package/_chunks/hooks.module-CG3gN83z.js +157 -0
- package/_chunks/jsxRuntime.module-F6UFnpT-.js +30 -0
- package/_chunks/mount-DZe_6VtR.js +90 -0
- package/_chunks/native.view-ByyZ1CT5.js +32 -0
- package/_chunks/{number-input-NnH57J4j.js → number-input-BeIadZuL.js} +89 -89
- package/_chunks/picker-DpP7iQLA.js +122 -0
- package/_chunks/preact.module-BBM36DnO.js +290 -0
- package/_chunks/{rating-choice-CWAsNQNS.js → rating-choice-Ca8ZBty3.js} +10 -10
- package/_chunks/reorder-list-Cc3KmfAN.js +59 -0
- package/_chunks/request-trail-IdNiFvKH.js +347 -0
- package/_chunks/{rich-text-2Rla349o.js → rich-text-BzI1DyfF.js} +167 -167
- package/_vendor/preact/LICENSE +21 -0
- package/_vendor/preact/compat/src/index.d.ts +353 -0
- package/_vendor/preact/compat/src/suspense-list.d.ts +16 -0
- package/_vendor/preact/compat/src/suspense.d.ts +19 -0
- package/_vendor/preact/hooks/src/index.d.ts +145 -0
- package/_vendor/preact/src/dom.d.ts +2548 -0
- package/_vendor/preact/src/index.d.ts +373 -0
- package/_vendor/preact/src/jsx.d.ts +2958 -0
- package/activity-message.d.ts +1 -1
- package/activity-message.js +16 -16
- package/ai/components.d.ts +1 -1
- package/ai/index.js +2 -2
- package/ai/request-trail.d.ts +1 -1
- package/ai/translation-context.d.ts +1 -1
- package/alert.d.ts +2 -2
- package/assignee/field.d.ts +2 -2
- package/assignee/index.js +87 -87
- package/assignee/layout.d.ts +2 -2
- package/assignee/picker.d.ts +1 -1
- package/avatar/index.js +25 -25
- package/avatar/index.view.d.ts +1 -1
- package/brush-range/component.d.ts +1 -1
- package/brush-range/component.js +30 -30
- package/buttons/delete-button.js +1 -1
- package/buttons/remove-button.d.ts +1 -1
- package/buttons/remove-button.js +3 -3
- package/buttons/svg-button.d.ts +1 -1
- package/buttons/svg-button.js +35 -35
- package/calendar/calendar.d.ts +1 -1
- package/calendar/calendar.js +1 -1
- package/calendar/caption.d.ts +1 -1
- package/calendar/day.d.ts +1 -1
- package/calendar/day.js +4 -4
- package/calendar/header.d.ts +1 -1
- package/calendar/header.js +35 -35
- package/calendar/index.js +2 -2
- package/calendar/month-grid.d.ts +1 -1
- package/calendar/month-grid.js +37 -37
- package/calendar/picker.d.ts +1 -1
- package/calendar/types.d.ts +1 -1
- package/calendar/year-grid.d.ts +1 -1
- package/calendar/year-grid.js +12 -12
- package/checkbox/index.d.ts +2 -2
- package/checkbox/index.js +9 -9
- package/choice-chips/index.d.ts +1 -1
- package/choice-chips/index.js +1 -1
- package/color-palette/color-palette.d.ts +1 -1
- package/color-palette/color-palette.js +1 -1
- package/color-palette/color-picker.d.ts +1 -1
- package/color-palette/color-picker.js +2 -2
- package/component-catalog.d.ts +19 -19
- package/control-presentation.js +18 -18
- package/controls.d.ts +4 -4
- package/controls.js +1 -1
- package/core/editor-commit.d.ts +1 -1
- package/core/editor-popup.d.ts +1 -1
- package/core/editor-popup.js +1 -1
- package/date-time/date-control.d.ts +1 -1
- package/date-time/field.d.ts +2 -2
- package/date-time/index.js +1 -1
- package/date-time/picker.d.ts +1 -1
- package/date-time/time-control.d.ts +1 -1
- package/date-time/time-selection.d.ts +1 -1
- package/date-time/types.d.ts +1 -1
- package/dialog/dialog-action-footer.view.d.ts +1 -1
- package/dialog/dialog.dom.js +52 -52
- package/dialog/dialog.parts.d.ts +18 -18
- package/dialog/dialog.parts.js +1 -1
- package/dialog/dialog.preact.d.ts +1 -1
- package/dialog/dialog.preact.js +6 -6
- package/distribution-chart/area-chart.d.ts +1 -1
- package/distribution-chart/area-chart.js +25 -25
- package/distribution-chart/bar-chart.d.ts +1 -1
- package/distribution-chart/bar-chart.js +6 -6
- package/distribution-chart/chart-frame.d.ts +1 -1
- package/distribution-chart/index.d.ts +1 -1
- package/distribution-chart/index.js +6 -6
- package/distribution-chart/line-chart.d.ts +1 -1
- package/distribution-chart/line-chart.js +9 -9
- package/distribution-chart/types.d.ts +1 -1
- package/dropdown/content.d.ts +1 -1
- package/dropdown/content.js +83 -82
- package/dropdown/dropdown.service.d.ts +1 -1
- package/dropdown/dropdown.service.js +9 -9
- package/dropdown/index.js +1 -1
- package/dropdown/lookup-field.d.ts +1 -1
- package/dropdown/lookup-field.js +41 -41
- package/dropdown/popup.d.ts +1 -1
- package/dropdown/popup.js +17 -16
- package/duration/controls.d.ts +1 -1
- package/duration/index.d.ts +2 -2
- package/duration/index.js +1 -1
- package/editor-actions.d.ts +1 -1
- package/editor-actions.js +21 -20
- package/editor-layout/index.d.ts +1 -1
- package/editor-layout/index.js +27 -27
- package/field-configurator.d.ts +1 -1
- package/field-configurator.js +93 -93
- package/field-reorder.hook.js +32 -32
- package/filter/filters/slider/preact.js +3 -3
- package/filter/filters/slider/single.d.ts +1 -1
- package/filter/filters/slider/single.js +23 -23
- package/filter-badge.d.ts +1 -1
- package/filter-badge.js +23 -22
- package/filter-controls.d.ts +1 -1
- package/filter-controls.js +31 -31
- package/form-controls/index.js +20 -20
- package/form-controls/presentation.d.ts +1 -1
- package/form-controls/presentation.js +44 -44
- package/formatting/comparison-preview.d.ts +1 -1
- package/formatting/control-tooltip.d.ts +1 -1
- package/formatting/icon-controls.d.ts +1 -1
- package/formatting/index.js +99 -98
- package/formatting/inspector-section.d.ts +1 -1
- package/formatting/typography-controls.d.ts +1 -1
- package/framework-mount.d.ts +1 -1
- package/framework.js +19 -19
- package/icons/icon.d.ts +1 -1
- package/icons/icon.js +1 -1
- package/legend.d.ts +1 -1
- package/legend.js +12 -12
- package/masked-input/index.d.ts +1 -1
- package/masked-input/index.js +109 -109
- package/native-control.d.ts +11 -11
- package/native-control.js +12 -12
- package/native.js +39 -39
- package/number-input/index.d.ts +1 -1
- package/number-input/index.js +1 -1
- package/package.json +1 -2
- package/pdf-viewer/component.d.ts +1 -1
- package/pdf-viewer/controller.js +1 -1
- package/pdf-viewer/header.d.ts +1 -1
- package/pdf-viewer/index.js +13 -13
- package/pdf-viewer/search-bar.d.ts +1 -1
- package/pdf-viewer/status.d.ts +1 -1
- package/pdf-viewer/toolbar.d.ts +1 -1
- package/pickers.d.ts +1 -1
- package/preact-mount.d.ts +1 -1
- package/preact-mount.js +1 -1
- package/preact.js +14 -14
- package/rating-choice.d.ts +1 -1
- package/rating-choice.js +1 -1
- package/react-adapter.d.ts +1 -1
- package/react.js +19 -19
- package/reorder-list.d.ts +1 -1
- package/reorder-list.js +1 -1
- package/resource-picker/resource-picker-avatar.d.ts +1 -1
- package/resource-picker/resource-picker-avatar.js +14 -14
- package/resource-picker/resource-picker-option.d.ts +1 -1
- package/resource-picker/resource-picker-option.js +28 -28
- package/resource-picker/resource-picker-popup.d.ts +1 -1
- package/resource-picker/resource-picker-popup.js +3 -3
- package/resource-picker/resource-picker.d.ts +1 -1
- package/resource-picker/resource-picker.js +88 -88
- package/rich-text/index.d.ts +1 -1
- package/rich-text/index.js +1 -1
- package/rich-text/toolbar.d.ts +1 -1
- package/search-input/index.js +12 -12
- package/segmented-switch/index.d.ts +1 -1
- package/segmented-switch/index.js +1 -1
- package/status-feedback/render.d.ts +2 -2
- package/status-feedback/render.js +13 -13
- package/surfaces.js +34 -34
- package/svelte.js +2 -2
- package/switch/index.js +15 -15
- package/time-grid.d.ts +1 -1
- package/time-grid.js +58 -58
- package/timeline-track/component.d.ts +1 -1
- package/timeline-track/index.js +75 -75
- package/vue-adapter.d.ts +1 -1
- package/vue.d.ts +116 -116
- package/vue.js +121 -121
- package/_chunks/calendar-BsDxCYhI.js +0 -248
- package/_chunks/chart-frame-BvxbmEU9.js +0 -126
- package/_chunks/choice-chips-0HfOnK_4.js +0 -110
- package/_chunks/color-picker-BRv-__AM.js +0 -138
- package/_chunks/component-D4PH5UZT.js +0 -859
- package/_chunks/date-time-DjucJmbc.js +0 -769
- package/_chunks/dialog.parts-Dt3KinUz.js +0 -134
- package/_chunks/duration-BCaktcvz.js +0 -270
- package/_chunks/editor-commit-D6Rf5rGz.js +0 -12
- package/_chunks/framework-mount-BKIOsvY-.js +0 -54
- package/_chunks/mount-0-8opf1j.js +0 -90
- package/_chunks/native.view-8q_nwQ7x.js +0 -32
- package/_chunks/picker-oazJ7sO_.js +0 -121
- package/_chunks/reorder-list-BV3kZXso.js +0 -59
- package/_chunks/request-trail-D0oVzdRd.js +0 -347
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as e } from "./jsxRuntime.module-F6UFnpT-.js";
|
|
2
2
|
//#region src/icons/cancel.svg?raw
|
|
3
3
|
var t = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path fill=\"currentColor\" d=\"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z\"/></svg>", n = ({ onClick: n, disabled: r, className: i, onMouseDown: a, onDblClick: o, locale: s = {
|
|
4
4
|
title: "Remove",
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { c as e, i as t } from "./preact.module-BBM36DnO.js";
|
|
2
|
+
import { t as n } from "./jsxRuntime.module-F6UFnpT-.js";
|
|
3
|
+
import { n as r } from "./compat.module-DDB2pm9O.js";
|
|
4
|
+
import { createPreactElement as i, releasePreactElement as a } from "../preact-mount.js";
|
|
5
|
+
import { ButtonControl as o, Input as s } from "../native-control.js";
|
|
6
|
+
import { t as c } from "./xmark-DD_PBvZI.js";
|
|
7
|
+
//#region src/dialog/dialog-action-footer.view.tsx
|
|
8
|
+
function l({ cancel: e = {}, save: t = {}, deleteAction: r = !1, reset: i = !1, start: a, end: s, children: c, actionsClass: l = "", class: u = "", ...d }) {
|
|
9
|
+
let f = (e, t, r, i = "", a = "button") => {
|
|
10
|
+
if (t === !1) return null;
|
|
11
|
+
let { label: s = r, class: c = "", ...l } = t;
|
|
12
|
+
return /* @__PURE__ */ n(o, {
|
|
13
|
+
type: a,
|
|
14
|
+
...l,
|
|
15
|
+
class: `rv-btn ${i} ${c}`,
|
|
16
|
+
"data-dialog-action": e,
|
|
17
|
+
children: s
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
return /* @__PURE__ */ n("footer", {
|
|
21
|
+
...d,
|
|
22
|
+
class: `rv-dialog__footer rv-dialog__action-footer ${u}`,
|
|
23
|
+
children: [c, /* @__PURE__ */ n("div", {
|
|
24
|
+
class: "rv-dialog__action-panel",
|
|
25
|
+
children: [/* @__PURE__ */ n("div", {
|
|
26
|
+
class: "rv-dialog__action-start",
|
|
27
|
+
children: [
|
|
28
|
+
a,
|
|
29
|
+
f("delete", r, "Delete", "rv-btn-danger-outline"),
|
|
30
|
+
f("reset", i, "Reset")
|
|
31
|
+
]
|
|
32
|
+
}), /* @__PURE__ */ n("div", {
|
|
33
|
+
class: `rv-dialog__actions ${l}`,
|
|
34
|
+
children: [
|
|
35
|
+
s,
|
|
36
|
+
f("cancel", e, "Cancel"),
|
|
37
|
+
f("save", t, "Save", "rv-btn-primary", "submit")
|
|
38
|
+
]
|
|
39
|
+
})]
|
|
40
|
+
})]
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function u(e, t) {
|
|
44
|
+
return /* @__PURE__ */ n(l, { ...t });
|
|
45
|
+
}
|
|
46
|
+
function d(e, t) {
|
|
47
|
+
let r = i(e.ownerDocument, /* @__PURE__ */ n(l, { ...t }));
|
|
48
|
+
return e.append(r), { destroy() {
|
|
49
|
+
a(r);
|
|
50
|
+
} };
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/dialog/dialog.parts.tsx
|
|
54
|
+
var f = r(({ class: e = "", ...t }, r) => /* @__PURE__ */ n("header", {
|
|
55
|
+
...t,
|
|
56
|
+
ref: r,
|
|
57
|
+
class: `rv-dialog__header ${e}`
|
|
58
|
+
}));
|
|
59
|
+
function p({ class: e = "", ...t }) {
|
|
60
|
+
return /* @__PURE__ */ n("form", {
|
|
61
|
+
...t,
|
|
62
|
+
class: `rv-dialog__surface ${e}`
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
var m = r(({ class: e = "", ...t }, r) => /* @__PURE__ */ n("div", {
|
|
66
|
+
...t,
|
|
67
|
+
ref: r,
|
|
68
|
+
class: `rv-dialog__body ${e}`
|
|
69
|
+
})), h = r(({ class: e = "", ...t }, r) => /* @__PURE__ */ n("footer", {
|
|
70
|
+
...t,
|
|
71
|
+
ref: r,
|
|
72
|
+
class: `rv-dialog__footer ${e}`
|
|
73
|
+
})), g = r(({ class: e = "", ...t }, r) => /* @__PURE__ */ n("div", {
|
|
74
|
+
...t,
|
|
75
|
+
ref: r,
|
|
76
|
+
class: `rv-dialog__actions ${e}`
|
|
77
|
+
}));
|
|
78
|
+
function _({ class: e = "", iconClass: t = "", ...r }) {
|
|
79
|
+
return /* @__PURE__ */ n(o, {
|
|
80
|
+
...r,
|
|
81
|
+
unstyled: !0,
|
|
82
|
+
type: "button",
|
|
83
|
+
class: `rv-dialog__close ${e}`,
|
|
84
|
+
children: /* @__PURE__ */ n("span", {
|
|
85
|
+
class: `rv-dialog__close-icon ${t}`,
|
|
86
|
+
"aria-hidden": "true",
|
|
87
|
+
dangerouslySetInnerHTML: { __html: c }
|
|
88
|
+
})
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
var v = r(({ class: e = "", ...t }, r) => /* @__PURE__ */ n(s, {
|
|
92
|
+
...t,
|
|
93
|
+
ref: r,
|
|
94
|
+
class: `rv-dialog__title-input ${e}`
|
|
95
|
+
})), y = r(({ titleId: e, title: r, name: i, description: a, inputLabel: o, titleHidden: s, headingClass: c = "", kickerClass: l = "", titleClass: u = "", inputProps: d, closeLabel: p, closeProps: m, onClose: h, class: g = "", ...y }, b) => /* @__PURE__ */ n(f, {
|
|
96
|
+
...y,
|
|
97
|
+
ref: b,
|
|
98
|
+
class: `rv-dialog__header--editable ${g}`,
|
|
99
|
+
children: [/* @__PURE__ */ n("div", {
|
|
100
|
+
class: `rv-dialog__heading ${c}`,
|
|
101
|
+
children: [
|
|
102
|
+
!s && i && /* @__PURE__ */ n("span", {
|
|
103
|
+
class: `rv-dialog__kicker ${l}`,
|
|
104
|
+
children: i
|
|
105
|
+
}),
|
|
106
|
+
!s && (d === !1 ? /* @__PURE__ */ n("h3", {
|
|
107
|
+
id: e,
|
|
108
|
+
class: `rv-dialog__title ${u}`,
|
|
109
|
+
children: r
|
|
110
|
+
}) : /* @__PURE__ */ n(t, { children: [/* @__PURE__ */ n("h3", {
|
|
111
|
+
id: e,
|
|
112
|
+
class: `rv-dialog__sr-only ${u}`,
|
|
113
|
+
children: r
|
|
114
|
+
}), /* @__PURE__ */ n(v, {
|
|
115
|
+
"aria-label": o,
|
|
116
|
+
value: r,
|
|
117
|
+
...d
|
|
118
|
+
})] })),
|
|
119
|
+
a && /* @__PURE__ */ n("div", {
|
|
120
|
+
class: "rv-dialog__description",
|
|
121
|
+
children: a
|
|
122
|
+
})
|
|
123
|
+
]
|
|
124
|
+
}), h && /* @__PURE__ */ n(_, {
|
|
125
|
+
...m,
|
|
126
|
+
"aria-label": p,
|
|
127
|
+
onClick: h
|
|
128
|
+
})]
|
|
129
|
+
}));
|
|
130
|
+
function b(t) {
|
|
131
|
+
return u(e, t);
|
|
132
|
+
}
|
|
133
|
+
//#endregion
|
|
134
|
+
export { h as a, v as c, d, u as f, _ as i, y as l, g as n, p as o, m as r, f as s, b as t, l as u };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { c as e, r as t } from "./preact.module-BBM36DnO.js";
|
|
2
|
+
import { c as n, i as r, n as i, r as a, t as o } from "./hooks.module-CG3gN83z.js";
|
|
3
|
+
import { t as s } from "./jsxRuntime.module-F6UFnpT-.js";
|
|
4
|
+
import { t as c } from "./chevron-down-GbplLa6s.js";
|
|
5
|
+
import { RemoveButton as l } from "../buttons/remove-button.js";
|
|
6
|
+
import { DropdownPopup as u } from "../dropdown/popup.js";
|
|
7
|
+
import { DropdownPopupContent as d } from "../dropdown/content.js";
|
|
8
8
|
//#region src/dropdown/remote.ts
|
|
9
|
-
var
|
|
9
|
+
var f = {
|
|
10
10
|
loading: "Loading…",
|
|
11
11
|
empty: "No results found",
|
|
12
12
|
error: "Unable to load options.",
|
|
13
13
|
retry: "Retry",
|
|
14
14
|
loadMore: "Load more",
|
|
15
15
|
unavailable: (e) => `Unavailable (${String(e)})`
|
|
16
|
-
},
|
|
16
|
+
}, p = class {
|
|
17
17
|
source;
|
|
18
18
|
context;
|
|
19
19
|
changed;
|
|
@@ -36,7 +36,7 @@ var p = {
|
|
|
36
36
|
failedCursor;
|
|
37
37
|
resolveFailed = !1;
|
|
38
38
|
opened = !1;
|
|
39
|
-
constructor(e, t, n, r =
|
|
39
|
+
constructor(e, t, n, r = f, i = {}) {
|
|
40
40
|
this.source = e, this.context = t, this.changed = n, this.text = r, this.settings = i;
|
|
41
41
|
}
|
|
42
42
|
remember(e) {
|
|
@@ -115,19 +115,19 @@ var p = {
|
|
|
115
115
|
//#endregion
|
|
116
116
|
//#region src/dropdown/remote-hook.ts
|
|
117
117
|
function ee(e) {
|
|
118
|
-
let t =
|
|
119
|
-
...
|
|
118
|
+
let t = i(() => ({
|
|
119
|
+
...f,
|
|
120
120
|
...e.remoteText
|
|
121
|
-
}), [e.remoteText]), [
|
|
121
|
+
}), [e.remoteText]), [s, c] = r({
|
|
122
122
|
items: [],
|
|
123
123
|
selected: [],
|
|
124
124
|
loading: !1,
|
|
125
125
|
error: !1,
|
|
126
126
|
hasMore: !1
|
|
127
|
-
}),
|
|
128
|
-
return
|
|
127
|
+
}), l = o(), u = e.value === null || e.value === void 0 ? [] : Array.isArray(e.value) ? e.value : [e.value], d = JSON.stringify(u);
|
|
128
|
+
return a(() => {
|
|
129
129
|
if (!e.dataSource || e.disabled) {
|
|
130
|
-
|
|
130
|
+
c({
|
|
131
131
|
items: [],
|
|
132
132
|
selected: [],
|
|
133
133
|
loading: !1,
|
|
@@ -136,17 +136,17 @@ function ee(e) {
|
|
|
136
136
|
});
|
|
137
137
|
return;
|
|
138
138
|
}
|
|
139
|
-
let n = new
|
|
140
|
-
return
|
|
141
|
-
n.destroy(),
|
|
139
|
+
let n = new p(e.dataSource, e.dataContext, c, t);
|
|
140
|
+
return l.current = n, () => {
|
|
141
|
+
n.destroy(), l.current === n && (l.current = void 0);
|
|
142
142
|
};
|
|
143
143
|
}, [
|
|
144
144
|
e.dataSource,
|
|
145
145
|
e.dataContext,
|
|
146
146
|
e.disabled,
|
|
147
147
|
t
|
|
148
|
-
]),
|
|
149
|
-
|
|
148
|
+
]), a(() => {
|
|
149
|
+
l.current?.setSelected(u, e.source);
|
|
150
150
|
}, [
|
|
151
151
|
d,
|
|
152
152
|
e.source,
|
|
@@ -154,8 +154,8 @@ function ee(e) {
|
|
|
154
154
|
e.dataContext,
|
|
155
155
|
e.disabled,
|
|
156
156
|
t
|
|
157
|
-
]),
|
|
158
|
-
e.open ?
|
|
157
|
+
]), n(() => {
|
|
158
|
+
e.open ? l.current?.search(e.initialQuery, !0) : l.current?.close();
|
|
159
159
|
}, [
|
|
160
160
|
e.open,
|
|
161
161
|
e.dataSource,
|
|
@@ -164,90 +164,90 @@ function ee(e) {
|
|
|
164
164
|
e.initialQuery,
|
|
165
165
|
t
|
|
166
166
|
]), {
|
|
167
|
-
...
|
|
167
|
+
...s,
|
|
168
168
|
text: t,
|
|
169
|
-
search: (e) =>
|
|
170
|
-
loadMore: () =>
|
|
171
|
-
retry: () =>
|
|
169
|
+
search: (e) => l.current?.search(e),
|
|
170
|
+
loadMore: () => l.current?.loadMore(),
|
|
171
|
+
retry: () => l.current?.retry()
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
174
|
//#endregion
|
|
175
175
|
//#region src/dropdown/index.tsx
|
|
176
|
-
var
|
|
177
|
-
className: `selected-value ${
|
|
178
|
-
children:
|
|
179
|
-
}),
|
|
176
|
+
var m = ({ options: t, className: n, renderValue: r }) => /* @__PURE__ */ s("span", {
|
|
177
|
+
className: `selected-value ${n}`,
|
|
178
|
+
children: r ? r(e, t[0]) : t[0].label
|
|
179
|
+
}), h = ({ options: t, removeOption: n, className: r, renderValue: i, disabled: a, removeLabel: o }) => /* @__PURE__ */ s("div", {
|
|
180
180
|
className: `selected-values ${r}`,
|
|
181
|
-
children:
|
|
181
|
+
children: t.map((t, r) => /* @__PURE__ */ s("span", {
|
|
182
182
|
className: "selected-tag",
|
|
183
|
-
children: [
|
|
183
|
+
children: [i ? i(e, t) : t.label, !a && !t.disabled && /* @__PURE__ */ s(l, {
|
|
184
184
|
compact: !0,
|
|
185
|
-
onClick: (
|
|
186
|
-
|
|
185
|
+
onClick: (e) => {
|
|
186
|
+
e.stopPropagation(), n(t);
|
|
187
187
|
},
|
|
188
188
|
locale: {
|
|
189
|
-
title:
|
|
190
|
-
ariaLabel:
|
|
189
|
+
title: o?.(t.label) ?? `Remove ${t.label}`,
|
|
190
|
+
ariaLabel: o?.(t.label) ?? `Remove ${t.label}`
|
|
191
191
|
}
|
|
192
192
|
})]
|
|
193
193
|
}, r))
|
|
194
|
-
}),
|
|
195
|
-
className: `dropdown-arrow ${
|
|
194
|
+
}), g = ({ className: e }) => /* @__PURE__ */ s("span", {
|
|
195
|
+
className: `dropdown-arrow ${e}`,
|
|
196
196
|
"aria-hidden": "true",
|
|
197
|
-
dangerouslySetInnerHTML: { __html:
|
|
198
|
-
}),
|
|
197
|
+
dangerouslySetInnerHTML: { __html: c }
|
|
198
|
+
}), te = ({ placeholder: e, className: t }) => [/* @__PURE__ */ s("span", {
|
|
199
199
|
className: `placeholder px-2 ${t}`,
|
|
200
200
|
children: e
|
|
201
|
-
}), /* @__PURE__ */
|
|
202
|
-
function
|
|
203
|
-
let { search: k = !1, searchPlaceholder: A = "Search...", closeOnClickOutside: j = !0, autoOpen: M = !1, multiSelect: N = !1, portalTarget: P, ariaLabel: F, ariaLabelledBy: I, ariaDescribedBy: L, popupClassName: R, maxHeight:
|
|
204
|
-
|
|
205
|
-
M && !q.current && !
|
|
206
|
-
}, [M,
|
|
207
|
-
|
|
208
|
-
}, [
|
|
201
|
+
}), /* @__PURE__ */ s(g, { className: "mr-2" })];
|
|
202
|
+
function _({ source: t, dataSource: a, dataContext: c, remoteText: l, value: f, onChange: p, placeholder: _ = "Select an option", disabled: v = !1, name: y, id: b, className: ne = "", style: re, config: x = {}, renderContent: S, renderOption: ie, renderValue: C, renderPlaceholder: w, renderSelectedValue: T, renderNoResults: ae, onClose: E, beforeOutsideClose: D, environment: O }) {
|
|
203
|
+
let { search: k = !1, searchPlaceholder: A = "Search...", closeOnClickOutside: j = !0, autoOpen: M = !1, multiSelect: N = !1, portalTarget: P, ariaLabel: F, ariaLabelledBy: I, ariaDescribedBy: L, popupClassName: R, maxHeight: oe } = x, z = o(null), B = P ?? (x.topLayer ? z.current?.closest("revo-grid") : void 0) ?? (typeof document < "u" ? document.body : null), V = i(() => b || `dropdown-${Math.random().toString(36).substring(2, 9)}`, [b]), H = `${V}-listbox`, se = `${V}-search`, U = `${V}-menu`, [W, G] = r(M && !v), [ce, K] = r(!v && (M || !!x.autoFocus)), q = o(M), J = x.theme ?? "default";
|
|
204
|
+
n(() => {
|
|
205
|
+
M && !q.current && !v && (K(!0), G(!0)), q.current = M;
|
|
206
|
+
}, [M, v]), n(() => {
|
|
207
|
+
v && W && (G(!1), E?.(!1));
|
|
208
|
+
}, [v, W]);
|
|
209
209
|
let Y = ee({
|
|
210
|
-
dataSource:
|
|
211
|
-
dataContext:
|
|
212
|
-
remoteText:
|
|
213
|
-
value:
|
|
214
|
-
disabled:
|
|
215
|
-
source:
|
|
210
|
+
dataSource: a,
|
|
211
|
+
dataContext: c,
|
|
212
|
+
remoteText: l,
|
|
213
|
+
value: f,
|
|
214
|
+
disabled: v,
|
|
215
|
+
source: t,
|
|
216
216
|
open: W,
|
|
217
217
|
initialQuery: x.initialSearch ?? ""
|
|
218
|
-
}), X =
|
|
219
|
-
if (
|
|
220
|
-
if (N && Array.isArray(
|
|
218
|
+
}), X = a ? [...new Map([...Y.selected, ...Y.items].map((e) => [e.value, e])).values()] : t, Z = i(() => {
|
|
219
|
+
if (f === void 0) return [];
|
|
220
|
+
if (N && Array.isArray(f)) return X.filter((e) => f.some((t) => JSON.stringify(t) === JSON.stringify(e.value)));
|
|
221
221
|
{
|
|
222
|
-
let e = X.find((e) => JSON.stringify(e.value) === JSON.stringify(
|
|
222
|
+
let e = X.find((e) => JSON.stringify(e.value) === JSON.stringify(f));
|
|
223
223
|
return e ? [e] : [];
|
|
224
224
|
}
|
|
225
225
|
}, [
|
|
226
|
-
|
|
226
|
+
f,
|
|
227
227
|
X,
|
|
228
228
|
N
|
|
229
229
|
]), Q = () => {
|
|
230
|
-
|
|
230
|
+
v || G((e) => {
|
|
231
231
|
let t = !e;
|
|
232
232
|
return t && K(!0), t;
|
|
233
233
|
});
|
|
234
234
|
}, $ = (e = !1) => {
|
|
235
235
|
G((t) => (t && E?.(e), !1));
|
|
236
236
|
};
|
|
237
|
-
|
|
237
|
+
n(() => {
|
|
238
238
|
if (!W) return;
|
|
239
239
|
let e = z.current;
|
|
240
240
|
if (e) return O?.onOpen?.(e, $);
|
|
241
241
|
}, [W]);
|
|
242
|
-
let
|
|
243
|
-
if (!(
|
|
242
|
+
let le = (e) => {
|
|
243
|
+
if (!(v || e.disabled)) {
|
|
244
244
|
if (N) {
|
|
245
245
|
let t = Z.some((t) => JSON.stringify(t.value) === JSON.stringify(e.value)), n;
|
|
246
|
-
n = t ? Z.filter((t) => JSON.stringify(t.value) !== JSON.stringify(e.value)) : [...Z, e],
|
|
247
|
-
} else
|
|
246
|
+
n = t ? Z.filter((t) => JSON.stringify(t.value) !== JSON.stringify(e.value)) : [...Z, e], p && p(n.map((e) => e.value));
|
|
247
|
+
} else p && p(e.value), $();
|
|
248
248
|
}
|
|
249
249
|
};
|
|
250
|
-
return
|
|
250
|
+
return n(() => {
|
|
251
251
|
if (!j || !W) return;
|
|
252
252
|
let e = B?.ownerDocument ?? z.current?.ownerDocument ?? (typeof document < "u" ? document : void 0);
|
|
253
253
|
if (!e) return;
|
|
@@ -270,42 +270,42 @@ function g({ source: e, dataSource: t, dataContext: a, remoteText: s, value: p,
|
|
|
270
270
|
U,
|
|
271
271
|
B,
|
|
272
272
|
D
|
|
273
|
-
]), /* @__PURE__ */
|
|
274
|
-
className: `dropdown-container ${
|
|
275
|
-
style:
|
|
273
|
+
]), /* @__PURE__ */ s("div", {
|
|
274
|
+
className: `dropdown-container ${ne} ${v ? "disabled" : ""}`,
|
|
275
|
+
style: re,
|
|
276
276
|
children: [
|
|
277
|
-
/* @__PURE__ */
|
|
277
|
+
/* @__PURE__ */ s("div", {
|
|
278
278
|
ref: z,
|
|
279
279
|
className: `dropdown-trigger ${W ? "open" : ""}`,
|
|
280
280
|
role: "combobox",
|
|
281
281
|
"aria-haspopup": S ? "dialog" : "listbox",
|
|
282
|
-
"aria-expanded": W && !
|
|
283
|
-
"aria-disabled":
|
|
282
|
+
"aria-expanded": W && !v,
|
|
283
|
+
"aria-disabled": v,
|
|
284
284
|
"aria-owns": H,
|
|
285
285
|
"aria-controls": H,
|
|
286
286
|
"aria-label": F,
|
|
287
287
|
"aria-labelledby": I,
|
|
288
288
|
"aria-describedby": L,
|
|
289
|
-
tabIndex:
|
|
290
|
-
onClick:
|
|
289
|
+
tabIndex: v ? -1 : 0,
|
|
290
|
+
onClick: v ? void 0 : Q,
|
|
291
291
|
onKeyDown: (e) => {
|
|
292
|
-
|
|
292
|
+
v || e.target !== e.currentTarget || (W && e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), $()) : !W && (e.key === "Enter" || e.key === " " || e.key === "ArrowDown") && (e.preventDefault(), e.stopPropagation(), Q()));
|
|
293
293
|
},
|
|
294
294
|
children: (() => {
|
|
295
|
-
let
|
|
296
|
-
return T ? T(
|
|
295
|
+
let t = [g({})];
|
|
296
|
+
return T ? T(e, Z, t) : Z.length > 0 ? N ? [/* @__PURE__ */ s(h, {
|
|
297
297
|
options: Z,
|
|
298
|
-
removeOption:
|
|
298
|
+
removeOption: le,
|
|
299
299
|
renderValue: C,
|
|
300
|
-
disabled:
|
|
300
|
+
disabled: v,
|
|
301
301
|
removeLabel: x.removeLabel
|
|
302
|
-
}), /* @__PURE__ */
|
|
302
|
+
}), /* @__PURE__ */ s(g, { className: "mr-2" })] : [/* @__PURE__ */ s(m, {
|
|
303
303
|
options: Z,
|
|
304
304
|
renderValue: C
|
|
305
|
-
}), /* @__PURE__ */
|
|
305
|
+
}), /* @__PURE__ */ s(g, { className: "mr-2" })] : w ? w(e, _, t) : /* @__PURE__ */ s(te, { placeholder: _ });
|
|
306
306
|
})()
|
|
307
307
|
}),
|
|
308
|
-
W && !
|
|
308
|
+
W && !v && /* @__PURE__ */ s(u, {
|
|
309
309
|
onPointerRelease: O?.onPointerRelease,
|
|
310
310
|
topLayer: x.topLayer,
|
|
311
311
|
triggerRef: z,
|
|
@@ -313,45 +313,45 @@ function g({ source: e, dataSource: t, dataContext: a, remoteText: s, value: p,
|
|
|
313
313
|
theme: J,
|
|
314
314
|
dropdownMenuId: U,
|
|
315
315
|
popupClassName: R,
|
|
316
|
-
maxHeight:
|
|
316
|
+
maxHeight: oe,
|
|
317
317
|
children: S ? S({
|
|
318
318
|
id: H,
|
|
319
319
|
close: $
|
|
320
|
-
}) : /* @__PURE__ */ d
|
|
321
|
-
options:
|
|
322
|
-
selectedValues:
|
|
323
|
-
remote:
|
|
324
|
-
value:
|
|
320
|
+
}) : /* @__PURE__ */ s(d, {
|
|
321
|
+
options: a ? Y.items : X,
|
|
322
|
+
selectedValues: a ? Y.selected : void 0,
|
|
323
|
+
remote: a ? Y : void 0,
|
|
324
|
+
value: f,
|
|
325
325
|
onChange: (e) => {
|
|
326
|
-
|
|
326
|
+
v || p?.(e);
|
|
327
327
|
},
|
|
328
328
|
config: {
|
|
329
329
|
...x,
|
|
330
|
-
autoFocus: x.autoFocus ||
|
|
330
|
+
autoFocus: x.autoFocus || ce
|
|
331
331
|
},
|
|
332
332
|
multiSelect: N,
|
|
333
|
-
search: !!
|
|
333
|
+
search: !!a || k,
|
|
334
334
|
searchPlaceholder: A,
|
|
335
335
|
listboxId: H,
|
|
336
|
-
searchId:
|
|
337
|
-
renderOption:
|
|
338
|
-
renderNoResults:
|
|
336
|
+
searchId: se,
|
|
337
|
+
renderOption: ie,
|
|
338
|
+
renderNoResults: ae,
|
|
339
339
|
onClose: $,
|
|
340
340
|
theme: J
|
|
341
341
|
})
|
|
342
342
|
}),
|
|
343
|
-
|
|
343
|
+
y && /* @__PURE__ */ s("input", {
|
|
344
344
|
type: "hidden",
|
|
345
|
-
name:
|
|
345
|
+
name: y,
|
|
346
346
|
value: JSON.stringify(N ? Z.map((e) => e.value) : Z[0]?.value || "")
|
|
347
347
|
})
|
|
348
348
|
]
|
|
349
349
|
});
|
|
350
350
|
}
|
|
351
|
-
var
|
|
352
|
-
|
|
353
|
-
},
|
|
354
|
-
|
|
351
|
+
var v = (e, n) => {
|
|
352
|
+
t(/* @__PURE__ */ s(_, { ...n }), e);
|
|
353
|
+
}, y = (e) => {
|
|
354
|
+
t(null, e);
|
|
355
355
|
};
|
|
356
356
|
//#endregion
|
|
357
|
-
export {
|
|
357
|
+
export { v as n, y as r, _ as t };
|