@cratis/scene.primereact 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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":"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,QAAAA,CAAyB,IAAMC,gBAAgBJ,OAAAA,EAAS,OAAA,CAAA,CAAA;AAClF,IAAA,MAAM,CAACK,SAAAA,EAAWC,YAAAA,CAAa,GAAGH,SAAyB,EAAE,CAAA;AAC7D,IAAA,MAAMI,cAAAA,GAAkD;QACpDC,KAAAA,EAAOP,KAAAA;AACPI,QAAAA,SAAAA;AACAI,QAAAA,aAAAA,EAAe,CAACC,KAAAA,GAAUR,QAAAA,CAASS,eAAAA,CAAgBD,MAAMF,KAAK,CAAA;AAClE,KAAA;AACA,IAAA,MAAMI,YAAYC,YAAAA,CAAaN,cAAAA,CAAAA;IAC/B,MAAMO,MAAAA,GAASC,eAAef,OAAAA,EAAS,QAAA,CAAA;AAEvC,IAAA,MAAMgB,SAAS,CAACC,IAAAA,GACZX,YAAAA,CAAa,CAACY,UAAaA,OAAAA,CAAQC,QAAQ,CAACF,IAAAA,CAAAA,GAAQC,QAAQE,MAAM,CAAC,CAACC,KAAAA,GAAUA,UAAUJ,IAAAA,CAAAA,GAAQ;AAAIC,gBAAAA,GAAAA,OAAAA;AAASD,gBAAAA;AAAK,aAAA,CAAA;AAEtH,IAAA,qBACIK,IAAA,CAACC,KAAAA,EAAAA;AAAIC,QAAAA,eAAAA,EAAexB,QAAQyB,EAAE;QAAEC,SAAAA,EAAU,YAAA;AAAc,QAAA,GAAGd,UAAUe,SAAS;;0BAC1EL,IAAA,CAACC,KAAAA,EAAAA;gBAAIG,SAAAA,EAAU,qBAAA;AAAuB,gBAAA,GAAGd,UAAUgB,aAAa;;kCAC5DC,GAAA,CAACC,QAAAA,EAAAA;AAAQ,wBAAA,GAAGlB,UA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AA,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,QAAAA,CAAyB,IAAMC,gBAAgBJ,OAAAA,EAAS,OAAA,CAAA,CAAA;AAClF,IAAA,MAAM,CAACK,SAAAA,EAAWC,YAAAA,CAAa,GAAGH,SAAyB,EAAE,CAAA;AAC7D,IAAA,MAAMI,cAAAA,GAAkD;QACpDC,KAAAA,EAAOP,KAAAA;AACPI,QAAAA,SAAAA;AACAI,QAAAA,aAAAA,EAAe,CAACC,KAAAA,GAAUR,QAAAA,CAASS,eAAAA,CAAgBD,MAAMF,KAAK,CAAA;AAClE,KAAA;AACA,IAAA,MAAMI,YAAYC,YAAAA,CAAaN,cAAAA,CAAAA;IAC/B,MAAMO,MAAAA,GAASC,eAAef,OAAAA,EAAS,QAAA,CAAA;AAEvC,IAAA,MAAMgB,SAAS,CAACC,IAAAA,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7B,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,GAAA,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,GAAA,CAACC,kBAAkBC,IAAI,EAAA;AAACC,QAAAA,eAAAA,EAAeJ,QAAQK,EAAE;QAAEC,KAAAA,EAAOC,gBAAAA,CAAiBC,kBAAkBR,OAAAA,EAAS,OAAA,CAAA,CAAA;gCAClGC,GAAA,CAACC,kBAAkBO,KAAK,EAAA;sBACnB,CAACC,GAAAA,iBACEC,IAAA,CAACT,iBAAAA,CAAkBU,IAAI,EAAA;oBAACC,IAAAA,EAAMH,GAAAA,CAAII,IAAI,CAACC,GAAG;;AACtC,sCAAAd,GAAA,CAACC,kBAAkBc,OAAO,EAAA;oDACtBf,GAAA,CAACC,kBAAkBe,KAAK,EAAA,EAAA;;AAE5B,sCAAAN,IAAA,CAACT,kBAAkBgB,MAAM,EAAA;;AACrB,8CAAAjB,GAAA,CAACC,kBAAkBiB,eAAe,EAAA;oCAACC,KAAAA,EAAM,WAAA;AAAY,oCAAA,QAAA,EAAA;;AACrD,8CAAAnB,GAAA,CAACC,kBAAkBiB,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,GAAA,CAACC,kBAAkBC,IAAI,EAAA;AAACC,QAAAA,eAAAA,EAAeJ,QAAQK,EAAE;QAAEC,KAAAA,EAAOC,gBAAAA,CAAiBC,kBAAkBR,OAAAA,EAAS,OAAA,CAAA,CAAA;gCAClGC,GAAA,CAACC,kBAAkBO,KAAK,EAAA;sBACnB,CAACC,GAAAA,iBACEC,IAAA,CAACT,iBAAAA,CAAkBU,IAAI,EAAA;oBAACC,IAAAA,EAAMH,GAAAA,CAAII,IAAI,CAACC,GAAG;;AACtC,sCAAAd,GAAA,CAACC,kBAAkBc,OAAO,EAAA;oDACtBf,GAAA,CAACC,kBAAkBe,KAAK,EAAA,EAAA;;AAE5B,sCAAAN,IAAA,CAACT,kBAAkBgB,MAAM,EAAA;;AACrB,8CAAAjB,GAAA,CAACC,kBAAkBiB,eAAe,EAAA;oCAACC,KAAAA,EAAM,WAAA;AAAY,oCAAA,QAAA,EAAA;;AACrD,8CAAAnB,GAAA,CAACC,kBAAkBiB,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,cAAAA,CAAeJ,OAAAA,EAAS,YAAY,EAAA,CAAA,EAAK,CAAA,CAAA;AACnE,IAAA,MAAM,CAACK,IAAAA,EAAMC,OAAAA,CAAQ,GAAGC,QAAAA,CAAS,IAAML,IAAAA,CAAKM,KAAK,CAACJ,cAAAA,CAAeJ,OAAAA,EAAS,OAAA,EAAS,KAAKC,QAAAA,CAAAA,GAAY,CAAA,CAAA;AACpG,IAAA,qBACIQ,GAAA,CAACC,UAAAA,EAAAA;AACGC,QAAAA,OAAAA,EAASX,QAAQY,EAAE;QACnBP,IAAAA,EAAMA,IAAAA;QACNQ,KAAAA,EAAOT,cAAAA,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,cAAAA,CAAeJ,OAAAA,EAAS,YAAY,EAAA,CAAA,EAAK,CAAA,CAAA;AACnE,IAAA,MAAM,CAACK,IAAAA,EAAMC,OAAAA,CAAQ,GAAGC,QAAAA,CAAS,IAAML,IAAAA,CAAKM,KAAK,CAACJ,cAAAA,CAAeJ,OAAAA,EAAS,OAAA,EAAS,KAAKC,QAAAA,CAAAA,GAAY,CAAA,CAAA;AACpG,IAAA,qBACIQ,GAAA,CAACC,UAAAA,EAAAA;AACGC,QAAAA,OAAAA,EAASX,QAAQY,EAAE;QACnBP,IAAAA,EAAMA,IAAAA;QACNQ,KAAAA,EAAOT,cAAAA,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,QAAAA,CAAyB,IAAMC,gBAAgBJ,OAAAA,EAAS,QAAA,CAAA,CAAA;AACpF,IAAA,MAAM,CAACK,MAAAA,EAAQC,SAAAA,CAAU,GAAGH,QAAAA,CAAyB,IAAMC,gBAAgBJ,OAAAA,EAAS,QAAA,CAAA,CAAA;AACpF,IAAA,MAAM,CAACO,SAAAA,EAAWC,YAAAA,CAAa,GAAGL,SAAyB,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,eAAAA,CAAgBD,MAAMV,MAAM,CAAA,CAAA;YACtCK,SAAAA,CAAUM,eAAAA,CAAgBD,MAAMN,MAAM,CAAA,CAAA;AAC1C,QAAA,CAAA;AACAQ,QAAAA,iBAAAA,EAAmB,CAACF,KAAAA,GAAUH,YAAAA,CAAaI,eAAAA,CAAgBD,MAAMG,KAAK,CAAA;AAC1E,KAAA;AACA,IAAA,MAAMC,WAAWC,WAAAA,CAAYP,aAAAA,CAAAA;AAE7B,IAAA,MAAMQ,SAAS,CAACC,IAAAA,GACZV,YAAAA,CAAa,CAACW,UAAaA,OAAAA,CAAQC,QAAQ,CAACF,IAAAA,CAAAA,GAAQC,QAAQE,MAAM,CAAC,CAACC,KAAAA,GAAUA,UAAUJ,IAAAA,CAAAA,GAAQ;AAAIC,gBAAAA,GAAAA,OAAAA;AAASD,gBAAAA;AAAK,aAAA,CAAA;AAEtH,IAAA,MAAM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AAA,CAACkB,QAAAA,EAAAA;AAAQ,wBAAA,GAAGlC,SAASmC,iBAAiB;AAAE,wBAAA,QAAA,EAAA;;kCACxCnB,GAAA,CAACkB,QAAAA,EAAAA;AAAQ,wBAAA,GAAGlC,SAASoC,oBAAoB;AAAE,wBAAA,QAAA,EAAA;;kCAC3CpB,GAAA,CAACkB,QAAAA,EAAAA;AAAQ,wBAAA,GAAGlC,SAASqC,iBAAiB;AAAE,wBAAA,QAAA,EAAA;;kCACxCrB,GAAA,CAACkB,QAAAA,EAAAA;AAAQ,wBAAA,GAAGlC,SAASsC,oBAAoB;AAAE,wBAAA,QAAA,EAAA;;;;AAE9C9B,YAAAA,IAAAA,CAAKwB,eAAe/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","moveToS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;AAAE,wBAAA,QAAA,EAAA;;kCACxCnB,GAAA,CAACkB,QAAAA,EAAAA;AAAQ,wBAAA,GAAGlC,SAASoC,oBAAoB;AAAE,wBAAA,QAAA,EAAA;;kCAC3CpB,GAAA,CAACkB,QAAAA,EAAAA;AAAQ,wBAAA,GAAGlC,SAASqC,iBAAiB;AAAE,wBAAA,QAAA,EAAA;;kCACxCrB,GAAA,CAACkB,QAAAA,EAAAA;AAAQ,wBAAA,GAAGlC,SAASsC,oBAAoB;AAAE,wBAAA,QAAA,EAAA;;;;AAE9C9B,YAAAA,IAAAA,CAAKwB,eAAe/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,cAAAA,CAAeF,OAAAA,EAAS,YAAA,EAAc,OAAA,CAAA;IACzD,MAAMG,gBAAAA,GAAmBD,cAAAA,CAAeF,OAAAA,EAAS,kBAAA,EAAoB,aAAA,CAAA;IACrE,MAAMI,SAAAA,GAAYF,cAAAA,CAAeF,OAAAA,EAAS,WAAA,EAAa,MAAA,CAAA;IACvD,MAAMK,MAAAA,GAASC,oBAAoBN,OAAAA,EAAS,QAAA,CAAA;IAE5C,qBAC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,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,cAAAA,CAAeF,OAAAA,EAAS,YAAA,EAAc,OAAA,CAAA;IACzD,MAAMG,gBAAAA,GAAmBD,cAAAA,CAAeF,OAAAA,EAAS,kBAAA,EAAoB,aAAA,CAAA;IACrE,MAAMI,SAAAA,GAAYF,cAAAA,CAAeF,OAAAA,EAAS,WAAA,EAAa,MAAA,CAAA;IACvD,MAAMK,MAAAA,GAASC,oBAAoBN,OAAAA,EAAS,QAAA,CAAA;IAE5C,qBACIO,GAAA,CAACC,SAASC,IAAI,EAAA;AACVC,QAAAA,eAAAA,EAAeV,QAAQW,EAAE;QACzBC,KAAAA,EAAOC,WAAAA,CAAYX,cAAAA,CAAeF,OAAAA,EAAS,OAAA,EAAS,MAAA,CAAA,CAAA;QACpDc,WAAAA,EAAaC,aAAAA,CAAcb,cAAAA,CAAeF,OAAAA,EAAS,QAAA,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,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,IAAA,CAACC,KAAKC,IAAI,EAAA;AACNC,QAAAA,eAAAA,EAAeJ,QAAQK,EAAE;QACzBC,KAAAA,EAAOC,gBAAAA,CAAiBC,kBAAkBR,OAAAA,EAAS,OAAA,CAAA,CAAA;AACnDS,QAAAA,aAAAA,EAAeC,eAAAA,CAAgBV,OAAAA,EAAS,YAAA,EAAc,KAAA,CAAA,GAAS,QAAA,GAAWW,SAAAA;;AACzED,YAAAA,eAAAA,CAAgBV,OAAAA,EAAS,QAAA,EAAU,KAAA,CAAA,kBAAUY,GAAA,CAACV,KAAKW,MAAM,EAAA;gBAACC,EAAAA,EAAG,OAAA;gBAAQC,WAAAA,EAAY;;AAClF,0BAAAH,GAAA,CAACV,KAAKc,KAAK,EAAA;0BACN,CAACC,GAAAA,iBACEL,GAAA,CAACV,IAAAA,CAAKgB,IAAI,EAAA;wBAACC,IAAAA,EAAMF,GAAAA,CAAIG,IAAI,CAACC,GAAG;gDACzBpB,IAAA,CAACC,KAAKoB,OAAO,EAAA;;AACT,8CAAArB,IAAA,CAACC,KAAKqB,MAAM,EAAA;;AACR,sDAAAX,GAAA,CAACV,KAAKsB,eAAe,EAAA;4CAACC,KAAAA,EAAM,WAAA;AAAY,4CAAA,QAAA,EAAA;;AACxC,sDAAAb,GAAA,CAACV,KAAKsB,eAAe,EAAA;4CAACC,KAAAA,EAAM,UAAA;AAAW,4CAAA,QAAA,EAAA;;;;AAE3C,8CAAAb,GAAA,CAACV,KAAKwB,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,IAAA,CAACC,KAAKC,IAAI,EAAA;AACNC,QAAAA,eAAAA,EAAeJ,QAAQK,EAAE;QACzBC,KAAAA,EAAOC,gBAAAA,CAAiBC,kBAAkBR,OAAAA,EAAS,OAAA,CAAA,CAAA;AACnDS,QAAAA,aAAAA,EAAeC,eAAAA,CAAgBV,OAAAA,EAAS,YAAA,EAAc,KAAA,CAAA,GAAS,QAAA,GAAWW,SAAAA;;AACzED,YAAAA,eAAAA,CAAgBV,OAAAA,EAAS,QAAA,EAAU,KAAA,CAAA,kBAAUY,GAAA,CAACV,KAAKW,MAAM,EAAA;gBAACC,EAAAA,EAAG,OAAA;gBAAQC,WAAAA,EAAY;;AAClF,0BAAAH,GAAA,CAACV,KAAKc,KAAK,EAAA;0BACN,CAACC,GAAAA,iBACEL,GAAA,CAACV,IAAAA,CAAKgB,IAAI,EAAA;wBAACC,IAAAA,EAAMF,GAAAA,CAAIG,IAAI,CAACC,GAAG;gDACzBpB,IAAA,CAACC,KAAKoB,OAAO,EAAA;;AACT,8CAAArB,IAAA,CAACC,KAAKqB,MAAM,EAAA;;AACR,sDAAAX,GAAA,CAACV,KAAKsB,eAAe,EAAA;4CAACC,KAAAA,EAAM,WAAA;AAAY,4CAAA,QAAA,EAAA;;AACxC,sDAAAb,GAAA,CAACV,KAAKsB,eAAe,EAAA;4CAACC,KAAAA,EAAM,UAAA;AAAW,4CAAA,QAAA,EAAA;;;;AAE3C,8CAAAb,GAAA,CAACV,KAAKwB,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,oBAAoBd,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,oBAAoBjB,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
|
+
{"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,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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,GAAMC,gBAAgBF,OAAAA,EAAS,SAAA,CAAA;AACrC,IAAA,MAAM,CAACG,OAAAA,EAASC,UAAAA,CAAW,GAAGC,QAAAA,CAAyBJ,GAAAA,CAAAA;IAEvD,qBACIK,IAAA,CAACC,aAAaC,IAAI,EAAA;AACdC,QAAAA,eAAAA,EAAeT,QAAQU,EAAE;QACzBP,OAAAA,EAASA,OAAAA;QACTQ,WAAAA,EAAY,OAAA;QACZC,WAAAA,EAAY,OAAA;QACZC,iBAAAA,EAAmBC,cAAAA,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,eAAAA,CAAgBxB,SAAS,UAAA,EAAY,KAAA,CAAA;;AAC/C,0BAAAyB,GAAA,CAAClB,aAAamB,KAAK,EAAA;AAACC,gBAAAA,WAAAA,EAAab,eAAed,OAAAA,EAAS,aAAA;;AACxDwB,YAAAA,eAAAA,CAAgBxB,OAAAA,EAAS,UAAA,EAAY,KAAA,CAAA,kBAClCyB,GAAA,CAAClB,aAAaqB,OAAO,EAAA;AACjB,gBAAA,QAAA,gBAAAH,GAAA,CAACI,GAAAA,EAAAA;oBAAEC,SAAAA,EAAU;;;AAGrB,0BAAAL,GAAA,CAAClB,aAAawB,MAAM,EAAA;wCAChBN,GAAA,CAAClB,aAAayB,UAAU,EAAA;4CACpBP,GAAA,CAAClB,aAAa0B,KAAK,EAAA;gDACfR,GAAA,CAAClB,aAAa2B,IAAI,EAAA,EAAA;;;;;;AAM1C
|
|
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,GAAMC,gBAAgBF,OAAAA,EAAS,SAAA,CAAA;AACrC,IAAA,MAAM,CAACG,OAAAA,EAASC,UAAAA,CAAW,GAAGC,QAAAA,CAAyBJ,GAAAA,CAAAA;IAEvD,qBACIK,IAAA,CAACC,aAAaC,IAAI,EAAA;AACdC,QAAAA,eAAAA,EAAeT,QAAQU,EAAE;QACzBP,OAAAA,EAASA,OAAAA;QACTQ,WAAAA,EAAY,OAAA;QACZC,WAAAA,EAAY,OAAA;QACZC,iBAAAA,EAAmBC,cAAAA,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,eAAAA,CAAgBxB,SAAS,UAAA,EAAY,KAAA,CAAA;;AAC/C,0BAAAyB,GAAA,CAAClB,aAAamB,KAAK,EAAA;AAACC,gBAAAA,WAAAA,EAAab,eAAed,OAAAA,EAAS,aAAA;;AACxDwB,YAAAA,eAAAA,CAAgBxB,OAAAA,EAAS,UAAA,EAAY,KAAA,CAAA,kBAClCyB,GAAA,CAAClB,aAAaqB,OAAO,EAAA;AACjB,gBAAA,QAAA,gBAAAH,GAAA,CAACI,GAAAA,EAAAA;oBAAEC,SAAAA,EAAU;;;AAGrB,0BAAAL,GAAA,CAAClB,aAAawB,MAAM,EAAA;wCAChBN,GAAA,CAAClB,aAAayB,UAAU,EAAA;4CACpBP,GAAA,CAAClB,aAAa0B,KAAK,EAAA;gDACfR,GAAA,CAAClB,aAAa2B,IAAI,EAAA,EAAA;;;;;;AAM1C;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeCalendar.js","sources":["../../../form/PrimeCalendar.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 { DatePicker } from 'primereact/datepicker';\nimport { InputText } from 'primereact/inputtext';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:calendar` component - a date picker, named `DatePicker` by PrimeReact 11.\n *\n * The seed value is parsed from an ISO date string because that is what survives a round trip through a\n * Scene model's JSON properties; an unparseable one leaves the field empty rather than showing\n * \"Invalid Date\".\n *\n * v11's `DatePicker` is a composition, and the grid is the bulk of it: `Calendar` holds a `Header` (the\n * month/year title flanked by the two navigation buttons) and a `Table` whose three `TableBody` views are\n * what makes clicking the title drill from days to months to years. That whole calendar is built once\n * here and then placed one of two ways, which is how `inline` survives a version that has no `inline`\n * prop: either inside a `Panel`, which simply renders where it stands, or behind a `Portal` and a\n * `Positioner`, which anchors it to the field and escapes any clipping ancestor.\n */\nexport function PrimeCalendar({ element }: RegisteredComponentProps) {\n const [value, setValue] = useState<Date | undefined>(() => {\n const seed = stringProperty(element, 'value');\n if (seed === undefined) return undefined;\n const parsed = new Date(seed);\n return Number.isNaN(parsed.getTime()) ? undefined : parsed;\n });\n\n const inline = booleanProperty(element, 'inline', false);\n const showTime = booleanProperty(element, 'showTime', false);\n const calendar = (\n <>\n <DatePicker.Calendar>\n <DatePicker.Header>\n <DatePicker.Prev>\n <i className='pi pi-chevron-left' />\n </DatePicker.Prev>\n <DatePicker.Title>\n <DatePicker.SelectMonth />\n <DatePicker.SelectYear />\n <DatePicker.Decade />\n </DatePicker.Title>\n <DatePicker.Next>\n <i className='pi pi-chevron-right' />\n </DatePicker.Next>\n </DatePicker.Header>\n <DatePicker.Table>\n <DatePicker.TableHead />\n <DatePicker.TableBody />\n <DatePicker.TableBody view='month' />\n <DatePicker.TableBody view='year' />\n </DatePicker.Table>\n </DatePicker.Calendar>\n {showTime && <DatePicker.Time />}\n </>\n );\n\n return (\n <DatePicker.Root\n data-scene-id={element.id}\n value={value}\n onValueChange={(event) => setValue(event.value instanceof Date ? event.value : undefined)}\n dateFormat={stringProperty(element, 'dateFormat')}\n showTime={showTime}\n disabled={booleanProperty(element, 'disabled', false)}>\n {inline ? (\n <DatePicker.Panel>{calendar}</DatePicker.Panel>\n ) : (\n <>\n <DatePicker.Input as={InputText} placeholder={stringProperty(element, 'placeholder')} />\n {booleanProperty(element, 'showIcon', true) && (\n <DatePicker.Trigger>\n <i className='pi pi-calendar' />\n </DatePicker.Trigger>\n )}\n <DatePicker.Portal>\n <DatePicker.Positioner align='start'>\n <DatePicker.Popup>{calendar}</DatePicker.Popup>\n </DatePicker.Positioner>\n </DatePicker.Portal>\n </>\n )}\n </DatePicker.Root>\n );\n}\n"],"names":["PrimeCalendar","element","value","setValue","useState","seed","stringProperty","undefined","parsed","Date","Number","isNaN","getTime","inline","booleanProperty","showTime","calendar","_jsxs","_Fragment","DatePicker","Calendar","Header","_jsx","Prev","i","className","Title","SelectMonth","SelectYear","Decade","Next","Table","TableHead","TableBody","view","Time","Root","data-scene-id","id","onValueChange","event","dateFormat","disabled","Panel","Input","as","InputText","placeholder","Trigger","Portal","Positioner","align","Popup"],"mappings":";;;;;;AASA;;;;;;;;;;;;;AAaC,IACM,SAASA,aAAAA,CAAc,EAAEC,OAAO,EAA4B,EAAA;AAC/D,IAAA,MAAM,CAACC,KAAAA,EAAOC,QAAAA,CAAS,GAAGC,QAAAA,CAA2B,IAAA;QACjD,MAAMC,IAAAA,GAAOC,eAAeL,OAAAA,EAAS,OAAA,CAAA;QACrC,IAAII,IAAAA,KAASE,WAAW,OAAOA,SAAAA;QAC/B,MAAMC,MAAAA,GAAS,IAAIC,IAAAA,CAAKJ,IAAAA,CAAAA;AACxB,QAAA,OAAOK,OAAOC,KAAK,CAACH,MAAAA,CAAOI,OAAO,MAAML,SAAAA,GAAYC,MAAAA;AACxD,IAAA,CAAA,CAAA;IAEA,MAAMK,MAAAA,GAASC,eAAAA,CAAgBb,OAAAA,EAAS,QAAA,EAAU,KAAA,CAAA;IAClD,MAAMc,QAAAA,GAAWD,eAAAA,CAAgBb,OAAAA,EAAS,UAAA,EAAY,KAAA,CAAA;AACtD,IAAA,MAAMe,QAAAA,iBACFC,IAAA,CAAAC,QAAA,EAAA;;AACI,0BAAAD,IAAA,CAACE,WAAWC,QAAQ,EAAA;;AAChB,kCAAAH,IAAA,CAACE,WAAWE,MAAM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gBb,SAAS,UAAA,EAAY,KAAA,CAAA;kBAC9CY,MAAAA,iBACGS,GAAA,CAACH,WAAWwB,KAAK,EAAA;AAAE3B,YAAAA,QAAAA,EAAAA;AAEnB,SAAA,CAAA,iBAAAC,IAAA,CAAAC,QAAA,EAAA;;AACI,8BAAAI,GAAA,CAACH,WAAWyB,KAAK,EAAA;oBAACC,EAAAA,EAAIC,SAAAA;AAAWC,oBAAAA,WAAAA,EAAazC,eAAeL,OAAAA,EAAS,aAAA;;AACrEa,gBAAAA,eAAAA,CAAgBb,OAAAA,EAAS,UAAA,EAAY,IAAA,CAAA,kBAClCqB,GAAA,CAACH,WAAW6B,OAAO,EAAA;AACf,oBAAA,QAAA,gBAAA1B,GAAA,CAACE,GAAAA,EAAAA;wBAAEC,SAAAA,EAAU;;;AAGrB,8BAAAH,GAAA,CAACH,WAAW8B,MAAM,EAAA;4CACd3B,GAAA,CAACH,WAAW+B,UAAU,EAAA;wBAACC,KAAAA,EAAM,OAAA;gDACzB7B,GAAA,CAACH,WAAWiC,KAAK,EAAA;AAAEpC,4BAAAA,QAAAA,EAAAA;;;;;;;AAO/C
|
|
1
|
+
{"version":3,"file":"PrimeCalendar.js","sources":["../../../form/PrimeCalendar.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 { DatePicker } from 'primereact/datepicker';\nimport { InputText } from 'primereact/inputtext';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:calendar` component - a date picker, named `DatePicker` by PrimeReact 11.\n *\n * The seed value is parsed from an ISO date string because that is what survives a round trip through a\n * Scene model's JSON properties; an unparseable one leaves the field empty rather than showing\n * \"Invalid Date\".\n *\n * v11's `DatePicker` is a composition, and the grid is the bulk of it: `Calendar` holds a `Header` (the\n * month/year title flanked by the two navigation buttons) and a `Table` whose three `TableBody` views are\n * what makes clicking the title drill from days to months to years. That whole calendar is built once\n * here and then placed one of two ways, which is how `inline` survives a version that has no `inline`\n * prop: either inside a `Panel`, which simply renders where it stands, or behind a `Portal` and a\n * `Positioner`, which anchors it to the field and escapes any clipping ancestor.\n */\nexport function PrimeCalendar({ element }: RegisteredComponentProps) {\n const [value, setValue] = useState<Date | undefined>(() => {\n const seed = stringProperty(element, 'value');\n if (seed === undefined) return undefined;\n const parsed = new Date(seed);\n return Number.isNaN(parsed.getTime()) ? undefined : parsed;\n });\n\n const inline = booleanProperty(element, 'inline', false);\n const showTime = booleanProperty(element, 'showTime', false);\n const calendar = (\n <>\n <DatePicker.Calendar>\n <DatePicker.Header>\n <DatePicker.Prev>\n <i className='pi pi-chevron-left' />\n </DatePicker.Prev>\n <DatePicker.Title>\n <DatePicker.SelectMonth />\n <DatePicker.SelectYear />\n <DatePicker.Decade />\n </DatePicker.Title>\n <DatePicker.Next>\n <i className='pi pi-chevron-right' />\n </DatePicker.Next>\n </DatePicker.Header>\n <DatePicker.Table>\n <DatePicker.TableHead />\n <DatePicker.TableBody />\n <DatePicker.TableBody view='month' />\n <DatePicker.TableBody view='year' />\n </DatePicker.Table>\n </DatePicker.Calendar>\n {showTime && <DatePicker.Time />}\n </>\n );\n\n return (\n <DatePicker.Root\n data-scene-id={element.id}\n value={value}\n onValueChange={(event) => setValue(event.value instanceof Date ? event.value : undefined)}\n dateFormat={stringProperty(element, 'dateFormat')}\n showTime={showTime}\n disabled={booleanProperty(element, 'disabled', false)}>\n {inline ? (\n <DatePicker.Panel>{calendar}</DatePicker.Panel>\n ) : (\n <>\n <DatePicker.Input as={InputText} placeholder={stringProperty(element, 'placeholder')} />\n {booleanProperty(element, 'showIcon', true) && (\n <DatePicker.Trigger>\n <i className='pi pi-calendar' />\n </DatePicker.Trigger>\n )}\n <DatePicker.Portal>\n <DatePicker.Positioner align='start'>\n <DatePicker.Popup>{calendar}</DatePicker.Popup>\n </DatePicker.Positioner>\n </DatePicker.Portal>\n </>\n )}\n </DatePicker.Root>\n );\n}\n"],"names":["PrimeCalendar","element","value","setValue","useState","seed","stringProperty","undefined","parsed","Date","Number","isNaN","getTime","inline","booleanProperty","showTime","calendar","_jsxs","_Fragment","DatePicker","Calendar","Header","_jsx","Prev","i","className","Title","SelectMonth","SelectYear","Decade","Next","Table","TableHead","TableBody","view","Time","Root","data-scene-id","id","onValueChange","event","dateFormat","disabled","Panel","Input","as","InputText","placeholder","Trigger","Portal","Positioner","align","Popup"],"mappings":";;;;;;AASA;;;;;;;;;;;;;AAaC,IACM,SAASA,aAAAA,CAAc,EAAEC,OAAO,EAA4B,EAAA;AAC/D,IAAA,MAAM,CAACC,KAAAA,EAAOC,QAAAA,CAAS,GAAGC,QAAAA,CAA2B,IAAA;QACjD,MAAMC,IAAAA,GAAOC,eAAeL,OAAAA,EAAS,OAAA,CAAA;QACrC,IAAII,IAAAA,KAASE,WAAW,OAAOA,SAAAA;QAC/B,MAAMC,MAAAA,GAAS,IAAIC,IAAAA,CAAKJ,IAAAA,CAAAA;AACxB,QAAA,OAAOK,OAAOC,KAAK,CAACH,MAAAA,CAAOI,OAAO,MAAML,SAAAA,GAAYC,MAAAA;AACxD,IAAA,CAAA,CAAA;IAEA,MAAMK,MAAAA,GAASC,eAAAA,CAAgBb,OAAAA,EAAS,QAAA,EAAU,KAAA,CAAA;IAClD,MAAMc,QAAAA,GAAWD,eAAAA,CAAgBb,OAAAA,EAAS,UAAA,EAAY,KAAA,CAAA;AACtD,IAAA,MAAMe,QAAAA,iBACFC,IAAA,CAAAC,QAAA,EAAA;;AACI,0BAAAD,IAAA,CAACE,WAAWC,QAAQ,EAAA;;AAChB,kCAAAH,IAAA,CAACE,WAAWE,MAAM,EAAA;;AACd,0CAAAC,GAAA,CAACH,WAAWI,IAAI,EAAA;AACZ,gCAAA,QAAA,gBAAAD,GAAA,CAACE,GAAAA,EAAAA;oCAAEC,SAAAA,EAAU;;;AAEjB,0CAAAR,IAAA,CAACE,WAAWO,KAAK,EAAA;;AAC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BAAAI,GAAA,CAACH,WAAWyB,KAAK,EAAA;oBAACC,EAAAA,EAAIC,SAAAA;AAAWC,oBAAAA,WAAAA,EAAazC,eAAeL,OAAAA,EAAS,aAAA;;AACrEa,gBAAAA,eAAAA,CAAgBb,OAAAA,EAAS,UAAA,EAAY,IAAA,CAAA,kBAClCqB,GAAA,CAACH,WAAW6B,OAAO,EAAA;AACf,oBAAA,QAAA,gBAAA1B,GAAA,CAACE,GAAAA,EAAAA;wBAAEC,SAAAA,EAAU;;;AAGrB,8BAAAH,GAAA,CAACH,WAAW8B,MAAM,EAAA;4CACd3B,GAAA,CAACH,WAAW+B,UAAU,EAAA;wBAACC,KAAAA,EAAM,OAAA;gDACzB7B,GAAA,CAACH,WAAWiC,KAAK,EAAA;AAAEpC,4BAAAA,QAAAA,EAAAA;;;;;;;AAO/C;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeCheckbox.js","sources":["../../../form/PrimeCheckbox.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 { Checkbox } from 'primereact/checkbox';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:checkbox` component.\n *\n * Rendered with its label rather than bare: an unlabeled checkbox has no accessible name and nothing to\n * click but a 20-pixel box, which is a defect in every screen that would ever use one.\n *\n * PrimeReact 11 makes the tick its own part: `Root` renders the real (visually hidden) input and owns the\n * state, `Box` is the square, and `Indicator` is what appears inside it when checked. The `checked` state\n * now arrives as `onCheckedChange` with a boolean rather than a change event whose `checked` might be\n * `undefined`, so the defensive `=== true` the v10 adapter needed is gone.\n */\nexport function PrimeCheckbox({ element }: RegisteredComponentProps) {\n const [checked, setChecked] = useState(booleanProperty(element, 'checked', false));\n const label = stringProperty(element, 'label');\n return (\n <div data-scene-id={element.id} className='flex items-center gap-2'>\n <Checkbox.Root\n inputId={element.id}\n checked={checked}\n onCheckedChange={(event) => setChecked(event.checked)}\n disabled={booleanProperty(element, 'disabled', false)}>\n <Checkbox.Box>\n <Checkbox.Indicator />\n </Checkbox.Box>\n </Checkbox.Root>\n {label !== undefined && <label htmlFor={element.id}>{label}</label>}\n </div>\n );\n}\n"],"names":["PrimeCheckbox","element","checked","setChecked","useState","booleanProperty","label","stringProperty","_jsxs","div","data-scene-id","id","className","_jsx","Checkbox","Root","inputId","onCheckedChange","event","disabled","Box","Indicator","undefined","htmlFor"],"mappings":";;;;;AAQA;;;;;;;;;;AAUC,IACM,SAASA,aAAAA,CAAc,EAAEC,OAAO,EAA4B,EAAA;AAC/D,IAAA,MAAM,CAACC,OAAAA,EAASC,UAAAA,CAAW,GAAGC,QAAAA,CAASC,eAAAA,CAAgBJ,SAAS,SAAA,EAAW,KAAA,CAAA,CAAA;IAC3E,MAAMK,KAAAA,GAAQC,eAAeN,OAAAA,EAAS,OAAA,CAAA;AACtC,IAAA,qBACIO,IAAA,CAACC,KAAAA,EAAAA;AAAIC,QAAAA,eAAAA,EAAeT,QAAQU,EAAE;QAAEC,SAAAA,EAAU,yBAAA;;AACtC,0BAAAC,GAAA,CAACC,SAASC,IAAI,EAAA;AACVC,gBAAAA,OAAAA,EAASf,QAAQU,EAAE;gBACnBT,OAAAA,EAASA,OAAAA;AACTe,gBAAAA,eAAAA,EAAiB,CAACC,KAAAA,GAAUf,UAAAA,CAAWe,KAAAA,CAAMhB,OAAO,CAAA;gBACpDiB,QAAAA,EAAUd,eAAAA,CAAgBJ,SAAS,UAAA,EAAY,KAAA,CAAA;wCAC/CY,GAAA,CAACC,SAASM,GAAG,EAAA;4CACTP,GAAA,CAACC,SAASO,SAAS,EAAA,EAAA;;;AAG1Bf,YAAAA,KAAAA,KAAUgB,2BAAaT,GAAA,CAACP,OAAAA,EAAAA;AAAMiB,gBAAAA,OAAAA,EAAStB,QAAQU,EAAE;AAAGL,gBAAAA,QAAAA,EAAAA;;;;AAGjE
|
|
1
|
+
{"version":3,"file":"PrimeCheckbox.js","sources":["../../../form/PrimeCheckbox.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 { Checkbox } from 'primereact/checkbox';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:checkbox` component.\n *\n * Rendered with its label rather than bare: an unlabeled checkbox has no accessible name and nothing to\n * click but a 20-pixel box, which is a defect in every screen that would ever use one.\n *\n * PrimeReact 11 makes the tick its own part: `Root` renders the real (visually hidden) input and owns the\n * state, `Box` is the square, and `Indicator` is what appears inside it when checked. The `checked` state\n * now arrives as `onCheckedChange` with a boolean rather than a change event whose `checked` might be\n * `undefined`, so the defensive `=== true` the v10 adapter needed is gone.\n */\nexport function PrimeCheckbox({ element }: RegisteredComponentProps) {\n const [checked, setChecked] = useState(booleanProperty(element, 'checked', false));\n const label = stringProperty(element, 'label');\n return (\n <div data-scene-id={element.id} className='flex items-center gap-2'>\n <Checkbox.Root\n inputId={element.id}\n checked={checked}\n onCheckedChange={(event) => setChecked(event.checked)}\n disabled={booleanProperty(element, 'disabled', false)}>\n <Checkbox.Box>\n <Checkbox.Indicator />\n </Checkbox.Box>\n </Checkbox.Root>\n {label !== undefined && <label htmlFor={element.id}>{label}</label>}\n </div>\n );\n}\n"],"names":["PrimeCheckbox","element","checked","setChecked","useState","booleanProperty","label","stringProperty","_jsxs","div","data-scene-id","id","className","_jsx","Checkbox","Root","inputId","onCheckedChange","event","disabled","Box","Indicator","undefined","htmlFor"],"mappings":";;;;;AAQA;;;;;;;;;;AAUC,IACM,SAASA,aAAAA,CAAc,EAAEC,OAAO,EAA4B,EAAA;AAC/D,IAAA,MAAM,CAACC,OAAAA,EAASC,UAAAA,CAAW,GAAGC,QAAAA,CAASC,eAAAA,CAAgBJ,SAAS,SAAA,EAAW,KAAA,CAAA,CAAA;IAC3E,MAAMK,KAAAA,GAAQC,eAAeN,OAAAA,EAAS,OAAA,CAAA;AACtC,IAAA,qBACIO,IAAA,CAACC,KAAAA,EAAAA;AAAIC,QAAAA,eAAAA,EAAeT,QAAQU,EAAE;QAAEC,SAAAA,EAAU,yBAAA;;AACtC,0BAAAC,GAAA,CAACC,SAASC,IAAI,EAAA;AACVC,gBAAAA,OAAAA,EAASf,QAAQU,EAAE;gBACnBT,OAAAA,EAASA,OAAAA;AACTe,gBAAAA,eAAAA,EAAiB,CAACC,KAAAA,GAAUf,UAAAA,CAAWe,KAAAA,CAAMhB,OAAO,CAAA;gBACpDiB,QAAAA,EAAUd,eAAAA,CAAgBJ,SAAS,UAAA,EAAY,KAAA,CAAA;wCAC/CY,GAAA,CAACC,SAASM,GAAG,EAAA;4CACTP,GAAA,CAACC,SAASO,SAAS,EAAA,EAAA;;;AAG1Bf,YAAAA,KAAAA,KAAUgB,2BAAaT,GAAA,CAACP,OAAAA,EAAAA;AAAMiB,gBAAAA,OAAAA,EAAStB,QAAQU,EAAE;AAAGL,gBAAAA,QAAAA,EAAAA;;;;AAGjE;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeChips.js","sources":["../../../form/PrimeChips.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 { InputTags } from 'primereact/inputtags';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, numberProperty, stringArrayProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:chips` component - free-form entry of a list of short values, each shown as a chip.\n * PrimeReact 11 calls it `InputTags`.\n *\n * The chips and the text field are both render-prop slots in v11 rather than markup the component\n * chooses, which is why this file draws a chip and its remove button by hand: `Items` hands over one tag\n * at a time along with the props that make it removable, and `Control` hands over the props for the\n * input. It is more code than the v10 one-liner and it is the reason the chip is stylable at all.\n *\n * A tag is committed per Enter, and pasted text arrives as one tag rather than being split. That is v11's\n * default and the adapter keeps it: v10's `separator` property is not read, because splitting on a\n * character is a data-entry policy that belongs to the screen collecting the data, not to a preview of it.\n */\nexport function PrimeChips({ element }: RegisteredComponentProps) {\n const [value, setValue] = useState<string[]>(stringArrayProperty(element, 'value'));\n return (\n <InputTags.Root\n data-scene-id={element.id}\n value={value}\n onValueChange={(event) => setValue(event.value ?? [])}\n max={numberProperty(element, 'max')}\n disabled={booleanProperty(element, 'disabled', false)}>\n <InputTags.Items>\n {({ item, index, remove, itemProps }) => (\n <span {...itemProps} key={`${item}-${index}`}>\n <span>{item}</span>\n <button type='button' aria-label={`Remove ${item}`} onClick={remove}>\n <i className='pi pi-times-circle' />\n </button>\n </span>\n )}\n </InputTags.Items>\n <InputTags.Control>\n {({ controlProps }) => <input {...controlProps} placeholder={stringProperty(element, 'placeholder')} />}\n </InputTags.Control>\n </InputTags.Root>\n );\n}\n"],"names":["PrimeChips","element","value","setValue","useState","stringArrayProperty","_jsxs","InputTags","Root","data-scene-id","id","onValueChange","event","max","numberProperty","disabled","booleanProperty","_jsx","Items","item","index","remove","itemProps","_createElement","span","key","button","type","aria-label","onClick","i","className","Control","controlProps","input","placeholder","stringProperty"],"mappings":";;;;;AAQA;;;;;;;;;;;;AAYC,IACM,SAASA,UAAAA,CAAW,EAAEC,OAAO,EAA4B,EAAA;AAC5D,IAAA,MAAM,CAACC,KAAAA,EAAOC,QAAAA,CAAS,GAAGC,QAAAA,CAAmBC,oBAAoBJ,OAAAA,EAAS,OAAA,CAAA,CAAA;IAC1E,qBACIK,IAAA,CAACC,UAAUC,IAAI,EAAA;AACXC,QAAAA,eAAAA,EAAeR,QAAQS,EAAE;QACzBR,KAAAA,EAAOA,KAAAA;AACPS,QAAAA,aAAAA,EAAe,CAACC,KAAAA,GAAUT,QAAAA,CAASS,KAAAA,CAAMV,KAAK,IAAI,EAAE,CAAA;AACpDW,QAAAA,GAAAA,EAAKC,eAAeb,OAAAA,EAAS,KAAA,CAAA;QAC7Bc,QAAAA,EAAUC,eAAAA,CAAgBf,SAAS,UAAA,EAAY,KAAA,CAAA;;AAC/C,0BAAAgB,GAAA,CAACV,UAAUW,KAAK,EAAA;0BACX,CAAC,EAAEC,IAAI,EAAEC,KAAK,EAAEC,MAAM,EAAEC,SAAS,EAAE,iBAChCC,aAAA,CAACC,MAAAA,EAAAA;AAAM,wBAAA,GAAGF,SAAS;AAAEG,wBAAAA,GAAAA,EAAK,CAAA,EAAGN,IAAAA,CAAK,CAAC,EAAEC,KAAAA,CAAAA,CAAO;;0CACxCH,GAAA,CAACO,MAAAA,EAAAA;AAAML,gCAAAA,QAAAA,EAAAA;;0CACPF,GAAA,CAACS,QAAAA,EAAAA;gCAAOC,IAAAA,EAAK,QAAA;gCAASC,YAAAA,EAAY,CAAC,OAAO,EAAET,IAAAA,CAAAA,CAAM;gCAAEU,OAAAA,EAASR,MAAAA;AACzD,gCAAA,QAAA,gBAAAJ,GAAA,CAACa,GAAAA,EAAAA;oCAAEC,SAAAA,EAAU;;;;;;AAK7B,0BAAAd,GAAA,CAACV,UAAUyB,OAAO,EAAA;AACb,gBAAA,QAAA,EAAA,CAAC,EAAEC,YAAY,EAAE,iBAAKhB,GAAA,CAACiB,OAAAA,EAAAA;AAAO,wBAAA,GAAGD,YAAY;AAAEE,wBAAAA,WAAAA,EAAaC,eAAenC,OAAAA,EAAS,aAAA;;;;;AAIrG
|
|
1
|
+
{"version":3,"file":"PrimeChips.js","sources":["../../../form/PrimeChips.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 { InputTags } from 'primereact/inputtags';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, numberProperty, stringArrayProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:chips` component - free-form entry of a list of short values, each shown as a chip.\n * PrimeReact 11 calls it `InputTags`.\n *\n * The chips and the text field are both render-prop slots in v11 rather than markup the component\n * chooses, which is why this file draws a chip and its remove button by hand: `Items` hands over one tag\n * at a time along with the props that make it removable, and `Control` hands over the props for the\n * input. It is more code than the v10 one-liner and it is the reason the chip is stylable at all.\n *\n * A tag is committed per Enter, and pasted text arrives as one tag rather than being split. That is v11's\n * default and the adapter keeps it: v10's `separator` property is not read, because splitting on a\n * character is a data-entry policy that belongs to the screen collecting the data, not to a preview of it.\n */\nexport function PrimeChips({ element }: RegisteredComponentProps) {\n const [value, setValue] = useState<string[]>(stringArrayProperty(element, 'value'));\n return (\n <InputTags.Root\n data-scene-id={element.id}\n value={value}\n onValueChange={(event) => setValue(event.value ?? [])}\n max={numberProperty(element, 'max')}\n disabled={booleanProperty(element, 'disabled', false)}>\n <InputTags.Items>\n {({ item, index, remove, itemProps }) => (\n <span {...itemProps} key={`${item}-${index}`}>\n <span>{item}</span>\n <button type='button' aria-label={`Remove ${item}`} onClick={remove}>\n <i className='pi pi-times-circle' />\n </button>\n </span>\n )}\n </InputTags.Items>\n <InputTags.Control>\n {({ controlProps }) => <input {...controlProps} placeholder={stringProperty(element, 'placeholder')} />}\n </InputTags.Control>\n </InputTags.Root>\n );\n}\n"],"names":["PrimeChips","element","value","setValue","useState","stringArrayProperty","_jsxs","InputTags","Root","data-scene-id","id","onValueChange","event","max","numberProperty","disabled","booleanProperty","_jsx","Items","item","index","remove","itemProps","_createElement","span","key","button","type","aria-label","onClick","i","className","Control","controlProps","input","placeholder","stringProperty"],"mappings":";;;;;AAQA;;;;;;;;;;;;AAYC,IACM,SAASA,UAAAA,CAAW,EAAEC,OAAO,EAA4B,EAAA;AAC5D,IAAA,MAAM,CAACC,KAAAA,EAAOC,QAAAA,CAAS,GAAGC,QAAAA,CAAmBC,oBAAoBJ,OAAAA,EAAS,OAAA,CAAA,CAAA;IAC1E,qBACIK,IAAA,CAACC,UAAUC,IAAI,EAAA;AACXC,QAAAA,eAAAA,EAAeR,QAAQS,EAAE;QACzBR,KAAAA,EAAOA,KAAAA;AACPS,QAAAA,aAAAA,EAAe,CAACC,KAAAA,GAAUT,QAAAA,CAASS,KAAAA,CAAMV,KAAK,IAAI,EAAE,CAAA;AACpDW,QAAAA,GAAAA,EAAKC,eAAeb,OAAAA,EAAS,KAAA,CAAA;QAC7Bc,QAAAA,EAAUC,eAAAA,CAAgBf,SAAS,UAAA,EAAY,KAAA,CAAA;;AAC/C,0BAAAgB,GAAA,CAACV,UAAUW,KAAK,EAAA;0BACX,CAAC,EAAEC,IAAI,EAAEC,KAAK,EAAEC,MAAM,EAAEC,SAAS,EAAE,iBAChCC,aAAA,CAACC,MAAAA,EAAAA;AAAM,wBAAA,GAAGF,SAAS;AAAEG,wBAAAA,GAAAA,EAAK,CAAA,EAAGN,IAAAA,CAAK,CAAC,EAAEC,KAAAA,CAAAA,CAAO;;0CACxCH,GAAA,CAACO,MAAAA,EAAAA;AAAML,gCAAAA,QAAAA,EAAAA;;0CACPF,GAAA,CAACS,QAAAA,EAAAA;gCAAOC,IAAAA,EAAK,QAAA;gCAASC,YAAAA,EAAY,CAAC,OAAO,EAAET,IAAAA,CAAAA,CAAM;gCAAEU,OAAAA,EAASR,MAAAA;AACzD,gCAAA,QAAA,gBAAAJ,GAAA,CAACa,GAAAA,EAAAA;oCAAEC,SAAAA,EAAU;;;;;;AAK7B,0BAAAd,GAAA,CAACV,UAAUyB,OAAO,EAAA;AACb,gBAAA,QAAA,EAAA,CAAC,EAAEC,YAAY,EAAE,iBAAKhB,GAAA,CAACiB,OAAAA,EAAAA;AAAO,wBAAA,GAAGD,YAAY;AAAEE,wBAAAA,WAAAA,EAAaC,eAAenC,OAAAA,EAAS,aAAA;;;;;AAIrG;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeColorPicker.js","sources":["../../../form/PrimeColorPicker.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 { InputColor, parseColor } from 'primereact/inputcolor';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, stringProperty } from '../properties';\n\n/**\n * The color an unauthored - or unparseable - picker falls back to, so an element with no `value` and an\n * element with a broken one look alike rather than one of them looking broken.\n */\nconst fallbackColor = '6366f1';\n\n/**\n * Parses a hex string with no leading `#` into the color object PrimeReact 11 works in.\n *\n * A Scene element's properties are authored, not validated: `value: 'red'` or a half-typed hex is an\n * ordinary state on a screen under construction, and `parseColor` throws on both. Swallowing that here\n * renders a picker the author can immediately correct instead of taking the surrounding screen down -\n * and it lives in a function rather than inline because a `try` inside JSX would force the whole\n * composition into a statement body for one expression's sake.\n *\n * @param hex The authored hex digits, without a leading `#`.\n * @returns The parsed color, or {@link fallbackColor} when the string is not a color.\n */\nfunction toColor(hex: string) {\n try {\n return parseColor(`#${hex}`);\n } catch {\n return parseColor(`#${fallbackColor}`);\n }\n}\n\n/**\n * The `PrimeReact:colorPicker` component, named `InputColor` by PrimeReact 11.\n *\n * The value is kept as a hex string without the leading `#`, which is what a Scene model round-trips\n * cleanly and what the v10 component expected; a screen writing `#6366f1` therefore still works. v11\n * models its value as a parsed color object rather than a string, so this adapter is the translation\n * layer - {@link toColor} on the way in, `toString('hex')` on the way out - and the authored property\n * keeps the shape it always had.\n *\n * v10's `inline` property is not read. It chose between a swatch that opened a panel and the panel shown\n * in place; v11's `InputColor` is only ever the panel - saturation area, hue slider and swatch, with no\n * overlay mode to switch to - so there is no longer a choice to express.\n */\nexport function PrimeColorPicker({ element }: RegisteredComponentProps) {\n const [value, setValue] = useState(stringProperty(element, 'value', fallbackColor).replace('#', ''));\n return (\n <div data-scene-id={element.id}>\n <InputColor.Root\n value={toColor(value)}\n onValueChange={(event) => setValue(event.value.toString('hex').replace('#', ''))}\n disabled={booleanProperty(element, 'disabled', false)}>\n <InputColor.Area>\n <InputColor.AreaBackground />\n <InputColor.AreaHandle />\n </InputColor.Area>\n <InputColor.Slider>\n <InputColor.SliderTrack />\n <InputColor.SliderHandle />\n </InputColor.Slider>\n <InputColor.Swatch>\n <InputColor.SwatchBackground />\n </InputColor.Swatch>\n </InputColor.Root>\n </div>\n );\n}\n"],"names":["fallbackColor","toColor","hex","parseColor","PrimeColorPicker","element","value","setValue","useState","stringProperty","replace","_jsx","div","data-scene-id","id","_jsxs","InputColor","Root","onValueChange","event","toString","disabled","booleanProperty","Area","AreaBackground","AreaHandle","Slider","SliderTrack","SliderHandle","Swatch","SwatchBackground"],"mappings":";;;;;AAQA;;;AAGC,IACD,MAAMA,aAAAA,GAAgB,QAAA;AAEtB;;;;;;;;;;;IAYA,SAASC,QAAQC,GAAW,EAAA;IACxB,IAAI;AACA,QAAA,OAAOC,UAAAA,CAAW,CAAC,CAAC,EAAED,GAAAA,CAAAA,CAAK,CAAA;AAC/B,IAAA,CAAA,CAAE,OAAM;AACJ,QAAA,OAAOC,UAAAA,CAAW,CAAC,CAAC,EAAEH,aAAAA,CAAAA,CAAe,CAAA;AACzC,IAAA;AACJ;AAEA;;;;;;;;;;;;AAYC,IACM,SAASI,gBAAAA,CAAiB,EAAEC,OAAO,EAA4B,EAAA;IAClE,MAAM,CAACC,KAAAA,EAAOC,QAAAA,CAAS,GAAGC,QAAAA,CAASC,cAAAA,CAAeJ,OAAAA,EAAS,OAAA,EAASL,aAAAA,CAAAA,CAAeU,OAAO,CAAC,GAAA,EAAK,EAAA,CAAA,CAAA;AAChG,IAAA,qBACIC,GAAA,CAACC,KAAAA,EAAAA;AAAIC,QAAAA,eAAAA,EAAeR,QAAQS,EAAE;gCAC1BC,IAAA,CAACC,WAAWC,IAAI,EAAA;AACZX,YAAAA,KAAAA,EAAOL,OAAAA,CAAQK,KAAAA,CAAAA;YACfY,aAAAA,EAAe,CAACC,KAAAA,GAAUZ,QAAAA,CAASY,KAAAA,CAAMb,KAAK,CAACc,QAAQ,CAAC,KAAA,CAAA,CAAOV,OAAO,CAAC,GAAA,EAAK,EAAA,CAAA,CAAA;YAC5EW,QAAAA,EAAUC,eAAAA,CAAgBjB,SAAS,UAAA,EAAY,KAAA,CAAA;;AAC/C,8BAAAU,IAAA,CAACC,WAAWO,IAAI,EAAA;;AACZ,sCAAAZ,GAAA,CAACK,WAAWQ,cAAc,EAAA,EAAA,CAAA;AAC1B,sCAAAb,GAAA,CAACK,WAAWS,UAAU,EAAA,EAAA;;;AAE1B,8BAAAV,IAAA,CAACC,WAAWU,MAAM,EAAA;;AACd,sCAAAf,GAAA,CAACK,WAAWW,WAAW,EAAA,EAAA,CAAA;AACvB,sCAAAhB,GAAA,CAACK,WAAWY,YAAY,EAAA,EAAA;;;AAE5B,8BAAAjB,GAAA,CAACK,WAAWa,MAAM,EAAA;4CACdlB,GAAA,CAACK,WAAWc,gBAAgB,EAAA,EAAA;;;;;AAKhD
|
|
1
|
+
{"version":3,"file":"PrimeColorPicker.js","sources":["../../../form/PrimeColorPicker.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 { InputColor, parseColor } from 'primereact/inputcolor';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, stringProperty } from '../properties';\n\n/**\n * The color an unauthored - or unparseable - picker falls back to, so an element with no `value` and an\n * element with a broken one look alike rather than one of them looking broken.\n */\nconst fallbackColor = '6366f1';\n\n/**\n * Parses a hex string with no leading `#` into the color object PrimeReact 11 works in.\n *\n * A Scene element's properties are authored, not validated: `value: 'red'` or a half-typed hex is an\n * ordinary state on a screen under construction, and `parseColor` throws on both. Swallowing that here\n * renders a picker the author can immediately correct instead of taking the surrounding screen down -\n * and it lives in a function rather than inline because a `try` inside JSX would force the whole\n * composition into a statement body for one expression's sake.\n *\n * @param hex The authored hex digits, without a leading `#`.\n * @returns The parsed color, or {@link fallbackColor} when the string is not a color.\n */\nfunction toColor(hex: string) {\n try {\n return parseColor(`#${hex}`);\n } catch {\n return parseColor(`#${fallbackColor}`);\n }\n}\n\n/**\n * The `PrimeReact:colorPicker` component, named `InputColor` by PrimeReact 11.\n *\n * The value is kept as a hex string without the leading `#`, which is what a Scene model round-trips\n * cleanly and what the v10 component expected; a screen writing `#6366f1` therefore still works. v11\n * models its value as a parsed color object rather than a string, so this adapter is the translation\n * layer - {@link toColor} on the way in, `toString('hex')` on the way out - and the authored property\n * keeps the shape it always had.\n *\n * v10's `inline` property is not read. It chose between a swatch that opened a panel and the panel shown\n * in place; v11's `InputColor` is only ever the panel - saturation area, hue slider and swatch, with no\n * overlay mode to switch to - so there is no longer a choice to express.\n */\nexport function PrimeColorPicker({ element }: RegisteredComponentProps) {\n const [value, setValue] = useState(stringProperty(element, 'value', fallbackColor).replace('#', ''));\n return (\n <div data-scene-id={element.id}>\n <InputColor.Root\n value={toColor(value)}\n onValueChange={(event) => setValue(event.value.toString('hex').replace('#', ''))}\n disabled={booleanProperty(element, 'disabled', false)}>\n <InputColor.Area>\n <InputColor.AreaBackground />\n <InputColor.AreaHandle />\n </InputColor.Area>\n <InputColor.Slider>\n <InputColor.SliderTrack />\n <InputColor.SliderHandle />\n </InputColor.Slider>\n <InputColor.Swatch>\n <InputColor.SwatchBackground />\n </InputColor.Swatch>\n </InputColor.Root>\n </div>\n );\n}\n"],"names":["fallbackColor","toColor","hex","parseColor","PrimeColorPicker","element","value","setValue","useState","stringProperty","replace","_jsx","div","data-scene-id","id","_jsxs","InputColor","Root","onValueChange","event","toString","disabled","booleanProperty","Area","AreaBackground","AreaHandle","Slider","SliderTrack","SliderHandle","Swatch","SwatchBackground"],"mappings":";;;;;AAQA;;;AAGC,IACD,MAAMA,aAAAA,GAAgB,QAAA;AAEtB;;;;;;;;;;;IAYA,SAASC,QAAQC,GAAW,EAAA;IACxB,IAAI;AACA,QAAA,OAAOC,UAAAA,CAAW,CAAC,CAAC,EAAED,GAAAA,CAAAA,CAAK,CAAA;AAC/B,IAAA,CAAA,CAAE,OAAM;AACJ,QAAA,OAAOC,UAAAA,CAAW,CAAC,CAAC,EAAEH,aA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Content":["// 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 { Select } from 'primereact/select';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, optionsProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:dropdown` component - a single-choice select.\n *\n * Options are normalized by `optionsProperty`, so a screen may write either bare strings or\n * `{ label, value }` records and get the same result.\n *\n * PrimeReact calls this `Select`, and it is a composition rather than one component: `Root` owns the\n * value and the option model, `Trigger` is what the user clicks, and the list lives behind a `Portal` so\n * it escapes any clipping ancestor. `Select.List` renders `options` itself - there is no option mapping\n * here, and adding one would only duplicate what `optionLabel` / `optionValue` already say. The `appendTo`\n * and z-index juggling a dropdown inside a dialog used to need is gone with it: the portal stacks\n * correctly on its own.\n */\nexport function PrimeDropdown({ element }: RegisteredComponentProps) {\n const [value, setValue] = useState<unknown>(stringProperty(element, 'value'));\n const placeholder = stringProperty(element, 'placeholder', 'Select');\n const filter = booleanProperty(element, 'filter', false);\n const showClear = booleanProperty(element, 'showClear', false);\n return (\n <Select.Root\n data-scene-id={element.id}\n value={value}\n onValueChange={(event) => setValue(event.value)}\n options={optionsProperty(element, 'options')}\n optionLabel='label'\n optionValue='value'\n filter={filter}\n disabled={booleanProperty(element, 'disabled', false)}>\n <Select.Trigger>\n <Select.Value placeholder={placeholder} />\n {showClear && <Select.Clear />}\n <Select.Arrow />\n </Select.Trigger>\n <Select.Portal>\n <Select.Positioner>\n <Select.Popup>\n {filter && <Select.Filter placeholder={placeholder} />}\n <Select.List />\n </Select.Popup>\n </Select.Positioner>\n </Select.Portal>\n </Select.Root>\n );\n}\n"],"names":["PrimeDropdown","element","value","setValue","useState","stringProperty","placeholder","filter","booleanProperty","showClear","_jsxs","Select","Root","data-scene-id","id","onValueChange","event","options","optionsProperty","optionLabel","optionValue","disabled","Trigger","_jsx","Value","Clear","Arrow","Portal","Positioner","Popup","Filter","List"],"mappings":";;;;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ACRtB,MAAAA,kBAAUgB,GAAA,CAACZ,OAAOmB,MAAM,EAAA;gCAACxB,WAAAA,EAAaA;;AACvC,0CAAAiB,GAAA,CAACZ,OAAOoB,IAAI,EAAA,EAAA;;;;;;;AAMpC
|
|
1
|
+
{"version":3,"file":"PrimeDropdown.js","sources":["../../../form/PrimeDropdown.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 { Select } from 'primereact/select';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, optionsProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:dropdown` component - a single-choice select.\n *\n * Options are normalized by `optionsProperty`, so a screen may write either bare strings or\n * `{ label, value }` records and get the same result.\n *\n * PrimeReact calls this `Select`, and it is a composition rather than one component: `Root` owns the\n * value and the option model, `Trigger` is what the user clicks, and the list lives behind a `Portal` so\n * it escapes any clipping ancestor. `Select.List` renders `options` itself - there is no option mapping\n * here, and adding one would only duplicate what `optionLabel` / `optionValue` already say. The `appendTo`\n * and z-index juggling a dropdown inside a dialog used to need is gone with it: the portal stacks\n * correctly on its own.\n */\nexport function PrimeDropdown({ element }: RegisteredComponentProps) {\n const [value, setValue] = useState<unknown>(stringProperty(element, 'value'));\n const placeholder = stringProperty(element, 'placeholder', 'Select');\n const filter = booleanProperty(element, 'filter', false);\n const showClear = booleanProperty(element, 'showClear', false);\n return (\n <Select.Root\n data-scene-id={element.id}\n value={value}\n onValueChange={(event) => setValue(event.value)}\n options={optionsProperty(element, 'options')}\n optionLabel='label'\n optionValue='value'\n filter={filter}\n disabled={booleanProperty(element, 'disabled', false)}>\n <Select.Trigger>\n <Select.Value placeholder={placeholder} />\n {showClear && <Select.Clear />}\n <Select.Arrow />\n </Select.Trigger>\n <Select.Portal>\n <Select.Positioner>\n <Select.Popup>\n {filter && <Select.Filter placeholder={placeholder} />}\n <Select.List />\n </Select.Popup>\n </Select.Positioner>\n </Select.Portal>\n </Select.Root>\n );\n}\n"],"names":["PrimeDropdown","element","value","setValue","useState","stringProperty","placeholder","filter","booleanProperty","showClear","_jsxs","Select","Root","data-scene-id","id","onValueChange","event","options","optionsProperty","optionLabel","optionValue","disabled","Trigger","_jsx","Value","Clear","Arrow","Portal","Positioner","Popup","Filter","List"],"mappings":";;;;;AAQA;;;;;;;;;;;;AAYC,IACM,SAASA,aAAAA,CAAc,EAAEC,OAAO,EAA4B,EAAA;AAC/D,IAAA,MAAM,CAACC,KAAAA,EAAOC,QAAAA,CAAS,GAAGC,QAAAA,CAAkBC,eAAeJ,OAAAA,EAAS,OAAA,CAAA,CAAA;IACpE,MAAMK,WAAAA,GAAcD,cAAAA,CAAeJ,OAAAA,EAAS,aAAA,EAAe,QAAA,CAAA;IAC3D,MAAMM,MAAAA,GAASC,eAAAA,CAAgBP,OAAAA,EAAS,QAAA,EAAU,KAAA,CAAA;IAClD,MAAMQ,SAAAA,GAAYD,eAAAA,CAAgBP,OAAAA,EAAS,WAAA,EAAa,KAAA,CAAA;IACxD,qBACIS,IAAA,CAACC,OAAOC,IAAI,EAAA;AACRC,QAAAA,eAAAA,EAAeZ,QAAQa,EAAE;QACzBZ,KAAAA,EAAOA,KAAAA;AACPa,QAAAA,aAAAA,EAAe,CAACC,KAAAA,GAAUb,QAAAA,CAASa,KAAAA,CAAMd,KAAK,CAAA;AAC9Ce,QAAAA,OAAAA,EAASC,gBAAgBjB,OAAAA,EAAS,SAAA,CAAA;QAClCkB,WAAAA,EAAY,OAAA;QACZC,WAAAA,EAAY,OAAA;QACZb,MAAAA,EAAQA,MAAAA;QACRc,QAAAA,EAAUb,eAAAA,CAAgBP,SAAS,UAAA,EAAY,KAAA,CAAA;;AAC/C,0BAAAS,IAAA,CAACC,OAAOW,OAAO,EAAA;;AACX,kCAAAC,GAAA,CAACZ,OAAOa,KAAK,EAAA;wBAAClB,WAAAA,EAAaA;;oBAC1BG,SAAAA,kBAAac,GAAA,CAACZ,OAAOc,KAAK,EAAA,EAAA,CAAA;AAC3B,kCAAAF,GAAA,CAACZ,OAAOe,KAAK,EAAA,EAAA;;;AAEjB,0BAAAH,GAAA,CAACZ,OAAOgB,MAAM,EAAA;wCACVJ,GAAA,CAACZ,OAAOiB,UAAU,EAAA;4CACdlB,IAAA,CAACC,OAAOkB,KAAK,EAAA;;4BACRtB,MAAAA,kBAAUgB,GAAA,CAACZ,OAAOmB,MAAM,EAAA;gCAACxB,WAAAA,EAAaA;;AACvC,0CAAAiB,GAAA,CAACZ,OAAOoB,IAAI,EAAA,EAAA;;;;;;;AAMpC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeFloatLabel.js","sources":["../../../form/PrimeFloatLabel.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 { FloatLabel } from 'primereact/floatlabel';\nimport { InputText } from 'primereact/inputtext';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:floatLabel` component - a label that starts inside its field and floats above it once\n * the field has focus or a value.\n *\n * FloatLabel is a wrapper, not a field, so the field it decorates comes from the `content` slot. An\n * empty slot falls back to a plain text input rather than rendering a label attached to nothing, which\n * would look like a styling bug rather than a missing child.\n */\nexport function PrimeFloatLabel({ element, slots }: RegisteredComponentProps) {\n const label = stringProperty(element, 'label', 'Label');\n return (\n <FloatLabel data-scene-id={element.id}>\n {slots.content?.length ? slots.content : <InputText id={element.id} />}\n <label htmlFor={element.id}>{label}</label>\n </FloatLabel>\n );\n}\n"],"names":["PrimeFloatLabel","element","slots","label","stringProperty","_jsxs","FloatLabel","data-scene-id","id","content","length","_jsx","InputText","htmlFor"],"mappings":";;;;;AAQA;;;;;;;AAOC,IACM,SAASA,eAAAA,CAAgB,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;IACxE,MAAMC,KAAAA,GAAQC,cAAAA,CAAeH,OAAAA,EAAS,OAAA,EAAS,OAAA,CAAA;AAC/C,IAAA,qBACII,IAAA,CAACC,UAAAA,EAAAA;AAAWC,QAAAA,eAAAA,EAAeN,QAAQO,EAAE;;AAChCN,YAAAA,KAAAA,CAAMO,OAAO,EAAEC,MAAAA,GAASR,KAAAA,CAAMO,OAAO,iBAAGE,GAAA,CAACC,SAAAA,EAAAA;AAAUJ,gBAAAA,EAAAA,EAAIP,QAAQO;;0BAChEG,GAAA,CAACR,OAAAA,EAAAA;AAAMU,gBAAAA,OAAAA,EAASZ,QAAQO,EAAE;AAAGL,gBAAAA,QAAAA,EAAAA;;;;AAGzC
|
|
1
|
+
{"version":3,"file":"PrimeFloatLabel.js","sources":["../../../form/PrimeFloatLabel.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 { FloatLabel } from 'primereact/floatlabel';\nimport { InputText } from 'primereact/inputtext';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:floatLabel` component - a label that starts inside its field and floats above it once\n * the field has focus or a value.\n *\n * FloatLabel is a wrapper, not a field, so the field it decorates comes from the `content` slot. An\n * empty slot falls back to a plain text input rather than rendering a label attached to nothing, which\n * would look like a styling bug rather than a missing child.\n */\nexport function PrimeFloatLabel({ element, slots }: RegisteredComponentProps) {\n const label = stringProperty(element, 'label', 'Label');\n return (\n <FloatLabel data-scene-id={element.id}>\n {slots.content?.length ? slots.content : <InputText id={element.id} />}\n <label htmlFor={element.id}>{label}</label>\n </FloatLabel>\n );\n}\n"],"names":["PrimeFloatLabel","element","slots","label","stringProperty","_jsxs","FloatLabel","data-scene-id","id","content","length","_jsx","InputText","htmlFor"],"mappings":";;;;;AAQA;;;;;;;AAOC,IACM,SAASA,eAAAA,CAAgB,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;IACxE,MAAMC,KAAAA,GAAQC,cAAAA,CAAeH,OAAAA,EAAS,OAAA,EAAS,OAAA,CAAA;AAC/C,IAAA,qBACII,IAAA,CAACC,UAAAA,EAAAA;AAAWC,QAAAA,eAAAA,EAAeN,QAAQO,EAAE;;AAChCN,YAAAA,KAAAA,CAAMO,OAAO,EAAEC,MAAAA,GAASR,KAAAA,CAAMO,OAAO,iBAAGE,GAAA,CAACC,SAAAA,EAAAA;AAAUJ,gBAAAA,EAAAA,EAAIP,QAAQO;;0BAChEG,GAAA,CAACR,OAAAA,EAAAA;AAAMU,gBAAAA,OAAAA,EAASZ,QAAQO,EAAE;AAAGL,gBAAAA,QAAAA,EAAAA;;;;AAGzC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeIconField.js","sources":["../../../form/PrimeIconField.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 { IconField } from 'primereact/iconfield';\nimport { InputText } from 'primereact/inputtext';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:iconField` component - a field with an icon rendered inside it.\n *\n * Like {@link PrimeFloatLabel} this decorates a field rather than being one, so the field comes from the\n * `content` slot with a plain text input as the fallback.\n *\n * PrimeReact 11 has no `primereact/inputicon` module; the icon slot is `IconField.Inset`, a part of\n * `iconfield` itself. With it went the `iconPosition` prop - v11 gives the root a single class and reads\n * the side off the DOM instead - so `iconPosition` is honored here by placing the inset before or after\n * the field rather than by naming a side. Same authored property, same result, decided one level up.\n */\nexport function PrimeIconField({ element, slots }: RegisteredComponentProps) {\n const icon = <IconField.Inset className={stringProperty(element, 'icon', 'pi pi-search')} />;\n const field = slots.content?.length ? slots.content : <InputText placeholder={stringProperty(element, 'placeholder')} />;\n const iconLast = stringProperty(element, 'iconPosition', 'left') === 'right';\n return (\n <IconField.Root data-scene-id={element.id}>\n {iconLast ? field : icon}\n {iconLast ? icon : field}\n </IconField.Root>\n );\n}\n"],"names":["PrimeIconField","element","slots","icon","_jsx","IconField","Inset","className","stringProperty","field","content","length","InputText","placeholder","iconLast","_jsxs","Root","data-scene-id","id"],"mappings":";;;;;AAQA;;;;;;;;;;AAUC,IACM,SAASA,cAAAA,CAAe,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;IACvE,MAAMC,IAAAA,iBAAOC,GAAA,CAACC,SAAAA,CAAUC,KAAK,EAAA;QAACC,SAAAA,EAAWC,cAAAA,CAAeP,SAAS,MAAA,EAAQ,cAAA;;IACzE,MAAMQ,KAAAA,GAAQP,MAAMQ,OAAO,EAAEC,SAAST,KAAAA,CAAMQ,OAAO,iBAAGN,GAAA,CAACQ,SAAAA,EAAAA;AAAUC,QAAAA,WAAAA,EAAaL,eAAeP,OAAAA,EAAS,aAAA;;AACtG,IAAA,MAAMa,QAAAA,GAAWN,cAAAA,CAAeP,OAAAA,EAAS,cAAA,EAAgB,MAAA,CAAA,KAAY,OAAA;IACrE,qBACIc,IAAA,CAACV,UAAUW,IAAI,EAAA;AAACC,QAAAA,eAAAA,EAAehB,QAAQiB,EAAE;;AACpCJ,YAAAA,QAAAA,GAAWL,KAAAA,GAAQN,IAAAA;AACnBW,YAAAA,QAAAA,GAAWX,IAAAA,GAAOM;;;AAG/B
|
|
1
|
+
{"version":3,"file":"PrimeIconField.js","sources":["../../../form/PrimeIconField.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 { IconField } from 'primereact/iconfield';\nimport { InputText } from 'primereact/inputtext';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:iconField` component - a field with an icon rendered inside it.\n *\n * Like {@link PrimeFloatLabel} this decorates a field rather than being one, so the field comes from the\n * `content` slot with a plain text input as the fallback.\n *\n * PrimeReact 11 has no `primereact/inputicon` module; the icon slot is `IconField.Inset`, a part of\n * `iconfield` itself. With it went the `iconPosition` prop - v11 gives the root a single class and reads\n * the side off the DOM instead - so `iconPosition` is honored here by placing the inset before or after\n * the field rather than by naming a side. Same authored property, same result, decided one level up.\n */\nexport function PrimeIconField({ element, slots }: RegisteredComponentProps) {\n const icon = <IconField.Inset className={stringProperty(element, 'icon', 'pi pi-search')} />;\n const field = slots.content?.length ? slots.content : <InputText placeholder={stringProperty(element, 'placeholder')} />;\n const iconLast = stringProperty(element, 'iconPosition', 'left') === 'right';\n return (\n <IconField.Root data-scene-id={element.id}>\n {iconLast ? field : icon}\n {iconLast ? icon : field}\n </IconField.Root>\n );\n}\n"],"names":["PrimeIconField","element","slots","icon","_jsx","IconField","Inset","className","stringProperty","field","content","length","InputText","placeholder","iconLast","_jsxs","Root","data-scene-id","id"],"mappings":";;;;;AAQA;;;;;;;;;;AAUC,IACM,SAASA,cAAAA,CAAe,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;IACvE,MAAMC,IAAAA,iBAAOC,GAAA,CAACC,SAAAA,CAAUC,KAAK,EAAA;QAACC,SAAAA,EAAWC,cAAAA,CAAeP,SAAS,MAAA,EAAQ,cAAA;;IACzE,MAAMQ,KAAAA,GAAQP,MAAMQ,OAAO,EAAEC,SAAST,KAAAA,CAAMQ,OAAO,iBAAGN,GAAA,CAACQ,SAAAA,EAAAA;AAAUC,QAAAA,WAAAA,EAAaL,eAAeP,OAAAA,EAAS,aAAA;;AACtG,IAAA,MAAMa,QAAAA,GAAWN,cAAAA,CAAeP,OAAAA,EAAS,cAAA,EAAgB,MAAA,CAAA,KAAY,OAAA;IACrE,qBACIc,IAAA,CAACV,UAAUW,IAAI,EAAA;AAACC,QAAAA,eAAAA,EAAehB,QAAQiB,EAAE;;AACpCJ,YAAAA,QAAAA,GAAWL,KAAAA,GAAQN,IAAAA;AACnBW,YAAAA,QAAAA,GAAWX,IAAAA,GAAOM;;;AAG/B;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeInputNumber.js","sources":["../../../form/PrimeInputNumber.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 { InputNumber } from 'primereact/inputnumber';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, numberProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:inputNumber` component - a numeric field with locale-aware formatting.\n *\n * `mode` and `currency` are passed straight through because that is where InputNumber earns its keep\n * over a plain text field: it formats and parses in the user's locale rather than making a screen do it.\n *\n * PrimeReact 11 splits the component in two: `Root` holds the number model and `Input` is the field it\n * formats into, which is also why `placeholder` moved onto the input rather than the root. `showButtons`\n * is no longer a flag the component interprets - the spinner is a `Group` of `Increment` and `Decrement`\n * you either render or do not - so the property now decides whether that group exists at all.\n */\nexport function PrimeInputNumber({ element }: RegisteredComponentProps) {\n const [value, setValue] = useState<number | undefined>(numberProperty(element, 'value'));\n const currency = stringProperty(element, 'currency');\n return (\n <InputNumber.Root\n data-scene-id={element.id}\n value={value}\n onValueChange={(event) => setValue(typeof event.value === 'number' ? event.value : undefined)}\n mode={currency === undefined ? 'decimal' : 'currency'}\n currency={currency}\n min={numberProperty(element, 'min')}\n max={numberProperty(element, 'max')}\n disabled={booleanProperty(element, 'disabled', false)}>\n <InputNumber.Input placeholder={stringProperty(element, 'placeholder')} />\n {booleanProperty(element, 'showButtons', false) && (\n <InputNumber.Group>\n <InputNumber.Increment>\n <i className='pi pi-chevron-up' />\n </InputNumber.Increment>\n <InputNumber.Decrement>\n <i className='pi pi-chevron-down' />\n </InputNumber.Decrement>\n </InputNumber.Group>\n )}\n </InputNumber.Root>\n );\n}\n"],"names":["PrimeInputNumber","element","value","setValue","useState","numberProperty","currency","stringProperty","_jsxs","InputNumber","Root","data-scene-id","id","onValueChange","event","undefined","mode","min","max","disabled","booleanProperty","_jsx","Input","placeholder","Group","Increment","i","className","Decrement"],"mappings":";;;;;AAQA;;;;;;;;;;AAUC,IACM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AA,EAAU;;;;;;;AAMrC
|
|
1
|
+
{"version":3,"file":"PrimeInputNumber.js","sources":["../../../form/PrimeInputNumber.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 { InputNumber } from 'primereact/inputnumber';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, numberProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:inputNumber` component - a numeric field with locale-aware formatting.\n *\n * `mode` and `currency` are passed straight through because that is where InputNumber earns its keep\n * over a plain text field: it formats and parses in the user's locale rather than making a screen do it.\n *\n * PrimeReact 11 splits the component in two: `Root` holds the number model and `Input` is the field it\n * formats into, which is also why `placeholder` moved onto the input rather than the root. `showButtons`\n * is no longer a flag the component interprets - the spinner is a `Group` of `Increment` and `Decrement`\n * you either render or do not - so the property now decides whether that group exists at all.\n */\nexport function PrimeInputNumber({ element }: RegisteredComponentProps) {\n const [value, setValue] = useState<number | undefined>(numberProperty(element, 'value'));\n const currency = stringProperty(element, 'currency');\n return (\n <InputNumber.Root\n data-scene-id={element.id}\n value={value}\n onValueChange={(event) => setValue(typeof event.value === 'number' ? event.value : undefined)}\n mode={currency === undefined ? 'decimal' : 'currency'}\n currency={currency}\n min={numberProperty(element, 'min')}\n max={numberProperty(element, 'max')}\n disabled={booleanProperty(element, 'disabled', false)}>\n <InputNumber.Input placeholder={stringProperty(element, 'placeholder')} />\n {booleanProperty(element, 'showButtons', false) && (\n <InputNumber.Group>\n <InputNumber.Increment>\n <i className='pi pi-chevron-up' />\n </InputNumber.Increment>\n <InputNumber.Decrement>\n <i className='pi pi-chevron-down' />\n </InputNumber.Decrement>\n </InputNumber.Group>\n )}\n </InputNumber.Root>\n );\n}\n"],"names":["PrimeInputNumber","element","value","setValue","useState","numberProperty","currency","stringProperty","_jsxs","InputNumber","Root","data-scene-id","id","onValueChange","event","undefined","mode","min","max","disabled","booleanProperty","_js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AAA;AAClB,wBAAA,QAAA,gBAAAP,GAAA,CAACK,GAAAA,EAAAA;4BAAEC,SAAAA,EAAU;;;;;;;AAMrC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeInputText.js","sources":["../../../form/PrimeInputText.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 { InputText } from 'primereact/inputtext';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:inputText` component - a single-line text field.\n *\n * PrimeReact inputs are controlled, and a Scene element has nowhere to put \"what the user has typed so\n * far\" - `properties` is authored design-time configuration, not live state. The adapter therefore owns\n * that state locally, seeded from the `value` property. The consequence is deliberate and worth knowing:\n * a preview is genuinely typeable instead of frozen, and the typed value is local to the rendered\n * component rather than pushed back into the model.\n */\nexport function PrimeInputText({ element }: RegisteredComponentProps) {\n const [value, setValue] = useState(stringProperty(element, 'value', ''));\n return (\n <InputText\n data-scene-id={element.id}\n value={value}\n onChange={(event) => setValue(event.target.value)}\n placeholder={stringProperty(element, 'placeholder')}\n disabled={booleanProperty(element, 'disabled', false)}\n readOnly={booleanProperty(element, 'readOnly', false)}\n invalid={booleanProperty(element, 'invalid', false)}\n />\n );\n}\n"],"names":["PrimeInputText","element","value","setValue","useState","stringProperty","_jsx","InputText","data-scene-id","id","onChange","event","target","placeholder","disabled","booleanProperty","readOnly","invalid"],"mappings":";;;;;AAQA;;;;;;;;AAQC,IACM,SAASA,cAAAA,CAAe,EAAEC,OAAO,EAA4B,EAAA;AAChE,IAAA,MAAM,CAACC,KAAAA,EAAOC,QAAAA,CAAS,GAAGC,QAAAA,CAASC,cAAAA,CAAeJ,SAAS,OAAA,EAAS,EAAA,CAAA,CAAA;AACpE,IAAA,qBACIK,GAAA,CAACC,SAAAA,EAAAA;AACGC,QAAAA,eAAAA,EAAeP,QAAQQ,EAAE;QACzBP,KAAAA,EAAOA,KAAAA;AACPQ,QAAAA,QAAAA,EAAU,CAACC,KAAAA,GAAUR,QAAAA,CAASQ,KAAAA,CAAMC,MAAM,CAACV,KAAK,CAAA;AAChDW,QAAAA,WAAAA,EAAaR,eAAeJ,OAAAA,EAAS,aAAA,CAAA;QACrCa,QAAAA,EAAUC,eAAAA,CAAgBd,SAAS,UAAA,EAAY,KAAA,CAAA;QAC/Ce,QAAAA,EAAUD,eAAAA,CAAgBd,SAAS,UAAA,EAAY,KAAA,CAAA;QAC/CgB,OAAAA,EAASF,eAAAA,CAAgBd,SAAS,SAAA,EAAW,KAAA;;AAGzD
|
|
1
|
+
{"version":3,"file":"PrimeInputText.js","sources":["../../../form/PrimeInputText.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 { InputText } from 'primereact/inputtext';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:inputText` component - a single-line text field.\n *\n * PrimeReact inputs are controlled, and a Scene element has nowhere to put \"what the user has typed so\n * far\" - `properties` is authored design-time configuration, not live state. The adapter therefore owns\n * that state locally, seeded from the `value` property. The consequence is deliberate and worth knowing:\n * a preview is genuinely typeable instead of frozen, and the typed value is local to the rendered\n * component rather than pushed back into the model.\n */\nexport function PrimeInputText({ element }: RegisteredComponentProps) {\n const [value, setValue] = useState(stringProperty(element, 'value', ''));\n return (\n <InputText\n data-scene-id={element.id}\n value={value}\n onChange={(event) => setValue(event.target.value)}\n placeholder={stringProperty(element, 'placeholder')}\n disabled={booleanProperty(element, 'disabled', false)}\n readOnly={booleanProperty(element, 'readOnly', false)}\n invalid={booleanProperty(element, 'invalid', false)}\n />\n );\n}\n"],"names":["PrimeInputText","element","value","setValue","useState","stringProperty","_jsx","InputText","data-scene-id","id","onChange","event","target","placeholder","disabled","booleanProperty","readOnly","invalid"],"mappings":";;;;;AAQA;;;;;;;;AAQC,IACM,SAASA,cAAAA,CAAe,EAAEC,OAAO,EAA4B,EAAA;AAChE,IAAA,MAAM,CAACC,KAAAA,EAAOC,QAAAA,CAAS,GAAGC,QAAAA,CAASC,cAAAA,CAAeJ,SAAS,OAAA,EAAS,EAAA,CAAA,CAAA;AACpE,IAAA,qBACIK,GAAA,CAACC,SAAAA,EAAAA;AACGC,QAAAA,eAAAA,EAAeP,QAAQQ,EAAE;QACzBP,KAAAA,EAAOA,KAAAA;AACPQ,QAAAA,QAAAA,EAAU,CAACC,KAAAA,GAAUR,QAAAA,CAASQ,KAAAA,CAAMC,MAAM,CAACV,KAAK,CAAA;AAChDW,QAAAA,WAAAA,EAAaR,eAAeJ,OAAAA,EAAS,aAAA,CAAA;QACrCa,QAAAA,EAAUC,eAAAA,CAAgBd,SAAS,UAAA,EAAY,KAAA,CAAA;QAC/Ce,QAAAA,EAAUD,eAAAA,CAAgBd,SAAS,UAAA,EAAY,KAAA,CAAA;QAC/CgB,OAAAA,EAASF,eAAAA,CAAgBd,SAAS,SAAA,EAAW,KAAA;;AAGzD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeInputTextarea.js","sources":["../../../form/PrimeInputTextarea.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 { ChangeEvent, useState } from 'react';\nimport { Textarea } from 'primereact/textarea';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, numberProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:inputTextarea` component - a multi-line text field, named `Textarea` by PrimeReact 11.\n *\n * One of the few components the version change left alone beyond its name: it is still a single element\n * rather than a composition, and `rows`, `cols` and `placeholder` still reach the underlying `<textarea>`\n * untouched. Holds the typed value locally for the same reason {@link PrimeInputText} does.\n */\nexport function PrimeInputTextarea({ element }: RegisteredComponentProps) {\n const [value, setValue] = useState(stringProperty(element, 'value', ''));\n return (\n <Textarea\n data-scene-id={element.id}\n value={value}\n onChange={(event: ChangeEvent<HTMLTextAreaElement>) => setValue(event.target.value)}\n rows={numberProperty(element, 'rows', 4)}\n cols={numberProperty(element, 'cols')}\n autoResize={booleanProperty(element, 'autoResize', false)}\n placeholder={stringProperty(element, 'placeholder')}\n disabled={booleanProperty(element, 'disabled', false)}\n />\n );\n}\n"],"names":["PrimeInputTextarea","element","value","setValue","useState","stringProperty","_jsx","Textarea","data-scene-id","id","onChange","event","target","rows","numberProperty","cols","autoResize","booleanProperty","placeholder","disabled"],"mappings":";;;;;AAQA;;;;;;AAMC,IACM,SAASA,kBAAAA,CAAmB,EAAEC,OAAO,EAA4B,EAAA;AACpE,IAAA,MAAM,CAACC,KAAAA,EAAOC,QAAAA,CAAS,GAAGC,QAAAA,CAASC,cAAAA,CAAeJ,SAAS,OAAA,EAAS,EAAA,CAAA,CAAA;AACpE,IAAA,qBACIK,GAAA,CAACC,QAAAA,EAAAA;AACGC,QAAAA,eAAAA,EAAeP,QAAQQ,EAAE;QACzBP,KAAAA,EAAOA,KAAAA;AACPQ,QAAAA,QAAAA,EAAU,CAACC,KAAAA,GAA4CR,QAAAA,CAASQ,KAAAA,CAAMC,MAAM,CAACV,KAAK,CAAA;QAClFW,IAAAA,EAAMC,cAAAA,CAAeb,SAAS,MAAA,EAAQ,CAAA,CAAA;AACtCc,QAAAA,IAAAA,EAAMD,eAAeb,OAAAA,EAAS,MAAA,CAAA;QAC9Be,UAAAA,EAAYC,eAAAA,CAAgBhB,SAAS,YAAA,EAAc,KAAA,CAAA;AACnDiB,QAAAA,WAAAA,EAAab,eAAeJ,OAAAA,EAAS,aAAA,CAAA;QACrCkB,QAAAA,EAAUF,eAAAA,CAAgBhB,SAAS,UAAA,EAAY,KAAA;;AAG3D
|
|
1
|
+
{"version":3,"file":"PrimeInputTextarea.js","sources":["../../../form/PrimeInputTextarea.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 { ChangeEvent, useState } from 'react';\nimport { Textarea } from 'primereact/textarea';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, numberProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:inputTextarea` component - a multi-line text field, named `Textarea` by PrimeReact 11.\n *\n * One of the few components the version change left alone beyond its name: it is still a single element\n * rather than a composition, and `rows`, `cols` and `placeholder` still reach the underlying `<textarea>`\n * untouched. Holds the typed value locally for the same reason {@link PrimeInputText} does.\n */\nexport function PrimeInputTextarea({ element }: RegisteredComponentProps) {\n const [value, setValue] = useState(stringProperty(element, 'value', ''));\n return (\n <Textarea\n data-scene-id={element.id}\n value={value}\n onChange={(event: ChangeEvent<HTMLTextAreaElement>) => setValue(event.target.value)}\n rows={numberProperty(element, 'rows', 4)}\n cols={numberProperty(element, 'cols')}\n autoResize={booleanProperty(element, 'autoResize', false)}\n placeholder={stringProperty(element, 'placeholder')}\n disabled={booleanProperty(element, 'disabled', false)}\n />\n );\n}\n"],"names":["PrimeInputTextarea","element","value","setValue","useState","stringProperty","_jsx","Textarea","data-scene-id","id","onChange","event","target","rows","numberProperty","cols","autoResize","booleanProperty","placeholder","disabled"],"mappings":";;;;;AAQA;;;;;;AAMC,IACM,SAASA,kBAAAA,CAAmB,EAAEC,OAAO,EAA4B,EAAA;AACpE,IAAA,MAAM,CAACC,KAAAA,EAAOC,QAAAA,CAAS,GAAGC,QAAAA,CAASC,cAAAA,CAAeJ,SAAS,OAAA,EAAS,EAAA,CAAA,CAAA;AACpE,IAAA,qBACIK,GAAA,CAACC,QAAAA,EAAAA;AACGC,QAAAA,eAAAA,EAAeP,QAAQQ,EAAE;QACzBP,KAAAA,EAAOA,KAAAA;AACPQ,QAAAA,QAAAA,EAAU,CAACC,KAAAA,GAA4CR,QAAAA,CAASQ,KAAAA,CAAMC,MAAM,CAACV,KAAK,CAAA;QAClFW,IAAAA,EAAMC,cAAAA,CAAeb,SAAS,MAAA,EAAQ,CAAA,CAAA;AACtCc,QAAAA,IAAAA,EAAMD,eAAeb,OAAAA,EAAS,MAAA,CAAA;QAC9Be,UAAAA,EAAYC,eAAAA,CAAgBhB,SAAS,YAAA,EAAc,KAAA,CAAA;AACnDiB,QAAAA,WAAAA,EAAab,eAAeJ,OAAAA,EAAS,aAAA,CAAA;QACrCkB,QAAAA,EAAUF,eAAAA,CAAgBhB,SAAS,UAAA,EAAY,KAAA;;AAG3D;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeKnob.js","sources":["../../../form/PrimeKnob.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 { Knob } from 'primereact/knob';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, numberProperty } from '../properties';\n\n/**\n * The `PrimeReact:knob` component - a circular value picker that doubles as a readout.\n *\n * `Knob.Root` draws the `<svg>` and its children are what goes inside it: `Range` is the full arc,\n * `Value` the filled portion of it, and `Text` the number in the middle. All three are required for the\n * knob to look like one - the root contributes only the canvas and the pointer handling - and `Text`\n * prints the current value when given no children, which is exactly what a readout wants.\n */\nexport function PrimeKnob({ element }: RegisteredComponentProps) {\n const [value, setValue] = useState(numberProperty(element, 'value', 0));\n return (\n <Knob.Root\n data-scene-id={element.id}\n value={value}\n onValueChange={(event) => setValue(event.value ?? 0)}\n min={numberProperty(element, 'min', 0)}\n max={numberProperty(element, 'max', 100)}\n step={numberProperty(element, 'step', 1)}\n size={numberProperty(element, 'size', 100)}\n readOnly={booleanProperty(element, 'readOnly', false)}\n disabled={booleanProperty(element, 'disabled', false)}>\n <Knob.Range />\n <Knob.Value />\n <Knob.Text />\n </Knob.Root>\n );\n}\n"],"names":["PrimeKnob","element","value","setValue","useState","numberProperty","_jsxs","Knob","Root","data-scene-id","id","onValueChange","event","min","max","step","size","readOnly","booleanProperty","disabled","_jsx","Range","Value","Text"],"mappings":";;;;;AAQA;;;;;;;AAOC,IACM,SAASA,SAAAA,CAAU,EAAEC,OAAO,EAA4B,EAAA;AAC3D,IAAA,MAAM,CAACC,KAAAA,EAAOC,QAAAA,CAAS,GAAGC,QAAAA,CAASC,cAAAA,CAAeJ,SAAS,OAAA,EAAS,CAAA,CAAA,CAAA;IACpE,qBACIK,IAAA,CAACC,KAAKC,IAAI,EAAA;AACNC,QAAAA,eAAAA,EAAeR,QAAQS,EAAE;QACzBR,KAAAA,EAAOA,KAAAA;AACPS,QAAAA,aAAAA,EAAe,CAACC,KAAAA,GAAUT,QAAAA,CAASS,KAAAA,CAAMV,KAAK,IAAI,CAAA,CAAA;QAClDW,GAAAA,EAAKR,cAAAA,CAAeJ,SAAS,KAAA,EAAO,CAAA,CAAA;QACpCa,GAAAA,EAAKT,cAAAA,CAAeJ,SAAS,KAAA,EAAO,GAAA,CAAA;QACpCc,IAAAA,EAAMV,cAAAA,CAAeJ,SAAS,MAAA,EAAQ,CAAA,CAAA;QACtCe,IAAAA,EAAMX,cAAAA,CAAeJ,SAAS,MAAA,EAAQ,GAAA,CAAA;QACtCgB,QAAAA,EAAUC,eAAAA,CAAgBjB,SAAS,UAAA,EAAY,KAAA,CAAA;QAC/CkB,QAAAA,EAAUD,eAAAA,CAAgBjB,SAAS,UAAA,EAAY,KAAA,CAAA;;AAC/C,0BAAAmB,GAAA,CAACb,KAAKc,KAAK,EAAA,EAAA,CAAA;AACX,0BAAAD,GAAA,CAACb,KAAKe,KAAK,EAAA,EAAA,CAAA;AACX,0BAAAF,GAAA,CAACb,KAAKgB,IAAI,EAAA,EAAA;;;AAGtB
|
|
1
|
+
{"version":3,"file":"PrimeKnob.js","sources":["../../../form/PrimeKnob.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 { Knob } from 'primereact/knob';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, numberProperty } from '../properties';\n\n/**\n * The `PrimeReact:knob` component - a circular value picker that doubles as a readout.\n *\n * `Knob.Root` draws the `<svg>` and its children are what goes inside it: `Range` is the full arc,\n * `Value` the filled portion of it, and `Text` the number in the middle. All three are required for the\n * knob to look like one - the root contributes only the canvas and the pointer handling - and `Text`\n * prints the current value when given no children, which is exactly what a readout wants.\n */\nexport function PrimeKnob({ element }: RegisteredComponentProps) {\n const [value, setValue] = useState(numberProperty(element, 'value', 0));\n return (\n <Knob.Root\n data-scene-id={element.id}\n value={value}\n onValueChange={(event) => setValue(event.value ?? 0)}\n min={numberProperty(element, 'min', 0)}\n max={numberProperty(element, 'max', 100)}\n step={numberProperty(element, 'step', 1)}\n size={numberProperty(element, 'size', 100)}\n readOnly={booleanProperty(element, 'readOnly', false)}\n disabled={booleanProperty(element, 'disabled', false)}>\n <Knob.Range />\n <Knob.Value />\n <Knob.Text />\n </Knob.Root>\n );\n}\n"],"names":["PrimeKnob","element","value","setValue","useState","numberProperty","_jsxs","Knob","Root","data-scene-id","id","onValueChange","event","min","max","step","size","readOnly","booleanProperty","disabled","_jsx","Range","Value","Text"],"mappings":";;;;;AAQA;;;;;;;AAOC,IACM,SAASA,SAAAA,CAAU,EAAEC,OAAO,EAA4B,EAAA;AAC3D,IAAA,MAAM,CAACC,KAAAA,EAAOC,QAAAA,CAAS,GAAGC,QAAAA,CAASC,cAAAA,CAAeJ,SAAS,OAAA,EAAS,CAAA,CAAA,CAAA;IACpE,qBACIK,IAAA,CAACC,KAAKC,IAAI,EAAA;AACNC,QAAAA,eAAAA,EAAeR,QAAQS,EAAE;QACzBR,KAAAA,EAAOA,KAAAA;AACPS,QAAAA,aAAAA,EAAe,CAACC,KAAAA,GAAUT,QAAAA,CAASS,KAAAA,CAAMV,KAAK,IAAI,CAAA,CAAA;QAClDW,GAAAA,EAAKR,cAAAA,CAAeJ,SAAS,KAAA,EAAO,CAAA,CAAA;QACpCa,GAAAA,EAAKT,cAAAA,CAAeJ,SAAS,KAAA,EAAO,GAAA,CAAA;QACpCc,IAAAA,EAAMV,cAAAA,CAAeJ,SAAS,MAAA,EAAQ,CAAA,CAAA;QACtCe,IAAAA,EAAMX,cAAAA,CAAeJ,SAAS,MAAA,EAAQ,GAAA,CAAA;QACtCgB,QAAAA,EAAUC,eAAAA,CAAgBjB,SAAS,UAAA,EAAY,KAAA,CAAA;QAC/CkB,QAAAA,EAAUD,eAAAA,CAAgBjB,SAAS,UAAA,EAAY,KAAA,CAAA;;AAC/C,0BAAAmB,GAAA,CAACb,KAAKc,KAAK,EAAA,EAAA,CAAA;AACX,0BAAAD,GAAA,CAACb,KAAKe,KAAK,EAAA,EAAA,CAAA;AACX,0BAAAF,GAAA,CAACb,KAAKgB,IAAI,EAAA,EAAA;;;AAGtB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeListBox.js","sources":["../../../form/PrimeListBox.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 { Listbox } from 'primereact/listbox';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, optionsProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:listBox` component - an always-visible list of choices.\n *\n * The alternative to a dropdown when the choices matter enough to stay on screen; `multiple` switches it\n * between one and many. `Listbox.List` renders `options` itself, so `optionLabel` / `optionValue` remain\n * the whole of the mapping and there is no per-option markup here.\n *\n * v10's `filter` property is not read. PrimeReact 11 ships a `Listbox.Filter` part, but it is only an\n * input wired for keyboard navigation - the root does no filtering of `options` at all, so switching it\n * on would render a search box that searches nothing. Filtering a list is the caller's to do, and a\n * design-time preview has no list long enough to need it.\n */\nexport function PrimeListBox({ element }: RegisteredComponentProps) {\n const [value, setValue] = useState<unknown>(stringProperty(element, 'value'));\n return (\n <Listbox.Root\n data-scene-id={element.id}\n value={value}\n onValueChange={(event) => setValue(event.value)}\n options={optionsProperty(element, 'options')}\n optionLabel='label'\n optionValue='value'\n multiple={booleanProperty(element, 'multiple', false)}\n disabled={booleanProperty(element, 'disabled', false)}>\n <Listbox.List />\n </Listbox.Root>\n );\n}\n"],"names":["PrimeListBox","element","value","setValue","useState","stringProperty","_jsx","Listbox","Root","data-scene-id","id","onValueChange","event","options","optionsProperty","optionLabel","optionValue","multiple","booleanProperty","disabled","List"],"mappings":";;;;;AAQA;;;;;;;;;;;AAWC,IACM,SAASA,YAAAA,CAAa,EAAEC,OAAO,EAA4B,EAAA;AAC9D,IAAA,MAAM,CAACC,KAAAA,EAAOC,QAAAA,CAAS,GAAGC,QAAAA,CAAkBC,eAAeJ,OAAAA,EAAS,OAAA,CAAA,CAAA;IACpE,qBACIK,GAAA,CAACC,QAAQC,IAAI,EAAA;AACTC,QAAAA,eAAAA,EAAeR,QAAQS,EAAE;QACzBR,KAAAA,EAAOA,KAAAA;AACPS,QAAAA,aAAAA,EAAe,CAACC,KAAAA,GAAUT,QAAAA,CAASS,KAAAA,CAAMV,KAAK,CAAA;AAC9CW,QAAAA,OAAAA,EAASC,gBAAgBb,OAAAA,EAAS,SAAA,CAAA;QAClCc,WAAAA,EAAY,OAAA;QACZC,WAAAA,EAAY,OAAA;QACZC,QAAAA,EAAUC,eAAAA,CAAgBjB,SAAS,UAAA,EAAY,KAAA,CAAA;QAC/CkB,QAAAA,EAAUD,eAAAA,CAAgBjB,SAAS,UAAA,EAAY,KAAA,CAAA;gCAC/CK,GAAA,CAACC,QAAQa,IAAI,EAAA,EAAA;;AAGzB
|
|
1
|
+
{"version":3,"file":"PrimeListBox.js","sources":["../../../form/PrimeListBox.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 { Listbox } from 'primereact/listbox';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, optionsProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:listBox` component - an always-visible list of choices.\n *\n * The alternative to a dropdown when the choices matter enough to stay on screen; `multiple` switches it\n * between one and many. `Listbox.List` renders `options` itself, so `optionLabel` / `optionValue` remain\n * the whole of the mapping and there is no per-option markup here.\n *\n * v10's `filter` property is not read. PrimeReact 11 ships a `Listbox.Filter` part, but it is only an\n * input wired for keyboard navigation - the root does no filtering of `options` at all, so switching it\n * on would render a search box that searches nothing. Filtering a list is the caller's to do, and a\n * design-time preview has no list long enough to need it.\n */\nexport function PrimeListBox({ element }: RegisteredComponentProps) {\n const [value, setValue] = useState<unknown>(stringProperty(element, 'value'));\n return (\n <Listbox.Root\n data-scene-id={element.id}\n value={value}\n onValueChange={(event) => setValue(event.value)}\n options={optionsProperty(element, 'options')}\n optionLabel='label'\n optionValue='value'\n multiple={booleanProperty(element, 'multiple', false)}\n disabled={booleanProperty(element, 'disabled', false)}>\n <Listbox.List />\n </Listbox.Root>\n );\n}\n"],"names":["PrimeListBox","element","value","setValue","useState","stringProperty","_jsx","Listbox","Root","data-scene-id","id","onValueChange","event","options","optionsProperty","optionLabel","optionValue","multiple","booleanProperty","disabled","List"],"mappings":";;;;;AAQA;;;;;;;;;;;AAWC,IACM,SAASA,YAAAA,CAAa,EAAEC,OAAO,EAA4B,EAAA;AAC9D,IAAA,MAAM,CAACC,KAAAA,EAAOC,QAAAA,CAAS,GAAGC,QAAAA,CAAkBC,eAAeJ,OAAAA,EAAS,OAAA,CAAA,CAAA;IACpE,qBACIK,GAAA,CAACC,QAAQC,IAAI,EAAA;AACTC,QAAAA,eAAAA,EAAeR,QAAQS,EAAE;QACzBR,KAAAA,EAAOA,KAAAA;AACPS,QAAAA,aAAAA,EAAe,CAACC,KAAAA,GAAUT,QAAAA,CAASS,KAAAA,CAAMV,KAAK,CAAA;AAC9CW,QAAAA,OAAAA,EAASC,gBAAgBb,OAAAA,EAAS,SAAA,CAAA;QAClCc,WAAAA,EAAY,OAAA;QACZC,WAAAA,EAAY,OAAA;QACZC,QAAAA,EAAUC,eAAAA,CAAgBjB,SAAS,UAAA,EAAY,KAAA,CAAA;QAC/CkB,QAAAA,EAAUD,eAAAA,CAAgBjB,SAAS,UAAA,EAAY,KAAA,CAAA;gCAC/CK,GAAA,CAACC,QAAQa,IAAI,EAAA,EAAA;;AAGzB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimeMultiSelect.js","sources":["../../../form/PrimeMultiSelect.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 { Select } from 'primereact/select';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, optionsProperty, stringArrayProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:multiSelect` component - a multiple-choice select.\n *\n * There is no `MultiSelect` in PrimeReact 11; the capability moved onto `Select`, which takes a\n * `multiple` prop. Keeping the abstract name and re-expressing it over `Select` is the whole point of\n * having an abstract name: a screen that says `multiSelect` keeps working, and only this file knows the\n * component behind it changed.\n *\n * Two v10 properties have nowhere to go and are deliberately dropped rather than silently ignored.\n * `display` chose between a comma-separated summary and a row of chips, and `maxSelectedLabels` collapsed\n * a long selection into an \"n items selected\" label - both were features of v10's own selection renderer.\n * v11 renders the selection through `Select.Value`, which joins the selected labels with commas and\n * offers no chip mode and no collapse threshold, so honoring either property would mean reimplementing\n * the value slot rather than configuring it.\n */\nexport function PrimeMultiSelect({ element }: RegisteredComponentProps) {\n const [value, setValue] = useState<unknown>(stringArrayProperty(element, 'value'));\n const placeholder = stringProperty(element, 'placeholder', 'Select');\n const filter = booleanProperty(element, 'filter', false);\n return (\n <Select.Root\n data-scene-id={element.id}\n multiple\n value={value}\n onValueChange={(event) => setValue(event.value)}\n options={optionsProperty(element, 'options')}\n optionLabel='label'\n optionValue='value'\n filter={filter}\n disabled={booleanProperty(element, 'disabled', false)}>\n <Select.Trigger>\n <Select.Value placeholder={placeholder} />\n <Select.Arrow />\n </Select.Trigger>\n <Select.Portal>\n <Select.Positioner>\n <Select.Popup>\n {filter && <Select.Filter placeholder={placeholder} />}\n <Select.List />\n </Select.Popup>\n </Select.Positioner>\n </Select.Portal>\n </Select.Root>\n );\n}\n"],"names":["PrimeMultiSelect","element","value","setValue","useState","stringArrayProperty","placeholder","stringProperty","filter","booleanProperty","_jsxs","Select","Root","data-scene-id","id","multiple","onValueChange","event","options","optionsProperty","optionLabel","optionValue","disabled","Trigger","_jsx","Value","Arrow","Portal","Positioner","Popup","Filter","List"],"mappings":";;;;;AAQA;;;;;;;;;;;;;;AAcC,IACM,SAASA,gBAAAA,CAAiB,EAAEC,OAAO,EAA4B,EAAA;AAClE,IAAA,MAAM,CAACC,KAAAA,EAAOC,QAAAA,CAAS,GAAGC,QAAAA,CAAkBC,oBAAoBJ,OAAAA,EAAS,OAAA,CAAA,CAAA;IACzE,MAAMK,WAAAA,GAAcC,cAAAA,CAAeN,OAAAA,EAAS,aAAA,EAAe,QAAA,CAAA;IAC3D,MAAMO,MAAAA,GAASC,eAAAA,CAAgBR,OAAAA,EAAS,QAAA,EAAU,KAAA,CAAA;IAClD,qBACIS,IAAA,CAACC,OAAOC,IAAI,EAAA;AACRC,QAAAA,eAAAA,EAAeZ,QAAQa,EAAE;QACzBC,QAAQ,EAAA,IAAA;QACRb,KAAAA,EAAOA,KAAAA;AACPc,QAAAA,aAAAA,EAAe,CAACC,KAAAA,GAAUd,QAAAA,CAASc,KAAAA,CAAMf,KAAK,CAAA;AAC9CgB,QAAAA,OAAAA,EAASC,gBAAgBlB,OAAAA,EAAS,SAAA,CAAA;QAClCmB,WAAAA,EAAY,OAAA;QACZC,WAAAA,EAAY,OAAA;QACZb,MAAAA,EAAQA,MAAAA;QACRc,QAAAA,EAAUb,eAAAA,CAAgBR,SAAS,UAAA,EAAY,KAAA,CAAA;;AAC/C,0BAAAS,IAAA,CAACC,OAAOY,OAAO,EAAA;;AACX,kCAAAC,GAAA,CAACb,OAAOc,KAAK,EAAA;wBAACnB,WAAAA,EAAaA;;AAC3B,kCAAAkB,GAAA,CAACb,OAAOe,KAAK,EAAA,EAAA;;;AAEjB,0BAAAF,GAAA,CAACb,OAAOgB,MAAM,EAAA;wCACVH,GAAA,CAACb,OAAOiB,UAAU,EAAA;4CACdlB,IAAA,CAACC,OAAOkB,KAAK,EAAA;;4BACRrB,MAAAA,kBAAUgB,GAAA,CAACb,OAAOmB,MAAM,EAAA;gCAACxB,WAAAA,EAAaA;;AACvC,0CAAAkB,GAAA,CAACb,OAAOoB,IAAI,EAAA,EAAA;;;;;;;AAMpC
|
|
1
|
+
{"version":3,"file":"PrimeMultiSelect.js","sources":["../../../form/PrimeMultiSelect.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 { Select } from 'primereact/select';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { booleanProperty, optionsProperty, stringArrayProperty, stringProperty } from '../properties';\n\n/**\n * The `PrimeReact:multiSelect` component - a multiple-choice select.\n *\n * There is no `MultiSelect` in PrimeReact 11; the capability moved onto `Select`, which takes a\n * `multiple` prop. Keeping the abstract name and re-expressing it over `Select` is the whole point of\n * having an abstract name: a screen that says `multiSelect` keeps working, and only this file knows the\n * component behind it changed.\n *\n * Two v10 properties have nowhere to go and are deliberately dropped rather than silently ignored.\n * `display` chose between a comma-separated summary and a row of chips, and `maxSelectedLabels` collapsed\n * a long selection into an \"n items selected\" label - both were features of v10's own selection renderer.\n * v11 renders the selection through `Select.Value`, which joins the selected labels with commas and\n * offers no chip mode and no collapse threshold, so honoring either property would mean reimplementing\n * the value slot rather than configuring it.\n */\nexport function PrimeMultiSelect({ element }: RegisteredComponentProps) {\n const [value, setValue] = useState<unknown>(stringArrayProperty(element, 'value'));\n const placeholder = stringProperty(element, 'placeholder', 'Select');\n const filter = booleanProperty(element, 'filter', false);\n return (\n <Select.Root\n data-scene-id={element.id}\n multiple\n value={value}\n onValueChange={(event) => setValue(event.value)}\n options={optionsProperty(element, 'options')}\n optionLabel='label'\n optionValue='value'\n filter={filter}\n disabled={booleanProperty(element, 'disabled', false)}>\n <Select.Trigger>\n <Select.Value placeholder={placeholder} />\n <Select.Arrow />\n </Select.Trigger>\n <Select.Portal>\n <Select.Positioner>\n <Select.Popup>\n {filter && <Select.Filter placeholder={placeholder} />}\n <Select.List />\n </Select.Popup>\n </Select.Positioner>\n </Select.Portal>\n </Select.Root>\n );\n}\n"],"names":["PrimeMultiSelect","element","value","setValue","useState","stringArrayProperty","placeholder","stringProperty","filter","booleanProperty","_jsxs","Select","Root","data-scene-id","id","multiple","onValueChange","event","options","optionsProperty","optionLabel","optionValue","disabled","Trigger","_jsx","Value","Arrow","Portal","Positioner","Popup","Filter","List"],"mappings":";;;;;AAQA;;;;;;;;;;;;;;AAcC,IACM,SAASA,gBAAAA,CAAiB,EAAEC,OAAO,EAA4B,EAAA;AAClE,IAAA,MAAM,CAACC,KAAAA,EAAOC,QAAAA,CAAS,GAAGC,QAAAA,CAAkBC,oBAAoBJ,OAAAA,EAAS,OAAA,CAAA,CAAA;IACzE,MAAMK,WAAAA,GAAcC,cAAAA,CAAeN,OAAAA,EAAS,aAAA,EAAe,QAAA,CAAA;IAC3D,MAAMO,MAAAA,GAASC,eAAAA,CAAgBR,OAAAA,EAAS,QAAA,EAAU,KAAA,CAAA;IAClD,qBACIS,IAAA,CAACC,OAAOC,IAAI,EAAA;AACRC,QAAAA,eAAAA,EAAeZ,QAAQa,EAAE;QACzBC,QAAQ,EAAA,IAAA;QACRb,KAAAA,EAAOA,KAAAA;AACPc,QAAAA,aAAAA,EAAe,CAACC,KAAAA,GAAUd,QAAAA,CAASc,KAAAA,CAAMf,KAAK,CAAA;AAC9CgB,QAAAA,OAAAA,EAASC,gBAAgBlB,OAAAA,EAAS,SAAA,CAAA;QAClCmB,WAAAA,EAAY,OAAA;QACZC,WAAAA,E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