@osdk/react-components 0.70.0 → 0.71.0-main-b8cfd7cc0d80e486c4ac145e259bf97e220d93da
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 +15 -0
- package/build/browser/action-form/ActionForm.js +86 -5
- package/build/browser/action-form/ActionForm.js.map +1 -1
- package/build/browser/action-form/ActionFormApi.js.map +1 -1
- package/build/browser/action-form/BaseForm.js +8 -6
- package/build/browser/action-form/BaseForm.js.map +1 -1
- package/build/browser/action-form/BaseForm.module.css +2 -2
- package/build/browser/public/action-form.js.map +1 -1
- package/build/browser/public/experimental/action-form.js +2 -0
- package/build/browser/public/experimental/action-form.js.map +1 -1
- package/build/browser/styles.css +2 -2
- package/build/browser/util/UserAgent.js +1 -1
- package/build/browser/util/UserAgent.js.map +1 -1
- package/build/cjs/{action-form-B6wbHrW1.d.cts → action-form-Iq1Ru5RI.d.cts} +18 -1
- package/build/cjs/{chunk-WUTJ2FYF.cjs → chunk-542S5PB4.cjs} +3 -3
- package/build/cjs/chunk-542S5PB4.cjs.map +1 -0
- package/build/cjs/{chunk-PKLHZUNU.cjs → chunk-6GHPHLCW.cjs} +8 -8
- package/build/cjs/{chunk-PKLHZUNU.cjs.map → chunk-6GHPHLCW.cjs.map} +1 -1
- package/build/cjs/chunk-6MRSW5XP.cjs +11 -0
- package/build/cjs/{chunk-DUH54L3A.cjs.map → chunk-6MRSW5XP.cjs.map} +1 -1
- package/build/cjs/{chunk-7EUTWZMR.cjs → chunk-6ZZTHO32.cjs} +4 -4
- package/build/cjs/{chunk-7EUTWZMR.cjs.map → chunk-6ZZTHO32.cjs.map} +1 -1
- package/build/cjs/{chunk-WVORK4J6.cjs → chunk-ALQZBG2D.cjs} +5 -5
- package/build/cjs/{chunk-WVORK4J6.cjs.map → chunk-ALQZBG2D.cjs.map} +1 -1
- package/build/cjs/{chunk-V6EHMYW3.cjs → chunk-AMNNLWCS.cjs} +4 -4
- package/build/cjs/{chunk-V6EHMYW3.cjs.map → chunk-AMNNLWCS.cjs.map} +1 -1
- package/build/cjs/chunk-AQD2HXGI.cjs +12 -0
- package/build/cjs/{chunk-BPC7IVVD.cjs.map → chunk-AQD2HXGI.cjs.map} +1 -1
- package/build/cjs/chunk-DSCFS24S.cjs +12 -0
- package/build/cjs/{chunk-Z4BT3QO3.cjs.map → chunk-DSCFS24S.cjs.map} +1 -1
- package/build/cjs/{chunk-UQTGPL5X.cjs → chunk-G6QCEAJR.cjs} +5 -5
- package/build/cjs/{chunk-UQTGPL5X.cjs.map → chunk-G6QCEAJR.cjs.map} +1 -1
- package/build/cjs/{chunk-T6TEMUKX.cjs → chunk-I2JZPI2A.cjs} +4 -4
- package/build/cjs/{chunk-T6TEMUKX.cjs.map → chunk-I2JZPI2A.cjs.map} +1 -1
- package/build/cjs/chunk-IAMQG4QK.cjs +11 -0
- package/build/cjs/{chunk-RWM5Q2TL.cjs.map → chunk-IAMQG4QK.cjs.map} +1 -1
- package/build/cjs/{chunk-JQTXDYGJ.cjs → chunk-IGOX32AB.cjs} +4 -4
- package/build/cjs/{chunk-JQTXDYGJ.cjs.map → chunk-IGOX32AB.cjs.map} +1 -1
- package/build/cjs/{chunk-HDSFUQBQ.cjs → chunk-IR3VWN44.cjs} +4 -4
- package/build/cjs/{chunk-HDSFUQBQ.cjs.map → chunk-IR3VWN44.cjs.map} +1 -1
- package/build/cjs/chunk-JUFROKPP.cjs +11 -0
- package/build/cjs/{chunk-34K44M7E.cjs.map → chunk-JUFROKPP.cjs.map} +1 -1
- package/build/cjs/chunk-LGFXDJ5F.cjs +11 -0
- package/build/cjs/{chunk-A3DQM47Z.cjs.map → chunk-LGFXDJ5F.cjs.map} +1 -1
- package/build/cjs/chunk-LZPDNV7J.cjs +11 -0
- package/build/cjs/{chunk-RSRRWH6V.cjs.map → chunk-LZPDNV7J.cjs.map} +1 -1
- package/build/cjs/{chunk-DNQRRSU2.cjs → chunk-MO2UJAQG.cjs} +4 -4
- package/build/cjs/{chunk-DNQRRSU2.cjs.map → chunk-MO2UJAQG.cjs.map} +1 -1
- package/build/cjs/{chunk-ZYBJ3LNA.cjs → chunk-MPEC5BN5.cjs} +4 -4
- package/build/cjs/{chunk-ZYBJ3LNA.cjs.map → chunk-MPEC5BN5.cjs.map} +1 -1
- package/build/cjs/{chunk-J4NBM6OE.cjs → chunk-NHQZGVEZ.cjs} +4 -4
- package/build/cjs/{chunk-J4NBM6OE.cjs.map → chunk-NHQZGVEZ.cjs.map} +1 -1
- package/build/cjs/chunk-RPYPKJAY.cjs +48 -0
- package/build/cjs/{chunk-NSPWQRJC.cjs.map → chunk-RPYPKJAY.cjs.map} +1 -1
- package/build/cjs/{chunk-P6SBA35V.cjs → chunk-RRIT3OA2.cjs} +4 -4
- package/build/cjs/{chunk-P6SBA35V.cjs.map → chunk-RRIT3OA2.cjs.map} +1 -1
- package/build/cjs/chunk-TBVC3WFI.cjs +11 -0
- package/build/cjs/{chunk-KPCU4HM4.cjs.map → chunk-TBVC3WFI.cjs.map} +1 -1
- package/build/cjs/{chunk-KIJIMTQX.cjs → chunk-TFK2W7YJ.cjs} +369 -428
- package/build/cjs/chunk-TFK2W7YJ.cjs.map +1 -0
- package/build/cjs/{chunk-IXXUU66T.cjs → chunk-TQOVHE6M.cjs} +4 -4
- package/build/cjs/{chunk-IXXUU66T.cjs.map → chunk-TQOVHE6M.cjs.map} +1 -1
- package/build/cjs/{chunk-JDOJZGDO.cjs → chunk-W7LK7SRO.cjs} +92 -51
- package/build/cjs/chunk-W7LK7SRO.cjs.map +1 -0
- package/build/cjs/{chunk-MNJON7D3.cjs → chunk-YKZ6DBDN.cjs} +98 -22
- package/build/cjs/chunk-YKZ6DBDN.cjs.map +1 -0
- package/build/cjs/chunk-ZMH2RDYW.cjs +34 -0
- package/build/cjs/{chunk-TPLDHL43.cjs.map → chunk-ZMH2RDYW.cjs.map} +1 -1
- package/build/cjs/public/action-form.cjs +5 -5
- package/build/cjs/public/action-form.css +2 -2
- package/build/cjs/public/action-form.css.map +1 -1
- package/build/cjs/public/action-form.d.cts +1 -1
- package/build/cjs/public/document-viewer.cjs +4 -4
- package/build/cjs/public/email-viewer.cjs +3 -3
- package/build/cjs/public/experimental/action-form.cjs +6 -6
- package/build/cjs/public/experimental/action-form.css +2 -2
- package/build/cjs/public/experimental/action-form.css.map +1 -1
- package/build/cjs/public/experimental/action-form.d.cts +4 -2
- package/build/cjs/public/experimental/cbac-picker.cjs +8 -8
- package/build/cjs/public/experimental/document-viewer.cjs +5 -5
- package/build/cjs/public/experimental/email-viewer.cjs +5 -5
- package/build/cjs/public/experimental/filter-list.cjs +16 -16
- package/build/cjs/public/experimental/image-viewer.cjs +5 -5
- package/build/cjs/public/experimental/markdown-renderer.cjs +7 -7
- package/build/cjs/public/experimental/object-table.cjs +24 -24
- package/build/cjs/public/experimental/pdf-viewer.cjs +25 -25
- package/build/cjs/public/experimental/spreadsheet-viewer.cjs +5 -5
- package/build/cjs/public/experimental/tiff-renderer.cjs +7 -7
- package/build/cjs/public/experimental/video-viewer.cjs +5 -5
- package/build/cjs/public/experimental/workshop-module.cjs +2 -2
- package/build/cjs/public/experimental/xml-viewer.cjs +5 -5
- package/build/cjs/public/experimental.cjs +110 -110
- package/build/cjs/public/experimental.css +2 -2
- package/build/cjs/public/experimental.css.map +1 -1
- package/build/cjs/public/experimental.d.cts +2 -2
- package/build/cjs/public/filter-list.cjs +15 -15
- package/build/cjs/public/image-viewer.cjs +3 -3
- package/build/cjs/public/markdown-viewer.cjs +3 -3
- package/build/cjs/public/object-table.cjs +23 -23
- package/build/cjs/public/pdf-viewer.cjs +7 -7
- package/build/cjs/public/spreadsheet-viewer.cjs +3 -3
- package/build/cjs/public/tiff-viewer.cjs +3 -3
- package/build/cjs/public/video-viewer.cjs +3 -3
- package/build/cjs/public/xml-viewer.cjs +3 -3
- package/build/esm/action-form/ActionForm.js +86 -5
- package/build/esm/action-form/ActionForm.js.map +1 -1
- package/build/esm/action-form/ActionFormApi.js.map +1 -1
- package/build/esm/action-form/BaseForm.js +8 -6
- package/build/esm/action-form/BaseForm.js.map +1 -1
- package/build/esm/action-form/BaseForm.module.css +2 -2
- package/build/esm/public/action-form.js.map +1 -1
- package/build/esm/public/experimental/action-form.js +2 -0
- package/build/esm/public/experimental/action-form.js.map +1 -1
- package/build/esm/util/UserAgent.js +1 -1
- package/build/esm/util/UserAgent.js.map +1 -1
- package/build/types/action-form/ActionForm.d.ts.map +1 -1
- package/build/types/action-form/ActionFormApi.d.ts +17 -0
- package/build/types/action-form/ActionFormApi.d.ts.map +1 -1
- package/build/types/action-form/BaseForm.d.ts.map +1 -1
- package/build/types/public/action-form.d.ts +1 -1
- package/build/types/public/action-form.d.ts.map +1 -1
- package/build/types/public/experimental/action-form.d.ts +2 -0
- package/build/types/public/experimental/action-form.d.ts.map +1 -1
- package/docs/ActionFormOverview.md +14 -13
- package/package.json +7 -7
- package/build/cjs/chunk-34K44M7E.cjs +0 -11
- package/build/cjs/chunk-A3DQM47Z.cjs +0 -11
- package/build/cjs/chunk-BPC7IVVD.cjs +0 -12
- package/build/cjs/chunk-DUH54L3A.cjs +0 -11
- package/build/cjs/chunk-JDOJZGDO.cjs.map +0 -1
- package/build/cjs/chunk-KIJIMTQX.cjs.map +0 -1
- package/build/cjs/chunk-KPCU4HM4.cjs +0 -11
- package/build/cjs/chunk-MNJON7D3.cjs.map +0 -1
- package/build/cjs/chunk-NSPWQRJC.cjs +0 -48
- package/build/cjs/chunk-RSRRWH6V.cjs +0 -11
- package/build/cjs/chunk-RWM5Q2TL.cjs +0 -11
- package/build/cjs/chunk-TPLDHL43.cjs +0 -34
- package/build/cjs/chunk-WUTJ2FYF.cjs.map +0 -1
- package/build/cjs/chunk-Z4BT3QO3.cjs +0 -12
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkLZPDNV7J_cjs = require('./chunk-LZPDNV7J.cjs');
|
|
4
4
|
var chunkKHMOMROL_cjs = require('./chunk-KHMOMROL.cjs');
|
|
5
5
|
|
|
6
6
|
// src/public/experimental/video-viewer.ts
|
|
7
7
|
var BaseVideoViewer2 = chunkKHMOMROL_cjs.BaseVideoViewer;
|
|
8
|
-
var VideoViewer2 =
|
|
8
|
+
var VideoViewer2 = chunkLZPDNV7J_cjs.VideoViewer;
|
|
9
9
|
|
|
10
10
|
exports.BaseVideoViewer = BaseVideoViewer2;
|
|
11
11
|
exports.VideoViewer = VideoViewer2;
|
|
12
|
-
//# sourceMappingURL=chunk-
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
12
|
+
//# sourceMappingURL=chunk-TQOVHE6M.cjs.map
|
|
13
|
+
//# sourceMappingURL=chunk-TQOVHE6M.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/public/experimental/video-viewer.ts"],"names":["BaseVideoViewer","VideoViewer"],"mappings":";;;;;;AAmBO,IAAMA,gBAAAA,GAAyBA;AAO/B,IAAMC,YAAAA,GAAqBA","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../../src/public/experimental/video-viewer.ts"],"names":["BaseVideoViewer","VideoViewer"],"mappings":";;;;;;AAmBO,IAAMA,gBAAAA,GAAyBA;AAO/B,IAAMC,YAAAA,GAAqBA","file":"chunk-TQOVHE6M.cjs","sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as Stable from \"../video-viewer.js\";\n\n/** @deprecated Import from `@osdk/react-components/video-viewer` instead. */\nexport const BaseVideoViewer = Stable.BaseVideoViewer;\n\n/** @deprecated Import from `@osdk/react-components/video-viewer` instead. */\n\n/** @deprecated Import from `@osdk/react-components/video-viewer` instead. */\n\n/** @deprecated Import from `@osdk/react-components/video-viewer` instead. */\nexport const VideoViewer = Stable.VideoViewer;"]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunk24W2HVQB_cjs = require('./chunk-24W2HVQB.cjs');
|
|
4
|
-
var
|
|
4
|
+
var React6 = require('react');
|
|
5
|
+
var lodashEs = require('lodash-es');
|
|
5
6
|
var icons = require('@blueprintjs/icons');
|
|
6
7
|
|
|
7
8
|
function _interopNamespace(e) {
|
|
@@ -22,21 +23,60 @@ function _interopNamespace(e) {
|
|
|
22
23
|
return Object.freeze(n);
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
var
|
|
26
|
+
var React6__namespace = /*#__PURE__*/_interopNamespace(React6);
|
|
26
27
|
|
|
27
|
-
var typedReactMemo = React3__namespace.default.memo;
|
|
28
28
|
function useEventCallback(callback) {
|
|
29
|
-
const latestCallbackValueWrapper =
|
|
29
|
+
const latestCallbackValueWrapper = React6__namespace.useRef((...args) => {
|
|
30
30
|
if (typeof globalThis.console !== "undefined") {
|
|
31
31
|
globalThis.console.error("A callback created with `useEventCallback` was called during the initial render of a component. This will throw an error in the future.");
|
|
32
32
|
}
|
|
33
33
|
return callback(...args);
|
|
34
34
|
});
|
|
35
|
-
|
|
35
|
+
React6__namespace.useEffect(() => {
|
|
36
36
|
latestCallbackValueWrapper.current = callback;
|
|
37
37
|
}, [callback]);
|
|
38
|
-
return
|
|
38
|
+
return React6__namespace.useCallback((...args) => latestCallbackValueWrapper.current(...args), []);
|
|
39
39
|
}
|
|
40
|
+
function useOnUnmount(onUnmount) {
|
|
41
|
+
const onUnmountRef = React6__namespace.useRef(onUnmount);
|
|
42
|
+
React6__namespace.useEffect(() => {
|
|
43
|
+
onUnmountRef.current = onUnmount;
|
|
44
|
+
}, [onUnmount]);
|
|
45
|
+
React6__namespace.useEffect(() => {
|
|
46
|
+
return () => {
|
|
47
|
+
onUnmountRef.current();
|
|
48
|
+
};
|
|
49
|
+
}, []);
|
|
50
|
+
}
|
|
51
|
+
function useGatedValue(value, isGateOpen) {
|
|
52
|
+
const ref = React6__namespace.useRef(value);
|
|
53
|
+
const gateOpen = React6__namespace.useMemo(() => isGateOpen(value, ref.current), [value, isGateOpen]);
|
|
54
|
+
React6__namespace.useEffect(() => {
|
|
55
|
+
if (gateOpen) {
|
|
56
|
+
ref.current = value;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
return gateOpen ? value : ref.current;
|
|
60
|
+
}
|
|
61
|
+
function useInverseGatedValue(value, isGateClosed) {
|
|
62
|
+
const isGateOpen = React6__namespace.useCallback((current, previous) => !isGateClosed(current, previous), [isGateClosed]);
|
|
63
|
+
return useGatedValue(value, isGateOpen);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// src/shared/hooks/variables/useDeepEqual.ts
|
|
67
|
+
function useDeepEqual(value) {
|
|
68
|
+
return useInverseGatedValue(value, lodashEs.isEqual);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// src/shared/hooks/useDebouncedCallback.ts
|
|
72
|
+
function useDebouncedCallback(callback, wait, options) {
|
|
73
|
+
const f = useEventCallback(callback);
|
|
74
|
+
const deepOptions = useDeepEqual(options);
|
|
75
|
+
const debouncedCallback = React6__namespace.useMemo(() => lodashEs.debounce(f, wait, deepOptions), [f, wait, deepOptions]);
|
|
76
|
+
useOnUnmount(() => debouncedCallback.cancel());
|
|
77
|
+
return debouncedCallback;
|
|
78
|
+
}
|
|
79
|
+
var typedReactMemo = React6__namespace.default.memo;
|
|
40
80
|
|
|
41
81
|
// src/action-form/fields/DropdownField.module.css
|
|
42
82
|
var DropdownField_default = {};
|
|
@@ -70,9 +110,9 @@ var DropdownField = typedReactMemo(function DropdownFieldFn({
|
|
|
70
110
|
const normalizedValue = value ?? (isMultiple ? EMPTY_ARRAY : null);
|
|
71
111
|
const resolvedItemToStringLabel = itemToStringLabel ?? defaultItemToStringLabel;
|
|
72
112
|
const resolvedRenderItemLabel = renderItemLabel ?? resolvedItemToStringLabel;
|
|
73
|
-
const getKey =
|
|
113
|
+
const getKey = React6.useCallback((item) => itemToKey?.(item) ?? resolvedItemToStringLabel(item), [itemToKey, resolvedItemToStringLabel]);
|
|
74
114
|
if (isSearchable || isMultiple) {
|
|
75
|
-
return /* @__PURE__ */
|
|
115
|
+
return /* @__PURE__ */ React6__namespace.default.createElement(ComboboxDropdown, _extends({}, rest, {
|
|
76
116
|
isMultiple,
|
|
77
117
|
value: normalizedValue,
|
|
78
118
|
itemToStringLabel: resolvedItemToStringLabel,
|
|
@@ -87,7 +127,7 @@ var DropdownField = typedReactMemo(function DropdownFieldFn({
|
|
|
87
127
|
modal
|
|
88
128
|
}));
|
|
89
129
|
}
|
|
90
|
-
return /* @__PURE__ */
|
|
130
|
+
return /* @__PURE__ */ React6__namespace.default.createElement(SelectDropdown, _extends({}, rest, {
|
|
91
131
|
value: normalizedValue,
|
|
92
132
|
itemToStringLabel: resolvedItemToStringLabel,
|
|
93
133
|
renderItemLabel: resolvedRenderItemLabel,
|
|
@@ -111,11 +151,11 @@ var SelectDropdown = typedReactMemo(function SelectDropdownFn({
|
|
|
111
151
|
modal = true,
|
|
112
152
|
disabled
|
|
113
153
|
}) {
|
|
114
|
-
const [open, setOpen] =
|
|
154
|
+
const [open, setOpen] = React6.useState(false);
|
|
115
155
|
const isOpen = !disabled && open;
|
|
116
156
|
const hasValue = value != null;
|
|
117
|
-
const renderSingleSelectedItemLabel =
|
|
118
|
-
const handleOpenChange =
|
|
157
|
+
const renderSingleSelectedItemLabel = React6.useCallback((selectedValue) => selectedValue == null ? null : renderItemLabel(selectedValue), [renderItemLabel]);
|
|
158
|
+
const handleOpenChange = React6.useCallback((nextOpen) => {
|
|
119
159
|
if (disabled) {
|
|
120
160
|
return;
|
|
121
161
|
}
|
|
@@ -124,14 +164,14 @@ var SelectDropdown = typedReactMemo(function SelectDropdownFn({
|
|
|
124
164
|
onBlur?.();
|
|
125
165
|
}
|
|
126
166
|
}, [disabled, onBlur]);
|
|
127
|
-
const handleClear =
|
|
167
|
+
const handleClear = React6.useCallback(() => {
|
|
128
168
|
onChange?.(null);
|
|
129
169
|
handleOpenChange(false);
|
|
130
170
|
}, [onChange, handleOpenChange]);
|
|
131
|
-
const handleDismiss =
|
|
171
|
+
const handleDismiss = React6.useCallback(() => {
|
|
132
172
|
handleOpenChange(false);
|
|
133
173
|
}, [handleOpenChange]);
|
|
134
|
-
return /* @__PURE__ */
|
|
174
|
+
return /* @__PURE__ */ React6__namespace.default.createElement("div", null, /* @__PURE__ */ React6__namespace.default.createElement(chunk24W2HVQB_cjs.Select.Root, {
|
|
135
175
|
value,
|
|
136
176
|
onValueChange: onChange,
|
|
137
177
|
open: isOpen,
|
|
@@ -140,32 +180,32 @@ var SelectDropdown = typedReactMemo(function SelectDropdownFn({
|
|
|
140
180
|
itemToStringLabel,
|
|
141
181
|
modal,
|
|
142
182
|
disabled
|
|
143
|
-
}, /* @__PURE__ */
|
|
183
|
+
}, /* @__PURE__ */ React6__namespace.default.createElement(chunk24W2HVQB_cjs.Select.Trigger, {
|
|
144
184
|
id,
|
|
145
185
|
placeholder,
|
|
146
186
|
disabled
|
|
147
|
-
}, /* @__PURE__ */
|
|
187
|
+
}, /* @__PURE__ */ React6__namespace.default.createElement("div", {
|
|
148
188
|
className: chunk24W2HVQB_cjs.Select_default.osdkSelectValueContainer
|
|
149
|
-
}, /* @__PURE__ */
|
|
189
|
+
}, /* @__PURE__ */ React6__namespace.default.createElement(chunk24W2HVQB_cjs.Select.Value, null, renderSingleSelectedItemLabel), placeholder != null && /* @__PURE__ */ React6__namespace.default.createElement("span", {
|
|
150
190
|
className: chunk24W2HVQB_cjs.Select_default.osdkSelectPlaceholder
|
|
151
|
-
}, placeholder)), hasValue && /* @__PURE__ */
|
|
191
|
+
}, placeholder)), hasValue && /* @__PURE__ */ React6__namespace.default.createElement("span", {
|
|
152
192
|
role: "button",
|
|
153
193
|
"aria-label": "Clear",
|
|
154
194
|
className: chunk24W2HVQB_cjs.Select_default.osdkSelectClear,
|
|
155
195
|
"aria-disabled": disabled || void 0,
|
|
156
196
|
onMouseDown: disabled ? void 0 : preventTriggerOpen,
|
|
157
197
|
onClick: disabled ? void 0 : handleClear
|
|
158
|
-
}, /* @__PURE__ */
|
|
198
|
+
}, /* @__PURE__ */ React6__namespace.default.createElement(icons.SmallCross, null)), /* @__PURE__ */ React6__namespace.default.createElement("span", {
|
|
159
199
|
className: chunk24W2HVQB_cjs.Select_default.osdkSelectIcon
|
|
160
|
-
}, /* @__PURE__ */
|
|
200
|
+
}, /* @__PURE__ */ React6__namespace.default.createElement(icons.CaretDown, null))), /* @__PURE__ */ React6__namespace.default.createElement(chunk24W2HVQB_cjs.Select.Portal, {
|
|
161
201
|
ref: portalRef,
|
|
162
202
|
container: portalContainer
|
|
163
|
-
}, isOpen && modal && /* @__PURE__ */
|
|
203
|
+
}, isOpen && modal && /* @__PURE__ */ React6__namespace.default.createElement(chunk24W2HVQB_cjs.PortalDismissLayer, {
|
|
164
204
|
className: DropdownField_default.osdkSelectDismissLayer,
|
|
165
205
|
onDismiss: handleDismiss
|
|
166
|
-
}), /* @__PURE__ */
|
|
206
|
+
}), /* @__PURE__ */ React6__namespace.default.createElement(chunk24W2HVQB_cjs.Select.Positioner, null, /* @__PURE__ */ React6__namespace.default.createElement(chunk24W2HVQB_cjs.Select.Popup, null, items.map((item) => {
|
|
167
207
|
const itemLabel = itemToStringLabel(item);
|
|
168
|
-
return /* @__PURE__ */
|
|
208
|
+
return /* @__PURE__ */ React6__namespace.default.createElement(chunk24W2HVQB_cjs.Select.Item, {
|
|
169
209
|
key: getKey(item),
|
|
170
210
|
value: item,
|
|
171
211
|
label: itemLabel,
|
|
@@ -196,48 +236,48 @@ var ComboboxDropdown = typedReactMemo(function ComboboxDropdownFn({
|
|
|
196
236
|
modal = true,
|
|
197
237
|
disabled
|
|
198
238
|
}) {
|
|
199
|
-
const [open, setOpen] =
|
|
239
|
+
const [open, setOpen] = React6.useState(false);
|
|
200
240
|
const isOpen = !disabled && open;
|
|
201
241
|
const hasValue = isMultiple ? Array.isArray(value) && value.length > 0 : value != null;
|
|
202
|
-
const renderSingleSelectedItemLabel =
|
|
203
|
-
const handleOpenChange =
|
|
242
|
+
const renderSingleSelectedItemLabel = React6.useCallback((selectedValue) => selectedValue == null ? null : renderItemLabel(selectedValue), [renderItemLabel]);
|
|
243
|
+
const handleOpenChange = React6.useCallback((nextOpen) => {
|
|
204
244
|
setOpen(nextOpen);
|
|
205
245
|
if (!nextOpen) {
|
|
206
246
|
onBlur?.();
|
|
207
247
|
}
|
|
208
248
|
}, [onBlur]);
|
|
209
|
-
const handleValueChange =
|
|
249
|
+
const handleValueChange = React6.useCallback((...args) => {
|
|
210
250
|
onChange?.(...args);
|
|
211
251
|
if (isMultiple) {
|
|
212
252
|
onBlur?.();
|
|
213
253
|
}
|
|
214
254
|
}, [onChange, onBlur, isMultiple]);
|
|
215
|
-
const handleClear =
|
|
255
|
+
const handleClear = React6.useCallback(() => {
|
|
216
256
|
const cleared = isMultiple ? EMPTY_ARRAY : null;
|
|
217
257
|
handleValueChange(cleared);
|
|
218
258
|
if (!isMultiple) {
|
|
219
259
|
handleOpenChange(false);
|
|
220
260
|
}
|
|
221
261
|
}, [isMultiple, handleValueChange, handleOpenChange]);
|
|
222
|
-
const handleRemoveItem =
|
|
262
|
+
const handleRemoveItem = React6.useCallback((itemToRemove) => {
|
|
223
263
|
if (!isMultiple || !Array.isArray(value)) {
|
|
224
264
|
return;
|
|
225
265
|
}
|
|
226
266
|
const next = value.filter((v) => isItemEqual != null ? !isItemEqual(v, itemToRemove) : v !== itemToRemove);
|
|
227
267
|
handleValueChange(next);
|
|
228
268
|
}, [isMultiple, value, handleValueChange, isItemEqual]);
|
|
229
|
-
const handleDismiss =
|
|
269
|
+
const handleDismiss = React6.useCallback(() => {
|
|
230
270
|
handleOpenChange(false);
|
|
231
271
|
}, [handleOpenChange]);
|
|
232
|
-
const renderItem =
|
|
272
|
+
const renderItem = React6.useCallback((item) => {
|
|
233
273
|
const itemLabel = itemToStringLabel(item);
|
|
234
|
-
return /* @__PURE__ */
|
|
274
|
+
return /* @__PURE__ */ React6__namespace.default.createElement(chunk24W2HVQB_cjs.Combobox.Item, {
|
|
235
275
|
key: getKey(item),
|
|
236
276
|
value: item,
|
|
237
277
|
"aria-label": itemLabel
|
|
238
|
-
}, isMultiple && /* @__PURE__ */
|
|
278
|
+
}, isMultiple && /* @__PURE__ */ React6__namespace.default.createElement(chunk24W2HVQB_cjs.Combobox.ItemIndicator, null, /* @__PURE__ */ React6__namespace.default.createElement(icons.Tick, null)), renderItemLabel(item));
|
|
239
279
|
}, [getKey, isMultiple, itemToStringLabel, renderItemLabel]);
|
|
240
|
-
return /* @__PURE__ */
|
|
280
|
+
return /* @__PURE__ */ React6__namespace.default.createElement("div", null, /* @__PURE__ */ React6__namespace.default.createElement(chunk24W2HVQB_cjs.Combobox.Root, {
|
|
241
281
|
value,
|
|
242
282
|
onValueChange: handleValueChange,
|
|
243
283
|
open: isOpen,
|
|
@@ -250,48 +290,48 @@ var ComboboxDropdown = typedReactMemo(function ComboboxDropdownFn({
|
|
|
250
290
|
onInputValueChange: onQueryChange,
|
|
251
291
|
filter: disableClientSideFiltering ? null : void 0,
|
|
252
292
|
disabled
|
|
253
|
-
}, /* @__PURE__ */
|
|
293
|
+
}, /* @__PURE__ */ React6__namespace.default.createElement(chunk24W2HVQB_cjs.Combobox.Trigger, {
|
|
254
294
|
id,
|
|
255
295
|
disabled,
|
|
256
296
|
className: isMultiple ? chunk24W2HVQB_cjs.Combobox_default.osdkComboboxTriggerMulti : void 0
|
|
257
|
-
}, /* @__PURE__ */
|
|
297
|
+
}, /* @__PURE__ */ React6__namespace.default.createElement("div", {
|
|
258
298
|
className: chunk24W2HVQB_cjs.Combobox_default.osdkComboboxValueContainer
|
|
259
|
-
}, isMultiple && Array.isArray(value) && value.length > 0 ? /* @__PURE__ */
|
|
299
|
+
}, isMultiple && Array.isArray(value) && value.length > 0 ? /* @__PURE__ */ React6__namespace.default.createElement("div", {
|
|
260
300
|
className: chunk24W2HVQB_cjs.Combobox_default.osdkComboboxTriggerChips
|
|
261
|
-
}, value.map((item) => /* @__PURE__ */
|
|
301
|
+
}, value.map((item) => /* @__PURE__ */ React6__namespace.default.createElement("span", {
|
|
262
302
|
key: getKey(item),
|
|
263
303
|
className: chunk24W2HVQB_cjs.Combobox_default.osdkComboboxTriggerChip
|
|
264
|
-
}, renderItemLabel(item), /* @__PURE__ */
|
|
304
|
+
}, renderItemLabel(item), /* @__PURE__ */ React6__namespace.default.createElement("span", {
|
|
265
305
|
role: "button",
|
|
266
306
|
"aria-label": `Remove ${itemToStringLabel(item)}`,
|
|
267
307
|
className: chunk24W2HVQB_cjs.Combobox_default.osdkComboboxTriggerChipRemove,
|
|
268
308
|
"aria-disabled": disabled || void 0,
|
|
269
309
|
onMouseDown: disabled ? void 0 : preventTriggerOpen,
|
|
270
310
|
onClick: disabled ? void 0 : () => handleRemoveItem(item)
|
|
271
|
-
}, /* @__PURE__ */
|
|
311
|
+
}, /* @__PURE__ */ React6__namespace.default.createElement(icons.Cross, {
|
|
272
312
|
size: 12
|
|
273
|
-
}))))) : /* @__PURE__ */
|
|
313
|
+
}))))) : /* @__PURE__ */ React6__namespace.default.createElement(React6__namespace.default.Fragment, null, /* @__PURE__ */ React6__namespace.default.createElement(chunk24W2HVQB_cjs.Combobox.Value, null, renderSingleSelectedItemLabel), !hasValue && placeholder != null && /* @__PURE__ */ React6__namespace.default.createElement("span", {
|
|
274
314
|
className: chunk24W2HVQB_cjs.Combobox_default.osdkComboboxPlaceholder
|
|
275
|
-
}, placeholder))), hasValue && /* @__PURE__ */
|
|
315
|
+
}, placeholder))), hasValue && /* @__PURE__ */ React6__namespace.default.createElement("span", {
|
|
276
316
|
role: "button",
|
|
277
317
|
"aria-label": "Clear",
|
|
278
318
|
className: chunk24W2HVQB_cjs.Combobox_default.osdkComboboxClear,
|
|
279
319
|
"aria-disabled": disabled || void 0,
|
|
280
320
|
onMouseDown: disabled ? void 0 : preventTriggerOpen,
|
|
281
321
|
onClick: disabled ? void 0 : handleClear
|
|
282
|
-
}, /* @__PURE__ */
|
|
322
|
+
}, /* @__PURE__ */ React6__namespace.default.createElement(icons.SmallCross, null)), /* @__PURE__ */ React6__namespace.default.createElement(chunk24W2HVQB_cjs.Combobox.Icon, null, /* @__PURE__ */ React6__namespace.default.createElement(icons.CaretDown, null))), /* @__PURE__ */ React6__namespace.default.createElement(chunk24W2HVQB_cjs.Combobox.Portal, {
|
|
283
323
|
ref: portalRef,
|
|
284
324
|
container: portalContainer
|
|
285
|
-
}, isOpen && modal && /* @__PURE__ */
|
|
325
|
+
}, isOpen && modal && /* @__PURE__ */ React6__namespace.default.createElement(chunk24W2HVQB_cjs.PortalDismissLayer, {
|
|
286
326
|
className: DropdownField_default.osdkComboboxDismissLayer,
|
|
287
327
|
onDismiss: handleDismiss
|
|
288
|
-
}), /* @__PURE__ */
|
|
328
|
+
}), /* @__PURE__ */ React6__namespace.default.createElement(chunk24W2HVQB_cjs.Combobox.Positioner, null, /* @__PURE__ */ React6__namespace.default.createElement(chunk24W2HVQB_cjs.Combobox.Popup, {
|
|
289
329
|
"aria-label": placeholder || "Options"
|
|
290
|
-
}, isSearchable && /* @__PURE__ */
|
|
330
|
+
}, isSearchable && /* @__PURE__ */ React6__namespace.default.createElement("div", {
|
|
291
331
|
className: chunk24W2HVQB_cjs.Combobox_default.osdkComboboxPopupSearchInput
|
|
292
|
-
}, /* @__PURE__ */
|
|
332
|
+
}, /* @__PURE__ */ React6__namespace.default.createElement(chunk24W2HVQB_cjs.Combobox.SearchInput, {
|
|
293
333
|
placeholder: "Search\u2026"
|
|
294
|
-
})), popupStatus, popupStatus == null && /* @__PURE__ */
|
|
334
|
+
})), popupStatus, popupStatus == null && /* @__PURE__ */ React6__namespace.default.createElement(chunk24W2HVQB_cjs.Combobox.Empty, null, "No results"), /* @__PURE__ */ React6__namespace.default.createElement(chunk24W2HVQB_cjs.Combobox.List, null, /* @__PURE__ */ React6__namespace.default.createElement(chunk24W2HVQB_cjs.Combobox.Collection, null, renderItem), trailingItem))))));
|
|
295
335
|
});
|
|
296
336
|
function preventTriggerOpen(e) {
|
|
297
337
|
e.stopPropagation();
|
|
@@ -309,6 +349,7 @@ function defaultItemToStringLabel(item) {
|
|
|
309
349
|
|
|
310
350
|
exports.DropdownField = DropdownField;
|
|
311
351
|
exports.typedReactMemo = typedReactMemo;
|
|
352
|
+
exports.useDebouncedCallback = useDebouncedCallback;
|
|
312
353
|
exports.useEventCallback = useEventCallback;
|
|
313
|
-
//# sourceMappingURL=chunk-
|
|
314
|
-
//# sourceMappingURL=chunk-
|
|
354
|
+
//# sourceMappingURL=chunk-W7LK7SRO.cjs.map
|
|
355
|
+
//# sourceMappingURL=chunk-W7LK7SRO.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/shared/hooks/useEventCallback.ts","../../src/shared/hooks/lifecycle/useOnUnmount.ts","../../src/shared/hooks/variables/useGatedValue.ts","../../src/shared/hooks/variables/useDeepEqual.ts","../../src/shared/hooks/useDebouncedCallback.ts","../../src/shared/typedMemo.ts","../../src/action-form/fields/DropdownField.module.css","../../src/action-form/fields/DropdownField.tsx"],"names":["React","React2","React3","isEqual","React4","debounce","useCallback","useState","Select","Select_default","SmallCross","CaretDown","PortalDismissLayer","Combobox","Tick","Combobox_default","Cross"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BO,SAAS,iBAAiB,QAAA,EAAU;AACzC,EAAA,MAAM,0BAAA,GAAmCA,iBAAA,CAAA,MAAA,CAAO,CAAA,GAAI,IAAA,KAAS;AAC3D,IAAA,IAAI,OAAO,UAAA,CAAW,OAAA,KAAY,WAAA,EAAa;AAC7C,M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IAAA,KAAS,QAAA,EAAU;AAC5C,IAAA,OAAO,OAAO,IAAI,CAAA;AAAA,EACpB;AACA,EAAA,IAAI,OAAA,IAAW,QAAQ,IAAA,CAAK,KAAA,IAAS,QAAQ,OAAO,IAAA,CAAK,UAAU,QAAA,EAAU;AAC3E,IAAA,OAAO,IAAA,CAAK,KAAA;AAAA,EACd;AACA,EAAA,OAAO,OAAO,IAAI,CAAA;AACpB","file":"chunk-W7LK7SRO.cjs","sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as React from \"react\";\n\n/**\n * Creates a MutableRefObject with a constant reference. This allows us to pass around a constant reference\n * to a callback, but let the consumer change the callback over time without losing that reference.\n * The callback is only updated after render, so any usage of the callback during render will operate on the\n * previous render's callback. Callbacks created by this hook should **only** be used for event handling.\n * If the callback is called on the first render of a component, it will log an error. In the future,\n * this will throw.\n *\n * ```\n *\n * @param callback\n */\n/* eslint-disable-next-line @typescript-eslint/no-unsafe-function-type */\nexport function useEventCallback(callback) {\n const latestCallbackValueWrapper = React.useRef((...args) => {\n if (typeof globalThis.console !== \"undefined\") {\n globalThis.console.error(\"A callback created with `useEventCallback` was called during the initial render of a component. This will throw an error in the future.\");\n }\n return callback(...args);\n });\n React.useEffect(() => {\n latestCallbackValueWrapper.current = callback;\n }, [callback]);\n return React.useCallback((...args) => latestCallbackValueWrapper.current(...args), []);\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as React from \"react\";\n\n/**\n * Executes the `onUnmount` callback when the component unmounts. This tracks the value of the `onUnmount` argument\n * so that it has the correct value when the component unmounts.\n */\nexport function useOnUnmount(onUnmount) {\n const onUnmountRef = React.useRef(onUnmount);\n React.useEffect(() => {\n onUnmountRef.current = onUnmount;\n }, [onUnmount]);\n React.useEffect(() => {\n return () => {\n onUnmountRef.current();\n };\n }, []);\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as React from \"react\";\n\n/**\n * Lets through @param value when @param isGateOpen returns true, otherwise it returns\n * the last value for which @param isGateOpen was true (or the very first value if it was\n * never true).\n *\n * @see useInverseGatedValue for the opposite function\n */\nexport function useGatedValue(value, isGateOpen) {\n const ref = React.useRef(value);\n const gateOpen = React.useMemo(() => isGateOpen(value, ref.current), [value, isGateOpen]);\n React.useEffect(() => {\n if (gateOpen) {\n ref.current = value;\n }\n });\n return gateOpen ? value : ref.current;\n}\n\n/**\n * Blocks the @param value when @param isGateClosed returns true, returning the last value for which\n *\n * @param isGateClosed was false (or the very first value if it was never false).\n *\n * @see useGatedValue for the opposite function\n */\nexport function useInverseGatedValue(value, isGateClosed) {\n const isGateOpen = React.useCallback((current, previous) => !isGateClosed(current, previous), [isGateClosed]);\n return useGatedValue(value, isGateOpen);\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { isEqual } from \"lodash-es\";\nimport { useInverseGatedValue } from \"./useGatedValue.js\";\n\n/**\n * Simple wrapper around useInverseGatedValue where lodash's isEqual is the \"gatekeeper\".\n *\n * While you are passing values that are deep equal to each other, this will\n * return the first value you passed. If you pass a value that isn't deep equal\n * to its predecessor, this will return the new value.\n *\n * It's guaranteed that the return value of `useDeepEqual` will be deep equal\n * to the @param value you passed, though it may have been an argument from an\n * earlier run.\n *\n * @example\n * A1 and A2 are deep equal.\n * B1, B2 and B3 are deep equal.\n * - Call 1: useDeepEqual(A1) -> A1\n * - Call 2: useDeepEqual(A2) -> A1\n * - Call 3: useDeepEqual(B1) -> B1\n * - Call 4: useDeepEqual(B2) -> B1\n * - Call 5: useDeepEqual(B3) -> B1\n * - Call 6: useDeepEqual(C1) -> C1\n */\nexport function useDeepEqual(value) {\n return useInverseGatedValue(value, isEqual);\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { debounce } from \"lodash-es\";\nimport * as React from \"react\";\nimport { useOnUnmount } from \"./lifecycle/useOnUnmount.js\";\nimport { useEventCallback } from \"./useEventCallback.js\";\nimport { useDeepEqual } from \"./variables/useDeepEqual.js\";\n\n// Helper type to check if parameters have explicit types\n\n/**\n * Creates a debounced callback that delays invoking `callback` until after `wait`\n * milliseconds have elapsed since the last time `callback` was invoked.\n *\n * The function returned will be stable, suitable for passing to memoized components or as the dependency to useEffect.\n *\n * Note that you _do not_ need to memoize the function passed to `useDebouncedCallback` by first using `useCallback` or `useEventCallback`, you can pass an inline function.\n *\n * @param {Function} callback The function to debounce.\n * @param {number} wait The number of milliseconds to delay\n * @param options Additional configuration options. See https://lodash.com/docs/4.17.15#debounce for more details\n *\n * @example\n * const handleScroll = useDebouncedCallback((event: React.UIEvent<HTMLDivElement>) => {\n * loadMore(event.current.scrollTop);\n * }, 100)\n */\nexport function useDebouncedCallback(callback, wait, options) {\n const f = useEventCallback(callback);\n const deepOptions = useDeepEqual(options);\n const debouncedCallback = React.useMemo(() => debounce(f, wait, deepOptions), [f, wait, deepOptions]);\n useOnUnmount(() => debouncedCallback.cancel());\n return debouncedCallback;\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from \"react\";\n\n/**\n * TODO: Delete this once `React.memo` is typed to not lose generics to `unknown`\n *\n * Context: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/37087\n */\nexport const typedReactMemo = React.memo;","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n.osdkSelectDismissLayer {\n --osdk-portal-dismiss-layer-z-index: var(--osdk-select-z-index);\n}\n\n.osdkComboboxDismissLayer {\n --osdk-portal-dismiss-layer-z-index: var(--osdk-combobox-z-index);\n}\n","function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\n/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CaretDown, Cross, SmallCross, Tick } from \"@blueprintjs/icons\";\nimport React, { useCallback, useState } from \"react\";\nimport { Combobox } from \"../../base-components/combobox/Combobox.js\";\nimport { Select } from \"../../base-components/select/Select.js\";\nimport { PortalDismissLayer } from \"../../shared/PortalDismissLayer.js\";\nimport { typedReactMemo } from \"../../shared/typedMemo.js\";\nimport comboboxStyles from \"../../base-components/combobox/Combobox.module.css\";\nimport selectStyles from \"../../base-components/select/Select.module.css\";\nimport dropdownStyles from \"./DropdownField.module.css\";\nconst EMPTY_ARRAY = [];\n\n/**\n * SelectDropdown is only used for single-select (the multi-select path\n * always routes to ComboboxDropdown). We keep the `Multiple` generic so\n * the spread from DropdownField type-checks, but SelectDropdown never\n * reads `isMultiple`.\n */\n\nexport const DropdownField = typedReactMemo(function DropdownFieldFn({\n isSearchable = false,\n isMultiple,\n itemToStringLabel,\n renderItemLabel,\n itemToKey,\n value,\n query,\n onQueryChange,\n disableClientSideFiltering,\n popupStatus,\n trailingItem,\n modal = true,\n ...rest\n}) {\n // Ensure always controlled from first render: multi-select needs [],\n // single-select needs null. Passing undefined switches Base UI from\n // uncontrolled to controlled and triggers a warning.\n const normalizedValue = value ?? (isMultiple ? EMPTY_ARRAY : null);\n const resolvedItemToStringLabel = itemToStringLabel ?? defaultItemToStringLabel;\n const resolvedRenderItemLabel = renderItemLabel ?? resolvedItemToStringLabel;\n const getKey = useCallback(item => itemToKey?.(item) ?? resolvedItemToStringLabel(item), [itemToKey, resolvedItemToStringLabel]);\n\n // Multi-select always uses Combobox for the chip-based UI because it looks better\n if (isSearchable || isMultiple) {\n return /*#__PURE__*/React.createElement(ComboboxDropdown, _extends({}, rest, {\n isMultiple: isMultiple,\n value: normalizedValue,\n itemToStringLabel: resolvedItemToStringLabel,\n renderItemLabel: resolvedRenderItemLabel,\n getKey: getKey,\n isSearchable: isSearchable,\n query: query,\n onQueryChange: onQueryChange,\n disableClientSideFiltering: disableClientSideFiltering,\n popupStatus: popupStatus,\n trailingItem: trailingItem,\n modal: modal\n }));\n }\n\n // TODO: Support trailingItem\n return /*#__PURE__*/React.createElement(SelectDropdown, _extends({}, rest, {\n value: normalizedValue,\n itemToStringLabel: resolvedItemToStringLabel,\n renderItemLabel: resolvedRenderItemLabel,\n getKey: getKey,\n modal: modal\n }));\n});\nconst SelectDropdown = typedReactMemo(function SelectDropdownFn({\n id,\n value,\n onChange,\n items,\n itemToStringLabel,\n renderItemLabel,\n getKey,\n isItemEqual,\n placeholder,\n portalRef,\n portalContainer,\n onBlur,\n modal = true,\n disabled\n}) {\n const [open, setOpen] = useState(false);\n const isOpen = !disabled && open;\n const hasValue = value != null;\n const renderSingleSelectedItemLabel = useCallback(selectedValue => selectedValue == null ? null : renderItemLabel(selectedValue), [renderItemLabel]);\n const handleOpenChange = useCallback(nextOpen => {\n if (disabled) {\n return;\n }\n setOpen(nextOpen);\n // Mark the field as touched when the popover closes so RHF validates.\n // Opening the popover does not trigger validation.\n if (!nextOpen) {\n onBlur?.();\n }\n }, [disabled, onBlur]);\n const handleClear = useCallback(() => {\n // SelectDropdown is always single-select, so cleared value is null.\n onChange?.(null);\n handleOpenChange(false);\n }, [onChange, handleOpenChange]);\n const handleDismiss = useCallback(() => {\n handleOpenChange(false);\n }, [handleOpenChange]);\n return /*#__PURE__*/React.createElement(\"div\", null, /*#__PURE__*/React.createElement(Select.Root, {\n value: value,\n onValueChange: onChange,\n open: isOpen,\n onOpenChange: handleOpenChange,\n isItemEqualToValue: isItemEqual,\n itemToStringLabel: itemToStringLabel,\n modal: modal,\n disabled: disabled\n }, /*#__PURE__*/React.createElement(Select.Trigger, {\n id: id,\n placeholder: placeholder,\n disabled: disabled\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: selectStyles.osdkSelectValueContainer\n }, /*#__PURE__*/React.createElement(Select.Value, null, renderSingleSelectedItemLabel), placeholder != null && /*#__PURE__*/React.createElement(\"span\", {\n className: selectStyles.osdkSelectPlaceholder\n }, placeholder)), hasValue && /*#__PURE__*/React.createElement(\"span\", {\n role: \"button\",\n \"aria-label\": \"Clear\",\n className: selectStyles.osdkSelectClear,\n \"aria-disabled\": disabled || undefined,\n onMouseDown: disabled ? undefined : preventTriggerOpen,\n onClick: disabled ? undefined : handleClear\n }, /*#__PURE__*/React.createElement(SmallCross, null)), /*#__PURE__*/React.createElement(\"span\", {\n className: selectStyles.osdkSelectIcon\n }, /*#__PURE__*/React.createElement(CaretDown, null))), /*#__PURE__*/React.createElement(Select.Portal, {\n ref: portalRef,\n container: portalContainer\n }, isOpen && modal && /*#__PURE__*/React.createElement(PortalDismissLayer, {\n className: dropdownStyles.osdkSelectDismissLayer,\n onDismiss: handleDismiss\n }), /*#__PURE__*/React.createElement(Select.Positioner, null, /*#__PURE__*/React.createElement(Select.Popup, null, items.map(item => {\n const itemLabel = itemToStringLabel(item);\n return /*#__PURE__*/React.createElement(Select.Item, {\n key: getKey(item),\n value: item,\n label: itemLabel,\n \"aria-label\": itemLabel\n }, renderItemLabel(item));\n }))))));\n});\nconst ComboboxDropdown = typedReactMemo(function ComboboxDropdownFn({\n id,\n value,\n onChange,\n items,\n itemToStringLabel,\n renderItemLabel,\n getKey,\n isItemEqual,\n isMultiple,\n isSearchable,\n placeholder,\n portalRef,\n portalContainer,\n query,\n onQueryChange,\n disableClientSideFiltering,\n popupStatus,\n trailingItem,\n onBlur,\n modal = true,\n disabled\n}) {\n const [open, setOpen] = useState(false);\n const isOpen = !disabled && open;\n const hasValue = isMultiple ? Array.isArray(value) && value.length > 0 : value != null;\n const renderSingleSelectedItemLabel = useCallback(selectedValue => selectedValue == null ? null : renderItemLabel(selectedValue), [renderItemLabel]);\n const handleOpenChange = useCallback(nextOpen => {\n setOpen(nextOpen);\n if (!nextOpen) {\n onBlur?.();\n }\n }, [onBlur]);\n\n // Mark the field as touched on every value change so RHF revalidates\n // immediately — especially important for multi-select where the popup\n // stays open after toggling an item.\n const handleValueChange = useCallback((...args) => {\n onChange?.(...args);\n // Multi-select: popover stays open, so fire onBlur directly.\n // Single-select: popover closes on selection, handleOpenChange(false)\n // already fires onBlur.\n if (isMultiple) {\n onBlur?.();\n }\n }, [onChange, onBlur, isMultiple]);\n const handleClear = useCallback(() => {\n // TypeScript can't narrow the conditional type `Multiple extends true ? V[] : V`\n // at runtime, so we cast through the known parameter type at this single call site.\n const cleared = isMultiple ? EMPTY_ARRAY : null;\n handleValueChange(cleared);\n // Single-select: close after clearing. Multi-select: keep open for continued selection.\n if (!isMultiple) {\n handleOpenChange(false);\n }\n }, [isMultiple, handleValueChange, handleOpenChange]);\n const handleRemoveItem = useCallback(itemToRemove => {\n if (!isMultiple || !Array.isArray(value)) {\n return;\n }\n const next = value.filter(v => isItemEqual != null ? !isItemEqual(v, itemToRemove) : v !== itemToRemove);\n handleValueChange(next);\n }, [isMultiple, value, handleValueChange, isItemEqual]);\n const handleDismiss = useCallback(() => {\n handleOpenChange(false);\n }, [handleOpenChange]);\n const renderItem = useCallback(item => {\n const itemLabel = itemToStringLabel(item);\n return /*#__PURE__*/React.createElement(Combobox.Item, {\n key: getKey(item),\n value: item,\n \"aria-label\": itemLabel\n }, isMultiple && /*#__PURE__*/React.createElement(Combobox.ItemIndicator, null, /*#__PURE__*/React.createElement(Tick, null)), renderItemLabel(item));\n }, [getKey, isMultiple, itemToStringLabel, renderItemLabel]);\n return /*#__PURE__*/React.createElement(\"div\", null, /*#__PURE__*/React.createElement(Combobox.Root, {\n value: value,\n onValueChange: handleValueChange,\n open: isOpen,\n onOpenChange: handleOpenChange,\n multiple: isMultiple,\n itemToStringLabel: itemToStringLabel,\n isItemEqualToValue: isItemEqual,\n items: items,\n inputValue: query,\n onInputValueChange: onQueryChange,\n filter: disableClientSideFiltering ? null : undefined,\n disabled: disabled\n }, /*#__PURE__*/React.createElement(Combobox.Trigger, {\n id: id,\n disabled: disabled,\n className: isMultiple ? comboboxStyles.osdkComboboxTriggerMulti : undefined\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: comboboxStyles.osdkComboboxValueContainer\n }, isMultiple && Array.isArray(value) && value.length > 0 ? /*#__PURE__*/React.createElement(\"div\", {\n className: comboboxStyles.osdkComboboxTriggerChips\n }, value.map(item => /*#__PURE__*/React.createElement(\"span\", {\n key: getKey(item),\n className: comboboxStyles.osdkComboboxTriggerChip\n }, renderItemLabel(item), /*#__PURE__*/React.createElement(\"span\", {\n role: \"button\",\n \"aria-label\": `Remove ${itemToStringLabel(item)}`,\n className: comboboxStyles.osdkComboboxTriggerChipRemove,\n \"aria-disabled\": disabled || undefined,\n onMouseDown: disabled ? undefined : preventTriggerOpen,\n onClick: disabled ? undefined : () => handleRemoveItem(item)\n }, /*#__PURE__*/React.createElement(Cross, {\n size: 12\n }))))) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Combobox.Value, null, renderSingleSelectedItemLabel), !hasValue && placeholder != null && /*#__PURE__*/React.createElement(\"span\", {\n className: comboboxStyles.osdkComboboxPlaceholder\n }, placeholder))), hasValue && /*#__PURE__*/React.createElement(\"span\", {\n role: \"button\",\n \"aria-label\": \"Clear\",\n className: comboboxStyles.osdkComboboxClear,\n \"aria-disabled\": disabled || undefined,\n onMouseDown: disabled ? undefined : preventTriggerOpen,\n onClick: disabled ? undefined : handleClear\n }, /*#__PURE__*/React.createElement(SmallCross, null)), /*#__PURE__*/React.createElement(Combobox.Icon, null, /*#__PURE__*/React.createElement(CaretDown, null))), /*#__PURE__*/React.createElement(Combobox.Portal, {\n ref: portalRef,\n container: portalContainer\n }, isOpen && modal && /*#__PURE__*/React.createElement(PortalDismissLayer, {\n className: dropdownStyles.osdkComboboxDismissLayer,\n onDismiss: handleDismiss\n }), /*#__PURE__*/React.createElement(Combobox.Positioner, null, /*#__PURE__*/React.createElement(Combobox.Popup, {\n \"aria-label\": placeholder || \"Options\"\n }, isSearchable && /*#__PURE__*/React.createElement(\"div\", {\n className: comboboxStyles.osdkComboboxPopupSearchInput\n }, /*#__PURE__*/React.createElement(Combobox.SearchInput, {\n placeholder: \"Search\\u2026\"\n })), popupStatus, popupStatus == null && /*#__PURE__*/React.createElement(Combobox.Empty, null, \"No results\"), /*#__PURE__*/React.createElement(Combobox.List, null, /*#__PURE__*/React.createElement(Combobox.Collection, null, renderItem), trailingItem))))));\n});\n\n// Prevent the clear/remove click from bubbling into the trigger\n// and toggling the dropdown open/closed.\nfunction preventTriggerOpen(e) {\n e.stopPropagation();\n e.preventDefault();\n}\nfunction defaultItemToStringLabel(item) {\n if (item == null || typeof item !== \"object\") {\n return String(item);\n }\n if (\"label\" in item && item.label != null && typeof item.label === \"string\") {\n return item.label;\n }\n return String(item);\n}"]}
|