import PlusIcon from "@lucide/svelte/icons/plus"; import Settings2Icon from "@lucide/svelte/icons/settings-2"; import PencilIcon from "@lucide/svelte/icons/pencil"; import { API } from "$lib/config/api"; export const searchFields = [ { key: "LocCode", label: "Location Code", type: "text", }, { key: "LocName", label: "Location Name", type: "text", }, { key: "LocType", label: "Location Type", type: "select", optionsEndpoint: `${API.BASE_URL}${API.VALUESET}/location_type`, }, ]; export const detailSections = [ { class: "grid grid-cols-2 gap-4 items-center", fields: [ { key: "SiteID", label: "Site" }, { key: "Parent", label: "Parent" }, { key: "LocCode", label: "Location Code" }, { key: "LocFull", label: "Location Name" }, { key: "LocType", label: "Location Type" }, { key: "Description", label: "Description" }, ] }, { title: "", class: "grid grid-cols-1 md:grid-cols-2 gap-4", groups: [ { class: "space-y-3", fields: [ { key: "Province", label: "Province" }, { key: "City", label: "City" }, { key: "PostCode", label: "ZIP" }, ] }, { class: "space-y-3", fields: [ { key: "Street1", label: "Street 1" }, { key: "Street2", label: "Street 2" }, ] } ] }, { class: "grid grid-cols-2 gap-4 items-center", fields: [ { key: "GeoLocationSystem", label: "Geo Location System" }, { key: "GeoLocationData", label: "Geo Location Data" }, ] }, ]; export function locationActions(masterDetail) { return [ { Icon: PlusIcon, label: 'Add Location', onClick: () => masterDetail.enterCreate(), }, { Icon: Settings2Icon, label: 'Search Parameters', }, ]; } export function viewActions(handlers){ return [ { Icon: PencilIcon, label: 'Edit Location', onClick: handlers.editLocation, }, ] }