@powerportalspro/react 5.1.0 → 6.1.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/index.d.cts CHANGED
@@ -800,6 +800,16 @@ interface ViewDataSource {
800
800
  readonly status: QueryStatus;
801
801
  readonly rows: readonly TableRecord[];
802
802
  readonly totalCount: number | string | null | undefined;
803
+ /**
804
+ * Dataverse's `MoreRecords` flag from the most recent response — the
805
+ * authoritative "is there another page?" signal for sequential paging.
806
+ * Prefer it over comparing rows against {@link totalCount}: the count is
807
+ * computed before the server's per-row permission handlers drop rows,
808
+ * so the rows a consumer accumulates can legitimately fall short of it.
809
+ * `undefined` until the first response lands; `null` when the server
810
+ * didn't report one.
811
+ */
812
+ readonly moreRecords: boolean | null | undefined;
803
813
  readonly columns: readonly ResolvedColumn[];
804
814
  /**
805
815
  * Current user's combined table-level `TableSecurityPermission` mask for
@@ -1933,6 +1943,17 @@ interface CreateLocalizerOptions {
1933
1943
  */
1934
1944
  onMissingKey?: (key: string) => void;
1935
1945
  }
1946
+ /**
1947
+ * Query-string flag that switches the localizer into "show keys" mode — mirrors the C#
1948
+ * `PowerPortalsPro.Localization.LocalizationKeyMode.QueryParameterName`. Keep the two in sync.
1949
+ */
1950
+ declare const LOCALIZATION_KEY_MODE_QUERY_PARAM = "ppp-show-keys";
1951
+ /**
1952
+ * Whether key-display mode is on for the current URL — the `ppp-show-keys` query parameter is
1953
+ * present and its value isn't `0`/`false` (bare presence counts as on). Always `false` outside a
1954
+ * browser (SSR). Query-only and un-persisted: it reflects whatever's in the address bar right now.
1955
+ */
1956
+ declare function isKeyModeEnabled(): boolean;
1936
1957
  /**
1937
1958
  * Builds a {@link Localizer} backed by a flat string map. Missing keys
1938
1959
  * return the key itself (visible fallback for missing strings — easier to
@@ -2696,4 +2717,4 @@ declare function ValidationProvider({ children }: {
2696
2717
 
2697
2718
  declare const VERSION = "0.1.0";
2698
2719
 
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 };
2720
+ 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
@@ -800,6 +800,16 @@ interface ViewDataSource {
800
800
  readonly status: QueryStatus;
801
801
  readonly rows: readonly TableRecord[];
802
802
  readonly totalCount: number | string | null | undefined;
803
+ /**
804
+ * Dataverse's `MoreRecords` flag from the most recent response — the
805
+ * authoritative "is there another page?" signal for sequential paging.
806
+ * Prefer it over comparing rows against {@link totalCount}: the count is
807
+ * computed before the server's per-row permission handlers drop rows,
808
+ * so the rows a consumer accumulates can legitimately fall short of it.
809
+ * `undefined` until the first response lands; `null` when the server
810
+ * didn't report one.
811
+ */
812
+ readonly moreRecords: boolean | null | undefined;
803
813
  readonly columns: readonly ResolvedColumn[];
804
814
  /**
805
815
  * Current user's combined table-level `TableSecurityPermission` mask for
@@ -1933,6 +1943,17 @@ interface CreateLocalizerOptions {
1933
1943
  */
1934
1944
  onMissingKey?: (key: string) => void;
1935
1945
  }
1946
+ /**
1947
+ * Query-string flag that switches the localizer into "show keys" mode — mirrors the C#
1948
+ * `PowerPortalsPro.Localization.LocalizationKeyMode.QueryParameterName`. Keep the two in sync.
1949
+ */
1950
+ declare const LOCALIZATION_KEY_MODE_QUERY_PARAM = "ppp-show-keys";
1951
+ /**
1952
+ * Whether key-display mode is on for the current URL — the `ppp-show-keys` query parameter is
1953
+ * present and its value isn't `0`/`false` (bare presence counts as on). Always `false` outside a
1954
+ * browser (SSR). Query-only and un-persisted: it reflects whatever's in the address bar right now.
1955
+ */
1956
+ declare function isKeyModeEnabled(): boolean;
1936
1957
  /**
1937
1958
  * Builds a {@link Localizer} backed by a flat string map. Missing keys
1938
1959
  * return the key itself (visible fallback for missing strings — easier to
@@ -2696,4 +2717,4 @@ declare function ValidationProvider({ children }: {
2696
2717
 
2697
2718
  declare const VERSION = "0.1.0";
2698
2719
 
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 };
2720
+ 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)) {
@@ -1387,6 +1401,7 @@ function useViewDataSource(options) {
1387
1401
  const rows = data?.tableRecords ?? EMPTY_RECORDS;
1388
1402
  const columns = data?.columns ?? EMPTY_COLUMNS;
1389
1403
  const totalCount = data?.pagingInfo?.totalRecordCount;
1404
+ const moreRecords = data?.pagingInfo?.moreRecords;
1390
1405
  const tablePermissions = data?.tablePermissions;
1391
1406
  const aggregations = options.aggregations ?? EMPTY_AGGREGATION_SPEC;
1392
1407
  const isFetchingAggregations = query.isFetching && debouncedRequest.aggregations !== void 0 && debouncedRequest.aggregations !== null && debouncedRequest.aggregations.length > 0;
@@ -1412,6 +1427,7 @@ function useViewDataSource(options) {
1412
1427
  status: query.status,
1413
1428
  rows,
1414
1429
  totalCount,
1430
+ moreRecords,
1415
1431
  columns,
1416
1432
  tablePermissions,
1417
1433
  aggregationResults,
@@ -1437,6 +1453,7 @@ function useViewDataSource(options) {
1437
1453
  query.status,
1438
1454
  rows,
1439
1455
  totalCount,
1456
+ moreRecords,
1440
1457
  columns,
1441
1458
  tablePermissions,
1442
1459
  aggregationResults,
@@ -2595,6 +2612,6 @@ function useUnsavedChangesGuard() {
2595
2612
  // src/index.ts
2596
2613
  var VERSION = "0.1.0";
2597
2614
 
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 };
2615
+ 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
2616
  //# sourceMappingURL=index.js.map
2600
2617
  //# sourceMappingURL=index.js.map