@vuu-ui/vuu-table-extras 0.8.23-debug → 0.8.24-debug
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/cjs/index.js +437 -408
- package/cjs/index.js.map +4 -4
- package/esm/index.js +424 -393
- package/esm/index.js.map +4 -4
- package/index.css +31 -7
- package/index.css.map +3 -3
- package/package.json +13 -13
- package/types/cell-renderers/index.d.ts +1 -0
- package/types/cell-renderers/pct-progress-cell/PctProgressCell.d.ts +4 -0
- package/types/cell-renderers/pct-progress-cell/index.d.ts +1 -0
- package/types/column-expression-panel/ColumnExpressionPanel.d.ts +3 -1
- package/types/column-expression-panel/useColumnExpression.d.ts +3 -3
- package/types/column-formatting-settings/BaseNumericFormattingSettings.d.ts +1 -1
- package/types/column-formatting-settings/ColumnFormattingPanel.d.ts +2 -3
- package/types/column-formatting-settings/DateTimeFormattingSettings.d.ts +1 -2
- package/types/column-formatting-settings/LongTypeFormattingSettings.d.ts +3 -3
- package/types/column-settings/useColumnSettings.d.ts +3 -0
- package/types/table-settings/useTableSettings.d.ts +2 -0
- package/types/column-formatting-settings/types.d.ts +0 -6
package/cjs/index.js
CHANGED
|
@@ -63,6 +63,7 @@ __export(src_exports, {
|
|
|
63
63
|
DropdownCell: () => DropdownCell,
|
|
64
64
|
LookupCell: () => LookupCell,
|
|
65
65
|
PatternValidator: () => PatternValidator,
|
|
66
|
+
PctProgressCell: () => PctProgressCell,
|
|
66
67
|
TableSettingsPanel: () => TableSettingsPanel,
|
|
67
68
|
columnExpressionLanguageSupport: () => columnExpressionLanguageSupport,
|
|
68
69
|
isCompleteExpression: () => isCompleteExpression,
|
|
@@ -266,12 +267,15 @@ var DropdownCell = (0, import_react4.memo)(
|
|
|
266
267
|
row
|
|
267
268
|
}) {
|
|
268
269
|
const dataIdx = columnMap[column.name];
|
|
269
|
-
const
|
|
270
|
-
const
|
|
270
|
+
const dataValue = row[dataIdx];
|
|
271
|
+
const { values } = (0, import_vuu_data_react.useLookupValues)(column, dataValue);
|
|
272
|
+
const valueRef = (0, import_react4.useRef)(null);
|
|
273
|
+
(0, import_react4.useMemo)(() => {
|
|
274
|
+
valueRef.current = (0, import_vuu_data_react.getSelectedOption)(values, dataValue);
|
|
275
|
+
}, [dataValue, values]);
|
|
271
276
|
const handleSelectionChange = (0, import_react4.useCallback)(
|
|
272
277
|
(evt, selectedOption) => {
|
|
273
278
|
if (selectedOption) {
|
|
274
|
-
setValue(selectedOption);
|
|
275
279
|
onCommit(selectedOption.value).then((response) => {
|
|
276
280
|
if (response === true && evt) {
|
|
277
281
|
(0, import_vuu_utils6.dispatchCustomEvent)(evt.target, "vuu-commit");
|
|
@@ -287,15 +291,17 @@ var DropdownCell = (0, import_react4.memo)(
|
|
|
287
291
|
className: classBase3,
|
|
288
292
|
onSelectionChange: handleSelectionChange,
|
|
289
293
|
openKeys,
|
|
290
|
-
selected:
|
|
294
|
+
selected: valueRef.current,
|
|
291
295
|
source: values,
|
|
292
296
|
width: column.width - 17
|
|
293
297
|
}
|
|
294
298
|
);
|
|
295
299
|
},
|
|
296
|
-
import_vuu_utils6.
|
|
300
|
+
import_vuu_utils6.dataColumnAndKeyUnchanged
|
|
297
301
|
);
|
|
298
|
-
(0, import_vuu_utils6.registerComponent)("dropdown-cell", DropdownCell, "cell-renderer", {
|
|
302
|
+
(0, import_vuu_utils6.registerComponent)("dropdown-cell", DropdownCell, "cell-renderer", {
|
|
303
|
+
userCanAssign: false
|
|
304
|
+
});
|
|
299
305
|
|
|
300
306
|
// src/cell-renderers/lookup-cell/LookupCell.tsx
|
|
301
307
|
var import_vuu_data_react2 = require("@vuu-ui/vuu-data-react");
|
|
@@ -309,28 +315,80 @@ var LookupCell = (0, import_react5.memo)(
|
|
|
309
315
|
row
|
|
310
316
|
}) {
|
|
311
317
|
const dataIdx = columnMap[column.name];
|
|
312
|
-
const
|
|
318
|
+
const dataValue = row[dataIdx];
|
|
319
|
+
const { initialValue: value } = (0, import_vuu_data_react2.useLookupValues)(column, dataValue);
|
|
313
320
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: value == null ? void 0 : value.label });
|
|
314
321
|
},
|
|
315
322
|
import_vuu_utils7.dataAndColumnUnchanged
|
|
316
323
|
);
|
|
317
|
-
(0, import_vuu_utils7.registerComponent)("lookup-cell", LookupCell, "cell-renderer", {
|
|
324
|
+
(0, import_vuu_utils7.registerComponent)("lookup-cell", LookupCell, "cell-renderer", {
|
|
325
|
+
userCanAssign: false
|
|
326
|
+
});
|
|
318
327
|
|
|
319
|
-
// src/cell-renderers/progress-cell/
|
|
328
|
+
// src/cell-renderers/pct-progress-cell/PctProgressCell.tsx
|
|
320
329
|
var import_vuu_utils8 = require("@vuu-ui/vuu-utils");
|
|
321
330
|
var import_clsx2 = __toESM(require("clsx"), 1);
|
|
322
331
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
323
|
-
var classBase4 = "
|
|
332
|
+
var classBase4 = "vuuPctProgressCell";
|
|
333
|
+
var getPercentageValue = (value) => {
|
|
334
|
+
if (value >= 0 && value <= 1) {
|
|
335
|
+
return value * 100;
|
|
336
|
+
} else if (value > 2) {
|
|
337
|
+
return 0;
|
|
338
|
+
} else if (value > 1) {
|
|
339
|
+
return 100;
|
|
340
|
+
} else {
|
|
341
|
+
return 0;
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
var PctProgressCell = ({ column, columnMap, row }) => {
|
|
345
|
+
const value = row[columnMap[column.name]];
|
|
346
|
+
const percentageValue = getPercentageValue(value);
|
|
347
|
+
const className = (0, import_clsx2.default)(classBase4, {});
|
|
348
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
349
|
+
"div",
|
|
350
|
+
{
|
|
351
|
+
className: (0, import_clsx2.default)(className, {
|
|
352
|
+
[`${classBase4}-zero`]: percentageValue === 0,
|
|
353
|
+
[`${classBase4}-complete`]: percentageValue >= 100
|
|
354
|
+
}),
|
|
355
|
+
tabIndex: -1,
|
|
356
|
+
children: [
|
|
357
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
358
|
+
"span",
|
|
359
|
+
{
|
|
360
|
+
className: `${classBase4}-progressBar`,
|
|
361
|
+
style: { "--progress-bar-pct": `${percentageValue}%` }
|
|
362
|
+
}
|
|
363
|
+
),
|
|
364
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: `${classBase4}-text`, children: `${percentageValue.toFixed(
|
|
365
|
+
2
|
|
366
|
+
)} %` })
|
|
367
|
+
]
|
|
368
|
+
}
|
|
369
|
+
);
|
|
370
|
+
};
|
|
371
|
+
(0, import_vuu_utils8.registerComponent)("vuu.pct-progress", PctProgressCell, "cell-renderer", {
|
|
372
|
+
description: "Percentage formatter",
|
|
373
|
+
label: "Percentage formatter",
|
|
374
|
+
serverDataType: "double"
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
// src/cell-renderers/progress-cell/ProgressCell.tsx
|
|
378
|
+
var import_vuu_utils9 = require("@vuu-ui/vuu-utils");
|
|
379
|
+
var import_clsx3 = __toESM(require("clsx"), 1);
|
|
380
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
381
|
+
var classBase5 = "vuuProgressCell";
|
|
324
382
|
var ProgressCell = ({ column, columnMap, row }) => {
|
|
325
383
|
const { name: name2, type } = column;
|
|
326
384
|
const value = row[columnMap[name2]];
|
|
327
385
|
let showProgress = false;
|
|
328
386
|
let percentage = 0;
|
|
329
|
-
if ((0,
|
|
387
|
+
if ((0, import_vuu_utils9.isTypeDescriptor)(type) && (0, import_vuu_utils9.isColumnTypeRenderer)(type.renderer)) {
|
|
330
388
|
const { associatedField } = type.renderer;
|
|
331
389
|
if (associatedField) {
|
|
332
390
|
const associatedValue = row[columnMap[associatedField]];
|
|
333
|
-
if (
|
|
391
|
+
if ((0, import_vuu_utils9.isValidNumber)(value) && (0, import_vuu_utils9.isValidNumber)(associatedValue)) {
|
|
334
392
|
percentage = Math.min(Math.round(value / associatedValue * 100), 100);
|
|
335
393
|
percentage = Math.min(Math.round(value / associatedValue * 100), 100);
|
|
336
394
|
showProgress = isFinite(percentage);
|
|
@@ -351,55 +409,57 @@ var ProgressCell = ({ column, columnMap, row }) => {
|
|
|
351
409
|
throw Error("ProgressCell associatedField is required to render");
|
|
352
410
|
}
|
|
353
411
|
}
|
|
354
|
-
const className = (0,
|
|
355
|
-
return /* @__PURE__ */ (0,
|
|
356
|
-
showProgress ? /* @__PURE__ */ (0,
|
|
357
|
-
/* @__PURE__ */ (0,
|
|
358
|
-
/* @__PURE__ */ (0,
|
|
412
|
+
const className = (0, import_clsx3.default)(classBase5, {});
|
|
413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className, tabIndex: -1, children: [
|
|
414
|
+
showProgress ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: `${classBase5}-track`, children: [
|
|
415
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: `${classBase5}-bg` }),
|
|
416
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
359
417
|
"span",
|
|
360
418
|
{
|
|
361
|
-
className: `${
|
|
419
|
+
className: `${classBase5}-bar`,
|
|
362
420
|
style: { "--progress-bar-pct": `-${100 - percentage}%` }
|
|
363
421
|
}
|
|
364
422
|
)
|
|
365
423
|
] }) : null,
|
|
366
|
-
/* @__PURE__ */ (0,
|
|
424
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: `${classBase5}-text`, children: `${percentage} %` })
|
|
367
425
|
] });
|
|
368
426
|
};
|
|
369
|
-
(0,
|
|
427
|
+
(0, import_vuu_utils9.registerComponent)("vuu.progress", ProgressCell, "cell-renderer", {
|
|
370
428
|
description: "Progress formatter",
|
|
371
429
|
label: "Progress formatter",
|
|
372
|
-
serverDataType: ["long", "int", "double"]
|
|
430
|
+
serverDataType: ["long", "int", "double"],
|
|
431
|
+
// Not until we provide settings for associaetd field
|
|
432
|
+
userCanAssign: false
|
|
373
433
|
});
|
|
374
434
|
|
|
375
435
|
// src/column-list/ColumnList.tsx
|
|
376
436
|
var import_vuu_ui_controls3 = require("@vuu-ui/vuu-ui-controls");
|
|
377
437
|
var import_core2 = require("@salt-ds/core");
|
|
378
|
-
var
|
|
438
|
+
var import_clsx4 = __toESM(require("clsx"), 1);
|
|
379
439
|
var import_react6 = require("react");
|
|
380
|
-
var
|
|
381
|
-
var
|
|
382
|
-
var
|
|
440
|
+
var import_vuu_utils10 = require("@vuu-ui/vuu-utils");
|
|
441
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
442
|
+
var classBase6 = "vuuColumnList";
|
|
383
443
|
var classBaseListItem = "vuuColumnListItem";
|
|
384
444
|
var ColumnListItem = ({
|
|
385
445
|
className: classNameProp,
|
|
386
446
|
item,
|
|
387
447
|
...listItemProps
|
|
388
448
|
}) => {
|
|
389
|
-
return /* @__PURE__ */ (0,
|
|
449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
390
450
|
import_vuu_ui_controls3.ListItem,
|
|
391
451
|
{
|
|
392
452
|
...listItemProps,
|
|
393
|
-
className: (0,
|
|
453
|
+
className: (0, import_clsx4.default)(classNameProp, classBaseListItem),
|
|
394
454
|
"data-name": item == null ? void 0 : item.name,
|
|
395
455
|
children: [
|
|
396
|
-
/* @__PURE__ */ (0,
|
|
397
|
-
(item == null ? void 0 : item.isCalculated) ? /* @__PURE__ */ (0,
|
|
398
|
-
/* @__PURE__ */ (0,
|
|
399
|
-
/* @__PURE__ */ (0,
|
|
456
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: `${classBase6}-icon`, "data-icon": "draggable" }),
|
|
457
|
+
(item == null ? void 0 : item.isCalculated) ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: `${classBase6}-icon`, "data-icon": "function" }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_core2.Switch, { className: `${classBase6}-switch`, checked: item == null ? void 0 : item.subscribed }),
|
|
458
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: `${classBase6}-text`, children: (0, import_vuu_utils10.getColumnLabel)(item) }),
|
|
459
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
400
460
|
import_core2.Checkbox,
|
|
401
461
|
{
|
|
402
|
-
className: `${
|
|
462
|
+
className: `${classBase6}-checkBox`,
|
|
403
463
|
checked: (item == null ? void 0 : item.hidden) !== true,
|
|
404
464
|
disabled: (item == null ? void 0 : item.subscribed) !== true
|
|
405
465
|
}
|
|
@@ -423,9 +483,9 @@ var ColumnList = ({
|
|
|
423
483
|
dataset: { name: name2 }
|
|
424
484
|
} = listItem;
|
|
425
485
|
if (name2) {
|
|
426
|
-
const saltSwitch = input.closest(`.${
|
|
486
|
+
const saltSwitch = input.closest(`.${classBase6}-switch`);
|
|
427
487
|
const saltCheckbox = input.closest(
|
|
428
|
-
`.${
|
|
488
|
+
`.${classBase6}-checkBox`
|
|
429
489
|
);
|
|
430
490
|
if (saltSwitch) {
|
|
431
491
|
onChange(name2, "subscribed", input.checked);
|
|
@@ -445,13 +505,13 @@ var ColumnList = ({
|
|
|
445
505
|
}
|
|
446
506
|
}
|
|
447
507
|
}, []);
|
|
448
|
-
return /* @__PURE__ */ (0,
|
|
449
|
-
/* @__PURE__ */ (0,
|
|
450
|
-
/* @__PURE__ */ (0,
|
|
451
|
-
/* @__PURE__ */ (0,
|
|
452
|
-
/* @__PURE__ */ (0,
|
|
508
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { ...htmlAttributes, className: classBase6, children: [
|
|
509
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: `${classBase6}-header`, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: "Column Selection" }) }),
|
|
510
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: `${classBase6}-colHeadings`, children: [
|
|
511
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: "Column subscription" }),
|
|
512
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: "Visibility" })
|
|
453
513
|
] }),
|
|
454
|
-
/* @__PURE__ */ (0,
|
|
514
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
455
515
|
import_vuu_ui_controls3.List,
|
|
456
516
|
{
|
|
457
517
|
ListItem: ColumnListItem,
|
|
@@ -470,13 +530,13 @@ var ColumnList = ({
|
|
|
470
530
|
|
|
471
531
|
// src/column-settings/ColumnSettingsPanel.tsx
|
|
472
532
|
var import_vuu_ui_controls7 = require("@vuu-ui/vuu-ui-controls");
|
|
473
|
-
var
|
|
533
|
+
var import_vuu_utils22 = require("@vuu-ui/vuu-utils");
|
|
474
534
|
var import_core8 = require("@salt-ds/core");
|
|
475
|
-
var
|
|
535
|
+
var import_clsx7 = __toESM(require("clsx"), 1);
|
|
476
536
|
|
|
477
537
|
// src/column-expression-panel/ColumnExpressionPanel.tsx
|
|
478
538
|
var import_vuu_ui_controls4 = require("@vuu-ui/vuu-ui-controls");
|
|
479
|
-
var
|
|
539
|
+
var import_vuu_utils15 = require("@vuu-ui/vuu-utils");
|
|
480
540
|
var import_core3 = require("@salt-ds/core");
|
|
481
541
|
var import_react12 = require("react");
|
|
482
542
|
|
|
@@ -485,7 +545,7 @@ var import_react9 = require("react");
|
|
|
485
545
|
|
|
486
546
|
// src/column-expression-input/useColumnExpressionEditor.ts
|
|
487
547
|
var import_vuu_codemirror5 = require("@vuu-ui/vuu-codemirror");
|
|
488
|
-
var
|
|
548
|
+
var import_vuu_utils11 = require("@vuu-ui/vuu-utils");
|
|
489
549
|
var import_react8 = require("react");
|
|
490
550
|
|
|
491
551
|
// src/column-expression-input/column-language-parser/ColumnExpressionLanguage.ts
|
|
@@ -1491,8 +1551,8 @@ var noop = () => console.log("noooop");
|
|
|
1491
1551
|
var hasExpressionType = (completion) => "expressionType" in completion;
|
|
1492
1552
|
var injectOptionContent = (completion) => {
|
|
1493
1553
|
if (hasExpressionType(completion)) {
|
|
1494
|
-
const div = (0,
|
|
1495
|
-
const span = (0,
|
|
1554
|
+
const div = (0, import_vuu_utils11.createEl)("div", "expression-type-container");
|
|
1555
|
+
const span = (0, import_vuu_utils11.createEl)("span", "expression-type", completion.expressionType);
|
|
1496
1556
|
div.appendChild(span);
|
|
1497
1557
|
return div;
|
|
1498
1558
|
} else {
|
|
@@ -1597,8 +1657,8 @@ var useColumnExpressionEditor = ({
|
|
|
1597
1657
|
};
|
|
1598
1658
|
|
|
1599
1659
|
// src/column-expression-input/ColumnExpressionInput.tsx
|
|
1600
|
-
var
|
|
1601
|
-
var
|
|
1660
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1661
|
+
var classBase7 = "vuuColumnExpressionInput";
|
|
1602
1662
|
var ColumnExpressionInput = (0, import_react9.memo)(
|
|
1603
1663
|
({
|
|
1604
1664
|
onChange,
|
|
@@ -1612,7 +1672,7 @@ var ColumnExpressionInput = (0, import_react9.memo)(
|
|
|
1612
1672
|
source,
|
|
1613
1673
|
suggestionProvider
|
|
1614
1674
|
});
|
|
1615
|
-
return /* @__PURE__ */ (0,
|
|
1675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: `${classBase7}`, onBlur, ref: editorRef });
|
|
1616
1676
|
},
|
|
1617
1677
|
(prevProps, newProps) => {
|
|
1618
1678
|
return prevProps.source === newProps.source;
|
|
@@ -1623,7 +1683,7 @@ ColumnExpressionInput.displayName = "ColumnExpressionInput";
|
|
|
1623
1683
|
// src/column-expression-input/useColumnExpressionSuggestionProvider.ts
|
|
1624
1684
|
var import_vuu_codemirror6 = require("@vuu-ui/vuu-codemirror");
|
|
1625
1685
|
var import_vuu_data_react3 = require("@vuu-ui/vuu-data-react");
|
|
1626
|
-
var
|
|
1686
|
+
var import_vuu_utils13 = require("@vuu-ui/vuu-utils");
|
|
1627
1687
|
var import_react10 = require("react");
|
|
1628
1688
|
|
|
1629
1689
|
// src/column-expression-input/column-function-descriptors.ts
|
|
@@ -1931,7 +1991,7 @@ var columnFunctionDescriptors = [
|
|
|
1931
1991
|
];
|
|
1932
1992
|
|
|
1933
1993
|
// src/column-expression-input/functionDocInfo.ts
|
|
1934
|
-
var
|
|
1994
|
+
var import_vuu_utils12 = require("@vuu-ui/vuu-utils");
|
|
1935
1995
|
var functionDocInfo = ({
|
|
1936
1996
|
name: name2,
|
|
1937
1997
|
description,
|
|
@@ -1939,25 +1999,25 @@ var functionDocInfo = ({
|
|
|
1939
1999
|
params,
|
|
1940
2000
|
type
|
|
1941
2001
|
}) => {
|
|
1942
|
-
const rootElement = (0,
|
|
1943
|
-
const headingElement = (0,
|
|
1944
|
-
const nameElement = (0,
|
|
1945
|
-
const paramElement = (0,
|
|
1946
|
-
const typeElement = (0,
|
|
2002
|
+
const rootElement = (0, import_vuu_utils12.createEl)("div", "vuuFunctionDoc");
|
|
2003
|
+
const headingElement = (0, import_vuu_utils12.createEl)("div", "function-heading");
|
|
2004
|
+
const nameElement = (0, import_vuu_utils12.createEl)("span", "function-name", name2);
|
|
2005
|
+
const paramElement = (0, import_vuu_utils12.createEl)("span", "param-list", params.description);
|
|
2006
|
+
const typeElement = (0, import_vuu_utils12.createEl)("span", "function-type", type);
|
|
1947
2007
|
headingElement.appendChild(nameElement);
|
|
1948
2008
|
headingElement.appendChild(paramElement);
|
|
1949
2009
|
headingElement.appendChild(typeElement);
|
|
1950
|
-
const child2 = (0,
|
|
2010
|
+
const child2 = (0, import_vuu_utils12.createEl)("p", void 0, description);
|
|
1951
2011
|
rootElement.appendChild(headingElement);
|
|
1952
2012
|
rootElement.appendChild(child2);
|
|
1953
2013
|
if (example) {
|
|
1954
|
-
const exampleElement = (0,
|
|
1955
|
-
const expressionElement = (0,
|
|
2014
|
+
const exampleElement = (0, import_vuu_utils12.createEl)("div", "example-container");
|
|
2015
|
+
const expressionElement = (0, import_vuu_utils12.createEl)(
|
|
1956
2016
|
"div",
|
|
1957
2017
|
"example-expression",
|
|
1958
2018
|
example.expression
|
|
1959
2019
|
);
|
|
1960
|
-
const resultElement = (0,
|
|
2020
|
+
const resultElement = (0, import_vuu_utils12.createEl)("div", "example-result", example.result);
|
|
1961
2021
|
exampleElement.appendChild(expressionElement);
|
|
1962
2022
|
rootElement.appendChild(exampleElement);
|
|
1963
2023
|
rootElement.appendChild(resultElement);
|
|
@@ -1976,15 +2036,15 @@ var withApplySpace = (suggestions) => suggestions.map((suggestion) => {
|
|
|
1976
2036
|
});
|
|
1977
2037
|
var getValidColumns = (columns, { functionName, operator }) => {
|
|
1978
2038
|
if (operator) {
|
|
1979
|
-
return columns.filter(
|
|
2039
|
+
return columns.filter(import_vuu_utils13.isNumericColumn);
|
|
1980
2040
|
} else if (functionName) {
|
|
1981
2041
|
const fn = columnFunctionDescriptors.find((f) => f.name === functionName);
|
|
1982
2042
|
if (fn) {
|
|
1983
2043
|
switch (fn.accepts) {
|
|
1984
2044
|
case "string":
|
|
1985
|
-
return columns.filter(
|
|
2045
|
+
return columns.filter(import_vuu_utils13.isTextColumn);
|
|
1986
2046
|
case "number":
|
|
1987
|
-
return columns.filter(
|
|
2047
|
+
return columns.filter(import_vuu_utils13.isNumericColumn);
|
|
1988
2048
|
default:
|
|
1989
2049
|
return columns;
|
|
1990
2050
|
}
|
|
@@ -2013,7 +2073,7 @@ var arithmeticOperators = [
|
|
|
2013
2073
|
{ apply: "- ", boost: 2, label: "-", type: "operator" }
|
|
2014
2074
|
];
|
|
2015
2075
|
var getOperators = (column) => {
|
|
2016
|
-
if (column === void 0 || (0,
|
|
2076
|
+
if (column === void 0 || (0, import_vuu_utils13.isNumericColumn)(column)) {
|
|
2017
2077
|
return arithmeticOperators;
|
|
2018
2078
|
} else {
|
|
2019
2079
|
return NO_OPERATORS;
|
|
@@ -2173,10 +2233,10 @@ var useColumnExpressionSuggestionProvider = ({
|
|
|
2173
2233
|
};
|
|
2174
2234
|
|
|
2175
2235
|
// src/column-expression-panel/useColumnExpression.ts
|
|
2176
|
-
var
|
|
2236
|
+
var import_vuu_utils14 = require("@vuu-ui/vuu-utils");
|
|
2177
2237
|
var import_react11 = require("react");
|
|
2178
2238
|
var applyDefaults = (column) => {
|
|
2179
|
-
const [name2, expression, type] = (0,
|
|
2239
|
+
const [name2, expression, type] = (0, import_vuu_utils14.getCalculatedColumnDetails)(column);
|
|
2180
2240
|
if (type === "") {
|
|
2181
2241
|
return {
|
|
2182
2242
|
...column,
|
|
@@ -2188,7 +2248,8 @@ var applyDefaults = (column) => {
|
|
|
2188
2248
|
};
|
|
2189
2249
|
var useColumnExpression = ({
|
|
2190
2250
|
column: columnProp,
|
|
2191
|
-
onChangeName: onChangeNameProp
|
|
2251
|
+
onChangeName: onChangeNameProp,
|
|
2252
|
+
onChangeServerDataType: onChangeServerDataTypeProp
|
|
2192
2253
|
}) => {
|
|
2193
2254
|
const [column, _setColumn] = (0, import_react11.useState)(
|
|
2194
2255
|
applyDefaults(columnProp)
|
|
@@ -2201,7 +2262,7 @@ var useColumnExpression = ({
|
|
|
2201
2262
|
const onChangeName = (0, import_react11.useCallback)(
|
|
2202
2263
|
(evt) => {
|
|
2203
2264
|
const { value } = evt.target;
|
|
2204
|
-
const newColumn = (0,
|
|
2265
|
+
const newColumn = (0, import_vuu_utils14.setCalculatedColumnName)(column, value);
|
|
2205
2266
|
setColumn(newColumn);
|
|
2206
2267
|
onChangeNameProp == null ? void 0 : onChangeNameProp(newColumn.name);
|
|
2207
2268
|
},
|
|
@@ -2211,46 +2272,49 @@ var useColumnExpression = ({
|
|
|
2211
2272
|
(value) => {
|
|
2212
2273
|
const expression = value.trim();
|
|
2213
2274
|
const { current: column2 } = columnRef;
|
|
2214
|
-
const newColumn = (0,
|
|
2275
|
+
const newColumn = (0, import_vuu_utils14.setCalculatedColumnExpression)(column2, expression);
|
|
2215
2276
|
setColumn(newColumn);
|
|
2216
2277
|
onChangeNameProp == null ? void 0 : onChangeNameProp(newColumn.name);
|
|
2217
2278
|
},
|
|
2218
2279
|
[onChangeNameProp, setColumn]
|
|
2219
2280
|
);
|
|
2220
|
-
const
|
|
2281
|
+
const onChangeServerDataType = (0, import_react11.useCallback)(
|
|
2221
2282
|
(evt, value) => {
|
|
2222
|
-
if (
|
|
2223
|
-
const newColumn = (0,
|
|
2283
|
+
if ((0, import_vuu_utils14.isVuuColumnDataType)(value)) {
|
|
2284
|
+
const newColumn = (0, import_vuu_utils14.setCalculatedColumnType)(column, value);
|
|
2224
2285
|
setColumn(newColumn);
|
|
2225
2286
|
onChangeNameProp == null ? void 0 : onChangeNameProp(newColumn.name);
|
|
2287
|
+
onChangeServerDataTypeProp == null ? void 0 : onChangeServerDataTypeProp(value);
|
|
2226
2288
|
}
|
|
2227
2289
|
},
|
|
2228
|
-
[column, onChangeNameProp, setColumn]
|
|
2290
|
+
[column, onChangeNameProp, onChangeServerDataTypeProp, setColumn]
|
|
2229
2291
|
);
|
|
2230
2292
|
return {
|
|
2231
2293
|
column,
|
|
2232
2294
|
onChangeExpression,
|
|
2233
2295
|
onChangeName,
|
|
2234
|
-
|
|
2296
|
+
onChangeServerDataType
|
|
2235
2297
|
};
|
|
2236
2298
|
};
|
|
2237
2299
|
|
|
2238
2300
|
// src/column-expression-panel/ColumnExpressionPanel.tsx
|
|
2239
|
-
var
|
|
2240
|
-
var
|
|
2301
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2302
|
+
var classBase8 = "vuuColumnExpressionPanel";
|
|
2241
2303
|
var ColumnExpressionPanel = ({
|
|
2242
2304
|
column: columnProp,
|
|
2243
2305
|
onChangeName: onChangeNameProp,
|
|
2306
|
+
onChangeServerDataType: onChangeServerDataTypeProp,
|
|
2244
2307
|
tableConfig,
|
|
2245
2308
|
vuuTable
|
|
2246
2309
|
}) => {
|
|
2247
2310
|
const typeRef = (0, import_react12.useRef)(null);
|
|
2248
|
-
const { column, onChangeExpression, onChangeName,
|
|
2311
|
+
const { column, onChangeExpression, onChangeName, onChangeServerDataType } = useColumnExpression({
|
|
2249
2312
|
column: columnProp,
|
|
2250
|
-
onChangeName: onChangeNameProp
|
|
2313
|
+
onChangeName: onChangeNameProp,
|
|
2314
|
+
onChangeServerDataType: onChangeServerDataTypeProp
|
|
2251
2315
|
});
|
|
2252
2316
|
const initialExpressionRef = (0, import_react12.useRef)(
|
|
2253
|
-
(0,
|
|
2317
|
+
(0, import_vuu_utils15.getCalculatedColumnExpression)(column)
|
|
2254
2318
|
);
|
|
2255
2319
|
const suggestionProvider = useColumnExpressionSuggestionProvider({
|
|
2256
2320
|
columns: tableConfig.columns,
|
|
@@ -2262,22 +2326,22 @@ var ColumnExpressionPanel = ({
|
|
|
2262
2326
|
(_b = (_a = typeRef.current) == null ? void 0 : _a.querySelector("button")) == null ? void 0 : _b.focus();
|
|
2263
2327
|
}
|
|
2264
2328
|
}, []);
|
|
2265
|
-
return /* @__PURE__ */ (0,
|
|
2266
|
-
/* @__PURE__ */ (0,
|
|
2267
|
-
/* @__PURE__ */ (0,
|
|
2268
|
-
/* @__PURE__ */ (0,
|
|
2269
|
-
/* @__PURE__ */ (0,
|
|
2329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: classBase8, children: [
|
|
2330
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "vuuColumnSettingsPanel-header", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: "Calculation" }) }),
|
|
2331
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core3.FormField, { "data-field": "column-name", children: [
|
|
2332
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core3.FormFieldLabel, { children: "Column Name" }),
|
|
2333
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2270
2334
|
import_core3.Input,
|
|
2271
2335
|
{
|
|
2272
2336
|
className: "vuuInput",
|
|
2273
2337
|
onChange: onChangeName,
|
|
2274
|
-
value: (0,
|
|
2338
|
+
value: (0, import_vuu_utils15.getCalculatedColumnName)(column)
|
|
2275
2339
|
}
|
|
2276
2340
|
)
|
|
2277
2341
|
] }),
|
|
2278
|
-
/* @__PURE__ */ (0,
|
|
2279
|
-
/* @__PURE__ */ (0,
|
|
2280
|
-
/* @__PURE__ */ (0,
|
|
2342
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core3.FormField, { "data-field": "column-expression", children: [
|
|
2343
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core3.FormFieldLabel, { children: "Expression" }),
|
|
2344
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2281
2345
|
ColumnExpressionInput,
|
|
2282
2346
|
{
|
|
2283
2347
|
onChange: onChangeExpression,
|
|
@@ -2287,16 +2351,16 @@ var ColumnExpressionPanel = ({
|
|
|
2287
2351
|
}
|
|
2288
2352
|
)
|
|
2289
2353
|
] }),
|
|
2290
|
-
/* @__PURE__ */ (0,
|
|
2291
|
-
/* @__PURE__ */ (0,
|
|
2292
|
-
/* @__PURE__ */ (0,
|
|
2354
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core3.FormField, { "data-field": "type", children: [
|
|
2355
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core3.FormFieldLabel, { children: "Column type" }),
|
|
2356
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2293
2357
|
import_vuu_ui_controls4.Dropdown,
|
|
2294
2358
|
{
|
|
2295
|
-
className: `${
|
|
2296
|
-
onSelectionChange:
|
|
2359
|
+
className: `${classBase8}-type`,
|
|
2360
|
+
onSelectionChange: onChangeServerDataType,
|
|
2297
2361
|
ref: typeRef,
|
|
2298
|
-
selected: (0,
|
|
2299
|
-
source: ["double", "long", "string"],
|
|
2362
|
+
selected: (0, import_vuu_utils15.getCalculatedColumnType)(column) || null,
|
|
2363
|
+
source: ["double", "long", "string", "boolean"],
|
|
2300
2364
|
width: "100%"
|
|
2301
2365
|
}
|
|
2302
2366
|
)
|
|
@@ -2306,23 +2370,23 @@ var ColumnExpressionPanel = ({
|
|
|
2306
2370
|
|
|
2307
2371
|
// src/column-formatting-settings/ColumnFormattingPanel.tsx
|
|
2308
2372
|
var import_vuu_ui_controls6 = require("@vuu-ui/vuu-ui-controls");
|
|
2309
|
-
var
|
|
2373
|
+
var import_vuu_utils19 = require("@vuu-ui/vuu-utils");
|
|
2310
2374
|
var import_core7 = require("@salt-ds/core");
|
|
2311
|
-
var
|
|
2375
|
+
var import_clsx5 = __toESM(require("clsx"), 1);
|
|
2312
2376
|
var import_react16 = require("react");
|
|
2313
2377
|
|
|
2314
2378
|
// src/column-formatting-settings/BaseNumericFormattingSettings.tsx
|
|
2315
2379
|
var import_core4 = require("@salt-ds/core");
|
|
2316
|
-
var
|
|
2380
|
+
var import_vuu_utils16 = require("@vuu-ui/vuu-utils");
|
|
2317
2381
|
var import_react13 = require("react");
|
|
2318
|
-
var
|
|
2319
|
-
var
|
|
2382
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
2383
|
+
var classBase9 = "vuuFormattingSettings";
|
|
2320
2384
|
var BaseNumericFormattingSettings = ({
|
|
2321
2385
|
column,
|
|
2322
2386
|
onChangeFormatting: onChange
|
|
2323
2387
|
}) => {
|
|
2324
2388
|
var _a, _b, _c;
|
|
2325
|
-
const [formattingSettings, setFormattingSettings] = (0, import_react13.useState)((0,
|
|
2389
|
+
const [formattingSettings, setFormattingSettings] = (0, import_react13.useState)((0, import_vuu_utils16.getTypeFormattingFromColumn)(column));
|
|
2326
2390
|
const handleInputKeyDown = (0, import_react13.useCallback)(
|
|
2327
2391
|
(evt) => {
|
|
2328
2392
|
if (evt.key === "Enter" || evt.key === "Tab") {
|
|
@@ -2367,10 +2431,10 @@ var BaseNumericFormattingSettings = ({
|
|
|
2367
2431
|
},
|
|
2368
2432
|
[formattingSettings, onChange]
|
|
2369
2433
|
);
|
|
2370
|
-
return /* @__PURE__ */ (0,
|
|
2371
|
-
/* @__PURE__ */ (0,
|
|
2372
|
-
/* @__PURE__ */ (0,
|
|
2373
|
-
/* @__PURE__ */ (0,
|
|
2434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: classBase9, children: [
|
|
2435
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_core4.FormField, { "data-field": "decimals", children: [
|
|
2436
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core4.FormFieldLabel, { children: "Number of decimals" }),
|
|
2437
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2374
2438
|
import_core4.Input,
|
|
2375
2439
|
{
|
|
2376
2440
|
className: "vuuInput",
|
|
@@ -2380,9 +2444,9 @@ var BaseNumericFormattingSettings = ({
|
|
|
2380
2444
|
}
|
|
2381
2445
|
)
|
|
2382
2446
|
] }),
|
|
2383
|
-
/* @__PURE__ */ (0,
|
|
2384
|
-
/* @__PURE__ */ (0,
|
|
2385
|
-
/* @__PURE__ */ (0,
|
|
2447
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_core4.FormField, { labelPlacement: "left", children: [
|
|
2448
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core4.FormFieldLabel, { children: "Align on decimals" }),
|
|
2449
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2386
2450
|
import_core4.Switch,
|
|
2387
2451
|
{
|
|
2388
2452
|
checked: (_b = formattingSettings.alignOnDecimals) != null ? _b : false,
|
|
@@ -2391,9 +2455,9 @@ var BaseNumericFormattingSettings = ({
|
|
|
2391
2455
|
}
|
|
2392
2456
|
)
|
|
2393
2457
|
] }),
|
|
2394
|
-
/* @__PURE__ */ (0,
|
|
2395
|
-
/* @__PURE__ */ (0,
|
|
2396
|
-
/* @__PURE__ */ (0,
|
|
2458
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_core4.FormField, { labelPlacement: "left", children: [
|
|
2459
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core4.FormFieldLabel, { children: "Zero pad decimals" }),
|
|
2460
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2397
2461
|
import_core4.Switch,
|
|
2398
2462
|
{
|
|
2399
2463
|
checked: (_c = formattingSettings.zeroPad) != null ? _c : false,
|
|
@@ -2408,23 +2472,23 @@ var BaseNumericFormattingSettings = ({
|
|
|
2408
2472
|
// src/column-formatting-settings/LongTypeFormattingSettings.tsx
|
|
2409
2473
|
var import_react15 = require("react");
|
|
2410
2474
|
var import_core6 = require("@salt-ds/core");
|
|
2411
|
-
var
|
|
2475
|
+
var import_vuu_utils18 = require("@vuu-ui/vuu-utils");
|
|
2412
2476
|
|
|
2413
2477
|
// src/column-formatting-settings/DateTimeFormattingSettings.tsx
|
|
2414
2478
|
var import_react14 = require("react");
|
|
2415
2479
|
var import_vuu_ui_controls5 = require("@vuu-ui/vuu-ui-controls");
|
|
2416
|
-
var
|
|
2480
|
+
var import_vuu_utils17 = require("@vuu-ui/vuu-utils");
|
|
2417
2481
|
var import_core5 = require("@salt-ds/core");
|
|
2418
|
-
var
|
|
2482
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2419
2483
|
var DateTimeFormattingSettings = ({ column, onChangeFormatting: onChange }) => {
|
|
2420
2484
|
var _a, _b;
|
|
2421
|
-
const formatting = (0,
|
|
2422
|
-
const { pattern =
|
|
2485
|
+
const formatting = (0, import_vuu_utils17.getTypeFormattingFromColumn)(column);
|
|
2486
|
+
const { pattern = import_vuu_utils17.fallbackDateTimePattern } = formatting;
|
|
2423
2487
|
const toggleValue = (0, import_react14.useMemo)(() => getToggleValue(pattern), [pattern]);
|
|
2424
2488
|
const [fallbackState, setFallbackState] = (0, import_react14.useState)(
|
|
2425
2489
|
{
|
|
2426
|
-
time: (_a = pattern.time) != null ? _a :
|
|
2427
|
-
date: (_b = pattern.date) != null ? _b :
|
|
2490
|
+
time: (_a = pattern.time) != null ? _a : import_vuu_utils17.defaultPatternsByType.time,
|
|
2491
|
+
date: (_b = pattern.date) != null ? _b : import_vuu_utils17.defaultPatternsByType.date
|
|
2428
2492
|
}
|
|
2429
2493
|
);
|
|
2430
2494
|
const onPatternChange = (0, import_react14.useCallback)(
|
|
@@ -2467,27 +2531,28 @@ var DateTimeFormattingSettings = ({ column, onChangeFormatting: onChange }) => {
|
|
|
2467
2531
|
},
|
|
2468
2532
|
[onPatternChange, pattern, fallbackState]
|
|
2469
2533
|
);
|
|
2470
|
-
return /* @__PURE__ */ (0,
|
|
2471
|
-
/* @__PURE__ */ (0,
|
|
2472
|
-
/* @__PURE__ */ (0,
|
|
2473
|
-
/* @__PURE__ */ (0,
|
|
2534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
2535
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_core5.FormField, { labelPlacement: "top", children: [
|
|
2536
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core5.FormFieldLabel, { children: "Display" }),
|
|
2537
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2474
2538
|
import_core5.ToggleButtonGroup,
|
|
2475
2539
|
{
|
|
2476
2540
|
className: "vuuToggleButtonGroup",
|
|
2477
2541
|
onChange: onToggleChange,
|
|
2478
2542
|
value: toggleValue,
|
|
2479
|
-
|
|
2543
|
+
"data-variant": "primary",
|
|
2544
|
+
children: toggleValues.map((v) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core5.ToggleButton, { value: v, children: v.toUpperCase() }, v))
|
|
2480
2545
|
}
|
|
2481
2546
|
)
|
|
2482
2547
|
] }),
|
|
2483
|
-
["date", "time"].filter((v) => !!pattern[v]).map((v) => /* @__PURE__ */ (0,
|
|
2484
|
-
/* @__PURE__ */ (0,
|
|
2485
|
-
/* @__PURE__ */ (0,
|
|
2548
|
+
["date", "time"].filter((v) => !!pattern[v]).map((v) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_core5.FormField, { labelPlacement: "top", children: [
|
|
2549
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core5.FormFieldLabel, { children: `${labelByType[v]} pattern` }),
|
|
2550
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2486
2551
|
import_vuu_ui_controls5.Dropdown,
|
|
2487
2552
|
{
|
|
2488
2553
|
onSelectionChange: onDropdownChange(v),
|
|
2489
2554
|
selected: pattern[v],
|
|
2490
|
-
source:
|
|
2555
|
+
source: import_vuu_utils17.supportedDateTimePatterns[v],
|
|
2491
2556
|
width: "100%"
|
|
2492
2557
|
}
|
|
2493
2558
|
)
|
|
@@ -2501,11 +2566,11 @@ function getToggleValue(pattern) {
|
|
|
2501
2566
|
}
|
|
2502
2567
|
|
|
2503
2568
|
// src/column-formatting-settings/LongTypeFormattingSettings.tsx
|
|
2504
|
-
var
|
|
2505
|
-
var
|
|
2569
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2570
|
+
var classBase10 = "vuuLongColumnFormattingSettings";
|
|
2506
2571
|
var LongTypeFormattingSettings = (props) => {
|
|
2507
|
-
const { column, onChangeType } = props;
|
|
2508
|
-
const type = (0,
|
|
2572
|
+
const { column, onChangeColumnType: onChangeType } = props;
|
|
2573
|
+
const type = (0, import_vuu_utils18.isTypeDescriptor)(column.type) ? column.type.name : column.type;
|
|
2509
2574
|
const handleToggleChange = (0, import_react15.useCallback)(
|
|
2510
2575
|
(event) => {
|
|
2511
2576
|
const value = event.currentTarget.value;
|
|
@@ -2513,27 +2578,27 @@ var LongTypeFormattingSettings = (props) => {
|
|
|
2513
2578
|
},
|
|
2514
2579
|
[onChangeType]
|
|
2515
2580
|
);
|
|
2516
|
-
return /* @__PURE__ */ (0,
|
|
2517
|
-
/* @__PURE__ */ (0,
|
|
2518
|
-
/* @__PURE__ */ (0,
|
|
2519
|
-
/* @__PURE__ */ (0,
|
|
2581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: classBase10, children: [
|
|
2582
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_core6.FormField, { children: [
|
|
2583
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_core6.FormFieldLabel, { children: "Type inferred as" }),
|
|
2584
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2520
2585
|
import_core6.ToggleButtonGroup,
|
|
2521
2586
|
{
|
|
2522
2587
|
className: "vuuToggleButtonGroup",
|
|
2523
2588
|
onChange: handleToggleChange,
|
|
2524
2589
|
value: type != null ? type : "number",
|
|
2525
|
-
children: toggleValues2.map((v) => /* @__PURE__ */ (0,
|
|
2590
|
+
children: toggleValues2.map((v) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_core6.ToggleButton, { value: v, children: v.toUpperCase() }, v))
|
|
2526
2591
|
}
|
|
2527
2592
|
)
|
|
2528
2593
|
] }),
|
|
2529
|
-
(0,
|
|
2594
|
+
(0, import_vuu_utils18.isDateTimeColumn)(column) ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DateTimeFormattingSettings, { ...props, column }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(BaseNumericFormattingSettings, { ...props })
|
|
2530
2595
|
] });
|
|
2531
2596
|
};
|
|
2532
2597
|
var toggleValues2 = ["number", "date/time"];
|
|
2533
2598
|
|
|
2534
2599
|
// src/column-formatting-settings/ColumnFormattingPanel.tsx
|
|
2535
|
-
var
|
|
2536
|
-
var
|
|
2600
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2601
|
+
var classBase11 = "vuuColumnFormattingPanel";
|
|
2537
2602
|
var itemToString = (item) => {
|
|
2538
2603
|
var _a;
|
|
2539
2604
|
return (_a = item.label) != null ? _a : item.name;
|
|
@@ -2543,26 +2608,31 @@ var ColumnFormattingPanel = ({
|
|
|
2543
2608
|
className,
|
|
2544
2609
|
column,
|
|
2545
2610
|
onChangeFormatting,
|
|
2546
|
-
|
|
2611
|
+
onChangeColumnType,
|
|
2547
2612
|
onChangeRendering,
|
|
2548
2613
|
...htmlAttributes
|
|
2549
2614
|
}) => {
|
|
2550
|
-
const
|
|
2551
|
-
() =>
|
|
2552
|
-
|
|
2615
|
+
const formattingSettingsComponent = (0, import_react16.useMemo)(
|
|
2616
|
+
() => getFormattingSettingsComponent({
|
|
2617
|
+
column,
|
|
2618
|
+
onChangeFormatting,
|
|
2619
|
+
onChangeColumnType
|
|
2620
|
+
}),
|
|
2621
|
+
[column, onChangeColumnType, onChangeFormatting]
|
|
2553
2622
|
);
|
|
2623
|
+
console.log({ formattingSettingsComponent });
|
|
2554
2624
|
const ConfigEditor = (0, import_react16.useMemo)(() => {
|
|
2555
2625
|
const { type } = column;
|
|
2556
|
-
if ((0,
|
|
2557
|
-
const cellRendererOptions = (0,
|
|
2558
|
-
return (0,
|
|
2626
|
+
if ((0, import_vuu_utils19.isTypeDescriptor)(type) && (0, import_vuu_utils19.isColumnTypeRenderer)(type.renderer)) {
|
|
2627
|
+
const cellRendererOptions = (0, import_vuu_utils19.getCellRendererOptions)(type.renderer.name);
|
|
2628
|
+
return (0, import_vuu_utils19.getConfigurationEditor)(cellRendererOptions == null ? void 0 : cellRendererOptions.configEditor);
|
|
2559
2629
|
}
|
|
2560
2630
|
return void 0;
|
|
2561
2631
|
}, [column]);
|
|
2562
2632
|
const selectedCellRenderer = (0, import_react16.useMemo)(() => {
|
|
2563
2633
|
const { type } = column;
|
|
2564
2634
|
const [defaultRenderer] = availableRenderers;
|
|
2565
|
-
const rendererName = (0,
|
|
2635
|
+
const rendererName = (0, import_vuu_utils19.isTypeDescriptor)(type) && (0, import_vuu_utils19.isColumnTypeRenderer)(type.renderer) ? type.renderer.name : void 0;
|
|
2566
2636
|
const configuredRenderer = availableRenderers.find(
|
|
2567
2637
|
(renderer) => renderer.name === rendererName
|
|
2568
2638
|
);
|
|
@@ -2578,14 +2648,14 @@ var ColumnFormattingPanel = ({
|
|
|
2578
2648
|
[onChangeRendering]
|
|
2579
2649
|
);
|
|
2580
2650
|
const { serverDataType = "string" } = column;
|
|
2581
|
-
return /* @__PURE__ */ (0,
|
|
2582
|
-
/* @__PURE__ */ (0,
|
|
2583
|
-
/* @__PURE__ */ (0,
|
|
2584
|
-
/* @__PURE__ */ (0,
|
|
2585
|
-
/* @__PURE__ */ (0,
|
|
2651
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { ...htmlAttributes, className: `vuuColumnSettingsPanel-header`, children: [
|
|
2652
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { children: "Formatting" }),
|
|
2653
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_core7.FormField, { children: [
|
|
2654
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core7.FormFieldLabel, { children: `Renderer (data type ${column.serverDataType})` }),
|
|
2655
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2586
2656
|
import_vuu_ui_controls6.Dropdown,
|
|
2587
2657
|
{
|
|
2588
|
-
className: (0,
|
|
2658
|
+
className: (0, import_clsx5.default)(`${classBase11}-renderer`),
|
|
2589
2659
|
itemToString,
|
|
2590
2660
|
onSelectionChange: handleChangeRenderer,
|
|
2591
2661
|
selected: selectedCellRenderer,
|
|
@@ -2594,13 +2664,13 @@ var ColumnFormattingPanel = ({
|
|
|
2594
2664
|
}
|
|
2595
2665
|
)
|
|
2596
2666
|
] }),
|
|
2597
|
-
/* @__PURE__ */ (0,
|
|
2667
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
2598
2668
|
"div",
|
|
2599
2669
|
{
|
|
2600
|
-
className: (0,
|
|
2670
|
+
className: (0, import_clsx5.default)(classBase11, className, `${classBase11}-${serverDataType}`),
|
|
2601
2671
|
children: [
|
|
2602
|
-
|
|
2603
|
-
ConfigEditor ? /* @__PURE__ */ (0,
|
|
2672
|
+
formattingSettingsComponent,
|
|
2673
|
+
ConfigEditor ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2604
2674
|
ConfigEditor,
|
|
2605
2675
|
{
|
|
2606
2676
|
column,
|
|
@@ -2612,93 +2682,88 @@ var ColumnFormattingPanel = ({
|
|
|
2612
2682
|
)
|
|
2613
2683
|
] });
|
|
2614
2684
|
};
|
|
2615
|
-
function
|
|
2685
|
+
function getFormattingSettingsComponent(props) {
|
|
2616
2686
|
const { column } = props;
|
|
2617
2687
|
switch (column.serverDataType) {
|
|
2618
2688
|
case "double":
|
|
2619
2689
|
case "int":
|
|
2620
|
-
return /* @__PURE__ */ (0,
|
|
2690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(BaseNumericFormattingSettings, { ...props });
|
|
2621
2691
|
case "long":
|
|
2622
|
-
return /* @__PURE__ */ (0,
|
|
2692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(LongTypeFormattingSettings, { ...props });
|
|
2623
2693
|
default:
|
|
2624
2694
|
return null;
|
|
2625
2695
|
}
|
|
2626
2696
|
}
|
|
2627
2697
|
|
|
2628
2698
|
// src/column-settings/ColumnNameLabel.tsx
|
|
2629
|
-
var
|
|
2630
|
-
var
|
|
2631
|
-
var
|
|
2632
|
-
var
|
|
2699
|
+
var import_clsx6 = __toESM(require("clsx"), 1);
|
|
2700
|
+
var import_vuu_utils20 = require("@vuu-ui/vuu-utils");
|
|
2701
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2702
|
+
var classBase12 = "vuuColumnNameLabel";
|
|
2633
2703
|
var ColumnNameLabel = ({ column, onClick }) => {
|
|
2634
|
-
if ((0,
|
|
2635
|
-
const [name2, type, expression] = (0,
|
|
2704
|
+
if ((0, import_vuu_utils20.isCalculatedColumn)(column.name)) {
|
|
2705
|
+
const [name2, type, expression] = (0, import_vuu_utils20.getCalculatedColumnDetails)(column);
|
|
2636
2706
|
const displayName = name2 || "name";
|
|
2637
2707
|
const displayExpression = "=expression";
|
|
2638
|
-
const nameClass = displayName === "name" ? `${
|
|
2639
|
-
const expressionClass = expression === "" ? `${
|
|
2640
|
-
return /* @__PURE__ */ (0,
|
|
2708
|
+
const nameClass = displayName === "name" ? `${classBase12}-placeholder` : void 0;
|
|
2709
|
+
const expressionClass = expression === "" ? `${classBase12}-placeholder` : void 0;
|
|
2710
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2641
2711
|
"div",
|
|
2642
2712
|
{
|
|
2643
|
-
className: (0,
|
|
2713
|
+
className: (0, import_clsx6.default)(classBase12, `${classBase12}-calculated`),
|
|
2644
2714
|
onClick,
|
|
2645
2715
|
children: [
|
|
2646
|
-
/* @__PURE__ */ (0,
|
|
2647
|
-
/* @__PURE__ */ (0,
|
|
2648
|
-
/* @__PURE__ */ (0,
|
|
2649
|
-
/* @__PURE__ */ (0,
|
|
2650
|
-
/* @__PURE__ */ (0,
|
|
2651
|
-
/* @__PURE__ */ (0,
|
|
2716
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: nameClass, children: displayName }),
|
|
2717
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: ":" }),
|
|
2718
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: type || "string" }),
|
|
2719
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: ":" }),
|
|
2720
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: expressionClass, children: displayExpression }),
|
|
2721
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: `${classBase12}-edit`, "data-icon": "edit" })
|
|
2652
2722
|
]
|
|
2653
2723
|
}
|
|
2654
2724
|
);
|
|
2655
2725
|
} else {
|
|
2656
|
-
return /* @__PURE__ */ (0,
|
|
2726
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: classBase12, children: column.name });
|
|
2657
2727
|
}
|
|
2658
2728
|
};
|
|
2659
2729
|
|
|
2660
2730
|
// src/column-settings/useColumnSettings.ts
|
|
2661
|
-
var
|
|
2731
|
+
var import_vuu_utils21 = require("@vuu-ui/vuu-utils");
|
|
2662
2732
|
var import_react17 = require("react");
|
|
2663
2733
|
var integerCellRenderers = [
|
|
2664
2734
|
{
|
|
2665
2735
|
description: "Default formatter for columns with data type integer",
|
|
2666
2736
|
label: "Default Renderer (int, long)",
|
|
2667
2737
|
name: "default-int"
|
|
2668
|
-
}
|
|
2669
|
-
...(0, import_vuu_utils20.getRegisteredCellRenderers)("int")
|
|
2738
|
+
}
|
|
2670
2739
|
];
|
|
2671
2740
|
var doubleCellRenderers = [
|
|
2672
2741
|
{
|
|
2673
2742
|
description: "Default formatter for columns with data type double",
|
|
2674
2743
|
label: "Default Renderer (double)",
|
|
2675
2744
|
name: "default-double"
|
|
2676
|
-
}
|
|
2677
|
-
...(0, import_vuu_utils20.getRegisteredCellRenderers)("double")
|
|
2745
|
+
}
|
|
2678
2746
|
];
|
|
2679
2747
|
var stringCellRenderers = [
|
|
2680
2748
|
{
|
|
2681
2749
|
description: "Default formatter for columns with data type string",
|
|
2682
2750
|
label: "Default Renderer (string)",
|
|
2683
2751
|
name: "default-string"
|
|
2684
|
-
}
|
|
2685
|
-
...(0, import_vuu_utils20.getRegisteredCellRenderers)("string")
|
|
2686
|
-
];
|
|
2687
|
-
var booleanCellRenderers = [
|
|
2688
|
-
...(0, import_vuu_utils20.getRegisteredCellRenderers)("boolean")
|
|
2752
|
+
}
|
|
2689
2753
|
];
|
|
2754
|
+
var booleanCellRenderers = [];
|
|
2690
2755
|
var getAvailableCellRenderers = (column) => {
|
|
2691
2756
|
switch (column.serverDataType) {
|
|
2692
2757
|
case "char":
|
|
2693
2758
|
case "string":
|
|
2694
|
-
return stringCellRenderers;
|
|
2759
|
+
return stringCellRenderers.concat((0, import_vuu_utils21.getRegisteredCellRenderers)("string"));
|
|
2695
2760
|
case "int":
|
|
2696
2761
|
case "long":
|
|
2697
|
-
return integerCellRenderers;
|
|
2762
|
+
return integerCellRenderers.concat((0, import_vuu_utils21.getRegisteredCellRenderers)("int"));
|
|
2698
2763
|
case "double":
|
|
2699
|
-
return doubleCellRenderers;
|
|
2764
|
+
return doubleCellRenderers.concat((0, import_vuu_utils21.getRegisteredCellRenderers)("double"));
|
|
2700
2765
|
case "boolean":
|
|
2701
|
-
return booleanCellRenderers;
|
|
2766
|
+
return booleanCellRenderers.concat((0, import_vuu_utils21.getRegisteredCellRenderers)("boolean"));
|
|
2702
2767
|
default:
|
|
2703
2768
|
return stringCellRenderers;
|
|
2704
2769
|
}
|
|
@@ -2757,51 +2822,60 @@ var useColumnSettings = ({
|
|
|
2757
2822
|
const handleInputCommit = (0, import_react17.useCallback)(() => {
|
|
2758
2823
|
onConfigChange(replaceColumn(tableConfig, column));
|
|
2759
2824
|
}, [column, onConfigChange, tableConfig]);
|
|
2760
|
-
const
|
|
2825
|
+
const handleChangeToggleButton = (0, import_react17.useCallback)(
|
|
2761
2826
|
(evt) => {
|
|
2762
|
-
const
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
if ((0, import_vuu_utils20.isValidColumnAlignment)(value)) {
|
|
2777
|
-
const newColumn = {
|
|
2778
|
-
...column,
|
|
2779
|
-
align: value || void 0
|
|
2780
|
-
};
|
|
2781
|
-
setColumn(newColumn);
|
|
2782
|
-
onConfigChange(replaceColumn(tableConfig, newColumn));
|
|
2783
|
-
}
|
|
2784
|
-
break;
|
|
2785
|
-
case "column-pin":
|
|
2786
|
-
if ((0, import_vuu_utils20.isValidPinLocation)(value)) {
|
|
2787
|
-
const newColumn = {
|
|
2788
|
-
...column,
|
|
2789
|
-
pin: value || void 0
|
|
2790
|
-
};
|
|
2791
|
-
setColumn(newColumn);
|
|
2792
|
-
onConfigChange(replaceColumn(tableConfig, newColumn));
|
|
2827
|
+
const button = (0, import_vuu_utils21.queryClosest)(evt.target, "button");
|
|
2828
|
+
if (button) {
|
|
2829
|
+
const fieldName = getFieldName(button);
|
|
2830
|
+
const { value } = button;
|
|
2831
|
+
switch (fieldName) {
|
|
2832
|
+
case "column-alignment":
|
|
2833
|
+
if ((0, import_vuu_utils21.isValidColumnAlignment)(value)) {
|
|
2834
|
+
const newColumn = {
|
|
2835
|
+
...column,
|
|
2836
|
+
align: value || void 0
|
|
2837
|
+
};
|
|
2838
|
+
setColumn(newColumn);
|
|
2839
|
+
onConfigChange(replaceColumn(tableConfig, newColumn));
|
|
2840
|
+
}
|
|
2793
2841
|
break;
|
|
2794
|
-
|
|
2842
|
+
case "column-pin":
|
|
2843
|
+
if ((0, import_vuu_utils21.isValidPinLocation)(value)) {
|
|
2844
|
+
const newColumn = {
|
|
2845
|
+
...column,
|
|
2846
|
+
pin: value || void 0
|
|
2847
|
+
};
|
|
2848
|
+
setColumn(newColumn);
|
|
2849
|
+
onConfigChange(replaceColumn(tableConfig, newColumn));
|
|
2850
|
+
break;
|
|
2851
|
+
}
|
|
2852
|
+
}
|
|
2795
2853
|
}
|
|
2796
2854
|
},
|
|
2797
2855
|
[column, onConfigChange, tableConfig]
|
|
2798
2856
|
);
|
|
2857
|
+
const handleChange = (0, import_react17.useCallback)((evt) => {
|
|
2858
|
+
const input = evt.target;
|
|
2859
|
+
const fieldName = getFieldName(input);
|
|
2860
|
+
const { value } = input;
|
|
2861
|
+
switch (fieldName) {
|
|
2862
|
+
case "column-label":
|
|
2863
|
+
setColumn((state) => ({ ...state, label: value }));
|
|
2864
|
+
break;
|
|
2865
|
+
case "column-name":
|
|
2866
|
+
setColumn((state) => (0, import_vuu_utils21.setCalculatedColumnName)(state, value));
|
|
2867
|
+
break;
|
|
2868
|
+
case "column-width":
|
|
2869
|
+
setColumn((state) => ({ ...state, width: parseInt(value) }));
|
|
2870
|
+
break;
|
|
2871
|
+
}
|
|
2872
|
+
}, []);
|
|
2799
2873
|
const handleChangeCalculatedColumnName = (0, import_react17.useCallback)((name2) => {
|
|
2800
2874
|
setColumn((state) => ({ ...state, name: name2 }));
|
|
2801
2875
|
}, []);
|
|
2802
2876
|
const handleChangeFormatting = (0, import_react17.useCallback)(
|
|
2803
2877
|
(formatting) => {
|
|
2804
|
-
const newColumn = (0,
|
|
2878
|
+
const newColumn = (0, import_vuu_utils21.updateColumnFormatting)(column, formatting);
|
|
2805
2879
|
setColumn(newColumn);
|
|
2806
2880
|
onConfigChange(replaceColumn(tableConfig, newColumn));
|
|
2807
2881
|
},
|
|
@@ -2809,16 +2883,22 @@ var useColumnSettings = ({
|
|
|
2809
2883
|
);
|
|
2810
2884
|
const handleChangeType = (0, import_react17.useCallback)(
|
|
2811
2885
|
(type) => {
|
|
2812
|
-
const updatedColumn = (0,
|
|
2886
|
+
const updatedColumn = (0, import_vuu_utils21.updateColumnType)(column, type);
|
|
2813
2887
|
setColumn(updatedColumn);
|
|
2814
2888
|
onConfigChange(replaceColumn(tableConfig, updatedColumn));
|
|
2815
2889
|
},
|
|
2816
2890
|
[column, onConfigChange, tableConfig]
|
|
2817
2891
|
);
|
|
2892
|
+
const handleChangeServerDataType = (0, import_react17.useCallback)(
|
|
2893
|
+
(serverDataType) => {
|
|
2894
|
+
setColumn((col) => ({ ...col, serverDataType }));
|
|
2895
|
+
},
|
|
2896
|
+
[]
|
|
2897
|
+
);
|
|
2818
2898
|
const handleChangeRendering = (0, import_react17.useCallback)(
|
|
2819
2899
|
(renderProps) => {
|
|
2820
2900
|
if (renderProps) {
|
|
2821
|
-
const newColumn = (0,
|
|
2901
|
+
const newColumn = (0, import_vuu_utils21.updateColumnRenderProps)(
|
|
2822
2902
|
column,
|
|
2823
2903
|
renderProps
|
|
2824
2904
|
);
|
|
@@ -2869,6 +2949,8 @@ var useColumnSettings = ({
|
|
|
2869
2949
|
onChangeCalculatedColumnName: handleChangeCalculatedColumnName,
|
|
2870
2950
|
onChangeFormatting: handleChangeFormatting,
|
|
2871
2951
|
onChangeRendering: handleChangeRendering,
|
|
2952
|
+
onChangeServerDataType: handleChangeServerDataType,
|
|
2953
|
+
onChangeToggleButton: handleChangeToggleButton,
|
|
2872
2954
|
onChangeType: handleChangeType,
|
|
2873
2955
|
onEditCalculatedColumn: handleEditCalculatedcolumn,
|
|
2874
2956
|
onInputCommit: handleInputCommit,
|
|
@@ -2877,12 +2959,12 @@ var useColumnSettings = ({
|
|
|
2877
2959
|
};
|
|
2878
2960
|
|
|
2879
2961
|
// src/column-settings/ColumnSettingsPanel.tsx
|
|
2880
|
-
var
|
|
2881
|
-
var
|
|
2962
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2963
|
+
var classBase13 = "vuuColumnSettingsPanel";
|
|
2882
2964
|
var getColumnLabel2 = (column) => {
|
|
2883
2965
|
const { name: name2, label } = column;
|
|
2884
|
-
if ((0,
|
|
2885
|
-
return label != null ? label : (0,
|
|
2966
|
+
if ((0, import_vuu_utils22.isCalculatedColumn)(name2)) {
|
|
2967
|
+
return label != null ? label : (0, import_vuu_utils22.getCalculatedColumnName)(column);
|
|
2886
2968
|
} else {
|
|
2887
2969
|
return label != null ? label : name2;
|
|
2888
2970
|
}
|
|
@@ -2907,6 +2989,8 @@ var ColumnSettingsPanel = ({
|
|
|
2907
2989
|
onChangeCalculatedColumnName,
|
|
2908
2990
|
onChangeFormatting,
|
|
2909
2991
|
onChangeRendering,
|
|
2992
|
+
onChangeServerDataType,
|
|
2993
|
+
onChangeToggleButton,
|
|
2910
2994
|
onChangeType,
|
|
2911
2995
|
onEditCalculatedColumn,
|
|
2912
2996
|
onInputCommit,
|
|
@@ -2920,30 +3004,31 @@ var ColumnSettingsPanel = ({
|
|
|
2920
3004
|
});
|
|
2921
3005
|
const {
|
|
2922
3006
|
serverDataType,
|
|
2923
|
-
align = (0,
|
|
3007
|
+
align = (0, import_vuu_utils22.getDefaultAlignment)(serverDataType),
|
|
2924
3008
|
pin,
|
|
2925
3009
|
width
|
|
2926
3010
|
} = column;
|
|
2927
|
-
return /* @__PURE__ */ (0,
|
|
3011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
2928
3012
|
"div",
|
|
2929
3013
|
{
|
|
2930
|
-
className: (0,
|
|
2931
|
-
[`${
|
|
3014
|
+
className: (0, import_clsx7.default)(classBase13, {
|
|
3015
|
+
[`${classBase13}-editing`]: editCalculatedColumn
|
|
2932
3016
|
}),
|
|
2933
3017
|
children: [
|
|
2934
|
-
/* @__PURE__ */ (0,
|
|
2935
|
-
editCalculatedColumn ? /* @__PURE__ */ (0,
|
|
3018
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: `${classBase13}-header`, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ColumnNameLabel, { column, onClick: onEditCalculatedColumn }) }),
|
|
3019
|
+
editCalculatedColumn ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2936
3020
|
ColumnExpressionPanel,
|
|
2937
3021
|
{
|
|
2938
3022
|
column,
|
|
2939
3023
|
onChangeName: onChangeCalculatedColumnName,
|
|
3024
|
+
onChangeServerDataType,
|
|
2940
3025
|
tableConfig,
|
|
2941
3026
|
vuuTable
|
|
2942
3027
|
}
|
|
2943
3028
|
) : null,
|
|
2944
|
-
/* @__PURE__ */ (0,
|
|
2945
|
-
/* @__PURE__ */ (0,
|
|
2946
|
-
/* @__PURE__ */ (0,
|
|
3029
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_core8.FormField, { "data-field": "column-label", children: [
|
|
3030
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core8.FormFieldLabel, { children: "Column Label" }),
|
|
3031
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2947
3032
|
import_vuu_ui_controls7.VuuInput,
|
|
2948
3033
|
{
|
|
2949
3034
|
className: "vuuInput",
|
|
@@ -2953,9 +3038,9 @@ var ColumnSettingsPanel = ({
|
|
|
2953
3038
|
}
|
|
2954
3039
|
)
|
|
2955
3040
|
] }),
|
|
2956
|
-
/* @__PURE__ */ (0,
|
|
2957
|
-
/* @__PURE__ */ (0,
|
|
2958
|
-
/* @__PURE__ */ (0,
|
|
3041
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_core8.FormField, { "data-field": "column-width", children: [
|
|
3042
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core8.FormFieldLabel, { children: "Column Width" }),
|
|
3043
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2959
3044
|
import_vuu_ui_controls7.VuuInput,
|
|
2960
3045
|
{
|
|
2961
3046
|
className: "vuuInput",
|
|
@@ -2965,129 +3050,71 @@ var ColumnSettingsPanel = ({
|
|
|
2965
3050
|
}
|
|
2966
3051
|
)
|
|
2967
3052
|
] }),
|
|
2968
|
-
/* @__PURE__ */ (0,
|
|
2969
|
-
/* @__PURE__ */ (0,
|
|
2970
|
-
/* @__PURE__ */ (0,
|
|
2971
|
-
import_core8.
|
|
2972
|
-
{
|
|
2973
|
-
|
|
2974
|
-
onChange,
|
|
2975
|
-
value: align,
|
|
2976
|
-
children: [
|
|
2977
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2978
|
-
import_core8.ToggleButton,
|
|
2979
|
-
{
|
|
2980
|
-
"data-icon": "align-left",
|
|
2981
|
-
className: "vuuIconToggleButton",
|
|
2982
|
-
value: "left"
|
|
2983
|
-
}
|
|
2984
|
-
),
|
|
2985
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2986
|
-
import_core8.ToggleButton,
|
|
2987
|
-
{
|
|
2988
|
-
"data-icon": "align-right",
|
|
2989
|
-
className: "vuuIconToggleButton",
|
|
2990
|
-
value: "right"
|
|
2991
|
-
}
|
|
2992
|
-
)
|
|
2993
|
-
]
|
|
2994
|
-
}
|
|
2995
|
-
)
|
|
3053
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_core8.FormField, { "data-field": "column-alignment", children: [
|
|
3054
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core8.FormFieldLabel, { children: "Alignment" }),
|
|
3055
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_core8.ToggleButtonGroup, { onChange: onChangeToggleButton, value: align, children: [
|
|
3056
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core8.ToggleButton, { value: "left", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_vuu_ui_controls7.Icon, { name: "align-left", size: 16 }) }),
|
|
3057
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core8.ToggleButton, { value: "right", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_vuu_ui_controls7.Icon, { name: "align-right", size: 16 }) })
|
|
3058
|
+
] })
|
|
2996
3059
|
] }),
|
|
2997
|
-
/* @__PURE__ */ (0,
|
|
2998
|
-
/* @__PURE__ */ (0,
|
|
2999
|
-
/* @__PURE__ */ (0,
|
|
3000
|
-
import_core8.
|
|
3001
|
-
{
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
children: [
|
|
3006
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3007
|
-
import_core8.ToggleButton,
|
|
3008
|
-
{
|
|
3009
|
-
className: "vuuIconToggleButton",
|
|
3010
|
-
"data-icon": "cross-circle",
|
|
3011
|
-
value: ""
|
|
3012
|
-
}
|
|
3013
|
-
),
|
|
3014
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3015
|
-
import_core8.ToggleButton,
|
|
3016
|
-
{
|
|
3017
|
-
className: "vuuIconToggleButton",
|
|
3018
|
-
"data-icon": "pin-left",
|
|
3019
|
-
value: "left"
|
|
3020
|
-
}
|
|
3021
|
-
),
|
|
3022
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3023
|
-
import_core8.ToggleButton,
|
|
3024
|
-
{
|
|
3025
|
-
className: "vuuIconToggleButton",
|
|
3026
|
-
"data-icon": "pin-float",
|
|
3027
|
-
value: "floating"
|
|
3028
|
-
}
|
|
3029
|
-
),
|
|
3030
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3031
|
-
import_core8.ToggleButton,
|
|
3032
|
-
{
|
|
3033
|
-
className: "vuuIconToggleButton",
|
|
3034
|
-
"data-icon": "pin-right",
|
|
3035
|
-
value: "right"
|
|
3036
|
-
}
|
|
3037
|
-
)
|
|
3038
|
-
]
|
|
3039
|
-
}
|
|
3040
|
-
)
|
|
3060
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_core8.FormField, { "data-field": "column-pin", children: [
|
|
3061
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core8.FormFieldLabel, { children: "Pin Column" }),
|
|
3062
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_core8.ToggleButtonGroup, { onChange: onChangeToggleButton, value: pin != null ? pin : "", children: [
|
|
3063
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core8.ToggleButton, { value: "", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_vuu_ui_controls7.Icon, { name: "cross-circle", size: 16 }) }),
|
|
3064
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core8.ToggleButton, { value: "left", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_vuu_ui_controls7.Icon, { name: "pin-left", size: 16 }) }),
|
|
3065
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core8.ToggleButton, { value: "floating", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_vuu_ui_controls7.Icon, { name: "pin-float", size: 16 }) }),
|
|
3066
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core8.ToggleButton, { value: "right", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_vuu_ui_controls7.Icon, { name: "pin-right", size: 16 }) })
|
|
3067
|
+
] })
|
|
3041
3068
|
] }),
|
|
3042
|
-
/* @__PURE__ */ (0,
|
|
3069
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3043
3070
|
ColumnFormattingPanel,
|
|
3044
3071
|
{
|
|
3045
3072
|
availableRenderers,
|
|
3046
3073
|
column,
|
|
3047
3074
|
onChangeFormatting,
|
|
3048
3075
|
onChangeRendering,
|
|
3049
|
-
onChangeType
|
|
3076
|
+
onChangeColumnType: onChangeType
|
|
3050
3077
|
}
|
|
3051
3078
|
),
|
|
3052
|
-
editCalculatedColumn ? /* @__PURE__ */ (0,
|
|
3053
|
-
/* @__PURE__ */ (0,
|
|
3079
|
+
editCalculatedColumn ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "vuuColumnSettingsPanel-buttonBar", "data-align": "right", children: [
|
|
3080
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3054
3081
|
import_core8.Button,
|
|
3055
3082
|
{
|
|
3056
|
-
className: `${
|
|
3083
|
+
className: `${classBase13}-buttonCancel`,
|
|
3057
3084
|
onClick: onCancel,
|
|
3058
3085
|
tabIndex: -1,
|
|
3059
3086
|
children: "cancel"
|
|
3060
3087
|
}
|
|
3061
3088
|
),
|
|
3062
|
-
/* @__PURE__ */ (0,
|
|
3089
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3063
3090
|
import_core8.Button,
|
|
3064
3091
|
{
|
|
3065
|
-
className: `${
|
|
3092
|
+
className: `${classBase13}-buttonSave`,
|
|
3066
3093
|
onClick: onSave,
|
|
3067
3094
|
variant: "cta",
|
|
3068
3095
|
children: "save"
|
|
3069
3096
|
}
|
|
3070
3097
|
)
|
|
3071
|
-
] }) : /* @__PURE__ */ (0,
|
|
3098
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
3072
3099
|
"div",
|
|
3073
3100
|
{
|
|
3074
|
-
className: `${
|
|
3101
|
+
className: `${classBase13}-buttonBar`,
|
|
3075
3102
|
"data-align": isNewCalculatedColumn ? "right" : void 0,
|
|
3076
3103
|
children: [
|
|
3077
|
-
/* @__PURE__ */ (0,
|
|
3104
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3078
3105
|
import_core8.Button,
|
|
3079
3106
|
{
|
|
3080
|
-
className: `${
|
|
3107
|
+
className: `${classBase13}-buttonNavPrev`,
|
|
3081
3108
|
variant: "secondary",
|
|
3082
3109
|
"data-icon": "arrow-left",
|
|
3083
3110
|
onClick: navigatePrevColumn,
|
|
3084
3111
|
children: "PREVIOUS"
|
|
3085
3112
|
}
|
|
3086
3113
|
),
|
|
3087
|
-
/* @__PURE__ */ (0,
|
|
3114
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3088
3115
|
import_core8.Button,
|
|
3089
3116
|
{
|
|
3090
|
-
className: `${
|
|
3117
|
+
className: `${classBase13}-buttonNavNext`,
|
|
3091
3118
|
variant: "secondary",
|
|
3092
3119
|
"data-icon": "arrow-right",
|
|
3093
3120
|
onClick: navigateNextColumn,
|
|
@@ -3103,10 +3130,10 @@ var ColumnSettingsPanel = ({
|
|
|
3103
3130
|
};
|
|
3104
3131
|
|
|
3105
3132
|
// src/datasource-stats/DatasourceStats.tsx
|
|
3106
|
-
var
|
|
3133
|
+
var import_clsx8 = __toESM(require("clsx"), 1);
|
|
3107
3134
|
var import_react18 = require("react");
|
|
3108
|
-
var
|
|
3109
|
-
var
|
|
3135
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
3136
|
+
var classBase14 = "vuuDatasourceStats";
|
|
3110
3137
|
var numberFormatter = new Intl.NumberFormat();
|
|
3111
3138
|
var DataSourceStats = ({
|
|
3112
3139
|
className: classNameProp,
|
|
@@ -3118,18 +3145,22 @@ var DataSourceStats = ({
|
|
|
3118
3145
|
setSize(dataSource.size);
|
|
3119
3146
|
dataSource.on("resize", setSize);
|
|
3120
3147
|
dataSource.on("range", setRange);
|
|
3148
|
+
return () => {
|
|
3149
|
+
dataSource.removeListener("resize", setSize);
|
|
3150
|
+
dataSource.removeListener("range", setRange);
|
|
3151
|
+
};
|
|
3121
3152
|
}, [dataSource]);
|
|
3122
|
-
const className = (0,
|
|
3153
|
+
const className = (0, import_clsx8.default)(classBase14, classNameProp);
|
|
3123
3154
|
const from = numberFormatter.format(range.from + 1);
|
|
3124
3155
|
const to = numberFormatter.format(Math.min(range.to, size));
|
|
3125
3156
|
const value = numberFormatter.format(size);
|
|
3126
|
-
return /* @__PURE__ */ (0,
|
|
3127
|
-
/* @__PURE__ */ (0,
|
|
3128
|
-
/* @__PURE__ */ (0,
|
|
3129
|
-
/* @__PURE__ */ (0,
|
|
3130
|
-
/* @__PURE__ */ (0,
|
|
3131
|
-
/* @__PURE__ */ (0,
|
|
3132
|
-
/* @__PURE__ */ (0,
|
|
3157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className, children: [
|
|
3158
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: `${classBase14}-label`, children: "Row count" }),
|
|
3159
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: `${classBase14}-range`, children: from }),
|
|
3160
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: "-" }),
|
|
3161
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: `${classBase14}-range`, children: to }),
|
|
3162
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: "of" }),
|
|
3163
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: `${classBase14}-size`, children: value })
|
|
3133
3164
|
] });
|
|
3134
3165
|
};
|
|
3135
3166
|
|
|
@@ -3138,7 +3169,7 @@ var import_core9 = require("@salt-ds/core");
|
|
|
3138
3169
|
|
|
3139
3170
|
// src/table-settings/useTableSettings.ts
|
|
3140
3171
|
var import_vuu_table = require("@vuu-ui/vuu-table");
|
|
3141
|
-
var
|
|
3172
|
+
var import_vuu_utils23 = require("@vuu-ui/vuu-utils");
|
|
3142
3173
|
var import_react19 = require("react");
|
|
3143
3174
|
var sortOrderFromAvailableColumns = (availableColumns, columns) => {
|
|
3144
3175
|
const sortedColumns = [];
|
|
@@ -3155,7 +3186,7 @@ var buildColumnItems = (availableColumns, configuredColumns) => {
|
|
|
3155
3186
|
const configuredColumn = configuredColumns.find((col) => col.name === name2);
|
|
3156
3187
|
return {
|
|
3157
3188
|
hidden: configuredColumn == null ? void 0 : configuredColumn.hidden,
|
|
3158
|
-
isCalculated: (0,
|
|
3189
|
+
isCalculated: (0, import_vuu_utils23.isCalculatedColumn)(name2),
|
|
3159
3190
|
label: configuredColumn == null ? void 0 : configuredColumn.label,
|
|
3160
3191
|
name: name2,
|
|
3161
3192
|
serverDataType,
|
|
@@ -3180,7 +3211,7 @@ var useTableSettings = ({
|
|
|
3180
3211
|
const handleMoveListItem = (0, import_react19.useCallback)(
|
|
3181
3212
|
(fromIndex, toIndex) => {
|
|
3182
3213
|
setColumnState((state) => {
|
|
3183
|
-
const newAvailableColumns = (0,
|
|
3214
|
+
const newAvailableColumns = (0, import_vuu_utils23.moveItem)(
|
|
3184
3215
|
state.availableColumns,
|
|
3185
3216
|
fromIndex,
|
|
3186
3217
|
toIndex
|
|
@@ -3211,7 +3242,7 @@ var useTableSettings = ({
|
|
|
3211
3242
|
tableConfig: {
|
|
3212
3243
|
...tableConfig,
|
|
3213
3244
|
columns: tableConfig.columns.filter(
|
|
3214
|
-
(0,
|
|
3245
|
+
(0, import_vuu_utils23.subscribedOnly)(subscribedColumns)
|
|
3215
3246
|
)
|
|
3216
3247
|
}
|
|
3217
3248
|
}));
|
|
@@ -3221,7 +3252,7 @@ var useTableSettings = ({
|
|
|
3221
3252
|
} else {
|
|
3222
3253
|
const newConfig = {
|
|
3223
3254
|
...tableConfig,
|
|
3224
|
-
columns: (0,
|
|
3255
|
+
columns: (0, import_vuu_utils23.addColumnToSubscribedColumns)(
|
|
3225
3256
|
tableConfig.columns,
|
|
3226
3257
|
availableColumns,
|
|
3227
3258
|
name2
|
|
@@ -3255,30 +3286,48 @@ var useTableSettings = ({
|
|
|
3255
3286
|
[availableColumns, columnItems, onDataSourceConfigChange, tableConfig]
|
|
3256
3287
|
);
|
|
3257
3288
|
const handleChangeColumnLabels = (0, import_react19.useCallback)((evt) => {
|
|
3258
|
-
const
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
...state
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3289
|
+
const button = (0, import_vuu_utils23.queryClosest)(evt.target, "button");
|
|
3290
|
+
if (button) {
|
|
3291
|
+
const value = parseInt(button.value);
|
|
3292
|
+
const columnFormatHeader = value === 0 ? void 0 : value === 1 ? "capitalize" : "uppercase";
|
|
3293
|
+
setColumnState((state) => ({
|
|
3294
|
+
...state,
|
|
3295
|
+
tableConfig: {
|
|
3296
|
+
...state.tableConfig,
|
|
3297
|
+
columnFormatHeader
|
|
3298
|
+
}
|
|
3299
|
+
}));
|
|
3300
|
+
}
|
|
3267
3301
|
}, []);
|
|
3268
3302
|
const handleChangeTableAttribute = (0, import_react19.useCallback)(
|
|
3269
3303
|
(evt) => {
|
|
3270
|
-
const
|
|
3304
|
+
const button = (0, import_vuu_utils23.queryClosest)(evt.target, "button");
|
|
3305
|
+
const { ariaPressed, value } = button;
|
|
3306
|
+
console.log({ ariaPressed, value, button });
|
|
3271
3307
|
setColumnState((state) => ({
|
|
3272
3308
|
...state,
|
|
3273
3309
|
tableConfig: {
|
|
3274
3310
|
...state.tableConfig,
|
|
3275
|
-
[value]:
|
|
3311
|
+
[value]: ariaPressed !== "true"
|
|
3276
3312
|
}
|
|
3277
3313
|
}));
|
|
3278
3314
|
},
|
|
3279
3315
|
[]
|
|
3280
3316
|
);
|
|
3281
|
-
(0,
|
|
3317
|
+
const handleCommitColumnWidth = (0, import_react19.useCallback)((_, value) => {
|
|
3318
|
+
const columnDefaultWidth = parseInt(value);
|
|
3319
|
+
if (!isNaN(columnDefaultWidth)) {
|
|
3320
|
+
setColumnState((state) => ({
|
|
3321
|
+
...state,
|
|
3322
|
+
tableConfig: {
|
|
3323
|
+
...state.tableConfig,
|
|
3324
|
+
columnDefaultWidth
|
|
3325
|
+
}
|
|
3326
|
+
}));
|
|
3327
|
+
}
|
|
3328
|
+
console.log({ value });
|
|
3329
|
+
}, []);
|
|
3330
|
+
(0, import_vuu_utils23.useLayoutEffectSkipFirst)(() => {
|
|
3282
3331
|
onConfigChange == null ? void 0 : onConfigChange(tableConfig);
|
|
3283
3332
|
}, [onConfigChange, tableConfig]);
|
|
3284
3333
|
const columnLabelsValue = tableConfig.columnFormatHeader === void 0 ? 0 : tableConfig.columnFormatHeader === "capitalize" ? 1 : 2;
|
|
@@ -3288,14 +3337,17 @@ var useTableSettings = ({
|
|
|
3288
3337
|
onChangeColumnLabels: handleChangeColumnLabels,
|
|
3289
3338
|
onChangeTableAttribute: handleChangeTableAttribute,
|
|
3290
3339
|
onColumnChange: handleColumnChange,
|
|
3340
|
+
onCommitColumnWidth: handleCommitColumnWidth,
|
|
3291
3341
|
onMoveListItem: handleMoveListItem,
|
|
3292
3342
|
tableConfig
|
|
3293
3343
|
};
|
|
3294
3344
|
};
|
|
3295
3345
|
|
|
3296
3346
|
// src/table-settings/TableSettingsPanel.tsx
|
|
3297
|
-
var
|
|
3298
|
-
var
|
|
3347
|
+
var import_vuu_ui_controls8 = require("@vuu-ui/vuu-ui-controls");
|
|
3348
|
+
var import_vuu_ui_controls9 = require("@vuu-ui/vuu-ui-controls");
|
|
3349
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
3350
|
+
var classBase15 = "vuuTableSettingsPanel";
|
|
3299
3351
|
var TableSettingsPanel = ({
|
|
3300
3352
|
availableColumns,
|
|
3301
3353
|
onAddCalculatedColumn,
|
|
@@ -3311,6 +3363,7 @@ var TableSettingsPanel = ({
|
|
|
3311
3363
|
onChangeColumnLabels,
|
|
3312
3364
|
onChangeTableAttribute,
|
|
3313
3365
|
onColumnChange,
|
|
3366
|
+
onCommitColumnWidth,
|
|
3314
3367
|
onMoveListItem,
|
|
3315
3368
|
tableConfig
|
|
3316
3369
|
} = useTableSettings({
|
|
@@ -3319,84 +3372,60 @@ var TableSettingsPanel = ({
|
|
|
3319
3372
|
onDataSourceConfigChange,
|
|
3320
3373
|
tableConfig: tableConfigProp
|
|
3321
3374
|
});
|
|
3322
|
-
return /* @__PURE__ */ (0,
|
|
3323
|
-
/* @__PURE__ */ (0,
|
|
3324
|
-
/* @__PURE__ */ (0,
|
|
3325
|
-
/* @__PURE__ */ (0,
|
|
3375
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: classBase15, children: [
|
|
3376
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core9.FormField, { children: [
|
|
3377
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core9.FormFieldLabel, { children: "Column Labels" }),
|
|
3378
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
3326
3379
|
import_core9.ToggleButtonGroup,
|
|
3327
3380
|
{
|
|
3328
3381
|
className: "vuuToggleButtonGroup",
|
|
3329
3382
|
onChange: onChangeColumnLabels,
|
|
3330
3383
|
value: columnLabelsValue,
|
|
3331
3384
|
children: [
|
|
3332
|
-
/* @__PURE__ */ (0,
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
className: "vuuIconToggleButton",
|
|
3336
|
-
"data-icon": "text-strikethrough",
|
|
3337
|
-
value: 0
|
|
3338
|
-
}
|
|
3339
|
-
),
|
|
3340
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3341
|
-
import_core9.ToggleButton,
|
|
3342
|
-
{
|
|
3343
|
-
className: "vuuIconToggleButton",
|
|
3344
|
-
"data-icon": "text-Tt",
|
|
3345
|
-
value: 1
|
|
3346
|
-
}
|
|
3347
|
-
),
|
|
3348
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3349
|
-
import_core9.ToggleButton,
|
|
3350
|
-
{
|
|
3351
|
-
className: "vuuIconToggleButton",
|
|
3352
|
-
"data-icon": "text-T",
|
|
3353
|
-
value: 2
|
|
3354
|
-
}
|
|
3355
|
-
)
|
|
3385
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core9.ToggleButton, { className: "vuuIconToggleButton", value: 0, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_vuu_ui_controls8.Icon, { name: "text-strikethrough", size: 48 }) }),
|
|
3386
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core9.ToggleButton, { className: "vuuIconToggleButton", value: 1, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_vuu_ui_controls8.Icon, { name: "text-Tt", size: 48 }) }),
|
|
3387
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core9.ToggleButton, { className: "vuuIconToggleButton", value: 2, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_vuu_ui_controls8.Icon, { name: "text-T", size: 48 }) })
|
|
3356
3388
|
]
|
|
3357
3389
|
}
|
|
3358
3390
|
)
|
|
3359
3391
|
] }),
|
|
3360
|
-
/* @__PURE__ */ (0,
|
|
3361
|
-
/* @__PURE__ */ (0,
|
|
3362
|
-
/* @__PURE__ */ (0,
|
|
3363
|
-
/* @__PURE__ */ (0,
|
|
3392
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core9.FormField, { children: [
|
|
3393
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core9.FormFieldLabel, { children: "Grid separators" }),
|
|
3394
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "saltToggleButtonGroup vuuStateButtonGroup saltToggleButtonGroup-horizontal", children: [
|
|
3395
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3364
3396
|
import_core9.ToggleButton,
|
|
3365
3397
|
{
|
|
3366
|
-
className: "vuuIconToggleButton",
|
|
3367
|
-
"data-icon": "row-striping",
|
|
3368
3398
|
selected: (_a = tableConfig.zebraStripes) != null ? _a : false,
|
|
3369
3399
|
onChange: onChangeTableAttribute,
|
|
3370
|
-
value: "zebraStripes"
|
|
3400
|
+
value: "zebraStripes",
|
|
3401
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_vuu_ui_controls8.Icon, { name: "row-striping", size: 16 })
|
|
3371
3402
|
}
|
|
3372
3403
|
),
|
|
3373
|
-
/* @__PURE__ */ (0,
|
|
3404
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3374
3405
|
import_core9.ToggleButton,
|
|
3375
3406
|
{
|
|
3376
|
-
className: "vuuIconToggleButton",
|
|
3377
|
-
"data-icon": "row-lines",
|
|
3378
3407
|
selected: (_b = tableConfig.rowSeparators) != null ? _b : false,
|
|
3379
3408
|
onChange: onChangeTableAttribute,
|
|
3380
|
-
value: "rowSeparators"
|
|
3409
|
+
value: "rowSeparators",
|
|
3410
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_vuu_ui_controls8.Icon, { name: "row-lines", size: 16 })
|
|
3381
3411
|
}
|
|
3382
3412
|
),
|
|
3383
|
-
/* @__PURE__ */ (0,
|
|
3413
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3384
3414
|
import_core9.ToggleButton,
|
|
3385
3415
|
{
|
|
3386
|
-
className: "vuuIconToggleButton",
|
|
3387
|
-
"data-icon": "col-lines",
|
|
3388
3416
|
selected: (_c = tableConfig.columnSeparators) != null ? _c : false,
|
|
3389
3417
|
onChange: onChangeTableAttribute,
|
|
3390
|
-
value: "columnSeparators"
|
|
3418
|
+
value: "columnSeparators",
|
|
3419
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_vuu_ui_controls8.Icon, { name: "col-lines", size: 16 })
|
|
3391
3420
|
}
|
|
3392
3421
|
)
|
|
3393
3422
|
] })
|
|
3394
3423
|
] }),
|
|
3395
|
-
/* @__PURE__ */ (0,
|
|
3396
|
-
/* @__PURE__ */ (0,
|
|
3397
|
-
/* @__PURE__ */ (0,
|
|
3424
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core9.FormField, { children: [
|
|
3425
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core9.FormFieldLabel, { children: "Default Column Width" }),
|
|
3426
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_vuu_ui_controls9.VuuInput, { className: "vuuInput", onCommit: onCommitColumnWidth })
|
|
3398
3427
|
] }),
|
|
3399
|
-
/* @__PURE__ */ (0,
|
|
3428
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3400
3429
|
ColumnList,
|
|
3401
3430
|
{
|
|
3402
3431
|
columnItems,
|
|
@@ -3405,9 +3434,9 @@ var TableSettingsPanel = ({
|
|
|
3405
3434
|
onNavigateToColumn
|
|
3406
3435
|
}
|
|
3407
3436
|
),
|
|
3408
|
-
/* @__PURE__ */ (0,
|
|
3409
|
-
/* @__PURE__ */ (0,
|
|
3410
|
-
/* @__PURE__ */ (0,
|
|
3437
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: `${classBase15}-calculatedButtonbar`, children: [
|
|
3438
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core9.Button, { "data-icon": "plus", onClick: onAddCalculatedColumn }),
|
|
3439
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: `${classBase15}-calculatedLabel`, children: "Add calculated column" })
|
|
3411
3440
|
] })
|
|
3412
3441
|
] });
|
|
3413
3442
|
};
|