@cratis/scene.components 1.1.0 → 2.0.0
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/.storybook/main.ts +0 -6
- package/.storybook/preview.tsx +33 -8
- package/README.md +21 -11
- package/common/SceneDropdown.tsx +10 -3
- package/cratisComponentsPackage.ts +18 -14
- package/data/SceneDataTable.tsx +7 -2
- package/data/SceneObservableDataTable.tsx +5 -2
- package/dialogs/SceneCommandDialog.tsx +11 -1
- package/dialogs/SceneDialog.tsx +13 -1
- package/dist/cjs/common/SceneDropdown.js +10 -3
- package/dist/cjs/common/SceneDropdown.js.map +1 -1
- package/dist/cjs/cratisComponentsPackage.js +18 -14
- package/dist/cjs/cratisComponentsPackage.js.map +1 -1
- package/dist/cjs/data/SceneDataTable.js +6 -1
- package/dist/cjs/data/SceneDataTable.js.map +1 -1
- package/dist/cjs/data/SceneObservableDataTable.js +4 -1
- package/dist/cjs/data/SceneObservableDataTable.js.map +1 -1
- package/dist/cjs/dialogs/SceneCommandDialog.js +11 -1
- package/dist/cjs/dialogs/SceneCommandDialog.js.map +1 -1
- package/dist/cjs/dialogs/SceneDialog.js +13 -1
- package/dist/cjs/dialogs/SceneDialog.js.map +1 -1
- package/dist/cjs/forms/fields/SceneChipsField.js +6 -1
- package/dist/cjs/forms/fields/SceneChipsField.js.map +1 -1
- package/dist/cjs/forms/fields/SceneMultiSelectField.js +7 -6
- package/dist/cjs/forms/fields/SceneMultiSelectField.js.map +1 -1
- package/dist/cjs/pages/SceneDataPage.js +5 -2
- package/dist/cjs/pages/SceneDataPage.js.map +1 -1
- package/dist/esm/common/SceneDropdown.d.ts.map +1 -1
- package/dist/esm/common/SceneDropdown.js +10 -3
- package/dist/esm/common/SceneDropdown.js.map +1 -1
- package/dist/esm/cratisComponentsPackage.d.ts.map +1 -1
- package/dist/esm/cratisComponentsPackage.js +18 -14
- package/dist/esm/cratisComponentsPackage.js.map +1 -1
- package/dist/esm/data/SceneDataTable.d.ts.map +1 -1
- package/dist/esm/data/SceneDataTable.js +7 -2
- package/dist/esm/data/SceneDataTable.js.map +1 -1
- package/dist/esm/data/SceneObservableDataTable.d.ts.map +1 -1
- package/dist/esm/data/SceneObservableDataTable.js +5 -2
- package/dist/esm/data/SceneObservableDataTable.js.map +1 -1
- package/dist/esm/dialogs/SceneCommandDialog.d.ts.map +1 -1
- package/dist/esm/dialogs/SceneCommandDialog.js +11 -1
- package/dist/esm/dialogs/SceneCommandDialog.js.map +1 -1
- package/dist/esm/dialogs/SceneDialog.d.ts.map +1 -1
- package/dist/esm/dialogs/SceneDialog.js +13 -1
- package/dist/esm/dialogs/SceneDialog.js.map +1 -1
- package/dist/esm/editors/for_SceneObjectNavigationalBar/when_navigating_back_up_the_trail.js +2 -1
- package/dist/esm/editors/for_SceneObjectNavigationalBar/when_navigating_back_up_the_trail.js.map +1 -1
- package/dist/esm/for_cratisComponentsPackage/when_resolving_its_dependencies.js +5 -5
- package/dist/esm/for_cratisComponentsPackage/when_resolving_its_dependencies.js.map +1 -1
- package/dist/esm/forms/fields/SceneChipsField.d.ts.map +1 -1
- package/dist/esm/forms/fields/SceneChipsField.js +6 -1
- package/dist/esm/forms/fields/SceneChipsField.js.map +1 -1
- package/dist/esm/forms/fields/SceneMultiSelectField.d.ts.map +1 -1
- package/dist/esm/forms/fields/SceneMultiSelectField.js +8 -7
- package/dist/esm/forms/fields/SceneMultiSelectField.js.map +1 -1
- package/dist/esm/pages/SceneDataPage.d.ts.map +1 -1
- package/dist/esm/pages/SceneDataPage.js +6 -3
- package/dist/esm/pages/SceneDataPage.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/editors/for_SceneObjectNavigationalBar/when_navigating_back_up_the_trail.tsx +13 -1
- package/for_cratisComponentsPackage/when_resolving_its_dependencies.ts +16 -6
- package/forms/fields/SceneChipsField.tsx +6 -1
- package/forms/fields/SceneMultiSelectField.tsx +8 -6
- package/package.json +19 -13
- package/pages/SceneDataPage.tsx +6 -3
|
@@ -20,17 +20,29 @@ const Dialog = /*#__PURE__*/ react.lazy(async ()=>({
|
|
|
20
20
|
*
|
|
21
21
|
* `visible` defaults to `true` because a dialog placed on a screen is being placed to be seen; a host
|
|
22
22
|
* that controls visibility sets the property explicitly.
|
|
23
|
+
*
|
|
24
|
+
* `dismissable` replaces the `resizable` property this adapter used to carry, and the swap is the whole
|
|
25
|
+
* PrimeReact 11 story in miniature. `resizable` is still declared on `DialogProps` so call sites compile,
|
|
26
|
+
* but version 11's headless dialog has no resize handle and the library never reads the prop - a screen
|
|
27
|
+
* setting it got nothing. `dismissable` is the opposite: 3.0.0 added it and honors it, and it decides
|
|
28
|
+
* whether the header close button, backdrop click and `Escape` are offered at all. Leaving it unset keeps
|
|
29
|
+
* the library's own default, so a screen opts into a dismiss affordance rather than having one imposed.
|
|
30
|
+
*
|
|
31
|
+
* `closeAriaLabel` names that close button. It is separate from every other label here because it is the
|
|
32
|
+
* only one a screen reader reads and nobody sees, which is exactly why it gets forgotten - offering it
|
|
33
|
+
* next to `okLabel` and `cancelLabel` is what makes localizing a dialog a complete job.
|
|
23
34
|
*/ function SceneDialog({ element, slots }) {
|
|
24
35
|
return /*#__PURE__*/ jsxRuntime.jsx(ArcRuntimeBoundary.ArcRuntimeBoundary, {
|
|
25
36
|
children: /*#__PURE__*/ jsxRuntime.jsx(Dialog, {
|
|
26
37
|
title: properties.stringProperty(element.properties, 'title') ?? '',
|
|
27
38
|
visible: properties.booleanProperty(element.properties, 'visible') ?? true,
|
|
28
39
|
width: properties.stringProperty(element.properties, 'width'),
|
|
29
|
-
|
|
40
|
+
dismissable: properties.booleanProperty(element.properties, 'dismissable'),
|
|
30
41
|
isValid: properties.booleanProperty(element.properties, 'isValid'),
|
|
31
42
|
isBusy: properties.booleanProperty(element.properties, 'isBusy'),
|
|
32
43
|
okLabel: properties.stringProperty(element.properties, 'okLabel'),
|
|
33
44
|
cancelLabel: properties.stringProperty(element.properties, 'cancelLabel'),
|
|
45
|
+
closeAriaLabel: properties.stringProperty(element.properties, 'closeAriaLabel'),
|
|
34
46
|
className: properties.stringProperty(element.properties, 'className'),
|
|
35
47
|
children: slots.content
|
|
36
48
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneDialog.js","sources":["../../../dialogs/SceneDialog.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { lazy } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { ArcRuntimeBoundary } from '../bindings';\nimport { booleanProperty, stringProperty } from '../properties';\n\nconst Dialog = lazy(async () => ({ default: (await import('@cratis/components/Dialogs')).Dialog }));\n\n/**\n * The `Cratis.Components:dialog` component, registered under the bare name `dialog` - `Dialog` from\n * `@cratis/components/Dialogs`.\n *\n * Shadowing PrimeReact's `dialog` deliberately. PrimeReact's is a modal frame and nothing more; this one\n * resolves its result through Arc's dialog context, so a screen's dialog participates in the same\n * request/response protocol as the rest of the application - a caller awaits a `DialogResult` instead of\n * threading `visible` state and callbacks by hand.\n *\n * `visible` defaults to `true` because a dialog placed on a screen is being placed to be seen; a host\n * that controls visibility sets the property explicitly.\n */\nexport function SceneDialog({ element, slots }: RegisteredComponentProps) {\n return (\n <ArcRuntimeBoundary>\n <Dialog\n title={stringProperty(element.properties, 'title') ?? ''}\n visible={booleanProperty(element.properties, 'visible') ?? true}\n width={stringProperty(element.properties, 'width')}\n
|
|
1
|
+
{"version":3,"file":"SceneDialog.js","sources":["../../../dialogs/SceneDialog.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { lazy } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { ArcRuntimeBoundary } from '../bindings';\nimport { booleanProperty, stringProperty } from '../properties';\n\nconst Dialog = lazy(async () => ({ default: (await import('@cratis/components/Dialogs')).Dialog }));\n\n/**\n * The `Cratis.Components:dialog` component, registered under the bare name `dialog` - `Dialog` from\n * `@cratis/components/Dialogs`.\n *\n * Shadowing PrimeReact's `dialog` deliberately. PrimeReact's is a modal frame and nothing more; this one\n * resolves its result through Arc's dialog context, so a screen's dialog participates in the same\n * request/response protocol as the rest of the application - a caller awaits a `DialogResult` instead of\n * threading `visible` state and callbacks by hand.\n *\n * `visible` defaults to `true` because a dialog placed on a screen is being placed to be seen; a host\n * that controls visibility sets the property explicitly.\n *\n * `dismissable` replaces the `resizable` property this adapter used to carry, and the swap is the whole\n * PrimeReact 11 story in miniature. `resizable` is still declared on `DialogProps` so call sites compile,\n * but version 11's headless dialog has no resize handle and the library never reads the prop - a screen\n * setting it got nothing. `dismissable` is the opposite: 3.0.0 added it and honors it, and it decides\n * whether the header close button, backdrop click and `Escape` are offered at all. Leaving it unset keeps\n * the library's own default, so a screen opts into a dismiss affordance rather than having one imposed.\n *\n * `closeAriaLabel` names that close button. It is separate from every other label here because it is the\n * only one a screen reader reads and nobody sees, which is exactly why it gets forgotten - offering it\n * next to `okLabel` and `cancelLabel` is what makes localizing a dialog a complete job.\n */\nexport function SceneDialog({ element, slots }: RegisteredComponentProps) {\n return (\n <ArcRuntimeBoundary>\n <Dialog\n title={stringProperty(element.properties, 'title') ?? ''}\n visible={booleanProperty(element.properties, 'visible') ?? true}\n width={stringProperty(element.properties, 'width')}\n dismissable={booleanProperty(element.properties, 'dismissable')}\n isValid={booleanProperty(element.properties, 'isValid')}\n isBusy={booleanProperty(element.properties, 'isBusy')}\n okLabel={stringProperty(element.properties, 'okLabel')}\n cancelLabel={stringProperty(element.properties, 'cancelLabel')}\n closeAriaLabel={stringProperty(element.properties, 'closeAriaLabel')}\n className={stringProperty(element.properties, 'className')}\n >\n {slots.content}\n </Dialog>\n </ArcRuntimeBoundary>\n );\n}\n"],"names":["Dialog","lazy","default","SceneDialog","element","slots","_jsx","ArcRuntimeBoundary","title","stringProperty","properties","visible","booleanProperty","width","dismissable","isValid","isBusy","okLabel","cancelLabel","closeAriaLabel","className","content"],"mappings":";;;;;;;;AAQA,MAAMA,MAAAA,iBAASC,UAAAA,CAAK,WAAa;AAAEC,QAAAA,OAAAA,EAAS,CAAC,MAAM,OAAO,4BAAA,CAA4B,EAAGF;KAAO,CAAA,CAAA;AAEhG;;;;;;;;;;;;;;;;;;;;;;AAsBC,IACM,SAASG,WAAAA,CAAY,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;AACpE,IAAA,qBACIC,cAAA,CAACC,qCAAAA,EAAAA;AACG,QAAA,QAAA,gBAAAD,cAAA,CAACN,MAAAA,EAAAA;AACGQ,YAAAA,KAAAA,EAAOC,yBAAAA,CAAeL,OAAAA,CAAQM,UAAU,EAAE,OAAA,CAAA,IAAY,EAAA;AACtDC,YAAAA,OAAAA,EAASC,0BAAAA,CAAgBR,OAAAA,CAAQM,UAAU,EAAE,SAAA,CAAA,IAAc,IAAA;YAC3DG,KAAAA,EAAOJ,yBAAAA,CAAeL,OAAAA,CAAQM,UAAU,EAAE,OAAA,CAAA;YAC1CI,WAAAA,EAAaF,0BAAAA,CAAgBR,OAAAA,CAAQM,UAAU,EAAE,aAAA,CAAA;YACjDK,OAAAA,EAASH,0BAAAA,CAAgBR,OAAAA,CAAQM,UAAU,EAAE,SAAA,CAAA;YAC7CM,MAAAA,EAAQJ,0BAAAA,CAAgBR,OAAAA,CAAQM,UAAU,EAAE,QAAA,CAAA;YAC5CO,OAAAA,EAASR,yBAAAA,CAAeL,OAAAA,CAAQM,UAAU,EAAE,SAAA,CAAA;YAC5CQ,WAAAA,EAAaT,yBAAAA,CAAeL,OAAAA,CAAQM,UAAU,EAAE,aAAA,CAAA;YAChDS,cAAAA,EAAgBV,yBAAAA,CAAeL,OAAAA,CAAQM,UAAU,EAAE,gBAAA,CAAA;YACnDU,SAAAA,EAAWX,yBAAAA,CAAeL,OAAAA,CAAQM,UAAU,EAAE,WAAA,CAAA;AAE7CL,YAAAA,QAAAA,EAAAA,KAAAA,CAAMgB;;;AAIvB;;;;"}
|
|
@@ -14,6 +14,12 @@ const ChipsField = /*#__PURE__*/ react.lazy(async ()=>({
|
|
|
14
14
|
* A free-form list of strings - tags, labels, recipients - where the values are typed rather than picked.
|
|
15
15
|
* `multiSelectField` is the right choice whenever the values come from a known set; this one exists for
|
|
16
16
|
* when they do not.
|
|
17
|
+
*
|
|
18
|
+
* There is no `separator` property. PrimeReact 11's `InputTags` commits exactly one tag per `Enter` and
|
|
19
|
+
* no longer splits pasted text, so `@cratis/components` keeps the prop only so existing call sites
|
|
20
|
+
* compile and never reads it. A screen that wrote `separator: ','` and watched a pasted comma-separated
|
|
21
|
+
* list arrive as a single tag would have no way to tell that from a bug, which is precisely why the
|
|
22
|
+
* property is withdrawn rather than passed through.
|
|
17
23
|
*/ function SceneChipsField({ element }) {
|
|
18
24
|
return /*#__PURE__*/ jsxRuntime.jsx(CommandFormField.CommandFormField, {
|
|
19
25
|
element: element,
|
|
@@ -21,7 +27,6 @@ const ChipsField = /*#__PURE__*/ react.lazy(async ()=>({
|
|
|
21
27
|
...binding,
|
|
22
28
|
placeholder: properties.stringProperty(element.properties, 'placeholder'),
|
|
23
29
|
max: properties.numberProperty(element.properties, 'max'),
|
|
24
|
-
separator: properties.stringProperty(element.properties, 'separator'),
|
|
25
30
|
addOnBlur: properties.booleanProperty(element.properties, 'addOnBlur'),
|
|
26
31
|
allowDuplicate: properties.booleanProperty(element.properties, 'allowDuplicate'),
|
|
27
32
|
className: properties.stringProperty(element.properties, 'className')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneChipsField.js","sources":["../../../../forms/fields/SceneChipsField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { lazy } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, numberProperty, stringProperty } from '../../properties';\nimport { CommandFormField } from './CommandFormField';\n\nconst ChipsField = lazy(async () => ({ default: (await import('@cratis/components/CommandForm')).ChipsField }));\n\n/**\n * The `Cratis.Components:chipsField` component - `ChipsField` from `@cratis/components/CommandForm`.\n *\n * A free-form list of strings - tags, labels, recipients - where the values are typed rather than picked.\n * `multiSelectField` is the right choice whenever the values come from a known set; this one exists for\n * when they do not.\n */\nexport function SceneChipsField({ element }: RegisteredComponentProps) {\n return (\n <CommandFormField element={element}>\n {binding => (\n <ChipsField\n {...binding}\n placeholder={stringProperty(element.properties, 'placeholder')}\n max={numberProperty(element.properties, 'max')}\n
|
|
1
|
+
{"version":3,"file":"SceneChipsField.js","sources":["../../../../forms/fields/SceneChipsField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { lazy } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, numberProperty, stringProperty } from '../../properties';\nimport { CommandFormField } from './CommandFormField';\n\nconst ChipsField = lazy(async () => ({ default: (await import('@cratis/components/CommandForm')).ChipsField }));\n\n/**\n * The `Cratis.Components:chipsField` component - `ChipsField` from `@cratis/components/CommandForm`.\n *\n * A free-form list of strings - tags, labels, recipients - where the values are typed rather than picked.\n * `multiSelectField` is the right choice whenever the values come from a known set; this one exists for\n * when they do not.\n *\n * There is no `separator` property. PrimeReact 11's `InputTags` commits exactly one tag per `Enter` and\n * no longer splits pasted text, so `@cratis/components` keeps the prop only so existing call sites\n * compile and never reads it. A screen that wrote `separator: ','` and watched a pasted comma-separated\n * list arrive as a single tag would have no way to tell that from a bug, which is precisely why the\n * property is withdrawn rather than passed through.\n */\nexport function SceneChipsField({ element }: RegisteredComponentProps) {\n return (\n <CommandFormField element={element}>\n {binding => (\n <ChipsField\n {...binding}\n placeholder={stringProperty(element.properties, 'placeholder')}\n max={numberProperty(element.properties, 'max')}\n addOnBlur={booleanProperty(element.properties, 'addOnBlur')}\n allowDuplicate={booleanProperty(element.properties, 'allowDuplicate')}\n className={stringProperty(element.properties, 'className')}\n />\n )}\n </CommandFormField>\n );\n}\n"],"names":["ChipsField","lazy","default","SceneChipsField","element","_jsx","CommandFormField","binding","placeholder","stringProperty","properties","max","numberProperty","addOnBlur","booleanProperty","allowDuplicate","className"],"mappings":";;;;;;;AAQA,MAAMA,UAAAA,iBAAaC,UAAAA,CAAK,WAAa;AAAEC,QAAAA,OAAAA,EAAS,CAAC,MAAM,OAAO,gCAAA,CAAgC,EAAGF;KAAW,CAAA,CAAA;AAE5G;;;;;;;;;;;;AAYC,IACM,SAASG,eAAAA,CAAgB,EAAEC,OAAO,EAA4B,EAAA;AACjE,IAAA,qBACIC,cAAA,CAACC,iCAAAA,EAAAA;QAAiBF,OAAAA,EAASA,OAAAA;AACtBG,QAAAA,QAAAA,EAAAA,CAAAA,wBACGF,cAAA,CAACL,UAAAA,EAAAA;AACI,gBAAA,GAAGO,OAAO;gBACXC,WAAAA,EAAaC,yBAAAA,CAAeL,OAAAA,CAAQM,UAAU,EAAE,aAAA,CAAA;gBAChDC,GAAAA,EAAKC,yBAAAA,CAAeR,OAAAA,CAAQM,UAAU,EAAE,KAAA,CAAA;gBACxCG,SAAAA,EAAWC,0BAAAA,CAAgBV,OAAAA,CAAQM,UAAU,EAAE,WAAA,CAAA;gBAC/CK,cAAAA,EAAgBD,0BAAAA,CAAgBV,OAAAA,CAAQM,UAAU,EAAE,gBAAA,CAAA;gBACpDM,SAAAA,EAAWP,yBAAAA,CAAeL,OAAAA,CAAQM,UAAU,EAAE,WAAA;;;AAKlE;;;;"}
|
|
@@ -8,16 +8,19 @@ var CommandFormField = require('./CommandFormField.js');
|
|
|
8
8
|
const MultiSelectField = /*#__PURE__*/ react.lazy(async ()=>({
|
|
9
9
|
default: (await import('@cratis/components/CommandForm')).MultiSelectField
|
|
10
10
|
}));
|
|
11
|
-
/** How the current selection is summarized in the closed control. */ const displayModes = [
|
|
12
|
-
'comma',
|
|
13
|
-
'chip'
|
|
14
|
-
];
|
|
15
11
|
/**
|
|
16
12
|
* The `Cratis.Components:multiSelectField` component - `MultiSelectField` from
|
|
17
13
|
* `@cratis/components/CommandForm`.
|
|
18
14
|
*
|
|
19
15
|
* The many-valued counterpart to `dropdownField`, binding to a collection property on the command rather
|
|
20
16
|
* than a scalar one.
|
|
17
|
+
*
|
|
18
|
+
* The `display` and `maxSelectedLabels` properties this adapter used to expose are gone. In
|
|
19
|
+
* `@cratis/components` 3.0.0 the field is re-expressed over the library's own `Dropdown` in multiple
|
|
20
|
+
* mode, because PrimeReact 11's `Select` has no `multiple` prop of the version 10 shape and renders the
|
|
21
|
+
* selection through its own value slot - so there is no comma mode, no chip mode, and no label-collapse
|
|
22
|
+
* threshold left to choose between. Both props are still declared upstream so call sites compile, and
|
|
23
|
+
* neither is read. Passing them on would have let a screen state a preference the control cannot honor.
|
|
21
24
|
*/ function SceneMultiSelectField({ element }) {
|
|
22
25
|
return /*#__PURE__*/ jsxRuntime.jsx(CommandFormField.CommandFormField, {
|
|
23
26
|
element: element,
|
|
@@ -27,8 +30,6 @@ const MultiSelectField = /*#__PURE__*/ react.lazy(async ()=>({
|
|
|
27
30
|
optionLabel: properties.stringProperty(element.properties, 'optionLabel') ?? 'label',
|
|
28
31
|
optionValue: properties.stringProperty(element.properties, 'optionValue') ?? 'value',
|
|
29
32
|
placeholder: properties.stringProperty(element.properties, 'placeholder'),
|
|
30
|
-
display: properties.unionProperty(element.properties, 'display', displayModes),
|
|
31
|
-
maxSelectedLabels: properties.numberProperty(element.properties, 'maxSelectedLabels'),
|
|
32
33
|
filter: properties.booleanProperty(element.properties, 'filter'),
|
|
33
34
|
showClear: properties.booleanProperty(element.properties, 'showClear'),
|
|
34
35
|
className: properties.stringProperty(element.properties, 'className')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneMultiSelectField.js","sources":["../../../../forms/fields/SceneMultiSelectField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { lazy } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty,
|
|
1
|
+
{"version":3,"file":"SceneMultiSelectField.js","sources":["../../../../forms/fields/SceneMultiSelectField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { lazy } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, objectArrayProperty, stringProperty } from '../../properties';\nimport { CommandFormField } from './CommandFormField';\n\nconst MultiSelectField = lazy(async () => ({ default: (await import('@cratis/components/CommandForm')).MultiSelectField }));\n\n/**\n * The `Cratis.Components:multiSelectField` component - `MultiSelectField` from\n * `@cratis/components/CommandForm`.\n *\n * The many-valued counterpart to `dropdownField`, binding to a collection property on the command rather\n * than a scalar one.\n *\n * The `display` and `maxSelectedLabels` properties this adapter used to expose are gone. In\n * `@cratis/components` 3.0.0 the field is re-expressed over the library's own `Dropdown` in multiple\n * mode, because PrimeReact 11's `Select` has no `multiple` prop of the version 10 shape and renders the\n * selection through its own value slot - so there is no comma mode, no chip mode, and no label-collapse\n * threshold left to choose between. Both props are still declared upstream so call sites compile, and\n * neither is read. Passing them on would have let a screen state a preference the control cannot honor.\n */\nexport function SceneMultiSelectField({ element }: RegisteredComponentProps) {\n return (\n <CommandFormField element={element}>\n {binding => (\n <MultiSelectField\n {...binding}\n options={objectArrayProperty(element.properties, 'options') ?? []}\n optionLabel={stringProperty(element.properties, 'optionLabel') ?? 'label'}\n optionValue={stringProperty(element.properties, 'optionValue') ?? 'value'}\n placeholder={stringProperty(element.properties, 'placeholder')}\n filter={booleanProperty(element.properties, 'filter')}\n showClear={booleanProperty(element.properties, 'showClear')}\n className={stringProperty(element.properties, 'className')}\n />\n )}\n </CommandFormField>\n );\n}\n"],"names":["MultiSelectField","lazy","default","SceneMultiSelectField","element","_jsx","CommandFormField","binding","options","objectArrayProperty","properties","optionLabel","stringProperty","optionValue","placeholder","filter","booleanProperty","showClear","className"],"mappings":";;;;;;;AAQA,MAAMA,gBAAAA,iBAAmBC,UAAAA,CAAK,WAAa;AAAEC,QAAAA,OAAAA,EAAS,CAAC,MAAM,OAAO,gCAAA,CAAgC,EAAGF;KAAiB,CAAA,CAAA;AAExH;;;;;;;;;;;;;AAaC,IACM,SAASG,qBAAAA,CAAsB,EAAEC,OAAO,EAA4B,EAAA;AACvE,IAAA,qBACIC,cAAA,CAACC,iCAAAA,EAAAA;QAAiBF,OAAAA,EAASA,OAAAA;AACtBG,QAAAA,QAAAA,EAAAA,CAAAA,wBACGF,cAAA,CAACL,gBAAAA,EAAAA;AACI,gBAAA,GAAGO,OAAO;AACXC,gBAAAA,OAAAA,EAASC,8BAAAA,CAAoBL,OAAAA,CAAQM,UAAU,EAAE,cAAc,EAAE;AACjEC,gBAAAA,WAAAA,EAAaC,yBAAAA,CAAeR,OAAAA,CAAQM,UAAU,EAAE,aAAA,CAAA,IAAkB,OAAA;AAClEG,gBAAAA,WAAAA,EAAaD,yBAAAA,CAAeR,OAAAA,CAAQM,UAAU,EAAE,aAAA,CAAA,IAAkB,OAAA;gBAClEI,WAAAA,EAAaF,yBAAAA,CAAeR,OAAAA,CAAQM,UAAU,EAAE,aAAA,CAAA;gBAChDK,MAAAA,EAAQC,0BAAAA,CAAgBZ,OAAAA,CAAQM,UAAU,EAAE,QAAA,CAAA;gBAC5CO,SAAAA,EAAWD,0BAAAA,CAAgBZ,OAAAA,CAAQM,UAAU,EAAE,WAAA,CAAA;gBAC/CQ,SAAAA,EAAWN,yBAAAA,CAAeR,OAAAA,CAAQM,UAAU,EAAE,WAAA;;;AAKlE;;;;"}
|
|
@@ -14,13 +14,17 @@ const DataPage = /*#__PURE__*/ react.lazy(async ()=>({
|
|
|
14
14
|
/**
|
|
15
15
|
* The `Cratis.Components:dataPage` component - `DataPage` from `@cratis/components/DataPage`.
|
|
16
16
|
*
|
|
17
|
-
* The library's whole list-screen composite in one name: title bar,
|
|
17
|
+
* The library's whole list-screen composite in one name: title bar, action toolbar, filterable table and
|
|
18
18
|
* optional details pane, all driven from a single query. It is the single highest-leverage thing this
|
|
19
19
|
* package exposes, because reproducing it out of `table` and `toolbar` in a screen would be pages of
|
|
20
20
|
* modeling for a worse result.
|
|
21
21
|
*
|
|
22
22
|
* The `query` property names an Arc query proxy; the columns and menu items come from the `content`
|
|
23
23
|
* slot as `DataPage.Columns` / `DataPage.MenuItems` children.
|
|
24
|
+
*
|
|
25
|
+
* No `clientFiltering` property, for the same reason `dataTable` no longer exposes one: 3.0.0 keeps the
|
|
26
|
+
* prop so call sites compile but never reads it, and a screen setting that cannot take effect is a worse
|
|
27
|
+
* thing to offer than nothing.
|
|
24
28
|
*/ function SceneDataPage({ element, slots }) {
|
|
25
29
|
const { name, target } = resolveElementBinding.resolveElementBinding(element, BindingKind.BindingKind.Query);
|
|
26
30
|
if (!target) return /*#__PURE__*/ jsxRuntime.jsx(MissingBinding.MissingBinding, {
|
|
@@ -35,7 +39,6 @@ const DataPage = /*#__PURE__*/ react.lazy(async ()=>({
|
|
|
35
39
|
emptyMessage: properties.stringProperty(element.properties, 'emptyMessage') ?? '',
|
|
36
40
|
dataKey: properties.stringProperty(element.properties, 'dataKey'),
|
|
37
41
|
globalFilterFields: properties.stringArrayProperty(element.properties, 'globalFilterFields'),
|
|
38
|
-
clientFiltering: properties.booleanProperty(element.properties, 'clientFiltering'),
|
|
39
42
|
children: slots.content
|
|
40
43
|
})
|
|
41
44
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneDataPage.js","sources":["../../../pages/SceneDataPage.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { lazy } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { ArcRuntimeBoundary, BindingKind, MissingBinding, resolveElementBinding } from '../bindings';\nimport {
|
|
1
|
+
{"version":3,"file":"SceneDataPage.js","sources":["../../../pages/SceneDataPage.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { lazy } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { ArcRuntimeBoundary, BindingKind, MissingBinding, resolveElementBinding } from '../bindings';\nimport { stringArrayProperty, stringProperty } from '../properties';\n\nconst DataPage = lazy(async () => ({ default: (await import('@cratis/components/DataPage')).DataPage }));\n\n/**\n * The `Cratis.Components:dataPage` component - `DataPage` from `@cratis/components/DataPage`.\n *\n * The library's whole list-screen composite in one name: title bar, action toolbar, filterable table and\n * optional details pane, all driven from a single query. It is the single highest-leverage thing this\n * package exposes, because reproducing it out of `table` and `toolbar` in a screen would be pages of\n * modeling for a worse result.\n *\n * The `query` property names an Arc query proxy; the columns and menu items come from the `content`\n * slot as `DataPage.Columns` / `DataPage.MenuItems` children.\n *\n * No `clientFiltering` property, for the same reason `dataTable` no longer exposes one: 3.0.0 keeps the\n * prop so call sites compile but never reads it, and a screen setting that cannot take effect is a worse\n * thing to offer than nothing.\n */\nexport function SceneDataPage({ element, slots }: RegisteredComponentProps) {\n const { name, target } = resolveElementBinding(element, BindingKind.Query);\n if (!target) return <MissingBinding element={element} kind={BindingKind.Query} name={name} />;\n\n return (\n <ArcRuntimeBoundary>\n <DataPage\n title={stringProperty(element.properties, 'title') ?? ''}\n query={target}\n emptyMessage={stringProperty(element.properties, 'emptyMessage') ?? ''}\n dataKey={stringProperty(element.properties, 'dataKey')}\n globalFilterFields={stringArrayProperty(element.properties, 'globalFilterFields')}\n >\n {slots.content}\n </DataPage>\n </ArcRuntimeBoundary>\n );\n}\n"],"names":["DataPage","lazy","default","SceneDataPage","element","slots","name","target","resolveElementBinding","BindingKind","Query","_jsx","MissingBinding","kind","ArcRuntimeBoundary","title","stringProperty","properties","query","emptyMessage","dataKey","globalFilterFields","stringArrayProperty","content"],"mappings":";;;;;;;;;;AAQA,MAAMA,QAAAA,iBAAWC,UAAAA,CAAK,WAAa;AAAEC,QAAAA,OAAAA,EAAS,CAAC,MAAM,OAAO,6BAAA,CAA6B,EAAGF;KAAS,CAAA,CAAA;AAErG;;;;;;;;;;;;;;AAcC,IACM,SAASG,aAAAA,CAAc,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;IACtE,MAAM,EAAEC,IAAI,EAAEC,MAAM,EAAE,GAAGC,2CAAAA,CAAsBJ,OAAAA,EAASK,uBAAAA,CAAYC,KAAK,CAAA;IACzE,IAAI,CAACH,MAAAA,EAAQ,qBAAOI,cAAA,CAACC,6BAAAA,EAAAA;QAAeR,OAAAA,EAASA,OAAAA;AAASS,QAAAA,IAAAA,EAAMJ,wBAAYC,KAAK;QAAEJ,IAAAA,EAAMA;;AAErF,IAAA,qBACIK,cAAA,CAACG,qCAAAA,EAAAA;AACG,QAAA,QAAA,gBAAAH,cAAA,CAACX,QAAAA,EAAAA;AACGe,YAAAA,KAAAA,EAAOC,yBAAAA,CAAeZ,OAAAA,CAAQa,UAAU,EAAE,OAAA,CAAA,IAAY,EAAA;YACtDC,KAAAA,EAAOX,MAAAA;AACPY,YAAAA,YAAAA,EAAcH,yBAAAA,CAAeZ,OAAAA,CAAQa,UAAU,EAAE,cAAA,CAAA,IAAmB,EAAA;YACpEG,OAAAA,EAASJ,yBAAAA,CAAeZ,OAAAA,CAAQa,UAAU,EAAE,SAAA,CAAA;YAC5CI,kBAAAA,EAAoBC,8BAAAA,CAAoBlB,OAAAA,CAAQa,UAAU,EAAE,oBAAA,CAAA;AAE3DZ,YAAAA,QAAAA,EAAAA,KAAAA,CAAMkB;;;AAIvB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneDropdown.d.ts","sourceRoot":"","sources":["../../../common/SceneDropdown.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"SceneDropdown.d.ts","sourceRoot":"","sources":["../../../common/SceneDropdown.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAoB/D,wBAAgB,aAAa,CAAC,EAAE,OAAO,EAAE,EAAE,wBAAwB,+BAalE"}
|
|
@@ -5,9 +5,16 @@ import { stringProperty, booleanProperty, objectArrayProperty } from '../propert
|
|
|
5
5
|
/**
|
|
6
6
|
* The `Cratis.Components:dropdown` component - `Dropdown` from `@cratis/components/Dropdown`.
|
|
7
7
|
*
|
|
8
|
-
* The library's own `Dropdown` rather than PrimeReact's
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* The library's own `Dropdown` rather than PrimeReact's `Select`, and the reason changed with PrimeReact
|
|
9
|
+
* 11. It used to be the overlay z-index fix: a version 10 dropdown panel opened inside a dialog rendered
|
|
10
|
+
* within the dialog's own subtree and could land under its mask, so the library appended every overlay to
|
|
11
|
+
* the document body and handed out z-indexes itself. Version 11 does both natively - the select panel
|
|
12
|
+
* portals to the body and the shared z-index registry puts a later overlay above whatever is already
|
|
13
|
+
* open - and `@cratis/components` 3.0.0 accordingly deleted that workaround. What the wrapper is worth
|
|
14
|
+
* now is its curated surface: a single/multi select expressed in `options` / `optionLabel` /
|
|
15
|
+
* `optionValue` terms, where version 11's `Select` is compositional (`Select.Root`, `.Trigger`,
|
|
16
|
+
* `.Portal`, `.Popup`, `.List`, `.Option`) and would have to be assembled here, in an adapter whose whole
|
|
17
|
+
* input is a property bag.
|
|
11
18
|
*
|
|
12
19
|
* This is the standalone dropdown, not the command-form one: it takes its options from the screen and is
|
|
13
20
|
* not bound to a command property. Use `dropdownField` inside a `commandForm`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneDropdown.js","sources":["../../../common/SceneDropdown.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Dropdown } from '@cratis/components/Dropdown';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, objectArrayProperty, stringProperty } from '../properties';\n\n/**\n * The `Cratis.Components:dropdown` component - `Dropdown` from `@cratis/components/Dropdown`.\n *\n * The library's own `Dropdown` rather than PrimeReact's
|
|
1
|
+
{"version":3,"file":"SceneDropdown.js","sources":["../../../common/SceneDropdown.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Dropdown } from '@cratis/components/Dropdown';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, objectArrayProperty, stringProperty } from '../properties';\n\n/**\n * The `Cratis.Components:dropdown` component - `Dropdown` from `@cratis/components/Dropdown`.\n *\n * The library's own `Dropdown` rather than PrimeReact's `Select`, and the reason changed with PrimeReact\n * 11. It used to be the overlay z-index fix: a version 10 dropdown panel opened inside a dialog rendered\n * within the dialog's own subtree and could land under its mask, so the library appended every overlay to\n * the document body and handed out z-indexes itself. Version 11 does both natively - the select panel\n * portals to the body and the shared z-index registry puts a later overlay above whatever is already\n * open - and `@cratis/components` 3.0.0 accordingly deleted that workaround. What the wrapper is worth\n * now is its curated surface: a single/multi select expressed in `options` / `optionLabel` /\n * `optionValue` terms, where version 11's `Select` is compositional (`Select.Root`, `.Trigger`,\n * `.Portal`, `.Popup`, `.List`, `.Option`) and would have to be assembled here, in an adapter whose whole\n * input is a property bag.\n *\n * This is the standalone dropdown, not the command-form one: it takes its options from the screen and is\n * not bound to a command property. Use `dropdownField` inside a `commandForm`.\n */\nexport function SceneDropdown({ element }: RegisteredComponentProps) {\n return (\n <Dropdown\n options={objectArrayProperty(element.properties, 'options') ?? []}\n optionLabel={stringProperty(element.properties, 'optionLabel') ?? 'label'}\n optionValue={stringProperty(element.properties, 'optionValue') ?? 'value'}\n placeholder={stringProperty(element.properties, 'placeholder')}\n disabled={booleanProperty(element.properties, 'disabled')}\n showClear={booleanProperty(element.properties, 'showClear')}\n filter={booleanProperty(element.properties, 'filter')}\n className={stringProperty(element.properties, 'className')}\n />\n );\n}\n"],"names":["SceneDropdown","element","_jsx","Dropdown","options","objectArrayProperty","properties","optionLabel","stringProperty","optionValue","placeholder","disabled","booleanProperty","showClear","filter","className"],"mappings":";;;;AAOA;;;;;;;;;;;;;;;;AAgBC,IACM,SAASA,aAAAA,CAAc,EAAEC,OAAO,EAA4B,EAAA;AAC/D,IAAA,qBACIC,GAAA,CAACC,QAAAA,EAAAA;AACGC,QAAAA,OAAAA,EAASC,mBAAAA,CAAoBJ,OAAAA,CAAQK,UAAU,EAAE,cAAc,EAAE;AACjEC,QAAAA,WAAAA,EAAaC,cAAAA,CAAeP,OAAAA,CAAQK,UAAU,EAAE,aAAA,CAAA,IAAkB,OAAA;AAClEG,QAAAA,WAAAA,EAAaD,cAAAA,CAAeP,OAAAA,CAAQK,UAAU,EAAE,aAAA,CAAA,IAAkB,OAAA;QAClEI,WAAAA,EAAaF,cAAAA,CAAeP,OAAAA,CAAQK,UAAU,EAAE,aAAA,CAAA;QAChDK,QAAAA,EAAUC,eAAAA,CAAgBX,OAAAA,CAAQK,UAAU,EAAE,UAAA,CAAA;QAC9CO,SAAAA,EAAWD,eAAAA,CAAgBX,OAAAA,CAAQK,UAAU,EAAE,WAAA,CAAA;QAC/CQ,MAAAA,EAAQF,eAAAA,CAAgBX,OAAAA,CAAQK,UAAU,EAAE,QAAA,CAAA;QAC5CS,SAAAA,EAAWP,cAAAA,CAAeP,OAAAA,CAAQK,UAAU,EAAE,WAAA;;AAG1D;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cratisComponentsPackage.d.ts","sourceRoot":"","sources":["../../cratisComponentsPackage.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"cratisComponentsPackage.d.ts","sourceRoot":"","sources":["../../cratisComponentsPackage.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAsBzD,eAAO,MAAM,+BAA+B,EAAE,YAkE7C,CAAC;AASF,eAAO,MAAM,uBAAuB,EAAE,kBAGrC,CAAC"}
|
|
@@ -7,24 +7,28 @@ import { cratisComponents, cratisComponentsPackageName } from './cratisComponent
|
|
|
7
7
|
* The `Cratis.Components` package's declaration - what a profile gets when it lists this package.
|
|
8
8
|
*
|
|
9
9
|
* This is the concrete case the whole package-dependency mechanism exists for. `@cratis/components` is
|
|
10
|
-
* not a self-contained library: every component in it is a wrapper over a PrimeReact widget, and its
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* Tailwind and everything renders unstyled. Both are stated as
|
|
14
|
-
* so while the profile is being configured, instead of leaving
|
|
10
|
+
* not a self-contained library: every component in it is a wrapper over a PrimeReact widget, and its own
|
|
11
|
+
* styling is a `--cratis-*` token layer (`@cratis/components/tokens`) plus the component stylesheets and
|
|
12
|
+
* compiled Tailwind utilities in `@cratis/components/styles`. Activate it in a profile without PrimeReact
|
|
13
|
+
* and nothing renders; activate it without Tailwind and everything renders unstyled. Both are stated as
|
|
14
|
+
* dependencies so a package picker can say so while the profile is being configured, instead of leaving
|
|
15
|
+
* it to be discovered when the page opens.
|
|
15
16
|
*
|
|
16
|
-
* The version ranges are the real ones the library carries
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* The version ranges are the real ones the library carries. `>=11.0.0` for PrimeReact: version 3.0.0
|
|
18
|
+
* declares `primereact@^11` as a peer dependency and is built against version 11's component set, so the
|
|
19
|
+
* span across the major boundary that the previous `>=10.9.0` range described is over. The `--cratis-*`
|
|
20
|
+
* tokens still resolve a version 10 theme variable as their last fallback, but that is an upgrade-window
|
|
21
|
+
* courtesy for an application with a compiled version 10 stylesheet still on the page - not a version of
|
|
22
|
+
* PrimeReact this package can be activated against. `^4.0.0` for Tailwind, because the utility sheet is
|
|
23
|
+
* compiled against Tailwind 4.
|
|
20
24
|
*/ const cratisComponentsPackageManifest = {
|
|
21
25
|
name: cratisComponentsPackageName,
|
|
22
|
-
version: '
|
|
26
|
+
version: '3.0.0',
|
|
23
27
|
kind: PackageKind.ComponentLibrary,
|
|
24
28
|
dependencies: [
|
|
25
29
|
{
|
|
26
30
|
name: 'PrimeReact',
|
|
27
|
-
versionRange: '>=
|
|
31
|
+
versionRange: '>=11.0.0'
|
|
28
32
|
},
|
|
29
33
|
{
|
|
30
34
|
name: 'Tailwind',
|
|
@@ -79,9 +83,9 @@ import { cratisComponents, cratisComponentsPackageName } from './cratisComponent
|
|
|
79
83
|
screenTemplates: [],
|
|
80
84
|
dialogTemplates: [],
|
|
81
85
|
// No themes either, for a different reason: `@cratis/components` has no palette of its own. It reads
|
|
82
|
-
// a `--cratis-*` variable layer that resolves whatever
|
|
83
|
-
//
|
|
84
|
-
// asserting a look it was specifically built not to have.
|
|
86
|
+
// a `--cratis-*` variable layer that resolves whatever is in front of it - the `--p-*` properties a
|
|
87
|
+
// PrimeReact 11 preset emits at runtime, or a Scene theme through this package's token bridge.
|
|
88
|
+
// Shipping a theme here would be this library asserting a look it was specifically built not to have.
|
|
85
89
|
themes: [],
|
|
86
90
|
displayName: 'Cratis Components',
|
|
87
91
|
description: "Cratis' Arc-bound data, form and dialog composites, built on PrimeReact and Tailwind.",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cratisComponentsPackage.js","sources":["../../cratisComponentsPackage.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { PackageKind, ScenePackage } from '@cratis/scene.model';\nimport { ScenePackageBundle } from '@cratis/scene.react';\nimport { cratisComponents, cratisComponentsPackageName } from './cratisComponents';\n\n/**\n * The `Cratis.Components` package's declaration - what a profile gets when it lists this package.\n *\n * This is the concrete case the whole package-dependency mechanism exists for. `@cratis/components` is\n * not a self-contained library: every component in it is a wrapper over a PrimeReact widget, and its\n *
|
|
1
|
+
{"version":3,"file":"cratisComponentsPackage.js","sources":["../../cratisComponentsPackage.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { PackageKind, ScenePackage } from '@cratis/scene.model';\nimport { ScenePackageBundle } from '@cratis/scene.react';\nimport { cratisComponents, cratisComponentsPackageName } from './cratisComponents';\n\n/**\n * The `Cratis.Components` package's declaration - what a profile gets when it lists this package.\n *\n * This is the concrete case the whole package-dependency mechanism exists for. `@cratis/components` is\n * not a self-contained library: every component in it is a wrapper over a PrimeReact widget, and its own\n * styling is a `--cratis-*` token layer (`@cratis/components/tokens`) plus the component stylesheets and\n * compiled Tailwind utilities in `@cratis/components/styles`. Activate it in a profile without PrimeReact\n * and nothing renders; activate it without Tailwind and everything renders unstyled. Both are stated as\n * dependencies so a package picker can say so while the profile is being configured, instead of leaving\n * it to be discovered when the page opens.\n *\n * The version ranges are the real ones the library carries. `>=11.0.0` for PrimeReact: version 3.0.0\n * declares `primereact@^11` as a peer dependency and is built against version 11's component set, so the\n * span across the major boundary that the previous `>=10.9.0` range described is over. The `--cratis-*`\n * tokens still resolve a version 10 theme variable as their last fallback, but that is an upgrade-window\n * courtesy for an application with a compiled version 10 stylesheet still on the page - not a version of\n * PrimeReact this package can be activated against. `^4.0.0` for Tailwind, because the utility sheet is\n * compiled against Tailwind 4.\n */\nexport const cratisComponentsPackageManifest: ScenePackage = {\n name: cratisComponentsPackageName,\n version: '3.0.0',\n kind: PackageKind.ComponentLibrary,\n dependencies: [\n { name: 'PrimeReact', versionRange: '>=11.0.0' },\n { name: 'Tailwind', versionRange: '^4.0.0' },\n ],\n components: [\n 'page',\n 'dataPage',\n 'formElement',\n 'dataTable',\n 'table',\n 'observableDataTable',\n 'commandForm',\n 'inputTextField',\n 'numberField',\n 'checkboxField',\n 'textAreaField',\n 'dropdownField',\n 'sliderField',\n 'calendarField',\n 'colorPickerField',\n 'multiSelectField',\n 'chipsField',\n 'radioButtonField',\n 'radioGroupField',\n 'dialog',\n 'confirmationDialog',\n 'busyIndicatorDialog',\n 'commandDialog',\n 'stepperCommandDialog',\n 'icon',\n 'tooltip',\n 'dropdown',\n 'errorBoundary',\n 'objectContentEditor',\n 'objectNavigationalBar',\n 'schemaEditor',\n 'timeMachine',\n 'filterPanel',\n 'toolbar',\n 'toolbarButton',\n 'toolbarGroup',\n 'toolbarSeparator',\n ],\n\n // A component library ships components, and nothing else. Layouts, screen templates and dialog\n // templates all belong to a Blueprint: they are decisions about what an application looks like as a\n // whole, and this package deliberately makes none of them - it provides the Arc-bound composites a\n // template is *built from*, so that a blueprint can place a `dataPage` in a slot and configure it,\n // rather than shipping one opinionated data page nobody can rearrange.\n layouts: [],\n screenTemplates: [],\n dialogTemplates: [],\n\n // No themes either, for a different reason: `@cratis/components` has no palette of its own. It reads\n // a `--cratis-*` variable layer that resolves whatever is in front of it - the `--p-*` properties a\n // PrimeReact 11 preset emits at runtime, or a Scene theme through this package's token bridge.\n // Shipping a theme here would be this library asserting a look it was specifically built not to have.\n themes: [],\n\n displayName: 'Cratis Components',\n description: \"Cratis' Arc-bound data, form and dialog composites, built on PrimeReact and Tailwind.\",\n module: '@cratis/scene.components',\n};\n\n/**\n * The `Cratis.Components` package as a loadable bundle - the manifest above, plus the React components\n * behind the names it declares.\n *\n * No `layouts`, `screenTemplates`, `dialogTemplates` or `themes` are provided, matching a manifest that\n * declares none of them; `validatePackageBundle` is what proves the two halves agree.\n */\nexport const cratisComponentsPackage: ScenePackageBundle = {\n manifest: cratisComponentsPackageManifest,\n components: cratisComponents,\n};\n"],"names":["cratisComponentsPackageManifest","name","cratisComponentsPackageName","version","kind","PackageKind","ComponentLibrary","dependencies","versionRange","components","layouts","screenTemplates","dialogTemplates","themes","displayName","description","module","cratisComponentsPackage","manifest","cratisComponents"],"mappings":";;;AAAA;AACA;AAMA;;;;;;;;;;;;;;;;;;UAmBaA,+BAAAA,GAAgD;IACzDC,IAAAA,EAAMC,2BAAAA;IACNC,OAAAA,EAAS,OAAA;AACTC,IAAAA,IAAAA,EAAMC,YAAYC,gBAAgB;IAClCC,YAAAA,EAAc;AACV,QAAA;YAAEN,IAAAA,EAAM,YAAA;YAAcO,YAAAA,EAAc;AAAW,SAAA;AAC/C,QAAA;YAAEP,IAAAA,EAAM,UAAA;YAAYO,YAAAA,EAAc;AAAS;AAC9C,KAAA;IACDC,UAAAA,EAAY;AACR,QAAA,MAAA;AACA,QAAA,UAAA;AACA,QAAA,aAAA;AACA,QAAA,WAAA;AACA,QAAA,OAAA;AACA,QAAA,qBAAA;AACA,QAAA,aAAA;AACA,QAAA,gBAAA;AACA,QAAA,aAAA;AACA,QAAA,eAAA;AACA,QAAA,eAAA;AACA,QAAA,eAAA;AACA,QAAA,aAAA;AACA,QAAA,eAAA;AACA,QAAA,kBAAA;AACA,QAAA,kBAAA;AACA,QAAA,YAAA;AACA,QAAA,kBAAA;AACA,QAAA,iBAAA;AACA,QAAA,QAAA;AACA,QAAA,oBAAA;AACA,QAAA,qBAAA;AACA,QAAA,eAAA;AACA,QAAA,sBAAA;AACA,QAAA,MAAA;AACA,QAAA,SAAA;AACA,QAAA,UAAA;AACA,QAAA,eAAA;AACA,QAAA,qBAAA;AACA,QAAA,uBAAA;AACA,QAAA,cAAA;AACA,QAAA,aAAA;AACA,QAAA,aAAA;AACA,QAAA,SAAA;AACA,QAAA,eAAA;AACA,QAAA,cAAA;AACA,QAAA;AACH,KAAA;;;;;;AAODC,IAAAA,OAAAA,EAAS,EAAE;AACXC,IAAAA,eAAAA,EAAiB,EAAE;AACnBC,IAAAA,eAAAA,EAAiB,EAAE;;;;;AAMnBC,IAAAA,MAAAA,EAAQ,EAAE;IAEVC,WAAAA,EAAa,mBAAA;IACbC,WAAAA,EAAa,uFAAA;IACbC,MAAAA,EAAQ;AACZ;AAEA;;;;;;UAOaC,uBAAAA,GAA8C;IACvDC,QAAAA,EAAUlB,+BAAAA;IACVS,UAAAA,EAAYU;AAChB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneDataTable.d.ts","sourceRoot":"","sources":["../../../data/SceneDataTable.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"SceneDataTable.d.ts","sourceRoot":"","sources":["../../../data/SceneDataTable.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAwB/D,wBAAgB,cAAc,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,wBAAwB,+BAiB1E"}
|
|
@@ -4,7 +4,7 @@ import { BindingKind } from '../bindings/BindingKind.js';
|
|
|
4
4
|
import { resolveElementBinding } from '../bindings/resolveElementBinding.js';
|
|
5
5
|
import { MissingBinding } from '../bindings/MissingBinding.js';
|
|
6
6
|
import { ArcRuntimeBoundary } from '../bindings/ArcRuntimeBoundary.js';
|
|
7
|
-
import { stringProperty,
|
|
7
|
+
import { stringProperty, stringArrayProperty } from '../properties.js';
|
|
8
8
|
|
|
9
9
|
const DataTableForQuery = /*#__PURE__*/ lazy(async ()=>({
|
|
10
10
|
default: (await import('@cratis/components/DataTables')).DataTableForQuery
|
|
@@ -20,6 +20,12 @@ const DataTableForQuery = /*#__PURE__*/ lazy(async ()=>({
|
|
|
20
20
|
* back into it, where PrimeReact's `DataTable` is handed rows and knows nothing about where they came from.
|
|
21
21
|
*
|
|
22
22
|
* The `query` property names an Arc query proxy; the columns come from the `content` slot.
|
|
23
|
+
*
|
|
24
|
+
* There is deliberately no `clientFiltering` property. `@cratis/components` 3.0.0 still accepts the prop
|
|
25
|
+
* so existing call sites compile, but it no longer does anything - filtering is always applied to the
|
|
26
|
+
* loaded page. Exposing a screen property that reads as a choice and silently is not would be worse than
|
|
27
|
+
* not offering it, so a screen that set it now gets a property-not-recognized signal rather than a
|
|
28
|
+
* setting that quietly stopped mattering.
|
|
23
29
|
*/ function SceneDataTable({ element, slots }) {
|
|
24
30
|
const { name, target } = resolveElementBinding(element, BindingKind.Query);
|
|
25
31
|
if (!target) return /*#__PURE__*/ jsx(MissingBinding, {
|
|
@@ -33,7 +39,6 @@ const DataTableForQuery = /*#__PURE__*/ lazy(async ()=>({
|
|
|
33
39
|
emptyMessage: stringProperty(element.properties, 'emptyMessage') ?? '',
|
|
34
40
|
dataKey: stringProperty(element.properties, 'dataKey'),
|
|
35
41
|
globalFilterFields: stringArrayProperty(element.properties, 'globalFilterFields'),
|
|
36
|
-
clientFiltering: booleanProperty(element.properties, 'clientFiltering'),
|
|
37
42
|
className: stringProperty(element.properties, 'className'),
|
|
38
43
|
children: slots.content
|
|
39
44
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneDataTable.js","sources":["../../../data/SceneDataTable.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { lazy } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { ArcRuntimeBoundary, BindingKind, MissingBinding, resolveElementBinding } from '../bindings';\nimport {
|
|
1
|
+
{"version":3,"file":"SceneDataTable.js","sources":["../../../data/SceneDataTable.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { lazy } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { ArcRuntimeBoundary, BindingKind, MissingBinding, resolveElementBinding } from '../bindings';\nimport { stringArrayProperty, stringProperty } from '../properties';\n\nconst DataTableForQuery = lazy(async () => ({ default: (await import('@cratis/components/DataTables')).DataTableForQuery }));\n\n/**\n * The `Cratis.Components:dataTable` component, also registered as `table` - `DataTableForQuery` from\n * `@cratis/components/DataTables`.\n *\n * Registering it under the bare name `table` as well is override priority working as designed: a profile\n * listing `core`, `PrimeReact` and `Cratis.Components` in that order resolves `table` here and records\n * the other two as shadowed. That is the right outcome, because this is a strictly better `table` for a\n * Cratis application - it performs the query, pages against the server, and wires filtering and sorting\n * back into it, where PrimeReact's `DataTable` is handed rows and knows nothing about where they came from.\n *\n * The `query` property names an Arc query proxy; the columns come from the `content` slot.\n *\n * There is deliberately no `clientFiltering` property. `@cratis/components` 3.0.0 still accepts the prop\n * so existing call sites compile, but it no longer does anything - filtering is always applied to the\n * loaded page. Exposing a screen property that reads as a choice and silently is not would be worse than\n * not offering it, so a screen that set it now gets a property-not-recognized signal rather than a\n * setting that quietly stopped mattering.\n */\nexport function SceneDataTable({ element, slots }: RegisteredComponentProps) {\n const { name, target } = resolveElementBinding(element, BindingKind.Query);\n if (!target) return <MissingBinding element={element} kind={BindingKind.Query} name={name} />;\n\n return (\n <ArcRuntimeBoundary>\n <DataTableForQuery\n query={target}\n emptyMessage={stringProperty(element.properties, 'emptyMessage') ?? ''}\n dataKey={stringProperty(element.properties, 'dataKey')}\n globalFilterFields={stringArrayProperty(element.properties, 'globalFilterFields')}\n className={stringProperty(element.properties, 'className')}\n >\n {slots.content}\n </DataTableForQuery>\n </ArcRuntimeBoundary>\n );\n}\n"],"names":["DataTableForQuery","lazy","default","SceneDataTable","element","slots","name","target","resolveElementBinding","BindingKind","Query","_jsx","MissingBinding","kind","ArcRuntimeBoundary","query","emptyMessage","stringProperty","properties","dataKey","globalFilterFields","stringArrayProperty","className","content"],"mappings":";;;;;;;;AAQA,MAAMA,iBAAAA,iBAAoBC,IAAAA,CAAK,WAAa;AAAEC,QAAAA,OAAAA,EAAS,CAAC,MAAM,OAAO,+BAAA,CAA+B,EAAGF;KAAkB,CAAA,CAAA;AAEzH;;;;;;;;;;;;;;;;;AAiBC,IACM,SAASG,cAAAA,CAAe,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;IACvE,MAAM,EAAEC,IAAI,EAAEC,MAAM,EAAE,GAAGC,qBAAAA,CAAsBJ,OAAAA,EAASK,WAAAA,CAAYC,KAAK,CAAA;IACzE,IAAI,CAACH,MAAAA,EAAQ,qBAAOI,GAAA,CAACC,cAAAA,EAAAA;QAAeR,OAAAA,EAASA,OAAAA;AAASS,QAAAA,IAAAA,EAAMJ,YAAYC,KAAK;QAAEJ,IAAAA,EAAMA;;AAErF,IAAA,qBACIK,GAAA,CAACG,kBAAAA,EAAAA;AACG,QAAA,QAAA,gBAAAH,GAAA,CAACX,iBAAAA,EAAAA;YACGe,KAAAA,EAAOR,MAAAA;AACPS,YAAAA,YAAAA,EAAcC,cAAAA,CAAeb,OAAAA,CAAQc,UAAU,EAAE,cAAA,CAAA,IAAmB,EAAA;YACpEC,OAAAA,EAASF,cAAAA,CAAeb,OAAAA,CAAQc,UAAU,EAAE,SAAA,CAAA;YAC5CE,kBAAAA,EAAoBC,mBAAAA,CAAoBjB,OAAAA,CAAQc,UAAU,EAAE,oBAAA,CAAA;YAC5DI,SAAAA,EAAWL,cAAAA,CAAeb,OAAAA,CAAQc,UAAU,EAAE,WAAA,CAAA;AAE7Cb,YAAAA,QAAAA,EAAAA,KAAAA,CAAMkB;;;AAIvB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneObservableDataTable.d.ts","sourceRoot":"","sources":["../../../data/SceneObservableDataTable.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"SceneObservableDataTable.d.ts","sourceRoot":"","sources":["../../../data/SceneObservableDataTable.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAsB/D,wBAAgB,wBAAwB,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,wBAAwB,+BAiBpF"}
|
|
@@ -4,7 +4,7 @@ import { BindingKind } from '../bindings/BindingKind.js';
|
|
|
4
4
|
import { resolveElementBinding } from '../bindings/resolveElementBinding.js';
|
|
5
5
|
import { MissingBinding } from '../bindings/MissingBinding.js';
|
|
6
6
|
import { ArcRuntimeBoundary } from '../bindings/ArcRuntimeBoundary.js';
|
|
7
|
-
import { stringProperty,
|
|
7
|
+
import { stringProperty, stringArrayProperty } from '../properties.js';
|
|
8
8
|
|
|
9
9
|
const DataTableForObservableQuery = /*#__PURE__*/ lazy(async ()=>({
|
|
10
10
|
default: (await import('@cratis/components/DataTables')).DataTableForObservableQuery
|
|
@@ -18,6 +18,10 @@ const DataTableForObservableQuery = /*#__PURE__*/ lazy(async ()=>({
|
|
|
18
18
|
* re-renders when the server's read model changes, and a plain query does not. A screen that names an
|
|
19
19
|
* observable query here is stating that its data is live, which is a design decision worth being able to
|
|
20
20
|
* read off the screen.
|
|
21
|
+
*
|
|
22
|
+
* As with `dataTable`, no `clientFiltering` property is exposed: `@cratis/components` 3.0.0 keeps the
|
|
23
|
+
* prop for source compatibility but ignores it, and a screen property that cannot change anything is
|
|
24
|
+
* worse than an absent one.
|
|
21
25
|
*/ function SceneObservableDataTable({ element, slots }) {
|
|
22
26
|
const { name, target } = resolveElementBinding(element, BindingKind.Query);
|
|
23
27
|
if (!target) return /*#__PURE__*/ jsx(MissingBinding, {
|
|
@@ -31,7 +35,6 @@ const DataTableForObservableQuery = /*#__PURE__*/ lazy(async ()=>({
|
|
|
31
35
|
emptyMessage: stringProperty(element.properties, 'emptyMessage') ?? '',
|
|
32
36
|
dataKey: stringProperty(element.properties, 'dataKey'),
|
|
33
37
|
globalFilterFields: stringArrayProperty(element.properties, 'globalFilterFields'),
|
|
34
|
-
clientFiltering: booleanProperty(element.properties, 'clientFiltering'),
|
|
35
38
|
className: stringProperty(element.properties, 'className'),
|
|
36
39
|
children: slots.content
|
|
37
40
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneObservableDataTable.js","sources":["../../../data/SceneObservableDataTable.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { lazy } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { ArcRuntimeBoundary, BindingKind, MissingBinding, resolveElementBinding } from '../bindings';\nimport {
|
|
1
|
+
{"version":3,"file":"SceneObservableDataTable.js","sources":["../../../data/SceneObservableDataTable.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { lazy } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { ArcRuntimeBoundary, BindingKind, MissingBinding, resolveElementBinding } from '../bindings';\nimport { stringArrayProperty, stringProperty } from '../properties';\n\nconst DataTableForObservableQuery = lazy(async () => ({\n default: (await import('@cratis/components/DataTables')).DataTableForObservableQuery,\n}));\n\n/**\n * The `Cratis.Components:observableDataTable` component - `DataTableForObservableQuery` from\n * `@cratis/components/DataTables`.\n *\n * A separate name rather than a flag on `dataTable`, because the distinction is in the *proxy* a host\n * registers, not in how the table is configured: an observable query opens a WebSocket subscription and\n * re-renders when the server's read model changes, and a plain query does not. A screen that names an\n * observable query here is stating that its data is live, which is a design decision worth being able to\n * read off the screen.\n *\n * As with `dataTable`, no `clientFiltering` property is exposed: `@cratis/components` 3.0.0 keeps the\n * prop for source compatibility but ignores it, and a screen property that cannot change anything is\n * worse than an absent one.\n */\nexport function SceneObservableDataTable({ element, slots }: RegisteredComponentProps) {\n const { name, target } = resolveElementBinding(element, BindingKind.Query);\n if (!target) return <MissingBinding element={element} kind={BindingKind.Query} name={name} />;\n\n return (\n <ArcRuntimeBoundary>\n <DataTableForObservableQuery\n query={target}\n emptyMessage={stringProperty(element.properties, 'emptyMessage') ?? ''}\n dataKey={stringProperty(element.properties, 'dataKey')}\n globalFilterFields={stringArrayProperty(element.properties, 'globalFilterFields')}\n className={stringProperty(element.properties, 'className')}\n >\n {slots.content}\n </DataTableForObservableQuery>\n </ArcRuntimeBoundary>\n );\n}\n"],"names":["DataTableForObservableQuery","lazy","default","SceneObservableDataTable","element","slots","name","target","resolveElementBinding","BindingKind","Query","_jsx","MissingBinding","kind","ArcRuntimeBoundary","query","emptyMessage","stringProperty","properties","dataKey","globalFilterFields","stringArrayProperty","className","content"],"mappings":";;;;;;;;AAQA,MAAMA,2BAAAA,iBAA8BC,IAAAA,CAAK,WAAa;AAClDC,QAAAA,OAAAA,EAAS,CAAC,MAAM,OAAO,+BAAA,CAA+B,EAAGF;KAC7D,CAAA,CAAA;AAEA;;;;;;;;;;;;;AAaC,IACM,SAASG,wBAAAA,CAAyB,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;IACjF,MAAM,EAAEC,IAAI,EAAEC,MAAM,EAAE,GAAGC,qBAAAA,CAAsBJ,OAAAA,EAASK,WAAAA,CAAYC,KAAK,CAAA;IACzE,IAAI,CAACH,MAAAA,EAAQ,qBAAOI,GAAA,CAACC,cAAAA,EAAAA;QAAeR,OAAAA,EAASA,OAAAA;AAASS,QAAAA,IAAAA,EAAMJ,YAAYC,KAAK;QAAEJ,IAAAA,EAAMA;;AAErF,IAAA,qBACIK,GAAA,CAACG,kBAAAA,EAAAA;AACG,QAAA,QAAA,gBAAAH,GAAA,CAACX,2BAAAA,EAAAA;YACGe,KAAAA,EAAOR,MAAAA;AACPS,YAAAA,YAAAA,EAAcC,cAAAA,CAAeb,OAAAA,CAAQc,UAAU,EAAE,cAAA,CAAA,IAAmB,EAAA;YACpEC,OAAAA,EAASF,cAAAA,CAAeb,OAAAA,CAAQc,UAAU,EAAE,SAAA,CAAA;YAC5CE,kBAAAA,EAAoBC,mBAAAA,CAAoBjB,OAAAA,CAAQc,UAAU,EAAE,oBAAA,CAAA;YAC5DI,SAAAA,EAAWL,cAAAA,CAAeb,OAAAA,CAAQc,UAAU,EAAE,WAAA,CAAA;AAE7Cb,YAAAA,QAAAA,EAAAA,KAAAA,CAAMkB;;;AAIvB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneCommandDialog.d.ts","sourceRoot":"","sources":["../../../dialogs/SceneCommandDialog.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"SceneCommandDialog.d.ts","sourceRoot":"","sources":["../../../dialogs/SceneCommandDialog.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AA0B/D,wBAAgB,kBAAkB,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,wBAAwB,+BAqB9E"}
|
|
@@ -19,6 +19,15 @@ const CommandDialog = /*#__PURE__*/ lazy(async ()=>({
|
|
|
19
19
|
* reimplementing the protocol.
|
|
20
20
|
*
|
|
21
21
|
* The `command` property names an Arc command proxy; the fields go in the `content` slot.
|
|
22
|
+
*
|
|
23
|
+
* `dismissable` and `closeAriaLabel` are here rather than on `dialog` alone because `CommandDialog`
|
|
24
|
+
* forwards both to the dialog it wraps, and in `@cratis/components` 3.0.0 that forwarding actually
|
|
25
|
+
* happens - 2.x accepted the two props and dropped them on the floor. `dismissable` matters more on a
|
|
26
|
+
* command dialog than anywhere else: it decides whether a half-filled form can be abandoned with
|
|
27
|
+
* `Escape` or a backdrop click, which is a decision about the command, not about the chrome.
|
|
28
|
+
*
|
|
29
|
+
* The `resizable` property this adapter used to carry is gone. It is still declared upstream so call
|
|
30
|
+
* sites compile, but PrimeReact 11's headless dialog has no resize handle and nothing reads the prop.
|
|
22
31
|
*/ function SceneCommandDialog({ element, slots }) {
|
|
23
32
|
const { name, target } = resolveElementBinding(element, BindingKind.Command);
|
|
24
33
|
if (!target) return /*#__PURE__*/ jsx(MissingBinding, {
|
|
@@ -32,9 +41,10 @@ const CommandDialog = /*#__PURE__*/ lazy(async ()=>({
|
|
|
32
41
|
command: target,
|
|
33
42
|
visible: booleanProperty(element.properties, 'visible') ?? true,
|
|
34
43
|
width: stringProperty(element.properties, 'width'),
|
|
35
|
-
|
|
44
|
+
dismissable: booleanProperty(element.properties, 'dismissable'),
|
|
36
45
|
okLabel: stringProperty(element.properties, 'okLabel'),
|
|
37
46
|
cancelLabel: stringProperty(element.properties, 'cancelLabel'),
|
|
47
|
+
closeAriaLabel: stringProperty(element.properties, 'closeAriaLabel'),
|
|
38
48
|
className: stringProperty(element.properties, 'className'),
|
|
39
49
|
children: slots.content
|
|
40
50
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneCommandDialog.js","sources":["../../../dialogs/SceneCommandDialog.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { lazy } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { ArcRuntimeBoundary, BindingKind, MissingBinding, resolveElementBinding } from '../bindings';\nimport { booleanProperty, stringProperty } from '../properties';\n\nconst CommandDialog = lazy(async () => ({ default: (await import('@cratis/components/CommandDialog')).CommandDialog }));\n\n/**\n * The `Cratis.Components:commandDialog` component - `CommandDialog` from `@cratis/components/CommandDialog`.\n *\n * A dialog whose confirm button *is* the command's execution: it binds the form to the command, submits\n * on confirm, feeds the backend's validation results back onto the fields, and only closes when the\n * command succeeded. That last part is the reason to use it rather than composing `dialog` with\n * `commandForm` - a hand-composed pair has no way to keep the dialog open on a rejected command without\n * reimplementing the protocol.\n *\n * The `command` property names an Arc command proxy; the fields go in the `content` slot.\n */\nexport function SceneCommandDialog({ element, slots }: RegisteredComponentProps) {\n const { name, target } = resolveElementBinding(element, BindingKind.Command);\n if (!target) return <MissingBinding element={element} kind={BindingKind.Command} name={name} />;\n\n return (\n <ArcRuntimeBoundary>\n <CommandDialog\n title={stringProperty(element.properties, 'title') ?? ''}\n command={target}\n visible={booleanProperty(element.properties, 'visible') ?? true}\n width={stringProperty(element.properties, 'width')}\n
|
|
1
|
+
{"version":3,"file":"SceneCommandDialog.js","sources":["../../../dialogs/SceneCommandDialog.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { lazy } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { ArcRuntimeBoundary, BindingKind, MissingBinding, resolveElementBinding } from '../bindings';\nimport { booleanProperty, stringProperty } from '../properties';\n\nconst CommandDialog = lazy(async () => ({ default: (await import('@cratis/components/CommandDialog')).CommandDialog }));\n\n/**\n * The `Cratis.Components:commandDialog` component - `CommandDialog` from `@cratis/components/CommandDialog`.\n *\n * A dialog whose confirm button *is* the command's execution: it binds the form to the command, submits\n * on confirm, feeds the backend's validation results back onto the fields, and only closes when the\n * command succeeded. That last part is the reason to use it rather than composing `dialog` with\n * `commandForm` - a hand-composed pair has no way to keep the dialog open on a rejected command without\n * reimplementing the protocol.\n *\n * The `command` property names an Arc command proxy; the fields go in the `content` slot.\n *\n * `dismissable` and `closeAriaLabel` are here rather than on `dialog` alone because `CommandDialog`\n * forwards both to the dialog it wraps, and in `@cratis/components` 3.0.0 that forwarding actually\n * happens - 2.x accepted the two props and dropped them on the floor. `dismissable` matters more on a\n * command dialog than anywhere else: it decides whether a half-filled form can be abandoned with\n * `Escape` or a backdrop click, which is a decision about the command, not about the chrome.\n *\n * The `resizable` property this adapter used to carry is gone. It is still declared upstream so call\n * sites compile, but PrimeReact 11's headless dialog has no resize handle and nothing reads the prop.\n */\nexport function SceneCommandDialog({ element, slots }: RegisteredComponentProps) {\n const { name, target } = resolveElementBinding(element, BindingKind.Command);\n if (!target) return <MissingBinding element={element} kind={BindingKind.Command} name={name} />;\n\n return (\n <ArcRuntimeBoundary>\n <CommandDialog\n title={stringProperty(element.properties, 'title') ?? ''}\n command={target}\n visible={booleanProperty(element.properties, 'visible') ?? true}\n width={stringProperty(element.properties, 'width')}\n dismissable={booleanProperty(element.properties, 'dismissable')}\n okLabel={stringProperty(element.properties, 'okLabel')}\n cancelLabel={stringProperty(element.properties, 'cancelLabel')}\n closeAriaLabel={stringProperty(element.properties, 'closeAriaLabel')}\n className={stringProperty(element.properties, 'className')}\n >\n {slots.content}\n </CommandDialog>\n </ArcRuntimeBoundary>\n );\n}\n"],"names":["CommandDialog","lazy","default","SceneCommandDialog","element","slots","name","target","resolveElementBinding","BindingKind","Command","_jsx","MissingBinding","kind","ArcRuntimeBoundary","title","stringProperty","properties","command","visible","booleanProperty","width","dismissable","okLabel","cancelLabel","closeAriaLabel","className","content"],"mappings":";;;;;;;;AAQA,MAAMA,aAAAA,iBAAgBC,IAAAA,CAAK,WAAa;AAAEC,QAAAA,OAAAA,EAAS,CAAC,MAAM,OAAO,kCAAA,CAAkC,EAAGF;KAAc,CAAA,CAAA;AAEpH;;;;;;;;;;;;;;;;;;;AAmBC,IACM,SAASG,kBAAAA,CAAmB,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;IAC3E,MAAM,EAAEC,IAAI,EAAEC,MAAM,EAAE,GAAGC,qBAAAA,CAAsBJ,OAAAA,EAASK,WAAAA,CAAYC,OAAO,CAAA;IAC3E,IAAI,CAACH,MAAAA,EAAQ,qBAAOI,GAAA,CAACC,cAAAA,EAAAA;QAAeR,OAAAA,EAASA,OAAAA;AAASS,QAAAA,IAAAA,EAAMJ,YAAYC,OAAO;QAAEJ,IAAAA,EAAMA;;AAEvF,IAAA,qBACIK,GAAA,CAACG,kBAAAA,EAAAA;AACG,QAAA,QAAA,gBAAAH,GAAA,CAACX,aAAAA,EAAAA;AACGe,YAAAA,KAAAA,EAAOC,cAAAA,CAAeZ,OAAAA,CAAQa,UAAU,EAAE,OAAA,CAAA,IAAY,EAAA;YACtDC,OAAAA,EAASX,MAAAA;AACTY,YAAAA,OAAAA,EAASC,eAAAA,CAAgBhB,OAAAA,CAAQa,UAAU,EAAE,SAAA,CAAA,IAAc,IAAA;YAC3DI,KAAAA,EAAOL,cAAAA,CAAeZ,OAAAA,CAAQa,UAAU,EAAE,OAAA,CAAA;YAC1CK,WAAAA,EAAaF,eAAAA,CAAgBhB,OAAAA,CAAQa,UAAU,EAAE,aAAA,CAAA;YACjDM,OAAAA,EAASP,cAAAA,CAAeZ,OAAAA,CAAQa,UAAU,EAAE,SAAA,CAAA;YAC5CO,WAAAA,EAAaR,cAAAA,CAAeZ,OAAAA,CAAQa,UAAU,EAAE,aAAA,CAAA;YAChDQ,cAAAA,EAAgBT,cAAAA,CAAeZ,OAAAA,CAAQa,UAAU,EAAE,gBAAA,CAAA;YACnDS,SAAAA,EAAWV,cAAAA,CAAeZ,OAAAA,CAAQa,UAAU,EAAE,WAAA,CAAA;AAE7CZ,YAAAA,QAAAA,EAAAA,KAAAA,CAAMsB;;;AAIvB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneDialog.d.ts","sourceRoot":"","sources":["../../../dialogs/SceneDialog.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"SceneDialog.d.ts","sourceRoot":"","sources":["../../../dialogs/SceneDialog.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AA6B/D,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,wBAAwB,+BAmBvE"}
|
|
@@ -18,17 +18,29 @@ const Dialog = /*#__PURE__*/ lazy(async ()=>({
|
|
|
18
18
|
*
|
|
19
19
|
* `visible` defaults to `true` because a dialog placed on a screen is being placed to be seen; a host
|
|
20
20
|
* that controls visibility sets the property explicitly.
|
|
21
|
+
*
|
|
22
|
+
* `dismissable` replaces the `resizable` property this adapter used to carry, and the swap is the whole
|
|
23
|
+
* PrimeReact 11 story in miniature. `resizable` is still declared on `DialogProps` so call sites compile,
|
|
24
|
+
* but version 11's headless dialog has no resize handle and the library never reads the prop - a screen
|
|
25
|
+
* setting it got nothing. `dismissable` is the opposite: 3.0.0 added it and honors it, and it decides
|
|
26
|
+
* whether the header close button, backdrop click and `Escape` are offered at all. Leaving it unset keeps
|
|
27
|
+
* the library's own default, so a screen opts into a dismiss affordance rather than having one imposed.
|
|
28
|
+
*
|
|
29
|
+
* `closeAriaLabel` names that close button. It is separate from every other label here because it is the
|
|
30
|
+
* only one a screen reader reads and nobody sees, which is exactly why it gets forgotten - offering it
|
|
31
|
+
* next to `okLabel` and `cancelLabel` is what makes localizing a dialog a complete job.
|
|
21
32
|
*/ function SceneDialog({ element, slots }) {
|
|
22
33
|
return /*#__PURE__*/ jsx(ArcRuntimeBoundary, {
|
|
23
34
|
children: /*#__PURE__*/ jsx(Dialog, {
|
|
24
35
|
title: stringProperty(element.properties, 'title') ?? '',
|
|
25
36
|
visible: booleanProperty(element.properties, 'visible') ?? true,
|
|
26
37
|
width: stringProperty(element.properties, 'width'),
|
|
27
|
-
|
|
38
|
+
dismissable: booleanProperty(element.properties, 'dismissable'),
|
|
28
39
|
isValid: booleanProperty(element.properties, 'isValid'),
|
|
29
40
|
isBusy: booleanProperty(element.properties, 'isBusy'),
|
|
30
41
|
okLabel: stringProperty(element.properties, 'okLabel'),
|
|
31
42
|
cancelLabel: stringProperty(element.properties, 'cancelLabel'),
|
|
43
|
+
closeAriaLabel: stringProperty(element.properties, 'closeAriaLabel'),
|
|
32
44
|
className: stringProperty(element.properties, 'className'),
|
|
33
45
|
children: slots.content
|
|
34
46
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneDialog.js","sources":["../../../dialogs/SceneDialog.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { lazy } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { ArcRuntimeBoundary } from '../bindings';\nimport { booleanProperty, stringProperty } from '../properties';\n\nconst Dialog = lazy(async () => ({ default: (await import('@cratis/components/Dialogs')).Dialog }));\n\n/**\n * The `Cratis.Components:dialog` component, registered under the bare name `dialog` - `Dialog` from\n * `@cratis/components/Dialogs`.\n *\n * Shadowing PrimeReact's `dialog` deliberately. PrimeReact's is a modal frame and nothing more; this one\n * resolves its result through Arc's dialog context, so a screen's dialog participates in the same\n * request/response protocol as the rest of the application - a caller awaits a `DialogResult` instead of\n * threading `visible` state and callbacks by hand.\n *\n * `visible` defaults to `true` because a dialog placed on a screen is being placed to be seen; a host\n * that controls visibility sets the property explicitly.\n */\nexport function SceneDialog({ element, slots }: RegisteredComponentProps) {\n return (\n <ArcRuntimeBoundary>\n <Dialog\n title={stringProperty(element.properties, 'title') ?? ''}\n visible={booleanProperty(element.properties, 'visible') ?? true}\n width={stringProperty(element.properties, 'width')}\n
|
|
1
|
+
{"version":3,"file":"SceneDialog.js","sources":["../../../dialogs/SceneDialog.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { lazy } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { ArcRuntimeBoundary } from '../bindings';\nimport { booleanProperty, stringProperty } from '../properties';\n\nconst Dialog = lazy(async () => ({ default: (await import('@cratis/components/Dialogs')).Dialog }));\n\n/**\n * The `Cratis.Components:dialog` component, registered under the bare name `dialog` - `Dialog` from\n * `@cratis/components/Dialogs`.\n *\n * Shadowing PrimeReact's `dialog` deliberately. PrimeReact's is a modal frame and nothing more; this one\n * resolves its result through Arc's dialog context, so a screen's dialog participates in the same\n * request/response protocol as the rest of the application - a caller awaits a `DialogResult` instead of\n * threading `visible` state and callbacks by hand.\n *\n * `visible` defaults to `true` because a dialog placed on a screen is being placed to be seen; a host\n * that controls visibility sets the property explicitly.\n *\n * `dismissable` replaces the `resizable` property this adapter used to carry, and the swap is the whole\n * PrimeReact 11 story in miniature. `resizable` is still declared on `DialogProps` so call sites compile,\n * but version 11's headless dialog has no resize handle and the library never reads the prop - a screen\n * setting it got nothing. `dismissable` is the opposite: 3.0.0 added it and honors it, and it decides\n * whether the header close button, backdrop click and `Escape` are offered at all. Leaving it unset keeps\n * the library's own default, so a screen opts into a dismiss affordance rather than having one imposed.\n *\n * `closeAriaLabel` names that close button. It is separate from every other label here because it is the\n * only one a screen reader reads and nobody sees, which is exactly why it gets forgotten - offering it\n * next to `okLabel` and `cancelLabel` is what makes localizing a dialog a complete job.\n */\nexport function SceneDialog({ element, slots }: RegisteredComponentProps) {\n return (\n <ArcRuntimeBoundary>\n <Dialog\n title={stringProperty(element.properties, 'title') ?? ''}\n visible={booleanProperty(element.properties, 'visible') ?? true}\n width={stringProperty(element.properties, 'width')}\n dismissable={booleanProperty(element.properties, 'dismissable')}\n isValid={booleanProperty(element.properties, 'isValid')}\n isBusy={booleanProperty(element.properties, 'isBusy')}\n okLabel={stringProperty(element.properties, 'okLabel')}\n cancelLabel={stringProperty(element.properties, 'cancelLabel')}\n closeAriaLabel={stringProperty(element.properties, 'closeAriaLabel')}\n className={stringProperty(element.properties, 'className')}\n >\n {slots.content}\n </Dialog>\n </ArcRuntimeBoundary>\n );\n}\n"],"names":["Dialog","lazy","default","SceneDialog","element","slots","_jsx","ArcRuntimeBoundary","title","stringProperty","properties","visible","booleanProperty","width","dismissable","isValid","isBusy","okLabel","cancelLabel","closeAriaLabel","className","content"],"mappings":";;;;;;AAQA,MAAMA,MAAAA,iBAASC,IAAAA,CAAK,WAAa;AAAEC,QAAAA,OAAAA,EAAS,CAAC,MAAM,OAAO,4BAAA,CAA4B,EAAGF;KAAO,CAAA,CAAA;AAEhG;;;;;;;;;;;;;;;;;;;;;;AAsBC,IACM,SAASG,WAAAA,CAAY,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;AACpE,IAAA,qBACIC,GAAA,CAACC,kBAAAA,EAAAA;AACG,QAAA,QAAA,gBAAAD,GAAA,CAACN,MAAAA,EAAAA;AACGQ,YAAAA,KAAAA,EAAOC,cAAAA,CAAeL,OAAAA,CAAQM,UAAU,EAAE,OAAA,CAAA,IAAY,EAAA;AACtDC,YAAAA,OAAAA,EAASC,eAAAA,CAAgBR,OAAAA,CAAQM,UAAU,EAAE,SAAA,CAAA,IAAc,IAAA;YAC3DG,KAAAA,EAAOJ,cAAAA,CAAeL,OAAAA,CAAQM,UAAU,EAAE,OAAA,CAAA;YAC1CI,WAAAA,EAAaF,eAAAA,CAAgBR,OAAAA,CAAQM,UAAU,EAAE,aAAA,CAAA;YACjDK,OAAAA,EAASH,eAAAA,CAAgBR,OAAAA,CAAQM,UAAU,EAAE,SAAA,CAAA;YAC7CM,MAAAA,EAAQJ,eAAAA,CAAgBR,OAAAA,CAAQM,UAAU,EAAE,QAAA,CAAA;YAC5CO,OAAAA,EAASR,cAAAA,CAAeL,OAAAA,CAAQM,UAAU,EAAE,SAAA,CAAA;YAC5CQ,WAAAA,EAAaT,cAAAA,CAAeL,OAAAA,CAAQM,UAAU,EAAE,aAAA,CAAA;YAChDS,cAAAA,EAAgBV,cAAAA,CAAeL,OAAAA,CAAQM,UAAU,EAAE,gBAAA,CAAA;YACnDU,SAAAA,EAAWX,cAAAA,CAAeL,OAAAA,CAAQM,UAAU,EAAE,WAAA,CAAA;AAE7CL,YAAAA,QAAAA,EAAAA,KAAAA,CAAMgB;;;AAIvB;;;;"}
|