fastapi-rtk 0.1.21 → 0.1.22

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.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- /*! @license DOMPurify 3.2.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.5/LICENSE */
2
+ /*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */
3
3
  const {
4
4
  entries,
5
5
  setPrototypeOf,
@@ -150,7 +150,7 @@ const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm);
150
150
  const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/);
151
151
  const ARIA_ATTR = seal(/^aria-[\-\w]+$/);
152
152
  const IS_ALLOWED_URI = seal(
153
- /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
153
+ /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
154
154
  // eslint-disable-line no-useless-escape
155
155
  );
156
156
  const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
@@ -224,7 +224,7 @@ const _createHooksMap = function _createHooksMap2() {
224
224
  function createDOMPurify() {
225
225
  let window2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
226
226
  const DOMPurify = (root) => createDOMPurify(root);
227
- DOMPurify.version = "3.2.5";
227
+ DOMPurify.version = "3.2.6";
228
228
  DOMPurify.removed = [];
229
229
  if (!window2 || !window2.document || window2.document.nodeType !== NODE_TYPE.document || !window2.Element) {
230
230
  DOMPurify.isSupported = false;
@@ -371,8 +371,8 @@ function createDOMPurify() {
371
371
  URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, "ADD_URI_SAFE_ATTR") ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;
372
372
  DATA_URI_TAGS = objectHasOwnProperty(cfg, "ADD_DATA_URI_TAGS") ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;
373
373
  FORBID_CONTENTS = objectHasOwnProperty(cfg, "FORBID_CONTENTS") ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
374
- FORBID_TAGS = objectHasOwnProperty(cfg, "FORBID_TAGS") ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};
375
- FORBID_ATTR = objectHasOwnProperty(cfg, "FORBID_ATTR") ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};
374
+ FORBID_TAGS = objectHasOwnProperty(cfg, "FORBID_TAGS") ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : clone({});
375
+ FORBID_ATTR = objectHasOwnProperty(cfg, "FORBID_ATTR") ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({});
376
376
  USE_PROFILES = objectHasOwnProperty(cfg, "USE_PROFILES") ? cfg.USE_PROFILES : false;
377
377
  ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;
378
378
  ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;
@@ -636,7 +636,7 @@ function createDOMPurify() {
636
636
  tagName,
637
637
  allowedTags: ALLOWED_TAGS
638
638
  });
639
- if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) {
639
+ if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) {
640
640
  _forceRemove(currentNode);
641
641
  return true;
642
642
  }
@@ -749,7 +749,8 @@ function createDOMPurify() {
749
749
  value: attrValue
750
750
  } = attr;
751
751
  const lcName = transformCaseFunc(name);
752
- let value = name === "value" ? attrValue : stringTrim(attrValue);
752
+ const initValue = attrValue;
753
+ let value = name === "value" ? initValue : stringTrim(initValue);
753
754
  hookEvent.attrName = lcName;
754
755
  hookEvent.attrValue = value;
755
756
  hookEvent.keepAttr = true;
@@ -767,8 +768,8 @@ function createDOMPurify() {
767
768
  if (hookEvent.forceKeepAttr) {
768
769
  continue;
769
770
  }
770
- _removeAttribute(name, currentNode);
771
771
  if (!hookEvent.keepAttr) {
772
+ _removeAttribute(name, currentNode);
772
773
  continue;
773
774
  }
774
775
  if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
@@ -782,6 +783,7 @@ function createDOMPurify() {
782
783
  }
783
784
  const lcTag = transformCaseFunc(currentNode.nodeName);
784
785
  if (!_isValidAttribute(lcTag, lcName, value)) {
786
+ _removeAttribute(name, currentNode);
785
787
  continue;
786
788
  }
787
789
  if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function") {
@@ -799,18 +801,21 @@ function createDOMPurify() {
799
801
  }
800
802
  }
801
803
  }
802
- try {
803
- if (namespaceURI) {
804
- currentNode.setAttributeNS(namespaceURI, name, value);
805
- } else {
806
- currentNode.setAttribute(name, value);
807
- }
808
- if (_isClobbered(currentNode)) {
809
- _forceRemove(currentNode);
810
- } else {
811
- arrayPop(DOMPurify.removed);
804
+ if (value !== initValue) {
805
+ try {
806
+ if (namespaceURI) {
807
+ currentNode.setAttributeNS(namespaceURI, name, value);
808
+ } else {
809
+ currentNode.setAttribute(name, value);
810
+ }
811
+ if (_isClobbered(currentNode)) {
812
+ _forceRemove(currentNode);
813
+ } else {
814
+ arrayPop(DOMPurify.removed);
815
+ }
816
+ } catch (_) {
817
+ _removeAttribute(name, currentNode);
812
818
  }
813
- } catch (_) {
814
819
  }
815
820
  }
816
821
  _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
@@ -1,4 +1,4 @@
1
- /*! @license DOMPurify 3.2.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.5/LICENSE */
1
+ /*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */
2
2
  const {
3
3
  entries,
4
4
  setPrototypeOf,
@@ -149,7 +149,7 @@ const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm);
149
149
  const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/);
