@tulip-systems/core 0.5.7 → 0.5.8
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/components/common/icons.d.mts +52 -52
- package/dist/components/common/status.d.mts +3 -3
- package/dist/components/editor/components/content.client.d.mts +2 -2
- package/dist/components/editor/components/editor.client.d.mts +5 -5
- package/dist/components/editor/components/editor.client.d.mts.map +1 -1
- package/dist/components/editor/components/menu.client.d.mts +3 -3
- package/dist/components/editor/lib/constants.d.mts +27 -27
- package/dist/components/header/back-button.client.d.mts +2 -2
- package/dist/components/header/bottom-bar.client.d.mts +3 -3
- package/dist/components/header/breadcrumbs.client.d.mts +7 -7
- package/dist/components/header/header.client.d.mts +2 -2
- package/dist/components/header/header.client.d.mts.map +1 -1
- package/dist/components/header/mobile-nav-switcher.client.d.mts +2 -2
- package/dist/components/header/mobile-nav-switcher.client.d.mts.map +1 -1
- package/dist/components/header/top-bar.client.d.mts +4 -4
- package/dist/components/header/top-bar.client.d.mts.map +1 -1
- package/dist/components/layouts/admin-content.client.d.mts +2 -2
- package/dist/components/layouts/admin-content.client.d.mts.map +1 -1
- package/dist/components/layouts/admin-layout.d.mts +2 -2
- package/dist/components/layouts/admin-loading.d.mts +2 -2
- package/dist/components/layouts/empty-page.d.mts +4 -4
- package/dist/components/layouts/error-page.d.mts +3 -3
- package/dist/components/layouts/list-layout.d.mts +2 -2
- package/dist/components/layouts/not-allowed-page.d.mts +2 -2
- package/dist/components/layouts/not-found-page.d.mts +3 -3
- package/dist/components/layouts/providers.client.d.mts +2 -2
- package/dist/components/layouts/providers.client.d.mts.map +1 -1
- package/dist/components/layouts/root-layout.server.d.mts +2 -2
- package/dist/components/layouts/root-loading.d.mts +2 -2
- package/dist/components/layouts/tab-layout.d.mts +2 -2
- package/dist/components/lists/data-list.d.mts +5 -5
- package/dist/components/lists/data-stack.d.mts +8 -8
- package/dist/components/navigation/admin-sidebar-paths.client.d.mts +10 -10
- package/dist/components/ui/accordion.d.mts +5 -5
- package/dist/components/ui/alert-dialog.d.mts +12 -12
- package/dist/components/ui/alert.d.mts +4 -4
- package/dist/components/ui/aspect-ratio.d.mts +2 -2
- package/dist/components/ui/avatar.client.d.mts +4 -4
- package/dist/components/ui/badge.d.mts +2 -2
- package/dist/components/ui/breadcrumb.d.mts +8 -8
- package/dist/components/ui/button.d.mts +3 -3
- package/dist/components/ui/calendar.d.mts +3 -3
- package/dist/components/ui/card.d.mts +7 -7
- package/dist/components/ui/carousel.d.mts +6 -6
- package/dist/components/ui/chart.client.d.mts +5 -5
- package/dist/components/ui/checkbox.d.mts +2 -2
- package/dist/components/ui/collapsible.client.d.mts +4 -4
- package/dist/components/ui/color-picker.client.d.mts +2 -2
- package/dist/components/ui/combobox-dropdown.client.d.mts +2 -2
- package/dist/components/ui/combobox.client.d.mts +2 -2
- package/dist/components/ui/command.d.mts +10 -10
- package/dist/components/ui/context-menu.d.mts +16 -16
- package/dist/components/ui/date-picker.client.d.mts +2 -2
- package/dist/components/ui/dialog.client.d.mts +11 -11
- package/dist/components/ui/drawer.client.d.mts +11 -11
- package/dist/components/ui/dropdown-menu.d.mts +18 -18
- package/dist/components/ui/dropdown-menu.d.mts.map +1 -1
- package/dist/components/ui/dropdown-menu.mjs +2 -2
- package/dist/components/ui/dropdown-menu.mjs.map +1 -1
- package/dist/components/ui/form.client.d.mts +7 -7
- package/dist/components/ui/hover-card.client.d.mts +4 -4
- package/dist/components/ui/input-recipient.d.mts +2 -2
- package/dist/components/ui/input.d.mts +2 -2
- package/dist/components/ui/label.d.mts +2 -2
- package/dist/components/ui/navigation-menu.d.mts +9 -9
- package/dist/components/ui/pagination.d.mts +8 -8
- package/dist/components/ui/popover.d.mts +5 -5
- package/dist/components/ui/progress.client.d.mts +2 -2
- package/dist/components/ui/radio-group.d.mts +3 -3
- package/dist/components/ui/resizable.client.d.mts +4 -4
- package/dist/components/ui/scroll-area.d.mts +3 -3
- package/dist/components/ui/select.client.d.mts +11 -11
- package/dist/components/ui/separator.d.mts +2 -2
- package/dist/components/ui/sheet.client.d.mts +9 -9
- package/dist/components/ui/sidebar.client.d.mts +26 -26
- package/dist/components/ui/skeleton.d.mts +2 -2
- package/dist/components/ui/slider.d.mts +2 -2
- package/dist/components/ui/sonner.client.d.mts +2 -2
- package/dist/components/ui/switch.d.mts +2 -2
- package/dist/components/ui/tabs.d.mts +5 -5
- package/dist/components/ui/textarea.d.mts +2 -2
- package/dist/components/ui/time-input.client.d.mts +2 -2
- package/dist/components/ui/toggle-group.client.d.mts +3 -3
- package/dist/components/ui/toggle.d.mts +4 -4
- package/dist/components/ui/toggle.d.mts.map +1 -1
- package/dist/components/ui/tooltip.client.d.mts +5 -5
- package/dist/components/ui/tooltip.client.d.mts.map +1 -1
- package/dist/data-tables/client.d.mts +2 -6
- package/dist/data-tables/client.mjs +2 -6
- package/dist/lib/hooks/use-action.d.mts +2 -2
- package/dist/lib/hooks/use-indicator.d.mts +2 -2
- package/dist/modules/auth/components/allowed.client.d.mts +2 -2
- package/dist/modules/auth/components/auth-layout.server.d.mts +2 -2
- package/dist/modules/auth/components/auth-loading.d.mts +2 -2
- package/dist/modules/auth/components/create-first-user-page.client.d.mts +2 -2
- package/dist/modules/auth/components/forget-password-page.client.d.mts +2 -2
- package/dist/modules/auth/components/guard-first-user.server.d.mts +2 -2
- package/dist/modules/auth/components/guard.server.d.mts +2 -2
- package/dist/modules/auth/components/login-page.client.d.mts +2 -2
- package/dist/modules/auth/components/reset-password-page.client.d.mts +2 -2
- package/dist/modules/auth/components/update-password-command.d.mts +2 -2
- package/dist/modules/auth/handler/client.client.d.mts +143 -143
- package/dist/modules/auth/handler/client.client.d.mts.map +1 -1
- package/dist/modules/auth/handler/init.d.mts +131 -131
- package/dist/modules/auth/handler/init.d.mts.map +1 -1
- package/dist/modules/auth/hooks/use-permission.d.mts +3 -3
- package/dist/modules/auth/hooks/use-session.d.mts +4 -4
- package/dist/modules/auth/lib/helpers.server.d.mts +2 -2
- package/dist/modules/auth/lib/helpers.server.d.mts.map +1 -1
- package/dist/modules/auth/lib/validators.d.mts +2 -2
- package/dist/modules/auth/lib/validators.d.mts.map +1 -1
- package/dist/modules/commands/components/alert-dialog-command.client.d.mts +10 -10
- package/dist/modules/commands/components/alert-dialog-command.client.d.mts.map +1 -1
- package/dist/modules/commands/components/click-command.client.d.mts +2 -2
- package/dist/modules/commands/components/click-command.client.d.mts.map +1 -1
- package/dist/modules/commands/components/command-trigger.client.d.mts +4 -4
- package/dist/modules/commands/components/command-trigger.client.d.mts.map +1 -1
- package/dist/modules/commands/components/dialog-command.client.d.mts +8 -8
- package/dist/modules/commands/components/dropdown-command.client.d.mts +5 -5
- package/dist/modules/commands/components/dropdown-command.client.d.mts.map +1 -1
- package/dist/modules/commands/components/empty-command.client.d.mts +2 -2
- package/dist/modules/commands/components/form-dialog-command.client.d.mts +11 -11
- package/dist/modules/commands/menus/context-menu.client.d.mts +2 -2
- package/dist/modules/commands/menus/dropdown-menu.client.d.mts +3 -3
- package/dist/modules/commands/menus/inline-menu.client.d.mts +3 -3
- package/dist/modules/commands/menus/responsive-menu.client.d.mts +3 -3
- package/dist/modules/commands/utils/archive-command.client.d.mts +3 -3
- package/dist/modules/commands/utils/delete-command.client.d.mts +3 -3
- package/dist/modules/data-tables/components/cell/common.client.d.mts +5 -5
- package/dist/modules/data-tables/components/cell/common.client.d.mts.map +1 -1
- package/dist/modules/data-tables/components/column-header.d.mts +2 -2
- package/dist/modules/data-tables/components/filters/combobox.client.d.mts +2 -2
- package/dist/modules/data-tables/components/filters/combobox.client.d.mts.map +1 -1
- package/dist/modules/data-tables/components/filters/slider.client.d.mts +2 -2
- package/dist/modules/data-tables/components/filters/slider.client.d.mts.map +1 -1
- package/dist/modules/data-tables/components/header.d.mts +4 -4
- package/dist/modules/data-tables/components/layout.d.mts +2 -2
- package/dist/modules/data-tables/components/search-input.client.d.mts +2 -2
- package/dist/modules/data-tables/components/search-input.client.d.mts.map +1 -1
- package/dist/modules/data-tables/components/skeleton.d.mts +2 -2
- package/dist/modules/data-tables/components/table.d.mts +7 -7
- package/dist/modules/data-tables/components/toolbar.d.mts +3 -3
- package/dist/modules/data-tables/hooks/use-context.client.d.mts +2 -2
- package/dist/modules/data-tables/hooks/use-context.client.d.mts.map +1 -1
- package/dist/modules/data-tables/tables/data-table/components/table.d.mts +2 -2
- package/dist/modules/data-tables/tables/data-table/components/table.d.mts.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/common.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/cells/common.d.mts.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.d.mts.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/{inputs → cells}/read-only.d.mts +3 -3
- package/dist/modules/data-tables/tables/inline-table/components/cells/read-only.d.mts.map +1 -0
- package/dist/modules/data-tables/tables/inline-table/components/{inputs → cells}/read-only.mjs +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/read-only.mjs.map +1 -0
- package/dist/modules/data-tables/tables/inline-table/components/table.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/table.d.mts.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/table.mjs +1 -1
- package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/combobox-dropdown.client.d.mts +2 -2
- package/dist/modules/inline-edit/components/combobox.client.d.mts +2 -2
- package/dist/modules/inline-edit/components/date-input.client.d.mts +2 -2
- package/dist/modules/inline-edit/components/date-picker.client.d.mts +2 -2
- package/dist/modules/inline-edit/components/editor.client.d.mts +2 -2
- package/dist/modules/inline-edit/components/input-recipient.client.d.mts +2 -2
- package/dist/modules/inline-edit/components/input-toggle.client.d.mts +2 -2
- package/dist/modules/inline-edit/components/input.client.d.mts +4 -4
- package/dist/modules/inline-edit/components/select.client.d.mts +6 -6
- package/dist/modules/inline-edit/components/switch.client.d.mts +2 -2
- package/dist/modules/inline-edit/components/toggle.client.d.mts +2 -2
- package/dist/modules/inline-edit/hooks/context.client.d.mts +2 -2
- package/dist/modules/inline-edit/lib/variants.d.mts +2 -2
- package/dist/modules/router/handler/init.server.d.mts +6 -6
- package/dist/modules/router/handler/init.server.d.mts.map +1 -1
- package/dist/modules/router/lib/query-client.server.d.mts +2 -2
- package/dist/modules/router/lib/query-client.server.d.mts.map +1 -1
- package/dist/modules/storage/components/dropzone-context.client.d.mts +2 -2
- package/dist/modules/storage/components/dropzone-context.client.d.mts.map +1 -1
- package/dist/modules/storage/components/dropzone.client.d.mts +5 -5
- package/dist/modules/storage/components/dropzone.client.d.mts.map +1 -1
- package/dist/modules/storage/components/image-grid.client.d.mts +3 -3
- package/dist/modules/storage/components/image-grid.client.d.mts.map +1 -1
- package/dist/modules/storage/components/upload-zone.client.d.mts +2 -2
- package/dist/modules/storage/components/upload-zone.client.d.mts.map +1 -1
- package/dist/modules/storage/lib/router.server.d.mts +2344 -2344
- package/dist/modules/storage/lib/router.server.d.mts.map +1 -1
- package/dist/modules/storage/lib/schema.d.mts +92 -92
- package/dist/modules/storage/lib/schema.d.mts.map +1 -1
- package/dist/modules/storage/lib/service.server.d.mts +15 -15
- package/dist/modules/storage/lib/service.server.mjs +1 -1
- package/dist/modules/storage/lib/service.server.mjs.map +1 -1
- package/dist/modules/storage/lib/validators.d.mts +88 -88
- package/dist/modules/storage/lib/validators.d.mts.map +1 -1
- package/package.json +1 -1
- package/src/modules/data-tables/entry.client.ts +1 -5
- package/src/modules/storage/lib/service.server.ts +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/inputs/advanced-select.client.d.mts +0 -29
- package/dist/modules/data-tables/tables/inline-table/components/inputs/advanced-select.client.d.mts.map +0 -1
- package/dist/modules/data-tables/tables/inline-table/components/inputs/advanced-select.client.mjs +0 -52
- package/dist/modules/data-tables/tables/inline-table/components/inputs/advanced-select.client.mjs.map +0 -1
- package/dist/modules/data-tables/tables/inline-table/components/inputs/combobox.client.d.mts +0 -27
- package/dist/modules/data-tables/tables/inline-table/components/inputs/combobox.client.d.mts.map +0 -1
- package/dist/modules/data-tables/tables/inline-table/components/inputs/combobox.client.mjs +0 -29
- package/dist/modules/data-tables/tables/inline-table/components/inputs/combobox.client.mjs.map +0 -1
- package/dist/modules/data-tables/tables/inline-table/components/inputs/input.client.d.mts +0 -39
- package/dist/modules/data-tables/tables/inline-table/components/inputs/input.client.d.mts.map +0 -1
- package/dist/modules/data-tables/tables/inline-table/components/inputs/input.client.mjs +0 -71
- package/dist/modules/data-tables/tables/inline-table/components/inputs/input.client.mjs.map +0 -1
- package/dist/modules/data-tables/tables/inline-table/components/inputs/read-only.d.mts.map +0 -1
- package/dist/modules/data-tables/tables/inline-table/components/inputs/read-only.mjs.map +0 -1
- package/dist/modules/data-tables/tables/inline-table/components/inputs/select.client.d.mts +0 -33
- package/dist/modules/data-tables/tables/inline-table/components/inputs/select.client.d.mts.map +0 -1
- package/dist/modules/data-tables/tables/inline-table/components/inputs/select.client.mjs +0 -52
- package/dist/modules/data-tables/tables/inline-table/components/inputs/select.client.mjs.map +0 -1
- package/dist/modules/data-tables/tables/inline-table/hooks/use-input.client.d.mts +0 -17
- package/dist/modules/data-tables/tables/inline-table/hooks/use-input.client.d.mts.map +0 -1
- package/dist/modules/data-tables/tables/inline-table/hooks/use-input.client.mjs +0 -53
- package/dist/modules/data-tables/tables/inline-table/hooks/use-input.client.mjs.map +0 -1
- package/src/modules/data-tables/tables/inline-table/components/inputs/advanced-select.client.tsx +0 -90
- package/src/modules/data-tables/tables/inline-table/components/inputs/combobox.client.tsx +0 -109
- package/src/modules/data-tables/tables/inline-table/components/inputs/input.client.tsx +0 -108
- package/src/modules/data-tables/tables/inline-table/components/inputs/select.client.tsx +0 -102
- package/src/modules/data-tables/tables/inline-table/hooks/use-input.client.ts +0 -65
- /package/src/modules/data-tables/tables/inline-table/components/{inputs → cells}/read-only.tsx +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.d.mts","names":[],"sources":["../../../../src/modules/storage/lib/validators.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;KAYY,IAAA,UAAc,KAAA,CAAM;AAApB,KACA,QAAA,GADI,OACc,KAAA,CAAM,YADQ,GAAA;EAChC,IAAA,EAAA,MAAQ;AACpB,CAAA;AAKa,KALD,UAAA,GAKiD,OAL7B,KAAA,CAAM,YAKX,GAAA;EACf,IAAA,EAAA,QAAQ;AAKpB,CAAA;;;;cANa,gBAAc,GAAA,CAAA;;;;KACf,QAAA,GAAW,GAAA,CAAE,aAAa;;;;cAKzB,+BAAgB;QAE3B,
|
|
1
|
+
{"version":3,"file":"validators.d.mts","names":[],"sources":["../../../../src/modules/storage/lib/validators.ts"],"sourcesContent":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -19,11 +19,7 @@ export * from "./hooks/use-table.client";
|
|
|
19
19
|
* Inline tables
|
|
20
20
|
*/
|
|
21
21
|
export * from "./tables/inline-table/components/cells/common";
|
|
22
|
-
export * from "./tables/inline-table/components/
|
|
23
|
-
export * from "./tables/inline-table/components/inputs/combobox.client";
|
|
24
|
-
export * from "./tables/inline-table/components/inputs/input.client";
|
|
25
|
-
export * from "./tables/inline-table/components/inputs/read-only";
|
|
26
|
-
export * from "./tables/inline-table/components/inputs/select.client";
|
|
22
|
+
export * from "./tables/inline-table/components/cells/read-only";
|
|
27
23
|
export * from "./tables/inline-table/components/table";
|
|
28
24
|
export * from "./tables/inline-table/hooks/context.client";
|
|
29
25
|
|
|
@@ -225,7 +225,7 @@ export class StorageService<TSchema extends TDatabaseSchema> {
|
|
|
225
225
|
* Upload file to S3 and add it to the database
|
|
226
226
|
**/
|
|
227
227
|
async uploadFile(input: UploadFileSchema & Pick<PutObjectInput, "body">) {
|
|
228
|
-
const id = generateDefaultUUID();
|
|
228
|
+
const id = input.id ?? generateDefaultUUID();
|
|
229
229
|
|
|
230
230
|
return await this.#db.transaction(async (tx) => {
|
|
231
231
|
const [result] = await tx
|
package/dist/modules/data-tables/tables/inline-table/components/inputs/advanced-select.client.d.mts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { UseInlineDataTableInputParams } from "../../hooks/use-input.client.mjs";
|
|
2
|
-
import * as react_jsx_runtime11 from "react/jsx-runtime";
|
|
3
|
-
|
|
4
|
-
//#region src/modules/data-tables/tables/inline-table/components/inputs/advanced-select.client.d.ts
|
|
5
|
-
type AdvancedSelectItem = {
|
|
6
|
-
id: string;
|
|
7
|
-
label: string;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
};
|
|
10
|
-
type InlineDataTableAdvancedSelectProps<TData, TValue> = UseInlineDataTableInputParams<TData, TValue> & {
|
|
11
|
-
options: AdvancedSelectItem[];
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
className?: string;
|
|
14
|
-
autoSelect?: boolean;
|
|
15
|
-
};
|
|
16
|
-
declare function InlineDataTableAdvancedSelect<TData extends {
|
|
17
|
-
id: string;
|
|
18
|
-
}, TValue>({
|
|
19
|
-
context,
|
|
20
|
-
action,
|
|
21
|
-
permission,
|
|
22
|
-
options,
|
|
23
|
-
disabled,
|
|
24
|
-
autoSelect,
|
|
25
|
-
className
|
|
26
|
-
}: InlineDataTableAdvancedSelectProps<TData, TValue>): react_jsx_runtime11.JSX.Element;
|
|
27
|
-
//#endregion
|
|
28
|
-
export { AdvancedSelectItem, InlineDataTableAdvancedSelect, InlineDataTableAdvancedSelectProps };
|
|
29
|
-
//# sourceMappingURL=advanced-select.client.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"advanced-select.client.d.mts","names":[],"sources":["../../../../../../../src/modules/data-tables/tables/inline-table/components/inputs/advanced-select.client.tsx"],"sourcesContent":[],"mappings":";;;;KAgBY,kBAAA;;;EAAA,QAAA,CAAA,EAAA,OAAA;AAMZ,CAAA;AACE,KADU,kCACV,CAAA,KAAA,EAAA,MAAA,CAAA,GAD8D,6BAC9D,CAAA,KAAA,EACA,MADA,CAAA,GAAA;EACA,OAAA,EAES,kBAFT,EAAA;EAF8D,QAAA,CAAA,EAAA,OAAA;EAIrD,SAAA,CAAA,EAAA,MAAA;EAAkB,UAAA,CAAA,EAAA,OAAA;AAM7B,CAAA;AACE,iBADc,6BACd,CAAA,cAAA;EACA,EAAA,EAAA,MAAA;CACA,EAAA,MAAA,CAAA,CAAA;EAAA,OAAA;EAAA,MAAA;EAAA,UAAA;EAAA,OAAA;EAAA,QAAA;EAAA,UAAA;EAAA;AAAA,CAAA,EAKC,kCALD,CAKoC,KALpC,EAK2C,MAL3C,CAAA,CAAA,EAKkD,mBAAA,CAAA,GAAA,CAAA,OALlD"}
|
package/dist/modules/data-tables/tables/inline-table/components/inputs/advanced-select.client.mjs
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { Icons } from "../../../../../../components/common/icons.mjs";
|
|
4
|
-
import { cn } from "../../../../../../lib/utils/cn.mjs";
|
|
5
|
-
import { DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../../../../../../components/ui/dropdown-menu.mjs";
|
|
6
|
-
import { useInlineTableContext } from "../../hooks/context.client.mjs";
|
|
7
|
-
import { useInlineDataTableInput } from "../../hooks/use-input.client.mjs";
|
|
8
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
import { DropdownMenu } from "@radix-ui/react-dropdown-menu";
|
|
10
|
-
|
|
11
|
-
//#region src/modules/data-tables/tables/inline-table/components/inputs/advanced-select.client.tsx
|
|
12
|
-
function InlineDataTableAdvancedSelect({ context, action, permission, options, disabled, autoSelect, className }) {
|
|
13
|
-
const { disabledColumns } = useInlineTableContext();
|
|
14
|
-
const { value, setValue, isAllowed } = useInlineDataTableInput({
|
|
15
|
-
context,
|
|
16
|
-
action,
|
|
17
|
-
permission
|
|
18
|
-
});
|
|
19
|
-
const isDisabled = disabled || disabledColumns?.[context.column.id] || !isAllowed;
|
|
20
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
21
|
-
className: "flex h-full",
|
|
22
|
-
children: [/* @__PURE__ */ jsx("input", {
|
|
23
|
-
type: "text",
|
|
24
|
-
value: value ?? "",
|
|
25
|
-
"data-input": true,
|
|
26
|
-
disabled: isDisabled,
|
|
27
|
-
onFocus: (e) => {
|
|
28
|
-
if (autoSelect) e.target.select();
|
|
29
|
-
},
|
|
30
|
-
onChange: (e) => {
|
|
31
|
-
setValue(e.target.value);
|
|
32
|
-
},
|
|
33
|
-
className: cn("h- placeholder:text-primary-foreground read-only:bg-muted/50 flex w-full bg-transparent px-3 py-0.5 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50", className)
|
|
34
|
-
}), /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
35
|
-
disabled: isDisabled,
|
|
36
|
-
className: "bg-muted/30 flex aspect-square h-full items-center justify-center rounded-none border-none outline-none ring-0 focus:border-0 focus:outline-none focus:ring-0 focus:ring-offset-0 focus-visible:outline-none",
|
|
37
|
-
children: /* @__PURE__ */ jsx(Icons.chevronDown, { className: "size-4 opacity-50" })
|
|
38
|
-
}), /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
39
|
-
className: "w-56",
|
|
40
|
-
children: options.map((item) => /* @__PURE__ */ jsx(DropdownMenuItem, {
|
|
41
|
-
disabled: item.disabled,
|
|
42
|
-
className: "cursor-pointer",
|
|
43
|
-
onSelect: () => setValue(item.id),
|
|
44
|
-
children: item.label
|
|
45
|
-
}, item.id))
|
|
46
|
-
})] })]
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
//#endregion
|
|
51
|
-
export { InlineDataTableAdvancedSelect };
|
|
52
|
-
//# sourceMappingURL=advanced-select.client.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"advanced-select.client.mjs","names":[],"sources":["../../../../../../../src/modules/data-tables/tables/inline-table/components/inputs/advanced-select.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Icons } from \"@/components/common/icons\";\nimport {\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { DropdownMenu } from \"@radix-ui/react-dropdown-menu\";\nimport { useInlineTableContext } from \"../../hooks/context.client\";\nimport {\n useInlineDataTableInput,\n UseInlineDataTableInputParams,\n} from \"../../hooks/use-input.client\";\n\nexport type AdvancedSelectItem = {\n id: string;\n label: string;\n disabled?: boolean;\n};\n\nexport type InlineDataTableAdvancedSelectProps<TData, TValue> = UseInlineDataTableInputParams<\n TData,\n TValue\n> & {\n options: AdvancedSelectItem[];\n disabled?: boolean;\n className?: string;\n autoSelect?: boolean;\n};\n\nexport function InlineDataTableAdvancedSelect<TData extends { id: string }, TValue>({\n context,\n action,\n permission,\n options,\n disabled,\n autoSelect,\n className,\n}: InlineDataTableAdvancedSelectProps<TData, TValue>) {\n const { disabledColumns } = useInlineTableContext();\n\n const { value, setValue, isAllowed } = useInlineDataTableInput({ context, action, permission });\n\n const isDisabled = disabled || disabledColumns?.[context.column.id] || !isAllowed;\n\n return (\n <div className=\"flex h-full\">\n <input\n type=\"text\"\n value={(value as string) ?? \"\"}\n data-input\n disabled={isDisabled}\n onFocus={(e) => {\n if (autoSelect) e.target.select();\n }}\n onChange={(e) => {\n setValue(e.target.value as TValue);\n }}\n className={cn(\n \"h- placeholder:text-primary-foreground read-only:bg-muted/50 flex w-full bg-transparent px-3 py-0.5 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n />\n\n <DropdownMenu>\n <DropdownMenuTrigger\n disabled={isDisabled}\n className=\"bg-muted/30 flex aspect-square h-full items-center justify-center rounded-none border-none outline-none ring-0 focus:border-0 focus:outline-none focus:ring-0 focus:ring-offset-0 focus-visible:outline-none\"\n >\n <Icons.chevronDown className=\"size-4 opacity-50\" />\n </DropdownMenuTrigger>\n\n <DropdownMenuContent className=\"w-56\">\n {options.map((item) => (\n <DropdownMenuItem\n disabled={item.disabled}\n className=\"cursor-pointer\"\n key={item.id}\n onSelect={() => setValue(item.id as TValue)}\n >\n {item.label}\n </DropdownMenuItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAgCA,SAAgB,8BAAoE,EAClF,SACA,QACA,YACA,SACA,UACA,YACA,aACoD;CACpD,MAAM,EAAE,oBAAoB,uBAAuB;CAEnD,MAAM,EAAE,OAAO,UAAU,cAAc,wBAAwB;EAAE;EAAS;EAAQ;EAAY,CAAC;CAE/F,MAAM,aAAa,YAAY,kBAAkB,QAAQ,OAAO,OAAO,CAAC;AAExE,QACE,qBAAC;EAAI,WAAU;aACb,oBAAC;GACC,MAAK;GACL,OAAQ,SAAoB;GAC5B;GACA,UAAU;GACV,UAAU,MAAM;AACd,QAAI,WAAY,GAAE,OAAO,QAAQ;;GAEnC,WAAW,MAAM;AACf,aAAS,EAAE,OAAO,MAAgB;;GAEpC,WAAW,GACT,0PACA,UACD;IACD,EAEF,qBAAC,2BACC,oBAAC;GACC,UAAU;GACV,WAAU;aAEV,oBAAC,MAAM,eAAY,WAAU,sBAAsB;IAC/B,EAEtB,oBAAC;GAAoB,WAAU;aAC5B,QAAQ,KAAK,SACZ,oBAAC;IACC,UAAU,KAAK;IACf,WAAU;IAEV,gBAAgB,SAAS,KAAK,GAAa;cAE1C,KAAK;MAHD,KAAK,GAIO,CACnB;IACkB,IACT;GACX"}
|
package/dist/modules/data-tables/tables/inline-table/components/inputs/combobox.client.d.mts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { UseInlineDataTableInputParams } from "../../hooks/use-input.client.mjs";
|
|
2
|
-
import * as react_jsx_runtime12 from "react/jsx-runtime";
|
|
3
|
-
|
|
4
|
-
//#region src/modules/data-tables/tables/inline-table/components/inputs/combobox.client.d.ts
|
|
5
|
-
type ComboboxItem = {
|
|
6
|
-
id: string;
|
|
7
|
-
label: string;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
};
|
|
10
|
-
type InlineDataTableComboboxProps<TData, TValue> = UseInlineDataTableInputParams<TData, TValue> & {
|
|
11
|
-
options: ComboboxItem[];
|
|
12
|
-
emptyMessage?: string;
|
|
13
|
-
placeholder?: string;
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
};
|
|
16
|
-
declare function InlineDataTableCombobox<TData extends {
|
|
17
|
-
id: string;
|
|
18
|
-
}, TValue>({
|
|
19
|
-
context,
|
|
20
|
-
action,
|
|
21
|
-
permission,
|
|
22
|
-
disabled,
|
|
23
|
-
...props
|
|
24
|
-
}: InlineDataTableComboboxProps<TData, TValue>): react_jsx_runtime12.JSX.Element;
|
|
25
|
-
//#endregion
|
|
26
|
-
export { ComboboxItem, InlineDataTableCombobox };
|
|
27
|
-
//# sourceMappingURL=combobox.client.d.mts.map
|
package/dist/modules/data-tables/tables/inline-table/components/inputs/combobox.client.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.client.d.mts","names":[],"sources":["../../../../../../../src/modules/data-tables/tables/inline-table/components/inputs/combobox.client.tsx"],"sourcesContent":[],"mappings":";;;;KASY,YAAA;;;EAAA,QAAA,CAAA,EAAA,OAAY;AAItB,CAAA;KAEG,4BAA4E,CAAA,KAAA,EAAA,MAAA,CAAA,GAA9B,6BAA8B,CAAA,KAAA,EAAO,MAAP,CAAA,GAAA;EAAO,OAAA,EAC7E,YAD6E,EAAA;EAArC,YAAA,CAAA,EAAA,MAAA;EACxC,WAAA,CAAA,EAAA,MAAA;EAAY,QAAA,CAAA,EAAA,OAAA;AAMvB,CAAA;AACE,iBADc,uBACd,CAAA,cAAA;EACA,EAAA,EAAA,MAAA;CACA,EAAA,MAAA,CAAA,CAAA;EAAA,OAAA;EAAA,MAAA;EAAA,UAAA;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAGC,4BAHD,CAG8B,KAH9B,EAGqC,MAHrC,CAAA,CAAA,EAG4C,mBAAA,CAAA,GAAA,CAAA,OAH5C"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { Combobox } from "../../../../../../components/ui/combobox.client.mjs";
|
|
4
|
-
import { useInlineTableContext } from "../../hooks/context.client.mjs";
|
|
5
|
-
import { useInlineDataTableInput } from "../../hooks/use-input.client.mjs";
|
|
6
|
-
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
|
|
8
|
-
//#region src/modules/data-tables/tables/inline-table/components/inputs/combobox.client.tsx
|
|
9
|
-
function InlineDataTableCombobox({ context, action, permission, disabled, ...props }) {
|
|
10
|
-
const { disabledColumns } = useInlineTableContext();
|
|
11
|
-
const { value, setValue, mutate, isAllowed } = useInlineDataTableInput({
|
|
12
|
-
context,
|
|
13
|
-
action,
|
|
14
|
-
permission
|
|
15
|
-
});
|
|
16
|
-
const isDisabled = disabled || disabledColumns?.[context.column.id] || !isAllowed;
|
|
17
|
-
return /* @__PURE__ */ jsx(Combobox, {
|
|
18
|
-
...props,
|
|
19
|
-
value,
|
|
20
|
-
disabled: isDisabled,
|
|
21
|
-
onSelect: setValue,
|
|
22
|
-
onBlur: (e) => mutate(e.target.value),
|
|
23
|
-
className: "rounded-none border-none shadow-none"
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
export { InlineDataTableCombobox };
|
|
29
|
-
//# sourceMappingURL=combobox.client.mjs.map
|
package/dist/modules/data-tables/tables/inline-table/components/inputs/combobox.client.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.client.mjs","names":[],"sources":["../../../../../../../src/modules/data-tables/tables/inline-table/components/inputs/combobox.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Combobox } from \"@/components/ui/combobox.client\";\nimport { useInlineTableContext } from \"../../hooks/context.client\";\nimport {\n useInlineDataTableInput,\n UseInlineDataTableInputParams,\n} from \"../../hooks/use-input.client\";\n\nexport type ComboboxItem = {\n id: string;\n label: string;\n disabled?: boolean;\n};\n\ntype InlineDataTableComboboxProps<TData, TValue> = UseInlineDataTableInputParams<TData, TValue> & {\n options: ComboboxItem[];\n emptyMessage?: string;\n placeholder?: string;\n disabled?: boolean;\n};\n\nexport function InlineDataTableCombobox<TData extends { id: string }, TValue>({\n context,\n action,\n permission,\n disabled,\n ...props\n}: InlineDataTableComboboxProps<TData, TValue>) {\n const { disabledColumns } = useInlineTableContext();\n\n const { value, setValue, mutate, isAllowed } = useInlineDataTableInput({\n context,\n action,\n permission,\n });\n\n const isDisabled = disabled || disabledColumns?.[context.column.id] || !isAllowed;\n\n return (\n <Combobox\n {...props}\n value={value}\n disabled={isDisabled}\n onSelect={setValue}\n onBlur={(e) => mutate(e.target.value as TValue)}\n className=\"rounded-none border-none shadow-none\"\n />\n );\n\n // return (\n // <Popover open={open} onOpenChange={setOpen}>\n // <Command className=\"text-foreground bg-transparent\">\n // <PopoverAnchor asChild>\n // <CommandPrimitive.Input\n // data-input\n // value={value?.toString() ?? \"\"}\n // placeholder={placeholder}\n // disabled={isDisabled}\n // onValueChange={(value) => setValue(value as TValue)}\n // onKeyDown={(e) => setOpen(e.key !== \"Escape\")}\n // onMouseDown={() => setOpen((open) => !!value || !open)}\n // onBlur={(e) => {\n // setOpen(false);\n // mutate(e.target.value as TValue);\n // }}\n // onFocus={() => setOpen(true)}\n // className=\"read-only:bg-muted/50 h-full w-full bg-transparent px-3 py-0.5 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50\"\n // />\n // </PopoverAnchor>\n\n // {!open && <CommandList aria-hidden=\"true\" className=\"hidden\" />}\n\n // <PopoverContent\n // asChild\n // onOpenAutoFocus={(e) => e.preventDefault()}\n // onInteractOutside={(e) => {\n // if (e.target instanceof Element && e.target.hasAttribute(\"cmdk-input\")) {\n // e.preventDefault();\n // }\n // }}\n // className=\"w-[var(--radix-popover-trigger-width)] p-0\"\n // >\n // <CommandList>\n // {options.length > 0 && (\n // <CommandGroup>\n // {options.map((option) => (\n // <CommandItem\n // key={option.id}\n // value={option.id}\n // onMouseDown={(e) => e.preventDefault()}\n // onSelect={(id) => {\n // setValue(id as TValue);\n // setOpen(false);\n // }}\n // >\n // {option.label}\n // </CommandItem>\n // ))}\n // </CommandGroup>\n // )}\n\n // <CommandEmpty className=\"px-3 py-1\">{emptyMessage}</CommandEmpty>\n // </CommandList>\n // </PopoverContent>\n // </Command>\n // </Popover>\n // );\n}\n"],"mappings":";;;;;;;;AAsBA,SAAgB,wBAA8D,EAC5E,SACA,QACA,YACA,UACA,GAAG,SAC2C;CAC9C,MAAM,EAAE,oBAAoB,uBAAuB;CAEnD,MAAM,EAAE,OAAO,UAAU,QAAQ,cAAc,wBAAwB;EACrE;EACA;EACA;EACD,CAAC;CAEF,MAAM,aAAa,YAAY,kBAAkB,QAAQ,OAAO,OAAO,CAAC;AAExE,QACE,oBAAC;EACC,GAAI;EACG;EACP,UAAU;EACV,UAAU;EACV,SAAS,MAAM,OAAO,EAAE,OAAO,MAAgB;EAC/C,WAAU;GACV"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { Input } from "../../../../../../components/ui/input.mjs";
|
|
2
|
-
import { UseInlineDataTableInputParams } from "../../hooks/use-input.client.mjs";
|
|
3
|
-
import * as react_jsx_runtime13 from "react/jsx-runtime";
|
|
4
|
-
import { ComponentProps } from "react";
|
|
5
|
-
|
|
6
|
-
//#region src/modules/data-tables/tables/inline-table/components/inputs/input.client.d.ts
|
|
7
|
-
type InlineDataTableInputProps<TData, TValue> = Omit<ComponentProps<typeof Input>, "type"> & UseInlineDataTableInputParams<TData, TValue> & {
|
|
8
|
-
autoSelect?: boolean;
|
|
9
|
-
};
|
|
10
|
-
declare function InlineDataTableStringInput<TData extends {
|
|
11
|
-
id: string;
|
|
12
|
-
}, TValue>({
|
|
13
|
-
context,
|
|
14
|
-
action,
|
|
15
|
-
permission,
|
|
16
|
-
onChange,
|
|
17
|
-
onBlur,
|
|
18
|
-
onFocus,
|
|
19
|
-
autoSelect,
|
|
20
|
-
disabled,
|
|
21
|
-
className,
|
|
22
|
-
...props
|
|
23
|
-
}: InlineDataTableInputProps<TData, TValue>): react_jsx_runtime13.JSX.Element;
|
|
24
|
-
declare function InlineDataTableNumberInput<TData extends {
|
|
25
|
-
id: string;
|
|
26
|
-
}, TValue>({
|
|
27
|
-
context,
|
|
28
|
-
action,
|
|
29
|
-
onChange,
|
|
30
|
-
onFocus,
|
|
31
|
-
onBlur,
|
|
32
|
-
autoSelect,
|
|
33
|
-
disabled,
|
|
34
|
-
className,
|
|
35
|
-
...props
|
|
36
|
-
}: InlineDataTableInputProps<TData, TValue>): react_jsx_runtime13.JSX.Element;
|
|
37
|
-
//#endregion
|
|
38
|
-
export { InlineDataTableInputProps, InlineDataTableNumberInput, InlineDataTableStringInput };
|
|
39
|
-
//# sourceMappingURL=input.client.d.mts.map
|
package/dist/modules/data-tables/tables/inline-table/components/inputs/input.client.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input.client.d.mts","names":[],"sources":["../../../../../../../src/modules/data-tables/tables/inline-table/components/inputs/input.client.tsx"],"sourcesContent":[],"mappings":";;;;;;KAWY,2CAA2C,KAAK,sBAAsB,kBAChF,8BAA8B,OAAO;;;AAD3B,iBAGI,0BAHqB,CAAA,cAAA;EAA6C,EAAA,EAAA,MAAA;CAAtB,EAAA,MAAA,CAAA,CAAA;EAAA,OAAA;EAAA,MAAA;EAAA,UAAA;EAAA,QAAA;EAAA,MAAA;EAAA,OAAA;EAAA,UAAA;EAAA,QAAA;EAAA,SAAA;EAAA,GAAA;AAAA,CAAA,EAczD,yBAdyD,CAc/B,KAd+B,EAcxB,MAdwB,CAAA,CAAA,EAcjB,mBAAA,CAAA,GAAA,CAAA,OAdiB;AAAL,iBAqDvC,0BArDuC,CAAA,cAAA;EACvB,EAAA,EAAA,MAAA;CAAO,EAAA,MAAA,CAAA,CAAA;EAAA,OAAA;EAAA,MAAA;EAAA,QAAA;EAAA,OAAA;EAAA,MAAA;EAAA,UAAA;EAAA,QAAA;EAAA,SAAA;EAAA,GAAA;AAAA,CAAA,EA8DpC,yBA9DoC,CA8DV,KA9DU,EA8DH,MA9DG,CAAA,CAAA,EA8DI,mBAAA,CAAA,GAAA,CAAA,OA9DJ"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { cn } from "../../../../../../lib/utils/cn.mjs";
|
|
4
|
-
import { useInlineTableContext } from "../../hooks/context.client.mjs";
|
|
5
|
-
import { useInlineDataTableInput } from "../../hooks/use-input.client.mjs";
|
|
6
|
-
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
import { createElement } from "react";
|
|
8
|
-
|
|
9
|
-
//#region src/modules/data-tables/tables/inline-table/components/inputs/input.client.tsx
|
|
10
|
-
function InlineDataTableStringInput({ context, action, permission, onChange, onBlur, onFocus, autoSelect, disabled, className, ...props }) {
|
|
11
|
-
const { disabledColumns } = useInlineTableContext();
|
|
12
|
-
const { value, setValue, mutate, isAllowed } = useInlineDataTableInput({
|
|
13
|
-
context,
|
|
14
|
-
action,
|
|
15
|
-
permission
|
|
16
|
-
});
|
|
17
|
-
const isDisabled = disabled || disabledColumns?.[context.column.id] || !isAllowed;
|
|
18
|
-
return /* @__PURE__ */ createElement("input", {
|
|
19
|
-
...props,
|
|
20
|
-
key: `${context.row.id}-${context.column.id}`,
|
|
21
|
-
type: "text",
|
|
22
|
-
value,
|
|
23
|
-
"data-input": true,
|
|
24
|
-
disabled: isDisabled,
|
|
25
|
-
onFocus: (e) => {
|
|
26
|
-
if (autoSelect) e.target.select();
|
|
27
|
-
onFocus?.(e);
|
|
28
|
-
},
|
|
29
|
-
onChange: (e) => {
|
|
30
|
-
setValue(e.target.value);
|
|
31
|
-
onChange?.(e);
|
|
32
|
-
},
|
|
33
|
-
onBlur: (e) => {
|
|
34
|
-
mutate(e.target.value);
|
|
35
|
-
onBlur?.(e);
|
|
36
|
-
},
|
|
37
|
-
className: cn("placeholder:text-primary-foreground read-only:bg-muted/50 flex h-full w-full bg-transparent px-3 py-0.5 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50", className)
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
function InlineDataTableNumberInput({ context, action, onChange, onFocus, onBlur, autoSelect, disabled, className, ...props }) {
|
|
41
|
-
const { disabledColumns } = useInlineTableContext();
|
|
42
|
-
const { value, setValue, mutate, isAllowed } = useInlineDataTableInput({
|
|
43
|
-
context,
|
|
44
|
-
action
|
|
45
|
-
});
|
|
46
|
-
const isDisabled = disabled || disabledColumns?.[context.column.id] || !isAllowed;
|
|
47
|
-
return /* @__PURE__ */ jsx("input", {
|
|
48
|
-
...props,
|
|
49
|
-
type: "number",
|
|
50
|
-
value,
|
|
51
|
-
"data-input": true,
|
|
52
|
-
disabled: isDisabled,
|
|
53
|
-
onFocus: (e) => {
|
|
54
|
-
if (autoSelect) e.target.select();
|
|
55
|
-
onFocus?.(e);
|
|
56
|
-
},
|
|
57
|
-
onChange: (e) => {
|
|
58
|
-
setValue(e.target.valueAsNumber);
|
|
59
|
-
onChange?.(e);
|
|
60
|
-
},
|
|
61
|
-
onBlur: (e) => {
|
|
62
|
-
mutate(e.target.value);
|
|
63
|
-
onBlur?.(e);
|
|
64
|
-
},
|
|
65
|
-
className: cn("placeholder:text-primary-foreground read-only:bg-muted/50 flex h-full w-full bg-transparent px-3 py-0.5 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50", "[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none", className)
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
//#endregion
|
|
70
|
-
export { InlineDataTableNumberInput, InlineDataTableStringInput };
|
|
71
|
-
//# sourceMappingURL=input.client.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input.client.mjs","names":[],"sources":["../../../../../../../src/modules/data-tables/tables/inline-table/components/inputs/input.client.tsx"],"sourcesContent":["\"use client\";\n\nimport type { Input } from \"@/components/ui/input\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { ComponentProps } from \"react\";\nimport { useInlineTableContext } from \"../../hooks/context.client\";\nimport {\n useInlineDataTableInput,\n UseInlineDataTableInputParams,\n} from \"../../hooks/use-input.client\";\n\nexport type InlineDataTableInputProps<TData, TValue> = Omit<ComponentProps<typeof Input>, \"type\"> &\n UseInlineDataTableInputParams<TData, TValue> & { autoSelect?: boolean };\n\nexport function InlineDataTableStringInput<TData extends { id: string }, TValue>({\n context,\n action,\n permission,\n onChange,\n onBlur,\n onFocus,\n autoSelect,\n disabled,\n className,\n ...props\n}: InlineDataTableInputProps<TData, TValue>) {\n const { disabledColumns } = useInlineTableContext();\n\n const { value, setValue, mutate, isAllowed } = useInlineDataTableInput({\n context,\n action,\n permission,\n });\n\n const isDisabled = disabled || disabledColumns?.[context.column.id] || !isAllowed;\n\n return (\n <input\n {...props}\n key={`${context.row.id}-${context.column.id}`}\n type=\"text\"\n value={value as string}\n data-input\n disabled={isDisabled}\n onFocus={(e) => {\n if (autoSelect) e.target.select();\n onFocus?.(e);\n }}\n onChange={(e) => {\n setValue(e.target.value as TValue);\n onChange?.(e);\n }}\n onBlur={(e) => {\n mutate(e.target.value as TValue);\n onBlur?.(e);\n }}\n className={cn(\n \"placeholder:text-primary-foreground read-only:bg-muted/50 flex h-full w-full bg-transparent px-3 py-0.5 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n />\n );\n}\n\nexport function InlineDataTableNumberInput<TData extends { id: string }, TValue>({\n context,\n action,\n onChange,\n onFocus,\n onBlur,\n autoSelect,\n disabled,\n className,\n ...props\n}: InlineDataTableInputProps<TData, TValue>) {\n const { disabledColumns } = useInlineTableContext();\n\n const { value, setValue, mutate, isAllowed } = useInlineDataTableInput({ context, action });\n\n const isDisabled = disabled || disabledColumns?.[context.column.id] || !isAllowed;\n\n return (\n <input\n {...props}\n type=\"number\"\n value={value as number}\n data-input\n disabled={isDisabled}\n onFocus={(e) => {\n if (autoSelect) e.target.select();\n onFocus?.(e);\n }}\n onChange={(e) => {\n setValue(e.target.valueAsNumber as TValue);\n onChange?.(e);\n }}\n onBlur={(e) => {\n mutate(e.target.value as TValue);\n onBlur?.(e);\n }}\n className={cn(\n \"placeholder:text-primary-foreground read-only:bg-muted/50 flex h-full w-full bg-transparent px-3 py-0.5 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50\",\n \"[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none\",\n className,\n )}\n />\n );\n}\n"],"mappings":";;;;;;;;;AAcA,SAAgB,2BAAiE,EAC/E,SACA,QACA,YACA,UACA,QACA,SACA,YACA,UACA,WACA,GAAG,SACwC;CAC3C,MAAM,EAAE,oBAAoB,uBAAuB;CAEnD,MAAM,EAAE,OAAO,UAAU,QAAQ,cAAc,wBAAwB;EACrE;EACA;EACA;EACD,CAAC;CAEF,MAAM,aAAa,YAAY,kBAAkB,QAAQ,OAAO,OAAO,CAAC;AAExE,QACE,8BAAC;EACC,GAAI;EACJ,KAAK,GAAG,QAAQ,IAAI,GAAG,GAAG,QAAQ,OAAO;EACzC,MAAK;EACE;EACP;EACA,UAAU;EACV,UAAU,MAAM;AACd,OAAI,WAAY,GAAE,OAAO,QAAQ;AACjC,aAAU,EAAE;;EAEd,WAAW,MAAM;AACf,YAAS,EAAE,OAAO,MAAgB;AAClC,cAAW,EAAE;;EAEf,SAAS,MAAM;AACb,UAAO,EAAE,OAAO,MAAgB;AAChC,YAAS,EAAE;;EAEb,WAAW,GACT,8PACA,UACD;GACD;;AAIN,SAAgB,2BAAiE,EAC/E,SACA,QACA,UACA,SACA,QACA,YACA,UACA,WACA,GAAG,SACwC;CAC3C,MAAM,EAAE,oBAAoB,uBAAuB;CAEnD,MAAM,EAAE,OAAO,UAAU,QAAQ,cAAc,wBAAwB;EAAE;EAAS;EAAQ,CAAC;CAE3F,MAAM,aAAa,YAAY,kBAAkB,QAAQ,OAAO,OAAO,CAAC;AAExE,QACE,oBAAC;EACC,GAAI;EACJ,MAAK;EACE;EACP;EACA,UAAU;EACV,UAAU,MAAM;AACd,OAAI,WAAY,GAAE,OAAO,QAAQ;AACjC,aAAU,EAAE;;EAEd,WAAW,MAAM;AACf,YAAS,EAAE,OAAO,cAAwB;AAC1C,cAAW,EAAE;;EAEf,SAAS,MAAM;AACb,UAAO,EAAE,OAAO,MAAgB;AAChC,YAAS,EAAE;;EAEb,WAAW,GACT,8PACA,wHACA,UACD;GACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"read-only.d.mts","names":[],"sources":["../../../../../../../src/modules/data-tables/tables/inline-table/components/inputs/read-only.tsx"],"sourcesContent":[],"mappings":";;;;iBAGgB,uBAAA;;;;GAIb,KAAA,CAAM,eAAe,mBAAgB,mBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"read-only.mjs","names":[],"sources":["../../../../../../../src/modules/data-tables/tables/inline-table/components/inputs/read-only.tsx"],"sourcesContent":["import { cn } from \"@/lib/utils/cn\";\nimport React from \"react\";\n\nexport function InlineDataTableReadOnly({\n className,\n children,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) {\n return (\n <span\n {...props}\n className={cn(\"bg-muted/50 flex h-full w-full items-center truncate px-3\", className)}\n >\n {children}\n </span>\n );\n}\n"],"mappings":";;;;;AAGA,SAAgB,wBAAwB,EACtC,WACA,UACA,GAAG,SACqC;AACxC,QACE,oBAAC;EACC,GAAI;EACJ,WAAW,GAAG,6DAA6D,UAAU;EAEpF;GACI"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { UseInlineDataTableInputParams } from "../../hooks/use-input.client.mjs";
|
|
2
|
-
import * as react_jsx_runtime16 from "react/jsx-runtime";
|
|
3
|
-
import React from "react";
|
|
4
|
-
|
|
5
|
-
//#region src/modules/data-tables/tables/inline-table/components/inputs/select.client.d.ts
|
|
6
|
-
type SelectItem = {
|
|
7
|
-
id: string;
|
|
8
|
-
value: string;
|
|
9
|
-
label?: React.ReactNode;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
};
|
|
12
|
-
type InlineDataTableSelectProps<TData, TValue> = UseInlineDataTableInputParams<TData, TValue> & {
|
|
13
|
-
placeholder?: React.ReactNode;
|
|
14
|
-
options: SelectItem[];
|
|
15
|
-
renderSelectedItem?: (selectedItem: SelectItem) => React.ReactNode;
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
className?: string;
|
|
18
|
-
};
|
|
19
|
-
declare function InlineDataTableSelect<TData extends {
|
|
20
|
-
id: string;
|
|
21
|
-
}, TValue>({
|
|
22
|
-
context,
|
|
23
|
-
action,
|
|
24
|
-
permission,
|
|
25
|
-
placeholder,
|
|
26
|
-
options,
|
|
27
|
-
renderSelectedItem,
|
|
28
|
-
disabled,
|
|
29
|
-
className
|
|
30
|
-
}: InlineDataTableSelectProps<TData, TValue>): react_jsx_runtime16.JSX.Element;
|
|
31
|
-
//#endregion
|
|
32
|
-
export { InlineDataTableSelect, InlineDataTableSelectProps, SelectItem };
|
|
33
|
-
//# sourceMappingURL=select.client.d.mts.map
|
package/dist/modules/data-tables/tables/inline-table/components/inputs/select.client.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"select.client.d.mts","names":[],"sources":["../../../../../../../src/modules/data-tables/tables/inline-table/components/inputs/select.client.tsx"],"sourcesContent":[],"mappings":";;;;;KAWY,UAAA;;;EAAA,KAAA,CAAA,EAGF,KAAA,CAAM,SAHM;EAOV,QAAA,CAAA,EAAA,OAAA;CACV;AACA,KAFU,0BAEV,CAAA,KAAA,EAAA,MAAA,CAAA,GAFsD,6BAEtD,CADA,KACA,EAAA,MAAA,CAAA,GAAA;EAFsD,WAAA,CAAA,EAIxC,KAAA,CAAM,SAJkC;EAIxC,OAAM,EACX,UADW,EAAA;EACX,kBAAA,CAAA,EAAA,CAAA,YAAA,EAC2B,UAD3B,EAAA,GAC0C,KAAA,CAAM,SADhD;EAC2B,QAAA,CAAA,EAAA,OAAA;EAAe,SAAM,CAAA,EAAA,MAAA;CAAS;AAKpD,iBAAA,qBAAqB,CAAA,cAAA;EACnC,EAAA,EAAA,MAAA;CACA,EAAA,MAAA,CAAA,CAAA;EAAA,OAAA;EAAA,MAAA;EAAA,UAAA;EAAA,WAAA;EAAA,OAAA;EAAA,kBAAA;EAAA,QAAA;EAAA;AAAA,CAAA,EAOC,0BAPD,CAO4B,KAP5B,EAOmC,MAPnC,CAAA,CAAA,EAO0C,mBAAA,CAAA,GAAA,CAAA,OAP1C"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { cn } from "../../../../../../lib/utils/cn.mjs";
|
|
4
|
-
import { Select, SelectContent, SelectItem, SelectTrigger } from "../../../../../../components/ui/select.client.mjs";
|
|
5
|
-
import { useInlineTableContext } from "../../hooks/context.client.mjs";
|
|
6
|
-
import { useInlineDataTableInput } from "../../hooks/use-input.client.mjs";
|
|
7
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
import React from "react";
|
|
9
|
-
|
|
10
|
-
//#region src/modules/data-tables/tables/inline-table/components/inputs/select.client.tsx
|
|
11
|
-
function InlineDataTableSelect({ context, action, permission, placeholder, options, renderSelectedItem, disabled, className }) {
|
|
12
|
-
const { disabledColumns } = useInlineTableContext();
|
|
13
|
-
const { value, setValue, mutate, isAllowed } = useInlineDataTableInput({
|
|
14
|
-
context,
|
|
15
|
-
action,
|
|
16
|
-
permission
|
|
17
|
-
});
|
|
18
|
-
const incomingSelectedItem = options.find((item) => item.id === value);
|
|
19
|
-
const [open, setOpen] = React.useState(false);
|
|
20
|
-
const [internalSelectedItem, setInternalSelectedItem] = React.useState();
|
|
21
|
-
const selectedItem = incomingSelectedItem ?? internalSelectedItem;
|
|
22
|
-
return /* @__PURE__ */ jsxs(Select, {
|
|
23
|
-
open,
|
|
24
|
-
defaultValue: value,
|
|
25
|
-
onOpenChange: setOpen,
|
|
26
|
-
onValueChange: (id) => {
|
|
27
|
-
const foundItem = options.find((item) => item.id === id);
|
|
28
|
-
if (!foundItem) return;
|
|
29
|
-
setValue(foundItem.id);
|
|
30
|
-
mutate(foundItem.id);
|
|
31
|
-
setInternalSelectedItem(foundItem);
|
|
32
|
-
setOpen(false);
|
|
33
|
-
},
|
|
34
|
-
children: [/* @__PURE__ */ jsx(SelectTrigger, {
|
|
35
|
-
disabled: disabled || disabledColumns?.[context.column.id] || !isAllowed,
|
|
36
|
-
className: cn("h-full w-full border-none outline-none ring-0 focus:border-0 focus:outline-none focus:ring-0 focus:ring-offset-0 focus-visible:outline-none", className),
|
|
37
|
-
children: selectedItem ? /* @__PURE__ */ jsx("div", {
|
|
38
|
-
className: "flex items-center",
|
|
39
|
-
children: renderSelectedItem?.(selectedItem) ?? selectedItem.label ?? selectedItem.value
|
|
40
|
-
}) : placeholder ?? "Kies een optie..."
|
|
41
|
-
}), /* @__PURE__ */ jsx(SelectContent, { children: options.map((item) => /* @__PURE__ */ jsx(SelectItem, {
|
|
42
|
-
disabled: item.disabled,
|
|
43
|
-
className: "cursor-pointer",
|
|
44
|
-
value: item.id,
|
|
45
|
-
children: item.label ?? item.value
|
|
46
|
-
}, item.id)) })]
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
//#endregion
|
|
51
|
-
export { InlineDataTableSelect };
|
|
52
|
-
//# sourceMappingURL=select.client.mjs.map
|
package/dist/modules/data-tables/tables/inline-table/components/inputs/select.client.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"select.client.mjs","names":[],"sources":["../../../../../../../src/modules/data-tables/tables/inline-table/components/inputs/select.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Select, SelectContent, SelectItem, SelectTrigger } from \"@/components/ui/select.client\";\nimport { cn } from \"@/lib/utils/cn\";\nimport React from \"react\";\nimport { useInlineTableContext } from \"../../hooks/context.client\";\nimport {\n useInlineDataTableInput,\n UseInlineDataTableInputParams,\n} from \"../../hooks/use-input.client\";\n\nexport type SelectItem = {\n id: string;\n value: string;\n label?: React.ReactNode;\n disabled?: boolean;\n};\n\nexport type InlineDataTableSelectProps<TData, TValue> = UseInlineDataTableInputParams<\n TData,\n TValue\n> & {\n placeholder?: React.ReactNode;\n options: SelectItem[];\n renderSelectedItem?: (selectedItem: SelectItem) => React.ReactNode;\n disabled?: boolean;\n className?: string;\n};\n\nexport function InlineDataTableSelect<TData extends { id: string }, TValue>({\n context,\n action,\n permission,\n placeholder,\n options,\n renderSelectedItem,\n disabled,\n className,\n}: InlineDataTableSelectProps<TData, TValue>) {\n const { disabledColumns } = useInlineTableContext();\n\n const { value, setValue, mutate, isAllowed } = useInlineDataTableInput({\n context,\n action,\n permission,\n });\n const incomingSelectedItem = options.find((item) => item.id === value);\n\n const [open, setOpen] = React.useState(false);\n const [internalSelectedItem, setInternalSelectedItem] = React.useState<SelectItem | undefined>();\n\n const selectedItem = incomingSelectedItem ?? internalSelectedItem;\n\n const isDisabled = disabled || disabledColumns?.[context.column.id] || !isAllowed;\n\n return (\n <Select\n open={open}\n defaultValue={value as string}\n onOpenChange={setOpen}\n onValueChange={(id) => {\n const foundItem = options.find((item) => item.id === id);\n\n if (!foundItem) return;\n\n setValue(foundItem.id as TValue);\n mutate(foundItem.id as TValue);\n setInternalSelectedItem(foundItem);\n setOpen(false);\n }}\n >\n <SelectTrigger\n disabled={isDisabled}\n className={cn(\n \"h-full w-full border-none outline-none ring-0 focus:border-0 focus:outline-none focus:ring-0 focus:ring-offset-0 focus-visible:outline-none\",\n className,\n )}\n >\n {selectedItem ? (\n <div className=\"flex items-center\">\n {renderSelectedItem?.(selectedItem) ?? selectedItem.label ?? selectedItem.value}\n </div>\n ) : (\n (placeholder ?? \"Kies een optie...\")\n )}\n </SelectTrigger>\n\n <SelectContent>\n {options.map((item) => (\n <SelectItem\n disabled={item.disabled}\n className=\"cursor-pointer\"\n key={item.id}\n value={item.id}\n >\n {item.label ?? item.value}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n );\n}\n"],"mappings":";;;;;;;;;;AA6BA,SAAgB,sBAA4D,EAC1E,SACA,QACA,YACA,aACA,SACA,oBACA,UACA,aAC4C;CAC5C,MAAM,EAAE,oBAAoB,uBAAuB;CAEnD,MAAM,EAAE,OAAO,UAAU,QAAQ,cAAc,wBAAwB;EACrE;EACA;EACA;EACD,CAAC;CACF,MAAM,uBAAuB,QAAQ,MAAM,SAAS,KAAK,OAAO,MAAM;CAEtE,MAAM,CAAC,MAAM,WAAW,MAAM,SAAS,MAAM;CAC7C,MAAM,CAAC,sBAAsB,2BAA2B,MAAM,UAAkC;CAEhG,MAAM,eAAe,wBAAwB;AAI7C,QACE,qBAAC;EACO;EACN,cAAc;EACd,cAAc;EACd,gBAAgB,OAAO;GACrB,MAAM,YAAY,QAAQ,MAAM,SAAS,KAAK,OAAO,GAAG;AAExD,OAAI,CAAC,UAAW;AAEhB,YAAS,UAAU,GAAa;AAChC,UAAO,UAAU,GAAa;AAC9B,2BAAwB,UAAU;AAClC,WAAQ,MAAM;;aAGhB,oBAAC;GACC,UAnBa,YAAY,kBAAkB,QAAQ,OAAO,OAAO,CAAC;GAoBlE,WAAW,GACT,+IACA,UACD;aAEA,eACC,oBAAC;IAAI,WAAU;cACZ,qBAAqB,aAAa,IAAI,aAAa,SAAS,aAAa;KACtE,GAEL,eAAe;IAEJ,EAEhB,oBAAC,2BACE,QAAQ,KAAK,SACZ,oBAAC;GACC,UAAU,KAAK;GACf,WAAU;GAEV,OAAO,KAAK;aAEX,KAAK,SAAS,KAAK;KAHf,KAAK,GAIC,CACb,GACY;GACT"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Permission } from "../../../../auth/lib/permissions.mjs";
|
|
2
|
-
import "../../../../../auth.mjs";
|
|
3
|
-
import { InlineEditSchema } from "../../../../inline-edit/lib/validators.mjs";
|
|
4
|
-
import "../../../../../inline-edit.mjs";
|
|
5
|
-
import "react";
|
|
6
|
-
import "client-only";
|
|
7
|
-
import { CellContext } from "@tanstack/react-table";
|
|
8
|
-
|
|
9
|
-
//#region src/modules/data-tables/tables/inline-table/hooks/use-input.client.d.ts
|
|
10
|
-
type UseInlineDataTableInputParams<TData, TValue> = {
|
|
11
|
-
context: CellContext<TData, TValue>;
|
|
12
|
-
action: (params: InlineEditSchema<TValue>) => Promise<void> | void;
|
|
13
|
-
permission?: Permission;
|
|
14
|
-
};
|
|
15
|
-
//#endregion
|
|
16
|
-
export { UseInlineDataTableInputParams };
|
|
17
|
-
//# sourceMappingURL=use-input.client.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-input.client.d.mts","names":[],"sources":["../../../../../../src/modules/data-tables/tables/inline-table/hooks/use-input.client.ts"],"sourcesContent":[],"mappings":";;;;;;;;;KAUY;WACD,YAAY,OAAO;mBACX,iBAAiB,YAAY;eACjC"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { useAction } from "../../../../../lib/hooks/use-action.mjs";
|
|
2
|
-
import { usePermission } from "../../../../auth/hooks/use-permission.mjs";
|
|
3
|
-
import { useEffect, useState } from "react";
|
|
4
|
-
import { toast } from "sonner";
|
|
5
|
-
import "client-only";
|
|
6
|
-
|
|
7
|
-
//#region src/modules/data-tables/tables/inline-table/hooks/use-input.client.ts
|
|
8
|
-
/**
|
|
9
|
-
* Inline form table input
|
|
10
|
-
*/
|
|
11
|
-
function useInlineDataTableInput({ context, action, permission }) {
|
|
12
|
-
const initialValue = context.getValue();
|
|
13
|
-
const [value, setValue] = useState(initialValue);
|
|
14
|
-
useEffect(() => setValue(initialValue), [initialValue]);
|
|
15
|
-
const isAllowed = usePermission(permission ?? {}).data?.success;
|
|
16
|
-
/**
|
|
17
|
-
* Update value mutation
|
|
18
|
-
*/
|
|
19
|
-
const { mutate } = useAction({
|
|
20
|
-
mutationFn: async (value$1) => {
|
|
21
|
-
if (initialValue === value$1) return;
|
|
22
|
-
const { id } = context.row.original;
|
|
23
|
-
await action({
|
|
24
|
-
id,
|
|
25
|
-
value: value$1
|
|
26
|
-
});
|
|
27
|
-
},
|
|
28
|
-
onError: () => {
|
|
29
|
-
setValue(initialValue);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
/**
|
|
33
|
-
* Handle the update of the value.
|
|
34
|
-
*/
|
|
35
|
-
const handleUpdate = (value$1) => {
|
|
36
|
-
if (!isAllowed) {
|
|
37
|
-
toast.error("Je hebt geen toestemming om dit te bewerken");
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
if (value$1 === initialValue) return;
|
|
41
|
-
return mutate(value$1);
|
|
42
|
-
};
|
|
43
|
-
return {
|
|
44
|
-
value,
|
|
45
|
-
setValue,
|
|
46
|
-
mutate: handleUpdate,
|
|
47
|
-
isAllowed
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
//#endregion
|
|
52
|
-
export { useInlineDataTableInput };
|
|
53
|
-
//# sourceMappingURL=use-input.client.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-input.client.mjs","names":["value"],"sources":["../../../../../../src/modules/data-tables/tables/inline-table/hooks/use-input.client.ts"],"sourcesContent":["import \"client-only\";\n\nimport { useAction } from \"@/lib/hooks/use-action\";\nimport { Permission } from \"@/modules/auth/entry\";\nimport { usePermission } from \"@/modules/auth/hooks/use-permission\";\nimport { InlineEditSchema } from \"@/modules/inline-edit/entry\";\nimport { type CellContext } from \"@tanstack/react-table\";\nimport { useEffect, useState } from \"react\";\nimport { toast } from \"sonner\";\n\nexport type UseInlineDataTableInputParams<TData, TValue> = {\n context: CellContext<TData, TValue>;\n action: (params: InlineEditSchema<TValue>) => Promise<void> | void;\n permission?: Permission;\n};\n\n/**\n * Inline form table input\n */\nexport function useInlineDataTableInput<TData extends { id: string }, TValue>({\n context,\n action,\n permission,\n}: UseInlineDataTableInputParams<TData, TValue>) {\n const initialValue = context.getValue();\n\n const [value, setValue] = useState(initialValue);\n\n useEffect(() => setValue(initialValue), [initialValue]);\n\n const permissionData = usePermission(permission ?? {});\n const isAllowed = permissionData.data?.success;\n\n /**\n * Update value mutation\n */\n const { mutate } = useAction({\n mutationFn: async (value: TValue) => {\n if (initialValue === value) return;\n\n const { id } = context.row.original as TData;\n await action({ id, value });\n },\n onError: () => {\n setValue(initialValue);\n },\n });\n\n /**\n * Handle the update of the value.\n */\n const handleUpdate = (value: TValue) => {\n if (!isAllowed) {\n toast.error(\"Je hebt geen toestemming om dit te bewerken\");\n return;\n }\n\n // If the value is the same as the initial value, do nothing\n if (value === initialValue) return;\n\n return mutate(value);\n };\n\n return { value, setValue, mutate: handleUpdate, isAllowed };\n}\n"],"mappings":";;;;;;;;;;AAmBA,SAAgB,wBAA8D,EAC5E,SACA,QACA,cAC+C;CAC/C,MAAM,eAAe,QAAQ,UAAU;CAEvC,MAAM,CAAC,OAAO,YAAY,SAAS,aAAa;AAEhD,iBAAgB,SAAS,aAAa,EAAE,CAAC,aAAa,CAAC;CAGvD,MAAM,YADiB,cAAc,cAAc,EAAE,CAAC,CACrB,MAAM;;;;CAKvC,MAAM,EAAE,WAAW,UAAU;EAC3B,YAAY,OAAO,YAAkB;AACnC,OAAI,iBAAiBA,QAAO;GAE5B,MAAM,EAAE,OAAO,QAAQ,IAAI;AAC3B,SAAM,OAAO;IAAE;IAAI;IAAO,CAAC;;EAE7B,eAAe;AACb,YAAS,aAAa;;EAEzB,CAAC;;;;CAKF,MAAM,gBAAgB,YAAkB;AACtC,MAAI,CAAC,WAAW;AACd,SAAM,MAAM,8CAA8C;AAC1D;;AAIF,MAAIA,YAAU,aAAc;AAE5B,SAAO,OAAOA,QAAM;;AAGtB,QAAO;EAAE;EAAO;EAAU,QAAQ;EAAc;EAAW"}
|