@contember/react-select 2.1.0-alpha.8 → 2.1.0-beta.1
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/CLAUDE.md +20 -0
- package/dist/development/index.cjs +2 -2
- package/dist/development/index.js +1 -1
- package/dist/development/src/components/MultiSelect.cjs.map +1 -1
- package/dist/development/src/components/MultiSelect.js.map +1 -1
- package/dist/development/src/components/Select.cjs.map +1 -1
- package/dist/development/src/components/Select.js.map +1 -1
- package/dist/development/src/components/SelectDataView.cjs.map +1 -1
- package/dist/development/src/components/SelectDataView.js.map +1 -1
- package/dist/development/src/components/SelectEachItem.cjs +1 -1
- package/dist/development/src/components/SelectEachItem.cjs.map +1 -1
- package/dist/development/src/components/SelectEachItem.js +1 -1
- package/dist/development/src/components/SelectEachItem.js.map +1 -1
- package/dist/development/src/components/SelectItemTrigger.cjs.map +1 -1
- package/dist/development/src/components/SelectItemTrigger.js.map +1 -1
- package/dist/development/src/components/SelectNewItem.cjs +29 -14
- package/dist/development/src/components/SelectNewItem.cjs.map +1 -1
- package/dist/development/src/components/SelectNewItem.js +29 -14
- package/dist/development/src/components/SelectNewItem.js.map +1 -1
- package/dist/development/src/components/SelectOption.cjs.map +1 -1
- package/dist/development/src/components/SelectOption.js.map +1 -1
- package/dist/development/src/components/SelectPlaceholder.cjs.map +1 -1
- package/dist/development/src/components/SelectPlaceholder.js.map +1 -1
- package/dist/development/src/components/SortableMultiSelect.cjs +70 -67
- package/dist/development/src/components/SortableMultiSelect.cjs.map +1 -1
- package/dist/development/src/components/SortableMultiSelect.js +70 -67
- package/dist/development/src/components/SortableMultiSelect.js.map +1 -1
- package/dist/development/src/contexts.cjs.map +1 -1
- package/dist/development/src/contexts.js.map +1 -1
- package/dist/production/index.cjs +2 -2
- package/dist/production/index.js +1 -1
- package/dist/production/src/components/MultiSelect.cjs.map +1 -1
- package/dist/production/src/components/MultiSelect.js.map +1 -1
- package/dist/production/src/components/Select.cjs.map +1 -1
- package/dist/production/src/components/Select.js.map +1 -1
- package/dist/production/src/components/SelectDataView.cjs.map +1 -1
- package/dist/production/src/components/SelectDataView.js.map +1 -1
- package/dist/production/src/components/SelectEachItem.cjs.map +1 -1
- package/dist/production/src/components/SelectEachItem.js.map +1 -1
- package/dist/production/src/components/SelectItemTrigger.cjs.map +1 -1
- package/dist/production/src/components/SelectItemTrigger.js.map +1 -1
- package/dist/production/src/components/SelectNewItem.cjs +14 -3
- package/dist/production/src/components/SelectNewItem.cjs.map +1 -1
- package/dist/production/src/components/SelectNewItem.js +14 -3
- package/dist/production/src/components/SelectNewItem.js.map +1 -1
- package/dist/production/src/components/SelectOption.cjs.map +1 -1
- package/dist/production/src/components/SelectOption.js.map +1 -1
- package/dist/production/src/components/SelectPlaceholder.cjs.map +1 -1
- package/dist/production/src/components/SelectPlaceholder.js.map +1 -1
- package/dist/production/src/components/SortableMultiSelect.cjs +42 -39
- package/dist/production/src/components/SortableMultiSelect.cjs.map +1 -1
- package/dist/production/src/components/SortableMultiSelect.js +42 -39
- package/dist/production/src/components/SortableMultiSelect.js.map +1 -1
- package/dist/production/src/contexts.cjs.map +1 -1
- package/dist/production/src/contexts.js.map +1 -1
- package/dist/types/components/SelectDataView.d.ts.map +1 -1
- package/dist/types/components/SelectEachItem.d.ts.map +1 -1
- package/dist/types/components/SelectNewItem.d.ts.map +1 -1
- package/dist/types/components/SortableMultiSelect.d.ts.map +1 -1
- package/dist/types/contexts.d.ts +6 -6
- package/dist/types/contexts.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -12
- package/src/components/MultiSelect.tsx +1 -2
- package/src/components/Select.tsx +0 -1
- package/src/components/SelectDataView.tsx +1 -1
- package/src/components/SelectEachItem.tsx +0 -1
- package/src/components/SelectItemTrigger.tsx +1 -1
- package/src/components/SelectNewItem.tsx +27 -10
- package/src/components/SortableMultiSelect.tsx +64 -60
- package/src/contexts.ts +0 -2
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# react-select
|
|
2
|
+
|
|
3
|
+
Select/multi-select components for choosing related entities in forms.
|
|
4
|
+
|
|
5
|
+
## Core Components
|
|
6
|
+
|
|
7
|
+
- `Select` — single entity select with toggle/select/unselect actions
|
|
8
|
+
- `MultiSelect`, `SortableMultiSelect` — multi-entity selection with optional drag sorting
|
|
9
|
+
- `SelectDataView` — integration with react-dataview for large datasets
|
|
10
|
+
- `SelectOption`, `SelectPlaceholder`, `SelectNewItem`, `SelectEachItem` — UI elements
|
|
11
|
+
|
|
12
|
+
## Key Contexts
|
|
13
|
+
|
|
14
|
+
- `SelectCurrentEntitiesContext` — currently selected entities
|
|
15
|
+
- `SelectIsSelectedContext` — selection check predicate
|
|
16
|
+
- `SelectHandleSelectContext` — select/unselect/toggle handler
|
|
17
|
+
|
|
18
|
+
## Binding Integration
|
|
19
|
+
|
|
20
|
+
Uses `Component` wrapper from react-binding with `HasOne`/`HasMany` relations. Manages entity connections/disconnections at field level. Depends on `@contember/react-dataview` for option display and `@contember/react-repeater` for list handling.
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const contexts = require("./src/contexts.cjs");
|
|
4
4
|
const MultiSelect = require("./src/components/MultiSelect.cjs");
|
|
5
5
|
const Select = require("./src/components/Select.cjs");
|
|
6
|
-
const SelectNewItem = require("./src/components/SelectNewItem.cjs");
|
|
7
6
|
const SelectDataView = require("./src/components/SelectDataView.cjs");
|
|
8
7
|
const SelectEachItem = require("./src/components/SelectEachItem.cjs");
|
|
9
8
|
const SelectItemTrigger = require("./src/components/SelectItemTrigger.cjs");
|
|
9
|
+
const SelectNewItem = require("./src/components/SelectNewItem.cjs");
|
|
10
10
|
const SelectOption = require("./src/components/SelectOption.cjs");
|
|
11
11
|
const SelectPlaceholder = require("./src/components/SelectPlaceholder.cjs");
|
|
12
12
|
const SortableMultiSelect = require("./src/components/SortableMultiSelect.cjs");
|
|
@@ -20,10 +20,10 @@ exports.useSelectIsSelected = contexts.useSelectIsSelected;
|
|
|
20
20
|
exports.useSelectOptions = contexts.useSelectOptions;
|
|
21
21
|
exports.MultiSelect = MultiSelect.MultiSelect;
|
|
22
22
|
exports.Select = Select.Select;
|
|
23
|
-
exports.SelectNewItem = SelectNewItem.SelectNewItem;
|
|
24
23
|
exports.SelectDataView = SelectDataView.SelectDataView;
|
|
25
24
|
exports.SelectEachValue = SelectEachItem.SelectEachValue;
|
|
26
25
|
exports.SelectItemTrigger = SelectItemTrigger.SelectItemTrigger;
|
|
26
|
+
exports.SelectNewItem = SelectNewItem.SelectNewItem;
|
|
27
27
|
exports.SelectOption = SelectOption.SelectOption;
|
|
28
28
|
exports.SelectPlaceholder = SelectPlaceholder.SelectPlaceholder;
|
|
29
29
|
exports.SortableMultiSelect = SortableMultiSelect.SortableMultiSelect;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { SelectCurrentEntitiesContext, SelectHandleSelectContext, SelectIsSelectedContext, SelectOptionsContext, useSelectCurrentEntities, useSelectHandleSelect, useSelectIsSelected, useSelectOptions } from "./src/contexts.js";
|
|
2
2
|
import { MultiSelect } from "./src/components/MultiSelect.js";
|
|
3
3
|
import { Select } from "./src/components/Select.js";
|
|
4
|
-
import { SelectNewItem } from "./src/components/SelectNewItem.js";
|
|
5
4
|
import { SelectDataView } from "./src/components/SelectDataView.js";
|
|
6
5
|
import { SelectEachValue } from "./src/components/SelectEachItem.js";
|
|
7
6
|
import { SelectItemTrigger } from "./src/components/SelectItemTrigger.js";
|
|
7
|
+
import { SelectNewItem } from "./src/components/SelectNewItem.js";
|
|
8
8
|
import { SelectOption } from "./src/components/SelectOption.js";
|
|
9
9
|
import { SelectPlaceholder } from "./src/components/SelectPlaceholder.js";
|
|
10
10
|
import { SortableMultiSelect } from "./src/components/SortableMultiSelect.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelect.cjs","sources":["../../../../../packages/react-select/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\toptions ??= entities.name\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} expectedMutation=\"connectOrDisconnect\">\n\t\t\t{children}\n\t\t</HasMany>\n\t)\n})\n
|
|
1
|
+
{"version":3,"file":"MultiSelect.cjs","sources":["../../../../../packages/react-select/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\toptions ??= entities.name\n\tconst entitiesArr = useMemo(() => Array.from(entities), [entities])\n\tconst selectedEntities = useMemo(() => Array.from(entities).map((it: EntityAccessor) => 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} expectedMutation=\"connectOrDisconnect\">\n\t\t\t{children}\n\t\t</HasMany>\n\t)\n})\n"],"names":["Component","useEntityList","useMemo","useReferentiallyStableCallback","isSelected","useCallback","jsxDEV","SelectCurrentEntitiesContext","SelectIsSelectedContext","SelectHandleSelectContext","SelectOptionsContext","this","HasMany"],"mappings":";;;;;;;AAcO,MAAM,cAAcA,aAAAA,UAAU,CAAC,EAAE,OAAO,UAAU,SAAS,UAAU,iBAAmC;AAC9G,QAAM,WAAWC,aAAAA,cAAc,EAAE,OAAO;AACxC,cAAA,UAAY,SAAS;AACrB,QAAM,cAAcC,MAAAA,QAAQ,MAAM,MAAM,KAAK,QAAQ,GAAG,CAAC,QAAQ,CAAC;AAClE,QAAM,mBAAmBA,MAAAA,QAAQ,MAAM,MAAM,KAAK,QAAQ,EAAE,IAAI,CAAC,OAAuB,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC;AAE1G,QAAM,UAAUC,WAAAA,+BAA8C,CAAC,QAAQ,SAAS,aAAa;AAC5F,UAAMC,cAAa,iBAAiB,SAAS,OAAO,EAAE;AACtD,QAAI,WAAW,UAAU;AACxB,eAASA,cAAa,aAAa;AAAA,IACpC;AACA,QAAI,WAAW,cAAcA,aAAY;AACxC,eAAS,iBAAiB,MAAM;AAChC,mBAAa,MAAM;AAAA,IACpB,WAAW,WAAW,YAAY,CAACA,aAAY;AAC9C,eAAS,cAAc,MAAM;AAC7B,iBAAW,MAAM;AAAA,IAClB;AAAA,EACD,CAAC;AACD,QAAM,aAAaC,kBAAY,CAAC,WAA2B;AAC1D,WAAO,iBAAiB,SAAS,OAAO,EAAE;AAAA,EAC3C,GAAG,CAAC,gBAAgB,CAAC;AAErB,SACCC,8BAAAA,OAACC,SAAAA,6BAA6B,UAA7B,EAAsC,OAAO,aAC7C,UAAAD,8BAAAA,OAACE,SAAAA,wBAAwB,UAAxB,EAAiC,OAAO,YACxC,+CAACC,SAAAA,0BAA0B,UAA1B,EAAmC,OAAO,SAC1C,UAAAH,8BAAAA,OAACI,SAAAA,qBAAqB,UAArB,EAA8B,OAAO,SACpC,SAAA,GADF,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAC,MAEA,EAAA,GAHD,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAIA,EAAA,GALD,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAMA,EAAA,GAPD,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAQA;AAEF,GAAG,CAAC,EAAE,OAAO,eAAe;AAC3B,SACCL,8BAAAA,OAACM,sBAAA,EAAQ,OAAc,kBAAiB,uBACtC,SAAA,GADF,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAD,MAEA;AAEF,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelect.js","sources":["../../../../../packages/react-select/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\toptions ??= entities.name\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} expectedMutation=\"connectOrDisconnect\">\n\t\t\t{children}\n\t\t</HasMany>\n\t)\n})\n
|
|
1
|
+
{"version":3,"file":"MultiSelect.js","sources":["../../../../../packages/react-select/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\toptions ??= entities.name\n\tconst entitiesArr = useMemo(() => Array.from(entities), [entities])\n\tconst selectedEntities = useMemo(() => Array.from(entities).map((it: EntityAccessor) => 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} expectedMutation=\"connectOrDisconnect\">\n\t\t\t{children}\n\t\t</HasMany>\n\t)\n})\n"],"names":["isSelected","this"],"mappings":";;;;;AAcO,MAAM,cAAc,UAAU,CAAC,EAAE,OAAO,UAAU,SAAS,UAAU,iBAAmC;AAC9G,QAAM,WAAW,cAAc,EAAE,OAAO;AACxC,cAAA,UAAY,SAAS;AACrB,QAAM,cAAc,QAAQ,MAAM,MAAM,KAAK,QAAQ,GAAG,CAAC,QAAQ,CAAC;AAClE,QAAM,mBAAmB,QAAQ,MAAM,MAAM,KAAK,QAAQ,EAAE,IAAI,CAAC,OAAuB,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC;AAE1G,QAAM,UAAU,+BAA8C,CAAC,QAAQ,SAAS,aAAa;AAC5F,UAAMA,cAAa,iBAAiB,SAAS,OAAO,EAAE;AACtD,QAAI,WAAW,UAAU;AACxB,eAASA,cAAa,aAAa;AAAA,IACpC;AACA,QAAI,WAAW,cAAcA,aAAY;AACxC,eAAS,iBAAiB,MAAM;AAChC,mBAAa,MAAM;AAAA,IACpB,WAAW,WAAW,YAAY,CAACA,aAAY;AAC9C,eAAS,cAAc,MAAM;AAC7B,iBAAW,MAAM;AAAA,IAClB;AAAA,EACD,CAAC;AACD,QAAM,aAAa,YAAY,CAAC,WAA2B;AAC1D,WAAO,iBAAiB,SAAS,OAAO,EAAE;AAAA,EAC3C,GAAG,CAAC,gBAAgB,CAAC;AAErB,SACC,uBAAC,6BAA6B,UAA7B,EAAsC,OAAO,aAC7C,UAAA,uBAAC,wBAAwB,UAAxB,EAAiC,OAAO,YACxC,iCAAC,0BAA0B,UAA1B,EAAmC,OAAO,SAC1C,UAAA,uBAAC,qBAAqB,UAArB,EAA8B,OAAO,SACpC,SAAA,GADF,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAC,MAEA,EAAA,GAHD,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAIA,EAAA,GALD,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAMA,EAAA,GAPD,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAQA;AAEF,GAAG,CAAC,EAAE,OAAO,eAAe;AAC3B,SACC,uBAAC,SAAA,EAAQ,OAAc,kBAAiB,uBACtC,SAAA,GADF,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAEA;AAEF,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.cjs","sources":["../../../../../packages/react-select/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\tisNonbearing?: boolean\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\toptions ??= selectedEntity.name\n\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, isNonbearing }) => {\n\treturn (\n\t\t<HasOne field={field} expectedMutation=\"connectOrDisconnect\" isNonbearing={isNonbearing}>\n\t\t\t{children}\n\t\t</HasOne>\n\t)\n})\n
|
|
1
|
+
{"version":3,"file":"Select.cjs","sources":["../../../../../packages/react-select/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\tisNonbearing?: boolean\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\toptions ??= selectedEntity.name\n\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, isNonbearing }) => {\n\treturn (\n\t\t<HasOne field={field} expectedMutation=\"connectOrDisconnect\" isNonbearing={isNonbearing}>\n\t\t\t{children}\n\t\t</HasOne>\n\t)\n})\n"],"names":["Component","useEntity","useMemo","useReferentiallyStableCallback","useCallback","entity","jsxDEV","SelectCurrentEntitiesContext","SelectIsSelectedContext","SelectHandleSelectContext","SelectOptionsContext","this","HasOne"],"mappings":";;;;;;;AAeO,MAAM,SAASA,aAAAA,UAAU,CAAC,EAAE,OAAO,UAAU,YAAY,UAAU,cAA2B;AACpG,QAAM,SAASC,aAAAA,UAAA;AACf,QAAM,iBAAiB,OAAO,UAAU,EAAE,OAAO;AACjD,cAAA,UAAY,eAAe;AAE3B,QAAM,eAAe,eAAe,kBAAkB,eAAe;AACrE,QAAM,cAAcC,cAAQ,MAAM,eAAe,CAAC,cAAc,IAAI,IAAI,CAAC,cAAc,cAAc,CAAC;AAEtG,QAAM,eAAeC,WAAAA,+BAA8C,CAAC,UAAU,SAAS,aAAa;AACnG,QAAI,WAAW,UAAU;AACxB,eAAS,SAAS,OAAO,eAAe,KAAK,aAAa;AAAA,IAC3D;AACA,QAAI,WAAW,YAAY;AAC1B,aAAO,wBAAwB,EAAE,OAAO;AACxC,mBAAa,QAAQ;AAAA,IACtB,WAAW,WAAW,UAAU;AAC/B,aAAO,qBAAqB,EAAE,MAAA,GAAS,QAAQ;AAC/C,iBAAW,QAAQ;AAAA,IACpB;AAAA,EACD,CAAC;AACD,QAAM,aAAaC,MAAAA,YAAY,CAACC,YAA2BA,QAAO,OAAO,eAAe,IAAI,CAAC,eAAe,EAAE,CAAC;AAE/G,SACCC,8BAAAA,OAACC,SAAAA,6BAA6B,UAA7B,EAAsC,OAAO,aAC7C,UAAAD,8BAAAA,OAACE,SAAAA,wBAAwB,UAAxB,EAAiC,OAAO,YACxC,+CAACC,SAAAA,0BAA0B,UAA1B,EAAmC,OAAO,cAC1C,UAAAH,8BAAAA,OAACI,SAAAA,qBAAqB,UAArB,EAA8B,OAAO,SACpC,SAAA,GADF,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAC,MAEA,EAAA,GAHD,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAIA,EAAA,GALD,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAMA,EAAA,GAPD,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAQA;AAEF,GAAG,CAAC,EAAE,OAAO,UAAU,mBAAmB;AACzC,8CACEC,aAAAA,QAAA,EAAO,OAAc,kBAAiB,uBAAsB,cAC3D,SAAA,GADF,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAD,MAEA;AAEF,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sources":["../../../../../packages/react-select/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\tisNonbearing?: boolean\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\toptions ??= selectedEntity.name\n\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, isNonbearing }) => {\n\treturn (\n\t\t<HasOne field={field} expectedMutation=\"connectOrDisconnect\" isNonbearing={isNonbearing}>\n\t\t\t{children}\n\t\t</HasOne>\n\t)\n})\n
|
|
1
|
+
{"version":3,"file":"Select.js","sources":["../../../../../packages/react-select/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\tisNonbearing?: boolean\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\toptions ??= selectedEntity.name\n\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, isNonbearing }) => {\n\treturn (\n\t\t<HasOne field={field} expectedMutation=\"connectOrDisconnect\" isNonbearing={isNonbearing}>\n\t\t\t{children}\n\t\t</HasOne>\n\t)\n})\n"],"names":["entity","this"],"mappings":";;;;;AAeO,MAAM,SAAS,UAAU,CAAC,EAAE,OAAO,UAAU,YAAY,UAAU,cAA2B;AACpG,QAAM,SAAS,UAAA;AACf,QAAM,iBAAiB,OAAO,UAAU,EAAE,OAAO;AACjD,cAAA,UAAY,eAAe;AAE3B,QAAM,eAAe,eAAe,kBAAkB,eAAe;AACrE,QAAM,cAAc,QAAQ,MAAM,eAAe,CAAC,cAAc,IAAI,IAAI,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;AAC1B,aAAO,wBAAwB,EAAE,OAAO;AACxC,mBAAa,QAAQ;AAAA,IACtB,WAAW,WAAW,UAAU;AAC/B,aAAO,qBAAqB,EAAE,MAAA,GAAS,QAAQ;AAC/C,iBAAW,QAAQ;AAAA,IACpB;AAAA,EACD,CAAC;AACD,QAAM,aAAa,YAAY,CAACA,YAA2BA,QAAO,OAAO,eAAe,IAAI,CAAC,eAAe,EAAE,CAAC;AAE/G,SACC,uBAAC,6BAA6B,UAA7B,EAAsC,OAAO,aAC7C,UAAA,uBAAC,wBAAwB,UAAxB,EAAiC,OAAO,YACxC,iCAAC,0BAA0B,UAA1B,EAAmC,OAAO,cAC1C,UAAA,uBAAC,qBAAqB,UAArB,EAA8B,OAAO,SACpC,SAAA,GADF,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAC,MAEA,EAAA,GAHD,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAIA,EAAA,GALD,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAMA,EAAA,GAPD,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAQA;AAEF,GAAG,CAAC,EAAE,OAAO,UAAU,mBAAmB;AACzC,gCACE,QAAA,EAAO,OAAc,kBAAiB,uBAAsB,cAC3D,SAAA,GADF,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAEA;AAEF,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectDataView.cjs","sources":["../../../../../packages/react-select/src/components/SelectDataView.tsx"],"sourcesContent":["import React, { ReactNode, useMemo } from 'react'\nimport { useSelectHandleSelect, useSelectOptions } from '../contexts'\nimport {
|
|
1
|
+
{"version":3,"file":"SelectDataView.cjs","sources":["../../../../../packages/react-select/src/components/SelectDataView.tsx"],"sourcesContent":["import React, { ReactNode, useMemo } from 'react'\nimport { useSelectHandleSelect, useSelectOptions } from '../contexts'\nimport { DataView, DataViewFilterHandlerRegistry, DataViewProps } 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\n\treturn (\n\t\t<DataView\n\t\t\tonSelectHighlighted={handleSelect}\n\t\t\tentities={entities}\n\t\t\tfilteringStateStorage=\"null\"\n\t\t\tsortingStateStorage=\"null\"\n\t\t\tcurrentPageStateStorage=\"null\"\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n"],"names":["useSelectHandleSelect","useSelectOptions","jsxDEV","DataView","this"],"mappings":";;;;;AAUO,MAAM,iBAAiB,CAAC,UAA+B;AAC7D,QAAM,eAAeA,SAAAA,sBAAA;AACrB,QAAM,WAAWC,SAAAA,iBAAA;AAEjB,SACCC,8BAAAA;AAAAA,IAACC,cAAAA;AAAAA,IAAA;AAAA,MACA,qBAAqB;AAAA,MACrB;AAAA,MACA,uBAAsB;AAAA,MACtB,qBAAoB;AAAA,MACpB,yBAAwB;AAAA,MACvB,GAAG;AAAA,IAAA;AAAA,IANL;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAC;AAAAA,EAAA;AASF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectDataView.js","sources":["../../../../../packages/react-select/src/components/SelectDataView.tsx"],"sourcesContent":["import React, { ReactNode, useMemo } from 'react'\nimport { useSelectHandleSelect, useSelectOptions } from '../contexts'\nimport {
|
|
1
|
+
{"version":3,"file":"SelectDataView.js","sources":["../../../../../packages/react-select/src/components/SelectDataView.tsx"],"sourcesContent":["import React, { ReactNode, useMemo } from 'react'\nimport { useSelectHandleSelect, useSelectOptions } from '../contexts'\nimport { DataView, DataViewFilterHandlerRegistry, DataViewProps } 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\n\treturn (\n\t\t<DataView\n\t\t\tonSelectHighlighted={handleSelect}\n\t\t\tentities={entities}\n\t\t\tfilteringStateStorage=\"null\"\n\t\t\tsortingStateStorage=\"null\"\n\t\t\tcurrentPageStateStorage=\"null\"\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n"],"names":["this"],"mappings":";;;AAUO,MAAM,iBAAiB,CAAC,UAA+B;AAC7D,QAAM,eAAe,sBAAA;AACrB,QAAM,WAAW,iBAAA;AAEjB,SACC;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,qBAAqB;AAAA,MACrB;AAAA,MACA,uBAAsB;AAAA,MACtB,qBAAoB;AAAA,MACpB,yBAAwB;AAAA,MACvB,GAAG;AAAA,IAAA;AAAA,IANL;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAA;AAAAA,EAAA;AASF;"}
|
|
@@ -7,7 +7,7 @@ const SelectEachValue = ({ children }) => {
|
|
|
7
7
|
const entities = contexts.useSelectCurrentEntities();
|
|
8
8
|
return entities.map((entity) => /* @__PURE__ */ jsxDevRuntime.jsxDEV(reactBinding.Entity, { accessor: entity, children }, entity.key, false, {
|
|
9
9
|
fileName: "/home/runner/work/contember/contember/packages/react-select/src/components/SelectEachItem.tsx",
|
|
10
|
-
lineNumber:
|
|
10
|
+
lineNumber: 8,
|
|
11
11
|
columnNumber: 3
|
|
12
12
|
}, void 0));
|
|
13
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectEachItem.cjs","sources":["../../../../../packages/react-select/src/components/SelectEachItem.tsx"],"sourcesContent":["import React, { ReactNode } from 'react'\nimport { useSelectCurrentEntities } from '../contexts'\nimport { Entity } from '@contember/react-binding'\n\
|
|
1
|
+
{"version":3,"file":"SelectEachItem.cjs","sources":["../../../../../packages/react-select/src/components/SelectEachItem.tsx"],"sourcesContent":["import React, { ReactNode } from 'react'\nimport { useSelectCurrentEntities } from '../contexts'\nimport { Entity } from '@contember/react-binding'\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":";;;;;AAIO,MAAM,kBAAkB,CAAC,EAAE,eAAwC;AACzE,QAAM,WAAWA,SAAAA,yBAAA;AACjB,SAAO,SAAS,IAAI,CAAA,WACnBC,8BAAAA,OAACC,aAAAA,UAAwB,UAAU,QACjC,SAAA,GADW,OAAO,KAApB,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAC,MAEA,CACA;AACF;;"}
|
|
@@ -5,7 +5,7 @@ const SelectEachValue = ({ children }) => {
|
|
|
5
5
|
const entities = useSelectCurrentEntities();
|
|
6
6
|
return entities.map((entity) => /* @__PURE__ */ jsxDEV(Entity, { accessor: entity, children }, entity.key, false, {
|
|
7
7
|
fileName: "/home/runner/work/contember/contember/packages/react-select/src/components/SelectEachItem.tsx",
|
|
8
|
-
lineNumber:
|
|
8
|
+
lineNumber: 8,
|
|
9
9
|
columnNumber: 3
|
|
10
10
|
}, void 0));
|
|
11
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectEachItem.js","sources":["../../../../../packages/react-select/src/components/SelectEachItem.tsx"],"sourcesContent":["import React, { ReactNode } from 'react'\nimport { useSelectCurrentEntities } from '../contexts'\nimport { Entity } from '@contember/react-binding'\n\
|
|
1
|
+
{"version":3,"file":"SelectEachItem.js","sources":["../../../../../packages/react-select/src/components/SelectEachItem.tsx"],"sourcesContent":["import React, { ReactNode } from 'react'\nimport { useSelectCurrentEntities } from '../contexts'\nimport { Entity } from '@contember/react-binding'\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":";;;AAIO,MAAM,kBAAkB,CAAC,EAAE,eAAwC;AACzE,QAAM,WAAW,yBAAA;AACjB,SAAO,SAAS,IAAI,CAAA,WACnB,uBAAC,UAAwB,UAAU,QACjC,SAAA,GADW,OAAO,KAApB,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAEA,CACA;AACF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectItemTrigger.cjs","sources":["../../../../../packages/react-select/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\tonClick?: (event: React.MouseEvent<HTMLElement>) => void\n}\n\nexport const SelectItemTrigger = forwardRef<HTMLElement, SelectItemTriggerProps>(({ action, ...props }: SelectItemTriggerProps, ref) => {\n\tconst handleSelect = useSelectHandleSelect()\n\tconst entity = useEntity()\n\tconst onClickProp = props.onClick\n\tconst onClick = useCallback((e: React.MouseEvent<HTMLElement>) => {\n\t\thandleSelect?.(entity, action)\n\t\tonClickProp?.(e)\n\t}, [action, entity, handleSelect, onClickProp])\n\treturn <Slot {...props} onClick={onClick}
|
|
1
|
+
{"version":3,"file":"SelectItemTrigger.cjs","sources":["../../../../../packages/react-select/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\tonClick?: (event: React.MouseEvent<HTMLElement>) => void\n}\n\nexport const SelectItemTrigger = forwardRef<HTMLElement, SelectItemTriggerProps>(({ action, ...props }: SelectItemTriggerProps, ref) => {\n\tconst handleSelect = useSelectHandleSelect()\n\tconst entity = useEntity()\n\tconst onClickProp = props.onClick\n\tconst onClick = useCallback((e: React.MouseEvent<HTMLElement>) => {\n\t\thandleSelect?.(entity, action)\n\t\tonClickProp?.(e)\n\t}, [action, entity, handleSelect, onClickProp])\n\treturn <Slot {...props} onClick={onClick} ref={ref} />\n})\n"],"names":["forwardRef","useSelectHandleSelect","useEntity","useCallback","jsxDEV","Slot","this"],"mappings":";;;;;;;AAWO,MAAM,oBAAoBA,MAAAA,WAAgD,CAAC,EAAE,QAAQ,GAAG,MAAA,GAAiC,QAAQ;AACvI,QAAM,eAAeC,SAAAA,sBAAA;AACrB,QAAM,SAASC,aAAAA,UAAA;AACf,QAAM,cAAc,MAAM;AAC1B,QAAM,UAAUC,kBAAY,CAAC,MAAqC;AACjE,mBAAe,QAAQ,MAAM;AAC7B,kBAAc,CAAC;AAAA,EAChB,GAAG,CAAC,QAAQ,QAAQ,cAAc,WAAW,CAAC;AAC9C,SAAOC,8BAAAA,OAACC,UAAAA,MAAA,EAAM,GAAG,OAAO,SAAkB,IAAA,GAAnC,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAC,MAA6C;AACrD,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectItemTrigger.js","sources":["../../../../../packages/react-select/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\tonClick?: (event: React.MouseEvent<HTMLElement>) => void\n}\n\nexport const SelectItemTrigger = forwardRef<HTMLElement, SelectItemTriggerProps>(({ action, ...props }: SelectItemTriggerProps, ref) => {\n\tconst handleSelect = useSelectHandleSelect()\n\tconst entity = useEntity()\n\tconst onClickProp = props.onClick\n\tconst onClick = useCallback((e: React.MouseEvent<HTMLElement>) => {\n\t\thandleSelect?.(entity, action)\n\t\tonClickProp?.(e)\n\t}, [action, entity, handleSelect, onClickProp])\n\treturn <Slot {...props} onClick={onClick}
|
|
1
|
+
{"version":3,"file":"SelectItemTrigger.js","sources":["../../../../../packages/react-select/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\tonClick?: (event: React.MouseEvent<HTMLElement>) => void\n}\n\nexport const SelectItemTrigger = forwardRef<HTMLElement, SelectItemTriggerProps>(({ action, ...props }: SelectItemTriggerProps, ref) => {\n\tconst handleSelect = useSelectHandleSelect()\n\tconst entity = useEntity()\n\tconst onClickProp = props.onClick\n\tconst onClick = useCallback((e: React.MouseEvent<HTMLElement>) => {\n\t\thandleSelect?.(entity, action)\n\t\tonClickProp?.(e)\n\t}, [action, entity, handleSelect, onClickProp])\n\treturn <Slot {...props} onClick={onClick} ref={ref} />\n})\n"],"names":["this"],"mappings":";;;;;AAWO,MAAM,oBAAoB,WAAgD,CAAC,EAAE,QAAQ,GAAG,MAAA,GAAiC,QAAQ;AACvI,QAAM,eAAe,sBAAA;AACrB,QAAM,SAAS,UAAA;AACf,QAAM,cAAc,MAAM;AAC1B,QAAM,UAAU,YAAY,CAAC,MAAqC;AACjE,mBAAe,QAAQ,MAAM;AAC7B,kBAAc,CAAC;AAAA,EAChB,GAAG,CAAC,QAAQ,QAAQ,cAAc,WAAW,CAAC;AAC9C,SAAO,uBAAC,MAAA,EAAM,GAAG,OAAO,SAAkB,IAAA,GAAnC,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAA6C;AACrD,CAAC;"}
|
|
@@ -13,17 +13,32 @@ const SelectNewItem = ({ children }) => {
|
|
|
13
13
|
const getSubTree = reactBinding.useGetEntitySubTree();
|
|
14
14
|
React.useEffect(() => {
|
|
15
15
|
(async () => {
|
|
16
|
-
const treeRootId = await extendTree(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
16
|
+
const treeRootId = await extendTree(
|
|
17
|
+
/* @__PURE__ */ jsxDevRuntime.jsxDEV(jsxDevRuntime.Fragment, { children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(
|
|
18
|
+
reactBinding.EntitySubTree,
|
|
19
|
+
{
|
|
20
|
+
entity: {
|
|
21
|
+
entityName
|
|
22
|
+
},
|
|
23
|
+
expectedMutation: "none",
|
|
24
|
+
isUnpersisted: true,
|
|
25
|
+
isCreating: true,
|
|
26
|
+
children
|
|
27
|
+
},
|
|
28
|
+
void 0,
|
|
29
|
+
false,
|
|
30
|
+
{
|
|
31
|
+
fileName: "/home/runner/work/contember/contember/packages/react-select/src/components/SelectNewItem.tsx",
|
|
32
|
+
lineNumber: 29,
|
|
33
|
+
columnNumber: 6
|
|
34
|
+
},
|
|
35
|
+
void 0
|
|
36
|
+
) }, void 0, false, {
|
|
37
|
+
fileName: "/home/runner/work/contember/contember/packages/react-select/src/components/SelectNewItem.tsx",
|
|
38
|
+
lineNumber: 28,
|
|
39
|
+
columnNumber: 5
|
|
40
|
+
}, void 0)
|
|
41
|
+
);
|
|
27
42
|
if (!treeRootId) {
|
|
28
43
|
return;
|
|
29
44
|
}
|
|
@@ -44,15 +59,15 @@ const SelectNewItem = ({ children }) => {
|
|
|
44
59
|
}
|
|
45
60
|
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
61
|
fileName: "/home/runner/work/contember/contember/packages/react-select/src/components/SelectNewItem.tsx",
|
|
47
|
-
lineNumber:
|
|
62
|
+
lineNumber: 65,
|
|
48
63
|
columnNumber: 5
|
|
49
64
|
}, void 0) }, void 0, false, {
|
|
50
65
|
fileName: "/home/runner/work/contember/contember/packages/react-select/src/components/SelectNewItem.tsx",
|
|
51
|
-
lineNumber:
|
|
66
|
+
lineNumber: 64,
|
|
52
67
|
columnNumber: 4
|
|
53
68
|
}, void 0) }, void 0, false, {
|
|
54
69
|
fileName: "/home/runner/work/contember/contember/packages/react-select/src/components/SelectNewItem.tsx",
|
|
55
|
-
lineNumber:
|
|
70
|
+
lineNumber: 63,
|
|
56
71
|
columnNumber: 3
|
|
57
72
|
}, void 0);
|
|
58
73
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectNewItem.cjs","sources":["../../../../../packages/react-select/src/components/SelectNewItem.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"SelectNewItem.cjs","sources":["../../../../../packages/react-select/src/components/SelectNewItem.tsx"],"sourcesContent":["import {\n\tEntity,\n\tEntityAccessor,\n\tEntitySubTree,\n\tQueryLanguage,\n\tTreeRootId,\n\tTreeRootIdProvider,\n\tuseEnvironment,\n\tuseExtendTree,\n\tuseGetEntitySubTree,\n} 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<>\n\t\t\t\t\t<EntitySubTree\n\t\t\t\t\t\tentity={{\n\t\t\t\t\t\t\tentityName,\n\t\t\t\t\t\t}}\n\t\t\t\t\t\texpectedMutation={'none'}\n\t\t\t\t\t\tisUnpersisted\n\t\t\t\t\t\tisCreating\n\t\t\t\t\t>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</EntitySubTree>\n\t\t\t\t</>,\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":";;;;;;AAeO,MAAM,gBAAgB,CAAC,EAAE,eAAwC;AACvE,QAAM,UAAUA,SAAAA,iBAAA;AAChB,QAAM,MAAMC,aAAAA,eAAA;AACZ,QAAM,EAAE,WAAA,IAAeC,MAAAA,QAAQ,MAAMC,aAAAA,cAAc,2BAA2B,EAAE,UAAU,QAAA,GAAW,GAAG,GAAG,CAAC,KAAK,OAAO,CAAC;AAEzH,QAAM,CAAC,OAAO,QAAQ,IAAIC,MAAAA,SAAoE,IAAI;AAClG,QAAM,aAAaC,aAAAA,cAAA;AACnB,QAAM,aAAaC,aAAAA,oBAAA;AAEnBC,QAAAA,UAAU,MAAM;AACd,KAAC,YAAY;AACb,YAAM,aAAa,MAAM;AAAA,QACxBC,qCAAAC,cAAAA,UAAA,EACC,UAAAD,8BAAAA;AAAAA,UAACE,aAAAA;AAAAA,UAAA;AAAA,YACA,QAAQ;AAAA,cACP;AAAA,YAAA;AAAA,YAED,kBAAkB;AAAA,YAClB,eAAa;AAAA,YACb,YAAU;AAAA,YAET;AAAA,UAAA;AAAA,UARF;AAAA,UAAA;AAAA,UAAA;AAAA,YAAA,UAAA;AAAA,YAAA,YAAA;AAAA,YAAA,cAAA;AAAA,UAAA;AAAA,UAAAC;AAAAA,QAAA,EASA,GAVD,QAAA,OAAA;AAAA,UAAA,UAAA;AAAA,UAAA,YAAA;AAAA,UAAA,cAAA;AAAA,QAAA,GAAAA,MAWA;AAAA,MAAA;AAED,UAAI,CAAC,YAAY;AAChB;AAAA,MACD;AAEA,YAAM,SAAS,WAAW;AAAA,QACzB,QAAQ;AAAA,UACP;AAAA,QAAA;AAAA,QAED,YAAY;AAAA,MAAA,GACV,UAAU;AACb,eAAS;AAAA,QACR;AAAA,QACA;AAAA,MAAA,CACA;AAAA,IACF,GAAA;AAAA,EACD,GAAG,CAAC,UAAU,YAAY,YAAY,UAAU,CAAC;AAEjD,MAAI,CAAC,OAAO;AACX,WAAO;AAAA,EACR;AAEA,SACCH,8BAAAA,OAAAC,cAAAA,UAAA,EACC,UAAAD,8BAAAA,OAACI,iCAAA,EAAmB,YAAY,MAAM,YACrC,UAAAJ,qCAACK,aAAAA,QAAA,EAAO,UAAU,MAAM,QACtB,SAAA,GADF,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAF,MAEA,EAAA,GAHD,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAIA,EAAA,GALD,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAMA;AAEF;;"}
|
|
@@ -11,17 +11,32 @@ const SelectNewItem = ({ children }) => {
|
|
|
11
11
|
const getSubTree = useGetEntitySubTree();
|
|
12
12
|
useEffect(() => {
|
|
13
13
|
(async () => {
|
|
14
|
-
const treeRootId = await extendTree(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
const treeRootId = await extendTree(
|
|
15
|
+
/* @__PURE__ */ jsxDEV(Fragment, { children: /* @__PURE__ */ jsxDEV(
|
|
16
|
+
EntitySubTree,
|
|
17
|
+
{
|
|
18
|
+
entity: {
|
|
19
|
+
entityName
|
|
20
|
+
},
|
|
21
|
+
expectedMutation: "none",
|
|
22
|
+
isUnpersisted: true,
|
|
23
|
+
isCreating: true,
|
|
24
|
+
children
|
|
25
|
+
},
|
|
26
|
+
void 0,
|
|
27
|
+
false,
|
|
28
|
+
{
|
|
29
|
+
fileName: "/home/runner/work/contember/contember/packages/react-select/src/components/SelectNewItem.tsx",
|
|
30
|
+
lineNumber: 29,
|
|
31
|
+
columnNumber: 6
|
|
32
|
+
},
|
|
33
|
+
void 0
|
|
34
|
+
) }, void 0, false, {
|
|
35
|
+
fileName: "/home/runner/work/contember/contember/packages/react-select/src/components/SelectNewItem.tsx",
|
|
36
|
+
lineNumber: 28,
|
|
37
|
+
columnNumber: 5
|
|
38
|
+
}, void 0)
|
|
39
|
+
);
|
|
25
40
|
if (!treeRootId) {
|
|
26
41
|
return;
|
|
27
42
|
}
|
|
@@ -42,15 +57,15 @@ const SelectNewItem = ({ children }) => {
|
|
|
42
57
|
}
|
|
43
58
|
return /* @__PURE__ */ jsxDEV(Fragment, { children: /* @__PURE__ */ jsxDEV(TreeRootIdProvider, { treeRootId: state.treeRootId, children: /* @__PURE__ */ jsxDEV(Entity, { accessor: state.entity, children }, void 0, false, {
|
|
44
59
|
fileName: "/home/runner/work/contember/contember/packages/react-select/src/components/SelectNewItem.tsx",
|
|
45
|
-
lineNumber:
|
|
60
|
+
lineNumber: 65,
|
|
46
61
|
columnNumber: 5
|
|
47
62
|
}, void 0) }, void 0, false, {
|
|
48
63
|
fileName: "/home/runner/work/contember/contember/packages/react-select/src/components/SelectNewItem.tsx",
|
|
49
|
-
lineNumber:
|
|
64
|
+
lineNumber: 64,
|
|
50
65
|
columnNumber: 4
|
|
51
66
|
}, void 0) }, void 0, false, {
|
|
52
67
|
fileName: "/home/runner/work/contember/contember/packages/react-select/src/components/SelectNewItem.tsx",
|
|
53
|
-
lineNumber:
|
|
68
|
+
lineNumber: 63,
|
|
54
69
|
columnNumber: 3
|
|
55
70
|
}, void 0);
|
|
56
71
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectNewItem.js","sources":["../../../../../packages/react-select/src/components/SelectNewItem.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"SelectNewItem.js","sources":["../../../../../packages/react-select/src/components/SelectNewItem.tsx"],"sourcesContent":["import {\n\tEntity,\n\tEntityAccessor,\n\tEntitySubTree,\n\tQueryLanguage,\n\tTreeRootId,\n\tTreeRootIdProvider,\n\tuseEnvironment,\n\tuseExtendTree,\n\tuseGetEntitySubTree,\n} 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<>\n\t\t\t\t\t<EntitySubTree\n\t\t\t\t\t\tentity={{\n\t\t\t\t\t\t\tentityName,\n\t\t\t\t\t\t}}\n\t\t\t\t\t\texpectedMutation={'none'}\n\t\t\t\t\t\tisUnpersisted\n\t\t\t\t\t\tisCreating\n\t\t\t\t\t>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</EntitySubTree>\n\t\t\t\t</>,\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":";;;;AAeO,MAAM,gBAAgB,CAAC,EAAE,eAAwC;AACvE,QAAM,UAAU,iBAAA;AAChB,QAAM,MAAM,eAAA;AACZ,QAAM,EAAE,WAAA,IAAe,QAAQ,MAAM,cAAc,2BAA2B,EAAE,UAAU,QAAA,GAAW,GAAG,GAAG,CAAC,KAAK,OAAO,CAAC;AAEzH,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAoE,IAAI;AAClG,QAAM,aAAa,cAAA;AACnB,QAAM,aAAa,oBAAA;AAEnB,YAAU,MAAM;AACd,KAAC,YAAY;AACb,YAAM,aAAa,MAAM;AAAA,QACxB,uBAAA,UAAA,EACC,UAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACA,QAAQ;AAAA,cACP;AAAA,YAAA;AAAA,YAED,kBAAkB;AAAA,YAClB,eAAa;AAAA,YACb,YAAU;AAAA,YAET;AAAA,UAAA;AAAA,UARF;AAAA,UAAA;AAAA,UAAA;AAAA,YAAA,UAAA;AAAA,YAAA,YAAA;AAAA,YAAA,cAAA;AAAA,UAAA;AAAA,UAAAA;AAAAA,QAAA,EASA,GAVD,QAAA,OAAA;AAAA,UAAA,UAAA;AAAA,UAAA,YAAA;AAAA,UAAA,cAAA;AAAA,QAAA,GAAAA,MAWA;AAAA,MAAA;AAED,UAAI,CAAC,YAAY;AAChB;AAAA,MACD;AAEA,YAAM,SAAS,WAAW;AAAA,QACzB,QAAQ;AAAA,UACP;AAAA,QAAA;AAAA,QAED,YAAY;AAAA,MAAA,GACV,UAAU;AACb,eAAS;AAAA,QACR;AAAA,QACA;AAAA,MAAA,CACA;AAAA,IACF,GAAA;AAAA,EACD,GAAG,CAAC,UAAU,YAAY,YAAY,UAAU,CAAC;AAEjD,MAAI,CAAC,OAAO;AACX,WAAO;AAAA,EACR;AAEA,SACC,uBAAA,UAAA,EACC,UAAA,uBAAC,oBAAA,EAAmB,YAAY,MAAM,YACrC,UAAA,uBAAC,QAAA,EAAO,UAAU,MAAM,QACtB,SAAA,GADF,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAEA,EAAA,GAHD,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAIA,EAAA,GALD,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAMA;AAEF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectOption.cjs","sources":["../../../../../packages/react-select/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":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"SelectOption.cjs","sources":["../../../../../packages/react-select/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":";;;;;;;;AAWO,MAAM,eAAeA,MAAAA,WAA2C,CAAC,EAAE,QAAQ,GAAG,MAAA,GAAS,QAAQ;AACrG,QAAM,aAAaC,SAAAA,oBAAA;AACnB,QAAM,SAASC,aAAAA,UAAA;AACf,SACCC,8BAAAA;AAAAA,IAACC,UAAAA;AAAAA,IAAA;AAAA,MACA;AAAA,MACA,iBAAeC,UAAAA,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;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectOption.js","sources":["../../../../../packages/react-select/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":["this"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"SelectOption.js","sources":["../../../../../packages/react-select/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":["this"],"mappings":";;;;;;AAWO,MAAM,eAAe,WAA2C,CAAC,EAAE,QAAQ,GAAG,MAAA,GAAS,QAAQ;AACrG,QAAM,aAAa,oBAAA;AACnB,QAAM,SAAS,UAAA;AACf,SACC;AAAA,IAAC;AAAA,IAAA;AAAA,MACA;AAAA,MACA,iBAAe,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,IAAAA;AAAAA,EAAA;AAMF,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectPlaceholder.cjs","sources":["../../../../../packages/react-select/src/components/SelectPlaceholder.tsx"],"sourcesContent":["import React, { ReactNode } from 'react'\nimport { useSelectCurrentEntities } from '../contexts'\n\nexport const SelectPlaceholder = ({ children }: { children: ReactNode }) => {\n\tconst hasEntities = useSelectCurrentEntities().length > 0\n\treturn hasEntities ? null : <>{children}</>\n}\n"],"names":["useSelectCurrentEntities","jsxDEV","Fragment","this"],"mappings":";;;;AAGO,MAAM,oBAAoB,CAAC,EAAE,eAAwC;
|
|
1
|
+
{"version":3,"file":"SelectPlaceholder.cjs","sources":["../../../../../packages/react-select/src/components/SelectPlaceholder.tsx"],"sourcesContent":["import React, { ReactNode } from 'react'\nimport { useSelectCurrentEntities } from '../contexts'\n\nexport const SelectPlaceholder = ({ children }: { children: ReactNode }) => {\n\tconst hasEntities = useSelectCurrentEntities().length > 0\n\treturn hasEntities ? null : <>{children}</>\n}\n"],"names":["useSelectCurrentEntities","jsxDEV","Fragment","this"],"mappings":";;;;AAGO,MAAM,oBAAoB,CAAC,EAAE,eAAwC;AAC3E,QAAM,cAAcA,SAAAA,2BAA2B,SAAS;AACxD,SAAO,cAAc,OAAOC,qCAAAC,cAAAA,UAAA,EAAG,SAAA,GAAH,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAC,MAAY;AACzC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectPlaceholder.js","sources":["../../../../../packages/react-select/src/components/SelectPlaceholder.tsx"],"sourcesContent":["import React, { ReactNode } from 'react'\nimport { useSelectCurrentEntities } from '../contexts'\n\nexport const SelectPlaceholder = ({ children }: { children: ReactNode }) => {\n\tconst hasEntities = useSelectCurrentEntities().length > 0\n\treturn hasEntities ? null : <>{children}</>\n}\n"],"names":["this"],"mappings":";;AAGO,MAAM,oBAAoB,CAAC,EAAE,eAAwC;
|
|
1
|
+
{"version":3,"file":"SelectPlaceholder.js","sources":["../../../../../packages/react-select/src/components/SelectPlaceholder.tsx"],"sourcesContent":["import React, { ReactNode } from 'react'\nimport { useSelectCurrentEntities } from '../contexts'\n\nexport const SelectPlaceholder = ({ children }: { children: ReactNode }) => {\n\tconst hasEntities = useSelectCurrentEntities().length > 0\n\treturn hasEntities ? null : <>{children}</>\n}\n"],"names":["this"],"mappings":";;AAGO,MAAM,oBAAoB,CAAC,EAAE,eAAwC;AAC3E,QAAM,cAAc,2BAA2B,SAAS;AACxD,SAAO,cAAc,OAAO,uBAAA,UAAA,EAAG,SAAA,GAAH,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAAY;AACzC;"}
|