@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.
- package/ComponentName.ts +12 -0
- package/defaultBlueprintComponents.ts +5 -1
- package/dist/cjs/ComponentName.js +4 -0
- package/dist/cjs/ComponentName.js.map +1 -1
- package/dist/cjs/defaultBlueprint.js +1 -1
- package/dist/cjs/defaultBlueprintComponentMetadata.js +2 -2
- package/dist/cjs/defaultBlueprintComponents.js +10 -2
- package/dist/cjs/defaultBlueprintComponents.js.map +1 -1
- package/dist/cjs/foundation/ChartWrapper.js +520 -0
- package/dist/cjs/foundation/ChartWrapper.js.map +1 -0
- package/dist/cjs/foundation/ColumnChooser.js +156 -0
- package/dist/cjs/foundation/ColumnChooser.js.map +1 -0
- package/dist/cjs/foundation/FilterBuilder.js +307 -0
- package/dist/cjs/foundation/FilterBuilder.js.map +1 -0
- package/dist/cjs/foundation/SavedViewsMenu.js +199 -0
- package/dist/cjs/foundation/SavedViewsMenu.js.map +1 -0
- package/dist/cjs/foundation/chartGeometry.js +101 -0
- package/dist/cjs/foundation/chartGeometry.js.map +1 -0
- package/dist/cjs/foundation/columnModel.js +43 -0
- package/dist/cjs/foundation/columnModel.js.map +1 -0
- package/dist/cjs/foundation/filterModel.js +123 -0
- package/dist/cjs/foundation/filterModel.js.map +1 -0
- package/dist/cjs/foundation/foundationComponentMetadata.js +28 -0
- package/dist/cjs/foundation/foundationComponentMetadata.js.map +1 -1
- package/dist/cjs/foundation/foundationDescriptors.js +153 -0
- package/dist/cjs/foundation/foundationDescriptors.js.map +1 -1
- package/dist/cjs/foundation/foundationSamples.js +130 -0
- package/dist/cjs/foundation/foundationSamples.js.map +1 -1
- package/dist/cjs/foundation/foundationStrings.js +25 -0
- package/dist/cjs/foundation/foundationStrings.js.map +1 -1
- package/dist/cjs/foundation/useElementWidth.js +31 -0
- package/dist/cjs/foundation/useElementWidth.js.map +1 -0
- package/dist/cjs/foundation/viewModel.js +24 -0
- package/dist/cjs/foundation/viewModel.js.map +1 -0
- package/dist/cjs/index.js +38 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/ComponentName.d.ts +5 -1
- package/dist/esm/ComponentName.d.ts.map +1 -1
- package/dist/esm/ComponentName.js +4 -0
- package/dist/esm/ComponentName.js.map +1 -1
- package/dist/esm/defaultBlueprint.js +1 -1
- package/dist/esm/defaultBlueprintComponentMetadata.js +2 -2
- package/dist/esm/defaultBlueprintComponents.d.ts.map +1 -1
- package/dist/esm/defaultBlueprintComponents.js +10 -2
- package/dist/esm/defaultBlueprintComponents.js.map +1 -1
- package/dist/esm/foundation/ChartWrapper.d.ts +5 -0
- package/dist/esm/foundation/ChartWrapper.d.ts.map +1 -0
- package/dist/esm/foundation/ChartWrapper.js +517 -0
- package/dist/esm/foundation/ChartWrapper.js.map +1 -0
- package/dist/esm/foundation/ColumnChooser.d.ts +3 -0
- package/dist/esm/foundation/ColumnChooser.d.ts.map +1 -0
- package/dist/esm/foundation/ColumnChooser.js +154 -0
- package/dist/esm/foundation/ColumnChooser.js.map +1 -0
- package/dist/esm/foundation/FilterBuilder.d.ts +3 -0
- package/dist/esm/foundation/FilterBuilder.d.ts.map +1 -0
- package/dist/esm/foundation/FilterBuilder.js +305 -0
- package/dist/esm/foundation/FilterBuilder.js.map +1 -0
- package/dist/esm/foundation/Foundation.stories.d.ts +16 -0
- package/dist/esm/foundation/Foundation.stories.d.ts.map +1 -1
- package/dist/esm/foundation/Foundation.stories.js +16 -0
- package/dist/esm/foundation/Foundation.stories.js.map +1 -1
- package/dist/esm/foundation/SavedViewsMenu.d.ts +4 -0
- package/dist/esm/foundation/SavedViewsMenu.d.ts.map +1 -0
- package/dist/esm/foundation/SavedViewsMenu.js +196 -0
- package/dist/esm/foundation/SavedViewsMenu.js.map +1 -0
- package/dist/esm/foundation/chartGeometry.d.ts +34 -0
- package/dist/esm/foundation/chartGeometry.d.ts.map +1 -0
- package/dist/esm/foundation/chartGeometry.js +93 -0
- package/dist/esm/foundation/chartGeometry.js.map +1 -0
- package/dist/esm/foundation/columnModel.d.ts +11 -0
- package/dist/esm/foundation/columnModel.d.ts.map +1 -0
- package/dist/esm/foundation/columnModel.js +38 -0
- package/dist/esm/foundation/columnModel.js.map +1 -0
- package/dist/esm/foundation/filterModel.d.ts +33 -0
- package/dist/esm/foundation/filterModel.d.ts.map +1 -0
- package/dist/esm/foundation/filterModel.js +112 -0
- package/dist/esm/foundation/filterModel.js.map +1 -0
- package/dist/esm/foundation/foundationComponentMetadata.d.ts.map +1 -1
- package/dist/esm/foundation/foundationComponentMetadata.js +28 -0
- package/dist/esm/foundation/foundationComponentMetadata.js.map +1 -1
- package/dist/esm/foundation/foundationDescriptors.d.ts.map +1 -1
- package/dist/esm/foundation/foundationDescriptors.js +154 -1
- package/dist/esm/foundation/foundationDescriptors.js.map +1 -1
- package/dist/esm/foundation/foundationSamples.d.ts.map +1 -1
- package/dist/esm/foundation/foundationSamples.js +130 -0
- package/dist/esm/foundation/foundationSamples.js.map +1 -1
- package/dist/esm/foundation/foundationStrings.d.ts +25 -0
- package/dist/esm/foundation/foundationStrings.d.ts.map +1 -1
- package/dist/esm/foundation/foundationStrings.js +25 -0
- package/dist/esm/foundation/foundationStrings.js.map +1 -1
- package/dist/esm/foundation/index.d.ts +9 -0
- package/dist/esm/foundation/index.d.ts.map +1 -1
- package/dist/esm/foundation/index.js +9 -0
- package/dist/esm/foundation/index.js.map +1 -1
- package/dist/esm/foundation/useElementWidth.d.ts +3 -0
- package/dist/esm/foundation/useElementWidth.d.ts.map +1 -0
- package/dist/esm/foundation/useElementWidth.js +29 -0
- package/dist/esm/foundation/useElementWidth.js.map +1 -0
- package/dist/esm/foundation/viewModel.d.ts +7 -0
- package/dist/esm/foundation/viewModel.d.ts.map +1 -0
- package/dist/esm/foundation/viewModel.js +22 -0
- package/dist/esm/foundation/viewModel.js.map +1 -0
- package/dist/esm/index.js +9 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/foundation/ChartWrapper.tsx +252 -0
- package/foundation/ColumnChooser.tsx +73 -0
- package/foundation/FilterBuilder.tsx +144 -0
- package/foundation/Foundation.stories.tsx +16 -0
- package/foundation/SavedViewsMenu.tsx +94 -0
- package/foundation/chartGeometry.ts +108 -0
- package/foundation/columnModel.ts +39 -0
- package/foundation/filterModel.ts +111 -0
- package/foundation/foundationComponentMetadata.ts +4 -0
- package/foundation/foundationDescriptors.ts +86 -1
- package/foundation/foundationSamples.ts +19 -0
- package/foundation/foundationStrings.ts +25 -0
- package/foundation/index.ts +9 -0
- package/foundation/useElementWidth.ts +31 -0
- package/foundation/viewModel.ts +21 -0
- package/package.json +8 -8
- package/shell/layout.css +285 -0
|
@@ -4,7 +4,9 @@ var scene_model = require('@cratis/scene.model');
|
|
|
4
4
|
var scene_react = require('@cratis/scene.react');
|
|
5
5
|
var ComponentName = require('../ComponentName.js');
|
|
6
6
|
var packageName = require('../packageName.js');
|
|
7
|
+
var chartGeometry = require('./chartGeometry.js');
|
|
7
8
|
var ComponentState = require('./ComponentState.js');
|
|
9
|
+
var filterModel = require('./filterModel.js');
|
|
8
10
|
var formatting = require('./formatting.js');
|
|
9
11
|
var PermissionRule = require('./PermissionRule.js');
|
|
10
12
|
var StatusChip = require('./StatusChip.js');
|
|
@@ -222,6 +224,157 @@ const formats = {
|
|
|
222
224
|
[StatusChip.StatusTone.Neutral]: 'Neutral'
|
|
223
225
|
}, StatusChip.StatusTone.Neutral, 'The tone picks the icon and the theme color.')
|
|
224
226
|
]
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
component: key(ComponentName.ComponentName.ChartWrapper),
|
|
230
|
+
displayName: 'Chart',
|
|
231
|
+
description: 'One chart - line, bar, stacked, donut or funnel - with a legend and a table of the same data. A donut and a funnel draw the first series.',
|
|
232
|
+
properties: [
|
|
233
|
+
text('title', 'Title', 'Content'),
|
|
234
|
+
choice('kind', 'Chart type', 'Appearance', {
|
|
235
|
+
[chartGeometry.ChartKind.Line]: 'Line',
|
|
236
|
+
[chartGeometry.ChartKind.Bar]: 'Bar',
|
|
237
|
+
[chartGeometry.ChartKind.Stacked]: 'Stacked bar',
|
|
238
|
+
[chartGeometry.ChartKind.Donut]: 'Donut',
|
|
239
|
+
[chartGeometry.ChartKind.Funnel]: 'Funnel'
|
|
240
|
+
}, chartGeometry.ChartKind.Line),
|
|
241
|
+
{
|
|
242
|
+
path: 'categories',
|
|
243
|
+
label: 'Categories',
|
|
244
|
+
group: 'Data',
|
|
245
|
+
valueType: scene_model.PropertyValueType.Json,
|
|
246
|
+
editorKind: scene_model.PropertyEditorKind.StringList,
|
|
247
|
+
default: [],
|
|
248
|
+
acceptedBindingKinds: bindable,
|
|
249
|
+
description: 'The label of each point, bar or slice, in order.'
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
...list('series', 'Series', 'Data', 'Series', [
|
|
253
|
+
text('name', 'Name', 'Data', undefined, {
|
|
254
|
+
constraints: {
|
|
255
|
+
required: true
|
|
256
|
+
}
|
|
257
|
+
}),
|
|
258
|
+
{
|
|
259
|
+
path: 'values',
|
|
260
|
+
label: 'Values',
|
|
261
|
+
group: 'Data',
|
|
262
|
+
valueType: scene_model.PropertyValueType.Json,
|
|
263
|
+
editorKind: scene_model.PropertyEditorKind.NumberList,
|
|
264
|
+
default: [],
|
|
265
|
+
description: 'One value for each category.'
|
|
266
|
+
}
|
|
267
|
+
], 'What is plotted: a named list of values, one per category.'),
|
|
268
|
+
acceptedBindingKinds: bindable
|
|
269
|
+
},
|
|
270
|
+
choice('format', 'Value format', 'Appearance', formats, formatting.NumberFormat.Number),
|
|
271
|
+
text('currency', 'Currency', 'Appearance', 'The ISO 4217 code when the format is currency.'),
|
|
272
|
+
...standardStateProperties.filter((property)=>property.path !== 'label')
|
|
273
|
+
]
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
component: key(ComponentName.ComponentName.FilterBuilder),
|
|
277
|
+
displayName: 'Filter builder',
|
|
278
|
+
description: 'Conditions on fields, joined by AND or OR in groups that nest three deep. The filter is published as the value output; the component filters nothing itself.',
|
|
279
|
+
properties: [
|
|
280
|
+
{
|
|
281
|
+
...list('fields', 'Fields', 'Data', 'Field', [
|
|
282
|
+
text('name', 'Name', 'Data', 'The result field the condition tests.', {
|
|
283
|
+
constraints: {
|
|
284
|
+
required: true
|
|
285
|
+
},
|
|
286
|
+
editorKind: scene_model.PropertyEditorKind.Field
|
|
287
|
+
}),
|
|
288
|
+
text('label', 'Label', 'Content'),
|
|
289
|
+
choice('type', 'Type', 'Data', {
|
|
290
|
+
[filterModel.FilterFieldType.Text]: 'Text',
|
|
291
|
+
[filterModel.FilterFieldType.Number]: 'Number',
|
|
292
|
+
[filterModel.FilterFieldType.Date]: 'Date',
|
|
293
|
+
[filterModel.FilterFieldType.Select]: 'Select',
|
|
294
|
+
[filterModel.FilterFieldType.Boolean]: 'Yes / no'
|
|
295
|
+
}, filterModel.FilterFieldType.Text, 'Decides the operators offered.'),
|
|
296
|
+
{
|
|
297
|
+
path: 'options',
|
|
298
|
+
label: 'Options',
|
|
299
|
+
group: 'Data',
|
|
300
|
+
valueType: scene_model.PropertyValueType.Json,
|
|
301
|
+
editorKind: scene_model.PropertyEditorKind.StringList,
|
|
302
|
+
default: [],
|
|
303
|
+
description: 'The choices of a select field.'
|
|
304
|
+
}
|
|
305
|
+
], 'What can be filtered.'),
|
|
306
|
+
acceptedBindingKinds: bindable
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
path: 'filter',
|
|
310
|
+
label: 'Initial filter',
|
|
311
|
+
group: 'Data',
|
|
312
|
+
valueType: scene_model.PropertyValueType.Object,
|
|
313
|
+
acceptedBindingKinds: bindable,
|
|
314
|
+
description: 'A filter to start from, usually bound to the active saved view.'
|
|
315
|
+
},
|
|
316
|
+
rule('editPermission', 'Edit permission', 'Enabled lets the user change the filter; disabled shows it read-only.'),
|
|
317
|
+
scene_react.valueOutputProperty(scene_model.PropertyValueType.Object, 'The filter as the user has built it: { operator, conditions, groups }, published as it changes.'),
|
|
318
|
+
...standardStateProperties
|
|
319
|
+
]
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
component: key(ComponentName.ComponentName.ColumnChooser),
|
|
323
|
+
displayName: 'Column chooser',
|
|
324
|
+
description: 'Which columns a table shows, and in what order. Publishes the ordered ids of the visible columns as the value output.',
|
|
325
|
+
properties: [
|
|
326
|
+
{
|
|
327
|
+
...list('columns', 'Columns', 'Data', 'Column', [
|
|
328
|
+
text('id', 'Id', 'Data', 'The result field the column shows.', {
|
|
329
|
+
constraints: {
|
|
330
|
+
required: true
|
|
331
|
+
},
|
|
332
|
+
editorKind: scene_model.PropertyEditorKind.Field
|
|
333
|
+
}),
|
|
334
|
+
text('label', 'Label', 'Content'),
|
|
335
|
+
flag('visible', 'Visible', 'Content', 'Whether the column starts shown.', {
|
|
336
|
+
default: true
|
|
337
|
+
}),
|
|
338
|
+
flag('locked', 'Always shown', 'Content', 'A locked column cannot be hidden: the identifying column is.')
|
|
339
|
+
], 'What could be shown.'),
|
|
340
|
+
acceptedBindingKinds: bindable
|
|
341
|
+
},
|
|
342
|
+
scene_react.valueOutputProperty(scene_model.PropertyValueType.Json, 'The ids of the visible columns, in order, published as the user changes them.'),
|
|
343
|
+
...standardStateProperties
|
|
344
|
+
]
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
component: key(ComponentName.ComponentName.SavedViewsMenu),
|
|
348
|
+
displayName: 'Saved views menu',
|
|
349
|
+
description: 'A list\'s saved views as a menu button, with the current view as its label. Publishes the chosen view id as the value output.',
|
|
350
|
+
properties: [
|
|
351
|
+
{
|
|
352
|
+
...list('views', 'Views', 'Data', 'View', [
|
|
353
|
+
text('id', 'Id', 'Data', undefined, {
|
|
354
|
+
constraints: {
|
|
355
|
+
required: true
|
|
356
|
+
}
|
|
357
|
+
}),
|
|
358
|
+
text('label', 'Label', 'Content'),
|
|
359
|
+
text('description', 'Description', 'Content')
|
|
360
|
+
], 'The choices.'),
|
|
361
|
+
acceptedBindingKinds: bindable
|
|
362
|
+
},
|
|
363
|
+
text('activeView', 'Active view', 'Data', 'The id of the view in force; bind it to start from a view.'),
|
|
364
|
+
rule('savePermission', 'Save permission', 'Whether "Save current view" works, refuses with a reason, or is not shown.'),
|
|
365
|
+
rule('managePermission', 'Manage permission', 'Whether "Manage views" works, refuses with a reason, or is not shown.'),
|
|
366
|
+
scene_react.valueOutputProperty(scene_model.PropertyValueType.String, 'The id of the chosen view, published as the user chooses.'),
|
|
367
|
+
{
|
|
368
|
+
path: 'action',
|
|
369
|
+
label: 'Requested action',
|
|
370
|
+
group: 'Outputs',
|
|
371
|
+
valueType: scene_model.PropertyValueType.String,
|
|
372
|
+
readOnly: true,
|
|
373
|
+
output: true,
|
|
374
|
+
description: '"save" or "manage" when the user asks for it; the host acts on it.'
|
|
375
|
+
},
|
|
376
|
+
...standardStateProperties
|
|
377
|
+
]
|
|
225
378
|
}
|
|
226
379
|
];
|
|
227
380
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"foundationDescriptors.js","sources":["../../../foundation/foundationDescriptors.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { BindingSourceKind, ComponentDescriptor, PropertyDescriptor, PropertyEditorKind, PropertyValueType } from '@cratis/scene.model';\nimport { componentRegistryKey } from '@cratis/scene.react';\nimport { ComponentName } from '../ComponentName';\nimport { defaultBlueprintName } from '../packageName';\nimport { ComponentState } from './ComponentState';\nimport { NumberFormat } from './formatting';\nimport { PermissionRule } from './PermissionRule';\nimport { StatusTone } from './StatusChip';\n\n/** Data properties take what a screen binds them to: a query's result, a data context or another component's output. */\nexport const bindable = [BindingSourceKind.DataContext, BindingSourceKind.QueryResult, BindingSourceKind.ComponentProperty];\n\nconst text = (path: string, label: string, group: string, description?: string, extra: Partial<PropertyDescriptor> = {}): PropertyDescriptor =>\n ({ path, label, group, valueType: PropertyValueType.String, ...(group === 'Data' ? { acceptedBindingKinds: bindable } : {}), ...(description === undefined ? {} : { description }), ...extra });\n\nconst number = (path: string, label: string, group: string, description?: string, extra: Partial<PropertyDescriptor> = {}): PropertyDescriptor =>\n ({ path, label, group, valueType: PropertyValueType.Number, editorKind: PropertyEditorKind.Number, ...(group === 'Data' ? { acceptedBindingKinds: bindable } : {}), ...(description === undefined ? {} : { description }), ...extra });\n\nconst flag = (path: string, label: string, group: string, description?: string, extra: Partial<PropertyDescriptor> = {}): PropertyDescriptor =>\n ({ path, label, group, valueType: PropertyValueType.Boolean, editorKind: PropertyEditorKind.Boolean, ...(description === undefined ? {} : { description }), ...extra });\n\nconst choice = (path: string, label: string, group: string, values: Record<string, string>, defaultValue: string, description?: string): PropertyDescriptor =>\n ({\n path, label, group, valueType: PropertyValueType.Enum, editorKind: PropertyEditorKind.Enum, default: defaultValue,\n choices: Object.entries(values).map(([value, name]) => ({ value, label: name })), ...(description === undefined ? {} : { description }),\n });\n\nexport const list = (path: string, label: string, group: string, itemLabel: string, properties: PropertyDescriptor[], description?: string): PropertyDescriptor =>\n ({ path, label, group, valueType: PropertyValueType.Collection, default: [], item: { label: itemLabel, properties }, ...(description === undefined ? {} : { description }) });\n\nconst rule = (path: string, label: string, description: string): PropertyDescriptor =>\n choice(path, label, 'Permissions', { [PermissionRule.Enabled]: 'Enabled', [PermissionRule.Disabled]: 'Disabled', [PermissionRule.Hidden]: 'Hidden' }, PermissionRule.Enabled, description);\n\n/** The properties every data-showing foundation component shares: the standard states (spec Part B 1.4) and the cross-cutting rules of 1.5. */\nexport const standardStateProperties: PropertyDescriptor[] = [\n choice('state', 'Preview state', 'State', {\n [ComponentState.Ready]: 'Ready', [ComponentState.Loading]: 'Loading', [ComponentState.Empty]: 'Empty',\n [ComponentState.Error]: 'Error', [ComponentState.NoPermission]: 'No permission', [ComponentState.Partial]: 'Partial',\n }, ComponentState.Ready, 'Forces a state so each can be designed and previewed; empty means the state follows the bound data.'),\n text('error', 'Error message', 'State', 'The message of the error state; setting it puts the component in that state.'),\n flag('loading', 'Loading', 'State', 'Shows the skeleton while the data has not answered.'),\n flag('forbidden', 'Not allowed', 'State', 'Shows the no-permission state, which explains what is missing and shows no data.'),\n text('permissionSubject', 'What access is missing', 'State', 'Names what the user cannot see in the no-permission message.'),\n { path: 'failedRegions', label: 'Failed regions', group: 'State', valueType: PropertyValueType.Json, editorKind: PropertyEditorKind.StringList, default: [], description: 'The parts that failed to load; any entry puts the component in the partial state.' },\n text('emptyHeadline', 'Empty headline', 'State'),\n text('emptyHint', 'Empty hint', 'State'),\n text('emptyActionLabel', 'Empty action', 'State', 'The primary action offered when there is nothing to show.'),\n rule('actionPermission', 'Empty action permission', 'Whether the empty state offers its action, refuses it with a reason, or does not render it.'),\n text('label', 'Label', 'Accessibility', 'The accessible name of the region.'),\n text('locale', 'Locale', 'Content', 'The locale dates, numbers and currency are formatted in; empty follows the document.'),\n choice('density', 'Density', 'Appearance', { comfortable: 'Comfortable', compact: 'Compact' }, 'comfortable'),\n { path: 'strings', label: 'Text overrides', group: 'Content', valueType: PropertyValueType.Object, editorKind: PropertyEditorKind.StringMap, description: 'Replaces the text the component says itself, for localization.' },\n];\n\nconst key = (name: ComponentName) => componentRegistryKey(defaultBlueprintName, name);\n\nconst formats = { [NumberFormat.Number]: 'Number', [NumberFormat.Currency]: 'Currency', [NumberFormat.Percent]: 'Percent', [NumberFormat.Compact]: 'Compact' };\n\n/** What can be edited on the foundation components (Part B 4). Each declares the shape of its data, never values (SD1). */\nexport const foundationDescriptors: ComponentDescriptor[] = [\n {\n component: key(ComponentName.EmptyState),\n displayName: 'Empty state',\n description: 'An icon, a headline, a hint and one primary action; embeddable in any region.',\n properties: [\n text('headline', 'Headline', 'Content', undefined, { default: 'Nothing here yet' }),\n text('hint', 'Hint', 'Content'),\n text('icon', 'Icon', 'Appearance'),\n text('actionLabel', 'Primary action', 'Behavior', 'The label of the one action the state offers; its behaviors say what it does.'),\n rule('actionPermission', 'Action permission', 'Whether the action works, refuses with a reason, or is not rendered.'),\n text('locale', 'Locale', 'Content'),\n { path: 'strings', label: 'Text overrides', group: 'Content', valueType: PropertyValueType.Object, editorKind: PropertyEditorKind.StringMap },\n ],\n },\n {\n component: key(ComponentName.StatCard),\n displayName: 'Stat card',\n description: 'One key figure with its label, trend and the period the trend is compared to.',\n properties: [\n text('label', 'Label', 'Content', 'What the figure measures.', { constraints: { required: true } }),\n number('value', 'Value', 'Data', 'The figure; bind it to a query result.'),\n choice('format', 'Format', 'Appearance', formats, NumberFormat.Number),\n text('currency', 'Currency', 'Appearance', 'The ISO 4217 code when the format is currency.'),\n number('fractionDigits', 'Fraction digits', 'Appearance'),\n number('change', 'Change', 'Data', 'How much the figure moved, as a percentage; bind it to a query result.'),\n choice('goodDirection', 'Good direction', 'Appearance', { up: 'Up is good', down: 'Down is good' }, 'up', 'Which movement is good: a falling response time is.'),\n text('comparison', 'Compared to', 'Content', 'The period the change is compared to, for example \"last month\".'),\n ...standardStateProperties.filter(property => property.path !== 'label'),\n ],\n },\n {\n component: key(ComponentName.TrendChip),\n displayName: 'Trend chip',\n description: 'A change drawn as a direction, a magnitude and whether the movement is good.',\n properties: [\n number('change', 'Change', 'Data', 'The movement; bind it to a query result.'),\n choice('format', 'Format', 'Appearance', formats, NumberFormat.Percent),\n choice('goodDirection', 'Good direction', 'Appearance', { up: 'Up is good', down: 'Down is good' }, 'up'),\n text('comparison', 'Compared to', 'Content'),\n text('locale', 'Locale', 'Content'),\n { path: 'strings', label: 'Text overrides', group: 'Content', valueType: PropertyValueType.Object, editorKind: PropertyEditorKind.StringMap },\n ],\n },\n {\n component: key(ComponentName.StatusChip),\n displayName: 'Status chip',\n description: 'A status shown as a semantic color, an icon and its text; the text is always shown.',\n properties: [\n text('status', 'Status', 'Data', 'The status text; bind it to a query result.', { constraints: { required: true } }),\n choice('tone', 'Tone', 'Appearance', {\n [StatusTone.Success]: 'Success', [StatusTone.Warning]: 'Warning', [StatusTone.Danger]: 'Danger', [StatusTone.Info]: 'Info', [StatusTone.Neutral]: 'Neutral',\n }, StatusTone.Neutral, 'The tone picks the icon and the theme color.'),\n ],\n },\n];\n\n"],"names":["bindable","BindingSourceKind","DataContext","QueryResult","ComponentProperty","text","path","label","group","description","extra","valueType","PropertyValueType","String","acceptedBindingKinds","undefined","number","Number","editorKind","PropertyEditorKind","flag","Boolean","choice","values","defaultValue","Enum","default","choices","Object","entries","map","value","name","list","itemLabel","properties","Collection","item","rule","PermissionRule","Enabled","Disabled","Hidden","standardStateProperties","ComponentState","Ready","Loading","Empty","Error","NoPermission","Partial","Json","StringList","comfortable","compact","StringMap","key","componentRegistryKey","defaultBlueprintName","formats","NumberFormat","Currency","Percent","Compact","foundationDescriptors","component","ComponentName","EmptyState","displayName","StatCard","constraints","required","up","down","filter","property","TrendChip","StatusChip","StatusTone","Success","Warning","Danger","Info","Neutral"],"mappings":";;;;;;;;;;;AAAA;AACA;AAWA,yHACO,MAAMA,QAAAA,GAAW;AAACC,IAAAA,6BAAAA,CAAkBC,WAAW;AAAED,IAAAA,6BAAAA,CAAkBE,WAAW;AAAEF,IAAAA,6BAAAA,CAAkBG;;AAEzG,MAAMC,IAAAA,GAAO,CAACC,IAAAA,EAAcC,KAAAA,EAAeC,KAAAA,EAAeC,aAAsBC,KAAAA,GAAqC,EAAE,IAClH;AAAEJ,QAAAA,IAAAA;AAAMC,QAAAA,KAAAA;AAAOC,QAAAA,KAAAA;AAAOG,QAAAA,SAAAA,EAAWC,8BAAkBC,MAAM;AAAE,QAAA,GAAIL,UAAU,MAAA,GAAS;YAAEM,oBAAAA,EAAsBd;AAAS,SAAA,GAAI,EAAE;QAAG,GAAIS,WAAAA,KAAgBM,SAAAA,GAAY,EAAC,GAAI;AAAEN,YAAAA;SAAa;AAAG,QAAA,GAAGC;KAAM,CAAA;AAEjM,MAAMM,MAAAA,GAAS,CAACV,IAAAA,EAAcC,KAAAA,EAAeC,KAAAA,EA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A,CAAO,eAAA,EAAiB,kBAAkB,YAAA,EAAc;gBAAEkD,EAAAA,EAAI,YAAA;gBAAcC,IAAAA,EAAM;aAAe,EAAG,IAAA,CAAA;AACpGpE,YAAAA,IAAAA,CAAK,cAAc,aAAA,EAAe,SAAA,CAAA;AAClCA,YAAAA,IAAAA,CAAK,UAAU,QAAA,EAAU,SAAA,CAAA;AACzB,YAAA;gBAAEC,IAAAA,EAAM,SAAA;gBAAWC,KAAAA,EAAO,gBAAA;gBAAkBC,KAAAA,EAAO,SAAA;AAAWG,gBAAAA,SAAAA,EAAWC,8BAAkBgB,MAAM;AAAEV,gBAAAA,UAAAA,EAAYC,+BAAmBoC;AAAU;AAC/I;AACL,KAAA;AACA,IAAA;QACIU,SAAAA,EAAWT,GAAAA,CAAIU,4BAAcW,UAAU,CAAA;QACvCT,WAAAA,EAAa,aAAA;QACb3D,WAAAA,EAAa,qFAAA;QACb0B,UAAAA,EAAY;YACR9B,IAAAA,CAAK,QAAA,EAAU,QAAA,EAAU,MAAA,EAAQ,6CAAA,EAA+C;gBAAEiE,WAAAA,EAAa;oBAAEC,QAAAA,EAAU;AAAK;AAAE,aAAA,CAAA;YAClHjD,MAAAA,CAAO,MAAA,EAAQ,QAAQ,YAAA,EAAc;gBACjC,CAACwD,qBAAAA,CAAWC,OAAO,GAAG,SAAA;gBAAW,CAACD,qBAAAA,CAAWE,OAAO,GAAG,SAAA;gBAAW,CAACF,qBAAAA,CAAWG,MAAM,GAAG,QAAA;gBAAU,CAACH,qBAAAA,CAAWI,IAAI,GAAG,MAAA;gBAAQ,CAACJ,qBAAAA,CAAWK,OAAO,GAAG;aACtJ,EAAGL,qBAAAA,CAAWK,OAAO,EAAE,8CAAA;AAC1B;AACL;;;;;;"}
|
|
1
|
+
{"version":3,"file":"foundationDescriptors.js","sources":["../../../foundation/foundationDescriptors.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { BindingSourceKind, ComponentDescriptor, PropertyDescriptor, PropertyEditorKind, PropertyValueType } from '@cratis/scene.model';\nimport { componentRegistryKey, valueOutputProperty } from '@cratis/scene.react';\nimport { ComponentName } from '../ComponentName';\nimport { defaultBlueprintName } from '../packageName';\nimport { ChartKind } from './chartGeometry';\nimport { ComponentState } from './ComponentState';\nimport { FilterFieldType } from './filterModel';\nimport { NumberFormat } from './formatting';\nimport { PermissionRule } from './PermissionRule';\nimport { StatusTone } from './StatusChip';\n\n/** Data properties take what a screen binds them to: a query's result, a data context or another component's output. */\nexport const bindable = [BindingSourceKind.DataContext, BindingSourceKind.QueryResult, BindingSourceKind.ComponentProperty];\n\nconst text = (path: string, label: string, group: string, description?: string, extra: Partial<PropertyDescriptor> = {}): PropertyDescriptor =>\n ({ path, label, group, valueType: PropertyValueType.String, ...(group === 'Data' ? { acceptedBindingKinds: bindable } : {}), ...(description === undefined ? {} : { description }), ...extra });\n\nconst number = (path: string, label: string, group: string, description?: string, extra: Partial<PropertyDescriptor> = {}): PropertyDescriptor =>\n ({ path, label, group, valueType: PropertyValueType.Number, editorKind: PropertyEditorKind.Number, ...(group === 'Data' ? { acceptedBindingKinds: bindable } : {}), ...(description === undefined ? {} : { description }), ...extra });\n\nconst flag = (path: string, label: string, group: string, description?: string, extra: Partial<PropertyDescriptor> = {}): PropertyDescriptor =>\n ({ path, label, group, valueType: PropertyValueType.Boolean, editorKind: PropertyEditorKind.Boolean, ...(description === undefined ? {} : { description }), ...extra });\n\nconst choice = (path: string, label: string, group: string, values: Record<string, string>, defaultValue: string, description?: string): PropertyDescriptor =>\n ({\n path, label, group, valueType: PropertyValueType.Enum, editorKind: PropertyEditorKind.Enum, default: defaultValue,\n choices: Object.entries(values).map(([value, name]) => ({ value, label: name })), ...(description === undefined ? {} : { description }),\n });\n\nexport const list = (path: string, label: string, group: string, itemLabel: string, properties: PropertyDescriptor[], description?: string): PropertyDescriptor =>\n ({ path, label, group, valueType: PropertyValueType.Collection, default: [], item: { label: itemLabel, properties }, ...(description === undefined ? {} : { description }) });\n\nconst rule = (path: string, label: string, description: string): PropertyDescriptor =>\n choice(path, label, 'Permissions', { [PermissionRule.Enabled]: 'Enabled', [PermissionRule.Disabled]: 'Disabled', [PermissionRule.Hidden]: 'Hidden' }, PermissionRule.Enabled, description);\n\n/** The properties every data-showing foundation component shares: the standard states (spec Part B 1.4) and the cross-cutting rules of 1.5. */\nexport const standardStateProperties: PropertyDescriptor[] = [\n choice('state', 'Preview state', 'State', {\n [ComponentState.Ready]: 'Ready', [ComponentState.Loading]: 'Loading', [ComponentState.Empty]: 'Empty',\n [ComponentState.Error]: 'Error', [ComponentState.NoPermission]: 'No permission', [ComponentState.Partial]: 'Partial',\n }, ComponentState.Ready, 'Forces a state so each can be designed and previewed; empty means the state follows the bound data.'),\n text('error', 'Error message', 'State', 'The message of the error state; setting it puts the component in that state.'),\n flag('loading', 'Loading', 'State', 'Shows the skeleton while the data has not answered.'),\n flag('forbidden', 'Not allowed', 'State', 'Shows the no-permission state, which explains what is missing and shows no data.'),\n text('permissionSubject', 'What access is missing', 'State', 'Names what the user cannot see in the no-permission message.'),\n { path: 'failedRegions', label: 'Failed regions', group: 'State', valueType: PropertyValueType.Json, editorKind: PropertyEditorKind.StringList, default: [], description: 'The parts that failed to load; any entry puts the component in the partial state.' },\n text('emptyHeadline', 'Empty headline', 'State'),\n text('emptyHint', 'Empty hint', 'State'),\n text('emptyActionLabel', 'Empty action', 'State', 'The primary action offered when there is nothing to show.'),\n rule('actionPermission', 'Empty action permission', 'Whether the empty state offers its action, refuses it with a reason, or does not render it.'),\n text('label', 'Label', 'Accessibility', 'The accessible name of the region.'),\n text('locale', 'Locale', 'Content', 'The locale dates, numbers and currency are formatted in; empty follows the document.'),\n choice('density', 'Density', 'Appearance', { comfortable: 'Comfortable', compact: 'Compact' }, 'comfortable'),\n { path: 'strings', label: 'Text overrides', group: 'Content', valueType: PropertyValueType.Object, editorKind: PropertyEditorKind.StringMap, description: 'Replaces the text the component says itself, for localization.' },\n];\n\nconst key = (name: ComponentName) => componentRegistryKey(defaultBlueprintName, name);\n\nconst formats = { [NumberFormat.Number]: 'Number', [NumberFormat.Currency]: 'Currency', [NumberFormat.Percent]: 'Percent', [NumberFormat.Compact]: 'Compact' };\n\n/** What can be edited on the foundation components (Part B 4). Each declares the shape of its data, never values (SD1). */\nexport const foundationDescriptors: ComponentDescriptor[] = [\n {\n component: key(ComponentName.EmptyState),\n displayName: 'Empty state',\n description: 'An icon, a headline, a hint and one primary action; embeddable in any region.',\n properties: [\n text('headline', 'Headline', 'Content', undefined, { default: 'Nothing here yet' }),\n text('hint', 'Hint', 'Content'),\n text('icon', 'Icon', 'Appearance'),\n text('actionLabel', 'Primary action', 'Behavior', 'The label of the one action the state offers; its behaviors say what it does.'),\n rule('actionPermission', 'Action permission', 'Whether the action works, refuses with a reason, or is not rendered.'),\n text('locale', 'Locale', 'Content'),\n { path: 'strings', label: 'Text overrides', group: 'Content', valueType: PropertyValueType.Object, editorKind: PropertyEditorKind.StringMap },\n ],\n },\n {\n component: key(ComponentName.StatCard),\n displayName: 'Stat card',\n description: 'One key figure with its label, trend and the period the trend is compared to.',\n properties: [\n text('label', 'Label', 'Content', 'What the figure measures.', { constraints: { required: true } }),\n number('value', 'Value', 'Data', 'The figure; bind it to a query result.'),\n choice('format', 'Format', 'Appearance', formats, NumberFormat.Number),\n text('currency', 'Currency', 'Appearance', 'The ISO 4217 code when the format is currency.'),\n number('fractionDigits', 'Fraction digits', 'Appearance'),\n number('change', 'Change', 'Data', 'How much the figure moved, as a percentage; bind it to a query result.'),\n choice('goodDirection', 'Good direction', 'Appearance', { up: 'Up is good', down: 'Down is good' }, 'up', 'Which movement is good: a falling response time is.'),\n text('comparison', 'Compared to', 'Content', 'The period the change is compared to, for example \"last month\".'),\n ...standardStateProperties.filter(property => property.path !== 'label'),\n ],\n },\n {\n component: key(ComponentName.TrendChip),\n displayName: 'Trend chip',\n description: 'A change drawn as a direction, a magnitude and whether the movement is good.',\n properties: [\n number('change', 'Change', 'Data', 'The movement; bind it to a query result.'),\n choice('format', 'Format', 'Appearance', formats, NumberFormat.Percent),\n choice('goodDirection', 'Good direction', 'Appearance', { up: 'Up is good', down: 'Down is good' }, 'up'),\n text('comparison', 'Compared to', 'Content'),\n text('locale', 'Locale', 'Content'),\n { path: 'strings', label: 'Text overrides', group: 'Content', valueType: PropertyValueType.Object, editorKind: PropertyEditorKind.StringMap },\n ],\n },\n {\n component: key(ComponentName.StatusChip),\n displayName: 'Status chip',\n description: 'A status shown as a semantic color, an icon and its text; the text is always shown.',\n properties: [\n text('status', 'Status', 'Data', 'The status text; bind it to a query result.', { constraints: { required: true } }),\n choice('tone', 'Tone', 'Appearance', {\n [StatusTone.Success]: 'Success', [StatusTone.Warning]: 'Warning', [StatusTone.Danger]: 'Danger', [StatusTone.Info]: 'Info', [StatusTone.Neutral]: 'Neutral',\n }, StatusTone.Neutral, 'The tone picks the icon and the theme color.'),\n ],\n },\n {\n component: key(ComponentName.ChartWrapper),\n displayName: 'Chart',\n description: 'One chart - line, bar, stacked, donut or funnel - with a legend and a table of the same data. A donut and a funnel draw the first series.',\n properties: [\n text('title', 'Title', 'Content'),\n choice('kind', 'Chart type', 'Appearance', {\n [ChartKind.Line]: 'Line', [ChartKind.Bar]: 'Bar', [ChartKind.Stacked]: 'Stacked bar', [ChartKind.Donut]: 'Donut', [ChartKind.Funnel]: 'Funnel',\n }, ChartKind.Line),\n { path: 'categories', label: 'Categories', group: 'Data', valueType: PropertyValueType.Json, editorKind: PropertyEditorKind.StringList, default: [], acceptedBindingKinds: bindable, description: 'The label of each point, bar or slice, in order.' },\n {\n ...list('series', 'Series', 'Data', 'Series', [\n text('name', 'Name', 'Data', undefined, { constraints: { required: true } }),\n { path: 'values', label: 'Values', group: 'Data', valueType: PropertyValueType.Json, editorKind: PropertyEditorKind.NumberList, default: [], description: 'One value for each category.' },\n ], 'What is plotted: a named list of values, one per category.'),\n acceptedBindingKinds: bindable,\n },\n choice('format', 'Value format', 'Appearance', formats, NumberFormat.Number),\n text('currency', 'Currency', 'Appearance', 'The ISO 4217 code when the format is currency.'),\n ...standardStateProperties.filter(property => property.path !== 'label'),\n ],\n },\n {\n component: key(ComponentName.FilterBuilder),\n displayName: 'Filter builder',\n description: 'Conditions on fields, joined by AND or OR in groups that nest three deep. The filter is published as the value output; the component filters nothing itself.',\n properties: [\n {\n ...list('fields', 'Fields', 'Data', 'Field', [\n text('name', 'Name', 'Data', 'The result field the condition tests.', { constraints: { required: true }, editorKind: PropertyEditorKind.Field }),\n text('label', 'Label', 'Content'),\n choice('type', 'Type', 'Data', {\n [FilterFieldType.Text]: 'Text', [FilterFieldType.Number]: 'Number', [FilterFieldType.Date]: 'Date', [FilterFieldType.Select]: 'Select', [FilterFieldType.Boolean]: 'Yes / no',\n }, FilterFieldType.Text, 'Decides the operators offered.'),\n { path: 'options', label: 'Options', group: 'Data', valueType: PropertyValueType.Json, editorKind: PropertyEditorKind.StringList, default: [], description: 'The choices of a select field.' },\n ], 'What can be filtered.'),\n acceptedBindingKinds: bindable,\n },\n { path: 'filter', label: 'Initial filter', group: 'Data', valueType: PropertyValueType.Object, acceptedBindingKinds: bindable, description: 'A filter to start from, usually bound to the active saved view.' },\n rule('editPermission', 'Edit permission', 'Enabled lets the user change the filter; disabled shows it read-only.'),\n valueOutputProperty(PropertyValueType.Object, 'The filter as the user has built it: { operator, conditions, groups }, published as it changes.'),\n ...standardStateProperties,\n ],\n },\n {\n component: key(ComponentName.ColumnChooser),\n displayName: 'Column chooser',\n description: 'Which columns a table shows, and in what order. Publishes the ordered ids of the visible columns as the value output.',\n properties: [\n {\n ...list('columns', 'Columns', 'Data', 'Column', [\n text('id', 'Id', 'Data', 'The result field the column shows.', { constraints: { required: true }, editorKind: PropertyEditorKind.Field }),\n text('label', 'Label', 'Content'),\n flag('visible', 'Visible', 'Content', 'Whether the column starts shown.', { default: true }),\n flag('locked', 'Always shown', 'Content', 'A locked column cannot be hidden: the identifying column is.'),\n ], 'What could be shown.'),\n acceptedBindingKinds: bindable,\n },\n valueOutputProperty(PropertyValueType.Json, 'The ids of the visible columns, in order, published as the user changes them.'),\n ...standardStateProperties,\n ],\n },\n {\n component: key(ComponentName.SavedViewsMenu),\n displayName: 'Saved views menu',\n description: 'A list\\'s saved views as a menu button, with the current view as its label. Publishes the chosen view id as the value output.',\n properties: [\n {\n ...list('views', 'Views', 'Data', 'View', [\n text('id', 'Id', 'Data', undefined, { constraints: { required: true } }),\n text('label', 'Label', 'Content'),\n text('description', 'Description', 'Content'),\n ], 'The choices.'),\n acceptedBindingKinds: bindable,\n },\n text('activeView', 'Active view', 'Data', 'The id of the view in force; bind it to start from a view.'),\n rule('savePermission', 'Save permission', 'Whether \"Save current view\" works, refuses with a reason, or is not shown.'),\n rule('managePermission', 'Manage permission', 'Whether \"Manage views\" works, refuses with a reason, or is not shown.'),\n valueOutputProperty(PropertyValueType.String, 'The id of the chosen view, published as the user chooses.'),\n { path: 'action', label: 'Requested action', group: 'Outputs', valueType: PropertyValueType.String, readOnly: true, output: true, description: '\"save\" or \"manage\" when the user asks for it; the host acts on it.' },\n ...standardStateProperties,\n ],\n },\n];\n\n"],"names":["bindable","BindingSourceKind","DataContext","QueryResult","ComponentProperty","text","path","label","group","description","extra","valueType","PropertyValueType","String","acceptedBindingKinds","undefined","number","Number","editorKind","PropertyEditorKind","flag","Boolean","choice","values","defaultValue","Enum","default","choices","Object","entries","map","value","name","list","itemLabel","properties","Collection","item","rule","PermissionRule","Enabled","Disabled","Hidden","standardStateProperties","ComponentState","Ready","Loading","Empty","Error","NoPermission","Partial","Json","StringList","comfortable","compact","StringMap","key","componentRegistryKey","defaultBlueprintName","formats","NumberFormat","Currency","Percent","Compact","foundationDescriptors","component","ComponentName","EmptyState","displayName","StatCard","constraints","required","up","down","filter","property","TrendChip","StatusChip","StatusTone","Success","Warning","Danger","Info","Neutral","ChartWrapper","ChartKind","Line","Bar","Stacked","Donut","Funnel","NumberList","FilterBuilder","Field","FilterField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CAAK,IAAA,EAAM,IAAA,EAAM,MAAA,EAAQU,SAAAA,EAAW;wBAAEuD,WAAAA,EAAa;4BAAEC,QAAAA,EAAU;AAAK;AAAE,qBAAA,CAAA;AACtElE,oBAAAA,IAAAA,CAAK,SAAS,OAAA,EAAS,SAAA,CAAA;AACvBA,oBAAAA,IAAAA,CAAK,eAAe,aAAA,EAAe,SAAA;AACtC,iBAAA,EAAE,cAAA,CAAe;gBAClBS,oBAAAA,EAAsBd;AAC1B,aAAA;YACAK,IAAAA,CAAK,YAAA,EAAc,eAAe,MAAA,EAAQ,4DAAA,CAAA;AAC1CiC,YAAAA,IAAAA,CAAK,kBAAkB,iBAAA,EAAmB,4EAAA,CAAA;AAC1CA,YAAAA,IAAAA,CAAK,oBAAoB,mBAAA,EAAqB,uEAAA,CAAA;YAC9C4D,+BAAAA,CAAoBtF,6BAAAA,CAAkBC,MAAM,EAAE,2DAAA,CAAA;AAC9C,YAAA;gBAAEP,IAAAA,EAAM,QAAA;gBAAUC,KAAAA,EAAO,kBAAA;gBAAoBC,KAAAA,EAAO,SAAA;AAAWG,gBAAAA,SAAAA,EAAWC,8BAAkBC,MAAM;gBAAEwF,QAAAA,EAAU,IAAA;gBAAMC,MAAAA,EAAQ,IAAA;gBAAM7F,WAAAA,EAAa;AAAqE,aAAA;AACjNkC,YAAAA,GAAAA;AACN;AACL;;;;;;"}
|
|
@@ -49,6 +49,136 @@ const foundationSamples = {
|
|
|
49
49
|
},
|
|
50
50
|
data: [],
|
|
51
51
|
stateful: false
|
|
52
|
+
},
|
|
53
|
+
[ComponentName.ComponentName.ChartWrapper]: {
|
|
54
|
+
properties: {
|
|
55
|
+
title: 'Revenue by quarter',
|
|
56
|
+
kind: 'line',
|
|
57
|
+
categories: [
|
|
58
|
+
'Q1',
|
|
59
|
+
'Q2',
|
|
60
|
+
'Q3',
|
|
61
|
+
'Q4'
|
|
62
|
+
],
|
|
63
|
+
series: [
|
|
64
|
+
{
|
|
65
|
+
name: 'Revenue',
|
|
66
|
+
values: [
|
|
67
|
+
120,
|
|
68
|
+
180,
|
|
69
|
+
150,
|
|
70
|
+
240
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: 'Target',
|
|
75
|
+
values: [
|
|
76
|
+
100,
|
|
77
|
+
150,
|
|
78
|
+
200,
|
|
79
|
+
220
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
locale: 'en-US'
|
|
84
|
+
},
|
|
85
|
+
data: [
|
|
86
|
+
'Revenue by quarter'
|
|
87
|
+
],
|
|
88
|
+
stateful: true
|
|
89
|
+
},
|
|
90
|
+
[ComponentName.ComponentName.FilterBuilder]: {
|
|
91
|
+
properties: {
|
|
92
|
+
fields: [
|
|
93
|
+
{
|
|
94
|
+
name: 'owner',
|
|
95
|
+
label: 'Owner',
|
|
96
|
+
type: 'text'
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: 'status',
|
|
100
|
+
label: 'Status',
|
|
101
|
+
type: 'select',
|
|
102
|
+
options: [
|
|
103
|
+
'Open',
|
|
104
|
+
'Won',
|
|
105
|
+
'Lost'
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: 'value',
|
|
110
|
+
label: 'Value',
|
|
111
|
+
type: 'number'
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
filter: {
|
|
115
|
+
operator: 'and',
|
|
116
|
+
conditions: [
|
|
117
|
+
{
|
|
118
|
+
field: 'status',
|
|
119
|
+
operator: 'is',
|
|
120
|
+
value: 'Open'
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
field: 'owner',
|
|
124
|
+
operator: 'contains',
|
|
125
|
+
value: 'Ada'
|
|
126
|
+
}
|
|
127
|
+
],
|
|
128
|
+
groups: []
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
data: [
|
|
132
|
+
'2 active filters'
|
|
133
|
+
],
|
|
134
|
+
stateful: true
|
|
135
|
+
},
|
|
136
|
+
[ComponentName.ComponentName.ColumnChooser]: {
|
|
137
|
+
properties: {
|
|
138
|
+
columns: [
|
|
139
|
+
{
|
|
140
|
+
id: 'name',
|
|
141
|
+
label: 'Name',
|
|
142
|
+
locked: true
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
id: 'owner',
|
|
146
|
+
label: 'Owner'
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
id: 'status',
|
|
150
|
+
label: 'Status',
|
|
151
|
+
visible: false
|
|
152
|
+
}
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
data: [
|
|
156
|
+
'3 shown'
|
|
157
|
+
],
|
|
158
|
+
stateful: true
|
|
159
|
+
},
|
|
160
|
+
[ComponentName.ComponentName.SavedViewsMenu]: {
|
|
161
|
+
properties: {
|
|
162
|
+
views: [
|
|
163
|
+
{
|
|
164
|
+
id: 'all',
|
|
165
|
+
label: 'All leads'
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
id: 'mine',
|
|
169
|
+
label: 'Mine'
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
id: 'overdue',
|
|
173
|
+
label: 'Overdue'
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
activeView: 'mine'
|
|
177
|
+
},
|
|
178
|
+
data: [
|
|
179
|
+
'Mine'
|
|
180
|
+
],
|
|
181
|
+
stateful: true
|
|
52
182
|
}
|
|
53
183
|
};
|
|
54
184
|
/** A scene element for a foundation component, populated with its sample unless properties are given, with the state forced when asked. */ function foundationElement(name, properties, state) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"foundationSamples.js","sources":["../../../foundation/foundationSamples.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ExternalComponent } from '@cratis/scene.model';\nimport { componentRegistryKey } from '@cratis/scene.react';\nimport { ComponentName } from '../ComponentName';\nimport { defaultBlueprintName } from '../packageName';\nimport { ComponentState } from './ComponentState';\n\n/**\n * What a story or a specification feeds each foundation component to see it populated.\n *\n * These are design-time and test-time values, never part of what a component is: a component declares the shape of its data\n * and a screen binds it to a query (spec SD1). The domain blueprints supply real preview data as sample-data packs; this is\n * only enough to draw each component in each state.\n */\nexport interface FoundationSample {\n /** The properties that make the component populated. */\n properties: Record<string, unknown>;\n\n /** Text that only appears when the component shows its data, so a specification can prove the no-permission state shows none of it. */\n data: string[];\n\n /** Whether the component shows data and so owns the five standard states; chips and the empty state themselves do not. */\n stateful: boolean;\n}\n\nexport const foundationSamples: Record<string, FoundationSample> = {\n [ComponentName.EmptyState]: { properties: { headline: 'No invoices yet', hint: 'Invoices you create appear here.', icon: 'file', actionLabel: 'New invoice' }, data: [], stateful: false },\n [ComponentName.StatCard]: { properties: { label: 'Open pipeline', value: 1234567, format: 'currency', currency: 'USD', change: 12.5, comparison: 'last month', locale: 'en-US' }, data: ['$1,234,567'], stateful: true },\n [ComponentName.TrendChip]: { properties: { change: -3.2, goodDirection: 'down', comparison: 'last week', locale: 'en-US' }, data: [], stateful: false },\n [ComponentName.StatusChip]: { properties: { status: 'Awaiting approval', tone: 'warning' }, data: [], stateful: false },\n};\n\n/** A scene element for a foundation component, populated with its sample unless properties are given, with the state forced when asked. */\nexport function foundationElement(name: string, properties?: Record<string, unknown>, state?: ComponentState): ExternalComponent {\n const sample = foundationSamples[name];\n return {\n id: `${name}-sample`,\n componentName: componentRegistryKey(defaultBlueprintName, name),\n properties: { ...(properties ?? sample?.properties ?? {}), ...(state === undefined ? {} : { state }) },\n slots: {},\n } as unknown as ExternalComponent;\n}\n"],"names":["foundationSamples","ComponentName","EmptyState","properties","headline","hint","icon","actionLabel","data","stateful","StatCard","label","value","format","currency","change","comparison","locale","TrendChip","goodDirection","StatusChip","status","tone","
|
|
1
|
+
{"version":3,"file":"foundationSamples.js","sources":["../../../foundation/foundationSamples.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ExternalComponent } from '@cratis/scene.model';\nimport { componentRegistryKey } from '@cratis/scene.react';\nimport { ComponentName } from '../ComponentName';\nimport { defaultBlueprintName } from '../packageName';\nimport { ComponentState } from './ComponentState';\n\n/**\n * What a story or a specification feeds each foundation component to see it populated.\n *\n * These are design-time and test-time values, never part of what a component is: a component declares the shape of its data\n * and a screen binds it to a query (spec SD1). The domain blueprints supply real preview data as sample-data packs; this is\n * only enough to draw each component in each state.\n */\nexport interface FoundationSample {\n /** The properties that make the component populated. */\n properties: Record<string, unknown>;\n\n /** Text that only appears when the component shows its data, so a specification can prove the no-permission state shows none of it. */\n data: string[];\n\n /** Whether the component shows data and so owns the five standard states; chips and the empty state themselves do not. */\n stateful: boolean;\n}\n\nexport const foundationSamples: Record<string, FoundationSample> = {\n [ComponentName.EmptyState]: { properties: { headline: 'No invoices yet', hint: 'Invoices you create appear here.', icon: 'file', actionLabel: 'New invoice' }, data: [], stateful: false },\n [ComponentName.StatCard]: { properties: { label: 'Open pipeline', value: 1234567, format: 'currency', currency: 'USD', change: 12.5, comparison: 'last month', locale: 'en-US' }, data: ['$1,234,567'], stateful: true },\n [ComponentName.TrendChip]: { properties: { change: -3.2, goodDirection: 'down', comparison: 'last week', locale: 'en-US' }, data: [], stateful: false },\n [ComponentName.StatusChip]: { properties: { status: 'Awaiting approval', tone: 'warning' }, data: [], stateful: false },\n [ComponentName.ChartWrapper]: {\n properties: { title: 'Revenue by quarter', kind: 'line', categories: ['Q1', 'Q2', 'Q3', 'Q4'], series: [{ name: 'Revenue', values: [120, 180, 150, 240] }, { name: 'Target', values: [100, 150, 200, 220] }], locale: 'en-US' },\n data: ['Revenue by quarter'], stateful: true,\n },\n [ComponentName.FilterBuilder]: {\n properties: {\n fields: [{ name: 'owner', label: 'Owner', type: 'text' }, { name: 'status', label: 'Status', type: 'select', options: ['Open', 'Won', 'Lost'] }, { name: 'value', label: 'Value', type: 'number' }],\n filter: { operator: 'and', conditions: [{ field: 'status', operator: 'is', value: 'Open' }, { field: 'owner', operator: 'contains', value: 'Ada' }], groups: [] },\n },\n data: ['2 active filters'], stateful: true,\n },\n [ComponentName.ColumnChooser]: {\n properties: { columns: [{ id: 'name', label: 'Name', locked: true }, { id: 'owner', label: 'Owner' }, { id: 'status', label: 'Status', visible: false }] },\n data: ['3 shown'], stateful: true,\n },\n [ComponentName.SavedViewsMenu]: {\n properties: { views: [{ id: 'all', label: 'All leads' }, { id: 'mine', label: 'Mine' }, { id: 'overdue', label: 'Overdue' }], activeView: 'mine' },\n data: ['Mine'], stateful: true,\n },\n};\n\n/** A scene element for a foundation component, populated with its sample unless properties are given, with the state forced when asked. */\nexport function foundationElement(name: string, properties?: Record<string, unknown>, state?: ComponentState): ExternalComponent {\n const sample = foundationSamples[name];\n return {\n id: `${name}-sample`,\n componentName: componentRegistryKey(defaultBlueprintName, name),\n properties: { ...(properties ?? sample?.properties ?? {}), ...(state === undefined ? {} : { state }) },\n slots: {},\n } as unknown as ExternalComponent;\n}\n"],"names":["foundationSamples","ComponentName","EmptyState","properties","headline","hint","icon","actionLabel","data","stateful","StatCard","label","value","format","currency","change","comparison","locale","TrendChip","goodDirection","StatusChip","status","tone","ChartWrapper","title","kind","categories","series","name","values","FilterBuilder","fields","type","options","filter","operator","conditions","field","groups","ColumnChooser","columns","id","locked","visible","SavedViewsMenu","views","activeView","foundationElement","state","sample","componentName","componentRegistryKey","defaultBlueprintName","undefined","slots"],"mappings":";;;;;;AAAA;AACA;MA0BaA,iBAAAA,GAAsD;IAC/D,CAACC,2BAAAA,CAAcC,UAAU,GAAG;QAAEC,UAAAA,EAAY;YAAEC,QAAAA,EAAU,iBAAA;YAAmBC,IAAAA,EAAM,kCAAA;YAAoCC,IAAAA,EAAM,MAAA;YAAQC,WAAAA,EAAa;AAAc,SAAA;AAAGC,QAAAA,IAAAA,EAAM,EAAE;QAAEC,QAAAA,EAAU;AAAM,KAAA;IACzL,CAACR,2BAAA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AA;AACrGM,QAAAA,KAAAA,EAAO;AACX,KAAA;AACJ;;;"}
|
|
@@ -43,14 +43,39 @@
|
|
|
43
43
|
filterOperator: 'Operator',
|
|
44
44
|
filterValue: 'Value',
|
|
45
45
|
filterClear: 'Clear filters',
|
|
46
|
+
filterCondition: 'Condition {n}',
|
|
47
|
+
filterGroup: 'Group {n}',
|
|
48
|
+
filterNoFields: 'There are no fields to filter on',
|
|
49
|
+
opContains: 'contains',
|
|
50
|
+
opEquals: 'equals',
|
|
51
|
+
opNotEquals: 'does not equal',
|
|
52
|
+
opStartsWith: 'starts with',
|
|
53
|
+
opIsEmpty: 'is empty',
|
|
54
|
+
opGreater: 'is greater than',
|
|
55
|
+
opGreaterOrEqual: 'is at least',
|
|
56
|
+
opLess: 'is less than',
|
|
57
|
+
opLessOrEqual: 'is at most',
|
|
58
|
+
opBefore: 'is before',
|
|
59
|
+
opAfter: 'is after',
|
|
60
|
+
opOn: 'is on',
|
|
61
|
+
opIs: 'is',
|
|
62
|
+
opIsNot: 'is not',
|
|
63
|
+
opTrue: 'is yes',
|
|
64
|
+
opFalse: 'is no',
|
|
46
65
|
filterSummary: '{count} active filters',
|
|
66
|
+
filterSummaryOne: '1 active filter',
|
|
47
67
|
columnsChoose: 'Columns',
|
|
48
68
|
columnsLocked: 'always shown',
|
|
49
69
|
columnsReset: 'Show all columns',
|
|
70
|
+
columnsMoveUp: 'Move {name} up',
|
|
71
|
+
columnsMoveDown: 'Move {name} down',
|
|
72
|
+
columnsShown: '{shown} of {total} shown',
|
|
73
|
+
columnsNone: 'There are no columns to choose from',
|
|
50
74
|
viewsLabel: 'Saved views',
|
|
51
75
|
viewsDefault: 'All items',
|
|
52
76
|
viewsSave: 'Save current view',
|
|
53
77
|
viewsManage: 'Manage views',
|
|
78
|
+
viewsNone: 'There are no saved views',
|
|
54
79
|
checklistProgress: '{done} of {total} complete',
|
|
55
80
|
checklistOwner: 'Owner',
|
|
56
81
|
checklistDue: 'Due',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"foundationStrings.js","sources":["../../../foundation/foundationStrings.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ExternalComponent } from '@cratis/scene.model';\n\n/**\n * Every piece of text the foundation components say themselves, as opposed to text a screen author or a bound query\n * supplies. Nothing is hard-coded in a component (spec Part B 1.5): a component reads its text from here, merged with\n * the `strings` property of the element, so an application localizes by supplying a table - and a bound string\n * (a `{name}` placeholder is replaced by the values the component passes) arrives the same way any other property does.\n */\nexport const foundationStrings = {\n loading: 'Loading',\n emptyHeadline: 'Nothing here yet',\n emptyHint: 'There is nothing to show for now.',\n errorHeadline: 'This could not be loaded',\n errorHint: 'Something went wrong while loading. Try again in a moment.',\n retry: 'Try again',\n noPermissionHeadline: 'You do not have access',\n noPermissionHint: 'Ask an administrator to grant you access to {subject}.',\n noPermissionSubject: 'this content',\n partialHeadline: 'Some parts could not be loaded',\n partialHint: 'The unavailable parts are: {regions}.',\n disabledNoPermission: 'You do not have permission to do this',\n trendUp: 'up {value}',\n trendDown: 'down {value}',\n trendFlat: 'unchanged',\n trendComparison: 'compared to {period}',\n statusSuccess: 'Success',\n statusWarning: 'Warning',\n statusDanger: 'Problem',\n statusInfo: 'Information',\n statusNeutral: 'Status',\n chartNoData: 'No data to chart',\n chartDataTable: 'Chart data',\n chartSeries: 'Series',\n chartCategory: 'Category',\n filterAdd: 'Add condition',\n filterAddGroup: 'Add group',\n filterRemove: 'Remove condition',\n filterRemoveGroup: 'Remove group',\n filterMatchAll: 'Match all (AND)',\n filterMatchAny: 'Match any (OR)',\n filterField: 'Field',\n filterOperator: 'Operator',\n filterValue: 'Value',\n filterClear: 'Clear filters',\n filterSummary: '{count} active filters',\n columnsChoose: 'Columns',\n columnsLocked: 'always shown',\n columnsReset: 'Show all columns',\n viewsLabel: 'Saved views',\n viewsDefault: 'All items',\n viewsSave: 'Save current view',\n viewsManage: 'Manage views',\n checklistProgress: '{done} of {total} complete',\n checklistOwner: 'Owner',\n checklistDue: 'Due',\n activityEmpty: 'No activity yet',\n avatarOverflow: '{count} more',\n avatarPeople: '{count} people',\n uploadDrop: 'Drop files here or',\n uploadBrowse: 'Browse files',\n uploadRemove: 'Remove {name}',\n uploadTooLarge: '{name} is larger than {limit}',\n uploadWrongType: '{name} is not an accepted file type',\n uploadUploading: 'Uploading',\n uploadDone: 'Uploaded',\n uploadFailed: 'Upload failed',\n approvalPending: 'Pending',\n approvalCurrent: 'Awaiting decision',\n approvalApproved: 'Approved',\n approvalRejected: 'Rejected',\n approvalSkipped: 'Skipped',\n approvalChain: 'Approval chain',\n orgExpand: 'Expand {name}',\n orgCollapse: 'Collapse {name}',\n orgReports: '{count} reports',\n matrixAllowed: 'Allowed',\n matrixDenied: 'Not allowed',\n matrixGrant: 'Grant {permission} to {role}',\n matrixReadOnly: 'Read-only',\n} as const;\n\n/** The name of one of the foundation strings. */\nexport type FoundationStringName = keyof typeof foundationStrings;\n\n/** The text table a foundation component works with. */\nexport type FoundationStrings = Record<FoundationStringName, string>;\n\n/**\n * The foundation strings with the element's own `strings` property laid over them.\n *\n * Only string values of known names are taken, so a typo in an application's table falls back to the default text\n * rather than rendering nothing.\n */\nexport function readFoundationStrings(element: ExternalComponent): FoundationStrings {\n const supplied = element.properties.strings;\n const result: FoundationStrings = { ...foundationStrings };\n if (typeof supplied !== 'object' || supplied === null || Array.isArray(supplied)) return result;\n\n for (const [name, value] of Object.entries(supplied as Record<string, unknown>)) {\n if (name in foundationStrings && typeof value === 'string') result[name as FoundationStringName] = value;\n }\n\n return result;\n}\n\n/** Replaces each `{name}` in a string with the value of the same name, leaving an unknown placeholder visible rather than blank. */\nexport function formatText(text: string, values: Record<string, string | number> = {}): string {\n return text.replace(/\\{(\\w+)\\}/g, (placeholder, name: string) => (name in values ? String(values[name]) : placeholder));\n}\n"],"names":["foundationStrings","loading","emptyHeadline","emptyHint","errorHeadline","errorHint","retry","noPermissionHeadline","noPermissionHint","noPermissionSubject","partialHeadline","partialHint","disabledNoPermission","trendUp","trendDown","trendFlat","trendComparison","statusSuccess","statusWarning","statusDanger","statusInfo","statusNeutral","chartNoData","chartDataTable","chartSeries","chartCategory","filterAdd","filterAddGroup","filterRemove","filterRemoveGroup","filterMatchAll","filterMatchAny","filterField","filterOperator","filterValue","filterClear","filterSummary","columnsChoose","columnsLocked","columnsReset","viewsLabel","viewsDefault","viewsSave","viewsManage","checklistProgress","checklistOwner","checklistDue","activityEmpty","avatarOverflow","avatarPeople","uploadDrop","uploadBrowse","uploadRemove","uploadTooLarge","uploadWrongType","uploadUploading","uploadDone","uploadFailed","approvalPending","approvalCurrent","approvalApproved","approvalRejected","approvalSkipped","approvalChain","orgExpand","orgCollapse","orgReports","matrixAllowed","matrixDenied","matrixGrant","matrixReadOnly","readFoundationStrings","element","supplied","properties","strings","result","Array","isArray","name","value","Object","entries","formatText","text","values","replace","placeholder","String"],"mappings":";;AAAA;AACA;AAIA;;;;;UAMaA,iBAAAA,GAAoB;IAC7BC,OAAAA,EAAS,SAAA;IACTC,aAAAA,EAAe,kBAAA;IACfC,SAAAA,EAAW,mCAAA;IACXC,aAAAA,EAAe,0BAAA;IACfC,SAAAA,EAAW,4DAAA;IACXC,KAAAA,EAAO,WAAA;IACPC,oBAAAA,EAAsB,wBAAA;IACtBC,gBAAAA,EAAkB,wDAAA;IAClBC,mBAAAA,EAAqB,cAAA;IACrBC,eAAAA,EAAiB,gCAAA;IACjBC,WAAAA,EAAa,uCAAA;IACbC,oBAAAA,EAAsB,uCAAA;IACtBC,OAAAA,EAAS,YAAA;IACTC,SAAAA,EAAW,cAAA;IACXC,SAAAA,EAAW,WAAA;IACXC,eAAAA,EAAiB,sBAAA;IACjBC,aAAAA,EAAe,SAAA;IACfC,aAAAA,EAAe,SAAA;IACfC,YAAAA,EAAc,SAAA;IACdC,UAAAA,EAAY,aAAA;IACZC,aAAAA,EAAe,QAAA;IACfC,WAAAA,EAAa,kBAAA;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,WAAAA,EAAa,8BAAA;IACbC,cAAAA,EAAgB;AACpB;AAQA;;;;;IAMO,SAASC,qBAAAA,CAAsBC,OAA0B,EAAA;AAC5D,IAAA,MAAMC,QAAAA,GAAWD,OAAAA,CAAQE,UAAU,CAACC,OAAO;AAC3C,IAAA,MAAMC,MAAAA,GAA4B;AAAE,QAAA,GAAG5E;AAAkB,KAAA;IACzD,IAAI,OAAOyE,aAAa,QAAA,IAAYA,QAAAA,KAAa,QAAQI,KAAAA,CAAMC,OAAO,CAACL,QAAAA,CAAAA,EAAW,OAAOG,MAAAA;IAEzF,KAAK,MAAM,CAACG,IAAAA,EAAMC,KAAAA,CAAM,IAAIC,MAAAA,CAAOC,OAAO,CAACT,QAAAA,CAAAA,CAAsC;QAC7E,IAAIM,IAAAA,IAAQ/E,qBAAqB,OAAOgF,KAAAA,KAAU,UAAUJ,MAAM,CAACG,KAA6B,GAAGC,KAAAA;AACvG,IAAA;IAEA,OAAOJ,MAAAA;AACX;AAEA,qIACO,SAASO,UAAAA,CAAWC,IAAY,EAAEC,MAAAA,GAA0C,EAAE,EAAA;AACjF,IAAA,OAAOD,IAAAA,CAAKE,OAAO,CAAC,YAAA,EAAc,CAACC,WAAAA,EAAaR,IAAAA,GAAkBA,IAAAA,IAAQM,MAAAA,GAASG,MAAAA,CAAOH,MAAM,CAACN,KAAK,CAAA,GAAIQ,WAAAA,CAAAA;AAC9G;;;;"}
|
|
1
|
+
{"version":3,"file":"foundationStrings.js","sources":["../../../foundation/foundationStrings.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ExternalComponent } from '@cratis/scene.model';\n\n/**\n * Every piece of text the foundation components say themselves, as opposed to text a screen author or a bound query\n * supplies. Nothing is hard-coded in a component (spec Part B 1.5): a component reads its text from here, merged with\n * the `strings` property of the element, so an application localizes by supplying a table - and a bound string\n * (a `{name}` placeholder is replaced by the values the component passes) arrives the same way any other property does.\n */\nexport const foundationStrings = {\n loading: 'Loading',\n emptyHeadline: 'Nothing here yet',\n emptyHint: 'There is nothing to show for now.',\n errorHeadline: 'This could not be loaded',\n errorHint: 'Something went wrong while loading. Try again in a moment.',\n retry: 'Try again',\n noPermissionHeadline: 'You do not have access',\n noPermissionHint: 'Ask an administrator to grant you access to {subject}.',\n noPermissionSubject: 'this content',\n partialHeadline: 'Some parts could not be loaded',\n partialHint: 'The unavailable parts are: {regions}.',\n disabledNoPermission: 'You do not have permission to do this',\n trendUp: 'up {value}',\n trendDown: 'down {value}',\n trendFlat: 'unchanged',\n trendComparison: 'compared to {period}',\n statusSuccess: 'Success',\n statusWarning: 'Warning',\n statusDanger: 'Problem',\n statusInfo: 'Information',\n statusNeutral: 'Status',\n chartNoData: 'No data to chart',\n chartDataTable: 'Chart data',\n chartSeries: 'Series',\n chartCategory: 'Category',\n filterAdd: 'Add condition',\n filterAddGroup: 'Add group',\n filterRemove: 'Remove condition',\n filterRemoveGroup: 'Remove group',\n filterMatchAll: 'Match all (AND)',\n filterMatchAny: 'Match any (OR)',\n filterField: 'Field',\n filterOperator: 'Operator',\n filterValue: 'Value',\n filterClear: 'Clear filters',\n filterCondition: 'Condition {n}',\n filterGroup: 'Group {n}',\n filterNoFields: 'There are no fields to filter on',\n opContains: 'contains',\n opEquals: 'equals',\n opNotEquals: 'does not equal',\n opStartsWith: 'starts with',\n opIsEmpty: 'is empty',\n opGreater: 'is greater than',\n opGreaterOrEqual: 'is at least',\n opLess: 'is less than',\n opLessOrEqual: 'is at most',\n opBefore: 'is before',\n opAfter: 'is after',\n opOn: 'is on',\n opIs: 'is',\n opIsNot: 'is not',\n opTrue: 'is yes',\n opFalse: 'is no',\n filterSummary: '{count} active filters',\n filterSummaryOne: '1 active filter',\n columnsChoose: 'Columns',\n columnsLocked: 'always shown',\n columnsReset: 'Show all columns',\n columnsMoveUp: 'Move {name} up',\n columnsMoveDown: 'Move {name} down',\n columnsShown: '{shown} of {total} shown',\n columnsNone: 'There are no columns to choose from',\n viewsLabel: 'Saved views',\n viewsDefault: 'All items',\n viewsSave: 'Save current view',\n viewsManage: 'Manage views',\n viewsNone: 'There are no saved views',\n checklistProgress: '{done} of {total} complete',\n checklistOwner: 'Owner',\n checklistDue: 'Due',\n activityEmpty: 'No activity yet',\n avatarOverflow: '{count} more',\n avatarPeople: '{count} people',\n uploadDrop: 'Drop files here or',\n uploadBrowse: 'Browse files',\n uploadRemove: 'Remove {name}',\n uploadTooLarge: '{name} is larger than {limit}',\n uploadWrongType: '{name} is not an accepted file type',\n uploadUploading: 'Uploading',\n uploadDone: 'Uploaded',\n uploadFailed: 'Upload failed',\n approvalPending: 'Pending',\n approvalCurrent: 'Awaiting decision',\n approvalApproved: 'Approved',\n approvalRejected: 'Rejected',\n approvalSkipped: 'Skipped',\n approvalChain: 'Approval chain',\n orgExpand: 'Expand {name}',\n orgCollapse: 'Collapse {name}',\n orgReports: '{count} reports',\n matrixAllowed: 'Allowed',\n matrixDenied: 'Not allowed',\n matrixGrant: 'Grant {permission} to {role}',\n matrixReadOnly: 'Read-only',\n} as const;\n\n/** The name of one of the foundation strings. */\nexport type FoundationStringName = keyof typeof foundationStrings;\n\n/** The text table a foundation component works with. */\nexport type FoundationStrings = Record<FoundationStringName, string>;\n\n/**\n * The foundation strings with the element's own `strings` property laid over them.\n *\n * Only string values of known names are taken, so a typo in an application's table falls back to the default text\n * rather than rendering nothing.\n */\nexport function readFoundationStrings(element: ExternalComponent): FoundationStrings {\n const supplied = element.properties.strings;\n const result: FoundationStrings = { ...foundationStrings };\n if (typeof supplied !== 'object' || supplied === null || Array.isArray(supplied)) return result;\n\n for (const [name, value] of Object.entries(supplied as Record<string, unknown>)) {\n if (name in foundationStrings && typeof value === 'string') result[name as FoundationStringName] = value;\n }\n\n return result;\n}\n\n/** Replaces each `{name}` in a string with the value of the same name, leaving an unknown placeholder visible rather than blank. */\nexport function formatText(text: string, values: Record<string, string | number> = {}): string {\n return text.replace(/\\{(\\w+)\\}/g, (placeholder, name: string) => (name in values ? String(values[name]) : placeholder));\n}\n"],"names":["foundationStrings","loading","emptyHeadline","emptyHint","errorHeadline","errorHint","retry","noPermissionHeadline","noPermissionHint","noPermissionSubject","partialHeadline","partialHint","disabledNoPermission","trendUp","trendDown","trendFlat","trendComparison","statusSuccess","statusWarning","statusDanger","statusInfo","statusNeutral","chartNoData","chartDataTable","chartSeries","chartCategory","filterAdd","filterAddGroup","filterRemove","filterRemoveGroup","filterMatchAll","filterMatchAny","filterField","filterOperator","filterValue","filterClear","filterCondition","filterGroup","filterNoFields","opContains","opEquals","opNotEquals","opStartsWith","opIsEmpty","opGreater","opGreaterOrEqual","opLess","opLessOrEqual","opBefore","opAfter","opOn","opIs","opIsNot","opTrue","opFalse","filterSummary","filterSummaryOne","columnsChoose","columnsLocked","columnsReset","columnsMoveUp","columnsMoveDown","columnsShown","columnsNone","viewsLabel","viewsDefault","viewsSave","viewsManage","viewsNone","checklistProgress","checklistOwner","checklistDue","activityEmpty","avatarOverflow","avatarPeople","uploadDrop","uploadBrowse","uploadRemove","uploadTooLarge","uploadWrongType","uploadUploading","uploadDone","uploadFailed","approvalPending","approvalCurrent","approvalApproved","approvalRejected","approvalSkipped","approvalChain","orgExpand","orgCollapse","orgReports","matrixAllowed","matrixDenied","matrixGrant","matrixReadOnly","readFoundationStrings","element","supplied","properties","strings","result","Array","isArray","name","value","Object","entries","formatText","text","values","replace","placeholder","String"],"mappings":";;AAAA;AACA;AAIA;;;;;UAMaA,iBAAAA,GAAoB;IAC7BC,OAAAA,EAAS,SAAA;IACTC,aAAAA,EAAe,kBAAA;IACfC,SAAAA,EAAW,mCAAA;IACXC,aAAAA,EAAe,0BAAA;IACfC,SAAAA,EAAW,4DAAA;IACXC,KAAAA,EAAO,WAAA;IACPC,oBAAAA,EAAsB,wBAAA;IACtBC,gBAAAA,EAAkB,wDAAA;IAClBC,mBAAAA,EAAqB,cAAA;IACrBC,eAAAA,EAAiB,gCAAA;IACjBC,WAAAA,EAAa,uCAA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,KAAa,QAAQI,KAAAA,CAAMC,OAAO,CAACL,QAAAA,CAAAA,EAAW,OAAOG,MAAAA;IAEzF,KAAK,MAAM,CAACG,IAAAA,EAAMC,KAAAA,CAAM,IAAIC,MAAAA,CAAOC,OAAO,CAACT,QAAAA,CAAAA,CAAsC;QAC7E,IAAIM,IAAAA,IAAQxG,qBAAqB,OAAOyG,KAAAA,KAAU,UAAUJ,MAAM,CAACG,KAA6B,GAAGC,KAAAA;AACvG,IAAA;IAEA,OAAOJ,MAAAA;AACX;AAEA,qIACO,SAASO,UAAAA,CAAWC,IAAY,EAAEC,MAAAA,GAA0C,EAAE,EAAA;AACjF,IAAA,OAAOD,IAAAA,CAAKE,OAAO,CAAC,YAAA,EAAc,CAACC,WAAAA,EAAaR,IAAAA,GAAkBA,IAAAA,IAAQM,MAAAA,GAASG,MAAAA,CAAOH,MAAM,CAACN,KAAK,CAAA,GAAIQ,WAAAA,CAAAA;AAC9G;;;;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('react');
|
|
4
|
+
|
|
5
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
6
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
7
|
+
/**
|
|
8
|
+
* The width of an element, kept up to date, so a chart can draw at the size it is shown at instead of scaling a fixed drawing -
|
|
9
|
+
* which would shrink its labels with it on a phone. Where there is no `ResizeObserver` (a test environment) the fallback is used.
|
|
10
|
+
*/ function useElementWidth(reference, fallback) {
|
|
11
|
+
const [width, setWidth] = react.useState(fallback);
|
|
12
|
+
react.useLayoutEffect(()=>{
|
|
13
|
+
const element = reference.current;
|
|
14
|
+
if (!element) return;
|
|
15
|
+
const measure = ()=>{
|
|
16
|
+
const measured = Math.round(element.getBoundingClientRect().width);
|
|
17
|
+
if (measured > 0) setWidth(measured);
|
|
18
|
+
};
|
|
19
|
+
measure();
|
|
20
|
+
if (typeof ResizeObserver === 'undefined') return;
|
|
21
|
+
const observer = new ResizeObserver(measure);
|
|
22
|
+
observer.observe(element);
|
|
23
|
+
return ()=>observer.disconnect();
|
|
24
|
+
}, [
|
|
25
|
+
reference
|
|
26
|
+
]);
|
|
27
|
+
return width;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
exports.useElementWidth = useElementWidth;
|
|
31
|
+
//# sourceMappingURL=useElementWidth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useElementWidth.js","sources":["../../../foundation/useElementWidth.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { RefObject, useLayoutEffect, useState } from 'react';\n\n/**\n * The width of an element, kept up to date, so a chart can draw at the size it is shown at instead of scaling a fixed drawing -\n * which would shrink its labels with it on a phone. Where there is no `ResizeObserver` (a test environment) the fallback is used.\n */\nexport function useElementWidth(reference: RefObject<HTMLElement | null>, fallback: number): number {\n const [width, setWidth] = useState(fallback);\n\n useLayoutEffect(() => {\n const element = reference.current;\n if (!element) return;\n\n const measure = () => {\n const measured = Math.round(element.getBoundingClientRect().width);\n if (measured > 0) setWidth(measured);\n };\n\n measure();\n if (typeof ResizeObserver === 'undefined') return;\n\n const observer = new ResizeObserver(measure);\n observer.observe(element);\n return () => observer.disconnect();\n }, [reference]);\n\n return width;\n}\n"],"names":["useElementWidth","reference","fallback","width","setWidth","useState","useLayoutEffect","element","current","measure","measured","Math","round","getBoundingClientRect","ResizeObserver","observer","observe","disconnect"],"mappings":";;;;AAAA;AACA;AAIA;;;AAGC,IACM,SAASA,eAAAA,CAAgBC,SAAwC,EAAEC,QAAgB,EAAA;AACtF,IAAA,MAAM,CAACC,KAAAA,EAAOC,QAAAA,CAAS,GAAGC,cAAAA,CAASH,QAAAA,CAAAA;IAEnCI,qBAAAA,CAAgB,IAAA;QACZ,MAAMC,OAAAA,GAAUN,UAAUO,OAAO;AACjC,QAAA,IAAI,CAACD,OAAAA,EAAS;AAEd,QAAA,MAAME,OAAAA,GAAU,IAAA;AACZ,YAAA,MAAMC,WAAWC,IAAAA,CAAKC,KAAK,CAACL,OAAAA,CAAQM,qBAAqB,GAAGV,KAAK,CAAA;YACjE,IAAIO,QAAAA,GAAW,GAAGN,QAAAA,CAASM,QAAAA,CAAAA;AAC/B,QAAA,CAAA;AAEAD,QAAAA,OAAAA,EAAAA;QACA,IAAI,OAAOK,mBAAmB,WAAA,EAAa;QAE3C,MAAMC,QAAAA,GAAW,IAAID,cAAAA,CAAeL,OAAAA,CAAAA;AACpCM,QAAAA,QAAAA,CAASC,OAAO,CAACT,OAAAA,CAAAA;QACjB,OAAO,IAAMQ,SAASE,UAAU,EAAA;IACpC,CAAA,EAAG;AAAChB,QAAAA;AAAU,KAAA,CAAA;IAEd,OAAOE,KAAAA;AACX;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
4
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
5
|
+
/** One saved view of a list: a named combination of filters, sort and columns. The definition lives with the application. */ /** Reads saved views out of a property value, dropping entries without an id. */ function readViews(value) {
|
|
6
|
+
if (!Array.isArray(value)) return [];
|
|
7
|
+
return value.flatMap((entry)=>{
|
|
8
|
+
if (typeof entry !== 'object' || entry === null || Array.isArray(entry)) return [];
|
|
9
|
+
const { id, label, description } = entry;
|
|
10
|
+
if (typeof id !== 'string' || id.length === 0) return [];
|
|
11
|
+
return [
|
|
12
|
+
{
|
|
13
|
+
id,
|
|
14
|
+
label: typeof label === 'string' && label.length > 0 ? label : id,
|
|
15
|
+
...typeof description === 'string' ? {
|
|
16
|
+
description
|
|
17
|
+
} : {}
|
|
18
|
+
}
|
|
19
|
+
];
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
exports.readViews = readViews;
|
|
24
|
+
//# sourceMappingURL=viewModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewModel.js","sources":["../../../foundation/viewModel.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/** One saved view of a list: a named combination of filters, sort and columns. The definition lives with the application. */\nexport interface SavedView {\n id: string;\n label: string;\n description?: string;\n}\n\n/** Reads saved views out of a property value, dropping entries without an id. */\nexport function readViews(value: unknown): SavedView[] {\n if (!Array.isArray(value)) return [];\n\n return value.flatMap((entry): SavedView[] => {\n if (typeof entry !== 'object' || entry === null || Array.isArray(entry)) return [];\n const { id, label, description } = entry as Record<string, unknown>;\n if (typeof id !== 'string' || id.length === 0) return [];\n return [{ id, label: typeof label === 'string' && label.length > 0 ? label : id, ...(typeof description === 'string' ? { description } : {}) }];\n });\n}\n"],"names":["readViews","value","Array","isArray","flatMap","entry","id","label","description","length"],"mappings":";;AAAA;AACA;AAEA,gNAQO,SAASA,UAAUC,KAAc,EAAA;AACpC,IAAA,IAAI,CAACC,KAAAA,CAAMC,OAAO,CAACF,KAAAA,CAAAA,EAAQ,OAAO,EAAE;IAEpC,OAAOA,KAAAA,CAAMG,OAAO,CAAC,CAACC,KAAAA,GAAAA;QAClB,IAAI,OAAOA,KAAAA,KAAU,QAAA,IAAYA,KAAAA,KAAU,IAAA,IAAQH,MAAMC,OAAO,CAACE,KAAAA,CAAAA,EAAQ,OAAO,EAAE;AAClF,QAAA,MAAM,EAAEC,EAAE,EAAEC,KAAK,EAAEC,WAAW,EAAE,GAAGH,KAAAA;QACnC,IAAI,OAAOC,OAAO,QAAA,IAAYA,EAAAA,CAAGG,MAAM,KAAK,CAAA,EAAG,OAAO,EAAE;QACxD,OAAO;AAAC,YAAA;AAAEH,gBAAAA,EAAAA;AAAIC,gBAAAA,KAAAA,EAAO,OAAOA,KAAAA,KAAU,QAAA,IAAYA,MAAME,MAAM,GAAG,IAAIF,KAAAA,GAAQD,EAAAA;gBAAI,GAAI,OAAOE,gBAAgB,QAAA,GAAW;AAAEA,oBAAAA;AAAY,iBAAA,GAAI;AAAI;AAAE,SAAA;AACnJ,IAAA,CAAA,CAAA;AACJ;;"}
|