@powerportalspro/react 5.1.0 → 6.0.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/EULA.txt +263 -0
- package/README.md +25 -0
- package/dist/index.cjs +16 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +15 -1
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
package/dist/index.d.cts
CHANGED
|
@@ -1933,6 +1933,17 @@ interface CreateLocalizerOptions {
|
|
|
1933
1933
|
*/
|
|
1934
1934
|
onMissingKey?: (key: string) => void;
|
|
1935
1935
|
}
|
|
1936
|
+
/**
|
|
1937
|
+
* Query-string flag that switches the localizer into "show keys" mode — mirrors the C#
|
|
1938
|
+
* `PowerPortalsPro.Localization.LocalizationKeyMode.QueryParameterName`. Keep the two in sync.
|
|
1939
|
+
*/
|
|
1940
|
+
declare const LOCALIZATION_KEY_MODE_QUERY_PARAM = "ppp-show-keys";
|
|
1941
|
+
/**
|
|
1942
|
+
* Whether key-display mode is on for the current URL — the `ppp-show-keys` query parameter is
|
|
1943
|
+
* present and its value isn't `0`/`false` (bare presence counts as on). Always `false` outside a
|
|
1944
|
+
* browser (SSR). Query-only and un-persisted: it reflects whatever's in the address bar right now.
|
|
1945
|
+
*/
|
|
1946
|
+
declare function isKeyModeEnabled(): boolean;
|
|
1936
1947
|
/**
|
|
1937
1948
|
* Builds a {@link Localizer} backed by a flat string map. Missing keys
|
|
1938
1949
|
* return the key itself (visible fallback for missing strings — easier to
|
|
@@ -2696,4 +2707,4 @@ declare function ValidationProvider({ children }: {
|
|
|
2696
2707
|
|
|
2697
2708
|
declare const VERSION = "0.1.0";
|
|
2698
2709
|
|
|
2699
|
-
export { ASP_NET_CULTURE_COOKIE, type AuthState, AuthStatus, AuthorizedView, type AuthorizedViewProps, type ColumnValidator, type ConfirmationDialogOptions, type CreateLocalizerOptions, DEFAULT_URL_LOCALE_PATTERN, DefaultLocalizerProvider, type DefaultLocalizerProviderProps, type DialogOptions, type DialogResult, type DialogService, DialogServiceProvider, InMemoryOrganizationSettingsCache, InMemoryTableMetadataCache, InMemoryViewMetadataCache, InMemoryViewsForTableCache, LocaleProvider, type LocaleProviderProps, type LocaleState, type LocalizationPrefetcher, type Localizer, LocalizerProvider, LookupRecordContext, type LookupRecordContextProps, MainContext, type MainContextDescendant, type MainContextProps, MainContextProvider, type MainContextValue, MaskMode, type MaskOptions, type NumericOptions, type OrganizationSettingsCache, type OverlayInstance, type OverlayOptions, type OverlayService, OverlayServiceProvider, PowerPortalsProContext, type PowerPortalsProContextValue, PowerPortalsProProvider, type PowerPortalsProProviderProps, type QueryResult, QueryStatus, RecordContext, type RecordContextProps, type RecordContextValue, type ReformatResult, type TableMetadataCache, type UnsavedChangesGuardController, type UnsavedChangesRegistry, UnsavedChangesRegistryProvider, type UnsavedChangesRegistryProviderProps, type UnsavedChangesReporter, type UrlCultureStrategyName, type UseAuthResult, type UseFetchRecordsOptions, type UseGridDataOptions, type UseMaskedTextFieldOptions, type UseMaskedTextFieldReturn, type UseOrganizationSettingsOptions, type UseRecordOptions, type UseSupportedLocalesOptions, type UseTableMetadataOptions, type UseTablePermissionsOptions, type UseViewDataSourceOptions, type UseViewMetadataOptions, type UseViewsForTableOptions, VERSION, type ValidationContextValue, ValidationProvider, type ViewDataSource, type ViewDataSourceHighlight, type ViewMetadataCache, type ViewsForTableCache, buildLocalePath, createLocalizer, detectLocale, flattenStrings, getAspNetCultureCookie, getLocaleFromUrlPath, interpolate, reformat, resolveLocalizationUrl, runWithOverlayAsync, setAspNetCultureCookie, shouldPrefixLocale, stripLocalePrefix, useAuth, useColumnMetadata, useColumnValidationErrors, useDefaultLocale, useDialogService, useFetchRecords, useGridData, useIsAnyDirty, useLocale, useLocalization, useLocalizationLoaded, useLocalizationPrefetcher, useLocalizer, useMainContext, useMaskedTextField, useOrganizationSettings, useOverlayForTarget, useOverlayService, useOverlayServiceState, usePowerPortalsPro, usePrefixedT, useQueryParam, useRecord, useRecordContext, useRecordContextOptional, useRunWithOverlay, useSupportedLocales, useT, useTableMetadata, useTablePermissions, useUnsavedChangesGuard, useUnsavedChangesRegistry, useUnsavedChangesWarning, useUrlCultureStrategy, useValidationContext, useViewDataSource, useViewMetadata, useViewsForTable, useWarnAboutUnsavedChanges, warnAboutUnsavedChangesAsync };
|
|
2710
|
+
export { ASP_NET_CULTURE_COOKIE, type AuthState, AuthStatus, AuthorizedView, type AuthorizedViewProps, type ColumnValidator, type ConfirmationDialogOptions, type CreateLocalizerOptions, DEFAULT_URL_LOCALE_PATTERN, DefaultLocalizerProvider, type DefaultLocalizerProviderProps, type DialogOptions, type DialogResult, type DialogService, DialogServiceProvider, InMemoryOrganizationSettingsCache, InMemoryTableMetadataCache, InMemoryViewMetadataCache, InMemoryViewsForTableCache, LOCALIZATION_KEY_MODE_QUERY_PARAM, LocaleProvider, type LocaleProviderProps, type LocaleState, type LocalizationPrefetcher, type Localizer, LocalizerProvider, LookupRecordContext, type LookupRecordContextProps, MainContext, type MainContextDescendant, type MainContextProps, MainContextProvider, type MainContextValue, MaskMode, type MaskOptions, type NumericOptions, type OrganizationSettingsCache, type OverlayInstance, type OverlayOptions, type OverlayService, OverlayServiceProvider, PowerPortalsProContext, type PowerPortalsProContextValue, PowerPortalsProProvider, type PowerPortalsProProviderProps, type QueryResult, QueryStatus, RecordContext, type RecordContextProps, type RecordContextValue, type ReformatResult, type TableMetadataCache, type UnsavedChangesGuardController, type UnsavedChangesRegistry, UnsavedChangesRegistryProvider, type UnsavedChangesRegistryProviderProps, type UnsavedChangesReporter, type UrlCultureStrategyName, type UseAuthResult, type UseFetchRecordsOptions, type UseGridDataOptions, type UseMaskedTextFieldOptions, type UseMaskedTextFieldReturn, type UseOrganizationSettingsOptions, type UseRecordOptions, type UseSupportedLocalesOptions, type UseTableMetadataOptions, type UseTablePermissionsOptions, type UseViewDataSourceOptions, type UseViewMetadataOptions, type UseViewsForTableOptions, VERSION, type ValidationContextValue, ValidationProvider, type ViewDataSource, type ViewDataSourceHighlight, type ViewMetadataCache, type ViewsForTableCache, buildLocalePath, createLocalizer, detectLocale, flattenStrings, getAspNetCultureCookie, getLocaleFromUrlPath, interpolate, isKeyModeEnabled, reformat, resolveLocalizationUrl, runWithOverlayAsync, setAspNetCultureCookie, shouldPrefixLocale, stripLocalePrefix, useAuth, useColumnMetadata, useColumnValidationErrors, useDefaultLocale, useDialogService, useFetchRecords, useGridData, useIsAnyDirty, useLocale, useLocalization, useLocalizationLoaded, useLocalizationPrefetcher, useLocalizer, useMainContext, useMaskedTextField, useOrganizationSettings, useOverlayForTarget, useOverlayService, useOverlayServiceState, usePowerPortalsPro, usePrefixedT, useQueryParam, useRecord, useRecordContext, useRecordContextOptional, useRunWithOverlay, useSupportedLocales, useT, useTableMetadata, useTablePermissions, useUnsavedChangesGuard, useUnsavedChangesRegistry, useUnsavedChangesWarning, useUrlCultureStrategy, useValidationContext, useViewDataSource, useViewMetadata, useViewsForTable, useWarnAboutUnsavedChanges, warnAboutUnsavedChangesAsync };
|
package/dist/index.d.ts
CHANGED
|
@@ -1933,6 +1933,17 @@ interface CreateLocalizerOptions {
|
|
|
1933
1933
|
*/
|
|
1934
1934
|
onMissingKey?: (key: string) => void;
|
|
1935
1935
|
}
|
|
1936
|
+
/**
|
|
1937
|
+
* Query-string flag that switches the localizer into "show keys" mode — mirrors the C#
|
|
1938
|
+
* `PowerPortalsPro.Localization.LocalizationKeyMode.QueryParameterName`. Keep the two in sync.
|
|
1939
|
+
*/
|
|
1940
|
+
declare const LOCALIZATION_KEY_MODE_QUERY_PARAM = "ppp-show-keys";
|
|
1941
|
+
/**
|
|
1942
|
+
* Whether key-display mode is on for the current URL — the `ppp-show-keys` query parameter is
|
|
1943
|
+
* present and its value isn't `0`/`false` (bare presence counts as on). Always `false` outside a
|
|
1944
|
+
* browser (SSR). Query-only and un-persisted: it reflects whatever's in the address bar right now.
|
|
1945
|
+
*/
|
|
1946
|
+
declare function isKeyModeEnabled(): boolean;
|
|
1936
1947
|
/**
|
|
1937
1948
|
* Builds a {@link Localizer} backed by a flat string map. Missing keys
|
|
1938
1949
|
* return the key itself (visible fallback for missing strings — easier to
|
|
@@ -2696,4 +2707,4 @@ declare function ValidationProvider({ children }: {
|
|
|
2696
2707
|
|
|
2697
2708
|
declare const VERSION = "0.1.0";
|
|
2698
2709
|
|
|
2699
|
-
export { ASP_NET_CULTURE_COOKIE, type AuthState, AuthStatus, AuthorizedView, type AuthorizedViewProps, type ColumnValidator, type ConfirmationDialogOptions, type CreateLocalizerOptions, DEFAULT_URL_LOCALE_PATTERN, DefaultLocalizerProvider, type DefaultLocalizerProviderProps, type DialogOptions, type DialogResult, type DialogService, DialogServiceProvider, InMemoryOrganizationSettingsCache, InMemoryTableMetadataCache, InMemoryViewMetadataCache, InMemoryViewsForTableCache, LocaleProvider, type LocaleProviderProps, type LocaleState, type LocalizationPrefetcher, type Localizer, LocalizerProvider, LookupRecordContext, type LookupRecordContextProps, MainContext, type MainContextDescendant, type MainContextProps, MainContextProvider, type MainContextValue, MaskMode, type MaskOptions, type NumericOptions, type OrganizationSettingsCache, type OverlayInstance, type OverlayOptions, type OverlayService, OverlayServiceProvider, PowerPortalsProContext, type PowerPortalsProContextValue, PowerPortalsProProvider, type PowerPortalsProProviderProps, type QueryResult, QueryStatus, RecordContext, type RecordContextProps, type RecordContextValue, type ReformatResult, type TableMetadataCache, type UnsavedChangesGuardController, type UnsavedChangesRegistry, UnsavedChangesRegistryProvider, type UnsavedChangesRegistryProviderProps, type UnsavedChangesReporter, type UrlCultureStrategyName, type UseAuthResult, type UseFetchRecordsOptions, type UseGridDataOptions, type UseMaskedTextFieldOptions, type UseMaskedTextFieldReturn, type UseOrganizationSettingsOptions, type UseRecordOptions, type UseSupportedLocalesOptions, type UseTableMetadataOptions, type UseTablePermissionsOptions, type UseViewDataSourceOptions, type UseViewMetadataOptions, type UseViewsForTableOptions, VERSION, type ValidationContextValue, ValidationProvider, type ViewDataSource, type ViewDataSourceHighlight, type ViewMetadataCache, type ViewsForTableCache, buildLocalePath, createLocalizer, detectLocale, flattenStrings, getAspNetCultureCookie, getLocaleFromUrlPath, interpolate, reformat, resolveLocalizationUrl, runWithOverlayAsync, setAspNetCultureCookie, shouldPrefixLocale, stripLocalePrefix, useAuth, useColumnMetadata, useColumnValidationErrors, useDefaultLocale, useDialogService, useFetchRecords, useGridData, useIsAnyDirty, useLocale, useLocalization, useLocalizationLoaded, useLocalizationPrefetcher, useLocalizer, useMainContext, useMaskedTextField, useOrganizationSettings, useOverlayForTarget, useOverlayService, useOverlayServiceState, usePowerPortalsPro, usePrefixedT, useQueryParam, useRecord, useRecordContext, useRecordContextOptional, useRunWithOverlay, useSupportedLocales, useT, useTableMetadata, useTablePermissions, useUnsavedChangesGuard, useUnsavedChangesRegistry, useUnsavedChangesWarning, useUrlCultureStrategy, useValidationContext, useViewDataSource, useViewMetadata, useViewsForTable, useWarnAboutUnsavedChanges, warnAboutUnsavedChangesAsync };
|
|
2710
|
+
export { ASP_NET_CULTURE_COOKIE, type AuthState, AuthStatus, AuthorizedView, type AuthorizedViewProps, type ColumnValidator, type ConfirmationDialogOptions, type CreateLocalizerOptions, DEFAULT_URL_LOCALE_PATTERN, DefaultLocalizerProvider, type DefaultLocalizerProviderProps, type DialogOptions, type DialogResult, type DialogService, DialogServiceProvider, InMemoryOrganizationSettingsCache, InMemoryTableMetadataCache, InMemoryViewMetadataCache, InMemoryViewsForTableCache, LOCALIZATION_KEY_MODE_QUERY_PARAM, LocaleProvider, type LocaleProviderProps, type LocaleState, type LocalizationPrefetcher, type Localizer, LocalizerProvider, LookupRecordContext, type LookupRecordContextProps, MainContext, type MainContextDescendant, type MainContextProps, MainContextProvider, type MainContextValue, MaskMode, type MaskOptions, type NumericOptions, type OrganizationSettingsCache, type OverlayInstance, type OverlayOptions, type OverlayService, OverlayServiceProvider, PowerPortalsProContext, type PowerPortalsProContextValue, PowerPortalsProProvider, type PowerPortalsProProviderProps, type QueryResult, QueryStatus, RecordContext, type RecordContextProps, type RecordContextValue, type ReformatResult, type TableMetadataCache, type UnsavedChangesGuardController, type UnsavedChangesRegistry, UnsavedChangesRegistryProvider, type UnsavedChangesRegistryProviderProps, type UnsavedChangesReporter, type UrlCultureStrategyName, type UseAuthResult, type UseFetchRecordsOptions, type UseGridDataOptions, type UseMaskedTextFieldOptions, type UseMaskedTextFieldReturn, type UseOrganizationSettingsOptions, type UseRecordOptions, type UseSupportedLocalesOptions, type UseTableMetadataOptions, type UseTablePermissionsOptions, type UseViewDataSourceOptions, type UseViewMetadataOptions, type UseViewsForTableOptions, VERSION, type ValidationContextValue, ValidationProvider, type ViewDataSource, type ViewDataSourceHighlight, type ViewMetadataCache, type ViewsForTableCache, buildLocalePath, createLocalizer, detectLocale, flattenStrings, getAspNetCultureCookie, getLocaleFromUrlPath, interpolate, isKeyModeEnabled, reformat, resolveLocalizationUrl, runWithOverlayAsync, setAspNetCultureCookie, shouldPrefixLocale, stripLocalePrefix, useAuth, useColumnMetadata, useColumnValidationErrors, useDefaultLocale, useDialogService, useFetchRecords, useGridData, useIsAnyDirty, useLocale, useLocalization, useLocalizationLoaded, useLocalizationPrefetcher, useLocalizer, useMainContext, useMaskedTextField, useOrganizationSettings, useOverlayForTarget, useOverlayService, useOverlayServiceState, usePowerPortalsPro, usePrefixedT, useQueryParam, useRecord, useRecordContext, useRecordContextOptional, useRunWithOverlay, useSupportedLocales, useT, useTableMetadata, useTablePermissions, useUnsavedChangesGuard, useUnsavedChangesRegistry, useUnsavedChangesWarning, useUrlCultureStrategy, useValidationContext, useViewDataSource, useViewMetadata, useViewsForTable, useWarnAboutUnsavedChanges, warnAboutUnsavedChangesAsync };
|
package/dist/index.js
CHANGED
|
@@ -469,10 +469,24 @@ function interpolate(template, args) {
|
|
|
469
469
|
return String(args[idx]);
|
|
470
470
|
});
|
|
471
471
|
}
|
|
472
|
+
var LOCALIZATION_KEY_MODE_QUERY_PARAM = "ppp-show-keys";
|
|
473
|
+
var keyModeSearch;
|
|
474
|
+
var keyModeResult = false;
|
|
475
|
+
function isKeyModeEnabled() {
|
|
476
|
+
if (typeof window === "undefined") return false;
|
|
477
|
+
const search = window.location.search;
|
|
478
|
+
if (search !== keyModeSearch) {
|
|
479
|
+
keyModeSearch = search;
|
|
480
|
+
const value = new URLSearchParams(search).get(LOCALIZATION_KEY_MODE_QUERY_PARAM);
|
|
481
|
+
keyModeResult = value !== null && value !== "0" && value.toLowerCase() !== "false";
|
|
482
|
+
}
|
|
483
|
+
return keyModeResult;
|
|
484
|
+
}
|
|
472
485
|
function createLocalizer(strings, options) {
|
|
473
486
|
const warnedKeys = /* @__PURE__ */ new Set();
|
|
474
487
|
return {
|
|
475
488
|
t(key, args) {
|
|
489
|
+
if (isKeyModeEnabled()) return key;
|
|
476
490
|
const template = strings[key];
|
|
477
491
|
if (template === void 0) {
|
|
478
492
|
if (options?.onMissingKey && !warnedKeys.has(key)) {
|
|
@@ -2595,6 +2609,6 @@ function useUnsavedChangesGuard() {
|
|
|
2595
2609
|
// src/index.ts
|
|
2596
2610
|
var VERSION = "0.1.0";
|
|
2597
2611
|
|
|
2598
|
-
export { ASP_NET_CULTURE_COOKIE, AuthStatus, AuthorizedView, DEFAULT_URL_LOCALE_PATTERN, DefaultLocalizerProvider, DialogServiceProvider, InMemoryOrganizationSettingsCache, InMemoryTableMetadataCache, InMemoryViewMetadataCache, InMemoryViewsForTableCache, LocaleProvider, LocalizerProvider, LookupRecordContext, MainContext, MainContextProvider, MaskMode, OverlayServiceProvider, PowerPortalsProContext, PowerPortalsProProvider, QueryStatus, RecordContext, UnsavedChangesRegistryProvider, VERSION, ValidationProvider, buildLocalePath, createLocalizer, detectLocale, flattenStrings, getAspNetCultureCookie, getLocaleFromUrlPath, interpolate, reformat, resolveLocalizationUrl, runWithOverlayAsync, setAspNetCultureCookie, shouldPrefixLocale, stripLocalePrefix, useAuth, useColumnMetadata, useColumnValidationErrors, useDefaultLocale, useDialogService, useFetchRecords, useGridData, useIsAnyDirty, useLocale, useLocalization, useLocalizationLoaded, useLocalizationPrefetcher, useLocalizer, useMainContext, useMaskedTextField, useOrganizationSettings, useOverlayForTarget, useOverlayService, useOverlayServiceState, usePowerPortalsPro, usePrefixedT, useQueryParam, useRecord, useRecordContext, useRecordContextOptional, useRunWithOverlay, useSupportedLocales, useT, useTableMetadata, useTablePermissions, useUnsavedChangesGuard, useUnsavedChangesRegistry, useUnsavedChangesWarning, useUrlCultureStrategy, useValidationContext, useViewDataSource, useViewMetadata, useViewsForTable, useWarnAboutUnsavedChanges, warnAboutUnsavedChangesAsync };
|
|
2612
|
+
export { ASP_NET_CULTURE_COOKIE, AuthStatus, AuthorizedView, DEFAULT_URL_LOCALE_PATTERN, DefaultLocalizerProvider, DialogServiceProvider, InMemoryOrganizationSettingsCache, InMemoryTableMetadataCache, InMemoryViewMetadataCache, InMemoryViewsForTableCache, LOCALIZATION_KEY_MODE_QUERY_PARAM, LocaleProvider, LocalizerProvider, LookupRecordContext, MainContext, MainContextProvider, MaskMode, OverlayServiceProvider, PowerPortalsProContext, PowerPortalsProProvider, QueryStatus, RecordContext, UnsavedChangesRegistryProvider, VERSION, ValidationProvider, buildLocalePath, createLocalizer, detectLocale, flattenStrings, getAspNetCultureCookie, getLocaleFromUrlPath, interpolate, isKeyModeEnabled, reformat, resolveLocalizationUrl, runWithOverlayAsync, setAspNetCultureCookie, shouldPrefixLocale, stripLocalePrefix, useAuth, useColumnMetadata, useColumnValidationErrors, useDefaultLocale, useDialogService, useFetchRecords, useGridData, useIsAnyDirty, useLocale, useLocalization, useLocalizationLoaded, useLocalizationPrefetcher, useLocalizer, useMainContext, useMaskedTextField, useOrganizationSettings, useOverlayForTarget, useOverlayService, useOverlayServiceState, usePowerPortalsPro, usePrefixedT, useQueryParam, useRecord, useRecordContext, useRecordContextOptional, useRunWithOverlay, useSupportedLocales, useT, useTableMetadata, useTablePermissions, useUnsavedChangesGuard, useUnsavedChangesRegistry, useUnsavedChangesWarning, useUrlCultureStrategy, useValidationContext, useViewDataSource, useViewMetadata, useViewsForTable, useWarnAboutUnsavedChanges, warnAboutUnsavedChangesAsync };
|
|
2599
2613
|
//# sourceMappingURL=index.js.map
|
|
2600
2614
|
//# sourceMappingURL=index.js.map
|