react-table-edit 1.5.41 → 1.5.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsxs, jsx, Fragment as Fragment$1 } from 'react/jsx-runtime';
2
2
  import * as React$5 from 'react';
3
- import React__default, { Fragment, forwardRef, Component, useEffect, useRef, useState, useMemo, useLayoutEffect, createContext, useContext, useCallback, useImperativeHandle } from 'react';
3
+ import React__default, { Fragment, forwardRef, Component, useEffect, useRef, useMemo, useState, useLayoutEffect, createContext, useContext, useCallback, useImperativeHandle } from 'react';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import toast from 'react-hot-toast';
6
6
  import { createRoot } from 'react-dom/client';
@@ -20114,9 +20114,139 @@ const findItemInTree = (items, filter, keyFilter = 'value', keyChildren = 'child
20114
20114
  }
20115
20115
  };
20116
20116
 
20117
+ const RenderElement = React__default.memo((props) => {
20118
+ const { indexRow, formatSetting, currentOptions, id, defaultColumns, closeMenu, setIndexFocus, setSearchTerm, indexFocus, columns, compareFunction, fieldValue, value, handChange, isMulti, row, isSelected, level = 0 } = props;
20119
+ const checkOverflow = (indexRow, indexCol) => {
20120
+ const element = document.getElementById(`select-${id}-${indexRow}-${indexCol}`);
20121
+ return element && element.scrollWidth > element.clientWidth;
20122
+ };
20123
+ return (jsxs("tr", { id: `row-select-table-${indexRow}`, style: { paddingLeft: 10 * level }, className: classNames$1('r-select-row', { 'last-row': indexRow === currentOptions.length - 1 }, { 'fisrt-row': indexRow === 0 }), children: [isMulti && (jsx("td", { className: classNames$1(`r-select-rowcell`, { 'r-select-move': indexFocus === indexRow, 'r-select-active': !isMulti && value && (compareFunction ? compareFunction(row) : value[fieldValue ?? 'value'] === row[fieldValue ?? 'value']) }), style: { width: 40, textAlign: 'center', padding: 0, paddingBottom: 6 }, onClick: (e) => {
20124
+ if (isMulti) {
20125
+ const index = value?.findIndex((x) => (compareFunction ? compareFunction(row) : x[fieldValue ?? 'value'] === row[fieldValue ?? 'value']));
20126
+ if (index > -1) {
20127
+ value?.splice(index, 1);
20128
+ handChange([...value]);
20129
+ }
20130
+ else {
20131
+ if (value) {
20132
+ value?.push(row);
20133
+ handChange([...value]);
20134
+ }
20135
+ else {
20136
+ handChange([row]);
20137
+ }
20138
+ }
20139
+ e.stopPropagation();
20140
+ }
20141
+ }, children: jsx(Input$1, { checked: isSelected, type: "checkbox", className: "cursor-pointer", onChange: () => { }, style: { textAlign: 'center', marginTop: 6 } }) })), (columns ? columns : defaultColumns).map((col, indexCol) => {
20142
+ let valueDisplay = row[col.field];
20143
+ if (col.type === 'numeric' || (col.typeCondition && col.typeCondition(row) === 'numeric')) {
20144
+ valueDisplay = formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? '.', formatSetting?.thousandSeparator ?? ',', col.fraction ?? 0, true, false) ?? 0;
20145
+ }
20146
+ else if (col.type === 'date') {
20147
+ valueDisplay = valueDisplay ? formatDateTime(valueDisplay, formatSetting?.dateFormat) : '';
20148
+ }
20149
+ else if (col.type === 'datetime') {
20150
+ valueDisplay = valueDisplay ? formatDateTime(valueDisplay, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm') : '';
20151
+ }
20152
+ return (jsxs(Fragment, { children: [col.visible !== false && (jsx("td", { id: `select-${id}-${indexRow}-${indexCol}`,
20153
+ // ref={refRow}
20154
+ className: classNames$1(`r-select-rowcell`, { 'r-select-move': indexFocus === indexRow, 'r-select-active': !isMulti && value && (compareFunction ? compareFunction(row) : value[fieldValue ?? 'value'] === row[fieldValue ?? 'value']) }), style: {
20155
+ minWidth: col.minWidth,
20156
+ width: col.width,
20157
+ maxWidth: col.maxWidth,
20158
+ textAlign: col.textAlign ? col.textAlign : 'left'
20159
+ }, onClick: (e) => {
20160
+ if (isMulti) {
20161
+ const index = value?.findIndex((x) => (compareFunction ? compareFunction(row) : x[fieldValue ?? 'value'] === row[fieldValue ?? 'value']));
20162
+ if (index > -1) {
20163
+ value?.splice(index, 1);
20164
+ handChange([...value]);
20165
+ }
20166
+ else {
20167
+ if (value) {
20168
+ value?.push(row);
20169
+ handChange([...value]);
20170
+ }
20171
+ else {
20172
+ handChange([row]);
20173
+ }
20174
+ }
20175
+ }
20176
+ else {
20177
+ handChange(row);
20178
+ setSearchTerm('');
20179
+ closeMenu();
20180
+ }
20181
+ e.preventDefault();
20182
+ e.stopPropagation();
20183
+ }, onMouseMove: (e) => {
20184
+ if (indexRow !== indexFocus) {
20185
+ setIndexFocus(indexRow);
20186
+ }
20187
+ e.stopPropagation();
20188
+ }, children: col.template ? col.template(row, indexRow) : col.type === 'numeric' && Number(row[col.field]) < 0 ? jsxs("div", { style: { color: formatSetting?.colorNegative ?? 'red' }, children: [" ", `${formatSetting?.prefixNegative ?? '-'}${value}${formatSetting?.suffixNegative ?? ''}`] }) : valueDisplay }, `col-${indexRow}-${indexCol}`)), checkOverflow(indexRow, indexCol) && (jsx(UncontrolledTooltip, { className: "r-tooltip", autohide: false, target: `select-${id}-${indexRow}-${indexCol}`, children: col.template ? col.template(row, indexRow) : valueDisplay }))] }, indexCol));
20189
+ })] }, `row-${indexRow}`));
20190
+ });
20191
+
20192
+ const TableElement$1 = React__default.memo((props) => {
20193
+ const { currentOptions, isMulti, closeMenu, indexFocus, setIndexFocus, setSearchTerm, formatSetting, defaultColumns, haveCreateNew, isLoading, searchTerm, compareFunction, handChange, columns, fieldLabel, fieldValue, noHeader, value } = props;
20194
+ const { t } = useTranslation();
20195
+ const checkboxRef = useRef(null);
20196
+ const typeSelected = useMemo(() => {
20197
+ // 0: none selected, 1: some selected, 2: all selected
20198
+ if (!isMulti || currentOptions.length === 0 || !value?.length) {
20199
+ return 0;
20200
+ }
20201
+ else if (value?.length < currentOptions.length) {
20202
+ return 1;
20203
+ }
20204
+ else if (!currentOptions.some((item) => !value.some((x) => x[fieldValue ?? 'value'] === item[fieldValue ?? 'value']))) {
20205
+ return 2;
20206
+ }
20207
+ return 1;
20208
+ }, [currentOptions, value]);
20209
+ useEffect(() => {
20210
+ if (checkboxRef.current) {
20211
+ checkboxRef.current.checked = typeSelected === 2;
20212
+ checkboxRef.current.indeterminate = typeSelected === 1;
20213
+ }
20214
+ }, [typeSelected]);
20215
+ return (jsxs(Fragment$1, { children: [jsxs("table", { style: { width: '100%' }, children: [!(noHeader || (columns?.length ?? 0) === 0) && (jsx("thead", { className: "r-select-gridheader", children: jsxs("tr", { className: "r-select-row", role: "row", children: [isMulti && (jsx("th", { className: classNames$1(`r-select-headercell`), style: { width: 40, top: `0px` }, children: jsx("div", { style: { justifyContent: 'center' }, className: classNames$1('r-select-headercell-div'), children: jsx(Input$1, { innerRef: (el) => {
20216
+ checkboxRef.current = el;
20217
+ }, type: "checkbox", onClick: (e) => {
20218
+ if (isMulti) {
20219
+ if (typeSelected === 2) {
20220
+ handChange([]);
20221
+ }
20222
+ else if (typeSelected === 0) {
20223
+ handChange([...currentOptions]);
20224
+ }
20225
+ else {
20226
+ const notSelectedRows = currentOptions.filter((item) => !value.some((x) => x[fieldValue ?? 'value'] === item[fieldValue ?? 'value']));
20227
+ handChange([...value, ...notSelectedRows]);
20228
+ }
20229
+ e.stopPropagation();
20230
+ }
20231
+ }, readOnly: true, className: classNames$1('cursor-pointer', { 'd-none': !isMulti }), style: { textAlign: 'center', marginTop: 6 } }) }) })), (columns ? columns : defaultColumns).map((col, indexCol) => {
20232
+ return (col.visible !== false && (jsx("th", { className: classNames$1(`r-select-headercell `), style: {
20233
+ width: Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? 'auto'),
20234
+ minWidth: Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? 'auto'),
20235
+ top: `${0 * 35}px`,
20236
+ maxWidth: col.maxWidth
20237
+ }, children: jsx("div", { role: "textbox", title: t(col.headerText ?? ''), style: {
20238
+ height: `${1 * 35}px`,
20239
+ justifyContent: col.textAlign ?? 'left'
20240
+ }, className: "r-select-headercell-div", children: t(col.headerText ?? '') }) }, `header-select-${indexCol}`)));
20241
+ })] }) })), currentOptions && !isLoading && (jsxs("tbody", { className: "r-select-gridcontent", children: [haveCreateNew && (jsx(RenderElement, { indexRow: 0, isSelected: false, closeMenu: closeMenu, value: value, isMulti: isMulti, currentOptions: currentOptions, fieldValue: fieldValue, columns: columns, defaultColumns: defaultColumns, indexFocus: indexFocus, formatSetting: formatSetting, handChange: handChange, compareFunction: compareFunction, setIndexFocus: setIndexFocus, setSearchTerm: setSearchTerm, row: { valueCreate: searchTerm, [fieldValue ?? 'value']: searchTerm, [fieldLabel ?? 'label']: `${t('Create')} '${searchTerm}'`, isCreated: true } })), currentOptions?.map((row, indexRow) => {
20242
+ const isSelected = isMulti && value?.some((x) => (compareFunction ? compareFunction(row) : x[fieldValue ?? 'value'] === row[fieldValue ?? 'value']));
20243
+ return (jsx(RenderElement, { isSelected: isSelected ?? false, indexRow: indexRow + (haveCreateNew ? 1 : 0), closeMenu: closeMenu, value: value, isMulti: isMulti, currentOptions: currentOptions, fieldValue: fieldValue, columns: columns, defaultColumns: defaultColumns, indexFocus: indexFocus, formatSetting: formatSetting, handChange: handChange, compareFunction: compareFunction, setIndexFocus: setIndexFocus, setSearchTerm: setSearchTerm, row: row }, `select-table-${indexRow}`));
20244
+ })] }))] }), (currentOptions?.length ?? 0) === 0 && !haveCreateNew && !isLoading && (jsxs("div", { className: "r-no-data", children: [jsx("svg", { width: "64", height: "41", viewBox: "0 0 64 41", xmlns: "http://www.w3.org/2000/svg", children: jsxs("g", { transform: "translate(0 1)", fill: "none", fillRule: "evenodd", children: [jsx("ellipse", { fill: "#f5f5f5", cx: "32", cy: "33", rx: "32", ry: "7" }), jsxs("g", { fillRule: "nonzero", stroke: "#d9d9d9", children: [jsx("path", { d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z" }), jsx("path", { d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z", fill: "#fafafa" })] })] }) }), t('No data available.')] })), isLoading && (jsxs("div", { className: "r-no-data", children: [jsx(Spinner$1, { className: "me-1", children: " " }), t('Loading...')] }))] }));
20245
+ });
20246
+
20117
20247
  const defaultMaxHeight$1 = 250;
