@pallasoft/ps-mobile-components 1.3.0 → 1.4.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-menu/ps-action-menu-entries.js +1 -0
- package/dist/components/ps-action-menu/ps-action-menu.android.js +19 -30
- package/dist/components/ps-action-sheet/ps-action-sheet.js +6 -4
- package/dist/components/ps-barcode-scanner-sheet/index.d.ts +2 -0
- package/dist/components/ps-barcode-scanner-sheet/index.js +2 -0
- package/dist/components/ps-barcode-scanner-sheet/ps-barcode-scanner-sheet-props.d.ts +11 -0
- package/dist/components/ps-barcode-scanner-sheet/ps-barcode-scanner-sheet-props.js +1 -0
- package/dist/components/ps-barcode-scanner-sheet/ps-barcode-scanner-sheet.d.ts +2 -0
- package/dist/components/ps-barcode-scanner-sheet/ps-barcode-scanner-sheet.js +82 -0
- package/dist/components/ps-button/ps-button.js +4 -2
- package/dist/components/ps-cartesian-chart/ps-cartesian-chart.js +25 -19
- package/dist/components/ps-checkbox/ps-checkbox.js +5 -2
- package/dist/components/ps-chip/ps-chip.js +3 -1
- package/dist/components/ps-date-field/ps-date-field.android.js +1 -1
- package/dist/components/ps-date-field/ps-date-field.ios.js +1 -1
- package/dist/components/ps-document-page/ps-document-page-props.d.ts +3 -0
- package/dist/components/ps-document-page/ps-document-page.d.ts +1 -1
- package/dist/components/ps-document-page/ps-document-page.js +16 -7
- package/dist/components/ps-document-page-strip/index.d.ts +2 -0
- package/dist/components/ps-document-page-strip/index.js +2 -0
- package/dist/components/ps-document-page-strip/ps-document-page-strip-props.d.ts +6 -0
- package/dist/components/ps-document-page-strip/ps-document-page-strip-props.js +1 -0
- package/dist/components/ps-document-page-strip/ps-document-page-strip.d.ts +2 -0
- package/dist/components/ps-document-page-strip/ps-document-page-strip.js +43 -0
- package/dist/components/ps-document-pdf-cover/index.d.ts +2 -0
- package/dist/components/ps-document-pdf-cover/index.js +2 -0
- package/dist/components/ps-document-pdf-cover/ps-document-pdf-cover-props.d.ts +6 -0
- package/dist/components/ps-document-pdf-cover/ps-document-pdf-cover-props.js +1 -0
- package/dist/components/ps-document-pdf-cover/ps-document-pdf-cover.d.ts +2 -0
- package/dist/components/ps-document-pdf-cover/ps-document-pdf-cover.js +18 -0
- package/dist/components/ps-document-preview/ps-document-preview.js +3 -4
- package/dist/components/ps-document-preview-face/index.d.ts +2 -0
- package/dist/components/ps-document-preview-face/index.js +2 -0
- package/dist/components/ps-document-preview-face/ps-document-preview-face-props.d.ts +6 -0
- package/dist/components/ps-document-preview-face/ps-document-preview-face-props.js +1 -0
- package/dist/components/ps-document-preview-face/ps-document-preview-face.d.ts +2 -0
- package/dist/components/ps-document-preview-face/ps-document-preview-face.js +18 -0
- package/dist/components/ps-document-text-page/index.d.ts +2 -0
- package/dist/components/ps-document-text-page/index.js +2 -0
- package/dist/components/ps-document-text-page/ps-document-text-page-props.d.ts +6 -0
- package/dist/components/ps-document-text-page/ps-document-text-page-props.js +1 -0
- package/dist/components/ps-document-text-page/ps-document-text-page.d.ts +2 -0
- package/dist/components/ps-document-text-page/ps-document-text-page.js +18 -0
- package/dist/components/ps-document-unsupported/index.d.ts +2 -0
- package/dist/components/ps-document-unsupported/index.js +2 -0
- package/dist/components/ps-document-unsupported/ps-document-unsupported-props.d.ts +7 -0
- package/dist/components/ps-document-unsupported/ps-document-unsupported-props.js +1 -0
- package/dist/components/ps-document-unsupported/ps-document-unsupported.d.ts +2 -0
- package/dist/components/ps-document-unsupported/ps-document-unsupported.js +10 -0
- package/dist/components/ps-document-viewer/ps-document-viewer.js +27 -7
- package/dist/components/ps-header-action/index.d.ts +2 -0
- package/dist/components/ps-header-action/index.js +2 -0
- package/dist/components/ps-header-action/ps-header-action-props.d.ts +6 -0
- package/dist/components/ps-header-action/ps-header-action-props.js +1 -0
- package/dist/components/ps-header-action/ps-header-action.android.d.ts +2 -0
- package/dist/components/ps-header-action/ps-header-action.android.js +9 -0
- package/dist/components/ps-header-action/ps-header-action.d.ts +2 -0
- package/dist/components/ps-header-action/ps-header-action.js +11 -0
- package/dist/components/ps-header-menu/index.d.ts +2 -0
- package/dist/components/ps-header-menu/index.js +2 -0
- package/dist/components/ps-header-menu/ps-header-menu-props.d.ts +7 -0
- package/dist/components/ps-header-menu/ps-header-menu-props.js +1 -0
- package/dist/components/ps-header-menu/ps-header-menu.android.d.ts +2 -0
- package/dist/components/ps-header-menu/ps-header-menu.android.js +11 -0
- package/dist/components/ps-header-menu/ps-header-menu.d.ts +2 -0
- package/dist/components/ps-header-menu/ps-header-menu.js +20 -0
- package/dist/components/ps-icon-button/ps-icon-button.js +7 -7
- package/dist/components/ps-kpi-card/ps-kpi-card.js +1 -2
- package/dist/components/ps-list/ps-list-action-row.js +6 -6
- package/dist/components/ps-list/ps-list-context-menu.android.d.ts +2 -0
- package/dist/components/ps-list/ps-list-context-menu.android.js +3 -0
- package/dist/components/ps-list/ps-list-link-menu.android.d.ts +2 -0
- package/dist/components/ps-list/ps-list-link-menu.android.js +7 -0
- package/dist/components/ps-list/ps-list-link-row.js +5 -5
- package/dist/components/ps-list/ps-list-props.d.ts +1 -0
- package/dist/components/ps-list/ps-list-row-body.d.ts +2 -2
- package/dist/components/ps-list/ps-list-row-body.js +7 -4
- package/dist/components/ps-list/ps-list-row-menu.d.ts +10 -0
- package/dist/components/ps-list/ps-list-row-menu.js +27 -0
- package/dist/components/ps-list/ps-list-row.d.ts +1 -1
- package/dist/components/ps-list/ps-list-row.js +2 -2
- package/dist/components/ps-list/ps-list-select-row.js +2 -1
- package/dist/components/ps-menu-popup/index.d.ts +4 -0
- package/dist/components/ps-menu-popup/index.js +4 -0
- package/dist/components/ps-menu-popup/ps-menu-popup-divider.d.ts +1 -0
- package/dist/components/ps-menu-popup/ps-menu-popup-divider.js +7 -0
- package/dist/components/ps-menu-popup/ps-menu-popup-header.d.ts +5 -0
- package/dist/components/ps-menu-popup/ps-menu-popup-header.js +8 -0
- package/dist/components/ps-menu-popup/ps-menu-popup-row.d.ts +12 -0
- package/dist/components/ps-menu-popup/ps-menu-popup-row.js +22 -0
- package/dist/components/ps-menu-popup/ps-menu-popup.d.ts +9 -0
- package/dist/components/ps-menu-popup/ps-menu-popup.js +35 -0
- package/dist/components/ps-mobile-theme-provider/ps-mobile-theme-provider-props.d.ts +1 -0
- package/dist/components/ps-mobile-theme-provider/ps-mobile-theme-provider.d.ts +1 -1
- package/dist/components/ps-mobile-theme-provider/ps-mobile-theme-provider.js +8 -2
- package/dist/components/ps-native-menu/ps-native-menu-row.js +5 -5
- package/dist/components/ps-native-menu/ps-native-menu.android.js +16 -24
- package/dist/components/ps-option-picker/ps-option-picker.js +3 -1
- package/dist/components/ps-page-header/ps-page-header.js +3 -1
- package/dist/components/ps-pallasoft-sign-in-button/ps-pallasoft-sign-in-button.js +3 -1
- package/dist/components/ps-screen/ps-screen.js +9 -4
- package/dist/components/ps-search-field/ps-search-field.js +3 -1
- package/dist/components/ps-segmented-control/ps-segmented-control.android.js +4 -9
- package/dist/components/ps-selection-mode/ps-selection-bar.d.ts +9 -0
- package/dist/components/ps-selection-mode/ps-selection-bar.js +49 -0
- package/dist/components/ps-selection-mode/ps-selection-mode.android.d.ts +2 -0
- package/dist/components/ps-selection-mode/ps-selection-mode.android.js +23 -0
- package/dist/components/ps-sheet-content/ps-sheet-content.js +1 -1
- package/dist/components/ps-sheet-presenter/ps-sheet-presenter.android.js +4 -4
- package/dist/components/ps-sortable-grid/ps-sortable-item.js +2 -0
- package/dist/components/ps-spinner/ps-spinner.android.d.ts +2 -0
- package/dist/components/ps-spinner/ps-spinner.android.js +13 -0
- package/dist/components/ps-switch/ps-switch.android.d.ts +2 -0
- package/dist/components/ps-switch/ps-switch.android.js +25 -0
- package/dist/components/ps-switcher/index.d.ts +2 -0
- package/dist/components/ps-switcher/index.js +2 -0
- package/dist/components/ps-switcher/ps-switcher-panel.d.ts +10 -0
- package/dist/components/ps-switcher/ps-switcher-panel.js +17 -0
- package/dist/components/ps-switcher/ps-switcher-props.d.ts +12 -0
- package/dist/components/ps-switcher/ps-switcher-props.js +1 -0
- package/dist/components/ps-switcher/ps-switcher-row.d.ts +7 -0
- package/dist/components/ps-switcher/ps-switcher-row.js +33 -0
- package/dist/components/ps-switcher/ps-switcher-trigger.d.ts +11 -0
- package/dist/components/ps-switcher/ps-switcher-trigger.js +35 -0
- package/dist/components/ps-switcher/ps-switcher.d.ts +2 -0
- package/dist/components/ps-switcher/ps-switcher.js +21 -0
- package/dist/components/ps-tab-bar-provider/ps-tab-bar-provider.js +1 -1
- package/dist/components/ps-tabs/ps-tabs.js +3 -1
- package/dist/components/ps-waterfall-chart/index.d.ts +2 -0
- package/dist/components/ps-waterfall-chart/index.js +2 -0
- package/dist/components/ps-waterfall-chart/ps-waterfall-chart-props.d.ts +9 -0
- package/dist/components/ps-waterfall-chart/ps-waterfall-chart-props.js +1 -0
- package/dist/components/ps-waterfall-chart/ps-waterfall-chart.d.ts +2 -0
- package/dist/components/ps-waterfall-chart/ps-waterfall-chart.js +37 -0
- package/dist/components/ps-widget-list/ps-widget-list.js +1 -1
- package/dist/constants/ps-android-state-config.d.ts +12 -0
- package/dist/constants/ps-android-state-config.js +12 -0
- package/dist/constants/ps-barcode-permission.d.ts +6 -0
- package/dist/constants/ps-barcode-permission.js +5 -0
- package/dist/constants/ps-barcode-scanner-config.d.ts +18 -0
- package/dist/constants/ps-barcode-scanner-config.js +31 -0
- package/dist/constants/ps-capture-config.d.ts +12 -0
- package/dist/constants/ps-capture-config.js +22 -0
- package/dist/constants/ps-capture-source.d.ts +7 -0
- package/dist/constants/ps-capture-source.js +6 -0
- package/dist/constants/ps-cartesian-series-shape.d.ts +5 -0
- package/dist/constants/ps-cartesian-series-shape.js +4 -0
- package/dist/constants/ps-chart-brand-config.d.ts +21 -0
- package/dist/constants/ps-chart-brand-config.js +10 -0
- package/dist/constants/ps-document-config.d.ts +3 -0
- package/dist/constants/ps-document-config.js +3 -0
- package/dist/constants/ps-document-file-config.d.ts +11 -0
- package/dist/constants/ps-document-file-config.js +11 -0
- package/dist/constants/ps-document-kind.d.ts +1 -0
- package/dist/constants/ps-document-kind.js +1 -0
- package/dist/constants/ps-document-load-status.d.ts +7 -0
- package/dist/constants/ps-document-load-status.js +6 -0
- package/dist/constants/ps-document-pdf-config.d.ts +14 -0
- package/dist/constants/ps-document-pdf-config.js +14 -0
- package/dist/constants/ps-header-config.d.ts +3 -0
- package/dist/constants/ps-header-config.js +3 -0
- package/dist/constants/ps-menu-popup-config.d.ts +10 -0
- package/dist/constants/ps-menu-popup-config.js +10 -0
- package/dist/constants/ps-quick-action-config.d.ts +4 -0
- package/dist/constants/ps-quick-action-config.js +4 -0
- package/dist/constants/ps-ripple-kind.d.ts +8 -0
- package/dist/constants/ps-ripple-kind.js +7 -0
- package/dist/constants/ps-selection-bar-config.d.ts +4 -0
- package/dist/constants/ps-selection-bar-config.js +4 -0
- package/dist/constants/ps-sortable-grid-config.d.ts +2 -1
- package/dist/constants/ps-sortable-grid-config.js +2 -1
- package/dist/constants/ps-switcher-config.d.ts +12 -0
- package/dist/constants/ps-switcher-config.js +12 -0
- package/dist/contexts/ps-tab-bar-context.js +1 -0
- package/dist/hooks/use-ps-barcode-scanner.d.ts +2 -0
- package/dist/hooks/use-ps-barcode-scanner.js +9 -0
- package/dist/hooks/use-ps-document-open.d.ts +3 -0
- package/dist/hooks/use-ps-document-open.js +14 -0
- package/dist/hooks/use-ps-document-pdf-cover.d.ts +3 -0
- package/dist/hooks/use-ps-document-pdf-cover.js +33 -0
- package/dist/hooks/use-ps-document-pdf-pages.d.ts +3 -0
- package/dist/hooks/use-ps-document-pdf-pages.js +31 -0
- package/dist/hooks/use-ps-document-text.d.ts +3 -0
- package/dist/hooks/use-ps-document-text.js +29 -0
- package/dist/hooks/use-ps-file-upload.d.ts +3 -0
- package/dist/hooks/use-ps-file-upload.js +32 -0
- package/dist/hooks/use-ps-header-right.d.ts +2 -0
- package/dist/hooks/use-ps-header-right.js +9 -0
- package/dist/hooks/use-ps-material-scheme.d.ts +2 -0
- package/dist/hooks/use-ps-material-scheme.js +3 -0
- package/dist/hooks/use-ps-menu-anchor.d.ts +10 -0
- package/dist/hooks/use-ps-menu-anchor.js +13 -0
- package/dist/hooks/use-ps-quick-actions.d.ts +2 -0
- package/dist/hooks/use-ps-quick-actions.js +30 -0
- package/dist/hooks/use-ps-stack-screen-options.d.ts +2 -0
- package/dist/hooks/use-ps-stack-screen-options.js +7 -0
- package/dist/hooks/use-ps-top-inset.d.ts +1 -0
- package/dist/hooks/use-ps-top-inset.js +10 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +43 -0
- package/dist/interfaces/ps-barcode-frame-size.d.ts +4 -0
- package/dist/interfaces/ps-barcode-frame-size.js +1 -0
- package/dist/interfaces/ps-barcode-last-read.d.ts +4 -0
- package/dist/interfaces/ps-barcode-last-read.js +1 -0
- package/dist/interfaces/ps-barcode-scan.d.ts +4 -0
- package/dist/interfaces/ps-barcode-scan.js +1 -0
- package/dist/interfaces/ps-barcode-scanner-labels.d.ts +8 -0
- package/dist/interfaces/ps-barcode-scanner-labels.js +1 -0
- package/dist/interfaces/ps-barcode-scanner-native.d.ts +23 -0
- package/dist/interfaces/ps-barcode-scanner-native.js +1 -0
- package/dist/interfaces/ps-capture-labels.d.ts +6 -0
- package/dist/interfaces/ps-capture-labels.js +1 -0
- package/dist/interfaces/ps-capture-menu-options.d.ts +6 -0
- package/dist/interfaces/ps-capture-menu-options.js +1 -0
- package/dist/interfaces/ps-capture-modules.d.ts +6 -0
- package/dist/interfaces/ps-capture-modules.js +1 -0
- package/dist/interfaces/ps-capture-options.d.ts +6 -0
- package/dist/interfaces/ps-capture-options.js +1 -0
- package/dist/interfaces/ps-cartesian-chart-series.d.ts +2 -0
- package/dist/interfaces/ps-date-dialog-colors.d.ts +19 -0
- package/dist/interfaces/ps-date-dialog-colors.js +1 -0
- package/dist/interfaces/ps-device-file.d.ts +5 -0
- package/dist/interfaces/ps-device-file.js +1 -0
- package/dist/interfaces/ps-document-file-system.d.ts +2 -0
- package/dist/interfaces/ps-document-file-system.js +1 -0
- package/dist/interfaces/ps-document-labels.d.ts +1 -0
- package/dist/interfaces/ps-document-page-image.d.ts +5 -0
- package/dist/interfaces/ps-document-page-image.js +1 -0
- package/dist/interfaces/ps-document-pdf-native.d.ts +9 -0
- package/dist/interfaces/ps-document-pdf-native.js +1 -0
- package/dist/interfaces/ps-document-pdf-options.d.ts +4 -0
- package/dist/interfaces/ps-document-pdf-options.js +1 -0
- package/dist/interfaces/ps-document-pdf-state.d.ts +6 -0
- package/dist/interfaces/ps-document-pdf-state.js +1 -0
- package/dist/interfaces/ps-document-viewer-entry.d.ts +8 -0
- package/dist/interfaces/ps-document-viewer-entry.js +1 -0
- package/dist/interfaces/ps-file-upload-options.d.ts +8 -0
- package/dist/interfaces/ps-file-upload-options.js +1 -0
- package/dist/interfaces/ps-material-scheme.d.ts +38 -0
- package/dist/interfaces/ps-material-scheme.js +1 -0
- package/dist/interfaces/ps-material-segmented-colors.d.ts +14 -0
- package/dist/interfaces/ps-material-segmented-colors.js +1 -0
- package/dist/interfaces/ps-material-switch-colors.d.ts +14 -0
- package/dist/interfaces/ps-material-switch-colors.js +1 -0
- package/dist/interfaces/ps-menu-anchor.d.ts +6 -0
- package/dist/interfaces/ps-menu-anchor.js +1 -0
- package/dist/interfaces/ps-menu-item.d.ts +1 -0
- package/dist/interfaces/ps-menu-popup-layout.d.ts +6 -0
- package/dist/interfaces/ps-menu-popup-layout.js +1 -0
- package/dist/interfaces/ps-menu-popup-window.d.ts +4 -0
- package/dist/interfaces/ps-menu-popup-window.js +1 -0
- package/dist/interfaces/ps-mobile-theme-input.d.ts +2 -0
- package/dist/interfaces/ps-quick-action-native.d.ts +14 -0
- package/dist/interfaces/ps-quick-action-native.js +1 -0
- package/dist/interfaces/ps-quick-action.d.ts +7 -0
- package/dist/interfaces/ps-quick-action.js +1 -0
- package/dist/interfaces/ps-scanned-file.d.ts +2 -5
- package/dist/interfaces/ps-stack-screen-options.d.ts +2 -0
- package/dist/interfaces/ps-stack-screen-options.js +1 -0
- package/dist/interfaces/ps-switcher-item.d.ts +11 -0
- package/dist/interfaces/ps-switcher-item.js +1 -0
- package/dist/interfaces/ps-tab-bar-context-data.d.ts +1 -0
- package/dist/interfaces/ps-tab-bar-icon-colors.d.ts +4 -0
- package/dist/interfaces/ps-tab-bar-icon-colors.js +1 -0
- package/dist/interfaces/ps-tab-bar-label-style.d.ts +5 -0
- package/dist/interfaces/ps-tab-bar-label-style.js +1 -0
- package/dist/interfaces/ps-tab-bar-label-styles.d.ts +5 -0
- package/dist/interfaces/ps-tab-bar-label-styles.js +1 -0
- package/dist/interfaces/ps-tab-bar-style.d.ts +12 -0
- package/dist/interfaces/ps-tab-bar-style.js +1 -0
- package/dist/interfaces/ps-waterfall-datum.d.ts +6 -0
- package/dist/interfaces/ps-waterfall-datum.js +1 -0
- package/dist/interfaces/ps-waterfall-step.d.ts +7 -0
- package/dist/interfaces/ps-waterfall-step.js +1 -0
- package/dist/interfaces/use-ps-barcode-scanner-result.d.ts +6 -0
- package/dist/interfaces/use-ps-barcode-scanner-result.js +1 -0
- package/dist/interfaces/use-ps-document-open-result.d.ts +5 -0
- package/dist/interfaces/use-ps-document-open-result.js +1 -0
- package/dist/interfaces/use-ps-document-pdf-cover-result.d.ts +7 -0
- package/dist/interfaces/use-ps-document-pdf-cover-result.js +1 -0
- package/dist/interfaces/use-ps-document-pdf-pages-result.d.ts +5 -0
- package/dist/interfaces/use-ps-document-pdf-pages-result.js +1 -0
- package/dist/interfaces/use-ps-document-text-result.d.ts +5 -0
- package/dist/interfaces/use-ps-document-text-result.js +1 -0
- package/dist/interfaces/use-ps-file-upload-result.d.ts +8 -0
- package/dist/interfaces/use-ps-file-upload-result.js +1 -0
- package/dist/interfaces/use-ps-quick-actions-options.d.ts +5 -0
- package/dist/interfaces/use-ps-quick-actions-options.js +1 -0
- package/dist/services/ps-barcode-scanner-service.d.ts +14 -0
- package/dist/services/ps-barcode-scanner-service.js +53 -0
- package/dist/services/ps-button-style-service.d.ts +2 -0
- package/dist/services/ps-button-style-service.js +13 -1
- package/dist/services/ps-capture-picker-service.d.ts +11 -0
- package/dist/services/ps-capture-picker-service.js +67 -0
- package/dist/services/ps-capture-source-service.d.ts +10 -0
- package/dist/services/ps-capture-source-service.js +31 -0
- package/dist/services/ps-chart-brand-service.d.ts +4 -0
- package/dist/services/ps-chart-brand-service.js +20 -0
- package/dist/services/ps-chart-shape-service.d.ts +7 -0
- package/dist/services/ps-chart-shape-service.js +17 -0
- package/dist/services/ps-control-style-service.js +3 -2
- package/dist/services/ps-date-picker-service.d.ts +3 -0
- package/dist/services/ps-date-picker-service.js +21 -0
- package/dist/services/ps-device-file-service.d.ts +14 -0
- package/dist/services/ps-device-file-service.js +27 -0
- package/dist/services/ps-document-file-service.d.ts +10 -0
- package/dist/services/ps-document-file-service.js +75 -0
- package/dist/services/ps-document-open-service.d.ts +5 -0
- package/dist/services/ps-document-open-service.js +16 -0
- package/dist/services/ps-document-pdf-service.d.ts +10 -0
- package/dist/services/ps-document-pdf-service.js +40 -0
- package/dist/services/ps-document-text-service.d.ts +5 -0
- package/dist/services/ps-document-text-service.js +14 -0
- package/dist/services/ps-document-viewer-entry-service.d.ts +11 -0
- package/dist/services/ps-document-viewer-entry-service.js +72 -0
- package/dist/services/ps-list-row-style-service.js +2 -5
- package/dist/services/ps-material-control-service.d.ts +9 -0
- package/dist/services/ps-material-control-service.js +46 -0
- package/dist/services/ps-material-scheme-service.d.ts +5 -0
- package/dist/services/ps-material-scheme-service.js +42 -0
- package/dist/services/ps-menu-popup-service.d.ts +6 -0
- package/dist/services/ps-menu-popup-service.js +23 -0
- package/dist/services/ps-mobile-theme-service.d.ts +1 -1
- package/dist/services/ps-mobile-theme-service.js +7 -2
- package/dist/services/ps-navigation-theme-service.d.ts +5 -0
- package/dist/services/ps-navigation-theme-service.js +21 -0
- package/dist/services/ps-pdf-native-service.d.ts +8 -0
- package/dist/services/ps-pdf-native-service.js +33 -0
- package/dist/services/ps-quick-action-service.d.ts +9 -0
- package/dist/services/ps-quick-action-service.js +31 -0
- package/dist/services/ps-ripple-service.d.ts +7 -0
- package/dist/services/ps-ripple-service.js +26 -0
- package/dist/services/ps-screen-service.d.ts +3 -1
- package/dist/services/ps-screen-service.js +8 -2
- package/dist/services/ps-sheet-service.d.ts +1 -0
- package/dist/services/ps-sheet-service.js +3 -0
- package/dist/services/ps-stack-options-service.d.ts +5 -0
- package/dist/services/ps-stack-options-service.js +18 -0
- package/dist/services/ps-state-service.d.ts +7 -0
- package/dist/services/ps-state-service.js +26 -0
- package/dist/services/ps-switcher-service.d.ts +6 -0
- package/dist/services/ps-switcher-service.js +15 -0
- package/dist/services/ps-tab-bar-style-service.d.ts +5 -0
- package/dist/services/ps-tab-bar-style-service.js +30 -0
- package/dist/services/ps-waterfall-service.d.ts +10 -0
- package/dist/services/ps-waterfall-service.js +38 -0
- package/jest-setup.js +86 -3
- package/package.json +36 -3
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PsMaterialScheme } from '../interfaces/ps-material-scheme';
|
|
2
|
+
import type { PsMaterialSegmentedColors } from '../interfaces/ps-material-segmented-colors';
|
|
3
|
+
import type { PsMaterialSwitchColors } from '../interfaces/ps-material-switch-colors';
|
|
4
|
+
export declare class PsMaterialControlService {
|
|
5
|
+
static switchColors(scheme: PsMaterialScheme): PsMaterialSwitchColors;
|
|
6
|
+
static segmentedColors(scheme: PsMaterialScheme): PsMaterialSegmentedColors;
|
|
7
|
+
private static disabledContent;
|
|
8
|
+
private static disabledContainer;
|
|
9
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { PsAndroidStateConfig } from '../constants/ps-android-state-config';
|
|
2
|
+
import { PsMobileColorService } from './ps-mobile-color-service';
|
|
3
|
+
export class PsMaterialControlService {
|
|
4
|
+
static switchColors(scheme) {
|
|
5
|
+
const disabledContent = PsMaterialControlService.disabledContent(scheme);
|
|
6
|
+
const disabledContainer = PsMaterialControlService.disabledContainer(scheme);
|
|
7
|
+
return {
|
|
8
|
+
checkedBorderColor: scheme.primary,
|
|
9
|
+
checkedThumbColor: scheme.onPrimary,
|
|
10
|
+
checkedTrackColor: scheme.primary,
|
|
11
|
+
disabledCheckedBorderColor: disabledContainer,
|
|
12
|
+
disabledCheckedThumbColor: scheme.surface,
|
|
13
|
+
disabledCheckedTrackColor: disabledContainer,
|
|
14
|
+
disabledUncheckedBorderColor: disabledContainer,
|
|
15
|
+
disabledUncheckedThumbColor: disabledContent,
|
|
16
|
+
disabledUncheckedTrackColor: scheme.surface,
|
|
17
|
+
uncheckedBorderColor: scheme.outline,
|
|
18
|
+
uncheckedThumbColor: scheme.outline,
|
|
19
|
+
uncheckedTrackColor: scheme.surfaceContainerHighest,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
static segmentedColors(scheme) {
|
|
23
|
+
const disabledContent = PsMaterialControlService.disabledContent(scheme);
|
|
24
|
+
const disabledContainer = PsMaterialControlService.disabledContainer(scheme);
|
|
25
|
+
return {
|
|
26
|
+
activeBorderColor: scheme.primary,
|
|
27
|
+
activeContainerColor: scheme.primaryContainer,
|
|
28
|
+
activeContentColor: scheme.onPrimaryContainer,
|
|
29
|
+
disabledActiveBorderColor: disabledContainer,
|
|
30
|
+
disabledActiveContainerColor: disabledContainer,
|
|
31
|
+
disabledActiveContentColor: disabledContent,
|
|
32
|
+
disabledInactiveBorderColor: disabledContainer,
|
|
33
|
+
disabledInactiveContainerColor: scheme.surface,
|
|
34
|
+
disabledInactiveContentColor: disabledContent,
|
|
35
|
+
inactiveBorderColor: scheme.outlineVariant,
|
|
36
|
+
inactiveContainerColor: scheme.surface,
|
|
37
|
+
inactiveContentColor: scheme.onSurfaceVariant,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
static disabledContent(scheme) {
|
|
41
|
+
return PsMobileColorService.withAlpha(scheme.onSurface, PsAndroidStateConfig.disabledContentAlpha);
|
|
42
|
+
}
|
|
43
|
+
static disabledContainer(scheme) {
|
|
44
|
+
return PsMobileColorService.withAlpha(scheme.onSurface, PsAndroidStateConfig.disabledContainerAlpha);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export class PsMaterialSchemeService {
|
|
2
|
+
static create(theme) {
|
|
3
|
+
return {
|
|
4
|
+
background: theme.background,
|
|
5
|
+
error: theme.danger,
|
|
6
|
+
errorContainer: theme.dangerSoft,
|
|
7
|
+
inverseOnSurface: theme.surface,
|
|
8
|
+
inversePrimary: theme.primary,
|
|
9
|
+
inverseSurface: theme.ink,
|
|
10
|
+
onBackground: theme.ink,
|
|
11
|
+
onError: theme.white,
|
|
12
|
+
onErrorContainer: theme.dangerText,
|
|
13
|
+
onPrimary: theme.primaryContrast,
|
|
14
|
+
onPrimaryContainer: theme.primaryText,
|
|
15
|
+
onSecondary: theme.secondaryContrast,
|
|
16
|
+
onSecondaryContainer: theme.secondaryText,
|
|
17
|
+
onSurface: theme.ink,
|
|
18
|
+
onSurfaceVariant: theme.muted,
|
|
19
|
+
onTertiary: theme.white,
|
|
20
|
+
onTertiaryContainer: theme.infoText,
|
|
21
|
+
outline: theme.muted,
|
|
22
|
+
outlineVariant: theme.line,
|
|
23
|
+
primary: theme.primary,
|
|
24
|
+
primaryContainer: theme.primarySoftStrong,
|
|
25
|
+
scrim: theme.overlay,
|
|
26
|
+
secondary: theme.secondary,
|
|
27
|
+
secondaryContainer: theme.secondarySoft,
|
|
28
|
+
surface: theme.surface,
|
|
29
|
+
surfaceBright: theme.surface,
|
|
30
|
+
surfaceContainer: theme.surface,
|
|
31
|
+
surfaceContainerHigh: theme.background,
|
|
32
|
+
surfaceContainerHighest: theme.background,
|
|
33
|
+
surfaceContainerLow: theme.surface,
|
|
34
|
+
surfaceContainerLowest: theme.surface,
|
|
35
|
+
surfaceDim: theme.background,
|
|
36
|
+
surfaceTint: theme.primary,
|
|
37
|
+
surfaceVariant: theme.background,
|
|
38
|
+
tertiary: theme.info,
|
|
39
|
+
tertiaryContainer: theme.infoSoft,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PsMenuAnchor } from '../interfaces/ps-menu-anchor';
|
|
2
|
+
import type { PsMenuPopupLayout } from '../interfaces/ps-menu-popup-layout';
|
|
3
|
+
import type { PsMenuPopupWindow } from '../interfaces/ps-menu-popup-window';
|
|
4
|
+
export declare class PsMenuPopupService {
|
|
5
|
+
static layout(anchor: PsMenuAnchor, window: PsMenuPopupWindow, contentHeight: number, contentWidth: number, isFullWidth: boolean): PsMenuPopupLayout;
|
|
6
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { PsMenuPopupConfig } from '../constants/ps-menu-popup-config';
|
|
2
|
+
export class PsMenuPopupService {
|
|
3
|
+
static layout(anchor, window, contentHeight, contentWidth, isFullWidth) {
|
|
4
|
+
const margin = PsMenuPopupConfig.edgeMargin;
|
|
5
|
+
const gap = PsMenuPopupConfig.anchorGap;
|
|
6
|
+
const width = isFullWidth ? anchor.width : undefined;
|
|
7
|
+
const menuWidth = width === undefined ? contentWidth : width;
|
|
8
|
+
const below = window.height - (anchor.y + anchor.height) - gap - margin;
|
|
9
|
+
const above = anchor.y - gap - margin;
|
|
10
|
+
const isBelow = contentHeight <= below || below >= above;
|
|
11
|
+
const room = isBelow ? below : above;
|
|
12
|
+
const height = Math.min(contentHeight, Math.max(room, 0));
|
|
13
|
+
const top = isBelow ? anchor.y + anchor.height + gap : anchor.y - gap - height;
|
|
14
|
+
const alignedRight = anchor.x + menuWidth > window.width - margin;
|
|
15
|
+
const left = alignedRight ? anchor.x + anchor.width - menuWidth : anchor.x;
|
|
16
|
+
return {
|
|
17
|
+
left: Math.max(margin, Math.min(left, window.width - margin - menuWidth)),
|
|
18
|
+
maxHeight: Math.max(room, 0),
|
|
19
|
+
top,
|
|
20
|
+
width,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PsMobileTheme } from '../interfaces/ps-mobile-theme';
|
|
2
2
|
import type { PsMobileThemeInput } from '../interfaces/ps-mobile-theme-input';
|
|
3
3
|
export declare class PsMobileThemeService {
|
|
4
|
-
static create({ chart, hasHaptics, isDark, isReduceMotion, primary, primaryContrast, secondary, }: PsMobileThemeInput): PsMobileTheme;
|
|
4
|
+
static create({ chart, hasBrandSecondary, hasHaptics, isBrandChart, isDark, isReduceMotion, primary, primaryContrast, secondary, }: PsMobileThemeInput): PsMobileTheme;
|
|
5
5
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { PallasoftThemeService } from '@pallasoft/ps-design-system';
|
|
2
2
|
import { PsFontConfig } from '../constants/ps-font-config';
|
|
3
|
+
import { PsChartBrandService } from './ps-chart-brand-service';
|
|
3
4
|
export class PsMobileThemeService {
|
|
4
|
-
static create({ chart, hasHaptics, isDark, isReduceMotion, primary, primaryContrast, secondary, }) {
|
|
5
|
+
static create({ chart, hasBrandSecondary, hasHaptics, isBrandChart, isDark, isReduceMotion, primary, primaryContrast, secondary, }) {
|
|
5
6
|
const tokens = PallasoftThemeService.build({
|
|
6
7
|
primary,
|
|
7
8
|
primaryContrast,
|
|
@@ -12,7 +13,11 @@ export class PsMobileThemeService {
|
|
|
12
13
|
accent: tokens.accent,
|
|
13
14
|
accentSoft: tokens.accentSoft,
|
|
14
15
|
background: tokens.background,
|
|
15
|
-
chart: chart
|
|
16
|
+
chart: chart !== undefined && chart.length > 0
|
|
17
|
+
? chart
|
|
18
|
+
: isBrandChart === true
|
|
19
|
+
? PsChartBrandService.series(hasBrandSecondary === true ? [tokens.primary, tokens.secondary] : [tokens.primary])
|
|
20
|
+
: tokens.chart,
|
|
16
21
|
danger: tokens.danger,
|
|
17
22
|
dangerSoft: tokens.dangerSoft,
|
|
18
23
|
dangerText: tokens.dangerText,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export class PsNavigationThemeService {
|
|
2
|
+
static from(theme) {
|
|
3
|
+
return {
|
|
4
|
+
colors: {
|
|
5
|
+
background: theme.background,
|
|
6
|
+
border: theme.line,
|
|
7
|
+
card: theme.background,
|
|
8
|
+
notification: theme.danger,
|
|
9
|
+
primary: theme.primaryText,
|
|
10
|
+
text: theme.ink,
|
|
11
|
+
},
|
|
12
|
+
dark: theme.isDark,
|
|
13
|
+
fonts: {
|
|
14
|
+
bold: { fontFamily: theme.fonts.bold, fontWeight: '700' },
|
|
15
|
+
heavy: { fontFamily: theme.fonts.bold, fontWeight: '800' },
|
|
16
|
+
medium: { fontFamily: theme.fonts.medium, fontWeight: '500' },
|
|
17
|
+
regular: { fontFamily: theme.fonts.regular, fontWeight: '400' },
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PsDocumentPageImage } from '../interfaces/ps-document-page-image';
|
|
2
|
+
export declare class PsPdfNativeService {
|
|
3
|
+
static isAvailable(): boolean;
|
|
4
|
+
static page(filePath: string, page: number, maxWidth: number): Promise<PsDocumentPageImage>;
|
|
5
|
+
static pages(filePath: string, maxWidth: number): Promise<PsDocumentPageImage[]>;
|
|
6
|
+
private static require;
|
|
7
|
+
private static load;
|
|
8
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { PsDocumentPdfConfig } from '../constants/ps-document-pdf-config';
|
|
2
|
+
export class PsPdfNativeService {
|
|
3
|
+
static isAvailable() {
|
|
4
|
+
return PsPdfNativeService.load() !== null;
|
|
5
|
+
}
|
|
6
|
+
static async page(filePath, page, maxWidth) {
|
|
7
|
+
return PsPdfNativeService.require().generate(filePath, page, {
|
|
8
|
+
maxWidth,
|
|
9
|
+
quality: PsDocumentPdfConfig.jpegQuality,
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
static async pages(filePath, maxWidth) {
|
|
13
|
+
return PsPdfNativeService.require().generateAllPages(filePath, {
|
|
14
|
+
maxWidth,
|
|
15
|
+
quality: PsDocumentPdfConfig.jpegQuality,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
static require() {
|
|
19
|
+
const native = PsPdfNativeService.load();
|
|
20
|
+
if (native === null)
|
|
21
|
+
throw new Error(PsDocumentPdfConfig.unavailableError);
|
|
22
|
+
return native;
|
|
23
|
+
}
|
|
24
|
+
static load() {
|
|
25
|
+
try {
|
|
26
|
+
const loaded = require('react-native-pdf-thumbnail');
|
|
27
|
+
return typeof loaded.default.generate === 'function' ? loaded.default : null;
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PsQuickAction } from '../interfaces/ps-quick-action';
|
|
2
|
+
import type { PsQuickActionNative, PsQuickActionNativeItem } from '../interfaces/ps-quick-action-native';
|
|
3
|
+
export declare class PsQuickActionService {
|
|
4
|
+
private static isInitialTaken;
|
|
5
|
+
static toNative(items: PsQuickAction[], os?: string): PsQuickActionNativeItem[];
|
|
6
|
+
static key(items: PsQuickAction[]): string;
|
|
7
|
+
static takeInitial(native: PsQuickActionNative): PsQuickActionNativeItem | null;
|
|
8
|
+
static load(): PsQuickActionNative | null;
|
|
9
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
import { PsQuickActionConfig } from '../constants/ps-quick-action-config';
|
|
3
|
+
export class PsQuickActionService {
|
|
4
|
+
static toNative(items, os = Platform.OS) {
|
|
5
|
+
return items.map((item) => ({
|
|
6
|
+
icon: os === 'ios' ? `${PsQuickActionConfig.iosSymbolPrefix}${item.iosSymbol}` : item.androidIcon,
|
|
7
|
+
id: item.id,
|
|
8
|
+
title: item.title,
|
|
9
|
+
...(item.subtitle === undefined ? {} : { subtitle: item.subtitle }),
|
|
10
|
+
}));
|
|
11
|
+
}
|
|
12
|
+
static key(items) {
|
|
13
|
+
return JSON.stringify(PsQuickActionService.toNative(items));
|
|
14
|
+
}
|
|
15
|
+
static takeInitial(native) {
|
|
16
|
+
if (PsQuickActionService.isInitialTaken || native.initial === undefined)
|
|
17
|
+
return null;
|
|
18
|
+
PsQuickActionService.isInitialTaken = true;
|
|
19
|
+
return native.initial;
|
|
20
|
+
}
|
|
21
|
+
static load() {
|
|
22
|
+
try {
|
|
23
|
+
const loaded = require('expo-quick-actions');
|
|
24
|
+
return typeof loaded.setItems === 'function' ? loaded : null;
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
PsQuickActionService.isInitialTaken = false;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PressableAndroidRippleConfig } from 'react-native';
|
|
2
|
+
import { PsRippleKind } from '../constants/ps-ripple-kind';
|
|
3
|
+
import type { PsMobileTheme } from '../interfaces/ps-mobile-theme';
|
|
4
|
+
export declare class PsRippleService {
|
|
5
|
+
static resolve(theme: PsMobileTheme, kind: PsRippleKind): PressableAndroidRippleConfig;
|
|
6
|
+
private static color;
|
|
7
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { PsAndroidStateConfig } from '../constants/ps-android-state-config';
|
|
2
|
+
import { PsRippleKind } from '../constants/ps-ripple-kind';
|
|
3
|
+
import { PsMobileColorService } from './ps-mobile-color-service';
|
|
4
|
+
export class PsRippleService {
|
|
5
|
+
static resolve(theme, kind) {
|
|
6
|
+
const isBorderless = kind === PsRippleKind.Borderless;
|
|
7
|
+
return {
|
|
8
|
+
borderless: isBorderless,
|
|
9
|
+
color: PsRippleService.color(theme, kind),
|
|
10
|
+
foreground: true,
|
|
11
|
+
radius: isBorderless ? PsAndroidStateConfig.iconRippleRadius : undefined,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
static color(theme, kind) {
|
|
15
|
+
switch (kind) {
|
|
16
|
+
case PsRippleKind.OnPrimary:
|
|
17
|
+
return PsMobileColorService.withAlpha(theme.primaryContrast, PsAndroidStateConfig.rippleOnFillAlpha);
|
|
18
|
+
case PsRippleKind.OnDanger:
|
|
19
|
+
return PsMobileColorService.withAlpha(theme.white, PsAndroidStateConfig.rippleOnFillAlpha);
|
|
20
|
+
case PsRippleKind.Danger:
|
|
21
|
+
return PsMobileColorService.withAlpha(theme.danger, PsAndroidStateConfig.rippleAlpha);
|
|
22
|
+
default:
|
|
23
|
+
return PsMobileColorService.withAlpha(theme.primary, PsAndroidStateConfig.rippleAlpha);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { ViewStyle } from 'react-native';
|
|
2
2
|
import type { PsScreenInsets } from '../interfaces/ps-screen-insets';
|
|
3
3
|
export declare class PsScreenService {
|
|
4
|
-
static content(insets: PsScreenInsets, isIos: boolean, hasGutter: boolean, gap: number): ViewStyle;
|
|
4
|
+
static content(insets: PsScreenInsets, isIos: boolean, hasGutter: boolean, gap: number, extraBottom?: number): ViewStyle;
|
|
5
|
+
static bottomInset(navigationBar: number, hasTabBar: boolean, isTabBarHidden: boolean): number;
|
|
6
|
+
static topInset(statusBar: number, headerHeight: number | undefined): number;
|
|
5
7
|
static statusBarScrim(top: number): ViewStyle;
|
|
6
8
|
}
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { PsLayoutConfig } from '../constants/ps-layout-config';
|
|
2
2
|
export class PsScreenService {
|
|
3
|
-
static content(insets, isIos, hasGutter, gap) {
|
|
3
|
+
static content(insets, isIos, hasGutter, gap, extraBottom = 0) {
|
|
4
4
|
const gutter = hasGutter ? PsLayoutConfig.gutter : 0;
|
|
5
5
|
return {
|
|
6
6
|
gap,
|
|
7
|
-
paddingBottom: (isIos ? 0 : insets.bottom) + gutter,
|
|
7
|
+
paddingBottom: (isIos ? 0 : insets.bottom + extraBottom) + gutter,
|
|
8
8
|
paddingHorizontal: gutter,
|
|
9
9
|
paddingTop: (isIos ? 0 : insets.top) + gutter,
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
|
+
static bottomInset(navigationBar, hasTabBar, isTabBarHidden) {
|
|
13
|
+
return hasTabBar && !isTabBarHidden ? 0 : navigationBar;
|
|
14
|
+
}
|
|
15
|
+
static topInset(statusBar, headerHeight) {
|
|
16
|
+
return headerHeight === undefined || headerHeight <= 0 ? statusBar : 0;
|
|
17
|
+
}
|
|
12
18
|
static statusBarScrim(top) {
|
|
13
19
|
return { height: top, left: 0, position: 'absolute', right: 0, top: 0 };
|
|
14
20
|
}
|
|
@@ -3,6 +3,7 @@ import type { PsSheetAction } from '../interfaces/ps-sheet-action';
|
|
|
3
3
|
import type { PsSheetLeadingKind } from '../interfaces/ps-sheet-leading-kind';
|
|
4
4
|
export declare class PsSheetService {
|
|
5
5
|
static maxHeight(windowHeight: number): number;
|
|
6
|
+
static handlesInset(os: string): boolean;
|
|
6
7
|
static bottomPadding(isFloating: boolean, bottomInset: number): number;
|
|
7
8
|
static fittedHeight(headerHeight: number, bodyHeight: number, windowHeight: number): number;
|
|
8
9
|
static closeAction(label: string | undefined, onPress: () => void): PsSheetAction | undefined;
|
|
@@ -4,6 +4,9 @@ export class PsSheetService {
|
|
|
4
4
|
static maxHeight(windowHeight) {
|
|
5
5
|
return Math.floor(windowHeight * PsSheetConfig.maxHeightFraction);
|
|
6
6
|
}
|
|
7
|
+
static handlesInset(os) {
|
|
8
|
+
return os === 'ios' || os === 'android';
|
|
9
|
+
}
|
|
7
10
|
static bottomPadding(isFloating, bottomInset) {
|
|
8
11
|
return PsLayoutConfig.sheetGutter + (isFloating ? 0 : bottomInset);
|
|
9
12
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { PsMobileTheme } from '../interfaces/ps-mobile-theme';
|
|
2
|
+
import type { PsStackScreenOptions } from '../interfaces/ps-stack-screen-options';
|
|
3
|
+
export declare class PsStackOptionsService {
|
|
4
|
+
static android(base: PsStackScreenOptions, theme: PsMobileTheme): PsStackScreenOptions;
|
|
5
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PsHeaderConfig } from '../constants/ps-header-config';
|
|
2
|
+
export class PsStackOptionsService {
|
|
3
|
+
static android(base, theme) {
|
|
4
|
+
return {
|
|
5
|
+
...base,
|
|
6
|
+
contentStyle: { backgroundColor: theme.background },
|
|
7
|
+
headerShadowVisible: false,
|
|
8
|
+
headerStyle: { backgroundColor: theme.background },
|
|
9
|
+
headerTintColor: theme.ink,
|
|
10
|
+
headerTitleAlign: 'left',
|
|
11
|
+
headerTitleStyle: {
|
|
12
|
+
color: theme.ink,
|
|
13
|
+
fontFamily: theme.fonts.semibold,
|
|
14
|
+
fontSize: PsHeaderConfig.titleSize,
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PsMobileTheme } from '../interfaces/ps-mobile-theme';
|
|
2
|
+
export declare class PsStateService {
|
|
3
|
+
static pressedFill(theme: PsMobileTheme, base: string): string;
|
|
4
|
+
static headerFill(theme: PsMobileTheme, isPressed: boolean): string;
|
|
5
|
+
static disabledOpacity(): number;
|
|
6
|
+
static ringColor(theme: PsMobileTheme, hasError: boolean): string;
|
|
7
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
import { PsAndroidStateConfig } from '../constants/ps-android-state-config';
|
|
3
|
+
import { PsMobileControlConfig } from '../constants/ps-mobile-control-config';
|
|
4
|
+
import { PsMobileColorService } from './ps-mobile-color-service';
|
|
5
|
+
export class PsStateService {
|
|
6
|
+
static pressedFill(theme, base) {
|
|
7
|
+
if (Platform.OS === 'android')
|
|
8
|
+
return base;
|
|
9
|
+
return PsMobileColorService.withAlpha(theme.ink, PsMobileControlConfig.pressedAlpha);
|
|
10
|
+
}
|
|
11
|
+
static headerFill(theme, isPressed) {
|
|
12
|
+
if (Platform.OS === 'android')
|
|
13
|
+
return isPressed ? theme.primarySoftStrong : theme.primarySoft;
|
|
14
|
+
return PsMobileColorService.withAlpha(theme.ink, isPressed
|
|
15
|
+
? PsMobileControlConfig.neutralAlpha + PsMobileControlConfig.pressedAlpha
|
|
16
|
+
: PsMobileControlConfig.neutralAlpha);
|
|
17
|
+
}
|
|
18
|
+
static disabledOpacity() {
|
|
19
|
+
return Platform.OS === 'android'
|
|
20
|
+
? PsAndroidStateConfig.disabledContentAlpha
|
|
21
|
+
: PsMobileControlConfig.disabledOpacity;
|
|
22
|
+
}
|
|
23
|
+
static ringColor(theme, hasError) {
|
|
24
|
+
return Platform.OS === 'android' && hasError ? theme.danger : theme.primary;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PsSwitcherItem } from '../interfaces/ps-switcher-item';
|
|
2
|
+
export declare class PsSwitcherService {
|
|
3
|
+
static filter(items: PsSwitcherItem[], query: string): PsSwitcherItem[];
|
|
4
|
+
static hasSearch(count: number): boolean;
|
|
5
|
+
static selected(items: PsSwitcherItem[], id: string): PsSwitcherItem | undefined;
|
|
6
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PsSwitcherConfig } from '../constants/ps-switcher-config';
|
|
2
|
+
export class PsSwitcherService {
|
|
3
|
+
static filter(items, query) {
|
|
4
|
+
const needle = query.trim().toLowerCase();
|
|
5
|
+
return needle === ''
|
|
6
|
+
? items
|
|
7
|
+
: items.filter((item) => item.searchText.toLowerCase().includes(needle));
|
|
8
|
+
}
|
|
9
|
+
static hasSearch(count) {
|
|
10
|
+
return count > PsSwitcherConfig.searchThreshold;
|
|
11
|
+
}
|
|
12
|
+
static selected(items, id) {
|
|
13
|
+
return items.find((item) => item.id === id);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
import { PsAndroidStateConfig } from '../constants/ps-android-state-config';
|
|
3
|
+
import { PsMobileColorService } from './ps-mobile-color-service';
|
|
4
|
+
export class PsTabBarStyleService {
|
|
5
|
+
static resolve(theme) {
|
|
6
|
+
if (Platform.OS !== 'android')
|
|
7
|
+
return { tintColor: theme.primaryText };
|
|
8
|
+
return {
|
|
9
|
+
backgroundColor: theme.surface,
|
|
10
|
+
badgeBackgroundColor: theme.danger,
|
|
11
|
+
badgeTextColor: theme.white,
|
|
12
|
+
iconColor: { default: theme.muted, selected: theme.primaryText },
|
|
13
|
+
indicatorColor: theme.primarySoftStrong,
|
|
14
|
+
labelStyle: {
|
|
15
|
+
default: {
|
|
16
|
+
color: theme.muted,
|
|
17
|
+
fontFamily: theme.fonts.medium,
|
|
18
|
+
fontSize: PsAndroidStateConfig.tabLabelSize,
|
|
19
|
+
},
|
|
20
|
+
selected: {
|
|
21
|
+
color: theme.primaryText,
|
|
22
|
+
fontFamily: theme.fonts.semibold,
|
|
23
|
+
fontSize: PsAndroidStateConfig.tabLabelSize,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
rippleColor: PsMobileColorService.withAlpha(theme.primary, PsAndroidStateConfig.rippleAlpha),
|
|
27
|
+
tintColor: theme.primaryText,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PsChartBarRect } from '../interfaces/ps-chart-bar-rect';
|
|
2
|
+
import type { PsChartDomain } from '../interfaces/ps-chart-domain';
|
|
3
|
+
import type { PsChartPlot } from '../interfaces/ps-chart-plot';
|
|
4
|
+
import type { PsWaterfallDatum } from '../interfaces/ps-waterfall-datum';
|
|
5
|
+
import type { PsWaterfallStep } from '../interfaces/ps-waterfall-step';
|
|
6
|
+
export declare class PsWaterfallService {
|
|
7
|
+
static steps(data: PsWaterfallDatum[]): PsWaterfallStep[];
|
|
8
|
+
static values(steps: PsWaterfallStep[]): number[];
|
|
9
|
+
static rects(steps: PsWaterfallStep[], colors: string[], domain: PsChartDomain, plot: PsChartPlot): PsChartBarRect[];
|
|
10
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { PsChartConfig } from '../constants/ps-chart-config';
|
|
2
|
+
import { PsChartBarService } from './ps-chart-bar-service';
|
|
3
|
+
import { PsChartScaleService } from './ps-chart-scale-service';
|
|
4
|
+
export class PsWaterfallService {
|
|
5
|
+
static steps(data) {
|
|
6
|
+
let running = 0;
|
|
7
|
+
return data.map((datum) => {
|
|
8
|
+
const value = Number.isFinite(datum.value) ? datum.value : 0;
|
|
9
|
+
if (datum.isTotal === true) {
|
|
10
|
+
running = value;
|
|
11
|
+
return { end: value, isTotal: true, label: datum.label, start: 0, value };
|
|
12
|
+
}
|
|
13
|
+
const start = running;
|
|
14
|
+
running += value;
|
|
15
|
+
return { end: running, isTotal: false, label: datum.label, start, value };
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
static values(steps) {
|
|
19
|
+
return steps.flatMap((step) => [step.start, step.end]);
|
|
20
|
+
}
|
|
21
|
+
static rects(steps, colors, domain, plot) {
|
|
22
|
+
const slot = PsChartBarService.slot(steps.length, plot);
|
|
23
|
+
const width = slot * (1 - PsChartConfig.barGapRatio);
|
|
24
|
+
return steps.map((step, row) => {
|
|
25
|
+
const from = PsChartScaleService.y(step.start, domain, plot);
|
|
26
|
+
const to = PsChartScaleService.y(step.end, domain, plot);
|
|
27
|
+
return {
|
|
28
|
+
color: step.isTotal ? colors[2] : step.value < 0 ? colors[1] : colors[0],
|
|
29
|
+
height: Math.abs(to - from),
|
|
30
|
+
id: `${row}:${step.label}`,
|
|
31
|
+
isNegative: step.end < step.start,
|
|
32
|
+
width,
|
|
33
|
+
x: plot.left + row * slot + (slot * PsChartConfig.barGapRatio) / 2,
|
|
34
|
+
y: Math.min(from, to),
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|