@mittwald/flow-remote-vue-components 1.5.0-next.35 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -2
- package/USAGE.md +5 -2
- package/dist/js/index.mjs +2 -1
- package/dist/js/remote-vue-components/src/auto-generated/AccordionGroup.mjs +38 -0
- package/dist/js/remote-vue-components/src/auto-generated/AccordionGroup.mjs.map +1 -0
- package/dist/js/remote-vue-components/src/list/AllFiltersModal.mjs +2 -1
- package/dist/js/remote-vue-components/src/list/AllFiltersModal.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/overlays/locales.mjs +2 -2
- package/dist/js/remote-vue-components/src/overlays/locales.mjs.map +1 -1
- package/dist/js/remote-vue-components/src/version.mjs +1 -1
- package/dist/types/auto-generated/AccordionGroup.d.ts +4 -0
- package/dist/types/auto-generated/index.d.ts +1 -0
- package/package.json +34 -36
- package/dist/js/remote-vue-components/src/overlays/overlayRegistry.mjs +0 -18
- package/dist/js/remote-vue-components/src/overlays/overlayRegistry.mjs.map +0 -1
- package/dist/packages/remote-vue-components/tsconfig.vite.tsbuildinfo +0 -1
- package/dist/types/overlays/overlayRegistry.d.ts +0 -3
package/README.md
CHANGED
|
@@ -14,7 +14,8 @@ pipeline is React-specific below the element layer, which is what makes this
|
|
|
14
14
|
package possible.
|
|
15
15
|
|
|
16
16
|
```shell
|
|
17
|
-
|
|
17
|
+
FLOW=$(npm view @mittwald/flow-remote-vue-components@next version)
|
|
18
|
+
pnpm add @mittwald/flow-remote-vue-components@$FLOW @mittwald/flow-react-components@$FLOW @mittwald/ext-bridge@$FLOW vue react react-dom
|
|
18
19
|
```
|
|
19
20
|
|
|
20
21
|
`@mittwald/flow-react-components` is a peer dependency at **runtime and for the
|
|
@@ -30,7 +31,10 @@ types**:
|
|
|
30
31
|
`@mittwald/ext-bridge` is a peer because `RemoteRoot` imports it. `react` and
|
|
31
32
|
`react-dom` are peers of `@mittwald/flow-react-components`, not of this package.
|
|
32
33
|
npm and pnpm install peers on their own; `yarn` and `npm --legacy-peer-deps` do
|
|
33
|
-
not, so name all of them.
|
|
34
|
+
not, so name all of them. Pin the Flow packages to this package's version: its
|
|
35
|
+
peers require exactly that version, and named without one, pnpm and yarn take
|
|
36
|
+
the `latest` dist-tag of `@mittwald/flow-react-components` and
|
|
37
|
+
`@mittwald/ext-bridge`, which is a different release line.
|
|
34
38
|
|
|
35
39
|
```vue
|
|
36
40
|
<script setup lang="ts">
|
package/USAGE.md
CHANGED
|
@@ -27,7 +27,8 @@ What follows is only what is different because you write Vue.
|
|
|
27
27
|
## Installation
|
|
28
28
|
|
|
29
29
|
```shell
|
|
30
|
-
|
|
30
|
+
FLOW=$(npm view @mittwald/flow-remote-vue-components@next version)
|
|
31
|
+
pnpm add @mittwald/flow-remote-vue-components@$FLOW @mittwald/flow-react-components@$FLOW @mittwald/ext-bridge@$FLOW vue react react-dom
|
|
31
32
|
```
|
|
32
33
|
|
|
33
34
|
`@mittwald/flow-react-components` is a **runtime and type** dependency. The
|
|
@@ -37,7 +38,9 @@ fails to build. Every component's props are typed with Flow's React prop types,
|
|
|
37
38
|
read from that package's declarations. `@mittwald/ext-bridge` is needed because
|
|
38
39
|
`RemoteRoot` imports it; `react` and `react-dom` are peers of
|
|
39
40
|
`@mittwald/flow-react-components`. Install all of them explicitly: `yarn` and
|
|
40
|
-
`npm --legacy-peer-deps` do not install peers on their own.
|
|
41
|
+
`npm --legacy-peer-deps` do not install peers on their own. All Flow packages
|
|
42
|
+
need this package's exact version — named without one, pnpm and yarn take the
|
|
43
|
+
`latest` dist-tag of the other two, which is a different release line.
|
|
41
44
|
|
|
42
45
|
## The model
|
|
43
46
|
|
package/dist/js/index.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import { communicationVersion, packageVersion } from "./remote-vue-components/sr
|
|
|
3
3
|
import { createFlowRemoteComponent } from "./remote-vue-components/src/lib/createFlowRemoteComponent.mjs";
|
|
4
4
|
import { AccentBox } from "./remote-vue-components/src/auto-generated/AccentBox.mjs";
|
|
5
5
|
import { Accordion } from "./remote-vue-components/src/auto-generated/Accordion.mjs";
|
|
6
|
+
import { AccordionGroup } from "./remote-vue-components/src/auto-generated/AccordionGroup.mjs";
|
|
6
7
|
import { ActionGroup } from "./remote-vue-components/src/auto-generated/ActionGroup.mjs";
|
|
7
8
|
import { Alert } from "./remote-vue-components/src/auto-generated/Alert.mjs";
|
|
8
9
|
import { AlertBadge } from "./remote-vue-components/src/auto-generated/AlertBadge.mjs";
|
|
@@ -297,4 +298,4 @@ import { Wrap } from "./remote-vue-components/src/components/Wrap.mjs";
|
|
|
297
298
|
import { LightBox } from "./remote-vue-components/src/overlays/LightBox.mjs";
|
|
298
299
|
import { useIsMounted } from "./remote-vue-components/src/composables/useIsMounted.mjs";
|
|
299
300
|
import { useOnChange } from "./remote-vue-components/src/composables/useOnChange.mjs";
|
|
300
|
-
export { AccentBox, Accordion, Action, ActionBatch, ActionGroup, Alert, AlertBadge, AlertIcon, AlertText, Align, Area, Autocomplete, Avatar, AvatarStack, Badge, Bar, BigNumber, Breadcrumb, BrowserOnly, Button, CartesianChart, CartesianGrid, ChartGrid, ChartLegend, ChartTooltip, Chat, Checkbox, CheckboxButton, CheckboxGroup, ClearPropsContext, CoachMark, CodeBlock, CodeEditor, Color, ColumnLayout, Combine, ComboBox, ComponentPropsContextProvider, Content, ContextMenu, ContextMenuContent, ContextMenuSection, ContextMenuTrigger, ContextualHelp, ContextualHelpTrigger, CopyButton, CounterBadge, CountryOptions, DatePicker, DateRangePicker, DeprecationWarningProvider, DialogTrigger, Div, DonutChart, FieldDescription, FieldError, FileCard, FileCardList, FileDropZone, FileField, Flex, Form, Header, HeaderNavigation, Heading, Icon, IconAI, IconAIHosting, IconAnalytics, IconApp, IconAscending, IconAttachment, IconAutoresponder, IconBackLink, IconBackup, IconBold, IconCamera, IconCertificate, IconChangelog, IconCheck, IconCheckboxChecked, IconCheckboxEmpty, IconCheckboxIndeterminate, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconClose, IconCode, IconContainer, IconContextMenu, IconContextMenuVertical, IconContract, IconContractPartner, IconContributor, IconCopy, IconCronjob, IconCustomer, IconDanger, IconDashboard, IconDatabase, IconDate, IconDelete, IconDeliveryBox, IconDescending, IconDesktop, IconDirectory, IconDnsSubZone, IconDnsZone, IconDomain, IconDownload, IconEdit, IconEmail, IconEmailArchive, IconExtension, IconExternalLink, IconFailed, IconFeedback, IconFile, IconFilter, IconForwardAddress, IconForwardLink, IconHide, IconHome, IconImage, IconInfo, IconInvite, IconInvoice, IconItalic, IconKnowledgeHint, IconLanguage, IconLeadFyndr, IconLink, IconLock, IconLockOpen, IconLogout, IconMainUser, IconMarketplace, IconMaximize, IconMember, IconMenu, IconMinimize, IconMinus, IconMittwald, IconMobile, IconMonitoring, IconMove, IconNewsletter, IconNotification, IconNumber, IconOrder, IconOrderedList, IconPassword, IconPath, IconPause, IconPayment, IconPending, IconPicture, IconPlus, IconProject, IconQuote, IconRadioOff, IconRadioOn, IconRedo, IconRefresh, IconRegistry, IconSave, IconSearch, IconSecurity, IconSend, IconServer, IconSetProvider, IconSettings, IconShare, IconShow, IconSorting, IconSsh, IconSshKey, IconSshSftp, IconStack, IconStar, IconStarFilled, IconStart, IconStrikeThrough, IconSubdomain, IconSucceeded, IconSuccess, IconSupport, IconTerminate, IconTicket, IconTime, IconUnavailable, IconUndo, IconUnorderedList, IconUpload, IconUser, IconVhost, IconView, IconVolume, IconWarning, IllustratedMessage, Image, ImageCropper, Initials, InlineCode, ItemsGridList, ItemsGridListItem, Kbd, Label, LabeledValue, LayoutCard, Legend, LightBox, LightBoxGallery, LightBoxGalleryItem, LightBoxTrigger, Line, Link, List, ListEmptyView, ListEmptyViewContainer, ListFilter, ListItem, ListItemView, ListItemViewContent, ListLoaderAsync, ListLoaderComposable, ListModel, ListSearch, ListSorting, ListStaticData, ListSummary, ListTable, ListTableBody, ListTableCell, ListTableColumn, ListTableHeader, ListTableRow, LoadingFallbackTrigger, LoadingIndicator, LoadingSpinner, Markdown, MarkdownEditor, MenuItem, MenuTrigger, Message, MessageSeparator, MessageThread, Modal, ModalTrigger, Navigation, NavigationGroup, Notification, NotificationController, NotificationProvider, NumberField, Option, OverlayContent, PasswordCreationField, Popover, PopoverContent, PopoverTrigger, ProgressBar, Radio, RadioButton, RadioGroup, RangeCalendar, Rating, RatingSegment, RemoteRoot, SearchField, Section, Segment, SegmentedControl, Select, Separator, SettingsProvider, SettingsStore, Skeleton, SkeletonMode, SkeletonText, Slider, Switch, Tab, TabNavigation, TabTitle, Table, TableBody, TableCell, TableColumn, TableFooterRow, TableHeader, TableRow, Tabs, Text, TextArea, TextField, TimeField, Tooltip, TooltipTrigger, TranslationProvider, Truncate, TunnelEntry, Wrap, XAxis, YAxis, communicationVersion, createFlowRemoteComponent, createListSettings, createOverlayController, injectContextIcon, injectListModel, injectOverlayController, injectSettings, packageVersion, svgIcon, tablerIcon, useIsMounted, useLanguage, useListMetadata, useListSettings, useModalController, useNotificationController, useOnChange, useOverlayController, useRemoteConnection, useWarnDeprecation };
|
|
301
|
+
export { AccentBox, Accordion, AccordionGroup, Action, ActionBatch, ActionGroup, Alert, AlertBadge, AlertIcon, AlertText, Align, Area, Autocomplete, Avatar, AvatarStack, Badge, Bar, BigNumber, Breadcrumb, BrowserOnly, Button, CartesianChart, CartesianGrid, ChartGrid, ChartLegend, ChartTooltip, Chat, Checkbox, CheckboxButton, CheckboxGroup, ClearPropsContext, CoachMark, CodeBlock, CodeEditor, Color, ColumnLayout, Combine, ComboBox, ComponentPropsContextProvider, Content, ContextMenu, ContextMenuContent, ContextMenuSection, ContextMenuTrigger, ContextualHelp, ContextualHelpTrigger, CopyButton, CounterBadge, CountryOptions, DatePicker, DateRangePicker, DeprecationWarningProvider, DialogTrigger, Div, DonutChart, FieldDescription, FieldError, FileCard, FileCardList, FileDropZone, FileField, Flex, Form, Header, HeaderNavigation, Heading, Icon, IconAI, IconAIHosting, IconAnalytics, IconApp, IconAscending, IconAttachment, IconAutoresponder, IconBackLink, IconBackup, IconBold, IconCamera, IconCertificate, IconChangelog, IconCheck, IconCheckboxChecked, IconCheckboxEmpty, IconCheckboxIndeterminate, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconClose, IconCode, IconContainer, IconContextMenu, IconContextMenuVertical, IconContract, IconContractPartner, IconContributor, IconCopy, IconCronjob, IconCustomer, IconDanger, IconDashboard, IconDatabase, IconDate, IconDelete, IconDeliveryBox, IconDescending, IconDesktop, IconDirectory, IconDnsSubZone, IconDnsZone, IconDomain, IconDownload, IconEdit, IconEmail, IconEmailArchive, IconExtension, IconExternalLink, IconFailed, IconFeedback, IconFile, IconFilter, IconForwardAddress, IconForwardLink, IconHide, IconHome, IconImage, IconInfo, IconInvite, IconInvoice, IconItalic, IconKnowledgeHint, IconLanguage, IconLeadFyndr, IconLink, IconLock, IconLockOpen, IconLogout, IconMainUser, IconMarketplace, IconMaximize, IconMember, IconMenu, IconMinimize, IconMinus, IconMittwald, IconMobile, IconMonitoring, IconMove, IconNewsletter, IconNotification, IconNumber, IconOrder, IconOrderedList, IconPassword, IconPath, IconPause, IconPayment, IconPending, IconPicture, IconPlus, IconProject, IconQuote, IconRadioOff, IconRadioOn, IconRedo, IconRefresh, IconRegistry, IconSave, IconSearch, IconSecurity, IconSend, IconServer, IconSetProvider, IconSettings, IconShare, IconShow, IconSorting, IconSsh, IconSshKey, IconSshSftp, IconStack, IconStar, IconStarFilled, IconStart, IconStrikeThrough, IconSubdomain, IconSucceeded, IconSuccess, IconSupport, IconTerminate, IconTicket, IconTime, IconUnavailable, IconUndo, IconUnorderedList, IconUpload, IconUser, IconVhost, IconView, IconVolume, IconWarning, IllustratedMessage, Image, ImageCropper, Initials, InlineCode, ItemsGridList, ItemsGridListItem, Kbd, Label, LabeledValue, LayoutCard, Legend, LightBox, LightBoxGallery, LightBoxGalleryItem, LightBoxTrigger, Line, Link, List, ListEmptyView, ListEmptyViewContainer, ListFilter, ListItem, ListItemView, ListItemViewContent, ListLoaderAsync, ListLoaderComposable, ListModel, ListSearch, ListSorting, ListStaticData, ListSummary, ListTable, ListTableBody, ListTableCell, ListTableColumn, ListTableHeader, ListTableRow, LoadingFallbackTrigger, LoadingIndicator, LoadingSpinner, Markdown, MarkdownEditor, MenuItem, MenuTrigger, Message, MessageSeparator, MessageThread, Modal, ModalTrigger, Navigation, NavigationGroup, Notification, NotificationController, NotificationProvider, NumberField, Option, OverlayContent, PasswordCreationField, Popover, PopoverContent, PopoverTrigger, ProgressBar, Radio, RadioButton, RadioGroup, RangeCalendar, Rating, RatingSegment, RemoteRoot, SearchField, Section, Segment, SegmentedControl, Select, Separator, SettingsProvider, SettingsStore, Skeleton, SkeletonMode, SkeletonText, Slider, Switch, Tab, TabNavigation, TabTitle, Table, TableBody, TableCell, TableColumn, TableFooterRow, TableHeader, TableRow, Tabs, Text, TextArea, TextField, TimeField, Tooltip, TooltipTrigger, TranslationProvider, Truncate, TunnelEntry, Wrap, XAxis, YAxis, communicationVersion, createFlowRemoteComponent, createListSettings, createOverlayController, injectContextIcon, injectListModel, injectOverlayController, injectSettings, packageVersion, svgIcon, tablerIcon, useIsMounted, useLanguage, useListMetadata, useListSettings, useModalController, useNotificationController, useOnChange, useOverlayController, useRemoteConnection, useWarnDeprecation };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { createFlowRemoteComponent } from "../lib/createFlowRemoteComponent.mjs";
|
|
2
|
+
import { RemoteAccordionGroupElement } from "@mittwald/flow-remote-elements";
|
|
3
|
+
//#region src/auto-generated/AccordionGroup.ts
|
|
4
|
+
var AccordionGroup = createFlowRemoteComponent("flr-accordion-group", "AccordionGroup", RemoteAccordionGroupElement, { booleans: [
|
|
5
|
+
"allowsMultipleExpanded",
|
|
6
|
+
"aria-atomic",
|
|
7
|
+
"aria-busy",
|
|
8
|
+
"aria-checked",
|
|
9
|
+
"aria-current",
|
|
10
|
+
"aria-disabled",
|
|
11
|
+
"aria-expanded",
|
|
12
|
+
"aria-grabbed",
|
|
13
|
+
"aria-haspopup",
|
|
14
|
+
"aria-hidden",
|
|
15
|
+
"aria-invalid",
|
|
16
|
+
"aria-modal",
|
|
17
|
+
"aria-multiline",
|
|
18
|
+
"aria-multiselectable",
|
|
19
|
+
"aria-pressed",
|
|
20
|
+
"aria-readonly",
|
|
21
|
+
"aria-required",
|
|
22
|
+
"aria-selected",
|
|
23
|
+
"autoFocus",
|
|
24
|
+
"contentEditable",
|
|
25
|
+
"defaultChecked",
|
|
26
|
+
"draggable",
|
|
27
|
+
"hidden",
|
|
28
|
+
"inert",
|
|
29
|
+
"itemScope",
|
|
30
|
+
"separators",
|
|
31
|
+
"spellCheck",
|
|
32
|
+
"suppressContentEditableWarning",
|
|
33
|
+
"suppressHydrationWarning"
|
|
34
|
+
] });
|
|
35
|
+
//#endregion
|
|
36
|
+
export { AccordionGroup };
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=AccordionGroup.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionGroup.mjs","names":[],"sources":["../../../../../src/auto-generated/AccordionGroup.ts"],"sourcesContent":["/* prettier-ignore */\n/* This file is auto-generated with the remote-components-generator */\nimport { createFlowRemoteComponent } from \"@/lib/createFlowRemoteComponent\";\nimport type { FlowRemoteVueComponent } from \"@/lib/types\";\nimport { RemoteAccordionGroupElement } from \"@mittwald/flow-remote-elements\";\nimport type { RemoteAccordionGroupElementProps } from \"@mittwald/flow-remote-elements\";\nexport { type RemoteAccordionGroupElementProps as AccordionGroupProps } from \"@mittwald/flow-remote-elements\";\n\nexport const AccordionGroup: FlowRemoteVueComponent<RemoteAccordionGroupElementProps> =\n createFlowRemoteComponent(\n \"flr-accordion-group\",\n \"AccordionGroup\",\n RemoteAccordionGroupElement,\n {\n booleans: [\n \"allowsMultipleExpanded\",\n \"aria-atomic\",\n \"aria-busy\",\n \"aria-checked\",\n \"aria-current\",\n \"aria-disabled\",\n \"aria-expanded\",\n \"aria-grabbed\",\n \"aria-haspopup\",\n \"aria-hidden\",\n \"aria-invalid\",\n \"aria-modal\",\n \"aria-multiline\",\n \"aria-multiselectable\",\n \"aria-pressed\",\n \"aria-readonly\",\n \"aria-required\",\n \"aria-selected\",\n \"autoFocus\",\n \"contentEditable\",\n \"defaultChecked\",\n \"draggable\",\n \"hidden\",\n \"inert\",\n \"itemScope\",\n \"separators\",\n \"spellCheck\",\n \"suppressContentEditableWarning\",\n \"suppressHydrationWarning\",\n ],\n },\n );\n"],"mappings":";;;AAQA,IAAa,iBACX,0BACE,uBACA,kBACA,6BACA,EACE,UAAU;CACR;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,EACF,CACF"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { composition } from "../lib/composition.mjs";
|
|
2
2
|
import { Accordion } from "../auto-generated/Accordion.mjs";
|
|
3
|
+
import { AccordionGroup } from "../auto-generated/AccordionGroup.mjs";
|
|
3
4
|
import { ActionGroup } from "../auto-generated/ActionGroup.mjs";
|
|
4
5
|
import { Button } from "../auto-generated/Button.mjs";
|
|
5
6
|
import { Checkbox } from "../auto-generated/Checkbox.mjs";
|
|
@@ -173,7 +174,7 @@ var AllFiltersModal = defineComponent({
|
|
|
173
174
|
controller
|
|
174
175
|
}, () => [
|
|
175
176
|
h(Heading, null, () => format("filters.all")),
|
|
176
|
-
h(Content, null, () => h(Section, null, () => accordions)),
|
|
177
|
+
h(Content, null, () => h(Section, null, () => h(AccordionGroup, null, () => accordions))),
|
|
177
178
|
h(ActionGroup, null, () => [h(Button, { onPress: () => controller.close() }, () => h(Text, null, () => isInitiallyLoading.value ? h(SkeletonText, { width: "16ch" }) : showCount)), h(Button, {
|
|
178
179
|
color: "secondary",
|
|
179
180
|
variant: "soft",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AllFiltersModal.mjs","names":[],"sources":["../../../../../src/list/AllFiltersModal.ts"],"sourcesContent":["import {\n Accordion,\n ActionGroup,\n Button,\n Checkbox,\n CheckboxGroup,\n Content,\n Flex,\n Heading,\n Radio,\n RadioGroup,\n RangeCalendar,\n Section,\n SkeletonText,\n Text,\n} from \"@/auto-generated\";\nimport { IconFilter } from \"@/icons\";\nimport { watchMobxValue } from \"@/lib/mobxSelector\";\nimport { Modal } from \"@/overlays/Modal\";\nimport { createOverlayController } from \"@/overlays/overlayController\";\nimport { ModalTrigger } from \"@/overlays/triggers\";\nimport { defineComponent, h, type VNodeChild } from \"vue\";\nimport { isDateRangeFilter } from \"./dateRangeFilter\";\nimport { injectListModel, type AnyListModel } from \"./listContext\";\nimport { useListTexts, type ListTextFormatter } from \"./locales\";\nimport { listStyles } from \"./styles\";\nimport type { ListRendered } from \"./types\";\nimport { composition } from \"@/lib/composition\";\n\n/*\n * What this modal needs of a filter and a sorting. Not the classes: a list of\n * concrete filters is not assignable to a list of generic ones — a row model\n * sits in a contravariant position deep inside `Column`.\n */\ninterface ModalFilterValue {\n readonly id: string;\n readonly isActive: boolean;\n toggle(): void;\n render(): ListRendered;\n}\n\ninterface ModalFilter {\n readonly name?: string;\n readonly property: unknown;\n readonly mode: string;\n readonly priority: \"primary\" | \"secondary\";\n readonly values: ModalFilterValue[];\n readonly isSelectAllAvailable: boolean;\n isActive(): boolean;\n isEveryValueActive(): boolean;\n selectAll(): void;\n deselectAll(): void;\n clear(): void;\n}\n\ninterface ModalSorting {\n readonly id: string;\n readonly name?: string;\n readonly property: unknown;\n readonly directionName?: string;\n isSorted(): boolean;\n enable(): void;\n}\n\nconst accordion = (\n key: string,\n heading: string,\n expanded: boolean,\n content: () => VNodeChild,\n): VNodeChild =>\n h(Accordion, { key, defaultExpanded: expanded }, () => [\n h(Heading, null, () => heading),\n h(Content, null, content),\n ]);\n\ninterface ModalDateRangeFilter {\n readonly name?: string;\n readonly property: unknown;\n readonly dateRangeOptions?: Record<string, unknown>;\n getValue(): unknown;\n setValue(range: unknown): void;\n clear(): void;\n}\n\nconst renderDateRangeAccordion = (\n filter: ModalDateRangeFilter,\n expanded: boolean,\n texts: ListTextFormatter,\n): VNodeChild => {\n const name = filter.name ?? String(filter.property);\n const value = filter.getValue();\n\n return accordion(`filter-${name}`, name, expanded, () =>\n h(Flex, { direction: \"column\", gap: \"m\" }, () => [\n h(RangeCalendar, {\n ...filter.dateRangeOptions,\n value,\n onChange: (range: unknown) => filter.setValue(range),\n } as never),\n value\n ? h(\n Button,\n {\n size: \"s\",\n color: \"secondary\",\n variant: \"soft\",\n onPress: () => filter.clear(),\n },\n () => texts(\"filters.clearSelection\"),\n )\n : null,\n ]),\n );\n};\n\n/*\n * Flow's `FilterAccordionCheckboxGroup`: outside the checkbox group, so it is\n * not one of the values, and indeterminate while only some of them are on.\n */\nconst renderSelectAllCheckbox = (\n filter: ModalFilter,\n texts: ListTextFormatter,\n): VNodeChild => {\n const isEveryValueActive = filter.isEveryValueActive();\n\n return h(\n Checkbox,\n {\n key: \"select-all\",\n class: listStyles.selectAllCheckbox,\n isSelected: isEveryValueActive,\n isIndeterminate: filter.isActive() && !isEveryValueActive,\n onChange: () =>\n isEveryValueActive ? filter.deselectAll() : filter.selectAll(),\n },\n () =>\n texts(isEveryValueActive ? \"filters.deselectAll\" : \"filters.selectAll\"),\n );\n};\n\nconst renderFilterAccordion = (\n filter: ModalFilter,\n expanded: boolean,\n texts: ListTextFormatter,\n): VNodeChild => {\n const name = filter.name ?? String(filter.property);\n const activeIds = filter.values.filter((v) => v.isActive).map((v) => v.id);\n\n const content = (): VNodeChild =>\n filter.mode === \"one\"\n ? h(Flex, { direction: \"column\", gap: \"m\" }, () => [\n h(\n RadioGroup,\n {\n /*\n * Keyed on the selection, like Flow's: the group is controlled\n * and only remounting makes it pick up a value that changed from\n * outside — a chip removed, a reset.\n */\n key: activeIds[0],\n value: activeIds[0],\n m: [1, 1],\n \"aria-label\": name,\n },\n () =>\n filter.values.map((value) =>\n h(\n Radio,\n {\n key: value.id,\n value: value.id,\n onPress: () => {\n if (!value.isActive) {\n value.toggle();\n }\n },\n },\n () => value.render(),\n ),\n ),\n ),\n activeIds.length > 0\n ? h(\n Button,\n {\n size: \"s\",\n color: \"secondary\",\n variant: \"soft\",\n onPress: () => filter.clear(),\n },\n () => texts(\"filters.clearSelection\"),\n )\n : null,\n ])\n : [\n filter.isSelectAllAvailable\n ? renderSelectAllCheckbox(filter, texts)\n : null,\n h(\n CheckboxGroup,\n { value: activeIds, m: [1, 1], \"aria-label\": name },\n () =>\n filter.values.map((value) =>\n h(\n Checkbox,\n {\n key: value.id,\n value: value.id,\n onPress: () => value.toggle(),\n },\n () => value.render(),\n ),\n ),\n ),\n ];\n\n return accordion(`filter-${name}`, name, expanded, content);\n};\n\nconst renderSortingAccordion = (\n sortings: ModalSorting[],\n expanded: boolean,\n texts: ListTextFormatter,\n): VNodeChild => {\n const active = sortings.find((s) => s.isSorted());\n\n return accordion(\"sorting\", texts(\"sorting\"), expanded, () =>\n h(RadioGroup, { value: active?.id, m: [1, 1] }, () =>\n sortings.map((sorting) =>\n h(\n Radio,\n {\n key: sorting.id,\n value: sorting.id,\n onPress: () => sorting.enable(),\n },\n () =>\n `${sorting.name ?? String(sorting.property)} ${sorting.directionName ?? \"\"}`.trim(),\n ),\n ),\n ),\n );\n};\n\nconst renderViewModeAccordion = (\n list: AnyListModel,\n modes: (\"list\" | \"table\" | \"tiles\")[],\n selected: \"list\" | \"table\" | \"tiles\",\n expanded: boolean,\n texts: ListTextFormatter,\n): VNodeChild =>\n accordion(\"viewMode\", texts(\"settings.viewMode\"), expanded, () =>\n h(RadioGroup, { value: selected, m: [1, 1] }, () =>\n modes.map((mode) =>\n h(\n Radio,\n { key: mode, value: mode, onPress: () => list.viewMode.set(mode) },\n () => texts(`settings.viewMode.${mode}`),\n ),\n ),\n ),\n );\n\n/**\n * Every filter, sorting and view mode in one off-canvas modal.\n *\n * The mobile path to what the header shows as separate menus on desktop — and\n * on desktop too, where a list has secondary filters that the header leaves\n * out. It drives the same model objects, so a value ticked here is the same\n * event as one ticked in a menu.\n */\nexport const AllFiltersModal = defineComponent({\n name: \"ListAllFiltersModal\",\n\n props: {\n isDisabled: { type: Boolean, default: false },\n /** The layouts this list can show, from the header. */\n viewModes: {\n type: Array as () => (\"list\" | \"table\" | \"tiles\")[],\n default: () => [],\n },\n },\n\n setup(props) {\n const list = injectListModel();\n const texts = useListTexts();\n const controller = createOverlayController();\n\n const isInitiallyLoading = watchMobxValue(\n () => list.loaderState.isInitiallyLoading,\n );\n const viewMode = watchMobxValue(() => list.viewMode.value);\n const totalItemCount = watchMobxValue(() => {\n void list.listTable.revision;\n return list.batches.getTotalItemsCount();\n });\n /* Every value below is read off the table's filter and sorting state. */\n const tableRevision = watchMobxValue(() => list.listTable.revision);\n\n return () => {\n void tableRevision.value;\n\n const format = texts.value;\n const filters = list.filters as unknown as ModalFilter[];\n const sortings = list.visibleSorting as unknown as ModalSorting[];\n const modes = props.viewModes;\n\n const accordionCount =\n (modes.length > 1 ? 1 : 0) +\n (sortings.length > 0 ? 1 : 0) +\n filters.length;\n\n if (accordionCount === 0) {\n return null;\n }\n\n /* Two or fewer open by default — more than that is a wall of controls. */\n const expanded = accordionCount <= 2;\n\n const accordions: VNodeChild[] = [\n modes.length > 1\n ? renderViewModeAccordion(\n list,\n modes,\n viewMode.value,\n expanded,\n format,\n )\n : null,\n sortings.length > 0\n ? renderSortingAccordion(sortings, expanded, format)\n : null,\n ...filters.map((filter) =>\n isDateRangeFilter(filter)\n ? renderDateRangeAccordion(\n filter as unknown as ModalDateRangeFilter,\n expanded,\n format,\n )\n : renderFilterAccordion(filter, expanded, format),\n ),\n ];\n\n const hasSecondaryFilters = filters.some(\n (filter) => filter.priority === \"secondary\",\n );\n\n const showCount = format(\n totalItemCount.value === 1 ? \"results.show.one\" : \"results.show.other\",\n { totalItemCount: totalItemCount.value },\n );\n\n return h(ModalTrigger, { controller }, () => [\n h(\n Button,\n {\n class: [\n listStyles.hideOnMobile,\n hasSecondaryFilters ? undefined : listStyles.hideOnDesktop,\n ]\n .filter(Boolean)\n .join(\" \"),\n variant: \"outline\",\n color: \"secondary\",\n isDisabled: props.isDisabled,\n },\n () => [h(Text, null, () => format(\"filters.all\")), h(IconFilter)],\n ),\n\n h(\n Button,\n {\n class: listStyles.hideOnDesktop,\n variant: \"outline\",\n color: \"secondary\",\n \"aria-label\": format(\"filters.all\"),\n },\n () => h(IconFilter),\n ),\n\n h(Modal, { offCanvas: true, controller }, () => [\n h(Heading, null, () => format(\"filters.all\")),\n h(Content, null, () => h(Section, null, () => accordions)),\n h(ActionGroup, null, () => [\n h(Button, { onPress: () => controller.close() }, () =>\n h(Text, null, () =>\n isInitiallyLoading.value\n ? h(SkeletonText, { width: \"16ch\" })\n : showCount,\n ),\n ),\n h(\n Button,\n {\n color: \"secondary\",\n variant: \"soft\",\n onPress: () => {\n list.resetFilters();\n controller.close();\n },\n },\n () => format(\"reset\"),\n ),\n ]),\n ]),\n ]);\n };\n },\n});\n\ncomposition(AllFiltersModal);\n\nexport default AllFiltersModal;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAgEA,IAAM,aACJ,KACA,SACA,UACA,YAEA,EAAE,WAAW;CAAE;CAAK,iBAAiB;AAAS,SAAS,CACrD,EAAE,SAAS,YAAY,OAAO,GAC9B,EAAE,SAAS,MAAM,OAAO,CAC1B,CAAC;AAWH,IAAM,4BACJ,QACA,UACA,UACe;CACf,MAAM,OAAO,OAAO,QAAQ,OAAO,OAAO,QAAQ;CAClD,MAAM,QAAQ,OAAO,SAAS;CAE9B,OAAO,UAAU,UAAU,QAAQ,MAAM,gBACvC,EAAE,MAAM;EAAE,WAAW;EAAU,KAAK;CAAI,SAAS,CAC/C,EAAE,eAAe;EACf,GAAG,OAAO;EACV;EACA,WAAW,UAAmB,OAAO,SAAS,KAAK;CACrD,CAAU,GACV,QACI,EACE,QAC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,SAAS,YAAY,OAAO,aAAa,CAAC;KAC5C,EAAE,SAAS,YAAY,EAAE,SAAS,YAAY,UAAU,CAAC;KACzD,EAAE,aAAa,YAAY,CACzB,EAAE,QAAQ,EAAE,eAAe,WAAW,MAAM,EAAE,SAC5C,EAAE,MAAM,YACN,mBAAmB,QACf,EAAE,cAAc,EAAE,OAAO,OAAO,CAAC,IACjC,SACN,CACF,GACA,EACE,QACA;MACE,OAAO;MACP,SAAS;MACT,eAAe;OACb,KAAK,aAAa;OAClB,WAAW,MAAM;MACnB;KACF,SACM,OAAO,OAAO,CACtB,CACF,CAAC;IACH,CAAC;GACH,CAAC;EACH;CACF;AACF,CAAC;AAED,YAAY,eAAe"}
|
|
1
|
+
{"version":3,"file":"AllFiltersModal.mjs","names":[],"sources":["../../../../../src/list/AllFiltersModal.ts"],"sourcesContent":["import {\n Accordion,\n AccordionGroup,\n ActionGroup,\n Button,\n Checkbox,\n CheckboxGroup,\n Content,\n Flex,\n Heading,\n Radio,\n RadioGroup,\n RangeCalendar,\n Section,\n SkeletonText,\n Text,\n} from \"@/auto-generated\";\nimport { IconFilter } from \"@/icons\";\nimport { watchMobxValue } from \"@/lib/mobxSelector\";\nimport { Modal } from \"@/overlays/Modal\";\nimport { createOverlayController } from \"@/overlays/overlayController\";\nimport { ModalTrigger } from \"@/overlays/triggers\";\nimport { defineComponent, h, type VNodeChild } from \"vue\";\nimport { isDateRangeFilter } from \"./dateRangeFilter\";\nimport { injectListModel, type AnyListModel } from \"./listContext\";\nimport { useListTexts, type ListTextFormatter } from \"./locales\";\nimport { listStyles } from \"./styles\";\nimport type { ListRendered } from \"./types\";\nimport { composition } from \"@/lib/composition\";\n\n/*\n * What this modal needs of a filter and a sorting. Not the classes: a list of\n * concrete filters is not assignable to a list of generic ones — a row model\n * sits in a contravariant position deep inside `Column`.\n */\ninterface ModalFilterValue {\n readonly id: string;\n readonly isActive: boolean;\n toggle(): void;\n render(): ListRendered;\n}\n\ninterface ModalFilter {\n readonly name?: string;\n readonly property: unknown;\n readonly mode: string;\n readonly priority: \"primary\" | \"secondary\";\n readonly values: ModalFilterValue[];\n readonly isSelectAllAvailable: boolean;\n isActive(): boolean;\n isEveryValueActive(): boolean;\n selectAll(): void;\n deselectAll(): void;\n clear(): void;\n}\n\ninterface ModalSorting {\n readonly id: string;\n readonly name?: string;\n readonly property: unknown;\n readonly directionName?: string;\n isSorted(): boolean;\n enable(): void;\n}\n\nconst accordion = (\n key: string,\n heading: string,\n expanded: boolean,\n content: () => VNodeChild,\n): VNodeChild =>\n h(Accordion, { key, defaultExpanded: expanded }, () => [\n h(Heading, null, () => heading),\n h(Content, null, content),\n ]);\n\ninterface ModalDateRangeFilter {\n readonly name?: string;\n readonly property: unknown;\n readonly dateRangeOptions?: Record<string, unknown>;\n getValue(): unknown;\n setValue(range: unknown): void;\n clear(): void;\n}\n\nconst renderDateRangeAccordion = (\n filter: ModalDateRangeFilter,\n expanded: boolean,\n texts: ListTextFormatter,\n): VNodeChild => {\n const name = filter.name ?? String(filter.property);\n const value = filter.getValue();\n\n return accordion(`filter-${name}`, name, expanded, () =>\n h(Flex, { direction: \"column\", gap: \"m\" }, () => [\n h(RangeCalendar, {\n ...filter.dateRangeOptions,\n value,\n onChange: (range: unknown) => filter.setValue(range),\n } as never),\n value\n ? h(\n Button,\n {\n size: \"s\",\n color: \"secondary\",\n variant: \"soft\",\n onPress: () => filter.clear(),\n },\n () => texts(\"filters.clearSelection\"),\n )\n : null,\n ]),\n );\n};\n\n/*\n * Flow's `FilterAccordionCheckboxGroup`: outside the checkbox group, so it is\n * not one of the values, and indeterminate while only some of them are on.\n */\nconst renderSelectAllCheckbox = (\n filter: ModalFilter,\n texts: ListTextFormatter,\n): VNodeChild => {\n const isEveryValueActive = filter.isEveryValueActive();\n\n return h(\n Checkbox,\n {\n key: \"select-all\",\n class: listStyles.selectAllCheckbox,\n isSelected: isEveryValueActive,\n isIndeterminate: filter.isActive() && !isEveryValueActive,\n onChange: () =>\n isEveryValueActive ? filter.deselectAll() : filter.selectAll(),\n },\n () =>\n texts(isEveryValueActive ? \"filters.deselectAll\" : \"filters.selectAll\"),\n );\n};\n\nconst renderFilterAccordion = (\n filter: ModalFilter,\n expanded: boolean,\n texts: ListTextFormatter,\n): VNodeChild => {\n const name = filter.name ?? String(filter.property);\n const activeIds = filter.values.filter((v) => v.isActive).map((v) => v.id);\n\n const content = (): VNodeChild =>\n filter.mode === \"one\"\n ? h(Flex, { direction: \"column\", gap: \"m\" }, () => [\n h(\n RadioGroup,\n {\n /*\n * Keyed on the selection, like Flow's: the group is controlled\n * and only remounting makes it pick up a value that changed from\n * outside — a chip removed, a reset.\n */\n key: activeIds[0],\n value: activeIds[0],\n m: [1, 1],\n \"aria-label\": name,\n },\n () =>\n filter.values.map((value) =>\n h(\n Radio,\n {\n key: value.id,\n value: value.id,\n onPress: () => {\n if (!value.isActive) {\n value.toggle();\n }\n },\n },\n () => value.render(),\n ),\n ),\n ),\n activeIds.length > 0\n ? h(\n Button,\n {\n size: \"s\",\n color: \"secondary\",\n variant: \"soft\",\n onPress: () => filter.clear(),\n },\n () => texts(\"filters.clearSelection\"),\n )\n : null,\n ])\n : [\n filter.isSelectAllAvailable\n ? renderSelectAllCheckbox(filter, texts)\n : null,\n h(\n CheckboxGroup,\n { value: activeIds, m: [1, 1], \"aria-label\": name },\n () =>\n filter.values.map((value) =>\n h(\n Checkbox,\n {\n key: value.id,\n value: value.id,\n onPress: () => value.toggle(),\n },\n () => value.render(),\n ),\n ),\n ),\n ];\n\n return accordion(`filter-${name}`, name, expanded, content);\n};\n\nconst renderSortingAccordion = (\n sortings: ModalSorting[],\n expanded: boolean,\n texts: ListTextFormatter,\n): VNodeChild => {\n const active = sortings.find((s) => s.isSorted());\n\n return accordion(\"sorting\", texts(\"sorting\"), expanded, () =>\n h(RadioGroup, { value: active?.id, m: [1, 1] }, () =>\n sortings.map((sorting) =>\n h(\n Radio,\n {\n key: sorting.id,\n value: sorting.id,\n onPress: () => sorting.enable(),\n },\n () =>\n `${sorting.name ?? String(sorting.property)} ${sorting.directionName ?? \"\"}`.trim(),\n ),\n ),\n ),\n );\n};\n\nconst renderViewModeAccordion = (\n list: AnyListModel,\n modes: (\"list\" | \"table\" | \"tiles\")[],\n selected: \"list\" | \"table\" | \"tiles\",\n expanded: boolean,\n texts: ListTextFormatter,\n): VNodeChild =>\n accordion(\"viewMode\", texts(\"settings.viewMode\"), expanded, () =>\n h(RadioGroup, { value: selected, m: [1, 1] }, () =>\n modes.map((mode) =>\n h(\n Radio,\n { key: mode, value: mode, onPress: () => list.viewMode.set(mode) },\n () => texts(`settings.viewMode.${mode}`),\n ),\n ),\n ),\n );\n\n/**\n * Every filter, sorting and view mode in one off-canvas modal.\n *\n * The mobile path to what the header shows as separate menus on desktop — and\n * on desktop too, where a list has secondary filters that the header leaves\n * out. It drives the same model objects, so a value ticked here is the same\n * event as one ticked in a menu.\n */\nexport const AllFiltersModal = defineComponent({\n name: \"ListAllFiltersModal\",\n\n props: {\n isDisabled: { type: Boolean, default: false },\n /** The layouts this list can show, from the header. */\n viewModes: {\n type: Array as () => (\"list\" | \"table\" | \"tiles\")[],\n default: () => [],\n },\n },\n\n setup(props) {\n const list = injectListModel();\n const texts = useListTexts();\n const controller = createOverlayController();\n\n const isInitiallyLoading = watchMobxValue(\n () => list.loaderState.isInitiallyLoading,\n );\n const viewMode = watchMobxValue(() => list.viewMode.value);\n const totalItemCount = watchMobxValue(() => {\n void list.listTable.revision;\n return list.batches.getTotalItemsCount();\n });\n /* Every value below is read off the table's filter and sorting state. */\n const tableRevision = watchMobxValue(() => list.listTable.revision);\n\n return () => {\n void tableRevision.value;\n\n const format = texts.value;\n const filters = list.filters as unknown as ModalFilter[];\n const sortings = list.visibleSorting as unknown as ModalSorting[];\n const modes = props.viewModes;\n\n const accordionCount =\n (modes.length > 1 ? 1 : 0) +\n (sortings.length > 0 ? 1 : 0) +\n filters.length;\n\n if (accordionCount === 0) {\n return null;\n }\n\n /* Two or fewer open by default — more than that is a wall of controls. */\n const expanded = accordionCount <= 2;\n\n const accordions: VNodeChild[] = [\n modes.length > 1\n ? renderViewModeAccordion(\n list,\n modes,\n viewMode.value,\n expanded,\n format,\n )\n : null,\n sortings.length > 0\n ? renderSortingAccordion(sortings, expanded, format)\n : null,\n ...filters.map((filter) =>\n isDateRangeFilter(filter)\n ? renderDateRangeAccordion(\n filter as unknown as ModalDateRangeFilter,\n expanded,\n format,\n )\n : renderFilterAccordion(filter, expanded, format),\n ),\n ];\n\n const hasSecondaryFilters = filters.some(\n (filter) => filter.priority === \"secondary\",\n );\n\n const showCount = format(\n totalItemCount.value === 1 ? \"results.show.one\" : \"results.show.other\",\n { totalItemCount: totalItemCount.value },\n );\n\n return h(ModalTrigger, { controller }, () => [\n h(\n Button,\n {\n class: [\n listStyles.hideOnMobile,\n hasSecondaryFilters ? undefined : listStyles.hideOnDesktop,\n ]\n .filter(Boolean)\n .join(\" \"),\n variant: \"outline\",\n color: \"secondary\",\n isDisabled: props.isDisabled,\n },\n () => [h(Text, null, () => format(\"filters.all\")), h(IconFilter)],\n ),\n\n h(\n Button,\n {\n class: listStyles.hideOnDesktop,\n variant: \"outline\",\n color: \"secondary\",\n \"aria-label\": format(\"filters.all\"),\n },\n () => h(IconFilter),\n ),\n\n h(Modal, { offCanvas: true, controller }, () => [\n h(Heading, null, () => format(\"filters.all\")),\n h(Content, null, () =>\n h(Section, null, () => h(AccordionGroup, null, () => accordions)),\n ),\n h(ActionGroup, null, () => [\n h(Button, { onPress: () => controller.close() }, () =>\n h(Text, null, () =>\n isInitiallyLoading.value\n ? h(SkeletonText, { width: \"16ch\" })\n : showCount,\n ),\n ),\n h(\n Button,\n {\n color: \"secondary\",\n variant: \"soft\",\n onPress: () => {\n list.resetFilters();\n controller.close();\n },\n },\n () => format(\"reset\"),\n ),\n ]),\n ]),\n ]);\n };\n },\n});\n\ncomposition(AllFiltersModal);\n\nexport default AllFiltersModal;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;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AgB,eAAe,MAAM,CACzC;GAEA,OAAO,EAAE,cAAc,EAAE,WAAW,SAAS;IAC3C,EACE,QACA;KACE,OAAO,CACL,WAAW,cACX,sBAAsB,KAAA,IAAY,WAAW,aAC/C,CAAC,CACE,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;KACX,SAAS;KACT,OAAO;KACP,YAAY,MAAM;IACpB,SACM,CAAC,EAAE,MAAM,YAAY,OAAO,aAAa,CAAC,GAAG,EAAE,UAAU,CAAC,CAClE;IAEA,EACE,QACA;KACE,OAAO,WAAW;KAClB,SAAS;KACT,OAAO;KACP,cAAc,OAAO,aAAa;IACpC,SACM,EAAE,UAAU,CACpB;IAEA,EAAE,OAAO;KAAE,WAAW;KAAM;IAAW,SAAS;KAC9C,EAAE,SAAS,YAAY,OAAO,aAAa,CAAC;KAC5C,EAAE,SAAS,YACT,EAAE,SAAS,YAAY,EAAE,gBAAgB,YAAY,UAAU,CAAC,CAClE;KACA,EAAE,aAAa,YAAY,CACzB,EAAE,QAAQ,EAAE,eAAe,WAAW,MAAM,EAAE,SAC5C,EAAE,MAAM,YACN,mBAAmB,QACf,EAAE,cAAc,EAAE,OAAO,OAAO,CAAC,IACjC,SACN,CACF,GACA,EACE,QACA;MACE,OAAO;MACP,SAAS;MACT,eAAe;OACb,KAAK,aAAa;OAClB,WAAW,MAAM;MACnB;KACF,SACM,OAAO,OAAO,CACtB,CACF,CAAC;IACH,CAAC;GACH,CAAC;EACH;CACF;AACF,CAAC;AAED,YAAY,eAAe"}
|
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
var confirmCloseTexts = {
|
|
8
8
|
"en-US": {
|
|
9
9
|
heading: "Unsaved changes",
|
|
10
|
-
text: "You have unsaved changes. Are you sure you want to close
|
|
10
|
+
text: "You have unsaved changes. Are you sure you want to close? All changes will be lost.",
|
|
11
11
|
close: "Close",
|
|
12
12
|
keepOpen: "Keep editing"
|
|
13
13
|
},
|
|
14
14
|
"de-DE": {
|
|
15
15
|
heading: "Ungespeicherte Änderungen",
|
|
16
|
-
text: "Du hast ungespeicherte Änderungen. Möchtest du
|
|
16
|
+
text: "Du hast ungespeicherte Änderungen. Möchtest du wirklich schließen? Alle Änderungen gehen dabei verloren.",
|
|
17
17
|
close: "Schließen",
|
|
18
18
|
keepOpen: "Weiter bearbeiten"
|
|
19
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locales.mjs","names":[],"sources":["../../../../../src/overlays/locales.ts"],"sourcesContent":["/*\n * The overlays' UI text, copied from Flow's locale files.\n *\n * Flow's are compiled into the React bundle by a locale plugin and are not\n * importable from a published package, so the only way a Vue binding can put\n * words on these overlays is to carry its own. A rewording on the Flow side\n * fails `src/tests/CopiedTexts.test.ts`. The generated `Modal` this layer\n * argues for would remove the copy.\n */\n\n/**\n * `Modal confirmOnClose`, from\n * `packages/components/src/components/Modal/locales/*.locale.json`. `close`\n * also labels the modal's own close button, as Flow's `close` key does.\n */\nexport const confirmCloseTexts = {\n \"en-US\": {\n heading: \"Unsaved changes\",\n text: \"You have unsaved changes. Are you sure you want to close
|
|
1
|
+
{"version":3,"file":"locales.mjs","names":[],"sources":["../../../../../src/overlays/locales.ts"],"sourcesContent":["/*\n * The overlays' UI text, copied from Flow's locale files.\n *\n * Flow's are compiled into the React bundle by a locale plugin and are not\n * importable from a published package, so the only way a Vue binding can put\n * words on these overlays is to carry its own. A rewording on the Flow side\n * fails `src/tests/CopiedTexts.test.ts`. The generated `Modal` this layer\n * argues for would remove the copy.\n */\n\n/**\n * `Modal confirmOnClose`, from\n * `packages/components/src/components/Modal/locales/*.locale.json`. `close`\n * also labels the modal's own close button, as Flow's `close` key does.\n */\nexport const confirmCloseTexts = {\n \"en-US\": {\n heading: \"Unsaved changes\",\n text: \"You have unsaved changes. Are you sure you want to close? All changes will be lost.\",\n close: \"Close\",\n keepOpen: \"Keep editing\",\n },\n \"de-DE\": {\n heading: \"Ungespeicherte Änderungen\",\n text: \"Du hast ungespeicherte Änderungen. Möchtest du wirklich schließen? Alle Änderungen gehen dabei verloren.\",\n close: \"Schließen\",\n keepOpen: \"Weiter bearbeiten\",\n },\n};\n\n/**\n * The `LightBox` close button's label, from\n * `packages/components/src/components/LightBox/locales/*.locale.json`.\n */\nexport const lightBoxCloseTexts = { \"de-DE\": \"Schließen\", \"en-US\": \"Close\" };\n"],"mappings":";;;;;;AAeA,IAAa,oBAAoB;CAC/B,SAAS;EACP,SAAS;EACT,MAAM;EACN,OAAO;EACP,UAAU;CACZ;CACA,SAAS;EACP,SAAS;EACT,MAAM;EACN,OAAO;EACP,UAAU;CACZ;AACF;;;;;AAMA,IAAa,qBAAqB;CAAE,SAAS;CAAa,SAAS;AAAQ"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Version } from "@mittwald/flow-remote-core";
|
|
2
2
|
//#region src/version.ts
|
|
3
3
|
var communicationVersion = Version.v5;
|
|
4
|
-
var packageVersion = "1.5.
|
|
4
|
+
var packageVersion = "1.5.1";
|
|
5
5
|
var version = communicationVersion;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { communicationVersion, packageVersion, version };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FlowRemoteVueComponent } from '../lib/types';
|
|
2
|
+
import { RemoteAccordionGroupElementProps } from '@mittwald/flow-remote-elements';
|
|
3
|
+
export { type RemoteAccordionGroupElementProps as AccordionGroupProps } from '@mittwald/flow-remote-elements';
|
|
4
|
+
export declare const AccordionGroup: FlowRemoteVueComponent<RemoteAccordionGroupElementProps>;
|
package/package.json
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/flow-remote-vue-components",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Vue components that can be used in a remote environment",
|
|
6
6
|
"homepage": "https://flow.mittwald.de",
|
|
7
|
-
"repository":
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "https://github.com/mittwald/flow"
|
|
10
|
-
},
|
|
7
|
+
"repository": "https://github.com/mittwald/flow",
|
|
11
8
|
"license": "MIT",
|
|
12
9
|
"sideEffects": false,
|
|
13
10
|
"exports": {
|
|
@@ -27,19 +24,42 @@
|
|
|
27
24
|
"engines": {
|
|
28
25
|
"node": ">=24.0.0"
|
|
29
26
|
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "vite build --config vite.build.config.ts",
|
|
29
|
+
"build:icons": "tsx dev/icons/generate.ts",
|
|
30
|
+
"clean": "rimraf dist src/icons/components/*",
|
|
31
|
+
"test:browser": "vitest run --project=browser --browser.headless",
|
|
32
|
+
"test:browser:dev": "vitest dev --project=browser",
|
|
33
|
+
"test:browser:prepare": "if [ -z \"$CI\" ]; then playwright install firefox webkit; fi",
|
|
34
|
+
"test:compile": "tsc --noEmit && tsc --noEmit -p tsconfig.vite.json",
|
|
35
|
+
"test:parity": "tsx dev/react-parity/run.ts",
|
|
36
|
+
"test:parity:dev": "tsx dev/react-parity/dev.ts",
|
|
37
|
+
"test:parity:list": "vitest run --config e2e/list-parity/vitest.config.ts --browser.headless",
|
|
38
|
+
"test:parity:list:dev": "vitest dev --config e2e/list-parity/vitest.config.ts",
|
|
39
|
+
"test:unit": "vitest run --project=unit*",
|
|
40
|
+
"test:unit:dev": "vitest dev --project=unit*"
|
|
41
|
+
},
|
|
30
42
|
"dependencies": {
|
|
31
43
|
"@internationalized/date": "^3.12.3",
|
|
44
|
+
"@mittwald/flow-remote-core": "1.5.1",
|
|
45
|
+
"@mittwald/flow-remote-elements": "1.5.1",
|
|
32
46
|
"@tanstack/table-core": "^8.21.3",
|
|
33
47
|
"country-codes-list": "^2.0.0",
|
|
34
48
|
"dot-prop": "^10.2.0",
|
|
35
49
|
"luxon": "^3.7.2",
|
|
36
50
|
"mobx": "^6.16.1",
|
|
37
51
|
"object-code": "^2.0.0",
|
|
38
|
-
"remeda": "^2.43.0"
|
|
39
|
-
"@mittwald/flow-remote-core": "1.5.0-next.35",
|
|
40
|
-
"@mittwald/flow-remote-elements": "1.5.0-next.35"
|
|
52
|
+
"remeda": "^2.43.0"
|
|
41
53
|
},
|
|
42
54
|
"devDependencies": {
|
|
55
|
+
"@mittwald/ext-bridge": "1.5.1",
|
|
56
|
+
"@mittwald/flow-components-base": "1.5.1",
|
|
57
|
+
"@mittwald/flow-core": "1.5.1",
|
|
58
|
+
"@mittwald/flow-icons-base": "1.5.1",
|
|
59
|
+
"@mittwald/flow-react-components": "1.5.1",
|
|
60
|
+
"@mittwald/flow-remote-react-components": "1.5.1",
|
|
61
|
+
"@mittwald/flow-remote-react-renderer": "1.5.1",
|
|
62
|
+
"@mittwald/typescript-config": "1.5.1",
|
|
43
63
|
"@quilted/threads": "^3.3.1",
|
|
44
64
|
"@types/node": "^25.9.3",
|
|
45
65
|
"@types/react": "^19.2",
|
|
@@ -56,35 +76,13 @@
|
|
|
56
76
|
"vite": "^8.2.2",
|
|
57
77
|
"vite-plugin-externalize-deps": "^0.10.0",
|
|
58
78
|
"vitest": "^4.1.11",
|
|
59
|
-
"vue": "~3.5.38"
|
|
60
|
-
"@mittwald/ext-bridge": "1.5.0-next.35",
|
|
61
|
-
"@mittwald/flow-components-base": "1.5.0-next.35",
|
|
62
|
-
"@mittwald/flow-core": "1.5.0-next.35",
|
|
63
|
-
"@mittwald/flow-icons-base": "1.5.0-next.35",
|
|
64
|
-
"@mittwald/flow-react-components": "1.5.0-next.35",
|
|
65
|
-
"@mittwald/flow-remote-react-renderer": "1.5.0-next.35",
|
|
66
|
-
"@mittwald/flow-remote-react-components": "1.5.0-next.35",
|
|
67
|
-
"@mittwald/typescript-config": "1.5.0-next.35"
|
|
79
|
+
"vue": "~3.5.38"
|
|
68
80
|
},
|
|
69
81
|
"peerDependencies": {
|
|
70
|
-
"
|
|
71
|
-
"@mittwald/
|
|
72
|
-
"
|
|
82
|
+
"@mittwald/ext-bridge": "1.5.1",
|
|
83
|
+
"@mittwald/flow-react-components": "1.5.1",
|
|
84
|
+
"vue": "^3.5.0"
|
|
73
85
|
},
|
|
74
86
|
"flowStatus": "beta",
|
|
75
|
-
"
|
|
76
|
-
|
|
77
|
-
"build:icons": "tsx dev/icons/generate.ts",
|
|
78
|
-
"clean": "rimraf dist src/icons/components/*",
|
|
79
|
-
"test:browser": "vitest run --project=browser --browser.headless",
|
|
80
|
-
"test:browser:dev": "vitest dev --project=browser",
|
|
81
|
-
"test:browser:prepare": "if [ -z \"$CI\" ]; then playwright install firefox webkit; fi",
|
|
82
|
-
"test:compile": "tsc --noEmit && tsc --noEmit -p tsconfig.vite.json",
|
|
83
|
-
"test:parity": "tsx dev/react-parity/run.ts",
|
|
84
|
-
"test:parity:dev": "tsx dev/react-parity/dev.ts",
|
|
85
|
-
"test:parity:list": "vitest run --config e2e/list-parity/vitest.config.ts --browser.headless",
|
|
86
|
-
"test:parity:list:dev": "vitest dev --config e2e/list-parity/vitest.config.ts",
|
|
87
|
-
"test:unit": "vitest run --project=unit*",
|
|
88
|
-
"test:unit:dev": "vitest dev --project=unit*"
|
|
89
|
-
}
|
|
90
|
-
}
|
|
87
|
+
"gitHead": "59e49fe7ae9c4157fc348cbc1ffcc85e9db31433"
|
|
88
|
+
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
//#region src/overlays/overlayRegistry.ts
|
|
2
|
-
/**
|
|
3
|
-
* The overlay components a trigger may contain.
|
|
4
|
-
*
|
|
5
|
-
* A trigger has to tell its trigger element (a `Button`) from the overlay it
|
|
6
|
-
* opens. React does it through the props context, which names the components it
|
|
7
|
-
* configures; here the components register themselves and the trigger asks.
|
|
8
|
-
*/
|
|
9
|
-
var overlayComponents = /* @__PURE__ */ new Set();
|
|
10
|
-
var markAsOverlay = (component) => {
|
|
11
|
-
overlayComponents.add(component);
|
|
12
|
-
return component;
|
|
13
|
-
};
|
|
14
|
-
var isOverlay = (child) => overlayComponents.has(child.type);
|
|
15
|
-
//#endregion
|
|
16
|
-
export { isOverlay, markAsOverlay };
|
|
17
|
-
|
|
18
|
-
//# sourceMappingURL=overlayRegistry.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"overlayRegistry.mjs","names":[],"sources":["../../../../../src/overlays/overlayRegistry.ts"],"sourcesContent":["import type { Component, VNode } from \"vue\";\n\n/**\n * The overlay components a trigger may contain.\n *\n * A trigger has to tell its trigger element (a `Button`) from the overlay it\n * opens. React does it through the props context, which names the components it\n * configures; here the components register themselves and the trigger asks.\n */\nconst overlayComponents = new Set<Component>();\n\nexport const markAsOverlay = <T extends Component>(component: T): T => {\n overlayComponents.add(component);\n return component;\n};\n\nexport const isOverlay = (child: VNode): boolean =>\n overlayComponents.has(child.type as Component);\n"],"mappings":";;;;;;;;AASA,IAAM,oCAAoB,IAAI,IAAe;AAE7C,IAAa,iBAAsC,cAAoB;CACrE,kBAAkB,IAAI,SAAS;CAC/B,OAAO;AACT;AAEA,IAAa,aAAa,UACxB,kBAAkB,IAAI,MAAM,IAAiB"}
|