@cratis/scene.blueprint.default 4.32.0 → 4.33.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.
Files changed (122) hide show
  1. package/ComponentName.ts +12 -0
  2. package/defaultBlueprintComponents.ts +5 -1
  3. package/dist/cjs/ComponentName.js +4 -0
  4. package/dist/cjs/ComponentName.js.map +1 -1
  5. package/dist/cjs/defaultBlueprint.js +1 -1
  6. package/dist/cjs/defaultBlueprintComponentMetadata.js +2 -2
  7. package/dist/cjs/defaultBlueprintComponents.js +10 -2
  8. package/dist/cjs/defaultBlueprintComponents.js.map +1 -1
  9. package/dist/cjs/foundation/ChartWrapper.js +520 -0
  10. package/dist/cjs/foundation/ChartWrapper.js.map +1 -0
  11. package/dist/cjs/foundation/ColumnChooser.js +156 -0
  12. package/dist/cjs/foundation/ColumnChooser.js.map +1 -0
  13. package/dist/cjs/foundation/FilterBuilder.js +307 -0
  14. package/dist/cjs/foundation/FilterBuilder.js.map +1 -0
  15. package/dist/cjs/foundation/SavedViewsMenu.js +199 -0
  16. package/dist/cjs/foundation/SavedViewsMenu.js.map +1 -0
  17. package/dist/cjs/foundation/chartGeometry.js +101 -0
  18. package/dist/cjs/foundation/chartGeometry.js.map +1 -0
  19. package/dist/cjs/foundation/columnModel.js +43 -0
  20. package/dist/cjs/foundation/columnModel.js.map +1 -0
  21. package/dist/cjs/foundation/filterModel.js +123 -0
  22. package/dist/cjs/foundation/filterModel.js.map +1 -0
  23. package/dist/cjs/foundation/foundationComponentMetadata.js +28 -0
  24. package/dist/cjs/foundation/foundationComponentMetadata.js.map +1 -1
  25. package/dist/cjs/foundation/foundationDescriptors.js +153 -0
  26. package/dist/cjs/foundation/foundationDescriptors.js.map +1 -1
  27. package/dist/cjs/foundation/foundationSamples.js +130 -0
  28. package/dist/cjs/foundation/foundationSamples.js.map +1 -1
  29. package/dist/cjs/foundation/foundationStrings.js +25 -0
  30. package/dist/cjs/foundation/foundationStrings.js.map +1 -1
  31. package/dist/cjs/foundation/useElementWidth.js +31 -0
  32. package/dist/cjs/foundation/useElementWidth.js.map +1 -0
  33. package/dist/cjs/foundation/viewModel.js +24 -0
  34. package/dist/cjs/foundation/viewModel.js.map +1 -0
  35. package/dist/cjs/index.js +38 -0
  36. package/dist/cjs/index.js.map +1 -1
  37. package/dist/esm/ComponentName.d.ts +5 -1
  38. package/dist/esm/ComponentName.d.ts.map +1 -1
  39. package/dist/esm/ComponentName.js +4 -0
  40. package/dist/esm/ComponentName.js.map +1 -1
  41. package/dist/esm/defaultBlueprint.js +1 -1
  42. package/dist/esm/defaultBlueprintComponentMetadata.js +2 -2
  43. package/dist/esm/defaultBlueprintComponents.d.ts.map +1 -1
  44. package/dist/esm/defaultBlueprintComponents.js +10 -2
  45. package/dist/esm/defaultBlueprintComponents.js.map +1 -1
  46. package/dist/esm/foundation/ChartWrapper.d.ts +5 -0
  47. package/dist/esm/foundation/ChartWrapper.d.ts.map +1 -0
  48. package/dist/esm/foundation/ChartWrapper.js +517 -0
  49. package/dist/esm/foundation/ChartWrapper.js.map +1 -0
  50. package/dist/esm/foundation/ColumnChooser.d.ts +3 -0
  51. package/dist/esm/foundation/ColumnChooser.d.ts.map +1 -0
  52. package/dist/esm/foundation/ColumnChooser.js +154 -0
  53. package/dist/esm/foundation/ColumnChooser.js.map +1 -0
  54. package/dist/esm/foundation/FilterBuilder.d.ts +3 -0
  55. package/dist/esm/foundation/FilterBuilder.d.ts.map +1 -0
  56. package/dist/esm/foundation/FilterBuilder.js +305 -0
  57. package/dist/esm/foundation/FilterBuilder.js.map +1 -0
  58. package/dist/esm/foundation/Foundation.stories.d.ts +16 -0
  59. package/dist/esm/foundation/Foundation.stories.d.ts.map +1 -1
  60. package/dist/esm/foundation/Foundation.stories.js +16 -0
  61. package/dist/esm/foundation/Foundation.stories.js.map +1 -1
  62. package/dist/esm/foundation/SavedViewsMenu.d.ts +4 -0
  63. package/dist/esm/foundation/SavedViewsMenu.d.ts.map +1 -0
  64. package/dist/esm/foundation/SavedViewsMenu.js +196 -0
  65. package/dist/esm/foundation/SavedViewsMenu.js.map +1 -0
  66. package/dist/esm/foundation/chartGeometry.d.ts +34 -0
  67. package/dist/esm/foundation/chartGeometry.d.ts.map +1 -0
  68. package/dist/esm/foundation/chartGeometry.js +93 -0
  69. package/dist/esm/foundation/chartGeometry.js.map +1 -0
  70. package/dist/esm/foundation/columnModel.d.ts +11 -0
  71. package/dist/esm/foundation/columnModel.d.ts.map +1 -0
  72. package/dist/esm/foundation/columnModel.js +38 -0
  73. package/dist/esm/foundation/columnModel.js.map +1 -0
  74. package/dist/esm/foundation/filterModel.d.ts +33 -0
  75. package/dist/esm/foundation/filterModel.d.ts.map +1 -0
  76. package/dist/esm/foundation/filterModel.js +112 -0
  77. package/dist/esm/foundation/filterModel.js.map +1 -0
  78. package/dist/esm/foundation/foundationComponentMetadata.d.ts.map +1 -1
  79. package/dist/esm/foundation/foundationComponentMetadata.js +28 -0
  80. package/dist/esm/foundation/foundationComponentMetadata.js.map +1 -1
  81. package/dist/esm/foundation/foundationDescriptors.d.ts.map +1 -1
  82. package/dist/esm/foundation/foundationDescriptors.js +154 -1
  83. package/dist/esm/foundation/foundationDescriptors.js.map +1 -1
  84. package/dist/esm/foundation/foundationSamples.d.ts.map +1 -1
  85. package/dist/esm/foundation/foundationSamples.js +130 -0
  86. package/dist/esm/foundation/foundationSamples.js.map +1 -1
  87. package/dist/esm/foundation/foundationStrings.d.ts +25 -0
  88. package/dist/esm/foundation/foundationStrings.d.ts.map +1 -1
  89. package/dist/esm/foundation/foundationStrings.js +25 -0
  90. package/dist/esm/foundation/foundationStrings.js.map +1 -1
  91. package/dist/esm/foundation/index.d.ts +9 -0
  92. package/dist/esm/foundation/index.d.ts.map +1 -1
  93. package/dist/esm/foundation/index.js +9 -0
  94. package/dist/esm/foundation/index.js.map +1 -1
  95. package/dist/esm/foundation/useElementWidth.d.ts +3 -0
  96. package/dist/esm/foundation/useElementWidth.d.ts.map +1 -0
  97. package/dist/esm/foundation/useElementWidth.js +29 -0
  98. package/dist/esm/foundation/useElementWidth.js.map +1 -0
  99. package/dist/esm/foundation/viewModel.d.ts +7 -0
  100. package/dist/esm/foundation/viewModel.d.ts.map +1 -0
  101. package/dist/esm/foundation/viewModel.js +22 -0
  102. package/dist/esm/foundation/viewModel.js.map +1 -0
  103. package/dist/esm/index.js +9 -0
  104. package/dist/esm/index.js.map +1 -1
  105. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  106. package/foundation/ChartWrapper.tsx +252 -0
  107. package/foundation/ColumnChooser.tsx +73 -0
  108. package/foundation/FilterBuilder.tsx +144 -0
  109. package/foundation/Foundation.stories.tsx +16 -0
  110. package/foundation/SavedViewsMenu.tsx +94 -0
  111. package/foundation/chartGeometry.ts +108 -0
  112. package/foundation/columnModel.ts +39 -0
  113. package/foundation/filterModel.ts +111 -0
  114. package/foundation/foundationComponentMetadata.ts +4 -0
  115. package/foundation/foundationDescriptors.ts +86 -1
  116. package/foundation/foundationSamples.ts +19 -0
  117. package/foundation/foundationStrings.ts +25 -0
  118. package/foundation/index.ts +9 -0
  119. package/foundation/useElementWidth.ts +31 -0
  120. package/foundation/viewModel.ts +21 -0
  121. package/package.json +8 -8
  122. package/shell/layout.css +285 -0
