Skip to content

Commit a0f4ff9

Browse files
committed
layout.Card: slideDirection_ #5400
1 parent 805f9bc commit a0f4ff9

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

examples/layout/card/MainContainer.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class MainContainer extends ConfigurationViewport {
2222

2323
return [{
2424
module : Radio,
25-
checked : layout.slideDirection === 'bottom-left',
25+
checked : layout.slideDirection === 'horizontal',
2626
hideValueLabel: false,
2727
labelText : 'slideDirection',
2828
listeners : {change: me.onRadioLayoutChange.bind(me, 'slideDirection', 'horizontal')},
@@ -126,7 +126,7 @@ class MainContainer extends ConfigurationViewport {
126126
*/
127127
onRadioLayoutChange(config, value, opts) {
128128
if (opts.value === true) { // we only want to listen to check events, not uncheck
129-
this.exampleComponent.layout[config] = value;
129+
this.getItem('card-container').layout[config] = value;
130130
}
131131
}
132132

src/layout/Card.mjs

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ class Card extends Base {
2424
* @static
2525
*/
2626
static itemCls = 'neo-layout-card-item'
27+
/**
28+
* Valid values for slideDirection
29+
* @member {String[]} iconPositions=['horizontal','vertical',null]
30+
* @protected
31+
* @static
32+
*/
33+
static slideDirections = ['horizontal', 'vertical', null]
2734

2835
static config = {
2936
/**
@@ -47,7 +54,12 @@ class Card extends Base {
4754
* This will keep the instances & vdom trees
4855
* @member {Boolean} removeInactiveCards=true
4956
*/
50-
removeInactiveCards: true
57+
removeInactiveCards: true,
58+
/*
59+
* Valid values: 'horizontal', 'vertical', null
60+
* @member {String|null} slideDirection_=null
61+
*/
62+
slideDirection_: null
5163
}
5264

5365
/**
@@ -164,6 +176,17 @@ class Card extends Base {
164176
container.wrapperCls = wrapperCls;
165177
}
166178

179+
/**
180+
* Triggered before the slideDirection config gets changed
181+
* @param {String} value
182+
* @param {String} oldValue
183+
* @returns {String}
184+
* @protected
185+
*/
186+
beforeSetSlideDirection(value, oldValue) {
187+
return this.beforeSetEnumValue(value, oldValue, 'slideDirection')
188+
}
189+
167190
/**
168191
* Loads a component.Base module which is defined via module: () => import('...')
169192
* @param {Object} item

0 commit comments

Comments
 (0)