Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add feature to update URL when dialog is opened #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions demo/action-toolbar-demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class ActionToolbarDemo extends LitElement {
.disabledActions=${this.disabledActions}
.hiddenActions=${this.hiddenActions}
.mobileMode=${this.mobileMode}
dialogActionName="action"
dialogActionValue="filter"
>
</dw-action-toolbar>
`;
Expand Down
24 changes: 24 additions & 0 deletions dw-action-toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,27 @@ export class DwActionToolbar extends LitElement {
*/
dialogVOffset: Number,

/**
* Input property
* Represents name of the query params to be add when dialog is opened
*/
dialogActionName: { type: String },

/**
* Input property
* Represents value of the given `actionName` param
* e.g. if actionName is 'action' and `actionValue` is 'edit' then in URL action=edit will be added
*/
dialogActionValue: { type: String },

/**
* Input property
* Represents the location at where action params will be added.
* Possible values: `hash` or `queryParams`
* Default value is `queryParams`
*/
dialogActionLocation: { type: String },

/**
* It can be of either String or Array type.
*/
Expand Down Expand Up @@ -276,6 +297,9 @@ export class DwActionToolbar extends LitElement {
.vOffset="${this.dialogVOffset}"
.hOffset="${this.dialogHOffset}"
.alwaysFullScreenInMobile="${this.alwaysFullScreenInMobile}"
.actionName="${this.dialogActionName}"
.actionValue="${this.dialogActionValue}"
.location="${this.dialogActionLocation}"
@value-changed="${this._triggerActionEvent}"
@opened-changed="${this._onSelectOpenedChanged}">
<slot></slot>
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"dependencies": {
"@dreamworld/dw-icon": "^1.2.0",
"@dreamworld/dw-icon-button": "^1.1.0",
"@dreamworld/dw-select": "^1.6.0",
"@dreamworld/dw-select": "1.7.0-support-url.1",
"@dreamworld/flex-layout": "^1.0.0",
"lit-element": "^2.2.1",
"lodash-es": "^4.17.15"
Expand All @@ -41,8 +41,8 @@
"@material/animation": "3.1.0",
"@material/dom": "3.1.0",
"@semantic-release/npm": "5.2.0-beta.5",
"@dreamworld/dw-icon": "1.0.2",
"@dreamworld/dw-icon-button": "1.1.2",
"@dreamworld/dw-icon": "1.2.0",
"@dreamworld/dw-icon-button": "^1.1.2",
"@material/mwc-ripple": "0.7.1"
}
}
Loading