@dreamtree-org/twreact-ui 1.1.70 → 1.1.72
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/README.md +2 -1
- package/dist/ai-schema.json +21 -0
- package/dist/components/core/Checkbox.d.ts.map +1 -1
- package/dist/components/core/Switch.d.ts.map +1 -1
- package/dist/components/core/Table/FieldInput.d.ts +3 -2
- package/dist/components/core/Table/FieldInput.d.ts.map +1 -1
- package/dist/components/core/Table/Table.d.ts +2 -1
- package/dist/components/core/Table/Table.d.ts.map +1 -1
- package/dist/components/core/Table/TableRow.d.ts +2 -1
- package/dist/components/core/Table/TableRow.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +402 -77
- package/dist/index.js +402 -77
- package/dist/types/index.d.ts +23 -0
- package/dist/types/index.d.ts.map +1 -1
- package/mcp/catalog.snapshot.json +23 -5
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -3171,8 +3171,8 @@ function cn$1() {
|
|
|
3171
3171
|
}
|
|
3172
3172
|
|
|
3173
3173
|
var _excluded$A = ["id", "className", "type", "label", "placeholder", "error", "success", "disabled", "required", "clearable", "icon", "iconPosition", "onClear", "showCount", "maxLength", "readOnly", "onChange", "value", "defaultValue"];
|
|
3174
|
-
function ownKeys$
|
|
3175
|
-
function _objectSpread$
|
|
3174
|
+
function ownKeys$G(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3175
|
+
function _objectSpread$G(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$G(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$G(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3176
3176
|
var Input = /*#__PURE__*/forwardRef(function (props, forwardedRef) {
|
|
3177
3177
|
var _ref$current$value2, _ref$current;
|
|
3178
3178
|
var id = props.id,
|
|
@@ -3287,7 +3287,7 @@ var Input = /*#__PURE__*/forwardRef(function (props, forwardedRef) {
|
|
|
3287
3287
|
className: "text-primary-400",
|
|
3288
3288
|
children: icon
|
|
3289
3289
|
})
|
|
3290
|
-
}), jsx("input", _objectSpread$
|
|
3290
|
+
}), jsx("input", _objectSpread$G({
|
|
3291
3291
|
id: inputId,
|
|
3292
3292
|
ref: ref,
|
|
3293
3293
|
type: inputType,
|
|
@@ -3348,8 +3348,8 @@ var Input = /*#__PURE__*/forwardRef(function (props, forwardedRef) {
|
|
|
3348
3348
|
});
|
|
3349
3349
|
|
|
3350
3350
|
var _excluded$z = ["className", "variant", "size", "disabled", "loading", "children", "leftIcon", "rightIcon", "fullWidth"];
|
|
3351
|
-
function ownKeys$
|
|
3352
|
-
function _objectSpread$
|
|
3351
|
+
function ownKeys$F(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3352
|
+
function _objectSpread$F(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$F(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$F(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3353
3353
|
var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
3354
3354
|
var className = _ref.className,
|
|
3355
3355
|
_ref$variant = _ref.variant,
|
|
@@ -3379,7 +3379,7 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
3379
3379
|
// Full width
|
|
3380
3380
|
'w-full': fullWidth
|
|
3381
3381
|
}, className);
|
|
3382
|
-
return jsxs("button", _objectSpread$
|
|
3382
|
+
return jsxs("button", _objectSpread$F(_objectSpread$F({
|
|
3383
3383
|
ref: ref,
|
|
3384
3384
|
className: baseClasses,
|
|
3385
3385
|
disabled: disabled || loading
|
|
@@ -3414,8 +3414,8 @@ function _toConsumableArray$1(r) {
|
|
|
3414
3414
|
}
|
|
3415
3415
|
|
|
3416
3416
|
var _excluded$y = ["options", "value", "onChange", "placeholder", "label", "error", "disabled", "required", "multiSelect", "searchable", "grouped", "onMenuItemRender", "className", "allowClear", "creatable", "onCreateOption", "onSearch", "loading", "selectAllOption", "closeOnSelect", "maxTagCount", "renderGroupLabel", "name"];
|
|
3417
|
-
function ownKeys$
|
|
3418
|
-
function _objectSpread$
|
|
3417
|
+
function ownKeys$E(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3418
|
+
function _objectSpread$E(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$E(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$E(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3419
3419
|
/**
|
|
3420
3420
|
* Enhanced Select component (debounce removed)
|
|
3421
3421
|
* - Supports single and multi select
|
|
@@ -3436,7 +3436,7 @@ var flattenGroups = function flattenGroups() {
|
|
|
3436
3436
|
return groups.reduce(function (acc, g) {
|
|
3437
3437
|
var groupLabel = g.label;
|
|
3438
3438
|
g.options.forEach(function (opt) {
|
|
3439
|
-
return acc.push(_objectSpread$
|
|
3439
|
+
return acc.push(_objectSpread$E(_objectSpread$E({}, opt), {}, {
|
|
3440
3440
|
_group: groupLabel
|
|
3441
3441
|
}));
|
|
3442
3442
|
});
|
|
@@ -3532,7 +3532,7 @@ var Select = /*#__PURE__*/React__default.forwardRef(function (_ref, forwardedRef
|
|
|
3532
3532
|
var flatOptions = useMemo(function () {
|
|
3533
3533
|
if (grouped) return flattenGroups(options);
|
|
3534
3534
|
return options.map(function (opt) {
|
|
3535
|
-
return _objectSpread$
|
|
3535
|
+
return _objectSpread$E({}, opt);
|
|
3536
3536
|
});
|
|
3537
3537
|
}, [options, grouped]);
|
|
3538
3538
|
var selectedValues = multiSelect ? Array.isArray(value) ? value : [] : value;
|
|
@@ -3557,7 +3557,7 @@ var Select = /*#__PURE__*/React__default.forwardRef(function (_ref, forwardedRef
|
|
|
3557
3557
|
}
|
|
3558
3558
|
if (grouped) {
|
|
3559
3559
|
return options.map(function (g) {
|
|
3560
|
-
return _objectSpread$
|
|
3560
|
+
return _objectSpread$E(_objectSpread$E({}, g), {}, {
|
|
3561
3561
|
options: g.options.filter(function (o) {
|
|
3562
3562
|
return o.label.toLowerCase().includes(searchTerm.toLowerCase());
|
|
3563
3563
|
})
|
|
@@ -3827,7 +3827,7 @@ var Select = /*#__PURE__*/React__default.forwardRef(function (_ref, forwardedRef
|
|
|
3827
3827
|
className: "text-xs border border-slate-200 p-0.5 rounded-md cursor-pointer hover:bg-gray-100",
|
|
3828
3828
|
onClick: function onClick() {
|
|
3829
3829
|
return setCollapsedGroups(function (prev) {
|
|
3830
|
-
return _objectSpread$
|
|
3830
|
+
return _objectSpread$E(_objectSpread$E({}, prev), {}, _defineProperty$4({}, group.label, !prev[group.label]));
|
|
3831
3831
|
});
|
|
3832
3832
|
},
|
|
3833
3833
|
children: jsx(ChevronDown, {
|
|
@@ -3921,7 +3921,7 @@ var Select = /*#__PURE__*/React__default.forwardRef(function (_ref, forwardedRef
|
|
|
3921
3921
|
}), jsxs("div", {
|
|
3922
3922
|
ref: selectRef,
|
|
3923
3923
|
className: "relative",
|
|
3924
|
-
children: [jsxs("button", _objectSpread$
|
|
3924
|
+
children: [jsxs("button", _objectSpread$E(_objectSpread$E({
|
|
3925
3925
|
type: "button",
|
|
3926
3926
|
"aria-haspopup": "listbox",
|
|
3927
3927
|
"aria-expanded": isOpen,
|
|
@@ -3988,7 +3988,7 @@ var Select = /*#__PURE__*/React__default.forwardRef(function (_ref, forwardedRef
|
|
|
3988
3988
|
// escapes any ancestor overflow:hidden|auto|scroll. Coordinates
|
|
3989
3989
|
// are anchored to the trigger's viewport rect; width matches the
|
|
3990
3990
|
// trigger; maxHeight is driven by available space.
|
|
3991
|
-
style: _objectSpread$
|
|
3991
|
+
style: _objectSpread$E({
|
|
3992
3992
|
left: menuCoords ? "".concat(menuCoords.left, "px") : undefined,
|
|
3993
3993
|
top: menuCoords ? "".concat(menuCoords.top, "px") : undefined,
|
|
3994
3994
|
width: menuCoords ? "".concat(menuCoords.width, "px") : undefined
|
|
@@ -4470,8 +4470,8 @@ var DEFAULT_ACTIONS = [{
|
|
|
4470
4470
|
})
|
|
4471
4471
|
}];
|
|
4472
4472
|
|
|
4473
|
-
function ownKeys$
|
|
4474
|
-
function _objectSpread$
|
|
4473
|
+
function ownKeys$D(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4474
|
+
function _objectSpread$D(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$D(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$D(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4475
4475
|
function _createForOfIteratorHelper$1(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: true } : { done: false, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = true, u = false; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = true, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
4476
4476
|
function _unsupportedIterableToArray$1(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$1(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0; } }
|
|
4477
4477
|
function _arrayLikeToArray$1(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
@@ -4535,7 +4535,7 @@ var mergeDefaultActions = function mergeDefaultActions(overrides, defaults) {
|
|
|
4535
4535
|
_iterator.f();
|
|
4536
4536
|
}
|
|
4537
4537
|
var merged = defaults.map(function (d) {
|
|
4538
|
-
return d !== null && d !== void 0 && d.name && byName.has(d.name) ? _objectSpread$
|
|
4538
|
+
return d !== null && d !== void 0 && d.name && byName.has(d.name) ? _objectSpread$D(_objectSpread$D({}, d), byName.get(d.name)) : d;
|
|
4539
4539
|
});
|
|
4540
4540
|
var defaultNames = new Set(defaults.map(function (d) {
|
|
4541
4541
|
return d === null || d === void 0 ? void 0 : d.name;
|
|
@@ -4577,7 +4577,7 @@ var resolveActions = function resolveActions(actions, row, index) {
|
|
|
4577
4577
|
var action = _step2.value;
|
|
4578
4578
|
if (!action || _typeof$4(action) !== "object") continue;
|
|
4579
4579
|
if (callIfFn(action.hidden, row, index)) continue;
|
|
4580
|
-
var resolved = _objectSpread$
|
|
4580
|
+
var resolved = _objectSpread$D(_objectSpread$D({}, action), {}, {
|
|
4581
4581
|
label: callIfFn(action.label, row, index),
|
|
4582
4582
|
icon: callIfFn(action.icon, row, index),
|
|
4583
4583
|
disabled: !!callIfFn(action.disabled, row, index),
|
|
@@ -5114,6 +5114,8 @@ function ActionMenu(_ref) {
|
|
|
5114
5114
|
}), document.body);
|
|
5115
5115
|
}
|
|
5116
5116
|
|
|
5117
|
+
function ownKeys$C(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5118
|
+
function _objectSpread$C(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$C(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$C(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5117
5119
|
/**
|
|
5118
5120
|
* Desktop table row component
|
|
5119
5121
|
*/
|
|
@@ -5162,6 +5164,8 @@ function TableRow(_ref) {
|
|
|
5162
5164
|
renderInteractiveCellInput = _ref$renderInteractiv === void 0 ? null : _ref$renderInteractiv,
|
|
5163
5165
|
_ref$invalidCellSet = _ref.invalidCellSet,
|
|
5164
5166
|
invalidCellSet = _ref$invalidCellSet === void 0 ? null : _ref$invalidCellSet,
|
|
5167
|
+
_ref$pendingEdits = _ref.pendingEdits,
|
|
5168
|
+
pendingEdits = _ref$pendingEdits === void 0 ? null : _ref$pendingEdits,
|
|
5165
5169
|
_ref$isNewRow = _ref.isNewRow,
|
|
5166
5170
|
isNewRow = _ref$isNewRow === void 0 ? false : _ref$isNewRow,
|
|
5167
5171
|
_ref$onDeleteNewRow = _ref.onDeleteNewRow,
|
|
@@ -5189,6 +5193,10 @@ function TableRow(_ref) {
|
|
|
5189
5193
|
var stripeBg = stripedRows && !isSelected && Array.isArray(stripeColors) && stripeColors.length > 0 ? stripeColors[globalIndex % stripeColors.length] : undefined;
|
|
5190
5194
|
var rowKey = isNewRow ? row._key : key;
|
|
5191
5195
|
var isRowActive = interactive && (activeCell === null || activeCell === void 0 ? void 0 : activeCell.rowKey) === rowKey;
|
|
5196
|
+
var effectiveRow = React__default.useMemo(function () {
|
|
5197
|
+
if (!interactive || !pendingEdits || !pendingEdits[rowKey]) return row;
|
|
5198
|
+
return _objectSpread$C(_objectSpread$C({}, row), pendingEdits[rowKey]);
|
|
5199
|
+
}, [interactive, pendingEdits, rowKey, row]);
|
|
5192
5200
|
return jsxs(React__default.Fragment, {
|
|
5193
5201
|
children: [jsxs("tr", {
|
|
5194
5202
|
style: stripeBg ? {
|
|
@@ -5201,7 +5209,7 @@ function TableRow(_ref) {
|
|
|
5201
5209
|
"bg-amber-50/40": isNewRow && !isSelected && !isRowActive
|
|
5202
5210
|
}, safeExtraRowClass),
|
|
5203
5211
|
onClick: function onClick() {
|
|
5204
|
-
return onRowClick === null || onRowClick === void 0 ? void 0 : onRowClick(
|
|
5212
|
+
return onRowClick === null || onRowClick === void 0 ? void 0 : onRowClick(effectiveRow, globalIndex);
|
|
5205
5213
|
},
|
|
5206
5214
|
children: [hasDetailsColumn && jsx("td", {
|
|
5207
5215
|
className: "px-4 py-4 text-sm",
|
|
@@ -5209,7 +5217,7 @@ function TableRow(_ref) {
|
|
|
5209
5217
|
type: "button",
|
|
5210
5218
|
onClick: function onClick(e) {
|
|
5211
5219
|
e.stopPropagation();
|
|
5212
|
-
toggleExpandRow(
|
|
5220
|
+
toggleExpandRow(effectiveRow, rowIndexInPage);
|
|
5213
5221
|
},
|
|
5214
5222
|
"aria-expanded": isExpanded,
|
|
5215
5223
|
"aria-label": isExpanded ? "Collapse row details" : "Expand row details",
|
|
@@ -5229,12 +5237,12 @@ function TableRow(_ref) {
|
|
|
5229
5237
|
className: "rounded border-gray-300",
|
|
5230
5238
|
checked: isSelected,
|
|
5231
5239
|
onChange: function onChange() {
|
|
5232
|
-
return handleSelectRow(
|
|
5240
|
+
return handleSelectRow(effectiveRow, rowIndexInPage);
|
|
5233
5241
|
}
|
|
5234
5242
|
})
|
|
5235
5243
|
}), visibleColumns.map(function (column, columnIndex) {
|
|
5236
5244
|
var extraCellClass = typeof cellClass === "function" ? cellClass({
|
|
5237
|
-
row:
|
|
5245
|
+
row: effectiveRow,
|
|
5238
5246
|
rowIndex: globalIndex,
|
|
5239
5247
|
column: column,
|
|
5240
5248
|
columnIndex: columnIndex
|
|
@@ -5253,15 +5261,15 @@ function TableRow(_ref) {
|
|
|
5253
5261
|
}, safeExtraCellClass),
|
|
5254
5262
|
onClick: function onClick(e) {
|
|
5255
5263
|
if (interactive && onCellClick) {
|
|
5256
|
-
onCellClick(rowKey, column.key,
|
|
5264
|
+
onCellClick(rowKey, column.key, effectiveRow, column, globalIndex);
|
|
5257
5265
|
}
|
|
5258
5266
|
},
|
|
5259
5267
|
onDoubleClick: function onDoubleClick(e) {
|
|
5260
5268
|
if (interactive && onCellDoubleClick && column.editable !== false) {
|
|
5261
|
-
onCellDoubleClick(rowKey, column.key,
|
|
5269
|
+
onCellDoubleClick(rowKey, column.key, effectiveRow, column, globalIndex);
|
|
5262
5270
|
}
|
|
5263
5271
|
},
|
|
5264
|
-
children: isCellEditing && renderInteractiveCellInput ? renderInteractiveCellInput(column,
|
|
5272
|
+
children: isCellEditing && renderInteractiveCellInput ? renderInteractiveCellInput(column, effectiveRow, globalIndex, rowKey) : renderCell(column, effectiveRow, globalIndex)
|
|
5265
5273
|
}, column.key);
|
|
5266
5274
|
}), jsx("td", {
|
|
5267
5275
|
className: "px-4 py-4"
|
|
@@ -5532,6 +5540,7 @@ function FieldInput(_ref) {
|
|
|
5532
5540
|
var column = _ref.column,
|
|
5533
5541
|
value = _ref.value,
|
|
5534
5542
|
_onChange = _ref.onChange,
|
|
5543
|
+
onKeyDown = _ref.onKeyDown,
|
|
5535
5544
|
_ref$isEditing = _ref.isEditing,
|
|
5536
5545
|
isEditing = _ref$isEditing === void 0 ? true : _ref$isEditing,
|
|
5537
5546
|
_ref$row = _ref.row,
|
|
@@ -5544,14 +5553,22 @@ function FieldInput(_ref) {
|
|
|
5544
5553
|
autoFocus = _ref$autoFocus === void 0 ? false : _ref$autoFocus;
|
|
5545
5554
|
var currentValue = value !== null && value !== void 0 ? value : "";
|
|
5546
5555
|
var inputType = column.type || column.inputType || "text";
|
|
5556
|
+
var stopProp = function stopProp(e) {
|
|
5557
|
+
e.stopPropagation();
|
|
5558
|
+
};
|
|
5547
5559
|
// Check if custom onRender renderer is provided on the column definition
|
|
5548
5560
|
if (typeof column.onRender === "function") {
|
|
5549
|
-
return
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5561
|
+
return jsx("div", {
|
|
5562
|
+
onClick: stopProp,
|
|
5563
|
+
onMouseDown: stopProp,
|
|
5564
|
+
children: column.onRender(row, rowIndex, column, {
|
|
5565
|
+
value: currentValue,
|
|
5566
|
+
onChange: function onChange(newVal) {
|
|
5567
|
+
return _onChange === null || _onChange === void 0 ? void 0 : _onChange(newVal);
|
|
5568
|
+
},
|
|
5569
|
+
onKeyDown: onKeyDown,
|
|
5570
|
+
isEditing: isEditing
|
|
5571
|
+
})
|
|
5555
5572
|
});
|
|
5556
5573
|
}
|
|
5557
5574
|
// Textarea / Longtext
|
|
@@ -5563,6 +5580,9 @@ function FieldInput(_ref) {
|
|
|
5563
5580
|
onChange: function onChange(e) {
|
|
5564
5581
|
return _onChange === null || _onChange === void 0 ? void 0 : _onChange(e.target.value);
|
|
5565
5582
|
},
|
|
5583
|
+
onKeyDown: onKeyDown,
|
|
5584
|
+
onClick: stopProp,
|
|
5585
|
+
onMouseDown: stopProp,
|
|
5566
5586
|
placeholder: "Enter ".concat(column.label || column.key, "..."),
|
|
5567
5587
|
className: cn$1("w-full px-2 py-1 text-sm border rounded outline-none transition-all focus:ring-2 focus:ring-primary-500 bg-white resize-y min-h-[2.5rem]", className)
|
|
5568
5588
|
});
|
|
@@ -5581,6 +5601,9 @@ function FieldInput(_ref) {
|
|
|
5581
5601
|
onChange: function onChange(e) {
|
|
5582
5602
|
return _onChange === null || _onChange === void 0 ? void 0 : _onChange(e.target.value);
|
|
5583
5603
|
},
|
|
5604
|
+
onKeyDown: onKeyDown,
|
|
5605
|
+
onClick: stopProp,
|
|
5606
|
+
onMouseDown: stopProp,
|
|
5584
5607
|
className: cn$1("w-full px-2 py-1 text-sm border rounded outline-none focus:ring-2 focus:ring-primary-500 bg-white", className),
|
|
5585
5608
|
children: [jsxs("option", {
|
|
5586
5609
|
value: "",
|
|
@@ -5598,6 +5621,8 @@ function FieldInput(_ref) {
|
|
|
5598
5621
|
var checked = Boolean(currentValue);
|
|
5599
5622
|
return jsx("div", {
|
|
5600
5623
|
className: cn$1("flex items-center justify-center py-1", className),
|
|
5624
|
+
onClick: stopProp,
|
|
5625
|
+
onMouseDown: stopProp,
|
|
5601
5626
|
children: jsx("input", {
|
|
5602
5627
|
type: "checkbox",
|
|
5603
5628
|
autoFocus: autoFocus,
|
|
@@ -5605,6 +5630,7 @@ function FieldInput(_ref) {
|
|
|
5605
5630
|
onChange: function onChange(e) {
|
|
5606
5631
|
return _onChange === null || _onChange === void 0 ? void 0 : _onChange(e.target.checked);
|
|
5607
5632
|
},
|
|
5633
|
+
onKeyDown: onKeyDown,
|
|
5608
5634
|
className: "w-4 h-4 text-primary-600 border-gray-300 rounded focus:ring-primary-500 cursor-pointer"
|
|
5609
5635
|
})
|
|
5610
5636
|
});
|
|
@@ -5618,6 +5644,9 @@ function FieldInput(_ref) {
|
|
|
5618
5644
|
onChange: function onChange(e) {
|
|
5619
5645
|
return _onChange === null || _onChange === void 0 ? void 0 : _onChange(e.target.value);
|
|
5620
5646
|
},
|
|
5647
|
+
onKeyDown: onKeyDown,
|
|
5648
|
+
onClick: stopProp,
|
|
5649
|
+
onMouseDown: stopProp,
|
|
5621
5650
|
className: cn$1("w-full px-2 py-1 text-sm border rounded outline-none focus:ring-2 focus:ring-primary-500 bg-white", className)
|
|
5622
5651
|
});
|
|
5623
5652
|
}
|
|
@@ -5630,6 +5659,9 @@ function FieldInput(_ref) {
|
|
|
5630
5659
|
onChange: function onChange(e) {
|
|
5631
5660
|
return _onChange === null || _onChange === void 0 ? void 0 : _onChange(e.target.value === "" ? "" : Number(e.target.value));
|
|
5632
5661
|
},
|
|
5662
|
+
onKeyDown: onKeyDown,
|
|
5663
|
+
onClick: stopProp,
|
|
5664
|
+
onMouseDown: stopProp,
|
|
5633
5665
|
placeholder: "Enter ".concat(column.label || column.key, "..."),
|
|
5634
5666
|
className: cn$1("w-full px-2 py-1 text-sm border rounded outline-none focus:ring-2 focus:ring-primary-500 bg-white", className)
|
|
5635
5667
|
});
|
|
@@ -5642,12 +5674,15 @@ function FieldInput(_ref) {
|
|
|
5642
5674
|
onChange: function onChange(e) {
|
|
5643
5675
|
return _onChange === null || _onChange === void 0 ? void 0 : _onChange(e.target.value);
|
|
5644
5676
|
},
|
|
5677
|
+
onKeyDown: onKeyDown,
|
|
5678
|
+
onClick: stopProp,
|
|
5679
|
+
onMouseDown: stopProp,
|
|
5645
5680
|
placeholder: "Enter ".concat(column.label || column.key, "..."),
|
|
5646
5681
|
className: cn$1("w-full px-2 py-1 text-sm border rounded outline-none focus:ring-2 focus:ring-primary-500 bg-white", className)
|
|
5647
5682
|
});
|
|
5648
5683
|
}
|
|
5649
5684
|
|
|
5650
|
-
var _excluded$x = ["data", "columns", "sortable", "filterable", "selectable", "pagination", "pageSize", "onSort", "onFilter", "onFetch", "onFilterChange", "onSelectionChange", "onRowClick", "hasDetails", "DetailsComponent", "className", "withAction", "onAction", "actions", "replaceDefaultActions", "showSerial", "cellClass", "rowClass", "globalSearch", "limitOptions", "showLimitSelector", "onLimitChange", "showReloadButton", "renderReloadButton", "onReload", "stripedRows", "theme", "responsiveBreakpoint", "serverSide", "totalRecords", "pageNumber", "onPageChange", "TheadComponent", "TfootComponent", "interactive", "onSave", "onRowAdd", "onRowDelete"],
|
|
5685
|
+
var _excluded$x = ["data", "columns", "sortable", "filterable", "selectable", "pagination", "pageSize", "onSort", "onFilter", "onFetch", "onFilterChange", "onSelectionChange", "onRowClick", "hasDetails", "DetailsComponent", "className", "withAction", "onAction", "actions", "replaceDefaultActions", "showSerial", "cellClass", "rowClass", "globalSearch", "limitOptions", "showLimitSelector", "onLimitChange", "showReloadButton", "renderReloadButton", "onReload", "stripedRows", "theme", "responsiveBreakpoint", "serverSide", "totalRecords", "pageNumber", "onPageChange", "TheadComponent", "TfootComponent", "interactive", "onSave", "onEdit", "onRowAdd", "onRowDelete"],
|
|
5651
5686
|
_excluded2$4 = ["_key", "_isNew"];
|
|
5652
5687
|
function ownKeys$B(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5653
5688
|
function _objectSpread$B(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$B(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$B(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -5727,6 +5762,7 @@ var Table = function Table(_ref) {
|
|
|
5727
5762
|
_ref$interactive = _ref.interactive,
|
|
5728
5763
|
interactive = _ref$interactive === void 0 ? false : _ref$interactive,
|
|
5729
5764
|
onSave = _ref.onSave,
|
|
5765
|
+
onEdit = _ref.onEdit,
|
|
5730
5766
|
onRowAdd = _ref.onRowAdd,
|
|
5731
5767
|
onRowDelete = _ref.onRowDelete,
|
|
5732
5768
|
props = _objectWithoutProperties$1(_ref, _excluded$x);
|
|
@@ -5979,15 +6015,33 @@ var Table = function Table(_ref) {
|
|
|
5979
6015
|
setNewRows(function (prev) {
|
|
5980
6016
|
var next = _toConsumableArray$1(prev);
|
|
5981
6017
|
next[newRowIdx] = _objectSpread$B(_objectSpread$B({}, next[newRowIdx]), {}, _defineProperty$4({}, colKey, newValue));
|
|
6018
|
+
onEdit === null || onEdit === void 0 || onEdit({
|
|
6019
|
+
rowKey: rowKey,
|
|
6020
|
+
colKey: colKey,
|
|
6021
|
+
newValue: newValue,
|
|
6022
|
+
row: next[newRowIdx],
|
|
6023
|
+
isNew: true
|
|
6024
|
+
});
|
|
5982
6025
|
return next;
|
|
5983
6026
|
});
|
|
5984
6027
|
return;
|
|
5985
6028
|
}
|
|
5986
6029
|
setPendingEdits(function (prev) {
|
|
5987
6030
|
var nextRowEdits = _objectSpread$B(_objectSpread$B({}, prev[rowKey] || {}), {}, _defineProperty$4({}, colKey, newValue));
|
|
6031
|
+
var origRow = tableData.find(function (r, i) {
|
|
6032
|
+
return getRowKey(r, i) === rowKey;
|
|
6033
|
+
});
|
|
6034
|
+
var updatedRow = _objectSpread$B(_objectSpread$B({}, origRow), nextRowEdits);
|
|
6035
|
+
onEdit === null || onEdit === void 0 || onEdit({
|
|
6036
|
+
rowKey: rowKey,
|
|
6037
|
+
colKey: colKey,
|
|
6038
|
+
newValue: newValue,
|
|
6039
|
+
row: updatedRow,
|
|
6040
|
+
isNew: false
|
|
6041
|
+
});
|
|
5988
6042
|
return _objectSpread$B(_objectSpread$B({}, prev), {}, _defineProperty$4({}, rowKey, nextRowEdits));
|
|
5989
6043
|
});
|
|
5990
|
-
}, [newRows]);
|
|
6044
|
+
}, [newRows, tableData, onEdit]);
|
|
5991
6045
|
var handleAddRow = useCallback(function () {
|
|
5992
6046
|
var _columnsState$find, _columnsState$;
|
|
5993
6047
|
var newKey = "new-".concat(Date.now());
|
|
@@ -6035,7 +6089,7 @@ var Table = function Table(_ref) {
|
|
|
6035
6089
|
onRowDelete === null || onRowDelete === void 0 || onRowDelete(rowKey);
|
|
6036
6090
|
}, [activeCell, onRowDelete]);
|
|
6037
6091
|
var handleSave = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
6038
|
-
var updatedTableData, finalNewRows, finalData, _t;
|
|
6092
|
+
var _customSaveResult, _customSaveResult2, updatedTableData, finalNewRows, finalData, customSaveResult, nextData, _t;
|
|
6039
6093
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
6040
6094
|
while (1) switch (_context.prev = _context.next) {
|
|
6041
6095
|
case 0:
|
|
@@ -6062,43 +6116,59 @@ var Table = function Table(_ref) {
|
|
|
6062
6116
|
});
|
|
6063
6117
|
finalData = [].concat(_toConsumableArray$1(updatedTableData), _toConsumableArray$1(finalNewRows));
|
|
6064
6118
|
if (!onSave) {
|
|
6065
|
-
_context.next =
|
|
6119
|
+
_context.next = 4;
|
|
6066
6120
|
break;
|
|
6067
6121
|
}
|
|
6068
6122
|
_context.next = 3;
|
|
6069
6123
|
return onSave({
|
|
6070
6124
|
updatedRows: dirtyEdits,
|
|
6071
6125
|
newRows: finalNewRows,
|
|
6072
|
-
allData: finalData
|
|
6126
|
+
allData: finalData,
|
|
6127
|
+
tableData: updatedTableData
|
|
6073
6128
|
});
|
|
6074
6129
|
case 3:
|
|
6075
|
-
|
|
6130
|
+
customSaveResult = _context.sent;
|
|
6131
|
+
case 4:
|
|
6132
|
+
nextData = Array.isArray(customSaveResult) ? customSaveResult : ((_customSaveResult = customSaveResult) === null || _customSaveResult === void 0 ? void 0 : _customSaveResult.data) || ((_customSaveResult2 = customSaveResult) === null || _customSaveResult2 === void 0 ? void 0 : _customSaveResult2.allData) || finalData;
|
|
6133
|
+
setTableData(nextData);
|
|
6134
|
+
initialDataRef.current = nextData;
|
|
6076
6135
|
setPendingEdits({});
|
|
6077
6136
|
setNewRows([]);
|
|
6078
6137
|
setEditingCell(null);
|
|
6079
|
-
_context.next =
|
|
6138
|
+
_context.next = 6;
|
|
6080
6139
|
break;
|
|
6081
|
-
case 4:
|
|
6082
|
-
_context.prev = 4;
|
|
6083
|
-
_t = _context["catch"](2);
|
|
6084
|
-
console.error("Save error:", _t);
|
|
6085
6140
|
case 5:
|
|
6086
6141
|
_context.prev = 5;
|
|
6087
|
-
|
|
6088
|
-
|
|
6142
|
+
_t = _context["catch"](2);
|
|
6143
|
+
console.error("Save error:", _t);
|
|
6089
6144
|
case 6:
|
|
6145
|
+
_context.prev = 6;
|
|
6146
|
+
setIsSaving(false);
|
|
6147
|
+
return _context.finish(6);
|
|
6148
|
+
case 7:
|
|
6090
6149
|
case "end":
|
|
6091
6150
|
return _context.stop();
|
|
6092
6151
|
}
|
|
6093
|
-
}, _callee, null, [[2,
|
|
6152
|
+
}, _callee, null, [[2, 5, 6, 7]]);
|
|
6094
6153
|
})), [isDirty, isSaving, tableData, dirtyEdits, newRows, onSave]);
|
|
6154
|
+
var handleClearChanges = useCallback(function () {
|
|
6155
|
+
setPendingEdits({});
|
|
6156
|
+
setNewRows([]);
|
|
6157
|
+
setEditingCell(null);
|
|
6158
|
+
setActiveCell(null);
|
|
6159
|
+
}, []);
|
|
6095
6160
|
var handleCellClick = useCallback(function (rowKey, colKey, row, column, globalIndex) {
|
|
6096
6161
|
setActiveCell({
|
|
6097
6162
|
rowKey: rowKey,
|
|
6098
6163
|
colKey: colKey,
|
|
6099
6164
|
rowIndex: globalIndex
|
|
6100
6165
|
});
|
|
6101
|
-
setEditingCell(
|
|
6166
|
+
setEditingCell(function (prev) {
|
|
6167
|
+
if (prev && prev.rowKey === rowKey && prev.colKey === colKey) {
|
|
6168
|
+
return prev;
|
|
6169
|
+
}
|
|
6170
|
+
return null;
|
|
6171
|
+
});
|
|
6102
6172
|
}, []);
|
|
6103
6173
|
var handleCellDoubleClick = useCallback(function (rowKey, colKey, row, column, globalIndex) {
|
|
6104
6174
|
setActiveCell({
|
|
@@ -6114,21 +6184,6 @@ var Table = function Table(_ref) {
|
|
|
6114
6184
|
});
|
|
6115
6185
|
}
|
|
6116
6186
|
}, []);
|
|
6117
|
-
var renderInteractiveCellInput = useCallback(function (column, row, globalIndex, rowKey) {
|
|
6118
|
-
var _row$column$key;
|
|
6119
|
-
var value = pendingEdits[rowKey] && pendingEdits[rowKey][column.key] !== undefined ? pendingEdits[rowKey][column.key] : (_row$column$key = row[column.key]) !== null && _row$column$key !== void 0 ? _row$column$key : "";
|
|
6120
|
-
return jsx(FieldInput, {
|
|
6121
|
-
column: column,
|
|
6122
|
-
value: value,
|
|
6123
|
-
onChange: function onChange(newVal) {
|
|
6124
|
-
return handleCellValueChange(rowKey, column.key, newVal);
|
|
6125
|
-
},
|
|
6126
|
-
isEditing: true,
|
|
6127
|
-
row: row,
|
|
6128
|
-
rowIndex: globalIndex,
|
|
6129
|
-
autoFocus: (editingCell === null || editingCell === void 0 ? void 0 : editingCell.rowKey) === rowKey && (editingCell === null || editingCell === void 0 ? void 0 : editingCell.colKey) === column.key
|
|
6130
|
-
});
|
|
6131
|
-
}, [pendingEdits, handleCellValueChange, editingCell]);
|
|
6132
6187
|
useClickOutside([tableContainerRef], interactive && Boolean(editingCell), function () {
|
|
6133
6188
|
setEditingCell(null);
|
|
6134
6189
|
});
|
|
@@ -6279,6 +6334,129 @@ var Table = function Table(_ref) {
|
|
|
6279
6334
|
};
|
|
6280
6335
|
});
|
|
6281
6336
|
}, [limitOptions]);
|
|
6337
|
+
var handleTableKeyDown = useCallback(function (e) {
|
|
6338
|
+
if (!interactive) return;
|
|
6339
|
+
var key = e.key,
|
|
6340
|
+
shiftKey = e.shiftKey;
|
|
6341
|
+
// Escape: stop editing
|
|
6342
|
+
if (key === "Escape") {
|
|
6343
|
+
if (editingCell) {
|
|
6344
|
+
e.preventDefault();
|
|
6345
|
+
setEditingCell(null);
|
|
6346
|
+
}
|
|
6347
|
+
return;
|
|
6348
|
+
}
|
|
6349
|
+
// Enter: Save changes only when there are modified changes (isDirty)
|
|
6350
|
+
if (key === "Enter") {
|
|
6351
|
+
var _e$target;
|
|
6352
|
+
if (((_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.tagName) === "TEXTAREA" && shiftKey) {
|
|
6353
|
+
return;
|
|
6354
|
+
}
|
|
6355
|
+
if (isDirty) {
|
|
6356
|
+
e.preventDefault();
|
|
6357
|
+
setEditingCell(null);
|
|
6358
|
+
if (isValid && !isSaving) {
|
|
6359
|
+
handleSave();
|
|
6360
|
+
}
|
|
6361
|
+
}
|
|
6362
|
+
return;
|
|
6363
|
+
}
|
|
6364
|
+
var currentCell = activeCell || editingCell;
|
|
6365
|
+
if (!currentCell) return;
|
|
6366
|
+
var allRows = [].concat(_toConsumableArray$1(paginatedData), _toConsumableArray$1(newRows));
|
|
6367
|
+
if (allRows.length === 0 || visibleColumns.length === 0) return;
|
|
6368
|
+
var rIdx = allRows.findIndex(function (r, idx) {
|
|
6369
|
+
var rKey = r._key || getRowKey(r, startIndex + idx);
|
|
6370
|
+
return rKey === currentCell.rowKey;
|
|
6371
|
+
});
|
|
6372
|
+
var cIdx = visibleColumns.findIndex(function (c) {
|
|
6373
|
+
return c.key === currentCell.colKey;
|
|
6374
|
+
});
|
|
6375
|
+
if (rIdx === -1 || cIdx === -1) return;
|
|
6376
|
+
var nextRIdx = rIdx;
|
|
6377
|
+
var nextCIdx = cIdx;
|
|
6378
|
+
if (key === "Tab") {
|
|
6379
|
+
e.preventDefault();
|
|
6380
|
+
if (shiftKey) {
|
|
6381
|
+
if (cIdx > 0) {
|
|
6382
|
+
nextCIdx = cIdx - 1;
|
|
6383
|
+
} else if (rIdx > 0) {
|
|
6384
|
+
nextRIdx = rIdx - 1;
|
|
6385
|
+
nextCIdx = visibleColumns.length - 1;
|
|
6386
|
+
}
|
|
6387
|
+
} else {
|
|
6388
|
+
if (cIdx < visibleColumns.length - 1) {
|
|
6389
|
+
nextCIdx = cIdx + 1;
|
|
6390
|
+
} else if (rIdx < allRows.length - 1) {
|
|
6391
|
+
nextRIdx = rIdx + 1;
|
|
6392
|
+
nextCIdx = 0;
|
|
6393
|
+
}
|
|
6394
|
+
}
|
|
6395
|
+
} else if (key === "ArrowRight") {
|
|
6396
|
+
var _e$target2, _e$target$value;
|
|
6397
|
+
if (editingCell && ((_e$target2 = e.target) === null || _e$target2 === void 0 ? void 0 : _e$target2.selectionStart) !== undefined && e.target.selectionStart < String((_e$target$value = e.target.value) !== null && _e$target$value !== void 0 ? _e$target$value : "").length) {
|
|
6398
|
+
return;
|
|
6399
|
+
}
|
|
6400
|
+
if (cIdx < visibleColumns.length - 1) {
|
|
6401
|
+
e.preventDefault();
|
|
6402
|
+
nextCIdx = cIdx + 1;
|
|
6403
|
+
}
|
|
6404
|
+
} else if (key === "ArrowLeft") {
|
|
6405
|
+
var _e$target3;
|
|
6406
|
+
if (editingCell && ((_e$target3 = e.target) === null || _e$target3 === void 0 ? void 0 : _e$target3.selectionStart) !== undefined && e.target.selectionStart > 0) {
|
|
6407
|
+
return;
|
|
6408
|
+
}
|
|
6409
|
+
if (cIdx > 0) {
|
|
6410
|
+
e.preventDefault();
|
|
6411
|
+
nextCIdx = cIdx - 1;
|
|
6412
|
+
}
|
|
6413
|
+
} else if (key === "ArrowDown") {
|
|
6414
|
+
var _e$target4;
|
|
6415
|
+
if (((_e$target4 = e.target) === null || _e$target4 === void 0 ? void 0 : _e$target4.tagName) === "SELECT") return;
|
|
6416
|
+
if (rIdx < allRows.length - 1) {
|
|
6417
|
+
e.preventDefault();
|
|
6418
|
+
nextRIdx = rIdx + 1;
|
|
6419
|
+
}
|
|
6420
|
+
} else if (key === "ArrowUp") {
|
|
6421
|
+
var _e$target5;
|
|
6422
|
+
if (((_e$target5 = e.target) === null || _e$target5 === void 0 ? void 0 : _e$target5.tagName) === "SELECT") return;
|
|
6423
|
+
if (rIdx > 0) {
|
|
6424
|
+
e.preventDefault();
|
|
6425
|
+
nextRIdx = rIdx - 1;
|
|
6426
|
+
}
|
|
6427
|
+
} else {
|
|
6428
|
+
return;
|
|
6429
|
+
}
|
|
6430
|
+
var targetRow = allRows[nextRIdx];
|
|
6431
|
+
var targetCol = visibleColumns[nextCIdx];
|
|
6432
|
+
if (!targetRow || !targetCol) return;
|
|
6433
|
+
var targetRowKey = targetRow._key || getRowKey(targetRow, startIndex + nextRIdx);
|
|
6434
|
+
var nextCellObj = {
|
|
6435
|
+
rowKey: targetRowKey,
|
|
6436
|
+
colKey: targetCol.key,
|
|
6437
|
+
rowIndex: startIndex + nextRIdx
|
|
6438
|
+
};
|
|
6439
|
+
setActiveCell(nextCellObj);
|
|
6440
|
+
if (editingCell && targetCol.editable !== false) {
|
|
6441
|
+
setEditingCell(nextCellObj);
|
|
6442
|
+
}
|
|
6443
|
+
}, [interactive, editingCell, activeCell, isDirty, isValid, isSaving, handleSave, paginatedData, newRows, visibleColumns, startIndex]);
|
|
6444
|
+
var renderInteractiveCellInput = useCallback(function (column, row, globalIndex, rowKey) {
|
|
6445
|
+
var _row$column$key;
|
|
6446
|
+
var value = pendingEdits[rowKey] && pendingEdits[rowKey][column.key] !== undefined ? pendingEdits[rowKey][column.key] : (_row$column$key = row[column.key]) !== null && _row$column$key !== void 0 ? _row$column$key : "";
|
|
6447
|
+
return jsx(FieldInput, {
|
|
6448
|
+
column: column,
|
|
6449
|
+
value: value,
|
|
6450
|
+
onChange: function onChange(newVal) {
|
|
6451
|
+
return handleCellValueChange(rowKey, column.key, newVal);
|
|
6452
|
+
},
|
|
6453
|
+
onKeyDown: handleTableKeyDown,
|
|
6454
|
+
isEditing: true,
|
|
6455
|
+
row: row,
|
|
6456
|
+
rowIndex: globalIndex,
|
|
6457
|
+
autoFocus: (editingCell === null || editingCell === void 0 ? void 0 : editingCell.rowKey) === rowKey && (editingCell === null || editingCell === void 0 ? void 0 : editingCell.colKey) === column.key
|
|
6458
|
+
});
|
|
6459
|
+
}, [pendingEdits, handleCellValueChange, handleTableKeyDown, editingCell]);
|
|
6282
6460
|
// Callbacks
|
|
6283
6461
|
var toggleColumnVisibility = useCallback(function (key) {
|
|
6284
6462
|
setColumnsState(function (prev) {
|
|
@@ -6383,12 +6561,40 @@ var Table = function Table(_ref) {
|
|
|
6383
6561
|
action: action,
|
|
6384
6562
|
row: row
|
|
6385
6563
|
});
|
|
6564
|
+
if ((action === null || action === void 0 ? void 0 : action.name) === "edit" || (action === null || action === void 0 ? void 0 : action.name) === "Edit") {
|
|
6565
|
+
if (interactive) {
|
|
6566
|
+
var _columnsState$find2, _columnsState$2;
|
|
6567
|
+
var firstColKey = ((_columnsState$find2 = columnsState.find(function (c) {
|
|
6568
|
+
return c.isVisible !== false && c.editable !== false;
|
|
6569
|
+
})) === null || _columnsState$find2 === void 0 ? void 0 : _columnsState$find2.key) || ((_columnsState$2 = columnsState[0]) === null || _columnsState$2 === void 0 ? void 0 : _columnsState$2.key);
|
|
6570
|
+
var globalIndex = tableData.findIndex(function (r, i) {
|
|
6571
|
+
return getRowKey(r, i) === getRowKey(row);
|
|
6572
|
+
});
|
|
6573
|
+
if (firstColKey && globalIndex !== -1) {
|
|
6574
|
+
var rKey = getRowKey(row, globalIndex);
|
|
6575
|
+
setActiveCell({
|
|
6576
|
+
rowKey: rKey,
|
|
6577
|
+
colKey: firstColKey,
|
|
6578
|
+
rowIndex: globalIndex
|
|
6579
|
+
});
|
|
6580
|
+
setEditingCell({
|
|
6581
|
+
rowKey: rKey,
|
|
6582
|
+
colKey: firstColKey,
|
|
6583
|
+
rowIndex: globalIndex
|
|
6584
|
+
});
|
|
6585
|
+
}
|
|
6586
|
+
}
|
|
6587
|
+
onEdit === null || onEdit === void 0 || onEdit({
|
|
6588
|
+
action: action,
|
|
6589
|
+
row: row
|
|
6590
|
+
});
|
|
6591
|
+
}
|
|
6386
6592
|
onAction === null || onAction === void 0 || onAction({
|
|
6387
6593
|
action: action,
|
|
6388
6594
|
row: row
|
|
6389
6595
|
});
|
|
6390
6596
|
setActiveActionRowKey(null);
|
|
6391
|
-
}, [onAction]);
|
|
6597
|
+
}, [onAction, onEdit, interactive, columnsState, tableData]);
|
|
6392
6598
|
var handleLimitChange = useCallback(function (nextLimit) {
|
|
6393
6599
|
var parsed = Number(nextLimit);
|
|
6394
6600
|
if (!Number.isFinite(parsed) || parsed <= 0) return;
|
|
@@ -6473,11 +6679,14 @@ var Table = function Table(_ref) {
|
|
|
6473
6679
|
onCellClick: handleCellClick,
|
|
6474
6680
|
onCellDoubleClick: handleCellDoubleClick,
|
|
6475
6681
|
renderInteractiveCellInput: renderInteractiveCellInput,
|
|
6476
|
-
invalidCellSet: invalidCellSet
|
|
6682
|
+
invalidCellSet: invalidCellSet,
|
|
6683
|
+
pendingEdits: pendingEdits
|
|
6477
6684
|
};
|
|
6478
6685
|
return jsxs("div", {
|
|
6479
6686
|
ref: tableContainerRef,
|
|
6480
|
-
|
|
6687
|
+
tabIndex: interactive ? 0 : undefined,
|
|
6688
|
+
onKeyDown: handleTableKeyDown,
|
|
6689
|
+
className: cn$1("w-full border rounded-lg md:rounded-md outline-none focus:ring-1 focus:ring-primary-400", className),
|
|
6481
6690
|
children: [TheadComponent && typeof TheadComponent === "function" ? jsx(TheadComponent, {
|
|
6482
6691
|
columns: columnsState,
|
|
6483
6692
|
data: filteredData
|
|
@@ -6524,15 +6733,26 @@ var Table = function Table(_ref) {
|
|
|
6524
6733
|
onClick: handleSave,
|
|
6525
6734
|
disabled: !isValid || isSaving,
|
|
6526
6735
|
title: !isValid ? "Cannot save: ".concat(((_validationErrors$ = validationErrors[0]) === null || _validationErrors$ === void 0 ? void 0 : _validationErrors$.message) || "Validation failed") : "Save changes",
|
|
6527
|
-
className: cn$1("px-4 py-2 font-medium rounded-lg text-sm flex items-center gap-2 transition-all shadow-sm", isValid ? "bg-
|
|
6736
|
+
className: cn$1("px-4 py-2 font-medium rounded-lg text-sm flex items-center gap-2 transition-all shadow-sm", isValid ? "bg-primary-600 hover:bg-primary-700 active:bg-primary-800 text-white cursor-pointer" : "bg-gray-200 text-gray-400 border border-gray-300 cursor-not-allowed opacity-75"),
|
|
6528
6737
|
children: [jsx(Save, {
|
|
6529
6738
|
className: "w-4 h-4"
|
|
6530
6739
|
}), jsx("span", {
|
|
6531
6740
|
children: isSaving ? "Saving..." : "Save Changes"
|
|
6532
6741
|
}), pendingCount > 0 && jsx("span", {
|
|
6533
|
-
className: cn$1("ml-1 px-2 py-0.5 text-xs rounded-full font-bold", isValid ? "bg-
|
|
6742
|
+
className: cn$1("ml-1 px-2 py-0.5 text-xs rounded-full font-bold", isValid ? "bg-primary-700 text-white" : "bg-gray-300 text-gray-600"),
|
|
6534
6743
|
children: pendingCount
|
|
6535
6744
|
})]
|
|
6745
|
+
}), jsxs("button", {
|
|
6746
|
+
type: "button",
|
|
6747
|
+
onClick: handleClearChanges,
|
|
6748
|
+
disabled: isSaving,
|
|
6749
|
+
title: "Discard all pending modifications",
|
|
6750
|
+
className: "px-4 py-2 font-medium rounded-lg text-sm flex items-center gap-2 transition-all border border-primary-300 text-primary-700 bg-white hover:bg-primary-50 active:bg-primary-100 cursor-pointer shadow-sm disabled:opacity-50",
|
|
6751
|
+
children: [jsx(X, {
|
|
6752
|
+
className: "w-4 h-4 text-primary-600"
|
|
6753
|
+
}), jsx("span", {
|
|
6754
|
+
children: "Clear Changes"
|
|
6755
|
+
})]
|
|
6536
6756
|
}), !isValid && validationErrors.length > 0 && jsxs("div", {
|
|
6537
6757
|
className: "flex items-center gap-1.5 px-3 py-1.5 bg-warning-50 border border-warning-200 text-warning-800 rounded-md text-xs font-medium",
|
|
6538
6758
|
children: [jsx(AlertCircle, {
|
|
@@ -6758,9 +6978,9 @@ var Table = function Table(_ref) {
|
|
|
6758
6978
|
className: "bg-primary-50/40 hover:bg-primary-100/70 active:bg-primary-100 transition-colors border-t-2 border-dashed border-primary-300 cursor-pointer group",
|
|
6759
6979
|
children: jsx("td", {
|
|
6760
6980
|
colSpan: visibleCount,
|
|
6761
|
-
className: "px-6 py-3.5 text-
|
|
6981
|
+
className: "px-6 py-3.5 text-left text-sm font-semibold text-primary-700 group-hover:text-primary-800",
|
|
6762
6982
|
children: jsxs("div", {
|
|
6763
|
-
className: "flex items-center justify-
|
|
6983
|
+
className: "flex items-center justify-start gap-2",
|
|
6764
6984
|
children: [jsx(Plus, {
|
|
6765
6985
|
className: "w-4 h-4 text-primary-600 group-hover:scale-110 transition-transform"
|
|
6766
6986
|
}), jsx("span", {
|
|
@@ -12585,7 +12805,7 @@ var DatePicker = /*#__PURE__*/React__default.forwardRef(function (_ref, forwarde
|
|
|
12585
12805
|
});
|
|
12586
12806
|
});
|
|
12587
12807
|
|
|
12588
|
-
var _excluded$v = ["id", "name", "checked", "defaultChecked", "onChange", "disabled", "size", "trackClass", "thumbClass", "className", "topLabel", "bottomLabel", "rightLabel", "leftLabel", "ariaLabel"];
|
|
12808
|
+
var _excluded$v = ["id", "name", "checked", "defaultChecked", "onChange", "disabled", "size", "color", "trackClass", "thumbClass", "className", "topLabel", "bottomLabel", "rightLabel", "leftLabel", "ariaLabel"];
|
|
12589
12809
|
function ownKeys$z(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12590
12810
|
function _objectSpread$z(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$z(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$z(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12591
12811
|
/**
|
|
@@ -12617,6 +12837,52 @@ var SIZE_MAP$2 = {
|
|
|
12617
12837
|
knobTranslate: "translate-x-6"
|
|
12618
12838
|
}
|
|
12619
12839
|
};
|
|
12840
|
+
var COLOR_PRESETS$1 = {
|
|
12841
|
+
primary: {
|
|
12842
|
+
bg: "bg-primary-600",
|
|
12843
|
+
ring: "focus-visible:ring-primary-300"
|
|
12844
|
+
},
|
|
12845
|
+
secondary: {
|
|
12846
|
+
bg: "bg-secondary-600",
|
|
12847
|
+
ring: "focus-visible:ring-secondary-300"
|
|
12848
|
+
},
|
|
12849
|
+
success: {
|
|
12850
|
+
bg: "bg-success-600",
|
|
12851
|
+
ring: "focus-visible:ring-success-300"
|
|
12852
|
+
},
|
|
12853
|
+
green: {
|
|
12854
|
+
bg: "bg-success-600",
|
|
12855
|
+
ring: "focus-visible:ring-success-300"
|
|
12856
|
+
},
|
|
12857
|
+
error: {
|
|
12858
|
+
bg: "bg-error-600",
|
|
12859
|
+
ring: "focus-visible:ring-error-300"
|
|
12860
|
+
},
|
|
12861
|
+
danger: {
|
|
12862
|
+
bg: "bg-error-600",
|
|
12863
|
+
ring: "focus-visible:ring-error-300"
|
|
12864
|
+
},
|
|
12865
|
+
red: {
|
|
12866
|
+
bg: "bg-error-600",
|
|
12867
|
+
ring: "focus-visible:ring-error-300"
|
|
12868
|
+
},
|
|
12869
|
+
warning: {
|
|
12870
|
+
bg: "bg-warning-600",
|
|
12871
|
+
ring: "focus-visible:ring-warning-300"
|
|
12872
|
+
},
|
|
12873
|
+
blue: {
|
|
12874
|
+
bg: "bg-blue-600",
|
|
12875
|
+
ring: "focus-visible:ring-blue-300"
|
|
12876
|
+
},
|
|
12877
|
+
indigo: {
|
|
12878
|
+
bg: "bg-indigo-600",
|
|
12879
|
+
ring: "focus-visible:ring-indigo-300"
|
|
12880
|
+
},
|
|
12881
|
+
purple: {
|
|
12882
|
+
bg: "bg-purple-600",
|
|
12883
|
+
ring: "focus-visible:ring-purple-300"
|
|
12884
|
+
}
|
|
12885
|
+
};
|
|
12620
12886
|
var Switch = /*#__PURE__*/forwardRef(function Switch(props, ref) {
|
|
12621
12887
|
var id = props.id,
|
|
12622
12888
|
name = props.name,
|
|
@@ -12628,6 +12894,8 @@ var Switch = /*#__PURE__*/forwardRef(function Switch(props, ref) {
|
|
|
12628
12894
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
12629
12895
|
_props$size = props.size,
|
|
12630
12896
|
size = _props$size === void 0 ? "md" : _props$size,
|
|
12897
|
+
_props$color = props.color,
|
|
12898
|
+
color = _props$color === void 0 ? "primary" : _props$color,
|
|
12631
12899
|
trackClass = props.trackClass,
|
|
12632
12900
|
thumbClass = props.thumbClass,
|
|
12633
12901
|
_props$className = props.className,
|
|
@@ -12663,16 +12931,18 @@ var Switch = /*#__PURE__*/forwardRef(function Switch(props, ref) {
|
|
|
12663
12931
|
}
|
|
12664
12932
|
};
|
|
12665
12933
|
var sizeStuff = SIZE_MAP$2[size] || SIZE_MAP$2.md;
|
|
12934
|
+
var isPreset = COLOR_PRESETS$1[color];
|
|
12666
12935
|
// Classes for the track (we use inline style for arbitrary trackClass when ON)
|
|
12667
|
-
var trackClasses = cn$1("relative inline-flex items-center rounded-full transition-colors duration-200 ease-in-out", sizeStuff.track, isOn ? "" : "bg-gray-100", disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer", trackClass // Accepting trackClass as a class name
|
|
12936
|
+
var trackClasses = cn$1("relative inline-flex items-center rounded-full transition-colors duration-200 ease-in-out", sizeStuff.track, isOn ? trackClass ? "" : isPreset ? isPreset.bg : "" : "bg-gray-100", disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer", trackClass // Accepting trackClass as a class name
|
|
12668
12937
|
);
|
|
12669
12938
|
// Knob classes (thumb)
|
|
12670
12939
|
var knobBase = cn$1("inline-block rounded-full bg-white shadow transform ring-0 transition-transform duration-200 ease-in-out", sizeStuff.knob, thumbClass // Accepting thumbClass as a class name
|
|
12671
12940
|
);
|
|
12672
12941
|
var knobTransform = isOn ? sizeStuff.knobTranslate : "translate-x-1";
|
|
12673
|
-
var
|
|
12674
|
-
var
|
|
12675
|
-
|
|
12942
|
+
var ringClass = isPreset ? isPreset.ring : "focus-visible:ring-primary-300";
|
|
12943
|
+
var focusClasses = disabled ? "" : "focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 ".concat(ringClass);
|
|
12944
|
+
var trackStyle = isOn && !trackClass && !isPreset ? {
|
|
12945
|
+
backgroundColor: color
|
|
12676
12946
|
} : undefined; // Fallback to default trackClass if trackClass is not a class
|
|
12677
12947
|
var accessibleLabel = ariaLabel || rightLabel || leftLabel || topLabel || bottomLabel || "Toggle";
|
|
12678
12948
|
var containerIsColumn = Boolean(topLabel || bottomLabel);
|
|
@@ -13387,7 +13657,7 @@ var Accordion = /*#__PURE__*/forwardRef(function Accordion(_ref, ref) {
|
|
|
13387
13657
|
});
|
|
13388
13658
|
Accordion.displayName = "Accordion";
|
|
13389
13659
|
|
|
13390
|
-
var _excluded$s = ["id", "name", "label", "checked", "defaultChecked", "onChange", "disabled", "required", "className", "size", "labelPosition", "value", "ariaLabel", "variant", "indeterminate", "borderColor", "iconClass", "checkedClass"];
|
|
13660
|
+
var _excluded$s = ["id", "name", "label", "checked", "defaultChecked", "onChange", "disabled", "required", "className", "size", "labelPosition", "value", "ariaLabel", "variant", "indeterminate", "borderColor", "color", "iconClass", "checkedClass"];
|
|
13391
13661
|
function ownKeys$w(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13392
13662
|
function _objectSpread$w(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$w(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$w(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13393
13663
|
var SIZE_CLASSES = {
|
|
@@ -13407,6 +13677,52 @@ var SIZE_CLASSES = {
|
|
|
13407
13677
|
icon: "w-4 h-4"
|
|
13408
13678
|
}
|
|
13409
13679
|
};
|
|
13680
|
+
var COLOR_PRESETS = {
|
|
13681
|
+
primary: {
|
|
13682
|
+
checked: "peer-checked:bg-primary-600 peer-checked:border-primary-600 peer-checked:text-white",
|
|
13683
|
+
ring: "peer-focus:ring-primary-300"
|
|
13684
|
+
},
|
|
13685
|
+
secondary: {
|
|
13686
|
+
checked: "peer-checked:bg-secondary-600 peer-checked:border-secondary-600 peer-checked:text-white",
|
|
13687
|
+
ring: "peer-focus:ring-secondary-300"
|
|
13688
|
+
},
|
|
13689
|
+
success: {
|
|
13690
|
+
checked: "peer-checked:bg-success-600 peer-checked:border-success-600 peer-checked:text-white",
|
|
13691
|
+
ring: "peer-focus:ring-success-300"
|
|
13692
|
+
},
|
|
13693
|
+
green: {
|
|
13694
|
+
checked: "peer-checked:bg-success-600 peer-checked:border-success-600 peer-checked:text-white",
|
|
13695
|
+
ring: "peer-focus:ring-success-300"
|
|
13696
|
+
},
|
|
13697
|
+
error: {
|
|
13698
|
+
checked: "peer-checked:bg-error-600 peer-checked:border-error-600 peer-checked:text-white",
|
|
13699
|
+
ring: "peer-focus:ring-error-300"
|
|
13700
|
+
},
|
|
13701
|
+
danger: {
|
|
13702
|
+
checked: "peer-checked:bg-error-600 peer-checked:border-error-600 peer-checked:text-white",
|
|
13703
|
+
ring: "peer-focus:ring-error-300"
|
|
13704
|
+
},
|
|
13705
|
+
red: {
|
|
13706
|
+
checked: "peer-checked:bg-error-600 peer-checked:border-error-600 peer-checked:text-white",
|
|
13707
|
+
ring: "peer-focus:ring-error-300"
|
|
13708
|
+
},
|
|
13709
|
+
warning: {
|
|
13710
|
+
checked: "peer-checked:bg-warning-600 peer-checked:border-warning-600 peer-checked:text-white",
|
|
13711
|
+
ring: "peer-focus:ring-warning-300"
|
|
13712
|
+
},
|
|
13713
|
+
blue: {
|
|
13714
|
+
checked: "peer-checked:bg-blue-600 peer-checked:border-blue-600 peer-checked:text-white",
|
|
13715
|
+
ring: "peer-focus:ring-blue-300"
|
|
13716
|
+
},
|
|
13717
|
+
indigo: {
|
|
13718
|
+
checked: "peer-checked:bg-indigo-600 peer-checked:border-indigo-600 peer-checked:text-white",
|
|
13719
|
+
ring: "peer-focus:ring-indigo-300"
|
|
13720
|
+
},
|
|
13721
|
+
purple: {
|
|
13722
|
+
checked: "peer-checked:bg-purple-600 peer-checked:border-purple-600 peer-checked:text-white",
|
|
13723
|
+
ring: "peer-focus:ring-purple-300"
|
|
13724
|
+
}
|
|
13725
|
+
};
|
|
13410
13726
|
var Checkbox = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
13411
13727
|
var _props$wrapperProps;
|
|
13412
13728
|
var id = _ref.id,
|
|
@@ -13432,6 +13748,8 @@ var Checkbox = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
13432
13748
|
indeterminate = _ref$indeterminate === void 0 ? false : _ref$indeterminate,
|
|
13433
13749
|
_ref$borderColor = _ref.borderColor,
|
|
13434
13750
|
borderColor = _ref$borderColor === void 0 ? "#ccc" : _ref$borderColor,
|
|
13751
|
+
_ref$color = _ref.color,
|
|
13752
|
+
color = _ref$color === void 0 ? "primary" : _ref$color,
|
|
13435
13753
|
iconClass = _ref.iconClass,
|
|
13436
13754
|
checkedClass = _ref.checkedClass,
|
|
13437
13755
|
props = _objectWithoutProperties$1(_ref, _excluded$s);
|
|
@@ -13465,6 +13783,13 @@ var Checkbox = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
13465
13783
|
var iconBase = "pointer-events-none transform transition-all duration-150 ease-out";
|
|
13466
13784
|
var iconShown = "opacity-100 scale-100";
|
|
13467
13785
|
var iconHidden = "opacity-0 scale-75";
|
|
13786
|
+
var isPreset = COLOR_PRESETS[color];
|
|
13787
|
+
var colorClasses = isPreset ? "".concat(isPreset.checked, " peer-focus:ring-2 peer-focus:ring-offset-1 ").concat(isPreset.ring) : "peer-focus:ring-2 peer-focus:ring-offset-1 peer-focus:ring-primary-300";
|
|
13788
|
+
var customColorStyle = currentChecked && !isPreset && !checkedClass ? {
|
|
13789
|
+
backgroundColor: color,
|
|
13790
|
+
borderColor: color,
|
|
13791
|
+
color: "#ffffff"
|
|
13792
|
+
} : {};
|
|
13468
13793
|
return jsxs("div", _objectSpread$w(_objectSpread$w({
|
|
13469
13794
|
className: wrapperCls
|
|
13470
13795
|
}, (_props$wrapperProps = props === null || props === void 0 ? void 0 : props.wrapperProps) !== null && _props$wrapperProps !== void 0 ? _props$wrapperProps : {}), {}, {
|
|
@@ -13475,7 +13800,7 @@ var Checkbox = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
13475
13800
|
}), jsxs("div", {
|
|
13476
13801
|
className: boxOuterCls,
|
|
13477
13802
|
style: disabled ? {} : {
|
|
13478
|
-
borderColor: borderColor
|
|
13803
|
+
borderColor: currentChecked && (isPreset || customColorStyle.borderColor) ? undefined : borderColor
|
|
13479
13804
|
},
|
|
13480
13805
|
"aria-disabled": disabled,
|
|
13481
13806
|
children: [jsx("input", _objectSpread$w({
|
|
@@ -13494,11 +13819,11 @@ var Checkbox = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
13494
13819
|
"aria-label": ariaLabel,
|
|
13495
13820
|
"aria-checked": Boolean(currentChecked)
|
|
13496
13821
|
}, props)), jsx("div", {
|
|
13497
|
-
className: "pointer-events-none z-0 flex items-center justify-center rounded-sm w-full h-full transition-colors duration-150 ease-in-out " + "
|
|
13822
|
+
className: "pointer-events-none z-0 flex items-center justify-center rounded-sm w-full h-full transition-colors duration-150 ease-in-out " + "".concat(colorClasses, " ") + "".concat(disabled ? "bg-gray-100 border-gray-400 text-primary-400" : "bg-white border-gray-500", " ").concat(checkedClass ? checkedClass : ""),
|
|
13498
13823
|
style: currentChecked && checkedClass ? {
|
|
13499
13824
|
backgroundColor: "",
|
|
13500
13825
|
borderColor: ""
|
|
13501
|
-
} :
|
|
13826
|
+
} : customColorStyle,
|
|
13502
13827
|
"aria-hidden": "true",
|
|
13503
13828
|
children: jsx(Check, {
|
|
13504
13829
|
className: "".concat(sizeClass.icon, " ").concat(iconBase, " ").concat(currentChecked ? iconShown : iconHidden, " ").concat(iconClass || ""),
|