Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/development' into feat-resizab…
Browse files Browse the repository at this point in the history
…le-columns
  • Loading branch information
Rohan Bansal committed Jan 10, 2025
2 parents e2c9e18 + 8c677ca commit ce760b3
Show file tree
Hide file tree
Showing 52 changed files with 736 additions and 385 deletions.
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.3.8",
"tag": "@stonecrop/aform_v0.3.8",
"date": "Thu, 09 Jan 2025 11:21:58 GMT",
"comments": {
"patch": [
{
"comment": "add strict null checks to improve logic"
}
]
}
},
{
"version": "0.3.7",
"tag": "@stonecrop/aform_v0.3.7",
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 Fri, 03 Jan 2025 06:27:07 GMT and should not be manually modified.
This log was last generated on Thu, 09 Jan 2025 11:21:58 GMT and should not be manually modified.

## 0.3.8
Thu, 09 Jan 2025 11:21:58 GMT

### Patches

- add strict null checks to improve logic

## 0.3.7
Fri, 03 Jan 2025 06:27:07 GMT
Expand Down
2 changes: 1 addition & 1 deletion aform/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stonecrop/aform",
"version": "0.3.7",
"version": "0.3.8",
"license": "MIT",
"type": "module",
"author": {
Expand Down
6 changes: 3 additions & 3 deletions aform/src/directives/mask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ function getMask(binding: DirectiveBinding<string>) {
if (maskFn) {
// TODO: (state) replace with state management;
// pass the entire form/table data to the function
const locale = binding.instance['locale']
const locale = binding.instance?.['locale']
mask = maskFn(locale)
}
} else {
// TODO: (state) handle using state management
const schema = binding.instance['schema'] as FormSchema
const schema = binding.instance?.['schema'] as FormSchema
const fieldType: string | undefined = schema?.fieldtype?.toLowerCase()
if (fieldType && NAMED_MASKS[fieldType]) {
mask = NAMED_MASKS[fieldType]
Expand Down Expand Up @@ -127,7 +127,7 @@ export function useStringMask(el: HTMLInputElement, binding: DirectiveBinding<st
// most likely fixed with state management;
// a better way could be to emit back to instance;

if (binding.instance['maskFilled']) {
if (binding.instance?.['maskFilled']) {
binding.instance['maskFilled'] = !replacement.includes(maskToken)
}

Expand Down
8 changes: 7 additions & 1 deletion aform/tests/datepicker.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ describe('datepicker component', () => {

const $prevMonthBtn = wrapper.find('#previous-month-btn')
await $prevMonthBtn.trigger('click')
expect(wrapper.vm.currentMonth).toBe(new Date().getMonth() - 1)

const currentMonth = new Date().getMonth()
if (currentMonth === 0) {
expect(wrapper.vm.currentMonth).toBe(11)
} else {
expect(wrapper.vm.currentMonth).toBe(currentMonth - 1)
}
})

it('select previous year', async () => {
Expand Down
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.3.8",
"tag": "@stonecrop/atable_v0.3.8",
"date": "Thu, 09 Jan 2025 11:21:58 GMT",
"comments": {
"patch": [
{
"comment": "add strict null checks to improve logic"
}
]
}
},
{
"version": "0.3.7",
"tag": "@stonecrop/atable_v0.3.7",
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 Fri, 03 Jan 2025 06:27:07 GMT and should not be manually modified.
This log was last generated on Thu, 09 Jan 2025 11:21:58 GMT and should not be manually modified.

## 0.3.8
Thu, 09 Jan 2025 11:21:58 GMT

### Patches

- add strict null checks to improve logic

## 0.3.7
Fri, 03 Jan 2025 06:27:07 GMT
Expand Down
2 changes: 1 addition & 1 deletion atable/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stonecrop/atable",
"version": "0.3.7",
"version": "0.3.8",
"license": "MIT",
"type": "module",
"author": {
Expand Down
14 changes: 7 additions & 7 deletions atable/src/components/ACell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ const showModal = () => {
state.modal.visible = true
state.modal.colIndex = colIndex
state.modal.rowIndex = rowIndex
state.modal.parent = cellRef.value
state.modal.top = cellRef.value.offsetTop + cellRef.value.offsetHeight
state.modal.left = cellRef.value.offsetLeft
state.modal.parent = cellRef.value!
state.modal.top = cellRef.value!.offsetTop + cellRef.value!.offsetHeight
state.modal.left = cellRef.value!.offsetLeft
state.modal.width = width.value
state.modal.height = height.value
Expand Down Expand Up @@ -146,7 +146,7 @@ if (addNavigation) {
const onFocus = () => {
if (cellRef.value) {
currentData.value = cellRef.value.textContent
currentData.value = cellRef.value.textContent!
}
}
Expand All @@ -156,14 +156,14 @@ const updateCellData = (payload: Event) => {
return
}
emit('cellInput', colIndex, rowIndex, target.textContent, currentData.value)
currentData.value = target.textContent
emit('cellInput', colIndex, rowIndex, target.textContent!, currentData.value)
currentData.value = target.textContent!
// only apply changes if the cell value has changed after being mounted
if (column.format) {
cellModified.value = target.textContent !== store.getFormattedValue(colIndex, rowIndex, originalData)
// TODO: need to setup reverse format function?
store.setCellText(colIndex, rowIndex, target.textContent)
store.setCellText(colIndex, rowIndex, target.textContent!)
} else {
cellModified.value = target.textContent !== originalData
store.setCellData(colIndex, rowIndex, target.textContent)
Expand Down
7 changes: 4 additions & 3 deletions atable/src/components/ARow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<script setup lang="ts">
import { type KeypressHandlers, useKeyboardNav, defaultKeypressHandlers } from '@stonecrop/utilities'
import { useTemplateRef } from 'vue'
import { computed, useTemplateRef } from 'vue'
import { createTableStore } from '../stores/table'
Expand All @@ -43,8 +43,9 @@ const {
}>()
const rowRef = useTemplateRef<HTMLTableRowElement>('rowEl')
const isRowVisible = store.isRowVisible(rowIndex)
const rowExpandSymbol = store.getRowExpandSymbol(rowIndex)
const isRowVisible = computed(() => store.isRowVisible(rowIndex))
const rowExpandSymbol = computed(() => store.getRowExpandSymbol(rowIndex))
if (addNavigation) {
let handlers = defaultKeypressHandlers
Expand Down
6 changes: 4 additions & 2 deletions atable/src/stores/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const createTableStore = (initData: {
defaultDisplay[rowIndex] = {
childrenOpen: false,
expanded: false,
indent: row.indent || null,
indent: row.indent || 0,
isParent: parents.has(rowIndex),
isRoot: row.parent === null || row.parent === undefined,
rowModified: false,
Expand Down Expand Up @@ -85,7 +85,9 @@ export const createTableStore = (initData: {
return `${indent}ch`
})

const zeroColumn = computed(() => ['list', 'tree', 'list-expansion'].includes(config.value.view))
const zeroColumn = computed(() =>
config.value.view ? ['list', 'tree', 'list-expansion'].includes(config.value.view) : false
)

// actions
const getCellData = <T = any>(colIndex: number, rowIndex: number): T => table.value[`${colIndex}:${rowIndex}`]
Expand Down
12 changes: 12 additions & 0 deletions beam/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"name": "@stonecrop/beam",
"entries": [
{
"version": "0.3.8",
"tag": "@stonecrop/beam_v0.3.8",
"date": "Thu, 09 Jan 2025 11:21:58 GMT",
"comments": {
"patch": [
{
"comment": "add strict null checks to improve logic"
}
]
}
},
{
"version": "0.3.7",
"tag": "@stonecrop/beam_v0.3.7",
Expand Down
9 changes: 8 additions & 1 deletion beam/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Change Log - @stonecrop/beam

This log was last generated on Fri, 03 Jan 2025 06:27:07 GMT and should not be manually modified.
This log was last generated on Thu, 09 Jan 2025 11:21:58 GMT and should not be manually modified.

## 0.3.8
Thu, 09 Jan 2025 11:21:58 GMT

### Patches

- add strict null checks to improve logic

## 0.3.7
Fri, 03 Jan 2025 06:27:07 GMT
Expand Down
2 changes: 1 addition & 1 deletion beam/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stonecrop/beam",
"version": "0.3.7",
"version": "0.3.8",
"license": "MIT",
"type": "module",
"author": {
Expand Down
6 changes: 3 additions & 3 deletions beam/src/composables/mqtt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { IMqttStream } from '../types'
* @returns MQTT stream messages
* @beta
*/
export const useMqttStream = (options?: IMqttStream) => {
const client = ref<MqttClient>(null)
export const useMqttStream = (options: IMqttStream) => {
const client = ref<MqttClient>()
const messages = ref<Record<string, string[]>>({})

onMounted(() => {
Expand Down Expand Up @@ -38,7 +38,7 @@ export const useMqttStream = (options?: IMqttStream) => {
})

onUnmounted(() => {
client.value.end()
client.value?.end()
})

return { messages }
Expand Down
6 changes: 6 additions & 0 deletions code_editor/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"name": "@stonecrop/code-editor",
"entries": [
{
"version": "0.3.8",
"tag": "@stonecrop/code-editor_v0.3.8",
"date": "Thu, 09 Jan 2025 11:21:58 GMT",
"comments": {}
},
{
"version": "0.3.7",
"tag": "@stonecrop/code-editor_v0.3.7",
Expand Down
7 changes: 6 additions & 1 deletion code_editor/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @stonecrop/code-editor

This log was last generated on Fri, 03 Jan 2025 06:27:07 GMT and should not be manually modified.
This log was last generated on Thu, 09 Jan 2025 11:21:58 GMT and should not be manually modified.

## 0.3.8
Thu, 09 Jan 2025 11:21:58 GMT

_Version update only_

## 0.3.7
Fri, 03 Jan 2025 06:27:07 GMT
Expand Down
2 changes: 1 addition & 1 deletion code_editor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stonecrop/code-editor",
"version": "0.3.7",
"version": "0.3.8",
"license": "MIT",
"type": "module",
"author": {
Expand Down
15 changes: 6 additions & 9 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion common/config/rush/version-policies.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{
"definitionName": "lockStepVersion",
"policyName": "stonecrop",
"version": "0.3.7",
"version": "0.3.8",
"nextBump": "patch"
}
// {
Expand Down
Loading

0 comments on commit ce760b3

Please sign in to comment.