@acorex/components 20.1.34 → 20.1.36
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/accordion/index.d.ts +6 -5
- package/command/index.d.ts +13 -3
- package/comment/index.d.ts +6 -0
- package/data-table/index.d.ts +58 -2
- package/dialog/index.d.ts +29 -4
- package/drawer-2/index.d.ts +15 -0
- package/dropdown-button/index.d.ts +7 -2
- package/fesm2022/acorex-components-accordion.mjs +65 -58
- package/fesm2022/acorex-components-accordion.mjs.map +1 -1
- package/fesm2022/acorex-components-command.mjs +52 -8
- package/fesm2022/acorex-components-command.mjs.map +1 -1
- package/fesm2022/acorex-components-comment.mjs +7 -1
- package/fesm2022/acorex-components-comment.mjs.map +1 -1
- package/fesm2022/acorex-components-data-table.mjs +58 -2
- package/fesm2022/acorex-components-data-table.mjs.map +1 -1
- package/fesm2022/acorex-components-dialog.mjs +34 -9
- package/fesm2022/acorex-components-dialog.mjs.map +1 -1
- package/fesm2022/acorex-components-drawer-2.mjs +15 -0
- package/fesm2022/acorex-components-drawer-2.mjs.map +1 -1
- package/fesm2022/acorex-components-dropdown-button.mjs +7 -2
- package/fesm2022/acorex-components-dropdown-button.mjs.map +1 -1
- package/fesm2022/acorex-components-form.mjs +10 -0
- package/fesm2022/acorex-components-form.mjs.map +1 -1
- package/fesm2022/acorex-components-grid-layout-builder.mjs +115 -5
- package/fesm2022/acorex-components-grid-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-components-menu.mjs +12 -1
- package/fesm2022/acorex-components-menu.mjs.map +1 -1
- package/fesm2022/{acorex-components-modal-acorex-components-modal-BdrQgtUV.mjs → acorex-components-modal-acorex-components-modal-DTUAOsgv.mjs} +12 -11
- package/fesm2022/{acorex-components-modal-acorex-components-modal-BdrQgtUV.mjs.map → acorex-components-modal-acorex-components-modal-DTUAOsgv.mjs.map} +1 -1
- package/fesm2022/{acorex-components-modal-modal-content.component-DTrjX50k.mjs → acorex-components-modal-modal-content.component-Co2yaRpp.mjs} +20 -19
- package/fesm2022/acorex-components-modal-modal-content.component-Co2yaRpp.mjs.map +1 -0
- package/fesm2022/acorex-components-modal.mjs +1 -1
- package/fesm2022/acorex-components-phone-box.mjs +31 -4
- package/fesm2022/acorex-components-phone-box.mjs.map +1 -1
- package/fesm2022/acorex-components-scheduler.mjs +947 -84
- package/fesm2022/acorex-components-scheduler.mjs.map +1 -1
- package/fesm2022/acorex-components-tabs.mjs +2 -2
- package/fesm2022/acorex-components-tabs.mjs.map +1 -1
- package/form/index.d.ts +10 -0
- package/grid-layout-builder/index.d.ts +115 -4
- package/menu/index.d.ts +12 -0
- package/modal/index.d.ts +3 -2
- package/package.json +1 -1
- package/scheduler/index.d.ts +363 -244
- package/fesm2022/acorex-components-modal-modal-content.component-DTrjX50k.mjs.map +0 -1
@@ -136,28 +136,35 @@ class AXGridLayoutWidgetComponent {
|
|
136
136
|
#eff;
|
137
137
|
/**
|
138
138
|
* Locks or unlocks the widget (prevents dragging and resizing).
|
139
|
-
*
|
139
|
+
*
|
140
|
+
* @param state - If true, the widget will be locked.
|
141
|
+
* @returns void - No return value. The widget lock state is updated.
|
140
142
|
*/
|
141
143
|
setLockable(state) {
|
142
144
|
this.updateWidgetOptions({ disableResize: state, disableDrag: state });
|
143
145
|
}
|
144
146
|
/**
|
145
147
|
* Enables or disables resizing of the widget.
|
146
|
-
*
|
148
|
+
*
|
149
|
+
* @param state - If true, resizing will be enabled.
|
150
|
+
* @returns void - No return value. The widget resize state is updated.
|
147
151
|
*/
|
148
152
|
setResizable(state) {
|
149
153
|
this.updateWidgetOptions({ disableResize: !state });
|
150
154
|
}
|
151
155
|
/**
|
152
156
|
* Updates the widget options.
|
157
|
+
*
|
153
158
|
* @param options - The new options for the widget.
|
159
|
+
* @returns void - No return value. The widget options are updated.
|
154
160
|
*/
|
155
161
|
setOptions(options) {
|
156
162
|
this.updateWidgetOptions(options);
|
157
163
|
}
|
158
164
|
/**
|
159
165
|
* Returns the current options of the widget.
|
160
|
-
*
|
166
|
+
*
|
167
|
+
* @returns AXGridLayoutNode - The current widget options.
|
161
168
|
*/
|
162
169
|
getOptions() {
|
163
170
|
const gridstackNode = this.elementRef.nativeElement.gridstackNode;
|
@@ -167,7 +174,8 @@ class AXGridLayoutWidgetComponent {
|
|
167
174
|
}
|
168
175
|
/**
|
169
176
|
* Returns the native DOM element of the widget.
|
170
|
-
*
|
177
|
+
*
|
178
|
+
* @returns AXGridLayoutWidgetElement - The native element.
|
171
179
|
*/
|
172
180
|
get element() {
|
173
181
|
return this.elementRef.nativeElement;
|
@@ -342,7 +350,13 @@ class AXGridLayoutContainerComponent extends NXComponent {
|
|
342
350
|
}
|
343
351
|
}
|
344
352
|
//#endregion
|
345
|
-
|
353
|
+
/**
|
354
|
+
* Adds a widget to the grid layout.
|
355
|
+
*
|
356
|
+
* @param w - Widget configuration object.
|
357
|
+
* @param withAutoArrange - Whether to compact the grid before adding the widget.
|
358
|
+
* @returns AXGridLayoutWidgetElement | undefined - The created widget element or undefined if failed.
|
359
|
+
*/
|
346
360
|
addWidget(w, withAutoArrange = false) {
|
347
361
|
if (withAutoArrange)
|
348
362
|
this.compact();
|
@@ -354,39 +368,119 @@ class AXGridLayoutContainerComponent extends NXComponent {
|
|
354
368
|
widgetElement.gridstackNode = removeUndefinedKeys(convertGridStackNodeToAXGridLayoutNode(node));
|
355
369
|
return widgetElement;
|
356
370
|
}
|
371
|
+
/**
|
372
|
+
* Compacts the grid layout.
|
373
|
+
*
|
374
|
+
* @param layout - Layout type for compacting ('list' or 'compact').
|
375
|
+
* @param doSort - Whether to sort items while compacting.
|
376
|
+
* @returns void - No return value. The grid layout is compacted.
|
377
|
+
*/
|
357
378
|
compact(layout = 'compact', doSort = true) {
|
358
379
|
this.grid?.compact(layout, doSort);
|
359
380
|
}
|
381
|
+
/**
|
382
|
+
* Sets the cell height of the grid.
|
383
|
+
*
|
384
|
+
* @param val - New cell height value.
|
385
|
+
* @param update - Whether to update the grid immediately.
|
386
|
+
* @returns void - No return value. The cell height is updated.
|
387
|
+
*/
|
360
388
|
setCellHeight(val, update = true) {
|
361
389
|
this.grid?.cellHeight(val, update);
|
362
390
|
}
|
391
|
+
/**
|
392
|
+
* Sets the number of columns in the grid.
|
393
|
+
*
|
394
|
+
* @param column - Number of columns.
|
395
|
+
* @param layout - Layout type for the change ('list', 'compact', 'moveScale', 'move', 'scale', or 'none').
|
396
|
+
* @returns void - No return value. The column count is updated.
|
397
|
+
*/
|
363
398
|
setColumn(column, layout = 'moveScale') {
|
364
399
|
this.grid?.column(column, layout);
|
365
400
|
}
|
401
|
+
/**
|
402
|
+
* Destroys the grid instance.
|
403
|
+
*
|
404
|
+
* @param removeDOM - Whether to remove DOM elements.
|
405
|
+
* @returns void - No return value. The grid instance is destroyed.
|
406
|
+
*/
|
366
407
|
destroy(removeDOM = true) {
|
367
408
|
this.grid?.destroy(removeDOM);
|
368
409
|
}
|
410
|
+
/**
|
411
|
+
* Enables or disables moving of widgets.
|
412
|
+
*
|
413
|
+
* @param state - Whether to enable moving.
|
414
|
+
* @param recurse - Whether to apply to all child widgets.
|
415
|
+
* @returns void - No return value. The move state is updated.
|
416
|
+
*/
|
369
417
|
setMovable(state, recurse) {
|
370
418
|
this.grid?.enableMove(state, recurse);
|
371
419
|
}
|
420
|
+
/**
|
421
|
+
* Enables or disables resizing of widgets.
|
422
|
+
*
|
423
|
+
* @param state - Whether to enable resizing.
|
424
|
+
* @param recurse - Whether to apply to all child widgets.
|
425
|
+
* @returns void - No return value. The resize state is updated.
|
426
|
+
*/
|
372
427
|
setResizable(state, recurse) {
|
373
428
|
this.grid?.enableResize(state, recurse);
|
374
429
|
}
|
430
|
+
/**
|
431
|
+
* Sets the float property of the grid.
|
432
|
+
*
|
433
|
+
* @param val - Whether to enable floating widgets.
|
434
|
+
* @returns void - No return value. The float state is updated.
|
435
|
+
*/
|
375
436
|
setFloat(val) {
|
376
437
|
this.grid?.float(val);
|
377
438
|
}
|
439
|
+
/**
|
440
|
+
* Sets the margin between grid items.
|
441
|
+
*
|
442
|
+
* @param value - Margin value (number in pixels or string with units).
|
443
|
+
* @returns void - No return value. The margin is updated.
|
444
|
+
*/
|
378
445
|
setMargin(value) {
|
379
446
|
this.grid?.margin(value);
|
380
447
|
}
|
448
|
+
/**
|
449
|
+
* Removes a specific widget from the grid.
|
450
|
+
*
|
451
|
+
* @param el - The widget element to remove.
|
452
|
+
* @param removeDOM - Whether to remove the DOM element.
|
453
|
+
* @param triggerEvent - Whether to trigger removal events.
|
454
|
+
* @returns void - No return value. The widget is removed.
|
455
|
+
*/
|
381
456
|
removeWidget(el, removeDOM = true, triggerEvent = true) {
|
382
457
|
this.grid?.removeWidget(el, removeDOM, triggerEvent);
|
383
458
|
}
|
459
|
+
/**
|
460
|
+
* Removes all widgets from the grid.
|
461
|
+
*
|
462
|
+
* @param removeDOM - Whether to remove DOM elements.
|
463
|
+
* @returns void - No return value. All widgets are removed.
|
464
|
+
*/
|
384
465
|
removeAll(removeDOM = true) {
|
385
466
|
this.grid?.removeAll(removeDOM);
|
386
467
|
}
|
468
|
+
/**
|
469
|
+
* Sets the animation state for the grid.
|
470
|
+
*
|
471
|
+
* @param doAnimate - Whether to enable animations.
|
472
|
+
* @returns void - No return value. The animation state is updated.
|
473
|
+
*/
|
387
474
|
setAnimation(doAnimate) {
|
388
475
|
this.grid?.setAnimation(doAnimate);
|
389
476
|
}
|
477
|
+
/**
|
478
|
+
* Sets up draggable functionality for external elements.
|
479
|
+
*
|
480
|
+
* @param dragIn - CSS selector string or array of HTML elements to make draggable.
|
481
|
+
* @param widgets - Optional widget configuration for dragged items.
|
482
|
+
* @returns Promise<void> - Promise that resolves when drag setup is complete.
|
483
|
+
*/
|
390
484
|
async setupDraggable(dragIn, widgets) {
|
391
485
|
if (typeof dragIn === 'string') {
|
392
486
|
document.querySelectorAll(dragIn).forEach((item) => {
|
@@ -401,16 +495,32 @@ class AXGridLayoutContainerComponent extends NXComponent {
|
|
401
495
|
: undefined;
|
402
496
|
GridStack.setupDragIn(dragIn, undefined, gridStackWidgets);
|
403
497
|
}
|
498
|
+
/**
|
499
|
+
* Gets the current grid options.
|
500
|
+
*
|
501
|
+
* @returns AXGridLayoutOptions - Current grid configuration options.
|
502
|
+
*/
|
404
503
|
getOptions() {
|
405
504
|
const opts = this.grid?.opts;
|
406
505
|
if (!opts)
|
407
506
|
return {};
|
408
507
|
return removeUndefinedKeys(convertGridStackOptionsToAXGridLayoutOptions(opts));
|
409
508
|
}
|
509
|
+
/**
|
510
|
+
* Gets all child widgets in the grid.
|
511
|
+
*
|
512
|
+
* @returns AXGridLayoutNode[] - Array of all child widget nodes.
|
513
|
+
*/
|
410
514
|
getChildren() {
|
411
515
|
const children = this.grid?.engine.nodes ?? [];
|
412
516
|
return children.map((node) => removeUndefinedKeys(convertGridStackNodeToAXGridLayoutNode(node)));
|
413
517
|
}
|
518
|
+
/**
|
519
|
+
* Finds an empty space in the grid for a widget.
|
520
|
+
*
|
521
|
+
* @param input - Dimensions of the widget with height and width.
|
522
|
+
* @returns { x: number; y: number } - Object containing x and y coordinates of empty space.
|
523
|
+
*/
|
414
524
|
findEmptySpace(input) {
|
415
525
|
const value = { h: input.height, w: input.height };
|
416
526
|
this.grid?.engine.findEmptyPosition(value);
|