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

fix!: align play button property with others (disablePlay-> play) #1450

Merged
merged 1 commit into from
Dec 19, 2024
Merged
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
4 changes: 2 additions & 2 deletions elements/layercontrol/src/components/layer-datetime.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class EOxLayerControlLayerDatetime extends LitElement {
* Layer config for eox-jsonform
*
* @type {{
* disablePlay?: boolean;
* play?: boolean;
* slider?: boolean;
* navigation?: boolean;
* currentStep: string|number;
Expand Down Expand Up @@ -110,7 +110,7 @@ export class EOxLayerControlLayerDatetime extends LitElement {
.layer=${undefined}
.navigation=${this.layerDatetime.navigation ?? false}
.slider=${this.layerDatetime.slider ?? false}
.disablePlay=${this.layerDatetime.disablePlay ?? false}
.play=${this.layerDatetime.play ?? false}
.controlValues=${this.layerDatetime.controlValues}
.controlProperty=${undefined}
current-step=${this.layerDatetime.currentStep}
Expand Down
2 changes: 1 addition & 1 deletion elements/layercontrol/src/enums/stories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ export const STORIES_LAYER_VESSEL_DENSITY_CARGO = {
range: ["#C3EBDC", "#0ADC00", "#FEF500", "#F29300", "#800303"],
},
layerDatetime: {
disablePlay: true,
play: false,
slider: true,
currentStep: "2021-03-01",
displayFormat: "DD.MM.YYYY",
Expand Down
2 changes: 1 addition & 1 deletion elements/layercontrol/stories/layercontrol.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const LayerStylesConfig = LayerStylesConfigStory;
/**
* By adding "datetime" as tool, the time for a specific layer can be modified.
* The `layerDatetime` property of the layer allows passing the following properties of eox-timecontrol:
* `disablePlay`: allows disabling the timecontrol play button.
* `play`: allows disabling the timecontrol play button.
* `slider`: show/hide timecontrol slider.
* `currentStep`: current datetime string.
* `controlValues`: The list of available values.
Expand Down
2 changes: 2 additions & 0 deletions elements/timecontrol/src/enums/stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ export const DEFAULT_ARGS = {
"2023-04-17",
"2023-04-24",
],
navigation: true,
play: true,
// map
layers: [
{
Expand Down
6 changes: 3 additions & 3 deletions elements/timecontrol/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class EOxTimeControl extends LitElement {
/**
* Hides the play button if set
*/
disablePlay: { type: Boolean, attribute: "disable-play" },
play: { type: Boolean, attribute: "play" },

/**
* Date format string for displaying the current step
Expand Down Expand Up @@ -82,7 +82,7 @@ export class EOxTimeControl extends LitElement {
/** @type {boolean} */
this.unstyled = false;
/** @type {boolean} */
this.disablePlay = false;
this.play = false;
/** @type {boolean} */
this.navigation = true;
/** @type {boolean} */
Expand Down Expand Up @@ -337,7 +337,7 @@ export class EOxTimeControl extends LitElement {
</button>
`
: nothing}
${!this.disablePlay
${this.play
? html`
<button
part="play"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { html } from "lit";
import { DEFAULT_ARGS } from "../src/enums/stories";

export const DisabledPlayButton = {
export const DisabledButtons = {
args: {
...DEFAULT_ARGS,
for: "eox-map#disabled-play",
disablePlay: true,
play: false,
navigation: false,
},
render: (args) => html`
<eox-map
Expand All @@ -20,11 +21,12 @@ export const DisabledPlayButton = {
.layer=${args.layer}
.controlProperty=${args.controlProperty}
.controlValues=${args.controlValues}
.navigation=${args.navigation}
.slider=${args.slider}
.disablePlay=${args.disablePlay}
.play=${args.play}
style="margin-top: 8px"
></eox-timecontrol>
`,
};

export default DisabledPlayButton;
export default DisabledButtons;
7 changes: 5 additions & 2 deletions elements/timecontrol/stories/format.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import { DEFAULT_ARGS } from "../src/enums/stories";
export const Format = {
args: {
...DEFAULT_ARGS,
for: "eox-map#primary",
for: "eox-map#format",
displayFormat: "MMMM DD, YYYY",
play: false,
},
render: (args) => html`
<eox-map
id="primary"
id="format"
style="width: 1005; height: 300px;"
.zoom=${args.zoom}
.center=${args.center}
Expand All @@ -20,6 +21,8 @@ export const Format = {
.layer=${args.layer}
.controlProperty=${args.controlProperty}
.controlValues=${args.controlValues}
.navigation=${args.navigation}
.play=${args.play}
.slider=${args.slider}
style="margin-top: 10px;"
.displayFormat=${args.displayFormat}
Expand Down
2 changes: 1 addition & 1 deletion elements/timecontrol/stories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
export { default as PrimaryStory } from "./primary"; // Primary story
export { default as SliderStory } from "./slider"; // Slider story
export { default as ProgrammaticTimeSelectionStory } from "./programmatic-time-selection"; // Programmatic time selection story
export { default as DisabledPlayButtonStory } from "./disabled-play-button"; // Disabled play button story
export { default as DisabledButtonsStory } from "./disabled-buttons"; // Disabled play button story
export { default as NoMapStory } from "./no-map"; // No map provided story
export { default as FormatStory } from "./format"; // Date-Time Format story
5 changes: 3 additions & 2 deletions elements/timecontrol/stories/no-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DEFAULT_ARGS } from "../src/enums/stories";
const NoMap = {
args: {
...DEFAULT_ARGS,
disablePlay: true,
play: true,
layer: undefined,
for: undefined,
controlProperty: undefined,
Expand All @@ -19,8 +19,9 @@ const NoMap = {
.layer=${args.layer}
.controlProperty=${args.controlProperty}
.controlValues=${args.controlValues}
.navigation=${args.navigation}
.slider=${args.slider}
.disablePlay=${args.disablePlay}
.play=${args.play}
@stepchange=${args.onStepChange}
></eox-timecontrol>
`,
Expand Down
2 changes: 2 additions & 0 deletions elements/timecontrol/stories/primary.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export const Primary = {
.layer=${args.layer}
.controlProperty=${args.controlProperty}
.controlValues=${args.controlValues}
.navigation=${args.navigation}
.play=${args.play}
.slider=${args.slider}
style="margin-top: 8px"
></eox-timecontrol>
Expand Down
4 changes: 4 additions & 0 deletions elements/timecontrol/stories/programmatic-time-selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export const ProgrammaticTimeSelection = {
...DEFAULT_ARGS,
for: "eox-map#programmatic-time-selection",
slider: true,
navigation: false,
play: false,
},
render: (args) => html`
<eox-map
Expand Down Expand Up @@ -33,6 +35,8 @@ export const ProgrammaticTimeSelection = {
.layer=${args.layer}
.controlProperty=${args.controlProperty}
.controlValues=${args.controlValues}
.navigation=${args.navigation}
.play=${args.play}
.slider=${args.slider}
style="margin-top: 8px"
></eox-timecontrol>
Expand Down
4 changes: 4 additions & 0 deletions elements/timecontrol/stories/slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export const Slider = {
...DEFAULT_ARGS,
for: "eox-map#slider",
slider: true,
navigation: false,
play: false,
},
render: (args) => html`
<eox-map
Expand All @@ -20,6 +22,8 @@ export const Slider = {
.layer=${args.layer}
.controlProperty=${args.controlProperty}
.controlValues=${args.controlValues}
.navigation=${args.navigation}
.play=${args.play}
.slider=${args.slider}
style="margin-top: 8px"
></eox-timecontrol>
Expand Down
4 changes: 2 additions & 2 deletions elements/timecontrol/stories/timecontrol.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
PrimaryStory,
SliderStory,
ProgrammaticTimeSelectionStory,
DisabledPlayButtonStory,
DisabledButtonsStory,
NoMapStory,
FormatStory,
} from "./index";
Expand All @@ -20,7 +20,7 @@ export const Slider = SliderStory;

export const ProgrammaticTimeSelection = ProgrammaticTimeSelectionStory;

export const DisabledPlayButton = DisabledPlayButtonStory;
export const DisabledButtons = DisabledButtonsStory;

export const NoMap = NoMapStory;

Expand Down
Loading