@pallasoft/ps-mobile-components 1.11.0 → 1.13.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-action-sheet/ps-action-sheet.js +18 -2
- package/dist/components/ps-barcode-scanner-sheet/ps-barcode-scanner-sheet.js +2 -1
- package/dist/components/ps-document-highlight-layer/index.d.ts +2 -0
- package/dist/components/ps-document-highlight-layer/index.js +2 -0
- package/dist/components/ps-document-highlight-layer/ps-document-highlight-layer-props.d.ts +8 -0
- package/dist/components/ps-document-highlight-layer/ps-document-highlight-layer-props.js +1 -0
- package/dist/components/ps-document-highlight-layer/ps-document-highlight-layer.d.ts +2 -0
- package/dist/components/ps-document-highlight-layer/ps-document-highlight-layer.js +19 -0
- package/dist/components/ps-document-page/ps-document-page-props.d.ts +2 -0
- package/dist/components/ps-document-page/ps-document-page.d.ts +1 -1
- package/dist/components/ps-document-page/ps-document-page.js +3 -3
- package/dist/components/ps-document-search-bar/index.d.ts +2 -0
- package/dist/components/ps-document-search-bar/index.js +2 -0
- package/dist/components/ps-document-search-bar/ps-document-search-bar-props.d.ts +11 -0
- package/dist/components/ps-document-search-bar/ps-document-search-bar-props.js +1 -0
- package/dist/components/ps-document-search-bar/ps-document-search-bar.d.ts +2 -0
- package/dist/components/ps-document-search-bar/ps-document-search-bar.js +46 -0
- package/dist/components/ps-document-search-step/index.d.ts +2 -0
- package/dist/components/ps-document-search-step/index.js +2 -0
- package/dist/components/ps-document-search-step/ps-document-search-step-props.d.ts +7 -0
- package/dist/components/ps-document-search-step/ps-document-search-step-props.js +1 -0
- package/dist/components/ps-document-search-step/ps-document-search-step.d.ts +2 -0
- package/dist/components/ps-document-search-step/ps-document-search-step.js +30 -0
- package/dist/components/ps-document-text-page/ps-document-text-page-props.d.ts +2 -0
- package/dist/components/ps-document-text-page/ps-document-text-page.d.ts +1 -1
- package/dist/components/ps-document-text-page/ps-document-text-page.js +27 -3
- package/dist/components/ps-document-viewer/ps-document-viewer.js +53 -3
- package/dist/components/ps-document-zoom-image/ps-document-zoom-image-props.d.ts +4 -0
- package/dist/components/ps-document-zoom-image/ps-document-zoom-image.d.ts +1 -1
- package/dist/components/ps-document-zoom-image/ps-document-zoom-image.js +30 -3
- package/dist/components/ps-infinite-list/ps-infinite-list-props.d.ts +2 -0
- package/dist/components/ps-infinite-list/ps-infinite-list.d.ts +1 -1
- package/dist/components/ps-infinite-list/ps-infinite-list.js +12 -5
- package/dist/components/ps-list/ps-list-props.d.ts +2 -0
- package/dist/components/ps-list/ps-list.d.ts +1 -1
- package/dist/components/ps-list/ps-list.js +1 -1
- package/dist/components/ps-menu-popup/ps-menu-popup.js +3 -2
- package/dist/components/ps-screen/ps-screen-props.d.ts +2 -0
- package/dist/components/ps-screen/ps-screen.d.ts +1 -1
- package/dist/components/ps-screen/ps-screen.js +12 -5
- package/dist/components/ps-sheet-content/ps-sheet-content.js +4 -2
- package/dist/components/ps-sheet-presenter/ps-sheet-presenter.ios.js +15 -5
- package/dist/components/ps-sheet-presenter/ps-sheet-presenter.js +16 -3
- package/dist/components/ps-sortable-grid/ps-sortable-grid.js +4 -1
- package/dist/components/ps-text/ps-text-props.d.ts +1 -0
- package/dist/components/ps-text/ps-text.d.ts +1 -1
- package/dist/components/ps-text/ps-text.js +2 -2
- package/dist/components/ps-widget-list/ps-widget-grid.js +16 -7
- package/dist/components/ps-widget-list/ps-widget-list-props.d.ts +2 -0
- package/dist/components/ps-widget-list/ps-widget-list.d.ts +1 -1
- package/dist/components/ps-widget-list/ps-widget-list.js +12 -5
- package/dist/constants/ps-content-width.d.ts +6 -0
- package/dist/constants/ps-content-width.js +5 -0
- package/dist/constants/ps-document-search-config.d.ts +16 -0
- package/dist/constants/ps-document-search-config.js +16 -0
- package/dist/constants/ps-layout-class-config.d.ts +12 -0
- package/dist/constants/ps-layout-class-config.js +12 -0
- package/dist/constants/ps-layout-class.d.ts +5 -0
- package/dist/constants/ps-layout-class.js +4 -0
- package/dist/constants/ps-menu-popup-config.d.ts +1 -0
- package/dist/constants/ps-menu-popup-config.js +1 -0
- package/dist/constants/ps-orientation-config.d.ts +3 -0
- package/dist/constants/ps-orientation-config.js +3 -0
- package/dist/constants/ps-sheet-config.d.ts +1 -0
- package/dist/constants/ps-sheet-config.js +1 -0
- package/dist/constants/ps-sortable-grid-config.d.ts +2 -0
- package/dist/constants/ps-sortable-grid-config.js +2 -0
- package/dist/hooks/use-ps-document-search-texts.d.ts +2 -0
- package/dist/hooks/use-ps-document-search-texts.js +26 -0
- package/dist/hooks/use-ps-layout-class.d.ts +2 -0
- package/dist/hooks/use-ps-layout-class.js +6 -0
- package/dist/hooks/use-ps-menu-anchor.d.ts +1 -1
- package/dist/hooks/use-ps-menu-anchor.js +14 -2
- package/dist/index.d.ts +9 -0
- package/dist/index.js +9 -0
- package/dist/interfaces/ps-document-highlight-rect.d.ts +5 -0
- package/dist/interfaces/ps-document-highlight-rect.js +1 -0
- package/dist/interfaces/ps-document-item.d.ts +3 -0
- package/dist/interfaces/ps-document-labels.d.ts +7 -0
- package/dist/interfaces/ps-document-point.d.ts +4 -0
- package/dist/interfaces/ps-document-point.js +1 -0
- package/dist/interfaces/ps-document-search-labels.d.ts +9 -0
- package/dist/interfaces/ps-document-search-labels.js +1 -0
- package/dist/interfaces/ps-document-search-location.d.ts +4 -0
- package/dist/interfaces/ps-document-search-location.js +1 -0
- package/dist/interfaces/ps-document-search-match.d.ts +2 -0
- package/dist/interfaces/ps-document-search-match.js +1 -0
- package/dist/interfaces/ps-document-search-state.d.ts +4 -0
- package/dist/interfaces/ps-document-search-state.js +1 -0
- package/dist/interfaces/ps-document-text-box.d.ts +2 -0
- package/dist/interfaces/ps-document-text-box.js +1 -0
- package/dist/interfaces/ps-document-text-layer-word.d.ts +2 -0
- package/dist/interfaces/ps-document-text-layer-word.js +1 -0
- package/dist/interfaces/ps-document-text-layer.d.ts +2 -0
- package/dist/interfaces/ps-document-text-layer.js +1 -0
- package/dist/interfaces/ps-document-text-line.d.ts +4 -0
- package/dist/interfaces/ps-document-text-line.js +1 -0
- package/dist/interfaces/ps-document-text-segment.d.ts +2 -0
- package/dist/interfaces/ps-document-text-segment.js +1 -0
- package/dist/interfaces/ps-document-word-match.d.ts +3 -0
- package/dist/interfaces/ps-document-word-match.js +1 -0
- package/dist/interfaces/ps-menu-popup-insets.d.ts +2 -0
- package/dist/interfaces/ps-menu-popup-layout.d.ts +1 -0
- package/dist/services/ps-document-search-service.d.ts +36 -0
- package/dist/services/ps-document-search-service.js +114 -0
- package/dist/services/ps-document-search-style-service.d.ts +7 -0
- package/dist/services/ps-document-search-style-service.js +22 -0
- package/dist/services/ps-document-viewer-entry-service.js +1 -0
- package/dist/services/ps-document-zoom-service.d.ts +1 -0
- package/dist/services/ps-document-zoom-service.js +3 -0
- package/dist/services/ps-layout-service.d.ts +12 -0
- package/dist/services/ps-layout-service.js +41 -0
- package/dist/services/ps-menu-popup-service.js +8 -4
- package/dist/services/ps-sheet-service.d.ts +5 -2
- package/dist/services/ps-sheet-service.js +17 -4
- package/dist/services/ps-sortable-grid-service.d.ts +3 -2
- package/dist/services/ps-sortable-grid-service.js +26 -22
- package/package.json +2 -2
|
@@ -16,34 +16,38 @@ export class PsSortableGridService {
|
|
|
16
16
|
static isSameOrder(first, second) {
|
|
17
17
|
return first.length === second.length && first.every((id, index) => id === second[index]);
|
|
18
18
|
}
|
|
19
|
-
static
|
|
20
|
-
return
|
|
19
|
+
static units(span) {
|
|
20
|
+
return span === PsSortableGridSpan.half ? 1 : PsSortableGridConfig.fullUnits;
|
|
21
|
+
}
|
|
22
|
+
static rows(spans, capacity = PsSortableGridConfig.compactUnits) {
|
|
23
|
+
const rows = [];
|
|
24
|
+
let used = 0;
|
|
25
|
+
spans.forEach((span, index) => {
|
|
26
|
+
const units = PsSortableGridService.units(span);
|
|
21
27
|
const last = rows[rows.length - 1];
|
|
22
|
-
|
|
23
|
-
last !== undefined &&
|
|
24
|
-
last.length === 1 &&
|
|
25
|
-
spans[last[0]] === PsSortableGridSpan.half;
|
|
26
|
-
if (canJoin)
|
|
28
|
+
if (last !== undefined && used + units <= capacity) {
|
|
27
29
|
last.push(index);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
used += units;
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
rows.push([index]);
|
|
34
|
+
used = units;
|
|
35
|
+
});
|
|
36
|
+
return rows;
|
|
32
37
|
}
|
|
33
|
-
static layout(spans, heights, width) {
|
|
34
|
-
const
|
|
38
|
+
static layout(spans, heights, width, capacity = PsSortableGridConfig.compactUnits) {
|
|
39
|
+
const gap = PsSortableGridConfig.columnGap;
|
|
35
40
|
const rects = [];
|
|
36
41
|
let top = 0;
|
|
37
|
-
PsSortableGridService.rows(spans).forEach((row) => {
|
|
42
|
+
PsSortableGridService.rows(spans, capacity).forEach((row) => {
|
|
38
43
|
const rowHeight = Math.max(...row.map((index) => heights[index]));
|
|
39
|
-
row.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
};
|
|
44
|
+
const units = row.reduce((sum, index) => sum + PsSortableGridService.units(spans[index]), 0);
|
|
45
|
+
const unitWidth = Math.max(width - gap * (row.length - 1), 0) / units;
|
|
46
|
+
let left = 0;
|
|
47
|
+
row.forEach((index) => {
|
|
48
|
+
const itemWidth = unitWidth * PsSortableGridService.units(spans[index]);
|
|
49
|
+
rects[index] = { height: rowHeight, width: itemWidth, x: left, y: top };
|
|
50
|
+
left += itemWidth + gap;
|
|
47
51
|
});
|
|
48
52
|
top += rowHeight + PsSortableGridConfig.rowGap;
|
|
49
53
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pallasoft/ps-mobile-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Native iOS (SwiftUI) and Android (Jetpack Compose) Ps components for Pallasoft mobile apps",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@pallasoft/ps-design-system": "^1.19.0",
|
|
38
38
|
"@pallasoft/ps-icons": "^1.12.0",
|
|
39
|
-
"@pallasoft/ps-utilities": "^2.
|
|
39
|
+
"@pallasoft/ps-utilities": "^2.30.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@expo/ui": "~58.0.0",
|