@contember/react-select 1.3.0-alpha.14 → 1.3.0-alpha.16
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/development/components/MultiSelect.cjs +23 -3
- package/dist/development/components/MultiSelect.cjs.map +1 -1
- package/dist/development/components/MultiSelect.js +23 -3
- package/dist/development/components/MultiSelect.js.map +1 -1
- package/dist/development/components/Select.cjs +23 -3
- package/dist/development/components/Select.cjs.map +1 -1
- package/dist/development/components/Select.js +23 -3
- package/dist/development/components/Select.js.map +1 -1
- package/dist/development/components/SelectDataView.cjs +6 -2
- package/dist/development/components/SelectDataView.cjs.map +1 -1
- package/dist/development/components/SelectDataView.js +6 -2
- package/dist/development/components/SelectDataView.js.map +1 -1
- package/dist/development/components/SelectEachItem.cjs +6 -2
- package/dist/development/components/SelectEachItem.cjs.map +1 -1
- package/dist/development/components/SelectEachItem.js +6 -2
- package/dist/development/components/SelectEachItem.js.map +1 -1
- package/dist/development/components/SelectItemTrigger.cjs +6 -2
- package/dist/development/components/SelectItemTrigger.cjs.map +1 -1
- package/dist/development/components/SelectItemTrigger.js +6 -2
- package/dist/development/components/SelectItemTrigger.js.map +1 -1
- package/dist/development/components/SelectNewItem.cjs +24 -4
- package/dist/development/components/SelectNewItem.cjs.map +1 -1
- package/dist/development/components/SelectNewItem.js +24 -4
- package/dist/development/components/SelectNewItem.js.map +1 -1
- package/dist/development/components/SelectOption.cjs +11 -3
- package/dist/development/components/SelectOption.cjs.map +1 -1
- package/dist/development/components/SelectOption.js +11 -3
- package/dist/development/components/SelectOption.js.map +1 -1
- package/dist/development/components/SelectPlaceholder.cjs +6 -2
- package/dist/development/components/SelectPlaceholder.cjs.map +1 -1
- package/dist/development/components/SelectPlaceholder.js +6 -2
- package/dist/development/components/SelectPlaceholder.js.map +1 -1
- package/dist/development/components/SortableMultiSelect.cjs +31 -3
- package/dist/development/components/SortableMultiSelect.cjs.map +1 -1
- package/dist/development/components/SortableMultiSelect.js +31 -3
- package/dist/development/components/SortableMultiSelect.js.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
3
|
+
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
4
|
const react = require("react");
|
|
5
5
|
const contexts = require("../contexts.cjs");
|
|
6
6
|
const reactBinding = require("@contember/react-binding");
|
|
@@ -25,9 +25,29 @@ const MultiSelect = reactBinding.Component(({ field, children, options, onSelect
|
|
|
25
25
|
const isSelected = react.useCallback((entity) => {
|
|
26
26
|
return selectedEntities.includes(entity.id);
|
|
27
27
|
}, [selectedEntities]);
|
|
28
|
-
return /* @__PURE__ */
|
|
28
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(contexts.SelectCurrentEntitiesContext.Provider, { value: entitiesArr, children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(contexts.SelectIsSelectedContext.Provider, { value: isSelected, children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(contexts.SelectHandleSelectContext.Provider, { value: handler, children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(contexts.SelectOptionsContext.Provider, { value: options, children }, void 0, false, {
|
|
29
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/MultiSelect.tsx",
|
|
30
|
+
lineNumber: 41,
|
|
31
|
+
columnNumber: 6
|
|
32
|
+
}, void 0) }, void 0, false, {
|
|
33
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/MultiSelect.tsx",
|
|
34
|
+
lineNumber: 40,
|
|
35
|
+
columnNumber: 5
|
|
36
|
+
}, void 0) }, void 0, false, {
|
|
37
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/MultiSelect.tsx",
|
|
38
|
+
lineNumber: 39,
|
|
39
|
+
columnNumber: 4
|
|
40
|
+
}, void 0) }, void 0, false, {
|
|
41
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/MultiSelect.tsx",
|
|
42
|
+
lineNumber: 38,
|
|
43
|
+
columnNumber: 3
|
|
44
|
+
}, void 0);
|
|
29
45
|
}, ({ field, children }) => {
|
|
30
|
-
return /* @__PURE__ */
|
|
46
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(reactBinding.HasMany, { field, children }, void 0, false, {
|
|
47
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/MultiSelect.tsx",
|
|
48
|
+
lineNumber: 50,
|
|
49
|
+
columnNumber: 3
|
|
50
|
+
}, void 0);
|
|
31
51
|
});
|
|
32
52
|
exports.MultiSelect = MultiSelect;
|
|
33
53
|
//# sourceMappingURL=MultiSelect.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelect.cjs","sources":["../../../src/components/MultiSelect.tsx"],"sourcesContent":["import React, { ReactNode, useCallback, useMemo } from 'react'\nimport { SelectCurrentEntitiesContext, SelectHandler, SelectHandleSelectContext, SelectIsSelectedContext, SelectOptionsContext } from '../contexts'\nimport { Component, EntityAccessor, HasMany, SugaredQualifiedEntityList, SugaredRelativeEntityList, useEntityList } from '@contember/react-binding'\nimport { useReferentiallyStableCallback } from '@contember/react-utils'\nimport { SelectEvents } from '../types'\n\nexport type MultiSelectProps =\n\t& {\n\t\tchildren: ReactNode\n\t\tfield: SugaredRelativeEntityList['field']\n\t\toptions: SugaredQualifiedEntityList['entities']\n\t}\n\t& SelectEvents\n\nexport const MultiSelect = Component(({ field, children, options, onSelect, onUnselect }: MultiSelectProps) => {\n\tconst entities = useEntityList({ field })\n\tconst entitiesArr = useMemo(() => Array.from(entities), [entities])\n\tconst selectedEntities = useMemo(() => Array.from(entities).map(it => it.id), [entities])\n\n\tconst handler = useReferentiallyStableCallback<SelectHandler>((entity, action = 'toggle') => {\n\t\tconst isSelected = selectedEntities.includes(entity.id)\n\t\tif (action === 'toggle') {\n\t\t\taction = isSelected ? 'unselect' : 'select'\n\t\t}\n\t\tif (action === 'unselect' && isSelected) {\n\t\t\tentities.disconnectEntity(entity)\n\t\t\tonUnselect?.(entity)\n\t\t} else if (action === 'select' && !isSelected) {\n\t\t\tentities.connectEntity(entity)\n\t\t\tonSelect?.(entity)\n\t\t}\n\t})\n\tconst isSelected = useCallback((entity: EntityAccessor) => {\n\t\treturn selectedEntities.includes(entity.id)\n\t}, [selectedEntities])\n\n\treturn (\n\t\t<SelectCurrentEntitiesContext.Provider value={entitiesArr}>\n\t\t\t<SelectIsSelectedContext.Provider value={isSelected}>\n\t\t\t\t<SelectHandleSelectContext.Provider value={handler}>\n\t\t\t\t\t<SelectOptionsContext.Provider value={options}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</SelectOptionsContext.Provider>\n\t\t\t\t</SelectHandleSelectContext.Provider>\n\t\t\t</SelectIsSelectedContext.Provider>\n\t\t</SelectCurrentEntitiesContext.Provider>\n\t)\n}, ({ field, children }) => {\n\treturn (\n\t\t<HasMany field={field}>\n\t\t\t{children}\n\t\t</HasMany>\n\t)\n})\n\n"],"names":["Component","useEntityList","useMemo","useReferentiallyStableCallback","isSelected","useCallback","
|
|
1
|
+
{"version":3,"file":"MultiSelect.cjs","sources":["../../../src/components/MultiSelect.tsx"],"sourcesContent":["import React, { ReactNode, useCallback, useMemo } from 'react'\nimport { SelectCurrentEntitiesContext, SelectHandler, SelectHandleSelectContext, SelectIsSelectedContext, SelectOptionsContext } from '../contexts'\nimport { Component, EntityAccessor, HasMany, SugaredQualifiedEntityList, SugaredRelativeEntityList, useEntityList } from '@contember/react-binding'\nimport { useReferentiallyStableCallback } from '@contember/react-utils'\nimport { SelectEvents } from '../types'\n\nexport type MultiSelectProps =\n\t& {\n\t\tchildren: ReactNode\n\t\tfield: SugaredRelativeEntityList['field']\n\t\toptions: SugaredQualifiedEntityList['entities']\n\t}\n\t& SelectEvents\n\nexport const MultiSelect = Component(({ field, children, options, onSelect, onUnselect }: MultiSelectProps) => {\n\tconst entities = useEntityList({ field })\n\tconst entitiesArr = useMemo(() => Array.from(entities), [entities])\n\tconst selectedEntities = useMemo(() => Array.from(entities).map(it => it.id), [entities])\n\n\tconst handler = useReferentiallyStableCallback<SelectHandler>((entity, action = 'toggle') => {\n\t\tconst isSelected = selectedEntities.includes(entity.id)\n\t\tif (action === 'toggle') {\n\t\t\taction = isSelected ? 'unselect' : 'select'\n\t\t}\n\t\tif (action === 'unselect' && isSelected) {\n\t\t\tentities.disconnectEntity(entity)\n\t\t\tonUnselect?.(entity)\n\t\t} else if (action === 'select' && !isSelected) {\n\t\t\tentities.connectEntity(entity)\n\t\t\tonSelect?.(entity)\n\t\t}\n\t})\n\tconst isSelected = useCallback((entity: EntityAccessor) => {\n\t\treturn selectedEntities.includes(entity.id)\n\t}, [selectedEntities])\n\n\treturn (\n\t\t<SelectCurrentEntitiesContext.Provider value={entitiesArr}>\n\t\t\t<SelectIsSelectedContext.Provider value={isSelected}>\n\t\t\t\t<SelectHandleSelectContext.Provider value={handler}>\n\t\t\t\t\t<SelectOptionsContext.Provider value={options}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</SelectOptionsContext.Provider>\n\t\t\t\t</SelectHandleSelectContext.Provider>\n\t\t\t</SelectIsSelectedContext.Provider>\n\t\t</SelectCurrentEntitiesContext.Provider>\n\t)\n}, ({ field, children }) => {\n\treturn (\n\t\t<HasMany field={field}>\n\t\t\t{children}\n\t\t</HasMany>\n\t)\n})\n\n"],"names":["Component","useEntityList","useMemo","useReferentiallyStableCallback","isSelected","useCallback","jsxDEV","SelectCurrentEntitiesContext","SelectIsSelectedContext","SelectHandleSelectContext","SelectOptionsContext","this","HasMany"],"mappings":";;;;;;;AAca,MAAA,cAAcA,aAAAA,UAAU,CAAC,EAAE,OAAO,UAAU,SAAS,UAAU,iBAAmC;AAC9G,QAAM,WAAWC,aAAAA,cAAc,EAAE,MAAO,CAAA;AAClC,QAAA,cAAcC,cAAQ,MAAM,MAAM,KAAK,QAAQ,GAAG,CAAC,QAAQ,CAAC;AAClE,QAAM,mBAAmBA,MAAA,QAAQ,MAAM,MAAM,KAAK,QAAQ,EAAE,IAAI,CAAA,OAAM,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC;AAExF,QAAM,UAAUC,WAAA,+BAA8C,CAAC,QAAQ,SAAS,aAAa;AAC5F,UAAMC,cAAa,iBAAiB,SAAS,OAAO,EAAE;AACtD,QAAI,WAAW,UAAU;AACxB,eAASA,cAAa,aAAa;AAAA,IACpC;AACI,QAAA,WAAW,cAAcA,aAAY;AACxC,eAAS,iBAAiB,MAAM;AAChC,mBAAa,MAAM;AAAA,IACT,WAAA,WAAW,YAAY,CAACA,aAAY;AAC9C,eAAS,cAAc,MAAM;AAC7B,iBAAW,MAAM;AAAA,IAClB;AAAA,EAAA,CACA;AACK,QAAA,aAAaC,kBAAY,CAAC,WAA2B;AACnD,WAAA,iBAAiB,SAAS,OAAO,EAAE;AAAA,EAAA,GACxC,CAAC,gBAAgB,CAAC;AAGpB,SAAAC,8BAAA,OAACC,SAA6B,6BAAA,UAA7B,EAAsC,OAAO,aAC7C,UAACD,8BAAAA,OAAAE,SAAAA,wBAAwB,UAAxB,EAAiC,OAAO,YACxC,+CAACC,mCAA0B,UAA1B,EAAmC,OAAO,SAC1C,UAAAH,8BAAA,OAACI,8BAAqB,UAArB,EAA8B,OAAO,SACpC,SADF,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAC,MAEA,EAHD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAIA,EALD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAMA,EAPD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAQA,GAAAA,MAAA;AAEF,GAAG,CAAC,EAAE,OAAO,eAAe;AAE1B,SAAAL,8BAAAA,OAACM,aAAAA,SAAQ,EAAA,OACP,YADF,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAEA,GAAAD,MAAA;AAEF,CAAC;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
2
|
import { useMemo, useCallback } from "react";
|
|
3
3
|
import { SelectCurrentEntitiesContext, SelectIsSelectedContext, SelectHandleSelectContext, SelectOptionsContext } from "../contexts.js";
|
|
4
4
|
import { Component, useEntityList, HasMany } from "@contember/react-binding";
|
|
@@ -23,9 +23,29 @@ const MultiSelect = Component(({ field, children, options, onSelect, onUnselect
|
|
|
23
23
|
const isSelected = useCallback((entity) => {
|
|
24
24
|
return selectedEntities.includes(entity.id);
|
|
25
25
|
}, [selectedEntities]);
|
|
26
|
-
return /* @__PURE__ */
|
|
26
|
+
return /* @__PURE__ */ jsxDEV(SelectCurrentEntitiesContext.Provider, { value: entitiesArr, children: /* @__PURE__ */ jsxDEV(SelectIsSelectedContext.Provider, { value: isSelected, children: /* @__PURE__ */ jsxDEV(SelectHandleSelectContext.Provider, { value: handler, children: /* @__PURE__ */ jsxDEV(SelectOptionsContext.Provider, { value: options, children }, void 0, false, {
|
|
27
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/MultiSelect.tsx",
|
|
28
|
+
lineNumber: 41,
|
|
29
|
+
columnNumber: 6
|
|
30
|
+
}, void 0) }, void 0, false, {
|
|
31
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/MultiSelect.tsx",
|
|
32
|
+
lineNumber: 40,
|
|
33
|
+
columnNumber: 5
|
|
34
|
+
}, void 0) }, void 0, false, {
|
|
35
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/MultiSelect.tsx",
|
|
36
|
+
lineNumber: 39,
|
|
37
|
+
columnNumber: 4
|
|
38
|
+
}, void 0) }, void 0, false, {
|
|
39
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/MultiSelect.tsx",
|
|
40
|
+
lineNumber: 38,
|
|
41
|
+
columnNumber: 3
|
|
42
|
+
}, void 0);
|
|
27
43
|
}, ({ field, children }) => {
|
|
28
|
-
return /* @__PURE__ */
|
|
44
|
+
return /* @__PURE__ */ jsxDEV(HasMany, { field, children }, void 0, false, {
|
|
45
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/MultiSelect.tsx",
|
|
46
|
+
lineNumber: 50,
|
|
47
|
+
columnNumber: 3
|
|
48
|
+
}, void 0);
|
|
29
49
|
});
|
|
30
50
|
export {
|
|
31
51
|
MultiSelect
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelect.js","sources":["../../../src/components/MultiSelect.tsx"],"sourcesContent":["import React, { ReactNode, useCallback, useMemo } from 'react'\nimport { SelectCurrentEntitiesContext, SelectHandler, SelectHandleSelectContext, SelectIsSelectedContext, SelectOptionsContext } from '../contexts'\nimport { Component, EntityAccessor, HasMany, SugaredQualifiedEntityList, SugaredRelativeEntityList, useEntityList } from '@contember/react-binding'\nimport { useReferentiallyStableCallback } from '@contember/react-utils'\nimport { SelectEvents } from '../types'\n\nexport type MultiSelectProps =\n\t& {\n\t\tchildren: ReactNode\n\t\tfield: SugaredRelativeEntityList['field']\n\t\toptions: SugaredQualifiedEntityList['entities']\n\t}\n\t& SelectEvents\n\nexport const MultiSelect = Component(({ field, children, options, onSelect, onUnselect }: MultiSelectProps) => {\n\tconst entities = useEntityList({ field })\n\tconst entitiesArr = useMemo(() => Array.from(entities), [entities])\n\tconst selectedEntities = useMemo(() => Array.from(entities).map(it => it.id), [entities])\n\n\tconst handler = useReferentiallyStableCallback<SelectHandler>((entity, action = 'toggle') => {\n\t\tconst isSelected = selectedEntities.includes(entity.id)\n\t\tif (action === 'toggle') {\n\t\t\taction = isSelected ? 'unselect' : 'select'\n\t\t}\n\t\tif (action === 'unselect' && isSelected) {\n\t\t\tentities.disconnectEntity(entity)\n\t\t\tonUnselect?.(entity)\n\t\t} else if (action === 'select' && !isSelected) {\n\t\t\tentities.connectEntity(entity)\n\t\t\tonSelect?.(entity)\n\t\t}\n\t})\n\tconst isSelected = useCallback((entity: EntityAccessor) => {\n\t\treturn selectedEntities.includes(entity.id)\n\t}, [selectedEntities])\n\n\treturn (\n\t\t<SelectCurrentEntitiesContext.Provider value={entitiesArr}>\n\t\t\t<SelectIsSelectedContext.Provider value={isSelected}>\n\t\t\t\t<SelectHandleSelectContext.Provider value={handler}>\n\t\t\t\t\t<SelectOptionsContext.Provider value={options}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</SelectOptionsContext.Provider>\n\t\t\t\t</SelectHandleSelectContext.Provider>\n\t\t\t</SelectIsSelectedContext.Provider>\n\t\t</SelectCurrentEntitiesContext.Provider>\n\t)\n}, ({ field, children }) => {\n\treturn (\n\t\t<HasMany field={field}>\n\t\t\t{children}\n\t\t</HasMany>\n\t)\n})\n\n"],"names":["isSelected"],"mappings":";;;;;AAca,MAAA,cAAc,UAAU,CAAC,EAAE,OAAO,UAAU,SAAS,UAAU,iBAAmC;AAC9G,QAAM,WAAW,cAAc,EAAE,MAAO,CAAA;AAClC,QAAA,cAAc,QAAQ,MAAM,MAAM,KAAK,QAAQ,GAAG,CAAC,QAAQ,CAAC;AAClE,QAAM,mBAAmB,QAAQ,MAAM,MAAM,KAAK,QAAQ,EAAE,IAAI,CAAA,OAAM,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC;AAExF,QAAM,UAAU,+BAA8C,CAAC,QAAQ,SAAS,aAAa;AAC5F,UAAMA,cAAa,iBAAiB,SAAS,OAAO,EAAE;AACtD,QAAI,WAAW,UAAU;AACxB,eAASA,cAAa,aAAa;AAAA,IACpC;AACI,QAAA,WAAW,cAAcA,aAAY;AACxC,eAAS,iBAAiB,MAAM;AAChC,mBAAa,MAAM;AAAA,IACT,WAAA,WAAW,YAAY,CAACA,aAAY;AAC9C,eAAS,cAAc,MAAM;AAC7B,iBAAW,MAAM;AAAA,IAClB;AAAA,EAAA,CACA;AACK,QAAA,aAAa,YAAY,CAAC,WAA2B;AACnD,WAAA,iBAAiB,SAAS,OAAO,EAAE;AAAA,EAAA,GACxC,CAAC,gBAAgB,CAAC;AAGpB,SAAA,
|
|
1
|
+
{"version":3,"file":"MultiSelect.js","sources":["../../../src/components/MultiSelect.tsx"],"sourcesContent":["import React, { ReactNode, useCallback, useMemo } from 'react'\nimport { SelectCurrentEntitiesContext, SelectHandler, SelectHandleSelectContext, SelectIsSelectedContext, SelectOptionsContext } from '../contexts'\nimport { Component, EntityAccessor, HasMany, SugaredQualifiedEntityList, SugaredRelativeEntityList, useEntityList } from '@contember/react-binding'\nimport { useReferentiallyStableCallback } from '@contember/react-utils'\nimport { SelectEvents } from '../types'\n\nexport type MultiSelectProps =\n\t& {\n\t\tchildren: ReactNode\n\t\tfield: SugaredRelativeEntityList['field']\n\t\toptions: SugaredQualifiedEntityList['entities']\n\t}\n\t& SelectEvents\n\nexport const MultiSelect = Component(({ field, children, options, onSelect, onUnselect }: MultiSelectProps) => {\n\tconst entities = useEntityList({ field })\n\tconst entitiesArr = useMemo(() => Array.from(entities), [entities])\n\tconst selectedEntities = useMemo(() => Array.from(entities).map(it => it.id), [entities])\n\n\tconst handler = useReferentiallyStableCallback<SelectHandler>((entity, action = 'toggle') => {\n\t\tconst isSelected = selectedEntities.includes(entity.id)\n\t\tif (action === 'toggle') {\n\t\t\taction = isSelected ? 'unselect' : 'select'\n\t\t}\n\t\tif (action === 'unselect' && isSelected) {\n\t\t\tentities.disconnectEntity(entity)\n\t\t\tonUnselect?.(entity)\n\t\t} else if (action === 'select' && !isSelected) {\n\t\t\tentities.connectEntity(entity)\n\t\t\tonSelect?.(entity)\n\t\t}\n\t})\n\tconst isSelected = useCallback((entity: EntityAccessor) => {\n\t\treturn selectedEntities.includes(entity.id)\n\t}, [selectedEntities])\n\n\treturn (\n\t\t<SelectCurrentEntitiesContext.Provider value={entitiesArr}>\n\t\t\t<SelectIsSelectedContext.Provider value={isSelected}>\n\t\t\t\t<SelectHandleSelectContext.Provider value={handler}>\n\t\t\t\t\t<SelectOptionsContext.Provider value={options}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</SelectOptionsContext.Provider>\n\t\t\t\t</SelectHandleSelectContext.Provider>\n\t\t\t</SelectIsSelectedContext.Provider>\n\t\t</SelectCurrentEntitiesContext.Provider>\n\t)\n}, ({ field, children }) => {\n\treturn (\n\t\t<HasMany field={field}>\n\t\t\t{children}\n\t\t</HasMany>\n\t)\n})\n\n"],"names":["isSelected","this"],"mappings":";;;;;AAca,MAAA,cAAc,UAAU,CAAC,EAAE,OAAO,UAAU,SAAS,UAAU,iBAAmC;AAC9G,QAAM,WAAW,cAAc,EAAE,MAAO,CAAA;AAClC,QAAA,cAAc,QAAQ,MAAM,MAAM,KAAK,QAAQ,GAAG,CAAC,QAAQ,CAAC;AAClE,QAAM,mBAAmB,QAAQ,MAAM,MAAM,KAAK,QAAQ,EAAE,IAAI,CAAA,OAAM,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC;AAExF,QAAM,UAAU,+BAA8C,CAAC,QAAQ,SAAS,aAAa;AAC5F,UAAMA,cAAa,iBAAiB,SAAS,OAAO,EAAE;AACtD,QAAI,WAAW,UAAU;AACxB,eAASA,cAAa,aAAa;AAAA,IACpC;AACI,QAAA,WAAW,cAAcA,aAAY;AACxC,eAAS,iBAAiB,MAAM;AAChC,mBAAa,MAAM;AAAA,IACT,WAAA,WAAW,YAAY,CAACA,aAAY;AAC9C,eAAS,cAAc,MAAM;AAC7B,iBAAW,MAAM;AAAA,IAClB;AAAA,EAAA,CACA;AACK,QAAA,aAAa,YAAY,CAAC,WAA2B;AACnD,WAAA,iBAAiB,SAAS,OAAO,EAAE;AAAA,EAAA,GACxC,CAAC,gBAAgB,CAAC;AAGpB,SAAA,uBAAC,6BAA6B,UAA7B,EAAsC,OAAO,aAC7C,UAAC,uBAAA,wBAAwB,UAAxB,EAAiC,OAAO,YACxC,iCAAC,0BAA0B,UAA1B,EAAmC,OAAO,SAC1C,UAAA,uBAAC,qBAAqB,UAArB,EAA8B,OAAO,SACpC,SADF,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAC,MAEA,EAHD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAIA,EALD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAMA,EAPD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAQA,GAAAA,MAAA;AAEF,GAAG,CAAC,EAAE,OAAO,eAAe;AAE1B,SAAA,uBAAC,SAAQ,EAAA,OACP,YADF,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAEA,GAAAA,MAAA;AAEF,CAAC;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
3
|
+
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
4
|
const react = require("react");
|
|
5
5
|
const contexts = require("../contexts.cjs");
|
|
6
6
|
const reactBinding = require("@contember/react-binding");
|
|
@@ -23,9 +23,29 @@ const Select = reactBinding.Component(({ field, children, onUnselect, onSelect,
|
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
const isSelected = react.useCallback((entity2) => entity2.id === selectedEntity.id, [selectedEntity.id]);
|
|
26
|
-
return /* @__PURE__ */
|
|
26
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(contexts.SelectCurrentEntitiesContext.Provider, { value: entitiesArr, children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(contexts.SelectIsSelectedContext.Provider, { value: isSelected, children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(contexts.SelectHandleSelectContext.Provider, { value: handleSelect, children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(contexts.SelectOptionsContext.Provider, { value: options, children }, void 0, false, {
|
|
27
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/Select.tsx",
|
|
28
|
+
lineNumber: 39,
|
|
29
|
+
columnNumber: 6
|
|
30
|
+
}, void 0) }, void 0, false, {
|
|
31
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/Select.tsx",
|
|
32
|
+
lineNumber: 38,
|
|
33
|
+
columnNumber: 5
|
|
34
|
+
}, void 0) }, void 0, false, {
|
|
35
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/Select.tsx",
|
|
36
|
+
lineNumber: 37,
|
|
37
|
+
columnNumber: 4
|
|
38
|
+
}, void 0) }, void 0, false, {
|
|
39
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/Select.tsx",
|
|
40
|
+
lineNumber: 36,
|
|
41
|
+
columnNumber: 3
|
|
42
|
+
}, void 0);
|
|
27
43
|
}, ({ field, children }) => {
|
|
28
|
-
return /* @__PURE__ */
|
|
44
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(reactBinding.HasOne, { field, children }, void 0, false, {
|
|
45
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/Select.tsx",
|
|
46
|
+
lineNumber: 48,
|
|
47
|
+
columnNumber: 3
|
|
48
|
+
}, void 0);
|
|
29
49
|
});
|
|
30
50
|
exports.Select = Select;
|
|
31
51
|
//# sourceMappingURL=Select.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.cjs","sources":["../../../src/components/Select.tsx"],"sourcesContent":["import React, { ReactNode, useCallback, useMemo } from 'react'\nimport { SelectCurrentEntitiesContext, SelectHandler, SelectHandleSelectContext, SelectIsSelectedContext, SelectOptionsContext } from '../contexts'\nimport { Component, EntityAccessor, HasOne, SugaredQualifiedEntityList, SugaredRelativeSingleEntity, useEntity } from '@contember/react-binding'\nimport { useReferentiallyStableCallback } from '@contember/react-utils'\nimport { SelectEvents } from '../types'\n\nexport type SelectProps =\n\t& {\n\t\tchildren: ReactNode\n\t\tfield: SugaredRelativeSingleEntity['field']\n\t\toptions: SugaredQualifiedEntityList['entities']\n\t}\n\t& SelectEvents\n\nexport const Select = Component(({ field, children, onUnselect, onSelect, options }: SelectProps) => {\n\tconst entity = useEntity()\n\tconst selectedEntity = entity.getEntity({ field })\n\tconst entityExists = selectedEntity.existsOnServer || selectedEntity.hasUnpersistedChanges\n\tconst entitiesArr = useMemo(() => entityExists ? [selectedEntity] : [], [entityExists, selectedEntity])\n\n\tconst handleSelect = useReferentiallyStableCallback<SelectHandler>((selected, action = 'toggle') => {\n\t\tif (action === 'toggle') {\n\t\t\taction = selected.id === selectedEntity.id ? 'unselect' : 'select'\n\t\t}\n\t\tif (action === 'unselect') {\n\t\t\tentity.disconnectEntityAtField({ field })\n\t\t\tonUnselect?.(selected)\n\t\t} else if (action === 'select') {\n\t\t\tentity.connectEntityAtField({ field }, selected)\n\t\t\tonSelect?.(selected)\n\t\t}\n\t})\n\tconst isSelected = useCallback((entity: EntityAccessor) => entity.id === selectedEntity.id, [selectedEntity.id])\n\n\treturn (\n\t\t<SelectCurrentEntitiesContext.Provider value={entitiesArr}>\n\t\t\t<SelectIsSelectedContext.Provider value={isSelected}>\n\t\t\t\t<SelectHandleSelectContext.Provider value={handleSelect}>\n\t\t\t\t\t<SelectOptionsContext.Provider value={options}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</SelectOptionsContext.Provider>\n\t\t\t\t</SelectHandleSelectContext.Provider>\n\t\t\t</SelectIsSelectedContext.Provider>\n\t\t</SelectCurrentEntitiesContext.Provider>\n\t)\n}, ({ field, children }) => {\n\treturn (\n\t\t<HasOne field={field}>\n\t\t\t{children}\n\t\t</HasOne>\n\t)\n})\n\n"],"names":["Component","useEntity","useMemo","useReferentiallyStableCallback","useCallback","entity","
|
|
1
|
+
{"version":3,"file":"Select.cjs","sources":["../../../src/components/Select.tsx"],"sourcesContent":["import React, { ReactNode, useCallback, useMemo } from 'react'\nimport { SelectCurrentEntitiesContext, SelectHandler, SelectHandleSelectContext, SelectIsSelectedContext, SelectOptionsContext } from '../contexts'\nimport { Component, EntityAccessor, HasOne, SugaredQualifiedEntityList, SugaredRelativeSingleEntity, useEntity } from '@contember/react-binding'\nimport { useReferentiallyStableCallback } from '@contember/react-utils'\nimport { SelectEvents } from '../types'\n\nexport type SelectProps =\n\t& {\n\t\tchildren: ReactNode\n\t\tfield: SugaredRelativeSingleEntity['field']\n\t\toptions: SugaredQualifiedEntityList['entities']\n\t}\n\t& SelectEvents\n\nexport const Select = Component(({ field, children, onUnselect, onSelect, options }: SelectProps) => {\n\tconst entity = useEntity()\n\tconst selectedEntity = entity.getEntity({ field })\n\tconst entityExists = selectedEntity.existsOnServer || selectedEntity.hasUnpersistedChanges\n\tconst entitiesArr = useMemo(() => entityExists ? [selectedEntity] : [], [entityExists, selectedEntity])\n\n\tconst handleSelect = useReferentiallyStableCallback<SelectHandler>((selected, action = 'toggle') => {\n\t\tif (action === 'toggle') {\n\t\t\taction = selected.id === selectedEntity.id ? 'unselect' : 'select'\n\t\t}\n\t\tif (action === 'unselect') {\n\t\t\tentity.disconnectEntityAtField({ field })\n\t\t\tonUnselect?.(selected)\n\t\t} else if (action === 'select') {\n\t\t\tentity.connectEntityAtField({ field }, selected)\n\t\t\tonSelect?.(selected)\n\t\t}\n\t})\n\tconst isSelected = useCallback((entity: EntityAccessor) => entity.id === selectedEntity.id, [selectedEntity.id])\n\n\treturn (\n\t\t<SelectCurrentEntitiesContext.Provider value={entitiesArr}>\n\t\t\t<SelectIsSelectedContext.Provider value={isSelected}>\n\t\t\t\t<SelectHandleSelectContext.Provider value={handleSelect}>\n\t\t\t\t\t<SelectOptionsContext.Provider value={options}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</SelectOptionsContext.Provider>\n\t\t\t\t</SelectHandleSelectContext.Provider>\n\t\t\t</SelectIsSelectedContext.Provider>\n\t\t</SelectCurrentEntitiesContext.Provider>\n\t)\n}, ({ field, children }) => {\n\treturn (\n\t\t<HasOne field={field}>\n\t\t\t{children}\n\t\t</HasOne>\n\t)\n})\n\n"],"names":["Component","useEntity","useMemo","useReferentiallyStableCallback","useCallback","entity","jsxDEV","SelectCurrentEntitiesContext","SelectIsSelectedContext","SelectHandleSelectContext","SelectOptionsContext","this","HasOne"],"mappings":";;;;;;;AAca,MAAA,SAASA,aAAAA,UAAU,CAAC,EAAE,OAAO,UAAU,YAAY,UAAU,cAA2B;AACpG,QAAM,SAASC,aAAAA;AACf,QAAM,iBAAiB,OAAO,UAAU,EAAE,MAAO,CAAA;AAC3C,QAAA,eAAe,eAAe,kBAAkB,eAAe;AACrE,QAAM,cAAcC,MAAAA,QAAQ,MAAM,eAAe,CAAC,cAAc,IAAI,CAAA,GAAI,CAAC,cAAc,cAAc,CAAC;AAEtG,QAAM,eAAeC,WAAA,+BAA8C,CAAC,UAAU,SAAS,aAAa;AACnG,QAAI,WAAW,UAAU;AACxB,eAAS,SAAS,OAAO,eAAe,KAAK,aAAa;AAAA,IAC3D;AACA,QAAI,WAAW,YAAY;AACnB,aAAA,wBAAwB,EAAE,MAAA,CAAO;AACxC,mBAAa,QAAQ;AAAA,IAAA,WACX,WAAW,UAAU;AAC/B,aAAO,qBAAqB,EAAE,MAAM,GAAG,QAAQ;AAC/C,iBAAW,QAAQ;AAAA,IACpB;AAAA,EAAA,CACA;AACK,QAAA,aAAaC,MAAAA,YAAY,CAACC,YAA2BA,QAAO,OAAO,eAAe,IAAI,CAAC,eAAe,EAAE,CAAC;AAG9G,SAAAC,8BAAA,OAACC,SAA6B,6BAAA,UAA7B,EAAsC,OAAO,aAC7C,UAACD,8BAAAA,OAAAE,SAAAA,wBAAwB,UAAxB,EAAiC,OAAO,YACxC,+CAACC,mCAA0B,UAA1B,EAAmC,OAAO,cAC1C,UAAAH,8BAAA,OAACI,8BAAqB,UAArB,EAA8B,OAAO,SACpC,SADF,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAC,MAEA,EAHD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAIA,EALD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAMA,EAPD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAQA,GAAAA,MAAA;AAEF,GAAG,CAAC,EAAE,OAAO,eAAe;AAE1B,SAAAL,8BAAAA,OAACM,aAAAA,QAAO,EAAA,OACN,YADF,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAEA,GAAAD,MAAA;AAEF,CAAC;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
2
|
import { useMemo, useCallback } from "react";
|
|
3
3
|
import { SelectCurrentEntitiesContext, SelectIsSelectedContext, SelectHandleSelectContext, SelectOptionsContext } from "../contexts.js";
|
|
4
4
|
import { Component, useEntity, HasOne } from "@contember/react-binding";
|
|
@@ -21,9 +21,29 @@ const Select = Component(({ field, children, onUnselect, onSelect, options }) =>
|
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
const isSelected = useCallback((entity2) => entity2.id === selectedEntity.id, [selectedEntity.id]);
|
|
24
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ jsxDEV(SelectCurrentEntitiesContext.Provider, { value: entitiesArr, children: /* @__PURE__ */ jsxDEV(SelectIsSelectedContext.Provider, { value: isSelected, children: /* @__PURE__ */ jsxDEV(SelectHandleSelectContext.Provider, { value: handleSelect, children: /* @__PURE__ */ jsxDEV(SelectOptionsContext.Provider, { value: options, children }, void 0, false, {
|
|
25
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/Select.tsx",
|
|
26
|
+
lineNumber: 39,
|
|
27
|
+
columnNumber: 6
|
|
28
|
+
}, void 0) }, void 0, false, {
|
|
29
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/Select.tsx",
|
|
30
|
+
lineNumber: 38,
|
|
31
|
+
columnNumber: 5
|
|
32
|
+
}, void 0) }, void 0, false, {
|
|
33
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/Select.tsx",
|
|
34
|
+
lineNumber: 37,
|
|
35
|
+
columnNumber: 4
|
|
36
|
+
}, void 0) }, void 0, false, {
|
|
37
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/Select.tsx",
|
|
38
|
+
lineNumber: 36,
|
|
39
|
+
columnNumber: 3
|
|
40
|
+
}, void 0);
|
|
25
41
|
}, ({ field, children }) => {
|
|
26
|
-
return /* @__PURE__ */
|
|
42
|
+
return /* @__PURE__ */ jsxDEV(HasOne, { field, children }, void 0, false, {
|
|
43
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/Select.tsx",
|
|
44
|
+
lineNumber: 48,
|
|
45
|
+
columnNumber: 3
|
|
46
|
+
}, void 0);
|
|
27
47
|
});
|
|
28
48
|
export {
|
|
29
49
|
Select
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sources":["../../../src/components/Select.tsx"],"sourcesContent":["import React, { ReactNode, useCallback, useMemo } from 'react'\nimport { SelectCurrentEntitiesContext, SelectHandler, SelectHandleSelectContext, SelectIsSelectedContext, SelectOptionsContext } from '../contexts'\nimport { Component, EntityAccessor, HasOne, SugaredQualifiedEntityList, SugaredRelativeSingleEntity, useEntity } from '@contember/react-binding'\nimport { useReferentiallyStableCallback } from '@contember/react-utils'\nimport { SelectEvents } from '../types'\n\nexport type SelectProps =\n\t& {\n\t\tchildren: ReactNode\n\t\tfield: SugaredRelativeSingleEntity['field']\n\t\toptions: SugaredQualifiedEntityList['entities']\n\t}\n\t& SelectEvents\n\nexport const Select = Component(({ field, children, onUnselect, onSelect, options }: SelectProps) => {\n\tconst entity = useEntity()\n\tconst selectedEntity = entity.getEntity({ field })\n\tconst entityExists = selectedEntity.existsOnServer || selectedEntity.hasUnpersistedChanges\n\tconst entitiesArr = useMemo(() => entityExists ? [selectedEntity] : [], [entityExists, selectedEntity])\n\n\tconst handleSelect = useReferentiallyStableCallback<SelectHandler>((selected, action = 'toggle') => {\n\t\tif (action === 'toggle') {\n\t\t\taction = selected.id === selectedEntity.id ? 'unselect' : 'select'\n\t\t}\n\t\tif (action === 'unselect') {\n\t\t\tentity.disconnectEntityAtField({ field })\n\t\t\tonUnselect?.(selected)\n\t\t} else if (action === 'select') {\n\t\t\tentity.connectEntityAtField({ field }, selected)\n\t\t\tonSelect?.(selected)\n\t\t}\n\t})\n\tconst isSelected = useCallback((entity: EntityAccessor) => entity.id === selectedEntity.id, [selectedEntity.id])\n\n\treturn (\n\t\t<SelectCurrentEntitiesContext.Provider value={entitiesArr}>\n\t\t\t<SelectIsSelectedContext.Provider value={isSelected}>\n\t\t\t\t<SelectHandleSelectContext.Provider value={handleSelect}>\n\t\t\t\t\t<SelectOptionsContext.Provider value={options}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</SelectOptionsContext.Provider>\n\t\t\t\t</SelectHandleSelectContext.Provider>\n\t\t\t</SelectIsSelectedContext.Provider>\n\t\t</SelectCurrentEntitiesContext.Provider>\n\t)\n}, ({ field, children }) => {\n\treturn (\n\t\t<HasOne field={field}>\n\t\t\t{children}\n\t\t</HasOne>\n\t)\n})\n\n"],"names":["entity"],"mappings":";;;;;AAca,MAAA,SAAS,UAAU,CAAC,EAAE,OAAO,UAAU,YAAY,UAAU,cAA2B;AACpG,QAAM,SAAS;AACf,QAAM,iBAAiB,OAAO,UAAU,EAAE,MAAO,CAAA;AAC3C,QAAA,eAAe,eAAe,kBAAkB,eAAe;AACrE,QAAM,cAAc,QAAQ,MAAM,eAAe,CAAC,cAAc,IAAI,CAAA,GAAI,CAAC,cAAc,cAAc,CAAC;AAEtG,QAAM,eAAe,+BAA8C,CAAC,UAAU,SAAS,aAAa;AACnG,QAAI,WAAW,UAAU;AACxB,eAAS,SAAS,OAAO,eAAe,KAAK,aAAa;AAAA,IAC3D;AACA,QAAI,WAAW,YAAY;AACnB,aAAA,wBAAwB,EAAE,MAAA,CAAO;AACxC,mBAAa,QAAQ;AAAA,IAAA,WACX,WAAW,UAAU;AAC/B,aAAO,qBAAqB,EAAE,MAAM,GAAG,QAAQ;AAC/C,iBAAW,QAAQ;AAAA,IACpB;AAAA,EAAA,CACA;AACK,QAAA,aAAa,YAAY,CAACA,YAA2BA,QAAO,OAAO,eAAe,IAAI,CAAC,eAAe,EAAE,CAAC;AAG9G,SAAA,
|
|
1
|
+
{"version":3,"file":"Select.js","sources":["../../../src/components/Select.tsx"],"sourcesContent":["import React, { ReactNode, useCallback, useMemo } from 'react'\nimport { SelectCurrentEntitiesContext, SelectHandler, SelectHandleSelectContext, SelectIsSelectedContext, SelectOptionsContext } from '../contexts'\nimport { Component, EntityAccessor, HasOne, SugaredQualifiedEntityList, SugaredRelativeSingleEntity, useEntity } from '@contember/react-binding'\nimport { useReferentiallyStableCallback } from '@contember/react-utils'\nimport { SelectEvents } from '../types'\n\nexport type SelectProps =\n\t& {\n\t\tchildren: ReactNode\n\t\tfield: SugaredRelativeSingleEntity['field']\n\t\toptions: SugaredQualifiedEntityList['entities']\n\t}\n\t& SelectEvents\n\nexport const Select = Component(({ field, children, onUnselect, onSelect, options }: SelectProps) => {\n\tconst entity = useEntity()\n\tconst selectedEntity = entity.getEntity({ field })\n\tconst entityExists = selectedEntity.existsOnServer || selectedEntity.hasUnpersistedChanges\n\tconst entitiesArr = useMemo(() => entityExists ? [selectedEntity] : [], [entityExists, selectedEntity])\n\n\tconst handleSelect = useReferentiallyStableCallback<SelectHandler>((selected, action = 'toggle') => {\n\t\tif (action === 'toggle') {\n\t\t\taction = selected.id === selectedEntity.id ? 'unselect' : 'select'\n\t\t}\n\t\tif (action === 'unselect') {\n\t\t\tentity.disconnectEntityAtField({ field })\n\t\t\tonUnselect?.(selected)\n\t\t} else if (action === 'select') {\n\t\t\tentity.connectEntityAtField({ field }, selected)\n\t\t\tonSelect?.(selected)\n\t\t}\n\t})\n\tconst isSelected = useCallback((entity: EntityAccessor) => entity.id === selectedEntity.id, [selectedEntity.id])\n\n\treturn (\n\t\t<SelectCurrentEntitiesContext.Provider value={entitiesArr}>\n\t\t\t<SelectIsSelectedContext.Provider value={isSelected}>\n\t\t\t\t<SelectHandleSelectContext.Provider value={handleSelect}>\n\t\t\t\t\t<SelectOptionsContext.Provider value={options}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</SelectOptionsContext.Provider>\n\t\t\t\t</SelectHandleSelectContext.Provider>\n\t\t\t</SelectIsSelectedContext.Provider>\n\t\t</SelectCurrentEntitiesContext.Provider>\n\t)\n}, ({ field, children }) => {\n\treturn (\n\t\t<HasOne field={field}>\n\t\t\t{children}\n\t\t</HasOne>\n\t)\n})\n\n"],"names":["entity","this"],"mappings":";;;;;AAca,MAAA,SAAS,UAAU,CAAC,EAAE,OAAO,UAAU,YAAY,UAAU,cAA2B;AACpG,QAAM,SAAS;AACf,QAAM,iBAAiB,OAAO,UAAU,EAAE,MAAO,CAAA;AAC3C,QAAA,eAAe,eAAe,kBAAkB,eAAe;AACrE,QAAM,cAAc,QAAQ,MAAM,eAAe,CAAC,cAAc,IAAI,CAAA,GAAI,CAAC,cAAc,cAAc,CAAC;AAEtG,QAAM,eAAe,+BAA8C,CAAC,UAAU,SAAS,aAAa;AACnG,QAAI,WAAW,UAAU;AACxB,eAAS,SAAS,OAAO,eAAe,KAAK,aAAa;AAAA,IAC3D;AACA,QAAI,WAAW,YAAY;AACnB,aAAA,wBAAwB,EAAE,MAAA,CAAO;AACxC,mBAAa,QAAQ;AAAA,IAAA,WACX,WAAW,UAAU;AAC/B,aAAO,qBAAqB,EAAE,MAAM,GAAG,QAAQ;AAC/C,iBAAW,QAAQ;AAAA,IACpB;AAAA,EAAA,CACA;AACK,QAAA,aAAa,YAAY,CAACA,YAA2BA,QAAO,OAAO,eAAe,IAAI,CAAC,eAAe,EAAE,CAAC;AAG9G,SAAA,uBAAC,6BAA6B,UAA7B,EAAsC,OAAO,aAC7C,UAAC,uBAAA,wBAAwB,UAAxB,EAAiC,OAAO,YACxC,iCAAC,0BAA0B,UAA1B,EAAmC,OAAO,cAC1C,UAAA,uBAAC,qBAAqB,UAArB,EAA8B,OAAO,SACpC,SADF,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAC,MAEA,EAHD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAIA,EALD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAMA,EAPD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAQA,GAAAA,MAAA;AAEF,GAAG,CAAC,EAAE,OAAO,eAAe;AAE1B,SAAA,uBAAC,QAAO,EAAA,OACN,YADF,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAEA,GAAAA,MAAA;AAEF,CAAC;"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
3
|
+
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
4
|
const contexts = require("../contexts.cjs");
|
|
5
5
|
const reactDataview = require("@contember/react-dataview");
|
|
6
6
|
const SelectDataView = (props) => {
|
|
7
7
|
const handleSelect = contexts.useSelectHandleSelect();
|
|
8
8
|
const entities = contexts.useSelectOptions();
|
|
9
|
-
return /* @__PURE__ */
|
|
9
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(reactDataview.DataView, { ...props, onSelectHighlighted: handleSelect, entities }, void 0, false, {
|
|
10
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/SelectDataView.tsx",
|
|
11
|
+
lineNumber: 15,
|
|
12
|
+
columnNumber: 3
|
|
13
|
+
}, void 0);
|
|
10
14
|
};
|
|
11
15
|
exports.SelectDataView = SelectDataView;
|
|
12
16
|
//# sourceMappingURL=SelectDataView.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectDataView.cjs","sources":["../../../src/components/SelectDataView.tsx"],"sourcesContent":["import React, { ReactNode } from 'react'\nimport { useSelectHandleSelect, useSelectOptions } from '../contexts'\nimport { DataViewProps, DataView } from '@contember/react-dataview'\n\nexport type SelectDataViewProps =\n\t& Omit<DataViewProps, 'entities'>\n\t& {\n\t\tchildren: ReactNode\n\t}\n\nexport const SelectDataView = (props: SelectDataViewProps) => {\n\tconst handleSelect = useSelectHandleSelect()\n\tconst entities = useSelectOptions()\n\treturn (\n\t\t<DataView {...props} onSelectHighlighted={handleSelect} entities={entities} />\n\t)\n}\n"],"names":["useSelectHandleSelect","useSelectOptions","DataView"],"mappings":";;;;;AAUa,MAAA,iBAAiB,CAAC,UAA+B;AAC7D,QAAM,eAAeA,SAAAA;AACrB,QAAM,WAAWC,SAAAA;AACjB,
|
|
1
|
+
{"version":3,"file":"SelectDataView.cjs","sources":["../../../src/components/SelectDataView.tsx"],"sourcesContent":["import React, { ReactNode } from 'react'\nimport { useSelectHandleSelect, useSelectOptions } from '../contexts'\nimport { DataViewProps, DataView } from '@contember/react-dataview'\n\nexport type SelectDataViewProps =\n\t& Omit<DataViewProps, 'entities'>\n\t& {\n\t\tchildren: ReactNode\n\t}\n\nexport const SelectDataView = (props: SelectDataViewProps) => {\n\tconst handleSelect = useSelectHandleSelect()\n\tconst entities = useSelectOptions()\n\treturn (\n\t\t<DataView {...props} onSelectHighlighted={handleSelect} entities={entities} />\n\t)\n}\n"],"names":["useSelectHandleSelect","useSelectOptions","DataView","this"],"mappings":";;;;;AAUa,MAAA,iBAAiB,CAAC,UAA+B;AAC7D,QAAM,eAAeA,SAAAA;AACrB,QAAM,WAAWC,SAAAA;AACjB,8CACEC,cAAAA,UAAU,EAAA,GAAG,OAAO,qBAAqB,cAAc,SAAxD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAA4E,GAAAC,MAAA;AAE9E;;"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
2
|
import { useSelectHandleSelect, useSelectOptions } from "../contexts.js";
|
|
3
3
|
import { DataView } from "@contember/react-dataview";
|
|
4
4
|
const SelectDataView = (props) => {
|
|
5
5
|
const handleSelect = useSelectHandleSelect();
|
|
6
6
|
const entities = useSelectOptions();
|
|
7
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ jsxDEV(DataView, { ...props, onSelectHighlighted: handleSelect, entities }, void 0, false, {
|
|
8
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/SelectDataView.tsx",
|
|
9
|
+
lineNumber: 15,
|
|
10
|
+
columnNumber: 3
|
|
11
|
+
}, void 0);
|
|
8
12
|
};
|
|
9
13
|
export {
|
|
10
14
|
SelectDataView
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectDataView.js","sources":["../../../src/components/SelectDataView.tsx"],"sourcesContent":["import React, { ReactNode } from 'react'\nimport { useSelectHandleSelect, useSelectOptions } from '../contexts'\nimport { DataViewProps, DataView } from '@contember/react-dataview'\n\nexport type SelectDataViewProps =\n\t& Omit<DataViewProps, 'entities'>\n\t& {\n\t\tchildren: ReactNode\n\t}\n\nexport const SelectDataView = (props: SelectDataViewProps) => {\n\tconst handleSelect = useSelectHandleSelect()\n\tconst entities = useSelectOptions()\n\treturn (\n\t\t<DataView {...props} onSelectHighlighted={handleSelect} entities={entities} />\n\t)\n}\n"],"names":[],"mappings":";;;AAUa,MAAA,iBAAiB,CAAC,UAA+B;AAC7D,QAAM,eAAe;AACrB,QAAM,WAAW;AACjB,
|
|
1
|
+
{"version":3,"file":"SelectDataView.js","sources":["../../../src/components/SelectDataView.tsx"],"sourcesContent":["import React, { ReactNode } from 'react'\nimport { useSelectHandleSelect, useSelectOptions } from '../contexts'\nimport { DataViewProps, DataView } from '@contember/react-dataview'\n\nexport type SelectDataViewProps =\n\t& Omit<DataViewProps, 'entities'>\n\t& {\n\t\tchildren: ReactNode\n\t}\n\nexport const SelectDataView = (props: SelectDataViewProps) => {\n\tconst handleSelect = useSelectHandleSelect()\n\tconst entities = useSelectOptions()\n\treturn (\n\t\t<DataView {...props} onSelectHighlighted={handleSelect} entities={entities} />\n\t)\n}\n"],"names":["this"],"mappings":";;;AAUa,MAAA,iBAAiB,CAAC,UAA+B;AAC7D,QAAM,eAAe;AACrB,QAAM,WAAW;AACjB,gCACE,UAAU,EAAA,GAAG,OAAO,qBAAqB,cAAc,SAAxD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAA4E,GAAAA,MAAA;AAE9E;"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
3
|
+
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
4
|
const contexts = require("../contexts.cjs");
|
|
5
5
|
const reactBinding = require("@contember/react-binding");
|
|
6
6
|
const SelectEachValue = ({ children }) => {
|
|
7
7
|
const entities = contexts.useSelectCurrentEntities();
|
|
8
|
-
return entities.map((entity) => /* @__PURE__ */
|
|
8
|
+
return entities.map((entity) => /* @__PURE__ */ jsxDevRuntime.jsxDEV(reactBinding.Entity, { accessor: entity, children }, entity.key, false, {
|
|
9
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/SelectEachItem.tsx",
|
|
10
|
+
lineNumber: 9,
|
|
11
|
+
columnNumber: 3
|
|
12
|
+
}, void 0));
|
|
9
13
|
};
|
|
10
14
|
exports.SelectEachValue = SelectEachValue;
|
|
11
15
|
//# sourceMappingURL=SelectEachItem.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectEachItem.cjs","sources":["../../../src/components/SelectEachItem.tsx"],"sourcesContent":["import React, { ReactNode } from 'react'\nimport { useSelectCurrentEntities } from '../contexts'\nimport { Entity } from '@contember/react-binding'\n\n\nexport const SelectEachValue = ({ children }: { children: ReactNode }) => {\n\tconst entities = useSelectCurrentEntities()\n\treturn entities.map(entity => (\n\t\t<Entity key={entity.key} accessor={entity}>\n\t\t\t{children}\n\t\t</Entity>\n\t))\n}\n"],"names":["useSelectCurrentEntities","
|
|
1
|
+
{"version":3,"file":"SelectEachItem.cjs","sources":["../../../src/components/SelectEachItem.tsx"],"sourcesContent":["import React, { ReactNode } from 'react'\nimport { useSelectCurrentEntities } from '../contexts'\nimport { Entity } from '@contember/react-binding'\n\n\nexport const SelectEachValue = ({ children }: { children: ReactNode }) => {\n\tconst entities = useSelectCurrentEntities()\n\treturn entities.map(entity => (\n\t\t<Entity key={entity.key} accessor={entity}>\n\t\t\t{children}\n\t\t</Entity>\n\t))\n}\n"],"names":["useSelectCurrentEntities","jsxDEV","Entity","this"],"mappings":";;;;;AAKO,MAAM,kBAAkB,CAAC,EAAE,eAAwC;AACzE,QAAM,WAAWA,SAAAA;AACV,SAAA,SAAS,IAAI,CACnB,WAAAC,8BAAA,OAACC,uBAAwB,UAAU,QACjC,SADW,GAAA,OAAO,KAApB,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAC,MAEA,CACA;AACF;;"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
2
|
import { useSelectCurrentEntities } from "../contexts.js";
|
|
3
3
|
import { Entity } from "@contember/react-binding";
|
|
4
4
|
const SelectEachValue = ({ children }) => {
|
|
5
5
|
const entities = useSelectCurrentEntities();
|
|
6
|
-
return entities.map((entity) => /* @__PURE__ */
|
|
6
|
+
return entities.map((entity) => /* @__PURE__ */ jsxDEV(Entity, { accessor: entity, children }, entity.key, false, {
|
|
7
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/SelectEachItem.tsx",
|
|
8
|
+
lineNumber: 9,
|
|
9
|
+
columnNumber: 3
|
|
10
|
+
}, void 0));
|
|
7
11
|
};
|
|
8
12
|
export {
|
|
9
13
|
SelectEachValue
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectEachItem.js","sources":["../../../src/components/SelectEachItem.tsx"],"sourcesContent":["import React, { ReactNode } from 'react'\nimport { useSelectCurrentEntities } from '../contexts'\nimport { Entity } from '@contember/react-binding'\n\n\nexport const SelectEachValue = ({ children }: { children: ReactNode }) => {\n\tconst entities = useSelectCurrentEntities()\n\treturn entities.map(entity => (\n\t\t<Entity key={entity.key} accessor={entity}>\n\t\t\t{children}\n\t\t</Entity>\n\t))\n}\n"],"names":[],"mappings":";;;AAKO,MAAM,kBAAkB,CAAC,EAAE,eAAwC;AACzE,QAAM,WAAW;AACV,SAAA,SAAS,IAAI,
|
|
1
|
+
{"version":3,"file":"SelectEachItem.js","sources":["../../../src/components/SelectEachItem.tsx"],"sourcesContent":["import React, { ReactNode } from 'react'\nimport { useSelectCurrentEntities } from '../contexts'\nimport { Entity } from '@contember/react-binding'\n\n\nexport const SelectEachValue = ({ children }: { children: ReactNode }) => {\n\tconst entities = useSelectCurrentEntities()\n\treturn entities.map(entity => (\n\t\t<Entity key={entity.key} accessor={entity}>\n\t\t\t{children}\n\t\t</Entity>\n\t))\n}\n"],"names":["this"],"mappings":";;;AAKO,MAAM,kBAAkB,CAAC,EAAE,eAAwC;AACzE,QAAM,WAAW;AACV,SAAA,SAAS,IAAI,CACnB,WAAA,uBAAC,UAAwB,UAAU,QACjC,SADW,GAAA,OAAO,KAApB,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAEA,CACA;AACF;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
3
|
+
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
4
|
const react = require("react");
|
|
5
5
|
const contexts = require("../contexts.cjs");
|
|
6
6
|
const reactSlot = require("@radix-ui/react-slot");
|
|
@@ -11,7 +11,11 @@ const SelectItemTrigger = react.forwardRef(({ action, ...props }, ref) => {
|
|
|
11
11
|
const onClick = react.useCallback(() => {
|
|
12
12
|
handleSelect?.(entity, action);
|
|
13
13
|
}, [action, entity, handleSelect]);
|
|
14
|
-
return /* @__PURE__ */
|
|
14
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(reactSlot.Slot, { onClick, ...props, ref }, void 0, false, {
|
|
15
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/SelectItemTrigger.tsx",
|
|
16
|
+
lineNumber: 18,
|
|
17
|
+
columnNumber: 9
|
|
18
|
+
}, void 0);
|
|
15
19
|
});
|
|
16
20
|
exports.SelectItemTrigger = SelectItemTrigger;
|
|
17
21
|
//# sourceMappingURL=SelectItemTrigger.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectItemTrigger.cjs","sources":["../../../src/components/SelectItemTrigger.tsx"],"sourcesContent":["import React, { forwardRef, ReactElement, useCallback } from 'react'\nimport { useSelectHandleSelect } from '../contexts'\nimport { Slot } from '@radix-ui/react-slot'\nimport { useEntity } from '@contember/react-binding'\n\nexport type SelectItemTriggerProps = {\n\tchildren: ReactElement\n\taction?: 'select' | 'unselect' | 'toggle'\n}\n\nexport const SelectItemTrigger = forwardRef<HTMLElement, SelectItemTriggerProps>(({ action, ...props }: SelectItemTriggerProps, ref) => {\n\tconst handleSelect = useSelectHandleSelect()\n\tconst entity = useEntity()\n\tconst onClick = useCallback(() => {\n\t\thandleSelect?.(entity, action)\n\t}, [action, entity, handleSelect])\n\n\treturn <Slot onClick={onClick} {...props} ref={ref} />\n})\n"],"names":["forwardRef","useSelectHandleSelect","useEntity","useCallback","
|
|
1
|
+
{"version":3,"file":"SelectItemTrigger.cjs","sources":["../../../src/components/SelectItemTrigger.tsx"],"sourcesContent":["import React, { forwardRef, ReactElement, useCallback } from 'react'\nimport { useSelectHandleSelect } from '../contexts'\nimport { Slot } from '@radix-ui/react-slot'\nimport { useEntity } from '@contember/react-binding'\n\nexport type SelectItemTriggerProps = {\n\tchildren: ReactElement\n\taction?: 'select' | 'unselect' | 'toggle'\n}\n\nexport const SelectItemTrigger = forwardRef<HTMLElement, SelectItemTriggerProps>(({ action, ...props }: SelectItemTriggerProps, ref) => {\n\tconst handleSelect = useSelectHandleSelect()\n\tconst entity = useEntity()\n\tconst onClick = useCallback(() => {\n\t\thandleSelect?.(entity, action)\n\t}, [action, entity, handleSelect])\n\n\treturn <Slot onClick={onClick} {...props} ref={ref} />\n})\n"],"names":["forwardRef","useSelectHandleSelect","useEntity","useCallback","jsxDEV","Slot","this"],"mappings":";;;;;;;AAUa,MAAA,oBAAoBA,iBAAgD,CAAC,EAAE,QAAQ,GAAG,SAAiC,QAAQ;AACvI,QAAM,eAAeC,SAAAA;AACrB,QAAM,SAASC,aAAAA;AACT,QAAA,UAAUC,MAAAA,YAAY,MAAM;AACjC,mBAAe,QAAQ,MAAM;AAAA,EAC3B,GAAA,CAAC,QAAQ,QAAQ,YAAY,CAAC;AAEjC,SAAQC,8BAAA,OAAAC,gBAAA,EAAK,SAAmB,GAAG,OAAO,IAAnC,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAA6C,GAAAC,MAAA;AACrD,CAAC;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
2
|
import { forwardRef, useCallback } from "react";
|
|
3
3
|
import { useSelectHandleSelect } from "../contexts.js";
|
|
4
4
|
import { Slot } from "@radix-ui/react-slot";
|
|
@@ -9,7 +9,11 @@ const SelectItemTrigger = forwardRef(({ action, ...props }, ref) => {
|
|
|
9
9
|
const onClick = useCallback(() => {
|
|
10
10
|
handleSelect?.(entity, action);
|
|
11
11
|
}, [action, entity, handleSelect]);
|
|
12
|
-
return /* @__PURE__ */
|
|
12
|
+
return /* @__PURE__ */ jsxDEV(Slot, { onClick, ...props, ref }, void 0, false, {
|
|
13
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/SelectItemTrigger.tsx",
|
|
14
|
+
lineNumber: 18,
|
|
15
|
+
columnNumber: 9
|
|
16
|
+
}, void 0);
|
|
13
17
|
});
|
|
14
18
|
export {
|
|
15
19
|
SelectItemTrigger
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectItemTrigger.js","sources":["../../../src/components/SelectItemTrigger.tsx"],"sourcesContent":["import React, { forwardRef, ReactElement, useCallback } from 'react'\nimport { useSelectHandleSelect } from '../contexts'\nimport { Slot } from '@radix-ui/react-slot'\nimport { useEntity } from '@contember/react-binding'\n\nexport type SelectItemTriggerProps = {\n\tchildren: ReactElement\n\taction?: 'select' | 'unselect' | 'toggle'\n}\n\nexport const SelectItemTrigger = forwardRef<HTMLElement, SelectItemTriggerProps>(({ action, ...props }: SelectItemTriggerProps, ref) => {\n\tconst handleSelect = useSelectHandleSelect()\n\tconst entity = useEntity()\n\tconst onClick = useCallback(() => {\n\t\thandleSelect?.(entity, action)\n\t}, [action, entity, handleSelect])\n\n\treturn <Slot onClick={onClick} {...props} ref={ref} />\n})\n"],"names":[],"mappings":";;;;;AAUa,MAAA,oBAAoB,WAAgD,CAAC,EAAE,QAAQ,GAAG,SAAiC,QAAQ;AACvI,QAAM,eAAe;AACrB,QAAM,SAAS;AACT,QAAA,UAAU,YAAY,MAAM;AACjC,mBAAe,QAAQ,MAAM;AAAA,EAC3B,GAAA,CAAC,QAAQ,QAAQ,YAAY,CAAC;AAEjC,SAAQ,
|
|
1
|
+
{"version":3,"file":"SelectItemTrigger.js","sources":["../../../src/components/SelectItemTrigger.tsx"],"sourcesContent":["import React, { forwardRef, ReactElement, useCallback } from 'react'\nimport { useSelectHandleSelect } from '../contexts'\nimport { Slot } from '@radix-ui/react-slot'\nimport { useEntity } from '@contember/react-binding'\n\nexport type SelectItemTriggerProps = {\n\tchildren: ReactElement\n\taction?: 'select' | 'unselect' | 'toggle'\n}\n\nexport const SelectItemTrigger = forwardRef<HTMLElement, SelectItemTriggerProps>(({ action, ...props }: SelectItemTriggerProps, ref) => {\n\tconst handleSelect = useSelectHandleSelect()\n\tconst entity = useEntity()\n\tconst onClick = useCallback(() => {\n\t\thandleSelect?.(entity, action)\n\t}, [action, entity, handleSelect])\n\n\treturn <Slot onClick={onClick} {...props} ref={ref} />\n})\n"],"names":["this"],"mappings":";;;;;AAUa,MAAA,oBAAoB,WAAgD,CAAC,EAAE,QAAQ,GAAG,SAAiC,QAAQ;AACvI,QAAM,eAAe;AACrB,QAAM,SAAS;AACT,QAAA,UAAU,YAAY,MAAM;AACjC,mBAAe,QAAQ,MAAM;AAAA,EAC3B,GAAA,CAAC,QAAQ,QAAQ,YAAY,CAAC;AAEjC,SAAQ,uBAAA,MAAA,EAAK,SAAmB,GAAG,OAAO,IAAnC,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAA6C,GAAAA,MAAA;AACrD,CAAC;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
3
|
+
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
4
|
const reactBinding = require("@contember/react-binding");
|
|
5
5
|
const react = require("react");
|
|
6
6
|
const contexts = require("../contexts.cjs");
|
|
@@ -13,9 +13,17 @@ const SelectNewItem = ({ children }) => {
|
|
|
13
13
|
const getSubTree = reactBinding.useGetEntitySubTree();
|
|
14
14
|
react.useEffect(() => {
|
|
15
15
|
(async () => {
|
|
16
|
-
const treeRootId = await extendTree(/* @__PURE__ */
|
|
16
|
+
const treeRootId = await extendTree(/* @__PURE__ */ jsxDevRuntime.jsxDEV(jsxDevRuntime.Fragment, { children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(reactBinding.EntitySubTree, { entity: {
|
|
17
17
|
entityName
|
|
18
|
-
}, expectedMutation: "none", isUnpersisted: true, isCreating: true, children }
|
|
18
|
+
}, expectedMutation: "none", isUnpersisted: true, isCreating: true, children }, void 0, false, {
|
|
19
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/SelectNewItem.tsx",
|
|
20
|
+
lineNumber: 18,
|
|
21
|
+
columnNumber: 5
|
|
22
|
+
}, void 0) }, void 0, false, {
|
|
23
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/SelectNewItem.tsx",
|
|
24
|
+
lineNumber: 17,
|
|
25
|
+
columnNumber: 40
|
|
26
|
+
}, void 0));
|
|
19
27
|
if (!treeRootId) {
|
|
20
28
|
return;
|
|
21
29
|
}
|
|
@@ -34,7 +42,19 @@ const SelectNewItem = ({ children }) => {
|
|
|
34
42
|
if (!state) {
|
|
35
43
|
return null;
|
|
36
44
|
}
|
|
37
|
-
return /* @__PURE__ */
|
|
45
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(jsxDevRuntime.Fragment, { children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(reactBinding.TreeRootIdProvider, { treeRootId: state.treeRootId, children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(reactBinding.Entity, { accessor: state.entity, children }, void 0, false, {
|
|
46
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/SelectNewItem.tsx",
|
|
47
|
+
lineNumber: 48,
|
|
48
|
+
columnNumber: 5
|
|
49
|
+
}, void 0) }, void 0, false, {
|
|
50
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/SelectNewItem.tsx",
|
|
51
|
+
lineNumber: 47,
|
|
52
|
+
columnNumber: 4
|
|
53
|
+
}, void 0) }, void 0, false, {
|
|
54
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/SelectNewItem.tsx",
|
|
55
|
+
lineNumber: 46,
|
|
56
|
+
columnNumber: 3
|
|
57
|
+
}, void 0);
|
|
38
58
|
};
|
|
39
59
|
exports.SelectNewItem = SelectNewItem;
|
|
40
60
|
//# sourceMappingURL=SelectNewItem.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectNewItem.cjs","sources":["../../../src/components/SelectNewItem.tsx"],"sourcesContent":["import { Entity, EntityAccessor, EntitySubTree, QueryLanguage, TreeRootId, TreeRootIdProvider, useEnvironment, useExtendTree, useGetEntitySubTree } from '@contember/react-binding'\nimport * as React from 'react'\nimport { ReactNode, useEffect, useMemo, useState } from 'react'\nimport { useSelectOptions } from '../contexts'\n\nexport const SelectNewItem = ({ children }: { children: ReactNode }) => {\n\tconst options = useSelectOptions()\n\tconst env = useEnvironment()\n\tconst { entityName } = useMemo((() => QueryLanguage.desugarQualifiedEntityList({ entities: options }, env)), [env, options])\n\n\tconst [state, setState] = useState<{ entity: EntityAccessor, treeRootId: TreeRootId } | null>(null)\n\tconst extendTree = useExtendTree()\n\tconst getSubTree = useGetEntitySubTree()\n\n\tuseEffect(() => {\n\t\t(async () => {\n\t\t\tconst treeRootId = await extendTree(<>\n\t\t\t\t<EntitySubTree entity={{\n\t\t\t\t\tentityName,\n\t\t\t\t}} expectedMutation={'none'} isUnpersisted isCreating>\n\t\t\t\t\t{children}\n\t\t\t\t</EntitySubTree>\n\t\t\t</>)\n\t\t\tif (!treeRootId) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst entity = getSubTree({\n\t\t\t\tentity: {\n\t\t\t\t\tentityName: entityName,\n\t\t\t\t},\n\t\t\t\tisCreating: true,\n\t\t\t}, treeRootId)\n\t\t\tsetState({\n\t\t\t\tentity,\n\t\t\t\ttreeRootId,\n\t\t\t})\n\t\t})()\n\t}, [children, entityName, extendTree, getSubTree])\n\n\tif (!state) {\n\t\treturn null\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<TreeRootIdProvider treeRootId={state.treeRootId}>\n\t\t\t\t<Entity accessor={state.entity}>\n\t\t\t\t\t{children}\n\t\t\t\t</Entity>\n\t\t\t</TreeRootIdProvider>\n\t\t</>\n\t)\n}\n"],"names":["useSelectOptions","useEnvironment","useMemo","QueryLanguage","useState","useExtendTree","useGetEntitySubTree","useEffect","
|
|
1
|
+
{"version":3,"file":"SelectNewItem.cjs","sources":["../../../src/components/SelectNewItem.tsx"],"sourcesContent":["import { Entity, EntityAccessor, EntitySubTree, QueryLanguage, TreeRootId, TreeRootIdProvider, useEnvironment, useExtendTree, useGetEntitySubTree } from '@contember/react-binding'\nimport * as React from 'react'\nimport { ReactNode, useEffect, useMemo, useState } from 'react'\nimport { useSelectOptions } from '../contexts'\n\nexport const SelectNewItem = ({ children }: { children: ReactNode }) => {\n\tconst options = useSelectOptions()\n\tconst env = useEnvironment()\n\tconst { entityName } = useMemo((() => QueryLanguage.desugarQualifiedEntityList({ entities: options }, env)), [env, options])\n\n\tconst [state, setState] = useState<{ entity: EntityAccessor, treeRootId: TreeRootId } | null>(null)\n\tconst extendTree = useExtendTree()\n\tconst getSubTree = useGetEntitySubTree()\n\n\tuseEffect(() => {\n\t\t(async () => {\n\t\t\tconst treeRootId = await extendTree(<>\n\t\t\t\t<EntitySubTree entity={{\n\t\t\t\t\tentityName,\n\t\t\t\t}} expectedMutation={'none'} isUnpersisted isCreating>\n\t\t\t\t\t{children}\n\t\t\t\t</EntitySubTree>\n\t\t\t</>)\n\t\t\tif (!treeRootId) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst entity = getSubTree({\n\t\t\t\tentity: {\n\t\t\t\t\tentityName: entityName,\n\t\t\t\t},\n\t\t\t\tisCreating: true,\n\t\t\t}, treeRootId)\n\t\t\tsetState({\n\t\t\t\tentity,\n\t\t\t\ttreeRootId,\n\t\t\t})\n\t\t})()\n\t}, [children, entityName, extendTree, getSubTree])\n\n\tif (!state) {\n\t\treturn null\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<TreeRootIdProvider treeRootId={state.treeRootId}>\n\t\t\t\t<Entity accessor={state.entity}>\n\t\t\t\t\t{children}\n\t\t\t\t</Entity>\n\t\t\t</TreeRootIdProvider>\n\t\t</>\n\t)\n}\n"],"names":["useSelectOptions","useEnvironment","useMemo","QueryLanguage","useState","useExtendTree","useGetEntitySubTree","useEffect","jsxDEV","Fragment","EntitySubTree","this","TreeRootIdProvider","Entity"],"mappings":";;;;;;AAKO,MAAM,gBAAgB,CAAC,EAAE,eAAwC;AACvE,QAAM,UAAUA,SAAAA;AAChB,QAAM,MAAMC,aAAAA;AACZ,QAAM,EAAE,WAAW,IAAIC,MAAS,QAAA,MAAMC,aAAAA,cAAc,2BAA2B,EAAE,UAAU,QAAA,GAAW,GAAG,GAAI,CAAC,KAAK,OAAO,CAAC;AAE3H,QAAM,CAAC,OAAO,QAAQ,IAAIC,eAAoE,IAAI;AAClG,QAAM,aAAaC,aAAAA;AACnB,QAAM,aAAaC,aAAAA;AAEnBC,QAAAA,UAAU,MAAM;AACf,KAAC,YAAY;AACZ,YAAM,aAAa,MAAM,WACxBC,qCAAAC,cAAAA,UAAA,EAAA,UAAAD,8BAAA,OAACE,8BAAc,QAAQ;AAAA,QACtB;AAAA,SACE,kBAAkB,QAAQ,eAAa,MAAC,YAAU,MACnD,SAHF,GAAA,QAAA,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAAA,GAAAC,MAIA,EALmC,GAAA,QAAA,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAAA,GAAAA,MAMpC,CAAG;AACH,UAAI,CAAC,YAAY;AAChB;AAAA,MACD;AAEA,YAAM,SAAS,WAAW;AAAA,QACzB,QAAQ;AAAA,UACP;AAAA,QACD;AAAA,QACA,YAAY;AAAA,SACV,UAAU;AACJ,eAAA;AAAA,QACR;AAAA,QACA;AAAA,MAAA,CACA;AAAA,IAAA;KAEA,CAAC,UAAU,YAAY,YAAY,UAAU,CAAC;AAEjD,MAAI,CAAC,OAAO;AACJ,WAAA;AAAA,EACR;AAGC,SAAAH,8BAAA,OAAAC,cAAA,UAAA,EACC,UAACD,8BAAA,OAAAI,iCAAA,EAAmB,YAAY,MAAM,YACrC,UAAAJ,qCAACK,aAAAA,QAAO,EAAA,UAAU,MAAM,QACtB,SADF,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAF,MAEA,EAHD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAIA,EALD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAMA,GAAAA,MAAA;AAEF;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
|
|
2
2
|
import { useEnvironment, QueryLanguage, useExtendTree, useGetEntitySubTree, EntitySubTree, TreeRootIdProvider, Entity } from "@contember/react-binding";
|
|
3
3
|
import { useMemo, useState, useEffect } from "react";
|
|
4
4
|
import { useSelectOptions } from "../contexts.js";
|
|
@@ -11,9 +11,17 @@ const SelectNewItem = ({ children }) => {
|
|
|
11
11
|
const getSubTree = useGetEntitySubTree();
|
|
12
12
|
useEffect(() => {
|
|
13
13
|
(async () => {
|
|
14
|
-
const treeRootId = await extendTree(/* @__PURE__ */
|
|
14
|
+
const treeRootId = await extendTree(/* @__PURE__ */ jsxDEV(Fragment, { children: /* @__PURE__ */ jsxDEV(EntitySubTree, { entity: {
|
|
15
15
|
entityName
|
|
16
|
-
}, expectedMutation: "none", isUnpersisted: true, isCreating: true, children }
|
|
16
|
+
}, expectedMutation: "none", isUnpersisted: true, isCreating: true, children }, void 0, false, {
|
|
17
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/SelectNewItem.tsx",
|
|
18
|
+
lineNumber: 18,
|
|
19
|
+
columnNumber: 5
|
|
20
|
+
}, void 0) }, void 0, false, {
|
|
21
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/SelectNewItem.tsx",
|
|
22
|
+
lineNumber: 17,
|
|
23
|
+
columnNumber: 40
|
|
24
|
+
}, void 0));
|
|
17
25
|
if (!treeRootId) {
|
|
18
26
|
return;
|
|
19
27
|
}
|
|
@@ -32,7 +40,19 @@ const SelectNewItem = ({ children }) => {
|
|
|
32
40
|
if (!state) {
|
|
33
41
|
return null;
|
|
34
42
|
}
|
|
35
|
-
return /* @__PURE__ */
|
|
43
|
+
return /* @__PURE__ */ jsxDEV(Fragment, { children: /* @__PURE__ */ jsxDEV(TreeRootIdProvider, { treeRootId: state.treeRootId, children: /* @__PURE__ */ jsxDEV(Entity, { accessor: state.entity, children }, void 0, false, {
|
|
44
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/SelectNewItem.tsx",
|
|
45
|
+
lineNumber: 48,
|
|
46
|
+
columnNumber: 5
|
|
47
|
+
}, void 0) }, void 0, false, {
|
|
48
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/SelectNewItem.tsx",
|
|
49
|
+
lineNumber: 47,
|
|
50
|
+
columnNumber: 4
|
|
51
|
+
}, void 0) }, void 0, false, {
|
|
52
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/SelectNewItem.tsx",
|
|
53
|
+
lineNumber: 46,
|
|
54
|
+
columnNumber: 3
|
|
55
|
+
}, void 0);
|
|
36
56
|
};
|
|
37
57
|
export {
|
|
38
58
|
SelectNewItem
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectNewItem.js","sources":["../../../src/components/SelectNewItem.tsx"],"sourcesContent":["import { Entity, EntityAccessor, EntitySubTree, QueryLanguage, TreeRootId, TreeRootIdProvider, useEnvironment, useExtendTree, useGetEntitySubTree } from '@contember/react-binding'\nimport * as React from 'react'\nimport { ReactNode, useEffect, useMemo, useState } from 'react'\nimport { useSelectOptions } from '../contexts'\n\nexport const SelectNewItem = ({ children }: { children: ReactNode }) => {\n\tconst options = useSelectOptions()\n\tconst env = useEnvironment()\n\tconst { entityName } = useMemo((() => QueryLanguage.desugarQualifiedEntityList({ entities: options }, env)), [env, options])\n\n\tconst [state, setState] = useState<{ entity: EntityAccessor, treeRootId: TreeRootId } | null>(null)\n\tconst extendTree = useExtendTree()\n\tconst getSubTree = useGetEntitySubTree()\n\n\tuseEffect(() => {\n\t\t(async () => {\n\t\t\tconst treeRootId = await extendTree(<>\n\t\t\t\t<EntitySubTree entity={{\n\t\t\t\t\tentityName,\n\t\t\t\t}} expectedMutation={'none'} isUnpersisted isCreating>\n\t\t\t\t\t{children}\n\t\t\t\t</EntitySubTree>\n\t\t\t</>)\n\t\t\tif (!treeRootId) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst entity = getSubTree({\n\t\t\t\tentity: {\n\t\t\t\t\tentityName: entityName,\n\t\t\t\t},\n\t\t\t\tisCreating: true,\n\t\t\t}, treeRootId)\n\t\t\tsetState({\n\t\t\t\tentity,\n\t\t\t\ttreeRootId,\n\t\t\t})\n\t\t})()\n\t}, [children, entityName, extendTree, getSubTree])\n\n\tif (!state) {\n\t\treturn null\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<TreeRootIdProvider treeRootId={state.treeRootId}>\n\t\t\t\t<Entity accessor={state.entity}>\n\t\t\t\t\t{children}\n\t\t\t\t</Entity>\n\t\t\t</TreeRootIdProvider>\n\t\t</>\n\t)\n}\n"],"names":[],"mappings":";;;;AAKO,MAAM,gBAAgB,CAAC,EAAE,eAAwC;AACvE,QAAM,UAAU;AAChB,QAAM,MAAM;AACZ,QAAM,EAAE,WAAW,IAAI,QAAS,MAAM,cAAc,2BAA2B,EAAE,UAAU,QAAA,GAAW,GAAG,GAAI,CAAC,KAAK,OAAO,CAAC;AAE3H,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAoE,IAAI;AAClG,QAAM,aAAa;AACnB,QAAM,aAAa;AAEnB,YAAU,MAAM;AACf,KAAC,YAAY;AACZ,YAAM,aAAa,MAAM,WACxB,
|
|
1
|
+
{"version":3,"file":"SelectNewItem.js","sources":["../../../src/components/SelectNewItem.tsx"],"sourcesContent":["import { Entity, EntityAccessor, EntitySubTree, QueryLanguage, TreeRootId, TreeRootIdProvider, useEnvironment, useExtendTree, useGetEntitySubTree } from '@contember/react-binding'\nimport * as React from 'react'\nimport { ReactNode, useEffect, useMemo, useState } from 'react'\nimport { useSelectOptions } from '../contexts'\n\nexport const SelectNewItem = ({ children }: { children: ReactNode }) => {\n\tconst options = useSelectOptions()\n\tconst env = useEnvironment()\n\tconst { entityName } = useMemo((() => QueryLanguage.desugarQualifiedEntityList({ entities: options }, env)), [env, options])\n\n\tconst [state, setState] = useState<{ entity: EntityAccessor, treeRootId: TreeRootId } | null>(null)\n\tconst extendTree = useExtendTree()\n\tconst getSubTree = useGetEntitySubTree()\n\n\tuseEffect(() => {\n\t\t(async () => {\n\t\t\tconst treeRootId = await extendTree(<>\n\t\t\t\t<EntitySubTree entity={{\n\t\t\t\t\tentityName,\n\t\t\t\t}} expectedMutation={'none'} isUnpersisted isCreating>\n\t\t\t\t\t{children}\n\t\t\t\t</EntitySubTree>\n\t\t\t</>)\n\t\t\tif (!treeRootId) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst entity = getSubTree({\n\t\t\t\tentity: {\n\t\t\t\t\tentityName: entityName,\n\t\t\t\t},\n\t\t\t\tisCreating: true,\n\t\t\t}, treeRootId)\n\t\t\tsetState({\n\t\t\t\tentity,\n\t\t\t\ttreeRootId,\n\t\t\t})\n\t\t})()\n\t}, [children, entityName, extendTree, getSubTree])\n\n\tif (!state) {\n\t\treturn null\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<TreeRootIdProvider treeRootId={state.treeRootId}>\n\t\t\t\t<Entity accessor={state.entity}>\n\t\t\t\t\t{children}\n\t\t\t\t</Entity>\n\t\t\t</TreeRootIdProvider>\n\t\t</>\n\t)\n}\n"],"names":["this"],"mappings":";;;;AAKO,MAAM,gBAAgB,CAAC,EAAE,eAAwC;AACvE,QAAM,UAAU;AAChB,QAAM,MAAM;AACZ,QAAM,EAAE,WAAW,IAAI,QAAS,MAAM,cAAc,2BAA2B,EAAE,UAAU,QAAA,GAAW,GAAG,GAAI,CAAC,KAAK,OAAO,CAAC;AAE3H,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAoE,IAAI;AAClG,QAAM,aAAa;AACnB,QAAM,aAAa;AAEnB,YAAU,MAAM;AACf,KAAC,YAAY;AACZ,YAAM,aAAa,MAAM,WACxB,uBAAA,UAAA,EAAA,UAAA,uBAAC,iBAAc,QAAQ;AAAA,QACtB;AAAA,SACE,kBAAkB,QAAQ,eAAa,MAAC,YAAU,MACnD,SAHF,GAAA,QAAA,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAAA,GAAAA,MAIA,EALmC,GAAA,QAAA,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAAA,GAAAA,MAMpC,CAAG;AACH,UAAI,CAAC,YAAY;AAChB;AAAA,MACD;AAEA,YAAM,SAAS,WAAW;AAAA,QACzB,QAAQ;AAAA,UACP;AAAA,QACD;AAAA,QACA,YAAY;AAAA,SACV,UAAU;AACJ,eAAA;AAAA,QACR;AAAA,QACA;AAAA,MAAA,CACA;AAAA,IAAA;KAEA,CAAC,UAAU,YAAY,YAAY,UAAU,CAAC;AAEjD,MAAI,CAAC,OAAO;AACJ,WAAA;AAAA,EACR;AAGC,SAAA,uBAAA,UAAA,EACC,UAAC,uBAAA,oBAAA,EAAmB,YAAY,MAAM,YACrC,UAAA,uBAAC,QAAO,EAAA,UAAU,MAAM,QACtB,SADF,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAEA,EAHD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAIA,EALD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAMA,GAAAA,MAAA;AAEF;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
3
|
+
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
4
|
const react = require("react");
|
|
5
5
|
const contexts = require("../contexts.cjs");
|
|
6
6
|
const reactSlot = require("@radix-ui/react-slot");
|
|
@@ -9,13 +9,21 @@ const utilities = require("@contember/utilities");
|
|
|
9
9
|
const SelectOption = react.forwardRef(({ action, ...props }, ref) => {
|
|
10
10
|
const isSelected = contexts.useSelectIsSelected();
|
|
11
11
|
const entity = reactBinding.useEntity();
|
|
12
|
-
return /* @__PURE__ */
|
|
12
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
|
|
13
13
|
reactSlot.Slot,
|
|
14
14
|
{
|
|
15
15
|
ref,
|
|
16
16
|
"data-selected": utilities.dataAttribute(isSelected?.(entity)),
|
|
17
17
|
...props
|
|
18
|
-
}
|
|
18
|
+
},
|
|
19
|
+
void 0,
|
|
20
|
+
false,
|
|
21
|
+
{
|
|
22
|
+
fileName: "/__w/interface/interface/packages/react-select/src/components/SelectOption.tsx",
|
|
23
|
+
lineNumber: 16,
|
|
24
|
+
columnNumber: 3
|
|
25
|
+
},
|
|
26
|
+
void 0
|
|
19
27
|
);
|
|
20
28
|
});
|
|
21
29
|
exports.SelectOption = SelectOption;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectOption.cjs","sources":["../../../src/components/SelectOption.tsx"],"sourcesContent":["import React, { forwardRef, ReactNode } from 'react'\nimport { useSelectIsSelected } from '../contexts'\nimport { Slot } from '@radix-ui/react-slot'\nimport { useEntity } from '@contember/react-binding'\nimport { dataAttribute } from '@contember/utilities'\n\nexport type SelectOptionProps = {\n\tchildren: ReactNode\n\taction?: 'select' | 'unselect' | 'toggle'\n}\n\nexport const SelectOption = forwardRef<HTMLElement, SelectOptionProps>(({ action, ...props }, ref) => {\n\tconst isSelected = useSelectIsSelected()\n\tconst entity = useEntity()\n\treturn (\n\t\t<Slot\n\t\t\tref={ref}\n\t\t\tdata-selected={dataAttribute(isSelected?.(entity))}\n\t\t\t{...props}\n\t\t/>\n\t)\n})\n"],"names":["forwardRef","useSelectIsSelected","useEntity","
|
|
1
|
+
{"version":3,"file":"SelectOption.cjs","sources":["../../../src/components/SelectOption.tsx"],"sourcesContent":["import React, { forwardRef, ReactNode } from 'react'\nimport { useSelectIsSelected } from '../contexts'\nimport { Slot } from '@radix-ui/react-slot'\nimport { useEntity } from '@contember/react-binding'\nimport { dataAttribute } from '@contember/utilities'\n\nexport type SelectOptionProps = {\n\tchildren: ReactNode\n\taction?: 'select' | 'unselect' | 'toggle'\n}\n\nexport const SelectOption = forwardRef<HTMLElement, SelectOptionProps>(({ action, ...props }, ref) => {\n\tconst isSelected = useSelectIsSelected()\n\tconst entity = useEntity()\n\treturn (\n\t\t<Slot\n\t\t\tref={ref}\n\t\t\tdata-selected={dataAttribute(isSelected?.(entity))}\n\t\t\t{...props}\n\t\t/>\n\t)\n})\n"],"names":["forwardRef","useSelectIsSelected","useEntity","jsxDEV","Slot","dataAttribute","this"],"mappings":";;;;;;;;AAWa,MAAA,eAAeA,iBAA2C,CAAC,EAAE,QAAQ,GAAG,SAAS,QAAQ;AACrG,QAAM,aAAaC,SAAAA;AACnB,QAAM,SAASC,aAAAA;AAEd,SAAAC,8BAAA;AAAA,IAACC,UAAA;AAAA,IAAA;AAAA,MACA;AAAA,MACA,iBAAeC,UAAA,cAAc,aAAa,MAAM,CAAC;AAAA,MAChD,GAAG;AAAA,IAAA;AAAA,IAHL;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAC;AAAAA,EAAA;AAMF,CAAC;;"}
|