@@ -0,0 +1,154 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { useMemo, useState, useId, useRef, useEffect } from 'react';
3
+ import { useValueOutput } from '@cratis/scene.react';
4
+ import { readColumns, visibleColumnIds, toggleColumn, moveColumn } from './columnModel.js';
5
+ import { readComponentState, ComponentState } from './ComponentState.js';
6
+ import { FoundationIcon } from './FoundationIcon.js';
7
+ import { readFoundationStrings, formatText } from './foundationStrings.js';
8
+ import { FoundationFrame } from './StateFrame.js';
9
+
10
+ /**
11
+ * The `columnChooser` component: which columns a table shows, and in what order.
12
+ *
13
+ * `columns` lists what could be shown (id, label, whether it starts visible, and whether it is locked - the identifying column is). The
14
+ * chooser is a button that discloses a list of checkboxes; each row also has move up and move down buttons, so ordering needs no
15
+ * drag-and-drop. Its `value` output is the ordered list of visible ids, which the table binds its columns to. Escape closes the list and
16
+ * returns focus to the button.
17
+ */ function ColumnChooser({ element, interactions, bindingOutputs }) {
18
+ const supplied = useMemo(()=>readColumns(element.properties.columns), [
19
+ element.properties.columns
20
+ ]);
21
+ const suppliedKey = JSON.stringify(supplied);
22
+ const [columns, setColumns] = useState(supplied);
23
+ const [open, setOpen] = useState(false);
24
+ const strings = readFoundationStrings(element);
25
+ const state = readComponentState(element, supplied.length > 0);
26
+ const panelId = useId();
27
+ const button = useRef(null);
28
+ useEffect(()=>setColumns(supplied), [
29
+ suppliedKey
30
+ ]);
31
+ useValueOutput(bindingOutputs, visibleColumnIds(columns));
32
+ const apply = (next)=>{
33
+ setColumns(next);
34
+ interactions?.onChange?.();
35
+ };
36
+ const close = (event)=>{
37
+ if (event.key !== 'Escape' || !open) return;
38
+ setOpen(false);
39
+ button.current?.focus();
40
+ };
41
+ return /*#__PURE__*/ jsx(FoundationFrame, {
42
+ element: element,
43
+ interactions: interactions,
44
+ name: "column-chooser",
45
+ state: state,
46
+ skeleton: [
47
+ 50
48
+ ],
49
+ children: state !== ComponentState.Loading && /*#__PURE__*/ jsxs("div", {
50
+ className: "foundation-popover-host",
51
+ onKeyDown: close,
52
+ children: [
53
+ /*#__PURE__*/ jsxs("button", {
54
+ ref: button,
55
+ type: "button",
56
+ className: "foundation-button",
57
+ "data-emphasis": "secondary",
58
+ "aria-expanded": open,
59
+ "aria-controls": panelId,
60
+ onClick: ()=>setOpen(!open),
61
+ children: [
62
+ /*#__PURE__*/ jsx(FoundationIcon, {
63
+ name: "columns"
64
+ }),
65
+ /*#__PURE__*/ jsx("span", {
66
+ children: strings.columnsChoose
67
+ }),
68
+ /*#__PURE__*/ jsx("span", {
69
+ className: "foundation-count",
70
+ children: formatText(strings.columnsShown, {
71
+ shown: visibleColumnIds(columns).length,
72
+ total: columns.length
73
+ })
74
+ })
75
+ ]
76
+ }),
77
+ /*#__PURE__*/ jsxs("div", {
78
+ id: panelId,
79
+ className: "foundation-popover",
80
+ hidden: !open,
81
+ children: [
82
+ /*#__PURE__*/ jsx("ul", {
83
+ className: "foundation-list",
84
+ "aria-label": strings.columnsChoose,
85
+ children: columns.map((column, index)=>/*#__PURE__*/ jsxs("li", {
86
+ className: "foundation-list-row",
87
+ children: [
88
+ /*#__PURE__*/ jsxs("label", {
89
+ className: "foundation-check",
90
+ children: [
91
+ /*#__PURE__*/ jsx("input", {
92
+ type: "checkbox",
93
+ checked: column.visible,
94
+ disabled: column.locked,
95
+ onChange: ()=>apply(toggleColumn(columns, index))
96
+ }),
97
+ /*#__PURE__*/ jsx("span", {
98
+ children: column.label
99
+ }),
100
+ column.locked && /*#__PURE__*/ jsxs("span", {
101
+ className: "foundation-count",
102
+ children: [
103
+ "(",
104
+ strings.columnsLocked,
105
+ ")"
106
+ ]
107
+ })
108
+ ]
109
+ }),
110
+ /*#__PURE__*/ jsx("button", {
111
+ type: "button",
112
+ className: "foundation-icon-button",
113
+ disabled: index === 0,
114
+ "aria-label": formatText(strings.columnsMoveUp, {
115
+ name: column.label
116
+ }),
117
+ onClick: ()=>apply(moveColumn(columns, index, -1)),
118
+ children: /*#__PURE__*/ jsx(FoundationIcon, {
119
+ name: "arrow-up"
120
+ })
121
+ }),
122
+ /*#__PURE__*/ jsx("button", {
123
+ type: "button",
124
+ className: "foundation-icon-button",
125
+ disabled: index === columns.length - 1,
126
+ "aria-label": formatText(strings.columnsMoveDown, {
127
+ name: column.label
128
+ }),
129
+ onClick: ()=>apply(moveColumn(columns, index, 1)),
130
+ children: /*#__PURE__*/ jsx(FoundationIcon, {
131
+ name: "arrow-down"
132
+ })
133
+ })
134
+ ]
135
+ }, column.id))
136
+ }),
137
+ /*#__PURE__*/ jsx("button", {
138
+ type: "button",
139
+ className: "foundation-link",
140
+ onClick: ()=>apply(columns.map((column)=>({
141
+ ...column,
142
+ visible: true
143
+ }))),
144
+ children: strings.columnsReset
145
+ })
146
+ ]
147
+ })
148
+ ]
149
+ })
150
+ });
151
+ }
152
+
153
+ export { ColumnChooser };
154
+ //# sourceMappingURL=ColumnChooser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColumnChooser.js","sources":["../../../foundation/ColumnChooser.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 { KeyboardEvent, useEffect, useId, useMemo, useRef, useState } from 'react';\nimport { RegisteredComponentProps, useValueOutput } from '@cratis/scene.react';\nimport { ChooserColumn, moveColumn, readColumns, toggleColumn, visibleColumnIds } from './columnModel';\nimport { ComponentState, readComponentState } from './ComponentState';\nimport { FoundationIcon } from './FoundationIcon';\nimport { formatText, readFoundationStrings } from './foundationStrings';\nimport { FoundationFrame } from './StateFrame';\n\n/**\n * The `columnChooser` component: which columns a table shows, and in what order.\n *\n * `columns` lists what could be shown (id, label, whether it starts visible, and whether it is locked - the identifying column is). The\n * chooser is a button that discloses a list of checkboxes; each row also has move up and move down buttons, so ordering needs no\n * drag-and-drop. Its `value` output is the ordered list of visible ids, which the table binds its columns to. Escape closes the list and\n * returns focus to the button.\n */\nexport function ColumnChooser({ element, interactions, bindingOutputs }: RegisteredComponentProps) {\n const supplied = useMemo(() => readColumns(element.properties.columns), [element.properties.columns]);\n const suppliedKey = JSON.stringify(supplied);\n const [columns, setColumns] = useState<ChooserColumn[]>(supplied);\n const [open, setOpen] = useState(false);\n const strings = readFoundationStrings(element);\n const state = readComponentState(element, supplied.length > 0);\n const panelId = useId();\n const button = useRef<HTMLButtonElement>(null);\n\n useEffect(() => setColumns(supplied), [suppliedKey]);\n useValueOutput(bindingOutputs, visibleColumnIds(columns));\n\n const apply = (next: ChooserColumn[]) => { setColumns(next); interactions?.onChange?.(); };\n const close = (event: KeyboardEvent) => {\n if (event.key !== 'Escape' || !open) return;\n setOpen(false);\n button.current?.focus();\n };\n\n return (\n <FoundationFrame element={element} interactions={interactions} name='column-chooser' state={state} skeleton={[50]}>\n {state !== ComponentState.Loading && (\n <div className='foundation-popover-host' onKeyDown={close}>\n <button ref={button} type='button' className='foundation-button' data-emphasis='secondary' aria-expanded={open} aria-controls={panelId} onClick={() => setOpen(!open)}>\n <FoundationIcon name='columns' />\n <span>{strings.columnsChoose}</span>\n <span className='foundation-count'>{formatText(strings.columnsShown, { shown: visibleColumnIds(columns).length, total: columns.length })}</span>\n </button>\n <div id={panelId} className='foundation-popover' hidden={!open}>\n <ul className='foundation-list' aria-label={strings.columnsChoose}>\n {columns.map((column, index) => (\n <li key={column.id} className='foundation-list-row'>\n <label className='foundation-check'>\n <input type='checkbox' checked={column.visible} disabled={column.locked} onChange={() => apply(toggleColumn(columns, index))} />\n <span>{column.label}</span>\n {column.locked && <span className='foundation-count'>({strings.columnsLocked})</span>}\n </label>\n <button type='button' className='foundation-icon-button' disabled={index === 0} aria-label={formatText(strings.columnsMoveUp, { name: column.label })} onClick={() => apply(moveColumn(columns, index, -1))}>\n <FoundationIcon name='arrow-up' />\n </button>\n <button type='button' className='foundation-icon-button' disabled={index === columns.length - 1} aria-label={formatText(strings.columnsMoveDown, { name: column.label })} onClick={() => apply(moveColumn(columns, index, 1))}>\n <FoundationIcon name='arrow-down' />\n </button>\n </li>\n ))}\n </ul>\n <button type='button' className='foundation-link' onClick={() => apply(columns.map(column => ({ ...column, visible: true })))}>{strings.columnsReset}</button>\n </div>\n </div>\n )}\n </FoundationFrame>\n );\n}\n"],"names":["ColumnChooser","element","interactions","bindingOutputs","supplied","useMemo","readColumns","properties","columns","suppliedKey","JSON","stringify","setColumns","useState","open","setOpen","strings","readFoundationStrings","state","readComponentState","length","panelId","useId","button","useRef","useEffect","useValueOutput","visibleColumnIds","apply","next","onChange","close","event","key","current","focus","_jsx","FoundationFrame","name","skeleton","ComponentState","Loading","_jsxs","div","className","onKeyDown","ref","type","data-emphasis","aria-expanded","aria-controls","onClick","FoundationIcon","span","columnsChoose","formatText","columnsShown","shown","total","id","hidden","ul","aria-label","map","column","index","li","label","input","checked","visible","disabled","locked","toggleColumn","columnsLocked","columnsMoveUp","moveColumn","columnsMoveDown","columnsReset"],"mappings":";;;;;;;;;AAWA;;;;;;;IAQO,SAASA,aAAAA,CAAc,EAAEC,OAAO,EAAEC,YAAY,EAAEC,cAAc,EAA4B,EAAA;IAC7F,MAAMC,QAAAA,GAAWC,QAAQ,IAAMC,WAAAA,CAAYL,QAAQM,UAAU,CAACC,OAAO,CAAA,EAAG;QAACP,OAAAA,CAAQM,UAAU,CAACC;AAAQ,KAAA,CAAA;IACpG,MAAMC,WAAAA,GAAcC,IAAAA,CAAKC,SAAS,CAACP,QAAAA,CAAAA;AACnC,IAAA,MAAM,CAACI,OAAAA,EAASI,UAAAA,CAAW,GAAGC,QAAAA,CAA0BT,QAAAA,CAAAA;AACxD,IAAA,MAAM,CAACU,IAAAA,EAAMC,OAAAA,CAAQ,GAAGF,QAAAA,CAAS,KAAA,CAAA;AACjC,IAAA,MAAMG,UAAUC,qBAAAA,CAAsBhB,OAAAA,CAAAA;AACtC,IAAA,MAAMiB,KAAAA,GAAQC,kBAAAA,CAAmBlB,OAAAA,EAASG,QAAAA,CAASgB,MAAM,GAAG,CAAA,CAAA;AAC5D,IAAA,MAAMC,OAAAA,GAAUC,KAAAA,EAAAA;AAChB,IAAA,MAAMC,SAASC,MAAAA,CAA0B,IAAA,CAAA;IAEzCC,SAAAA,CAAU,IAAMb,WAAWR,QAAAA,CAAAA,EAAW;AAACK,QAAAA;AAAY,KAAA,CAAA;AACnDiB,IAAAA,cAAAA,CAAevB,gBAAgBwB,gBAAAA,CAAiBnB,OAAAA,CAAAA,CAAAA;AAEhD,IAAA,MAAMoB,QAAQ,CAACC,IAAAA,GAAAA;QAA4BjB,UAAAA,CAAWiB,IAAAA,CAAAA;QAAO3B,YAAAA,EAAc4B,QAAAA,IAAAA;AAAc,IAAA,CAAA;AACzF,IAAA,MAAMC,QAAQ,CAACC,KAAAA,GAAAA;AACX,QAAA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KAAAA,CAAMgD,UAAAA,CAAWpE,OAAAA,EAASyD,OAAO,EAAC,CAAA,CAAA;AACpM,4CAAA,QAAA,gBAAA7B,GAAA,CAACgB,cAAAA,EAAAA;gDAAed,IAAAA,EAAK;;;sDAEzBF,GAAA,CAACb,QAAAA,EAAAA;4CAAOwB,IAAAA,EAAK,QAAA;4CAASH,SAAAA,EAAU,wBAAA;4CAAyB2B,QAAAA,EAAUN,KAAAA,KAAUzD,OAAAA,CAAQY,MAAM,GAAG,CAAA;4CAAG0C,YAAAA,EAAYP,UAAAA,CAAWvC,OAAAA,CAAQ6D,eAAe,EAAE;AAAEvC,gDAAAA,IAAAA,EAAM0B,OAAOG;AAAM,6CAAA,CAAA;AAAIhB,4CAAAA,OAAAA,EAAS,IAAMvB,KAAAA,CAAMgD,UAAAA,CAAWpE,OAAAA,EAASyD,KAAAA,EAAO,CAAA,CAAA,CAAA;AACtN,4CAAA,QAAA,gBAAA7B,GAAA,CAACgB,cAAAA,EAAAA;gDAAed,IAAAA,EAAK;;;;AAVpB0B,iCAAAA,EAAAA,MAAAA,CAAOL,EAAE,CAAA;;sCAe1BvB,GAAA,CAACb,QAAAA,EAAAA;4BAAOwB,IAAAA,EAAK,QAAA;4BAASH,SAAAA,EAAU,iBAAA;AAAkBO,4BAAAA,OAAAA,EAAS,IAAMvB,KAAAA,CAAMpB,OAAAA,CAAQuD,GAAG,CAACC,CAAAA,UAAW;AAAE,wCAAA,GAAGA,MAAM;wCAAEM,OAAAA,EAAS;qCAAK,CAAA,CAAA,CAAA;AAAOtD,4BAAAA,QAAAA,EAAAA,OAAAA,CAAQ8D;;;;;;;AAMhK;;"}
@@ -0,0 +1,3 @@
1
+ import { RegisteredComponentProps } from '@cratis/scene.react';
2
+ export declare function FilterBuilder({ element, interactions, bindingOutputs }: RegisteredComponentProps): import("react").JSX.Element;
3
+ //# sourceMappingURL=FilterBuilder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FilterBuilder.d.ts","sourceRoot":"","sources":["../../../foundation/FilterBuilder.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAkB,MAAM,qBAAqB,CAAC;AA2G/E,wBAAgB,aAAa,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,EAAE,wBAAwB,+BAgChG"}
@@ -0,0 +1,305 @@
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import { useMemo, useState, useEffect } from 'react';
3
+ import { useValueOutput } from '@cratis/scene.react';
4
+ import { readComponentState, ComponentState } from './ComponentState.js';
5
+ import { ActionButton } from './ActionButton.js';
6
+ import { readFilterFields, normalizeFilter, countActiveConditions, emptyFilter, filterOperators, FilterFieldType, newCondition, maximumFilterDepth, updateGroupAt, valuelessOperators } from './filterModel.js';
7
+ import { readFoundationStrings, formatText } from './foundationStrings.js';
8
+ import { FoundationFrame } from './StateFrame.js';
9
+ import { readPermissionRule } from './PermissionRule.js';
10
+
11
+ const operatorText = (strings, operator)=>{
12
+ const names = {
13
+ contains: strings.opContains,
14
+ equals: strings.opEquals,
15
+ notEquals: strings.opNotEquals,
16
+ startsWith: strings.opStartsWith,
17
+ isEmpty: strings.opIsEmpty,
18
+ greater: strings.opGreater,
19
+ greaterOrEqual: strings.opGreaterOrEqual,
20
+ less: strings.opLess,
21
+ lessOrEqual: strings.opLessOrEqual,
22
+ before: strings.opBefore,
23
+ after: strings.opAfter,
24
+ on: strings.opOn,
25
+ is: strings.opIs,
26
+ isNot: strings.opIsNot,
27
+ true: strings.opTrue,
28
+ false: strings.opFalse
29
+ };
30
+ return names[operator] ?? operator;
31
+ };
32
+ function ValueInput({ field, condition, strings, label, disabled, onChange }) {
33
+ if (valuelessOperators.includes(condition.operator)) return undefined;
34
+ if (field?.type === FilterFieldType.Select) {
35
+ return /*#__PURE__*/ jsxs("select", {
36
+ "aria-label": `${strings.filterValue}, ${label}`,
37
+ value: condition.value,
38
+ disabled: disabled,
39
+ onChange: (event)=>onChange(event.target.value),
40
+ children: [
41
+ /*#__PURE__*/ jsx("option", {
42
+ value: "",
43
+ children: "—"
44
+ }),
45
+ field.options.map((option)=>/*#__PURE__*/ jsx("option", {
46
+ value: option,
47
+ children: option
48
+ }, option))
49
+ ]
50
+ });
51
+ }
52
+ return /*#__PURE__*/ jsx("input", {
53
+ "aria-label": `${strings.filterValue}, ${label}`,
54
+ type: field?.type === FilterFieldType.Number ? 'number' : field?.type === FilterFieldType.Date ? 'date' : 'text',
55
+ value: condition.value,
56
+ disabled: disabled,
57
+ onChange: (event)=>onChange(event.target.value)
58
+ });
59
+ }
60
+ function GroupEditor({ group, path, fields, strings, locked, change }) {
61
+ const label = path.length === 0 ? strings.filterMatchAll.replace(/ \(.*\)$/, '') : formatText(strings.filterGroup, {
62
+ n: path.join('.')
63
+ });
64
+ const depth = path.length + 1;
65
+ return /*#__PURE__*/ jsxs("div", {
66
+ className: "foundation-filter-group",
67
+ role: "group",
68
+ "aria-label": path.length === 0 ? formatText(countActiveConditions(group) === 1 ? strings.filterSummaryOne : strings.filterSummary, {
69
+ count: countActiveConditions(group)
70
+ }) : label,
71
+ "data-depth": depth,
72
+ children: [
73
+ /*#__PURE__*/ jsxs("div", {
74
+ className: "foundation-filter-match",
75
+ children: [
76
+ /*#__PURE__*/ jsxs("select", {
77
+ "aria-label": strings.filterMatchAll,
78
+ value: group.operator,
79
+ disabled: locked,
80
+ onChange: (event)=>change(path, (current)=>({
81
+ ...current,
82
+ operator: event.target.value === 'or' ? 'or' : 'and'
83
+ })),
84
+ children: [
85
+ /*#__PURE__*/ jsx("option", {
86
+ value: "and",
87
+ children: strings.filterMatchAll
88
+ }),
89
+ /*#__PURE__*/ jsx("option", {
90
+ value: "or",
91
+ children: strings.filterMatchAny
92
+ })
93
+ ]
94
+ }),
95
+ path.length > 0 && !locked && /*#__PURE__*/ jsx("button", {
96
+ type: "button",
97
+ className: "foundation-link",
98
+ onClick: ()=>change(path.slice(0, -1), (parent)=>({
99
+ ...parent,
100
+ groups: parent.groups.filter((_, index)=>index !== path[path.length - 1])
101
+ })),
102
+ children: strings.filterRemoveGroup
103
+ })
104
+ ]
105
+ }),
106
+ group.conditions.map((condition, index)=>{
107
+ const field = fields.find((candidate)=>candidate.name === condition.field);
108
+ const conditionLabel = formatText(strings.filterCondition, {
109
+ n: index + 1
110
+ });
111
+ return /*#__PURE__*/ jsxs("div", {
112
+ className: "foundation-filter-row",
113
+ role: "group",
114
+ "aria-label": conditionLabel,
115
+ children: [
116
+ /*#__PURE__*/ jsx("select", {
117
+ "aria-label": `${strings.filterField}, ${conditionLabel}`,
118
+ value: condition.field,
119
+ disabled: locked,
120
+ onChange: (event)=>{
121
+ const next = fields.find((candidate)=>candidate.name === event.target.value);
122
+ change(path, (current)=>({
123
+ ...current,
124
+ conditions: current.conditions.map((existing, position)=>position === index ? {
125
+ field: event.target.value,
126
+ operator: next ? filterOperators[next.type][0] : existing.operator,
127
+ value: ''
128
+ } : existing)
129
+ }));
130
+ },
131
+ children: fields.map((candidate)=>/*#__PURE__*/ jsx("option", {
132
+ value: candidate.name,
133
+ children: candidate.label
134
+ }, candidate.name))
135
+ }),
136
+ /*#__PURE__*/ jsx("select", {
137
+ "aria-label": `${strings.filterOperator}, ${conditionLabel}`,
138
+ value: condition.operator,
139
+ disabled: locked,
140
+ onChange: (event)=>change(path, (current)=>({
141
+ ...current,
142
+ conditions: current.conditions.map((existing, position)=>position === index ? {
143
+ ...existing,
144
+ operator: event.target.value
145
+ } : existing)
146
+ })),
147
+ children: filterOperators[field?.type ?? FilterFieldType.Text].map((operator)=>/*#__PURE__*/ jsx("option", {
148
+ value: operator,
149
+ children: operatorText(strings, operator)
150
+ }, operator))
151
+ }),
152
+ /*#__PURE__*/ jsx(ValueInput, {
153
+ field: field,
154
+ condition: condition,
155
+ strings: strings,
156
+ label: conditionLabel,
157
+ disabled: locked,
158
+ onChange: (value)=>change(path, (current)=>({
159
+ ...current,
160
+ conditions: current.conditions.map((existing, position)=>position === index ? {
161
+ ...existing,
162
+ value
163
+ } : existing)
164
+ }))
165
+ }),
166
+ !locked && /*#__PURE__*/ jsx("button", {
167
+ type: "button",
168
+ className: "foundation-icon-button",
169
+ "aria-label": `${strings.filterRemove}, ${conditionLabel}`,
170
+ onClick: ()=>change(path, (current)=>({
171
+ ...current,
172
+ conditions: current.conditions.filter((_, position)=>position !== index)
173
+ })),
174
+ children: "×"
175
+ })
176
+ ]
177
+ }, index);
178
+ }),
179
+ group.groups.map((nested, index)=>/*#__PURE__*/ jsx(GroupEditor, {
180
+ group: nested,
181
+ path: [
182
+ ...path,
183
+ index
184
+ ],
185
+ fields: fields,
186
+ strings: strings,
187
+ locked: locked,
188
+ change: change
189
+ }, index)),
190
+ !locked && /*#__PURE__*/ jsxs("div", {
191
+ className: "foundation-filter-actions",
192
+ children: [
193
+ /*#__PURE__*/ jsx("button", {
194
+ type: "button",
195
+ className: "foundation-link",
196
+ onClick: ()=>change(path, (current)=>({
197
+ ...current,
198
+ conditions: [
199
+ ...current.conditions,
200
+ newCondition(fields)
201
+ ]
202
+ })),
203
+ children: strings.filterAdd
204
+ }),
205
+ depth < maximumFilterDepth && /*#__PURE__*/ jsx("button", {
206
+ type: "button",
207
+ className: "foundation-link",
208
+ onClick: ()=>change(path, (current)=>({
209
+ ...current,
210
+ groups: [
211
+ ...current.groups,
212
+ {
213
+ operator: 'and',
214
+ conditions: [
215
+ newCondition(fields)
216
+ ],
217
+ groups: []
218
+ }
219
+ ]
220
+ })),
221
+ children: strings.filterAddGroup
222
+ })
223
+ ]
224
+ })
225
+ ]
226
+ });
227
+ }
228
+ /**
229
+ * The `filterBuilder` component: field, operator and value conditions joined by AND or OR, in groups that nest up to three deep.
230
+ *
231
+ * The filter is the component's `value` output - `{ operator, conditions, groups }` - which a list screen binds its query to; the
232
+ * component itself filters nothing. `fields` describe what can be filtered (name, label, type, and options for a select), and
233
+ * the operators on offer follow each field's type. A filter bound in through `value` is read back as the user left it: conditions on
234
+ * fields that no longer exist are dropped rather than shown broken. The component is the filter panel of a list on a desktop and
235
+ * the body of the filter dialog on a phone.
236
+ */ function FilterBuilder({ element, interactions, bindingOutputs }) {
237
+ const fields = useMemo(()=>readFilterFields(element.properties.fields), [
238
+ element.properties.fields
239
+ ]);
240
+ const supplied = useMemo(()=>normalizeFilter(element.properties.filter, fields), [
241
+ element.properties.filter,
242
+ fields
243
+ ]);
244
+ const [filter, setFilter] = useState(supplied);
245
+ const strings = readFoundationStrings(element);
246
+ const suppliedKey = JSON.stringify(supplied);
247
+ const state = readComponentState(element, fields.length > 0);
248
+ const locked = readPermissionRule(element, 'editPermission') !== 'enabled';
249
+ useEffect(()=>setFilter(supplied), [
250
+ suppliedKey
251
+ ]);
252
+ useValueOutput(bindingOutputs, filter);
253
+ const change = (path, apply)=>{
254
+ const next = updateGroupAt(filter, path, apply);
255
+ setFilter(next);
256
+ interactions?.onChange?.();
257
+ };
258
+ const active = countActiveConditions(filter);
259
+ return /*#__PURE__*/ jsx(FoundationFrame, {
260
+ element: element,
261
+ interactions: interactions,
262
+ name: "filter-builder",
263
+ state: state,
264
+ skeleton: [
265
+ 100,
266
+ 100
267
+ ],
268
+ children: state !== ComponentState.Loading && /*#__PURE__*/ jsxs(Fragment, {
269
+ children: [
270
+ /*#__PURE__*/ jsx(GroupEditor, {
271
+ group: filter,
272
+ path: [],
273
+ fields: fields,
274
+ strings: strings,
275
+ locked: locked,
276
+ change: change
277
+ }),
278
+ /*#__PURE__*/ jsxs("div", {
279
+ className: "foundation-filter-footer",
280
+ children: [
281
+ /*#__PURE__*/ jsx("span", {
282
+ className: "foundation-filter-summary",
283
+ "aria-live": "polite",
284
+ children: active === 1 ? strings.filterSummaryOne : formatText(strings.filterSummary, {
285
+ count: active
286
+ })
287
+ }),
288
+ active > 0 && !locked && /*#__PURE__*/ jsx(ActionButton, {
289
+ emphasis: "quiet",
290
+ disabledReason: strings.disabledNoPermission,
291
+ onClick: ()=>{
292
+ setFilter(emptyFilter());
293
+ interactions?.onChange?.();
294
+ },
295
+ children: strings.filterClear
296
+ })
297
+ ]
298
+ })
299
+ ]
300
+ })
301
+ });
302
+ }
303
+
304
+ export { FilterBuilder };
305
+ //# sourceMappingURL=FilterBuilder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FilterBuilder.js","sources":["../../../foundation/FilterBuilder.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 { useEffect, useMemo, useState } from 'react';\nimport { RegisteredComponentProps, useValueOutput } from '@cratis/scene.react';\nimport { ComponentState, readComponentState } from './ComponentState';\nimport { ActionButton } from './ActionButton';\nimport {\n FilterCondition, FilterField, emptyFilter, FilterFieldType, FilterGroup, countActiveConditions, filterOperators, maximumFilterDepth, newCondition,\n normalizeFilter, readFilterFields, updateGroupAt, valuelessOperators,\n} from './filterModel';\nimport { FoundationStrings, formatText, readFoundationStrings } from './foundationStrings';\nimport { FoundationFrame } from './StateFrame';\nimport { readPermissionRule } from './PermissionRule';\n\nconst operatorText = (strings: FoundationStrings, operator: string): string => {\n const names: Record<string, string> = {\n contains: strings.opContains, equals: strings.opEquals, notEquals: strings.opNotEquals, startsWith: strings.opStartsWith, isEmpty: strings.opIsEmpty,\n greater: strings.opGreater, greaterOrEqual: strings.opGreaterOrEqual, less: strings.opLess, lessOrEqual: strings.opLessOrEqual,\n before: strings.opBefore, after: strings.opAfter, on: strings.opOn, is: strings.opIs, isNot: strings.opIsNot, true: strings.opTrue, false: strings.opFalse,\n };\n return names[operator] ?? operator;\n};\n\ninterface GroupEditorProps {\n group: FilterGroup;\n path: number[];\n fields: FilterField[];\n strings: FoundationStrings;\n locked: boolean;\n change(path: number[], change: (group: FilterGroup) => FilterGroup): void;\n}\n\nfunction ValueInput({ field, condition, strings, label, disabled, onChange }: { field: FilterField | undefined; condition: FilterCondition; strings: FoundationStrings; label: string; disabled: boolean; onChange(value: string): void }) {\n if (valuelessOperators.includes(condition.operator)) return undefined;\n\n if (field?.type === FilterFieldType.Select) {\n return (\n <select aria-label={`${strings.filterValue}, ${label}`} value={condition.value} disabled={disabled} onChange={event => onChange(event.target.value)}>\n <option value=''>—</option>\n {field.options.map(option => <option key={option} value={option}>{option}</option>)}\n </select>\n );\n }\n\n return <input aria-label={`${strings.filterValue}, ${label}`} type={field?.type === FilterFieldType.Number ? 'number' : field?.type === FilterFieldType.Date ? 'date' : 'text'} value={condition.value} disabled={disabled} onChange={event => onChange(event.target.value)} />;\n}\n\nfunction GroupEditor({ group, path, fields, strings, locked, change }: GroupEditorProps) {\n const label = path.length === 0 ? strings.filterMatchAll.replace(/ \\(.*\\)$/, '') : formatText(strings.filterGroup, { n: path.join('.') });\n const depth = path.length + 1;\n\n return (\n <div className='foundation-filter-group' role='group' aria-label={path.length === 0 ? formatText(countActiveConditions(group) === 1 ? strings.filterSummaryOne : strings.filterSummary, { count: countActiveConditions(group) }) : label} data-depth={depth}>\n <div className='foundation-filter-match'>\n <select aria-label={strings.filterMatchAll} value={group.operator} disabled={locked} onChange={event => change(path, current => ({ ...current, operator: event.target.value === 'or' ? 'or' : 'and' }))}>\n <option value='and'>{strings.filterMatchAll}</option>\n <option value='or'>{strings.filterMatchAny}</option>\n </select>\n {path.length > 0 && !locked && (\n <button type='button' className='foundation-link' onClick={() => change(path.slice(0, -1), parent => ({ ...parent, groups: parent.groups.filter((_, index) => index !== path[path.length - 1]) }))}>{strings.filterRemoveGroup}</button>\n )}\n </div>\n {group.conditions.map((condition, index) => {\n const field = fields.find(candidate => candidate.name === condition.field);\n const conditionLabel = formatText(strings.filterCondition, { n: index + 1 });\n return (\n <div className='foundation-filter-row' role='group' aria-label={conditionLabel} key={index}>\n <select aria-label={`${strings.filterField}, ${conditionLabel}`} value={condition.field} disabled={locked}\n onChange={event => {\n const next = fields.find(candidate => candidate.name === event.target.value);\n change(path, current => ({ ...current, conditions: current.conditions.map((existing, position) => (position === index\n ? { field: event.target.value, operator: next ? filterOperators[next.type][0] : existing.operator, value: '' } : existing)) }));\n }}>\n {fields.map(candidate => <option key={candidate.name} value={candidate.name}>{candidate.label}</option>)}\n </select>\n <select aria-label={`${strings.filterOperator}, ${conditionLabel}`} value={condition.operator} disabled={locked}\n onChange={event => change(path, current => ({ ...current, conditions: current.conditions.map((existing, position) => (position === index ? { ...existing, operator: event.target.value } : existing)) }))}>\n {filterOperators[field?.type ?? FilterFieldType.Text].map(operator => <option key={operator} value={operator}>{operatorText(strings, operator)}</option>)}\n </select>\n <ValueInput field={field} condition={condition} strings={strings} label={conditionLabel} disabled={locked}\n onChange={value => change(path, current => ({ ...current, conditions: current.conditions.map((existing, position) => (position === index ? { ...existing, value } : existing)) }))} />\n {!locked && (\n <button type='button' className='foundation-icon-button' aria-label={`${strings.filterRemove}, ${conditionLabel}`}\n onClick={() => change(path, current => ({ ...current, conditions: current.conditions.filter((_, position) => position !== index) }))}>×</button>\n )}\n </div>\n );\n })}\n {group.groups.map((nested, index) => <GroupEditor key={index} group={nested} path={[...path, index]} fields={fields} strings={strings} locked={locked} change={change} />)}\n {!locked && (\n <div className='foundation-filter-actions'>\n <button type='button' className='foundation-link' onClick={() => change(path, current => ({ ...current, conditions: [...current.conditions, newCondition(fields)] }))}>{strings.filterAdd}</button>\n {depth < maximumFilterDepth && (\n <button type='button' className='foundation-link' onClick={() => change(path, current => ({ ...current, groups: [...current.groups, { operator: 'and', conditions: [newCondition(fields)], groups: [] }] }))}>{strings.filterAddGroup}</button>\n )}\n </div>\n )}\n </div>\n );\n}\n\n/**\n * The `filterBuilder` component: field, operator and value conditions joined by AND or OR, in groups that nest up to three deep.\n *\n * The filter is the component's `value` output - `{ operator, conditions, groups }` - which a list screen binds its query to; the\n * component itself filters nothing. `fields` describe what can be filtered (name, label, type, and options for a select), and\n * the operators on offer follow each field's type. A filter bound in through `value` is read back as the user left it: conditions on\n * fields that no longer exist are dropped rather than shown broken. The component is the filter panel of a list on a desktop and\n * the body of the filter dialog on a phone.\n */\nexport function FilterBuilder({ element, interactions, bindingOutputs }: RegisteredComponentProps) {\n const fields = useMemo(() => readFilterFields(element.properties.fields), [element.properties.fields]);\n const supplied = useMemo(() => normalizeFilter(element.properties.filter, fields), [element.properties.filter, fields]);\n const [filter, setFilter] = useState<FilterGroup>(supplied);\n const strings = readFoundationStrings(element);\n const suppliedKey = JSON.stringify(supplied);\n const state = readComponentState(element, fields.length > 0);\n const locked = readPermissionRule(element, 'editPermission') !== 'enabled';\n\n useEffect(() => setFilter(supplied), [suppliedKey]);\n useValueOutput(bindingOutputs, filter);\n\n const change = (path: number[], apply: (group: FilterGroup) => FilterGroup) => {\n const next = updateGroupAt(filter, path, apply);\n setFilter(next);\n interactions?.onChange?.();\n };\n const active = countActiveConditions(filter);\n\n return (\n <FoundationFrame element={element} interactions={interactions} name='filter-builder' state={state} skeleton={[100, 100]}>\n {state !== ComponentState.Loading && (\n <>\n <GroupEditor group={filter} path={[]} fields={fields} strings={strings} locked={locked} change={change} />\n <div className='foundation-filter-footer'>\n <span className='foundation-filter-summary' aria-live='polite'>{active === 1 ? strings.filterSummaryOne : formatText(strings.filterSummary, { count: active })}</span>\n {active > 0 && !locked && <ActionButton emphasis='quiet' disabledReason={strings.disabledNoPermission} onClick={() => { setFilter(emptyFilter()); interactions?.onChange?.(); }}>{strings.filterClear}</ActionButton>}\n </div>\n </>\n )}\n </FoundationFrame>\n );\n}\n"],"names":["operatorText","strings","operator","names","contains","opContains","equals","opEquals","notEquals","opNotEquals","startsWith","opStartsWith","isEmpty","opIsEmpty","greater","opGreater","greaterOrEqual","opGreaterOrEqual","less","opLess","lessOrEqual","opLessOrEqual","before","opBefore","after","opAfter","on","opOn","is","opIs","isNot","opIsNot","true","opTrue","false","opFalse","ValueInput","field","condition","label","disabled","onChange","valuelessOperators","includes","undefined","type","FilterFieldType","Select","_jsxs","select","aria-label","filterValue","value","event","target","_jsx","option","options","map","input","Number","Date","GroupEditor","group","path","fields","locked","change","length","filterMatchAll","replace","formatText","filterGroup","n","join","depth","div","className","role","countActiveConditions","filterSummaryOne","filterSummary","count","data-depth","current","filterMatchAny","button","onClick","slice","parent","groups","filter","_","index","filterRemoveGroup","conditions","find","candidate","name","conditionLabel","filterCondition","filterField","next","existing","position","filterOperators","filterOperator","Text","filterRemove","nested","newCondition","filterAdd","maximumFilterDepth","filterAddGroup","FilterBuilder","element","interactions","bindingOutputs","useMemo","readFilterFields","properties","supplied","normalizeFilter","setFilter","useState","readFoundationStrings","suppliedKey","JSON","stringify","state","readComponentState","readPermissionRule","useEffect","useValueOutput","apply","updateGroupAt","active","FoundationFrame","skeleton","ComponentState","Loading","_Fragment","span","aria-live","ActionButton","emphasis","disabledReason","disabledNoPermission","emptyFilter","filterClear"],"mappings":";;;;;;;;;;AAeA,MAAMA,YAAAA,GAAe,CAACC,OAAAA,EAA4BC,QAAAA,GAAAA;AAC9C,IAAA,MAAMC,KAAAA,GAAgC;AAClCC,QAAAA,QAAAA,EAAUH,QAAQI,UAAU;AAAEC,QAAAA,MAAAA,EAAQL,QAAQM,QAAQ;AAAEC,QAAAA,SAAAA,EAAWP,QAAQQ,WAAW;AAAEC,QAAAA,UAAAA,EAAYT,QAAQU,YAAY;AAAEC,QAAAA,OAAAA,EAASX,QAAQY,SAAS;AACpJC,QAAAA,OAAAA,EAASb,QAAQc,SAAS;AAAEC,QAAAA,cAAAA,EAAgBf,QAAQgB,gBAAgB;AAAEC,QAAAA,IAAAA,EAAMjB,QAAQkB,MAAM;AAAEC,QAAAA,WAAAA,EAAanB,QAAQoB,aAAa;AAC9HC,QAAAA,MAAAA,EAAQrB,QAAQsB,QAAQ;AAAEC,QAAAA,KAAAA,EAAOvB,QAAQwB,OAAO;AAAEC,QAAAA,EAAAA,EAAIzB,QAAQ0B,IAAI;AAAEC,QAAAA,EAAAA,EAAI3B,QAAQ4B,IAAI;AAAEC,QAAAA,KAAAA,EAAO7B,QAAQ8B,OAAO;AAAEC,QAAAA,IAAAA,EAAM/B,QAAQgC,MAAM;AAAEC,QAAAA,KAAAA,EAAOjC,QAAQkC;AACvJ,KAA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lN;;"}
@@ -18,4 +18,20 @@ export declare const TrendChipLight: Story;
18
18
  export declare const TrendChipDark: Story;
