-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core/date-dropdown): new date-dropdown component (#797)
Co-authored-by: lzeiml <[email protected]> Co-authored-by: Daniel Leroux <[email protected]> Co-authored-by: Lukas Maurer <[email protected]>
- Loading branch information
1 parent
0b619b9
commit 3d8d804
Showing
30 changed files
with
41,073 additions
and
121 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
packages/angular-test-app/src/preview-examples/date-dropdown-user-range.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 Siemens AG | ||
* | ||
* SPDX-License-Identifier: MIT | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import { Component } from '@angular/core'; | ||
import {DateDropdownOption} from "@siemens/ix"; | ||
import dayjs from "dayjs"; | ||
|
||
@Component({ | ||
selector: 'app-example', | ||
template: ` | ||
<ix-date-dropdown | ||
[dateRangeOptions]="dateDropdownOptions" | ||
> | ||
</ix-date-dropdown> | ||
`, | ||
}) | ||
export default class DateDropdownUserRange { | ||
dateDropdownOptions: DateDropdownOption[] = [ | ||
{ | ||
label: 'No time limit', | ||
getValue: () => { | ||
const today = dayjs(); | ||
return { from: undefined, to: today }; | ||
}, | ||
}, | ||
{ | ||
label: 'Today', | ||
getValue: () => { | ||
const today = dayjs(); | ||
return { from: today, to: today }; | ||
}, | ||
}, | ||
{ | ||
label: 'Last 7 days', | ||
getValue: () => { | ||
const today = dayjs(); | ||
return { | ||
from: today.subtract(7, 'day') as dayjs.Dayjs, | ||
to: today, | ||
}; | ||
}, | ||
}, | ||
]; | ||
} |
16 changes: 16 additions & 0 deletions
16
packages/angular-test-app/src/preview-examples/date-dropdown.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 Siemens AG | ||
* | ||
* SPDX-License-Identifier: MIT | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-example', | ||
template: `<ix-date-dropdown></ix-date-dropdown>`, | ||
}) | ||
export default class DateDropdownUserRange {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.