persian-data-grid 0.5.0 → 0.6.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/OFL.txt +93 -0
- package/README.md +179 -22
- package/dist/ERPTableGroupRow-J5Z2LRC5.cjs +131 -0
- package/dist/ERPTableGroupRow-J5Z2LRC5.cjs.map +1 -0
- package/dist/ERPTableGroupRow-PSAPAHGL.js +125 -0
- package/dist/ERPTableGroupRow-PSAPAHGL.js.map +1 -0
- package/dist/GridPlugin-CJCaYnlw.d.ts +57 -0
- package/dist/GridPlugin-oxhq8AsM.d.cts +57 -0
- package/dist/GridPresenceService-GEH6535Q.js +3 -0
- package/dist/GridPresenceService-GEH6535Q.js.map +1 -0
- package/dist/GridPresenceService-RDN5FXHQ.cjs +12 -0
- package/dist/GridPresenceService-RDN5FXHQ.cjs.map +1 -0
- package/dist/GridSession-B-9lLcoB.d.cts +2492 -0
- package/dist/GridSession-Bc7UIawO.d.ts +2492 -0
- package/dist/GridSyncService-KTLB4KP3.js +3 -0
- package/dist/GridSyncService-KTLB4KP3.js.map +1 -0
- package/dist/GridSyncService-TAPAHABV.cjs +12 -0
- package/dist/GridSyncService-TAPAHABV.cjs.map +1 -0
- package/dist/PdfRenderer-1HFh6UeR.d.ts +22 -0
- package/dist/PdfRenderer-CBg7hWNS.d.cts +22 -0
- package/dist/RemoteApi-CCQxiSf1.d.cts +28 -0
- package/dist/RemoteApi-CCQxiSf1.d.ts +28 -0
- package/dist/SelectImpl-NM4O4IGW.js +447 -0
- package/dist/SelectImpl-NM4O4IGW.js.map +1 -0
- package/dist/SelectImpl-W2EI4T7O.cjs +453 -0
- package/dist/SelectImpl-W2EI4T7O.cjs.map +1 -0
- package/dist/UITableController-Cuwq481K.d.cts +632 -0
- package/dist/UITableController-DU8RopUM.d.ts +632 -0
- package/dist/VazirmatnPdfRenderer-BCMpC1zy.d.cts +96 -0
- package/dist/VazirmatnPdfRenderer-Dz_G-m3c.d.ts +96 -0
- package/dist/adapters/arian-erp.cjs +77 -0
- package/dist/adapters/arian-erp.cjs.map +1 -0
- package/dist/adapters/arian-erp.d.cts +60 -0
- package/dist/adapters/arian-erp.d.ts +60 -0
- package/dist/adapters/arian-erp.js +71 -0
- package/dist/adapters/arian-erp.js.map +1 -0
- package/dist/appendAtEnd-RHIQRG2W.cjs +35 -0
- package/dist/appendAtEnd-RHIQRG2W.cjs.map +1 -0
- package/dist/appendAtEnd-TJEABLGD.js +33 -0
- package/dist/appendAtEnd-TJEABLGD.js.map +1 -0
- package/dist/applyImportedRows-BO6yxoAN.d.cts +135 -0
- package/dist/applyImportedRows-D4zVY8uD.d.ts +135 -0
- package/dist/applyRowVisibilityHandler-KS6TMCBN.js +83 -0
- package/dist/applyRowVisibilityHandler-KS6TMCBN.js.map +1 -0
- package/dist/applyRowVisibilityHandler-LXCOGESZ.cjs +85 -0
- package/dist/applyRowVisibilityHandler-LXCOGESZ.cjs.map +1 -0
- package/dist/broadcastChannelTransport-FHUMV76O.cjs +12 -0
- package/dist/broadcastChannelTransport-FHUMV76O.cjs.map +1 -0
- package/dist/broadcastChannelTransport-MIH53VNZ.js +3 -0
- package/dist/broadcastChannelTransport-MIH53VNZ.js.map +1 -0
- package/dist/callbackRemoteApi-BlXO5NJz.d.ts +30 -0
- package/dist/callbackRemoteApi-DgnXH-i0.d.cts +30 -0
- package/dist/cellRenderContext-DB7V_mlu.d.ts +42 -0
- package/dist/cellRenderContext-DG5BOlxK.d.cts +42 -0
- package/dist/chunk-2BJCRYOS.cjs +936 -0
- package/dist/chunk-2BJCRYOS.cjs.map +1 -0
- package/dist/chunk-3Y3KKGEC.js +3 -0
- package/dist/chunk-3Y3KKGEC.js.map +1 -0
- package/dist/chunk-5ALMNLUR.cjs +1408 -0
- package/dist/chunk-5ALMNLUR.cjs.map +1 -0
- package/dist/chunk-5HKVMPBD.js +937 -0
- package/dist/chunk-5HKVMPBD.js.map +1 -0
- package/dist/chunk-633KP74Z.js +189 -0
- package/dist/chunk-633KP74Z.js.map +1 -0
- package/dist/chunk-6XBXZPBW.js +298 -0
- package/dist/chunk-6XBXZPBW.js.map +1 -0
- package/dist/chunk-77UXAJII.js +112 -0
- package/dist/chunk-77UXAJII.js.map +1 -0
- package/dist/chunk-ASPTRYRD.cjs +21 -0
- package/dist/chunk-ASPTRYRD.cjs.map +1 -0
- package/dist/chunk-AU3RDJYQ.js +243 -0
- package/dist/chunk-AU3RDJYQ.js.map +1 -0
- package/dist/chunk-BHDRUZH5.cjs +33 -0
- package/dist/chunk-BHDRUZH5.cjs.map +1 -0
- package/dist/chunk-BLYVOV3G.cjs +191 -0
- package/dist/chunk-BLYVOV3G.cjs.map +1 -0
- package/dist/chunk-CILNIWYW.cjs +100 -0
- package/dist/chunk-CILNIWYW.cjs.map +1 -0
- package/dist/chunk-DFFP7SJ6.cjs +257 -0
- package/dist/chunk-DFFP7SJ6.cjs.map +1 -0
- package/dist/chunk-DXRCYW42.cjs +568 -0
- package/dist/chunk-DXRCYW42.cjs.map +1 -0
- package/dist/chunk-EBV6HGZB.cjs +33 -0
- package/dist/chunk-EBV6HGZB.cjs.map +1 -0
- package/dist/chunk-EHHHC5JV.js +832 -0
- package/dist/chunk-EHHHC5JV.js.map +1 -0
- package/dist/chunk-F4PYOYHR.js +112 -0
- package/dist/chunk-F4PYOYHR.js.map +1 -0
- package/dist/chunk-GQEDLUMB.js +168 -0
- package/dist/chunk-GQEDLUMB.js.map +1 -0
- package/dist/chunk-H2LESGMX.cjs +319 -0
- package/dist/chunk-H2LESGMX.cjs.map +1 -0
- package/dist/chunk-HTNJT2QU.js +11674 -0
- package/dist/chunk-HTNJT2QU.js.map +1 -0
- package/dist/chunk-IIISFUW4.cjs +11786 -0
- package/dist/chunk-IIISFUW4.cjs.map +1 -0
- package/dist/chunk-IMPCRWYP.cjs +251 -0
- package/dist/chunk-IMPCRWYP.cjs.map +1 -0
- package/dist/chunk-IPPIXOVQ.js +317 -0
- package/dist/chunk-IPPIXOVQ.js.map +1 -0
- package/dist/chunk-J4XJ4UBC.js +1404 -0
- package/dist/chunk-J4XJ4UBC.js.map +1 -0
- package/dist/chunk-J7CPPFXT.cjs +89 -0
- package/dist/chunk-J7CPPFXT.cjs.map +1 -0
- package/dist/chunk-JOICD47Q.cjs +41 -0
- package/dist/chunk-JOICD47Q.cjs.map +1 -0
- package/dist/chunk-KHMG6EI2.js +13 -0
- package/dist/chunk-KHMG6EI2.js.map +1 -0
- package/dist/chunk-KMRURD5J.cjs +15 -0
- package/dist/chunk-KMRURD5J.cjs.map +1 -0
- package/dist/chunk-KRJG3KMP.cjs +174 -0
- package/dist/chunk-KRJG3KMP.cjs.map +1 -0
- package/dist/chunk-KUBVDIF7.cjs +653 -0
- package/dist/chunk-KUBVDIF7.cjs.map +1 -0
- package/dist/chunk-KYAOSBQN.js +31 -0
- package/dist/chunk-KYAOSBQN.js.map +1 -0
- package/dist/chunk-LJ7LMEXO.js +36 -0
- package/dist/chunk-LJ7LMEXO.js.map +1 -0
- package/dist/chunk-MT3KLB2Q.cjs +944 -0
- package/dist/chunk-MT3KLB2Q.cjs.map +1 -0
- package/dist/chunk-MU3RY46O.js +932 -0
- package/dist/chunk-MU3RY46O.js.map +1 -0
- package/dist/chunk-MUQQKPWR.js +84 -0
- package/dist/chunk-MUQQKPWR.js.map +1 -0
- package/dist/chunk-N7SJTINL.cjs +4 -0
- package/dist/chunk-N7SJTINL.cjs.map +1 -0
- package/dist/chunk-NTV2UUAJ.cjs +149 -0
- package/dist/chunk-NTV2UUAJ.cjs.map +1 -0
- package/dist/chunk-PJQWHF6T.js +31 -0
- package/dist/chunk-PJQWHF6T.js.map +1 -0
- package/dist/chunk-PQY54EL5.js +248 -0
- package/dist/chunk-PQY54EL5.js.map +1 -0
- package/dist/chunk-PXCHPZTP.cjs +839 -0
- package/dist/chunk-PXCHPZTP.cjs.map +1 -0
- package/dist/chunk-Q7TBBUTX.cjs +110 -0
- package/dist/chunk-Q7TBBUTX.cjs.map +1 -0
- package/dist/chunk-QQMU44KJ.js +612 -0
- package/dist/chunk-QQMU44KJ.js.map +1 -0
- package/dist/chunk-QZN7R2WP.cjs +114 -0
- package/dist/chunk-QZN7R2WP.cjs.map +1 -0
- package/dist/chunk-RKVSJU46.js +35 -0
- package/dist/chunk-RKVSJU46.js.map +1 -0
- package/dist/chunk-RM6ZWNT3.js +561 -0
- package/dist/chunk-RM6ZWNT3.js.map +1 -0
- package/dist/chunk-SX4VQXAA.cjs +114 -0
- package/dist/chunk-SX4VQXAA.cjs.map +1 -0
- package/dist/chunk-SZ7BLAY3.js +92 -0
- package/dist/chunk-SZ7BLAY3.js.map +1 -0
- package/dist/chunk-TN4MG6FY.js +112 -0
- package/dist/chunk-TN4MG6FY.js.map +1 -0
- package/dist/chunk-UC7PHDM6.cjs +331 -0
- package/dist/chunk-UC7PHDM6.cjs.map +1 -0
- package/dist/chunk-UXVLYUUW.js +108 -0
- package/dist/chunk-UXVLYUUW.js.map +1 -0
- package/dist/chunk-VVGYRZ7S.cjs +38 -0
- package/dist/chunk-VVGYRZ7S.cjs.map +1 -0
- package/dist/chunk-W5256BJ4.js +56 -0
- package/dist/chunk-W5256BJ4.js.map +1 -0
- package/dist/chunk-WUMOSOEK.cjs +62 -0
- package/dist/chunk-WUMOSOEK.cjs.map +1 -0
- package/dist/chunk-XLRE2J25.js +140 -0
- package/dist/chunk-XLRE2J25.js.map +1 -0
- package/dist/chunk-Y6W5V2CI.js +19 -0
- package/dist/chunk-Y6W5V2CI.js.map +1 -0
- package/dist/chunk-Z4QPZ3Z3.cjs +114 -0
- package/dist/chunk-Z4QPZ3Z3.cjs.map +1 -0
- package/dist/createEngineGridQuery-Dmq3i5v3.d.cts +884 -0
- package/dist/createEngineGridQuery-Mt1hc33m.d.ts +884 -0
- package/dist/date-picker-jalali.cjs +263 -0
- package/dist/date-picker-jalali.cjs.map +1 -0
- package/dist/date-picker-jalali.d.cts +62 -0
- package/dist/date-picker-jalali.d.ts +62 -0
- package/dist/date-picker-jalali.js +256 -0
- package/dist/date-picker-jalali.js.map +1 -0
- package/dist/finance.cjs +205 -0
- package/dist/finance.cjs.map +1 -0
- package/dist/finance.d.cts +90 -0
- package/dist/finance.d.ts +90 -0
- package/dist/finance.js +157 -0
- package/dist/finance.js.map +1 -0
- package/dist/foldedColumn-IHDT4ARZ.cjs +66 -0
- package/dist/foldedColumn-IHDT4ARZ.cjs.map +1 -0
- package/dist/foldedColumn-TFURUKFG.js +64 -0
- package/dist/foldedColumn-TFURUKFG.js.map +1 -0
- package/dist/headless.cjs +729 -0
- package/dist/headless.cjs.map +1 -0
- package/dist/headless.d.cts +504 -0
- package/dist/headless.d.ts +504 -0
- package/dist/headless.js +226 -0
- package/dist/headless.js.map +1 -0
- package/dist/index-DN8M8Jkq.d.cts +14 -0
- package/dist/index-DmzL-F_o.d.ts +14 -0
- package/dist/index.cjs +8002 -11409
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +437 -2305
- package/dist/index.d.ts +437 -2305
- package/dist/index.js +7244 -11083
- package/dist/index.js.map +1 -1
- package/dist/locales/ar.cjs +12 -0
- package/dist/locales/ar.cjs.map +1 -0
- package/dist/locales/ar.d.cts +6 -0
- package/dist/locales/ar.d.ts +6 -0
- package/dist/locales/ar.js +3 -0
- package/dist/locales/ar.js.map +1 -0
- package/dist/locales/en.cjs +12 -0
- package/dist/locales/en.cjs.map +1 -0
- package/dist/locales/en.d.cts +6 -0
- package/dist/locales/en.d.ts +6 -0
- package/dist/locales/en.js +3 -0
- package/dist/locales/en.js.map +1 -0
- package/dist/locales/fa.cjs +12 -0
- package/dist/locales/fa.cjs.map +1 -0
- package/dist/locales/fa.d.cts +6 -0
- package/dist/locales/fa.d.ts +6 -0
- package/dist/locales/fa.js +3 -0
- package/dist/locales/fa.js.map +1 -0
- package/dist/locales/index.cjs +51 -0
- package/dist/locales/index.cjs.map +1 -0
- package/dist/locales/index.d.cts +5 -0
- package/dist/locales/index.d.ts +5 -0
- package/dist/locales/index.js +6 -0
- package/dist/locales/index.js.map +1 -0
- package/dist/memoryRecords-AWDKUJ2F.cjs +50 -0
- package/dist/memoryRecords-AWDKUJ2F.cjs.map +1 -0
- package/dist/memoryRecords-OJTGXLRH.js +47 -0
- package/dist/memoryRecords-OJTGXLRH.js.map +1 -0
- package/dist/pagedFooterTotals-DXCGDO6F.cjs +27 -0
- package/dist/pagedFooterTotals-DXCGDO6F.cjs.map +1 -0
- package/dist/pagedFooterTotals-ORWKUNE7.js +25 -0
- package/dist/pagedFooterTotals-ORWKUNE7.js.map +1 -0
- package/dist/pagedKit-MFGAJFSK.cjs +134 -0
- package/dist/pagedKit-MFGAJFSK.cjs.map +1 -0
- package/dist/pagedKit-WYWY4LRV.js +127 -0
- package/dist/pagedKit-WYWY4LRV.js.map +1 -0
- package/dist/pagedSearch-HCPJW7VM.js +38 -0
- package/dist/pagedSearch-HCPJW7VM.js.map +1 -0
- package/dist/pagedSearch-U3WCG4GN.cjs +42 -0
- package/dist/pagedSearch-U3WCG4GN.cjs.map +1 -0
- package/dist/plugins/csv.cjs +124 -0
- package/dist/plugins/csv.cjs.map +1 -0
- package/dist/plugins/csv.d.cts +44 -0
- package/dist/plugins/csv.d.ts +44 -0
- package/dist/plugins/csv.js +120 -0
- package/dist/plugins/csv.js.map +1 -0
- package/dist/plugins/excel.cjs +52 -0
- package/dist/plugins/excel.cjs.map +1 -0
- package/dist/plugins/excel.d.cts +14 -0
- package/dist/plugins/excel.d.ts +14 -0
- package/dist/plugins/excel.js +7 -0
- package/dist/plugins/excel.js.map +1 -0
- package/dist/plugins/pdf/fonts/vazirmatn.cjs +50 -0
- package/dist/plugins/pdf/fonts/vazirmatn.cjs.map +1 -0
- package/dist/plugins/pdf/fonts/vazirmatn.d.cts +24 -0
- package/dist/plugins/pdf/fonts/vazirmatn.d.ts +24 -0
- package/dist/plugins/pdf/fonts/vazirmatn.js +39 -0
- package/dist/plugins/pdf/fonts/vazirmatn.js.map +1 -0
- package/dist/plugins/pdf.cjs +24 -0
- package/dist/plugins/pdf.cjs.map +1 -0
- package/dist/plugins/pdf.d.cts +21 -0
- package/dist/plugins/pdf.d.ts +21 -0
- package/dist/plugins/pdf.js +7 -0
- package/dist/plugins/pdf.js.map +1 -0
- package/dist/presence.cjs +56 -0
- package/dist/presence.cjs.map +1 -0
- package/dist/presence.d.cts +17 -0
- package/dist/presence.d.ts +17 -0
- package/dist/presence.js +54 -0
- package/dist/presence.js.map +1 -0
- package/dist/rebuildRowVisibility-66EAZ356.cjs +21 -0
- package/dist/rebuildRowVisibility-66EAZ356.cjs.map +1 -0
- package/dist/rebuildRowVisibility-6TYM5BP2.js +19 -0
- package/dist/rebuildRowVisibility-6TYM5BP2.js.map +1 -0
- package/dist/styles.css +1440 -0
- package/dist/sync.cjs +148 -0
- package/dist/sync.cjs.map +1 -0
- package/dist/sync.d.cts +17 -0
- package/dist/sync.d.ts +17 -0
- package/dist/sync.js +146 -0
- package/dist/sync.js.map +1 -0
- package/dist/types-D__47BKv.d.cts +23 -0
- package/dist/types-D__47BKv.d.ts +23 -0
- package/package.json +184 -28
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"GridSyncService-KTLB4KP3.js"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkBLYVOV3G_cjs = require('./chunk-BLYVOV3G.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "GridSyncService", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () { return chunkBLYVOV3G_cjs.GridSyncService; }
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=GridSyncService-TAPAHABV.cjs.map
|
|
12
|
+
//# sourceMappingURL=GridSyncService-TAPAHABV.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"GridSyncService-TAPAHABV.cjs"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { E as ExportSource } from './GridPlugin-CJCaYnlw.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Port so PDF libraries stay out of Core.
|
|
5
|
+
* Host or plugin package injects a concrete renderer.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Options bag for {@link PdfRenderer}.
|
|
10
|
+
* `template` is defined by `persian-data-grid/plugins/pdf` (`DocumentPdfTemplate`).
|
|
11
|
+
*/
|
|
12
|
+
type PdfRenderOptions = {
|
|
13
|
+
title?: string;
|
|
14
|
+
direction?: 'rtl' | 'ltr';
|
|
15
|
+
/** Opaque to Core — interpreted by VazirmatnPdfRenderer (PR-141). */
|
|
16
|
+
template?: unknown;
|
|
17
|
+
};
|
|
18
|
+
interface PdfRenderer {
|
|
19
|
+
render(source: ExportSource, options?: PdfRenderOptions): Promise<Blob>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type { PdfRenderer as P, PdfRenderOptions as a };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { E as ExportSource } from './GridPlugin-oxhq8AsM.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Port so PDF libraries stay out of Core.
|
|
5
|
+
* Host or plugin package injects a concrete renderer.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Options bag for {@link PdfRenderer}.
|
|
10
|
+
* `template` is defined by `persian-data-grid/plugins/pdf` (`DocumentPdfTemplate`).
|
|
11
|
+
*/
|
|
12
|
+
type PdfRenderOptions = {
|
|
13
|
+
title?: string;
|
|
14
|
+
direction?: 'rtl' | 'ltr';
|
|
15
|
+
/** Opaque to Core — interpreted by VazirmatnPdfRenderer (PR-141). */
|
|
16
|
+
template?: unknown;
|
|
17
|
+
};
|
|
18
|
+
interface PdfRenderer {
|
|
19
|
+
render(source: ExportSource, options?: PdfRenderOptions): Promise<Blob>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type { PdfRenderer as P, PdfRenderOptions as a };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
type AuditEvent = {
|
|
2
|
+
message: string;
|
|
3
|
+
payload?: unknown;
|
|
4
|
+
type: 'INFORMATION' | 'ERROR' | 'FORBIDDEN' | 'CELL_CHANGED' | 'CELL_DISPLAY_CHANGED' | 'ROW_ADDED' | 'NEW_ROW_ADDED' | 'ROW_DELETED' | 'ROW_RESTORED' | 'ROW_REORDERED' | 'COLUMN_REORDERED' | 'COLUMN_STATE_CHANGED' | 'UNIT_COLUMN_ADDED' | 'PAGE_CHANGED' | 'PAGE_SIZE_CHANGED' | 'TABLE_DELETED' | 'TABLE_RESET' | 'ROWS_LOADED' | 'DYNAMIC_DATA_REQUESTED' | 'VALIDATION_FAILED' | 'ROW_NOT_FOUND' | 'PAGE_NOT_CHANGED' | 'COLUMN_NOT_FOUND' | 'CELL_NOT_FOUND' | 'NOT_EDITABLE' | 'FORBIDDEN' | 'INVALID_VALUE' | 'DUPLICATE_ROW' | 'INVARIANT_VIOLATION' | 'ROW_NOT_EXPANDED' | 'ACTIVE_COLLECTION_CHANGED' | 'DRAG_OR_DROP_ROW_NOT_FOUND';
|
|
5
|
+
};
|
|
6
|
+
interface AuditLogger {
|
|
7
|
+
log(event: AuditEvent): void;
|
|
8
|
+
error(event: AuditEvent): void;
|
|
9
|
+
warn(event: AuditEvent): void;
|
|
10
|
+
info(event: AuditEvent): void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
declare class ConsoleAuditLogger implements AuditLogger {
|
|
14
|
+
log(event: unknown): void;
|
|
15
|
+
error(event: unknown): void;
|
|
16
|
+
warn(event: unknown): void;
|
|
17
|
+
info(event: unknown): void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface RemoteApi {
|
|
21
|
+
request<TResponse = unknown>(input: {
|
|
22
|
+
endpoint: string;
|
|
23
|
+
params?: Record<string, unknown>;
|
|
24
|
+
method?: 'GET' | 'POST';
|
|
25
|
+
}): Promise<TResponse>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { type AuditLogger as A, ConsoleAuditLogger as C, type RemoteApi as R };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
type AuditEvent = {
|
|
2
|
+
message: string;
|
|
3
|
+
payload?: unknown;
|
|
4
|
+
type: 'INFORMATION' | 'ERROR' | 'FORBIDDEN' | 'CELL_CHANGED' | 'CELL_DISPLAY_CHANGED' | 'ROW_ADDED' | 'NEW_ROW_ADDED' | 'ROW_DELETED' | 'ROW_RESTORED' | 'ROW_REORDERED' | 'COLUMN_REORDERED' | 'COLUMN_STATE_CHANGED' | 'UNIT_COLUMN_ADDED' | 'PAGE_CHANGED' | 'PAGE_SIZE_CHANGED' | 'TABLE_DELETED' | 'TABLE_RESET' | 'ROWS_LOADED' | 'DYNAMIC_DATA_REQUESTED' | 'VALIDATION_FAILED' | 'ROW_NOT_FOUND' | 'PAGE_NOT_CHANGED' | 'COLUMN_NOT_FOUND' | 'CELL_NOT_FOUND' | 'NOT_EDITABLE' | 'FORBIDDEN' | 'INVALID_VALUE' | 'DUPLICATE_ROW' | 'INVARIANT_VIOLATION' | 'ROW_NOT_EXPANDED' | 'ACTIVE_COLLECTION_CHANGED' | 'DRAG_OR_DROP_ROW_NOT_FOUND';
|
|
5
|
+
};
|
|
6
|
+
interface AuditLogger {
|
|
7
|
+
log(event: AuditEvent): void;
|
|
8
|
+
error(event: AuditEvent): void;
|
|
9
|
+
warn(event: AuditEvent): void;
|
|
10
|
+
info(event: AuditEvent): void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
declare class ConsoleAuditLogger implements AuditLogger {
|
|
14
|
+
log(event: unknown): void;
|
|
15
|
+
error(event: unknown): void;
|
|
16
|
+
warn(event: unknown): void;
|
|
17
|
+
info(event: unknown): void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface RemoteApi {
|
|
21
|
+
request<TResponse = unknown>(input: {
|
|
22
|
+
endpoint: string;
|
|
23
|
+
params?: Record<string, unknown>;
|
|
24
|
+
method?: 'GET' | 'POST';
|
|
25
|
+
}): Promise<TResponse>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { type AuditLogger as A, ConsoleAuditLogger as C, type RemoteApi as R };
|
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
import { useId, useState, useRef, useMemo, useCallback, useEffect, useLayoutEffect } from 'react';
|
|
2
|
+
import { createPortal } from 'react-dom';
|
|
3
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
// ui/primitives/selectCss.ts
|
|
6
|
+
var ANT_SELECT_CSS = '.anticon{display:inline-flex;align-items:center;color:inherit;font-style:normal;line-height:0;text-align:center;text-transform:none;vertical-align:-0.125em;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}\n.anticon >*{line-height:1}\n.anticon svg{display:inline-block}\n.anticon .anticon .anticon-icon{display:block}\n[class^="ant-select"],[class*=" ant-select"]{font-size:14px;box-sizing:border-box}\n[class^="ant-select"]::before,[class*=" ant-select"]::before,[class^="ant-select"]::after,[class*=" ant-select"]::after{box-sizing:border-box}\n[class^="ant-select"] [class^="ant-select"],[class*=" ant-select"] [class^="ant-select"],[class^="ant-select"] [class*=" ant-select"],[class*=" ant-select"] [class*=" ant-select"]{box-sizing:border-box}\n[class^="ant-select"] [class^="ant-select"]::before,[class*=" ant-select"] [class^="ant-select"]::before,[class^="ant-select"] [class*=" ant-select"]::before,[class*=" ant-select"] [class*=" ant-select"]::before,[class^="ant-select"] [class^="ant-select"]::after,[class*=" ant-select"] [class^="ant-select"]::after,[class^="ant-select"] [class*=" ant-select"]::after,[class*=" ant-select"] [class*=" ant-select"]::after{box-sizing:border-box}\n.ant-select.ant-select-in-form-item{width:100%}\n.ant-select{box-sizing:border-box;margin:0;padding:0;color:var(--pdg-ant-text);font-size:14px;line-height:1.5714285714285714;list-style:none;position:relative;display:inline-flex;cursor:pointer}\n.ant-select:not(.ant-select-customize-input) .ant-select-selector{position:relative;transition:all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1)}\n.ant-select:not(.ant-select-customize-input) .ant-select-selector input{cursor:pointer}\n.ant-select-show-search.ant-select:not(.ant-select-customize-input) .ant-select-selector{cursor:text}\n.ant-select-show-search.ant-select:not(.ant-select-customize-input) .ant-select-selector input{cursor:auto;color:inherit;height:100%}\n.ant-select-disabled.ant-select:not(.ant-select-customize-input) .ant-select-selector{cursor:not-allowed}\n.ant-select-disabled.ant-select:not(.ant-select-customize-input) .ant-select-selector input{cursor:not-allowed}\n.ant-select:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-search-input{margin:0;padding:0;background:transparent;border:none;outline:none;appearance:none;font-family:inherit}\n.ant-select:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-search-input::-webkit-search-cancel-button{display:none;appearance:none}\n.ant-select .ant-select-selection-item{flex:1;font-weight:normal;position:relative;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}\n.ant-select .ant-select-selection-item >.ant-typography{display:inline}\n.ant-select .ant-select-selection-placeholder{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;flex:1;color:rgba(0,0,0,0.25);pointer-events:none}\n.ant-select .ant-select-arrow{display:flex;align-items:center;color:rgba(0,0,0,0.25);font-style:normal;line-height:1;text-align:center;text-transform:none;vertical-align:-0.125em;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:absolute;top:50%;inset-inline-start:auto;inset-inline-end:11px;height:12px;margin-top:-6px;font-size:12px;pointer-events:none;transition:opacity 0.3s ease}\n.ant-select .ant-select-arrow >*{line-height:1}\n.ant-select .ant-select-arrow svg{display:inline-block}\n.ant-select .ant-select-arrow .anticon{vertical-align:top;transition:transform 0.3s}\n.ant-select .ant-select-arrow .anticon >svg{vertical-align:top}\n.ant-select .ant-select-arrow .anticon:not(.ant-select-suffix){pointer-events:auto}\n.ant-select-disabled .ant-select .ant-select-arrow{cursor:not-allowed}\n.ant-select .ant-select-arrow >*:not(:last-child){margin-inline-end:8px}\n.ant-select .ant-select-selection-wrap{display:flex;width:100%;position:relative;min-width:0}\n.ant-select .ant-select-selection-wrap:after{content:"\\a0";width:0;overflow:hidden}\n.ant-select .ant-select-prefix{flex:none;margin-inline-end:4px}\n.ant-select .ant-select-clear{position:absolute;top:50%;inset-inline-start:auto;inset-inline-end:11px;z-index:1;display:inline-block;width:12px;height:12px;margin-top:-6px;color:rgba(0,0,0,0.25);font-size:12px;font-style:normal;line-height:1;text-align:center;text-transform:none;cursor:pointer;opacity:0;transition:color 0.2s ease,opacity 0.3s ease;text-rendering:auto}\n.ant-select .ant-select-clear:before{display:block}\n.ant-select .ant-select-clear:hover{color:rgba(0,0,0,0.45)}\n@media(hover:none){.ant-select .ant-select-clear{opacity:1;background:var(--pdg-ant-bg);border-radius:50%}}\n.ant-select:hover .ant-select-clear{opacity:1;background:var(--pdg-ant-bg);border-radius:50%}\n.ant-select-status-error.ant-select-has-feedback .ant-select-clear,.ant-select-status-warning.ant-select-has-feedback .ant-select-clear,.ant-select-status-success.ant-select-has-feedback .ant-select-clear,.ant-select-status-validating.ant-select-has-feedback .ant-select-clear{inset-inline-end:33px}\n.ant-select-single{font-size:14px;height:32px}\n.ant-select-single .ant-select-selector{box-sizing:border-box;margin:0;padding:0;color:var(--pdg-ant-text);font-size:14px;line-height:1.5714285714285714;list-style:none;font-family:inherit;display:flex;border-radius:6px;flex:1 1 auto}\n.ant-select-single .ant-select-selector .ant-select-selection-wrap:after{line-height:30px}\n.ant-select-single .ant-select-selector .ant-select-selection-search{position:absolute;inset:0;width:100%}\n.ant-select-single .ant-select-selector .ant-select-selection-search-input{width:100%;-webkit-appearance:textfield}\n.ant-select-single .ant-select-selector .ant-select-selection-item,.ant-select-single .ant-select-selector .ant-select-selection-placeholder{display:block;padding:0;line-height:30px;transition:all 0.3s,visibility 0s;align-self:center}\n.ant-select-single .ant-select-selector .ant-select-selection-placeholder{transition:none;pointer-events:none}\n.ant-select-single .ant-select-selector:after,.ant-select-single .ant-select-selector .ant-select-selection-item:empty:after,.ant-select-single .ant-select-selector .ant-select-selection-placeholder:empty:after{display:inline-block;width:0;visibility:hidden;content:"\\a0"}\n.ant-select-single.ant-select-show-arrow .ant-select-selection-item,.ant-select-single.ant-select-show-arrow .ant-select-selection-search,.ant-select-single.ant-select-show-arrow .ant-select-selection-placeholder{padding-inline-end:18px}\n.ant-select-single.ant-select-open .ant-select-selection-item{color:rgba(0,0,0,0.25)}\n.ant-select-single:not(.ant-select-customize-input) .ant-select-selector{width:100%;height:100%;align-items:center;padding:0 11px}\n.ant-select-single:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-search-input{height:30px;font-size:14px}\n.ant-select-single:not(.ant-select-customize-input) .ant-select-selector:after{line-height:30px}\n.ant-select-single.ant-select-customize-input .ant-select-selector:after{display:none}\n.ant-select-single.ant-select-customize-input .ant-select-selector .ant-select-selection-search{position:static;width:100%}\n.ant-select-single.ant-select-customize-input .ant-select-selector .ant-select-selection-placeholder{position:absolute;inset-inline-start:0;inset-inline-end:0;padding:0 11px}\n.ant-select-single.ant-select-customize-input .ant-select-selector .ant-select-selection-placeholder:after{display:none}\n.ant-select-single.ant-select-sm{font-size:14px;height:24px}\n.ant-select-single.ant-select-sm .ant-select-selector{box-sizing:border-box;margin:0;padding:0;color:var(--pdg-ant-text);font-size:14px;line-height:1.5714285714285714;list-style:none;font-family:inherit;display:flex;border-radius:4px;flex:1 1 auto}\n.ant-select-single.ant-select-sm .ant-select-selector .ant-select-selection-wrap:after{line-height:22px}\n.ant-select-single.ant-select-sm .ant-select-selector .ant-select-selection-search{position:absolute;inset:0;width:100%}\n.ant-select-single.ant-select-sm .ant-select-selector .ant-select-selection-search-input{width:100%;-webkit-appearance:textfield}\n.ant-select-single.ant-select-sm .ant-select-selector .ant-select-selection-item,.ant-select-single.ant-select-sm .ant-select-selector .ant-select-selection-placeholder{display:block;padding:0;line-height:22px;transition:all 0.3s,visibility 0s;align-self:center}\n.ant-select-single.ant-select-sm .ant-select-selector .ant-select-selection-placeholder{transition:none;pointer-events:none}\n.ant-select-single.ant-select-sm .ant-select-selector:after,.ant-select-single.ant-select-sm .ant-select-selector .ant-select-selection-item:empty:after,.ant-select-single.ant-select-sm .ant-select-selector .ant-select-selection-placeholder:empty:after{display:inline-block;width:0;visibility:hidden;content:"\\a0"}\n.ant-select-single.ant-select-sm.ant-select-show-arrow .ant-select-selection-item,.ant-select-single.ant-select-sm.ant-select-show-arrow .ant-select-selection-search,.ant-select-single.ant-select-sm.ant-select-show-arrow .ant-select-selection-placeholder{padding-inline-end:18px}\n.ant-select-single.ant-select-sm.ant-select-open .ant-select-selection-item{color:rgba(0,0,0,0.25)}\n.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selector{width:100%;height:100%;align-items:center;padding:0 11px}\n.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-search-input{height:22px;font-size:14px}\n.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selector:after{line-height:22px}\n.ant-select-single.ant-select-sm.ant-select-customize-input .ant-select-selector:after{display:none}\n.ant-select-single.ant-select-sm.ant-select-customize-input .ant-select-selector .ant-select-selection-search{position:static;width:100%}\n.ant-select-single.ant-select-sm.ant-select-customize-input .ant-select-selector .ant-select-selection-placeholder{position:absolute;inset-inline-start:0;inset-inline-end:0;padding:0 11px}\n.ant-select-single.ant-select-sm.ant-select-customize-input .ant-select-selector .ant-select-selection-placeholder:after{display:none}\n.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selector{padding:0 7px}\n.ant-select-single.ant-select-sm:not(.ant-select-customize-input).ant-select-show-arrow .ant-select-selection-search{inset-inline-end:28px}\n.ant-select-single.ant-select-sm:not(.ant-select-customize-input).ant-select-show-arrow .ant-select-selection-item,.ant-select-single.ant-select-sm:not(.ant-select-customize-input).ant-select-show-arrow .ant-select-selection-placeholder{padding-inline-end:21px}\n.ant-select-single.ant-select-lg{font-size:16px;height:40px}\n.ant-select-single.ant-select-lg .ant-select-selector{box-sizing:border-box;margin:0;padding:0;color:var(--pdg-ant-text);font-size:16px;line-height:1.5714285714285714;list-style:none;font-family:inherit;display:flex;border-radius:8px;flex:1 1 auto}\n.ant-select-single.ant-select-lg .ant-select-selector .ant-select-selection-wrap:after{line-height:38px}\n.ant-select-single.ant-select-lg .ant-select-selector .ant-select-selection-search{position:absolute;inset:0;width:100%}\n.ant-select-single.ant-select-lg .ant-select-selector .ant-select-selection-search-input{width:100%;-webkit-appearance:textfield}\n.ant-select-single.ant-select-lg .ant-select-selector .ant-select-selection-item,.ant-select-single.ant-select-lg .ant-select-selector .ant-select-selection-placeholder{display:block;padding:0;line-height:38px;transition:all 0.3s,visibility 0s;align-self:center}\n.ant-select-single.ant-select-lg .ant-select-selector .ant-select-selection-placeholder{transition:none;pointer-events:none}\n.ant-select-single.ant-select-lg .ant-select-selector:after,.ant-select-single.ant-select-lg .ant-select-selector .ant-select-selection-item:empty:after,.ant-select-single.ant-select-lg .ant-select-selector .ant-select-selection-placeholder:empty:after{display:inline-block;width:0;visibility:hidden;content:"\\a0"}\n.ant-select-single.ant-select-lg.ant-select-show-arrow .ant-select-selection-item,.ant-select-single.ant-select-lg.ant-select-show-arrow .ant-select-selection-search,.ant-select-single.ant-select-lg.ant-select-show-arrow .ant-select-selection-placeholder{padding-inline-end:18px}\n.ant-select-single.ant-select-lg.ant-select-open .ant-select-selection-item{color:rgba(0,0,0,0.25)}\n.ant-select-single.ant-select-lg:not(.ant-select-customize-input) .ant-select-selector{width:100%;height:100%;align-items:center;padding:0 11px}\n.ant-select-single.ant-select-lg:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-search-input{height:38px;font-size:16px}\n.ant-select-single.ant-select-lg:not(.ant-select-customize-input) .ant-select-selector:after{line-height:38px}\n.ant-select-single.ant-select-lg.ant-select-customize-input .ant-select-selector:after{display:none}\n.ant-select-single.ant-select-lg.ant-select-customize-input .ant-select-selector .ant-select-selection-search{position:static;width:100%}\n.ant-select-single.ant-select-lg.ant-select-customize-input .ant-select-selector .ant-select-selection-placeholder{position:absolute;inset-inline-start:0;inset-inline-end:0;padding:0 11px}\n.ant-select-single.ant-select-lg.ant-select-customize-input .ant-select-selector .ant-select-selection-placeholder:after{display:none}\n.ant-select-dropdown{box-sizing:border-box;margin:0;padding:4px;color:var(--pdg-ant-text);font-size:14px;line-height:1.5714285714285714;list-style:none;position:absolute;top:-9999px;z-index:1050;overflow:hidden;font-variant:initial;background-color:var(--pdg-ant-bg);border-radius:8px;outline:none;box-shadow:0 6px 16px 0 rgba(0, 0, 0, 0.08),0 3px 6px -4px rgba(0, 0, 0, 0.12),0 9px 28px 8px rgba(0, 0, 0, 0.05)}\n.ant-select-dropdown.ant-slide-up-enter.ant-slide-up-enter-active.ant-select-dropdown-placement-bottomLeft,.ant-select-dropdown.ant-slide-up-appear.ant-slide-up-appear-active.ant-select-dropdown-placement-bottomLeft{animation-name:antSlideUpIn}\n.ant-select-dropdown.ant-slide-up-enter.ant-slide-up-enter-active.ant-select-dropdown-placement-topLeft,.ant-select-dropdown.ant-slide-up-appear.ant-slide-up-appear-active.ant-select-dropdown-placement-topLeft,.ant-select-dropdown.ant-slide-up-enter.ant-slide-up-enter-active.ant-select-dropdown-placement-topRight,.ant-select-dropdown.ant-slide-up-appear.ant-slide-up-appear-active.ant-select-dropdown-placement-topRight{animation-name:antSlideDownIn}\n.ant-select-dropdown.ant-slide-up-leave.ant-slide-up-leave-active.ant-select-dropdown-placement-bottomLeft{animation-name:antSlideUpOut}\n.ant-select-dropdown.ant-slide-up-leave.ant-slide-up-leave-active.ant-select-dropdown-placement-topLeft,.ant-select-dropdown.ant-slide-up-leave.ant-slide-up-leave-active.ant-select-dropdown-placement-topRight{animation-name:antSlideDownOut}\n.ant-select-dropdown-hidden{display:none}\n.ant-select-dropdown .ant-select-item{position:relative;display:block;min-height:32px;padding:5px 12px;color:var(--pdg-ant-text);font-weight:normal;font-size:14px;line-height:1.5714285714285714;box-sizing:border-box;cursor:pointer;transition:background 0.3s ease;border-radius:4px}\n.ant-select-dropdown .ant-select-item-group{color:rgba(0,0,0,0.45);font-size:12px;cursor:default}\n.ant-select-dropdown .ant-select-item-option{display:flex}\n.ant-select-dropdown .ant-select-item-option-content{flex:auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}\n.ant-select-dropdown .ant-select-item-option-state{flex:none;display:flex;align-items:center}\n.ant-select-dropdown .ant-select-item-option-active:not(.ant-select-item-option-disabled){background-color:rgba(0,0,0,0.04)}\n.ant-select-dropdown .ant-select-item-option-selected:not(.ant-select-item-option-disabled){color:var(--pdg-ant-text);font-weight:600;background-color:var(--pdg-ant-primary-bg)}\n.ant-select-dropdown .ant-select-item-option-selected:not(.ant-select-item-option-disabled) .ant-select-item-option-state{color:var(--pdg-ant-primary)}\n.ant-select-dropdown .ant-select-item-option-disabled{color:rgba(0,0,0,0.25);cursor:not-allowed}\n.ant-select-dropdown .ant-select-item-option-disabled.ant-select-item-option-selected{background-color:rgba(0,0,0,0.04)}\n.ant-select-dropdown .ant-select-item-option-grouped{padding-inline-start:24px}\n.ant-select-dropdown .ant-select-item-empty{position:relative;display:block;min-height:32px;padding:5px 12px;color:rgba(0,0,0,0.25);font-weight:normal;font-size:14px;line-height:1.5714285714285714;box-sizing:border-box}\n.ant-select-dropdown .ant-select-item-option-selected:has(+ .ant-select-item-option-selected){border-end-start-radius:0;border-end-end-radius:0}\n.ant-select-dropdown .ant-select-item-option-selected:has(+ .ant-select-item-option-selected)+.ant-select-item-option-selected{border-start-start-radius:0;border-start-end-radius:0}\n.ant-select-dropdown-rtl{direction:rtl}\n.ant-slide-up-enter,.ant-slide-up-appear{animation-duration:0.2s;animation-fill-mode:both;animation-play-state:paused}\n.ant-slide-up-leave{animation-duration:0.2s;animation-fill-mode:both;animation-play-state:paused}\n.ant-slide-up-enter.ant-slide-up-enter-active,.ant-slide-up-appear.ant-slide-up-appear-active{animation-name:antSlideUpIn;animation-play-state:running}\n.ant-slide-up-leave.ant-slide-up-leave-active{animation-name:antSlideUpOut;animation-play-state:running;pointer-events:none}\n.ant-slide-up-enter,.ant-slide-up-appear{transform:scale(0);transform-origin:0% 0%;opacity:0;animation-timing-function:cubic-bezier(0.23, 1, 0.32, 1)}\n.ant-slide-up-enter-prepare,.ant-slide-up-appear-prepare{transform:scale(1)}\n.ant-slide-up-leave{animation-timing-function:cubic-bezier(0.755, 0.05, 0.855, 0.06)}\n.ant-slide-down-enter,.ant-slide-down-appear{animation-duration:0.2s;animation-fill-mode:both;animation-play-state:paused}\n.ant-slide-down-leave{animation-duration:0.2s;animation-fill-mode:both;animation-play-state:paused}\n.ant-slide-down-enter.ant-slide-down-enter-active,.ant-slide-down-appear.ant-slide-down-appear-active{animation-name:antSlideDownIn;animation-play-state:running}\n.ant-slide-down-leave.ant-slide-down-leave-active{animation-name:antSlideDownOut;animation-play-state:running;pointer-events:none}\n.ant-slide-down-enter,.ant-slide-down-appear{transform:scale(0);transform-origin:0% 0%;opacity:0;animation-timing-function:cubic-bezier(0.23, 1, 0.32, 1)}\n.ant-slide-down-enter-prepare,.ant-slide-down-appear-prepare{transform:scale(1)}\n.ant-slide-down-leave{animation-timing-function:cubic-bezier(0.755, 0.05, 0.855, 0.06)}\n.ant-move-up-enter,.ant-move-up-appear{animation-duration:0.2s;animation-fill-mode:both;animation-play-state:paused}\n.ant-move-up-leave{animation-duration:0.2s;animation-fill-mode:both;animation-play-state:paused}\n.ant-move-up-enter.ant-move-up-enter-active,.ant-move-up-appear.ant-move-up-appear-active{animation-name:antMoveUpIn;animation-play-state:running}\n.ant-move-up-leave.ant-move-up-leave-active{animation-name:antMoveUpOut;animation-play-state:running;pointer-events:none}\n.ant-move-up-enter,.ant-move-up-appear{opacity:0;animation-timing-function:cubic-bezier(0.08, 0.82, 0.17, 1)}\n.ant-move-up-leave{animation-timing-function:cubic-bezier(0.78, 0.14, 0.15, 0.86)}\n.ant-move-down-enter,.ant-move-down-appear{animation-duration:0.2s;animation-fill-mode:both;animation-play-state:paused}\n.ant-move-down-leave{animation-duration:0.2s;animation-fill-mode:both;animation-play-state:paused}\n.ant-move-down-enter.ant-move-down-enter-active,.ant-move-down-appear.ant-move-down-appear-active{animation-name:antMoveDownIn;animation-play-state:running}\n.ant-move-down-leave.ant-move-down-leave-active{animation-name:antMoveDownOut;animation-play-state:running;pointer-events:none}\n.ant-move-down-enter,.ant-move-down-appear{opacity:0;animation-timing-function:cubic-bezier(0.08, 0.82, 0.17, 1)}\n.ant-move-down-leave{animation-timing-function:cubic-bezier(0.78, 0.14, 0.15, 0.86)}\n.ant-select-rtl{direction:rtl}\n.ant-select-outlined:not(.ant-select-customize-input) .ant-select-selector{border:1px solid var(--pdg-ant-border);background:var(--pdg-ant-bg)}\n.ant-select-outlined:not(.ant-select-disabled):not(.ant-select-customize-input):not(.ant-pagination-size-changer):hover .ant-select-selector{border-color:var(--pdg-ant-primary-hover)}\n.ant-select-focused.ant-select-outlined:not(.ant-select-disabled):not(.ant-select-customize-input):not(.ant-pagination-size-changer) .ant-select-selector{border-color:var(--pdg-ant-primary);box-shadow:0 0 0 2px rgba(5,145,255,0.1);outline:0}\n.ant-select-outlined:not(.ant-select-disabled):not(.ant-select-customize-input):not(.ant-pagination-size-changer) .ant-select-prefix{color:var(--pdg-ant-text)}\n.ant-select-outlined.ant-select-status-error:not(.ant-select-customize-input) .ant-select-selector{border:1px solid var(--pdg-ant-error);background:var(--pdg-ant-bg)}\n.ant-select-outlined.ant-select-status-error:not(.ant-select-disabled):not(.ant-select-customize-input):not(.ant-pagination-size-changer):hover .ant-select-selector{border-color:var(--pdg-ant-error-hover)}\n.ant-select-focused.ant-select-outlined.ant-select-status-error:not(.ant-select-disabled):not(.ant-select-customize-input):not(.ant-pagination-size-changer) .ant-select-selector{border-color:var(--pdg-ant-error);box-shadow:0 0 0 2px rgba(255,38,5,0.06);outline:0}\n.ant-select-outlined.ant-select-status-error:not(.ant-select-disabled):not(.ant-select-customize-input):not(.ant-pagination-size-changer) .ant-select-prefix{color:var(--pdg-ant-error)}\n.ant-select-outlined.ant-select-status-warning:not(.ant-select-customize-input) .ant-select-selector{border:1px solid var(--pdg-ant-warning);background:var(--pdg-ant-bg)}\n.ant-select-outlined.ant-select-status-warning:not(.ant-select-disabled):not(.ant-select-customize-input):not(.ant-pagination-size-changer):hover .ant-select-selector{border-color:var(--pdg-ant-warning-hover)}\n.ant-select-focused.ant-select-outlined.ant-select-status-warning:not(.ant-select-disabled):not(.ant-select-customize-input):not(.ant-pagination-size-changer) .ant-select-selector{border-color:var(--pdg-ant-warning);box-shadow:0 0 0 2px rgba(255,215,5,0.1);outline:0}\n.ant-select-outlined.ant-select-status-warning:not(.ant-select-disabled):not(.ant-select-customize-input):not(.ant-pagination-size-changer) .ant-select-prefix{color:var(--pdg-ant-warning)}\n.ant-select-outlined.ant-select-disabled:not(.ant-select-customize-input) .ant-select-selector{background:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25)}\n@keyframes antSlideUpIn{0%{transform:scaleY(0.8);transform-origin:0% 0%;opacity:0}\n100%{transform:scaleY(1);transform-origin:0% 0%;opacity:1}}\n@keyframes antSlideDownIn{0%{transform:scaleY(0.8);transform-origin:100% 100%;opacity:0}\n100%{transform:scaleY(1);transform-origin:100% 100%;opacity:1}}\n@keyframes antSlideUpOut{0%{transform:scaleY(1);transform-origin:0% 0%;opacity:1}\n100%{transform:scaleY(0.8);transform-origin:0% 0%;opacity:0}}\n@keyframes antSlideDownOut{0%{transform:scaleY(1);transform-origin:100% 100%;opacity:1}\n100%{transform:scaleY(0.8);transform-origin:100% 100%;opacity:0}}\n@keyframes antMoveUpIn{0%{transform:translate3d(0, -100%, 0);transform-origin:0 0;opacity:0}\n100%{transform:translate3d(0, 0, 0);transform-origin:0 0;opacity:1}}\n@keyframes antMoveUpOut{0%{transform:translate3d(0, 0, 0);transform-origin:0 0;opacity:1}\n100%{transform:translate3d(0, -100%, 0);transform-origin:0 0;opacity:0}}\n.anticon-spin{animation:pdgSpin 1s linear infinite}@keyframes pdgSpin{to{transform:rotate(360deg)}}';
|
|
7
|
+
var ANT_SELECT_TOKENS = {
|
|
8
|
+
"--pdg-ant-text": "#000",
|
|
9
|
+
"--pdg-ant-bg": "#fff",
|
|
10
|
+
"--pdg-ant-primary": "#1677ff",
|
|
11
|
+
"--pdg-ant-primary-hover": "#4096ff",
|
|
12
|
+
"--pdg-ant-primary-bg": "#e6f4ff",
|
|
13
|
+
"--pdg-ant-border": "#d9d9d9",
|
|
14
|
+
"--pdg-ant-warning": "#faad14",
|
|
15
|
+
"--pdg-ant-warning-hover": "#ffd666",
|
|
16
|
+
"--pdg-ant-error": "#ff4d4f",
|
|
17
|
+
"--pdg-ant-error-hover": "#ff7875"
|
|
18
|
+
};
|
|
19
|
+
function ensureStyles() {
|
|
20
|
+
if (typeof document === "undefined") return;
|
|
21
|
+
if (document.getElementById("pdg-antd-select-css")) return;
|
|
22
|
+
const el = document.createElement("style");
|
|
23
|
+
el.id = "pdg-antd-select-css";
|
|
24
|
+
el.textContent = ANT_SELECT_CSS;
|
|
25
|
+
document.head.prepend(el);
|
|
26
|
+
}
|
|
27
|
+
ensureStyles();
|
|
28
|
+
var OVERSCAN = 3;
|
|
29
|
+
var GAP = 4;
|
|
30
|
+
var svgProps = {
|
|
31
|
+
viewBox: "64 64 896 896",
|
|
32
|
+
focusable: false,
|
|
33
|
+
width: "1em",
|
|
34
|
+
height: "1em",
|
|
35
|
+
fill: "currentColor",
|
|
36
|
+
"aria-hidden": true
|
|
37
|
+
};
|
|
38
|
+
var DownIcon = () => /* @__PURE__ */ jsx("span", { role: "img", "aria-label": "down", className: "anticon anticon-down ant-select-suffix", children: /* @__PURE__ */ jsx("svg", { ...svgProps, children: /* @__PURE__ */ jsx("path", { d: "M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z" }) }) });
|
|
39
|
+
var SearchIcon = () => /* @__PURE__ */ jsx("span", { role: "img", "aria-label": "search", className: "anticon anticon-search ant-select-suffix", children: /* @__PURE__ */ jsx("svg", { ...svgProps, children: /* @__PURE__ */ jsx("path", { d: "M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.3 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z" }) }) });
|
|
40
|
+
var LoadingIcon = () => /* @__PURE__ */ jsx("span", { role: "img", "aria-label": "loading", className: "anticon anticon-loading anticon-spin", children: /* @__PURE__ */ jsx("svg", { ...svgProps, children: /* @__PURE__ */ jsx("path", { d: "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z" }) }) });
|
|
41
|
+
var ClearIcon = () => /* @__PURE__ */ jsx("span", { role: "img", "aria-label": "close-circle", className: "anticon anticon-close-circle", children: /* @__PURE__ */ jsx("svg", { ...svgProps, fillRule: "evenodd", children: /* @__PURE__ */ jsx("path", { d: "M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z" }) }) });
|
|
42
|
+
var cx = (...parts) => parts.filter(Boolean).join(" ");
|
|
43
|
+
function labelText(option) {
|
|
44
|
+
if (typeof option.label === "string") return option.label;
|
|
45
|
+
if (typeof option.label === "number") return String(option.label);
|
|
46
|
+
return typeof option.title === "string" ? option.title : "";
|
|
47
|
+
}
|
|
48
|
+
function SelectImpl({
|
|
49
|
+
className,
|
|
50
|
+
style,
|
|
51
|
+
value,
|
|
52
|
+
disabled,
|
|
53
|
+
loading,
|
|
54
|
+
showSearch,
|
|
55
|
+
allowClear = false,
|
|
56
|
+
placeholder,
|
|
57
|
+
options = [],
|
|
58
|
+
size,
|
|
59
|
+
status,
|
|
60
|
+
filterOption,
|
|
61
|
+
onChange,
|
|
62
|
+
onClick,
|
|
63
|
+
onSearch,
|
|
64
|
+
onClear,
|
|
65
|
+
onFocus,
|
|
66
|
+
onBlur,
|
|
67
|
+
onPopupScroll,
|
|
68
|
+
popupMatchSelectWidth,
|
|
69
|
+
popupRender,
|
|
70
|
+
autoFocus,
|
|
71
|
+
optionRender,
|
|
72
|
+
notFoundContent,
|
|
73
|
+
getPopupContainer,
|
|
74
|
+
virtual = true,
|
|
75
|
+
listHeight = 256,
|
|
76
|
+
listItemHeight = 32
|
|
77
|
+
}) {
|
|
78
|
+
const listId = useId();
|
|
79
|
+
const [open, setOpen] = useState(false);
|
|
80
|
+
const [focused, setFocused] = useState(false);
|
|
81
|
+
const [query, setQuery] = useState("");
|
|
82
|
+
const [activeIndex, setActiveIndex] = useState(-1);
|
|
83
|
+
const [scrollTop, setScrollTop] = useState(0);
|
|
84
|
+
const [rtl, setRtl] = useState(false);
|
|
85
|
+
const [pos, setPos] = useState({
|
|
86
|
+
top: 0,
|
|
87
|
+
left: 0,
|
|
88
|
+
width: 0,
|
|
89
|
+
flip: false
|
|
90
|
+
});
|
|
91
|
+
const rootRef = useRef(null);
|
|
92
|
+
const inputRef = useRef(null);
|
|
93
|
+
const dropdownRef = useRef(null);
|
|
94
|
+
const listRef = useRef(null);
|
|
95
|
+
const hasValue = value !== void 0 && value !== null && value !== "";
|
|
96
|
+
const selected = hasValue ? options.find((o) => String(o.value) === String(value)) : void 0;
|
|
97
|
+
const visible = useMemo(() => {
|
|
98
|
+
if (!showSearch || !query) return options;
|
|
99
|
+
return options.filter((option) => {
|
|
100
|
+
if (typeof filterOption === "function") return filterOption(query, option);
|
|
101
|
+
return labelText(option).toLowerCase().includes(query.toLowerCase());
|
|
102
|
+
});
|
|
103
|
+
}, [options, query, filterOption, showSearch]);
|
|
104
|
+
const close = useCallback(() => {
|
|
105
|
+
setOpen(false);
|
|
106
|
+
setQuery("");
|
|
107
|
+
setActiveIndex(-1);
|
|
108
|
+
}, []);
|
|
109
|
+
const openList = useCallback(() => {
|
|
110
|
+
if (disabled) return;
|
|
111
|
+
setOpen(true);
|
|
112
|
+
}, [disabled]);
|
|
113
|
+
const commit = useCallback(
|
|
114
|
+
(option) => {
|
|
115
|
+
if (!option || option.disabled) return;
|
|
116
|
+
onChange?.(option.value, option);
|
|
117
|
+
close();
|
|
118
|
+
},
|
|
119
|
+
[onChange, close]
|
|
120
|
+
);
|
|
121
|
+
useEffect(() => {
|
|
122
|
+
if (!open) return;
|
|
123
|
+
const selectedIdx = visible.findIndex((o) => String(o.value) === String(value));
|
|
124
|
+
const firstEnabled = visible.findIndex((o) => !o.disabled);
|
|
125
|
+
setActiveIndex(query || selectedIdx < 0 ? firstEnabled : selectedIdx);
|
|
126
|
+
}, [open, visible]);
|
|
127
|
+
const reposition = useCallback(() => {
|
|
128
|
+
const root = rootRef.current;
|
|
129
|
+
if (!root) return;
|
|
130
|
+
const rect = root.getBoundingClientRect();
|
|
131
|
+
const isRtl = getComputedStyle(root).direction === "rtl";
|
|
132
|
+
setRtl(isRtl);
|
|
133
|
+
const menuHeight = dropdownRef.current?.offsetHeight ?? listHeight + 8;
|
|
134
|
+
const width = typeof popupMatchSelectWidth === "number" ? popupMatchSelectWidth : popupMatchSelectWidth === false ? Math.max(rect.width, dropdownRef.current?.scrollWidth ?? 0) : rect.width;
|
|
135
|
+
const spaceBelow = window.innerHeight - rect.bottom;
|
|
136
|
+
const flip = spaceBelow < menuHeight + GAP && rect.top > spaceBelow;
|
|
137
|
+
const top = flip ? rect.top - menuHeight - GAP : rect.bottom + GAP;
|
|
138
|
+
const left = isRtl ? rect.right - width : rect.left;
|
|
139
|
+
setPos({ top, left, width, flip });
|
|
140
|
+
}, [popupMatchSelectWidth]);
|
|
141
|
+
useLayoutEffect(() => {
|
|
142
|
+
if (!open) return;
|
|
143
|
+
reposition();
|
|
144
|
+
}, [open, reposition, visible.length]);
|
|
145
|
+
useEffect(() => {
|
|
146
|
+
if (!open) return;
|
|
147
|
+
const onMove = () => reposition();
|
|
148
|
+
window.addEventListener("resize", onMove);
|
|
149
|
+
window.addEventListener("scroll", onMove, true);
|
|
150
|
+
return () => {
|
|
151
|
+
window.removeEventListener("resize", onMove);
|
|
152
|
+
window.removeEventListener("scroll", onMove, true);
|
|
153
|
+
};
|
|
154
|
+
}, [open, reposition]);
|
|
155
|
+
useEffect(() => {
|
|
156
|
+
if (autoFocus) inputRef.current?.focus();
|
|
157
|
+
}, [autoFocus]);
|
|
158
|
+
useEffect(() => {
|
|
159
|
+
if (!open || activeIndex < 0) return;
|
|
160
|
+
const holder = listRef.current;
|
|
161
|
+
if (!holder) return;
|
|
162
|
+
const top = activeIndex * listItemHeight;
|
|
163
|
+
if (top < holder.scrollTop) holder.scrollTop = top;
|
|
164
|
+
else if (top + listItemHeight > holder.scrollTop + holder.clientHeight) {
|
|
165
|
+
holder.scrollTop = top + listItemHeight - holder.clientHeight;
|
|
166
|
+
}
|
|
167
|
+
}, [activeIndex, open, listItemHeight]);
|
|
168
|
+
useEffect(() => {
|
|
169
|
+
if (!query || !listRef.current) return;
|
|
170
|
+
listRef.current.scrollTop = 0;
|
|
171
|
+
setScrollTop(0);
|
|
172
|
+
}, [query]);
|
|
173
|
+
const move = (delta) => {
|
|
174
|
+
if (visible.length === 0) return;
|
|
175
|
+
let next = activeIndex;
|
|
176
|
+
for (let i = 0; i < visible.length; i += 1) {
|
|
177
|
+
next = (next + delta + visible.length) % visible.length;
|
|
178
|
+
if (!visible[next]?.disabled) break;
|
|
179
|
+
}
|
|
180
|
+
setActiveIndex(next);
|
|
181
|
+
};
|
|
182
|
+
const onKeyDown = (e) => {
|
|
183
|
+
switch (e.key) {
|
|
184
|
+
case "ArrowDown":
|
|
185
|
+
e.preventDefault();
|
|
186
|
+
if (!open) openList();
|
|
187
|
+
else move(1);
|
|
188
|
+
break;
|
|
189
|
+
case "ArrowUp":
|
|
190
|
+
e.preventDefault();
|
|
191
|
+
if (!open) openList();
|
|
192
|
+
else move(-1);
|
|
193
|
+
break;
|
|
194
|
+
case "Home":
|
|
195
|
+
if (open && !showSearch) {
|
|
196
|
+
e.preventDefault();
|
|
197
|
+
setActiveIndex(visible.findIndex((o) => !o.disabled));
|
|
198
|
+
}
|
|
199
|
+
break;
|
|
200
|
+
case "End":
|
|
201
|
+
if (open && !showSearch) {
|
|
202
|
+
e.preventDefault();
|
|
203
|
+
for (let i = visible.length - 1; i >= 0; i -= 1) {
|
|
204
|
+
if (!visible[i]?.disabled) {
|
|
205
|
+
setActiveIndex(i);
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
break;
|
|
211
|
+
case "Enter":
|
|
212
|
+
case "NumpadEnter":
|
|
213
|
+
if (open) {
|
|
214
|
+
e.preventDefault();
|
|
215
|
+
commit(visible[activeIndex]);
|
|
216
|
+
} else {
|
|
217
|
+
openList();
|
|
218
|
+
}
|
|
219
|
+
break;
|
|
220
|
+
case " ":
|
|
221
|
+
if (!showSearch || !query) {
|
|
222
|
+
if (!open) {
|
|
223
|
+
e.preventDefault();
|
|
224
|
+
openList();
|
|
225
|
+
} else if (!showSearch) {
|
|
226
|
+
e.preventDefault();
|
|
227
|
+
commit(visible[activeIndex]);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
break;
|
|
231
|
+
case "Escape":
|
|
232
|
+
if (open) {
|
|
233
|
+
e.preventDefault();
|
|
234
|
+
e.stopPropagation();
|
|
235
|
+
close();
|
|
236
|
+
}
|
|
237
|
+
break;
|
|
238
|
+
case "Tab":
|
|
239
|
+
if (open) close();
|
|
240
|
+
break;
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
const itemLabel = selected ? selected.label ?? selected.title ?? String(selected.value) : hasValue ? String(value) : void 0;
|
|
244
|
+
const itemTitle = selected ? typeof selected.title === "string" ? selected.title : typeof selected.label === "string" ? selected.label : void 0 : hasValue ? String(value) : void 0;
|
|
245
|
+
const rootClass = cx(
|
|
246
|
+
"ant-select",
|
|
247
|
+
"ant-select-outlined",
|
|
248
|
+
"ant-select-single",
|
|
249
|
+
"ant-select-show-arrow",
|
|
250
|
+
showSearch && "ant-select-show-search",
|
|
251
|
+
allowClear && !disabled && "ant-select-allow-clear",
|
|
252
|
+
size === "small" && "ant-select-sm",
|
|
253
|
+
size === "large" && "ant-select-lg",
|
|
254
|
+
status && `ant-select-status-${status}`,
|
|
255
|
+
disabled && "ant-select-disabled",
|
|
256
|
+
loading && "ant-select-loading",
|
|
257
|
+
open && "ant-select-open",
|
|
258
|
+
focused && "ant-select-focused",
|
|
259
|
+
rtl && "ant-select-rtl",
|
|
260
|
+
className
|
|
261
|
+
);
|
|
262
|
+
const useVirtual = virtual !== false && visible.length * listItemHeight > listHeight;
|
|
263
|
+
const first = useVirtual ? Math.max(0, Math.floor(scrollTop / listItemHeight) - OVERSCAN) : 0;
|
|
264
|
+
const last = useVirtual ? Math.min(visible.length, Math.ceil((scrollTop + listHeight) / listItemHeight) + OVERSCAN) : visible.length;
|
|
265
|
+
const rows = [];
|
|
266
|
+
for (let index = first; index < last; index += 1) {
|
|
267
|
+
const option = visible[index];
|
|
268
|
+
if (!option) continue;
|
|
269
|
+
const isSelected = hasValue && String(option.value) === String(value);
|
|
270
|
+
rows.push(
|
|
271
|
+
/* @__PURE__ */ jsx(
|
|
272
|
+
"div",
|
|
273
|
+
{
|
|
274
|
+
role: "option",
|
|
275
|
+
id: `${listId}-${index}`,
|
|
276
|
+
"aria-selected": isSelected,
|
|
277
|
+
"aria-disabled": option.disabled || void 0,
|
|
278
|
+
"aria-setsize": useVirtual ? visible.length : void 0,
|
|
279
|
+
"aria-posinset": useVirtual ? index + 1 : void 0,
|
|
280
|
+
title: typeof option.title === "string" ? option.title : void 0,
|
|
281
|
+
className: cx(
|
|
282
|
+
"ant-select-item",
|
|
283
|
+
"ant-select-item-option",
|
|
284
|
+
index === activeIndex && "ant-select-item-option-active",
|
|
285
|
+
isSelected && "ant-select-item-option-selected",
|
|
286
|
+
option.disabled && "ant-select-item-option-disabled"
|
|
287
|
+
),
|
|
288
|
+
style: useVirtual ? { height: listItemHeight } : void 0,
|
|
289
|
+
onMouseEnter: () => !option.disabled && setActiveIndex(index),
|
|
290
|
+
onClick: () => commit(option),
|
|
291
|
+
children: /* @__PURE__ */ jsx("div", { className: "ant-select-item-option-content", children: optionRender ? optionRender({ data: option }, { data: option }) : option.label })
|
|
292
|
+
},
|
|
293
|
+
String(option.value ?? index)
|
|
294
|
+
)
|
|
295
|
+
);
|
|
296
|
+
}
|
|
297
|
+
const menu = /* @__PURE__ */ jsx(
|
|
298
|
+
"div",
|
|
299
|
+
{
|
|
300
|
+
ref: listRef,
|
|
301
|
+
id: listId,
|
|
302
|
+
role: "listbox",
|
|
303
|
+
className: "rc-virtual-list-holder",
|
|
304
|
+
style: { maxHeight: listHeight, overflowY: "auto", overflowAnchor: "none" },
|
|
305
|
+
onScroll: (e) => {
|
|
306
|
+
if (useVirtual) setScrollTop(e.currentTarget.scrollTop);
|
|
307
|
+
onPopupScroll?.(e);
|
|
308
|
+
},
|
|
309
|
+
children: visible.length === 0 ? /* @__PURE__ */ jsx("div", { className: "ant-select-item ant-select-item-empty", children: notFoundContent ?? (loading ? "Loading..." : "No data") }) : useVirtual ? /* @__PURE__ */ jsx("div", { style: { height: visible.length * listItemHeight, position: "relative" }, children: /* @__PURE__ */ jsx(
|
|
310
|
+
"div",
|
|
311
|
+
{
|
|
312
|
+
style: {
|
|
313
|
+
position: "absolute",
|
|
314
|
+
top: 0,
|
|
315
|
+
left: 0,
|
|
316
|
+
right: 0,
|
|
317
|
+
transform: `translateY(${first * listItemHeight}px)`
|
|
318
|
+
},
|
|
319
|
+
children: rows
|
|
320
|
+
}
|
|
321
|
+
) }) : rows
|
|
322
|
+
}
|
|
323
|
+
);
|
|
324
|
+
const dropdown = /* @__PURE__ */ jsx(
|
|
325
|
+
"div",
|
|
326
|
+
{
|
|
327
|
+
ref: dropdownRef,
|
|
328
|
+
className: cx(
|
|
329
|
+
"ant-select-dropdown",
|
|
330
|
+
`ant-select-dropdown-placement-${pos.flip ? "top" : "bottom"}${rtl ? "Right" : "Left"}`,
|
|
331
|
+
rtl && "ant-select-dropdown-rtl"
|
|
332
|
+
),
|
|
333
|
+
style: {
|
|
334
|
+
...ANT_SELECT_TOKENS,
|
|
335
|
+
position: "fixed",
|
|
336
|
+
top: pos.top,
|
|
337
|
+
left: pos.left,
|
|
338
|
+
width: popupMatchSelectWidth === false ? void 0 : pos.width,
|
|
339
|
+
minWidth: pos.width || void 0
|
|
340
|
+
},
|
|
341
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
342
|
+
children: popupRender ? popupRender(menu) : menu
|
|
343
|
+
}
|
|
344
|
+
);
|
|
345
|
+
const showClear = allowClear && !disabled && hasValue && !loading;
|
|
346
|
+
return /* @__PURE__ */ jsxs(
|
|
347
|
+
"div",
|
|
348
|
+
{
|
|
349
|
+
ref: rootRef,
|
|
350
|
+
className: rootClass,
|
|
351
|
+
style: { ...ANT_SELECT_TOKENS, ...style },
|
|
352
|
+
onMouseDown: (e) => {
|
|
353
|
+
if (disabled) return;
|
|
354
|
+
const target = e.target;
|
|
355
|
+
if (target.closest(".ant-select-clear")) return;
|
|
356
|
+
if (target !== inputRef.current) e.preventDefault();
|
|
357
|
+
inputRef.current?.focus();
|
|
358
|
+
onClick?.();
|
|
359
|
+
if (open) {
|
|
360
|
+
if (!showSearch || target.closest(".ant-select-arrow")) close();
|
|
361
|
+
} else {
|
|
362
|
+
openList();
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
children: [
|
|
366
|
+
/* @__PURE__ */ jsx("div", { className: "ant-select-selector", children: /* @__PURE__ */ jsxs("span", { className: "ant-select-selection-wrap", children: [
|
|
367
|
+
/* @__PURE__ */ jsx("span", { className: "ant-select-selection-search", children: /* @__PURE__ */ jsx(
|
|
368
|
+
"input",
|
|
369
|
+
{
|
|
370
|
+
ref: inputRef,
|
|
371
|
+
type: "search",
|
|
372
|
+
role: "combobox",
|
|
373
|
+
autoComplete: "off",
|
|
374
|
+
"aria-haspopup": "listbox",
|
|
375
|
+
"aria-expanded": open,
|
|
376
|
+
"aria-controls": open ? listId : void 0,
|
|
377
|
+
"aria-activedescendant": open && activeIndex >= 0 ? `${listId}-${activeIndex}` : void 0,
|
|
378
|
+
"aria-autocomplete": "list",
|
|
379
|
+
className: "ant-select-selection-search-input",
|
|
380
|
+
style: showSearch ? void 0 : { opacity: 0 },
|
|
381
|
+
readOnly: !showSearch,
|
|
382
|
+
unselectable: showSearch ? void 0 : "on",
|
|
383
|
+
disabled,
|
|
384
|
+
value: query,
|
|
385
|
+
onChange: (e) => {
|
|
386
|
+
setQuery(e.target.value);
|
|
387
|
+
if (!open) openList();
|
|
388
|
+
onSearch?.(e.target.value);
|
|
389
|
+
},
|
|
390
|
+
onKeyDown,
|
|
391
|
+
onFocus: () => {
|
|
392
|
+
setFocused(true);
|
|
393
|
+
onFocus?.();
|
|
394
|
+
},
|
|
395
|
+
onBlur: () => {
|
|
396
|
+
setFocused(false);
|
|
397
|
+
close();
|
|
398
|
+
onBlur?.();
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
) }),
|
|
402
|
+
!query && itemLabel !== void 0 ? /* @__PURE__ */ jsx("span", { className: "ant-select-selection-item", title: itemTitle, children: itemLabel }) : null,
|
|
403
|
+
!query && itemLabel === void 0 ? /* @__PURE__ */ jsx("span", { className: "ant-select-selection-placeholder", children: placeholder }) : null
|
|
404
|
+
] }) }),
|
|
405
|
+
/* @__PURE__ */ jsx(
|
|
406
|
+
"span",
|
|
407
|
+
{
|
|
408
|
+
className: cx("ant-select-arrow", loading && "ant-select-arrow-loading"),
|
|
409
|
+
style: { userSelect: "none", WebkitUserSelect: "none" },
|
|
410
|
+
unselectable: "on",
|
|
411
|
+
"aria-hidden": "true",
|
|
412
|
+
children: loading ? /* @__PURE__ */ jsx(LoadingIcon, {}) : open && showSearch ? /* @__PURE__ */ jsx(SearchIcon, {}) : /* @__PURE__ */ jsx(DownIcon, {})
|
|
413
|
+
}
|
|
414
|
+
),
|
|
415
|
+
showClear ? /* @__PURE__ */ jsx(
|
|
416
|
+
"span",
|
|
417
|
+
{
|
|
418
|
+
className: "ant-select-clear",
|
|
419
|
+
style: { userSelect: "none", WebkitUserSelect: "none" },
|
|
420
|
+
unselectable: "on",
|
|
421
|
+
"aria-hidden": "true",
|
|
422
|
+
onMouseDown: (e) => {
|
|
423
|
+
e.preventDefault();
|
|
424
|
+
e.stopPropagation();
|
|
425
|
+
},
|
|
426
|
+
onClick: (e) => {
|
|
427
|
+
e.stopPropagation();
|
|
428
|
+
setQuery("");
|
|
429
|
+
onChange?.(void 0, void 0);
|
|
430
|
+
onClear?.();
|
|
431
|
+
},
|
|
432
|
+
children: /* @__PURE__ */ jsx(ClearIcon, {})
|
|
433
|
+
}
|
|
434
|
+
) : null,
|
|
435
|
+
open && typeof document !== "undefined" ? createPortal(
|
|
436
|
+
dropdown,
|
|
437
|
+
rootRef.current && getPopupContainer?.(rootRef.current) || document.body
|
|
438
|
+
) : null
|
|
439
|
+
]
|
|
440
|
+
}
|
|
441
|
+
);
|
|
442
|
+
}
|
|
443
|
+
var SelectImpl_default = SelectImpl;
|
|
444
|
+
|
|
445
|
+
export { ANT_SELECT_TOKENS, SelectImpl, SelectImpl_default as default };
|
|
446
|
+
//# sourceMappingURL=SelectImpl-NM4O4IGW.js.map
|
|
447
|
+
//# sourceMappingURL=SelectImpl-NM4O4IGW.js.map
|