Skip to content

Commit

Permalink
Revert ui package.json change
Browse files Browse the repository at this point in the history
  • Loading branch information
calebporzio committed Jul 24, 2023
1 parent a67fdb8 commit 06a2547
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
7 changes: 1 addition & 6 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,5 @@
"main": "dist/module.cjs.js",
"module": "dist/module.esm.js",
"unpkg": "dist/cdn.min.js",
"devDependencies": {
"alpinejs": "file:../alpinejs"
},
"peerDependencies": {
"alpinejs": "^3.10.0"
}
"devDependencies": {}
}
4 changes: 2 additions & 2 deletions packages/ui/src/combobox.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function handleRoot(el, Alpine) {
this.__nullable = Alpine.extractProp(el, 'nullable', false)
this.__compareBy = Alpine.extractProp(el, 'by')

this.__context = generateContext(this.__isMultiple, 'vertical', () => this.__activateSelectedOrFirst())
this.__context = generateContext(Alpine, this.__isMultiple, 'vertical', () => this.__activateSelectedOrFirst())

let defaultValue = Alpine.extractProp(el, 'default-value', this.__isMultiple ? [] : null)

Expand All @@ -109,7 +109,7 @@ function handleRoot(el, Alpine) {
Alpine.effect(() => {
// Everytime the value changes, we need to re-render the hidden inputs,
// if a user passed the "name" prop...
this.__inputName && renderHiddenInputs(this.$el, this.__inputName, this.__value)
this.__inputName && renderHiddenInputs(Alpine, this.$el, this.__inputName, this.__value)
})
})
},
Expand Down
5 changes: 2 additions & 3 deletions packages/ui/src/list-context.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Alpine from "alpinejs";

export function generateContext(multiple, orientation, activateSelectedOrFirst) {
export function generateContext(Alpine, multiple, orientation, activateSelectedOrFirst) {
return {
/**
* Main state...
Expand Down Expand Up @@ -326,7 +325,7 @@ function keyByValue(object, value) {
return Object.keys(object).find(key => object[key] === value)
}

export function renderHiddenInputs(el, name, value) {
export function renderHiddenInputs(Alpine, el, name, value) {
// Create input elements...
let newInputs = generateInputs(name, value)

Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/listbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function handleRoot(el, Alpine) {
this.__compareBy = Alpine.extractProp(el, 'by')
this.__orientation = Alpine.extractProp(el, 'horizontal', false) ? 'horizontal' : 'vertical'

this.__context = generateContext(this.__isMultiple, this.__orientation, () => this.$data.__activateSelectedOrFirst())
this.__context = generateContext(Alpine, this.__isMultiple, this.__orientation, () => this.$data.__activateSelectedOrFirst())

let defaultValue = Alpine.extractProp(el, 'default-value', this.__isMultiple ? [] : null)

Expand Down

0 comments on commit 06a2547

Please sign in to comment.