dn-react-router-toolkit 0.7.8 → 0.7.9

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.
@@ -189,12 +189,21 @@ function CrudForm({
189
189
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "max-w-2xl mx-auto", children: Object.keys(form.columns).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: Object.entries(form.columns).map(
190
190
  ([name, value]) => {
191
191
  function InputComponent() {
192
+ if (value.component) {
193
+ const Component = value.component;
194
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Component, { store: form.store, name });
195
+ }
192
196
  if (value.type === "textarea") {
193
197
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
194
198
  StoreTextEditor,
195
199
  {
196
200
  store: form.store,
197
- name
201
+ name,
202
+ editor: {
203
+ attributes: {
204
+ class: "text-editor-form"
205
+ }
206
+ }
198
207
  }
199
208
  );
200
209
  }
@@ -170,12 +170,21 @@ function CrudForm({
170
170
  /* @__PURE__ */ jsx6("div", { className: "max-w-2xl mx-auto", children: Object.keys(form.columns).length > 0 && /* @__PURE__ */ jsx6(Fragment2, { children: Object.entries(form.columns).map(
171
171
  ([name, value]) => {
172
172
  function InputComponent() {
173
+ if (value.component) {
174
+ const Component = value.component;
175
+ return /* @__PURE__ */ jsx6(Component, { store: form.store, name });
176
+ }
173
177
  if (value.type === "textarea") {
174
178
  return /* @__PURE__ */ jsx6(
175
179
  StoreTextEditor,
176
180
  {
177
181
  store: form.store,
178
- name
182
+ name,
183
+ editor: {
184
+ attributes: {
185
+ class: "text-editor-form"
186
+ }
187
+ }
179
188
  }
180
189
  );
181
190
  }
@@ -9,7 +9,7 @@ type FormColumnValue<TModel> = {
9
9
  defaultValue?: TModel[keyof TModel];
10
10
  component?: FC<{
11
11
  store: Store<TModel>;
12
- property: string;
12
+ name: string;
13
13
  }>;
14
14
  options?: FC;
15
15
  };
@@ -9,7 +9,7 @@ type FormColumnValue<TModel> = {
9
9
  defaultValue?: TModel[keyof TModel];
10
10
  component?: FC<{
11
11
  store: Store<TModel>;
12
- property: string;
12
+ name: string;
13
13
  }>;
14
14
  options?: FC;
15
15
  };
@@ -1,4 +1,4 @@
1
- import { LoaderFunction, LoaderFunctionArgs } from 'react-router';
1
+ import { LoaderFunctionArgs, LoaderFunction } from 'react-router';
2
2
  import { TableLoaderOptions } from '../table/loader.mjs';
3
3
  import { TableItemLoaderOptions } from '../table/item_loader.mjs';
4
4
  import { Table } from 'drizzle-orm';
@@ -1,4 +1,4 @@
1
- import { LoaderFunction, LoaderFunctionArgs } from 'react-router';
1
+ import { LoaderFunctionArgs, LoaderFunction } from 'react-router';
2
2
  import { TableLoaderOptions } from '../table/loader.js';
3
3
  import { TableItemLoaderOptions } from '../table/item_loader.js';
4
4
  import { Table } from 'drizzle-orm';
@@ -589,12 +589,21 @@ function CrudForm({
589
589
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "max-w-2xl mx-auto", children: Object.keys(form.columns).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children: Object.entries(form.columns).map(
590
590
  ([name, value]) => {
591
591
  function InputComponent() {
592
+ if (value.component) {
593
+ const Component = value.component;
594
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Component, { store: form.store, name });
595
+ }
592
596
  if (value.type === "textarea") {
593
597
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
594
598
  StoreTextEditor,
595
599
  {
596
600
  store: form.store,
597
- name
601
+ name,
602
+ editor: {
603
+ attributes: {
604
+ class: "text-editor-form"
605
+ }
606
+ }
598
607
  }
599
608
  );
600
609
  }
@@ -578,12 +578,21 @@ function CrudForm({
578
578
  /* @__PURE__ */ jsx9("div", { className: "max-w-2xl mx-auto", children: Object.keys(form.columns).length > 0 && /* @__PURE__ */ jsx9(Fragment5, { children: Object.entries(form.columns).map(
579
579
  ([name, value]) => {
580
580
  function InputComponent() {
581
+ if (value.component) {
582
+ const Component = value.component;
583
+ return /* @__PURE__ */ jsx9(Component, { store: form.store, name });
584
+ }
581
585
  if (value.type === "textarea") {
582
586
  return /* @__PURE__ */ jsx9(
583
587
  StoreTextEditor,
584
588
  {
585
589
  store: form.store,
586
- name
590
+ name,
591
+ editor: {
592
+ attributes: {
593
+ class: "text-editor-form"
594
+ }
595
+ }
587
596
  }
588
597
  );
589
598
  }
@@ -7943,12 +7943,21 @@ function CrudForm({
7943
7943
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "max-w-2xl mx-auto", children: Object.keys(form.columns).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: Object.entries(form.columns).map(
7944
7944
  ([name, value]) => {
7945
7945
  function InputComponent() {
7946
+ if (value.component) {
7947
+ const Component = value.component;
7948
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Component, { store: form.store, name });
7949
+ }
7946
7950
  if (value.type === "textarea") {
7947
7951
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
7948
7952
  StoreTextEditor,
7949
7953
  {
7950
7954
  store: form.store,
7951
- name
7955
+ name,
7956
+ editor: {
7957
+ attributes: {
7958
+ class: "text-editor-form"
7959
+ }
7960
+ }
7952
7961
  }
7953
7962
  );
7954
7963
  }
@@ -7929,12 +7929,21 @@ function CrudForm({
7929
7929
  /* @__PURE__ */ jsx6("div", { className: "max-w-2xl mx-auto", children: Object.keys(form.columns).length > 0 && /* @__PURE__ */ jsx6(Fragment2, { children: Object.entries(form.columns).map(
7930
7930
  ([name, value]) => {
7931
7931
  function InputComponent() {
7932
+ if (value.component) {
7933
+ const Component = value.component;
7934
+ return /* @__PURE__ */ jsx6(Component, { store: form.store, name });
7935
+ }
7932
7936
  if (value.type === "textarea") {
7933
7937
  return /* @__PURE__ */ jsx6(
7934
7938
  StoreTextEditor,
7935
7939
  {
7936
7940
  store: form.store,
7937
- name
7941
+ name,
7942
+ editor: {
7943
+ attributes: {
7944
+ class: "text-editor-form"
7945
+ }
7946
+ }
7938
7947
  }
7939
7948
  );
7940
7949
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dn-react-router-toolkit",
3
- "version": "0.7.8",
3
+ "version": "0.7.9",
4
4
  "types": "./dist/index.d.ts",
5
5
  "main": "./dist/index.mjs",
6
6
  "module": "./dist/index.js",