@liorian/sdk 0.28.0-alpha.56010ca
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/README.md +483 -0
- package/package.json +94 -0
- package/schemas/module.schema.json +818 -0
- package/src/application/index.ts +3 -0
- package/src/application/module-instance.ts +36 -0
- package/src/application/service/auth-api-service.ts +291 -0
- package/src/application/service/auth-user.service.ts +108 -0
- package/src/application/service/index.ts +12 -0
- package/src/application/service/module-activation-api.service.ts +105 -0
- package/src/application/service/notifications-api-service.ts +38 -0
- package/src/application/service/notifications-push.service.ts +299 -0
- package/src/application/service/notifications-socket-service.ts +76 -0
- package/src/application/service/organizations-api-service.ts +104 -0
- package/src/application/service/otp-api-service.ts +11 -0
- package/src/application/service/storage-api-service.ts +77 -0
- package/src/application/service/storefront-api.service.ts +72 -0
- package/src/application/service/user-preferences-api.service.ts +57 -0
- package/src/domain/config/app.config.ts +35 -0
- package/src/domain/config/auth.config.ts +30 -0
- package/src/domain/config/index.ts +4 -0
- package/src/domain/config/logo.config.ts +17 -0
- package/src/domain/entities/activities.interface.ts +18 -0
- package/src/domain/entities/catalog.interface.ts +96 -0
- package/src/domain/entities/index.ts +13 -0
- package/src/domain/entities/media.ts +22 -0
- package/src/domain/entities/module-activation.interface.ts +173 -0
- package/src/domain/entities/module.interface.ts +101 -0
- package/src/domain/entities/notification.interface.ts +23 -0
- package/src/domain/entities/objectable.type.ts +3 -0
- package/src/domain/entities/organization.interface.ts +81 -0
- package/src/domain/entities/user-auth.interface.ts +17 -0
- package/src/domain/entities/user-phone.interface.ts +11 -0
- package/src/domain/entities/user-profile.interface.ts +23 -0
- package/src/domain/entities/user.interface.ts +79 -0
- package/src/domain/enums/coloring.enum.ts +6 -0
- package/src/domain/enums/domains.enum.ts +282 -0
- package/src/domain/enums/index.ts +8 -0
- package/src/domain/enums/module-category.enum.ts +57 -0
- package/src/domain/enums/module.enum.ts +97 -0
- package/src/domain/enums/routine.enum.ts +12 -0
- package/src/domain/enums/user-profile.enum.ts +25 -0
- package/src/domain/enums/user-status.enum.ts +7 -0
- package/src/domain/index.ts +6 -0
- package/src/domain/typing/auth-caches.ts +12 -0
- package/src/domain/typing/auth-oauth.types.ts +172 -0
- package/src/domain/typing/devise.ts +2 -0
- package/src/domain/typing/index.ts +10 -0
- package/src/domain/typing/response.ts +30 -0
- package/src/domain/typing/routine.types.ts +113 -0
- package/src/domain/typing/session.interface.ts +28 -0
- package/src/domain/typing/statisticals.ts +11 -0
- package/src/domain/typing/user-media-upload.ts +9 -0
- package/src/domain/typing/values.ts +6 -0
- package/src/index.tsx +168 -0
- package/src/infrastructure/capabilities/cache-storage/capability.ts +129 -0
- package/src/infrastructure/capabilities/cache-storage/enum.ts +5 -0
- package/src/infrastructure/capabilities/cache-storage/index.ts +4 -0
- package/src/infrastructure/capabilities/cache-storage/types.ts +13 -0
- package/src/infrastructure/capabilities/index.ts +3 -0
- package/src/infrastructure/capabilities/stackable/capability.ts +55 -0
- package/src/infrastructure/capabilities/stackable/index.ts +3 -0
- package/src/infrastructure/capabilities/stackable/types.ts +24 -0
- package/src/infrastructure/common-classname.constant.ts +4 -0
- package/src/infrastructure/data/countries.ts +208 -0
- package/src/infrastructure/data/gender.ts +5 -0
- package/src/infrastructure/data/index.ts +3 -0
- package/src/infrastructure/dataset/index.ts +3 -0
- package/src/infrastructure/dataset/sign-in.dataset.ts +21 -0
- package/src/infrastructure/dataset/sign-up.dataset.ts +64 -0
- package/src/infrastructure/hooks/index.ts +10 -0
- package/src/infrastructure/hooks/use-activity-lock-draft.ts +69 -0
- package/src/infrastructure/hooks/use-auth.ts +24 -0
- package/src/infrastructure/hooks/use-elastic-interaction.ts +180 -0
- package/src/infrastructure/hooks/use-is-desktop.ts +25 -0
- package/src/infrastructure/hooks/use-is-tauri.ts +17 -0
- package/src/infrastructure/hooks/use-mobile.ts +19 -0
- package/src/infrastructure/hooks/use-notifications.ts +128 -0
- package/src/infrastructure/hooks/use-recent-colors.ts +113 -0
- package/src/infrastructure/hooks/use-recent-modules.ts +76 -0
- package/src/infrastructure/index.tsx +11 -0
- package/src/infrastructure/library/design-system.ts +95 -0
- package/src/infrastructure/library/index.tsx +5 -0
- package/src/infrastructure/library/motion-utils.ts +77 -0
- package/src/infrastructure/library/motion.tsx +31 -0
- package/src/infrastructure/library/scroll-progress.tsx +93 -0
- package/src/infrastructure/providers/auth-guard.provider.tsx +47 -0
- package/src/infrastructure/providers/auth.provider.tsx +168 -0
- package/src/infrastructure/providers/index.tsx +8 -0
- package/src/infrastructure/providers/module-usage.provider.tsx +95 -0
- package/src/infrastructure/providers/modules-guard.provider.tsx +64 -0
- package/src/infrastructure/providers/modules-routines.provider.tsx +33 -0
- package/src/infrastructure/providers/modules-switcher.provider.tsx +25 -0
- package/src/infrastructure/providers/query.provider.tsx +27 -0
- package/src/infrastructure/routines/__tests__/routine.test.ts +368 -0
- package/src/infrastructure/routines/index.tsx +3 -0
- package/src/infrastructure/routines/routine.hook.ts +121 -0
- package/src/infrastructure/routines/routine.ts +283 -0
- package/src/infrastructure/routines/routine.tsx +283 -0
- package/src/infrastructure/stores/activity-lock.store.ts +22 -0
- package/src/infrastructure/stores/auth-user-connected.store.ts +24 -0
- package/src/infrastructure/stores/dataset.store.ts +106 -0
- package/src/infrastructure/stores/index.ts +6 -0
- package/src/infrastructure/stores/module.store.ts +266 -0
- package/src/infrastructure/stores/upload.store.ts +198 -0
- package/src/infrastructure/utilities/access-label.util.ts +158 -0
- package/src/infrastructure/utilities/activities.util.tsx +54 -0
- package/src/infrastructure/utilities/activity-lock.service.ts +263 -0
- package/src/infrastructure/utilities/activity-tracker.service.ts +205 -0
- package/src/infrastructure/utilities/api-service.ts +237 -0
- package/src/infrastructure/utilities/auth-logout.util.ts +23 -0
- package/src/infrastructure/utilities/classname.util.ts +7 -0
- package/src/infrastructure/utilities/encryption.service.ts +125 -0
- package/src/infrastructure/utilities/form-snapshot.service.ts +304 -0
- package/src/infrastructure/utilities/format.util.ts +40 -0
- package/src/infrastructure/utilities/index.tsx +23 -0
- package/src/infrastructure/utilities/media-label.service.ts +47 -0
- package/src/infrastructure/utilities/modules.ts +11 -0
- package/src/infrastructure/utilities/permission.util.ts +22 -0
- package/src/infrastructure/utilities/push-permission.util.ts +43 -0
- package/src/infrastructure/utilities/route-access.ts +38 -0
- package/src/infrastructure/utilities/socket-service.ts +123 -0
- package/src/infrastructure/utilities/sso-auth.util.ts +188 -0
- package/src/infrastructure/utilities/stringable.util.ts +16 -0
- package/src/infrastructure/utilities/strings.util.ts +18 -0
- package/src/infrastructure/utilities/tauri.util.ts +15 -0
- package/src/infrastructure/utilities/utils.ts +6 -0
- package/src/infrastructure/utilities/values.ts +5 -0
- package/src/presentation/8starlabs-ui/button.tsx +94 -0
- package/src/presentation/8starlabs-ui/flip-clock.tsx +368 -0
- package/src/presentation/8starlabs-ui/heatmap.tsx +430 -0
- package/src/presentation/8starlabs-ui/hooks/index.tsx +2 -0
- package/src/presentation/8starlabs-ui/hooks/use-mobile.ts +21 -0
- package/src/presentation/8starlabs-ui/index.tsx +20 -0
- package/src/presentation/8starlabs-ui/json-viewer.tsx +972 -0
- package/src/presentation/8starlabs-ui/marquee.tsx +134 -0
- package/src/presentation/8starlabs-ui/partition-bar.tsx +198 -0
- package/src/presentation/8starlabs-ui/scroll-fade.tsx +158 -0
- package/src/presentation/8starlabs-ui/status-indicator.tsx +86 -0
- package/src/presentation/8starlabs-ui/system-banner.tsx +50 -0
- package/src/presentation/8starlabs-ui/timeline.tsx +576 -0
- package/src/presentation/8starlabs-ui/transport-badge.tsx +249 -0
- package/src/presentation/8starlabs-ui/ui/copy-button.tsx +60 -0
- package/src/presentation/8starlabs-ui/ui/index.tsx +2 -0
- package/src/presentation/analytics-section.tsx +85 -0
- package/src/presentation/app-sidebar.tsx +234 -0
- package/src/presentation/charts/area-widget.chart-skeleton.tsx +61 -0
- package/src/presentation/charts/area-widget.chart.tsx +128 -0
- package/src/presentation/charts/chart-widgets.types.ts +81 -0
- package/src/presentation/charts/index.tsx +16 -0
- package/src/presentation/charts/line-widget.chart-skeleton.tsx +64 -0
- package/src/presentation/charts/line-widget.chart.tsx +105 -0
- package/src/presentation/charts/pie-widget.chart-skeleton.tsx +56 -0
- package/src/presentation/charts/pie-widget.chart.tsx +168 -0
- package/src/presentation/charts/radar-widget.chart-skeleton.tsx +67 -0
- package/src/presentation/charts/radar-widget.chart.tsx +80 -0
- package/src/presentation/charts/radial-stacked-widget.chart-skeleton.tsx +66 -0
- package/src/presentation/charts/radial-stacked-widget.chart.tsx +120 -0
- package/src/presentation/charts/radial-widget.chart-skeleton.tsx +61 -0
- package/src/presentation/charts/radial-widget.chart.tsx +87 -0
- package/src/presentation/charts/tooltip-widget.chart-skeleton.tsx +64 -0
- package/src/presentation/charts/tooltip-widget.chart.tsx +89 -0
- package/src/presentation/components/activity-actions.tsx +20 -0
- package/src/presentation/components/activity-container.tsx +55 -0
- package/src/presentation/components/activity-content.tsx +20 -0
- package/src/presentation/components/activity-descriptor-parser.tsx +37 -0
- package/src/presentation/components/activity-header.tsx +20 -0
- package/src/presentation/components/activity-loader.tsx +19 -0
- package/src/presentation/components/activity-title.tsx +32 -0
- package/src/presentation/components/activity.tsx +22 -0
- package/src/presentation/components/auth/index.tsx +4 -0
- package/src/presentation/components/auth/sso-callback.view.tsx +44 -0
- package/src/presentation/components/auth/sso-disconnect.view.tsx +41 -0
- package/src/presentation/components/auth/sso-sign-in.view.tsx +29 -0
- package/src/presentation/components/auth-lock-screen.tsx +309 -0
- package/src/presentation/components/auth-session.view.tsx +17 -0
- package/src/presentation/components/data-table.tsx +814 -0
- package/src/presentation/components/dynamic-icon.tsx +16 -0
- package/src/presentation/components/floating-upload.tsx +291 -0
- package/src/presentation/components/index.tsx +40 -0
- package/src/presentation/components/local-time.tsx +170 -0
- package/src/presentation/components/markdown-parser.tsx +201 -0
- package/src/presentation/components/message-scroller.tsx +131 -0
- package/src/presentation/components/module-first-access-config.view.tsx +181 -0
- package/src/presentation/components/module-first-access-pending.view.tsx +38 -0
- package/src/presentation/components/module-guard.tsx +34 -0
- package/src/presentation/components/modules-first-access.guard.tsx +88 -0
- package/src/presentation/components/modules-guard-forbidden.tsx +46 -0
- package/src/presentation/components/notification-details.modal.tsx +145 -0
- package/src/presentation/components/notification-item.tsx +127 -0
- package/src/presentation/components/notifications-popover.tsx +128 -0
- package/src/presentation/components/push-notifications.provider.tsx +65 -0
- package/src/presentation/components/upload-progress-dialog.tsx +140 -0
- package/src/presentation/components/waiting-bar.tsx +22 -0
- package/src/presentation/components/waiting-section.tsx +15 -0
- package/src/presentation/components/waiting.tsx +14 -0
- package/src/presentation/data-grid/data-grid-empty.tsx +24 -0
- package/src/presentation/data-grid/data-grid-search-engine.tsx +32 -0
- package/src/presentation/data-grid/data-grid.tsx +892 -0
- package/src/presentation/data-grid/index.tsx +4 -0
- package/src/presentation/form-screen.tsx +95 -0
- package/src/presentation/icons/custom.tsx +20 -0
- package/src/presentation/icons/glyphIcons.tsx +53 -0
- package/src/presentation/icons/icons.enum.ts +4 -0
- package/src/presentation/icons/icons.util.ts +6 -0
- package/src/presentation/icons/index.tsx +8 -0
- package/src/presentation/icons/lucide.tsx +17 -0
- package/src/presentation/icons/remix.tsx +33 -0
- package/src/presentation/icons/types.ts +27 -0
- package/src/presentation/index.tsx +45 -0
- package/src/presentation/modals/components/ModalBox.tsx +74 -0
- package/src/presentation/modals/components/ModalPortal.tsx +31 -0
- package/src/presentation/modals/components/ModalStepper.tsx +319 -0
- package/src/presentation/modals/components/ModalWrapper.tsx +65 -0
- package/src/presentation/modals/components/index.tsx +5 -0
- package/src/presentation/modals/hooks/index.ts +2 -0
- package/src/presentation/modals/hooks/useModal.ts +38 -0
- package/src/presentation/modals/index.tsx +5 -0
- package/src/presentation/modals/stores/index.ts +2 -0
- package/src/presentation/modals/stores/useModalStore.ts +90 -0
- package/src/presentation/modals/types/index.ts +2 -0
- package/src/presentation/modals/types/modal.type.ts +33 -0
- package/src/presentation/module-menubar.tsx +300 -0
- package/src/presentation/module-widget.tsx +233 -0
- package/src/presentation/nav-documents.tsx +89 -0
- package/src/presentation/nav-main.tsx +62 -0
- package/src/presentation/nav-secondary.tsx +41 -0
- package/src/presentation/nav-user.tsx +109 -0
- package/src/presentation/permission-action-badge.tsx +35 -0
- package/src/presentation/reui/index.tsx +3 -0
- package/src/presentation/reui/stepper.tsx +508 -0
- package/src/presentation/reui/timeline.tsx +226 -0
- package/src/presentation/sheets/index.tsx +2 -0
- package/src/presentation/sheets/legacy-sheet-header.tsx +0 -0
- package/src/presentation/sheets/legacy-sheet.tsx +37 -0
- package/src/presentation/size.enum.ts +19 -0
- package/src/presentation/system/index.tsx +3 -0
- package/src/presentation/system/logo.theme.tsx +21 -0
- package/src/presentation/system/types.ts +10 -0
- package/src/presentation/theme/index.tsx +6 -0
- package/src/presentation/theme/prefer-color-scheme.tsx +50 -0
- package/src/presentation/theme/switch-color-scheme.tsx +16 -0
- package/src/presentation/theme/theme-switcher-button.tsx +20 -0
- package/src/presentation/theme/theme.enum.ts +4 -0
- package/src/presentation/theme/theme.store.ts +87 -0
- package/src/presentation/themes/index.tsx +2 -0
- package/src/presentation/themes/katon/dashboard-layout.tsx +1080 -0
- package/src/presentation/themes/katon/edge-section.tsx +19 -0
- package/src/presentation/themes/katon/header-menubar.tsx +270 -0
- package/src/presentation/themes/katon/header-modules-available.tsx +44 -0
- package/src/presentation/themes/katon/header-modules-recents.tsx +52 -0
- package/src/presentation/themes/katon/header-modules-store.tsx +25 -0
- package/src/presentation/themes/katon/header-options.tsx +13 -0
- package/src/presentation/themes/katon/header-organization-select.tsx +146 -0
- package/src/presentation/themes/katon/header-routines.tsx +74 -0
- package/src/presentation/themes/katon/header-tasks-connected-user.tsx +150 -0
- package/src/presentation/themes/katon/index.tsx +16 -0
- package/src/presentation/themes/katon/main-wrapper.tsx +34 -0
- package/src/presentation/themes/katon/module-item-link.tsx +32 -0
- package/src/presentation/themes/katon/view-frame.tsx +25 -0
- package/src/presentation/themes/katon/view-helmet.tsx +53 -0
- package/src/presentation/themes/katon/view-status.tsx +32 -0
- package/src/presentation/themes/katon/view-wrapper.tsx +15 -0
- package/src/presentation/themes/katon/view.tsx +42 -0
- package/src/presentation/ui/accordion-multiselect.tsx +206 -0
- package/src/presentation/ui/accordion.tsx +81 -0
- package/src/presentation/ui/alert-dialog.tsx +199 -0
- package/src/presentation/ui/alert.tsx +76 -0
- package/src/presentation/ui/aspect-ratio.tsx +11 -0
- package/src/presentation/ui/attachment.tsx +204 -0
- package/src/presentation/ui/avatar.tsx +112 -0
- package/src/presentation/ui/badge.tsx +49 -0
- package/src/presentation/ui/breadcrumb.tsx +122 -0
- package/src/presentation/ui/bubble.tsx +125 -0
- package/src/presentation/ui/button-group.tsx +83 -0
- package/src/presentation/ui/button.tsx +87 -0
- package/src/presentation/ui/calendar.tsx +222 -0
- package/src/presentation/ui/card.tsx +106 -0
- package/src/presentation/ui/carousel.tsx +242 -0
- package/src/presentation/ui/chart.tsx +373 -0
- package/src/presentation/ui/checkbox.tsx +33 -0
- package/src/presentation/ui/clickable.tsx +58 -0
- package/src/presentation/ui/collapsible.tsx +33 -0
- package/src/presentation/ui/color-swatch-selector.tsx +81 -0
- package/src/presentation/ui/combobox.tsx +299 -0
- package/src/presentation/ui/command.tsx +195 -0
- package/src/presentation/ui/context-menu.tsx +263 -0
- package/src/presentation/ui/dialog.tsx +168 -0
- package/src/presentation/ui/direction.tsx +22 -0
- package/src/presentation/ui/drawer.tsx +134 -0
- package/src/presentation/ui/dropdown-menu.tsx +269 -0
- package/src/presentation/ui/empty.tsx +104 -0
- package/src/presentation/ui/field.tsx +238 -0
- package/src/presentation/ui/granularity-selector.tsx +58 -0
- package/src/presentation/ui/hover-card.tsx +44 -0
- package/src/presentation/ui/index.tsx +74 -0
- package/src/presentation/ui/input-group.tsx +156 -0
- package/src/presentation/ui/input-otp.tsx +87 -0
- package/src/presentation/ui/input.tsx +19 -0
- package/src/presentation/ui/item.tsx +196 -0
- package/src/presentation/ui/kpi-card.tsx +203 -0
- package/src/presentation/ui/label-selector.tsx +100 -0
- package/src/presentation/ui/label.tsx +24 -0
- package/src/presentation/ui/legacy-birth-date-input.tsx +43 -0
- package/src/presentation/ui/legacy-color-picker/index.tsx +42 -0
- package/src/presentation/ui/legacy-color-picker/legacy-color-picker.content.tsx +37 -0
- package/src/presentation/ui/legacy-color-picker/legacy-color-picker.context.tsx +42 -0
- package/src/presentation/ui/legacy-color-picker/legacy-color-picker.hex-input.tsx +97 -0
- package/src/presentation/ui/legacy-color-picker/legacy-color-picker.picker.tsx +266 -0
- package/src/presentation/ui/legacy-color-picker/legacy-color-picker.presets.ts +22 -0
- package/src/presentation/ui/legacy-color-picker/legacy-color-picker.quick-list.tsx +49 -0
- package/src/presentation/ui/legacy-color-picker/legacy-color-picker.recent.tsx +43 -0
- package/src/presentation/ui/legacy-color-picker/legacy-color-picker.swatches.tsx +111 -0
- package/src/presentation/ui/legacy-color-picker/legacy-color-picker.trigger.tsx +128 -0
- package/src/presentation/ui/legacy-color-picker/legacy-color-picker.tsx +110 -0
- package/src/presentation/ui/legacy-color-picker/legacy-color-picker.types.ts +1 -0
- package/src/presentation/ui/legacy-color-picker/legacy-color-picker.utils.ts +114 -0
- package/src/presentation/ui/legacy-country-input.tsx +171 -0
- package/src/presentation/ui/legacy-gender-input.tsx +22 -0
- package/src/presentation/ui/legacy-input.tsx +106 -0
- package/src/presentation/ui/legacy-phone-input.tsx +213 -0
- package/src/presentation/ui/legacy-select-input.tsx +114 -0
- package/src/presentation/ui/legacy-text-area.tsx +111 -0
- package/src/presentation/ui/list-items.tsx +59 -0
- package/src/presentation/ui/marker.tsx +69 -0
- package/src/presentation/ui/media-player/index.tsx +12 -0
- package/src/presentation/ui/media-player/media-player.context.tsx +36 -0
- package/src/presentation/ui/media-player/media-player.tsx +167 -0
- package/src/presentation/ui/media-player/player-controls.tsx +207 -0
- package/src/presentation/ui/media-player/players/audio-player.tsx +78 -0
- package/src/presentation/ui/media-player/players/index.tsx +4 -0
- package/src/presentation/ui/media-player/players/video-player.tsx +193 -0
- package/src/presentation/ui/media-player/players/voice-note-player.tsx +108 -0
- package/src/presentation/ui/media-player/use-media-player.hook.ts +263 -0
- package/src/presentation/ui/menubar.tsx +281 -0
- package/src/presentation/ui/message.tsx +92 -0
- package/src/presentation/ui/navigation-menu.tsx +172 -0
- package/src/presentation/ui/pagination.tsx +129 -0
- package/src/presentation/ui/popover.tsx +89 -0
- package/src/presentation/ui/progress.tsx +31 -0
- package/src/presentation/ui/resizable.tsx +50 -0
- package/src/presentation/ui/select.tsx +192 -0
- package/src/presentation/ui/separator.tsx +28 -0
- package/src/presentation/ui/sheet.tsx +147 -0
- package/src/presentation/ui/sidebar.tsx +702 -0
- package/src/presentation/ui/skeleton.tsx +13 -0
- package/src/presentation/ui/slide-to-confirm.tsx +129 -0
- package/src/presentation/ui/slider.tsx +59 -0
- package/src/presentation/ui/sonner.tsx +58 -0
- package/src/presentation/ui/switch.tsx +33 -0
- package/src/presentation/ui/table.tsx +116 -0
- package/src/presentation/ui/tabs.tsx +90 -0
- package/src/presentation/ui/text-gradient.tsx +84 -0
- package/src/presentation/ui/textarea.tsx +18 -0
- package/src/presentation/ui/timeline-steps.tsx +235 -0
- package/src/presentation/ui/toggle-group.tsx +89 -0
- package/src/presentation/ui/toggle.tsx +47 -0
- package/src/presentation/ui/tooltip.tsx +57 -0
- package/src/presentation/uploading/index.tsx +3 -0
- package/src/presentation/uploading/media-upload-field.tsx +152 -0
- package/src/presentation/uploading/storage-media.tsx +210 -0
- package/src/styles.css +403 -0
- package/src/themes.css +1038 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {CacheStorageType} from "./enum";
|
|
2
|
+
import {StackableCapabilityInterface, StackableEntityType} from "../stackable/types";
|
|
3
|
+
|
|
4
|
+
export interface ICacheStorageCapability<T extends StackableEntityType> extends StackableCapabilityInterface<T> {
|
|
5
|
+
readonly key: string;
|
|
6
|
+
readonly type: CacheStorageType;
|
|
7
|
+
|
|
8
|
+
save(): Promise<boolean>;
|
|
9
|
+
|
|
10
|
+
load(): Promise<T>;
|
|
11
|
+
|
|
12
|
+
ready(): Promise<T>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {StackableCapabilityInterface, StackableEntityType, StackableMapType} from "./types";
|
|
2
|
+
|
|
3
|
+
export class StackableCapability<T extends StackableEntityType> implements StackableCapabilityInterface<T> {
|
|
4
|
+
|
|
5
|
+
protected _stack: StackableMapType<T> = new Map()
|
|
6
|
+
|
|
7
|
+
protected _providing(provider: T): this {
|
|
8
|
+
for (const entry of Object.entries(provider)) {
|
|
9
|
+
this._stack.set(entry[0], entry[1] as T[keyof T]);
|
|
10
|
+
}
|
|
11
|
+
return this;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
get stack(): StackableMapType<T> {
|
|
15
|
+
return this._stack;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
get<K extends keyof T>(key: K): T[K] | undefined {
|
|
19
|
+
return this._stack.get(key) as any;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
set<K extends keyof T>(key: K, value: T[K]): this {
|
|
23
|
+
this._stack.set(key, value);
|
|
24
|
+
return this;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
has<K extends keyof T>(key: K): boolean {
|
|
28
|
+
return this._stack.has(key);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
delete<K extends keyof T>(key: K): this {
|
|
32
|
+
this._stack.delete(key);
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
clear(): this {
|
|
37
|
+
this._stack.clear();
|
|
38
|
+
return this;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
fromString(data: string): T {
|
|
42
|
+
return this._providing(JSON.parse(data) as T).toObject();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
toObject(): T {
|
|
46
|
+
const stack: T = {} as T;
|
|
47
|
+
for (const [key, value] of this._stack.entries()) stack[key] = value;
|
|
48
|
+
return stack;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
toJson(): string {
|
|
52
|
+
return JSON.stringify(this.toObject());
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
|
|
2
|
+
export type StackableValueType = string | number | boolean | object | null | undefined;
|
|
3
|
+
|
|
4
|
+
export type StackableEntityType = Record<string, StackableValueType>;
|
|
5
|
+
|
|
6
|
+
export type StackableMapType<T extends StackableEntityType> = Map<keyof T, T[keyof T]>;
|
|
7
|
+
|
|
8
|
+
export interface StackableCapabilityInterface<T extends StackableEntityType> {
|
|
9
|
+
get stack(): StackableMapType<T>;
|
|
10
|
+
|
|
11
|
+
get<K extends keyof T>(key: K): T[K] | undefined;
|
|
12
|
+
|
|
13
|
+
set<K extends keyof T>(key: K, value: T[K]): this;
|
|
14
|
+
|
|
15
|
+
has<K extends keyof T>(key: K): boolean;
|
|
16
|
+
|
|
17
|
+
delete<K extends keyof T>(key: K): this;
|
|
18
|
+
|
|
19
|
+
clear(): this;
|
|
20
|
+
|
|
21
|
+
toObject(): T;
|
|
22
|
+
|
|
23
|
+
toJson(): string;
|
|
24
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export const COMMON_CLASSNAMES = {
|
|
2
|
+
Layer: "bg-background/50 border border rounded-4xl shadow-lg",
|
|
3
|
+
SheetContent: "sm:flex w-full! max-w-[calc(100dvw-16px)]! md:max-w-[70dvw]! max-h-[90dvh]! sm:max-h-[calc(100dvh-16px)]! h-full! p-0 flex-col sm:h-full! m-2 rounded-2xl"
|
|
4
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
export interface CountryInterface {
|
|
2
|
+
name: string;
|
|
3
|
+
code: string;
|
|
4
|
+
dialCode: string;
|
|
5
|
+
flag: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const countriesConstant: CountryInterface[] = [
|
|
9
|
+
{ name: "Afghanistan", code: "AF", dialCode: "+93", flag: "🇦🇫" },
|
|
10
|
+
{ name: "Albanie", code: "AL", dialCode: "+355", flag: "🇦🇱" },
|
|
11
|
+
{ name: "Algérie", code: "DZ", dialCode: "+213", flag: "🇩🇿" },
|
|
12
|
+
{ name: "Andorre", code: "AD", dialCode: "+376", flag: "🇦🇩" },
|
|
13
|
+
{ name: "Angola", code: "AO", dialCode: "+244", flag: "🇦🇴" },
|
|
14
|
+
{ name: "Antigua-et-Barbuda", code: "AG", dialCode: "+1", flag: "🇦🇬" },
|
|
15
|
+
{ name: "Argentine", code: "AR", dialCode: "+54", flag: "🇦🇷" },
|
|
16
|
+
{ name: "Arménie", code: "AM", dialCode: "+374", flag: "🇦🇲" },
|
|
17
|
+
{ name: "Australie", code: "AU", dialCode: "+61", flag: "🇦🇺" },
|
|
18
|
+
{ name: "Autriche", code: "AT", dialCode: "+43", flag: "🇦🇹" },
|
|
19
|
+
{ name: "Azerbaïdjan", code: "AZ", dialCode: "+994", flag: "🇦🇿" },
|
|
20
|
+
{ name: "Bahamas", code: "BS", dialCode: "+1", flag: "🇧🇸" },
|
|
21
|
+
{ name: "Bahreïn", code: "BH", dialCode: "+973", flag: "🇧🇭" },
|
|
22
|
+
{ name: "Bangladesh", code: "BD", dialCode: "+880", flag: "🇧🇩" },
|
|
23
|
+
{ name: "Barbade", code: "BB", dialCode: "+1", flag: "🇧🇧" },
|
|
24
|
+
{ name: "Biélorussie", code: "BY", dialCode: "+375", flag: "🇧🇾" },
|
|
25
|
+
{ name: "Belgique", code: "BE", dialCode: "+32", flag: "🇧🇪" },
|
|
26
|
+
{ name: "Belize", code: "BZ", dialCode: "+501", flag: "🇧🇿" },
|
|
27
|
+
{ name: "Bénin", code: "BJ", dialCode: "+229", flag: "🇧🇯" },
|
|
28
|
+
{ name: "Bhoutan", code: "BT", dialCode: "+975", flag: "🇧🇹" },
|
|
29
|
+
{ name: "Bolivie", code: "BO", dialCode: "+591", flag: "🇧🇴" },
|
|
30
|
+
{ name: "Bosnie-Herzégovine", code: "BA", dialCode: "+387", flag: "🇧🇦" },
|
|
31
|
+
{ name: "Botswana", code: "BW", dialCode: "+267", flag: "🇧🇼" },
|
|
32
|
+
{ name: "Brésil", code: "BR", dialCode: "+55", flag: "🇧🇷" },
|
|
33
|
+
{ name: "Brunei", code: "BN", dialCode: "+673", flag: "🇧🇳" },
|
|
34
|
+
{ name: "Bulgarie", code: "BG", dialCode: "+359", flag: "🇧🇬" },
|
|
35
|
+
{ name: "Burkina Faso", code: "BF", dialCode: "+226", flag: "🇧🇫" },
|
|
36
|
+
{ name: "Burundi", code: "BI", dialCode: "+257", flag: "🇧🇮" },
|
|
37
|
+
{ name: "Cambodge", code: "KH", dialCode: "+855", flag: "🇰🇭" },
|
|
38
|
+
{ name: "Cameroun", code: "CM", dialCode: "+237", flag: "🇨🇲" },
|
|
39
|
+
{ name: "Canada", code: "CA", dialCode: "+1", flag: "🇨🇦" },
|
|
40
|
+
{ name: "Cap-Vert", code: "CV", dialCode: "+238", flag: "🇨🇻" },
|
|
41
|
+
{ name: "République centrafricaine", code: "CF", dialCode: "+236", flag: "🇨🇫" },
|
|
42
|
+
{ name: "Tchad", code: "TD", dialCode: "+235", flag: "🇹🇩" },
|
|
43
|
+
{ name: "Chili", code: "CL", dialCode: "+56", flag: "🇨🇱" },
|
|
44
|
+
{ name: "Chine", code: "CN", dialCode: "+86", flag: "🇨🇳" },
|
|
45
|
+
{ name: "Colombie", code: "CO", dialCode: "+57", flag: "🇨🇴" },
|
|
46
|
+
{ name: "Comores", code: "KM", dialCode: "+269", flag: "🇰🇲" },
|
|
47
|
+
{ name: "Congo", code: "CG", dialCode: "+242", flag: "🇨🇬" },
|
|
48
|
+
{ name: "Congo (RDC)", code: "CD", dialCode: "+243", flag: "🇨🇩" },
|
|
49
|
+
{ name: "Îles Cook", code: "CK", dialCode: "+682", flag: "🇨🇰" },
|
|
50
|
+
{ name: "Costa Rica", code: "CR", dialCode: "+506", flag: "🇨🇷" },
|
|
51
|
+
{ name: "Côte d'Ivoire", code: "CI", dialCode: "+225", flag: "🇨🇮" },
|
|
52
|
+
{ name: "Croatie", code: "HR", dialCode: "+385", flag: "🇭🇷" },
|
|
53
|
+
{ name: "Cuba", code: "CU", dialCode: "+53", flag: "🇨🇺" },
|
|
54
|
+
{ name: "Chypre", code: "CY", dialCode: "+357", flag: "🇨🇾" },
|
|
55
|
+
{ name: "Tchéquie", code: "CZ", dialCode: "+420", flag: "🇨🇿" },
|
|
56
|
+
{ name: "Danemark", code: "DK", dialCode: "+45", flag: "🇩🇰" },
|
|
57
|
+
{ name: "Djibouti", code: "DJ", dialCode: "+253", flag: "🇩🇯" },
|
|
58
|
+
{ name: "Dominique", code: "DM", dialCode: "+1", flag: "🇩🇲" },
|
|
59
|
+
{ name: "République dominicaine", code: "DO", dialCode: "+1", flag: "🇩🇴" },
|
|
60
|
+
{ name: "Équateur", code: "EC", dialCode: "+593", flag: "🇪🇨" },
|
|
61
|
+
{ name: "Égypte", code: "EG", dialCode: "+20", flag: "🇪🇬" },
|
|
62
|
+
{ name: "Salvador", code: "SV", dialCode: "+503", flag: "🇸🇻" },
|
|
63
|
+
{ name: "Guinée équatoriale", code: "GQ", dialCode: "+240", flag: "🇬🇶" },
|
|
64
|
+
{ name: "Érythrée", code: "ER", dialCode: "+291", flag: "🇪🇷" },
|
|
65
|
+
{ name: "Estonie", code: "EE", dialCode: "+372", flag: "🇪🇪" },
|
|
66
|
+
{ name: "Eswatini", code: "SZ", dialCode: "+268", flag: "🇸🇿" },
|
|
67
|
+
{ name: "Éthiopie", code: "ET", dialCode: "+251", flag: "🇪🇹" },
|
|
68
|
+
{ name: "Fidji", code: "FJ", dialCode: "+679", flag: "🇫🇯" },
|
|
69
|
+
{ name: "Finlande", code: "FI", dialCode: "+358", flag: "🇫🇮" },
|
|
70
|
+
{ name: "France", code: "FR", dialCode: "+33", flag: "🇫🇷" },
|
|
71
|
+
{ name: "Gabon", code: "GA", dialCode: "+241", flag: "🇬🇦" },
|
|
72
|
+
{ name: "Gambie", code: "GM", dialCode: "+220", flag: "🇬🇲" },
|
|
73
|
+
{ name: "Géorgie", code: "GE", dialCode: "+995", flag: "🇬🇪" },
|
|
74
|
+
{ name: "Allemagne", code: "DE", dialCode: "+49", flag: "🇩🇪" },
|
|
75
|
+
{ name: "Ghana", code: "GH", dialCode: "+233", flag: "🇬🇭" },
|
|
76
|
+
{ name: "Grèce", code: "GR", dialCode: "+30", flag: "🇬🇷" },
|
|
77
|
+
{ name: "Grenade", code: "GD", dialCode: "+1", flag: "🇬🇩" },
|
|
78
|
+
{ name: "Guatemala", code: "GT", dialCode: "+502", flag: "🇬🇹" },
|
|
79
|
+
{ name: "Guinée", code: "GN", dialCode: "+224", flag: "🇬🇳" },
|
|
80
|
+
{ name: "Guinée-Bissau", code: "GW", dialCode: "+245", flag: "🇬🇼" },
|
|
81
|
+
{ name: "Guyana", code: "GY", dialCode: "+592", flag: "🇬🇾" },
|
|
82
|
+
{ name: "Haïti", code: "HT", dialCode: "+509", flag: "🇭🇹" },
|
|
83
|
+
{ name: "Honduras", code: "HN", dialCode: "+504", flag: "🇭🇳" },
|
|
84
|
+
{ name: "Hongrie", code: "HU", dialCode: "+36", flag: "🇭🇺" },
|
|
85
|
+
{ name: "Islande", code: "IS", dialCode: "+354", flag: "🇮🇸" },
|
|
86
|
+
{ name: "Inde", code: "IN", dialCode: "+91", flag: "🇮🇳" },
|
|
87
|
+
{ name: "Indonésie", code: "ID", dialCode: "+62", flag: "🇮🇩" },
|
|
88
|
+
{ name: "Iran", code: "IR", dialCode: "+98", flag: "🇮🇷" },
|
|
89
|
+
{ name: "Irak", code: "IQ", dialCode: "+964", flag: "🇮🇶" },
|
|
90
|
+
{ name: "Irlande", code: "IE", dialCode: "+353", flag: "🇮🇪" },
|
|
91
|
+
{ name: "Israël", code: "IL", dialCode: "+972", flag: "🇮🇱" },
|
|
92
|
+
{ name: "Italie", code: "IT", dialCode: "+39", flag: "🇮🇹" },
|
|
93
|
+
{ name: "Jamaïque", code: "JM", dialCode: "+1", flag: "🇯🇲" },
|
|
94
|
+
{ name: "Japon", code: "JP", dialCode: "+81", flag: "🇯🇵" },
|
|
95
|
+
{ name: "Jordanie", code: "JO", dialCode: "+962", flag: "🇯🇴" },
|
|
96
|
+
{ name: "Kazakhstan", code: "KZ", dialCode: "+7", flag: "🇰🇿" },
|
|
97
|
+
{ name: "Kenya", code: "KE", dialCode: "+254", flag: "🇰🇪" },
|
|
98
|
+
{ name: "Kiribati", code: "KI", dialCode: "+686", flag: "🇰🇮" },
|
|
99
|
+
{ name: "Koweït", code: "KW", dialCode: "+965", flag: "🇰🇼" },
|
|
100
|
+
{ name: "Kirghizistan", code: "KG", dialCode: "+996", flag: "🇰🇬" },
|
|
101
|
+
{ name: "Laos", code: "LA", dialCode: "+856", flag: "🇱🇦" },
|
|
102
|
+
{ name: "Lettonie", code: "LV", dialCode: "+371", flag: "🇱🇻" },
|
|
103
|
+
{ name: "Liban", code: "LB", dialCode: "+961", flag: "🇱🇧" },
|
|
104
|
+
{ name: "Lesotho", code: "LS", dialCode: "+266", flag: "🇱🇸" },
|
|
105
|
+
{ name: "Liberia", code: "LR", dialCode: "+231", flag: "🇱🇷" },
|
|
106
|
+
{ name: "Libye", code: "LY", dialCode: "+218", flag: "🇱🇾" },
|
|
107
|
+
{ name: "Liechtenstein", code: "LI", dialCode: "+423", flag: "🇱🇮" },
|
|
108
|
+
{ name: "Lituanie", code: "LT", dialCode: "+370", flag: "🇱🇹" },
|
|
109
|
+
{ name: "Luxembourg", code: "LU", dialCode: "+352", flag: "🇱🇺" },
|
|
110
|
+
{ name: "Madagascar", code: "MG", dialCode: "+261", flag: "🇲🇬" },
|
|
111
|
+
{ name: "Malawi", code: "MW", dialCode: "+265", flag: "🇲🇼" },
|
|
112
|
+
{ name: "Malaisie", code: "MY", dialCode: "+60", flag: "🇲🇾" },
|
|
113
|
+
{ name: "Maldives", code: "MV", dialCode: "+960", flag: "🇲🇻" },
|
|
114
|
+
{ name: "Mali", code: "ML", dialCode: "+223", flag: "🇲🇱" },
|
|
115
|
+
{ name: "Malte", code: "MT", dialCode: "+356", flag: "🇲🇹" },
|
|
116
|
+
{ name: "Îles Marshall", code: "MH", dialCode: "+692", flag: "🇲🇭" },
|
|
117
|
+
{ name: "Mauritanie", code: "MR", dialCode: "+222", flag: "🇲🇷" },
|
|
118
|
+
{ name: "Maurice", code: "MU", dialCode: "+230", flag: "🇲🇺" },
|
|
119
|
+
{ name: "Mexique", code: "MX", dialCode: "+52", flag: "🇲🇽" },
|
|
120
|
+
{ name: "Micronésie", code: "FM", dialCode: "+691", flag: "🇫🇲" },
|
|
121
|
+
{ name: "Moldavie", code: "MD", dialCode: "+373", flag: "🇲🇩" },
|
|
122
|
+
{ name: "Monaco", code: "MC", dialCode: "+377", flag: "🇲🇨" },
|
|
123
|
+
{ name: "Mongolie", code: "MN", dialCode: "+976", flag: "🇲🇳" },
|
|
124
|
+
{ name: "Monténégro", code: "ME", dialCode: "+382", flag: "🇲🇪" },
|
|
125
|
+
{ name: "Maroc", code: "MA", dialCode: "+212", flag: "🇲🇦" },
|
|
126
|
+
{ name: "Mozambique", code: "MZ", dialCode: "+258", flag: "🇲🇿" },
|
|
127
|
+
{ name: "Myanmar", code: "MM", dialCode: "+95", flag: "🇲🇲" },
|
|
128
|
+
{ name: "Namibie", code: "NA", dialCode: "+264", flag: "🇳🇦" },
|
|
129
|
+
{ name: "Nauru", code: "NR", dialCode: "+674", flag: "🇳🇷" },
|
|
130
|
+
{ name: "Népal", code: "NP", dialCode: "+977", flag: "🇳🇵" },
|
|
131
|
+
{ name: "Pays-Bas", code: "NL", dialCode: "+31", flag: "🇳🇱" },
|
|
132
|
+
{ name: "Nouvelle-Zélande", code: "NZ", dialCode: "+64", flag: "🇳🇿" },
|
|
133
|
+
{ name: "Nicaragua", code: "NI", dialCode: "+505", flag: "🇳🇮" },
|
|
134
|
+
{ name: "Niger", code: "NE", dialCode: "+227", flag: "🇳🇪" },
|
|
135
|
+
{ name: "Nigeria", code: "NG", dialCode: "+234", flag: "🇳🇬" },
|
|
136
|
+
{ name: "Niue", code: "NU", dialCode: "+683", flag: "🇳🇺" },
|
|
137
|
+
{ name: "Corée du Nord", code: "KP", dialCode: "+850", flag: "🇰🇵" },
|
|
138
|
+
{ name: "Macédoine du Nord", code: "MK", dialCode: "+389", flag: "🇲🇰" },
|
|
139
|
+
{ name: "Norvège", code: "NO", dialCode: "+47", flag: "🇳🇴" },
|
|
140
|
+
{ name: "Oman", code: "OM", dialCode: "+968", flag: "🇴🇲" },
|
|
141
|
+
{ name: "Pakistan", code: "PK", dialCode: "+92", flag: "🇵🇰" },
|
|
142
|
+
{ name: "Palaos", code: "PW", dialCode: "+680", flag: "🇵🇼" },
|
|
143
|
+
{ name: "Palestine", code: "PS", dialCode: "+970", flag: "🇵🇸" },
|
|
144
|
+
{ name: "Panama", code: "PA", dialCode: "+507", flag: "🇵🇦" },
|
|
145
|
+
{ name: "Papouasie-Nouvelle-Guinée", code: "PG", dialCode: "+675", flag: "🇵🇬" },
|
|
146
|
+
{ name: "Paraguay", code: "PY", dialCode: "+595", flag: "🇵🇾" },
|
|
147
|
+
{ name: "Pérou", code: "PE", dialCode: "+51", flag: "🇵🇪" },
|
|
148
|
+
{ name: "Philippines", code: "PH", dialCode: "+63", flag: "🇵🇭" },
|
|
149
|
+
{ name: "Pologne", code: "PL", dialCode: "+48", flag: "🇵🇱" },
|
|
150
|
+
{ name: "Portugal", code: "PT", dialCode: "+351", flag: "🇵🇹" },
|
|
151
|
+
{ name: "Qatar", code: "QA", dialCode: "+974", flag: "🇶🇦" },
|
|
152
|
+
{ name: "Roumanie", code: "RO", dialCode: "+40", flag: "🇷🇴" },
|
|
153
|
+
{ name: "Russie", code: "RU", dialCode: "+7", flag: "🇷🇺" },
|
|
154
|
+
{ name: "Rwanda", code: "RW", dialCode: "+250", flag: "🇷🇼" },
|
|
155
|
+
{ name: "Saint-Christophe-et-Niévès", code: "KN", dialCode: "+1", flag: "🇰🇳" },
|
|
156
|
+
{ name: "Sainte-Lucie", code: "LC", dialCode: "+1", flag: "🇱🇨" },
|
|
157
|
+
{ name: "Saint-Vincent-et-les-Grenadines", code: "VC", dialCode: "+1", flag: "🇻🇨" },
|
|
158
|
+
{ name: "Samoa", code: "WS", dialCode: "+685", flag: "🇼🇸" },
|
|
159
|
+
{ name: "Saint-Marin", code: "SM", dialCode: "+378", flag: "🇸🇲" },
|
|
160
|
+
{ name: "Sao Tomé-et-Principe", code: "ST", dialCode: "+239", flag: "🇸🇹" },
|
|
161
|
+
{ name: "Arabie saoudite", code: "SA", dialCode: "+966", flag: "🇸🇦" },
|
|
162
|
+
{ name: "Sénégal", code: "SN", dialCode: "+221", flag: "🇸🇳" },
|
|
163
|
+
{ name: "Serbie", code: "RS", dialCode: "+381", flag: "🇷🇸" },
|
|
164
|
+
{ name: "Seychelles", code: "SC", dialCode: "+248", flag: "🇸🇨" },
|
|
165
|
+
{ name: "Sierra Leone", code: "SL", dialCode: "+232", flag: "🇸🇱" },
|
|
166
|
+
{ name: "Singapour", code: "SG", dialCode: "+65", flag: "🇸🇬" },
|
|
167
|
+
{ name: "Slovaquie", code: "SK", dialCode: "+421", flag: "🇸🇰" },
|
|
168
|
+
{ name: "Slovénie", code: "SI", dialCode: "+386", flag: "🇸🇮" },
|
|
169
|
+
{ name: "Îles Salomon", code: "SB", dialCode: "+677", flag: "🇸🇧" },
|
|
170
|
+
{ name: "Somalie", code: "SO", dialCode: "+252", flag: "🇸🇴" },
|
|
171
|
+
{ name: "Afrique du Sud", code: "ZA", dialCode: "+27", flag: "🇿🇦" },
|
|
172
|
+
{ name: "Corée du Sud", code: "KR", dialCode: "+82", flag: "🇰🇷" },
|
|
173
|
+
{ name: "Soudan du Sud", code: "SS", dialCode: "+211", flag: "🇸🇸" },
|
|
174
|
+
{ name: "Espagne", code: "ES", dialCode: "+34", flag: "🇪🇸" },
|
|
175
|
+
{ name: "Sri Lanka", code: "LK", dialCode: "+94", flag: "🇱🇰" },
|
|
176
|
+
{ name: "Soudan", code: "SD", dialCode: "+249", flag: "🇸🇩" },
|
|
177
|
+
{ name: "Suriname", code: "SR", dialCode: "+597", flag: "🇸🇷" },
|
|
178
|
+
{ name: "Suède", code: "SE", dialCode: "+46", flag: "🇸🇪" },
|
|
179
|
+
{ name: "Suisse", code: "CH", dialCode: "+41", flag: "🇨🇭" },
|
|
180
|
+
{ name: "Syrie", code: "SY", dialCode: "+963", flag: "🇸🇾" },
|
|
181
|
+
{ name: "Taïwan", code: "TW", dialCode: "+886", flag: "🇹🇼" },
|
|
182
|
+
{ name: "Tadjikistan", code: "TJ", dialCode: "+992", flag: "🇹🇯" },
|
|
183
|
+
{ name: "Tanzanie", code: "TZ", dialCode: "+255", flag: "🇹🇿" },
|
|
184
|
+
{ name: "Thaïlande", code: "TH", dialCode: "+66", flag: "🇹🇭" },
|
|
185
|
+
{ name: "Timor oriental", code: "TL", dialCode: "+670", flag: "🇹🇱" },
|
|
186
|
+
{ name: "Togo", code: "TG", dialCode: "+228", flag: "🇹🇬" },
|
|
187
|
+
{ name: "Tokelau", code: "TK", dialCode: "+690", flag: "🇹🇰" },
|
|
188
|
+
{ name: "Tonga", code: "TO", dialCode: "+676", flag: "🇹🇴" },
|
|
189
|
+
{ name: "Trinité-et-Tobago", code: "TT", dialCode: "+1", flag: "🇹🇹" },
|
|
190
|
+
{ name: "Tunisie", code: "TN", dialCode: "+216", flag: "🇹🇳" },
|
|
191
|
+
{ name: "Turquie", code: "TR", dialCode: "+90", flag: "🇹🇷" },
|
|
192
|
+
{ name: "Turkménistan", code: "TM", dialCode: "+993", flag: "🇹🇲" },
|
|
193
|
+
{ name: "Tuvalu", code: "TV", dialCode: "+688", flag: "🇹🇻" },
|
|
194
|
+
{ name: "Ouganda", code: "UG", dialCode: "+256", flag: "🇺🇬" },
|
|
195
|
+
{ name: "Ukraine", code: "UA", dialCode: "+380", flag: "🇺🇦" },
|
|
196
|
+
{ name: "Émirats arabes unis", code: "AE", dialCode: "+971", flag: "🇦🇪" },
|
|
197
|
+
{ name: "Royaume-Uni", code: "GB", dialCode: "+44", flag: "🇬🇧" },
|
|
198
|
+
{ name: "États-Unis", code: "US", dialCode: "+1", flag: "🇺🇸" },
|
|
199
|
+
{ name: "Uruguay", code: "UY", dialCode: "+598", flag: "🇺🇾" },
|
|
200
|
+
{ name: "Ouzbékistan", code: "UZ", dialCode: "+998", flag: "🇺🇿" },
|
|
201
|
+
{ name: "Vanuatu", code: "VU", dialCode: "+678", flag: "🇻🇺" },
|
|
202
|
+
{ name: "Vatican", code: "VA", dialCode: "+379", flag: "🇻🇦" },
|
|
203
|
+
{ name: "Venezuela", code: "VE", dialCode: "+58", flag: "🇻🇪" },
|
|
204
|
+
{ name: "Viêt Nam", code: "VN", dialCode: "+84", flag: "🇻🇳" },
|
|
205
|
+
{ name: "Yémen", code: "YE", dialCode: "+967", flag: "🇾🇪" },
|
|
206
|
+
{ name: "Zambie", code: "ZM", dialCode: "+260", flag: "🇿🇲" },
|
|
207
|
+
{ name: "Zimbabwe", code: "ZW", dialCode: "+263", flag: "🇿🇼" },
|
|
208
|
+
];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {createDataset} from "../stores/dataset.store";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export interface SignInDatasetInterface {
|
|
5
|
+
identifier: string | undefined;
|
|
6
|
+
password: string | undefined;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const SignInDataset = createDataset<SignInDatasetInterface>({
|
|
10
|
+
identifier: undefined,
|
|
11
|
+
password: undefined,
|
|
12
|
+
}, {
|
|
13
|
+
identifier: (v) => {
|
|
14
|
+
if (!v) return "Identifiant requis";
|
|
15
|
+
return null;
|
|
16
|
+
},
|
|
17
|
+
password: (v) => {
|
|
18
|
+
if (!v) return "Mot de passe requis";
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import {createDataset} from "../stores/dataset.store";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export interface SignUpDatasetInterface {
|
|
5
|
+
username?: string;
|
|
6
|
+
email: string | undefined;
|
|
7
|
+
password: string | undefined;
|
|
8
|
+
password_confirmation: string | undefined;
|
|
9
|
+
first_names?: string;
|
|
10
|
+
last_name?: string;
|
|
11
|
+
phone?: string;
|
|
12
|
+
otp?: string;
|
|
13
|
+
country?: string;
|
|
14
|
+
city?: string;
|
|
15
|
+
address?: string;
|
|
16
|
+
gender?: string;
|
|
17
|
+
birth_date?: string;
|
|
18
|
+
organization?: string;
|
|
19
|
+
idRecto?: any;
|
|
20
|
+
idVerso?: any;
|
|
21
|
+
selfie?: any;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const SignUpDataset = createDataset<SignUpDatasetInterface>({
|
|
25
|
+
username: undefined,
|
|
26
|
+
email: undefined,
|
|
27
|
+
password: undefined,
|
|
28
|
+
password_confirmation: undefined,
|
|
29
|
+
first_names: undefined,
|
|
30
|
+
last_name: undefined,
|
|
31
|
+
phone: undefined,
|
|
32
|
+
otp: undefined,
|
|
33
|
+
country: undefined,
|
|
34
|
+
city: undefined,
|
|
35
|
+
address: undefined,
|
|
36
|
+
gender: undefined,
|
|
37
|
+
birth_date: undefined,
|
|
38
|
+
organization: undefined,
|
|
39
|
+
idRecto: undefined,
|
|
40
|
+
idVerso: undefined,
|
|
41
|
+
selfie: undefined,
|
|
42
|
+
}, {
|
|
43
|
+
username: (v) => (!v ? "Nom d'utilisateur requis" : null),
|
|
44
|
+
email: (v) => {
|
|
45
|
+
if (!v) return "Email requis";
|
|
46
|
+
const re = /\S+@\S+\.\S+/;
|
|
47
|
+
return re.test(v) ? null : "Email invalide";
|
|
48
|
+
},
|
|
49
|
+
password: (v) => {
|
|
50
|
+
if (!v) return "Mot de passe requis";
|
|
51
|
+
if (typeof v === 'string' && v.length < 6) return "Mot de passe trop court (>=6)";
|
|
52
|
+
return null;
|
|
53
|
+
},
|
|
54
|
+
password_confirmation: (v) => (!v ? "Confirmation requise" : null),
|
|
55
|
+
first_names: (v) => (!v ? "Prénom(s) requis" : null),
|
|
56
|
+
last_name: (v) => (!v ? "Nom requis" : null),
|
|
57
|
+
organization: (v) => (!v ? "organization requise" : null),
|
|
58
|
+
phone: (v) => {
|
|
59
|
+
if (!v) return "Numéro de téléphone requis";
|
|
60
|
+
if (!/^\+?[0-9\s\-()]{10,}$/.test(v)) return "Numéro de téléphone invalide";
|
|
61
|
+
return null;
|
|
62
|
+
},
|
|
63
|
+
otp: (v) => (!v ? "Code OTP requis" : null),
|
|
64
|
+
})
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// @liorian/sdk/infrastructure/hooks — shared React hooks.
|
|
2
|
+
export * from "./use-activity-lock-draft";
|
|
3
|
+
export * from "./use-auth";
|
|
4
|
+
export * from "./use-elastic-interaction";
|
|
5
|
+
export * from "./use-is-desktop";
|
|
6
|
+
export * from "./use-is-tauri";
|
|
7
|
+
export * from "./use-mobile";
|
|
8
|
+
export * from "./use-notifications";
|
|
9
|
+
export * from "./use-recent-colors";
|
|
10
|
+
export * from "./use-recent-modules";
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import {ACTIVITY_LOCK_EVENT, ACTIVITY_UNLOCK_EVENT} from "../utilities/form-snapshot.service";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Hook réutilisable pour sauvegarder/restaurer une valeur de formulaire (React state)
|
|
8
|
+
* autour d'un verrouillage d'activité.
|
|
9
|
+
*
|
|
10
|
+
* - À chaque verrouillage (`ACTIVITY_LOCK_EVENT`), la valeur courante est persistée dans
|
|
11
|
+
* le `sessionStorage` sous la clé fournie.
|
|
12
|
+
* - Au déverrouillage (`ACTIVITY_UNLOCK_EVENT`) — et au remontage du champ — la valeur
|
|
13
|
+
* est restaurée via le `setValue`, ce qui fonctionne pour tout état React (input,
|
|
14
|
+
* select non-natif, combobox, checkbox…).
|
|
15
|
+
*
|
|
16
|
+
* @param storageKey Clé de stockage dédiée (préfixer par la page/formulaire, ex. `quote.form.summary`).
|
|
17
|
+
* @param initialValue Valeur initiale (utilisée hors brouillon).
|
|
18
|
+
*/
|
|
19
|
+
export function useActivityLockDraft<T>(
|
|
20
|
+
storageKey: string,
|
|
21
|
+
initialValue: T
|
|
22
|
+
): [T, React.Dispatch<React.SetStateAction<T>>] {
|
|
23
|
+
const [value, setValue] = React.useState<T>(initialValue);
|
|
24
|
+
const valueRef = React.useRef<T>(initialValue);
|
|
25
|
+
|
|
26
|
+
React.useEffect(() => {
|
|
27
|
+
if (typeof window === "undefined") return;
|
|
28
|
+
|
|
29
|
+
const restore = () => {
|
|
30
|
+
try {
|
|
31
|
+
const raw = window.sessionStorage.getItem(storageKey);
|
|
32
|
+
if (raw != null) {
|
|
33
|
+
const parsed = JSON.parse(raw) as T;
|
|
34
|
+
valueRef.current = parsed;
|
|
35
|
+
setValue(parsed);
|
|
36
|
+
}
|
|
37
|
+
} catch {
|
|
38
|
+
// Brouillon illisible : on conserve la valeur courante.
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const persist = () => {
|
|
42
|
+
try {
|
|
43
|
+
window.sessionStorage.setItem(storageKey, JSON.stringify(valueRef.current));
|
|
44
|
+
} catch {
|
|
45
|
+
// Stockage indisponible : on ignore.
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// Re-hydrate après un rafraîchissement pendant que l'écran était verrouillé.
|
|
50
|
+
restore();
|
|
51
|
+
|
|
52
|
+
window.addEventListener(ACTIVITY_LOCK_EVENT, persist);
|
|
53
|
+
window.addEventListener(ACTIVITY_UNLOCK_EVENT, restore);
|
|
54
|
+
return () => {
|
|
55
|
+
window.removeEventListener(ACTIVITY_LOCK_EVENT, persist);
|
|
56
|
+
window.removeEventListener(ACTIVITY_UNLOCK_EVENT, restore);
|
|
57
|
+
};
|
|
58
|
+
}, [storageKey]);
|
|
59
|
+
|
|
60
|
+
const setDraft = React.useCallback<React.Dispatch<React.SetStateAction<T>>>((next) => {
|
|
61
|
+
setValue((previous) => {
|
|
62
|
+
const resolved = typeof next === "function" ? (next as (previous: T) => T)(previous) : next;
|
|
63
|
+
valueRef.current = resolved;
|
|
64
|
+
return resolved;
|
|
65
|
+
});
|
|
66
|
+
}, []);
|
|
67
|
+
|
|
68
|
+
return [value, setDraft];
|
|
69
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import {authUserConnectedStore} from "../stores/auth-user-connected.store"
|
|
4
|
+
import {useRouter} from "next/navigation"
|
|
5
|
+
import {AuthConfig} from "../../domain/config/auth.config";
|
|
6
|
+
import {authLogoutUtil} from "../utilities/auth-logout.util";
|
|
7
|
+
|
|
8
|
+
export function useAuth() {
|
|
9
|
+
const {getCurrentUser, setCurrentUser, currentOrganization, organizations} = authUserConnectedStore()
|
|
10
|
+
const router = useRouter()
|
|
11
|
+
|
|
12
|
+
const logout = async () => {
|
|
13
|
+
await authLogoutUtil();
|
|
14
|
+
router.push(`${AuthConfig.routes.logout}`)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
user: getCurrentUser,
|
|
19
|
+
currentOrganization,
|
|
20
|
+
organizations,
|
|
21
|
+
isAuthenticated: !!getCurrentUser,
|
|
22
|
+
logout
|
|
23
|
+
}
|
|
24
|
+
}
|