@pallasoft/ps-core-components 2.46.0 → 2.47.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/dist/components/ps-data-boundary.d.ts +2 -1
- package/dist/components/ps-data-boundary.js +2 -2
- package/dist/components/ps-empty-value.d.ts +5 -0
- package/dist/components/ps-empty-value.js +8 -0
- package/dist/components/ps-image.d.ts +14 -0
- package/dist/components/ps-image.js +29 -0
- package/dist/components/ps-signed-value.d.ts +6 -0
- package/dist/components/ps-signed-value.js +9 -0
- package/dist/constants/ps-empty-value-config.d.ts +4 -0
- package/dist/constants/ps-empty-value-config.js +7 -0
- package/dist/constants/ps-image-config.d.ts +7 -0
- package/dist/constants/ps-image-config.js +10 -0
- package/dist/constants/ps-image-fit.d.ts +7 -0
- package/dist/constants/ps-image-fit.js +11 -0
- package/dist/constants/ps-image-status.d.ts +5 -0
- package/dist/constants/ps-image-status.js +9 -0
- package/dist/constants/ps-signed-value-classes.d.ts +2 -0
- package/dist/constants/ps-signed-value-classes.js +9 -0
- package/dist/esm/components/ps-data-boundary.js +2 -2
- package/dist/esm/components/ps-empty-value.js +4 -0
- package/dist/esm/components/ps-image.js +25 -0
- package/dist/esm/components/ps-signed-value.js +5 -0
- package/dist/esm/constants/ps-empty-value-config.js +4 -0
- package/dist/esm/constants/ps-image-config.js +7 -0
- package/dist/esm/constants/ps-image-fit.js +8 -0
- package/dist/esm/constants/ps-image-status.js +6 -0
- package/dist/esm/constants/ps-signed-value-classes.js +6 -0
- package/dist/esm/hooks/use-ps-cursor-pages.js +82 -0
- package/dist/esm/hooks/use-ps-draft-state.js +18 -0
- package/dist/esm/hooks/use-ps-optimistic-rows.js +2 -1
- package/dist/esm/hooks/use-ps-remote-read.js +31 -0
- package/dist/esm/hooks/use-ps-text-param.js +16 -0
- package/dist/esm/index.js +30 -0
- package/dist/esm/interfaces/ps-cursor-pages-input.js +1 -0
- package/dist/esm/interfaces/ps-cursor-pages-result.js +1 -0
- package/dist/esm/interfaces/ps-draft-state-options.js +1 -0
- package/dist/esm/interfaces/ps-draft-state-result.js +1 -0
- package/dist/esm/interfaces/ps-remote-read-input.js +1 -0
- package/dist/esm/interfaces/ps-remote-read-result.js +1 -0
- package/dist/esm/models/ps-cursor-pages-state.js +1 -0
- package/dist/esm/models/ps-draft-state-data.js +1 -0
- package/dist/esm/models/ps-image-state-data.js +1 -0
- package/dist/esm/models/ps-remote-read-state.js +1 -0
- package/dist/esm/models/ps-remote-settled-data.js +1 -0
- package/dist/esm/models/ps-text-param-data.js +1 -0
- package/dist/esm/models/ps-text-param-options.js +1 -0
- package/dist/esm/services/ps-cursor-pages-service.js +14 -0
- package/dist/esm/services/ps-draft-state-service.js +11 -0
- package/dist/esm/services/ps-image-service.js +11 -0
- package/dist/esm/services/ps-optimistic-release-service.js +11 -5
- package/dist/esm/services/ps-remote-read-service.js +19 -0
- package/dist/esm/services/ps-signed-value-service.js +13 -0
- package/dist/hooks/use-ps-cursor-pages.d.ts +3 -0
- package/dist/hooks/use-ps-cursor-pages.js +86 -0
- package/dist/hooks/use-ps-draft-state.d.ts +3 -0
- package/dist/hooks/use-ps-draft-state.js +22 -0
- package/dist/hooks/use-ps-optimistic-rows.js +2 -1
- package/dist/hooks/use-ps-remote-read.d.ts +3 -0
- package/dist/hooks/use-ps-remote-read.js +35 -0
- package/dist/hooks/use-ps-text-param.d.ts +4 -0
- package/dist/hooks/use-ps-text-param.js +20 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +30 -0
- package/dist/interfaces/ps-cursor-pages-input.d.ts +8 -0
- package/dist/interfaces/ps-cursor-pages-input.js +2 -0
- package/dist/interfaces/ps-cursor-pages-result.d.ts +7 -0
- package/dist/interfaces/ps-cursor-pages-result.js +2 -0
- package/dist/interfaces/ps-draft-state-options.d.ts +3 -0
- package/dist/interfaces/ps-draft-state-options.js +2 -0
- package/dist/interfaces/ps-draft-state-result.d.ts +7 -0
- package/dist/interfaces/ps-draft-state-result.js +2 -0
- package/dist/interfaces/ps-optimistic-changes.d.ts +1 -0
- package/dist/interfaces/ps-remote-read-input.d.ts +5 -0
- package/dist/interfaces/ps-remote-read-input.js +2 -0
- package/dist/interfaces/ps-remote-read-result.d.ts +5 -0
- package/dist/interfaces/ps-remote-read-result.js +2 -0
- package/dist/models/ps-cursor-pages-state.d.ts +8 -0
- package/dist/models/ps-cursor-pages-state.js +2 -0
- package/dist/models/ps-draft-state-data.d.ts +4 -0
- package/dist/models/ps-draft-state-data.js +2 -0
- package/dist/models/ps-image-state-data.d.ts +5 -0
- package/dist/models/ps-image-state-data.js +2 -0
- package/dist/models/ps-remote-read-state.d.ts +6 -0
- package/dist/models/ps-remote-read-state.js +2 -0
- package/dist/models/ps-remote-settled-data.d.ts +4 -0
- package/dist/models/ps-remote-settled-data.js +2 -0
- package/dist/models/ps-text-param-data.d.ts +5 -0
- package/dist/models/ps-text-param-data.js +2 -0
- package/dist/models/ps-text-param-options.d.ts +5 -0
- package/dist/models/ps-text-param-options.js +2 -0
- package/dist/services/ps-cursor-pages-service.d.ts +6 -0
- package/dist/services/ps-cursor-pages-service.js +18 -0
- package/dist/services/ps-draft-state-service.d.ts +6 -0
- package/dist/services/ps-draft-state-service.js +15 -0
- package/dist/services/ps-image-service.d.ts +6 -0
- package/dist/services/ps-image-service.js +15 -0
- package/dist/services/ps-optimistic-release-service.d.ts +1 -1
- package/dist/services/ps-optimistic-release-service.js +11 -5
- package/dist/services/ps-remote-read-service.d.ts +8 -0
- package/dist/services/ps-remote-read-service.js +23 -0
- package/dist/services/ps-signed-value-service.d.ts +5 -0
- package/dist/services/ps-signed-value-service.js +17 -0
- package/package.json +2 -2
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PsRemoteReadState } from '../models/ps-remote-read-state';
|
|
2
|
+
import type { PsRemoteSettledData } from '../models/ps-remote-settled-data';
|
|
3
|
+
export declare class PsRemoteReadService {
|
|
4
|
+
private static readonly client;
|
|
5
|
+
static initialState<Data>(): PsRemoteReadState<Data>;
|
|
6
|
+
static isPending(settled: PsRemoteSettledData | null, url: string | null, reloadKey: unknown): boolean;
|
|
7
|
+
static read<Data>(url: string, parse: (value: unknown) => Data, signal: AbortSignal): Promise<Data>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PsRemoteReadService = void 0;
|
|
4
|
+
const ps_utilities_1 = require("@pallasoft/ps-utilities");
|
|
5
|
+
class PsRemoteReadService {
|
|
6
|
+
static initialState() {
|
|
7
|
+
return { data: null, error: null, settled: null };
|
|
8
|
+
}
|
|
9
|
+
static isPending(settled, url, reloadKey) {
|
|
10
|
+
if (url === null)
|
|
11
|
+
return false;
|
|
12
|
+
return settled === null || settled.url !== url || !Object.is(settled.reloadKey, reloadKey);
|
|
13
|
+
}
|
|
14
|
+
static async read(url, parse, signal) {
|
|
15
|
+
const response = await PsRemoteReadService.client.get(url, {
|
|
16
|
+
responseType: 'json',
|
|
17
|
+
signal,
|
|
18
|
+
});
|
|
19
|
+
return parse(response.data);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.PsRemoteReadService = PsRemoteReadService;
|
|
23
|
+
PsRemoteReadService.client = ps_utilities_1.Client.HttpService.createApiClient();
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PsSignedValueService = void 0;
|
|
4
|
+
const ps_utilities_1 = require("@pallasoft/ps-utilities");
|
|
5
|
+
class PsSignedValueService {
|
|
6
|
+
static direction(value) {
|
|
7
|
+
const sign = ps_utilities_1.Common.DecimalStringService.sign(value);
|
|
8
|
+
if (sign > 0)
|
|
9
|
+
return ps_utilities_1.AmountDirection.In;
|
|
10
|
+
return sign < 0 ? ps_utilities_1.AmountDirection.Out : ps_utilities_1.AmountDirection.Neutral;
|
|
11
|
+
}
|
|
12
|
+
static text(value, format) {
|
|
13
|
+
const body = format === undefined ? value : format(value);
|
|
14
|
+
return ps_utilities_1.Common.DecimalStringService.sign(value) > 0 ? `+${body}` : body;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.PsSignedValueService = PsSignedValueService;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pallasoft/ps-core-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.47.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@dnd-kit/utilities": "^3.2.2",
|
|
49
49
|
"@pallasoft/ps-icons": "^1.5.4",
|
|
50
50
|
"@pallasoft/ps-motion-components": "^1.2.2",
|
|
51
|
-
"@pallasoft/ps-utilities": "^2.
|
|
51
|
+
"@pallasoft/ps-utilities": "^2.25.0",
|
|
52
52
|
"@portabletext/react": "^3.2.4",
|
|
53
53
|
"@portabletext/types": "^2.0.13",
|
|
54
54
|
"@radix-ui/react-accordion": "^1.2.12",
|