150
150
  const ARIA_ATTR = seal(/^aria-[\-\w]+$/);
151
151
  const IS_ALLOWED_URI = seal(
152
- /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
152
+ /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
153
153
  // eslint-disable-line no-useless-escape
154
154
  );
155
155
  const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
@@ -223,7 +223,7 @@ const _createHooksMap = function _createHooksMap2() {
223
223
  function createDOMPurify() {
224
224
  let window2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
225
225
  const DOMPurify = (root) => createDOMPurify(root);
226
- DOMPurify.version = "3.2.5";
226
+ DOMPurify.version = "3.2.6";
227
227
  DOMPurify.removed = [];
228
228
  if (!window2 || !window2.document || window2.document.nodeType !== NODE_TYPE.document || !window2.Element) {
229
229
  DOMPurify.isSupported = false;
@@ -370,8 +370,8 @@ function createDOMPurify() {
370
370
  URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, "ADD_URI_SAFE_ATTR") ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;
371
371
  DATA_URI_TAGS = objectHasOwnProperty(cfg, "ADD_DATA_URI_TAGS") ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;
372
372
  FORBID_CONTENTS = objectHasOwnProperty(cfg, "FORBID_CONTENTS") ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
373
- FORBID_TAGS = objectHasOwnProperty(cfg, "FORBID_TAGS") ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};
374
- FORBID_ATTR = objectHasOwnProperty(cfg, "FORBID_ATTR") ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};
373
+ FORBID_TAGS = objectHasOwnProperty(cfg, "FORBID_TAGS") ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : clone({});
374
+ FORBID_ATTR = objectHasOwnProperty(cfg, "FORBID_ATTR") ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({});
375
375
  USE_PROFILES = objectHasOwnProperty(cfg, "USE_PROFILES") ? cfg.USE_PROFILES : false;
376
376
  ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;
377
377
  ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;
@@ -635,7 +635,7 @@ function createDOMPurify() {
635
635
  tagName,
636
636
  allowedTags: ALLOWED_TAGS
637
637
  });
638
- if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) {
638
+ if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) {
639
639
  _forceRemove(currentNode);
640
640
  return true;
641
641
  }
@@ -748,7 +748,8 @@ function createDOMPurify() {
748
748
  value: attrValue
749
749
  } = attr;
750
750
  const lcName = transformCaseFunc(name);
751
- let value = name === "value" ? attrValue : stringTrim(attrValue);
751
+ const initValue = attrValue;
752
+ let value = name === "value" ? initValue : stringTrim(initValue);
752
753
  hookEvent.attrName = lcName;
753
754
  hookEvent.attrValue = value;
754
755
  hookEvent.keepAttr = true;
@@ -766,8 +767,8 @@ function createDOMPurify() {
766
767
  if (hookEvent.forceKeepAttr) {
767
768
  continue;
768
769
  }
769
- _removeAttribute(name, currentNode);
770
770
  if (!hookEvent.keepAttr) {
771
+ _removeAttribute(name, currentNode);
771
772
  continue;
772
773
  }
773
774
  if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
@@ -781,6 +782,7 @@ function createDOMPurify() {
781
782
  }
782
783
  const lcTag = transformCaseFunc(currentNode.nodeName);
783
784
  if (!_isValidAttribute(lcTag, lcName, value)) {
785
+ _removeAttribute(name, currentNode);
784
786
  continue;
785
787
  }
786
788
  if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function") {
@@ -798,18 +800,21 @@ function createDOMPurify() {
798
800
  }
799
801
  }
800
802
  }
