@talxis/base-controls 1.2506.3 → 1.2506.4
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/DatasetControl/DatasetControl.js +9 -1
- package/dist/components/DatasetControl/DatasetControl.js.map +1 -1
- package/dist/components/DatasetControl/Paging/DatasetPaging.d.ts +3 -0
- package/dist/components/{Grid/paging/components/Paging/Paging.js → DatasetControl/Paging/DatasetPaging.js} +21 -23
- package/dist/components/DatasetControl/Paging/DatasetPaging.js.map +1 -0
- package/dist/components/{Grid/paging/model → DatasetControl/Paging}/Paging.d.ts +11 -2
- package/dist/components/DatasetControl/Paging/Paging.js +80 -0
- package/dist/components/DatasetControl/Paging/Paging.js.map +1 -0
- package/dist/components/DatasetControl/Paging/index.d.ts +3 -0
- package/dist/components/DatasetControl/Paging/index.js +3 -0
- package/dist/components/DatasetControl/Paging/index.js.map +1 -0
- package/dist/components/DatasetControl/Paging/interfaces.d.ts +16 -0
- package/dist/components/{Grid/paging/components → DatasetControl}/Paging/styles.d.ts +1 -1
- package/dist/components/{Grid/paging/components → DatasetControl}/Paging/styles.js +1 -1
- package/dist/components/DatasetControl/Paging/styles.js.map +1 -0
- package/dist/components/DatasetControl/Paging/translations.d.ts +38 -0
- package/dist/components/DatasetControl/Paging/translations.js +14 -0
- package/dist/components/DatasetControl/Paging/translations.js.map +1 -0
- package/dist/components/DatasetControl/index.d.ts +1 -0
- package/dist/components/DatasetControl/index.js +2 -0
- package/dist/components/DatasetControl/index.js.map +1 -1
- package/dist/components/DatasetControl/interfaces.d.ts +2 -0
- package/dist/components/DatasetControl/styles.d.ts +1 -1
- package/dist/components/DatasetControl/styles.js +1 -1
- package/dist/components/DatasetControl/styles.js.map +1 -1
- package/dist/components/Grid/core/components/AgGrid/AgGrid.js +1 -2
- package/dist/components/Grid/core/components/AgGrid/AgGrid.js.map +1 -1
- package/dist/components/Grid/core/components/Save/components/ChangeEditor/components/ChangeGrid/ChangeGrid.js +2 -1
- package/dist/components/Grid/core/components/Save/components/ChangeEditor/components/ChangeGrid/ChangeGrid.js.map +1 -1
- package/dist/components/Grid/core/components/Save/components/ChangeEditor/components/ChangeGrid/styles.d.ts +0 -3
- package/dist/components/Grid/core/components/Save/components/ChangeEditor/components/ChangeGrid/styles.js +0 -3
- package/dist/components/Grid/core/components/Save/components/ChangeEditor/components/ChangeGrid/styles.js.map +1 -1
- package/dist/components/Grid/core/model/Grid.d.ts +5 -3
- package/dist/components/Grid/core/model/Grid.js +1 -4
- package/dist/components/Grid/core/model/Grid.js.map +1 -1
- package/dist/components/Grid/translations.d.ts +0 -36
- package/dist/components/Grid/translations.js +1 -10
- package/dist/components/Grid/translations.js.map +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/index.d.ts +80 -37
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/Grid/paging/components/Paging/Paging.d.ts +0 -2
- package/dist/components/Grid/paging/components/Paging/Paging.js.map +0 -1
- package/dist/components/Grid/paging/components/Paging/styles.js.map +0 -1
- package/dist/components/Grid/paging/controllers/usePagingController.d.ts +0 -18
- package/dist/components/Grid/paging/controllers/usePagingController.js +0 -24
- package/dist/components/Grid/paging/controllers/usePagingController.js.map +0 -1
- package/dist/components/Grid/paging/model/Paging.js +0 -74
- package/dist/components/Grid/paging/model/Paging.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -600,38 +600,6 @@ declare const gridTranslations: {
|
|
|
600
600
|
1029: string;
|
|
601
601
|
1033: string;
|
|
602
602
|
};
|
|
603
|
-
"paging-of": {
|
|
604
|
-
1029: string;
|
|
605
|
-
1033: string;
|
|
606
|
-
};
|
|
607
|
-
"paging-firstpage": {
|
|
608
|
-
1029: string;
|
|
609
|
-
1033: string;
|
|
610
|
-
};
|
|
611
|
-
"paging-previouspage": {
|
|
612
|
-
1029: string;
|
|
613
|
-
1033: string;
|
|
614
|
-
};
|
|
615
|
-
"paging-page": {
|
|
616
|
-
1029: string;
|
|
617
|
-
1033: string;
|
|
618
|
-
};
|
|
619
|
-
"paging-nextpage": {
|
|
620
|
-
1029: string;
|
|
621
|
-
1033: string;
|
|
622
|
-
};
|
|
623
|
-
"paging-lastpage": {
|
|
624
|
-
1029: string;
|
|
625
|
-
1033: string;
|
|
626
|
-
};
|
|
627
|
-
"paging-pages": {
|
|
628
|
-
1029: string;
|
|
629
|
-
1033: string;
|
|
630
|
-
};
|
|
631
|
-
"paging-pages-totalcount": {
|
|
632
|
-
1029: string;
|
|
633
|
-
1033: string;
|
|
634
|
-
};
|
|
635
603
|
norecordsfound: {
|
|
636
604
|
1029: string;
|
|
637
605
|
1033: string;
|
|
@@ -724,10 +692,6 @@ declare const gridTranslations: {
|
|
|
724
692
|
1029: string;
|
|
725
693
|
1033: string;
|
|
726
694
|
};
|
|
727
|
-
"page-record-count": {
|
|
728
|
-
1029: string;
|
|
729
|
-
1033: string;
|
|
730
|
-
};
|
|
731
695
|
};
|
|
732
696
|
|
|
733
697
|
interface IGridComponentProps {
|
|
@@ -780,6 +744,84 @@ declare const datasetControlTranslations: {
|
|
|
780
744
|
};
|
|
781
745
|
};
|
|
782
746
|
|
|
747
|
+
declare const datasetPagingTranslations: {
|
|
748
|
+
"paging-of": {
|
|
749
|
+
1029: string;
|
|
750
|
+
1033: string;
|
|
751
|
+
};
|
|
752
|
+
"paging-firstpage": {
|
|
753
|
+
1029: string;
|
|
754
|
+
1033: string;
|
|
755
|
+
};
|
|
756
|
+
"paging-previouspage": {
|
|
757
|
+
1029: string;
|
|
758
|
+
1033: string;
|
|
759
|
+
};
|
|
760
|
+
"paging-page": {
|
|
761
|
+
1029: string;
|
|
762
|
+
1033: string;
|
|
763
|
+
};
|
|
764
|
+
"paging-nextpage": {
|
|
765
|
+
1029: string;
|
|
766
|
+
1033: string;
|
|
767
|
+
};
|
|
768
|
+
"paging-lastpage": {
|
|
769
|
+
1029: string;
|
|
770
|
+
1033: string;
|
|
771
|
+
};
|
|
772
|
+
"paging-pages": {
|
|
773
|
+
1029: string;
|
|
774
|
+
1033: string;
|
|
775
|
+
};
|
|
776
|
+
"paging-pages-totalcount": {
|
|
777
|
+
1029: string;
|
|
778
|
+
1033: string;
|
|
779
|
+
};
|
|
780
|
+
"page-record-count": {
|
|
781
|
+
1029: string;
|
|
782
|
+
1033: string;
|
|
783
|
+
};
|
|
784
|
+
};
|
|
785
|
+
|
|
786
|
+
interface IDatasetPaging extends IControl<IDatasetPagingParameters, any, Partial<ITranslations<typeof datasetPagingTranslations>>, any> {
|
|
787
|
+
}
|
|
788
|
+
interface IDatasetPagingParameters extends IParameters$1 {
|
|
789
|
+
Dataset: IDataset;
|
|
790
|
+
/**
|
|
791
|
+
* If set to false, the user will not be able to navigate through pages. The component will still display the total number of records and the current page.
|
|
792
|
+
*/
|
|
793
|
+
EnablePagination?: Omit<ITwoOptionsProperty, 'attributes'>;
|
|
794
|
+
/**
|
|
795
|
+
* If set to false, the user will not be able to change the page size.
|
|
796
|
+
*/
|
|
797
|
+
EnablePageSizeSwitcher?: Omit<ITwoOptionsProperty, 'attributes'>;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
declare const DatasetPaging: (props: IDatasetPaging) => JSX.Element;
|
|
801
|
+
|
|
802
|
+
type ILabels = Required<ITranslation<typeof datasetPagingTranslations>>;
|
|
803
|
+
declare class Paging {
|
|
804
|
+
private _getParameters;
|
|
805
|
+
private _getLabels;
|
|
806
|
+
constructor(getParameters: () => IDatasetPagingParameters, getLabels: () => ILabels);
|
|
807
|
+
get pageNumber(): number;
|
|
808
|
+
get pageSize(): number;
|
|
809
|
+
get totalResultCount(): number;
|
|
810
|
+
get hasPreviousPage(): boolean;
|
|
811
|
+
get hasNextPage(): boolean;
|
|
812
|
+
get pageFirstRecordOrder(): number;
|
|
813
|
+
get formattedTotalResultCount(): string;
|
|
814
|
+
get pageLastRecordOrder(): string;
|
|
815
|
+
get isEnabled(): boolean;
|
|
816
|
+
loadNextPage(): void;
|
|
817
|
+
loadPreviousPage(): void;
|
|
818
|
+
loadExactPage(pageNumber: number): void;
|
|
819
|
+
setPageSize(pageSize: number): void;
|
|
820
|
+
reset(): void;
|
|
821
|
+
toString(): string;
|
|
822
|
+
private _getDataset;
|
|
823
|
+
}
|
|
824
|
+
|
|
783
825
|
interface IQuickFindProps {
|
|
784
826
|
textFieldProps: ITextFieldProps;
|
|
785
827
|
container: ThemeProviderProps;
|
|
@@ -795,6 +837,7 @@ interface IDatasetControlComponentProps {
|
|
|
795
837
|
onRender: (renderQuickFind: () => React$1.ReactElement) => React$1.ReactElement;
|
|
796
838
|
onGetQuickFindProps: (props: IQuickFindProps) => IQuickFindProps;
|
|
797
839
|
};
|
|
840
|
+
onRenderPagination: (props: IDatasetPaging, renderPagination: (props: IDatasetPaging) => React$1.ReactElement<IDatasetPaging>) => React$1.ReactElement;
|
|
798
841
|
}
|
|
799
842
|
interface IDatasetControl extends IControl<IGridParameters, IGridOutputs, Partial<ITranslation<typeof datasetControlTranslations & typeof gridTranslations>>, IDatasetControlComponentProps> {
|
|
800
843
|
/**
|
|
@@ -1398,4 +1441,4 @@ interface IDurationOutputs extends IOutputs$1 {
|
|
|
1398
1441
|
|
|
1399
1442
|
declare const Duration: (props: IDuration) => JSX.Element;
|
|
1400
1443
|
|
|
1401
|
-
export { BaseControl, BaseControls, ControlTheme, DatasetAdapter, DatasetControl, DateTime, Decimal, Duration, Grid, GridCellRenderer, IContext, IControl, IControlController, IDatasetControl, IDatasetControlComponentProps, IDateTime, IDateTimeOutputs, IDateTimeParameters, IDateTimeProperty, IDecimal, IDecimalNumberProperty, IDecimalOutputs, IDecimalParameters, IDefaultTranslations, IDuration, IDurationOutputs, IDurationParameters, IEntity, IFileProperty, IFluentDesignState, IGrid, IGridCellRenderer, IGridCellRendererComponentProps, IGridCellRendererParameters, IGridComponentProps, IGridOutputs, IGridParameters, ILayout, ILookup, ILookupOutputs, ILookupParameters, ILookupProperty, IMetadata, IMultiSelectOptionSet, IMultiSelectOptionSetOutputs, IMultiSelectOptionSetParameters, IMultiSelectOptionSetProperty, IOptionProps, IOptionSet, IOptionSetOutputs, IOptionSetParameters, IOptionSetProperty, IOptionSetProps, IOutputs, IParameters$1 as IParameters, IProperty, IQuickFindProps, IRecordCommandsProps, IStringProperty, ITextField, ITextFieldOutputs, ITextFieldParameters, ITranslation, ITranslations, ITwoOptions, ITwoOptionsOutputs, ITwoOptionsParameters, ITwoOptionsProperty, IWholeNumberProperty, Lookup, MultiSelectOptionSet, NestedControlRenderer, OptionSet, TextField, ThemeWrapper, TwoOptions, VirtualDatasetAdapter, useControl, useControlLabels, useControlSizing, useControlTheme, useControlThemeGenerator, useDateTime, useFocusIn, useInputBasedControl, useLookup, useMouseOver };
|
|
1444
|
+
export { BaseControl, BaseControls, ControlTheme, DatasetAdapter, DatasetControl, DatasetPaging, DateTime, Decimal, Duration, Grid, GridCellRenderer, IContext, IControl, IControlController, IDatasetControl, IDatasetControlComponentProps, IDatasetPaging, IDatasetPagingParameters, IDateTime, IDateTimeOutputs, IDateTimeParameters, IDateTimeProperty, IDecimal, IDecimalNumberProperty, IDecimalOutputs, IDecimalParameters, IDefaultTranslations, IDuration, IDurationOutputs, IDurationParameters, IEntity, IFileProperty, IFluentDesignState, IGrid, IGridCellRenderer, IGridCellRendererComponentProps, IGridCellRendererParameters, IGridComponentProps, IGridOutputs, IGridParameters, ILayout, ILookup, ILookupOutputs, ILookupParameters, ILookupProperty, IMetadata, IMultiSelectOptionSet, IMultiSelectOptionSetOutputs, IMultiSelectOptionSetParameters, IMultiSelectOptionSetProperty, IOptionProps, IOptionSet, IOptionSetOutputs, IOptionSetParameters, IOptionSetProperty, IOptionSetProps, IOutputs, IParameters$1 as IParameters, IProperty, IQuickFindProps, IRecordCommandsProps, IStringProperty, ITextField, ITextFieldOutputs, ITextFieldParameters, ITranslation, ITranslations, ITwoOptions, ITwoOptionsOutputs, ITwoOptionsParameters, ITwoOptionsProperty, IWholeNumberProperty, Lookup, MultiSelectOptionSet, NestedControlRenderer, OptionSet, Paging, TextField, ThemeWrapper, TwoOptions, VirtualDatasetAdapter, useControl, useControlLabels, useControlSizing, useControlTheme, useControlThemeGenerator, useDateTime, useFocusIn, useInputBasedControl, useLookup, useMouseOver };
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,8 @@ export { BaseControls } from './utils/BaseControls.js';
|
|
|
12
12
|
export { DatasetAdapter } from './utils/dataset/adapters/DatasetAdapter.js';
|
|
13
13
|
export { VirtualDatasetAdapter } from './utils/dataset/adapters/VirtualDatasetAdapter.js';
|
|
14
14
|
export { DatasetControl } from './components/DatasetControl/DatasetControl.js';
|
|
15
|
+
export { DatasetPaging } from './components/DatasetControl/Paging/DatasetPaging.js';
|
|
16
|
+
export { Paging } from './components/DatasetControl/Paging/Paging.js';
|
|
15
17
|
export { DateTime } from './components/DateTime/DateTime.js';
|
|
16
18
|
export { useDateTime } from './components/DateTime/hooks/useDateTime.js';
|
|
17
19
|
export { Decimal } from './components/Decimal/Decimal.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Paging.js","sources":["../../../../../../src/components/Grid/paging/components/Paging/Paging.tsx"],"sourcesContent":["import { ComboBox, CommandBarButton, ContextualMenuItemType, IComboBoxOption, IContextualMenuItem, useTheme } from '@fluentui/react';\nimport { CommandBar } from '@fluentui/react';\nimport React from 'react';\nimport { useGridInstance } from '../../../core/hooks/useGridInstance';\nimport { usePagingController } from '../../controllers/usePagingController';\nimport { getPagingStyles } from './styles';\n\nexport const Paging = () => {\n const grid = useGridInstance();\n const labels = grid.labels;\n const paging = usePagingController();\n const styles = getPagingStyles(useTheme());\n\n const getPageSizeOptions = (): IContextualMenuItem[] => {\n const sizes = ['25', '50', '75', '100', '250'];\n return sizes.map(size => {\n return {\n key: size,\n text: size,\n checked: parseInt(size) === paging.pageSize,\n className: styles.pageSizeOption,\n onClick: () => paging.setPageSize(parseInt(size))\n }\n })\n }\n const getPagingLabel = () => {\n if (paging.totalResultCount === undefined) {\n return labels['paging-pages']({ start: paging.pageFirstRecordOrder, end: paging.pageLastRecordOrder })\n }\n return `${labels['paging-pages']({ start: paging.pageFirstRecordOrder, end: paging.pageLastRecordOrder })} ${labels['paging-pages-totalcount']({ recordcount: paging.formattedTotalResultCount })}`\n }\n return (\n <div className={styles.root}>\n <div className={styles.pageSizeBtnWrapper}>\n <CommandBarButton\n disabled={grid.dataset.loading || !grid.paging.isEnabled}\n text={getPagingLabel()}\n menuProps={grid.parameters.EnablePageSizeSwitcher?.raw !== false ? {\n items: [\n {\n key: 'header',\n itemType: ContextualMenuItemType.Header,\n text: labels['page-record-count'](),\n },\n {\n key: 'divider',\n itemType: ContextualMenuItemType.Divider,\n },\n ...getPageSizeOptions()\n ]\n } : undefined}\n />\n </div>\n {grid.paging.isEnabled &&\n <CommandBar\n className={styles.pagination}\n items={[]}\n farItems={[{\n key: 'FirstPage',\n iconOnly: true,\n iconProps: { iconName: 'DoubleChevronLeft' },\n disabled: !paging.hasPreviousPage || grid.dataset.loading,\n onClick: () => paging.reset()\n }, {\n key: 'PreviousPage',\n iconOnly: true,\n iconProps: { iconName: 'Back' },\n disabled: !paging.hasPreviousPage || grid.dataset.loading,\n onClick: () => paging.loadPreviousPage()\n }, {\n key: 'CurrentPage',\n text: `${labels['paging-page']()} ${paging.pageNumber.toString()}`,\n className: styles.currentPageBtn,\n disabled: true,\n }, {\n key: 'NextPage',\n iconOnly: true,\n iconProps: { iconName: 'Forward' },\n disabled: !paging.hasNextPage || grid.dataset.loading,\n onClick: () => paging.loadNextPage()\n }]}\n />\n }\n </div>\n )\n}"],"names":["_jsxs","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yBAChC,EAAE;AACC,4BAAA,GAAG,EAAE,cAAc;AACnB,4BAAA,QAAQ,EAAE,IAAI;AACd,4BAAA,SAAS,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE;4BAC/B,QAAQ,EAAE,CAAC,MAAM,CAAC,eAAe,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO;AACzD,4BAAA,OAAO,EAAE,MAAM,MAAM,CAAC,gBAAgB,EAAE;yBAC3C,EAAE;AACC,4BAAA,GAAG,EAAE,aAAa;AAClB,4BAAA,IAAI,EAAE,CAAA,EAAG,MAAM,CAAC,aAAa,CAAC,EAAE,CAAI,CAAA,EAAA,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAE,CAAA;4BAClE,SAAS,EAAE,MAAM,CAAC,cAAc;AAChC,4BAAA,QAAQ,EAAE,IAAI;yBACjB,EAAE;AACC,4BAAA,GAAG,EAAE,UAAU;AACf,4BAAA,QAAQ,EAAE,IAAI;AACd,4BAAA,SAAS,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE;4BAClC,QAAQ,EAAE,CAAC,MAAM,CAAC,WAAW,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO;AACrD,4BAAA,OAAO,EAAE,MAAM,MAAM,CAAC,YAAY,EAAE;yBACvC,CAAC,EAAA,CACJ,CAEJ,EAAA,CAAA,EACT;AACL;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../../../src/components/Grid/paging/components/Paging/styles.ts"],"sourcesContent":["import { mergeStyleSets, ITheme } from \"@fluentui/react\";\n\nexport const getPagingStyles = (theme: ITheme) => {\n return mergeStyleSets({\n root: {\n display: 'flex',\n flexWrap: 'wrap',\n justifyContent: 'center'\n },\n pagination: {\n '.ms-CommandBar': {\n paddingLeft: 0,\n paddingRight: 0,\n }\n },\n currentPageBtn: {\n '.ms-Button-label': {\n color: theme.semanticColors.bodyText\n }\n },\n pageSizeBtnWrapper: {\n flexGrow: 1,\n display: 'flex',\n '.ms-Button-label': {\n whiteSpace: 'nowrap',\n },\n '.ms-Button': {\n height: 44\n }\n },\n pageSizeOption: {\n '& .is-checked': {\n backgroundColor: theme.semanticColors.buttonBackgroundHovered,\n fontWeight: 600\n }\n }\n });\n};"],"names":[],"mappings":";;AAEa,MAAA,eAAe,GAAG,CAAC,KAAa,KAAI;AAC7C,IAAA,OAAO,cAAc,CAAC;AAClB,QAAA,IAAI,EAAE;AACF,YAAA,OAAO,EAAE,MAAM;AACf,YAAA,QAAQ,EAAE,MAAM;AAChB,YAAA,cAAc,EAAE,QAAQ;AAC3B,SAAA;AACD,QAAA,UAAU,EAAE;AACR,YAAA,gBAAgB,EAAE;AACd,gBAAA,WAAW,EAAE,CAAC;AACd,gBAAA,YAAY,EAAE,CAAC;AAClB,aAAA;AACJ,SAAA;AACD,QAAA,cAAc,EAAE;AACZ,YAAA,kBAAkB,EAAE;AAChB,gBAAA,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ;AACvC,aAAA;AACJ,SAAA;AACD,QAAA,kBAAkB,EAAE;AAChB,YAAA,QAAQ,EAAE,CAAC;AACX,YAAA,OAAO,EAAE,MAAM;AACf,YAAA,kBAAkB,EAAE;AAChB,gBAAA,UAAU,EAAE,QAAQ;AACvB,aAAA;AACD,YAAA,YAAY,EAAE;AACV,gBAAA,MAAM,EAAE,EAAE;AACb,aAAA;AACJ,SAAA;AACD,QAAA,cAAc,EAAE;AACZ,YAAA,eAAe,EAAE;AACb,gBAAA,eAAe,EAAE,KAAK,CAAC,cAAc,CAAC,uBAAuB;AAC7D,gBAAA,UAAU,EAAE,GAAG;AAClB,aAAA;AACJ,SAAA;AACJ,KAAA,CAAC,CAAC;AACP;;;;"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
interface IPagingController {
|
|
2
|
-
isEnabled: boolean;
|
|
3
|
-
pageNumber: number;
|
|
4
|
-
pageSize: number;
|
|
5
|
-
totalResultCount: number;
|
|
6
|
-
hasPreviousPage: boolean;
|
|
7
|
-
hasNextPage: boolean;
|
|
8
|
-
pageFirstRecordOrder: number;
|
|
9
|
-
pageLastRecordOrder: string;
|
|
10
|
-
formattedTotalResultCount: string;
|
|
11
|
-
loadNextPage: () => void;
|
|
12
|
-
loadPreviousPage: () => void;
|
|
13
|
-
loadExactPage: (pageNumber: number) => void;
|
|
14
|
-
setPageSize: (pageSize: number) => void;
|
|
15
|
-
reset: () => void;
|
|
16
|
-
}
|
|
17
|
-
export declare const usePagingController: () => IPagingController;
|
|
18
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { useGridInstance } from '../../core/hooks/useGridInstance.js';
|
|
2
|
-
|
|
3
|
-
const usePagingController = () => {
|
|
4
|
-
const paging = useGridInstance().paging;
|
|
5
|
-
return {
|
|
6
|
-
pageNumber: paging.pageNumber,
|
|
7
|
-
pageSize: paging.pageSize,
|
|
8
|
-
totalResultCount: paging.totalResultCount,
|
|
9
|
-
formattedTotalResultCount: paging.formattedTotalResultCount,
|
|
10
|
-
hasPreviousPage: paging.hasPreviousPage,
|
|
11
|
-
hasNextPage: paging.hasNextPage,
|
|
12
|
-
pageFirstRecordOrder: paging.pageFirstRecordOrder,
|
|
13
|
-
pageLastRecordOrder: paging.pageLastRecordOrder,
|
|
14
|
-
isEnabled: paging.isEnabled,
|
|
15
|
-
loadExactPage: (pageNumber) => paging.loadExactPage(pageNumber),
|
|
16
|
-
loadNextPage: () => paging.loadNextPage(),
|
|
17
|
-
loadPreviousPage: () => paging.loadPreviousPage(),
|
|
18
|
-
setPageSize: (pageSize) => paging.setPageSize(pageSize),
|
|
19
|
-
reset: () => paging.reset()
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export { usePagingController };
|
|
24
|
-
//# sourceMappingURL=usePagingController.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usePagingController.js","sources":["../../../../../src/components/Grid/paging/controllers/usePagingController.ts"],"sourcesContent":["import { useGridInstance } from \"../../core/hooks/useGridInstance\"\n\ninterface IPagingController {\n isEnabled: boolean,\n pageNumber: number,\n pageSize: number,\n totalResultCount: number,\n hasPreviousPage: boolean,\n hasNextPage: boolean,\n pageFirstRecordOrder: number,\n pageLastRecordOrder: string\n formattedTotalResultCount: string,\n loadNextPage: () => void,\n loadPreviousPage: () => void,\n loadExactPage: (pageNumber: number) => void,\n setPageSize: (pageSize: number) => void,\n reset: () => void\n}\n\nexport const usePagingController = (): IPagingController => {\n const paging = useGridInstance().paging;\n return {\n pageNumber: paging.pageNumber,\n pageSize: paging.pageSize,\n totalResultCount: paging.totalResultCount,\n formattedTotalResultCount: paging.formattedTotalResultCount,\n hasPreviousPage: paging.hasPreviousPage,\n hasNextPage: paging.hasNextPage,\n pageFirstRecordOrder: paging.pageFirstRecordOrder,\n pageLastRecordOrder: paging.pageLastRecordOrder,\n isEnabled: paging.isEnabled,\n loadExactPage: (pageNumber: number) => paging.loadExactPage(pageNumber),\n loadNextPage: () => paging.loadNextPage(),\n loadPreviousPage: () => paging.loadPreviousPage(),\n setPageSize: (pageSize) => paging.setPageSize(pageSize),\n reset: () => paging.reset()\n }\n}"],"names":[],"mappings":";;AAmBO,MAAM,mBAAmB,GAAG,MAAwB;AACvD,IAAA,MAAM,MAAM,GAAG,eAAe,EAAE,CAAC,MAAM,CAAC;IACxC,OAAO;QACH,UAAU,EAAE,MAAM,CAAC,UAAU;QACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;QACzC,yBAAyB,EAAE,MAAM,CAAC,yBAAyB;QAC3D,eAAe,EAAE,MAAM,CAAC,eAAe;QACvC,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,oBAAoB,EAAE,MAAM,CAAC,oBAAoB;QACjD,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;QAC/C,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,aAAa,EAAE,CAAC,UAAkB,KAAK,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC;AACvE,QAAA,YAAY,EAAE,MAAM,MAAM,CAAC,YAAY,EAAE;AACzC,QAAA,gBAAgB,EAAE,MAAM,MAAM,CAAC,gBAAgB,EAAE;QACjD,WAAW,EAAE,CAAC,QAAQ,KAAK,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC;AACvD,QAAA,KAAK,EAAE,MAAM,MAAM,CAAC,KAAK,EAAE;KAClC,CAAA;AACL;;;;"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { GridDependency } from '../../core/model/GridDependency.js';
|
|
2
|
-
|
|
3
|
-
class Paging extends GridDependency {
|
|
4
|
-
get pageNumber() {
|
|
5
|
-
return this._dataset.paging.pageNumber;
|
|
6
|
-
}
|
|
7
|
-
get pageSize() {
|
|
8
|
-
return this._dataset.paging.pageSize;
|
|
9
|
-
}
|
|
10
|
-
get totalResultCount() {
|
|
11
|
-
return this._dataset.paging.totalResultCount;
|
|
12
|
-
}
|
|
13
|
-
get hasPreviousPage() {
|
|
14
|
-
return this._dataset.paging.hasPreviousPage;
|
|
15
|
-
}
|
|
16
|
-
get hasNextPage() {
|
|
17
|
-
return this._dataset.paging.hasNextPage;
|
|
18
|
-
}
|
|
19
|
-
get pageFirstRecordOrder() {
|
|
20
|
-
if (this._dataset.sortedRecordIds.length === 0) {
|
|
21
|
-
return 0;
|
|
22
|
-
}
|
|
23
|
-
return (this.pageNumber - 1) * this.pageSize + (this.totalResultCount === 0 ? 0 : 1);
|
|
24
|
-
}
|
|
25
|
-
get formattedTotalResultCount() {
|
|
26
|
-
if (this.totalResultCount === undefined) {
|
|
27
|
-
return '';
|
|
28
|
-
}
|
|
29
|
-
if (this.totalResultCount === -1) {
|
|
30
|
-
return '5000+';
|
|
31
|
-
}
|
|
32
|
-
return this.totalResultCount.toString();
|
|
33
|
-
}
|
|
34
|
-
get pageLastRecordOrder() {
|
|
35
|
-
const count = this.pageNumber * this.pageSize;
|
|
36
|
-
if (this.totalResultCount === undefined) {
|
|
37
|
-
if (this.hasNextPage) {
|
|
38
|
-
return `${count}+`;
|
|
39
|
-
}
|
|
40
|
-
return `${count - this.pageSize + this._dataset.sortedRecordIds.length}`;
|
|
41
|
-
}
|
|
42
|
-
if (count > this.totalResultCount && this.totalResultCount !== -1) {
|
|
43
|
-
return this.totalResultCount.toString();
|
|
44
|
-
}
|
|
45
|
-
return count.toString();
|
|
46
|
-
}
|
|
47
|
-
get isEnabled() {
|
|
48
|
-
return this._grid.parameters.EnablePagination?.raw !== false;
|
|
49
|
-
}
|
|
50
|
-
loadNextPage() {
|
|
51
|
-
this.loadExactPage(this.pageNumber + 1);
|
|
52
|
-
}
|
|
53
|
-
loadPreviousPage() {
|
|
54
|
-
this.loadExactPage(this.pageNumber - 1);
|
|
55
|
-
}
|
|
56
|
-
loadExactPage(pageNumber) {
|
|
57
|
-
this._dataset.paging.loadExactPage(pageNumber);
|
|
58
|
-
}
|
|
59
|
-
setPageSize(pageSize) {
|
|
60
|
-
this._dataset.paging.setPageSize(pageSize);
|
|
61
|
-
this._dataset.refresh();
|
|
62
|
-
//in Power Apps the new page size can sometimes come only after second refresh #smh
|
|
63
|
-
//@ts-ignore - Portal types
|
|
64
|
-
if (!window.TALXIS?.Portal) {
|
|
65
|
-
this._dataset.refresh();
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
reset() {
|
|
69
|
-
this._dataset.paging.reset();
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export { Paging };
|
|
74
|
-
//# sourceMappingURL=Paging.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Paging.js","sources":["../../../../../src/components/Grid/paging/model/Paging.ts"],"sourcesContent":["import { GridDependency } from \"../../core/model/GridDependency\";\n\nexport class Paging extends GridDependency {\n\n public get pageNumber() {\n return this._dataset.paging.pageNumber;\n }\n public get pageSize() {\n return this._dataset.paging.pageSize;\n }\n public get totalResultCount() {\n return this._dataset.paging.totalResultCount;\n }\n public get hasPreviousPage() {\n return this._dataset.paging.hasPreviousPage;\n }\n public get hasNextPage() {\n return this._dataset.paging.hasNextPage;\n }\n public get pageFirstRecordOrder() {\n if(this._dataset.sortedRecordIds.length === 0) {\n return 0;\n }\n return (this.pageNumber - 1) * this.pageSize + (this.totalResultCount === 0 ? 0 : 1);\n }\n public get formattedTotalResultCount(): string {\n if(this.totalResultCount === undefined) {\n return '';\n }\n if(this.totalResultCount === -1) {\n return '5000+';\n }\n return this.totalResultCount.toString();\n }\n public get pageLastRecordOrder(): string {\n const count = this.pageNumber * this.pageSize;\n if(this.totalResultCount === undefined) {\n if(this.hasNextPage) {\n return `${count}+`;\n }\n return `${count - this.pageSize + this._dataset.sortedRecordIds.length}`\n\n }\n if(count > this.totalResultCount && this.totalResultCount !== -1) {\n return this.totalResultCount.toString();\n } \n return count.toString();\n }\n\n public get isEnabled() {\n return this._grid.parameters.EnablePagination?.raw !== false\n }\n\n public loadNextPage() {\n this.loadExactPage(this.pageNumber + 1)\n }\n public loadPreviousPage() {\n this.loadExactPage(this.pageNumber - 1);\n }\n public loadExactPage(pageNumber: number) {\n this._dataset.paging.loadExactPage(pageNumber);\n }\n public setPageSize(pageSize: number) {\n this._dataset.paging.setPageSize(pageSize);\n this._dataset.refresh();\n //in Power Apps the new page size can sometimes come only after second refresh #smh\n //@ts-ignore - Portal types\n if (!window.TALXIS?.Portal) {\n this._dataset.refresh()\n }\n }\n public reset() {\n this._dataset.paging.reset();\n }\n}"],"names":[],"mappings":";;AAEM,MAAO,MAAO,SAAQ,cAAc,CAAA;AAEtC,IAAA,IAAW,UAAU,GAAA;AACjB,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC;KAC1C;AACD,IAAA,IAAW,QAAQ,GAAA;AACf,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC;KACxC;AACD,IAAA,IAAW,gBAAgB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