19
19
  export declare const StatusChipLight: Story;
20
20
  export declare const StatusChipDark: Story;
21
+ export declare const ChartLineLight: Story;
22
+ export declare const ChartLineDark: Story;
23
+ export declare const ChartBarLight: Story;
24
+ export declare const ChartBarDark: Story;
25
+ export declare const ChartStackedLight: Story;
26
+ export declare const ChartStackedDark: Story;
27
+ export declare const ChartDonutLight: Story;
28
+ export declare const ChartDonutDark: Story;
29
+ export declare const ChartFunnelLight: Story;
30
+ export declare const ChartFunnelDark: Story;
31
+ export declare const FilterBuilderLight: Story;
32
+ export declare const FilterBuilderDark: Story;
33
+ export declare const ColumnChooserLight: Story;
34
+ export declare const ColumnChooserDark: Story;
35
+ export declare const SavedViewsMenuLight: Story;
36
+ export declare const SavedViewsMenuDark: Story;
21
37
  //# sourceMappingURL=Foundation.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Foundation.stories.d.ts","sourceRoot":"","sources":["../../../foundation/Foundation.stories.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAMtD,QAAA,MAAM,IAAI;;;;QAGQ,MAAM;;CACiB,CAAC;eAE3B,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,eAAe,EAAE,KAAyE,CAAC;AACxG,eAAO,MAAM,cAAc,EAAE,KAAwE,CAAC;AACtG,eAAO,MAAM,aAAa,EAAE,KAAuE,CAAC;AACpG,eAAO,MAAM,YAAY,EAAE,KAAsE,CAAC;AAClG,eAAO,MAAM,mBAAmB,EAAE,KAAiJ,CAAC;AACpL,eAAO,MAAM,cAAc,EAAE,KAAwE,CAAC;AACtG,eAAO,MAAM,aAAa,EAAE,KAAuE,CAAC;AACpG,e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AAE,KAA0N,CAAC;AACzP,eAAO,MAAM,kBAAkB,EAAE,KAA4E,CAAC;AAC9G,eAAO,MAAM,iBAAiB,EAAE,KAA2E,CAAC;AAC5G,eAAO,MAAM,kBAAkB,EAAE,KAA4E,CAAC;AAC9G,eAAO,MAAM,iBAAiB,EAAE,KAA2E,CAAC;AAC5G,eAAO,MAAM,mBAAmB,EAAE,KAA6E,CAAC;AAChH,eAAO,MAAM,kBAAkB,EAAE,KAA4E,CAAC"}