801
- try {
802
- if (namespaceURI) {
803
- currentNode.setAttributeNS(namespaceURI, name, value);
804
- } else {
805
- currentNode.setAttribute(name, value);
806
- }
807
- if (_isClobbered(currentNode)) {
808
- _forceRemove(currentNode);
809
- } else {
810
- arrayPop(DOMPurify.removed);
803
+ if (value !== initValue) {
804
+ try {
805
+ if (namespaceURI) {
806
+ currentNode.setAttributeNS(namespaceURI, name, value);
807
+ } else {
808
+ currentNode.setAttribute(name, value);
809
+ }
810
+ if (_isClobbered(currentNode)) {
811
+ _forceRemove(currentNode);
812
+ } else {
813
+ arrayPop(DOMPurify.removed);
814
+ }
815
+ } catch (_) {
816
+ _removeAttribute(name, currentNode);
811
817
  }
812
- } catch (_) {
813
818
  }
814
819
  }
815
820
  _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const core = require("@mantine/core");
5
- const purify_es = require("../../../../../../../.external/cjs/dompurify@3.2.5/dompurify/dist/purify.es.cjs");
5
+ const purify_es = require("../../../../../../../.external/cjs/dompurify@3.2.6/dompurify/dist/purify.es.cjs");
6
6
  const React = require("react");
7
7
  const FallbackWrapper = require("../../../../NextGenDataGrid/FallbackWrapper.cjs");
8
8
  const Field_module = require("./Field.module.css.cjs");
@@ -44,11 +44,13 @@ function ColumnHeaderFilter({
44
44
  filterModeDescription,
45
45
  filterMenu,
46
46
  onFilterClear,
47
+ onFilterMount,
47
48
  filters,
48
49
  filterFn,
49
- mrtProps: { column, table, ...restProps }
50
+ mrtProps
50
51
  }) {
51
52
  var _a;
53
+ const { column, table } = mrtProps;
52
54
  const { info, queryParams } = useApi.useApi();
53
55
  const api = useApi.useApi();
54
56
  const auth = useAuth.useAuth();
@@ -110,6 +112,9 @@ function ColumnHeaderFilter({
110
112
  handleClear();
111
113
  }
112
114
  }, [currentHeaderFilter]);
115
+ React.useEffect(() => {
116
+ onFilterMount == null ? void 0 : onFilterMount({ api: api.getState(), auth: auth.getState(), mrtProps });
117
+ }, [onFilterMount]);
113
118
  const AIProps = React.useMemo(() => {
114
119
  const props = { variant: "subtle" };
115
120
  const disabled = !(filters == null ? void 0 : filters.length);
@@ -127,10 +132,7 @@ function ColumnHeaderFilter({
127
132
  () => ({ ...AIProps, variant: "transparent", c: void 0, size: "sm", onClick: handleClear }),
128
133
  [AIProps, handleClear]
129
134
  );
130
- const functionProps = React.useMemo(
131
- () => ({ api, auth, mrtProps: { column, table, ...restProps } }),
132
- [api, auth, column, restProps, table]
133
- );
135
+ const functionProps = React.useMemo(() => ({ api, auth, mrtProps }), [api, auth, mrtProps]);
134
136
  const filterMenuFunctionProps = React.useMemo(
135
137
  () => ({
136
138
  ...functionProps,
@@ -167,54 +169,46 @@ function ColumnHeaderFilter({
167
169
  variant: "unstyled",
168
170
  disabled: !(filters == null ? void 0 : filters.length),
169
171
  title: !filters.length ? "No filters" : void 0,
170
- placeholder: (_a2 = table.options.localization.filterByColumn) == null ? void 0 : _a2.replace("{column}", String(column.columnDef.header)),
171
- "aria-label": (_b = table.options.localization.filterByColumn) == null ? void 0 : _b.replace("{column}", String(column.columnDef.header)),
172
+ placeholder: (_a2 = mrtProps.table.options.localization.filterByColumn) == null ? void 0 : _a2.replace(
173
+ "{column}",
174
+ String(mrtProps.column.columnDef.header)
175
+ ),
176
+ "aria-label": (_b = mrtProps.table.options.localization.filterByColumn) == null ? void 0 : _b.replace(
177
+ "{column}",
178
+ String(mrtProps.column.columnDef.header)
179
+ ),
172
180
  style: { fontWeight: "normal" },
173
181
  mrtprops: {
174
- column,
175
- table,
176
- ...restProps,
182
+ ...mrtProps,
177
183
  textinputprops: {
178
184
  className: clsx.clsx("mrt-filter-text-input", headerinput_module.default.root),
179
- ...utils$1.parseFromValuesOrFunc(table.mantineFilterTextInputProps, [{ column, table, ...restProps }]),
180
- ...utils$1.parseFromValuesOrFunc(column.columnDef.mantineFilterTextInputProps, [{ column, table, ...restProps }])
185
+ ...utils$1.parseFromValuesOrFunc(mrtProps.table.mantineFilterTextInputProps, mrtProps),
186
+ ...utils$1.parseFromValuesOrFunc(mrtProps.column.columnDef.mantineFilterTextInputProps, mrtProps)
181
187
  },
182
188
  selectprops: {
183
189
  className: clsx.clsx("mrt-filter-text-input", headerinput_module.default.root),
184
- ...utils$1.parseFromValuesOrFunc(table.mantineFilterSelectProps || { clearable: true }, {
185
- column,
186
- table,
187
- ...restProps
188
- }),
189
- ...utils$1.parseFromValuesOrFunc(column.columnDef.mantineFilterSelectProps, { column, table, ...restProps })
190
+ ...utils$1.parseFromValuesOrFunc(mrtProps.table.mantineFilterSelectProps || { clearable: true }, mrtProps),
191
+ ...utils$1.parseFromValuesOrFunc(mrtProps.column.columnDef.mantineFilterSelectProps, mrtProps)
190
192
  },
191
193
  multiselectprops: {
192
194
  className: clsx.clsx("mrt-filter-text-input", headerinput_module.default.root),
193
- ...utils$1.parseFromValuesOrFunc(table.mantineFilterMultiSelectProps || { clearable: true }, {
194
- column,
195
- table,
196
- ...restProps
197
- }),
198
- ...utils$1.parseFromValuesOrFunc(column.columnDef.mantineFilterMultiSelectProps, { column, table, ...restProps })
195
+ ...utils$1.parseFromValuesOrFunc(mrtProps.table.mantineFilterMultiSelectProps || { clearable: true }, mrtProps),
196
+ ...utils$1.parseFromValuesOrFunc(mrtProps.column.columnDef.mantineFilterMultiSelectProps, mrtProps)
199
197
  },
200
198
  dateinputprops: {
201
199
  className: clsx.clsx("mrt-filter-text-input", headerinput_module.default.root, headerinput_module.default["date-filter"]),
202
- ...utils$1.parseFromValuesOrFunc(table.mantineFilterDateInputProps, { column, table, ...restProps }),
203
- ...utils$1.parseFromValuesOrFunc(column.columnDef.mantineFilterDateInputProps, { column, table, ...restProps })
200
+ ...utils$1.parseFromValuesOrFunc(mrtProps.table.mantineFilterDateInputProps, mrtProps),
201
+ ...utils$1.parseFromValuesOrFunc(mrtProps.column.columnDef.mantineFilterDateInputProps, mrtProps)
204
202
  },
205
203
  autocompleteprops: {
206
204
  className: clsx.clsx("mrt-filter-text-input", headerinput_module.default.root),
207
- ...utils$1.parseFromValuesOrFunc(table.mantineFilterAutocompleteProps, { column, table, ...restProps }),
208
- ...utils$1.parseFromValuesOrFunc(column.columnDef.mantineFilterAutocompleteProps, {
209
- column,
210
- table,
211
- ...restProps
212
- })
205
+ ...utils$1.parseFromValuesOrFunc(mrtProps.table.mantineFilterAutocompleteProps, mrtProps),
206
+ ...utils$1.parseFromValuesOrFunc(mrtProps.column.columnDef.mantineFilterAutocompleteProps, mrtProps)
213
207
  }
214
208
  },
215
209
  ref: (node) => {
216
210
  if (node) {
217
- table.refs.filterInputRefs.current[`${column.id}-0`] = node;
211
+ mrtProps.table.refs.filterInputRefs.current[`${mrtProps.column.id}-0`] = node;
218
212
  }
219
213
  },
220
214
  clearIcon: field.isDirty() && /* @__PURE__ */ jsxRuntime.jsx(core.CloseButton, { ...clearIconProps }),
@@ -222,7 +216,7 @@ function ColumnHeaderFilter({
222
216
  cleariconprops: clearIconProps
223
217
  };
224
218
  },
225
- [clearIconProps, column, configuration, field, filters.length, restProps, table]
219
+ [clearIconProps, configuration, field, filters.length, mrtProps]
226
220
  );
227
221
  return /* @__PURE__ */ jsxRuntime.jsxs(core.Menu, { opened, closeOnClickOutside: true, onChange: toggle, children: [
228
222
  /* @__PURE__ */ jsxRuntime.jsxs(core.Stack, { w: "100%", gap: "0.25rem", children: [
@@ -34,6 +34,7 @@ function useColumns(columnProps, header, body, textFilterSeparator) {
34
34
  filterModeDescription,
35
35
  filterMenu,
36
36
  onFilterClear,
37
+ onFilterMount,
37
38
  defaultOpr = ((_d = (_c = (_b = (_a = info == null ? void 0 : info.filters) == null ? void 0 : _a[col]) == null ? void 0 : _b.filters) == null ? void 0 : _c[0]) == null ? void 0 : _d.operator) || ""
38
39
  } = utils.getProps(header, specialKey.all, col);
39
40
  const filterFn = utils.fromFilterToFilterFn(col, defaultOpr);
@@ -56,6 +57,7 @@ function useColumns(columnProps, header, body, textFilterSeparator) {
56
57
  filterModeDescription,
57
58
  filterMenu,
58
59
  onFilterClear,
60
+ onFilterMount,
59
61
  filters,
60
62
  filterFn,
61
63
  mrtProps: props,
@@ -87,6 +89,7 @@ function useColumns(columnProps, header, body, textFilterSeparator) {
87
89
  }
88
90
  let truncateObj = {};
89
91
  if (truncate) {
92
+ highlight.push(...highlight.map((h) => `${h.slice(0, truncate)}...`));
90
93
  if (Array.isArray(value)) {
91
94
  truncateObj = value.map((v) => ({
92
95
  original: v,
@@ -41,7 +41,11 @@ exports.useAuth = useAuth.useAuth;
41
41
  exports.useInfo = useInfo.useInfo;
42
42
  exports.UserMenu = UserMenu.UserMenu;
43
43
  exports.DataGrid = DataGrid.DataGrid;
44
+ exports.Datagrid = DataGrid.DataGrid;
44
45
  exports.NextGenDataGrid = NextGenDataGrid.NextGenDataGrid;
46
+ exports.NextGenDatagrid = NextGenDataGrid.NextGenDataGrid;
47
+ exports.NextGendatagrid = NextGenDataGrid.NextGenDataGrid;
48
+ exports.Nextgendatagrid = NextGenDataGrid.NextGenDataGrid;
45
49
  exports.ApiProvider = ApiProvider.ApiProvider;
46
50
  exports.InfiniteScroll = InfiniteScroll.InfiniteScroll;
47
51
  exports.LazyLoadWrapper = LazyLoadWrapper.LazyLoadWrapper;
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { useProps, useStyles, Table, Box, Skeleton, Text } from "@mantine/core";
3
- import purify from "../../../../../../../.external/esm/dompurify@3.2.5/dompurify/dist/purify.es.mjs";
3
+ import purify from "../../../../../../../.external/esm/dompurify@3.2.6/dompurify/dist/purify.es.mjs";
4
4
  import React__default, { isValidElement } from "react";
5
5
  import { FallbackWrapper } from "../../../../NextGenDataGrid/FallbackWrapper.mjs";
6
6
  import classes from "./Field.module.css.mjs";
@@ -42,11 +42,13 @@ function ColumnHeaderFilter({
42
42
  filterModeDescription,
43
43
  filterMenu,
44
44
  onFilterClear,
45
+ onFilterMount,
45
46
  filters,
46
47
  filterFn,
47
- mrtProps: { column, table, ...restProps }
48
+ mrtProps
48
49
  }) {
49
50
  var _a;
51
+ const { column, table } = mrtProps;
50
52
  const { info, queryParams } = useApi();
51
53
  const api = useApi();
52
54
  const auth = useAuth();
@@ -108,6 +110,9 @@ function ColumnHeaderFilter({
108
110
  handleClear();
109
111
  }
110
112
  }, [currentHeaderFilter]);
113
+ useEffect(() => {
114
+ onFilterMount == null ? void 0 : onFilterMount({ api: api.getState(), auth: auth.getState(), mrtProps });
115
+ }, [onFilterMount]);
111
116
  const AIProps = useMemo(() => {
112
117
  const props = { variant: "subtle" };
113
118
  const disabled = !(filters == null ? void 0 : filters.length);
@@ -125,10 +130,7 @@ function ColumnHeaderFilter({
125
130
  () => ({ ...AIProps, variant: "transparent", c: void 0, size: "sm", onClick: handleClear }),
126
131
  [AIProps, handleClear]
127
132
  );
128
- const functionProps = useMemo(
129
- () => ({ api, auth, mrtProps: { column, table, ...restProps } }),
130
- [api, auth, column, restProps, table]
131
- );
133
+ const functionProps = useMemo(() => ({ api, auth, mrtProps }), [api, auth, mrtProps]);
132
134
  const filterMenuFunctionProps = useMemo(
133
135
  () => ({
134
136
  ...functionProps,
@@ -165,54 +167,46 @@ function ColumnHeaderFilter({
165
167
  variant: "unstyled",
166
168
  disabled: !(filters == null ? void 0 : filters.length),
167
169
  title: !filters.length ? "No filters" : void 0,
168
- placeholder: (_a2 = table.options.localization.filterByColumn) == null ? void 0 : _a2.replace("{column}", String(column.columnDef.header)),
169
- "aria-label": (_b = table.options.localization.filterByColumn) == null ? void 0 : _b.replace("{column}", String(column.columnDef.header)),
170
+ placeholder: (_a2 = mrtProps.table.options.localization.filterByColumn) == null ? void 0 : _a2.replace(
171
+ "{column}",
172
+ String(mrtProps.column.columnDef.header)
173
+ ),
174
+ "aria-label": (_b = mrtProps.table.options.localization.filterByColumn) == null ? void 0 : _b.replace(
175
+ "{column}",
176
+ String(mrtProps.column.columnDef.header)
177
+ ),
170
178
  style: { fontWeight: "normal" },
171
179
  mrtprops: {
172
- column,
173
- table,
174
- ...restProps,
180
+ ...mrtProps,
175
181
  textinputprops: {
176
182
  className: clsx("mrt-filter-text-input", classes.root),
177
- ...parseFromValuesOrFunc(table.mantineFilterTextInputProps, [{ column, table, ...restProps }]),
178
- ...parseFromValuesOrFunc(column.columnDef.mantineFilterTextInputProps, [{ column, table, ...restProps }])
183
+ ...parseFromValuesOrFunc(mrtProps.table.mantineFilterTextInputProps, mrtProps),
184
+ ...parseFromValuesOrFunc(mrtProps.column.columnDef.mantineFilterTextInputProps, mrtProps)
179
185
  },
180
186
  selectprops: {
181
187
  className: clsx("mrt-filter-text-input", classes.root),
182
- ...parseFromValuesOrFunc(table.mantineFilterSelectProps || { clearable: true }, {
183
- column,
184
- table,
185
- ...restProps
186
- }),
187
- ...parseFromValuesOrFunc(column.columnDef.mantineFilterSelectProps, { column, table, ...restProps })
188
+ ...parseFromValuesOrFunc(mrtProps.table.mantineFilterSelectProps || { clearable: true }, mrtProps),
189
+ ...parseFromValuesOrFunc(mrtProps.column.columnDef.mantineFilterSelectProps, mrtProps)
188
190
  },
189
191
  multiselectprops: {
190
192
  className: clsx("mrt-filter-text-input", classes.root),
191
- ...parseFromValuesOrFunc(table.mantineFilterMultiSelectProps || { clearable: true }, {
192
- column,
193
- table,
194
- ...restProps
195
- }),
196
- ...parseFromValuesOrFunc(column.columnDef.mantineFilterMultiSelectProps, { column, table, ...restProps })
193
+ ...parseFromValuesOrFunc(mrtProps.table.mantineFilterMultiSelectProps || { clearable: true }, mrtProps),
194
+ ...parseFromValuesOrFunc(mrtProps.column.columnDef.mantineFilterMultiSelectProps, mrtProps)
197
195
  },
198
196
  dateinputprops: {
199
197
  className: clsx("mrt-filter-text-input", classes.root, classes["date-filter"]),
200
- ...parseFromValuesOrFunc(table.mantineFilterDateInputProps, { column, table, ...restProps }),
201
- ...parseFromValuesOrFunc(column.columnDef.mantineFilterDateInputProps, { column, table, ...restProps })
198
+ ...parseFromValuesOrFunc(mrtProps.table.mantineFilterDateInputProps, mrtProps),
199
+ ...parseFromValuesOrFunc(mrtProps.column.columnDef.mantineFilterDateInputProps, mrtProps)
202
200
  },
203
201
  autocompleteprops: {
204
202
  className: clsx("mrt-filter-text-input", classes.root),
205
- ...parseFromValuesOrFunc(table.mantineFilterAutocompleteProps, { column, table, ...restProps }),
206
- ...parseFromValuesOrFunc(column.columnDef.mantineFilterAutocompleteProps, {
207
- column,
208
- table,
209
- ...restProps
210
- })
203
+ ...parseFromValuesOrFunc(mrtProps.table.mantineFilterAutocompleteProps, mrtProps),
204
+ ...parseFromValuesOrFunc(mrtProps.column.columnDef.mantineFilterAutocompleteProps, mrtProps)
211
205
  }
212
206
  },
213
207
  ref: (node) => {
214
208
  if (node) {
215
- table.refs.filterInputRefs.current[`${column.id}-0`] = node;
209
+ mrtProps.table.refs.filterInputRefs.current[`${mrtProps.column.id}-0`] = node;
216
210
  }
217
211
  },
218
212
  clearIcon: field.isDirty() && /* @__PURE__ */ jsx(CloseButton, { ...clearIconProps }),
@@ -220,7 +214,7 @@ function ColumnHeaderFilter({
220
214
  cleariconprops: clearIconProps
221
215
  };
222
216
  },
223
- [clearIconProps, column, configuration, field, filters.length, restProps, table]
217
+ [clearIconProps, configuration, field, filters.length, mrtProps]
224
218
  );
225
219
  return /* @__PURE__ */ jsxs(Menu, { opened, closeOnClickOutside: true, onChange: toggle, children: [
226
220
  /* @__PURE__ */ jsxs(Stack, { w: "100%", gap: "0.25rem", children: [
@@ -32,6 +32,7 @@ function useColumns(columnProps, header, body, textFilterSeparator) {
32
32
  filterModeDescription,
33
33
  filterMenu,
34
34
  onFilterClear,
35
+ onFilterMount,
35
36
  defaultOpr = ((_d = (_c = (_b = (_a = info == null ? void 0 : info.filters) == null ? void 0 : _a[col]) == null ? void 0 : _b.filters) == null ? void 0 : _c[0]) == null ? void 0 : _d.operator) || ""
36
37
  } = getProps(header, specialKey.all, col);
37
38
  const filterFn = fromFilterToFilterFn(col, defaultOpr);
@@ -54,6 +55,7 @@ function useColumns(columnProps, header, body, textFilterSeparator) {
54
55
  filterModeDescription,
55
56
  filterMenu,
56
57
  onFilterClear,
58
+ onFilterMount,
57
59
  filters,
58
60
  filterFn,
59
61
  mrtProps: props,
@@ -85,6 +87,7 @@ function useColumns(columnProps, header, body, textFilterSeparator) {
85
87
  }
86
88
  let truncateObj = {};
87
89
  if (truncate) {
90
+ highlight.push(...highlight.map((h) => `${h.slice(0, truncate)}...`));
88
91
  if (Array.isArray(value)) {
89
92
  truncateObj = value.map((v) => ({
90
93
  original: v,
@@ -12,8 +12,8 @@ import { useForms } from "./hooks/api/useForms.mjs";
12
12
  import { useAuth } from "./hooks/auth/useAuth.mjs";
13
13
  import { useInfo } from "./hooks/auth/useInfo.mjs";
14
14
  import { UserMenu } from "./Menu/UserMenu/UserMenu.mjs";
15
- import { DataGrid } from "./Tables/DataGrid/DataGrid.mjs";
16
- import { NextGenDataGrid } from "./Tables/NextGenDataGrid/NextGenDataGrid.mjs";
15
+ import { DataGrid, DataGrid as DataGrid2 } from "./Tables/DataGrid/DataGrid.mjs";
16
+ import { NextGenDataGrid, NextGenDataGrid as NextGenDataGrid2, NextGenDataGrid as NextGenDataGrid3, NextGenDataGrid as NextGenDataGrid4 } from "./Tables/NextGenDataGrid/NextGenDataGrid.mjs";
17
17
  import { ApiProvider } from "./Wrappers/ApiProvider/ApiProvider.mjs";
18
18
  import { InfiniteScroll } from "./Wrappers/InfiniteScroll/InfiniteScroll.mjs";
19
19
  import { LazyLoadWrapper } from "./Wrappers/LazyLoadWrapper/LazyLoadWrapper.mjs";
@@ -29,6 +29,7 @@ export {
29
29
  Add,
30
30
  ApiProvider,
31
31
  DataGrid,
32
+ DataGrid2 as Datagrid,
32
33
  Delete,
33
34
  Download,
34
35
  Edit,
@@ -36,6 +37,9 @@ export {
36
37
  InfiniteScroll,
37
38
  LazyLoadWrapper,
38
39
  NextGenDataGrid,
40
+ NextGenDataGrid2 as NextGenDatagrid,
41
+ NextGenDataGrid3 as NextGendatagrid,
42
+ NextGenDataGrid4 as Nextgendatagrid,
39
43
  Provider,
40
44
  Refresh,
41
45
  Upload,
@@ -1,4 +1,4 @@
1
- export function ColumnHeaderFilter({ children, enableFilterModes, enableAdvancedFilters, filterProps, filterModeDescription, filterMenu, onFilterClear, filters, filterFn, mrtProps: { column, table, ...restProps }, }: {
1
+ export function ColumnHeaderFilter({ children, enableFilterModes, enableAdvancedFilters, filterProps, filterModeDescription, filterMenu, onFilterClear, onFilterMount, filters, filterFn, mrtProps, }: {
2
2
  children: any;
3
3
  enableFilterModes: any;
4
4
  enableAdvancedFilters: any;
@@ -6,11 +6,8 @@ export function ColumnHeaderFilter({ children, enableFilterModes, enableAdvanced
6
6
  filterModeDescription: any;
7
7
  filterMenu: any;
8
8
  onFilterClear: any;
9
+ onFilterMount: any;
9
10
  filters: any;
10
11
  filterFn: any;
11
- mrtProps: {
12
- [x: string]: any;
13
- column: any;
14
- table: any;
15
- };
12
+ mrtProps: any;
16
13
  }): import("react").JSX.Element;
@@ -12,11 +12,11 @@ export { useForms } from './hooks/api/useForms';
12
12
  export { useAuth } from './hooks/auth/useAuth';
13
13
  export { useInfo } from './hooks/auth/useInfo';
14
14
  export { UserMenu } from './Menu/UserMenu/UserMenu';
15
- export { DataGrid } from './Tables/DataGrid/DataGrid';
16
- export { NextGenDataGrid } from './Tables/NextGenDataGrid/NextGenDataGrid';
17
15
  export { ApiProvider } from './Wrappers/ApiProvider/ApiProvider';
18
16
  export { InfiniteScroll } from './Wrappers/InfiniteScroll/InfiniteScroll';
19
17
  export { LazyLoadWrapper } from './Wrappers/LazyLoadWrapper/LazyLoadWrapper';
20
18
  export { Provider } from './Wrappers/Provider/Provider';
21
19
  export * from './sub-packages-exporter';
22
20
  export { Filter } from './Tables/DataGrid/Toolbar/Filter/Filter';
21
+ export { DataGrid, DataGrid as Datagrid } from './Tables/DataGrid/DataGrid';
22
+ export { NextGenDataGrid, NextGenDataGrid as NextGenDatagrid, NextGenDataGrid as NextGendatagrid, NextGenDataGrid as Nextgendatagrid } from './Tables/NextGenDataGrid/NextGenDataGrid';
@@ -6,7 +6,7 @@ const createProxy = require("../utils/createProxy.cjs");
6
6
  const react = require("../../../.external/cjs/zustand@5.0.4_@types_react@18.3.21_react@18.3.1/zustand/esm/react.cjs");
7
7
  function useProxy(obj) {
8
8
  const [store] = React.useState(() => react.create(() => ({ ...obj })));
9
- const [proxy] = React.useState(() => createProxy.createProxy(store));
9
+ const [proxy] = React.useState(() => createProxy.createProxy(store, ["getState", "setState"]));
10
10
  React.useEffect(() => {
11
11
  store.setState((state) => compareStateWithStore.compareStateWithStore(state, obj));
12
12
  }, [obj, store]);
@@ -1,8 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const createProxy = (store) => new Proxy(store, {
3
+ const createProxy = (store, directProperties = []) => new Proxy(store, {
4
4
  get(target, prop) {
5
+ if (directProperties.includes(prop)) {
6
+ return target[prop];
7
+ }
5
8
  return target((state) => state[prop]);
9
+ },
10
+ ownKeys(target) {
11
+ return Reflect.ownKeys(target.getState());
12
+ },
13
+ getOwnPropertyDescriptor(target, prop) {
14
+ return Reflect.getOwnPropertyDescriptor(target.getState(), prop);
6
15
  }
7
16
  });
8
17
  exports.createProxy = createProxy;
@@ -4,7 +4,7 @@ import { createProxy } from "../utils/createProxy.mjs";
4
4
  import { create } from "../../../.external/esm/zustand@5.0.4_@types_react@18.3.21_react@18.3.1/zustand/esm/react.mjs";
5
5
  function useProxy(obj) {
6
6
  const [store] = useState(() => create(() => ({ ...obj })));
7
- const [proxy] = useState(() => createProxy(store));
7
+ const [proxy] = useState(() => createProxy(store, ["getState", "setState"]));
8
8
  useEffect(() => {
9
9
  store.setState((state) => compareStateWithStore(state, obj));
10
10
  }, [obj, store]);
@@ -1,6 +1,15 @@
1
- const createProxy = (store) => new Proxy(store, {
1
+ const createProxy = (store, directProperties = []) => new Proxy(store, {
2
2
  get(target, prop) {
3
+ if (directProperties.includes(prop)) {
4
+ return target[prop];
5
+ }
3
6
  return target((state) => state[prop]);
7
+ },
8
+ ownKeys(target) {
9
+ return Reflect.ownKeys(target.getState());
10
+ },
11
+ getOwnPropertyDescriptor(target, prop) {
12
+ return Reflect.getOwnPropertyDescriptor(target.getState(), prop);
4
13
  }
5
14
  });
6
15
  export {
@@ -1 +1 @@
1
- export function createProxy(store: any): ProxyConstructor;
1
+ export function createProxy(store: any, directProperties?: string[]): ProxyConstructor;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fastapi-rtk",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "private": false,
5
5
  "description": "A React component library for FastAPI in combination with FastAPI React Toolkit backend, built with Mantine, JsonForms, and Zustand.",
6
6
  "license": "MIT",