Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/development' into feat-nuxt-st…
Browse files Browse the repository at this point in the history
…onecrop
  • Loading branch information
Rohan Bansal committed Dec 13, 2024
2 parents f2343dd + 809a481 commit 5a13335
Show file tree
Hide file tree
Showing 115 changed files with 9,992 additions and 6,077 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.11.0
20.12.2
12 changes: 12 additions & 0 deletions aform/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"name": "@stonecrop/aform",
"entries": [
{
"version": "0.2.65",
"tag": "@stonecrop/aform_v0.2.65",
"date": "Fri, 13 Dec 2024 06:53:37 GMT",
"comments": {
"patch": [
{
"comment": "fix typings path"
}
]
}
},
{
"version": "0.2.64",
"tag": "@stonecrop/aform_v0.2.64",
Expand Down
9 changes: 8 additions & 1 deletion aform/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Change Log - @stonecrop/aform

This log was last generated on Wed, 11 Dec 2024 07:45:13 GMT and should not be manually modified.
This log was last generated on Fri, 13 Dec 2024 06:53:37 GMT and should not be manually modified.

## 0.2.65
Fri, 13 Dec 2024 06:53:37 GMT

### Patches

- fix typings path

## 0.2.64
Wed, 11 Dec 2024 07:45:13 GMT
Expand Down
12 changes: 6 additions & 6 deletions aform/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stonecrop/aform",
"version": "0.2.64",
"version": "0.2.65",
"license": "MIT",
"type": "module",
"author": {
Expand All @@ -18,14 +18,14 @@
"exports": {
".": {
"import": {
"types": "./dist/aform/src/index.d.ts",
"types": "./dist/src/index.d.ts",
"default": "./dist/aform.js"
},
"require": "./dist/aform.umd.cjs"
},
"./styles": "./dist/assets/index.css"
},
"typings": "./dist/aform/src/index.d.ts",
"typings": "./dist/src/index.d.ts",
"files": [
"dist/*",
"src/*"
Expand All @@ -48,8 +48,8 @@
"vue": "^3.5.11"
},
"devDependencies": {
"@microsoft/api-documenter": "^7.25.3",
"@rushstack/heft": "^0.67.2",
"@microsoft/api-documenter": "^7.26.2",
"@rushstack/heft": "^0.68.6",
"@stonecrop/atable": "workspace:*",
"@typescript-eslint/eslint-plugin": "^7.14.1",
"@typescript-eslint/parser": "^7.14.1",
Expand All @@ -63,7 +63,7 @@
"eslint": "^8.40.0",
"jsdom": "^25.0.0",
"stonecrop-rig": "workspace:*",
"typescript": "^5.5.2",
"typescript": "^5.6.3",
"vite-plugin-lib-inject-css": "^2.1.1",
"vite": "^5.4.5",
"vitest": "^2.1.1",
Expand Down
28 changes: 14 additions & 14 deletions aform/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { App } from 'vue'

import ACheckbox from '@/components/form/ACheckbox.vue'
import AComboBox from '@/components/form/AComboBox.vue'
import ADate from '@/components/form/ADate.vue'
import ADropdown from '@/components/form/ADropdown.vue'
import ADatePicker from '@/components/form/ADatePicker.vue'
import AFieldset from '@/components/form/AFieldset.vue'
import AFileAttach from '@/components/form/AFileAttach.vue'
import AForm from '@/components/AForm.vue'
import ANumericInput from '@/components/form/ANumericInput.vue'
import ATextInput from '@/components/form/ATextInput.vue'
import Login from '@/components/utilities/Login.vue'
export type { BasicSchema, FormSchema, TableSchema, FieldsetSchema, SchemaTypes } from '@/types'
// import { ACurrency } from '@/components/form/ACurrency.vue'
// import { AQuantity } from '@/components/form/AQuantity.vue'
import ACheckbox from './components/form/ACheckbox.vue'
import AComboBox from './components/form/AComboBox.vue'
import ADate from './components/form/ADate.vue'
import ADropdown from './components/form/ADropdown.vue'
import ADatePicker from './components/form/ADatePicker.vue'
import AFieldset from './components/form/AFieldset.vue'
import AFileAttach from './components/form/AFileAttach.vue'
import AForm from './components/AForm.vue'
import ANumericInput from './components/form/ANumericInput.vue'
import ATextInput from './components/form/ATextInput.vue'
import Login from './components/utilities/Login.vue'
export type { BasicSchema, FormSchema, TableSchema, FieldsetSchema, SchemaTypes } from './types'
// import { ACurrency } from './components/form/ACurrency.vue'
// import { AQuantity } from './components/form/AQuantity.vue'

/**
* Install all AForm components
Expand Down
32 changes: 28 additions & 4 deletions aform/src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import ATable from '@stonecrop/atable'
import type { TableColumn, TableConfig, TableRow } from '@stonecrop/atable'

/**
* Defined props for AForm components
* @public
*/
export type ComponentProps = {
label?: string
mask?: string
Expand All @@ -9,12 +13,20 @@ export type ComponentProps = {
validation?: Record<string, any>
}

/**
* Base schemda for AForm components
* @beta
*/
export type BasicSchema = {
component: string
fieldname: string
value: any
}

/**
* Form schema
* @beta
*/
export type FormSchema = BasicSchema & {
align: string
edit: boolean
Expand All @@ -25,16 +37,28 @@ export type FormSchema = BasicSchema & {
mask?: string
}

/**
* Table schema
* @beta
*/
export type TableSchema = BasicSchema & {
columns: ATable.TableColumn[]
config: ATable.TableConfig
rows: ATable.TableRow[]
columns: TableColumn[]
config: TableConfig
rows: TableRow[]
}

/**
* Fieldset schema
* @beta
*/
export type FieldsetSchema = BasicSchema & {
label: string
schema: (FormSchema | TableSchema)[]
collapsible?: boolean
}

/**
* Superset of schema types
* @public
*/
export type SchemaTypes = FormSchema | TableSchema | FieldsetSchema
2 changes: 1 addition & 1 deletion aform/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"types/*": ["./src/types/*"]
}
},
"include": ["src/**/*", "src/**/*.ts", "src/**/*.vue", "tests/**/*.spec.ts", "tests/**/*.ts", "tests/**/*.vue"]
"include": ["src/**/*.ts", "src/**/*.vue", "tests/**/*.spec.ts", "tests/**/*.ts", "tests/**/*.vue"]
}
12 changes: 12 additions & 0 deletions atable/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"name": "@stonecrop/atable",
"entries": [
{
"version": "0.2.65",
"tag": "@stonecrop/atable_v0.2.65",
"date": "Fri, 13 Dec 2024 06:53:37 GMT",
"comments": {
"patch": [
{
"comment": "externalize pinia dependency"
}
]
}
},
{
"version": "0.2.64",
"tag": "@stonecrop/atable_v0.2.64",
Expand Down
9 changes: 8 additions & 1 deletion atable/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Change Log - @stonecrop/atable

This log was last generated on Wed, 11 Dec 2024 07:45:13 GMT and should not be manually modified.
This log was last generated on Fri, 13 Dec 2024 06:53:37 GMT and should not be manually modified.

## 0.2.65
Fri, 13 Dec 2024 06:53:37 GMT

### Patches

- externalize pinia dependency

## 0.2.64
Wed, 11 Dec 2024 07:45:13 GMT
Expand Down
12 changes: 6 additions & 6 deletions atable/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stonecrop/atable",
"version": "0.2.64",
"version": "0.2.65",
"license": "MIT",
"type": "module",
"author": {
Expand All @@ -18,14 +18,14 @@
"exports": {
".": {
"import": {
"types": "./dist/atable/src/index.d.ts",
"types": "./dist/src/index.d.ts",
"default": "./dist/atable.js"
},
"require": "./dist/atable.umd.cjs"
},
"./styles": "./dist/assets/index.css"
},
"typings": "./dist/atable/src/index.d.ts",
"typings": "./dist/src/index.d.ts",
"files": [
"dist/*",
"src/*"
Expand Down Expand Up @@ -53,8 +53,8 @@
"vue": "^3.5.11"
},
"devDependencies": {
"@microsoft/api-documenter": "^7.25.3",
"@rushstack/heft": "^0.67.2",
"@microsoft/api-documenter": "^7.26.2",
"@rushstack/heft": "^0.68.6",
"@typescript-eslint/eslint-plugin": "^7.14.1",
"@typescript-eslint/parser": "^7.14.1",
"@vitejs/plugin-vue": "^5.1.3",
Expand All @@ -67,7 +67,7 @@
"eslint": "^8.40.0",
"jsdom": "^25.0.0",
"stonecrop-rig": "workspace:*",
"typescript": "^5.5.2",
"typescript": "^5.6.3",
"vite-plugin-lib-inject-css": "^2.1.1",
"vite": "^5.4.5",
"vitest": "^2.1.1",
Expand Down
20 changes: 8 additions & 12 deletions atable/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
import { createPinia } from 'pinia'
import { App } from 'vue'

import ACell from '@/components/ACell.vue'
import AExpansionRow from '@/components/AExpansionRow.vue'
import ARow from '@/components/ARow.vue'
import ATable from '@/components/ATable.vue'
import ATableHeader from '@/components/ATableHeader.vue'
import ATableModal from '@/components/ATableModal.vue'
export { createTableStore } from '@/stores/table'
export type { CellContext, TableColumn, TableConfig, TableDisplay, TableRow, TableModal } from '@/types'
import ACell from './components/ACell.vue'
import AExpansionRow from './components/AExpansionRow.vue'
import ARow from './components/ARow.vue'
import ATable from './components/ATable.vue'
import ATableHeader from './components/ATableHeader.vue'
import ATableModal from './components/ATableModal.vue'
export { createTableStore } from './stores/table'
export type { CellContext, TableColumn, TableConfig, TableDisplay, TableRow, TableModal } from './types'

/**
* Install all ATable components
* @param app - Vue app instance
* @public
*/
function install(app: App /* options */) {
const pinia = createPinia()
app.use(pinia)

app.component('ACell', ACell)
app.component('AExpansionRow', AExpansionRow)
app.component('ARow', ARow)
Expand Down
6 changes: 6 additions & 0 deletions atable/src/stores/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ import { type CSSProperties, computed, ref } from 'vue'

import type { CellContext, TableColumn, TableConfig, TableDisplay, TableModal, TableRow } from '@/types'

/**
* Create a table store
* @param initData - Initial data for the table store
* @returns table store instance
* @public
*/
export const createTableStore = (initData: {
columns: TableColumn[]
rows: TableRow[]
Expand Down
24 changes: 24 additions & 0 deletions atable/src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* Table column definition.
* @public
*/
export type TableColumn = {
name: string

Expand All @@ -17,12 +21,20 @@ export type TableColumn = {
mask?: (value: any) => any
}

/**
* Table cell context definition.
* @public
*/
export type CellContext = {
row: TableRow
column: TableColumn
table: { [key: string]: any }
}

/**
* Table configuration definition.
* @public
*/
export type TableConfig = {
/**
* The type of view to display the table in. Possible values:
Expand All @@ -35,6 +47,10 @@ export type TableConfig = {
fullWidth?: boolean
}

/**
* Table display definition.
* @public
*/
export type TableDisplay = {
childrenOpen?: boolean
expanded?: boolean
Expand All @@ -46,12 +62,20 @@ export type TableDisplay = {
rowModified?: boolean
}

/**
* Table row definition.
* @public
*/
export type TableRow = {
[key: string]: any
indent?: number
parent?: number
}

/**
* Table modal definition.
* @public
*/
export type TableModal = {
colIndex?: number
event?: string
Expand Down
2 changes: 1 addition & 1 deletion atable/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"types/*": ["./src/types/*"]
}
},
"include": ["src/**/*", "src/**/*.ts", "src/**/*.vue", "tests/**/*.ts", "tests/**/*.vue"]
"include": ["src/**/*.ts", "src/**/*.vue", "tests/**/*.ts", "tests/**/*.vue"]
}
3 changes: 2 additions & 1 deletion atable/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ export default defineConfig({
name: '@stonecrop/atable',
},
rollupOptions: {
external: ['vue'],
external: ['vue', 'pinia'],
output: {
chunkFileNames: 'chunks/[name].[hash].js',
assetFileNames: 'assets/[name].[ext]',
globals: {
vue: 'Vue',
pinia: 'pinia',
},
},
},
Expand Down
Loading

0 comments on commit 5a13335

Please sign in to comment.