20118
20248
  const SelectTable = forwardRef((props, ref) => {
20119
- const { id, menuWidth, width, invalid, placeholder, textAlign, options, columns, value, fieldValue, fieldLabel, maxHeight, isClearable, component, isMulti, noHeader, isDisabled, showFooter, formatSetting, allowCreate, onPaste, onChange, handleAdd, onKeyDown, onOpenMenu, loadOptions, onCloseMenu, footerComponent, formatOptionLabel, compareFunction } = props;
20249
+ const { id, menuWidth, width, invalid, placeholder, textAlign, options, columns, value, fieldValue, fieldLabel, maxHeight, isClearable, component, isMulti, noHeader, isDisabled, showFooter, formatSetting, allowCreate, onPaste, onChange, handleAdd, onKeyDown, onOpenMenu, loadOptions, onCloseMenu, footerComponent, formatOptionLabel, compareFunction, } = props;
20120
20250
  const selectTableRef = useRef(null);
20121
20251
  const selectMenuTableRef = useRef(null);
20122
20252
  const inputRef = useRef(null);
@@ -20128,15 +20258,13 @@ const SelectTable = forwardRef((props, ref) => {
20128
20258
  const [optionsLoad, setOptionsLoad] = useState();
20129
20259
  const [haveCreateNew, setHaveCreateNew] = useState(false);
20130
20260
  const { t } = useTranslation();
20131
- const isSelectedAll = useMemo(() => {
20132
- return isMulti === true && (optionsLoad ? optionsLoad : options).length > 0 && value?.length >= (optionsLoad ? optionsLoad : options).length;
20133
- }, [optionsLoad, options, value]);
20261
+ const currentOptions = useMemo(() => optionsLoad || options || [], [optionsLoad, options]);
20134
20262
  const defaultColumns = [
20135
20263
  {
20136
20264
  headerText: 'Name',
20137
20265
  field: fieldLabel ?? 'label',
20138
- width: menuWidth
20139
- }
20266
+ width: menuWidth,
20267
+ },
20140
20268
  ];
20141
20269
  const closeMenu = () => {
20142
20270
  setDropdownOpen(false);
@@ -20146,7 +20274,12 @@ const SelectTable = forwardRef((props, ref) => {
20146
20274
  };
20147
20275
  const handChange = (val) => {
20148
20276
  if (val && val.isCreated) {
20149
- const newVal = { ...val, [fieldLabel ?? 'label']: val.valueCreate, isCreated: undefined, isCreatedItem: true };
20277
+ const newVal = {
20278
+ ...val,
20279
+ [fieldLabel ?? 'label']: val.valueCreate,
20280
+ isCreated: undefined,
20281
+ isCreatedItem: true,
20282
+ };
20150
20283
  options.unshift(newVal);
20151
20284
  onChange(newVal);
20152
20285
  return;
@@ -20155,7 +20288,9 @@ const SelectTable = forwardRef((props, ref) => {
20155
20288
  };
20156
20289
  useEffect(() => {
20157
20290
  if (dropdownOpen && value && !isMulti && selectMenuTableRef) {
20158
- const index = (optionsLoad ? optionsLoad : options)?.findIndex((row) => (compareFunction ? compareFunction(row) : row[fieldValue ?? 'value'] === value[fieldValue ?? 'value']));
20291
+ const index = currentOptions?.findIndex((row) => compareFunction
20292
+ ? compareFunction(row)
20293
+ : row[fieldValue ?? 'value'] === value[fieldValue ?? 'value']);
20159
20294
  if (index >= 0) {
20160
20295
  selectMenuTableRef.current.scrollTo({ top: (index - 1) * 30 });
20161
20296
  }
@@ -20202,14 +20337,28 @@ const SelectTable = forwardRef((props, ref) => {
20202
20337
  }
20203
20338
  }
20204
20339
  };
20205
- const listKeyUse = ['Escape', 'Space', 'Enter', 'Tab', 'NumpadEnter', 'ArrowDown', 'ArrowUp', 'F9'];
20340
+ const listKeyUse = [
20341
+ 'Escape',
20342
+ 'Space',
20343
+ 'Enter',
20344
+ 'Tab',
20345
+ 'NumpadEnter',
20346
+ 'ArrowDown',
20347
+ 'ArrowUp',
20348
+ 'F9',
20349
+ ];
20206
20350
  const handleOnKeyDown = (e) => {
20207
20351
  let key = '';
20208
20352
  if (onKeyDown &&
20209
20353
  (!dropdownOpen ||
20210
20354
  !listKeyUse.includes(e.code) ||
20211
- ((e.code === 'Enter' || e.code === 'Tab' || e.code === 'NumpadEnter' || e.code === 'Space') && !((optionsLoad ? optionsLoad : options)[indexFocus] || haveCreateNew)) ||
20212
- ((e.code === 'ArrowDown' || e.code === 'ArrowUp') && (optionsLoad?.length ?? 0) === 0 && options.length === 0) ||
20355
+ ((e.code === 'Enter' ||
20356
+ e.code === 'Tab' ||
20357
+ e.code === 'NumpadEnter' ||
20358
+ e.code === 'Space') &&
20359
+ !(currentOptions[indexFocus] || haveCreateNew)) ||
20360
+ ((e.code === 'ArrowDown' || e.code === 'ArrowUp') &&
20361
+ currentOptions.length === 0) ||
20213
20362
  (e.code === 'Escape' && !(isClearable && value && !isDisabled)))) {
20214
20363
  key = onKeyDown(e);
20215
20364
  }
@@ -20222,10 +20371,15 @@ const SelectTable = forwardRef((props, ref) => {
20222
20371
  else if (e.code === 'Space') {
20223
20372
  let newItem;
20224
20373
  if (haveCreateNew && indexFocus === 0) {
20225
- newItem = { valueCreate: searchTerm, [fieldValue ?? 'value']: searchTerm, [fieldLabel ?? 'label']: `${t('Create')} '${searchTerm}'`, isCreated: true };
20374
+ newItem = {
20375
+ valueCreate: searchTerm,
20376
+ [fieldValue ?? 'value']: searchTerm,
20377
+ [fieldLabel ?? 'label']: `${t('Create')} '${searchTerm}'`,
20378
+ isCreated: true,
20379
+ };
20226
20380
  }
20227
20381
  else {
20228
- newItem = (optionsLoad ? optionsLoad : options)[indexFocus];
20382
+ newItem = currentOptions[indexFocus];
20229
20383
  }
20230
20384
  if (dropdownOpen && newItem) {
20231
20385
  handChange(newItem);
@@ -20243,13 +20397,20 @@ const SelectTable = forwardRef((props, ref) => {
20243
20397
  flag = true;
20244
20398
  }
20245
20399
  }
20246
- else if (e.code === 'Enter' || e.code === 'Tab' || e.code === 'NumpadEnter') {
20400
+ else if (e.code === 'Enter' ||
20401
+ e.code === 'Tab' ||
20402
+ e.code === 'NumpadEnter') {
20247
20403
  let newItem;
20248
20404
  if (haveCreateNew && indexFocus === 0) {
20249
- newItem = { valueCreate: searchTerm, [fieldValue ?? 'value']: searchTerm, [fieldLabel ?? 'label']: `${t('Create')} '${searchTerm}'`, isCreated: true };
20405
+ newItem = {
20406
+ valueCreate: searchTerm,
20407
+ [fieldValue ?? 'value']: searchTerm,
20408
+ [fieldLabel ?? 'label']: `${t('Create')} '${searchTerm}'`,
20409
+ isCreated: true,
20410
+ };
20250
20411
  }
20251
20412
  else {
20252
- newItem = (optionsLoad ? optionsLoad : options)[indexFocus];
20413
+ newItem = currentOptions[indexFocus];
20253
20414
  }
20254
20415
  if (dropdownOpen && newItem) {
20255
20416
  handChange(newItem);
@@ -20258,15 +20419,18 @@ const SelectTable = forwardRef((props, ref) => {
20258
20419
  }
20259
20420
  }
20260
20421
  else if (e.code === 'ArrowDown') {
20261
- if (dropdownOpen && ((optionsLoad?.length ?? 0) > 0 || options.length > 0 || haveCreateNew)) {
20422
+ if (dropdownOpen && (currentOptions.length > 0 || haveCreateNew)) {
20262
20423
  let newIndex = 0;
20263
20424
  if (indexFocus >= 0) {
20264
20425
  newIndex = indexFocus + 1;
20265
20426
  }
20266
20427
  else if (value) {
20267
- newIndex = (optionsLoad ? optionsLoad : options)?.findIndex((row) => (compareFunction ? compareFunction(row) : row[fieldValue ?? 'value'] === value[fieldValue ?? 'value'])) + 1;
20428
+ newIndex =
20429
+ currentOptions?.findIndex((row) => compareFunction
20430
+ ? compareFunction(row)
20431
+ : row[fieldValue ?? 'value'] === value[fieldValue ?? 'value']) + 1;
20268
20432
  }
20269
- if (newIndex < (optionsLoad ? optionsLoad : options).length) {
20433
+ if (newIndex < currentOptions.length) {
20270
20434
  setIndexFocus(newIndex);
20271
20435
  checkIfElementIsOutOfScroll(0, newIndex);
20272
20436
  }
@@ -20282,21 +20446,24 @@ const SelectTable = forwardRef((props, ref) => {
20282
20446
  }
20283
20447
  }
20284
20448
  else if (e.code === 'ArrowUp') {
20285
- if (dropdownOpen && ((optionsLoad?.length ?? 0) > 0 || options.length > 0 || haveCreateNew)) {
20449
+ if (dropdownOpen && (currentOptions.length > 0 || haveCreateNew)) {
20286
20450
  let newIndex = 0;
20287
20451
  if (indexFocus >= 0) {
20288
20452
  newIndex = indexFocus - 1;
20289
20453
  }
20290
20454
  else if (value) {
20291
- newIndex = (optionsLoad ? optionsLoad : options)?.findIndex((row) => (compareFunction ? compareFunction(row) : row[fieldValue ?? 'value'] === value[fieldValue ?? 'value'])) - 1;
20455
+ newIndex =
20456
+ currentOptions?.findIndex((row) => compareFunction
20457
+ ? compareFunction(row)
20458
+ : row[fieldValue ?? 'value'] === value[fieldValue ?? 'value']) - 1;
20292
20459
  }
20293
20460
  if (newIndex >= 0) {
20294
20461
  setIndexFocus(newIndex);
20295
20462
  checkIfElementIsOutOfScroll(2, newIndex);
20296
20463
  }
20297
20464
  else {
20298
- setIndexFocus((optionsLoad ? optionsLoad : options).length - 1);
20299
- checkIfElementIsOutOfScroll(3, (optionsLoad ? optionsLoad : options).length - 1);
20465
+ setIndexFocus(currentOptions.length - 1);
20466
+ checkIfElementIsOutOfScroll(3, currentOptions.length - 1);
20300
20467
  }
20301
20468
  flag = true;
20302
20469
  }
@@ -20321,7 +20488,11 @@ const SelectTable = forwardRef((props, ref) => {
20321
20488
  scrollToElement(selectMenuTableRef.current, selectMenuTableRef.current.scrollHeight);
20322
20489
  }
20323
20490
  else if (flag === 0 && rect.bottom + 30 > parentRect.bottom) {
20324
- scrollToElement(selectMenuTableRef.current, elementFocus.offsetTop - selectMenuTableRef.current.offsetTop - parentRect.height + rect.height + 50);
20491
+ scrollToElement(selectMenuTableRef.current, elementFocus.offsetTop -
20492
+ selectMenuTableRef.current.offsetTop -
20493
+ parentRect.height +
20494
+ rect.height +
20495
+ 50);
20325
20496
  }
20326
20497
  else if (flag === 2 && rect.top < parentRect.top + 50) {
20327
20498
  scrollToElement(selectMenuTableRef.current, elementFocus.offsetTop - 65);
@@ -20335,28 +20506,22 @@ const SelectTable = forwardRef((props, ref) => {
20335
20506
  timeOutElement = setTimeout(() => {
20336
20507
  elemment.scrollTo({
20337
20508
  top,
20338
- behavior: 'smooth'
20509
+ behavior: 'smooth',
20339
20510
  });
20340
20511
  }, 100);
20341
20512
  };
20342
- const renderHeaderCol = (col, indexCol) => {
20343
- return (jsx(Fragment, { children: col.visible !== false && (jsx("th", { className: classNames$1(`r-select-headercell fix-${col.fixedType}`, { 'cell-fixed': col.fixedType }), style: {
20344
- width: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? 'auto') : col.width,
20345
- minWidth: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? 'auto') : col.minWidth,
20346
- top: `${0 * 35}px`,
20347
- maxWidth: col.maxWidth
20348
- }, children: jsx("div", { role: "textbox", title: t(col.headerText ?? ''), style: {
20349
- height: `${1 * 35}px`,
20350
- justifyContent: col.textAlign ?? 'left'
20351
- }, className: "r-select-headercell-div", children: t(col.headerText ?? '') }) })) }, `header-select-${indexCol}`));
20352
- };
20353
20513
  const checkSearch = (keyword, data, columnsSearch) => {
20354
20514
  if (!keyword || columnsSearch.length === 0) {
20355
20515
  return true;
20356
20516
  }
20357
20517
  for (let index = 0; index < columnsSearch.length; index++) {
20358
20518
  const key = columnsSearch[index].field.trim();
20359
- if (data[key] && data[key].toString().trim().toLowerCase().includes(keyword.trim().toLowerCase())) {
20519
+ if (data[key] &&
20520
+ data[key]
20521
+ .toString()
20522
+ .trim()
20523
+ .toLowerCase()
20524
+ .includes(keyword.trim().toLowerCase())) {
20360
20525
  return true;
20361
20526
  }
20362
20527
  }
@@ -20372,7 +20537,8 @@ const SelectTable = forwardRef((props, ref) => {
20372
20537
  if (!searchTerm) {
20373
20538
  setOptionsLoad(undefined);
20374
20539
  }
20375
- else if (allowCreate && !(optionsLoad ? optionsLoad : options)?.find((x) => x[fieldLabel ?? 'label'] === searchTerm)) {
20540
+ else if (allowCreate &&
20541
+ !currentOptions?.find((x) => x[fieldLabel ?? 'label'] === searchTerm)) {
20376
20542
  setHaveCreateNew(true);
20377
20543
  return;
20378
20544
  }
@@ -20382,11 +20548,26 @@ const SelectTable = forwardRef((props, ref) => {
20382
20548
  const element = document.getElementById(`select-${id}-${indexRow}-${indexCol}`);
20383
20549
  return element && element.scrollWidth > element.clientWidth;
20384
20550
  };
20385
- const RenderElement = React__default.memo((props) => {
20551
+ React__default.memo((props) => {
20386
20552
  const { indexRow, row, isSelected, level = 0 } = props;
20387
- return (jsxs("tr", { id: `row-select-table-${indexRow}`, style: { paddingLeft: 10 * level }, className: classNames$1('r-select-row', { 'last-row': indexRow === (optionsLoad ? optionsLoad : options).length - 1 }, { 'fisrt-row': indexRow === 0 }), children: [isMulti && (jsx("td", { className: classNames$1(`r-select-rowcell`, { 'r-select-move': indexFocus === indexRow, 'r-select-active': !isMulti && value && (compareFunction ? compareFunction(row) : value[fieldValue ?? 'value'] === row[fieldValue ?? 'value']) }), style: { width: 40, textAlign: 'center', padding: 0, paddingBottom: 6 }, onClick: (e) => {
20553
+ return (jsxs("tr", { id: `row-select-table-${indexRow}`, style: { paddingLeft: 10 * level }, className: classNames$1('r-select-row', { 'last-row': indexRow === currentOptions.length - 1 }, { 'fisrt-row': indexRow === 0 }), children: [isMulti && (jsx("td", { className: classNames$1(`r-select-rowcell`, {
20554
+ 'r-select-move': indexFocus === indexRow,
20555
+ 'r-select-active': !isMulti &&
20556
+ value &&
20557
+ (compareFunction
20558
+ ? compareFunction(row)
20559
+ : value[fieldValue ?? 'value'] ===
20560
+ row[fieldValue ?? 'value']),
20561
+ }), style: {
20562
+ width: 40,
20563
+ textAlign: 'center',
20564
+ padding: 0,
20565
+ paddingBottom: 6,
20566
+ }, onClick: (e) => {
20388
20567
  if (isMulti) {
20389
- const index = value?.findIndex((x) => (compareFunction ? compareFunction(row) : x[fieldValue ?? 'value'] === row[fieldValue ?? 'value']));
20568
+ const index = value?.findIndex((x) => compareFunction
20569
+ ? compareFunction(row)
20570
+ : x[fieldValue ?? 'value'] === row[fieldValue ?? 'value']);
20390
20571
  if (index > -1) {
20391
20572
  value?.splice(index, 1);
20392
20573
  handChange([...value]);
@@ -20404,25 +20585,42 @@ const SelectTable = forwardRef((props, ref) => {
20404
20585
  }
20405
20586
  }, children: jsx(Input$1, { checked: isSelected, type: "checkbox", className: "cursor-pointer", onChange: () => { }, style: { textAlign: 'center', marginTop: 6 } }) })), (columns ? columns : defaultColumns).map((col, indexCol) => {
20406
20587
  let valueDisplay = row[col.field];
20407
- if (col.type === 'numeric' || (col.typeCondition && col.typeCondition(row) === 'numeric')) {
20408
- valueDisplay = formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? '.', formatSetting?.thousandSeparator ?? ',', col.fraction ?? 0, true, false) ?? 0;
20588
+ if (col.type === 'numeric' ||
20589
+ (col.typeCondition && col.typeCondition(row) === 'numeric')) {
20590
+ valueDisplay =
20591
+ formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? '.', formatSetting?.thousandSeparator ?? ',', col.fraction ?? 0, true, false) ?? 0;
20409
20592
  }
20410
20593
  else if (col.type === 'date') {
20411
- valueDisplay = valueDisplay ? formatDateTime(valueDisplay, formatSetting?.dateFormat) : '';
20594
+ valueDisplay = valueDisplay
20595
+ ? formatDateTime(valueDisplay, formatSetting?.dateFormat)
20596
+ : '';
20412
20597
  }
20413
20598
  else if (col.type === 'datetime') {
20414
- valueDisplay = valueDisplay ? formatDateTime(valueDisplay, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm') : '';
20599
+ valueDisplay = valueDisplay
20600
+ ? formatDateTime(valueDisplay, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm')
20601
+ : '';
20415
20602
  }
20416
20603
  return (jsxs(Fragment, { children: [col.visible !== false && (jsx("td", { id: `select-${id}-${indexRow}-${indexCol}`,
20417
20604
  // ref={refRow}
20418
- className: classNames$1(`r-select-rowcell`, { 'r-select-move': indexFocus === indexRow, 'r-select-active': !isMulti && value && (compareFunction ? compareFunction(row) : value[fieldValue ?? 'value'] === row[fieldValue ?? 'value']) }), style: {
20605
+ className: classNames$1(`r-select-rowcell`, {
20606
+ 'r-select-move': indexFocus === indexRow,
20607
+ 'r-select-active': !isMulti &&
20608
+ value &&
20609
+ (compareFunction
20610
+ ? compareFunction(row)
20611
+ : value[fieldValue ?? 'value'] ===
20612
+ row[fieldValue ?? 'value']),
20613
+ }), style: {
20419
20614
  minWidth: col.minWidth,
20420
20615
  width: col.width,
20421
20616
  maxWidth: col.maxWidth,
20422
- textAlign: col.textAlign ? col.textAlign : 'left'
20617
+ textAlign: col.textAlign ? col.textAlign : 'left',
20423
20618
  }, onClick: (e) => {
20424
20619
  if (isMulti) {
20425
- const index = value?.findIndex((x) => (compareFunction ? compareFunction(row) : x[fieldValue ?? 'value'] === row[fieldValue ?? 'value']));
20620
+ const index = value?.findIndex((x) => compareFunction
20621
+ ? compareFunction(row)
20622
+ : x[fieldValue ?? 'value'] ===
20623
+ row[fieldValue ?? 'value']);
20426
20624
  if (index > -1) {
20427
20625
  value?.splice(index, 1);
20428
20626
  handChange([...value]);
@@ -20449,36 +20647,36 @@ const SelectTable = forwardRef((props, ref) => {
20449
20647
  setIndexFocus(indexRow);
20450
20648
  }
20451
20649
  e.stopPropagation();
20452
- }, children: col.template ? col.template(row, indexRow) : col.type === 'numeric' && Number(row[col.field]) < 0 ? jsxs("div", { style: { color: formatSetting?.colorNegative ?? 'red' }, children: [" ", `${formatSetting?.prefixNegative ?? '-'}${value}${formatSetting?.suffixNegative ?? ''}`] }) : valueDisplay }, `col-${indexRow}-${indexCol}`)), checkOverflow(indexRow, indexCol) && (jsx(UncontrolledTooltip, { className: "r-tooltip", autohide: false, target: `select-${id}-${indexRow}-${indexCol}`, children: col.template ? col.template(row, indexRow) : valueDisplay }))] }, indexCol));
20650
+ }, children: col.template ? (col.template(row, indexRow)) : col.type === 'numeric' && Number(row[col.field]) < 0 ? (jsxs("div", { style: { color: formatSetting?.colorNegative ?? 'red' }, children: [' ', `${formatSetting?.prefixNegative ?? '-'}${value}${formatSetting?.suffixNegative ?? ''}`] })) : (valueDisplay) }, `col-${indexRow}-${indexCol}`)), checkOverflow(indexRow, indexCol) && (jsx(UncontrolledTooltip, { className: "r-tooltip", autohide: false, target: `select-${id}-${indexRow}-${indexCol}`, children: col.template ? col.template(row, indexRow) : valueDisplay }))] }, indexCol));
20453
20651
  })] }, `row-${indexRow}`));
20454
20652
  });
20455
- const RenderTable = (props) => {
20456
- return (jsxs(Fragment$1, { children: [jsxs("table", { style: { width: '100%' }, children: [!(noHeader || (columns?.length ?? 0) === 0) && (jsx("thead", { className: "r-select-gridheader", children: jsxs("tr", { className: "r-select-row", role: "row", children: [isMulti && (jsx("th", { className: classNames$1(`r-select-headercell`), style: { width: 40, top: `0px` }, children: jsx("div", { style: { justifyContent: 'center' }, className: classNames$1('r-select-headercell-div'), children: jsx(Input$1, { checked: isSelectedAll, type: "checkbox", onClick: (e) => {
20457
- if (isMulti) {
20458
- if (isSelectedAll) {
20459
- handChange([]);
20460
- }
20461
- else {
20462
- handChange([...(optionsLoad ? optionsLoad : options)]);
20463
- }
20464
- e.stopPropagation();
20465
- }
20466
- }, readOnly: true, className: classNames$1('cursor-pointer', { 'd-none': !isMulti }), style: { textAlign: 'center', marginTop: 6 } }) }) })), (columns ? columns : defaultColumns).map((col, index) => {
20467
- return renderHeaderCol(col, index);
20468
- })] }) })), (optionsLoad ? optionsLoad : options) && !isLoading && (jsx(Fragment$1, { children: jsxs("tbody", { className: "r-select-gridcontent", children: [haveCreateNew && jsx(RenderElement, { isSelected: false, indexRow: 0, row: { valueCreate: searchTerm, [fieldValue ?? 'value']: searchTerm, [fieldLabel ?? 'label']: `${t('Create')} '${searchTerm}'`, isCreated: true } }), (optionsLoad ? optionsLoad : options)?.map((row, indexRow) => {
20469
- const isSelected = isMulti && value?.some((x) => (compareFunction ? compareFunction(row) : x[fieldValue ?? 'value'] === row[fieldValue ?? 'value']));
20470
- return jsx(RenderElement, { isSelected: isSelected ?? false, indexRow: indexRow + (haveCreateNew ? 1 : 0), row: row }, `select-table-${indexRow}`);
20471
- })] }) }))] }), ((optionsLoad ? optionsLoad : options)?.length ?? 0) === 0 && !haveCreateNew && !isLoading && (jsxs("div", { className: "r-no-data", children: [jsx("svg", { width: "64", height: "41", viewBox: "0 0 64 41", xmlns: "http://www.w3.org/2000/svg", children: jsxs("g", { transform: "translate(0 1)", fill: "none", fillRule: "evenodd", children: [jsx("ellipse", { fill: "#f5f5f5", cx: "32", cy: "33", rx: "32", ry: "7" }), jsxs("g", { fillRule: "nonzero", stroke: "#d9d9d9", children: [jsx("path", { d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z" }), jsx("path", { d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z", fill: "#fafafa" })] })] }) }), t('No data available.')] })), isLoading && (jsxs("div", { className: "r-no-data", children: [jsx(Spinner$1, { className: "me-1", children: " " }), t('Loading...')] }))] }));
20472
- };
20473
20653
  return (jsx("div", { className: classNames$1('react-select-table', { 'is-invalid': invalid }), ref: ref, id: id, children: jsx("div", { ref: selectTableRef, children: jsxs(Dropdown$1$1, { isOpen: dropdownOpen, toggle: () => { }, onMouseDown: (e) => e.preventDefault(), children: [jsxs(DropdownToggle$1, { onClick: (e) => {
20474
20654
  if (!isDisabled) {
20475
20655
  inputRef?.current.focus();
20476
20656
  handleOpenClose();
20477
20657
  }
20478
20658
  e.preventDefault();
20479
- }, tag: "div", style: { width: width ? width : selectTableRef?.current?.clientWidth ? selectTableRef?.current?.clientWidth : 'auto' }, className: classNames$1('select-table-control', { 'r-select-is-disabled': isDisabled }, { 'r-select-is-open': dropdownOpen }, { 'r-select-is-focus': isFocus }, { 'r-select-is-invalid': invalid }), children: [jsxs("div", { className: "select-table-container", children: [isMulti ? (jsx(Fragment$1, { children: jsx("div", { className: classNames$1('select-value is-mutil', { 'd-none': searchTerm }), children: value?.map((ele, index) => {
20480
- return (jsxs("span", { children: [index === 0 ? '' : ', ', formatOptionLabel ? formatOptionLabel(ele) : ele[fieldLabel ?? 'label']] }, index));
20481
- }) }) })) : (jsx(Fragment$1, { children: jsxs("div", { className: classNames$1('select-value', { 'd-none': searchTerm }), children: [value ? (formatOptionLabel ? formatOptionLabel(value) : value[fieldLabel ?? 'label']) : '', " "] }) })), !((isMulti ? value?.length > 0 : value) || isDisabled || searchTerm) && jsx("div", { className: classNames$1('select-placeholder'), children: placeholder }), jsx("div", { className: "input-container", children: jsx("input", { style: { textAlign: textAlign ?? 'left' }, ref: inputRef, className: classNames$1('select-input'), readOnly: isDisabled, value: searchTerm, onPaste: (e) => onPaste && !dropdownOpen && onPaste(e), onChange: (val) => {
20659
+ }, tag: "div", style: {
20660
+ width: width
20661
+ ? width
20662
+ : selectTableRef?.current?.clientWidth
20663
+ ? selectTableRef?.current?.clientWidth
20664
+ : 'auto',
20665
+ }, className: classNames$1('select-table-control', { 'r-select-is-disabled': isDisabled }, { 'r-select-is-open': dropdownOpen }, { 'r-select-is-focus': isFocus }, { 'r-select-is-invalid': invalid }), children: [jsxs("div", { className: "select-table-container", children: [isMulti ? (jsx("div", { className: classNames$1('select-value is-mutil', {
20666
+ 'd-none': searchTerm,
20667
+ }), children: value?.map((ele, index) => {
20668
+ return (jsxs("span", { children: [index === 0 ? '' : ', ', formatOptionLabel
20669
+ ? formatOptionLabel(ele)
20670
+ : ele[fieldLabel ?? 'label']] }, index));
20671
+ }) })) : (jsxs("div", { className: classNames$1('select-value', {
20672
+ 'd-none': searchTerm,
20673
+ }), children: [value
20674
+ ? formatOptionLabel
20675
+ ? formatOptionLabel(value)
20676
+ : value[fieldLabel ?? 'label']
20677
+ : '', ' '] })), !((isMulti ? value?.length > 0 : value) ||
20678
+ isDisabled ||
20679
+ searchTerm) && (jsx("div", { className: classNames$1('select-placeholder'), children: placeholder })), jsx("div", { className: "input-container", children: jsx("input", { style: { textAlign: textAlign ?? 'left' }, ref: inputRef, className: classNames$1('select-input'), readOnly: isDisabled, value: searchTerm, onPaste: (e) => onPaste && !dropdownOpen && onPaste(e), onChange: (val) => {
20482
20680
  if (val.target.value) {
20483
20681
  if (loadOptions && val.target.value) {
20484
20682
  setIsLoading(true);
@@ -20500,13 +20698,23 @@ const SelectTable = forwardRef((props, ref) => {
20500
20698
  width: width ? width + 2 : 'min-content',
20501
20699
  position: 'fixed',
20502
20700
  borderRadius: 4,
20503
- zIndex: 9999
20701
+ zIndex: 9999,
20504
20702
  }, children: jsx(DropdownItem$1, { className: classNames$1('p-0 menu-select-table'), tag: "div", header: true, children: dropdownOpen && (jsx("div", { style: { backgroundColor: 'none' }, onMouseDown: (e) => {
20505
20703
  if (!isDisabled) {
20506
20704
  inputRef?.current.focus();
20507
20705
  e.preventDefault();
20508
20706
  }
20509
- }, children: jsxs("div", { className: "r-select-grid", children: [jsx("div", { className: classNames$1('r-select-gridtable', { 'no-header': noHeader || (columns?.length ?? 0) === 0 }), ref: selectMenuTableRef, style: { width: menuWidth, minWidth: selectTableRef?.current?.clientWidth, maxHeight: maxHeight ?? defaultMaxHeight$1 }, children: jsx(RenderTable, {}) }), jsxs("div", { className: classNames$1('r-select-footer', { 'd-none': !(showFooter === true || handleAdd || isMulti) }), children: [jsxs(Button$1$1, { outline: true, color: "primary", onClick: () => handleAdd?.(), className: classNames$1('r-btn d-flex align-items-center', { 'd-none': !handleAdd }), children: [jsx(SvgPlus, { className: "me-50", fontSize: 16 }), t('AddNew'), " (F9)"] }), isMulti && jsx("div", { className: "ms-50 text-primary h-100 d-flex align-items-center", children: t('countSelected', { item: value?.length ?? 0 }) }), footerComponent ? footerComponent() : null] })] }) })) }) })] }) }) }));
20707
+ }, children: jsxs("div", { className: "r-select-grid", children: [jsx("div", { className: classNames$1('r-select-gridtable', {
20708
+ 'no-header': noHeader || (columns?.length ?? 0) === 0,
20709
+ }), ref: selectMenuTableRef, style: {
20710
+ width: menuWidth,
20711
+ minWidth: selectTableRef?.current?.clientWidth,
20712
+ maxHeight: maxHeight ?? defaultMaxHeight$1,
20713
+ }, children: jsx(TableElement$1, { haveCreateNew: haveCreateNew, isLoading: isLoading, searchTerm: searchTerm, fieldLabel: fieldLabel, noHeader: noHeader, closeMenu: closeMenu, value: value, isMulti: isMulti, currentOptions: currentOptions, fieldValue: fieldValue, columns: columns, defaultColumns: defaultColumns, indexFocus: indexFocus, formatSetting: formatSetting, handChange: handChange, compareFunction: compareFunction, setIndexFocus: setIndexFocus, setSearchTerm: setSearchTerm }) }), jsxs("div", { className: classNames$1('r-select-footer', {
20714
+ 'd-none': !(showFooter === true ||
20715
+ handleAdd ||
20716
+ isMulti),
20717
+ }), children: [jsxs(Button$1$1, { outline: true, color: "primary", onClick: () => handleAdd?.(), className: classNames$1('r-btn d-flex align-items-center', { 'd-none': !handleAdd }), children: [jsx(SvgPlus, { className: "me-50", fontSize: 16 }), t('AddNew'), " (F9)"] }), isMulti && (jsx("div", { className: "ms-50 text-primary h-100 d-flex align-items-center", children: t('countSelected', { item: value?.length ?? 0 }) })), footerComponent ? footerComponent() : null] })] }) })) }) })] }) }) }));
20510
20718
  });
20511
20719
 
20512
20720
  const PagingComponent = ({ totalItem, gridRef, pageSize, currentPage, onChangePage, pageOptions, onChangePageSize }) => {
@@ -36322,7 +36530,7 @@ const RenderEditCellComponent = (props) => {
36322
36530
  }
36323
36531
  };
36324
36532
 
36325
- var css_248z$2 = "@charset \"UTF-8\";\n.react-select-table .select-table-control {\n opacity: 1;\n border: 1px solid hsl(0, 0%, 80%);\n border-radius: 0.357rem;\n width: 100%;\n height: 28px;\n background-color: #FFFFFF;\n display: flex;\n align-items: center;\n padding: 2px 8px;\n}\n.react-select-table .select-table-control .select-table-indicator svg {\n fill: #c4c4c4 !important;\n}\n.react-select-table .select-table-control .icon-clear {\n font-size: 25px;\n margin-top: 2px;\n font-weight: 500;\n color: #c4c4c4;\n}\n.react-select-table .select-table-control .icon-clear:hover {\n color: rgba(0, 0, 0, 0.8705882353) !important;\n}\n.react-select-table .select-table-control.r-select-is-open .select-table-indicator svg {\n fill: rgba(0, 0, 0, 0.8705882353) !important;\n}\n.react-select-table .select-table-control.r-select-is-invalid {\n border: 1px solid red !important;\n}\n.react-select-table .select-table-control.r-select-is-focus {\n border: 1px solid #1989fa !important;\n}\n.react-select-table .select-table-control.r-select-is-disabled {\n background-color: #efefef !important;\n}\n.react-select-table .select-table-control .select-table-container {\n position: relative;\n flex: 1;\n}\n.react-select-table .select-table-control .select-table-container .input-container {\n background-color: transparent;\n white-space: nowrap;\n top: 0px;\n left: 0px;\n display: inline;\n}\n.react-select-table .select-table-control .select-table-container .input-container .select-input {\n background-color: transparent;\n text-align: center;\n width: 100%;\n box-sizing: border-box;\n margin-left: -3px;\n border: none;\n /* Loại bỏ border */\n outline: none;\n /* Loại bỏ outline khi input được chọn */\n}\n.react-select-table .select-table-control .select-table-container .input-container .select-input:focus {\n border-width: 0px !important;\n}\n.react-select-table .select-table-control .select-table-container .select-placeholder {\n position: absolute;\n color: #283046;\n margin-top: 1px;\n background-color: transparent;\n}\n.react-select-table .select-table-control .select-table-container .select-value {\n position: absolute;\n background-color: transparent;\n bottom: 0px;\n left: 0px;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.react-select-table .formula-dropdown {\n min-width: min-content !important;\n box-shadow: rgba(0, 0, 0, 0.2) 0px 5px 15px;\n}\n.react-select-table input::placeholder {\n color: #000000 !important;\n opacity: 1;\n /* Firefox */\n}\n\n.r-select-grid.r-select-tree-grid .r-select-gridtable .r-select-row:hover {\n background-color: rgba(235, 70, 25, 0.1) !important;\n color: #eb4619;\n}\n\n.r-select-grid {\n font-size: 12px;\n font-family: Montserrat, Helvetica, Arial, serif;\n font-weight: 500 !important;\n border-radius: 4px !important;\n overflow: hidden;\n}\n.r-select-grid table {\n table-layout: fixed;\n border-collapse: separate;\n border-spacing: 0px;\n}\n.r-select-grid .r-select-gridtable {\n -webkit-overflow-scrolling: touch;\n overflow-x: auto;\n overflow-y: auto;\n position: relative;\n background-color: #FFFFFF;\n color: rgba(0, 0, 0, 0.8705882353) !important;\n font-weight: 400 !important;\n font-size: 13px !important;\n /* Toàn bộ thanh cuộn */\n}\n.r-select-grid .r-select-gridtable::-webkit-scrollbar {\n width: 9px;\n height: 9px;\n}\n.r-select-grid .r-select-gridtable::-webkit-scrollbar-track {\n background: #FCFCFC;\n}\n.r-select-grid .r-select-gridtable::-webkit-scrollbar-thumb {\n background: #8B8B8B;\n border-radius: 6px;\n}\n.r-select-grid .r-select-gridtable::-webkit-scrollbar-thumb:hover {\n background: #636363;\n}\n.r-select-grid .r-select-gridtable .r-select-gridheader .r-select-row .r-select-headercell {\n color: rgba(0, 0, 0, 0.8705882353) !important;\n position: sticky;\n padding: 0px;\n height: 35px;\n z-index: 1;\n border-width: 0px;\n line-height: 16px;\n}\n.r-select-grid .r-select-gridtable .r-select-gridheader .r-select-row .r-select-headercell .r-select-headercell-div {\n border-bottom: 1px solid #e0e0e0;\n background-color: #fafafa;\n display: flex;\n align-items: center;\n text-align: center;\n padding: 5px 10px;\n height: 100%;\n}\n.r-select-grid .r-select-gridtable .r-select-gridheader .r-select-row .r-select-headercell .r-select-headercell-text {\n width: 100%;\n}\n.r-select-grid .r-select-gridtable .r-select-gridcontent .r-select-row {\n background-color: #FFFFFF;\n cursor: pointer;\n}\n.r-select-grid .r-select-gridtable .r-select-gridcontent .r-select-row .cell-fixed {\n position: sticky;\n z-index: 1;\n}\n.r-select-grid .r-select-gridtable .r-select-gridcontent .r-select-row.fisrt-row .r-select-rowcell {\n border-top-width: 0px !important;\n}\n.r-select-grid .r-select-gridtable .r-select-gridcontent .r-select-row.last-row .r-select-rowcell {\n border-bottom: 1px solid #e0e0e0;\n}\n.r-select-grid .r-select-gridtable .r-select-gridcontent .r-select-row .r-select-rowcell {\n border-top: 1px solid #e0e0e0;\n height: 30px !important;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n padding: 7px 9px;\n vertical-align: middle !important;\n}\n.r-select-grid .r-select-gridtable .r-select-gridcontent .r-select-row .r-select-rowcell.r-select-move {\n background-color: rgba(235, 70, 25, 0.1) !important;\n color: #eb4619 !important;\n}\n.r-select-grid .r-select-gridtable .r-select-gridcontent .r-select-row .r-select-rowcell.r-select-active {\n background-color: #eb4619 !important;\n color: #FFFFFF !important;\n}\n.r-tooltip .r-select-grid .r-select-gridtable .r-select-gridcontent .r-select-row .r-select-rowcell.r-hidden {\n display: none;\n}\n.r-tooltip .r-select-grid .r-select-gridtable .r-select-gridcontent .r-select-row .r-select-rowcell.r-hidden ::after {\n display: none;\n}\n.r-select-grid .r-select-gridtable .r-select-gridcontent .r-select-row .r-select-rowcell .r-icon-expand {\n transition: transform 0.3s ease !important;\n}\n.r-select-grid .r-select-gridtable .r-select-gridcontent .r-select-row .r-select-rowcell .r-icon-expand.is-open {\n transform: rotate(90deg) !important;\n -moz-transform: rotate(90deg);\n -webkit-transform: rotate(90deg);\n -o-transform: rotate(90deg);\n}\n.r-select-grid .r-select-gridtable.no-header .r-select-rowcell {\n border: none !important;\n}\n.r-select-grid .r-no-data {\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 14px;\n padding: 7px 9px;\n color: #8f8f8f;\n}\n.r-select-grid .r-select-footer {\n height: 30px;\n background-color: #fafafa;\n}\n.r-select-grid .r-select-footer button {\n font-weight: 400 !important;\n font-size: 13px;\n}\n.r-select-grid .r-select-footer .r-btn {\n border-width: 0px !important;\n}\n\n.r-pagesize .react-select-table .select-table-control {\n border-radius: 0px;\n border: 0px;\n border-bottom: 1px solid #e0e0e0 !important;\n}\n.r-pagesize .react-select-table .select-table-control.r-select-is-focus {\n border: 0px !important;\n border-bottom: 1px solid #1989fa !important;\n}\n\n.r-sidebar {\n width: 400px;\n right: -400px;\n padding: 0;\n background-color: #FFFFFF;\n z-index: 1051;\n position: fixed;\n top: 0;\n bottom: 0;\n height: 100vh;\n height: calc(var(--vh, 1vh) * 100);\n transition: right 0.4s cubic-bezier(0.05, 0.74, 0.2, 0.99);\n backface-visibility: hidden;\n border-left: 1px solid rgba(0, 0, 0, 0.05);\n}\n.r-sidebar.open {\n box-shadow: 0 15px 30px 0 rgba(0, 0, 0, 0.11), 0 5px 15px 0 rgba(0, 0, 0, 0.08);\n right: 0;\n}\n.r-sidebar .modal-header {\n background-color: #FFFFFF;\n}\n.r-sidebar .modal-header .btn-close {\n padding: 0.8rem;\n box-shadow: 0 5px 20px 0 rgba(0, 0, 0, 0.1);\n border-radius: 0.357rem;\n background-color: #FFFFFF;\n opacity: 1;\n transition: all 0.23s ease 0.1s;\n position: relative;\n transform: translate(18px, -10px);\n}\n.r-sidebar .modal-header .btn-close:hover, .r-sidebar .modal-header .btn-close:focus, .r-sidebar .modal-header .btn-close:active {\n opacity: 1;\n outline: none;\n transform: translate(15px, -2px);\n box-shadow: none;\n}\n\n.r-sidebar .react-select {\n max-width: 100%;\n}\n\n.r-sidebar {\n width: 400px;\n right: -100vw;\n height: 100vh;\n}\n.r-sidebar .r-handle {\n position: fixed;\n background-color: #FFFFFF;\n top: 50%;\n transform: translate(-50%, -50%);\n filter: drop-shadow(0.9px 0.9px 1.5px);\n height: 50px;\n display: flex;\n align-items: center;\n border-radius: 0px 5px 5px 0px;\n cursor: pointer;\n margin-left: 7px;\n z-index: 9;\n}\n.r-sidebar.customizer-md {\n width: 600px;\n}\n.r-sidebar.customizer-lg {\n width: 800px;\n}\n.r-sidebar.customizer-500 {\n width: 500px;\n}\n@media (max-width: 500px) {\n .r-sidebar.customizer-500 {\n width: 100vw;\n }\n}\n.r-sidebar.customizer-600 {\n width: 600px;\n}\n@media (max-width: 600px) {\n .r-sidebar.customizer-600 {\n width: 100vw;\n }\n}\n.r-sidebar.customizer-700 {\n width: 700px;\n}\n@media (max-width: 700px) {\n .r-sidebar.customizer-700 {\n width: 100vw;\n }\n}\n.r-sidebar.customizer-800 {\n width: 800px;\n}\n@media (max-width: 800px) {\n .r-sidebar.customizer-800 {\n width: 100vw;\n }\n}\n.r-sidebar.customizer-900 {\n width: 900px;\n}\n@media (max-width: 900px) {\n .r-sidebar.customizer-900 {\n width: 100vw;\n }\n}\n.r-sidebar.customizer-1000 {\n width: 1000px;\n}\n@media (max-width: 1000px) {\n .r-sidebar.customizer-1000 {\n width: 100vw;\n }\n}\n.r-sidebar.customizer-1500 {\n width: 1500px;\n}\n@media (max-width: 1500px) {\n .r-sidebar.customizer-1500 {\n width: 100vw;\n }\n}\n.r-sidebar.fullscreen {\n width: 100%;\n}\n.r-sidebar.open {\n right: 0;\n}\n\n.r-datepicker {\n position: relative;\n}\n.r-datepicker .form-control {\n height: 28px;\n}\n\n.r-datepicker-popup {\n background: white;\n border: 1px solid #e0e0e0;\n padding: 15px 5px !important;\n}\n.r-datepicker-popup .rdp-nav {\n display: none;\n}\n.r-datepicker-popup .rdp-month_caption {\n display: none;\n}\n.r-datepicker-popup .select-month-year {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n padding: 5px 5px 8px 5px;\n}\n.r-datepicker-popup .select-month-year .select-month {\n text-align: right;\n width: 90px !important;\n}\n.r-datepicker-popup .select-month-year .select-year {\n text-align: left;\n width: 65px !important;\n}\n.r-datepicker-popup .select-month-year svg:hover {\n color: #eb4619;\n}\n.r-datepicker-popup .select-month-year .select-table-control .select-table-container {\n color: rgba(0, 0, 0, 0.8705882353) !important;\n font-size: 14px !important;\n font-weight: 600;\n}\n.r-datepicker-popup .select-month-year .select-table-control .select-table-container .select-input {\n cursor: pointer !important;\n}\n.r-datepicker-popup .select-month-year .react-select-table .select-table-control {\n border: none;\n}\n.r-datepicker-popup .select-month-year .react-select-table .r-select-is-focus {\n border: none !important;\n}\n.r-datepicker-popup .select-month-year .select-table-indicator {\n display: none;\n}\n.r-datepicker-popup .rdp-weekday {\n color: rgba(0, 0, 0, 0.8705882353) !important;\n opacity: 1 !important;\n font-weight: 500;\n font-size: 14px !important;\n}\n.r-datepicker-popup .rdp-day {\n color: rgba(0, 0, 0, 0.8705882353) !important;\n font-size: 13.5px !important;\n height: 32px !important;\n width: 32px !important;\n}\n.r-datepicker-popup .rdp-day .rdp-day_button {\n height: 32px !important;\n width: 32px !important;\n}\n.r-datepicker-popup .rdp-day.rdp-today {\n font-weight: bold;\n color: #eb4619;\n}\n.r-datepicker-popup .rdp-day.rdp-today .rdp-day_button {\n border: 1px solid #eb4619;\n border-radius: 8px;\n}\n.r-datepicker-popup .rdp-day.rdp-selected .rdp-day_button {\n border: 1px solid #eb4619;\n background-color: #eb4619;\n color: #FFFFFF;\n border-radius: 8px;\n}\n.r-datepicker-popup .rdp-day.rdp-in-range .rdp-day_button {\n background-color: #fce6df;\n color: #eb4619;\n border-radius: 2px;\n height: 22px !important;\n border-width: 0px !important;\n}\n.r-datepicker-popup .rdp-day .rdp-day_button:hover {\n background-color: #fce6df;\n color: #eb4619;\n border-radius: 8px;\n}\n.r-datepicker-popup .btn-today {\n margin-top: 5px;\n text-align: center;\n font-size: 13px;\n color: #eb4619;\n cursor: pointer;\n user-select: none;\n font-weight: 500;\n}\n.r-datepicker-popup .btn-today:hover {\n text-decoration: underline;\n}\n\n.tab-custom {\n font-family: Roboto, \"Segoe UI\", GeezaPro, \"DejaVu Serif\", \"sans-serif\", -apple-system, BlinkMacSystemFont;\n display: flex;\n}\n.tab-custom.tab-parent {\n border-bottom: solid 1px #c9c9c9;\n}\n.tab-custom .btn-scroll {\n cursor: pointer;\n display: flex;\n align-items: center;\n}\n.tab-custom .tab-component::-webkit-scrollbar {\n display: none;\n /* Ẩn thanh cuộn nếu không cần */\n}\n.tab-custom .tab-component {\n white-space: nowrap;\n overflow-x: hidden;\n scroll-behavior: smooth;\n}\n.tab-custom .tab-component > * {\n display: inline-block;\n}\n.tab-custom .tab-component .tab-custom-item {\n display: inline-block;\n padding: 3px 10px;\n line-height: 23px;\n cursor: pointer;\n font-size: 13px;\n font-weight: 500;\n text-transform: uppercase;\n height: 30px;\n color: rgba(0, 0, 0, 0.5);\n}\n.tab-custom .tab-component .tab-custom-item.active {\n border-bottom: solid 2px #eb4619 !important;\n color: #eb4619;\n}\n.tab-custom.tab-child .tab-custom-item {\n font-size: 12px !important;\n line-height: 23px !important;\n border-radius: 5px 5px 0px 0px;\n margin: 8px 3px 0px 3px;\n box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;\n}\n\n.bs-stepper {\n background-color: #FFFFFF;\n box-shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.1);\n border-radius: 0.5rem;\n}\n.bs-stepper .bs-stepper-header {\n padding: 1.5rem 1.5rem;\n flex-wrap: wrap;\n border-bottom: 1px solid rgba(0, 0, 0, 0.08);\n margin: 0;\n}\n.bs-stepper .bs-stepper-header .line {\n flex: 0;\n min-width: auto;\n min-height: auto;\n background-color: transparent;\n margin: 0;\n padding: 0 1.75rem;\n color: #283046;\n font-size: 1.5rem;\n}\n.bs-stepper .bs-stepper-header .step {\n margin-bottom: 0.25rem;\n margin-top: 0.25rem;\n}\n.bs-stepper .bs-stepper-header .step .step-trigger {\n flex-wrap: nowrap;\n padding: 0;\n font-weight: normal;\n}\n.bs-stepper .bs-stepper-header .step .step-trigger .bs-stepper-box {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 38px;\n height: 38px;\n padding: 0.5em 0;\n font-weight: 500;\n color: #babfc7;\n background-color: rgba(186, 191, 199, 0.12);\n border-radius: 0.35rem;\n}\n.bs-stepper .bs-stepper-header .step .step-trigger .bs-stepper-label {\n text-align: left;\n margin: 0;\n margin-top: 0.5rem;\n margin-left: 1rem;\n}\n.bs-stepper .bs-stepper-header .step .step-trigger .bs-stepper-label .bs-stepper-title {\n display: inherit;\n color: #283046;\n font-weight: 600;\n line-height: 1rem;\n margin-bottom: 0rem;\n}\n.bs-stepper .bs-stepper-header .step .step-trigger .bs-stepper-label .bs-stepper-subtitle {\n font-weight: 400;\n font-size: 0.85rem;\n color: #b9b9c3;\n}\n.bs-stepper .bs-stepper-header .step .step-trigger:hover {\n background-color: transparent;\n}\n.bs-stepper .bs-stepper-header .step.active .step-trigger .bs-stepper-box {\n background-color: #eb4619;\n color: #FFFFFF;\n box-shadow: 0 3px 6px 0 rgba(235, 70, 25, 0.4);\n}\n.bs-stepper .bs-stepper-header .step.active .step-trigger .bs-stepper-label .bs-stepper-title {\n color: #eb4619;\n}\n.bs-stepper .bs-stepper-header .step.crossed .step-trigger .bs-stepper-box {\n background-color: rgba(235, 70, 25, 0.12);\n color: #eb4619;\n}\n.bs-stepper .bs-stepper-header .step.crossed .step-trigger .bs-stepper-label .bs-stepper-title {\n color: #b9b9c3;\n}\n.bs-stepper .bs-stepper-header .step.crossed + .line {\n color: #eb4619;\n}\n.bs-stepper .bs-stepper-content {\n padding: 1.5rem 1.5rem;\n}\n.bs-stepper .bs-stepper-content .content {\n margin-left: 0;\n}\n.bs-stepper .bs-stepper-content .content .content-header {\n margin-bottom: 1rem;\n}\n.bs-stepper.vertical .bs-stepper-header {\n border-right: 1px solid #e0e0e0;\n border-bottom: none;\n}\n.bs-stepper.vertical .bs-stepper-header .step .step-trigger {\n padding: 1rem 0;\n}\n.bs-stepper.vertical .bs-stepper-header .line {\n display: none;\n}\n.bs-stepper.vertical .bs-stepper-content {\n width: 100%;\n padding-top: 2.5rem;\n}\n.bs-stepper.vertical .bs-stepper-content .content:not(.active) {\n display: none;\n}\n.bs-stepper.vertical.wizard-icons .step {\n text-align: center;\n}\n.bs-stepper.wizard-modern {\n background-color: transparent;\n box-shadow: none;\n}\n.bs-stepper.wizard-modern .bs-stepper-header {\n border: none;\n}\n.bs-stepper.wizard-modern .bs-stepper-content {\n background-color: #FFFFFF;\n border-radius: 0.5rem;\n box-shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.1);\n}\n\n.horizontal-wizard,\n.vertical-wizard,\n.modern-horizontal-wizard,\n.modern-vertical-wizard {\n margin-bottom: 2.2rem;\n}\n\nhtml[data-textdirection=rtl] .btn-prev,\nhtml[data-textdirection=rtl] .btn-next {\n display: flex;\n}\nhtml[data-textdirection=rtl] .btn-prev i,\nhtml[data-textdirection=rtl] .btn-prev svg,\nhtml[data-textdirection=rtl] .btn-next i,\nhtml[data-textdirection=rtl] .btn-next svg {\n transform: rotate(-180deg);\n}\n\n@media (max-width: 992px) {\n .bs-stepper .bs-stepper-header {\n flex-direction: column;\n align-items: flex-start;\n }\n .bs-stepper .bs-stepper-header .step .step-trigger {\n padding: 0.5rem 0 !important;\n flex-direction: row;\n }\n .bs-stepper .bs-stepper-header .line {\n display: none;\n }\n .bs-stepper.vertical {\n flex-direction: column;\n }\n .bs-stepper.vertical .bs-stepper-header {\n align-items: flex-start;\n }\n .bs-stepper.vertical .bs-stepper-content {\n padding-top: 1.5rem;\n }\n}\n.r-context-popover .popover-arrow {\n display: none !important;\n}\n.r-context-popover .popover-body {\n padding: 5px !important;\n border: none !important;\n border-radius: 10px;\n}\n.r-context-popover .popover-body .r-context-item {\n padding: 5px 10px;\n font-size: 13px;\n cursor: pointer;\n border-radius: 5px;\n display: flex;\n align-items: center;\n}\n.r-context-popover .popover-body .r-context-item:hover {\n background-color: rgba(235, 70, 25, 0.1);\n color: #eb4619;\n}\n\n.r-table-edit .r-grid {\n font-size: 12px;\n}\n.r-table-edit .r-grid .r-search {\n display: flex;\n position: relative;\n align-items: center;\n}\n.r-table-edit .r-grid .r-search .input__value {\n z-index: 1;\n}\n.r-table-edit .r-grid .r-search .input__value.is-clearable {\n padding-right: 25px;\n}\n.r-table-edit .r-grid .r-search .input__clear-icon {\n position: absolute;\n right: 5px;\n z-index: 10;\n}\n.r-table-edit .r-grid .r-gridtable {\n -webkit-overflow-scrolling: touch;\n overflow-x: auto;\n overflow-y: scroll;\n position: relative;\n background-color: #FFFFFF;\n color: rgba(0, 0, 0, 0.8705882353);\n font-weight: 400;\n border: 1px solid #e0e0e0;\n /* Toàn bộ thanh cuộn */\n /* Nền của thanh cuộn */\n /* Thanh trượt (thumb) */\n /* Khi hover */\n}\n.r-table-edit .r-grid .r-gridtable table {\n table-layout: fixed;\n border-collapse: separate;\n border-spacing: 0px;\n}\n.r-table-edit .r-grid .r-gridtable::-webkit-scrollbar {\n width: 9px;\n /* Độ rộng của thanh cuộn */\n height: 9px;\n /* Độ cao của thanh cuộn */\n}\n.r-table-edit .r-grid .r-gridtable::-webkit-scrollbar-track {\n background: #FCFCFC;\n /* Màu nền nhạt */\n}\n.r-table-edit .r-grid .r-gridtable::-webkit-scrollbar-thumb {\n background: #8B8B8B;\n /* Màu xám nhạt */\n border-radius: 6px;\n /* Bo góc giống Edge */\n}\n.r-table-edit .r-grid .r-gridtable::-webkit-scrollbar-thumb:hover {\n background: #636363;\n /* Màu đậm hơn khi hover */\n}\n.r-table-edit .r-grid .r-gridtable .react-resizable-handle.react-resizable-handle-se {\n position: absolute;\n right: 0px;\n top: 0px;\n width: 10px;\n height: 100%;\n cursor: col-resize;\n background-image: none;\n}\n.r-table-edit .r-grid .r-gridtable .r-filter svg.active {\n color: #eb4619;\n}\n.r-table-edit .r-grid .r-gridtable .r-filter-popup .react-select-table .select-value {\n line-height: 20px !important;\n}\n.r-table-edit .r-grid .r-gridtable .r-filter-popup .react-select-table .select-placeholder {\n line-height: 20px !important;\n}\n.r-table-edit .r-grid .r-gridtable .r-filter-popup .react-select-table .r-select-is-focus {\n border-color: #eb4619 !important;\n}\n.r-table-edit .r-grid .r-gridtable .r-filter-popup .form-control:focus {\n border-color: #eb4619 !important;\n}\n.r-table-edit .r-grid .r-gridtable .r-no-data {\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 14px;\n padding: 20px 9px;\n color: #8f8f8f;\n}\n.r-table-edit .r-grid .r-gridtable .r-loading-overlay {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(255, 255, 255, 0.3);\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 3;\n}\n.r-table-edit .r-grid .r-gridtable .r-loading-overlay .r-loading {\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 14px;\n padding: 7px 9px;\n color: #eb4619;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridheader .r-row .cell-fixed {\n z-index: 2 !important;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridheader .r-row .cell-fixed.fix-right .r-headercell-div {\n border-left: 1px solid #e0e0e0;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridheader .r-row .cell-fixed.fix-left .r-headercell-div {\n border-right: 1px solid #e0e0e0;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridheader .r-row .cell-fixed.fix-left.fixed-last .r-headercell-div {\n box-shadow: 2px 0 4px -1px rgba(0, 0, 0, 0.1);\n}\n.r-table-edit .r-grid .r-gridtable .r-gridheader .r-row .cell-fixed.fix-right.fixed-last .r-headercell-div {\n box-shadow: -2px 0 4px -1px rgba(0, 0, 0, 0.1);\n}\n.r-table-edit .r-grid .r-gridtable .r-gridheader .r-row .r-headercell {\n color: rgba(0, 0, 0, 0.8705882353);\n position: sticky;\n padding: 0px;\n height: 42px;\n z-index: 1;\n border-width: 0px;\n line-height: 16px;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridheader .r-row .r-headercell .r-headercell-div {\n border-right: 1px solid #e0e0e0;\n border-bottom: 1px solid #e0e0e0;\n background-color: #FFFFFF;\n display: flex;\n align-items: center;\n text-align: center;\n padding: 5px 10px;\n height: 100%;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridheader .r-row .r-headercell .header-content {\n display: flex;\n flex: 1 1 0%;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridheader .r-row .r-headercell .header-content .text-content {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row:first-of-type .r-rowcell-div {\n border-top-color: #FFFFFF;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row {\n font-size: 13px;\n transition: transform 0.05s linear;\n will-change: transform;\n backface-visibility: hidden;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .cell-fixed {\n position: sticky;\n z-index: 1;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .cell-fixed .r-rowcell.r-cell-selected-right {\n margin-right: 1px;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row.r-last-row .r-rowcell .r-rowcell-div {\n border-bottom: 1px solid #e0e0e0;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell {\n background-color: #FFFFFF;\n border-bottom: 1px solid #e0e0e0;\n border-right: 1px solid #e0e0e0;\n vertical-align: middle;\n padding: 0;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell.r-cell-sum-group {\n background-color: #fafafa;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell.r-cell-sum-group .r-rowcell-div {\n padding-left: 10px;\n padding-right: 5px;\n display: flex;\n align-items: center;\n background-color: #fafafa;\n font-weight: 550;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell.r-cell-group {\n left: 0px;\n position: sticky;\n z-index: 1;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell.r-cell-group .r-rowcell-div {\n padding-left: 10px;\n padding-right: 5px !important;\n display: flex;\n align-items: center;\n background-color: #fafafa;\n font-weight: 550;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell.r-cell-group .r-rowcell-div svg {\n margin-right: 10px;\n cursor: pointer;\n user-select: none;\n transition: transform 0.2s ease-in-out;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell.r-cell-group .r-rowcell-div svg:hover {\n color: #eb4619;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell.cell-fixed .r-rowcell-div.r-cell-selected-right {\n padding-right: 1px;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell.fix-right {\n border-left: 1px solid #e0e0e0;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell.fix-right.fixed-last {\n border-left: 1px solid #e0e0e0;\n box-shadow: -2px 0 4px -1px rgba(0, 0, 0, 0.1);\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell.fix-left.fixed-last {\n border-right: 1px solid #e0e0e0;\n box-shadow: 2px 0 4px -1px rgba(0, 0, 0, 0.1);\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell.r-active-row {\n background-color: #fce6df;\n border-right: 2px solid #eb4619;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div {\n min-height: 28px !important;\n border: 1px solid transparent;\n position: relative;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .arrow-context-menu {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 15px;\n width: 15px;\n background-color: #FFFFFF;\n border-radius: 10px;\n border: 1px solid #e0e0e0;\n box-shadow: 0px 0px 2px #e0e0e0;\n right: -5px;\n bottom: -5px;\n z-index: 10000;\n cursor: pointer;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div.command {\n padding-top: 0px;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div:focus {\n outline: none;\n /* bỏ viền focus mặc định */\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div.r-cell-disable {\n background-color: #f9f9f9;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div.r-active-cell {\n background-color: rgb(255, 240, 240);\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .r-cell-text:focus {\n outline: none;\n /* bỏ viền focus mặc định */\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .r-icon-invalid {\n position: absolute;\n width: 10px;\n height: 10px;\n top: 0px;\n left: -6px;\n rotate: -90deg;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .r-drag-icon {\n position: absolute;\n border: 1px solid #FFFFFF;\n bottom: -2px;\n right: -2px;\n width: 7px;\n height: 7px;\n background-color: #eb4619;\n border-radius: 20%;\n cursor: crosshair;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .r-cell-text {\n padding: 0px 7px;\n display: flex;\n align-items: center;\n min-width: 0;\n min-height: 28px;\n flex: 1;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .r-cell-text .r-drop-icon {\n position: absolute;\n fill: #c4c4c4 !important;\n right: 8.5px;\n top: 3.5px;\n cursor: pointer;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .is-invalid {\n border-width: 0px !important;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .is-invalid .r-select-is-invalid {\n border-width: 0px !important;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div.r-cell-selected-top {\n border-top: 1px solid #eb4619;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div.r-cell-selected-bottom {\n border-bottom: 1px solid #eb4619;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div.r-cell-selected-left {\n border-left: 1px solid #eb4619;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div.r-cell-selected-right {\n border-right: 1px solid #eb4619;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .r-datepicker .form-control {\n padding: 0px 4px;\n border-radius: 0px;\n border-width: 0px;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .react-select-table.is-invalid {\n border-width: 0px;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .react-select-table .r-select-is-focus {\n border-width: 0px !important;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .react-select-table .select-table-control {\n border-radius: 0px;\n border-width: 0px;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .react-select-table .select-table-control.r-select-is-focus {\n border: 1px solid #1989fa;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .form-edit .display-value {\n cursor: pointer;\n border-radius: 0px;\n background-color: #FFFFFF;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .form-edit .input-display {\n border-width: 0px;\n box-sizing: border-box;\n border: none;\n /* Loại bỏ border */\n outline: none;\n /* Loại bỏ outline khi input được chọn */\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .form-edit .form-input-content .form-control {\n border-radius: 4px;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .form-edit .form-input-content .form-control:focus {\n border: 1px solid #1989fa;\n outline: none;\n box-shadow: none;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .form-edit input::placeholder {\n color: #eb4619;\n opacity: 1;\n /* Firefox */\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .form-edit-inline .form__display {\n vertical-align: middle;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .form-edit-inline .form__edit {\n display: none;\n text-align: left;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .form-edit-inline .form__edit.active {\n display: flex;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .form-edit-inline .form__edit .form-label {\n font-size: 10px;\n margin-bottom: 0px;\n text-align: left;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .form-edit-inline .form__edit .form-control {\n border-radius: 0px;\n height: 23px;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .form-edit-inline .form__edit .form__element {\n margin: 0px 2px;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .r-date-input {\n text-align: center;\n height: 29px;\n border: 1px solid #ccc;\n border-radius: 4px;\n padding: 5px;\n font-size: 14px;\n background-color: #f9f9f9;\n color: #333;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .form-control:focus {\n border-radius: 0px;\n border-width: 0px;\n background-color: #f8f8f8;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div input {\n font-size: 13px;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridfoot {\n color: #283046;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridfoot .r-row {\n bottom: 0px;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridfoot .r-row .r-footer {\n background-color: #fafafa;\n font-size: 14px;\n font-weight: 600;\n width: 100px;\n position: sticky;\n z-index: 1;\n bottom: 0;\n border-width: 0px;\n padding: 0px;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridfoot .r-row .r-footer.cell-fixed {\n z-index: 2;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridfoot .r-row .r-footer .r-footer-div {\n height: 30px;\n padding: 5px 0px;\n}\n.r-table-edit .r-grid .r-gridtable .formula-dropdown {\n box-shadow: rgba(0, 0, 0, 0.2) 0px 5px 15px;\n}\n.r-table-edit .r-grid .text-left .form-label {\n text-align: left;\n}\n.r-table-edit .r-grid .r-toolbar {\n border: 1px solid #e0e0e0;\n height: 44px;\n}\n.r-table-edit .r-grid .r-toolbar.r-toolbar-bottom {\n border-top-width: 0px;\n}\n.r-table-edit .r-grid .r-toolbar.r-toolbar-top {\n border-bottom-width: 0px;\n}\n.r-table-edit .r-grid .r-toolbar .r-toolbar-items {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.r-table-edit .r-grid .r-toolbar .r-toolbar-items svg {\n cursor: pointer;\n}\n.r-table-edit .r-grid .r-toolbar .r-toolbar-items svg:hover {\n color: #eb4619;\n}\n.r-table-edit .r-grid .r-toolbar .r-toolbar-items .r-toolbar-left {\n display: flex;\n justify-content: flex-start;\n align-items: center;\n}\n.r-table-edit .r-grid .r-toolbar .r-toolbar-items .r-toolbar-left .r-toolbar-item {\n margin: 7px 0px 7px 7px;\n}\n.r-table-edit .r-grid .r-toolbar .r-toolbar-items .r-toolbar-center {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.r-table-edit .r-grid .r-toolbar .r-toolbar-items .r-toolbar-center .r-toolbar-item {\n margin: 7px 3px 7px 3px;\n}\n.r-table-edit .r-grid .r-toolbar .r-toolbar-items .r-toolbar-right {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n}\n.r-table-edit .r-grid .r-toolbar .r-toolbar-items .r-toolbar-right .r-toolbar-item {\n margin: 7px 7px 7px 0px;\n}\n.r-table-edit .r-setting-container {\n margin: 0px 15px;\n}\n.r-table-edit .r-setting-container .r-setting-content {\n -webkit-overflow-scrolling: touch;\n overflow-x: auto;\n overflow-y: scroll;\n position: relative;\n background-color: #FFFFFF;\n color: rgba(0, 0, 0, 0.8705882353);\n font-weight: 400;\n border-left: 1px solid #e0e0e0;\n border-right: 1px solid #e0e0e0;\n /* Toàn bộ thanh cuộn */\n /* Nền của thanh cuộn */\n /* Thanh trượt (thumb) */\n /* Khi hover */\n}\n.r-table-edit .r-setting-container .r-setting-content::-webkit-scrollbar {\n width: 9px;\n /* Độ rộng của thanh cuộn */\n height: 9px;\n /* Độ cao của thanh cuộn */\n}\n.r-table-edit .r-setting-container .r-setting-content::-webkit-scrollbar-track {\n background: #FCFCFC;\n /* Màu nền nhạt */\n}\n.r-table-edit .r-setting-container .r-setting-content::-webkit-scrollbar-thumb {\n background: #8B8B8B;\n /* Màu xám nhạt */\n border-radius: 6px;\n /* Bo góc giống Edge */\n}\n.r-table-edit .r-setting-container .r-setting-content::-webkit-scrollbar-thumb:hover {\n background: #636363;\n /* Màu đậm hơn khi hover */\n}\n.r-table-edit .r-setting-container .r-setting-row {\n padding: 5px !important;\n margin: 0px;\n border-bottom: 1px solid #e0e0e0;\n font-size: 13px;\n display: flex;\n align-items: center;\n}\n.r-table-edit .r-setting-container .r-setting-row .r-setting-cell {\n padding-right: 10px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.r-table-edit .r-setting-container .r-setting-row .r-setting-cell .form-control {\n font-size: 13px !important;\n}\n.r-table-edit .r-setting-container .r-setting-row.r-setting-header {\n font-size: 12px !important;\n}\n.r-table-edit.r-virtualized-table .r-row:hover .r-rowcell {\n background-color: #fce6df !important;\n}\n.r-table-edit .r-pager {\n border: 1px solid #e0e0e0;\n border-top-width: 0px;\n min-height: 50px;\n width: 100%;\n display: inline-block;\n}\n.r-table-edit .r-pager .r-pagercontainer {\n margin-left: 10px;\n float: left;\n height: 100%;\n display: block;\n align-items: center;\n}\n.r-table-edit .r-pager .r-pagercontainer .r-button {\n display: inline-block;\n margin: 9px 6px;\n height: 30px;\n width: 30px;\n padding: 6px;\n border-width: 0px;\n background-color: transparent;\n}\n.r-table-edit .r-pager .r-pagercontainer .r-button svg {\n font-size: 16px;\n}\n.r-table-edit .r-pager .r-pagercontainer .r-number {\n display: inline-block;\n margin: 10px 4px 0px 0px;\n height: 25px;\n width: 25px;\n font-size: 13px;\n padding-top: 4px;\n text-align: center;\n cursor: pointer;\n border-radius: 5px;\n}\n.r-table-edit .r-pager .r-pagercontainer .r-number.r-active {\n background-color: rgba(235, 70, 25, 0.1);\n color: #eb4619;\n}\n.r-table-edit .r-pager .r-pagercontainer .r-number:hover {\n border: 1px solid #eb4619;\n}\n.r-table-edit .r-pager .r-pagesize {\n margin-left: 20px;\n font-size: 13px;\n display: inline-block;\n}\n.r-table-edit .r-pager .r-pagesize .select-pagesize__menu-portal {\n z-index: 5;\n}\n.r-table-edit .r-pager .r-parentmsgbar {\n font-size: 13px;\n float: right;\n padding-bottom: 9px;\n padding-right: 18px;\n padding-top: 14px;\n}\n\n.r-tooltip .tooltip-inner {\n font-size: 11px;\n}\n.r-tooltip.tooltip-error ::before {\n border-top-color: rgb(235, 78, 78);\n}\n.r-tooltip.tooltip-error .tooltip-inner {\n background-color: rgb(235, 78, 78);\n}\n\n.btn-input-style {\n font-weight: 500;\n text-transform: uppercase;\n border: 1px solid #e0e0e0;\n border-radius: 5px;\n margin-left: 3px;\n height: 28px;\n padding: 2px 5px;\n cursor: pointer;\n}\n.btn-input-style:hover {\n background-color: rgba(235, 70, 25, 0.1);\n color: #eb4619;\n}\n.btn-input-style.active-custom {\n background-color: #eb4619;\n color: #FFFFFF;\n}";
36533
+ var css_248z$2 = "@charset \"UTF-8\";\n.react-select-table .select-table-control {\n opacity: 1;\n border: 1px solid hsl(0, 0%, 80%);\n border-radius: 0.357rem;\n width: 100%;\n height: 28px;\n background-color: #FFFFFF;\n display: flex;\n align-items: center;\n padding: 2px 8px;\n}\n.react-select-table .select-table-control .select-table-indicator svg {\n fill: #c4c4c4 !important;\n}\n.react-select-table .select-table-control .icon-clear {\n font-size: 25px;\n margin-top: 2px;\n font-weight: 500;\n color: #c4c4c4;\n}\n.react-select-table .select-table-control .icon-clear:hover {\n color: rgba(0, 0, 0, 0.8705882353) !important;\n}\n.react-select-table .select-table-control.r-select-is-open .select-table-indicator svg {\n fill: rgba(0, 0, 0, 0.8705882353) !important;\n}\n.react-select-table .select-table-control.r-select-is-invalid {\n border: 1px solid red !important;\n}\n.react-select-table .select-table-control.r-select-is-focus {\n border: 1px solid #1989fa !important;\n}\n.react-select-table .select-table-control.r-select-is-disabled {\n background-color: #efefef !important;\n}\n.react-select-table .select-table-control .select-table-container {\n position: relative;\n flex: 1;\n}\n.react-select-table .select-table-control .select-table-container .input-container {\n background-color: transparent;\n white-space: nowrap;\n top: 0px;\n left: 0px;\n display: inline;\n}\n.react-select-table .select-table-control .select-table-container .input-container .select-input {\n background-color: transparent;\n text-align: center;\n width: 100%;\n box-sizing: border-box;\n margin-left: -3px;\n border: none;\n /* Loại bỏ border */\n outline: none;\n /* Loại bỏ outline khi input được chọn */\n}\n.react-select-table .select-table-control .select-table-container .input-container .select-input:focus {\n border-width: 0px !important;\n}\n.react-select-table .select-table-control .select-table-container .select-placeholder {\n position: absolute;\n color: #283046;\n margin-top: 1px;\n background-color: transparent;\n}\n.react-select-table .select-table-control .select-table-container .select-value {\n position: absolute;\n background-color: transparent;\n bottom: 0px;\n left: 0px;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.react-select-table .formula-dropdown {\n min-width: min-content !important;\n box-shadow: rgba(0, 0, 0, 0.2) 0px 5px 15px;\n}\n.react-select-table input::placeholder {\n color: #000000 !important;\n opacity: 1;\n /* Firefox */\n}\n\n.r-select-grid.r-select-tree-grid .r-select-gridtable .r-select-row:hover {\n background-color: rgba(235, 70, 25, 0.1) !important;\n color: #eb4619;\n}\n\n.r-select-grid {\n font-size: 12px;\n font-family: Montserrat, Helvetica, Arial, serif;\n font-weight: 500 !important;\n border-radius: 4px !important;\n overflow: hidden;\n}\n.r-select-grid table {\n table-layout: fixed;\n border-collapse: separate;\n border-spacing: 0px;\n}\n.r-select-grid .r-select-gridtable {\n -webkit-overflow-scrolling: touch;\n overflow-x: auto;\n overflow-y: auto;\n position: relative;\n background-color: #FFFFFF;\n color: rgba(0, 0, 0, 0.8705882353) !important;\n font-weight: 400 !important;\n font-size: 13px !important;\n /* Toàn bộ thanh cuộn */\n}\n.r-select-grid .r-select-gridtable::-webkit-scrollbar {\n width: 9px;\n height: 9px;\n}\n.r-select-grid .r-select-gridtable::-webkit-scrollbar-track {\n background: #FCFCFC;\n}\n.r-select-grid .r-select-gridtable::-webkit-scrollbar-thumb {\n background: #8B8B8B;\n border-radius: 6px;\n}\n.r-select-grid .r-select-gridtable::-webkit-scrollbar-thumb:hover {\n background: #636363;\n}\n.r-select-grid .r-select-gridtable .r-select-gridheader .r-select-row .r-select-headercell {\n color: rgba(0, 0, 0, 0.8705882353) !important;\n position: sticky;\n padding: 0px;\n height: 35px;\n z-index: 1;\n border-width: 0px;\n line-height: 16px;\n}\n.r-select-grid .r-select-gridtable .r-select-gridheader .r-select-row .r-select-headercell .r-select-headercell-div {\n border-bottom: 1px solid #e0e0e0;\n background-color: #fafafa;\n display: flex;\n align-items: center;\n text-align: center;\n padding: 5px 10px;\n height: 100%;\n}\n.r-select-grid .r-select-gridtable .r-select-gridheader .r-select-row .r-select-headercell .r-select-headercell-text {\n width: 100%;\n}\n.r-select-grid .r-select-gridtable .r-select-gridcontent .r-select-row {\n background-color: #FFFFFF;\n cursor: pointer;\n}\n.r-select-grid .r-select-gridtable .r-select-gridcontent .r-select-row .cell-fixed {\n position: sticky;\n z-index: 1;\n}\n.r-select-grid .r-select-gridtable .r-select-gridcontent .r-select-row.fisrt-row .r-select-rowcell {\n border-top-width: 0px !important;\n}\n.r-select-grid .r-select-gridtable .r-select-gridcontent .r-select-row.last-row .r-select-rowcell {\n border-bottom: 1px solid #e0e0e0;\n}\n.r-select-grid .r-select-gridtable .r-select-gridcontent .r-select-row .r-select-rowcell {\n border-top: 1px solid #e0e0e0;\n height: 30px !important;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n padding: 7px 9px;\n vertical-align: middle !important;\n}\n.r-select-grid .r-select-gridtable .r-select-gridcontent .r-select-row .r-select-rowcell.r-select-move {\n background-color: rgba(235, 70, 25, 0.1) !important;\n color: #eb4619 !important;\n}\n.r-select-grid .r-select-gridtable .r-select-gridcontent .r-select-row .r-select-rowcell.r-select-active {\n background-color: #eb4619 !important;\n color: #FFFFFF !important;\n}\n.r-tooltip .r-select-grid .r-select-gridtable .r-select-gridcontent .r-select-row .r-select-rowcell.r-hidden {\n display: none;\n}\n.r-tooltip .r-select-grid .r-select-gridtable .r-select-gridcontent .r-select-row .r-select-rowcell.r-hidden ::after {\n display: none;\n}\n.r-select-grid .r-select-gridtable .r-select-gridcontent .r-select-row .r-select-rowcell .r-icon-expand {\n transition: transform 0.3s ease !important;\n}\n.r-select-grid .r-select-gridtable .r-select-gridcontent .r-select-row .r-select-rowcell .r-icon-expand.is-open {\n transform: rotate(90deg) !important;\n -moz-transform: rotate(90deg);\n -webkit-transform: rotate(90deg);\n -o-transform: rotate(90deg);\n}\n.r-select-grid .r-select-gridtable.no-header .r-select-rowcell {\n border: none !important;\n}\n.r-select-grid .r-no-data {\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 14px;\n padding: 7px 9px;\n color: #8f8f8f;\n}\n.r-select-grid .r-select-footer {\n height: 30px;\n background-color: #fafafa;\n}\n.r-select-grid .r-select-footer button {\n font-weight: 400 !important;\n font-size: 13px;\n}\n.r-select-grid .r-select-footer .r-btn {\n border-width: 0px !important;\n}\n\n.r-pagesize .react-select-table .select-table-control {\n border-radius: 0px;\n border: 0px;\n border-bottom: 1px solid #e0e0e0 !important;\n}\n.r-pagesize .react-select-table .select-table-control.r-select-is-focus {\n border: 0px !important;\n border-bottom: 1px solid #1989fa !important;\n}\n\n.r-sidebar {\n width: 400px;\n right: -400px;\n padding: 0;\n background-color: #FFFFFF;\n z-index: 1051;\n position: fixed;\n top: 0;\n bottom: 0;\n height: 100vh;\n height: calc(var(--vh, 1vh) * 100);\n transition: right 0.4s cubic-bezier(0.05, 0.74, 0.2, 0.99);\n backface-visibility: hidden;\n border-left: 1px solid rgba(0, 0, 0, 0.05);\n}\n.r-sidebar.open {\n box-shadow: 0 15px 30px 0 rgba(0, 0, 0, 0.11), 0 5px 15px 0 rgba(0, 0, 0, 0.08);\n right: 0;\n}\n.r-sidebar .modal-header {\n background-color: #FFFFFF;\n}\n.r-sidebar .modal-header .btn-close {\n padding: 0.8rem;\n box-shadow: 0 5px 20px 0 rgba(0, 0, 0, 0.1);\n border-radius: 0.357rem;\n background-color: #FFFFFF;\n opacity: 1;\n transition: all 0.23s ease 0.1s;\n position: relative;\n transform: translate(18px, -10px);\n}\n.r-sidebar .modal-header .btn-close:hover, .r-sidebar .modal-header .btn-close:focus, .r-sidebar .modal-header .btn-close:active {\n opacity: 1;\n outline: none;\n transform: translate(15px, -2px);\n box-shadow: none;\n}\n\n.r-sidebar .react-select {\n max-width: 100%;\n}\n\n.r-sidebar {\n width: 400px;\n right: -100vw;\n height: 100vh;\n}\n.r-sidebar .r-handle {\n position: fixed;\n background-color: #FFFFFF;\n top: 50%;\n transform: translate(-50%, -50%);\n filter: drop-shadow(0.9px 0.9px 1.5px);\n height: 50px;\n display: flex;\n align-items: center;\n border-radius: 0px 5px 5px 0px;\n cursor: pointer;\n margin-left: 7px;\n z-index: 9;\n}\n.r-sidebar.customizer-md {\n width: 600px;\n}\n.r-sidebar.customizer-lg {\n width: 800px;\n}\n.r-sidebar.customizer-500 {\n width: 500px;\n}\n@media (max-width: 500px) {\n .r-sidebar.customizer-500 {\n width: 100vw;\n }\n}\n.r-sidebar.customizer-600 {\n width: 600px;\n}\n@media (max-width: 600px) {\n .r-sidebar.customizer-600 {\n width: 100vw;\n }\n}\n.r-sidebar.customizer-700 {\n width: 700px;\n}\n@media (max-width: 700px) {\n .r-sidebar.customizer-700 {\n width: 100vw;\n }\n}\n.r-sidebar.customizer-800 {\n width: 800px;\n}\n@media (max-width: 800px) {\n .r-sidebar.customizer-800 {\n width: 100vw;\n }\n}\n.r-sidebar.customizer-900 {\n width: 900px;\n}\n@media (max-width: 900px) {\n .r-sidebar.customizer-900 {\n width: 100vw;\n }\n}\n.r-sidebar.customizer-1000 {\n width: 1000px;\n}\n@media (max-width: 1000px) {\n .r-sidebar.customizer-1000 {\n width: 100vw;\n }\n}\n.r-sidebar.customizer-1500 {\n width: 1500px;\n}\n@media (max-width: 1500px) {\n .r-sidebar.customizer-1500 {\n width: 100vw;\n }\n}\n.r-sidebar.fullscreen {\n width: 100%;\n}\n.r-sidebar.open {\n right: 0;\n}\n\n.r-datepicker {\n position: relative;\n}\n.r-datepicker .form-control {\n height: 28px;\n}\n\n.r-datepicker-popup {\n background: white;\n border: 1px solid #e0e0e0;\n padding: 15px 5px !important;\n}\n.r-datepicker-popup .rdp-nav {\n display: none;\n}\n.r-datepicker-popup .rdp-month_caption {\n display: none;\n}\n.r-datepicker-popup .select-month-year {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n padding: 5px 5px 8px 5px;\n}\n.r-datepicker-popup .select-month-year .select-month {\n text-align: right;\n width: 90px !important;\n}\n.r-datepicker-popup .select-month-year .select-year {\n text-align: left;\n width: 65px !important;\n}\n.r-datepicker-popup .select-month-year svg:hover {\n color: #eb4619;\n}\n.r-datepicker-popup .select-month-year .select-table-control .select-table-container {\n color: rgba(0, 0, 0, 0.8705882353) !important;\n font-size: 14px !important;\n font-weight: 600;\n}\n.r-datepicker-popup .select-month-year .select-table-control .select-table-container .select-input {\n cursor: pointer !important;\n}\n.r-datepicker-popup .select-month-year .react-select-table .select-table-control {\n border: none;\n}\n.r-datepicker-popup .select-month-year .react-select-table .r-select-is-focus {\n border: none !important;\n}\n.r-datepicker-popup .select-month-year .select-table-indicator {\n display: none;\n}\n.r-datepicker-popup .rdp-weekday {\n color: rgba(0, 0, 0, 0.8705882353) !important;\n opacity: 1 !important;\n font-weight: 500;\n font-size: 14px !important;\n}\n.r-datepicker-popup .rdp-day {\n color: rgba(0, 0, 0, 0.8705882353) !important;\n font-size: 13.5px !important;\n height: 32px !important;\n width: 32px !important;\n}\n.r-datepicker-popup .rdp-day .rdp-day_button {\n height: 32px !important;\n width: 32px !important;\n}\n.r-datepicker-popup .rdp-day.rdp-today {\n font-weight: bold;\n color: #eb4619;\n}\n.r-datepicker-popup .rdp-day.rdp-today .rdp-day_button {\n border: 1px solid #eb4619;\n border-radius: 8px;\n}\n.r-datepicker-popup .rdp-day.rdp-selected .rdp-day_button {\n border: 1px solid #eb4619;\n background-color: #eb4619;\n color: #FFFFFF;\n border-radius: 8px;\n}\n.r-datepicker-popup .rdp-day.rdp-in-range .rdp-day_button {\n background-color: #fce6df;\n color: #eb4619;\n border-radius: 2px;\n height: 22px !important;\n border-width: 0px !important;\n}\n.r-datepicker-popup .rdp-day .rdp-day_button:hover {\n background-color: #fce6df;\n color: #eb4619;\n border-radius: 8px;\n}\n.r-datepicker-popup .btn-today {\n margin-top: 5px;\n text-align: center;\n font-size: 13px;\n color: #eb4619;\n cursor: pointer;\n user-select: none;\n font-weight: 500;\n}\n.r-datepicker-popup .btn-today:hover {\n text-decoration: underline;\n}\n\n.tab-custom {\n font-family: Roboto, \"Segoe UI\", GeezaPro, \"DejaVu Serif\", \"sans-serif\", -apple-system, BlinkMacSystemFont;\n display: flex;\n}\n.tab-custom.tab-parent {\n border-bottom: solid 1px #c9c9c9;\n}\n.tab-custom .btn-scroll {\n cursor: pointer;\n display: flex;\n align-items: center;\n}\n.tab-custom .tab-component::-webkit-scrollbar {\n display: none;\n /* Ẩn thanh cuộn nếu không cần */\n}\n.tab-custom .tab-component {\n white-space: nowrap;\n overflow-x: hidden;\n scroll-behavior: smooth;\n}\n.tab-custom .tab-component > * {\n display: inline-block;\n}\n.tab-custom .tab-component .tab-custom-item {\n display: inline-block;\n padding: 3px 10px;\n line-height: 23px;\n cursor: pointer;\n font-size: 13px;\n font-weight: 500;\n text-transform: uppercase;\n height: 30px;\n color: rgba(0, 0, 0, 0.5);\n}\n.tab-custom .tab-component .tab-custom-item.active {\n border-bottom: solid 2px #eb4619 !important;\n color: #eb4619;\n}\n.tab-custom.tab-child .tab-custom-item {\n font-size: 12px !important;\n line-height: 23px !important;\n border-radius: 5px 5px 0px 0px;\n margin: 8px 3px 0px 3px;\n box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;\n}\n\n.bs-stepper {\n background-color: #FFFFFF;\n box-shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.1);\n border-radius: 0.5rem;\n}\n.bs-stepper .bs-stepper-header {\n padding: 1.5rem 1.5rem;\n flex-wrap: wrap;\n border-bottom: 1px solid rgba(0, 0, 0, 0.08);\n margin: 0;\n}\n.bs-stepper .bs-stepper-header .line {\n flex: 0;\n min-width: auto;\n min-height: auto;\n background-color: transparent;\n margin: 0;\n padding: 0 1.75rem;\n color: #283046;\n font-size: 1.5rem;\n}\n.bs-stepper .bs-stepper-header .step {\n margin-bottom: 0.25rem;\n margin-top: 0.25rem;\n}\n.bs-stepper .bs-stepper-header .step .step-trigger {\n flex-wrap: nowrap;\n padding: 0;\n font-weight: normal;\n}\n.bs-stepper .bs-stepper-header .step .step-trigger .bs-stepper-box {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 38px;\n height: 38px;\n padding: 0.5em 0;\n font-weight: 500;\n color: #babfc7;\n background-color: rgba(186, 191, 199, 0.12);\n border-radius: 0.35rem;\n}\n.bs-stepper .bs-stepper-header .step .step-trigger .bs-stepper-label {\n text-align: left;\n margin: 0;\n margin-top: 0.5rem;\n margin-left: 1rem;\n}\n.bs-stepper .bs-stepper-header .step .step-trigger .bs-stepper-label .bs-stepper-title {\n display: inherit;\n color: #283046;\n font-weight: 600;\n line-height: 1rem;\n margin-bottom: 0rem;\n}\n.bs-stepper .bs-stepper-header .step .step-trigger .bs-stepper-label .bs-stepper-subtitle {\n font-weight: 400;\n font-size: 0.85rem;\n color: #b9b9c3;\n}\n.bs-stepper .bs-stepper-header .step .step-trigger:hover {\n background-color: transparent;\n}\n.bs-stepper .bs-stepper-header .step.active .step-trigger .bs-stepper-box {\n background-color: #eb4619;\n color: #FFFFFF;\n box-shadow: 0 3px 6px 0 rgba(235, 70, 25, 0.4);\n}\n.bs-stepper .bs-stepper-header .step.active .step-trigger .bs-stepper-label .bs-stepper-title {\n color: #eb4619;\n}\n.bs-stepper .bs-stepper-header .step.crossed .step-trigger .bs-stepper-box {\n background-color: rgba(235, 70, 25, 0.12);\n color: #eb4619;\n}\n.bs-stepper .bs-stepper-header .step.crossed .step-trigger .bs-stepper-label .bs-stepper-title {\n color: #b9b9c3;\n}\n.bs-stepper .bs-stepper-header .step.crossed + .line {\n color: #eb4619;\n}\n.bs-stepper .bs-stepper-content {\n padding: 1.5rem 1.5rem;\n}\n.bs-stepper .bs-stepper-content .content {\n margin-left: 0;\n}\n.bs-stepper .bs-stepper-content .content .content-header {\n margin-bottom: 1rem;\n}\n.bs-stepper.vertical .bs-stepper-header {\n border-right: 1px solid #e0e0e0;\n border-bottom: none;\n}\n.bs-stepper.vertical .bs-stepper-header .step .step-trigger {\n padding: 1rem 0;\n}\n.bs-stepper.vertical .bs-stepper-header .line {\n display: none;\n}\n.bs-stepper.vertical .bs-stepper-content {\n width: 100%;\n padding-top: 2.5rem;\n}\n.bs-stepper.vertical .bs-stepper-content .content:not(.active) {\n display: none;\n}\n.bs-stepper.vertical.wizard-icons .step {\n text-align: center;\n}\n.bs-stepper.wizard-modern {\n background-color: transparent;\n box-shadow: none;\n}\n.bs-stepper.wizard-modern .bs-stepper-header {\n border: none;\n}\n.bs-stepper.wizard-modern .bs-stepper-content {\n background-color: #FFFFFF;\n border-radius: 0.5rem;\n box-shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.1);\n}\n\n.horizontal-wizard,\n.vertical-wizard,\n.modern-horizontal-wizard,\n.modern-vertical-wizard {\n margin-bottom: 2.2rem;\n}\n\nhtml[data-textdirection=rtl] .btn-prev,\nhtml[data-textdirection=rtl] .btn-next {\n display: flex;\n}\nhtml[data-textdirection=rtl] .btn-prev i,\nhtml[data-textdirection=rtl] .btn-prev svg,\nhtml[data-textdirection=rtl] .btn-next i,\nhtml[data-textdirection=rtl] .btn-next svg {\n transform: rotate(-180deg);\n}\n\n@media (max-width: 992px) {\n .bs-stepper .bs-stepper-header {\n flex-direction: column;\n align-items: flex-start;\n }\n .bs-stepper .bs-stepper-header .step .step-trigger {\n padding: 0.5rem 0 !important;\n flex-direction: row;\n }\n .bs-stepper .bs-stepper-header .line {\n display: none;\n }\n .bs-stepper.vertical {\n flex-direction: column;\n }\n .bs-stepper.vertical .bs-stepper-header {\n align-items: flex-start;\n }\n .bs-stepper.vertical .bs-stepper-content {\n padding-top: 1.5rem;\n }\n}\n.r-context-popover .popover-arrow {\n display: none !important;\n}\n.r-context-popover .popover-body {\n padding: 5px !important;\n border: none !important;\n border-radius: 10px;\n}\n.r-context-popover .popover-body .r-context-item {\n padding: 5px 10px;\n font-size: 13px;\n cursor: pointer;\n border-radius: 5px;\n display: flex;\n align-items: center;\n}\n.r-context-popover .popover-body .r-context-item:hover {\n background-color: rgba(235, 70, 25, 0.1);\n color: #eb4619;\n}\n\n.r-table-edit .r-grid {\n font-size: 12px;\n}\n.r-table-edit .r-grid .r-search {\n display: flex;\n position: relative;\n align-items: center;\n}\n.r-table-edit .r-grid .r-search .input__value {\n z-index: 1;\n}\n.r-table-edit .r-grid .r-search .input__value.is-clearable {\n padding-right: 25px;\n}\n.r-table-edit .r-grid .r-search .input__clear-icon {\n position: absolute;\n right: 5px;\n z-index: 10;\n}\n.r-table-edit .r-grid .r-gridtable {\n -webkit-overflow-scrolling: touch;\n overflow-x: auto;\n overflow-y: scroll;\n position: relative;\n background-color: #FFFFFF;\n color: rgba(0, 0, 0, 0.8705882353);\n font-weight: 400;\n border: 1px solid #e0e0e0;\n /* Toàn bộ thanh cuộn */\n /* Nền của thanh cuộn */\n /* Thanh trượt (thumb) */\n /* Khi hover */\n}\n.r-table-edit .r-grid .r-gridtable table {\n table-layout: fixed;\n border-collapse: separate;\n border-spacing: 0px;\n}\n.r-table-edit .r-grid .r-gridtable::-webkit-scrollbar {\n width: 9px;\n /* Độ rộng của thanh cuộn */\n height: 9px;\n /* Độ cao của thanh cuộn */\n}\n.r-table-edit .r-grid .r-gridtable::-webkit-scrollbar-track {\n background: #FCFCFC;\n /* Màu nền nhạt */\n}\n.r-table-edit .r-grid .r-gridtable::-webkit-scrollbar-thumb {\n background: #8B8B8B;\n /* Màu xám nhạt */\n border-radius: 6px;\n /* Bo góc giống Edge */\n}\n.r-table-edit .r-grid .r-gridtable::-webkit-scrollbar-thumb:hover {\n background: #636363;\n /* Màu đậm hơn khi hover */\n}\n.r-table-edit .r-grid .r-gridtable .react-resizable-handle.react-resizable-handle-se {\n position: absolute;\n right: 0px;\n top: 0px;\n width: 10px;\n height: 100%;\n cursor: col-resize;\n background-image: none;\n}\n.r-table-edit .r-grid .r-gridtable .r-filter svg.active {\n color: #eb4619;\n}\n.r-table-edit .r-grid .r-gridtable .r-filter-popup .react-select-table .select-value {\n line-height: 20px !important;\n}\n.r-table-edit .r-grid .r-gridtable .r-filter-popup .react-select-table .select-placeholder {\n line-height: 20px !important;\n}\n.r-table-edit .r-grid .r-gridtable .r-filter-popup .react-select-table .r-select-is-focus {\n border-color: #eb4619 !important;\n}\n.r-table-edit .r-grid .r-gridtable .r-filter-popup .form-control:focus {\n border-color: #eb4619 !important;\n}\n.r-table-edit .r-grid .r-gridtable .r-no-data {\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 14px;\n padding: 20px 9px;\n color: #8f8f8f;\n}\n.r-table-edit .r-grid .r-gridtable .r-loading-overlay {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(255, 255, 255, 0.3);\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 3;\n}\n.r-table-edit .r-grid .r-gridtable .r-loading-overlay .r-loading {\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 14px;\n padding: 7px 9px;\n color: #eb4619;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridheader .r-row .cell-fixed {\n z-index: 2 !important;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridheader .r-row .cell-fixed.fix-right .r-headercell-div {\n border-left: 1px solid #e0e0e0;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridheader .r-row .cell-fixed.fix-left .r-headercell-div {\n border-right: 1px solid #e0e0e0;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridheader .r-row .cell-fixed.fix-left.fixed-last .r-headercell-div {\n box-shadow: 2px 0 4px -1px rgba(0, 0, 0, 0.1);\n}\n.r-table-edit .r-grid .r-gridtable .r-gridheader .r-row .cell-fixed.fix-right.fixed-last .r-headercell-div {\n box-shadow: -2px 0 4px -1px rgba(0, 0, 0, 0.1);\n}\n.r-table-edit .r-grid .r-gridtable .r-gridheader .r-row .r-headercell {\n color: rgba(0, 0, 0, 0.8705882353);\n position: sticky;\n padding: 0px;\n height: 42px;\n z-index: 1;\n border-width: 0px;\n line-height: 16px;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridheader .r-row .r-headercell .r-headercell-div {\n border-right: 1px solid #e0e0e0;\n border-bottom: 1px solid #e0e0e0;\n background-color: #FFFFFF;\n display: flex;\n align-items: center;\n text-align: center;\n padding: 5px 10px;\n height: 100%;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridheader .r-row .r-headercell .header-content {\n display: flex;\n flex: 1 1 0%;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridheader .r-row .r-headercell .header-content .text-content {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row:first-of-type .r-rowcell-div {\n border-top-color: #FFFFFF;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row {\n font-size: 13px;\n transition: transform 0.05s linear;\n will-change: transform;\n backface-visibility: hidden;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .cell-fixed {\n position: sticky;\n z-index: 1;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .cell-fixed .r-rowcell.r-cell-selected-right {\n margin-right: 1px;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row.r-last-row .r-rowcell .r-rowcell-div {\n border-bottom: 1px solid #e0e0e0;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell {\n background-color: #FFFFFF;\n border-bottom: 1px solid #e0e0e0;\n border-right: 1px solid #e0e0e0;\n vertical-align: middle;\n padding: 0;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell.r-cell-sum-group {\n background-color: #fafafa;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell.r-cell-sum-group .r-rowcell-div {\n padding-left: 10px;\n padding-right: 5px;\n display: flex;\n align-items: center;\n background-color: #fafafa;\n font-weight: 550;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell.r-cell-group {\n left: 0px;\n position: sticky;\n z-index: 1;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell.r-cell-group .r-rowcell-div {\n padding-left: 10px;\n padding-right: 5px !important;\n display: flex;\n align-items: center;\n background-color: #fafafa;\n font-weight: 550;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell.r-cell-group .r-rowcell-div svg {\n margin-right: 10px;\n cursor: pointer;\n user-select: none;\n transition: transform 0.2s ease-in-out;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell.r-cell-group .r-rowcell-div svg:hover {\n color: #eb4619;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell.cell-fixed .r-rowcell-div.r-cell-selected-right {\n padding-right: 1px;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell.fix-right {\n border-left: 1px solid #e0e0e0;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell.fix-right.fixed-last {\n border-left: 1px solid #e0e0e0;\n box-shadow: -2px 0 4px -1px rgba(0, 0, 0, 0.1);\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell.fix-left.fixed-last {\n border-right: 1px solid #e0e0e0;\n box-shadow: 2px 0 4px -1px rgba(0, 0, 0, 0.1);\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell.r-active-row {\n background-color: #fce6df;\n border-right: 2px solid #eb4619;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div {\n min-height: 28px !important;\n border: 1px solid transparent;\n position: relative;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .arrow-context-menu {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 15px;\n width: 15px;\n background-color: #FFFFFF;\n border-radius: 10px;\n border: 1px solid #e0e0e0;\n box-shadow: 0px 0px 2px #e0e0e0;\n right: -5px;\n bottom: -5px;\n z-index: 10000;\n cursor: pointer;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div.command {\n padding-top: 0px;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div:focus {\n outline: none;\n /* bỏ viền focus mặc định */\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div.r-cell-disable {\n background-color: #f9f9f9;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div.r-active-cell {\n background-color: rgb(255, 240, 240);\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .r-cell-text:focus {\n outline: none;\n /* bỏ viền focus mặc định */\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .r-icon-invalid {\n position: absolute;\n width: 10px;\n height: 10px;\n top: 0px;\n left: -6px;\n rotate: -90deg;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .r-drag-icon {\n position: absolute;\n border: 1px solid #FFFFFF;\n bottom: -2px;\n right: -2px;\n width: 7px;\n height: 7px;\n background-color: #eb4619;\n border-radius: 20%;\n cursor: crosshair;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .r-cell-text {\n padding: 0px 7px;\n display: flex;\n align-items: center;\n min-width: 0;\n min-height: 28px;\n flex: 1;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .r-cell-text .r-drop-icon {\n position: absolute;\n fill: #c4c4c4 !important;\n right: 8.5px;\n top: 3.5px;\n cursor: pointer;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .is-invalid {\n border-width: 0px !important;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .is-invalid .r-select-is-invalid {\n border-width: 0px !important;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div.r-cell-selected-top {\n border-top: 1px solid #eb4619;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div.r-cell-selected-bottom {\n border-bottom: 1px solid #eb4619;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div.r-cell-selected-left {\n border-left: 1px solid #eb4619;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div.r-cell-selected-right {\n border-right: 1px solid #eb4619;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .r-datepicker .form-control {\n padding: 0px 4px;\n border-radius: 0px;\n border-width: 0px;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .react-select-table.is-invalid {\n border-width: 0px;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .react-select-table .r-select-is-focus {\n border-width: 0px !important;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .react-select-table .select-table-control {\n border-radius: 0px;\n border-width: 0px;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .react-select-table .select-table-control.r-select-is-focus {\n border: 1px solid #1989fa;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .form-edit .display-value {\n cursor: pointer;\n border-radius: 0px;\n background-color: #FFFFFF;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .form-edit .input-display {\n border-width: 0px;\n box-sizing: border-box;\n border: none;\n /* Loại bỏ border */\n outline: none;\n /* Loại bỏ outline khi input được chọn */\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .form-edit .form-input-content .form-control {\n border-radius: 4px;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .form-edit .form-input-content .form-control:focus {\n border: 1px solid #1989fa;\n outline: none;\n box-shadow: none;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .form-edit input::placeholder {\n color: #eb4619;\n opacity: 1;\n /* Firefox */\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .form-edit-inline .form__display {\n vertical-align: middle;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .form-edit-inline .form__edit {\n display: none;\n text-align: left;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .form-edit-inline .form__edit.active {\n display: flex;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .form-edit-inline .form__edit .form-label {\n font-size: 10px;\n margin-bottom: 0px;\n text-align: left;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .form-edit-inline .form__edit .form-control {\n border-radius: 0px;\n height: 23px;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .form-edit-inline .form__edit .form__element {\n margin: 0px 2px;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .r-date-input {\n text-align: center;\n height: 29px;\n border: 1px solid #ccc;\n border-radius: 4px;\n padding: 5px;\n font-size: 14px;\n background-color: #f9f9f9;\n color: #333;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div .form-control:focus {\n border-radius: 0px;\n border-width: 0px;\n background-color: #f8f8f8;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridcontent .r-row .r-rowcell .r-rowcell-div input {\n font-size: 13px;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridfoot {\n color: #283046;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridfoot .r-row {\n bottom: 0px;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridfoot .r-row .r-footer {\n background-color: #fafafa;\n font-size: 14px;\n font-weight: 600;\n width: 100px;\n position: sticky;\n z-index: 1;\n bottom: 0;\n border-width: 0px;\n padding: 0px;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridfoot .r-row .r-footer.cell-fixed {\n z-index: 2;\n}\n.r-table-edit .r-grid .r-gridtable .r-gridfoot .r-row .r-footer .r-footer-div {\n height: 30px;\n padding: 5px 0px;\n}\n.r-table-edit .r-grid .r-gridtable .formula-dropdown {\n box-shadow: rgba(0, 0, 0, 0.2) 0px 5px 15px;\n}\n.r-table-edit .r-grid .text-left .form-label {\n text-align: left;\n}\n.r-table-edit .r-grid .r-toolbar {\n border: 1px solid #e0e0e0;\n height: 44px;\n}\n.r-table-edit .r-grid .r-toolbar.r-toolbar-bottom {\n border-top-width: 0px;\n}\n.r-table-edit .r-grid .r-toolbar.r-toolbar-top {\n border-bottom-width: 0px;\n}\n.r-table-edit .r-grid .r-toolbar .r-toolbar-items {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.r-table-edit .r-grid .r-toolbar .r-toolbar-items svg {\n cursor: pointer;\n}\n.r-table-edit .r-grid .r-toolbar .r-toolbar-items svg:hover {\n color: #eb4619;\n}\n.r-table-edit .r-grid .r-toolbar .r-toolbar-items .r-toolbar-left {\n display: flex;\n justify-content: flex-start;\n align-items: center;\n}\n.r-table-edit .r-grid .r-toolbar .r-toolbar-items .r-toolbar-left .r-toolbar-item {\n margin: 7px 0px 7px 7px;\n}\n.r-table-edit .r-grid .r-toolbar .r-toolbar-items .r-toolbar-center {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.r-table-edit .r-grid .r-toolbar .r-toolbar-items .r-toolbar-center .r-toolbar-item {\n margin: 7px 3px 7px 3px;\n}\n.r-table-edit .r-grid .r-toolbar .r-toolbar-items .r-toolbar-right {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n}\n.r-table-edit .r-grid .r-toolbar .r-toolbar-items .r-toolbar-right .r-toolbar-item {\n margin: 7px 7px 7px 0px;\n}\n.r-table-edit .r-setting-container {\n margin: 0px 15px;\n}\n.r-table-edit .r-setting-container .r-setting-content {\n -webkit-overflow-scrolling: touch;\n overflow-x: auto;\n overflow-y: scroll;\n position: relative;\n background-color: #FFFFFF;\n color: rgba(0, 0, 0, 0.8705882353);\n font-weight: 400;\n border-left: 1px solid #e0e0e0;\n border-right: 1px solid #e0e0e0;\n /* Toàn bộ thanh cuộn */\n /* Nền của thanh cuộn */\n /* Thanh trượt (thumb) */\n /* Khi hover */\n}\n.r-table-edit .r-setting-container .r-setting-content::-webkit-scrollbar {\n width: 9px;\n /* Độ rộng của thanh cuộn */\n height: 9px;\n /* Độ cao của thanh cuộn */\n}\n.r-table-edit .r-setting-container .r-setting-content::-webkit-scrollbar-track {\n background: #FCFCFC;\n /* Màu nền nhạt */\n}\n.r-table-edit .r-setting-container .r-setting-content::-webkit-scrollbar-thumb {\n background: #8B8B8B;\n /* Màu xám nhạt */\n border-radius: 6px;\n /* Bo góc giống Edge */\n}\n.r-table-edit .r-setting-container .r-setting-content::-webkit-scrollbar-thumb:hover {\n background: #636363;\n /* Màu đậm hơn khi hover */\n}\n.r-table-edit .r-setting-container .r-setting-row {\n padding: 5px !important;\n margin: 0px;\n border-bottom: 1px solid #e0e0e0;\n font-size: 13px;\n display: flex;\n align-items: center;\n}\n.r-table-edit .r-setting-container .r-setting-row .r-setting-cell {\n padding-right: 10px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.r-table-edit .r-setting-container .r-setting-row .r-setting-cell .form-control {\n font-size: 13px !important;\n}\n.r-table-edit .r-setting-container .r-setting-row.r-setting-header {\n font-size: 12px !important;\n}\n.r-table-edit.r-virtualized-table {\n transition: top 0.25s ease, left 0.25s ease, width 0.25s ease, height 0.25s ease;\n}\n.r-table-edit.r-virtualized-table .r-row:hover .r-rowcell {\n background-color: #fce6df !important;\n}\n.r-table-edit.r-virtualized-table.is-maximized {\n position: fixed;\n inset: 0;\n width: 100vw;\n height: 100vh;\n z-index: 9999;\n background: #fff;\n}\n@keyframes zoomFeel {\n 0% {\n transform: scale(0.98);\n }\n 55% {\n transform: scale(1.02);\n }\n 100% {\n transform: scale(1);\n }\n}\n.r-table-edit .r-pager {\n border: 1px solid #e0e0e0;\n border-top-width: 0px;\n min-height: 50px;\n width: 100%;\n display: inline-block;\n}\n.r-table-edit .r-pager .r-pagercontainer {\n margin-left: 10px;\n float: left;\n height: 100%;\n display: block;\n align-items: center;\n}\n.r-table-edit .r-pager .r-pagercontainer .r-button {\n display: inline-block;\n margin: 9px 6px;\n height: 30px;\n width: 30px;\n padding: 6px;\n border-width: 0px;\n background-color: transparent;\n}\n.r-table-edit .r-pager .r-pagercontainer .r-button svg {\n font-size: 16px;\n}\n.r-table-edit .r-pager .r-pagercontainer .r-number {\n display: inline-block;\n margin: 10px 4px 0px 0px;\n height: 25px;\n width: 25px;\n font-size: 13px;\n padding-top: 4px;\n text-align: center;\n cursor: pointer;\n border-radius: 5px;\n}\n.r-table-edit .r-pager .r-pagercontainer .r-number.r-active {\n background-color: rgba(235, 70, 25, 0.1);\n color: #eb4619;\n}\n.r-table-edit .r-pager .r-pagercontainer .r-number:hover {\n border: 1px solid #eb4619;\n}\n.r-table-edit .r-pager .r-pagesize {\n margin-left: 20px;\n font-size: 13px;\n display: inline-block;\n}\n.r-table-edit .r-pager .r-pagesize .select-pagesize__menu-portal {\n z-index: 5;\n}\n.r-table-edit .r-pager .r-parentmsgbar {\n font-size: 13px;\n float: right;\n padding-bottom: 9px;\n padding-right: 18px;\n padding-top: 14px;\n}\n\n.r-tooltip .tooltip-inner {\n font-size: 11px;\n}\n.r-tooltip.tooltip-error ::before {\n border-top-color: rgb(235, 78, 78);\n}\n.r-tooltip.tooltip-error .tooltip-inner {\n background-color: rgb(235, 78, 78);\n}\n\n.btn-input-style {\n font-weight: 500;\n text-transform: uppercase;\n border: 1px solid #e0e0e0;\n border-radius: 5px;\n margin-left: 3px;\n height: 28px;\n padding: 2px 5px;\n cursor: pointer;\n}\n.btn-input-style:hover {\n background-color: rgba(235, 70, 25, 0.1);\n color: #eb4619;\n}\n.btn-input-style.active-custom {\n background-color: #eb4619;\n color: #FFFFFF;\n}";
36326
36534
  styleInject(css_248z$2);
36327
36535
 
36328
36536
  const getColumn = (contentColumns, col, count) => {
@@ -38989,13 +39197,33 @@ const DateRangeFilterComponent = ({ fieldFilter, filterBy, handleSave }) => {
38989
39197
  };
38990
39198
 
38991
39199
  const HeaderTableCol = (props) => {
38992
- const { selectEnable, dataSource, setSelectedRows, col, indexCol, indexParent, objHeaderWidthFixLeft, objHeaderWidthFixRight, totalCount, selectedRows, columns, orderBy, changeFilter, filterBy, changeOrder, allowFiltering, allowSorting, container, fisrtObjWidthFixRight, lastObjWidthFixLeft, setContentColumns, formatSetting, optionsFilter, idTable, isMulti } = props;
39200
+ const { selectEnable, dataSource, setSelectedRows, col, indexCol, indexParent, objHeaderWidthFixLeft, objHeaderWidthFixRight, selectedRows, columns, orderBy, changeFilter, filterBy, changeOrder, allowFiltering, allowSorting, container, fisrtObjWidthFixRight, lastObjWidthFixLeft, setContentColumns, formatSetting, optionsFilter, idTable, isMulti, fieldKey } = props;
38993
39201
  const { t } = useTranslation();
38994
39202
  const headerRef = useRef(null);
38995
39203
  const order = orderBy.find((item) => item.key === col.field);
38996
39204
  const [openFilter, setOpenFilter] = useState(false);
38997
39205
  const filter = filterBy.find((item) => item.key === col.field);
38998
39206
  const herderContent = col.headerDisplay ?? col.headerText ?? '';
39207
+ const headerCheckboxRef = useRef(null);
39208
+ const typeSelected = useMemo(() => {
39209
+ // 0: none selected, 1: some selected, 2: all selected
39210
+ if (!isMulti || !selectEnable || dataSource.length === 0 || !selectedRows?.length) {
39211
+ return 0;
39212
+ }
39213
+ else if (selectedRows?.length < dataSource.length) {
39214
+ return 1;
39215
+ }
39216
+ else if (!dataSource.some((item) => !selectedRows.some((y) => y[fieldKey] === item[fieldKey]))) {
39217
+ return 2;
39218
+ }
39219
+ return 1;
39220
+ }, [dataSource, selectedRows]);
39221
+ useEffect(() => {
39222
+ if (headerCheckboxRef.current) {
39223
+ headerCheckboxRef.current.checked = typeSelected === 2;
39224
+ headerCheckboxRef.current.indeterminate = typeSelected === 1;
39225
+ }
39226
+ }, [typeSelected]);
38999
39227
  const handleResize = (e, { size }) => {
39000
39228
  if (size.width > 50) {
39001
39229
  const newColumns = [...columns];
@@ -39029,12 +39257,20 @@ const HeaderTableCol = (props) => {
39029
39257
  orderBy.push({ direction: 'asc', key: col.field });
39030
39258
  changeOrder(orderBy);
39031
39259
  }
39032
- }, className: classNames$1('r-headercell-div', { 'cursor-pointer': allowSorting && !col.columns?.length }), children: [col.field === 'checkbox' && (jsx(Input$1, { checked: !!(totalCount > 0 && selectedRows?.length >= totalCount), type: "checkbox", className: classNames$1('cursor-pointer', { 'd-none': !isMulti }), style: { textAlign: col.textAlign ?? 'left', marginTop: 6 }, onChange: (e) => {
39260
+ }, className: classNames$1('r-headercell-div', { 'cursor-pointer': allowSorting && !col.columns?.length }), children: [col.field === 'checkbox' && (jsx(Input$1, { innerRef: (el) => {
39261
+ headerCheckboxRef.current = el;
39262
+ }, type: "checkbox", style: {
39263
+ marginTop: 6,
39264
+ textAlign: 'center',
39265
+ cursor: 'pointer'
39266
+ }, onChange: () => {
39033
39267
  if (selectEnable) {
39034
- if (e.target.checked) {
39035
- setSelectedRows(dataSource.map((item) => {
39036
- return item;
39037
- }));
39268
+ if (typeSelected === 0) {
39269
+ setSelectedRows([...dataSource]);
39270
+ }
39271
+ else if (typeSelected === 1) {
39272
+ const notSelectedRows = dataSource.filter((item) => !selectedRows.some((x) => x[fieldKey] === item[fieldKey]));
39273
+ setSelectedRows([...selectedRows, ...notSelectedRows]);
39038
39274
  }
39039
39275
  else {
39040
39276
  setSelectedRows([]);
@@ -39819,14 +40055,22 @@ const ToolbarBottom = ({ handleAdd, handleDuplicate, handleInsertBefore, handleI
39819
40055
  }), !toolbarSetting?.hiddenSetting && (jsxs(Fragment$1, { children: [jsx("div", { className: classNames$1('r-toolbar-item me-25'), "aria-disabled": "false", children: jsx(SvgSettings, { className: "text-primary cursor-pointer", onClick: () => setOpenPopupSetupColumn(true) }) }), jsx("div", { className: classNames$1('r-toolbar-item me-25', { 'd-none': editDisable || addDisable }), "aria-disabled": "false", children: jsxs(UncontrolledDropdown, { className: "dropdown-user nav-item", children: [jsx(DropdownToggle$1, { tag: "div", color: "primary", onClick: (e) => e.preventDefault(), children: jsx(SvgInfo, { className: "cursor-pointer text-primary" }) }), jsx(DropdownMenu$1, { className: "formula-dropdown icon-dropdown", children: jsxs("ul", { className: "mb-0 pe-50", children: [jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\u00E0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\u00E0ng v\u00E0 nh\u1EA5n Ctrl + D \u0111\u1EC3 nh\u00E2n b\u1EA3n" }), jsx("li", { style: { fontSize: 13 }, children: "Ch\u1ECDn \u00F4 v\u00E0 Ctrl + V \u0111\u1EC3 d\u00E1n th\u00F4ng tin t\u1EEB excel" }), jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\u00E0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\u00E0ng v\u00E0 nh\u1EA5n Ctrl + C \u0111\u1EC3 sao ch\u00E9p h\u00E0ng" }), jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\u00E0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\u00E0ng v\u00E0 nh\u1EA5n Ctrl + V \u0111\u1EC3 d\u00E1n h\u00E0ng" }), jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n Ctrl ho\u1EB7c Alt + Shift + \u2193 \u0111\u1EC3 sao ch\u00E9p d\u1EEF li\u1EC7u \u00F4 cho c\u00E1c d\u00F2ng d\u01B0\u1EDBi" }), jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n Ctrl ho\u1EB7c Alt + Shift + \u2191 \u0111\u1EC3 sao ch\u00E9p d\u1EEF li\u1EC7u \u00F4 cho c\u00E1c d\u00F2ng tr\u00EAn" })] }) })] }) })] }))] })] }) }));
39820
40056
  };
39821
40057
 
39822
- const RenderToolbarTop = ({ toolbarTopOption }) => {
40058
+ const RenderToolbarTop = ({ toolbarTopOption, maximize, setMaximize }) => {
39823
40059
  return (jsx("div", { id: "table_custom_top_toolbar", className: "r-toolbar r-toolbar-top", "aria-orientation": "horizontal", children: jsxs("div", { className: "r-toolbar-items", children: [jsx("div", { className: "r-toolbar-left", children: toolbarTopOption?.map((item, index) => {
39824
40060
  return item.align === 'left' ? jsx(ToolBarElement, { item: item, index: index }) : '';
39825
40061
  }) }), jsx("div", { className: "r-toolbar-center", children: toolbarTopOption?.map((item, index) => {
39826
40062
  return item.align === 'center' ? jsx(ToolBarElement, { item: item, index: index }) : '';
39827
- }) }), jsx("div", { className: "r-toolbar-right", children: toolbarTopOption?.map((item, index) => {
39828
- return item.align === 'right' ? jsx(ToolBarElement, { item: item, index: index }) : '';
39829
- }) })] }) }));
40063
+ }) }), jsxs("div", { className: "r-toolbar-right", children: [toolbarTopOption?.map((item, index) => {
40064
+ return item.align === 'right' ? jsx(ToolBarElement, { item: item, index: index }) : '';
40065
+ }), jsxs("div", { className: "r-toolbar-item", "aria-disabled": "false", children: [maximize === true && (jsx(SvgMinimize, { fontSize: 18, color: "#7F7F7F", className: "mx-25", onClick: () => {
40066
+ if (setMaximize) {
40067
+ setMaximize(!maximize);
40068
+ }
40069
+ } })), maximize === false && (jsx(SvgMaximize, { fontSize: 18, style: { strokeWidth: 2 }, className: "mx-25", color: "#7F7F7F", onClick: () => {
40070
+ if (setMaximize) {
40071
+ setMaximize(!maximize);
40072
+ }
40073
+ } }))] })] })] }) }));
39830
40074
  };
39831
40075
  const ToolBarElement = ({ item, index }) => {
39832
40076
  return (jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template?.() }, `toolbar-top-${index}`));
@@ -68728,8 +68972,8 @@ const UnExpandAllIcon = ({ className, color = '#7F7F7F', size = 24, onClick, sty
68728
68972
  }, onClick: onClick, children: [jsx("path", { d: "M18 8H8V18H6V8C6 7.46957 6.21071 6.96086 6.58579 6.58579C6.96086 6.21071 7.46957 6 8 6H18V8ZM14 2H4C3.46957 2 2.96086 2.21071 2.58579 2.58579C2.21071 2.96086 2 3.46957 2 4V14H4V4H14V2ZM22 12V20C22 20.5304 21.7893 21.0391 21.4142 21.4142C21.0391 21.7893 20.5304 22 20 22H12C11.4696 22 10.9609 21.7893 10.5858 21.4142C10.2107 21.0391 10 20.5304 10 20V12C10 11.4696 10.2107 10.9609 10.5858 10.5858C10.9609 10.2107 11.4696 10 12 10H20C20.5304 10 21.0391 10.2107 21.4142 10.5858C21.7893 10.9609 22 11.4696 22 12ZM20 15H17V12H15V15H12V17H15V20H17V17H20V15Z", fill: "currentColor" }), jsx("rect", { x: "14", y: "11", width: "4", height: "4", fill: "currentColor" }), jsx("rect", { x: "14", y: "17", width: "4", height: "4", fill: "currentColor" })] }));
68729
68973
  };
68730
68974
 
68731
- const RenderContentCol = (props) => {
68732
- const { col, indexCol, indexRow, isSelected, row, zeroVisiable, formatSetting, idTable, fisrtObjWidthFixRight, lastObjWidthFixLeft, objWidthFixLeft, objWidthFixRight, selectedRows, setSelectedRows, handleCloseContext, handleDoubleClick, fieldKey, isMulti } = props;
68975
+ const RenderContentCol = React__default.memo((props) => {
68976
+ const { col, indexCol, indexRow, isSelected, row, zeroVisiable, formatSetting, idTable, fisrtObjWidthFixRight, lastObjWidthFixLeft, objWidthFixLeft, objWidthFixRight, selectedRows, setSelectedRows, handleCloseContext, handleDoubleClick, handleCellClick, fieldKey, isMulti, } = props;
68733
68977
  const cellId = `content-${idTable}-row${indexRow}col-${indexCol}`;
68734
68978
  const checkOverflow = () => {
68735
68979
  const element = document.getElementById(cellId);
@@ -68751,10 +68995,12 @@ const RenderContentCol = (props) => {
68751
68995
  const RenderElement = () => {
68752
68996
  if (col.field === '#' || col.type === '#') {
68753
68997
  return (jsx("div", { className: classNames$1('r-rowcell-div cursor-pointer text-center', {
68754
- 'r-active-cell': isSelected
68998
+ 'r-active-cell': isSelected,
68755
68999
  }), style: {
68756
- fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType ? 600 : 400,
68757
- fontStyle: row.haveItalicType ? 'italic' : 'normal'
69000
+ fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType
69001
+ ? 600
69002
+ : 400,
69003
+ fontStyle: row.haveItalicType ? 'italic' : 'normal',
68758
69004
  }, onDoubleClick: (e) => {
68759
69005
  e.preventDefault();
68760
69006
  handleCloseContext();
@@ -68763,11 +69009,15 @@ const RenderContentCol = (props) => {
68763
69009
  }
68764
69010
  else if (col.type === 'checkbox' || col.field === 'checkbox') {
68765
69011
  return (jsx("div", { className: classNames$1('r-rowcell-div cursor-pointer', {
68766
- 'r-active-cell': isSelected
69012
+ 'r-active-cell': isSelected,
68767
69013
  }), style: {
68768
69014
  display: 'flex',
68769
- justifyContent: col.textAlign === 'center' ? 'center' : col.textAlign === 'right' ? 'flex-end' : 'flex-start',
68770
- alignItems: 'center'
69015
+ justifyContent: col.textAlign === 'center'
69016
+ ? 'center'
69017
+ : col.textAlign === 'right'
69018
+ ? 'flex-end'
69019
+ : 'flex-start',
69020
+ alignItems: 'center',
68771
69021
  }, onClick: (e) => {
68772
69022
  setSelectedRows(toggleSelect());
68773
69023
  e.stopPropagation();
@@ -68777,8 +69027,12 @@ const RenderContentCol = (props) => {
68777
69027
  let value = row[col.field];
68778
69028
  // ✅ Format dữ liệu theo loại cột
68779
69029
  if (col.type === 'numeric') {
68780
- value = formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', col.numericSettings?.fraction, true, false) ?? 0;
68781
- if (!zeroVisiable && !(row?.sortOrder < 0 || row?.sortOrder > 100000) && (value === '0' || value === 0)) {
69030
+ value =
69031
+ formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', col.numericSettings?.fraction, true, false) ?? 0;
69032
+ if (!zeroVisiable &&
69033
+ !col.zeroVisiable &&
69034
+ !(row?.sortOrder < 0 || row?.sortOrder > 100000) &&
69035
+ (value === '0' || value === 0)) {
68782
69036
  value = '';
68783
69037
  }
68784
69038
  }
@@ -68786,31 +69040,43 @@ const RenderContentCol = (props) => {
68786
69040
  value = value ? formatDateTime(value, formatSetting?.dateFormat) : '';
68787
69041
  }
68788
69042
  else if (col.type === 'datetime') {
68789
- value = value ? formatDateTime(value, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm') : '';
69043
+ value = value
69044
+ ? formatDateTime(value, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm')
69045
+ : '';
68790
69046
  }
68791
69047
  if (col.template) {
68792
69048
  value = col.template(row, indexRow) ?? '';
68793
69049
  }
68794
69050
  const isNegative = col.type === 'numeric' && Number(row[col.field]) < 0;
68795
- const textColor = isNegative ? formatSetting?.colorNegative ?? 'red' : undefined;
68796
- const prefix = isNegative ? formatSetting?.prefixNegative ?? '-' : '';
68797
- const suffix = isNegative ? formatSetting?.suffixNegative ?? '' : '';
68798
- const displayText = isNegative ? `${prefix}${value}${suffix}` : value ?? '';
69051
+ const textColor = isNegative
69052
+ ? (formatSetting?.colorNegative ?? 'red')
69053
+ : undefined;
69054
+ const prefix = isNegative ? (formatSetting?.prefixNegative ?? '-') : '';
69055
+ const suffix = isNegative ? (formatSetting?.suffixNegative ?? '') : '';
69056
+ const displayText = isNegative
69057
+ ? `${prefix}${value}${suffix}`
69058
+ : (value ?? '');
68799
69059
  return (jsxs("div", { className: classNames$1('r-rowcell-div cursor-pointer', {
68800
- 'r-active-cell': isSelected
69060
+ 'r-active-cell': isSelected,
68801
69061
  }), style: {
68802
- fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType ? 600 : 400,
68803
- fontStyle: row.haveItalicType ? 'italic' : 'normal'
69062
+ fontWeight: row.sortOrder < 0 || row.sortOrder > 100000 || row.haveBoldType
69063
+ ? 600
69064
+ : 400,
69065
+ fontStyle: row.haveItalicType ? 'italic' : 'normal',
68804
69066
  }, children: [jsx("div", { className: "r-cell-text", style: {
68805
69067
  display: 'flex',
68806
- justifyContent: col.textAlign === 'center' ? 'center' : col.textAlign === 'right' ? 'flex-end' : 'flex-start',
68807
- alignItems: 'center'
69068
+ justifyContent: col.textAlign === 'center'
69069
+ ? 'center'
69070
+ : col.textAlign === 'right'
69071
+ ? 'flex-end'
69072
+ : 'flex-start',
69073
+ alignItems: 'center',
68808
69074
  }, children: jsx("div", { id: cellId, style: {
68809
69075
  color: textColor,
68810
69076
  overflow: 'hidden',
68811
69077
  textOverflow: 'ellipsis',
68812
69078
  whiteSpace: 'pre',
68813
- maxWidth: '100%'
69079
+ maxWidth: '100%',
68814
69080
  }, children: displayText }) }), checkOverflow() && (jsx(UncontrolledTooltip, { className: "r-tooltip", autohide: false, target: cellId, placement: "top", children: jsx("div", { style: { color: textColor }, onClick: (e) => {
68815
69081
  e.stopPropagation();
68816
69082
  e.preventDefault();
@@ -68819,15 +69085,21 @@ const RenderContentCol = (props) => {
68819
69085
  };
68820
69086
  const clickTimerRef = useRef(null);
68821
69087
  return (jsx(Fragment$1, { children: col.visible !== false && col.isGroup !== true && (jsx("td", { className: classNames$1(`r-rowcell fix-${col.fixedType}`, { 'cell-fixed': col.fixedType }, {
68822
- 'fixed-last': (col.fixedType === 'left' && indexCol === lastObjWidthFixLeft) || (col.fixedType === 'right' && indexCol === fisrtObjWidthFixRight)
69088
+ 'fixed-last': (col.fixedType === 'left' &&
69089
+ indexCol === lastObjWidthFixLeft) ||
69090
+ (col.fixedType === 'right' &&
69091
+ indexCol === fisrtObjWidthFixRight),
68823
69092
  }, { 'r-active': isSelected }), style: {
68824
69093
  left: col.fixedType === 'left' ? objWidthFixLeft[indexCol] : undefined,
68825
- right: col.fixedType === 'right' ? objWidthFixRight[indexCol] : undefined
69094
+ right: col.fixedType === 'right'
69095
+ ? objWidthFixRight[indexCol]
69096
+ : undefined,
68826
69097
  }, onClick: (e) => {
68827
69098
  const tag = e.target?.nodeName;
68828
69099
  if (tag !== 'DIV' && tag !== 'TD') {
68829
69100
  return;
68830
69101
  }
69102
+ handleCellClick?.(row, col);
68831
69103
  if (clickTimerRef.current) {
68832
69104
  window.clearTimeout(clickTimerRef.current);
68833
69105
  }
@@ -68852,20 +69124,11 @@ const RenderContentCol = (props) => {
68852
69124
  e.preventDefault();
68853
69125
  e.stopPropagation();
68854
69126
  }, children: RenderElement() }, `col-${indexRow}-${indexCol}`)) }));
68855
- };
69127
+ });
68856
69128
 
68857
- const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoading, formatSetting, querySetting, pagingSetting, searchSetting, columnsAggregate, toolbarSetting, selectedItem, setSelectedItem, handleSelect, saveSettingColumn, resetDefaultColumns, settingColumns, headerComponent, groupSetting, zeroVisiable, isMulti, handleDoubleClick, contextMenuItems, handleContextMenuClick }) => {
69129
+ const TableElement = React__default.memo((props) => {
69130
+ const { contentColumns, dataSource, fieldKey, filterBy, fisrtObjWidthFixRight, lastObjWidthFixLeft, objWidthFixLeft, objWidthFixRight, orderBy, selectedRows, setContentColumns, setSelectedRows, formatSetting, gridRef, idTable, headerColumns, objHeaderWidthFixLeft, objHeaderWidthFixRight, isMulti, querySetting, searchSetting, searchTerm, columnsAggregate, haveSum, expandsAll, zeroVisiable, setFilterBy, setOrderBy, setExpandsAll, handleDoubleClick, handleCellClick, contextMenuItems, handleContextMenuClick, isLoading, } = props;
68858
69131
  const { t } = useTranslation();
68859
- const gridRef = useRef(null);
68860
- const [openPopupSetupColumn, setOpenPopupSetupColumn] = useState(false);
68861
- const [selectedRows, setSelectedRows] = useState([]);
68862
- const [orderBy, setOrderBy] = useState([]);
68863
- const [filterBy, setFilterBy] = useState([]);
68864
- const [searchTerm, setSearchTerm] = useState('');
68865
- const fieldKey = columns.find((item) => item.isPrimarykey === true)?.field ?? 'id';
68866
- const [contentColumns, setContentColumns] = useState([]);
68867
- const [groupColumns, setGroupColumns] = useState([]);
68868
- const [expandsAll, setExpandsAll] = useState(true);
68869
69132
  const [context, setContext] = useState(null);
68870
69133
  const virtualDivRef = useRef(null);
68871
69134
  useOnClickOutside(virtualDivRef, () => {
@@ -68875,17 +69138,17 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
68875
69138
  }, 100);
68876
69139
  }
68877
69140
  });
69141
+ const handleCloseContext = () => setContext((prev) => (prev ? { ...prev, show: false } : null));
68878
69142
  useEffect(() => {
68879
- if (groupSetting?.groupColumns) {
68880
- setGroupColumns([...groupSetting.groupColumns]);
69143
+ if (virtualDivRef.current && context) {
69144
+ // đặt vị trí div ảo tại con trỏ chuột
69145
+ virtualDivRef.current.style.position = 'fixed';
69146
+ virtualDivRef.current.style.top = `${context.y}px`;
69147
+ virtualDivRef.current.style.left = `${context.x}px`;
69148
+ virtualDivRef.current.style.width = '0px';
69149
+ virtualDivRef.current.style.height = '0px';
68881
69150
  }
68882
- setExpandsAll(true);
68883
- }, [groupSetting?.groupColumns]);
68884
- const { levels: headerColumns, objHeaderWidthFixLeft, objHeaderWidthFixRight, objWidthFixLeft, objWidthFixRight, lastObjWidthFixLeft, fisrtObjWidthFixRight } = useMemo(() => {
68885
- const rs = calculateTableStructure(columns, settingColumns?.value, groupSetting?.groupColumns);
68886
- setContentColumns(rs.flat);
68887
- return rs;
68888
- }, [columns, settingColumns, groupSetting?.groupColumns]);
69151
+ }, [context]);
68889
69152
  const firstColSpan = useMemo(() => {
68890
69153
  let count = 0;
68891
69154
  let index = 3;
@@ -68910,7 +69173,10 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
68910
69173
  if (searchTerm) {
68911
69174
  datas = datas.filter((row) => {
68912
69175
  return searchSetting?.keyField?.some((key) => {
68913
- return row[key]?.toString().toLowerCase().includes(searchTerm.trim().toLowerCase());
69176
+ return row[key]
69177
+ ?.toString()
69178
+ .toLowerCase()
69179
+ .includes(searchTerm.trim().toLowerCase());
68914
69180
  });
68915
69181
  });
68916
69182
  }
@@ -68919,7 +69185,10 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
68919
69185
  return filterBy.every((filter) => {
68920
69186
  const { key, value, ope } = filter;
68921
69187
  const rowValue = row[key];
68922
- if (rowValue === undefined || rowValue === null || value === undefined || value === null) {
69188
+ if (rowValue === undefined ||
69189
+ rowValue === null ||
69190
+ value === undefined ||
69191
+ value === null) {
68923
69192
  return false;
68924
69193
  }
68925
69194
  const valStr = String(rowValue).toLowerCase();
@@ -68969,6 +69238,202 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
68969
69238
  }
68970
69239
  return datas;
68971
69240
  }, [searchTerm, filterBy, orderBy, dataSource]);
69241
+ const RenderContent = React__default.memo(({ datas, level = 0 }) => {
69242
+ return (jsx(Fragment$1, { children: datas.map((row, indexRow) => {
69243
+ const [expand, setExpand] = useState(row.expand ?? true);
69244
+ useEffect(() => {
69245
+ if (expandsAll !== undefined) {
69246
+ setExpand(expandsAll);
69247
+ row.expand = expandsAll;
69248
+ }
69249
+ }, [expandsAll]);
69250
+ if (row.children?.length) {
69251
+ const col = contentColumns.find((x) => x.field === row.field);
69252
+ if (!col) {
69253
+ return;
69254
+ }
69255
+ let value = row[col.field];
69256
+ if (col.type === 'numeric') {
69257
+ value =
69258
+ formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', col.numericSettings?.fraction, true, false) ?? 0;
69259
+ }
69260
+ else if (col.type === 'date') {
69261
+ value = value
69262
+ ? formatDateTime(value, formatSetting?.dateFormat)
69263
+ : '';
69264
+ }
69265
+ else if (col.type === 'datetime') {
69266
+ value = value
69267
+ ? formatDateTime(value, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm')
69268
+ : '';
69269
+ }
69270
+ if (col.template) {
69271
+ value = col.template(row, indexRow) ?? '';
69272
+ }
69273
+ return (jsxs(Fragment$1, { children: [jsxs("tr", { "aria-rowindex": indexRow + 1, role: "row", className: "r-row", children: [jsx("td", { className: "r-rowcell r-cell-group", colSpan: 3, children: jsxs("div", { className: "r-rowcell-div", children: [jsx(SvgChevronRight, { style: {
69274
+ marginLeft: level * 20,
69275
+ transform: expand ? 'rotate(90deg)' : 'rotate(0deg)',
69276
+ }, fontSize: 15, onClick: () => {
69277
+ setExpand(!expand);
69278
+ setExpandsAll(undefined);
69279
+ row.expand = !expand;
69280
+ } }), t(col.headerDisplay ?? col.headerText ?? ''), ": ", value, " (", row.children.length, ")"] }) }), contentColumns.map((colSum, indexCol) => {
69281
+ if (indexCol <= firstColSpan ||
69282
+ colSum.visible === false ||
69283
+ colSum.isGroup === true) {
69284
+ return;
69285
+ }
69286
+ let sumValue = row[colSum.field];
69287
+ const haveSum = row[colSum.field] !== undefined &&
69288
+ row[colSum.field] !== null;
69289
+ if (!haveSum &&
69290
+ colSum.haveSum === true &&
69291
+ colSum.type === 'numeric') {
69292
+ sumValue = row.children.reduce(function (accumulator, currentValue) {
69293
+ return (Number(accumulator ?? 0) +
69294
+ Number(currentValue[colSum.field] ?? 0));
69295
+ }, 0);
69296
+ }
69297
+ if (colSum.type === 'numeric') {
69298
+ sumValue = formartNumberic(sumValue, formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', colSum.numericSettings?.fraction, true, false);
69299
+ if (!zeroVisiable &&
69300
+ !col.zeroVisiable &&
69301
+ (sumValue === '0' || sumValue === 0)) {
69302
+ sumValue = '';
69303
+ }
69304
+ }
69305
+ return (jsx("td", { className: "r-rowcell r-cell-sum-group", children: jsx("div", { className: "r-rowcell-div", style: {
69306
+ justifyContent: colSum.textAlign
69307
+ ? colSum.textAlign
69308
+ : 'left',
69309
+ }, children: (haveSum || colSum.haveSum === true) &&
69310
+ Number(row[colSum.field] ?? '0') < 0 ? (jsxs("div", { style: {
69311
+ color: formatSetting?.colorNegative ?? 'red',
69312
+ }, children: [' ', `${formatSetting?.prefixNegative ?? '-'}${sumValue}${formatSetting?.suffixNegative ?? ''}`] })) : (sumValue) }) }, `group-sum-cell-${level}-${indexRow}-${indexCol}`));
69313
+ })] }), expand && (jsx(RenderContent, { datas: row.children, level: level + 1 }))] }, `row-${level}-${indexRow}`));
69314
+ }
69315
+ else {
69316
+ const isSelected = selectedRows?.some((x) => x[fieldKey] === row[fieldKey]);
69317
+ return (jsx("tr", { id: `row-content-${indexRow}`, "aria-rowindex": indexRow + 1, role: "row", className: classNames$1('r-row', {
69318
+ 'r-last-row': level === 0 && indexRow === viewData.length - 1,
69319
+ }), onContextMenu: (e) => {
69320
+ e.preventDefault();
69321
+ handleContextMenu(e, row);
69322
+ }, children: contentColumns.map((column, indexCol) => (jsx(RenderContentCol, { idTable: idTable, col: column, fieldKey: fieldKey, objWidthFixLeft: objWidthFixLeft, objWidthFixRight: objWidthFixRight, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft, isMulti: isMulti, selectedRows: selectedRows, setSelectedRows: setSelectedRows, formatSetting: formatSetting, indexCol: indexCol, indexRow: indexRow, isSelected: isSelected, row: row, zeroVisiable: zeroVisiable, handleCloseContext: handleCloseContext, handleDoubleClick: handleDoubleClick, handleCellClick: handleCellClick }, indexCol))) }, `row-content-${indexRow}`));
69323
+ }
69324
+ }) }));
69325
+ });
69326
+ const handleContextMenu = (e, row) => {
69327
+ e.preventDefault();
69328
+ setContext(null);
69329
+ setTimeout(() => {
69330
+ setContext({
69331
+ x: e.clientX,
69332
+ y: e.clientY,
69333
+ row,
69334
+ show: true,
69335
+ });
69336
+ }, 100);
69337
+ };
69338
+ return (jsxs(Fragment$1, { children: [jsxs("table", { role: "presentation", style: { width: '100%' }, children: [jsx(RenderColGroup, { contentColumns: contentColumns }), jsx("thead", { className: "r-gridheader", role: "rowgroup", children: headerColumns.map((rowColumn, indexParent) => {
69339
+ return (jsx("tr", { className: "r-row", role: "row", children: rowColumn.map((col, index) => (jsx(HeaderTableCol, { col: col, idTable: idTable ?? '', dataSource: dataSource, indexCol: index, indexParent: indexParent, isMulti: isMulti ?? false, objHeaderWidthFixLeft: objHeaderWidthFixLeft, objHeaderWidthFixRight: objHeaderWidthFixRight, selectEnable: true, selectedRows: selectedRows, setSelectedRows: setSelectedRows, container: gridRef, filterBy: filterBy, orderBy: orderBy, optionsFilter: querySetting?.optionsFilter, allowFiltering: querySetting?.allowFiltering, allowSorting: querySetting?.allowSorting, formatSetting: formatSetting, changeFilter: (val) => {
69340
+ setFilterBy([...val]);
69341
+ if (querySetting?.changeFilter) {
69342
+ querySetting.changeFilter(val);
69343
+ }
69344
+ }, changeOrder: (val) => {
69345
+ setOrderBy([...val]);
69346
+ if (querySetting?.changeOrder) {
69347
+ querySetting.changeOrder(val);
69348
+ }
69349
+ }, columns: contentColumns, setContentColumns: setContentColumns, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft, fieldKey: fieldKey }, `header-${indexParent}-${index}`))) }, `header-${-indexParent}`));
69350
+ }) }), jsx("tbody", { className: "r-gridcontent", role: "rowgroup", children: jsx(RenderContent, { datas: viewData }) }), jsx("tfoot", { className: "r-gridfoot", children: ((columnsAggregate?.length ?? 0) > 0 || haveSum) && (jsx("tr", { className: "r-row", children: contentColumns.map((col, indexCol) => {
69351
+ if (col.visible === false || col.isGroup === true) {
69352
+ return;
69353
+ }
69354
+ const item = columnsAggregate?.find((x) => x.field === col.field);
69355
+ let sumValue = item?.value;
69356
+ if (!item && col.haveSum === true && col.type === 'numeric') {
69357
+ sumValue = viewData.reduce(function (accumulator, currentValue) {
69358
+ return (Number(accumulator ?? 0) +
69359
+ Number(currentValue[col.field] ?? 0));
69360
+ }, 0);
69361
+ }
69362
+ if (col.type === 'numeric') {
69363
+ sumValue = formartNumberic(sumValue, formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', col.numericSettings?.fraction, true, false);
69364
+ }
69365
+ return (jsx("td", { className: classNames$1(`p-0 px-50 r-footer fix-${col.fixedType}`, { 'cell-fixed': col.fixedType }), style: {
69366
+ left: col.fixedType === 'left'
69367
+ ? objWidthFixLeft[indexCol]
69368
+ : undefined,
69369
+ right: col.fixedType === 'right'
69370
+ ? objWidthFixRight[indexCol]
69371
+ : undefined,
69372
+ textAlign: col.textAlign ? col.textAlign : 'left',
69373
+ }, children: jsx("div", { className: "r-footer-div", children: (item || col.haveSum === true) &&
69374
+ Number(item?.value ?? '0') < 0 ? (jsxs("div", { style: {
69375
+ color: formatSetting?.colorNegative ?? 'red',
69376
+ }, children: [' ', `${formatSetting?.prefixNegative ?? '-'}${sumValue}${formatSetting?.suffixNegative ?? ''}`] })) : (sumValue) }) }, `summarycell-${indexCol}`));
69377
+ }) })) })] }), jsx("div", { ref: virtualDivRef }), context &&
69378
+ (contextMenuItems?.length ?? 0) > 0 &&
69379
+ handleContextMenuClick && (jsx(Popover$1, { className: "r-context-popover", placement: "right-start", isOpen: context.show, target: virtualDivRef.current, toggle: handleCloseContext, fade: false, children: jsx(PopoverBody$1, { children: contextMenuItems?.map((item, index) => {
69380
+ return (jsxs("div", { className: "r-context-item", onClick: () => {
69381
+ handleCloseContext();
69382
+ handleContextMenuClick?.(item, context.row);
69383
+ }, children: [item.icon && (jsx("div", { className: "me-75", children: jsx(IconCustom, { iconName: item.icon, size: 16 }) })), jsx("span", { children: t(item.text) })] }, `context-${index}`));
69384
+ }) }) })), (viewData.length ?? 0) === 0 && !isLoading && (jsxs("div", { className: "r-no-data", children: [jsx("svg", { width: "64", height: "41", viewBox: "0 0 64 41", xmlns: "http://www.w3.org/2000/svg", children: jsxs("g", { transform: "translate(0 1)", fill: "none", fillRule: "evenodd", children: [jsx("ellipse", { fill: "#f5f5f5", cx: "32", cy: "33", rx: "32", ry: "7" }), jsxs("g", { fillRule: "nonzero", stroke: "#d9d9d9", children: [jsx("path", { d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z" }), jsx("path", { d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z", fill: "#fafafa" })] })] }) }), t('No data available.')] }))] }));
69385
+ });
69386
+
69387
+ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoading, formatSetting, querySetting, pagingSetting, searchSetting, columnsAggregate, toolbarSetting, selectedItem, setSelectedItem, handleSelect, saveSettingColumn, resetDefaultColumns, settingColumns, headerComponent, groupSetting, zeroVisiable, isMulti, handleDoubleClick, handleCellClick, contextMenuItems, headerHeight, handleContextMenuClick, }) => {
69388
+ const { t } = useTranslation();
69389
+ const gridRef = useRef(null);
69390
+ const [openPopupSetupColumn, setOpenPopupSetupColumn] = useState(false);
69391
+ const [selectedRows, setSelectedRows] = useState([]);
69392
+ const [orderBy, setOrderBy] = useState([]);
69393
+ const [filterBy, setFilterBy] = useState([]);
69394
+ const [searchTerm, setSearchTerm] = useState('');
69395
+ const [contentColumns, setContentColumns] = useState([]);
69396
+ const [groupColumns, setGroupColumns] = useState([]);
69397
+ const [expandsAll, setExpandsAll] = useState(true);
69398
+ const [maximize, setMaximize] = useState(false);
69399
+ const [windowHeight, setWindowHeight] = useState(window.innerHeight);
69400
+ const fieldKey = columns.find((item) => item.isPrimarykey === true)?.field ??
69401
+ 'id';
69402
+ useEffect(() => {
69403
+ const handleResize = () => {
69404
+ setWindowHeight(window.innerHeight);
69405
+ };
69406
+ window.addEventListener('resize', handleResize);
69407
+ return () => window.removeEventListener('resize', handleResize);
69408
+ }, []);
69409
+ const heightTable = useMemo(() => {
69410
+ if (maximize) {
69411
+ return (windowHeight -
69412
+ (pagingSetting?.allowPaging ? 50 : 0) -
69413
+ (haveSum ? 30 : 0) -
69414
+ (headerHeight ?? 59) -
69415
+ (toolbarSetting?.showBottomToolbar ? 42 : 0) -
69416
+ (toolbarSetting?.showTopToolbar ? 42 : 0));
69417
+ }
69418
+ return height;
69419
+ }, [height, maximize, windowHeight]);
69420
+ const optionsGroupColumn = useMemo(() => {
69421
+ return contentColumns.map((col) => ({
69422
+ ...col,
69423
+ headerText: t(col.headerText),
69424
+ }));
69425
+ }, [contentColumns]);
69426
+ useEffect(() => {
69427
+ if (groupSetting?.groupColumns) {
69428
+ setGroupColumns([...groupSetting.groupColumns]);
69429
+ }
69430
+ setExpandsAll(true);
69431
+ }, [groupSetting?.groupColumns]);
69432
+ const { levels: headerColumns, objHeaderWidthFixLeft, objHeaderWidthFixRight, objWidthFixLeft, objWidthFixRight, lastObjWidthFixLeft, fisrtObjWidthFixRight, } = useMemo(() => {
69433
+ const rs = calculateTableStructure(columns, settingColumns?.value, groupSetting?.groupColumns);
69434
+ setContentColumns(rs.flat);
69435
+ return rs;
69436
+ }, [columns, settingColumns, groupSetting?.groupColumns]);
68972
69437
  const handleKeyPress = (e) => {
68973
69438
  if (e.code === 'Enter' || e.code === 'NumpadEnter') {
68974
69439
  if (searchSetting?.setSearchTerm) {
@@ -68982,12 +69447,17 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
68982
69447
  }
68983
69448
  };
68984
69449
  const searchTemplate = () => {
68985
- return (jsx("div", { className: "me-50 r-search", children: jsx(ReactInput, { style: { width: '230px' }, value: searchSetting?.searchTerm !== undefined ? searchSetting?.searchTerm : searchTerm, setSearchTerm: searchSetting?.setSearchTerm ? searchSetting?.setSearchTerm : setSearchTerm, placeholder: t('Search'), onKeyPress: handleKeyPress }) }));
69450
+ return (jsx("div", { className: "me-50 r-search", children: jsx(ReactInput, { style: { width: '230px' }, value: searchSetting?.searchTerm !== undefined
69451
+ ? searchSetting?.searchTerm
69452
+ : searchTerm, setSearchTerm: searchSetting?.setSearchTerm
69453
+ ? searchSetting?.setSearchTerm
69454
+ : setSearchTerm, placeholder: t('Search'), onKeyPress: handleKeyPress }) }));
68986
69455
  };
68987
69456
  const groupbtnTemplate = () => {
68988
- return (jsxs(UncontrolledDropdown, { children: [jsx(DropdownToggle$1, { tag: "div", id: "group-dropdown-toggle", style: { position: 'relative' }, onClick: (e) => e.preventDefault(), children: jsx(GroupIcon, { color: "#7F7F7F", size: 24 }) }), jsxs(DropdownMenu$1, { className: "formula-dropdown icon-dropdown p-1", children: [jsx("div", { className: "mb-1", style: { fontSize: 16, fontWeight: 500 }, children: "Nh\u00F3m d\u1EEF li\u1EC7u theo c\u1ED9t" }), jsxs("div", { className: 'form-group', children: [jsx(Label$1, { id: `label-group-1`, style: { fontWeight: 500, fontSize: 13 }, children: "M\u1EE9c 1" }), jsx("div", { className: "form-input", children: jsx(SelectTable, { options: contentColumns, fieldLabel: 'headerText', fieldValue: 'field', value: groupColumns[0]
69457
+ return (jsxs(UncontrolledDropdown, { children: [jsx(DropdownToggle$1, { tag: "div", id: "group-dropdown-toggle", style: { position: 'relative' }, onClick: (e) => e.preventDefault(), children: jsx(GroupIcon, { color: "#7F7F7F", size: 24 }) }), jsxs(DropdownMenu$1, { className: "formula-dropdown icon-dropdown p-1", children: [jsx("div", { className: "mb-1", style: { fontSize: 16, fontWeight: 500 }, children: "Nh\u00F3m d\u1EEF li\u1EC7u theo c\u1ED9t" }), jsxs("div", { className: 'form-group', children: [jsx(Label$1, { id: `label-group-1`, style: { fontWeight: 500, fontSize: 13 }, children: "M\u1EE9c 1" }), jsx("div", { className: "form-input", children: jsx(SelectTable, { options: optionsGroupColumn, fieldLabel: 'headerText', fieldValue: 'field', value: groupColumns[0]
68989
69458
  ? {
68990
- headerText: t(contentColumns.find((x) => x.field === groupColumns[0])?.headerText ?? contentColumns.find((x) => x.field === groupColumns[0])?.headerText)
69459
+ headerText: t(contentColumns.find((x) => x.field === groupColumns[0])?.headerText ??
69460
+ contentColumns.find((x) => x.field === groupColumns[0])?.headerText),
68991
69461
  }
68992
69462
  : undefined, onChange: (val) => {
68993
69463
  if (val) {
@@ -68997,9 +69467,10 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
68997
69467
  groupColumns.pop();
68998
69468
  }
68999
69469
  setGroupColumns([...groupColumns]);
69000
- }, isClearable: groupColumns?.length === 1 }) })] }), jsxs("div", { className: 'form-group', children: [jsx(Label$1, { id: `label-group-2`, style: { fontWeight: 500, fontSize: 13 }, children: "M\u1EE9c 2" }), jsx("div", { className: "form-input", children: jsx(SelectTable, { options: contentColumns, fieldLabel: 'headerText', fieldValue: 'field', value: groupColumns[1]
69470
+ }, isClearable: groupColumns?.length === 1 }) })] }), jsxs("div", { className: 'form-group', children: [jsx(Label$1, { id: `label-group-2`, style: { fontWeight: 500, fontSize: 13 }, children: "M\u1EE9c 2" }), jsx("div", { className: "form-input", children: jsx(SelectTable, { options: optionsGroupColumn, fieldLabel: 'headerText', fieldValue: 'field', value: groupColumns[1]
69001
69471
  ? {
69002
- headerText: t(contentColumns.find((x) => x.field === groupColumns[1])?.headerText ?? contentColumns.find((x) => x.field === groupColumns[1])?.headerText)
69472
+ headerText: t(contentColumns.find((x) => x.field === groupColumns[1])?.headerText ??
69473
+ contentColumns.find((x) => x.field === groupColumns[1])?.headerText),
69003
69474
  }
69004
69475
  : undefined, onChange: (val) => {
69005
69476
  if (val) {
@@ -69009,9 +69480,10 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
69009
69480
  groupColumns.pop();
69010
69481
  }
69011
69482
  setGroupColumns([...groupColumns]);
69012
- }, isClearable: groupColumns?.length === 2 }) })] }), jsxs("div", { className: 'form-group', children: [jsx(Label$1, { id: `label-group-3`, style: { fontWeight: 500, fontSize: 13 }, children: "M\u1EE9c 3" }), jsx("div", { className: "form-input", children: jsx(SelectTable, { options: contentColumns, fieldLabel: 'headerText', fieldValue: 'field', value: groupColumns[2]
69483
+ }, isClearable: groupColumns?.length === 2 }) })] }), jsxs("div", { className: 'form-group', children: [jsx(Label$1, { id: `label-group-3`, style: { fontWeight: 500, fontSize: 13 }, children: "M\u1EE9c 3" }), jsx("div", { className: "form-input", children: jsx(SelectTable, { options: optionsGroupColumn, fieldLabel: 'headerText', fieldValue: 'field', value: groupColumns[2]
69013
69484
  ? {
69014
- headerText: t(contentColumns.find((x) => x.field === groupColumns[2])?.headerText ?? contentColumns.find((x) => x.field === groupColumns[2])?.headerText)
69485
+ headerText: t(contentColumns.find((x) => x.field === groupColumns[2])?.headerText ??
69486
+ contentColumns.find((x) => x.field === groupColumns[2])?.headerText),
69015
69487
  }
69016
69488
  : undefined, onChange: (val) => {
69017
69489
  if (groupSetting) {
@@ -69025,7 +69497,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
69025
69497
  }
69026
69498
  }, isClearable: groupColumns?.length === 3 }) })] }), jsxs("div", { className: "border-top d-flex justify-content-end mt-1", children: [jsx(Button$1$1, { color: "primary", className: "mt-1 me-50 rounded", size: "sm", onClick: () => {
69027
69499
  groupSetting?.onGroup({
69028
- columnGrouped: groupColumns.filter((x) => x)
69500
+ columnGrouped: groupColumns.filter((x) => x),
69029
69501
  });
69030
69502
  document.getElementById('group-dropdown-toggle')?.click();
69031
69503
  }, children: `${t('Apply')}` }), jsx(Button$1$1, { color: "secondary", outline: true, className: "mt-1 rounded", size: "sm", onClick: () => {
@@ -69034,14 +69506,16 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
69034
69506
  }, children: `${t('Delete')}` })] })] })] }));
69035
69507
  };
69036
69508
  const chooseColumnsTemplate = () => {
69037
- return jsx(SvgSettings, { className: "r-toolbar-icon", fontSize: 20, color: "#7F7F7F", onClick: () => setOpenPopupSetupColumn(true) });
69509
+ return (jsx(SvgSettings, { className: "r-toolbar-icon", fontSize: 20, color: "#7F7F7F", onClick: () => setOpenPopupSetupColumn(true) }));
69038
69510
  };
69039
69511
  const expandTemplate = () => {
69040
69512
  return (jsxs(Fragment$1, { children: [!expandsAll && (jsx(ExpandAllIcon, { onClick: () => {
69041
69513
  setExpandsAll(true);
69042
- }, color: "#7F7F7F", size: 24 })), expandsAll && jsx(UnExpandAllIcon, { onClick: () => setExpandsAll(false), color: "#7F7F7F", size: 24 })] }));
69514
+ }, color: "#7F7F7F", size: 24 })), expandsAll && (jsx(UnExpandAllIcon, { onClick: () => setExpandsAll(false), color: "#7F7F7F", size: 24 }))] }));
69043
69515
  };
69044
- const defaultToolbarOption = searchSetting?.searchEnable ? [{ template: searchTemplate, align: 'left' }] : [];
69516
+ const defaultToolbarOption = searchSetting?.searchEnable
69517
+ ? [{ template: searchTemplate, align: 'left' }]
69518
+ : [];
69045
69519
  if (groupSetting) {
69046
69520
  defaultToolbarOption.push({ template: groupbtnTemplate, align: 'left' });
69047
69521
  }
@@ -69050,7 +69524,10 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
69050
69524
  }
69051
69525
  let toolbarTopOption = [];
69052
69526
  if (toolbarSetting?.toolbarOptions) {
69053
- toolbarTopOption = [...defaultToolbarOption, ...toolbarSetting?.toolbarOptions];
69527
+ toolbarTopOption = [
69528
+ ...defaultToolbarOption,
69529
+ ...toolbarSetting?.toolbarOptions,
69530
+ ];
69054
69531
  }
69055
69532
  else {
69056
69533
  toolbarTopOption = [...defaultToolbarOption];
@@ -69081,7 +69558,9 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
69081
69558
  useEffect(() => {
69082
69559
  if (setSelectedItem) {
69083
69560
  if (isMulti) {
69084
- if (dataSource && selectedRows && selectedRows?.length !== selectedItem?.length) {
69561
+ if (dataSource &&
69562
+ selectedRows &&
69563
+ selectedRows?.length !== selectedItem?.length) {
69085
69564
  setSelectedItem([...selectedRows]);
69086
69565
  if (handleSelect) {
69087
69566
  handleSelect([...selectedRows]);
@@ -69090,7 +69569,8 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
69090
69569
  }
69091
69570
  else {
69092
69571
  if (dataSource && selectedRows?.length > 0) {
69093
- if (!selectedItem || selectedItem[fieldKey] !== selectedRows[0][fieldKey]) {
69572
+ if (!selectedItem ||
69573
+ selectedItem[fieldKey] !== selectedRows[0][fieldKey]) {
69094
69574
  setSelectedItem({ ...selectedRows[0] });
69095
69575
  if (handleSelect) {
69096
69576
  handleSelect({ ...selectedRows[0] });
@@ -69109,7 +69589,8 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
69109
69589
  useEffect(() => {
69110
69590
  if (!isMulti) {
69111
69591
  if (dataSource && selectedItem && selectedItem[fieldKey]) {
69112
- if (selectedRows?.length === 0 || selectedItem[fieldKey] !== selectedRows[0][fieldKey]) {
69592
+ if (selectedRows?.length === 0 ||
69593
+ selectedItem[fieldKey] !== selectedRows[0][fieldKey]) {
69113
69594
  setSelectedRows([selectedItem]);
69114
69595
  }
69115
69596
  }
@@ -69118,142 +69599,19 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
69118
69599
  }
69119
69600
  }
69120
69601
  else {
69121
- if (dataSource && selectedItem && selectedRows?.length !== selectedItem.length) {
69602
+ if (dataSource &&
69603
+ selectedItem &&
69604
+ selectedRows?.length !== selectedItem.length) {
69122
69605
  setSelectedRows(selectedItem ? [...selectedItem] : []);
69123
69606
  }
69124
69607
  }
69125
69608
  }, [selectedItem]);
69126
- const RenderContent = ({ datas, level = 0 }) => {
69127
- return (jsx(Fragment$1, { children: datas.map((row, indexRow) => {
69128
- const [expand, setExpand] = useState(row.expand ?? true);
69129
- useEffect(() => {
69130
- if (expandsAll !== undefined) {
69131
- setExpand(expandsAll);
69132
- row.expand = expandsAll;
69133
- }
69134
- }, [expandsAll]);
69135
- if (row.children?.length) {
69136
- const col = contentColumns.find((x) => x.field === row.field);
69137
- let value = row[col.field];
69138
- if (col.type === 'numeric') {
69139
- value = formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', col.numericSettings?.fraction, true, false) ?? 0;
69140
- }
69141
- else if (col.type === 'date') {
69142
- value = value ? formatDateTime(value, formatSetting?.dateFormat) : '';
69143
- }
69144
- else if (col.type === 'datetime') {
69145
- value = value ? formatDateTime(value, formatSetting?.dateFormat ?? 'DD/MM/yyyy HH:mm') : '';
69146
- }
69147
- if (col.template) {
69148
- value = col.template(row, indexRow) ?? '';
69149
- }
69150
- return (jsxs(Fragment$1, { children: [jsxs("tr", { "aria-rowindex": indexRow + 1, role: "row", className: "r-row", children: [jsx("td", { className: "r-rowcell r-cell-group", colSpan: 3, children: jsxs("div", { className: "r-rowcell-div", children: [jsx(SvgChevronRight, { style: {
69151
- marginLeft: level * 20,
69152
- transform: expand ? 'rotate(90deg)' : 'rotate(0deg)'
69153
- }, fontSize: 15, onClick: () => {
69154
- setExpand(!expand);
69155
- setExpandsAll(undefined);
69156
- row.expand = !expand;
69157
- } }), t(col.headerDisplay ?? col.headerText), ": ", value, " (", row.children.length, ")"] }) }), contentColumns.map((colSum, indexCol) => {
69158
- if (indexCol <= firstColSpan || colSum.visible === false || colSum.isGroup === true) {
69159
- return;
69160
- }
69161
- let sumValue = row[colSum.field];
69162
- const haveSum = row[colSum.field] !== undefined && row[colSum.field] !== null;
69163
- if (!haveSum && colSum.haveSum === true && colSum.type === 'numeric') {
69164
- sumValue = row.children.reduce(function (accumulator, currentValue) {
69165
- return Number(accumulator ?? 0) + Number(currentValue[colSum.field] ?? 0);
69166
- }, 0);
69167
- }
69168
- if (colSum.type === 'numeric') {
69169
- sumValue = formartNumberic(sumValue, formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', colSum.numericSettings?.fraction, true, false);
69170
- if (!zeroVisiable && (sumValue === '0' || sumValue === 0)) {
69171
- sumValue = '';
69172
- }
69173
- }
69174
- return (jsx("td", { className: "r-rowcell r-cell-sum-group", children: jsx("div", { className: "r-rowcell-div", style: {
69175
- justifyContent: colSum.textAlign ? colSum.textAlign : 'left'
69176
- }, children: (haveSum || colSum.haveSum === true) && Number(row[colSum.field] ?? '0') < 0 ? (jsxs("div", { style: {
69177
- color: formatSetting?.colorNegative ?? 'red'
69178
- }, children: [' ', `${formatSetting?.prefixNegative ?? '-'}${sumValue}${formatSetting?.suffixNegative ?? ''}`] })) : (sumValue) }) }, `group-sum-cell-${level}-${indexRow}-${indexCol}`));
69179
- })] }), expand && jsx(RenderContent, { datas: row.children, level: level + 1 })] }, `row-${level}-${indexRow}`));
69180
- }
69181
- else {
69182
- const isSelected = selectedRows?.some((x) => x[fieldKey] === row[fieldKey]);
69183
- return (jsx("tr", { id: `row-content-${indexRow}`, "aria-rowindex": indexRow + 1, role: "row", className: classNames$1('r-row', {
69184
- 'r-last-row': level === 0 && indexRow === viewData.length - 1
69185
- }), onContextMenu: (e) => {
69186
- e.preventDefault();
69187
- handleContextMenu(e, row);
69188
- }, children: contentColumns.map((column, indexCol) => (jsx(RenderContentCol, { idTable: idTable, col: column, fieldKey: fieldKey, objWidthFixLeft: objWidthFixLeft, objWidthFixRight: objWidthFixRight, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft, isMulti: isMulti, selectedRows: selectedRows, setSelectedRows: setSelectedRows, formatSetting: formatSetting, indexCol: indexCol, indexRow: indexRow, isSelected: isSelected, row: row, zeroVisiable: zeroVisiable, handleCloseContext: handleCloseContext, handleDoubleClick: handleDoubleClick }, indexCol))) }, `row-content-${indexRow}`));
69189
- }
69190
- }) }));
69191
- };
69192
- const handleContextMenu = (e, row) => {
69193
- e.preventDefault();
69194
- setContext(null);
69195
- setTimeout(() => {
69196
- setContext({
69197
- x: e.clientX,
69198
- y: e.clientY,
69199
- row,
69200
- show: true
69201
- });
69202
- }, 100);
69203
- };
69204
- const handleCloseContext = () => setContext((prev) => (prev ? { ...prev, show: false } : null));
69205
- useEffect(() => {
69206
- if (virtualDivRef.current && context) {
69207
- // đặt vị trí div ảo tại con trỏ chuột
69208
- virtualDivRef.current.style.position = 'fixed';
69209
- virtualDivRef.current.style.top = `${context.y}px`;
69210
- virtualDivRef.current.style.left = `${context.x}px`;
69211
- virtualDivRef.current.style.width = '0px';
69212
- virtualDivRef.current.style.height = '0px';
69213
- }
69214
- }, [context]);
69215
- return (jsxs("div", { className: "r-table-edit r-virtualized-table", children: [jsxs("div", { className: "r-grid", children: [toolbarSetting?.showTopToolbar && jsx(RenderToolbarTop, { toolbarTopOption: toolbarTopOption }), headerComponent && headerComponent(), jsxs("div", { ref: gridRef, className: "r-gridtable", style: {
69216
- height: `${height ? `${height}px` : 'auto'}`,
69217
- position: 'relative'
69218
- }, children: [jsxs("table", { role: "presentation", style: { width: '100%' }, children: [jsx(RenderColGroup, { contentColumns: contentColumns }), jsx("thead", { className: "r-gridheader", role: "rowgroup", children: headerColumns.map((rowColumn, indexParent) => {
69219
- return (jsx("tr", { className: "r-row", role: "row", children: rowColumn.map((col, index) => (jsx(HeaderTableCol, { col: col, idTable: idTable ?? '', dataSource: dataSource, indexCol: index, indexParent: indexParent, isMulti: isMulti ?? false, objHeaderWidthFixLeft: objHeaderWidthFixLeft, objHeaderWidthFixRight: objHeaderWidthFixRight, selectEnable: true, selectedRows: selectedRows, setSelectedRows: setSelectedRows, container: gridRef, filterBy: filterBy, orderBy: orderBy, optionsFilter: querySetting?.optionsFilter, allowFiltering: querySetting?.allowFiltering, allowSorting: querySetting?.allowSorting, formatSetting: formatSetting, changeFilter: (val) => {
69220
- setFilterBy([...val]);
69221
- if (querySetting?.changeFilter) {
69222
- querySetting.changeFilter(val);
69223
- }
69224
- }, changeOrder: (val) => {
69225
- setOrderBy([...val]);
69226
- if (querySetting?.changeOrder) {
69227
- querySetting.changeOrder(val);
69228
- }
69229
- }, columns: contentColumns, setContentColumns: setContentColumns, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft, totalCount: dataSource?.length ?? 0 }, `header-${indexParent}-${index}`))) }, `header-${-indexParent}`));
69230
- }) }), jsx("tbody", { className: "r-gridcontent", role: "rowgroup", children: jsx(RenderContent, { datas: viewData }) }), jsx("tfoot", { className: "r-gridfoot", children: ((columnsAggregate?.length ?? 0) > 0 || haveSum) && (jsx("tr", { className: "r-row", children: contentColumns.map((col, indexCol) => {
69231
- if (col.visible === false || col.isGroup === true) {
69232
- return;
69233
- }
69234
- const item = columnsAggregate?.find((x) => x.field === col.field);
69235
- let sumValue = item?.value;
69236
- if (!item && col.haveSum === true && col.type === 'numeric') {
69237
- sumValue = viewData.reduce(function (accumulator, currentValue) {
69238
- return Number(accumulator ?? 0) + Number(currentValue[col.field] ?? 0);
69239
- }, 0);
69240
- }
69241
- if (col.type === 'numeric') {
69242
- sumValue = formartNumberic(sumValue, formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', col.numericSettings?.fraction, true, false);
69243
- }
69244
- return (jsx("td", { className: classNames$1(`p-0 px-50 r-footer fix-${col.fixedType}`, { 'cell-fixed': col.fixedType }), style: {
69245
- left: col.fixedType === 'left' ? objWidthFixLeft[indexCol] : undefined,
69246
- right: col.fixedType === 'right' ? objWidthFixRight[indexCol] : undefined,
69247
- textAlign: col.textAlign ? col.textAlign : 'left'
69248
- }, children: jsx("div", { className: "r-footer-div", children: (item || col.haveSum === true) && Number(item?.value ?? '0') < 0 ? (jsxs("div", { style: {
69249
- color: formatSetting?.colorNegative ?? 'red'
69250
- }, children: [' ', `${formatSetting?.prefixNegative ?? '-'}${sumValue}${formatSetting?.suffixNegative ?? ''}`] })) : (sumValue) }) }, `summarycell-${indexCol}`));
69251
- }) })) })] }), jsx("div", { ref: virtualDivRef }), context && (contextMenuItems?.length ?? 0) > 0 && handleContextMenuClick && (jsx(Popover$1, { className: "r-context-popover", placement: "right-start", isOpen: context.show, target: virtualDivRef.current, toggle: handleCloseContext, fade: false, children: jsx(PopoverBody$1, { children: contextMenuItems?.map((item, index) => {
69252
- return (jsxs("div", { className: "r-context-item", onClick: () => {
69253
- handleCloseContext();
69254
- handleContextMenuClick?.(item, context.row);
69255
- }, children: [item.icon && (jsx("div", { className: "me-75", children: jsx(IconCustom, { iconName: item.icon, size: 16 }) })), jsx("span", { children: t(item.text) })] }, `context-${index}`));
69256
- }) }) })), (viewData.length ?? 0) === 0 && !isLoading && (jsxs("div", { className: "r-no-data", children: [jsx("svg", { width: "64", height: "41", viewBox: "0 0 64 41", xmlns: "http://www.w3.org/2000/svg", children: jsxs("g", { transform: "translate(0 1)", fill: "none", fillRule: "evenodd", children: [jsx("ellipse", { fill: "#f5f5f5", cx: "32", cy: "33", rx: "32", ry: "7" }), jsxs("g", { fillRule: "nonzero", stroke: "#d9d9d9", children: [jsx("path", { d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z" }), jsx("path", { d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z", fill: "#fafafa" })] })] }) }), t('No data available.')] })), isLoading && (jsx("div", { className: "r-loading-overlay", children: jsxs("div", { className: "r-loading", children: [jsx(Spinner$1, { className: "me-1" }), t('Loading...')] }) }))] })] }), pagingSetting?.allowPaging && (jsx(PagingComponent, { gridRef: gridRef, onChangePage: onChangePage, pageSize: pagingSetting?.pageSize ?? 0, currentPage: pagingSetting?.currentPage ?? 0, pageOptions: pagingSetting?.pageOptions ?? [20, 30, 50, 100], totalItem: pagingSetting?.totalItem ?? 0, onChangePageSize: onChangePageSize })), jsx(SettingColumn, { gridRef: gridRef, handleSidebar: () => {
69609
+ return (jsxs("div", { className: classNames$1('r-table-edit r-virtualized-table', {
69610
+ 'is-maximized': maximize,
69611
+ }), children: [jsxs("div", { className: "r-grid", children: [toolbarSetting?.showTopToolbar && (jsx(RenderToolbarTop, { toolbarTopOption: toolbarTopOption, maximize: maximize, setMaximize: setMaximize })), headerComponent && headerComponent(), jsxs("div", { ref: gridRef, className: "r-gridtable", style: {
69612
+ height: `${heightTable ? `${heightTable}px` : 'auto'}`,
69613
+ position: 'relative',
69614
+ }, children: [jsx(TableElement, { idTable: idTable, gridRef: gridRef, isLoading: isLoading, dataSource: dataSource, objHeaderWidthFixLeft: objHeaderWidthFixLeft, objHeaderWidthFixRight: objHeaderWidthFixRight, fieldKey: fieldKey, lastObjWidthFixLeft: lastObjWidthFixLeft, fisrtObjWidthFixRight: fisrtObjWidthFixRight, selectedRows: selectedRows, isMulti: isMulti, filterBy: filterBy, orderBy: orderBy, formatSetting: formatSetting, contentColumns: contentColumns, headerColumns: headerColumns, objWidthFixLeft: objWidthFixLeft, objWidthFixRight: objWidthFixRight, searchTerm: searchTerm, searchSetting: searchSetting, columnsAggregate: columnsAggregate, haveSum: haveSum, expandsAll: expandsAll, zeroVisiable: zeroVisiable, contextMenuItems: contextMenuItems, handleContextMenuClick: handleContextMenuClick, setFilterBy: setFilterBy, setSelectedRows: setSelectedRows, setOrderBy: setOrderBy, handleDoubleClick: handleDoubleClick, handleCellClick: handleCellClick, querySetting: querySetting, setContentColumns: setContentColumns, setExpandsAll: setExpandsAll }), isLoading && (jsx("div", { className: "r-loading-overlay", children: jsxs("div", { className: "r-loading", children: [jsx(Spinner$1, { className: "me-1" }), t('Loading...')] }) }))] })] }), pagingSetting?.allowPaging && (jsx(PagingComponent, { gridRef: gridRef, onChangePage: onChangePage, pageSize: pagingSetting?.pageSize ?? 0, currentPage: pagingSetting?.currentPage ?? 0, pageOptions: pagingSetting?.pageOptions ?? [20, 30, 50, 100], totalItem: pagingSetting?.totalItem ?? 0, onChangePageSize: onChangePageSize })), jsx(SettingColumn, { gridRef: gridRef, handleSidebar: () => {
69257
69615
  setOpenPopupSetupColumn(!openPopupSetupColumn);
69258
69616
  }, settingColumns: settingColumns, openSidebar: openPopupSetupColumn, column: [...contentColumns], resetDefaultColumns: resetDefaultColumns, setColumn: (newColumns) => {
69259
69617
  if (saveSettingColumn) {
@@ -69263,7 +69621,7 @@ const TableView = ({ idTable, dataSource, height = 400, haveSum, columns, isLoad
69263
69621
  visible: x.visible,
69264
69622
  fixedType: x.fixedType,
69265
69623
  width: x.width,
69266
- sortOrder: index + 1
69624
+ sortOrder: index + 1,
69267
69625
  })));
69268
69626
  }
69269
69627
  } })] }));