@stacksjs/types 0.75.552 → 0.75.555

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.
@@ -89,6 +89,38 @@ export declare interface DashboardProviderOptions {
89
89
  errors?: DashboardProviderSelection
90
90
  analytics?: DashboardProviderSelection
91
91
  }
92
+ /**
93
+ * How one field is shown and asked for in the dashboard, where the model's
94
+ * definition cannot say: that a number is money, that a field is called
95
+ * "Joined". Everything left out stays derived from the attribute.
96
+ */
97
+ export declare interface DashboardModelField {
98
+ label?: string
99
+ help?: string
100
+ format?: 'badge' | 'bytes' | 'code' | 'date' | 'datetime' | 'duration' | 'image' | 'link' | 'money' | 'number' | 'percent' | 'text'
101
+ currency?: string
102
+ currencyField?: string
103
+ unit?: 'ms' | 's'
104
+ input?: 'email' | 'longtext' | 'markdown' | 'text' | 'upload' | 'url'
105
+ accept?: string
106
+ }
107
+ /**
108
+ * Something an operator can do to one record beyond creating, editing and
109
+ * deleting it, as a button the dashboard draws: "Mark as shipped".
110
+ *
111
+ * The model names it; an action under `app/Actions` does it.
112
+ */
113
+ export declare interface DashboardModelAction {
114
+ name: string
115
+ action: string
116
+ label?: string
117
+ icon?: string
118
+ confirm?: string
119
+ destructive?: boolean
120
+ on?: Array<'record' | 'row' | 'bulk'>
121
+ fields?: Record<string, Pick<DashboardModelField, 'label' | 'help'> & { input?: Exclude<DashboardModelField['input'], 'upload'> }>
122
+ when?: Record<string, string | number | boolean | null | Array<string | number | boolean | null>>
123
+ }
92
124
  export declare interface DashboardModelOptions {
93
125
  access?: boolean
94
126
  enabled?: boolean
@@ -108,6 +140,8 @@ export declare interface DashboardModelOptions {
108
140
  | 'app'
109
141
  columns?: string[]
110
142
  writes?: DashboardModelWrite[]
143
+ fields?: Record<string, DashboardModelField>
144
+ actions?: DashboardModelAction[]
111
145
  roles?: string[]
112
146
  enforce?: boolean
113
147
  description?: string
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/types",
3
3
  "type": "module",
4
- "version": "0.75.552",
4
+ "version": "0.75.555",
5
5
  "description": "The Stacks framework types.",
6
6
  "author": "Chris Breuer",
7
7
  "contributors": [
@@ -64,8 +64,8 @@
64
64
  "dependencies": {
65
65
  "@stacksjs/bunpress": "^0.2.15",
66
66
  "@stacksjs/clapp": "^0.2.17",
67
- "@stacksjs/events": "0.75.552",
68
- "@stacksjs/strings": "0.75.552",
67
+ "@stacksjs/events": "0.75.555",
68
+ "@stacksjs/strings": "0.75.555",
69
69
  "@stacksjs/stx": "^0.2.859",
70
70
  "@stacksjs/ts-validation": "^0.5.7",
71
71
  "bun-query-builder": "^0.3.44",
@@ -73,7 +73,7 @@
73
73
  "stripe": "23.0.0"
74
74
  },
75
75
  "devDependencies": {
76
- "@stacksjs/validation": "0.75.552",
76
+ "@stacksjs/validation": "0.75.555",
77
77
  "better-dx": "^0.2.24"
78
78
  },
79
79
  "sideEffects": false,
@@ -99,7 +99,7 @@
99
99
  }
100
100
  },
101
101
  "peerDependencies": {
102
- "@stacksjs/actions": "0.75.552",
103
- "@stacksjs/scheduler": "0.75.552"
102
+ "@stacksjs/actions": "0.75.555",
103
+ "@stacksjs/scheduler": "0.75.555"
104
104
  }
105
105
  }