@@ -15,4 +15,20 @@ export const TrendChipLight = { args: { component: ComponentName.TrendChip, them
15
15
  export const TrendChipDark = { args: { component: ComponentName.TrendChip, theme: 'dark' } };
16
16
  export const StatusChipLight = { args: { component: ComponentName.StatusChip, theme: 'light' } };
17
17
  export const StatusChipDark = { args: { component: ComponentName.StatusChip, theme: 'dark' } };
18
+ export const ChartLineLight = { args: { component: ComponentName.ChartWrapper, theme: 'light' } };
19
+ export const ChartLineDark = { args: { component: ComponentName.ChartWrapper, theme: 'dark' } };
20
+ export const ChartBarLight = { args: { component: ComponentName.ChartWrapper, theme: 'light', properties: { kind: 'bar' } } };
21
+ export const ChartBarDark = { args: { component: ComponentName.ChartWrapper, theme: 'dark', properties: { kind: 'bar' } } };
22
+ export const ChartStackedLight = { args: { component: ComponentName.ChartWrapper, theme: 'light', properties: { kind: 'stacked' } } };
23
+ export const ChartStackedDark = { args: { component: ComponentName.ChartWrapper, theme: 'dark', properties: { kind: 'stacked' } } };
24
+ export const ChartDonutLight = { args: { component: ComponentName.ChartWrapper, theme: 'light', properties: { kind: 'donut' } } };
25
+ export const ChartDonutDark = { args: { component: ComponentName.ChartWrapper, theme: 'dark', properties: { kind: 'donut' } } };
26
+ export const ChartFunnelLight = { args: { component: ComponentName.ChartWrapper, theme: 'light', properties: { kind: 'funnel', categories: ['Leads', 'Qualified', 'Proposal', 'Won'], series: [{ name: 'Deals', values: [400, 220, 90, 40] }] } } };
27
+ export const ChartFunnelDark = { args: { component: ComponentName.ChartWrapper, theme: 'dark', properties: { kind: 'funnel', categories: ['Leads', 'Qualified', 'Proposal', 'Won'], series: [{ name: 'Deals', values: [400, 220, 90, 40] }] } } };
28
+ export const FilterBuilderLight = { args: { component: ComponentName.FilterBuilder, theme: 'light' } };
29
+ export const FilterBuilderDark = { args: { component: ComponentName.FilterBuilder, theme: 'dark' } };
30
+ export const ColumnChooserLight = { args: { component: ComponentName.ColumnChooser, theme: 'light' } };
31
+ export const ColumnChooserDark = { args: { component: ComponentName.ColumnChooser, theme: 'dark' } };
32
+ export const SavedViewsMenuLight = { args: { component: ComponentName.SavedViewsMenu, theme: 'light' } };
33
+ export const SavedViewsMenuDark = { args: { component: ComponentName.SavedViewsMenu, theme: 'dark' } };
18
34
  //# sourceMappingURL=Foundation.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Foundation.stories.js","sourceRoot":"","sources":["../../../foundation/Foundation.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAMtD,MAAM,IAAI,GAAG;IACT,KAAK,EAAE,iCAAiC;IACxC,SAAS,EAAE,gBAAgB;IAC3B,UAAU,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE;CACC,CAAC;AAE1C,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,MAAM,eAAe,GAAU,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,aAAa,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC;AACxG,MAAM,CAAC,MAAM,cAAc,GAAU,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,aAAa,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC;AACtG,MAAM,CAAC,MAAM,aAAa,GAAU,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,aAAa,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAA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AE,EAAE,CAAC;AAC5G,MAAM,CAAC,MAAM,kBAAkB,GAAU,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,aAAa,CAAC,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC;AAC9G,MAAM,CAAC,MAAM,iBAAiB,GAAU,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,aAAa,CAAC,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC;AAC5G,MAAM,CAAC,MAAM,mBAAmB,GAAU,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,aAAa,CAAC,cAAc,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC;AAChH,MAAM,CAAC,MAAM,kBAAkB,GAAU,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,aAAa,CAAC,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { RegisteredComponentProps } from '@cratis/scene.react';
2
+ export declare const savedViewActionOutput = "action";
3
+ export declare function SavedViewsMenu({ element, interactions, bindingOutputs }: RegisteredComponentProps): import("react").JSX.Element;
4
+ //# sourceMappingURL=SavedViewsMenu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SavedViewsMenu.d.ts","sourceRoot":"","sources":["../../../foundation/SavedViewsMenu.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAkB,MAAM,qBAAqB,CAAC;AAU/E,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAW9C,wBAAgB,cAAc,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,EAAE,wBAAwB,+BAoEjG"}