@cratis/scene.primereact 3.2.0 → 3.3.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/dist/cjs/button/PrimeButton.js.map +1 -1
- package/dist/cjs/button/PrimeButtonGroup.js.map +1 -1
- package/dist/cjs/button/PrimeSpeedDial.js.map +1 -1
- package/dist/cjs/button/PrimeSplitButton.js.map +1 -1
- package/dist/cjs/button/SplitButton.js.map +1 -1
- package/dist/cjs/data/Column.js.map +1 -1
- package/dist/cjs/data/Pagination.js.map +1 -1
- package/dist/cjs/data/PrimeColumn.js.map +1 -1
- package/dist/cjs/data/PrimeDataTable.js.map +1 -1
- package/dist/cjs/data/PrimeDataView.js.map +1 -1
- package/dist/cjs/data/PrimeOrderList.js.map +1 -1
- package/dist/cjs/data/PrimeOrganizationChart.js.map +1 -1
- package/dist/cjs/data/PrimePaginator.js.map +1 -1
- package/dist/cjs/data/PrimePickList.js.map +1 -1
- package/dist/cjs/data/PrimeTimeline.js.map +1 -1
- package/dist/cjs/data/PrimeTree.js.map +1 -1
- package/dist/cjs/data/columnDefinitions.js.map +1 -1
- package/dist/cjs/data/primeTreeNodes.js.map +1 -1
- package/dist/cjs/data/selectOptions.js.map +1 -1
- package/dist/cjs/form/PrimeAutoComplete.js.map +1 -1
- package/dist/cjs/form/PrimeCalendar.js.map +1 -1
- package/dist/cjs/form/PrimeCheckbox.js.map +1 -1
- package/dist/cjs/form/PrimeChips.js.map +1 -1
- package/dist/cjs/form/PrimeColorPicker.js.map +1 -1
- package/dist/cjs/form/PrimeDropdown.js.map +1 -1
- package/dist/cjs/form/PrimeFloatLabel.js.map +1 -1
- package/dist/cjs/form/PrimeIconField.js.map +1 -1
- package/dist/cjs/form/PrimeInputNumber.js.map +1 -1
- package/dist/cjs/form/PrimeInputText.js.map +1 -1
- package/dist/cjs/form/PrimeInputTextarea.js.map +1 -1
- package/dist/cjs/form/PrimeKnob.js.map +1 -1
- package/dist/cjs/form/PrimeListBox.js.map +1 -1
- package/dist/cjs/form/PrimeMultiSelect.js.map +1 -1
- package/dist/cjs/form/PrimePassword.js.map +1 -1
- package/dist/cjs/form/PrimeRadioButton.js.map +1 -1
- package/dist/cjs/form/PrimeRating.js.map +1 -1
- package/dist/cjs/form/PrimeSelectButton.js.map +1 -1
- package/dist/cjs/form/PrimeSlider.js.map +1 -1
- package/dist/cjs/form/PrimeToggleSwitch.js.map +1 -1
- package/dist/cjs/form/PrimeTreeSelect.js.map +1 -1
- package/dist/cjs/form/TreeSelect.js.map +1 -1
- package/dist/cjs/media/Image.js.map +1 -1
- package/dist/cjs/media/PrimeCarousel.js.map +1 -1
- package/dist/cjs/media/PrimeGalleria.js.map +1 -1
- package/dist/cjs/media/PrimeImage.js.map +1 -1
- package/dist/cjs/menu/Dock.js.map +1 -1
- package/dist/cjs/menu/DockPosition.js.map +1 -1
- package/dist/cjs/menu/MegaMenu.js.map +1 -1
- package/dist/cjs/menu/MenuItemAction.js.map +1 -1
- package/dist/cjs/menu/MenuItemContent.js.map +1 -1
- package/dist/cjs/menu/Menubar.js.map +1 -1
- package/dist/cjs/menu/PanelMenu.js.map +1 -1
- package/dist/cjs/menu/PrimeBreadcrumb.js.map +1 -1
- package/dist/cjs/menu/PrimeContextMenu.js.map +1 -1
- package/dist/cjs/menu/PrimeDock.js.map +1 -1
- package/dist/cjs/menu/PrimeMegaMenu.js.map +1 -1
- package/dist/cjs/menu/PrimeMenu.js.map +1 -1
- package/dist/cjs/menu/PrimeMenubar.js.map +1 -1
- package/dist/cjs/menu/PrimePanelMenu.js.map +1 -1
- package/dist/cjs/menu/PrimeSteps.js.map +1 -1
- package/dist/cjs/menu/PrimeTabMenu.js.map +1 -1
- package/dist/cjs/menu/PrimeTieredMenu.js.map +1 -1
- package/dist/cjs/menu/Steps.js.map +1 -1
- package/dist/cjs/menu/TabMenu.js.map +1 -1
- package/dist/cjs/menu/TieredMenu.js.map +1 -1
- package/dist/cjs/menuItems.js.map +1 -1
- package/dist/cjs/messages/PrimeInlineMessage.js.map +1 -1
- package/dist/cjs/messages/PrimeMessage.js.map +1 -1
- package/dist/cjs/messages/PrimeToast.js.map +1 -1
- package/dist/cjs/misc/BlockUI.js.map +1 -1
- package/dist/cjs/misc/PrimeAvatar.js.map +1 -1
- package/dist/cjs/misc/PrimeBadge.js.map +1 -1
- package/dist/cjs/misc/PrimeBlockUI.js.map +1 -1
- package/dist/cjs/misc/PrimeChip.js.map +1 -1
- package/dist/cjs/misc/PrimeInplace.js.map +1 -1
- package/dist/cjs/misc/PrimeProgressBar.js.map +1 -1
- package/dist/cjs/misc/PrimeProgressSpinner.js.map +1 -1
- package/dist/cjs/misc/PrimeScrollTop.js.map +1 -1
- package/dist/cjs/misc/PrimeSkeleton.js.map +1 -1
- package/dist/cjs/misc/PrimeTag.js.map +1 -1
- package/dist/cjs/misc/PrimeTerminal.js.map +1 -1
- package/dist/cjs/misc/ScrollTop.js.map +1 -1
- package/dist/cjs/overlay/ConfirmDialog.js.map +1 -1
- package/dist/cjs/overlay/PrimeConfirmDialog.js.map +1 -1
- package/dist/cjs/overlay/PrimeDialog.js.map +1 -1
- package/dist/cjs/overlay/PrimeOverlayPanel.js.map +1 -1
- package/dist/cjs/overlay/PrimeSidebar.js.map +1 -1
- package/dist/cjs/overlay/PrimeTooltip.js.map +1 -1
- package/dist/cjs/panel/PrimeAccordion.js.map +1 -1
- package/dist/cjs/panel/PrimeCard.js.map +1 -1
- package/dist/cjs/panel/PrimeDivider.js.map +1 -1
- package/dist/cjs/panel/PrimeFieldset.js.map +1 -1
- package/dist/cjs/panel/PrimePanel.js.map +1 -1
- package/dist/cjs/panel/PrimeScrollPanel.js.map +1 -1
- package/dist/cjs/panel/PrimeSplitter.js.map +1 -1
- package/dist/cjs/panel/PrimeStepper.js.map +1 -1
- package/dist/cjs/panel/PrimeTabView.js.map +1 -1
- package/dist/cjs/panel/PrimeToolbar.js.map +1 -1
- package/dist/cjs/primeReactComponents.js.map +1 -1
- package/dist/cjs/primeReactPackage.js.map +1 -1
- package/dist/cjs/properties.js.map +1 -1
- package/dist/cjs/screen/PrimeAction.js.map +1 -1
- package/dist/cjs/screen/PrimeField.js.map +1 -1
- package/dist/cjs/screen/PrimeSection.js.map +1 -1
- package/dist/cjs/screen/PrimeSummary.js.map +1 -1
- package/dist/cjs/screen/PrimeText.js.map +1 -1
- package/dist/cjs/screen/PrimeTitle.js.map +1 -1
- package/dist/cjs/theme/PrimeReactThemeFamily.js.map +1 -1
- package/dist/cjs/theme/primeReactThemePreset.js.map +1 -1
- package/dist/cjs/theme/primeReactThemes.js.map +1 -1
- package/dist/cjs/theme/themePresets.js.map +1 -1
- package/dist/cjs/theme/usePrimeReactTheme.js.map +1 -1
- package/dist/cjs/treeNodes.js.map +1 -1
- package/dist/esm/button/PrimeButton.js.map +1 -1
- package/dist/esm/button/PrimeButtonGroup.js.map +1 -1
- package/dist/esm/button/PrimeSpeedDial.js.map +1 -1
- package/dist/esm/button/PrimeSplitButton.js.map +1 -1
- package/dist/esm/button/SplitButton.js.map +1 -1
- package/dist/esm/data/Column.js.map +1 -1
- package/dist/esm/data/Pagination.js.map +1 -1
- package/dist/esm/data/PrimeColumn.js.map +1 -1
- package/dist/esm/data/PrimeDataTable.js.map +1 -1
- package/dist/esm/data/PrimeDataView.js.map +1 -1
- package/dist/esm/data/PrimeOrderList.js.map +1 -1
- package/dist/esm/data/PrimeOrganizationChart.js.map +1 -1
- package/dist/esm/data/PrimePaginator.js.map +1 -1
- package/dist/esm/data/PrimePickList.js.map +1 -1
- package/dist/esm/data/PrimeTimeline.js.map +1 -1
- package/dist/esm/data/PrimeTree.js.map +1 -1
- package/dist/esm/data/columnDefinitions.js.map +1 -1
- package/dist/esm/data/primeTreeNodes.js.map +1 -1
- package/dist/esm/data/selectOptions.js.map +1 -1
- package/dist/esm/form/PrimeAutoComplete.js.map +1 -1
- package/dist/esm/form/PrimeCalendar.js.map +1 -1
- package/dist/esm/form/PrimeCheckbox.js.map +1 -1
- package/dist/esm/form/PrimeChips.js.map +1 -1
- package/dist/esm/form/PrimeColorPicker.js.map +1 -1
- package/dist/esm/form/PrimeDropdown.js.map +1 -1
- package/dist/esm/form/PrimeFloatLabel.js.map +1 -1
- package/dist/esm/form/PrimeIconField.js.map +1 -1
- package/dist/esm/form/PrimeInputNumber.js.map +1 -1
- package/dist/esm/form/PrimeInputText.js.map +1 -1
- package/dist/esm/form/PrimeInputTextarea.js.map +1 -1
- package/dist/esm/form/PrimeKnob.js.map +1 -1
- package/dist/esm/form/PrimeListBox.js.map +1 -1
- package/dist/esm/form/PrimeMultiSelect.js.map +1 -1
- package/dist/esm/form/PrimePassword.js.map +1 -1
- package/dist/esm/form/PrimeRadioButton.js.map +1 -1
- package/dist/esm/form/PrimeRating.js.map +1 -1
- package/dist/esm/form/PrimeSelectButton.js.map +1 -1
- package/dist/esm/form/PrimeSlider.js.map +1 -1
- package/dist/esm/form/PrimeToggleSwitch.js.map +1 -1
- package/dist/esm/form/PrimeTreeSelect.js.map +1 -1
- package/dist/esm/form/TreeSelect.js.map +1 -1
- package/dist/esm/media/Image.js.map +1 -1
- package/dist/esm/media/PrimeCarousel.js.map +1 -1
- package/dist/esm/media/PrimeGalleria.js.map +1 -1
- package/dist/esm/media/PrimeImage.js.map +1 -1
- package/dist/esm/menu/Dock.js.map +1 -1
- package/dist/esm/menu/DockPosition.js.map +1 -1
- package/dist/esm/menu/MegaMenu.js.map +1 -1
- package/dist/esm/menu/MenuItemAction.js.map +1 -1
- package/dist/esm/menu/MenuItemContent.js.map +1 -1
- package/dist/esm/menu/Menubar.js.map +1 -1
- package/dist/esm/menu/PanelMenu.js.map +1 -1
- package/dist/esm/menu/PrimeBreadcrumb.js.map +1 -1
- package/dist/esm/menu/PrimeContextMenu.js.map +1 -1
- package/dist/esm/menu/PrimeDock.js.map +1 -1
- package/dist/esm/menu/PrimeMegaMenu.js.map +1 -1
- package/dist/esm/menu/PrimeMenu.js.map +1 -1
- package/dist/esm/menu/PrimeMenubar.js.map +1 -1
- package/dist/esm/menu/PrimePanelMenu.js.map +1 -1
- package/dist/esm/menu/PrimeSteps.js.map +1 -1
- package/dist/esm/menu/PrimeTabMenu.js.map +1 -1
- package/dist/esm/menu/PrimeTieredMenu.js.map +1 -1
- package/dist/esm/menu/Steps.js.map +1 -1
- package/dist/esm/menu/TabMenu.js.map +1 -1
- package/dist/esm/menu/TieredMenu.js.map +1 -1
- package/dist/esm/menuItems.js.map +1 -1
- package/dist/esm/messages/PrimeInlineMessage.js.map +1 -1
- package/dist/esm/messages/PrimeMessage.js.map +1 -1
- package/dist/esm/messages/PrimeToast.js.map +1 -1
- package/dist/esm/misc/BlockUI.js.map +1 -1
- package/dist/esm/misc/PrimeAvatar.js.map +1 -1
- package/dist/esm/misc/PrimeBadge.js.map +1 -1
- package/dist/esm/misc/PrimeBlockUI.js.map +1 -1
- package/dist/esm/misc/PrimeChip.js.map +1 -1
- package/dist/esm/misc/PrimeInplace.js.map +1 -1
- package/dist/esm/misc/PrimeProgressBar.js.map +1 -1
- package/dist/esm/misc/PrimeProgressSpinner.js.map +1 -1
- package/dist/esm/misc/PrimeScrollTop.js.map +1 -1
- package/dist/esm/misc/PrimeSkeleton.js.map +1 -1
- package/dist/esm/misc/PrimeTag.js.map +1 -1
- package/dist/esm/misc/PrimeTerminal.js.map +1 -1
- package/dist/esm/misc/ScrollTop.js.map +1 -1
- package/dist/esm/overlay/ConfirmDialog.js.map +1 -1
- package/dist/esm/overlay/PrimeConfirmDialog.js.map +1 -1
- package/dist/esm/overlay/PrimeDialog.js.map +1 -1
- package/dist/esm/overlay/PrimeOverlayPanel.js.map +1 -1
- package/dist/esm/overlay/PrimeSidebar.js.map +1 -1
- package/dist/esm/overlay/PrimeTooltip.js.map +1 -1
- package/dist/esm/panel/PrimeAccordion.js.map +1 -1
- package/dist/esm/panel/PrimeCard.js.map +1 -1
- package/dist/esm/panel/PrimeDivider.js.map +1 -1
- package/dist/esm/panel/PrimeFieldset.js.map +1 -1
- package/dist/esm/panel/PrimePanel.js.map +1 -1
- package/dist/esm/panel/PrimeScrollPanel.js.map +1 -1
- package/dist/esm/panel/PrimeSplitter.js.map +1 -1
- package/dist/esm/panel/PrimeStepper.js.map +1 -1
- package/dist/esm/panel/PrimeTabView.js.map +1 -1
- package/dist/esm/panel/PrimeToolbar.js.map +1 -1
- package/dist/esm/primeReactComponents.js.map +1 -1
- package/dist/esm/primeReactPackage.js.map +1 -1
- package/dist/esm/properties.js.map +1 -1
- package/dist/esm/screen/PrimeAction.js.map +1 -1
- package/dist/esm/screen/PrimeField.js.map +1 -1
- package/dist/esm/screen/PrimeSection.js.map +1 -1
- package/dist/esm/screen/PrimeSummary.js.map +1 -1
- package/dist/esm/screen/PrimeText.js.map +1 -1
- package/dist/esm/screen/PrimeTitle.js.map +1 -1
- package/dist/esm/theme/PrimeReactThemeFamily.js.map +1 -1
- package/dist/esm/theme/primeReactThemePreset.js.map +1 -1
- package/dist/esm/theme/primeReactThemes.js.map +1 -1
- package/dist/esm/theme/themePresets.js.map +1 -1
- package/dist/esm/theme/usePrimeReactTheme.js.map +1 -1
- package/dist/esm/treeNodes.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeButton.js","sources":["../../../button/PrimeButton.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 { Button } from 'primereact/button';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport {booleanProperty, severityProperty, stringProperty} from '../properties';\n\n/**\n * The `PrimeReact:button` component.\n *\n * Deliberately claims the same bare name `core` already declares. A `ui profile` listing `core` and then\n * `PrimeReact` resolves `button` to this one and records that it shadowed core's - which is the whole\n * point of override priority, and the reason a screen written against the fallback vocabulary gets a real\n * themed button the moment a component library is added to the profile, with no edit to the screen.\n *\n * PrimeReact 11 reshaped the props under it, and the adapter absorbs all of it so screens do not have to.\n * `label` and `icon` are children now rather than props. The `outlined` and `text` booleans collapsed into\n * a single `variant`, which is the better model - they were never combinable - and the authored booleans\n * are still read and translated. `warning` became `warn`.\n *\n * `loading` is the one that could not simply be translated: v11 dropped it. The state still matters to a\n * screen, so it is rebuilt from parts that exist - a spinning icon in place of the button's own, the\n * button disabled so the action cannot be fired twice, and `aria-busy` so the state is announced rather\n * than only drawn. The icon is marked decorative throughout because the label already names the action.\n */\nexport function PrimeButton({ element, slots }: RegisteredComponentProps) {\n const icon = stringProperty(element, 'icon');\n const severity = severityProperty(element, 'severity');\n const loading = booleanProperty(element, 'loading', false);\n\n let variant: 'link' | 'text' | 'outlined' | undefined;\n if (booleanProperty(element, 'outlined', false)) variant = 'outlined';\n else if (booleanProperty(element, 'text', false)) variant = 'text';\n\n return (\n <Button\n data-scene-id={element.id}\n severity={severity}\n variant={variant}\n rounded={booleanProperty(element, 'rounded', false)}\n disabled={loading || booleanProperty(element, 'disabled', false)}\n aria-busy={loading}>\n {loading && <i className='pi pi-spinner pi-spin' aria-hidden='true' />}\n {!loading && icon !== undefined && <i className={icon} aria-hidden='true' />}\n {stringProperty(element, 'label')}\n {slots.content}\n </Button>\n );\n}\n"],"names":["PrimeButton","element","slots","icon","stringProperty","severity","severityProperty","loading","booleanProperty","variant","_jsxs","Button","data-scene-id","id","rounded","disabled","aria-busy","_jsx","i","className","aria-hidden","undefined","content"],"mappings":";;;;;;AAOA;;;;;;;;;;;;;;;;;AAiBC,IACM,SAASA,WAAAA,CAAY,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;IACpE,MAAMC,IAAAA,GAAOC,0BAAeH,OAAAA,EAAS,MAAA,CAAA;IACrC,MAAMI,QAAAA,GAAWC,4BAAiBL,OAAAA,EAAS,UAAA,CAAA;IAC3C,MAAMM,OAAAA,GAAUC,0BAAAA,CAAgBP,OAAAA,EAAS,SAAA,EAAW,KAAA,CAAA;IAEpD,IAAIQ,OAAAA;AACJ,IAAA,IAAID,0BAAAA,CAAgBP,OAAAA,EAAS,UAAA,EAAY,KAAA,CAAA,EAAQQ,OAAAA,GAAU,UAAA;AACtD,SAAA,IAAID,0BAAAA,CAAgBP,OAAAA,EAAS,MAAA,EAAQ,KAAA,CAAA,EAAQQ,OAAAA,GAAU,MAAA;AAE5D,IAAA,qBACIC,eAAA,CAACC,aAAAA,EAAAA;AACGC,QAAAA,eAAAA,EAAeX,QAAQY,EAAE;QACzBR,QAAAA,EAAUA,QAAAA;QACVI,OAAAA,EAASA,OAAAA;QACTK,OAAAA,EAASN,0BAAAA,CAAgBP,SAAS,SAAA,EAAW,KAAA,CAAA;QAC7Cc,QAAAA,EAAUR,OAAAA,IAAWC,0BAAAA,CAAgBP,OAAAA,EAAS,UAAA,EAAY,KAAA,CAAA;QAC1De,WAAAA,EAAWT,OAAAA;;AACVA,YAAAA,OAAAA,kBAAWU,cAAA,CAACC,GAAAA,EAAAA;gBAAEC,SAAAA,EAAU,uBAAA;gBAAwBC,aAAAA,EAAY;;YAC5D,CAACb,OAAAA,IAAWJ,IAAAA,KAASkB,SAAAA,kBAAaJ,cAAA,CAACC,GAAAA,EAAAA;gBAAEC,SAAAA,EAAWhB,IAAAA;gBAAMiB,aAAAA,EAAY;;AAClEhB,YAAAA,yBAAAA,CAAeH,OAAAA,EAAS,OAAA,CAAA;AACxBC,YAAAA,KAAAA,CAAMoB;;;AAGnB
|
|
1
|
+
{"version":3,"file":"PrimeButton.js","sources":["../../../button/PrimeButton.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 { Button } from 'primereact/button';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport {booleanProperty, severityProperty, stringProperty} from '../properties';\n\n/**\n * The `PrimeReact:button` component.\n *\n * Deliberately claims the same bare name `core` already declares. A `ui profile` listing `core` and then\n * `PrimeReact` resolves `button` to this one and records that it shadowed core's - which is the whole\n * point of override priority, and the reason a screen written against the fallback vocabulary gets a real\n * themed button the moment a component library is added to the profile, with no edit to the screen.\n *\n * PrimeReact 11 reshaped the props under it, and the adapter absorbs all of it so screens do not have to.\n * `label` and `icon` are children now rather than props. The `outlined` and `text` booleans collapsed into\n * a single `variant`, which is the better model - they were never combinable - and the authored booleans\n * are still read and translated. `warning` became `warn`.\n *\n * `loading` is the one that could not simply be translated: v11 dropped it. The state still matters to a\n * screen, so it is rebuilt from parts that exist - a spinning icon in place of the button's own, the\n * button disabled so the action cannot be fired twice, and `aria-busy` so the state is announced rather\n * than only drawn. The icon is marked decorative throughout because the label already names the action.\n */\nexport function PrimeButton({ element, slots }: RegisteredComponentProps) {\n const icon = stringProperty(element, 'icon');\n const severity = severityProperty(element, 'severity');\n const loading = booleanProperty(element, 'loading', false);\n\n let variant: 'link' | 'text' | 'outlined' | undefined;\n if (booleanProperty(element, 'outlined', false)) variant = 'outlined';\n else if (booleanProperty(element, 'text', false)) variant = 'text';\n\n return (\n <Button\n data-scene-id={element.id}\n severity={severity}\n variant={variant}\n rounded={booleanProperty(element, 'rounded', false)}\n disabled={loading || booleanProperty(element, 'disabled', false)}\n aria-busy={loading}>\n {loading && <i className='pi pi-spinner pi-spin' aria-hidden='true' />}\n {!loading && icon !== undefined && <i className={icon} aria-hidden='true' />}\n {stringProperty(element, 'label')}\n {slots.content}\n </Button>\n );\n}\n"],"names":["PrimeButton","element","slots","icon","stringProperty","severity","severityProperty","loading","booleanProperty","variant","_jsxs","Button","data-scene-id","id","rounded","disabled","aria-busy","_jsx","i","className","aria-hidden","undefined","content"],"mappings":";;;;;;AAOA;;;;;;;;;;;;;;;;;AAiBC,IACM,SAASA,WAAAA,CAAY,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;IACpE,MAAMC,IAAAA,GAAOC,0BAAeH,OAAAA,EAAS,MAAA,CAAA;IACrC,MAAMI,QAAAA,GAAWC,4BAAiBL,OAAAA,EAAS,UAAA,CAAA;IAC3C,MAAMM,OAAAA,GAAUC,0BAAAA,CAAgBP,OAAAA,EAAS,SAAA,EAAW,KAAA,CAAA;IAEpD,IAAIQ,OAAAA;AACJ,IAAA,IAAID,0BAAAA,CAAgBP,OAAAA,EAAS,UAAA,EAAY,KAAA,CAAA,EAAQQ,OAAAA,GAAU,UAAA;AACtD,SAAA,IAAID,0BAAAA,CAAgBP,OAAAA,EAAS,MAAA,EAAQ,KAAA,CAAA,EAAQQ,OAAAA,GAAU,MAAA;AAE5D,IAAA,qBACIC,eAAA,CAACC,aAAAA,EAAAA;AACGC,QAAAA,eAAAA,EAAeX,QAAQY,EAAE;QACzBR,QAAAA,EAAUA,QAAAA;QACVI,OAAAA,EAASA,OAAAA;QACTK,OAAAA,EAASN,0BAAAA,CAAgBP,SAAS,SAAA,EAAW,KAAA,CAAA;QAC7Cc,QAAAA,EAAUR,OAAAA,IAAWC,0BAAAA,CAAgBP,OAAAA,EAAS,UAAA,EAAY,KAAA,CAAA;QAC1De,WAAAA,EAAWT,OAAAA;;AACVA,YAAAA,OAAAA,kBAAWU,cAAA,CAACC,GAAAA,EAAAA;gBAAEC,SAAAA,EAAU,uBAAA;gBAAwBC,aAAAA,EAAY;;YAC5D,CAACb,OAAAA,IAAWJ,IAAAA,KAASkB,SAAAA,kBAAaJ,cAAA,CAACC,GAAAA,EAAAA;gBAAEC,SAAAA,EAAWhB,IAAAA;gBAAMiB,aAAAA,EAAY;;AAClEhB,YAAAA,yBAAAA,CAAeH,OAAAA,EAAS,OAAA,CAAA;AACxBC,YAAAA,KAAAA,CAAMoB;;;AAGnB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeButtonGroup.js","sources":["../../../button/PrimeButtonGroup.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 { ButtonGroup } from 'primereact/buttongroup';\nimport { Button } from 'primereact/button';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { optionsProperty } from '../properties';\n\n/**\n * The `PrimeReact:buttonGroup` component - buttons joined into one visually continuous control.\n *\n * ButtonGroup styles its children by position, so it needs real `Button` elements as children. Slot\n * content is therefore rendered when a screen supplies it, and otherwise the group is built from a\n * `buttons` property - which is what lets a generated screen produce a group without having to nest\n * elements it does not otherwise need.\n *\n * PrimeReact 11 left the group itself alone; the only change is in the buttons, which take their label as\n * children now rather than through a `label` prop.\n */\nexport function PrimeButtonGroup({ element, slots }: RegisteredComponentProps) {\n const buttons = optionsProperty(element, 'buttons');\n return (\n <ButtonGroup data-scene-id={element.id}>\n {slots.content?.length ? slots.content : buttons.map((button) => <Button key={button.value}>{button.label}</Button>)}\n </ButtonGroup>\n );\n}\n"],"names":["PrimeButtonGroup","element","slots","buttons","optionsProperty","_jsx","ButtonGroup","data-scene-id","id","content","length","map","button","Button","label","value"],"mappings":";;;;;;;AAQA;;;;;;;;;;AAUC,IACM,SAASA,gBAAAA,CAAiB,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;IACzE,MAAMC,OAAAA,GAAUC,2BAAgBH,OAAAA,EAAS,SAAA,CAAA;AACzC,IAAA,qBACII,cAAA,CAACC,uBAAAA,EAAAA;AAAYC,QAAAA,eAAAA,EAAeN,QAAQO,EAAE;kBACjCN,KAAAA,CAAMO,OAAO,EAAEC,MAAAA,GAASR,KAAAA,CAAMO,OAAO,GAAGN,OAAAA,CAAQQ,GAAG,CAAC,CAACC,QAAAA,iBAAWP,cAAA,CAACQ,aAAAA,EAAAA;AAA2BD,gBAAAA,QAAAA,EAAAA,QAAAA,CAAOE;AAAtBF,aAAAA,EAAAA,QAAAA,CAAOG,KAAK,CAAA;;AAGtG
|
|
1
|
+
{"version":3,"file":"PrimeButtonGroup.js","sources":["../../../button/PrimeButtonGroup.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 { ButtonGroup } from 'primereact/buttongroup';\nimport { Button } from 'primereact/button';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { optionsProperty } from '../properties';\n\n/**\n * The `PrimeReact:buttonGroup` component - buttons joined into one visually continuous control.\n *\n * ButtonGroup styles its children by position, so it needs real `Button` elements as children. Slot\n * content is therefore rendered when a screen supplies it, and otherwise the group is built from a\n * `buttons` property - which is what lets a generated screen produce a group without having to nest\n * elements it does not otherwise need.\n *\n * PrimeReact 11 left the group itself alone; the only change is in the buttons, which take their label as\n * children now rather than through a `label` prop.\n */\nexport function PrimeButtonGroup({ element, slots }: RegisteredComponentProps) {\n const buttons = optionsProperty(element, 'buttons');\n return (\n <ButtonGroup data-scene-id={element.id}>\n {slots.content?.length ? slots.content : buttons.map((button) => <Button key={button.value}>{button.label}</Button>)}\n </ButtonGroup>\n );\n}\n"],"names":["PrimeButtonGroup","element","slots","buttons","optionsProperty","_jsx","ButtonGroup","data-scene-id","id","content","length","map","button","Button","label","value"],"mappings":";;;;;;;AAQA;;;;;;;;;;AAUC,IACM,SAASA,gBAAAA,CAAiB,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;IACzE,MAAMC,OAAAA,GAAUC,2BAAgBH,OAAAA,EAAS,SAAA,CAAA;AACzC,IAAA,qBACII,cAAA,CAACC,uBAAAA,EAAAA;AAAYC,QAAAA,eAAAA,EAAeN,QAAQO,EAAE;kBACjCN,KAAAA,CAAMO,OAAO,EAAEC,MAAAA,GAASR,KAAAA,CAAMO,OAAO,GAAGN,OAAAA,CAAQQ,GAAG,CAAC,CAACC,QAAAA,iBAAWP,cAAA,CAACQ,aAAAA,EAAAA;AAA2BD,gBAAAA,QAAAA,EAAAA,QAAAA,CAAOE;AAAtBF,aAAAA,EAAAA,QAAAA,CAAOG,KAAK,CAAA;;AAGtG;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeSpeedDial.js","sources":["../../../button/PrimeSpeedDial.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 { SpeedDial } from 'primereact/speeddial';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { stringProperty } from '../properties';\nimport { menuItemsProperty } from '../menuItems';\n\n/**\n * The `PrimeReact:speedDial` component - a floating action button that fans its actions out on hover.\n *\n * Rendered inside a sized, relatively positioned box because SpeedDial positions its actions absolutely\n * against its nearest positioned ancestor; dropped straight into a Scene tree it would otherwise anchor\n * itself to the page and float over unrelated content.\n *\n * PrimeReact 11 replaced the `model` prop with parts, so the items are written out here. That is more\n * lines but a better fit: each action is a real button the adapter can name and label, where v10's model\n * entries produced icon-only buttons with no accessible name unless the screen happened to think of one.\n * The label is used as the accessible name and as the tooltip, and the icon is marked decorative, so an\n * action reads the same to a screen reader as it does to a pointer.\n */\nexport function PrimeSpeedDial({ element }: RegisteredComponentProps) {\n const items = menuItemsProperty(element, 'items');\n return (\n <div data-scene-id={element.id} className='relative h-40 w-40'>\n <SpeedDial.Root\n direction={stringProperty(element, 'direction', 'up') as 'up' | 'down' | 'left' | 'right'}\n type={stringProperty(element, 'type', 'linear') as 'linear' | 'circle' | 'semi-circle' | 'quarter-circle'}>\n <SpeedDial.Trigger aria-label='Actions'>\n <i className='pi pi-plus' aria-hidden='true' />\n </SpeedDial.Trigger>\n <SpeedDial.List>\n {items.map((item, index) => (\n <SpeedDial.Item key={index} index={index}>\n <SpeedDial.Action aria-label={item.label} title={item.label} onClick={item.command}>\n <i className={item.icon ?? 'pi pi-circle'} aria-hidden='true' />\n </SpeedDial.Action>\n </SpeedDial.Item>\n ))}\n </SpeedDial.List>\n </SpeedDial.Root>\n </div>\n );\n}\n"],"names":["PrimeSpeedDial","element","items","menuItemsProperty","_jsx","div","data-scene-id","id","className","_jsxs","SpeedDial","Root","direction","stringProperty","type","Trigger","aria-label","i","aria-hidden","List","map","item","index","Item","Action","label","title","onClick","command","icon"],"mappings":";;;;;;;AAQA;;;;;;;;;;;;AAYC,IACM,SAASA,cAAAA,CAAe,EAAEC,OAAO,EAA4B,EAAA;IAChE,MAAMC,KAAAA,GAAQC,4BAAkBF,OAAAA,EAAS,OAAA,CAAA;AACzC,IAAA,qBACIG,cAAA,CAACC,KAAAA,EAAAA;AAAIC,QAAAA,eAAAA,EAAeL,QAAQM,EAAE;QAAEC,SAAAA,EAAU,oBAAA;gCACtCC,eAAA,CAACC,oBAAUC,IAAI,EAAA;YACXC,SAAAA,EAAWC,yBAAAA,CAAeZ,SAAS,WAAA,EAAa,IAAA,CAAA;YAChDa,IAAAA,EAAMD,yBAAAA,CAAeZ,SAAS,MAAA,EAAQ,QAAA,CAAA;;AACtC,8BAAAG,cAAA,CAACM,oBAAUK,OAAO,EAAA;oBAACC,YAAAA,EAAW,SAAA;AAC1B,oBAAA,QAAA,gBAAAZ,cAAA,CAACa,GAAAA,EAAAA;wBAAET,SAAAA,EAAU,YAAA;wBAAaU,aAAAA,EAAY;;;AAE1C,8BAAAd,cAAA,CAACM,oBAAUS,IAAI,EAAA;AACVjB,oBAAAA,QAAAA,EAAAA,KAAAA,CAAMkB,GAAG,CAAC,CAACC,MAAMC,KAAAA,iBACdlB,cAAA,CAACM,oBAAUa,IAAI,EAAA;4BAAaD,KAAAA,EAAOA,KAAAA;oDAC/BlB,cAAA,CAACM,oBAAUc,MAAM,EAAA;AAACR,gCAAAA,YAAAA,EAAYK,KAAKI,KAAK;AAAEC,gCAAAA,KAAAA,EAAOL,KAAKI,KAAK;AAAEE,gCAAAA,OAAAA,EAASN,KAAKO,OAAO;AAC9E,gCAAA,QAAA,gBAAAxB,cAAA,CAACa,GAAAA,EAAAA;oCAAET,SAAAA,EAAWa,IAAAA,CAAKQ,IAAI,IAAI,cAAA;oCAAgBX,aAAAA,EAAY;;;AAF1CI,yBAAAA,EAAAA,KAAAA,CAAAA;;;;;AAU7C
|
|
1
|
+
{"version":3,"file":"PrimeSpeedDial.js","sources":["../../../button/PrimeSpeedDial.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 { SpeedDial } from 'primereact/speeddial';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { stringProperty } from '../properties';\nimport { menuItemsProperty } from '../menuItems';\n\n/**\n * The `PrimeReact:speedDial` component - a floating action button that fans its actions out on hover.\n *\n * Rendered inside a sized, relatively positioned box because SpeedDial positions its actions absolutely\n * against its nearest positioned ancestor; dropped straight into a Scene tree it would otherwise anchor\n * itself to the page and float over unrelated content.\n *\n * PrimeReact 11 replaced the `model` prop with parts, so the items are written out here. That is more\n * lines but a better fit: each action is a real button the adapter can name and label, where v10's model\n * entries produced icon-only buttons with no accessible name unless the screen happened to think of one.\n * The label is used as the accessible name and as the tooltip, and the icon is marked decorative, so an\n * action reads the same to a screen reader as it does to a pointer.\n */\nexport function PrimeSpeedDial({ element }: RegisteredComponentProps) {\n const items = menuItemsProperty(element, 'items');\n return (\n <div data-scene-id={element.id} className='relative h-40 w-40'>\n <SpeedDial.Root\n direction={stringProperty(element, 'direction', 'up') as 'up' | 'down' | 'left' | 'right'}\n type={stringProperty(element, 'type', 'linear') as 'linear' | 'circle' | 'semi-circle' | 'quarter-circle'}>\n <SpeedDial.Trigger aria-label='Actions'>\n <i className='pi pi-plus' aria-hidden='true' />\n </SpeedDial.Trigger>\n <SpeedDial.List>\n {items.map((item, index) => (\n <SpeedDial.Item key={index} index={index}>\n <SpeedDial.Action aria-label={item.label} title={item.label} onClick={item.command}>\n <i className={item.icon ?? 'pi pi-circle'} aria-hidden='true' />\n </SpeedDial.Action>\n </SpeedDial.Item>\n ))}\n </SpeedDial.List>\n </SpeedDial.Root>\n </div>\n );\n}\n"],"names":["PrimeSpeedDial","element","items","menuItemsProperty","_jsx","div","data-scene-id","id","className","_jsxs","SpeedDial","Root","direction","stringProperty","type","Trigger","aria-label","i","aria-hidden","List","map","item","index","Item","Action","label","title","onClick","command","icon"],"mappings":";;;;;;;AAQA;;;;;;;;;;;;AAYC,IACM,SAASA,cAAAA,CAAe,EAAEC,OAAO,EAA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\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { SplitButton } from './SplitButton';\nimport { booleanProperty, stringProperty } from '../properties';\nimport { menuItemsProperty } from '../menuItems';\n\n/**\n * The `PrimeReact:splitButton` component - a primary action with a dropdown of related ones.\n *\n * PrimeReact 11 removed `SplitButton` with no replacement and no headless hook, so the adapter renders\n * Cratis's own {@link SplitButton}, itself composed from the `Button` and `Popover` that survived. Nothing\n * about the element's contract changed, which is the whole point of having an adapter layer at all.\n *\n * The secondary actions come from an `items` property rather than from slots, because they are data - a\n * list of labels and icons - and feeding a menu rendered React nodes would give it nothing to show in its\n * rows. `menuItemsProperty` is the same reader every other menu in this package uses, so a screen writes\n * items the same way here as it does for a menubar.\n */\nexport function PrimeSplitButton({ element }: RegisteredComponentProps) {\n return (\n <SplitButton\n data-scene-id={element.id}\n label={stringProperty(element, 'label')}\n icon={stringProperty(element, 'icon')}\n severity={stringProperty(element, 'severity')}\n items={menuItemsProperty(element, 'items')}\n disabled={booleanProperty(element, 'disabled', false)}\n />\n );\n}\n"],"names":["PrimeSplitButton","element","_jsx","SplitButton","data-scene-id","id","label","stringProperty","icon","severity","items","menuItemsProperty","disabled","booleanProperty"],"mappings":";;;;;;;AAAA;AACA;AAOA;;;;;;;;;;;AAWC,IACM,SAASA,gBAAAA,CAAiB,EAAEC,OAAO,EAA4B,EAAA;AAClE,IAAA,qBACIC,cAAA,CAACC,uBAAAA,EAAAA;AACGC,QAAAA,eAAAA,EAAeH,QAAQI,EAAE;AACzBC,QAAAA,KAAAA,EAAOC,0BAAeN,OAAAA,EAAS,OAAA,CAAA;AAC/BO,QAAAA,IAAAA,EAAMD,0BAAeN,OAAAA,EAAS,MAAA,CAAA;AAC9BQ,QAAAA,QAAAA,EAAUF,0BAAeN,OAAAA,EAAS,UAAA,CAAA;AAClCS,QAAAA,KAAAA,EAAOC,4BAAkBV,OAAAA,EAAS,OAAA,CAAA;QAClCW,QAAAA,EAAUC,0BAAAA,CAAgBZ,SAAS,UAAA,EAAY,KAAA;;AAG3D
|
|
1
|
+
{"version":3,"file":"PrimeSplitButton.js","sources":["../../../button/PrimeSplitButton.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 { RegisteredComponentProps } from '@cratis/scene.react';\nimport { SplitButton } from './SplitButton';\nimport { booleanProperty, stringProperty } from '../properties';\nimport { menuItemsProperty } from '../menuItems';\n\n/**\n * The `PrimeReact:splitButton` component - a primary action with a dropdown of related ones.\n *\n * PrimeReact 11 removed `SplitButton` with no replacement and no headless hook, so the adapter renders\n * Cratis's own {@link SplitButton}, itself composed from the `Button` and `Popover` that survived. Nothing\n * about the element's contract changed, which is the whole point of having an adapter layer at all.\n *\n * The secondary actions come from an `items` property rather than from slots, because they are data - a\n * list of labels and icons - and feeding a menu rendered React nodes would give it nothing to show in its\n * rows. `menuItemsProperty` is the same reader every other menu in this package uses, so a screen writes\n * items the same way here as it does for a menubar.\n */\nexport function PrimeSplitButton({ element }: RegisteredComponentProps) {\n return (\n <SplitButton\n data-scene-id={element.id}\n label={stringProperty(element, 'label')}\n icon={stringProperty(element, 'icon')}\n severity={stringProperty(element, 'severity')}\n items={menuItemsProperty(element, 'items')}\n disabled={booleanProperty(element, 'disabled', false)}\n />\n );\n}\n"],"names":["PrimeSplitButton","element","_jsx","SplitButton","data-scene-id","id","label","stringProperty","icon","severity","items","menuItemsProperty","disabled","booleanProperty"],"mappings":";;;;;;;AAAA;AACA;AAOA;;;;;;;;;;;AAWC,IACM,SAASA,gBAAAA,CAAiB,EAAEC,OAAO,EAA4B,EAAA;AAClE,IAAA,qBACIC,cAAA,CAACC,uBAAAA,EAAAA;AACGC,QAAAA,eAAAA,EAAeH,QAAQI,EAAE;AACzBC,QAAAA,KAAAA,EAAOC,0BAAeN,OAAAA,EAAS,OAAA,CAAA;AAC/BO,QAAAA,IAAAA,EAAMD,0BAAeN,OAAAA,EAAS,MAAA,CAAA;AAC9BQ,QAAAA,QAAAA,EAAUF,0BAAeN,OAAAA,EAAS,UAAA,CAAA;AAClCS,QAAAA,KAAAA,EAAOC,4BAAkBV,OAAAA,EAAS,OAAA,CAAA;QAClCW,QAAAA,EAAUC,0BAAAA,CAAgBZ,SAAS,UAAA,EAAY,KAAA;;AAG3D;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SplitButton.js","sources":["../../../button/SplitButton.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 { HTMLAttributes } from 'react';\nimport { Button } from 'primereact/button';\nimport { Popover } from 'primereact/popover';\nimport { MenuItem } from '../MenuItem';\n\n/**\n * Configuration for {@link SplitButton}.\n */\nexport interface SplitButtonProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'onClick' | 'children'> {\n /**\n * The text on the primary half. This is the action the control is named after - the one a reader\n * takes without opening anything.\n */\n label?: string;\n\n /**\n * An icon class shown before the label on the primary half.\n */\n icon?: string;\n\n /**\n * The secondary actions, shown when the dropdown half is opened. Empty means there are none, and the\n * dropdown half is left off entirely rather than rendered as a control that opens onto nothing.\n */\n items?: MenuItem[];\n\n /**\n * Whether both halves are unavailable. There is no way to disable only one: a split button with a\n * dead primary action is a menu wearing the wrong shape.\n */\n disabled?: boolean;\n\n /**\n * The PrimeReact severity to tint both halves with, so the two read as one control.\n */\n severity?: string;\n\n /**\n * Invoked when the primary half is pressed. Named apart from the DOM `onClick` this component would\n * otherwise inherit, because the two are different questions - \"was the action taken\" against\n * \"was anything in here clicked\", including the dropdown toggle.\n */\n onAction?: () => void;\n}\n\n/**\n * One row of the dropdown menu.\n *\n * Kept apart from the composition below so the three shapes an entry can take - a divider, a link, a\n * command - are three plain branches rather than nested conditionals inside the JSX. An entry carrying a\n * `url` becomes a real anchor: it is a navigation, and rendering it as a button would cost the reader the\n * middle-click, the copy-link and the status bar preview that make a link a link.\n */\nfunction SplitButtonItem({ item }: { item: MenuItem }) {\n const className = 'flex w-full items-center gap-2 border-0 bg-transparent px-3 py-2 text-left no-underline disabled:opacity-50';\n const content = (\n <>\n {item.icon !== undefined && <i className={item.icon} aria-hidden='true' />}\n {item.label}\n </>\n );\n\n if (item.separator === true) return <li role='separator' className='my-1 border-t' />;\n\n if (item.url !== undefined) {\n return (\n <li role='none'>\n <a role='menuitem' href={item.url} className={className}>\n {content}\n </a>\n </li>\n );\n }\n\n return (\n <li role='none'>\n <button type='button' role='menuitem' disabled={item.disabled} onClick={item.command} className={className}>\n {content}\n </button>\n </li>\n );\n}\n\n/**\n * A primary action with a dropdown of related ones beside it.\n *\n * Cratis owns this component. PrimeReact 10 had `SplitButton`; PrimeReact 11 removed it with no\n * replacement and no headless hook, while `splitButton` remains a name this package's manifest publishes.\n * It is composed rather than reimplemented: both halves are PrimeReact `Button`s and the menu hangs off a\n * PrimeReact `Popover`, so the control is themed, positioned, portaled and dismissed by the same machinery\n * every other overlay in the application uses. What is actually ours is the arrangement and the menu\n * markup - a `menu` / `menuitem` structure over {@link MenuItem}, which is the part v10 left to chance.\n *\n * A dropdown half with nothing behind it is not rendered, so an authored but not-yet-populated item list\n * degrades to a plain button.\n *\n * What it deliberately does not carry over from v10: nested submenus - `items` is read one level deep,\n * because a split button whose menu has drawers is a menubar and should say so; the `menuButtonProps` /\n * `buttonProps` escape hatches, which existed to reach past the component and are unnecessary when the\n * halves are just Buttons; the `loading` state, which v11's Button no longer has; and `appendTo` and\n * z-index juggling, which the popover's portal makes moot.\n */\nexport function SplitButton({ label, icon, items = [], disabled = false, severity, onAction, className, ...rest }: SplitButtonProps) {\n return (\n <span {...rest} className={['inline-flex', className].filter(Boolean).join(' ')}>\n <Button severity={severity} disabled={disabled} onClick={onAction}>\n {icon !== undefined && <i className={icon} aria-hidden='true' />}\n {label}\n </Button>\n {items.length > 0 && (\n <Popover.Root>\n <Popover.Trigger as={Button} severity={severity} disabled={disabled} aria-label={label === undefined ? 'More actions' : `More actions for ${label}`}>\n <i className='pi pi-chevron-down' aria-hidden='true' />\n </Popover.Trigger>\n <Popover.Portal>\n <Popover.Positioner>\n <Popover.Popup>\n <Popover.Content>\n <ul role='menu' className='m-0 flex list-none flex-col p-0'>\n {items.map((item, index) => (\n <SplitButtonItem key={index} item={item} />\n ))}\n </ul>\n </Popover.Content>\n </Popover.Popup>\n </Popover.Positioner>\n </Popover.Portal>\n </Popover.Root>\n )}\n </span>\n );\n}\n"],"names":["SplitButtonItem","item","className","content","_jsxs","_Fragment","icon","undefined","_jsx","i","aria-hidden","label","separator","li","role","url","a","href","button","type","disabled","onClick","command","SplitButton","items","severity","onAction","rest","span","filter","Boolean","join","Button","length","Popover","Root","Trigger","as","aria-label","Portal","Positioner","Popup","Content","ul","map","index"],"mappings":";;;;;;AAAA;AACA;AA+CA;;;;;;;AAOC,IACD,SAASA,eAAAA,CAAgB,EAAEC,IAAI,EAAsB,EAAA;AACjD,IAAA,MAAMC,SAAAA,GAAY,6GAAA;AAClB,IAAA,MAAMC,OAAAA,iBACFC,eAAA,CAAAC,mBAAA,EAAA;;YACKJ,IAAAA,CAAKK,IAAI,KAAKC,SAAAA,kBAAaC,cAAA,CAACC,GAAAA,EAAAA;AAAEP,gBAAAA,SAAAA,EAAWD,KAAKK,IAAI;gBAAEI,aAAAA,EAAY;;AAChET,YAAAA,IAAAA,CAAKU;;;AAId,IAAA,IAAIV,IAAAA,CAAKW,SAAS,KAAK,IAAA,EAAM,qBAAOJ,cAAA,CAACK,IAAAA,EAAAA;QAAGC,IAAAA,EAAK,WAAA;QAAYZ,SAAAA,EAAU;;IAEnE,IAAID,IAAAA,CAAKc,GAAG,KAAKR,SAAAA,EAAW;AACxB,QAAA,qBACIC,cAAA,CAACK,IAAAA,EAAAA;YAAGC,IAAAA,EAAK,MAAA;AACL,YAAA,QAAA,gBAAAN,cAAA,CAACQ,GAAAA,EAAAA;gBAAEF,IAAAA,EAAK,UAAA;AAAWG,gBAAA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3B,cAAA,CAAC0B,gBAAQE,OAAO,EAAA;wBAACC,EAAAA,EAAIL,aAAAA;wBAAQP,QAAAA,EAAUA,QAAAA;wBAAUL,QAAAA,EAAUA,QAAAA;AAAUkB,wBAAAA,YAAAA,EAAY3B,UAAUJ,SAAAA,GAAY,cAAA,GAAiB,CAAC,iBAAiB,EAAEI,KAAAA,CAAAA,CAAO;AAC/I,wBAAA,QAAA,gBAAAH,cAAA,CAACC,GAAAA,EAAAA;4BAAEP,SAAAA,EAAU,oBAAA;4BAAqBQ,aAAAA,EAAY;;;AAElD,kCAAAF,cAAA,CAAC0B,gBAAQK,MAAM,EAAA;gDACX/B,cAAA,CAAC0B,gBAAQM,UAAU,EAAA;oDACfhC,cAAA,CAAC0B,gBAAQO,KAAK,EAAA;wDACVjC,cAAA,CAAC0B,gBAAQQ,OAAO,EAAA;AACZ,oCAAA,QAAA,gBAAAlC,cAAA,CAACmC,IAAAA,EAAAA;wCAAG7B,IAAAA,EAAK,MAAA;wCAAOZ,SAAAA,EAAU,iCAAA;AACrBsB,wCAAAA,QAAAA,EAAAA,KAAAA,CAAMoB,GAAG,CAAC,CAAC3C,IAAAA,EAAM4C,sBACdrC,cAAA,CAACR,eAAAA,EAAAA;gDAA4BC,IAAAA,EAAMA;AAAb4C,6CAAAA,EAAAA,KAAAA,CAAAA;;;;;;;;;;AAWlE
|
|
1
|
+
{"version":3,"file":"SplitButton.js","sources":["../../../button/SplitButton.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 { HTMLAttributes } from 'react';\nimport { Button } from 'primereact/button';\nimport { Popover } from 'primereact/popover';\nimport { MenuItem } from '../MenuItem';\n\n/**\n * Configuration for {@link SplitButton}.\n */\nexport interface SplitButtonProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'onClick' | 'children'> {\n /**\n * The text on the primary half. This is the action the control is named after - the one a reader\n * takes without opening anything.\n */\n label?: string;\n\n /**\n * An icon class shown before the label on the primary half.\n */\n icon?: string;\n\n /**\n * The secondary actions, shown when the dropdown half is opened. Empty means there are none, and the\n * dropdown half is left off entirely rather than rendered as a control that opens onto nothing.\n */\n items?: MenuItem[];\n\n /**\n * Whether both halves are unavailable. There is no way to disable only one: a split button with a\n * dead primary action is a menu wearing the wrong shape.\n */\n disabled?: boolean;\n\n /**\n * The PrimeReact severity to tint both halves with, so the two read as one control.\n */\n severity?: string;\n\n /**\n * Invoked when the primary half is pressed. Named apart from the DOM `onClick` this component would\n * otherwise inherit, because the two are different questions - \"was the action taken\" against\n * \"was anything in here clicked\", including the dropdown toggle.\n */\n onAction?: () => void;\n}\n\n/**\n * One row of the dropdown menu.\n *\n * Kept apart from the composition below so the three shapes an entry can take - a divider, a link, a\n * command - are three plain branches rather than nested conditionals inside the JSX. An entry carrying a\n * `url` becomes a real anchor: it is a navigation, and rendering it as a button would cost the reader the\n * middle-click, the copy-link and the status bar preview that make a link a link.\n */\nfunction SplitButtonItem({ item }: { item: MenuItem }) {\n const className = 'flex w-full items-center gap-2 border-0 bg-transparent px-3 py-2 text-left no-underline disabled:opacity-50';\n const content = (\n <>\n {item.icon !== undefined && <i className={item.icon} aria-hidden='true' />}\n {item.label}\n </>\n );\n\n if (item.separator === true) return <li role='separator' className='my-1 border-t' />;\n\n if (item.url !== undefined) {\n return (\n <li role='none'>\n <a role='menuitem' href={item.url} className={className}>\n {content}\n </a>\n </li>\n );\n }\n\n return (\n <li role='none'>\n <button type='button' role='menuitem' disabled={item.disabled} onClick={item.command} className={className}>\n {content}\n </button>\n </li>\n );\n}\n\n/**\n * A primary action with a dropdown of related ones beside it.\n *\n * Cratis owns this component. PrimeReact 10 had `SplitButton`; PrimeReact 11 removed it with no\n * replacement and no headless hook, while `splitButton` remains a name this package's manifest publishes.\n * It is composed rather than reimplemented: both halves are PrimeReact `Button`s and the menu hangs off a\n * PrimeReact `Popover`, so the control is themed, positioned, portaled and dismissed by the same machinery\n * every other overlay in the application uses. What is actually ours is the arrangement and the menu\n * markup - a `menu` / `menuitem` structure over {@link MenuItem}, which is the part v10 left to chance.\n *\n * A dropdown half with nothing behind it is not rendered, so an authored but not-yet-populated item list\n * degrades to a plain button.\n *\n * What it deliberately does not carry over from v10: nested submenus - `items` is read one level deep,\n * because a split button whose menu has drawers is a menubar and should say so; the `menuButtonProps` /\n * `buttonProps` escape hatches, which existed to reach past the component and are unnecessary when the\n * halves are just Buttons; the `loading` state, which v11's Button no longer has; and `appendTo` and\n * z-index juggling, which the popover's portal makes moot.\n */\nexport function SplitButton({ label, icon, items = [], disabled = false, severity, onAction, className, ...rest }: SplitButtonProps) {\n return (\n <span {...rest} className={['inline-flex', className].filter(Boolean).join(' ')}>\n <Button severity={severity} disabled={disabled} onClick={onAction}>\n {icon !== undefined && <i className={icon} aria-hidden='true' />}\n {label}\n </Button>\n {items.length > 0 && (\n <Popover.Root>\n <Popover.Trigger as={Button} severity={severity} disabled={disabled} aria-label={label === undefined ? 'More actions' : `More actions for ${label}`}>\n <i className='pi pi-chevron-down' aria-hidden='true' />\n </Popover.Trigger>\n <Popover.Portal>\n <Popover.Positioner>\n <Popover.Popup>\n <Popover.Content>\n <ul role='menu' className='m-0 flex list-none flex-col p-0'>\n {items.map((item, index) => (\n <SplitButtonItem key={index} item={item} />\n ))}\n </ul>\n </Popover.Content>\n </Popover.Popup>\n </Popover.Positioner>\n </Popover.Portal>\n </Popover.Root>\n )}\n </span>\n );\n}\n"],"names":["SplitButtonItem","item","className","content","_jsxs","_Fragment","icon","undefined","_jsx","i","aria-hidden","label","separator","li","role","url","a","href","button","type","disabled","onClick","command","SplitButton","items","severity","onAction","rest","span","filter","Boolean","join","Button","length","Popover","Root","Trigger","as","aria-label","Portal","Positioner","Popup","Content","ul","map","index"],"mappings":";;;;;;AAAA;AACA;AA+CA;;;;;;;AAOC,IACD,SAASA,eAAAA,CAAgB,EAAEC,IAAI,EAAsB,EAAA;AACjD,IAAA,MAAMC,SAAAA,GAAY,6GAAA;AAClB,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A;AACrBsB,wCAAAA,QAAAA,EAAAA,KAAAA,CAAMoB,GAAG,CAAC,CAAC3C,IAAAA,EAAM4C,sBACdrC,cAAA,CAACR,eAAAA,EAAAA;gDAA4BC,IAAAA,EAAMA;AAAb4C,6CAAAA,EAAAA,KAAAA,CAAAA;;;;;;;;;;AAWlE;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Column.js","sources":["../../../data/Column.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 { FC, ReactNode } from 'react';\n\n/**\n * What one column of a table declares about itself.\n *\n * This is deliberately the smallest set a table needs to draw a heading and a cell. PrimeReact 10's\n * `Column` also carried `editor`, `frozen`, `footer`, `colSpan` and `expander`; none of them are carried\n * over. Editing, frozen panes and footers are table-wide behaviors that a Scene screen has no way to\n * drive - there is nowhere for an edit to go and nothing to compute a footer from - and `colSpan` and\n * `expander` only mean anything inside layouts (column groups, nested rows) this package no longer\n * offers. Re-declaring them here would advertise capabilities the adapters cannot honor.\n */\nexport interface ColumnProps {\n /**\n * The row property the column shows. Also the field the table sorts and filters by, which is why a\n * column without one gets neither: there is nothing to key the operation on.\n */\n field?: string;\n\n /**\n * The column heading. A column authored with only a field falls back to the field name rather than\n * rendering blank, so a half-configured table still reads as a table.\n */\n header?: string;\n\n /**\n * Renders the cell from the whole row instead of from a single field. This is the escape hatch for a\n * column that shows something derived - two fields joined, a formatted date, a badge - and it is the\n * one reason a column may sensibly omit `field`.\n */\n body?: (row: Record<string, unknown>) => ReactNode;\n\n /**\n * Whether clicking the heading sorts by this column.\n */\n sortable?: boolean;\n\n /**\n * Whether the heading offers an inline filter for this column.\n */\n filter?: boolean;\n}\n\n/**\n * One column of a table - Cratis-owned, because PrimeReact 11 removed `primereact/column` outright.\n *\n * In PrimeReact 10 `Column` was a real participant: `DataTable` walked its children, recognized them by\n * React element type, and rendered the table from their props. PrimeReact 11 replaced that with a\n * compositional table whose header and body cells the caller writes out itself, so nothing in the library\n * is left to declare a column with. Cratis Components rebuilt the same `<Column field header body\n * sortable filter />` authoring model on top of the new table, and this is that same move for Scene: the\n * component renders nothing on its own and exists only to be read.\n *\n * Being a pure declaration is the whole point - it is what lets a column be written where it belongs,\n * inside the table it configures, without the table having to interpret arbitrary children.\n */\nexport const Column: FC<ColumnProps> = () => null;\n\nColumn.displayName = 'Column';\n"],"names":["Column","displayName"],"mappings":";;AAAA;AACA;AA6CA;;;;;;;;;;;;AAYC,IACM,MAAMA,MAAAA,GAA0B,IAAM;AAE7CA,MAAAA,CAAOC,WAAW,GAAG,QAAA
|
|
1
|
+
{"version":3,"file":"Column.js","sources":["../../../data/Column.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 { FC, ReactNode } from 'react';\n\n/**\n * What one column of a table declares about itself.\n *\n * This is deliberately the smallest set a table needs to draw a heading and a cell. PrimeReact 10's\n * `Column` also carried `editor`, `frozen`, `footer`, `colSpan` and `expander`; none of them are carried\n * over. Editing, frozen panes and footers are table-wide behaviors that a Scene screen has no way to\n * drive - there is nowhere for an edit to go and nothing to compute a footer from - and `colSpan` and\n * `expander` only mean anything inside layouts (column groups, nested rows) this package no longer\n * offers. Re-declaring them here would advertise capabilities the adapters cannot honor.\n */\nexport interface ColumnProps {\n /**\n * The row property the column shows. Also the field the table sorts and filters by, which is why a\n * column without one gets neither: there is nothing to key the operation on.\n */\n field?: string;\n\n /**\n * The column heading. A column authored with only a field falls back to the field name rather than\n * rendering blank, so a half-configured table still reads as a table.\n */\n header?: string;\n\n /**\n * Renders the cell from the whole row instead of from a single field. This is the escape hatch for a\n * column that shows something derived - two fields joined, a formatted date, a badge - and it is the\n * one reason a column may sensibly omit `field`.\n */\n body?: (row: Record<string, unknown>) => ReactNode;\n\n /**\n * Whether clicking the heading sorts by this column.\n */\n sortable?: boolean;\n\n /**\n * Whether the heading offers an inline filter for this column.\n */\n filter?: boolean;\n}\n\n/**\n * One column of a table - Cratis-owned, because PrimeReact 11 removed `primereact/column` outright.\n *\n * In PrimeReact 10 `Column` was a real participant: `DataTable` walked its children, recognized them by\n * React element type, and rendered the table from their props. PrimeReact 11 replaced that with a\n * compositional table whose header and body cells the caller writes out itself, so nothing in the library\n * is left to declare a column with. Cratis Components rebuilt the same `<Column field header body\n * sortable filter />` authoring model on top of the new table, and this is that same move for Scene: the\n * component renders nothing on its own and exists only to be read.\n *\n * Being a pure declaration is the whole point - it is what lets a column be written where it belongs,\n * inside the table it configures, without the table having to interpret arbitrary children.\n */\nexport const Column: FC<ColumnProps> = () => null;\n\nColumn.displayName = 'Column';\n"],"names":["Column","displayName"],"mappings":";;AAAA;AACA;AA6CA;;;;;;;;;;;;AAYC,IACM,MAAMA,MAAAA,GAA0B,IAAM;AAE7CA,MAAAA,CAAOC,WAAW,GAAG,QAAA;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.js","sources":["../../../data/Pagination.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 { Paginator, type PaginatorPagesInstance, type PaginatorRootChangeEvent } from 'primereact/paginator';\n\n/**\n * How a caller drives {@link Pagination}.\n */\nexport interface PaginationProps {\n /**\n * The page being shown, counted from one. PrimeReact 11's paginator is one-based throughout - its\n * `defaultPage` is `1`, and the page numbers it reports back are the ones it prints - so the adapters\n * count the same way rather than translating at every edge.\n */\n page: number;\n\n /**\n * How many records there are in total, across all pages.\n */\n total: number;\n\n /**\n * How many records fit on a page.\n */\n itemsPerPage: number;\n\n /**\n * Called with the page the user asked for.\n */\n onPageChange: (page: number) => void;\n\n /**\n * The Scene element id to tag the rendered paginator with, when the paginator *is* the adapter's\n * output rather than a part of it.\n */\n sceneId?: string;\n}\n\n/**\n * Page navigation, assembled once from PrimeReact 11's paginator parts.\n *\n * PrimeReact 11 ships the paginator as a namespace of parts - a root that owns the page arithmetic and\n * hands out pre-built button props, and separate first/previous/pages/next/last elements the caller\n * arranges. That is more expressive than PrimeReact 10's single component, but it is also several dozen\n * lines that two adapters in this folder would otherwise both write out: the `paginator` component\n * itself, and `dataView`, which in PrimeReact 11 no longer owns its data and so cannot page it either.\n * Assembling it here means the two agree on what a paginator looks like.\n *\n * The paginator is driven as a controlled component so the caller always knows which page is showing -\n * `dataView` needs it to slice its rows, and an uncontrolled paginator would keep that inside itself.\n *\n * @param props How to drive the paginator.\n * @returns The paginator.\n */\nexport function Pagination({ page, total, itemsPerPage, onPageChange, sceneId }: PaginationProps) {\n return (\n <Paginator.Root\n data-scene-id={sceneId}\n page={page}\n total={total}\n itemsPerPage={itemsPerPage}\n onPageChange={(event: PaginatorRootChangeEvent) => onPageChange(event.value)}>\n <Paginator.Content>\n <Paginator.First>«</Paginator.First>\n <Paginator.Prev>‹</Paginator.Prev>\n <Paginator.Pages>\n {(pages: PaginatorPagesInstance) =>\n pages.paginator?.pages.map((item, index) =>\n item.type === 'page' ? (\n <Paginator.Page key={`page-${item.value}`} value={item.value} />\n ) : (\n <Paginator.Ellipsis key={`ellipsis-${index}`}>…</Paginator.Ellipsis>\n )\n )\n }\n </Paginator.Pages>\n <Paginator.Next>›</Paginator.Next>\n <Paginator.Last>»</Paginator.Last>\n </Paginator.Content>\n </Paginator.Root>\n );\n}\n"],"names":["Pagination","page","total","itemsPerPage","onPageChange","sceneId","_jsx","Paginator","Root","data-scene-id","event","value","_jsxs","Content","First","Prev","Pages","pages","paginator","map","item","index","type","Page","Ellipsis","Next","Last"],"mappings":";;;;;AAsCA;;;;;;;;;;;;;;;AAeC,IACM,SAASA,UAAAA,CAAW,EAAEC,IAAI,EAAEC,KAAK,EAAEC,YAAY,EAAEC,YAAY,EAAEC,OAAO,EAAmB,EAAA;IAC5F,qBACIC,cAAA,CAACC,oBAAUC,IAAI,EAAA;QACXC,eAAAA,EAAeJ,OAAAA;QACfJ,IAAAA,EAAMA,IAAAA;QACNC,KAAAA,EAAOA,KAAAA;QACPC,YAAAA,EAAcA,YAAAA;AACdC,QAAAA,YAAAA,EAAc,CAACM,KAAAA,GAAoCN,YAAAA,CAAaM,KAAAA,CAAMC,KAAK,CAAA;gCAC3EC,eAAA,CAACL,oBAAUM,OAAO,EAAA;;AACd,8BAAAP,cAAA,CAACC,oBAAUO,KAAK,EAAA;AAAC,oBAAA,QAAA,EAAA;;AACjB,8BAAAR,cAAA,CAACC,oBAAUQ,IAAI,EAAA;AAAC,oBAAA,QAAA,EAAA;;AAChB,8BAAAT,cAAA,CAACC,oBAAUS,KAAK,EAAA;AACX,oBAAA,QAAA,EAAA,CAACC,KAAAA,GACEA,KAAAA,CAAMC,SAAS,EAAED,MAAME,GAAAA,CAAI,CAACC,IAAAA,EAAMC,KAAAA,GAC9BD,KAAKE,IAAI,KAAK,MAAA,iBACVhB,cAAA,CAACC,oBAAUgB,IAAI,EAAA;AAA4BZ,gCAAAA,KAAAA,EAAOS,KAAKT;+BAAlC,CAAC,KAAK,EAAES,IAAAA,CAAKT,KAAK,EAAE,CAAA,iBAEzCL,cAAA,CAACC,oBAAUiB,QAAQ,EAAA;AAA2B,gCAAA,QAAA,EAAA;+BAArB,CAAC,SAAS,EAAEH,KAAAA,CAAAA,CAAO,CAAA;;AAK5D,8BAAAf,cAAA,CAACC,oBAAUkB,IAAI,EAAA;AAAC,oBAAA,QAAA,EAAA;;AAChB,8BAAAnB,cAAA,CAACC,oBAAUmB,IAAI,EAAA;AAAC,oBAAA,QAAA,EAAA;;;;;AAIhC
|
|
1
|
+
{"version":3,"file":"Pagination.js","sources":["../../../data/Pagination.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 { Paginator, type PaginatorPagesInstance, type PaginatorRootChangeEvent } from 'primereact/paginator';\n\n/**\n * How a caller drives {@link Pagination}.\n */\nexport interface PaginationProps {\n /**\n * The page being shown, counted from one. PrimeReact 11's paginator is one-based throughout - its\n * `defaultPage` is `1`, and the page numbers it reports back are the ones it prints - so the adapters\n * count the same way rather than translating at every edge.\n */\n page: number;\n\n /**\n * How many records there are in total, across all pages.\n */\n total: number;\n\n /**\n * How many records fit on a page.\n */\n itemsPerPage: number;\n\n /**\n * Called with the page the user asked for.\n */\n onPageChange: (page: number) => void;\n\n /**\n * The Scene element id to tag the rendered paginator with, when the paginator *is* the adapter's\n * output rather than a part of it.\n */\n sceneId?: string;\n}\n\n/**\n * Page navigation, assembled once from PrimeReact 11's paginator parts.\n *\n * PrimeReact 11 ships the paginator as a namespace of parts - a root that owns the page arithmetic and\n * hands out pre-built button props, and separate first/previous/pages/next/last elements the caller\n * arranges. That is more expressive than PrimeReact 10's single component, but it is also several dozen\n * lines that two adapters in this folder would otherwise both write out: the `paginator` component\n * itself, and `dataView`, which in PrimeReact 11 no longer owns its data and so cannot page it either.\n * Assembling it here means the two agree on what a paginator looks like.\n *\n * The paginator is driven as a controlled component so the caller always knows which page is showing -\n * `dataView` needs it to slice its rows, and an uncontrolled paginator would keep that inside itself.\n *\n * @param props How to drive the paginator.\n * @returns The paginator.\n */\nexport function Pagination({ page, total, itemsPerPage, onPageChange, sceneId }: PaginationProps) {\n return (\n <Paginator.Root\n data-scene-id={sceneId}\n page={page}\n total={total}\n itemsPerPage={itemsPerPage}\n onPageChange={(event: PaginatorRootChangeEvent) => onPageChange(event.value)}>\n <Paginator.Content>\n <Paginator.First>«</Paginator.First>\n <Paginator.Prev>‹</Paginator.Prev>\n <Paginator.Pages>\n {(pages: PaginatorPagesInstance) =>\n pages.paginator?.pages.map((item, index) =>\n item.type === 'page' ? (\n <Paginator.Page key={`page-${item.value}`} value={item.value} />\n ) : (\n <Paginator.Ellipsis key={`ellipsis-${index}`}>…</Paginator.Ellipsis>\n )\n )\n }\n </Paginator.Pages>\n <Paginator.Next>›</Paginator.Next>\n <Paginator.Last>»</Paginator.Last>\n </Paginator.Content>\n </Paginator.Root>\n );\n}\n"],"names":["Pagination","page","total","itemsPerPage","onPageChange","sceneId","_jsx","Paginator","Root","data-scene-id","event","value","_jsxs","Content","First","Prev","Pages","pages","paginator","map","item","index","type","Page","Ellipsis","Next","Last"],"mappings":";;;;;AAsCA;;;;;;;;;;;;;;;AAeC,IACM,SAASA,UAAAA,CAAW,EAAEC,IAAI,EAAEC,KAAK,EAAEC,YAAY,EAAEC,YAAY,EAAEC,OAAO,EAAmB,EAAA;IAC5F,qBACIC,cAAA,CAACC,oBAAUC,IAAI,EAAA;QACXC,eAAAA,EAAeJ,OAAAA;QACfJ,IAAAA,EAAMA,IAAAA;QACNC,KAAAA,EAAOA,KAAAA;QACPC,YAAAA,EAAcA,YAAAA;AACdC,QAAAA,YAAAA,EAAc,CAACM,KAAAA,GAAoCN,YAAAA,CAAaM,KAAAA,CAAMC,KAAK,CAAA;gCAC3EC,eAAA,CAACL,oBAAUM,OAAO,EAAA;;AACd,8BAAAP,cAAA,CAACC,oBAAUO,KAAK,EAAA;AAAC,oBAAA,QAAA,EAAA;;AACjB,8BAAAR,cAAA,CAACC,oBAAUQ,IAAI,EAAA;AAAC,oBAAA,QAAA,EAAA;;AAChB,8BAAAT,cAAA,CAACC,oBAAUS,KAAK,EAAA;AACX,oBAAA,QAAA,EAAA,CAACC,KAAAA,GACEA,KAAAA,CAAMC,SAAS,EAAED,MAAME,GAAAA,CAAI,CAACC,IAAAA,EAAMC,KAAAA,GAC9BD,KAAKE,IAAI,KAAK,MAAA,iBACVhB,cAAA,CAACC,oBAAUgB,IAAI,EAAA;AAA4BZ,gCAAAA,KAAAA,EAAOS,KAAKT;+BAAlC,CAAC,KAAK,EAAES,IAAAA,CAAKT,KAAK,EAAE,CAAA,iBAEzCL,cAAA,CAACC,oBAAUiB,QAAQ,EAAA;AAA2B,gCAAA,QAAA,EAAA;+BAArB,CAAC,SAAS,EAAEH,KAAAA,CAAAA,CAAO,CAAA;;AAK5D,8BAAAf,cAAA,CAACC,oBAAUkB,IAAI,EAAA;AAAC,oBAAA,QAAA,EAAA;;AAChB,8BAAAnB,cAAA,CAACC,oBAAUmB,IAAI,EAAA;AAAC,oBAAA,QAAA,EAAA;;;;;AAIhC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeColumn.js","sources":["../../../data/PrimeColumn.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 { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, stringProperty } from '../properties';\nimport { Column } from './Column';\n\n/**\n * The `PrimeReact:column` component - one column of a table.\n *\n * This renders {@link Column}, which is Cratis-owned rather than PrimeReact's: PrimeReact 11 removed\n * `primereact/column` along with the table that walked it. Like its predecessor it is configuration\n * rather than output - it renders nothing on its own and only means something inside a table - so a bare\n * `column` on a screen looking blank is the component working, not failing.\n *\n * When a `column` element is nested under `dataTable` or `table`, the table reads its properties off the\n * model rather than off this rendered output; see `columnDefinitions` for why that indirection exists and\n * why PrimeReact 11 did not change it.\n */\nexport function PrimeColumn({ element }: RegisteredComponentProps) {\n const field = stringProperty(element, 'field', '');\n return (\n <Column\n field={field}\n header={stringProperty(element, 'header', field)}\n sortable={booleanProperty(element, 'sortable', false)}\n filter={booleanProperty(element, 'filter', false)}\n />\n );\n}\n"],"names":["PrimeColumn","element","field","stringProperty","_jsx","Column","header","sortable","booleanProperty","filter"],"mappings":";;;;;;AAAA;AACA;AAMA;;;;;;;;;;;AAWC,IACM,SAASA,WAAAA,CAAY,EAAEC,OAAO,EAA4B,EAAA;IAC7D,MAAMC,KAAAA,GAAQC,yBAAAA,CAAeF,OAAAA,EAAS,OAAA,EAAS,EAAA,CAAA;AAC/C,IAAA,qBACIG,cAAA,CAACC,aAAAA,EAAAA;QACGH,KAAAA,EAAOA,KAAAA;QACPI,MAAAA,EAAQH,yBAAAA,CAAeF,SAAS,QAAA,EAAUC,KAAAA,CAAAA;QAC1CK,QAAAA,EAAUC,0BAAAA,CAAgBP,SAAS,UAAA,EAAY,KAAA,CAAA;QAC/CQ,MAAAA,EAAQD,0BAAAA,CAAgBP,SAAS,QAAA,EAAU,KAAA;;AAGvD
|
|
1
|
+
{"version":3,"file":"PrimeColumn.js","sources":["../../../data/PrimeColumn.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 { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, stringProperty } from '../properties';\nimport { Column } from './Column';\n\n/**\n * The `PrimeReact:column` component - one column of a table.\n *\n * This renders {@link Column}, which is Cratis-owned rather than PrimeReact's: PrimeReact 11 removed\n * `primereact/column` along with the table that walked it. Like its predecessor it is configuration\n * rather than output - it renders nothing on its own and only means something inside a table - so a bare\n * `column` on a screen looking blank is the component working, not failing.\n *\n * When a `column` element is nested under `dataTable` or `table`, the table reads its properties off the\n * model rather than off this rendered output; see `columnDefinitions` for why that indirection exists and\n * why PrimeReact 11 did not change it.\n */\nexport function PrimeColumn({ element }: RegisteredComponentProps) {\n const field = stringProperty(element, 'field', '');\n return (\n <Column\n field={field}\n header={stringProperty(element, 'header', field)}\n sortable={booleanProperty(element, 'sortable', false)}\n filter={booleanProperty(element, 'filter', false)}\n />\n );\n}\n"],"names":["PrimeColumn","element","field","stringProperty","_jsx","Column","header","sortable","booleanProperty","filter"],"mappings":";;;;;;AAAA;AACA;AAMA;;;;;;;;;;;AAWC,IACM,SAASA,WAAAA,CAAY,EAAEC,OAAO,EAA4B,EAAA;IAC7D,MAAMC,KAAAA,GAAQC,yBAAAA,CAAeF,OAAAA,EAAS,OAAA,EAAS,EAAA,CAAA;AAC/C,IAAA,qBACIG,cAAA,CAACC,aAAAA,EAAAA;QACGH,KAAAA,EAAOA,KAAAA;QACPI,MAAAA,EAAQH,yBAAAA,CAAeF,SAAS,QAAA,EAAUC,KAAAA,CAAAA;QAC1CK,QAAAA,EAAUC,0BAAAA,CAAgBP,SAAS,UAAA,EAAY,KAAA,CAAA;QAC/CQ,MAAAA,EAAQD,0BAAAA,CAAgBP,SAAS,QAAA,EAAU,KAAA;;AAGvD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeDataTable.js","sources":["../../../data/PrimeDataTable.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 { ReactElement, ReactNode, isValidElement } from 'react';\nimport { DataTable, type DataTableFilterInstance, type DataTablePaginationInstance, type DataTableTBodyItemOptions } from 'primereact/datatable';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, numberProperty, recordArrayProperty, stringProperty } from '../properties';\nimport { Column, ColumnProps } from './Column';\nimport { columnDefinitions } from './columnDefinitions';\n\n/**\n * The `PrimeReact:dataTable` component, also registered under Screenplay's `table` name so a screen\n * compiled from a `.play` file renders through this package without a translation step.\n *\n * PrimeReact 11 turned the table inside out. Where PrimeReact 10 took `value` and a set of `Column`\n * children and produced the whole table, PrimeReact 11 gives back a root that owns sorting, filtering and\n * paging and a set of parts - container, table, head, rows, cells - that the caller arranges. So this\n * adapter now writes out the table's structure itself, and the column concept it renders from is\n * {@link Column}, which is Cratis-owned because PrimeReact 11 removed `primereact/column` entirely.\n *\n * Columns are taken from `Column` declarations when a React caller composed some into a slot, and\n * otherwise from the element's model - nested `column` children, a `columns` property, or the shape of\n * the first row; see `columnDefinitions`. The model is the path a screen takes, and it is checked second\n * only because an explicitly composed declaration is the more specific statement of the two.\n */\nexport function PrimeDataTable({ element, slots }: RegisteredComponentProps) {\n const rows = recordArrayProperty(element, 'rows');\n const declared = declaredColumns(slots);\n const columns: ColumnProps[] = declared.length > 0 ? declared : columnDefinitions(element, rows);\n const pageSize = numberProperty(element, 'pageSize');\n const size = stringProperty(element, 'size');\n\n return (\n <DataTable.Root\n data-scene-id={element.id}\n data={rows}\n removableSort\n paginator={pageSize !== undefined}\n rows={pageSize}\n stripedRows={booleanProperty(element, 'stripedRows', false)}\n showGridlines={booleanProperty(element, 'showGridlines', false)}\n size={size === 'small' || size === 'large' ? size : undefined}>\n <DataTable.TableContainer>\n <DataTable.Table>\n <DataTable.THead>\n <DataTable.THeadRow>\n {columns.map((column, index) => (\n <DataTable.THeadCell key={column.field ?? index}>\n {column.sortable && column.field ? (\n <DataTable.Sort field={column.field}>\n {headerOf(column)}\n <DataTable.SortIndicator match='asc'> ▲</DataTable.SortIndicator>\n <DataTable.SortIndicator match='desc'> ▼</DataTable.SortIndicator>\n </DataTable.Sort>\n ) : (\n <span>{headerOf(column)}</span>\n )}\n {column.filter && column.field && (\n <DataTable.Filter field={column.field} display='row'>\n {(filter: DataTableFilterInstance) => (\n <input\n className='w-full'\n aria-label={`Filter by ${headerOf(column)}`}\n value={typeof filter.value === 'string' ? filter.value : ''}\n onChange={(event) => filter.onChange(event, event.target.value)}\n />\n )}\n </DataTable.Filter>\n )}\n </DataTable.THeadCell>\n ))}\n </DataTable.THeadRow>\n </DataTable.THead>\n <DataTable.TBody>\n {({ item, index }: DataTableTBodyItemOptions) => (\n <DataTable.Row index={index}>\n {columns.map((column, columnIndex) => (\n <DataTable.Cell key={column.field ?? columnIndex}>{cellOf(column, item)}</DataTable.Cell>\n ))}\n </DataTable.Row>\n )}\n </DataTable.TBody>\n <DataTable.EmptyTBody>\n <DataTable.Row>\n <DataTable.Cell colSpan={Math.max(columns.length, 1)}>\n {stringProperty(element, 'emptyMessage', 'No records found')}\n </DataTable.Cell>\n </DataTable.Row>\n </DataTable.EmptyTBody>\n </DataTable.Table>\n </DataTable.TableContainer>\n <DataTable.Pagination>\n {(pagination: DataTablePaginationInstance) => (\n <div className='flex items-center gap-2 p-2'>\n <button\n type='button'\n disabled={!pagination.canPrev}\n onClick={(event) => pagination.onPageChange(event, pagination.page - 1)}>\n ‹\n </button>\n <span className='text-sm opacity-75'>\n {pagination.page + 1} / {Math.max(pagination.pageCount, 1)}\n </span>\n <button\n type='button'\n disabled={!pagination.canNext}\n onClick={(event) => pagination.onPageChange(event, pagination.page + 1)}>\n ›\n </button>\n </div>\n )}\n </DataTable.Pagination>\n </DataTable.Root>\n );\n}\n\nfunction declaredColumns(slots: Record<string, ReactNode[]>): ColumnProps[] {\n return [...(slots.columns ?? []), ...(slots.content ?? [])]\n .filter((node): node is ReactElement<ColumnProps> => isValidElement(node) && node.type === Column)\n .map((node) => node.props);\n}\n\nfunction headerOf(column: ColumnProps): string {\n return column.header ?? column.field ?? '';\n}\n\nfunction cellOf(column: ColumnProps, row: Record<string, unknown>): ReactNode {\n if (column.body !== undefined) return column.body(row);\n if (column.field === undefined) return '';\n return String(row[column.field] ?? '');\n}\n"],"names":["PrimeDataTable","element","slots","rows","recordArrayProperty","declared","declaredColumns","columns","length","columnDefinitions","pageSize","numberProperty","size","stringProperty","_jsxs","DataTable","Root","data-scene-id","id","data","removableSort","paginator","undefined","stripedRows","booleanProperty","showGridlines","_jsx","TableContainer","Table","THead","THeadRow","map","column","index","THeadCell","sortable","field","Sort","headerOf","SortIndicator","match","span","filter","Filter","display","input","className","aria-label","value","onChange","event","target","TBody","item","Row","columnIndex","Cell","cellOf","EmptyTBody","colSpan","Math","max","Pagination","pagination","div","button","type","disabled","canPrev","onClick","onPageChange","page","pageCount","canNext","content","node","isValidElement","Column","props","header","row","body","String"],"mappings":";;;;;;;;;AAUA;;;;;;;;;;;;;;AAcC,IACM,SAASA,cAAAA,CAAe,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;IACvE,MAAMC,IAAAA,GAAOC,+BAAoBH,OAAAA,EAAS,MAAA,CAAA;AAC1C,IAAA,MAAMI,WAAWC,eAAAA,CAAgBJ,KAAAA,CAAAA;AACjC,IAAA,MAAMK,UAAyBF,QAAAA,CAASG,MAAM,GAAG,CAAA,GAAIH,QAAAA,GAAWI,oCAAkBR,OAAAA,EAASE,IAAAA,CAAAA;IAC3F,MAAMO,QAAAA,GAAWC,0BAAeV,OAAAA,EAAS,UAAA,CAAA;IACzC,MAAMW,IAA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C,MAAM,CAAC,CAACiC,IAAAA,iBAA4CC,qBAAeD,IAAAA,CAAAA,IAASA,IAAAA,CAAKT,IAAI,KAAKW,eAC1F9C,GAAG,CAAC,CAAC4C,IAAAA,GAASA,KAAKG,KAAK,CAAA;AACjC;AAEA,SAASxC,SAASN,MAAmB,EAAA;AACjC,IAAA,OAAOA,MAAAA,CAAO+C,MAAM,IAAI/C,MAAAA,CAAOI,KAAK,IAAI,EAAA;AAC5C;AAEA,SAASqB,MAAAA,CAAOzB,MAAmB,EAAEgD,GAA4B,EAAA;AAC7D,IAAA,IAAIhD,OAAOiD,IAAI,KAAK3D,WAAW,OAAOU,MAAAA,CAAOiD,IAAI,CAACD,GAAAA,CAAAA;AAClD,IAAA,IAAIhD,MAAAA,CAAOI,KAAK,KAAKd,SAAAA,EAAW,OAAO,EAAA;AACvC,IAAA,OAAO4D,OAAOF,GAAG,CAAChD,MAAAA,CAAOI,KAAK,CAAC,IAAI,EAAA,CAAA;AACvC;;;;"}
|
|
1
|
+
{"version":3,"file":"PrimeDataTable.js","sources":["../../../data/PrimeDataTable.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 { ReactElement, ReactNode, isValidElement } from 'react';\nimport { DataTable, type DataTableFilterInstance, type DataTablePaginationInstance, type DataTableTBodyItemOptions } from 'primereact/datatable';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, numberProperty, recordArrayProperty, stringProperty } from '../properties';\nimport { Column, ColumnProps } from './Column';\nimport { columnDefinitions } from './columnDefinitions';\n\n/**\n * The `PrimeReact:dataTable` component, also registered under Screenplay's `table` name so a screen\n * compiled from a `.play` file renders through this package without a translation step.\n *\n * PrimeReact 11 turned the table inside out. Where PrimeReact 10 took `value` and a set of `Column`\n * children and produced the whole table, PrimeReact 11 gives back a root that owns sorting, filtering and\n * paging and a set of parts - container, table, head, rows, cells - that the caller arranges. So this\n * adapter now writes out the table's structure itself, and the column concept it renders from is\n * {@link Column}, which is Cratis-owned because PrimeReact 11 removed `primereact/column` entirely.\n *\n * Columns are taken from `Column` declarations when a React caller composed some into a slot, and\n * otherwise from the element's model - nested `column` children, a `columns` property, or the shape of\n * the first row; see `columnDefinitions`. The model is the path a screen takes, and it is checked second\n * only because an explicitly composed declaration is the more specific statement of the two.\n */\nexport function PrimeDataTable({ element, slots }: RegisteredComponentProps) {\n const rows = recordArrayProperty(element, 'rows');\n const declared = declaredColumns(slots);\n const columns: ColumnProps[] = declared.length > 0 ? declared : columnDefinitions(element, rows);\n const pageSize = numberProperty(element, 'pageSize');\n const size = stringProperty(element, 'size');\n\n return (\n <DataTable.Root\n data-scene-id={element.id}\n data={rows}\n removableSort\n paginator={pageSize !== undefined}\n rows={pageSize}\n stripedRows={booleanProperty(element, 'stripedRows', false)}\n showGridlines={booleanProperty(element, 'showGridlines', false)}\n size={size === 'small' || size === 'large' ? size : undefined}>\n <DataTable.TableContainer>\n <DataTable.Table>\n <DataTable.THead>\n <DataTable.THeadRow>\n {columns.map((column, index) => (\n <DataTable.THeadCell key={column.field ?? index}>\n {column.sortable && column.field ? (\n <DataTable.Sort field={column.field}>\n {headerOf(column)}\n <DataTable.SortIndicator match='asc'> ▲</DataTable.SortIndicator>\n <DataTable.SortIndicator match='desc'> ▼</DataTable.SortIndicator>\n </DataTable.Sort>\n ) : (\n <span>{headerOf(column)}</span>\n )}\n {column.filter && column.field && (\n <DataTable.Filter field={column.field} display='row'>\n {(filter: DataTableFilterInstance) => (\n <input\n className='w-full'\n aria-label={`Filter by ${headerOf(column)}`}\n value={typeof filter.value === 'string' ? filter.value : ''}\n onChange={(event) => filter.onChange(event, event.target.value)}\n />\n )}\n </DataTable.Filter>\n )}\n </DataTable.THeadCell>\n ))}\n </DataTable.THeadRow>\n </DataTable.THead>\n <DataTable.TBody>\n {({ item, index }: DataTableTBodyItemOptions) => (\n <DataTable.Row index={index}>\n {columns.map((column, columnIndex) => (\n <DataTable.Cell key={column.field ?? columnIndex}>{cellOf(column, item)}</DataTable.Cell>\n ))}\n </DataTable.Row>\n )}\n </DataTable.TBody>\n <DataTable.EmptyTBody>\n <DataTable.Row>\n <DataTable.Cell colSpan={Math.max(columns.length, 1)}>\n {stringProperty(element, 'emptyMessage', 'No records found')}\n </DataTable.Cell>\n </DataTable.Row>\n </DataTable.EmptyTBody>\n </DataTable.Table>\n </DataTable.TableContainer>\n <DataTable.Pagination>\n {(pagination: DataTablePaginationInstance) => (\n <div className='flex items-center gap-2 p-2'>\n <button\n type='button'\n disabled={!pagination.canPrev}\n onClick={(event) => pagination.onPageChange(event, pagination.page - 1)}>\n ‹\n </button>\n <span className='text-sm opacity-75'>\n {pagination.page + 1} / {Math.max(pagination.pageCount, 1)}\n </span>\n <button\n type='button'\n disabled={!pagination.canNext}\n onClick={(event) => pagination.onPageChange(event, pagination.page + 1)}>\n ›\n </button>\n </div>\n )}\n </DataTable.Pagination>\n </DataTable.Root>\n );\n}\n\nfunction declaredColumns(slots: Record<string, ReactNode[]>): ColumnProps[] {\n return [...(slots.columns ?? []), ...(slots.content ?? [])]\n .filter((node): node is ReactElement<ColumnProps> => isValidElement(node) && node.type === Column)\n .map((node) => node.props);\n}\n\nfunction headerOf(column: ColumnProps): string {\n return column.header ?? column.field ?? '';\n}\n\nfunction cellOf(column: ColumnProps, row: Record<string, unknown>): ReactNode {\n if (column.body !== undefined) return column.body(row);\n if (column.field === undefined) return '';\n return String(row[column.field] ?? '');\n}\n"],"names":["PrimeDataTable","element","slots","rows","recordArrayProperty","declared","declaredColumns","columns","length","columnDefinitions","pageSize","numberProperty","size","stringProperty","_jsxs","DataTable","Root","data-scene-id","id","data","removableSort","paginator","undefined","stripedRows","booleanProperty","showGridlines","_jsx","TableContainer","Table","THead","THeadRow","map","column","index","THeadCell","sortable","field","Sort","headerOf","SortIndicator","match","span","filter","Filter","display","input","className","aria-label","value","onChange","event","target","TBody","item","Row","columnIndex","Cell","cellOf","EmptyTBody","colSpan","Math","max","Pagination","pagination","div","button","type","disabled","canPrev","onClick","onPageChange","page","pageCount","canNext","content","node","isValidElement","Column","props","header","row","body","String"],"mappings":";;;;;;;;;AAUA;;;;;;;;;;;;;;AAcC,IACM,SAASA,cAAAA,CAAe,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;IACvE,MAAMC,IAAAA,GAAOC,+BAAoBH,OAAAA,EAAS,MAAA,CAAA;AAC1C,IAAA,MAAMI,WAAWC,eAAAA,CAAgBJ,KAAAA,CAAAA;AACjC,IAAA,MAAMK,UAAyBF,QAAAA,CAASG,MAAM,GAAG,CAAA,GAAIH,QAAAA,GAAWI,oCAAkBR,OAAAA,EAASE,IAAAA,CAAAA;IAC3F,MAAMO,QAAAA,GAAWC,0BAAeV,OAAAA,EAAS,UAAA,CAAA;IACzC,MAAMW,IAAAA,GAAOC,0BAAeZ,OAAAA,EAAS,MAAA,CAAA;IAErC,qBACIa,eAAA,CAACC,oBAAUC,IAAI,EAAA;AACXC,QAAAA,eAAAA,EAAehB,QAAQiB,EAAE;QACzBC,IAAAA,EAAMhB,IAAAA;QACNiB,aAAa,EAAA,IAAA;AACbC,QAAAA,SAAAA,EAAWX,QAAAA,KAAaY,SAAAA;QACxBnB,IAAAA,EAAMO,QAAAA;QACNa,WAAAA,EAAaC,0BAAAA,CAAgBvB,SAAS,aAAA,EAAe,KAAA,CAAA;QACrDwB,aAAAA,EAAeD,0BAAAA,CAAgBvB,SAAS,eAAA,EAAiB,KAAA,CAAA;AACzDW,QAAAA,IAAAA,EAAMA,IAAAA,KAAS,OAAA,IAAWA,IAAAA,KAAS,OAAA,GAAUA,IAAAA,GAAOU,SAAAA;;AACpD,0BAAAI,cAAA,CAACX,oBAAUY,cAAc,EAAA;wCACrBb,eAAA,CAACC,oBAAUa,KAAK,EAAA;;AACZ,sCAAAF,cAAA,CAACX,oBAAUc,KAAK,EAAA;oDACZH,cAAA,CAACX,oBAAUe,QAAQ,EAAA;AACdvB,gCAAAA,QAAAA,EAAAA,O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. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useState } from 'react';\nimport { DataView } from 'primereact/dataview';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { numberProperty, recordArrayProperty, stringProperty } from '../properties';\nimport { Pagination } from './Pagination';\n\n/**\n * The `PrimeReact:dataView` component - the same rows a table would show, laid out as a list of cards.\n *\n * PrimeReact 11 reduced `DataView` to a layout shell: a root that tracks nothing but the list/grid\n * layout, and header, content, empty and footer slots. It no longer takes the rows, so it can no longer\n * template them, page them, or decide when the list is empty - all three now belong to the caller. The\n * adapter therefore renders the cards itself from the `titleField` and `descriptionField` properties,\n * shows the empty slot when there are no rows, and slices the rows for the page the user is on.\n *\n * Owning the page locally is the same trade {@link PrimePaginator} makes: a Scene element has nowhere to\n * record which page is showing, and a preview where paging does nothing would be worse than one where it\n * works but is forgotten on reload.\n */\nexport function PrimeDataView({ element }: RegisteredComponentProps) {\n const rows = recordArrayProperty(element, 'rows');\n const titleField = stringProperty(element, 'titleField', 'title');\n const descriptionField = stringProperty(element, 'descriptionField', 'description');\n const pageSize = numberProperty(element, 'pageSize');\n const [page, setPage] = useState(1);\n const visible = pageSize === undefined ? rows : rows.slice((page - 1) * pageSize, page * pageSize);\n\n return (\n <DataView.Root data-scene-id={element.id}>\n <DataView.Content>\n {visible.map((row, index) => (\n <div key={index} className='flex flex-col gap-1 p-3'>\n <span className='font-semibold'>{String(row[titleField] ?? '')}</span>\n <span className='text-sm opacity-75'>{String(row[descriptionField] ?? '')}</span>\n </div>\n ))}\n </DataView.Content>\n {rows.length === 0 && <DataView.Empty>{stringProperty(element, 'emptyMessage', 'No records found')}</DataView.Empty>}\n {pageSize !== undefined && (\n <DataView.Footer>\n <Pagination page={page} total={rows.length} itemsPerPage={pageSize} onPageChange={setPage} />\n </DataView.Footer>\n )}\n </DataView.Root>\n );\n}\n"],"names":["PrimeDataView","element","rows","recordArrayProperty","titleField","stringProperty","descriptionField","pageSize","numberProperty","page","setPage","useState","visible","undefined","slice","_jsxs","DataView","Root","data-scene-id","id","_jsx","Content","map","row","index","div","className","span","String","length","Empty","Footer","Pagination","total","itemsPerPage","onPageChange"],"mappings":";;;;;;;;AASA;;;;;;;;;;;;AAYC,IACM,SAASA,aAAAA,CAAc,EAAEC,OAAO,EAA4B,EAAA;IAC/D,MAAMC,IAAAA,GAAOC,+BAAoBF,OAAAA,EAAS,MAAA,CAAA;IAC1C,MAAMG,UAAAA,GAAaC,yBAAAA,CAAeJ,OAAAA,EAAS,YAAA,EAAc,OAAA,CAAA;IACzD,MAAMK,gBAAAA,GAAmBD,yBAAAA,CAAeJ,OAAAA,EAAS,kBAAA,EAAoB,aAAA,CAAA;IACrE,MAAMM,QAAAA,GAAWC,0BAAeP,OAAAA,EAAS,UAAA,CAAA;AACzC,IAAA,MAAM,CAACQ,IAAAA,EAAMC,OAAAA,CAAQ,GAAGC,cAAAA,CAAS,CAAA,CAAA;AACjC,IAAA,MAAMC,OAAAA,GAAUL,QAAAA,KAAaM,SAAAA,GAAYX,IAAAA,GAAOA,IAAAA,CAAKY,KAAK,CAAEL,CAAAA,IAAAA,GAAO,CAAA,IAAKF,UAAUE,IAAAA,GAAOF,QAAAA,CAAAA;IAEzF,qBACIQ,eAAA,CAACC,kBAASC,IAAI,EAAA;AAACC,QAAAA,eAAAA,EAAejB,QAAQkB,EAAE;;AACpC,0BAAAC,cAAA,CAACJ,kBAASK,OAAO,EAAA;AACZT,gBAAAA,QAAAA,EAAAA,OAAAA,CAAQU,GAAG,CAAC,CAACC,GAAAA,EAAKC,sBACfT,eAAA,CAACU,KAAAA,EAAAA;wBAAgBC,SAAAA,EAAU,yBAAA;;0CACvBN,cAAA,CAACO,MAAAA,EAAAA;gCAAKD,SAAAA,EAAU,eAAA;0CAAiBE,MAAAA,CAAOL,GAAG,CAACnB,UAAAA,CAAW,IAAI,EAAA;;0CAC3DgB,cAAA,CAACO,MAAAA,EAAAA;gCAAKD,SAAAA,EAAU,oBAAA;0CAAsBE,MAAAA,CAAOL,GAAG,CAACjB,gBAAAA,CAAiB,IAAI,EAAA;;;AAFhEkB,qBAAAA,EAAAA,KAAAA,CAAAA;;AAMjBtB,YAAAA,IAAAA,CAAK2B,MAAM,KAAK,CAAA,kBAAKT,cAAA,CAACJ,kBAASc,KAAK,EAAA;AAAEzB,gBAAAA,QAAAA,EAAAA,yBAAAA,CAAeJ,SAAS,cAAA,EAAgB,kBAAA;;YAC9EM,QAAAA,KAAaM,SAAAA,kBACVO,cAAA,CAACJ,iBAAAA,CAASe,MAAM,EAAA;AACZ,gBAAA,QAAA,gBAAAX,cAAA,CAACY,qBAAAA,EAAAA;oBAAWvB,IAAAA,EAAMA,IAAAA;AAAMwB,oBAAAA,KAAAA,EAAO/B,KAAK2B,MAAM;oBAAEK,YAAAA,EAAc3B,QAAAA;oBAAU4B,YAAAA,EAAczB;;;;;AAKtG
|
|
1
|
+
{"version":3,"file":"PrimeDataView.js","sources":["../../../data/PrimeDataView.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 { useState } from 'react';\nimport { DataView } from 'primereact/dataview';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { numberProperty, recordArrayProperty, stringProperty } from '../properties';\nimport { Pagination } from './Pagination';\n\n/**\n * The `PrimeReact:dataView` component - the same rows a table would show, laid out as a list of cards.\n *\n * PrimeReact 11 reduced `DataView` to a layout shell: a root that tracks nothing but the list/grid\n * layout, and header, content, empty and footer slots. It no longer takes the rows, so it can no longer\n * template them, page them, or decide when the list is empty - all three now belong to the caller. The\n * adapter therefore renders the cards itself from the `titleField` and `descriptionField` properties,\n * shows the empty slot when there are no rows, and slices the rows for the page the user is on.\n *\n * Owning the page locally is the same trade {@link PrimePaginator} makes: a Scene element has nowhere to\n * record which page is showing, and a preview where paging does nothing would be worse than one where it\n * works but is forgotten on reload.\n */\nexport function PrimeDataView({ element }: RegisteredComponentProps) {\n const rows = recordArrayProperty(element, 'rows');\n const titleField = stringProperty(element, 'titleField', 'title');\n const descriptionField = stringProperty(element, 'descriptionField', 'description');\n const pageSize = numberProperty(element, 'pageSize');\n const [page, setPage] = useState(1);\n const visible = pageSize === undefined ? rows : rows.slice((page - 1) * pageSize, page * pageSize);\n\n return (\n <DataView.Root data-scene-id={element.id}>\n <DataView.Content>\n {visible.map((row, index) => (\n <div key={index} className='flex flex-col gap-1 p-3'>\n <span className='font-semibold'>{String(row[titleField] ?? '')}</span>\n <span className='text-sm opacity-75'>{String(row[descriptionField] ?? '')}</span>\n </div>\n ))}\n </DataView.Content>\n {rows.length === 0 && <DataView.Empty>{stringProperty(element, 'emptyMessage', 'No records found')}</DataView.Empty>}\n {pageSize !== undefined && (\n <DataView.Footer>\n <Pagination page={page} total={rows.length} itemsPerPage={pageSize} onPageChange={setPage} />\n </DataView.Footer>\n )}\n </DataView.Root>\n );\n}\n"],"names":["PrimeDataView","element","rows","recordArrayProperty","titleField","stringProperty","descriptionField","pageSize","numberProperty","page","setPage","useState","visible","undefined","slice","_jsxs","DataView","Root","data-scene-id","id","_jsx","Content","map","row","index","div","className","span","String","length","Empty","Footer","Pagination","total","itemsPerPage","onPageChange"],"mappings":";;;;;;;;AASA;;;;;;;;;;;;AAYC,IACM,SAASA,aAAAA,CAAc,EAAEC,OAAO,EAA4B,EAAA;IAC/D,MAAMC,IAAAA,GAAOC,+BAAoBF,OAAAA,EAAS,MAAA,CAAA;IAC1C,MAAMG,UAAAA,GAAaC,yBAAAA,CAAeJ,OAAAA,EAAS,YAAA,EAAc,OAAA,CAAA;IACzD,MAAMK,gBAAAA,GAAmBD,yBAAAA,CAAeJ,OAAAA,EAAS,kBAAA,EAAoB,aAAA,CAAA;IACrE,MAAMM,QAAAA,GAAWC,0BAAeP,OAAAA,EAAS,UAAA,CAAA;AACzC,IAAA,MAAM,CAACQ,IAAAA,EAAMC,OAAAA,CAAQ,GAAGC,cAAAA,CAAS,CAAA,CAAA;AACjC,IAAA,MAA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"PrimeOrderList.js","sources":["../../../data/PrimeOrderList.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 { useState } from 'react';\nimport { type UseOrderListProps, useOrderList } from '@primereact/headless/orderlist';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { optionsProperty, stringProperty } from '../properties';\nimport { SelectOption } from '../SelectOption';\nimport { toSelectOptions } from './selectOptions';\n\n/**\n * The `PrimeReact:orderList` component - a list the user reorders with the supplied controls.\n *\n * PrimeReact 11 ships no styled order list at all: what survives is `useOrderList`, a headless hook that\n * owns the ordering, works out which moves are legal, and hands back ready-made props for the move\n * buttons - but renders nothing. The presentation below is therefore this package's, not PrimeReact's,\n * which is why it is written out in full rather than configured.\n *\n * Selection is the one piece the hook does not own. It reads `selection` and never writes it, and it\n * compares entries by identity, so the adapter holds the selected options and the very same object\n * references it passed in as the list. Reordering is the component's entire purpose, so the order has to\n * survive a re-render too; it is seeded from `items` once and kept from there on.\n */\nexport function PrimeOrderList({ element }: RegisteredComponentProps) {\n const [items, setItems] = useState<SelectOption[]>(() => optionsProperty(element, 'items'));\n const [selection, setSelection] = useState<SelectOption[]>([]);\n const orderListProps: UseOrderListProps<SelectOption> = {\n value: items,\n selection,\n onValueChange: (event) => setItems(toSelectOptions(event.value)),\n };\n const orderList = useOrderList(orderListProps);\n const header = stringProperty(element, 'header');\n\n const toggle = (item: SelectOption) =>\n setSelection((current) => (current.includes(item) ? current.filter((entry) => entry !== item) : [...current, item]));\n\n return (\n <div data-scene-id={element.id} className='flex gap-2' {...orderList.rootProps}>\n <div className='flex flex-col gap-1' {...orderList.controlsProps}>\n <button {...orderList.firstProps}>⤒</button>\n <button {...orderList.prevProps}>↑</button>\n <button {...orderList.nextProps}>↓</button>\n <button {...orderList.lastProps}>⤓</button>\n </div>\n <div className='flex flex-col gap-1'>\n {header !== undefined && <span className='font-semibold'>{header}</span>}\n <ul\n className='flex flex-col border'\n role='listbox'\n aria-multiselectable\n ref={(node) => {\n orderList.listRef.current = node;\n }}\n {...orderList.listProps}>\n {items.map((item, index) => (\n <li\n key={item.value}\n role='option'\n aria-selected={selection.includes(item)}\n className='cursor-pointer px-3 py-1'\n onClick={() => toggle(item)}\n {...orderList.getOptionProps(item, index)}>\n {item.label}\n </li>\n ))}\n </ul>\n </div>\n </div>\n );\n}\n"],"names":["PrimeOrderList","element","items","setItems","useState","optionsProperty","selection","setSelection","orderListProps","value","onValueChange","event","toSelectOptions","orderList","useOrderList","header","stringProperty","toggle","item","current","includes","filter","entry","_jsxs","div","data-scene-id","id","className","rootProps","controlsProps","_jsx","button","firstProps","prevProps","nextProps","lastProps","undefined","span","ul","role","aria-multiselectable","ref","node","listRef","listProps","map","index","li","aria-selected","onClick","getOptionProps","label"],"mappings":";;;;;;;;AAUA;;;;;;;;;;;;AAYC,IACM,SAASA,cAAAA,CAAe,EAAEC,OAAO,EAA4B,EAAA;AAChE,IAAA,MAAM,CAACC,KAAAA,EAAOC,QAAAA,CAAS,GAAGC,cAAAA,CAAyB,IAAMC,2BAAgBJ,OAAAA,EAAS,OAAA,CAAA,CAAA;AAClF,IAAA,MAAM,CAACK,SAAAA,EAAWC,YAAAA,CAAa,GAAGH,eAAyB,EAAE,CAAA;AAC7D,IAAA,MAAMI,cAAAA,GAAkD;QACpDC,KAAAA,EAAOP,KAAAA;AACPI,QAAAA,SAAAA;AACAI,QAAAA,aAAAA,EAAe,CAACC,KAAAA,GAAUR,QAAAA,CAASS,6BAAAA,CAAgBD,MAAMF,KAAK,CAAA;AAClE,KAAA;AACA,IAAA,MAAMI,YAAYC,sBAAAA,CAAaN,cAAAA,CAAAA;IAC/B,MAAMO,MAAAA,GAASC,0BAAef,OAAAA,EAAS,QAAA,CAAA;AAEvC,IAAA,MAAMgB,SAAS,CAACC,IAAAA,GACZX,YAAAA,CAAa,CAACY,UAAaA,OAAAA,CAAQC,QAAQ,CAACF,IAAAA,CAAAA,GAAQC,QAAQE,MA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B,UAAU+B,SAAS;AACtB1C,wBAAAA,QAAAA,EAAAA,KAAAA,CAAM2C,GAAG,CAAC,CAAC3B,IAAAA,EAAM4B,sBACdhB,cAAA,CAACiB,IAAAA,EAAAA;gCAEGR,IAAAA,EAAK,QAAA;gCACLS,eAAAA,EAAe1C,SAAAA,CAAUc,QAAQ,CAACF,IAAAA,CAAAA;gCAClCS,SAAAA,EAAU,0BAAA;AACVsB,gCAAAA,OAAAA,EAAS,IAAMhC,MAAAA,CAAOC,IAAAA,CAAAA;AACrB,gCAAA,GAAGL,SAAAA,CAAUqC,cAAc,CAAChC,IAAAA,EAAM4B,KAAAA,CAAM;AACxC5B,gCAAAA,QAAAA,EAAAA,IAAAA,CAAKiC;AANDjC,6BAAAA,EAAAA,IAAAA,CAAKT,KAAK,CAAA;;;;;;AAa3C
|
|
1
|
+
{"version":3,"file":"PrimeOrderList.js","sources":["../../../data/PrimeOrderList.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 { useState } from 'react';\nimport { type UseOrderListProps, useOrderList } from '@primereact/headless/orderlist';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { optionsProperty, stringProperty } from '../properties';\nimport { SelectOption } from '../SelectOption';\nimport { toSelectOptions } from './selectOptions';\n\n/**\n * The `PrimeReact:orderList` component - a list the user reorders with the supplied controls.\n *\n * PrimeReact 11 ships no styled order list at all: what survives is `useOrderList`, a headless hook that\n * owns the ordering, works out which moves are legal, and hands back ready-made props for the move\n * buttons - but renders nothing. The presentation below is therefore this package's, not PrimeReact's,\n * which is why it is written out in full rather than configured.\n *\n * Selection is the one piece the hook does not own. It reads `selection` and never writes it, and it\n * compares entries by identity, so the adapter holds the selected options and the very same object\n * references it passed in as the list. Reordering is the component's entire purpose, so the order has to\n * survive a re-render too; it is seeded from `items` once and kept from there on.\n */\nexport function PrimeOrderList({ element }: RegisteredComponentProps) {\n const [items, setItems] = useState<SelectOption[]>(() => optionsProperty(element, 'items'));\n const [selection, setSelection] = useState<SelectOption[]>([]);\n const orderListProps: UseOrderListProps<SelectOption> = {\n value: items,\n selection,\n onValueChange: (event) => setItems(toSelectOptions(event.value)),\n };\n const orderList = useOrderList(orderListProps);\n const header = stringProperty(element, 'header');\n\n const toggle = (item: SelectOption) =>\n setSelection((current) => (current.includes(item) ? current.filter((entry) => entry !== item) : [...current, item]));\n\n return (\n <div data-scene-id={element.id} className='flex gap-2' {...orderList.rootProps}>\n <div className='flex flex-col gap-1' {...orderList.controlsProps}>\n <button {...orderList.firstProps}>⤒</button>\n <button {...orderList.prevProps}>↑</button>\n <button {...orderList.nextProps}>↓</button>\n <button {...orderList.lastProps}>⤓</button>\n </div>\n <div className='flex flex-col gap-1'>\n {header !== undefined && <span className='font-semibold'>{header}</span>}\n <ul\n className='flex flex-col border'\n role='listbox'\n aria-multiselectable\n ref={(node) => {\n orderList.listRef.current = node;\n }}\n {...orderList.listProps}>\n {items.map((item, index) => (\n <li\n key={item.value}\n role='option'\n aria-selected={selection.includes(item)}\n className='cursor-pointer px-3 py-1'\n onClick={() => toggle(item)}\n {...orderList.getOptionProps(item, index)}>\n {item.label}\n </li>\n ))}\n </ul>\n </div>\n </div>\n );\n}\n"],"names":["PrimeOrderList","element","items","setItems","useState","optionsProperty","selection","setSelection","orderListProps","value","onValueChange","event","toSelectOptions","orderList","useOrderList","header","stringProperty","toggle","item","current","includes","filter","entry","_jsxs","div","data-scene-id","id","className","rootProps","controlsProps","_jsx","button","firstProps","prevProps","nextProps","lastProps","undefined","span","ul","role","aria-multiselectable","ref","node","listRef","listProps","map","index","li","aria-selected","onClick","getOptionProps","label"],"mappings":";;;;;;;;AAUA;;;;;;;;;;;;AAYC,IACM,SAASA,cAAAA,CAAe,EAAEC,OAAO,EAA4B,EAAA;AAChE,IAAA,MAAM,CAACC,KAAAA,EAAOC,QAAAA,CAAS,GAAGC,cAAAA,CAAyB,IAAMC,2BAAgBJ,OAAAA,EAAS,OA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AA,EAAAA;AAAQ,wBAAA,GAAGlB,UAAUsB,SAAS;AAAE,wBAAA,QAAA,EAAA;;;;0BAErCZ,eAAA,CAACC,KAAAA,EAAAA;gBAAIG,SAAAA,EAAU,qBAAA;;AACVZ,oBAAAA,MAAAA,KAAWqB,2BAAaN,cAAA,CAACO,MAAAA,EAAAA;wBAAKV,SAAAA,EAAU,eAAA;AAAiBZ,wBAAAA,QAAAA,EAAAA;;kCAC1De,cAAA,CAACQ,IAAAA,EAAAA;wBACGX,SAAAA,EAAU,sBAAA;wBACVY,IAAAA,EAAK,SAAA;wBACLC,sBAAoB,EAAA,IAAA;AACpBC,wBAAAA,GAAAA,EAAK,CAACC,IAAAA,GAAAA;4BACF7B,SAAAA,CAAU8B,OAAO,CAACxB,OAAO,GAAGuB,IAAAA;AAChC,wBAAA,CAAA;AACC,wBAAA,GAAG7B,UAAU+B,SAAS;AACtB1C,wBAAAA,QAAAA,EAAAA,KAAAA,CAAM2C,GAAG,CAAC,CAAC3B,IAAAA,EAAM4B,sBACdhB,cAAA,CAACiB,IAAAA,EAAAA;gCAEGR,IAAAA,EAAK,QAAA;gCACLS,eAAAA,EAAe1C,SAAAA,CAAUc,QAAQ,CAACF,IAAAA,CAAAA;gCAClCS,SAAAA,EAAU,0BAAA;AACVsB,gCAAAA,OAAAA,EAAS,IAAMhC,MAAAA,CAAOC,IAAAA,CAAAA;AACrB,gCAAA,GAAGL,SAAAA,CAAUqC,cAAc,CAAChC,IAAAA,EAAM4B,KAAAA,CAAM;AACxC5B,gCAAAA,QAAAA,EAAAA,IAAAA,CAAKiC;AANDjC,6BAAAA,EAAAA,IAAAA,CAAKT,KAAK,CAAA;;;;;;AAa3C;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeOrganizationChart.js","sources":["../../../data/PrimeOrganizationChart.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 { OrganizationChart, type OrganizationChartNodeRow } from 'primereact/organizationchart';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { treeNodesProperty } from '../treeNodes';\nimport { toPrimeTreeNodes } from './primeTreeNodes';\n\n/**\n * The `PrimeReact:organizationChart` component - a hierarchy drawn top-down as connected boxes.\n *\n * Takes the same node model as `tree` and `treeSelect`, so one authored hierarchy can be shown three\n * different ways without being restructured.\n *\n * PrimeReact 10 threw on an empty `value`: it read the root node's `expanded` flag without checking there\n * was a root, so an element whose nodes had not been authored yet took the whole screen down with it, and\n * this adapter had to guard against its own empty case. PrimeReact 11 defaults the node list everywhere\n * it reads it, and `OrganizationChart.Nodes` simply renders an empty subtree, so the guard is gone and\n * an unconfigured chart renders as nothing rather than as an exception.\n *\n * The node body is declared once and applied to every node by the root's own recursion - `Nodes` invokes\n * this child for each root node and each expanded node hands the same function down to its children, so\n * there is no depth to walk here.\n */\nexport function PrimeOrganizationChart({ element }: RegisteredComponentProps) {\n return (\n <OrganizationChart.Root data-scene-id={element.id} value={toPrimeTreeNodes(treeNodesProperty(element, 'nodes'))}>\n <OrganizationChart.Nodes>\n {(row: OrganizationChartNodeRow) => (\n <OrganizationChart.Node uKey={row.node.key}>\n <OrganizationChart.Content>\n <OrganizationChart.Label />\n </OrganizationChart.Content>\n <OrganizationChart.Toggle>\n <OrganizationChart.ToggleIndicator match='collapsed'>▾</OrganizationChart.ToggleIndicator>\n <OrganizationChart.ToggleIndicator match='expanded'>▴</OrganizationChart.ToggleIndicator>\n </OrganizationChart.Toggle>\n </OrganizationChart.Node>\n )}\n </OrganizationChart.Nodes>\n </OrganizationChart.Root>\n );\n}\n"],"names":["PrimeOrganizationChart","element","_jsx","OrganizationChart","Root","data-scene-id","id","value","toPrimeTreeNodes","treeNodesProperty","Nodes","row","_jsxs","Node","uKey","node","key","Content","Label","Toggle","ToggleIndicator","match"],"mappings":";;;;;;;AAQA;;;;;;;;;;;;;;;AAeC,IACM,SAASA,sBAAAA,CAAuB,EAAEC,OAAO,EAA4B,EAAA;IACxE,qBACIC,cAAA,CAACC,oCAAkBC,IAAI,EAAA;AAACC,QAAAA,eAAAA,EAAeJ,QAAQK,EAAE;QAAEC,KAAAA,EAAOC,+BAAAA,CAAiBC,4BAAkBR,OAAAA,EAAS,OAAA,CAAA,CAAA;gCAClGC,cAAA,CAACC,oCAAkBO,KAAK,EAAA;sBACnB,CAACC,GAAAA,iBACEC,eAAA,CAACT,mCAAAA,CAAkBU,IAAI,EAAA;oBAACC,IAAAA,EAAMH,GAAAA,CAAII,IAAI,CAACC,GAAG;;AACtC,sCAAAd,cAAA,CAACC,oCAAkBc,OAAO,EAAA;oDACtBf,cAAA,CAACC,oCAAkBe,KAAK,EAAA,EAAA;;AAE5B,sCAAAN,eAAA,CAACT,oCAAkBgB,MAAM,EAAA;;AACrB,8CAAAjB,cAAA,CAACC,oCAAkBiB,eAAe,EAAA;oCAACC,KAAAA,EAAM,WAAA;AAAY,oCAAA,QAAA,EAAA;;AACrD,8CAAAnB,cAAA,CAACC,oCAAkBiB,eAAe,EAAA;oCAACC,KAAAA,EAAM,UAAA;AAAW,oCAAA,QAAA,EAAA;;;;;;;;AAOhF
|
|
1
|
+
{"version":3,"file":"PrimeOrganizationChart.js","sources":["../../../data/PrimeOrganizationChart.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 { OrganizationChart, type OrganizationChartNodeRow } from 'primereact/organizationchart';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { treeNodesProperty } from '../treeNodes';\nimport { toPrimeTreeNodes } from './primeTreeNodes';\n\n/**\n * The `PrimeReact:organizationChart` component - a hierarchy drawn top-down as connected boxes.\n *\n * Takes the same node model as `tree` and `treeSelect`, so one authored hierarchy can be shown three\n * different ways without being restructured.\n *\n * PrimeReact 10 threw on an empty `value`: it read the root node's `expanded` flag without checking there\n * was a root, so an element whose nodes had not been authored yet took the whole screen down with it, and\n * this adapter had to guard against its own empty case. PrimeReact 11 defaults the node list everywhere\n * it reads it, and `OrganizationChart.Nodes` simply renders an empty subtree, so the guard is gone and\n * an unconfigured chart renders as nothing rather than as an exception.\n *\n * The node body is declared once and applied to every node by the root's own recursion - `Nodes` invokes\n * this child for each root node and each expanded node hands the same function down to its children, so\n * there is no depth to walk here.\n */\nexport function PrimeOrganizationChart({ element }: RegisteredComponentProps) {\n return (\n <OrganizationChart.Root data-scene-id={element.id} value={toPrimeTreeNodes(treeNodesProperty(element, 'nodes'))}>\n <OrganizationChart.Nodes>\n {(row: OrganizationChartNodeRow) => (\n <OrganizationChart.Node uKey={row.node.key}>\n <OrganizationChart.Content>\n <OrganizationChart.Label />\n </OrganizationChart.Content>\n <OrganizationChart.Toggle>\n <OrganizationChart.ToggleIndicator match='collapsed'>▾</OrganizationChart.ToggleIndicator>\n <OrganizationChart.ToggleIndicator match='expanded'>▴</OrganizationChart.ToggleIndicator>\n </OrganizationChart.Toggle>\n </OrganizationChart.Node>\n )}\n </OrganizationChart.Nodes>\n </OrganizationChart.Root>\n );\n}\n"],"names":["PrimeOrganizationChart","element","_jsx","OrganizationChart","Root","data-scene-id","id","value","toPrimeTreeNodes","treeNodesProperty","Nodes","row","_jsxs","Node","uKey","node","key","Content","Label","Toggle","ToggleIndicator","match"],"mappings":";;;;;;;AAQA;;;;;;;;;;;;;;;AAeC,IACM,SAASA,sBAAAA,CAAuB,EAAEC,OAAO,EAA4B,EAAA;IACxE,qBACIC,cAAA,CAACC,oCAAkBC,IAAI,EAAA;AAACC,QAAAA,eAAAA,EAAeJ,QAAQK,EAAE;QAAEC,KAAAA,EAAOC,+BAAAA,CAAiBC,4BAAkBR,OAAAA,EAAS,OAAA,CAAA,CAAA;gCAClGC,cAAA,CAACC,oCAAkBO,KAAK,EAAA;sBACnB,CAACC,GAAAA,iBACEC,eAAA,CAACT,mCAAAA,CAAkBU,IAAI,EAAA;oBAACC,IAAAA,EAAMH,GAAAA,CAAII,IAAI,CAACC,GAAG;;AACtC,sCAAAd,cAAA,CAACC,oCAAkBc,OAAO,EAAA;oDACtBf,cAAA,CAACC,oCAAkBe,KAAK,EAAA,EAAA;;AAE5B,sCAAAN,eAAA,CAACT,oCAAkBgB,MAAM,EAAA;;AACrB,8CAAAjB,cAAA,CAACC,oCAAkBiB,eAAe,EAAA;oCAACC,KAAAA,EAAM,WAAA;AAAY,oCAAA,QAAA,EAAA;;AACrD,8CAAAnB,cAAA,CAACC,oCAAkBiB,eAAe,EAAA;oCAACC,KAAAA,EAAM,UAAA;AAAW,oCAAA,QAAA,EAAA;;;;;;;;AAOhF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimePaginator.js","sources":["../../../data/PrimePaginator.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 { useState } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { numberProperty } from '../properties';\nimport { Pagination } from './Pagination';\n\n/**\n * The `PrimeReact:paginator` component - page navigation for a list a screen paginates itself.\n *\n * Owns the current page locally so the control is operable in a preview; a Scene element has no place to\n * record which page the user is on.\n *\n * The authored `first` property still names a record offset, as it did in PrimeReact 10, but PrimeReact\n * 11's paginator counts pages rather than records - so the offset is divided into a page number here,\n * with the page size floored at one so an authored zero cannot turn that division into a NaN page.\n * Keeping the property in record terms means a screen written for the previous version still lands on the\n * page it asked for. `rowsPerPageOptions` has no counterpart in PrimeReact 11 and is not carried over:\n * the new paginator has no rows-per-page control to put the options in.\n */\nexport function PrimePaginator({ element }: RegisteredComponentProps) {\n const pageSize = Math.max(numberProperty(element, 'pageSize', 10), 1);\n const [page, setPage] = useState(() => Math.floor(numberProperty(element, 'first', 0) / pageSize) + 1);\n return (\n <Pagination\n sceneId={element.id}\n page={page}\n total={numberProperty(element, 'totalRecords', 0)}\n itemsPerPage={pageSize}\n onPageChange={setPage}\n />\n );\n}\n"],"names":["PrimePaginator","element","pageSize","Math","max","numberProperty","page","setPage","useState","floor","_jsx","Pagination","sceneId","id","total","itemsPerPage","onPageChange"],"mappings":";;;;;;;AAQA;;;;;;;;;;;;AAYC,IACM,SAASA,cAAAA,CAAe,EAAEC,OAAO,EAA4B,EAAA;AAChE,IAAA,MAAMC,WAAWC,IAAAA,CAAKC,GAAG,CAACC,yBAAAA,CAAeJ,OAAAA,EAAS,YAAY,EAAA,CAAA,EAAK,CAAA,CAAA;AACnE,IAAA,MAAM,CAACK,IAAAA,EAAMC,OAAAA,CAAQ,GAAGC,cAAAA,CAAS,IAAML,IAAAA,CAAKM,KAAK,CAACJ,yBAAAA,CAAeJ,OAAAA,EAAS,OAAA,EAAS,KAAKC,QAAAA,CAAAA,GAAY,CAAA,CAAA;AACpG,IAAA,qBACIQ,cAAA,CAACC,qBAAAA,EAAAA;AACGC,QAAAA,OAAAA,EAASX,QAAQY,EAAE;QACnBP,IAAAA,EAAMA,IAAAA;QACNQ,KAAAA,EAAOT,yBAAAA,CAAeJ,SAAS,cAAA,EAAgB,CAAA,CAAA;QAC/Cc,YAAAA,EAAcb,QAAAA;QACdc,YAAAA,EAAcT;;AAG1B
|
|
1
|
+
{"version":3,"file":"PrimePaginator.js","sources":["../../../data/PrimePaginator.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 { useState } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { numberProperty } from '../properties';\nimport { Pagination } from './Pagination';\n\n/**\n * The `PrimeReact:paginator` component - page navigation for a list a screen paginates itself.\n *\n * Owns the current page locally so the control is operable in a preview; a Scene element has no place to\n * record which page the user is on.\n *\n * The authored `first` property still names a record offset, as it did in PrimeReact 10, but PrimeReact\n * 11's paginator counts pages rather than records - so the offset is divided into a page number here,\n * with the page size floored at one so an authored zero cannot turn that division into a NaN page.\n * Keeping the property in record terms means a screen written for the previous version still lands on the\n * page it asked for. `rowsPerPageOptions` has no counterpart in PrimeReact 11 and is not carried over:\n * the new paginator has no rows-per-page control to put the options in.\n */\nexport function PrimePaginator({ element }: RegisteredComponentProps) {\n const pageSize = Math.max(numberProperty(element, 'pageSize', 10), 1);\n const [page, setPage] = useState(() => Math.floor(numberProperty(element, 'first', 0) / pageSize) + 1);\n return (\n <Pagination\n sceneId={element.id}\n page={page}\n total={numberProperty(element, 'totalRecords', 0)}\n itemsPerPage={pageSize}\n onPageChange={setPage}\n />\n );\n}\n"],"names":["PrimePaginator","element","pageSize","Math","max","numberProperty","page","setPage","useState","floor","_jsx","Pagination","sceneId","id","total","itemsPerPage","onPageChange"],"mappings":";;;;;;;AAQA;;;;;;;;;;;;AAYC,IACM,SAASA,cAAAA,CAAe,EAAEC,OAAO,EAA4B,EAAA;AAChE,IAAA,MAAMC,WAAWC,IAAAA,CAAKC,GAAG,CAACC,yBAAAA,CAAeJ,OAAAA,EAAS,YAAY,EAAA,CAAA,EAAK,CAAA,CAAA;AACnE,IAAA,MAAM,CAACK,IAAAA,EAAMC,OAAAA,CAAQ,GAAGC,cAAAA,CAAS,IAAML,IAAAA,CAAKM,KAAK,CAACJ,yBAAAA,CAAeJ,OAAAA,EAAS,OAAA,EAAS,KAAKC,QAAAA,CAAAA,GAAY,CAAA,CAAA;AACpG,IAAA,qBACIQ,cAAA,CAACC,qBAAAA,EAAAA;AACGC,QAAAA,OAAAA,EAASX,QAAQY,EAAE;QACnBP,IAAAA,EAAMA,IAAAA;QACNQ,KAAAA,EAAOT,yBAAAA,CAAeJ,SAAS,cAAA,EAAgB,CAAA,CAAA;QAC/Cc,YAAAA,EAAcb,QAAAA;QACdc,YAAAA,EAAcT;;AAG1B;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimePickList.js","sources":["../../../data/PrimePickList.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 { useState } from 'react';\nimport { type UsePickListProps, usePickList } from '@primereact/headless/picklist';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { optionsProperty, stringProperty } from '../properties';\nimport { SelectOption } from '../SelectOption';\nimport { toSelectOptions } from './selectOptions';\n\n/**\n * The `PrimeReact:pickList` component - two lists with items moved between them.\n *\n * Like {@link PrimeOrderList}, this is built on a headless hook because PrimeReact 11 ships no styled\n * pick list: `usePickList` decides what a move does to each side and which move buttons are live, and the\n * markup below is this package's own.\n *\n * Both sides are held locally for the same reason the order list holds its order - moving items is what\n * the component does, and a Scene element cannot record the result. Selection is held locally too, but\n * for a different reason: the hook reads it and only ever *prunes* it, when a selected item leaves the\n * side it was on, so something has to add to it when the user picks a row.\n */\nexport function PrimePickList({ element }: RegisteredComponentProps) {\n const [source, setSource] = useState<SelectOption[]>(() => optionsProperty(element, 'source'));\n const [target, setTarget] = useState<SelectOption[]>(() => optionsProperty(element, 'target'));\n const [selection, setSelection] = useState<SelectOption[]>([]);\n const pickListProps: UsePickListProps<SelectOption> = {\n source,\n target,\n selection,\n onValueChange: (event) => {\n setSource(toSelectOptions(event.source));\n setTarget(toSelectOptions(event.target));\n },\n onSelectionChange: (event) => setSelection(toSelectOptions(event.value)),\n };\n const pickList = usePickList(pickListProps);\n\n const toggle = (item: SelectOption) =>\n setSelection((current) => (current.includes(item) ? current.filter((entry) => entry !== item) : [...current, item]));\n\n const list = (heading: string, items: SelectOption[], side: 'source' | 'target', listProps: Record<string, unknown>) => (\n <div className='flex flex-col gap-1'>\n <span className='font-semibold'>{heading}</span>\n <ul className='flex flex-col border' role='listbox' aria-label={heading} aria-multiselectable {...listProps}>\n {items.map((item, index) => (\n <li\n key={item.value}\n role='option'\n aria-selected={selection.includes(item)}\n className='cursor-pointer px-3 py-1'\n onClick={() => toggle(item)}\n {...pickList.getOptionProps(item, index, side)}>\n {item.label}\n </li>\n ))}\n </ul>\n </div>\n );\n\n return (\n <div data-scene-id={element.id} className='flex gap-2' {...pickList.rootProps}>\n {list(stringProperty(element, 'sourceHeader', 'Available'), source, 'source', pickList.sourceListProps)}\n <div className='flex flex-col gap-1 self-center'>\n <button {...pickList.moveToTargetProps}>›</button>\n <button {...pickList.moveAllToTargetProps}>»</button>\n <button {...pickList.moveToSourceProps}>‹</button>\n <button {...pickList.moveAllToSourceProps}>«</button>\n </div>\n {list(stringProperty(element, 'targetHeader', 'Selected'), target, 'target', pickList.targetListProps)}\n </div>\n );\n}\n"],"names":["PrimePickList","element","source","setSource","useState","optionsProperty","target","setTarget","selection","setSelection","pickListProps","onValueChange","event","toSelectOptions","onSelectionChange","value","pickList","usePickList","toggle","item","current","includes","filter","entry","list","heading","items","side","listProps","_jsxs","div","className","_jsx","span","ul","role","aria-label","aria-multiselectable","map","index","li","aria-selected","onClick","getOptionProps","label","data-scene-id","id","rootProps","stringProperty","sourceListProps","button","moveToTargetProps","moveAllToTargetProps","moveToSourceProps","moveAllToSourceProps","targetListProps"],"mappings":";;;;;;;;AAUA;;;;;;;;;;;AAWC,IACM,SAASA,aAAAA,CAAc,EAAEC,OAAO,EAA4B,EAAA;AAC/D,IAAA,MAAM,CAACC,MAAAA,EAAQC,SAAAA,CAAU,GAAGC,cAAAA,CAAyB,IAAMC,2BAAgBJ,OAAAA,EAAS,QAAA,CAAA,CAAA;AACpF,IAAA,MAAM,CAACK,MAAAA,EAAQC,SAAAA,CAAU,GAAGH,cAAAA,CAAyB,IAAMC,2BAAgBJ,OAAAA,EAAS,QAAA,CAAA,CAAA;AACpF,IAAA,MAAM,CAACO,SAAAA,EAAWC,YAAAA,CAAa,GAAGL,eAAyB,EAAE,CAAA;AAC7D,IAAA,MAAMM,aAAAA,GAAgD;AAClDR,QAAAA,MAAAA;AACAI,QAAAA,MAAAA;AACAE,QAAAA,SAAAA;AACAG,QAAAA,aAAAA,EAAe,CAACC,KAAAA,GAAAA;YACZT,SAAAA,CAAUU,6BAAAA,CAAgBD,MAAMV,MAAM,CAAA,CAAA;YACtCK,SAAAA,CAAUM,6BAAAA,CAAgBD,MAAMN,MAAM,CAAA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AAOZ,IAAAA,CAAK;AAC7CR,4BAAAA,QAAAA,EAAAA,IAAAA,CAAKyB;AANDzB,yBAAAA,EAAAA,IAAAA,CAAKJ,KAAK,CAAA;;;;AAanC,IAAA,qBACIc,eAAA,CAACC,KAAAA,EAAAA;AAAIe,QAAAA,eAAAA,EAAe5C,QAAQ6C,EAAE;QAAEf,SAAAA,EAAU,YAAA;AAAc,QAAA,GAAGf,SAAS+B,SAAS;;AACxEvB,YAAAA,IAAAA,CAAKwB,0BAAe/C,OAAAA,EAAS,cAAA,EAAgB,cAAcC,MAAAA,EAAQ,QAAA,EAAUc,SAASiC,eAAe,CAAA;0BACtGpB,eAAA,CAACC,KAAAA,EAAAA;gBAAIC,SAAAA,EAAU,iCAAA;;kCACXC,cAAA,CAACkB,QAAAA,EAAAA;AAAQ,wBAAA,GAAGlC,SAASmC,iBAAiB;AAAE,wBAAA,QAAA,EAAA;;kCACxCnB,cAAA,CAACkB,QAAAA,EAAAA;AAAQ,wBAAA,GAAGlC,SAASoC,oBAAoB;AAAE,wBAAA,QAAA,EAAA;;kCAC3CpB,cAAA,CAACkB,QAAAA,EAAAA;AAAQ,wBAAA,GAAGlC,SAASqC,iBAAiB;AAAE,wBAAA,QAAA,EAAA;;kCACxCrB,cAAA,CAACkB,QAAAA,EAAAA;AAAQ,wBAAA,GAAGlC,SAASsC,oBAAoB;AAAE,wBAAA,QAAA,EAAA;;;;AAE9C9B,YAAAA,IAAAA,CAAKwB,0BAAe/C,OAAAA,EAAS,cAAA,EAAgB,aAAaK,MAAAA,EAAQ,QAAA,EAAUU,SAASuC,eAAe;;;AAGjH
|
|
1
|
+
{"version":3,"file":"PrimePickList.js","sources":["../../../data/PrimePickList.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 { useState } from 'react';\nimport { type UsePickListProps, usePickList } from '@primereact/headless/picklist';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { optionsProperty, stringProperty } from '../properties';\nimport { SelectOption } from '../SelectOption';\nimport { toSelectOptions } from './selectOptions';\n\n/**\n * The `PrimeReact:pickList` component - two lists with items moved between them.\n *\n * Like {@link PrimeOrderList}, this is built on a headless hook because PrimeReact 11 ships no styled\n * pick list: `usePickList` decides what a move does to each side and which move buttons are live, and the\n * markup below is this package's own.\n *\n * Both sides are held locally for the same reason the order list holds its order - moving items is what\n * the component does, and a Scene element cannot record the result. Selection is held locally too, but\n * for a different reason: the hook reads it and only ever *prunes* it, when a selected item leaves the\n * side it was on, so something has to add to it when the user picks a row.\n */\nexport function PrimePickList({ element }: RegisteredComponentProps) {\n const [source, setSource] = useState<SelectOption[]>(() => optionsProperty(element, 'source'));\n const [target, setTarget] = useState<SelectOption[]>(() => optionsProperty(element, 'target'));\n const [selection, setSelection] = useState<SelectOption[]>([]);\n const pickListProps: UsePickListProps<SelectOption> = {\n source,\n target,\n selection,\n onValueChange: (event) => {\n setSource(toSelectOptions(event.source));\n setTarget(toSelectOptions(event.target));\n },\n onSelectionChange: (event) => setSelection(toSelectOptions(event.value)),\n };\n const pickList = usePickList(pickListProps);\n\n const toggle = (item: SelectOption) =>\n setSelection((current) => (current.includes(item) ? current.filter((entry) => entry !== item) : [...current, item]));\n\n const list = (heading: string, items: SelectOption[], side: 'source' | 'target', listProps: Record<string, unknown>) => (\n <div className='flex flex-col gap-1'>\n <span className='font-semibold'>{heading}</span>\n <ul className='flex flex-col border' role='listbox' aria-label={heading} aria-multiselectable {...listProps}>\n {items.map((item, index) => (\n <li\n key={item.value}\n role='option'\n aria-selected={selection.includes(item)}\n className='cursor-pointer px-3 py-1'\n onClick={() => toggle(item)}\n {...pickList.getOptionProps(item, index, side)}>\n {item.label}\n </li>\n ))}\n </ul>\n </div>\n );\n\n return (\n <div data-scene-id={element.id} className='flex gap-2' {...pickList.rootProps}>\n {list(stringProperty(element, 'sourceHeader', 'Available'), source, 'source', pickList.sourceListProps)}\n <div className='flex flex-col gap-1 self-center'>\n <button {...pickList.moveToTargetProps}>›</button>\n <button {...pickList.moveAllToTargetProps}>»</button>\n <button {...pickList.moveToSourceProps}>‹</button>\n <button {...pickList.moveAllToSourceProps}>«</button>\n </div>\n {list(stringProperty(element, 'targetHeader', 'Selected'), target, 'target', pickList.targetListProps)}\n </div>\n );\n}\n"],"names":["PrimePickList","element","source","setSource","useState","optionsProperty","target","setTarget","selection","setSelection","pickListProps","onValueChange","event","toSelectOptions","onSelectionChange","value","pickList","usePickList","toggle","item","current","includes","filter","entry","list","heading","items","side","listProps","_jsxs","div","className","_jsx","span","ul","role","aria-label","aria-multiselectable","map","index","li","aria-selected","onClick","getOptionProps","label","data-scene-id","id","rootProps","stringProperty","sourceListProps","button","moveToTargetProps","moveAllToTargetProps","moveToSourceProps","moveAllToSourceProps","targetListProps"],"mappings":";;;;;;;;AAUA;;;;;;;;;;;AAWC,IACM,SAASA,aAAAA,CAAc,EAAEC,OAAO,EAA4B,EAAA;AAC/D,IAAA,MAAM,CAACC,MAAAA,EAAQC,SAAAA,CAAU,GAAGC,cAAAA,CAAyB,IAAMC,2BAAgBJ,OAAAA,EAAS,QAAA,CAAA,CAAA;AACpF,IAAA,MAAM,CAACK,MAAAA,EAAQC,SAAAA,CAAU,GAAGH,cAAAA,CAAyB,IAAMC,2BAAgBJ,OAAAA,EAAS,QAAA,CAAA,CAAA;AACpF,IAAA,MAAM,CAACO,SAAAA,EAAWC,YAAAA,CAAa,GAAGL,eAAyB,EAAE,CAAA;AAC7D,IAAA,MAAMM,aAAAA,GAAgD;AAClDR,QAAAA,MAAAA;AACAI,QAAAA,MAAAA;AACAE,QAAAA,SAAAA;AACAG,QAAAA,aAAAA,EAAe,CAACC,KAAAA,GAAAA;YACZT,SAAAA,CAAUU,6BAAAA,CAAgBD,MAAMV,MAAM,CAAA,CAAA;YACtCK,SAAAA,CAAUM,6BAAAA,CAAgBD,MAAMN,MAAM,CAAA,CAAA;AAC1C,QAAA,CAAA;AACAQ,QAAAA,iBAAAA,EAAm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AAA,CAAKyB;AANDzB,yBAAAA,EAAAA,IAAAA,CAAKJ,KAAK,CAAA;;;;AAanC,IAAA,qBACIc,eAAA,CAACC,KAAAA,EAAAA;AAAIe,QAAAA,eAAAA,EAAe5C,QAAQ6C,EAAE;QAAEf,SAAAA,EAAU,YAAA;AAAc,QAAA,GAAGf,SAAS+B,SAAS;;AACxEvB,YAAAA,IAAAA,CAAKwB,0BAAe/C,OAAAA,EAAS,cAAA,EAAgB,cAAcC,MAAAA,EAAQ,QAAA,EAAUc,SAASiC,eAAe,CAAA;0BACtGpB,eAAA,CAACC,KAAAA,EAAAA;gBAAIC,SAAAA,EAAU,iCAAA;;kCACXC,cAAA,CAACkB,QAAAA,EAAAA;AAAQ,wBAAA,GAAGlC,SAASmC,iBAAiB;AAAE,wBAAA,QAAA,EAAA;;kCACxCnB,cAAA,CAACkB,QAAAA,EAAAA;AAAQ,wBAAA,GAAGlC,SAASoC,oBAAoB;AAAE,wBAAA,QAAA,EAAA;;kCAC3CpB,cAAA,CAACkB,QAAAA,EAAAA;AAAQ,wBAAA,GAAGlC,SAASqC,iBAAiB;AAAE,wBAAA,QAAA,EAAA;;kCACxCrB,cAAA,CAACkB,QAAAA,EAAAA;AAAQ,wBAAA,GAAGlC,SAASsC,oBAAoB;AAAE,wBAAA,QAAA,EAAA;;;;AAE9C9B,YAAAA,IAAAA,CAAKwB,0BAAe/C,OAAAA,EAAS,cAAA,EAAgB,aAAaK,MAAAA,EAAQ,QAAA,EAAUU,SAASuC,eAAe;;;AAGjH;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeTimeline.js","sources":["../../../data/PrimeTimeline.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 { Timeline } from 'primereact/timeline';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { recordArrayProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:timeline` component - events laid out along an axis.\n *\n * PrimeReact 11 replaced the `value` / `content` / `opposite` render props with a composition: a root\n * that carries only alignment and orientation, and event, opposite, separator, marker, connector and\n * content parts the caller assembles per event. The adapter walks the events itself and builds that\n * structure from the `titleField`, `descriptionField` and `dateField` properties.\n *\n * The connector is left off the last event on purpose - it is the line *between* two events, and drawing\n * one after the final marker makes the timeline look truncated rather than finished.\n *\n * The authored property is still called `layout`, as in PrimeReact 10, even though the prop it feeds is\n * now `orientation`; renaming it would break every screen for no gain the author can see.\n */\nexport function PrimeTimeline({ element }: RegisteredComponentProps) {\n const titleField = stringProperty(element, 'titleField', 'title');\n const descriptionField = stringProperty(element, 'descriptionField', 'description');\n const dateField = stringProperty(element, 'dateField', 'date');\n const events = recordArrayProperty(element, 'events');\n\n return (\n <Timeline.Root\n data-scene-id={element.id}\n align={alignmentOf(stringProperty(element, 'align', 'left'))}\n orientation={orientationOf(stringProperty(element, 'layout', 'vertical'))}>\n {events.map((event, index) => (\n <Timeline.Event key={index}>\n <Timeline.Opposite>\n <span className='text-sm opacity-75'>{String(event[dateField] ?? '')}</span>\n </Timeline.Opposite>\n <Timeline.Separator>\n <Timeline.Marker />\n {index < events.length - 1 && <Timeline.Connector />}\n </Timeline.Separator>\n <Timeline.Content>\n <div className='flex flex-col'>\n <span className='font-semibold'>{String(event[titleField] ?? '')}</span>\n <span className='text-sm opacity-75'>{String(event[descriptionField] ?? '')}</span>\n </div>\n </Timeline.Content>\n </Timeline.Event>\n ))}\n </Timeline.Root>\n );\n}\n\nfunction alignmentOf(value: string): 'left' | 'right' | 'alternate' | 'top' | 'bottom' {\n switch (value) {\n case 'right':\n case 'alternate':\n case 'top':\n case 'bottom':\n return value;\n default:\n return 'left';\n }\n}\n\nfunction orientationOf(value: string): 'horizontal' | 'vertical' {\n return value === 'horizontal' ? 'horizontal' : 'vertical';\n}\n"],"names":["PrimeTimeline","element","titleField","stringProperty","descriptionField","dateField","events","recordArrayProperty","_jsx","Timeline","Root","data-scene-id","id","align","alignmentOf","orientation","orientationOf","map","event","index","_jsxs","Event","Opposite","span","className","String","Separator","Marker","length","Connector","Content","div","value"],"mappings":";;;;;;AAOA;;;;;;;;;;;;;AAaC,IACM,SAASA,aAAAA,CAAc,EAAEC,OAAO,EAA4B,EAAA;IAC/D,MAAMC,UAAAA,GAAaC,yBAAAA,CAAeF,OAAAA,EAAS,YAAA,EAAc,OAAA,CAAA;IACzD,MAAMG,gBAAAA,GAAmBD,yBAAAA,CAAeF,OAAAA,EAAS,kBAAA,EAAoB,aAAA,CAAA;IACrE,MAAMI,SAAAA,GAAYF,yBAAAA,CAAeF,OAAAA,EAAS,WAAA,EAAa,MAAA,CAAA;IACvD,MAAMK,MAAAA,GAASC,+BAAoBN,OAAAA,EAAS,QAAA,CAAA;IAE5C,qBACIO,cAAA,CAACC,kBAASC,IAAI,EAAA;AACVC,QAAAA,eAAAA,EAAeV,QAAQW,EAAE;QACzBC,KAAAA,EAAOC,WAAAA,CAAYX,yBAAAA,CAAeF,OAAAA,EAAS,OAAA,EAAS,MAAA,CAAA,CAAA;QACpDc,WAAAA,EAAaC,aAAAA,CAAcb,yBAAAA,CAAeF,OAAAA,EAAS,QAAA,EAAU,UAAA,CAAA,CAAA;AAC5DK,QAAAA,QAAAA,EAAAA,MAAAA,CAAOW,GAAG,CAAC,CAACC,OAAOC,KAAAA,iBAChBC,eAAA,CAACX,kBAASY,KAAK,EAAA;;AACX,kCAAAb,cAAA,CAACC,kBAASa,QAAQ,EAAA;AACd,wBAAA,QAAA,gBAAAd,cAAA,CAACe,MAAAA,EAAAA;4BAAKC,SAAAA,EAAU,oBAAA;sCAAsBC,MAAAA,CAAOP,KAAK,CAACb,SAAAA,CAAU,IAAI,EAAA;;;AAErE,kCAAAe,eAAA,CAACX,kBAASiB,SAAS,EAAA;;AACf,0CAAAlB,cAAA,CAACC,kBAASkB,MAAM,EAAA,EAAA,CAAA;AACfR,4BAAAA,KAAAA,GAAQb,OAAOsB,MAAM,GAAG,CAAA,kBAAKpB,cAAA,CAACC,kBAASoB,SAAS,EAAA,EAAA;;;AAErD,kCAAArB,cAAA,CAACC,kBAASqB,OAAO,EAAA;AACb,wBAAA,QAAA,gBAAAV,eAAA,CAACW,KAAAA,EAAAA;4BAAIP,SAAAA,EAAU,eAAA;;8CACXhB,cAAA,CAACe,MAAAA,EAAAA;oCAAKC,SAAAA,EAAU,eAAA;8CAAiBC,MAAAA,CAAOP,KAAK,CAAChB,UAAAA,CAAW,IAAI,EAAA;;8CAC7DM,cAAA,CAACe,MAAAA,EAAAA;oCAAKC,SAAAA,EAAU,oBAAA;8CAAsBC,MAAAA,CAAOP,KAAK,CAACd,gBAAAA,CAAiB,IAAI,EAAA;;;;;;AAX/De,aAAAA,EAAAA,KAAAA,CAAAA;;AAkBrC;AAEA,SAASL,YAAYkB,KAAa,EAAA;IAC9B,OAAQA,KAAAA;QACJ,KAAK,OAAA;QACL,KAAK,WAAA;QACL,KAAK,KAAA;QACL,KAAK,QAAA;YACD,OAAOA,KAAAA;AACX,QAAA;YACI,OAAO,MAAA;AACf;AACJ;AAEA,SAAShB,cAAcgB,KAAa,EAAA;IAChC,OAAOA,KAAAA,KAAU,eAAe,YAAA,GAAe,UAAA;AACnD
|
|
1
|
+
{"version":3,"file":"PrimeTimeline.js","sources":["../../../data/PrimeTimeline.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 { Timeline } from 'primereact/timeline';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { recordArrayProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:timeline` component - events laid out along an axis.\n *\n * PrimeReact 11 replaced the `value` / `content` / `opposite` render props with a composition: a root\n * that carries only alignment and orientation, and event, opposite, separator, marker, connector and\n * content parts the caller assembles per event. The adapter walks the events itself and builds that\n * structure from the `titleField`, `descriptionField` and `dateField` properties.\n *\n * The connector is left off the last event on purpose - it is the line *between* two events, and drawing\n * one after the final marker makes the timeline look truncated rather than finished.\n *\n * The authored property is still called `layout`, as in PrimeReact 10, even though the prop it feeds is\n * now `orientation`; renaming it would break every screen for no gain the author can see.\n */\nexport function PrimeTimeline({ element }: RegisteredComponentProps) {\n const titleField = stringProperty(element, 'titleField', 'title');\n const descriptionField = stringProperty(element, 'descriptionField', 'description');\n const dateField = stringProperty(element, 'dateField', 'date');\n const events = recordArrayProperty(element, 'events');\n\n return (\n <Timeline.Root\n data-scene-id={element.id}\n align={alignmentOf(stringProperty(element, 'align', 'left'))}\n orientation={orientationOf(stringProperty(element, 'layout', 'vertical'))}>\n {events.map((event, index) => (\n <Timeline.Event key={index}>\n <Timeline.Opposite>\n <span className='text-sm opacity-75'>{String(event[dateField] ?? '')}</span>\n </Timeline.Opposite>\n <Timeline.Separator>\n <Timeline.Marker />\n {index < events.length - 1 && <Timeline.Connector />}\n </Timeline.Separator>\n <Timeline.Content>\n <div className='flex flex-col'>\n <span className='font-semibold'>{String(event[titleField] ?? '')}</span>\n <span className='text-sm opacity-75'>{String(event[descriptionField] ?? '')}</span>\n </div>\n </Timeline.Content>\n </Timeline.Event>\n ))}\n </Timeline.Root>\n );\n}\n\nfunction alignmentOf(value: string): 'left' | 'right' | 'alternate' | 'top' | 'bottom' {\n switch (value) {\n case 'right':\n case 'alternate':\n case 'top':\n case 'bottom':\n return value;\n default:\n return 'left';\n }\n}\n\nfunction orientationOf(value: string): 'horizontal' | 'vertical' {\n return value === 'horizontal' ? 'horizontal' : 'vertical';\n}\n"],"names":["PrimeTimeline","element","titleField","stringProperty","descriptionField","dateField","events","recordArrayProperty","_jsx","Timeline","Root","data-scene-id","id","align","alignmentOf","orientation","orientationOf","map","event","index","_jsxs","Event","Opposite","span","className","String","Separator","Marker","length","Connector","Content","div","value"],"mappings":";;;;;;AAOA;;;;;;;;;;;;;AAaC,IACM,SAASA,aAAAA,CAAc,EAAEC,OAAO,EAA4B,EAAA;IAC/D,MAAMC,UAAAA,GAAaC,yBAAAA,CAAeF,OAAAA,EA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,EAAU,eAAA;8CAAiBC,MAAAA,CAAOP,KAAK,CAAChB,UAAAA,CAAW,IAAI,EAAA;;8CAC7DM,cAAA,CAACe,MAAAA,EAAAA;oCAAKC,SAAAA,EAAU,oBAAA;8CAAsBC,MAAAA,CAAOP,KAAK,CAACd,gBAAAA,CAAiB,IAAI,EAAA;;;;;;AAX/De,aAAAA,EAAAA,KAAAA,CAAAA;;AAkBrC;AAEA,SAASL,YAAYkB,KAAa,EAAA;IAC9B,OAAQA,KAAAA;QACJ,KAAK,OAAA;QACL,KAAK,WAAA;QACL,KAAK,KAAA;QACL,KAAK,QAAA;YACD,OAAOA,KAAAA;AACX,QAAA;YACI,OAAO,MAAA;AACf;AACJ;AAEA,SAAShB,cAAcgB,KAAa,EAAA;IAChC,OAAOA,KAAAA,KAAU,eAAe,YAAA,GAAe,UAAA;AACnD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeTree.js","sources":["../../../data/PrimeTree.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 { Tree, type TreeNodeRow } from 'primereact/tree';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty } from '../properties';\nimport { treeNodesProperty } from '../treeNodes';\nimport { toPrimeTreeNodes } from './primeTreeNodes';\n\n/**\n * The `PrimeReact:tree` component - a hierarchy the user can expand and collapse.\n *\n * PrimeReact 11 renders the tree through a flat iterator: `Tree.Nodes` calls its child once per *visible*\n * node, already flattened, and the indentation comes from a level custom property rather than from\n * nesting. That is why this looks like a list even though it draws a tree - the recursion happens in the\n * root, which resolves each node by key, and the adapter only has to say what one row looks like.\n *\n * The two toggle indicators are matched on state rather than swapped in code so that the collapsed and\n * expanded glyphs are both declared up front; `Tree.Toggle` renders a spacer instead of a button for a\n * leaf, which keeps every row's label on the same left edge.\n */\nexport function PrimeTree({ element }: RegisteredComponentProps) {\n return (\n <Tree.Root\n data-scene-id={element.id}\n value={toPrimeTreeNodes(treeNodesProperty(element, 'nodes'))}\n selectionMode={booleanProperty(element, 'selectable', false) ? 'single' : undefined}>\n {booleanProperty(element, 'filter', false) && <Tree.Filter as='input' placeholder='Search' />}\n <Tree.Nodes>\n {(row: TreeNodeRow) => (\n <Tree.Node uKey={row.node.key}>\n <Tree.Content>\n <Tree.Toggle>\n <Tree.ToggleIndicator match='collapsed'>▸</Tree.ToggleIndicator>\n <Tree.ToggleIndicator match='expanded'>▾</Tree.ToggleIndicator>\n </Tree.Toggle>\n <Tree.Label>{row.node.label}</Tree.Label>\n </Tree.Content>\n </Tree.Node>\n )}\n </Tree.Nodes>\n </Tree.Root>\n );\n}\n"],"names":["PrimeTree","element","_jsxs","Tree","Root","data-scene-id","id","value","toPrimeTreeNodes","treeNodesProperty","selectionMode","booleanProperty","undefined","_jsx","Filter","as","placeholder","Nodes","row","Node","uKey","node","key","Content","Toggle","ToggleIndicator","match","Label","label"],"mappings":";;;;;;;;AASA;;;;;;;;;;;AAWC,IACM,SAASA,SAAAA,CAAU,EAAEC,OAAO,EAA4B,EAAA;IAC3D,qBACIC,eAAA,CAACC,UAAKC,IAAI,EAAA;AACNC,QAAAA,eAAAA,EAAeJ,QAAQK,EAAE;QACzBC,KAAAA,EAAOC,+BAAAA,CAAiBC,4BAAkBR,OAAAA,EAAS,OAAA,CAAA,CAAA;AACnDS,QAAAA,aAAAA,EAAeC,0BAAAA,CAAgBV,OAAAA,EAAS,YAAA,EAAc,KAAA,CAAA,GAAS,QAAA,GAAWW,SAAAA;;AACzED,YAAAA,0BAAAA,CAAgBV,OAAAA,EAAS,QAAA,EAAU,KAAA,CAAA,kBAAUY,cAAA,CAACV,UAAKW,MAAM,EAAA;gBAACC,EAAAA,EAAG,OAAA;gBAAQC,WAAAA,EAAY;;AAClF,0BAAAH,cAAA,CAACV,UAAKc,KAAK,EAAA;0BACN,CAACC,GAAAA,iBACEL,cAAA,CAACV,SAAAA,CAAKgB,IAAI,EAAA;wBAACC,IAAAA,EAAMF,GAAAA,CAAIG,IAAI,CAACC,GAAG;gDACzBpB,eAAA,CAACC,UAAKoB,OAAO,EAAA;;AACT,8CAAArB,eAAA,CAACC,UAAKqB,MAAM,EAAA;;AACR,sDAAAX,cAAA,CAACV,UAAKsB,eAAe,EAAA;4CAACC,KAAAA,EAAM,WAAA;AAAY,4CAAA,QAAA,EAAA;;AACxC,sDAAAb,cAAA,CAACV,UAAKsB,eAAe,EAAA;4CAACC,KAAAA,EAAM,UAAA;AAAW,4CAAA,QAAA,EAAA;;;;AAE3C,8CAAAb,cAAA,CAACV,UAAKwB,KAAK,EAAA;8CAAET,GAAAA,CAAIG,IAAI,CAACO;;;;;;;;AAOlD
|
|
1
|
+
{"version":3,"file":"PrimeTree.js","sources":["../../../data/PrimeTree.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 { Tree, type TreeNodeRow } from 'primereact/tree';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty } from '../properties';\nimport { treeNodesProperty } from '../treeNodes';\nimport { toPrimeTreeNodes } from './primeTreeNodes';\n\n/**\n * The `PrimeReact:tree` component - a hierarchy the user can expand and collapse.\n *\n * PrimeReact 11 renders the tree through a flat iterator: `Tree.Nodes` calls its child once per *visible*\n * node, already flattened, and the indentation comes from a level custom property rather than from\n * nesting. That is why this looks like a list even though it draws a tree - the recursion happens in the\n * root, which resolves each node by key, and the adapter only has to say what one row looks like.\n *\n * The two toggle indicators are matched on state rather than swapped in code so that the collapsed and\n * expanded glyphs are both declared up front; `Tree.Toggle` renders a spacer instead of a button for a\n * leaf, which keeps every row's label on the same left edge.\n */\nexport function PrimeTree({ element }: RegisteredComponentProps) {\n return (\n <Tree.Root\n data-scene-id={element.id}\n value={toPrimeTreeNodes(treeNodesProperty(element, 'nodes'))}\n selectionMode={booleanProperty(element, 'selectable', false) ? 'single' : undefined}>\n {booleanProperty(element, 'filter', false) && <Tree.Filter as='input' placeholder='Search' />}\n <Tree.Nodes>\n {(row: TreeNodeRow) => (\n <Tree.Node uKey={row.node.key}>\n <Tree.Content>\n <Tree.Toggle>\n <Tree.ToggleIndicator match='collapsed'>▸</Tree.ToggleIndicator>\n <Tree.ToggleIndicator match='expanded'>▾</Tree.ToggleIndicator>\n </Tree.Toggle>\n <Tree.Label>{row.node.label}</Tree.Label>\n </Tree.Content>\n </Tree.Node>\n )}\n </Tree.Nodes>\n </Tree.Root>\n );\n}\n"],"names":["PrimeTree","element","_jsxs","Tree","Root","data-scene-id","id","value","toPrimeTreeNodes","treeNodesProperty","selectionMode","booleanProperty","undefined","_jsx","Filter","as","placeholder","Nodes","row","Node","uKey","node","key","Content","Toggle","ToggleIndicator","match","Label","label"],"mappings":";;;;;;;;AASA;;;;;;;;;;;AAWC,IACM,SAASA,SAAAA,CAAU,EAAEC,OAAO,EAA4B,EAAA;IAC3D,qBACIC,eAAA,CAACC,UAAKC,IAAI,EAAA;AACNC,QAAAA,eAAAA,EAAeJ,QAAQK,EAAE;QACzBC,KAAAA,EAAOC,+BAAAA,CAAiBC,4BAAkBR,OAAAA,EAAS,OAAA,CAAA,CAAA;AACnDS,QAAAA,aAAAA,EAAeC,0BAAAA,CAAgBV,OAAAA,EAAS,YAAA,EAAc,KAAA,CAAA,GAAS,QAAA,GAAWW,SAAAA;;AACzED,YAAAA,0BAAAA,CAAgBV,OAAAA,EAAS,QAAA,EAAU,KAAA,CAAA,kBAAUY,cAAA,CAACV,UAAKW,MAAM,EAAA;gBAACC,EAAAA,EAAG,OAAA;gBAAQC,WAAAA,EAAY;;AAClF,0BAAAH,cAAA,CAACV,UAAKc,KAAK,EAAA;0BACN,CAACC,GAAAA,iBACEL,cAAA,CAACV,SAAAA,CAAKgB,IAAI,EAAA;wBAACC,IAAAA,EAAMF,GAAAA,CAAIG,IAAI,CAACC,GAAG;gDACzBpB,eAAA,CAACC,UAAKoB,OAAO,EAAA;;AACT,8CAAArB,eAAA,CAACC,UAAKqB,MAAM,EAAA;;AACR,sDAAAX,cAAA,CAACV,UAAKsB,eAAe,EAAA;4CAACC,KAAAA,EAAM,WAAA;AAAY,4CAAA,QAAA,EAAA;;AACxC,sDAAAb,cAAA,CAACV,UAAKsB,eAAe,EAAA;4CAACC,KAAAA,EAAM,UAAA;AAAW,4CAAA,QAAA,EAAA;;;;AAE3C,8CAAAb,cAAA,CAACV,UAAKwB,KAAK,EAAA;8CAAET,GAAAA,CAAIG,IAAI,CAACO;;;;;;;;AAOlD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columnDefinitions.js","sources":["../../../data/columnDefinitions.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 { ExternalComponent, SceneElement } from '@cratis/scene.model';\nimport { recordArrayProperty, stringArrayProperty } from '../properties';\nimport { ColumnDefinition } from './ColumnDefinition';\n\n/**\n * Works out a table's columns, preferring what the screen said most explicitly.\n *\n * There are three ways a screen can express columns, and this walks them in order of intent:\n *\n * 1. Nested `column` children. Screenplay's screen vocabulary produces these, so they come first.\n * 2. A `columns` property, for a screen that would rather configure the table than nest elements.\n * 3. Nothing at all - in which case the keys of the first row are used.\n *\n * The third step matters more than it looks: a table given rows and no column configuration is the most\n * common thing an author writes first, and inferring the columns means it renders their data instead of\n * an empty grid they have to debug.\n *\n * Note that the children are read from `element.slots` - the *model* - and not from the rendered React\n * nodes the adapter is handed. Those nodes are `PrimeColumn` adapters produced by Scene's renderer, one\n * level removed from the `Column` declarations they render, so no amount of inspecting them recovers the\n * declaration. Reading the model instead is what makes nested `column` children work at all, and it is\n * why this derivation survived PrimeReact 11 removing `primereact/column` unchanged: it never depended\n * on the component in the first place.\n *\n * @param element The table element.\n * @param rows The rows the table will show, used for the inference step.\n * @returns The column definitions, in order.\n */\nexport function columnDefinitions(element: ExternalComponent, rows: Record<string, unknown>[]): ColumnDefinition[] {\n const children = [...(element.slots.columns ?? []), ...(element.slots.content ?? [])];\n const fromChildren = children.map(toColumnDefinition).filter((column): column is ColumnDefinition => column !== undefined);\n if (fromChildren.length > 0) return fromChildren;\n\n const fromProperty = recordArrayProperty(element, 'columns')\n .map((column) => toColumnDefinition({ id: '', properties: column }))\n .filter((column): column is ColumnDefinition => column !== undefined);\n if (fromProperty.length > 0) return fromProperty;\n\n const fromNames = stringArrayProperty(element, 'columns').map((field) => ({ field, header: field, sortable: false }));\n if (fromNames.length > 0) return fromNames;\n\n return Object.keys(rows[0] ?? {}).map((field) => ({ field, header: field, sortable: false }));\n}\n\nfunction toColumnDefinition(element: SceneElement): ColumnDefinition | undefined {\n const field = element.properties.field;\n const header = element.properties.header ?? element.properties.label;\n if (typeof field !== 'string') return undefined;\n return {\n field,\n header: typeof header === 'string' ? header : field,\n sortable: element.properties.sortable === true,\n };\n}\n"],"names":["columnDefinitions","element","rows","children","slots","columns","content","fromChildren","map","toColumnDefinition","filter","column","undefined","length","fromProperty","recordArrayProperty","properties","fromNames","stringArrayProperty","field","header","sortable","Object","keys","label"],"mappings":";;;;AAAA;AACA;AAMA;;;;;;;;;;;;;;;;;;;;;;;AAuBC,IACM,SAASA,iBAAAA,CAAkBC,OAA0B,EAAEC,IAA+B,EAAA;AACzF,IAAA,MAAMC,QAAAA,GAAW;AAAKF,QAAAA,GAAAA,OAAAA,CAAQG,KAAK,CAACC,OAAO,IAAI,EAAE;AAAOJ,QAAAA,GAAAA,OAAAA,CAAQG,KAAK,CAACE,OAAO,IAAI;AAAI,KAAA;IACrF,MAAMC,YAAAA,GAAeJ,SAASK,GAAG,CAACC,oBAAoBC,MAAM,CAAC,CAACC,MAAAA,GAAuCA,MAAAA,KAAWC,SAAAA,CAAAA;AAChH,IAAA,IAAIL,YAAAA,CAAaM,MAAM,GAAG,CAAA,EAAG,OAAON,YAAAA;IAEpC,MAAMO,YAAAA,GAAeC,+BAAoBd,OAAAA,EAAS,SAAA,CAAA,CAC7CO,GAAG,CAAC,CAAC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is. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ExternalComponent, SceneElement } from '@cratis/scene.model';\nimport { recordArrayProperty, stringArrayProperty } from '../properties';\nimport { ColumnDefinition } from './ColumnDefinition';\n\n/**\n * Works out a table's columns, preferring what the screen said most explicitly.\n *\n * There are three ways a screen can express columns, and this walks them in order of intent:\n *\n * 1. Nested `column` children. Screenplay's screen vocabulary produces these, so they come first.\n * 2. A `columns` property, for a screen that would rather configure the table than nest elements.\n * 3. Nothing at all - in which case the keys of the first row are used.\n *\n * The third step matters more than it looks: a table given rows and no column configuration is the most\n * common thing an author writes first, and inferring the columns means it renders their data instead of\n * an empty grid they have to debug.\n *\n * Note that the children are read from `element.slots` - the *model* - and not from the rendered React\n * nodes the adapter is handed. Those nodes are `PrimeColumn` adapters produced by Scene's renderer, one\n * level removed from the `Column` declarations they render, so no amount of inspecting them recovers the\n * declaration. Reading the model instead is what makes nested `column` children work at all, and it is\n * why this derivation survived PrimeReact 11 removing `primereact/column` unchanged: it never depended\n * on the component in the first place.\n *\n * @param element The table element.\n * @param rows The rows the table will show, used for the inference step.\n * @returns The column definitions, in order.\n */\nexport function columnDefinitions(element: ExternalComponent, rows: Record<string, unknown>[]): ColumnDefinition[] {\n const children = [...(element.slots.columns ?? []), ...(element.slots.content ?? [])];\n const fromChildren = children.map(toColumnDefinition).filter((column): column is ColumnDefinition => column !== undefined);\n if (fromChildren.length > 0) return fromChildren;\n\n const fromProperty = recordArrayProperty(element, 'columns')\n .map((column) => toColumnDefinition({ id: '', properties: column }))\n .filter((column): column is ColumnDefinition => column !== undefined);\n if (fromProperty.length > 0) return fromProperty;\n\n const fromNames = stringArrayProperty(element, 'columns').map((field) => ({ field, header: field, sortable: false }));\n if (fromNames.length > 0) return fromNames;\n\n return Object.keys(rows[0] ?? {}).map((field) => ({ field, header: field, sortable: false }));\n}\n\nfunction toColumnDefinition(element: SceneElement): ColumnDefinition | undefined {\n const field = element.properties.field;\n const header = element.properties.header ?? element.properties.label;\n if (typeof field !== 'string') return undefined;\n return {\n field,\n header: typeof header === 'string' ? header : field,\n sortable: element.properties.sortable === true,\n };\n}\n"],"names":["columnDefinitions","element","rows","children","slots","columns","content","fromChildren","map","toColumnDefinition","filter","column","undefined","length","fromProperty","recordArrayProperty","properties","fromNames","stringArrayProperty","field","header","sortable","Object","keys","label"],"mappings":";;;;AAAA;AACA;AAMA;;;;;;;;;;;;;;;;;;;;;;;AAuBC,IACM,SAASA,iBAAAA,CAAkBC,OAA0B,EAAEC,IAA+B,EAAA;AACzF,IAAA,MAAMC,QAAAA,GAAW;AAAKF,QAAAA,GAAAA,OAAAA,CAAQG,KAAK,CAACC,OAAO,IAAI,EAAE;AAAOJ,QAAAA,GAAAA,OAAAA,CAAQG,KAAK,CAACE,OAAO,IAAI;AAAI,KAAA;IACrF,MAAMC,YAAAA,GAAeJ,SAASK,GAAG,CAACC,oBAAoBC,MAAM,CAAC,CAACC,MAAAA,GAAuCA,MAAAA,KAAWC,SAAAA,CAAAA;AAChH,IAAA,IAAIL,YAAAA,CAAaM,MAAM,GAAG,CAAA,EAAG,OAAON,YAAAA;IAEpC,MAAMO,YAAAA,GAAeC,+BAAoBd,OAAAA,EAAS,SAAA,CAAA,CAC7CO,GAAG,CAAC,CAACG,SAAWF,kBAAAA,CAAmB;YAAUO,UAAAA,EAAYL;AAAO,SAAA,CAAA,CAAA,CAChED,MAAM,CAAC,CAACC,MAAAA,GAAuCA,MAAAA,KAAWC,SAAAA,CAAAA;AAC/D,IAAA,IAAIE,YAAAA,CAAaD,MAAM,GAAG,CAAA,EAAG,OAAOC,YAAAA;IAEpC,MAAMG,SAAAA,GAAYC,+BAAoBjB,OAAAA,EAAS,SAAA,CAAA,CAAWO,GAAG,CAAC,CAACW,SAAW;AAAEA,YAAAA,KAAAA;YAAOC,MAAAA,EAAQD,KAAAA;YAAOE,QAAAA,EAAU;SAAM,CAAA,CAAA;AAClH,IAAA,IAAIJ,SAAAA,CAAUJ,MAAM,GAAG,CAAA,EAAG,OAAOI,SAAAA;AAEjC,IAAA,OAAOK,MAAAA,CAAOC,IAAI,CAACrB,IAAI,CAAC,CAAA,CAAE,IAAI,EAAC,CAAA,CAAGM,GAAG,CAAC,CAACW,SAAW;AAAEA,YAAAA,KAAAA;YAAOC,MAAAA,EAAQD,KAAAA;YAAOE,QAAAA,EAAU;SAAM,CAAA,CAAA;AAC9F;AAEA,SAASZ,mBAAmBR,OAAqB,EAAA;AAC7C,IAAA,MAAMkB,KAAAA,GAAQlB,OAAAA,CAAQe,UAAU,CAACG,KAAK;IACtC,MAAMC,MAAAA,GAASnB,QAAQe,UAAU,CAACI,MAAM,IAAInB,OAAAA,CAAQe,UAAU,CAACQ,KAAK;IACpE,IAAI,OAAOL,KAAAA,KAAU,QAAA,EAAU,OAAOP,SAAAA;IACtC,OAAO;AACHO,QAAAA,KAAAA;QACAC,MAAAA,EAAQ,OAAOA,MAAAA,KAAW,QAAA,GAAWA,MAAAA,GAASD,KAAAA;AAC9CE,QAAAA,QAAAA,EAAUpB,OAAAA,CAAQe,UAAU,CAACK,QAAQ,KAAK;AAC9C,KAAA;AACJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primeTreeNodes.js","sources":["../../../data/primeTreeNodes.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 { TreeNode } from '../TreeNode';\n\n/**\n * A node in the shape PrimeReact 11's tree and organization chart both accept.\n *\n * The one difference from Scene's own {@link TreeNode} is that `key` is required. PrimeReact 11 resolves\n * every node by key - `Tree.Node` and `OrganizationChart.Node` take a `uKey` and look the node up rather\n * than receiving it - so a node without one cannot be rendered at all, where in PrimeReact 10 it merely\n * misbehaved. Scene's `TreeNode` keeps `key` optional because an author need not supply one; this type is\n * where that optionality is discharged.\n *\n * Declared as a type alias rather than an interface on purpose: PrimeReact's node types carry an index\n * signature for arbitrary extra data, and only a type alias is assignable to one.\n */\nexport type PrimeTreeNode = {\n /**\n * Identity, unique across the whole tree.\n */\n key: string;\n\n /**\n * The text shown for the node.\n */\n label?: string;\n\n /**\n * An icon class shown beside the label.\n */\n icon?: string;\n\n /**\n * Child nodes. A node with no `children` is a leaf.\n */\n children?: PrimeTreeNode[];\n\n /**\n * Whatever the author attached to the node, carried through untouched.\n */\n data?: unknown;\n};\n\n/**\n * Converts Scene's tree model into the node shape PrimeReact 11 renders.\n *\n * Synthesizes a key from the node's path when the author did not supply one, for the same reason\n * `toTreeNodes` does: two siblings sharing a label must not share an identity, or expanding one expands\n * the other. The path is stable across re-renders, so expansion and selection survive them.\n *\n * `expanded` and `selectable` are dropped rather than carried. PrimeReact 11 moved both off the node and\n * onto the component - expansion is `defaultExpandedKeys` / `defaultCollapsedKeys`, selectability is the\n * component's `selectionMode` - so a per-node flag has nowhere to land and would silently do nothing.\n *\n * @param nodes The Scene nodes to convert.\n * @param parentKey The key of the node these belong to, used to build stable child keys.\n * @returns The converted nodes, in order.\n */\nexport function toPrimeTreeNodes(nodes: TreeNode[], parentKey = ''): PrimeTreeNode[] {\n return nodes.map((node, index) => {\n const { children, expanded, selectable, ...rest } = node;\n const key = node.key ?? (parentKey === '' ? `${index}` : `${parentKey}-${index}`);\n const converted: PrimeTreeNode = { ...rest, key };\n if (children !== undefined) converted.children = toPrimeTreeNodes(children, key);\n return converted;\n });\n}\n"],"names":["toPrimeTreeNodes","nodes","parentKey","map","node","index","children","expanded","selectable","rest","key","converted","undefined"],"mappings":";;AAAA;AACA;AA2CA;;;;;;;;;;;;;;AAcC,IACM,SAASA,gBAAAA,CAAiBC,KAAiB,EAAEC,YAAY,EAAE,EAAA;AAC9D,IAAA,OAAOD,KAAAA,CAAME,GAAG,CAAC,CAACC,IAAAA,EAAMC,KAAAA,GAAAA;QACpB,MAAM,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,UAAU,EAAE,GAAGC,IAAAA,EAAM,GAAGL,IAAAA;AACpD,QAAA,MAAMM,GAAAA,GAAMN,IAAAA,CAAKM,GAAG,KAAKR,SAAAA,KAAc,EAAA,GAAK,CAAA,EAAGG,KAAAA,CAAAA,CAAO,GAAG,CAAA,EAAGH,SAAAA,CAAU,CAAC,EAAEG,OAAO,CAAD;AAC/E,QAAA,MAAMM,SAAAA,GAA2B;AAAE,YAAA,GAAGF,IAAI;AAAEC,YAAAA;AAAI,SAAA;AAChD,QAAA,IAAIJ,aAAaM,SAAAA,EAAWD,SAAAA,CAAUL,QAAQ,GAAGN,iBAAiBM,QAAAA,EAAUI,GAAAA,CAAAA;QAC5E,OAAOC,SAAAA;AACX,IAAA,CAAA,CAAA;AACJ
|
|
1
|
+
{"version":3,"file":"primeTreeNodes.js","sources":["../../../data/primeTreeNodes.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 { TreeNode } from '../TreeNode';\n\n/**\n * A node in the shape PrimeReact 11's tree and organization chart both accept.\n *\n * The one difference from Scene's own {@link TreeNode} is that `key` is required. PrimeReact 11 resolves\n * every node by key - `Tree.Node` and `OrganizationChart.Node` take a `uKey` and look the node up rather\n * than receiving it - so a node without one cannot be rendered at all, where in PrimeReact 10 it merely\n * misbehaved. Scene's `TreeNode` keeps `key` optional because an author need not supply one; this type is\n * where that optionality is discharged.\n *\n * Declared as a type alias rather than an interface on purpose: PrimeReact's node types carry an index\n * signature for arbitrary extra data, and only a type alias is assignable to one.\n */\nexport type PrimeTreeNode = {\n /**\n * Identity, unique across the whole tree.\n */\n key: string;\n\n /**\n * The text shown for the node.\n */\n label?: string;\n\n /**\n * An icon class shown beside the label.\n */\n icon?: string;\n\n /**\n * Child nodes. A node with no `children` is a leaf.\n */\n children?: PrimeTreeNode[];\n\n /**\n * Whatever the author attached to the node, carried through untouched.\n */\n data?: unknown;\n};\n\n/**\n * Converts Scene's tree model into the node shape PrimeReact 11 renders.\n *\n * Synthesizes a key from the node's path when the author did not supply one, for the same reason\n * `toTreeNodes` does: two siblings sharing a label must not share an identity, or expanding one expands\n * the other. The path is stable across re-renders, so expansion and selection survive them.\n *\n * `expanded` and `selectable` are dropped rather than carried. PrimeReact 11 moved both off the node and\n * onto the component - expansion is `defaultExpandedKeys` / `defaultCollapsedKeys`, selectability is the\n * component's `selectionMode` - so a per-node flag has nowhere to land and would silently do nothing.\n *\n * @param nodes The Scene nodes to convert.\n * @param parentKey The key of the node these belong to, used to build stable child keys.\n * @returns The converted nodes, in order.\n */\nexport function toPrimeTreeNodes(nodes: TreeNode[], parentKey = ''): PrimeTreeNode[] {\n return nodes.map((node, index) => {\n const { children, expanded, selectable, ...rest } = node;\n const key = node.key ?? (parentKey === '' ? `${index}` : `${parentKey}-${index}`);\n const converted: PrimeTreeNode = { ...rest, key };\n if (children !== undefined) converted.children = toPrimeTreeNodes(children, key);\n return converted;\n });\n}\n"],"names":["toPrimeTreeNodes","nodes","parentKey","map","node","index","children","expanded","selectable","rest","key","converted","undefined"],"mappings":";;AAAA;AACA;AA2CA;;;;;;;;;;;;;;AAcC,IACM,SAASA,gBAAAA,CAAiBC,KAAiB,EAAEC,YAAY,EAAE,EAAA;AAC9D,IAAA,OAAOD,KAAAA,CAAME,GAAG,CAAC,CAACC,IAAAA,EAAMC,KAAAA,GAAAA;QACpB,MAAM,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,UAAU,EAAE,GAAGC,IAAAA,EAAM,GAAGL,IAAAA;AACpD,QAAA,MAAMM,GAAAA,GAAMN,IAAAA,CAAKM,GAAG,KAAKR,SAAAA,KAAc,EAAA,GAAK,CAAA,EAAGG,KAAAA,CAAAA,CAAO,GAAG,CAAA,EAAGH,SAAAA,CAAU,CAAC,EAAEG,OAAO,CAAD;AAC/E,QAAA,MAAMM,SAAAA,GAA2B;AAAE,YAAA,GAAGF,IAAI;AAAEC,YAAAA;AAAI,SAAA;AAChD,QAAA,IAAIJ,aAAaM,SAAAA,EAAWD,SAAAA,CAAUL,QAAQ,GAAGN,iBAAiBM,QAAAA,EAAUI,GAAAA,CAAAA;QAC5E,OAAOC,SAAAA;AACX,IAAA,CAAA,CAAA;AACJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectOptions.js","sources":["../../../data/selectOptions.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 { SelectOption } from '../SelectOption';\n\n/**\n * Narrows the untyped item list a PrimeReact 11 headless list hook hands back into {@link SelectOption}s.\n *\n * The order list and pick list hooks are generic over their items but report changes as `unknown[]`,\n * because they only ever move entries around and never look inside one. The adapters fed them\n * `SelectOption`s and get the very same object references back, so this could have been a cast - but a\n * cast would also sail through if a future hook ever synthesized an entry, and the failure would surface\n * as a blank row rather than a missing one. Filtering on the shape keeps the untrusted boundary honest\n * for the cost of one pass over a list the user is looking at.\n *\n * @param values The entries as the hook reported them.\n * @returns The entries that are usable options, in order.\n */\nexport function toSelectOptions(values: unknown[]): SelectOption[] {\n return values.filter(\n (value): value is SelectOption =>\n typeof value === 'object' &&\n value !== null &&\n 'label' in value &&\n typeof value.label === 'string' &&\n 'value' in value &&\n typeof value.value === 'string'\n );\n}\n"],"names":["toSelectOptions","values","filter","value","label"],"mappings":";;AAAA;AACA;AAIA;;;;;;;;;;;;IAaO,SAASA,eAAAA,CAAgBC,MAAiB,EAAA;IAC7C,OAAOA,MAAAA,CAAOC,MAAM,CAChB,CAACC,QACG,OAAOA,KAAAA,KAAU,QAAA,IACjBA,KAAAA,KAAU,IAAA,IACV,OAAA,IAAWA,SACX,OAAOA,KAAAA,CAAMC,KAAK,KAAK,QAAA,IACvB,WAAWD,KAAAA,IACX,OAAOA,KAAAA,CAAMA,KAAK,KAAK,QAAA,CAAA;AAEnC
|
|
1
|
+
{"version":3,"file":"selectOptions.js","sources":["../../../data/selectOptions.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 { SelectOption } from '../SelectOption';\n\n/**\n * Narrows the untyped item list a PrimeReact 11 headless list hook hands back into {@link SelectOption}s.\n *\n * The order list and pick list hooks are generic over their items but report changes as `unknown[]`,\n * because they only ever move entries around and never look inside one. The adapters fed them\n * `SelectOption`s and get the very same object references back, so this could have been a cast - but a\n * cast would also sail through if a future hook ever synthesized an entry, and the failure would surface\n * as a blank row rather than a missing one. Filtering on the shape keeps the untrusted boundary honest\n * for the cost of one pass over a list the user is looking at.\n *\n * @param values The entries as the hook reported them.\n * @returns The entries that are usable options, in order.\n */\nexport function toSelectOptions(values: unknown[]): SelectOption[] {\n return values.filter(\n (value): value is SelectOption =>\n typeof value === 'object' &&\n value !== null &&\n 'label' in value &&\n typeof value.label === 'string' &&\n 'value' in value &&\n typeof value.value === 'string'\n );\n}\n"],"names":["toSelectOptions","values","filter","value","label"],"mappings":";;AAAA;AACA;AAIA;;;;;;;;;;;;IAaO,SAASA,eAAAA,CAAgBC,MAAiB,EAAA;IAC7C,OAAOA,MAAAA,CAAOC,MAAM,CAChB,CAACC,QACG,OAAOA,KAAAA,KAAU,QAAA,IACjBA,KAAAA,KAAU,IAAA,IACV,OAAA,IAAWA,SACX,OAAOA,KAAAA,CAAMC,KAAK,KAAK,QAAA,IACvB,WAAWD,KAAAA,IACX,OAAOA,KAAAA,CAAMA,KAAK,KAAK,QAAA,CAAA;AAEnC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeAutoComplete.js","sources":["../../../form/PrimeAutoComplete.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 { useState } from 'react';\nimport { AutoComplete } from 'primereact/autocomplete';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { SelectOption } from '../SelectOption';\nimport { booleanProperty, optionsProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:autoComplete` component - a text field that suggests from a known set as you type.\n *\n * AutoComplete has no built-in filtering: it asks the host to narrow the list through `onComplete`,\n * because in a real application that is a server call. A Scene element cannot express a server call, so\n * the adapter filters the authored `options` case-insensitively instead - enough for the component to\n * behave like itself in a preview, and honest about where the data came from.\n *\n * PrimeReact 11 renamed the two halves of that arrangement: the narrowed list is `options` (v10 called it\n * `suggestions`) and the callback is `onComplete` (v10's `completeMethod`), and `AutoComplete.List`\n * renders the list itself from `optionLabel` / `optionValue`. The v10 `dropdown` flag is gone as a prop\n * for the same reason it is gone from every other v11 overlay: the button either exists in the\n * composition or it does not, so the property now decides whether to render `AutoComplete.Trigger`.\n */\nexport function PrimeAutoComplete({ element }: RegisteredComponentProps) {\n const all = optionsProperty(element, 'options');\n const [options, setOptions] = useState<SelectOption[]>(all);\n\n return (\n <AutoComplete.Root\n data-scene-id={element.id}\n options={options}\n optionLabel='label'\n optionValue='value'\n defaultInputValue={stringProperty(element, 'value', '')}\n onComplete={(event) => setOptions(all.filter((option) => option.label.toLowerCase().includes(event.query.toLowerCase())))}\n disabled={booleanProperty(element, 'disabled', false)}>\n <AutoComplete.Input placeholder={stringProperty(element, 'placeholder')} />\n {booleanProperty(element, 'dropdown', false) && (\n <AutoComplete.Trigger>\n <i className='pi pi-chevron-down' />\n </AutoComplete.Trigger>\n )}\n <AutoComplete.Portal>\n <AutoComplete.Positioner>\n <AutoComplete.Popup>\n <AutoComplete.List />\n </AutoComplete.Popup>\n </AutoComplete.Positioner>\n </AutoComplete.Portal>\n </AutoComplete.Root>\n );\n}\n"],"names":["PrimeAutoComplete","element","all","optionsProperty","options","setOptions","useState","_jsxs","AutoComplete","Root","data-scene-id","id","optionLabel","optionValue","defaultInputValue","stringProperty","onComplete","event","filter","option","label","toLowerCase","includes","query","disabled","booleanProperty","_jsx","Input","placeholder","Trigger","i","className","Portal","Positioner","Popup","List"],"mappings":";;;;;;;AASA;;;;;;;;;;;;;AAaC,IACM,SAASA,iBAAAA,CAAkB,EAAEC,OAAO,EAA4B,EAAA;IACnE,MAAMC,GAAAA,GA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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 { useState } from 'react';\nimport { AutoComplete } from 'primereact/autocomplete';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { SelectOption } from '../SelectOption';\nimport { booleanProperty, optionsProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:autoComplete` component - a text field that suggests from a known set as you type.\n *\n * AutoComplete has no built-in filtering: it asks the host to narrow the list through `onComplete`,\n * because in a real application that is a server call. A Scene element cannot express a server call, so\n * the adapter filters the authored `options` case-insensitively instead - enough for the component to\n * behave like itself in a preview, and honest about where the data came from.\n *\n * PrimeReact 11 renamed the two halves of that arrangement: the narrowed list is `options` (v10 called it\n * `suggestions`) and the callback is `onComplete` (v10's `completeMethod`), and `AutoComplete.List`\n * renders the list itself from `optionLabel` / `optionValue`. The v10 `dropdown` flag is gone as a prop\n * for the same reason it is gone from every other v11 overlay: the button either exists in the\n * composition or it does not, so the property now decides whether to render `AutoComplete.Trigger`.\n */\nexport function PrimeAutoComplete({ element }: RegisteredComponentProps) {\n const all = optionsProperty(element, 'options');\n const [options, setOptions] = useState<SelectOption[]>(all);\n\n return (\n <AutoComplete.Root\n data-scene-id={element.id}\n options={options}\n optionLabel='label'\n optionValue='value'\n defaultInputValue={stringProperty(element, 'value', '')}\n onComplete={(event) => setOptions(all.filter((option) => option.label.toLowerCase().includes(event.query.toLowerCase())))}\n disabled={booleanProperty(element, 'disabled', false)}>\n <AutoComplete.Input placeholder={stringProperty(element, 'placeholder')} />\n {booleanProperty(element, 'dropdown', false) && (\n <AutoComplete.Trigger>\n <i className='pi pi-chevron-down' />\n </AutoComplete.Trigger>\n )}\n <AutoComplete.Portal>\n <AutoComplete.Positioner>\n <AutoComplete.Popup>\n <AutoComplete.List />\n </AutoComplete.Popup>\n </AutoComplete.Positioner>\n </AutoComplete.Portal>\n </AutoComplete.Root>\n );\n}\n"],"names":["PrimeAutoComplete","element","all","optionsProperty","options","setOptions","useState","_jsxs","AutoComplete","Root","data-scene-id","id","optionLabel","optionValue","defaultInputValue","stringProperty","onComplete","event","filter","option","label","toLowerCase","includes","query","disabled","booleanProperty","_jsx","Input","placeholder","Trigger","i","className","Portal","Positioner","Popup","List"],"mappings":";;;;;;;AASA;;;;;;;;;;;;;AAaC,IACM,SAASA,iBAAAA,CAAkB,EAAEC,OAAO,EAA4B,EAAA;IACnE,MAAMC,GAAAA,GAAMC,2BAAgBF,OAAAA,EAAS,SAAA,CAAA;AACrC,IAAA,MAAM,CAACG,OAAAA,EAASC,UAAAA,CAAW,GAAGC,cAAAA,CAAyBJ,GAAAA,CAAAA;IAEvD,qBACIK,eAAA,CAACC,0BAAaC,IAAI,EAAA;AACdC,QAAAA,eAAAA,EAAeT,QAAQU,EAAE;QACzBP,OAAAA,EAASA,OAAAA;QACTQ,WAAAA,EAAY,OAAA;QACZC,WAAAA,EAAY,OAAA;QACZC,iBAAAA,EAAmBC,yBAAAA,CAAed,SAAS,OAAA,EAAS,EAAA,CAAA;AACpDe,QAAAA,UAAAA,EAAY,CAACC,KAAAA,GAAUZ,UAAAA,CAAWH,IAAIgB,MAAM,CAAC,CAACC,MAAAA,GAAWA,MAAAA,CAAOC,KAAK,CAACC,WAAW,EAAA,CAAGC,QAAQ,CAACL,KAAAA,CAAMM,KAAK,CAACF,WAAW,EAAA,CAAA,CAAA,CAAA;QACpHG,QAAAA,EAAUC,0BAAAA,CAAgBxB,SAAS,UAAA,EAAY,KAAA,CAAA;;AAC/C,0BAAAyB,cAAA,CAAClB,0BAAamB,KAAK,EAAA;AAACC,gBAAAA,WAAAA,EAAab,0BAAed,OAAAA,EAAS,aAAA;;AACxDwB,YAAAA,0BAAAA,CAAgBxB,OAAAA,EAAS,UAAA,EAAY,KAAA,CAAA,kBAClCyB,cAAA,CAAClB,0BAAaqB,OAAO,EAAA;AACjB,gBAAA,QAAA,gBAAAH,cAAA,CAACI,GAAAA,EAAAA;oBAAEC,SAAAA,EAAU;;;AAGrB,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