@cwellt_software/cwellt-reactjs-lib 1.0.3 → 1.0.5
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/content/icons/new-cw-icons/NewCwIcons.html +390 -6
- package/dist/content/icons/new-cw-icons/NewCwIcons.json +1 -1
- package/dist/content/icons/new-cw-icons/css/new-cw-icons.css +20 -6
- package/dist/content/icons/new-cw-icons/fonts/NewCwIcons.woff +0 -0
- package/dist/index.cjs.js +653 -356
- package/dist/index.css +2 -2
- package/dist/index.d.ts +284 -134
- package/dist/index.es.js +658 -351
- package/dist/src/common/functions/colorManipulation.d.ts.map +1 -1
- package/dist/src/components/control/action/button/CwButton.d.ts +3 -2
- package/dist/src/components/control/action/button/CwButton.d.ts.map +1 -1
- package/dist/src/components/control/action/buttons/CwButtons.d.ts +0 -11
- package/dist/src/components/control/action/buttons/CwButtons.d.ts.map +1 -1
- package/dist/src/components/control/action/contextmenu/CwContextMenu.d.ts +4 -0
- package/dist/src/components/control/action/contextmenu/CwContextMenu.d.ts.map +1 -1
- package/dist/src/components/control/action/search/CwSearch.d.ts +1 -1
- package/dist/src/components/control/action/search/CwSearch.d.ts.map +1 -1
- package/dist/src/components/control/choice/dropdown/CwDropdown.d.ts +2 -2
- package/dist/src/components/control/choice/dropdown/CwDropdown.d.ts.map +1 -1
- package/dist/src/components/control/choice/multi-filter/CwMultiFilter.d.ts +122 -33
- package/dist/src/components/control/choice/multi-filter/CwMultiFilter.d.ts.map +1 -1
- package/dist/src/components/control/choice/toggle/CwToggle.d.ts +0 -4
- package/dist/src/components/control/choice/toggle/CwToggle.d.ts.map +1 -1
- package/dist/src/components/control/input/any/CwInput.d.ts.map +1 -1
- package/dist/src/components/control/input/number/CwInputNumber.d.ts.map +1 -1
- package/dist/src/components/custom/scheduler/CwSchedulerComp.d.ts.map +1 -1
- package/dist/src/components/custom/scheduler-new/presentation/NewScheduler.d.ts.map +1 -1
- package/dist/src/components/custom/scheduler-new/presentation/components/row/BackgroundEvent.d.ts +0 -1
- package/dist/src/components/custom/scheduler-new/presentation/components/row/BackgroundEvent.d.ts.map +1 -1
- package/dist/src/components/custom/scheduler-new/presentation/components/row/DefaultRowHeader.d.ts.map +1 -1
- package/dist/src/components/custom/scheduler-new/presentation/components/row/Event.d.ts +1 -0
- package/dist/src/components/custom/scheduler-new/presentation/components/row/Event.d.ts.map +1 -1
- package/dist/src/components/custom/super-scheduler/PinRowHeader.d.ts.map +1 -1
- package/dist/src/components/display/data/accordion/CwAccordionContainer.d.ts.map +1 -1
- package/dist/src/components/display/data/generic_tooltip/CwGenericTooltip.d.ts +1 -0
- package/dist/src/components/display/data/generic_tooltip/CwGenericTooltip.d.ts.map +1 -1
- package/dist/src/components/display/data/table/CwTable.d.ts +48 -63
- package/dist/src/components/display/data/table/CwTable.d.ts.map +1 -1
- package/dist/src/components/display/graphics/loading/CwLoading.d.ts +39 -9
- package/dist/src/components/display/graphics/loading/CwLoading.d.ts.map +1 -1
- package/dist/src/components/display/graphics/loading-small/CwLoadingSmall.d.ts +13 -1
- package/dist/src/components/display/graphics/loading-small/CwLoadingSmall.d.ts.map +1 -1
- package/dist/src/components/display/text/tag/CwTag.d.ts +2 -2
- package/dist/src/components/display/text/tag/CwTag.d.ts.map +1 -1
- package/dist/src/components/layout/dialog/CwDialog.d.ts +15 -4
- package/dist/src/components/layout/dialog/CwDialog.d.ts.map +1 -1
- package/dist/src/components/layout/list/key-value/CwKeyValueList.d.ts +33 -0
- package/dist/src/components/layout/list/key-value/CwKeyValueList.d.ts.map +1 -0
- package/dist/src/components/layout/modal/CwModalReportFunctional.d.ts +2 -2
- package/dist/src/components/layout/modal/CwModalReportFunctional.d.ts.map +1 -1
- package/dist/src/components/layout/modal/legacy/cw_modal_report.d.ts.map +1 -1
- package/dist/src/components/layout/tabs/CwTabs.d.ts +2 -1
- package/dist/src/components/layout/tabs/CwTabs.d.ts.map +1 -1
- package/dist/src/index.d.ts +3 -2
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -126,8 +126,8 @@ interface CwTagProps {
|
|
|
126
126
|
closableTag?: boolean;
|
|
127
127
|
className?: string;
|
|
128
128
|
classNameTag_description?: string;
|
|
129
|
-
onClickTag?:
|
|
130
|
-
onClickClosableTag?:
|
|
129
|
+
onClickTag?: (clickEvent: React$1.MouseEvent<HTMLSpanElement, MouseEvent>) => void;
|
|
130
|
+
onClickClosableTag?: (clickEvent: React$1.MouseEvent<HTMLSpanElement, MouseEvent>) => void;
|
|
131
131
|
idTag?: string;
|
|
132
132
|
ref?: any;
|
|
133
133
|
styleClosableButton?: React$1.CSSProperties;
|
|
@@ -174,19 +174,60 @@ interface CwIconProps extends Omit<HTMLProps<HTMLDivElement>, "className"> {
|
|
|
174
174
|
*/
|
|
175
175
|
declare function CwIcon(props: CwIconProps): react_jsx_runtime.JSX.Element;
|
|
176
176
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
177
|
+
type LoadingSize = 'small' | 'regular' | 'large';
|
|
178
|
+
type IconPosition = 'inside' | 'outside';
|
|
179
|
+
interface CwLoadingProps {
|
|
180
|
+
/** Boolean to show/hide loading */
|
|
181
|
+
isLoading?: boolean;
|
|
182
|
+
/** Text to display alongside the loading icon */
|
|
183
|
+
text?: string;
|
|
184
|
+
/** Controls the size of the loading indicator (small/regular/large) */
|
|
185
|
+
size?: LoadingSize;
|
|
186
|
+
/** Position of the icon */
|
|
187
|
+
iconPosition?: IconPosition;
|
|
188
|
+
/** Custom icon class (default: 'cwi-plane-solid') */
|
|
189
|
+
iconName?: string;
|
|
190
|
+
/** Custom animation (default: 'spin') */
|
|
191
|
+
animation?: string;
|
|
184
192
|
}
|
|
185
|
-
|
|
193
|
+
/**
|
|
194
|
+
* CwLoading
|
|
195
|
+
*
|
|
196
|
+
* A versatile loading component that shows a spinner with optional text
|
|
197
|
+
* and disables the wrapped content while in loading state.
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* // Basic usage
|
|
201
|
+
* <CwLoading isLoading={isSubmitting}>
|
|
202
|
+
* <form>...</form>
|
|
203
|
+
* </CwLoading>
|
|
204
|
+
*
|
|
205
|
+
* // With custom text and size
|
|
206
|
+
* <CwLoading
|
|
207
|
+
* isLoading={isLoading}
|
|
208
|
+
* text="Please wait..."
|
|
209
|
+
* size="large"
|
|
210
|
+
* >
|
|
211
|
+
* <UserProfile />
|
|
212
|
+
* </CwLoading>
|
|
213
|
+
*/
|
|
214
|
+
declare function CwLoading({ isLoading, text, size, iconPosition, iconName, animation, children }: React__default.PropsWithChildren<CwLoadingProps>): react_jsx_runtime.JSX.Element;
|
|
186
215
|
|
|
187
216
|
interface CwLoadingSmallProps {
|
|
188
|
-
|
|
217
|
+
isLoading?: boolean;
|
|
189
218
|
}
|
|
219
|
+
/**
|
|
220
|
+
* @deprecated since may 2025. Use <CwLoading size="small"> instead.
|
|
221
|
+
*
|
|
222
|
+
* This component will be removed in a future release.
|
|
223
|
+
*
|
|
224
|
+
* @example
|
|
225
|
+
* // Instead of:
|
|
226
|
+
* <CwLoadingSmall />
|
|
227
|
+
*
|
|
228
|
+
* // Use:
|
|
229
|
+
* <CwLoading size="small" />
|
|
230
|
+
*/
|
|
190
231
|
declare function CwLoadingSmall(CwelltLoadingAppointements: React$1.PropsWithChildren<CwLoadingSmallProps>): react_jsx_runtime.JSX.Element;
|
|
191
232
|
|
|
192
233
|
type TooltipPosition = "top" | "bottom" | "left" | "right";
|
|
@@ -194,6 +235,7 @@ interface CwGenericTooltipProps {
|
|
|
194
235
|
children: ReactNode;
|
|
195
236
|
content?: ReactNode;
|
|
196
237
|
dissapearsWhenHover?: boolean;
|
|
238
|
+
hide?: boolean;
|
|
197
239
|
position?: TooltipPosition;
|
|
198
240
|
overlayStyle?: CSSProperties;
|
|
199
241
|
showDelay?: number;
|
|
@@ -255,7 +297,7 @@ declare class CwModalIframe extends React$1.Component<CwModalIframeProps, State$
|
|
|
255
297
|
render(): react_jsx_runtime.JSX.Element;
|
|
256
298
|
}
|
|
257
299
|
|
|
258
|
-
interface
|
|
300
|
+
interface CwReportModalFunctionalProps {
|
|
259
301
|
content: string;
|
|
260
302
|
name: string;
|
|
261
303
|
title: string;
|
|
@@ -267,7 +309,7 @@ interface CwReportModalProps$1 {
|
|
|
267
309
|
isModal?: boolean;
|
|
268
310
|
onCloseModal: () => void;
|
|
269
311
|
}
|
|
270
|
-
declare const CwModalReportFunctional: FC<
|
|
312
|
+
declare const CwModalReportFunctional: FC<CwReportModalFunctionalProps>;
|
|
271
313
|
|
|
272
314
|
interface CwReportModalProps {
|
|
273
315
|
url: File;
|
|
@@ -317,18 +359,29 @@ interface CwModalHoverProps extends Omit<HTMLProps<HTMLDialogElement>, "classNam
|
|
|
317
359
|
declare const CwModalHover: FC<CwModalHoverProps>;
|
|
318
360
|
|
|
319
361
|
interface CwDialogProps extends Omit<HTMLProps<PropsWithChildren<HTMLDialogElement>>, "className"> {
|
|
362
|
+
/** Custom footer elements to replace the default footer */
|
|
320
363
|
customFooter?: Array<ReactElement>;
|
|
364
|
+
/** Custom header elements to replace the default header */
|
|
321
365
|
customHeader?: Array<ReactElement>;
|
|
366
|
+
/** Text displayed in the dialog header */
|
|
322
367
|
headline?: string;
|
|
368
|
+
/** Width of the dialog. Accepts number (px) or string with unit (px, rem, vw, vh) */
|
|
369
|
+
width?: number | string;
|
|
370
|
+
/** Height of the dialog. Accepts number (px) or string with unit (px, rem, vh). If not provided, height will adjust to content */
|
|
371
|
+
height?: number | string;
|
|
372
|
+
/** Legacy way to set dialog dimensions. For backwards compatibility */
|
|
323
373
|
dialogSize?: {
|
|
324
|
-
width
|
|
325
|
-
height
|
|
374
|
+
width?: number | string;
|
|
375
|
+
height?: number | string;
|
|
326
376
|
};
|
|
327
|
-
|
|
377
|
+
/** Whether to show a semi-transparent background behind the dialog. Default is true */
|
|
328
378
|
scrim?: boolean;
|
|
379
|
+
/** Function called when the save button is clicked */
|
|
329
380
|
onSave?: () => void;
|
|
381
|
+
/** Function called when the close button is clicked */
|
|
330
382
|
onClose?: () => void;
|
|
331
|
-
|
|
383
|
+
/** If true, the footer will not be displayed */
|
|
384
|
+
hideFooter?: boolean;
|
|
332
385
|
}
|
|
333
386
|
declare const CwDialog: FC<CwDialogProps>;
|
|
334
387
|
|
|
@@ -361,115 +414,100 @@ interface Column {
|
|
|
361
414
|
key: string;
|
|
362
415
|
render?: (item: DataItem) => React__default.ReactNode;
|
|
363
416
|
className?: string;
|
|
417
|
+
sortable?: boolean;
|
|
418
|
+
width?: number | string;
|
|
364
419
|
}
|
|
365
420
|
interface DataItem {
|
|
366
|
-
key: string;
|
|
367
421
|
[key: string]: any;
|
|
368
422
|
}
|
|
369
423
|
interface CwTableProps {
|
|
370
424
|
columns: Column[];
|
|
371
425
|
data: DataItem[];
|
|
372
426
|
pagination?: boolean;
|
|
373
|
-
|
|
427
|
+
pageSizeOptions?: number[];
|
|
374
428
|
expandedRowRender?: (record: DataItem) => React__default.ReactNode;
|
|
375
|
-
onExpand?:
|
|
429
|
+
onExpand?: (record: DataItem) => void;
|
|
376
430
|
classNameContainer?: string;
|
|
377
431
|
className?: string;
|
|
378
|
-
|
|
379
|
-
classNameTr_row?: string;
|
|
432
|
+
classNameRow?: string;
|
|
380
433
|
style?: React__default.CSSProperties;
|
|
381
434
|
id?: string;
|
|
382
435
|
textNoData?: string;
|
|
436
|
+
rowKey?: string;
|
|
437
|
+
loading?: boolean;
|
|
438
|
+
scrollHeight?: number | string;
|
|
439
|
+
stickyHeader?: boolean;
|
|
383
440
|
}
|
|
384
441
|
/**
|
|
385
|
-
* A
|
|
386
|
-
*
|
|
442
|
+
* A reusable and customizable table component.
|
|
443
|
+
*
|
|
444
|
+
* @param props - Component props to configure columns, data, styles, pagination, expanded rows, and more.
|
|
445
|
+
*
|
|
387
446
|
* @example
|
|
388
447
|
* const columns = [
|
|
389
448
|
* {
|
|
390
449
|
* title: 'Name',
|
|
391
450
|
* dataIndex: 'name',
|
|
392
451
|
* key: 'name',
|
|
452
|
+
* sortable: true, // Column is sortable
|
|
453
|
+
* width: 100 // You can define the width of the column
|
|
393
454
|
* },
|
|
394
455
|
* {
|
|
395
456
|
* title: 'Age',
|
|
396
457
|
* dataIndex: 'age',
|
|
397
458
|
* key: 'age',
|
|
398
|
-
*
|
|
459
|
+
* sortable: true,
|
|
460
|
+
* render: (item) => <span>{item.age} years</span> // Custom rendering
|
|
399
461
|
* },
|
|
400
462
|
* {
|
|
401
463
|
* title: 'Address',
|
|
402
464
|
* dataIndex: 'address',
|
|
403
465
|
* key: 'address',
|
|
404
|
-
* render: (
|
|
405
|
-
* <a href={`https://maps.google.com/?q=${encodeURIComponent(address)}`} target="_blank">
|
|
406
|
-
* {address}
|
|
466
|
+
* render: (item) => (
|
|
467
|
+
* <a href={`https://maps.google.com/?q=${encodeURIComponent(item.address)}`} target="_blank" rel="noreferrer">
|
|
468
|
+
* {item.address}
|
|
407
469
|
* </a>
|
|
408
|
-
* )
|
|
409
|
-
* }
|
|
470
|
+
* ) // Link rendering
|
|
471
|
+
* }
|
|
410
472
|
* ];
|
|
411
473
|
*
|
|
412
474
|
* const data = [
|
|
413
|
-
* {
|
|
414
|
-
*
|
|
415
|
-
*
|
|
416
|
-
*
|
|
417
|
-
*
|
|
418
|
-
* }
|
|
419
|
-
* {
|
|
420
|
-
* key: '2',
|
|
421
|
-
* name: 'John',
|
|
422
|
-
* age: 42,
|
|
423
|
-
* address: '10 Downing Street',
|
|
424
|
-
* },
|
|
425
|
-
* {
|
|
426
|
-
* key: '3',
|
|
427
|
-
* name: 'Andres',
|
|
428
|
-
* age: 33,
|
|
429
|
-
* address: '10 Downing Street',
|
|
430
|
-
* },
|
|
431
|
-
* {
|
|
432
|
-
* key: '4',
|
|
433
|
-
* name: 'Gabriel',
|
|
434
|
-
* age: 22,
|
|
435
|
-
* address: '10 Downing Street',
|
|
436
|
-
* },
|
|
437
|
-
* {
|
|
438
|
-
* key: '5',
|
|
439
|
-
* name: 'Sergio',
|
|
440
|
-
* age: 47,
|
|
441
|
-
* address: '10 Downing Street',
|
|
442
|
-
* },
|
|
443
|
-
* {
|
|
444
|
-
* key: '6',
|
|
445
|
-
* name: 'Zacarias',
|
|
446
|
-
* age: 61,
|
|
447
|
-
* address: '10 Downing Street',
|
|
448
|
-
* },
|
|
475
|
+
* { key: '1', name: 'Mike', age: 32, address: '10 Downing Street' },
|
|
476
|
+
* { key: '2', name: 'John', age: 42, address: '11 Downing Street' },
|
|
477
|
+
* { key: '3', name: 'Andres', age: 33, address: '12 Downing Street' },
|
|
478
|
+
* { key: '4', name: 'Gabriel', age: 22, address: '13 Downing Street' },
|
|
479
|
+
* { key: '5', name: 'Sergio', age: 47, address: '14 Downing Street' },
|
|
480
|
+
* { key: '6', name: 'Zacarias', age: 61, address: '15 Downing Street' }
|
|
449
481
|
* ];
|
|
450
482
|
*
|
|
451
|
-
* const generateExpandedContent = (record) =>
|
|
452
|
-
*
|
|
453
|
-
*
|
|
454
|
-
*
|
|
455
|
-
*
|
|
456
|
-
* </div>
|
|
457
|
-
* );
|
|
458
|
-
* };
|
|
459
|
-
*
|
|
460
|
-
* ------------------------- render ---------------------------
|
|
483
|
+
* const generateExpandedContent = (record) => (
|
|
484
|
+
* <div>
|
|
485
|
+
* Custom expanded content for {record.name}
|
|
486
|
+
* </div>
|
|
487
|
+
* );
|
|
461
488
|
*
|
|
462
489
|
* <CwTable
|
|
463
490
|
* columns={columns}
|
|
464
|
-
* data={data}
|
|
465
|
-
* itemsPerPage={3}
|
|
491
|
+
* data={data}
|
|
466
492
|
* pagination={true}
|
|
493
|
+
* pageSizeOptions={[3, 5, 10]} // Optional, defaults to [5, 10, 20, 50]
|
|
467
494
|
* expandedRowRender={generateExpandedContent}
|
|
468
|
-
* onExpand={(
|
|
495
|
+
* onExpand={(item) => console.log('Expanded:', item)}
|
|
496
|
+
* rowKey="key" // Optional, defaults to 'key'
|
|
497
|
+
* textNoData="No data available" // Optional message when no data
|
|
498
|
+
* loading={false} // Optional, shows loading indicator
|
|
499
|
+
* scrollHeight={300} // Optional scroll height, defaults to 300
|
|
500
|
+
* stickyHeader={true} // Optional, makes header sticky on scroll
|
|
501
|
+
* classNameContainer="my-table-wrapper" // Optional wrapper class
|
|
502
|
+
* className="my-table" // Optional table class
|
|
503
|
+
* classNameRow="my-table-row" // Optional class for each row
|
|
504
|
+
* id="custom-table-id" // Optional ID for the container
|
|
505
|
+
* style={{ border: '1px solid #ccc' }} // Optional inline styles
|
|
469
506
|
* />
|
|
507
|
+
*
|
|
470
508
|
* @returns React component
|
|
471
509
|
*/
|
|
472
|
-
declare function CwTable({ columns, data, pagination,
|
|
510
|
+
declare function CwTable({ columns, data, pagination, pageSizeOptions, expandedRowRender, onExpand, className, classNameRow, style, classNameContainer, id, textNoData, rowKey, loading, scrollHeight, stickyHeader, }: Readonly<CwTableProps>): react_jsx_runtime.JSX.Element;
|
|
473
511
|
|
|
474
512
|
interface Tab {
|
|
475
513
|
key: string;
|
|
@@ -482,10 +520,11 @@ interface CwTabsProps {
|
|
|
482
520
|
id?: string;
|
|
483
521
|
onTabClick?: any;
|
|
484
522
|
defaultActiveKey?: string;
|
|
485
|
-
|
|
523
|
+
className?: string;
|
|
486
524
|
style?: React__default.CSSProperties;
|
|
487
525
|
tabs: Tab[];
|
|
488
526
|
tabsPosition?: 'top' | 'left';
|
|
527
|
+
tabsListWidth?: string;
|
|
489
528
|
}
|
|
490
529
|
/**
|
|
491
530
|
*
|
|
@@ -528,6 +567,37 @@ interface CwExpandableProps extends Omit<HTMLProps<PropsWithChildren<HTMLDetails
|
|
|
528
567
|
*/
|
|
529
568
|
declare const CwExpandable: FC<CwExpandableProps>;
|
|
530
569
|
|
|
570
|
+
/**
|
|
571
|
+
* Props for the CwKeyValueList component
|
|
572
|
+
*/
|
|
573
|
+
interface CwKeyValueListProps {
|
|
574
|
+
items: Array<{
|
|
575
|
+
key: string;
|
|
576
|
+
label: string;
|
|
577
|
+
value: any;
|
|
578
|
+
/** Optional suffix to append to the value (e.g. units, currency symbols) */
|
|
579
|
+
suffix?: string;
|
|
580
|
+
}>;
|
|
581
|
+
className?: string;
|
|
582
|
+
emptyValue?: React.ReactNode;
|
|
583
|
+
/** Direction of flex layout: 'row' or 'column' @default "row" **/
|
|
584
|
+
direction?: 'row' | 'column';
|
|
585
|
+
}
|
|
586
|
+
/**
|
|
587
|
+
* A component for displaying key-value pairs in a definition list format
|
|
588
|
+
* Used for read-only display of structured data
|
|
589
|
+
*
|
|
590
|
+
* @example
|
|
591
|
+
* <CwKeyValueList
|
|
592
|
+
* items={[
|
|
593
|
+
* { key: "length", label: "Length", value: "10", suffix: "m" },
|
|
594
|
+
* { key: "width", label: "Width", value: null, suffix: "m" }
|
|
595
|
+
* ]}
|
|
596
|
+
* emptyValue="N/A"
|
|
597
|
+
* />
|
|
598
|
+
*/
|
|
599
|
+
declare const CwKeyValueList: React.FC<CwKeyValueListProps>;
|
|
600
|
+
|
|
531
601
|
interface CwTableGroupedData_Row {
|
|
532
602
|
cells: {
|
|
533
603
|
content: JSX.Element;
|
|
@@ -639,11 +709,12 @@ interface CwInputProps {
|
|
|
639
709
|
}
|
|
640
710
|
declare function CwInput(CwInputProps: React__default.PropsWithChildren<CwInputProps>): react_jsx_runtime.JSX.Element;
|
|
641
711
|
|
|
642
|
-
interface CwButtonProps extends
|
|
712
|
+
interface CwButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
643
713
|
text?: string;
|
|
714
|
+
variant?: 'solid' | 'outline';
|
|
644
715
|
ref?: React.LegacyRef<HTMLButtonElement>;
|
|
645
716
|
}
|
|
646
|
-
declare function CwButton(
|
|
717
|
+
declare function CwButton({ text, variant, className, children, ...buttonProps }: CwButtonProps): react_jsx_runtime.JSX.Element;
|
|
647
718
|
|
|
648
719
|
interface CwDigitProps extends Omit<HTMLProps<HTMLInputElement>, "className" | "type"> {
|
|
649
720
|
/** Props to define alignment and size; undefined == column
|
|
@@ -1051,9 +1122,6 @@ interface CwCheckboxProps {
|
|
|
1051
1122
|
declare function CwCheckbox(CwCheckboxProps: React__default.PropsWithChildren<CwCheckboxProps>): react_jsx_runtime.JSX.Element;
|
|
1052
1123
|
|
|
1053
1124
|
interface CwToggleProps extends Omit<React__default.DetailedHTMLProps<React__default.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "className" | "type"> {
|
|
1054
|
-
/** Props to define alignment and size; undefined == column
|
|
1055
|
-
* @example alignProps={{_direction:"row"}} */
|
|
1056
|
-
alignProps?: CwAlignProps;
|
|
1057
1125
|
/** Props of the button; undefined == no button
|
|
1058
1126
|
* @example buttonProps={{children:"Ok"}} */
|
|
1059
1127
|
buttonProps?: CwButtonProps;
|
|
@@ -1136,7 +1204,7 @@ interface CwOptionProps extends Omit<HTMLProps<PropsWithChildren<HTMLOptionEleme
|
|
|
1136
1204
|
*/
|
|
1137
1205
|
declare function CwOption(props: CwOptionProps): react_jsx_runtime.JSX.Element;
|
|
1138
1206
|
|
|
1139
|
-
interface CwDropdownProps {
|
|
1207
|
+
interface CwDropdownProps extends HTMLProps<HTMLDivElement> {
|
|
1140
1208
|
selectList: Array<CwSelectList>;
|
|
1141
1209
|
labelName: string;
|
|
1142
1210
|
labelPosition?: string;
|
|
@@ -1322,8 +1390,20 @@ interface CwMultiFilterProps {
|
|
|
1322
1390
|
style?: React__default.CSSProperties;
|
|
1323
1391
|
}
|
|
1324
1392
|
/**
|
|
1325
|
-
* A multiple filter selector, a MULTI-SELECT even.
|
|
1393
|
+
* A multiple filter selector, a MULTI-SELECT even. Allows users to select and filter items based on tags.
|
|
1326
1394
|
* @remark
|
|
1395
|
+
* The CwMultiFilter component provides a user interface for selecting multiple filter options
|
|
1396
|
+
* organized by categories. Each filter option is represented as a clickable tag with customizable
|
|
1397
|
+
* colors. The component manages the selection state internally but reports changes via a callback.
|
|
1398
|
+
*
|
|
1399
|
+
* Filter tags should include the following properties:
|
|
1400
|
+
* - `Name`: Display name of the filter
|
|
1401
|
+
* - `Value`: Actual value used for filtering logic
|
|
1402
|
+
* - `Category`: Group the filter belongs to
|
|
1403
|
+
* - `ID`: Unique identifier for the filter
|
|
1404
|
+
* - `PrimaryColor`: Background color of the tag
|
|
1405
|
+
* - `OnPrimaryColor`: Text color of the tag
|
|
1406
|
+
*
|
|
1327
1407
|
* ```
|
|
1328
1408
|
* ╭───────────────────────────────────────────────────────────────╮
|
|
1329
1409
|
* │ ╭──────────╮ ╭──────────╮ ╭──────────╮ │
|
|
@@ -1338,39 +1418,116 @@ interface CwMultiFilterProps {
|
|
|
1338
1418
|
* ╰─────────────────────────────────────────────────────────────╯
|
|
1339
1419
|
* ```
|
|
1340
1420
|
* @example
|
|
1341
|
-
* ```
|
|
1342
|
-
*
|
|
1343
|
-
*
|
|
1344
|
-
*
|
|
1421
|
+
* ```tsx
|
|
1422
|
+
* import { CwMultiFilter, type CwMultiFilterTagProps, type ICwMultiFilterTag } from "cwellt-reactjs-lib";
|
|
1423
|
+
* import { useCallback, useState } from "react";
|
|
1424
|
+
* import { hexToRGB } from "../common/functions/color";
|
|
1425
|
+
*
|
|
1426
|
+
* function FilterExample() {
|
|
1427
|
+
* // State to track selected filter tags
|
|
1428
|
+
* const [selectedTags, setSelectedTags] = useState(new Set<CwMultiFilterTagProps>());
|
|
1429
|
+
*
|
|
1430
|
+
* // Sample data to filter
|
|
1431
|
+
* const [users, setUsers] = useState([
|
|
1432
|
+
* { id: 1, name: "John", role: "admin", department: "IT" },
|
|
1433
|
+
* { id: 2, name: "Sarah", role: "user", department: "HR" },
|
|
1434
|
+
* // More users...
|
|
1435
|
+
* ]);
|
|
1436
|
+
*
|
|
1437
|
+
* // Filtered users based on selected tags
|
|
1438
|
+
* const [filteredUsers, setFilteredUsers] = useState(users);
|
|
1439
|
+
*
|
|
1440
|
+
* // Define filter options
|
|
1441
|
+
* const filterOptions = new Set([
|
|
1442
|
+
* {
|
|
1443
|
+
* Name: "Admin",
|
|
1444
|
+
* Value: "admin",
|
|
1445
|
+
* Category: "Roles",
|
|
1446
|
+
* ID: "Roles_admin",
|
|
1447
|
+
* OnPrimaryColor: hexToRGB("#2050a8"),
|
|
1448
|
+
* PrimaryColor: hexToRGB("#cedcff")
|
|
1449
|
+
* },
|
|
1450
|
+
* {
|
|
1451
|
+
* Name: "User",
|
|
1452
|
+
* Value: "user",
|
|
1453
|
+
* Category: "Roles",
|
|
1454
|
+
* ID: "Roles_user",
|
|
1455
|
+
* OnPrimaryColor: hexToRGB("#2050a8"),
|
|
1456
|
+
* PrimaryColor: hexToRGB("#cedcff")
|
|
1457
|
+
* },
|
|
1458
|
+
* {
|
|
1459
|
+
* Name: "IT",
|
|
1460
|
+
* Value: "IT",
|
|
1461
|
+
* Category: "Departments",
|
|
1462
|
+
* ID: "Departments_IT",
|
|
1463
|
+
* OnPrimaryColor: hexToRGB("#a82037"),
|
|
1464
|
+
* PrimaryColor: hexToRGB("#ffceda")
|
|
1465
|
+
* },
|
|
1466
|
+
* {
|
|
1467
|
+
* Name: "HR",
|
|
1468
|
+
* Value: "HR",
|
|
1469
|
+
* Category: "Departments",
|
|
1470
|
+
* ID: "Departments_HR",
|
|
1471
|
+
* OnPrimaryColor: hexToRGB("#a82037"),
|
|
1472
|
+
* PrimaryColor: hexToRGB("#ffceda")
|
|
1473
|
+
* }
|
|
1474
|
+
* ]);
|
|
1475
|
+
*
|
|
1476
|
+
* // Handle filter changes
|
|
1477
|
+
* const onChangeFilters = useCallback((tags: Set<ICwMultiFilterTag>) => {
|
|
1478
|
+
* setSelectedTags(tags);
|
|
1479
|
+
* const tagsArray = Array.from(tags);
|
|
1480
|
+
*
|
|
1481
|
+
* // Get values for each category
|
|
1482
|
+
* const roleValues = tagsArray
|
|
1483
|
+
* .filter(tag => tag.Category === "Roles")
|
|
1484
|
+
* .map(tag => tag.Value);
|
|
1485
|
+
*
|
|
1486
|
+
* const departmentValues = tagsArray
|
|
1487
|
+
* .filter(tag => tag.Category === "Departments")
|
|
1488
|
+
* .map(tag => tag.Value);
|
|
1489
|
+
*
|
|
1490
|
+
* // Apply filters
|
|
1491
|
+
* if (tagsArray.length === 0) {
|
|
1492
|
+
* // No filters applied
|
|
1493
|
+
* setFilteredUsers(users);
|
|
1494
|
+
* } else {
|
|
1495
|
+
* let filtered = users;
|
|
1496
|
+
*
|
|
1497
|
+
* if (roleValues.length > 0) {
|
|
1498
|
+
* filtered = filtered.filter(user => roleValues.includes(user.role));
|
|
1499
|
+
* }
|
|
1345
1500
|
*
|
|
1346
|
-
*
|
|
1347
|
-
*
|
|
1348
|
-
*
|
|
1349
|
-
*
|
|
1350
|
-
*
|
|
1351
|
-
*
|
|
1352
|
-
*
|
|
1353
|
-
*
|
|
1354
|
-
*
|
|
1355
|
-
*
|
|
1356
|
-
*
|
|
1357
|
-
*
|
|
1358
|
-
*
|
|
1359
|
-
*
|
|
1360
|
-
*
|
|
1361
|
-
*
|
|
1362
|
-
*
|
|
1363
|
-
*
|
|
1364
|
-
*
|
|
1365
|
-
*
|
|
1366
|
-
*
|
|
1367
|
-
*
|
|
1368
|
-
*
|
|
1369
|
-
*
|
|
1370
|
-
*
|
|
1371
|
-
*
|
|
1372
|
-
*
|
|
1373
|
-
*
|
|
1501
|
+
* if (departmentValues.length > 0) {
|
|
1502
|
+
* filtered = filtered.filter(user => departmentValues.includes(user.department));
|
|
1503
|
+
* }
|
|
1504
|
+
*
|
|
1505
|
+
* setFilteredUsers(filtered);
|
|
1506
|
+
* }
|
|
1507
|
+
* }, [users]);
|
|
1508
|
+
*
|
|
1509
|
+
* return (
|
|
1510
|
+
* <div>
|
|
1511
|
+
* <h2>Filter Users</h2>
|
|
1512
|
+
* <div style={{ width: "50%" }}>
|
|
1513
|
+
* <CwMultiFilter
|
|
1514
|
+
* id="user-filter"
|
|
1515
|
+
* allTags={filterOptions}
|
|
1516
|
+
* onChangeSelectedTags={onChangeFilters}
|
|
1517
|
+
* selectedTags={selectedTags}
|
|
1518
|
+
* />
|
|
1519
|
+
* </div>
|
|
1520
|
+
* <div style={{ marginTop: "20px" }}>
|
|
1521
|
+
* <h3>Filtered Results ({filteredUsers.length})</h3>
|
|
1522
|
+
* <ul>
|
|
1523
|
+
* {filteredUsers.map(user => (
|
|
1524
|
+
* <li key={user.id}>{user.name} - {user.role} ({user.department})</li>
|
|
1525
|
+
* ))}
|
|
1526
|
+
* </ul>
|
|
1527
|
+
* </div>
|
|
1528
|
+
* </div>
|
|
1529
|
+
* );
|
|
1530
|
+
* }
|
|
1374
1531
|
* ```
|
|
1375
1532
|
* @param {CwMultiFilterProps} props
|
|
1376
1533
|
* @returns Set the `onChange` callback to a function to check for changes in the selected filters
|
|
@@ -1379,7 +1536,7 @@ declare const CwMultiFilter: FC<CwMultiFilterProps>;
|
|
|
1379
1536
|
|
|
1380
1537
|
interface CwSearchInputProps extends HTMLProps<HTMLDivElement> {
|
|
1381
1538
|
selectList: Array<CwSelectList>;
|
|
1382
|
-
labelName
|
|
1539
|
+
labelName?: string;
|
|
1383
1540
|
labelPosition?: string;
|
|
1384
1541
|
labelClassName?: string;
|
|
1385
1542
|
handleChange?: (value: any) => void;
|
|
@@ -1393,6 +1550,10 @@ declare function CwSearchInput(optionsProps: React__default.PropsWithChildren<Cw
|
|
|
1393
1550
|
|
|
1394
1551
|
interface ContextMenuProps extends React__default.PropsWithChildren {
|
|
1395
1552
|
options: string[];
|
|
1553
|
+
offset?: {
|
|
1554
|
+
x: number;
|
|
1555
|
+
y: number;
|
|
1556
|
+
};
|
|
1396
1557
|
onSelect: (option: string) => void;
|
|
1397
1558
|
}
|
|
1398
1559
|
/**
|
|
@@ -1436,18 +1597,12 @@ declare function CwContextualMenu(CwelltRightClickProps: React$1.PropsWithChildr
|
|
|
1436
1597
|
* @dependencies #CwScheduler #CwSchedulerActive #cwelltContentDuty #cwelltContentDutyActive
|
|
1437
1598
|
*/
|
|
1438
1599
|
declare function CwFloatingButton(): react_jsx_runtime.JSX.Element;
|
|
1439
|
-
declare function CwButtonExpandAndCollapse(): react_jsx_runtime.JSX.Element;
|
|
1440
1600
|
interface cwButtonsDescProps {
|
|
1441
1601
|
cw_btn_desc: string;
|
|
1442
1602
|
cw_btnOnclick: any;
|
|
1443
1603
|
cw_btn_disabled?: boolean;
|
|
1444
1604
|
}
|
|
1445
1605
|
declare function CwButtonDef({ cw_btn_desc, cw_btnOnclick, cw_btn_disabled }: cwButtonsDescProps): react_jsx_runtime.JSX.Element;
|
|
1446
|
-
declare function CwButtonDefOutline({ cw_btn_desc, cw_btnOnclick, cw_btn_disabled }: cwButtonsDescProps): react_jsx_runtime.JSX.Element;
|
|
1447
|
-
declare function CwButtonSec({ cw_btn_desc, cw_btnOnclick, cw_btn_disabled }: cwButtonsDescProps): react_jsx_runtime.JSX.Element;
|
|
1448
|
-
declare function CwButtonSecOutline({ cw_btn_desc, cw_btnOnclick, cw_btn_disabled }: cwButtonsDescProps): react_jsx_runtime.JSX.Element;
|
|
1449
|
-
declare function CwButtonDanger({ cw_btn_desc, cw_btnOnclick, cw_btn_disabled }: cwButtonsDescProps): react_jsx_runtime.JSX.Element;
|
|
1450
|
-
declare function CwButtonDangerOutline({ cw_btn_desc, cw_btnOnclick, cw_btn_disabled }: cwButtonsDescProps): react_jsx_runtime.JSX.Element;
|
|
1451
1606
|
interface cw_btnProps {
|
|
1452
1607
|
cw_btnOnclick: any;
|
|
1453
1608
|
cw_btn_disabled?: boolean;
|
|
@@ -1470,20 +1625,15 @@ declare function CwBtnWarning({ cw_btnOnclick, cw_btn_disabled }: cw_btnProps):
|
|
|
1470
1625
|
declare function CwBtnShare({ cw_btnOnclick, cw_btn_disabled }: cw_btnProps): react_jsx_runtime.JSX.Element;
|
|
1471
1626
|
declare function CwBtnFiles({ cw_btnOnclick, cw_btn_disabled }: cw_btnProps): react_jsx_runtime.JSX.Element;
|
|
1472
1627
|
declare function CwBtnAirport({ cw_btnOnclick, cw_btn_disabled }: cw_btnProps): react_jsx_runtime.JSX.Element;
|
|
1473
|
-
declare function CwBtnUserFolder({ cw_btnOnclick, cw_btn_disabled }: cw_btnProps): react_jsx_runtime.JSX.Element;
|
|
1474
1628
|
declare function CwBtnDownLoadAllInfo({ cw_btnOnclick, cw_btn_disabled }: cw_btnProps): react_jsx_runtime.JSX.Element;
|
|
1475
1629
|
declare function CwBtnPropertyFolder({ cw_btnOnclick, cw_btn_disabled }: cw_btnProps): react_jsx_runtime.JSX.Element;
|
|
1476
1630
|
declare function CwBtnAddFolder({ cw_btnOnclick, cw_btn_disabled }: cw_btnProps): react_jsx_runtime.JSX.Element;
|
|
1477
1631
|
declare function CwBtnEditFolder({ cw_btnOnclick, cw_btn_disabled }: cw_btnProps): react_jsx_runtime.JSX.Element;
|
|
1478
|
-
declare function CwBtnSelectedFolder({ cw_btnOnclick, cw_btn_disabled }: cw_btnProps): react_jsx_runtime.JSX.Element;
|
|
1479
1632
|
declare function CwBtnUploadFiles({ cw_btnOnclick, cw_btn_disabled }: cw_btnProps): react_jsx_runtime.JSX.Element;
|
|
1480
1633
|
declare function CwBtnGoBackFolder({ cw_btnOnclick, cw_btn_disabled }: cw_btnProps): react_jsx_runtime.JSX.Element;
|
|
1481
1634
|
declare function CwBtnBookMark({ cw_btnOnclick, cw_btn_disabled }: cw_btnProps): react_jsx_runtime.JSX.Element;
|
|
1482
|
-
declare function CwBtnArchive({ cw_btnOnclick, cw_btn_disabled }: cw_btnProps): react_jsx_runtime.JSX.Element;
|
|
1483
|
-
declare function CwBtnArchiveRestore({ cw_btnOnclick, cw_btn_disabled }: cw_btnProps): react_jsx_runtime.JSX.Element;
|
|
1484
1635
|
declare function CwBtnPublish({ cw_btnOnclick, cw_btn_disabled }: cw_btnProps): react_jsx_runtime.JSX.Element;
|
|
1485
1636
|
declare function CwBtnApprove({ cw_btnOnclick, cw_btn_disabled }: cw_btnProps): react_jsx_runtime.JSX.Element;
|
|
1486
|
-
declare function CwBtnBookMarkLinkPage({ cw_btnOnclick, cw_btn_disabled }: cw_btnProps): react_jsx_runtime.JSX.Element;
|
|
1487
1637
|
declare function CwBtnBulkDuty({ cw_btnOnclick, cw_btn_disabled }: cw_btnProps): react_jsx_runtime.JSX.Element;
|
|
1488
1638
|
declare function CwBtnDropDownMenu({ cw_btnOnclick, cw_btn_disabled }: cw_btnProps): react_jsx_runtime.JSX.Element;
|
|
1489
1639
|
declare function CwBtnAlert({ cw_btnOnclick, cw_btn_disabled, cw_name }: cw_btnProps): react_jsx_runtime.JSX.Element;
|
|
@@ -1865,6 +2015,7 @@ interface SchedulerEventDm {
|
|
|
1865
2015
|
width: number;
|
|
1866
2016
|
order?: number;
|
|
1867
2017
|
icons?: ReactElement;
|
|
2018
|
+
rectangleColors?: string[];
|
|
1868
2019
|
tooltip?: ReactNode;
|
|
1869
2020
|
contextMenuItems?: ItemType[];
|
|
1870
2021
|
primaryTimeMarkerColor?: string;
|
|
@@ -1881,7 +2032,6 @@ declare const SchedulerEvent: FC<SchedulerEventState<SchedulerEventDm>>;
|
|
|
1881
2032
|
|
|
1882
2033
|
interface BackgroundEventDm extends SchedulerEventDm {
|
|
1883
2034
|
isVisible: boolean;
|
|
1884
|
-
isVerticalText?: boolean;
|
|
1885
2035
|
}
|
|
1886
2036
|
|
|
1887
2037
|
interface RowHeaderDm {
|
|
@@ -2106,4 +2256,4 @@ declare class OnClickContextMenu implements UiEvent {
|
|
|
2106
2256
|
constructor(id: string, clickedMenu: string);
|
|
2107
2257
|
}
|
|
2108
2258
|
|
|
2109
|
-
export { type BackgroundEventDm, CblDragAndDrop$1 as CblDragAndDrop, type Column, CwAccordionContainer, CwAlign, type CwAlignProps, CwBtnAdd, CwBtnAddFolder, CwBtnAirport, CwBtnAlert, CwBtnApprove,
|
|
2259
|
+
export { type BackgroundEventDm, CblDragAndDrop$1 as CblDragAndDrop, type Column, CwAccordionContainer, CwAlign, type CwAlignProps, CwBtnAdd, CwBtnAddFolder, CwBtnAirport, CwBtnAlert, CwBtnApprove, CwBtnBookMark, CwBtnBulkDuty, CwBtnCancel, CwBtnCrewPlanning, CwBtnDelay, CwBtnDelete, CwBtnDownLoadAllInfo, CwBtnDownload, CwBtnDropDownMenu, CwBtnEdit, CwBtnEditFolder, CwBtnFiles, CwBtnGeneratePairing, CwBtnGoBackFolder, CwBtnHide, CwBtnImportRequests, CwBtnInfo, CwBtnMVT, CwBtnNavFirstItemView, CwBtnNavLastItemView, CwBtnNavNextDay, CwBtnNavPreviewItem, CwBtnPairing, CwBtnPrint, CwBtnPropertyFolder, CwBtnPublish, CwBtnRefresh, CwBtnReleasePeriod, CwBtnSave, CwBtnSearch, CwBtnSelect, CwBtnShare, CwBtnStatistic, CwBtnUploadFiles, CwBtnVacations, CwBtnView, CwBtnWarning, CwButton, CwButtonDef, CwCheckbox, CwContextMenu, CwContextualMenu, CwDialog, CwDialogManager, type CwDialogProps, CwDigit, CwDisplayMessage, CwDropdown, CwDropdownContainer, CwDropdownFilter, CwDropdownNavigation, CwExpandable, type CwExpandableProps, CwFileUpload, type CwFilterTabProps, CwFindAirport, CwFloatingButton, CwGenericTooltip, CwHeadFilter, CwHeadingMain, CwHeadingSecond, CwIcon, CwImageArea, type CwImageAreaMethods, type CwImageAreaProps, CwInput, CwInputDate, CwInputDatePicker, type CwInputDatePickerProps, type CwInputDateProps, CwInputDateText, type CwInputDateTextProps, CwInputDatetime, type CwInputDatetimeProps, CwInputImage, type CwInputImageProps, CwInputNumber, type CwInputNumberProps, CwInputPhone, type CwInputPhoneProps, CwInputText, type CwInputTextProps, type CwInputTimeProps, CwKeyValueList, type CwKeyValueListProps, CwLabel, type CwLabelProps, CwLoading, CwLoadingSmall, CwMessage, CwMessageManager, type CwMessageProps, CwMessageType, CwModal, CwModalConfirm, CwModalHover, type CwModalHoverProps, CwModalIframe, CwModalReportFunctional, CwMultiFilter, type CwMultiFilterProps, CwMultiFilterTag, type CwMultiFilterTagProps, CwMultiselect, CwOption, CwOptionList, CwReportModal, type CwReportModalFunctionalProps, CwScheduler, CwScheduler2, CwSearchInput, CwSelect, CwSelectList, CwSelectListItems, type CwSelectListProps, CwSuperScheduler, CwTable, CwTableGrouped, type CwTableGroupedData, type CwTableGroupedData_Group, type CwTableGroupedData_Row, type CwTableGroupedProps, CwTabs, CwTag, CwTextArea, type CwTextAreaProps, CwTime, CwToggle, CwTooltip, CwWeekdaySelector, type DataItem, DefaultRowHeader, type ICwMultiFilterTag, MultiSelect, OnClearPinned, OnClickContextMenu, OnClickEvent, OnClickRowEvent, OnClickRowHeader, OnClickUtc, OnDoubleClickEvent, OnDoubleClickRowEvent, OnDragEvent, OnDropCtrlEvent, OnDropEvent, OnEndClickHeaderEvent, type OnEvent, OnLeftDragStart, OnMultiClickEvent, OnPinRow, OnRangeClickEvent, OnRightClickEvent, OnRightClickRow, OnRightDragStart, OnStartClickHeaderEvent, OnUnpinRow, PinRowHeader, type PinRowHeaderProps, Resource, type RowHeaderDm, type RowHeaderProps, Scheduler, SchedulerEvent, type SchedulerEventDm, type SchedulerEventState, type SchedulerRowProps, type SchedulerState, SuperScheduler, type SuperSchedulerProps, UiEvent, type Weekday, Weekdays, cblEvent, type cblEventCompProps, eventIsVisible, getDefaultDivisions, getEventSizes, itemsToMultiFilterTags, type resourceCompProps2, useCwMessage };
|