├── .eslintignore ├── static ├── .nojekyll └── favicon.png ├── .npmrc ├── src ├── routes │ ├── +layout.ts │ ├── docs │ │ └── +page.server.ts │ ├── admin │ │ └── [crud] │ │ │ └── [operation] │ │ │ ├── +page.server.ts │ │ │ └── +page.svelte │ └── +page.svelte ├── lib │ ├── themes │ │ └── svelte │ │ │ ├── index.ts │ │ │ └── carbon │ │ │ ├── ViewFieldsComponents │ │ │ ├── DefaultField.svelte │ │ │ ├── ViewLabel.svelte │ │ │ ├── EmailField.svelte │ │ │ ├── DateField.svelte │ │ │ ├── CheckboxField.svelte │ │ │ ├── ToggleField.svelte │ │ │ ├── NumberField.svelte │ │ │ ├── TabsField.svelte │ │ │ ├── ColumnsField.svelte │ │ │ ├── KeyValueObjectField.svelte │ │ │ ├── ArrayField.svelte │ │ │ ├── CheckboxField.test.ts │ │ │ ├── UrlField.svelte │ │ │ ├── DefaultField.test.ts │ │ │ ├── DateField.test.ts │ │ │ ├── EmailField.test.ts │ │ │ ├── CrudEntityField.svelte │ │ │ ├── ArrayField.test.ts │ │ │ ├── KeyValueObjectField.test.ts │ │ │ └── NumberField.test.ts │ │ │ ├── DataTable │ │ │ ├── Toolbar │ │ │ │ ├── ToolbarFilter.svelte │ │ │ │ ├── ToolbarAction.svelte │ │ │ │ └── DataTableToolbar.svelte │ │ │ └── actions │ │ │ │ ├── ItemActions.svelte │ │ │ │ └── SingleAction.svelte │ │ │ ├── FormFieldsComponents │ │ │ ├── EmailField.svelte │ │ │ ├── DefaultField.svelte │ │ │ ├── TabsField.svelte │ │ │ ├── ColumnsField.svelte │ │ │ ├── NumberField.svelte │ │ │ ├── TextareaField.svelte │ │ │ ├── TextField.svelte │ │ │ ├── ToggleField.svelte │ │ │ ├── UrlField.svelte │ │ │ ├── CheckboxField.svelte │ │ │ ├── EmailField.test.ts │ │ │ ├── ArrayField.svelte │ │ │ ├── DefaultField.test.ts │ │ │ ├── DateField.svelte │ │ │ ├── CrudEntityField.svelte │ │ │ └── KeyValueObjectField.svelte │ │ │ ├── FilterComponents │ │ │ ├── TextFilter.svelte │ │ │ ├── NumericFilter.svelte │ │ │ ├── Internal │ │ │ │ └── FilterContainer.svelte │ │ │ ├── DateRangeFilter.svelte │ │ │ └── BooleanFilter.svelte │ │ │ ├── lib │ │ │ └── ThemeChangeMenu.ts │ │ │ ├── Menu │ │ │ ├── TopMenu.svelte │ │ │ ├── TopLeftMenu.svelte │ │ │ ├── SideMenu.svelte │ │ │ └── TopRightMenu.svelte │ │ │ ├── Crud │ │ │ ├── CrudNew.svelte │ │ │ ├── CrudFormField.svelte │ │ │ ├── CrudViewField.svelte │ │ │ ├── CrudDelete.svelte │ │ │ ├── CrudView.svelte │ │ │ ├── CrudForm.svelte │ │ │ ├── CrudEdit.svelte │ │ │ └── CrudList.svelte │ │ │ ├── Tabs │ │ │ └── Tabs.svelte │ │ │ ├── Layout │ │ │ └── AdminLayout.svelte │ │ │ ├── Columns │ │ │ ├── Columns.svelte │ │ │ └── Columns.test.ts │ │ │ ├── Dashboard │ │ │ └── Dashboard.svelte │ │ │ └── index.ts │ ├── TestOptions.ts │ ├── Fields │ │ ├── Toggle.ts │ │ ├── Email.ts │ │ ├── Checkbox.ts │ │ ├── Url.ts │ │ ├── Textarea.ts │ │ ├── Date.ts │ │ ├── Number.ts │ │ ├── Text.ts │ │ ├── Tabs.ts │ │ ├── Array.ts │ │ ├── KeyValueObject.ts │ │ ├── CrudEntity.ts │ │ ├── index.ts │ │ └── Columns.ts │ ├── Config.ts │ ├── Pagination.ts │ ├── Layout │ │ └── Icon.svelte │ ├── Menu.ts │ ├── DataTable.ts │ ├── StateProvider.test.ts │ ├── StateProvider.ts │ ├── index.ts │ ├── StateProcessor.ts │ ├── Request.test.ts │ ├── StateProcessor.test.ts │ ├── i18n.ts │ ├── Request.ts │ ├── Filter.ts │ ├── DataTable.test.ts │ ├── Notification.ts │ ├── Crud │ │ ├── Form.ts │ │ ├── Form.test.ts │ │ ├── index.test.ts │ │ ├── index.ts │ │ └── Operations.ts │ ├── translations │ │ ├── en.ts │ │ └── fr.ts │ ├── types.ts │ ├── Actions.test.ts │ ├── Dashboard.test.ts │ ├── Actions.ts │ └── Dashboard.ts ├── testApp │ ├── translations │ │ └── fr.ts │ ├── internal │ │ ├── authorsInternal.ts │ │ ├── booksInternal.ts │ │ ├── testsInternal.ts │ │ └── memoryStorage.ts │ ├── Dashboard.ts │ ├── AuthorCrud.ts │ └── BookCrud.ts ├── app.d.ts └── app.html ├── docs-src ├── backoffice_edit.png ├── backoffice_list.png └── backoffice_view.png ├── bin ├── templates │ ├── carbonViewField.svelte │ ├── carbonFormField.svelte │ └── TemplateField.ts ├── package.json ├── pnpm-lock.yaml └── create_theme.mjs ├── .prettierignore ├── .prettierrc ├── .gitignore ├── typedoc.json ├── test_cli.js ├── .npmignore ├── tsconfig.json ├── vite.config.ts ├── svelte.config.js ├── .github └── workflows │ ├── CI.yaml │ └── pages.yaml ├── .eslintrc.cjs └── package.json /.eslintignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | engine-strict=true 2 | -------------------------------------------------------------------------------- /src/routes/+layout.ts: -------------------------------------------------------------------------------- 1 | export const trailingSlash = 'always'; 2 | -------------------------------------------------------------------------------- /src/routes/docs/+page.server.ts: -------------------------------------------------------------------------------- 1 | export const prerender = false; 2 | -------------------------------------------------------------------------------- /src/lib/themes/svelte/index.ts: -------------------------------------------------------------------------------- 1 | export { default as carbon } from './carbon'; 2 | -------------------------------------------------------------------------------- /static/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbitale/SvelteAdmin/HEAD/static/favicon.png -------------------------------------------------------------------------------- /docs-src/backoffice_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbitale/SvelteAdmin/HEAD/docs-src/backoffice_edit.png -------------------------------------------------------------------------------- /docs-src/backoffice_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbitale/SvelteAdmin/HEAD/docs-src/backoffice_list.png -------------------------------------------------------------------------------- /docs-src/backoffice_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbitale/SvelteAdmin/HEAD/docs-src/backoffice_view.png -------------------------------------------------------------------------------- /src/lib/TestOptions.ts: -------------------------------------------------------------------------------- 1 | import type { TestOptions } from 'vitest'; 2 | 3 | export const testOptions: TestOptions = { 4 | repeats: process.env.REPEAT ? parseInt(process.env.REPEAT) : undefined 5 | }; 6 | -------------------------------------------------------------------------------- /bin/templates/carbonViewField.svelte: -------------------------------------------------------------------------------- 1 | 8 | 9 | {value} 10 | -------------------------------------------------------------------------------- /src/lib/themes/svelte/carbon/ViewFieldsComponents/DefaultField.svelte: -------------------------------------------------------------------------------- 1 | 8 | 9 | {value} 10 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /build 4 | /.svelte-kit 5 | /package 6 | .env 7 | .env.* 8 | !.env.example 9 | 10 | # Ignore files for PNPM, NPM and YARN 11 | pnpm-lock.yaml 12 | package-lock.json 13 | yarn.lock 14 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "useTabs": true, 3 | "singleQuote": true, 4 | "trailingComma": "none", 5 | "printWidth": 100, 6 | "plugins": ["prettier-plugin-svelte"], 7 | "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }] 8 | } 9 | -------------------------------------------------------------------------------- /src/testApp/translations/fr.ts: -------------------------------------------------------------------------------- 1 | import type { Dictionary } from '$lib/i18n'; 2 | 3 | const dictionary: Dictionary = { 4 | Book: 'Livre', 5 | Books: 'Livres', 6 | Homepage: 'Accueil', 7 | Title: 'Titre' 8 | }; 9 | 10 | export default dictionary; 11 | -------------------------------------------------------------------------------- /src/lib/themes/svelte/carbon/ViewFieldsComponents/ViewLabel.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | {$_(field.label)} 10 | 11 | -------------------------------------------------------------------------------- /bin/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "svelte-admin-bin", 3 | "version": "0.1.0", 4 | "main": "create_field.cjs", 5 | "license": "proprietary", 6 | "scripts": { 7 | "create": "node create_field.mjs" 8 | }, 9 | "devDependencies": { 10 | "chalk": "^5.3.0", 11 | "prompts": "^2.4.2" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /build 4 | /dist 5 | /.svelte-kit 6 | /package 7 | .env 8 | .env.* 9 | !.env.example 10 | vite.config.js.timestamp-* 11 | vite.config.ts.timestamp-* 12 | coverage/ 13 | 14 | /web-components 15 | 16 | # For when running "npm pack" 17 | orbitale-svelte-admin-*.tgz 18 | -------------------------------------------------------------------------------- /src/lib/themes/svelte/carbon/ViewFieldsComponents/EmailField.svelte: -------------------------------------------------------------------------------- 1 | 6 | 7 | {#if value !== '' && value && value.length > 0} 8 | {value} 9 | {:else} 10 | - 11 | {/if} 12 | -------------------------------------------------------------------------------- /src/app.d.ts: -------------------------------------------------------------------------------- 1 | // See https://kit.svelte.dev/docs/types#app 2 | // for information about these interfaces 3 | declare global { 4 | namespace App { 5 | // interface Error {} 6 | // interface Locals {} 7 | // interface PageData {} 8 | // interface PageState {} 9 | // interface Platform {} 10 | } 11 | } 12 | 13 | export {}; 14 | -------------------------------------------------------------------------------- /src/app.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %sveltekit.head% 8 | 9 | 10 |
%sveltekit.body%
11 | 12 | 13 | -------------------------------------------------------------------------------- /src/lib/Fields/Toggle.ts: -------------------------------------------------------------------------------- 1 | import type { CommonFieldOptions, FormFieldTheme, ViewFieldTheme } from '$lib'; 2 | import { BaseField } from '$lib/Fields'; 3 | 4 | /** */ 5 | export type ToggleOptions = CommonFieldOptions; 6 | 7 | /** */ 8 | export class ToggleField extends BaseField { 9 | readonly formComponent: FormFieldTheme = 'toggle'; 10 | readonly viewComponent: ViewFieldTheme = 'toggle'; 11 | } 12 | -------------------------------------------------------------------------------- /src/lib/Fields/Email.ts: -------------------------------------------------------------------------------- 1 | import type { InputFieldOptions, FormFieldTheme, ViewFieldTheme } from '$lib'; 2 | import { BaseField } from '$lib/Fields'; 3 | 4 | /** */ 5 | export type EmailFieldOptions = InputFieldOptions & {}; 6 | 7 | /** */ 8 | export class EmailField extends BaseField { 9 | readonly formComponent: FormFieldTheme = 'email'; 10 | readonly viewComponent: ViewFieldTheme = 'email'; 11 | } 12 | -------------------------------------------------------------------------------- /typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "entryPoints": ["src/lib/*.ts", "src/lib/**/*.ts", "src/themes/*.ts", "src/themes/**/*.ts"], 3 | "out": "build/apidocs", 4 | "exclude": ["**/*+(index|.spec|.e2e).ts"], 5 | "disableGit": true, 6 | "disableSources": true, 7 | "excludeExternals": false, 8 | "excludeNotDocumented": true, 9 | "excludePrivate": true, 10 | "excludeReferences": true, 11 | "plugin": ["typedoc-plugin-mdn-links"] 12 | } 13 | -------------------------------------------------------------------------------- /src/lib/Fields/Checkbox.ts: -------------------------------------------------------------------------------- 1 | import type { CommonFieldOptions, FormFieldTheme, ViewFieldTheme } from '$lib'; 2 | import { BaseField } from '$lib/Fields'; 3 | 4 | /** */ 5 | export type CheckboxOptions = CommonFieldOptions; 6 | 7 | /** */ 8 | export class CheckboxField extends BaseField { 9 | readonly formComponent: FormFieldTheme = 'checkbox'; 10 | readonly viewComponent: ViewFieldTheme = 'checkbox'; 11 | } 12 | -------------------------------------------------------------------------------- /src/lib/Fields/Url.ts: -------------------------------------------------------------------------------- 1 | import type { InputFieldOptions, FormFieldTheme, ViewFieldTheme } from '$lib'; 2 | import { BaseField } from '$lib/Fields'; 3 | 4 | /** */ 5 | export type UrlOptions = InputFieldOptions & { 6 | openInNewTab?: boolean; 7 | }; 8 | 9 | /** */ 10 | export class UrlField extends BaseField { 11 | readonly formComponent: FormFieldTheme = 'url'; 12 | readonly viewComponent: ViewFieldTheme = 'url'; 13 | } 14 | -------------------------------------------------------------------------------- /test_cli.js: -------------------------------------------------------------------------------- 1 | import { load_config } from './node_modules/@sveltejs/kit/src/core/config/index.js'; 2 | import { all } from './node_modules/@sveltejs/kit/src/core/sync/sync.js'; 3 | 4 | (async () => { 5 | console.info('Testing.'); 6 | 7 | const conf = await load_config(); 8 | 9 | const manifest_data = all(conf, 'development'); 10 | 11 | const routes = manifest_data.manifest_data.routes; 12 | 13 | console.info(routes); 14 | })(); 15 | -------------------------------------------------------------------------------- /src/lib/Fields/Textarea.ts: -------------------------------------------------------------------------------- 1 | import type { TextOptions, FormFieldTheme, ViewFieldTheme } from '$lib'; 2 | import { BaseField } from '$lib/Fields'; 3 | 4 | /** */ 5 | export type TextareaOptions = TextOptions & { 6 | rows?: number; 7 | }; 8 | 9 | /** */ 10 | export class TextareaField extends BaseField { 11 | readonly formComponent: FormFieldTheme = 'textarea'; 12 | readonly viewComponent: ViewFieldTheme = 'textarea'; 13 | } 14 | -------------------------------------------------------------------------------- /src/lib/Config.ts: -------------------------------------------------------------------------------- 1 | /** */ 2 | export type AdminConfig = { 3 | defaultLocale: string; 4 | autoCloseSideMenu: boolean; 5 | rootUrl: string; 6 | head: { 7 | brandName: string; 8 | appName: string; 9 | }; 10 | }; 11 | 12 | export function defaultAdminConfig(): AdminConfig { 13 | return { 14 | defaultLocale: 'en', 15 | autoCloseSideMenu: false, 16 | rootUrl: '/', 17 | head: { 18 | appName: '', 19 | brandName: '' 20 | } 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /src/lib/themes/svelte/carbon/ViewFieldsComponents/DateField.svelte: -------------------------------------------------------------------------------- 1 | 15 | 16 | {value.substring(0, 10)} 17 | -------------------------------------------------------------------------------- /src/lib/Fields/Date.ts: -------------------------------------------------------------------------------- 1 | import type { InputFieldOptions, FormFieldTheme, ViewFieldTheme } from '$lib'; 2 | import { BaseField } from '$lib/Fields'; 3 | 4 | /** */ 5 | export type DateOptions = InputFieldOptions & { 6 | formFormat?: string; // Default: 'Y-m-d' 7 | }; 8 | 9 | /** */ 10 | export class DateField extends BaseField { 11 | readonly formComponent: FormFieldTheme = 'date'; 12 | readonly viewComponent: ViewFieldTheme = 'date'; 13 | } 14 | -------------------------------------------------------------------------------- /src/lib/Fields/Number.ts: -------------------------------------------------------------------------------- 1 | import type { InputFieldOptions, FormFieldTheme, ViewFieldTheme } from '$lib'; 2 | import { BaseField } from '$lib/Fields'; 3 | 4 | /** */ 5 | export type NumberOptions = InputFieldOptions & { 6 | min?: number; 7 | max?: number; 8 | }; 9 | 10 | /** */ 11 | export class NumberField extends BaseField { 12 | readonly formComponent: FormFieldTheme = 'number'; 13 | readonly viewComponent: ViewFieldTheme = 'number'; 14 | } 15 | -------------------------------------------------------------------------------- /src/lib/Fields/Text.ts: -------------------------------------------------------------------------------- 1 | import type { InputFieldOptions, FormFieldTheme, ViewFieldTheme } from '$lib'; 2 | import { BaseField } from '$lib/Fields'; 3 | 4 | /** */ 5 | export type TextOptions = InputFieldOptions & { 6 | maxLength?: number; 7 | stripTags?: boolean; 8 | }; 9 | 10 | /** */ 11 | export class TextField extends BaseField { 12 | readonly formComponent: FormFieldTheme = 'text'; 13 | readonly viewComponent: ViewFieldTheme = 'text'; 14 | } 15 | -------------------------------------------------------------------------------- /src/lib/themes/svelte/carbon/DataTable/Toolbar/ToolbarFilter.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/routes/admin/[crud]/[operation]/+page.server.ts: -------------------------------------------------------------------------------- 1 | import { dashboard } from '../../../../testApp/Dashboard'; 2 | 3 | export const prerender = true; 4 | 5 | /** @type {import('./$types').EntryGenerator} */ 6 | export function entries() { 7 | const routes = []; 8 | 9 | for (const crud of dashboard.cruds) { 10 | for (const operation of crud.options.operations) { 11 | routes.push({ 12 | crud: crud.name, 13 | operation: operation.name 14 | }); 15 | } 16 | } 17 | 18 | return routes; 19 | } 20 | -------------------------------------------------------------------------------- /src/lib/themes/svelte/carbon/ViewFieldsComponents/CheckboxField.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | {#if value} 13 | 14 | {:else} 15 | 16 | {/if} 17 | -------------------------------------------------------------------------------- /bin/templates/carbonFormField.svelte: -------------------------------------------------------------------------------- 1 | 8 | 9 | 16 | -------------------------------------------------------------------------------- /src/lib/themes/svelte/carbon/ViewFieldsComponents/ToggleField.svelte: -------------------------------------------------------------------------------- 1 | 12 | 13 | setTimeout(() => (boundValue = baseValue))} 16 | hideLabel 17 | labelA="" 18 | labelB="" 19 | /> 20 | -------------------------------------------------------------------------------- /bin/templates/TemplateField.ts: -------------------------------------------------------------------------------- 1 | import type { InputFieldOptions, FormFieldTheme, ViewFieldTheme } from '$lib'; 2 | import { BaseField } from '$lib/Fields'; 3 | 4 | /** */ 5 | export type __fullPascalCase__Options = InputFieldOptions & { 6 | // __fullPascalCase__ specific options 7 | }; 8 | 9 | /** */ 10 | export class __fullPascalCase__ extends BaseField<__fullPascalCase__Options> { 11 | readonly formComponent: FormFieldTheme = '__baseSnakeCase__'; 12 | readonly viewComponent: ViewFieldTheme = '__baseSnakeCase__'; 13 | } 14 | -------------------------------------------------------------------------------- /src/lib/themes/svelte/carbon/ViewFieldsComponents/NumberField.svelte: -------------------------------------------------------------------------------- 1 | 9 | 10 | {#if value !== undefined && isNaN(value)} 11 | NaN 12 | {:else if value !== 0 && !value} 13 | No value 14 | {:else} 15 | {value} 16 | {/if} 17 | -------------------------------------------------------------------------------- /src/lib/Pagination.ts: -------------------------------------------------------------------------------- 1 | /** */ 2 | export class PaginatedResults { 3 | constructor( 4 | public readonly currentPage: number, 5 | public readonly numberOfPages: number, 6 | public readonly numberOfItems: number, 7 | public readonly currentItems: Array 8 | ) {} 9 | } 10 | 11 | /** */ 12 | export type PaginationOptions = { 13 | enabled: boolean; 14 | itemsPerPage: number; 15 | }; 16 | 17 | /** */ 18 | export function defaultPaginationOptions(): PaginationOptions { 19 | return { 20 | enabled: true, 21 | itemsPerPage: 10 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /src/lib/themes/svelte/carbon/FormFieldsComponents/EmailField.svelte: -------------------------------------------------------------------------------- 1 | 8 | 9 | 17 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .env 3 | .env.* 4 | .eslintignore 5 | .eslintrc.cjs 6 | .github 7 | .gitignore 8 | .idea 9 | .npmrc 10 | .prettierignore 11 | .prettierrc 12 | .svelte-kit 13 | bin 14 | build 15 | coverage 16 | dist 17 | docs-src 18 | node_modules 19 | orbitale-svelte-admin-*.tgz 20 | package 21 | static 22 | svelte.config.js 23 | typedoc.json 24 | vite.config.js.timestamp-* 25 | vite.config.ts 26 | vite.config.ts.timestamp-* 27 | vite.lib.config.ts 28 | vite.webcomponents.config.ts 29 | yarn-error.log 30 | yarn.lock 31 | dist/ 32 | src/testApp/* 33 | src/app.html 34 | src/app.d.ts 35 | -------------------------------------------------------------------------------- /src/lib/themes/svelte/carbon/FormFieldsComponents/DefaultField.svelte: -------------------------------------------------------------------------------- 1 | 8 | 9 | 17 | -------------------------------------------------------------------------------- /src/routes/admin/[crud]/[operation]/+page.svelte: -------------------------------------------------------------------------------- 1 | 12 | 13 | {#key $page} 14 | 21 | {/key} 22 | -------------------------------------------------------------------------------- /src/lib/themes/svelte/carbon/FormFieldsComponents/TabsField.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/lib/themes/svelte/carbon/ViewFieldsComponents/TabsField.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./.svelte-kit/tsconfig.json", 3 | "compilerOptions": { 4 | "allowJs": true, 5 | "checkJs": true, 6 | "esModuleInterop": true, 7 | "forceConsistentCasingInFileNames": true, 8 | "resolveJsonModule": true, 9 | "skipLibCheck": true, 10 | "sourceMap": true, 11 | "strict": true, 12 | "moduleResolution": "bundler" 13 | } 14 | // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias 15 | // 16 | // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes 17 | // from the referenced tsconfig.json - TypeScript does not merge them in 18 | } 19 | -------------------------------------------------------------------------------- /src/lib/themes/svelte/carbon/FormFieldsComponents/ColumnsField.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/lib/themes/svelte/carbon/ViewFieldsComponents/ColumnsField.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/lib/themes/svelte/carbon/FilterComponents/TextFilter.svelte: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 19 | 20 | -------------------------------------------------------------------------------- /src/lib/themes/svelte/carbon/FormFieldsComponents/NumberField.svelte: -------------------------------------------------------------------------------- 1 | 15 | 16 | 25 | -------------------------------------------------------------------------------- /vite.config.ts: -------------------------------------------------------------------------------- 1 | import { sveltekit } from '@sveltejs/kit/vite'; 2 | import { defineConfig } from 'vite'; 3 | import { configDefaults } from 'vitest/config'; 4 | import { svelteTesting } from '@testing-library/svelte/vite'; 5 | import { resolve } from 'path'; 6 | 7 | export default defineConfig({ 8 | plugins: [sveltekit(), svelteTesting()], 9 | resolve: { 10 | alias: { 11 | $lib: resolve(__dirname, 'src/lib') 12 | } 13 | }, 14 | test: { 15 | include: ['src/**/*.{test,spec}.ts'], 16 | exclude: [...configDefaults.exclude, '**/build/**', '**/.svelte-kit/**', '**/dist/**'], 17 | globals: true, 18 | environment: 'jsdom', 19 | coverage: { 20 | include: ['src/lib/'] 21 | } 22 | } 23 | }); 24 | -------------------------------------------------------------------------------- /src/lib/themes/svelte/carbon/FilterComponents/NumericFilter.svelte: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 20 | 21 | -------------------------------------------------------------------------------- /src/lib/Layout/Icon.svelte: -------------------------------------------------------------------------------- 1 | 17 | 18 | {#if icon instanceof SvelteComponent || typeof icon === 'function' || typeof icon?.$$render !== 'undefined'} 19 | 20 | {:else if typeof icon === 'string'} 21 | {icon} 22 | {:else} 23 | {(icon || '').toString()} 24 | {/if} 25 | -------------------------------------------------------------------------------- /src/lib/Menu.ts: -------------------------------------------------------------------------------- 1 | import { type Action, type ActionIcon, type ActionOptions, DefaultAction } from '$lib'; 2 | 3 | type Optional = T | null | undefined; 4 | 5 | /** */ 6 | export type MenuLink = Action; 7 | 8 | /** */ 9 | export class Submenu extends DefaultAction { 10 | private readonly _links: Array; 11 | 12 | get links(): Array { 13 | return this._links; 14 | } 15 | 16 | constructor( 17 | label: string, 18 | icon: Optional, 19 | links: Array, 20 | options?: ActionOptions 21 | ) { 22 | super(label, icon, options); 23 | this._links = links; 24 | } 25 | } 26 | 27 | /** */ 28 | export class Divider extends DefaultAction { 29 | constructor() { 30 | super('divider', undefined, {}); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/lib/themes/svelte/carbon/DataTable/actions/ItemActions.svelte: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | {#each actions as action} 16 | 17 | 18 | 19 | {/each} 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/lib/themes/svelte/carbon/ViewFieldsComponents/KeyValueObjectField.svelte: -------------------------------------------------------------------------------- 1 | 15 | 16 | {#if value === undefined} 17 | No value 18 | {:else if displayValue === undefined} 19 | Not found 20 | {:else} 21 | {displayValue} 22 | {/if} 23 | -------------------------------------------------------------------------------- /src/lib/themes/svelte/carbon/FormFieldsComponents/TextareaField.svelte: -------------------------------------------------------------------------------- 1 | 15 | 16 |