@phis/ui 0.7.5 → 0.7.7
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/components/controls/phi-form-control.d.ts +3 -1
- package/components/controls/phi-form-control.js +4 -4
- package/components/forms/auth-admin-settings-labels.d.ts +1 -1
- package/components/forms/auth-admin-settings-labels.js +2 -2
- package/components/forms/form-descriptor-contract.d.ts +1 -1
- package/components/forms/form-descriptor-contract.js +1 -1
- package/components/forms/form-descriptor-runtime-client.d.ts +4 -1
- package/components/forms/form-descriptor-runtime-client.js +33 -11
- package/components/forms/form-media-limits.d.ts +12 -0
- package/components/forms/form-media-limits.js +14 -0
- package/components/forms/form-provider-registry.d.ts +8 -0
- package/components/forms/form-record-title.d.ts +14 -0
- package/components/forms/form-record-title.js +38 -0
- package/components/forms/form-widget-config.d.ts +3 -0
- package/components/forms/form-widget-config.js +2 -0
- package/components/forms/phi-form-widget.d.ts +1 -1
- package/components/forms/phi-form-widget.js +4 -0
- package/components/overlays/phi-overlay-container-client.js +8 -8
- package/components/overlays/phi-overlay-title.d.ts +7 -0
- package/components/overlays/phi-overlay-title.js +21 -0
- package/components/tables/client/phi-table-binding.d.ts +3 -1
- package/components/tables/client/phi-table-binding.js +90 -49
- package/components/tables/client/phi-table-filter-options.d.ts +27 -0
- package/components/tables/client/phi-table-filter-options.js +35 -0
- package/components/widgets/accessible-areas.d.ts +1 -1
- package/components/widgets/accessible-areas.js +1 -1
- package/components/widgets/client/shared/phi-rendered-value.d.ts +10 -0
- package/components/widgets/client/shared/phi-rendered-value.js +49 -1
- package/components/widgets/client/shared/phi-table-provider.d.ts +10 -1
- package/components/widgets/client/shared/phi-table-provider.js +22 -0
- package/components/widgets/label-sets/admin-users.d.ts +15 -0
- package/components/widgets/label-sets/admin-users.js +31 -0
- package/constants/core-data-provider-keys.d.ts +7 -0
- package/constants/core-data-provider-keys.js +7 -0
- package/constants/phi-base-role-metadata.d.ts +2 -2
- package/constants/phi-base-role-metadata.js +1 -1
- package/constants/runtime-module-ownership.js +3 -0
- package/forms.d.ts +1 -1
- package/forms.js +1 -1
- package/gateway/capability-media-limits.d.ts +10 -0
- package/gateway/capability-media-limits.js +40 -0
- package/gateway/server-capabilities.js +4 -0
- package/helpers/preset-tree-contract-check.d.ts +3 -2
- package/helpers/preset-tree-contract-check.js +60 -0
- package/helpers/record-title.d.ts +7 -0
- package/helpers/record-title.js +25 -0
- package/helpers/record-widget.d.ts +15 -0
- package/helpers/record-widget.js +57 -0
- package/package.json +2 -2
- package/plugins/runtime-modules/accounting/client-data-providers.d.ts +7 -0
- package/plugins/runtime-modules/accounting/client-data-providers.js +9 -0
- package/plugins/runtime-modules/accounting/data-providers.d.ts +63 -0
- package/plugins/runtime-modules/accounting/data-providers.js +127 -0
- package/plugins/runtime-modules/accounting/definition.d.ts +54 -2
- package/plugins/runtime-modules/accounting/definition.js +5 -3
- package/plugins/runtime-modules/accounting/ids.d.ts +20 -0
- package/plugins/runtime-modules/accounting/ids.js +27 -0
- package/plugins/runtime-modules/accounting/module.d.ts +52 -0
- package/plugins/runtime-modules/accounting/presets.js +23 -4
- package/plugins/runtime-modules/accounting/services/products-table.d.ts +93 -0
- package/plugins/runtime-modules/accounting/services/products-table.js +158 -0
- package/plugins/runtime-modules/accounting/trees/accounting-products-label-set.d.ts +86 -0
- package/plugins/runtime-modules/accounting/trees/accounting-products-label-set.js +123 -0
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-products-page-tree.d.ts +21 -0
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-products-page-tree.js +435 -0
- package/plugins/runtime-modules/area-definitions.js +2 -2
- package/plugins/runtime-modules/asset/media-asset-field.d.ts +15 -0
- package/plugins/runtime-modules/asset/media-asset-field.js +21 -0
- package/plugins/runtime-modules/asset/media-asset-form-control.d.ts +4 -0
- package/plugins/runtime-modules/asset/media-asset-form-control.js +10 -5
- package/plugins/runtime-modules/asset/media-assets-field.d.ts +8 -0
- package/plugins/runtime-modules/asset/media-assets-field.js +10 -0
- package/plugins/runtime-modules/asset/media-assets-form-control.d.ts +5 -0
- package/plugins/runtime-modules/asset/media-assets-form-control.js +15 -6
- package/plugins/runtime-modules/auth/admin-settings-forms.js +1 -1
- package/plugins/runtime-modules/client-manifests/accounting.js +5 -1
- package/plugins/runtime-modules/core/cards.js +2 -2
- package/plugins/runtime-modules/core/client-data-providers.js +5 -0
- package/plugins/runtime-modules/core/data-providers.js +14 -0
- package/plugins/runtime-modules/core/services/site-members-options.d.ts +27 -0
- package/plugins/runtime-modules/core/services/site-members-options.js +55 -0
- package/plugins/runtime-modules/core/widgets/form/config.d.ts +5 -0
- package/plugins/runtime-modules/core/widgets/form/config.js +3 -0
- package/plugins/runtime-modules/core/widgets/record/actions.d.ts +20 -0
- package/plugins/runtime-modules/core/widgets/record/actions.js +77 -0
- package/plugins/runtime-modules/core/widgets/record/client.js +71 -8
- package/plugins/runtime-modules/core/widgets/record/config.d.ts +66 -1
- package/plugins/runtime-modules/core/widgets/record/config.js +71 -2
- package/plugins/runtime-modules/core/widgets/table/client.js +33 -29
- package/plugins/runtime-modules/core/widgets/table/config.js +5 -1
- package/plugins/runtime-modules/groups/data-providers.js +1 -1
- package/plugins/runtime-modules/groups/definition.js +1 -1
- package/plugins/runtime-modules/groups/page-visibility.d.ts +1 -1
- package/plugins/runtime-modules/groups/page-visibility.js +1 -1
- package/plugins/runtime-modules/groups/presets.js +1 -1
- package/plugins/runtime-modules/groups/services/options.js +1 -1
- package/plugins/runtime-modules/groups/services/table.js +1 -1
- package/plugins/runtime-modules/groups/trees/phi-default-app-groups-page-tree.js +2 -2
- package/plugins/runtime-modules/user-management/addon-roles.d.ts +60 -4
- package/plugins/runtime-modules/user-management/addon-roles.js +92 -8
- package/plugins/runtime-modules/user-management/addresses.d.ts +1 -1
- package/plugins/runtime-modules/user-management/controller/client.js +1 -1
- package/plugins/runtime-modules/user-management/data-providers.js +1 -0
- package/plugins/runtime-modules/user-management/forms.js +22 -0
- package/plugins/runtime-modules/user-management/presets.js +2 -2
- package/plugins/runtime-modules/user-management/services/options.d.ts +4 -0
- package/plugins/runtime-modules/user-management/services/options.js +14 -6
- package/plugins/runtime-modules/user-management/services/table.js +12 -3
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +9 -4
- package/types/access.d.ts +1 -1
- package/types/access.js +7 -7
- package/types/core-widget-placements.d.ts +7 -0
- package/types/form-descriptor.d.ts +1 -1
- package/types/record-widget.d.ts +35 -0
- package/types/server-capabilities.d.ts +1 -1
- package/types/table-widget.d.ts +20 -0
- package/types/table-widget.js +44 -0
package/types/table-widget.js
CHANGED
|
@@ -149,6 +149,40 @@ export function readPhiTableProviderMutationResult(value) {
|
|
|
149
149
|
message: value.message,
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
|
+
/**
|
|
153
|
+
* Whether a Provider action may be asked for as stated: declared by the resource, with the row or the
|
|
154
|
+
* selection its scope needs, and a value of the type it declares. The one check every Widget that runs a
|
|
155
|
+
* Provider action makes before the Provider Client is called -- the Table's Binding and the record
|
|
156
|
+
* Widget alike -- answered as the error the Widget shows, or null.
|
|
157
|
+
*/
|
|
158
|
+
export function checkPhiTableProviderActionRequest(resource, request) {
|
|
159
|
+
const action = resource?.actions?.find((candidate) => candidate.key === request.actionKey);
|
|
160
|
+
if (!action) {
|
|
161
|
+
return new PhiTableProviderError("action-not-declared", `Table action "${request.actionKey}" is not declared by resource "${resource?.resourceKey ?? "unknown"}".`);
|
|
162
|
+
}
|
|
163
|
+
const hasRow = request.rowIdentity != null;
|
|
164
|
+
const hasSelection = (request.selectedRowIdentities?.length ?? 0) > 0;
|
|
165
|
+
if ((action.scope === "row" && !hasRow) || (action.scope === "selection" && !hasSelection)) {
|
|
166
|
+
return new PhiTableProviderError("action-scope-invalid", `Table action "${request.actionKey}" requires ${action.scope} identity context.`);
|
|
167
|
+
}
|
|
168
|
+
const value = request.actionValue;
|
|
169
|
+
const valueValid = action.valueType === undefined || action.valueType === "none"
|
|
170
|
+
? value === undefined || value === null
|
|
171
|
+
: action.valueType === "string"
|
|
172
|
+
? typeof value === "string"
|
|
173
|
+
: action.valueType === "number"
|
|
174
|
+
? typeof value === "number" && Number.isFinite(value)
|
|
175
|
+
: action.valueType === "boolean"
|
|
176
|
+
? typeof value === "boolean"
|
|
177
|
+
: action.valueType === "string[]"
|
|
178
|
+
? Array.isArray(value) && value.every((entry) => typeof entry === "string")
|
|
179
|
+
: action.valueType === "number[]"
|
|
180
|
+
? Array.isArray(value) && value.every((entry) => typeof entry === "number" && Number.isFinite(entry))
|
|
181
|
+
: isPhiRecord(value);
|
|
182
|
+
return valueValid
|
|
183
|
+
? null
|
|
184
|
+
: new PhiTableProviderError("action-value-invalid", `Table action "${request.actionKey}" received an incompatible value.`);
|
|
185
|
+
}
|
|
152
186
|
/**
|
|
153
187
|
* The choices a row offers for a field that declares `rowOptionsPath`, or null when the row offers none.
|
|
154
188
|
* A generic reader: an entry without a string value and a string label is dropped, not repaired.
|
|
@@ -312,6 +346,15 @@ export function validatePhiTableWidgetBinding(config, resource) {
|
|
|
312
346
|
errors.push(`Table column "${column.key}" icon field "${column.iconFieldKey}" must be an icon field.`);
|
|
313
347
|
}
|
|
314
348
|
}
|
|
349
|
+
if (column.imageFieldKey !== undefined) {
|
|
350
|
+
const imageField = fieldsByKey.get(column.imageFieldKey);
|
|
351
|
+
if (!imageField) {
|
|
352
|
+
errors.push(`Table column "${column.key}" references undeclared image field "${column.imageFieldKey}".`);
|
|
353
|
+
}
|
|
354
|
+
else if (imageField.type !== "string") {
|
|
355
|
+
errors.push(`Table column "${column.key}" image field "${column.imageFieldKey}" must be a string field.`);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
315
358
|
if (column.editor && field?.type === "json") {
|
|
316
359
|
errors.push(`Table column "${column.key}" cannot use an implicit JSON editor.`);
|
|
317
360
|
}
|
|
@@ -331,6 +374,7 @@ export function validatePhiTableWidgetBinding(config, resource) {
|
|
|
331
374
|
(column.renderer === "switch" && field?.type === "boolean") ||
|
|
332
375
|
(column.renderer === "checkbox" && field?.type === "boolean") ||
|
|
333
376
|
(column.renderer === "icon" && field?.type === "icon") ||
|
|
377
|
+
(column.renderer === "image" && field?.type === "string") ||
|
|
334
378
|
((column.renderer === "date" || column.renderer === "datetime") && field?.type === column.renderer) ||
|
|
335
379
|
(column.renderer === "json" && field?.type === "json") ||
|
|
336
380
|
(column.renderer === "tags" && (field?.type === "json" || field?.type === "enum[]")) ||
|