@salesforce/ui-bundle-template-feature-vue-file-upload 0.0.0-stage → 13.4.0
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/LICENSE.txt +82 -0
- package/README.md +267 -2
- package/dist/.forceignore +15 -0
- package/dist/.husky/pre-commit +4 -0
- package/dist/.prettierignore +11 -0
- package/dist/.prettierrc +17 -0
- package/dist/CHANGELOG.md +5454 -0
- package/dist/README.md +83 -0
- package/dist/config/project-scratch-def.json +13 -0
- package/dist/eslint.config.js +7 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/.forceignore +15 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/.graphqlrc.yml +2 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/.prettierignore +9 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/.prettierrc +11 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/README.md +43 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/codegen.yml +95 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/components.json +19 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/e2e/app.spec.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/eslint.config.js +124 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/feature-vue-file-upload.uibundle-meta.xml +7 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/index.html +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/package.json +72 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/playwright.config.ts +24 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/scripts/get-graphql-schema.mjs +71 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/scripts/rewrite-e2e-assets.mjs +23 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/App.vue +5 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/api/graphqlClient.ts +44 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/appLayout.vue +80 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/alerts/status-alert.vue +59 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/layouts/card-layout.vue +30 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/alert/Alert.vue +21 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/alert/AlertAction.vue +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/alert/AlertDescription.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/alert/AlertTitle.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/alert/index.ts +25 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/avatar/Avatar.vue +23 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/avatar/AvatarFallback.vue +31 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/avatar/AvatarImage.vue +16 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/avatar/index.ts +3 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/button/Button.vue +33 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/button/index.ts +43 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/card/Card.vue +29 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/card/CardAction.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/card/CardContent.vue +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/card/CardDescription.vue +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/card/CardFooter.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/card/CardHeader.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/card/CardTitle.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/card/index.ts +7 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/checkbox/Checkbox.vue +43 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/checkbox/index.ts +1 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/collapsible/Collapsible.vue +19 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/collapsible/CollapsibleContent.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/collapsible/CollapsibleTrigger.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/collapsible/index.ts +3 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/dialog/Dialog.vue +15 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/dialog/DialogClose.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/dialog/DialogContent.vue +59 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/dialog/DialogDescription.vue +31 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/dialog/DialogFooter.vue +33 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/dialog/DialogHeader.vue +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/dialog/DialogOverlay.vue +31 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/dialog/DialogPortal.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/dialog/DialogTitle.vue +26 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/dialog/DialogTrigger.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/dialog/index.ts +10 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/dropdown-menu/DropdownMenu.vue +19 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +51 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/dropdown-menu/DropdownMenuContent.vue +47 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/dropdown-menu/DropdownMenuGroup.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/dropdown-menu/DropdownMenuItem.vue +44 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/dropdown-menu/DropdownMenuLabel.vue +30 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/dropdown-menu/DropdownMenuPortal.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +21 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +52 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/dropdown-menu/DropdownMenuSeparator.vue +26 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/dropdown-menu/DropdownMenuShortcut.vue +19 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/dropdown-menu/DropdownMenuSub.vue +19 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/dropdown-menu/DropdownMenuSubContent.vue +37 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +38 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/dropdown-menu/DropdownMenuTrigger.vue +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/dropdown-menu/index.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/field/Field.vue +27 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/field/FieldContent.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/field/FieldDescription.vue +24 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/field/FieldError.vue +48 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/field/FieldGroup.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/field/FieldLabel.vue +24 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/field/FieldLegend.vue +29 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/field/FieldSeparator.vue +31 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/field/FieldSet.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/field/FieldTitle.vue +22 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/field/index.ts +33 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/index.ts +115 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/input/Input.vue +30 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/input/index.ts +1 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/label/Label.vue +29 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/label/index.ts +1 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/pagination/Pagination.vue +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/pagination/PaginationContent.vue +15 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/pagination/PaginationEllipsis.vue +23 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/pagination/PaginationItem.vue +7 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/pagination/PaginationLink.vue +31 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/pagination/PaginationNext.vue +29 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/pagination/PaginationPrevious.vue +29 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/pagination/index.ts +7 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/popover/Popover.vue +15 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/popover/PopoverAnchor.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/popover/PopoverContent.vue +44 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/popover/PopoverDescription.vue +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/popover/PopoverHeader.vue +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/popover/PopoverTitle.vue +14 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/popover/PopoverTrigger.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/popover/index.ts +7 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/select/Select.vue +15 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/select/SelectContent.vue +65 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/select/SelectGroup.vue +26 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/select/SelectItem.vue +41 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/select/SelectLabel.vue +26 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/select/SelectScrollDownButton.vue +32 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/select/SelectScrollUpButton.vue +32 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/select/SelectSeparator.vue +24 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/select/SelectTrigger.vue +45 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/select/SelectValue.vue +12 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/select/index.ts +10 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/separator/Separator.vue +33 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/separator/index.ts +1 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/skeleton/Skeleton.vue +15 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/skeleton/index.ts +1 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/sonner/Sonner.vue +29 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/sonner/index.ts +3 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/spinner/Spinner.vue +17 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/spinner/index.ts +1 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/composables/useAsyncData.ts +69 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/features/file-upload/__examples__/upload-test-page-example.vue +51 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/features/file-upload/api/fileUpload.ts +304 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/features/file-upload/assets/symbols.svg +1 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/features/file-upload/components/FileUpload.vue +95 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/features/file-upload/components/FileUploadDialog.vue +82 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/features/file-upload/components/FileUploadDropZone.vue +103 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/features/file-upload/components/FileUploadFileItem.vue +95 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/features/file-upload/components/FileUploadIcons.ts +175 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/features/file-upload/composables/useFileUpload.ts +218 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/features/file-upload/composables/useFileUploadDialog.ts +81 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/features/file-upload/types/fileUpload.ts +27 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/features/file-upload/utils/fileUploadUtils.ts +59 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/features/file-upload/utils/labels.ts +28 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/index.ts +65 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/lib/utils.ts +6 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/main.ts +6 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/pages/Home.vue +10 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/pages/NotFound.vue +18 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/router-utils.ts +32 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/router.ts +46 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/styles/global.css +134 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/src/test/setup.ts +1 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/tsconfig.json +45 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/tsconfig.node.json +13 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/tsconfig.tsbuildinfo +1 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/ui-bundle.json +7 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/vite-env.d.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/vite.config.ts +106 -0
- package/dist/force-app/main/default/uiBundles/feature-vue-file-upload/vitest-env.d.ts +2 -0
- package/dist/jest.config.js +6 -0
- package/dist/package-lock.json +12554 -0
- package/dist/package.json +46 -0
- package/dist/scripts/apex/hello.apex +10 -0
- package/dist/scripts/gitignore-templates.json +4 -0
- package/dist/scripts/graphql-search.sh +191 -0
- package/dist/scripts/network-senders.mjs +84 -0
- package/dist/scripts/org-setup-config-schema.mjs +132 -0
- package/dist/scripts/org-setup-dev.mjs +114 -0
- package/dist/scripts/org-setup-url.mjs +108 -0
- package/dist/scripts/org-setup-utils.mjs +569 -0
- package/dist/scripts/org-setup-xml.mjs +283 -0
- package/dist/scripts/org-setup.config.json +5 -0
- package/dist/scripts/org-setup.mjs +2545 -0
- package/dist/scripts/sf-project-setup.mjs +103 -0
- package/dist/scripts/soql/account.soql +6 -0
- package/dist/scripts/validate-org-setup-config.mjs +38 -0
- package/dist/sfdx-project.json +12 -0
- package/package.json +53 -4
- package/src/force-app/main/default/uiBundles/feature-vue-file-upload/src/__inherit__appLayout.vue +12 -0
- package/src/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/__inherit__button/index.ts +21 -0
- package/src/force-app/main/default/uiBundles/feature-vue-file-upload/src/components/ui/__inherit__dialog/index.ts +61 -0
- package/src/force-app/main/default/uiBundles/feature-vue-file-upload/src/features/file-upload/__examples__/upload-test-page-example.vue +51 -0
- package/src/force-app/main/default/uiBundles/feature-vue-file-upload/src/features/file-upload/api/fileUpload.ts +304 -0
- package/src/force-app/main/default/uiBundles/feature-vue-file-upload/src/features/file-upload/assets/symbols.svg +1 -0
- package/src/force-app/main/default/uiBundles/feature-vue-file-upload/src/features/file-upload/components/FileUpload.vue +95 -0
- package/src/force-app/main/default/uiBundles/feature-vue-file-upload/src/features/file-upload/components/FileUploadDialog.vue +82 -0
- package/src/force-app/main/default/uiBundles/feature-vue-file-upload/src/features/file-upload/components/FileUploadDropZone.vue +103 -0
- package/src/force-app/main/default/uiBundles/feature-vue-file-upload/src/features/file-upload/components/FileUploadFileItem.vue +95 -0
- package/src/force-app/main/default/uiBundles/feature-vue-file-upload/src/features/file-upload/components/FileUploadIcons.ts +175 -0
- package/src/force-app/main/default/uiBundles/feature-vue-file-upload/src/features/file-upload/composables/useFileUpload.ts +218 -0
- package/src/force-app/main/default/uiBundles/feature-vue-file-upload/src/features/file-upload/composables/useFileUploadDialog.ts +81 -0
- package/src/force-app/main/default/uiBundles/feature-vue-file-upload/src/features/file-upload/types/fileUpload.ts +27 -0
- package/src/force-app/main/default/uiBundles/feature-vue-file-upload/src/features/file-upload/utils/fileUploadUtils.ts +59 -0
- package/src/force-app/main/default/uiBundles/feature-vue-file-upload/src/features/file-upload/utils/labels.ts +28 -0
- package/src/force-app/main/default/uiBundles/feature-vue-file-upload/src/index.ts +65 -0
- package/src/force-app/main/default/uiBundles/feature-vue-file-upload/src/router.ts +31 -0
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
Terms of Use
|
|
2
|
+
|
|
3
|
+
Copyright 2026 Salesforce, Inc. All rights reserved.
|
|
4
|
+
|
|
5
|
+
These Terms of Use govern the download, installation, and/or use of this
|
|
6
|
+
software provided by Salesforce, Inc. ("Salesforce") (the "Software"), were
|
|
7
|
+
last updated on April 15, 2025, and constitute a legally binding
|
|
8
|
+
agreement between you and Salesforce. If you do not agree to these Terms of
|
|
9
|
+
Use, do not install or use the Software.
|
|
10
|
+
|
|
11
|
+
Salesforce grants you a worldwide, non-exclusive, no-charge, royalty-free
|
|
12
|
+
copyright license to reproduce, prepare derivative works of, publicly
|
|
13
|
+
display, publicly perform, sublicense, and distribute the Software and
|
|
14
|
+
derivative works subject to these Terms. These Terms shall be included in
|
|
15
|
+
all copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
Subject to the limited rights expressly granted hereunder, Salesforce
|
|
18
|
+
reserves all rights, title, and interest in and to all intellectual
|
|
19
|
+
property subsisting in the Software. No rights are granted to you hereunder
|
|
20
|
+
other than as expressly set forth herein. Users residing in countries on
|
|
21
|
+
the United States Office of Foreign Assets Control sanction list, or which
|
|
22
|
+
are otherwise subject to a US export embargo, may not use the Software.
|
|
23
|
+
|
|
24
|
+
Implementation of the Software may require development work, for which you
|
|
25
|
+
are responsible. The Software may contain bugs, errors and
|
|
26
|
+
incompatibilities and is made available on an AS IS basis without support,
|
|
27
|
+
updates, or service level commitments.
|
|
28
|
+
|
|
29
|
+
Salesforce reserves the right at any time to modify, suspend, or
|
|
30
|
+
discontinue, the Software (or any part thereof) with or without notice. You
|
|
31
|
+
agree that Salesforce shall not be liable to you or to any third party for
|
|
32
|
+
any modification, suspension, or discontinuance.
|
|
33
|
+
|
|
34
|
+
You agree to defend Salesforce against any claim, demand, suit or
|
|
35
|
+
proceeding made or brought against Salesforce by a third party arising out
|
|
36
|
+
of or accruing from (a) your use of the Software, and (b) any application
|
|
37
|
+
you develop with the Software that infringes any copyright, trademark,
|
|
38
|
+
trade secret, trade dress, patent, or other intellectual property right of
|
|
39
|
+
any person or defames any person or violates their rights of publicity or
|
|
40
|
+
privacy (each a "Claim Against Salesforce"), and will indemnify Salesforce
|
|
41
|
+
from any damages, attorney fees, and costs finally awarded against
|
|
42
|
+
Salesforce as a result of, or for any amounts paid by Salesforce under a
|
|
43
|
+
settlement approved by you in writing of, a Claim Against Salesforce,
|
|
44
|
+
provided Salesforce (x) promptly gives you written notice of the Claim
|
|
45
|
+
Against Salesforce, (y) gives you sole control of the defense and
|
|
46
|
+
settlement of the Claim Against Salesforce (except that you may not settle
|
|
47
|
+
any Claim Against Salesforce unless it unconditionally releases Salesforce
|
|
48
|
+
of all liability), and (z) gives you all reasonable assistance, at your
|
|
49
|
+
expense.
|
|
50
|
+
|
|
51
|
+
WITHOUT LIMITING THE GENERALITY OF THE FOREGOING, THE SOFTWARE IS NOT
|
|
52
|
+
SUPPORTED AND IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
53
|
+
IMPLIED. IN NO EVENT SHALL SALESFORCE HAVE ANY LIABILITY FOR ANY DAMAGES,
|
|
54
|
+
INCLUDING, BUT NOT LIMITED TO, DIRECT, INDIRECT, SPECIAL, INCIDENTAL,
|
|
55
|
+
PUNITIVE, OR CONSEQUENTIAL DAMAGES, OR DAMAGES BASED ON LOST PROFITS, DATA,
|
|
56
|
+
OR USE, IN CONNECTION WITH THE SOFTWARE, HOWEVER CAUSED AND WHETHER IN
|
|
57
|
+
CONTRACT, TORT, OR UNDER ANY OTHER THEORY OF LIABILITY, WHETHER OR NOT YOU
|
|
58
|
+
HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
59
|
+
|
|
60
|
+
These Terms of Use shall be governed exclusively by the internal laws of
|
|
61
|
+
the State of California, without regard to its conflicts of laws
|
|
62
|
+
rules. Each party hereby consents to the exclusive jurisdiction of the
|
|
63
|
+
state and federal courts located in San Francisco County, California to
|
|
64
|
+
adjudicate any dispute arising out of or relating to these Terms of Use and
|
|
65
|
+
the download, installation, and/or use of the Software. Except as expressly
|
|
66
|
+
stated herein, these Terms of Use constitute the entire agreement between
|
|
67
|
+
the parties, and supersede all prior and contemporaneous agreements,
|
|
68
|
+
proposals, or representations, written or oral, concerning their subject
|
|
69
|
+
matter. No modification, amendment, or waiver of any provision of these
|
|
70
|
+
Terms of Use shall be effective unless it is by an update to these Terms of
|
|
71
|
+
Use that Salesforce makes available, or is in writing and signed by the
|
|
72
|
+
party against whom the modification, amendment, or waiver is to be
|
|
73
|
+
asserted.
|
|
74
|
+
|
|
75
|
+
Data Privacy: Salesforce may collect, process, and store device,
|
|
76
|
+
system, and other information related to your use of the Software. This
|
|
77
|
+
information includes, but is not limited to, IP address, user metrics, and
|
|
78
|
+
other data ("Usage Data"). Salesforce may use Usage Data for analytics,
|
|
79
|
+
product development, and marketing purposes. You acknowledge that files
|
|
80
|
+
generated in conjunction with the Software may contain sensitive or
|
|
81
|
+
confidential data, and you are solely responsible for anonymizing and
|
|
82
|
+
protecting such data.
|
package/README.md
CHANGED
|
@@ -1,3 +1,268 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Feature: Vue File Upload API
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
File upload API package that provides programmatic APIs for uploading files to Salesforce with progress tracking and ContentVersion integration, for **Vue** UI Bundles. This package serves as a **reference implementation** with APIs that allow you to **build your own custom UI**.
|
|
4
|
+
|
|
5
|
+
> **Vue only.** The reference UI ships Vue 3 single-file components and composables built on `vue` 3.5 and base-vue-app's shadcn-vue `Dialog` and `Button`. The API module itself is framework-agnostic and matches the React sibling, `feature-react-file-upload`.
|
|
6
|
+
|
|
7
|
+
## Package Purpose
|
|
8
|
+
|
|
9
|
+
This package exposes APIs only - **no components or composables are exported**. You can:
|
|
10
|
+
|
|
11
|
+
- Use the `upload()` API to handle the complete upload flow
|
|
12
|
+
- Build your own custom UI with full control over the user experience
|
|
13
|
+
- Track upload progress for each file in real-time
|
|
14
|
+
- Optionally create ContentVersion records linked to Salesforce records
|
|
15
|
+
|
|
16
|
+
The components and composables in the source code are reference code. The features CLI copies them into your app (see [Installation](#installation)).
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npx @salesforce/ui-bundle-features install vue-file-upload --ui-bundle-dir <your-ui-bundle>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
This copies `src/features/file-upload/` into your UI bundle, including:
|
|
25
|
+
|
|
26
|
+
- `components/` – `FileUpload`, `FileUploadDropZone`, `FileUploadDialog`, `FileUploadFileItem`, icons
|
|
27
|
+
- `composables/` – `useFileUpload`, `useFileUploadDialog`
|
|
28
|
+
- `api/`, `types/`, `utils/` – upload API, types, size/format helpers, and labels
|
|
29
|
+
- `__examples__/upload-test-page-example.vue` – a demo page to register in `src/router.ts`:
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import UploadTestPage from "./features/file-upload/__examples__/upload-test-page-example.vue";
|
|
33
|
+
|
|
34
|
+
// inside the AppLayout route's children:
|
|
35
|
+
{ path: "upload-test", component: UploadTestPage, meta: { showInNavigation: true, label: "Upload Test" } },
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The copied components import `Dialog` and `Button` from your app's `src/components/ui/` (shadcn-vue, included in base-vue-app).
|
|
39
|
+
|
|
40
|
+
## Exports
|
|
41
|
+
|
|
42
|
+
### API Functions
|
|
43
|
+
|
|
44
|
+
- **upload** – Unified upload API that handles config, upload with progress tracking, and optionally creates ContentVersion records
|
|
45
|
+
- **createContentVersion** – Manually create a ContentVersion record from a contentBodyId
|
|
46
|
+
- **getCurrentUserId** – Get the current user's Salesforce ID
|
|
47
|
+
|
|
48
|
+
### Types
|
|
49
|
+
|
|
50
|
+
- **UploadOptions** – Configuration options for the upload function
|
|
51
|
+
- **FileUploadResult** – Result object containing file info and IDs
|
|
52
|
+
- **FileUploadProgress** – Progress callback data for tracking upload status
|
|
53
|
+
- **UploadStatus** – Upload status enum: "pending" | "uploading" | "processing" | "success" | "error"
|
|
54
|
+
|
|
55
|
+
## Usage Guide
|
|
56
|
+
|
|
57
|
+
### Drop-in Component (after installing with the features CLI)
|
|
58
|
+
|
|
59
|
+
```vue
|
|
60
|
+
<script setup lang="ts">
|
|
61
|
+
import FileUpload from "@/features/file-upload/components/FileUpload.vue";
|
|
62
|
+
import type { UploadedFile } from "@/features/file-upload/types/fileUpload";
|
|
63
|
+
|
|
64
|
+
const props = defineProps<{ recordId: string }>();
|
|
65
|
+
|
|
66
|
+
const onUploadComplete = (files: UploadedFile[]) => {
|
|
67
|
+
console.log("Uploaded:", files);
|
|
68
|
+
};
|
|
69
|
+
</script>
|
|
70
|
+
|
|
71
|
+
<template>
|
|
72
|
+
<FileUpload
|
|
73
|
+
multiple
|
|
74
|
+
accept="image/*,.pdf"
|
|
75
|
+
:record-id="props.recordId"
|
|
76
|
+
:max-file-size="50"
|
|
77
|
+
@upload-complete="onUploadComplete"
|
|
78
|
+
@upload-error="(file, error) => console.error(file.name, error)"
|
|
79
|
+
/>
|
|
80
|
+
</template>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
| Prop | Type | Description |
|
|
84
|
+
| --------------- | --------- | ------------------------------------------------------------------------------------------- |
|
|
85
|
+
| `accept` | `string` | MIME types or extensions to accept (e.g. `image/*,.pdf`). Omit for all files. |
|
|
86
|
+
| `multiple` | `boolean` | Allow selecting more than one file. Default `false` (only the first dropped file is used). |
|
|
87
|
+
| `recordId` | `string` | Links files to this record (FirstPublishLocationId) by creating a ContentVersion. Optional. |
|
|
88
|
+
| `maxFileSize` | `number` | Maximum file size in MB. Larger files are rejected. Default 2 GB. |
|
|
89
|
+
| `formatHint` | `string` | Hint under the drop zone. Defaults to `Up to {maxFileSize}MB` when `maxFileSize` is set. |
|
|
90
|
+
| `dropZoneClass` | `string` | Extra classes for the drop zone (e.g. `h-full`). |
|
|
91
|
+
|
|
92
|
+
| Event | Payload | When |
|
|
93
|
+
| ----------------- | ----------------------------- | ---------------------------------------------- |
|
|
94
|
+
| `upload-complete` | `UploadedFile[]` | After a selection finishes, with the successes |
|
|
95
|
+
| `upload-error` | `(file: File, error: string)` | A file was too large or its upload failed |
|
|
96
|
+
|
|
97
|
+
Closing the dialog (close button, Escape, or overlay) while uploads are running aborts them; files that already finished are kept.
|
|
98
|
+
|
|
99
|
+
### Basic Upload with Progress Tracking
|
|
100
|
+
|
|
101
|
+
Upload files to Salesforce with real-time progress tracking for each file:
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
import { upload } from "@salesforce/ui-bundle-template-feature-vue-file-upload";
|
|
105
|
+
|
|
106
|
+
async function handleUpload(files: File[]) {
|
|
107
|
+
const results = await upload({
|
|
108
|
+
files,
|
|
109
|
+
onProgress: (progress) => {
|
|
110
|
+
console.log(`${progress.fileName}: ${progress.status} - ${progress.progress}%`);
|
|
111
|
+
// Update your UI with progress.status and progress.progress
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
console.log("Upload complete:", results);
|
|
116
|
+
// results[0].contentBodyId: "069..." (always available)
|
|
117
|
+
// results[0].contentVersionId: undefined (no record linked)
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Upload with Record Linking
|
|
122
|
+
|
|
123
|
+
Link uploaded files to a Salesforce record immediately by providing `recordId`:
|
|
124
|
+
|
|
125
|
+
```ts
|
|
126
|
+
import { upload } from "@salesforce/ui-bundle-template-feature-vue-file-upload";
|
|
127
|
+
|
|
128
|
+
async function uploadToRecord(files: File[], recordId: string) {
|
|
129
|
+
const results = await upload({
|
|
130
|
+
files,
|
|
131
|
+
recordId, // Links files to this record (Account, Opportunity, etc.)
|
|
132
|
+
onProgress: (progress) => {
|
|
133
|
+
// Track progress: pending → uploading → processing → success
|
|
134
|
+
updateUI(progress.fileName, progress.status, progress.progress);
|
|
135
|
+
},
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
// Both contentBodyId and contentVersionId are available
|
|
139
|
+
console.log("Uploaded to record:", results);
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Deferred Record Linking (Record Creation Pattern)
|
|
144
|
+
|
|
145
|
+
**When creating a new record**: Upload files first without `recordId`, then link them after the record is created:
|
|
146
|
+
|
|
147
|
+
```ts
|
|
148
|
+
import {
|
|
149
|
+
upload,
|
|
150
|
+
createContentVersion,
|
|
151
|
+
} from "@salesforce/ui-bundle-template-feature-vue-file-upload";
|
|
152
|
+
|
|
153
|
+
async function createRecordWithFiles(formData: Record<string, unknown>, files: File[]) {
|
|
154
|
+
// Step 1: Upload files (no recordId yet)
|
|
155
|
+
const uploadResults = await upload({ files });
|
|
156
|
+
|
|
157
|
+
// Step 2: Create the record
|
|
158
|
+
const newRecordId = await createRecord(formData);
|
|
159
|
+
|
|
160
|
+
// Step 3: Link uploaded files to the new record
|
|
161
|
+
for (const file of uploadResults) {
|
|
162
|
+
await createContentVersion(new File([""], file.fileName), file.contentBodyId, newRecordId);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Cancel Upload
|
|
168
|
+
|
|
169
|
+
Use an AbortController to cancel uploads:
|
|
170
|
+
|
|
171
|
+
```vue
|
|
172
|
+
<script setup lang="ts">
|
|
173
|
+
import { upload } from "@salesforce/ui-bundle-template-feature-vue-file-upload";
|
|
174
|
+
|
|
175
|
+
let abortController: AbortController | null = null;
|
|
176
|
+
|
|
177
|
+
const handleUpload = async (files: File[]) => {
|
|
178
|
+
abortController = new AbortController();
|
|
179
|
+
await upload({ files, signal: abortController.signal });
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
const cancelUpload = () => abortController?.abort();
|
|
183
|
+
</script>
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Building Your Own UI
|
|
187
|
+
|
|
188
|
+
Use the `upload()` API with reactive state:
|
|
189
|
+
|
|
190
|
+
```vue
|
|
191
|
+
<script setup lang="ts">
|
|
192
|
+
import { ref } from "vue";
|
|
193
|
+
import {
|
|
194
|
+
upload,
|
|
195
|
+
type FileUploadProgress,
|
|
196
|
+
} from "@salesforce/ui-bundle-template-feature-vue-file-upload";
|
|
197
|
+
|
|
198
|
+
const props = defineProps<{ recordId?: string }>();
|
|
199
|
+
const progress = ref(new Map<string, FileUploadProgress>());
|
|
200
|
+
|
|
201
|
+
const handleFileSelect = async (event: Event) => {
|
|
202
|
+
const files = Array.from((event.target as HTMLInputElement).files ?? []);
|
|
203
|
+
await upload({
|
|
204
|
+
files,
|
|
205
|
+
recordId: props.recordId,
|
|
206
|
+
onProgress: (fileProgress) => {
|
|
207
|
+
progress.value = new Map(progress.value).set(fileProgress.fileName, fileProgress);
|
|
208
|
+
},
|
|
209
|
+
});
|
|
210
|
+
};
|
|
211
|
+
</script>
|
|
212
|
+
|
|
213
|
+
<template>
|
|
214
|
+
<input type="file" multiple @change="handleFileSelect" />
|
|
215
|
+
<div v-for="[fileName, fileProgress] in progress" :key="fileName">
|
|
216
|
+
{{ fileName }}: {{ fileProgress.status }} - {{ fileProgress.progress }}%
|
|
217
|
+
<span v-if="fileProgress.error">Error: {{ fileProgress.error }}</span>
|
|
218
|
+
</div>
|
|
219
|
+
</template>
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
For a fuller custom UI, the copied `useFileUpload` composable gives you per-file state (`fileItems`, `allDone`), `handleFiles(files)`, `cancelFile(file)`, `abortAll()`, and `reset()`.
|
|
223
|
+
|
|
224
|
+
## API Reference
|
|
225
|
+
|
|
226
|
+
### upload(options)
|
|
227
|
+
|
|
228
|
+
```typescript
|
|
229
|
+
interface UploadOptions {
|
|
230
|
+
/** Files to upload */
|
|
231
|
+
files: File[];
|
|
232
|
+
/**
|
|
233
|
+
* Record ID to link files to (FirstPublishLocationId).
|
|
234
|
+
* - If provided: Creates ContentVersion and links to this record
|
|
235
|
+
* - If null/undefined: Only uploads file, returns contentBodyId only
|
|
236
|
+
*/
|
|
237
|
+
recordId?: string | null;
|
|
238
|
+
/** Callback for upload progress of each file */
|
|
239
|
+
onProgress?: (progress: FileUploadProgress) => void;
|
|
240
|
+
/** Optional abort signal to cancel all uploads */
|
|
241
|
+
signal?: AbortSignal;
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
**Returns:** `Promise<FileUploadResult[]>` — `{ fileName, size, contentBodyId, contentVersionId? }` per file. `contentBodyId` is `""` for a file whose upload failed.
|
|
246
|
+
|
|
247
|
+
### createContentVersion(file, contentBodyId, recordId)
|
|
248
|
+
|
|
249
|
+
Create a ContentVersion record from a previously uploaded file. Returns `Promise<string | undefined>` (the ContentVersion ID).
|
|
250
|
+
|
|
251
|
+
### getCurrentUserId()
|
|
252
|
+
|
|
253
|
+
Get the current user's Salesforce ID. Returns `Promise<string>`.
|
|
254
|
+
|
|
255
|
+
## Dependencies
|
|
256
|
+
|
|
257
|
+
- **@salesforce/ui-bundle** – `createRecord` and `getCurrentUser` (ui-api)
|
|
258
|
+
- **@salesforce/platform-sdk** – Data SDK `fetch` for the upload config
|
|
259
|
+
|
|
260
|
+
## Testing
|
|
261
|
+
|
|
262
|
+
Run the reference implementation locally against your default org:
|
|
263
|
+
|
|
264
|
+
```bash
|
|
265
|
+
npx nx run @salesforce/ui-bundle-template-feature-vue-file-upload:dev
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
Open `/upload-test` to try the drop-in component.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# List files or directories below to ignore them when running force:source:push, force:source:pull, and force:source:status
|
|
2
|
+
# More information: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_exclude_source.htm
|
|
3
|
+
#
|
|
4
|
+
|
|
5
|
+
package.xml
|
|
6
|
+
|
|
7
|
+
# LWC configuration files
|
|
8
|
+
**/jsconfig.json
|
|
9
|
+
**/.eslintrc.json
|
|
10
|
+
|
|
11
|
+
# LWC Jest
|
|
12
|
+
**/__tests__/**
|
|
13
|
+
|
|
14
|
+
node_modules/
|
|
15
|
+
.DS_Store
|
package/dist/.prettierrc
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"trailingComma": "none",
|
|
3
|
+
"plugins": [
|
|
4
|
+
"prettier-plugin-apex",
|
|
5
|
+
"@prettier/plugin-xml"
|
|
6
|
+
],
|
|
7
|
+
"overrides": [
|
|
8
|
+
{
|
|
9
|
+
"files": "**/lwc/**/*.html",
|
|
10
|
+
"options": { "parser": "lwc" }
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"files": "*.{cmp,page,component}",
|
|
14
|
+
"options": { "parser": "html" }
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|