@svgrid/enterprise 2.0.3 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -6
- package/dist/cdn/svgrid-enterprise.svelte-external.js +14025 -6836
- package/dist/node/studio.js +7889 -2460
- package/package.json +9 -4
- package/src/SvGridMasterDetail.svelte +24 -3
- package/src/SvGridScheduler.svelte +4410 -0
- package/src/SvPivotDesigner.svelte +1990 -1045
- package/src/SvSchemaChart.svelte +10 -9
- package/src/ai.test.ts +522 -522
- package/src/ai.ts +202 -2
- package/src/index.ts +409 -384
- package/src/install.ts +10 -0
- package/src/pivot-chart.test.ts +86 -0
- package/src/pivot-chart.ts +112 -0
- package/src/scheduler.ts +37 -0
- package/src/scheduling.test.ts +194 -0
- package/src/scheduling.ts +293 -0
- package/src/sources/filters.ts +6 -0
- package/src/studio/HANDLERS-DESIGN.md +142 -0
- package/src/studio/cli.ts +7 -2
- package/src/studio/emit-project.test.ts +1447 -13
- package/src/studio/emit-project.ts +3995 -1273
- package/src/studio/emit-schema.ts +146 -29
- package/src/studio/index.ts +320 -195
- package/src/studio/project.test.ts +370 -0
- package/src/studio/project.ts +1146 -26
- package/src/studio/sample-data.ts +4 -1
- package/src/studio/samples/ats.ts +2 -2
- package/src/studio/samples/clinic.ts +4 -2
- package/src/studio/samples/crm.ts +16 -8
- package/src/studio/samples/events.ts +4 -2
- package/src/studio/samples/fleet.ts +4 -2
- package/src/studio/samples/gym.ts +4 -2
- package/src/studio/samples/hr.ts +3 -1
- package/src/studio/samples/live-data.ts +308 -308
- package/src/studio/samples/projects.ts +2 -2
- package/src/studio/samples/restaurant.ts +4 -2
- package/src/studio/samples/samples.test.ts +13 -5
- package/src/studio/samples/shared.ts +346 -305
- package/src/studio/samples/support.ts +3 -1
- package/src/studio/scaffold.test.ts +15 -1
- package/src/studio/scaffold.ts +16 -0
- package/src/studio/themes.ts +7 -0
- package/src/studio/ui-components.ts +472 -0
- package/src/sveltekit/transport.test.ts +26 -0
- package/src/sveltekit/transport.ts +50 -5
- package/dist/designer/assets/index-Dp44bTid.js +0 -939
- package/dist/designer/assets/index-RJp6x8tw.css +0 -1
- package/dist/designer/assets/jszip.min-CjMo-QGg.js +0 -2
- package/dist/designer/index.html +0 -13
package/src/SvSchemaChart.svelte
CHANGED
|
@@ -93,17 +93,18 @@
|
|
|
93
93
|
let msr = $state('')
|
|
94
94
|
let red = $state<AggregateReduce>('sum')
|
|
95
95
|
let ctype = $state<ChartType>('bar')
|
|
96
|
-
let seeded = false
|
|
97
96
|
|
|
98
|
-
//
|
|
97
|
+
// Follow the props reactively, so a controlled parent (e.g. the Studio preview,
|
|
98
|
+
// which hides the dropdowns) updates the chart whenever its dimension / measure /
|
|
99
|
+
// reduce / type change. One effect per prop so a change to one doesn't reset the
|
|
100
|
+
// others; the built-in dropdowns still write to this state and persist, because a
|
|
101
|
+
// dropdown change doesn't feed back into the props (so these effects don't re-run).
|
|
102
|
+
$effect(() => { if (type !== undefined) ctype = type })
|
|
103
|
+
$effect(() => { if (dimension !== undefined) dim = dimension })
|
|
104
|
+
$effect(() => { if (measure !== undefined) msr = measure })
|
|
105
|
+
$effect(() => { if (reduce !== undefined) red = reduce })
|
|
106
|
+
// Keep the dimension / measure valid for the schema.
|
|
99
107
|
$effect(() => {
|
|
100
|
-
if (!seeded) {
|
|
101
|
-
seeded = true
|
|
102
|
-
if (dimension) dim = dimension
|
|
103
|
-
if (measure) msr = measure
|
|
104
|
-
if (reduce) red = reduce
|
|
105
|
-
if (type) ctype = type
|
|
106
|
-
}
|
|
107
108
|
if (!dim || !fields.dimensions.includes(dim)) dim = fields.defaultDimension ?? fields.dimensions[0] ?? ''
|
|
108
109
|
if ((!msr || !fields.measures.includes(msr)) && fields.measures.length) msr = fields.defaultMeasure ?? fields.measures[0] ?? ''
|
|
109
110
|
})
|