Skip to content

Commit

Permalink
Merge 9aaa1dd into a13c8e8
Browse files Browse the repository at this point in the history
  • Loading branch information
jecisc committed Jan 31, 2022
2 parents a13c8e8 + 9aaa1dd commit 3453c13
Show file tree
Hide file tree
Showing 29 changed files with 702 additions and 284 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/continuous.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the development branch
on:
push:
branches:
- '**'
pull_request:
types: [assigned, opened, synchronize, reopened]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
smalltalk: [ Pharo64-6.1, Pharo64-7.0, Pharo64-8.0, Pharo64-9.0 ]
name: ${{ matrix.smalltalk }}
steps:
- uses: actions/checkout@v2
- uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalk-version: ${{ matrix.smalltalk }}
- run: smalltalkci -s ${{ matrix.smalltalk }}
shell: bash
timeout-minutes: 15

23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# MaterialDesignLite for Seaside <img src="https://raw.githubusercontent.com/DuneSt/MaterialDesignLite/development/resources/logos/logoFull.png" width="50">

#### Linux/OSX builds
Master: [![Build Status](https://travis-ci.org/DuneSt/MaterialDesignLite.svg?branch=master)](https://travis-ci.org/DuneSt/MaterialDesignLite)| Development: [![Build Status](https://travis-ci.org/DuneSt/MaterialDesignLite.svg?branch=development)](https://travis-ci.org/DuneSt/MaterialDesignLite)

Coverage:

[![Coverage Status](https://coveralls.io/repos/github/DuneSt/MaterialDesignLite/badge.svg)](https://coveralls.io/github/DuneSt/MaterialDesignLite)
Expand Down Expand Up @@ -185,8 +182,8 @@ ZnWorkspace openUrl: 'http://ws.stfx.eu/1JIZRQS7OI00'
| 1.1.x | Pharo 50, 60, 61 | None |
| 1.2.x | Pharo 50, 60, 61 | None |
| 1.3.x | Pharo 50, 60, 61 | Gemstone 3.4.1 (*) (**) |
| 2.x.x | Pharo 61, 70 | None |
| Dev | Pharo 61, 70 | None |
| 2.x.x | Pharo 61, 70, 80, 90 | None |
| Dev | Pharo 61, 70, 80, 90 | None |

(*) *This version of Gemstone is tested. Older versions might work but we did not tested it.*
(**) *The compatibility is not total. MaterialDesignLite uses Pharo's Traits to provide the users composables components. Thus, if the Gemstone users wants to use those components they will have to flatten themself the Traits in their Seaside application*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,23 @@ BaselineOfMaterialDesignLite >> baseline: spec [
fileLibraryHelper: spec;
materialColors: spec;
magritte: spec;
seasideGenerationTester: spec.
seasideGenerationTester: spec;
gitBridge: spec.

"Packages"
spec
package: 'Material-Design-Lite-Components' with: [ spec requires: #('MaterialColors' 'Seaside3') ];
package: 'Material-Design-Lite-Components-Tests' with: [ spec requires: #('Material-Design-Lite-Components' 'SeasideGenerationTester') ];
package: 'Material-Design-Lite-Core' with: [ spec requires: #('Material-Design-Lite-Utils' 'Material-Design-Lite-Components' 'Material-Design-Lite-Widgets' 'Material-Design-Lite-Extensions') ];
package: 'Material-Design-Lite-Core-Tests' with: [ spec requires: #('Material-Design-Lite-Core' 'Material-Design-Lite-Components-Tests') ];
package: 'Material-Design-Lite-Widgets' with: [ spec requires: #('Material-Design-Lite-Components') ];
package: 'Material-Design-Lite-Widgets-Tests' with: [ spec requires: #('Material-Design-Lite-Widgets' 'Material-Design-Lite-Components-Tests') ];
package: 'Material-Design-Lite-Extensions' with: [ spec requires: #('Material-Design-Lite-Utils' 'Material-Design-Lite-Components') ];
package: 'Material-Design-Lite-Extensions-Tests' with: [ spec requires: #('Material-Design-Lite-Extensions' 'Material-Design-Lite-Components-Tests') ];
package: 'Material-Design-Lite-Utils' with: [ spec requires: #('Seaside3' 'FileLibraryHelper') ];
package: 'Material-Design-Lite-Core' with: [ spec requires: #('Material-Design-Lite-Utils' 'Material-Design-Lite-Components' 'Material-Design-Lite-Widgets' 'Material-Design-Lite-Extensions') ];
package: 'Material-Design-Lite-Core-Tests' with: [ spec requires: #('Material-Design-Lite-Core' 'Material-Design-Lite-Components-Tests') ];
package: 'Material-Design-Lite-Utils' with: [ spec requires: #('Seaside3') ];
package: 'Material-Design-Lite-Demo' with: [ spec requires: #('Material-Design-Lite-Core') ];
package: 'Material-Design-Lite-Magritte' with: [ spec requires: #('Material-Design-Lite-Widgets' 'Material-Design-Lite-Components' 'Magritte') ].
package: 'Material-Design-Lite-Magritte' with: [ spec requires: #('Material-Design-Lite-Widgets' 'Material-Design-Lite-Components' 'Magritte') ];
package: 'Material-Design-Lite-Dev-Tools' with: [ spec requires: #('Material-Design-Lite-Core-Tests' 'Material-Design-Lite-Magritte' 'FileLibraryHelper' 'GitBridge' ) ].

"Groups"
spec
Expand All @@ -42,6 +44,7 @@ BaselineOfMaterialDesignLite >> baseline: spec [
group: 'core' with: #('Material-Design-Lite-Widgets' 'Material-Design-Lite-Components' 'Material-Design-Lite-Core' 'Material-Design-Lite-Utils');
group: 'default' with: #('core' 'tests' 'demo');
group: 'demo' with: #('Material-Design-Lite-Demo');
group: 'dev' with: #('all' 'Material-Design-Lite-Dev-Tools');
group: 'magritte' with: #('Material-Design-Lite-Magritte');
group: 'tests' with: #('Material-Design-Lite-Components-Tests' 'Material-Design-Lite-Widgets-Tests' 'Material-Design-Lite-Extensions-Tests' 'Material-Design-Lite-Core-Tests') ]
]
Expand All @@ -55,13 +58,22 @@ BaselineOfMaterialDesignLite >> fileLibraryHelper: spec [
with: [ spec repository: 'github://jecisc/FileLibraryHelper:v1.x.x/src' ]
]

{ #category : #dependencies }
BaselineOfMaterialDesignLite >> gitBridge: spec [
"I small project to help developers to manage the files in the FileLibrary."

spec
baseline: 'GitBridge'
with: [ spec repository: 'github://jecisc/GitBridge:v1.x.x/src' ]
]

{ #category : #dependencies }
BaselineOfMaterialDesignLite >> magritte: spec [
spec
baseline: 'Magritte'
with: [ spec
loads: #('Seaside');
repository: 'github://magritte-metamodel/magritte:v3.5.4/source' ]
repository: 'github://magritte-metamodel/magritte:v3.7/source' ]
]

{ #category : #dependencies }
Expand Down
10 changes: 10 additions & 0 deletions src/Material-Design-Lite-Components/MDLPasswordFieldInput.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Class {
#name : #MDLPasswordFieldInput,
#superclass : #MDLTextFieldInput,
#category : #'Material-Design-Lite-Components-Forms'
}

{ #category : #accessing }
MDLPasswordFieldInput >> type [
^ 'password'
]
5 changes: 5 additions & 0 deletions src/Material-Design-Lite-Components/WAHtmlCanvas.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,11 @@ WAHtmlCanvas >> mdlNavigationLink: aBlock [
yourself
]

{ #category : #'*Material-Design-Lite-Components' }
WAHtmlCanvas >> mdlPasswordFieldInput [
^ self brush: MDLPasswordFieldInput new
]

{ #category : #'*Material-Design-Lite-Components' }
WAHtmlCanvas >> mdlProgressBar [
^ self brush: MDLProgressBar new
Expand Down
19 changes: 19 additions & 0 deletions src/Material-Design-Lite-Demo/MDLSelectScreen.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,24 @@ MDLSelectScreen class >> title [
^ 'Select'
]

{ #category : #demos }
MDLSelectScreen >> renderAjaxSubmitSelectOn: html [
html
form:
((MDLSelectWidget
possibilities: #(1 2 3 4 5 5)
inputLabel: 'Select Your Number'
labelBlock: [ :number |
number = 5
ifTrue: [ '0' ]
ifFalse: [ (number - 1) greaseString ] ]
callback: [ :input | selectedEntity := input ]
selectedObject: selectedEntity)
beAjaxSubmit;
yourself).
selectedEntity ifNotNil: [ :entity | html div mdlTextColorPrimary; with: 'Selected: ' , entity asString ]
]

{ #category : #demos }
MDLSelectScreen >> renderAutoSubmitSelectOn: html [
html
Expand Down Expand Up @@ -111,5 +129,6 @@ MDLSelectScreen >> select [
MDLSelectScreen >> selectWithAjax [
^ OrderedDictionary new
add: 'Select Widget using ajax' -> #renderSelectWithAjaxOn:;
add: 'Select Widget using ajax(without any refresh)' -> #renderAjaxSubmitSelectOn:;
yourself
]
10 changes: 10 additions & 0 deletions src/Material-Design-Lite-Demo/MDLTextFieldsScreen.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ MDLTextFieldsScreen >> renderNumberTextFieldOn: html [
html mdlTextFieldError: 'Input is not a number !' ]
]

{ #category : #demos }
MDLTextFieldsScreen >> renderPasswordTextFieldOn: html [
html
mdlTextFieldContainer: [ html mdlTextFieldLabel
for: html nextId;
with: 'Password...'.
html mdlPasswordFieldInput id: html lastId ]
]

{ #category : #rendering }
MDLTextFieldsScreen >> renderScreenContentOn: html [
self
Expand Down Expand Up @@ -131,5 +140,6 @@ MDLTextFieldsScreen >> specialTextFields [
^ OrderedDictionary new
add: 'Multiple line' -> #renderMultiLineTextFieldOn:;
add: 'Expanding' -> #renderExpandingTextFieldOn:;
add: 'Password' -> #renderPasswordTextFieldOn:;
yourself
]
15 changes: 15 additions & 0 deletions src/Material-Design-Lite-Dev-Tools/MDLBridge.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Class {
#name : #MDLBridge,
#superclass : #GitBridge,
#category : #'Material-Design-Lite-Dev-Tools'
}

{ #category : #'class initialization' }
MDLBridge class >> initialize [
SessionManager default registerSystemClassNamed: self name
]

{ #category : #accessing }
MDLBridge class >> resources [
^ self root / 'resources'
]
24 changes: 24 additions & 0 deletions src/Material-Design-Lite-Dev-Tools/MDLLibrary.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Extension { #name : #MDLLibrary }

{ #category : #'*Material-Design-Lite-Dev-Tools' }
MDLLibrary class >> deployFiles [
<script>
super deployFiles
]

{ #category : #'*Material-Design-Lite-Dev-Tools' }
MDLLibrary class >> filesDirectory [
^ MDLBridge resources
]

{ #category : #'*Material-Design-Lite-Dev-Tools' }
MDLLibrary class >> importFiles [
<script>
super importFiles
]

{ #category : #'*Material-Design-Lite-Dev-Tools' }
MDLLibrary class >> openImportButton [
<script>
super openImportButton
]
1 change: 1 addition & 0 deletions src/Material-Design-Lite-Dev-Tools/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : #'Material-Design-Lite-Dev-Tools' }
29 changes: 9 additions & 20 deletions src/Material-Design-Lite-Utils/MDLLibrary.class.st

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions src/Material-Design-Lite-Widgets-Tests/MDLCalendarTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,26 @@ MDLCalendarTest >> testSelectNextMonth [
self assert: calendar currentDate equals: (Date year: 2016 month: 5 day: 10)
]

{ #category : #tests }
MDLCalendarTest >> testSelectNextYears [
calendar currentDate: (Date year: 2016 month: 4 day: 10).
calendar selectNextYears.
self assert: calendar yearsInterval first equals: 2021.
self assert: calendar yearsInterval last equals: 2029
]

{ #category : #tests }
MDLCalendarTest >> testSelectPreviousMonth [
calendar currentDate: (Date year: 2016 month: 4 day: 10).
calendar selectPreviousMonth.
self assert: calendar currentDate asMonth equals: (Month month: 3 year: 2016).
self assert: calendar currentDate equals: (Date year: 2016 month: 3 day: 10)
]

{ #category : #tests }
MDLCalendarTest >> testSelectPreviousYears [
calendar currentDate: (Date year: 2016 month: 4 day: 10).
calendar selectPreviousYears.
self assert: calendar yearsInterval first equals: 2003.
self assert: calendar yearsInterval last equals: 2011
]
15 changes: 15 additions & 0 deletions src/Material-Design-Lite-Widgets-Tests/MDLNestedListTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,21 @@ MDLNestedListTest >> testJsOnLoadHook [
self assert: list jsOnLoadHook contents equals: 'console.log("test")'
]

{ #category : #tests }
MDLNestedListTest >> testNotEraseOnCompleOnJSScript [
WAHtmlCanvas builder
render: [ :html |
list elements: self sampleElements keys.
list
onClickJs: [ :entity |
html jQuery ajax
serializeForm;
onComplete: 'console.log("this exists")' ] ].
self
assert: [ :html | html render: list ]
generatedIncludes: 'console.log(&quot;this exists&quot;)'
]

{ #category : #tests }
MDLNestedListTest >> testRightIconBlockIsRenderedIfNeeded [
list elements: self sampleElements keys.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ MDLTabsWidgetTest >> testAddTabNamedContent [
(MDLTabWidget new
addTabNamed: 'Tab label' content: 'Tab content';
yourself) ]
generatedIncludesAll: #('<a class="mdl-tabs__tab is-active" href="#id2">Tab label</a>' '<div class="mdl-tabs__panel is-active" id="id2">Tab content</div>')
generatedIncludesAll: #('<a class="mdl-tabs__tab is-active"' 'href="#id2">Tab label</a>' '<div class="mdl-tabs__panel is-active" id="id2">Tab content</div>')
]

{ #category : #tests }
Expand Down Expand Up @@ -43,5 +43,5 @@ MDLTabsWidgetTest >> testWithTwoTabs [
addTabNamed: 'Tab label' content: 'Tab content';
addTabNamed: 'Tab label 2' content: 'Tab content 2';
yourself) ]
generatedIncludesAll: #('<a class="mdl-tabs__tab is-active" href="#id2">Tab label</a>' '<div class="mdl-tabs__panel is-active" id="id2">Tab content</div>' '<a class="mdl-tabs__tab" href="#id3">Tab label 2</a>' '<div class="mdl-tabs__panel" id="id3">Tab content 2</div>')
generatedIncludesAll: #('<a class="mdl-tabs__tab is-active"' 'Tab label</a>' '<div class="mdl-tabs__panel is-active"' 'Tab content</div>' '<a class="mdl-tabs__tab"' 'Tab label 2</a>' '<div class="mdl-tabs__panel"' 'Tab content 2</div>')
]
10 changes: 10 additions & 0 deletions src/Material-Design-Lite-Widgets/Collection.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Extension { #name : #Collection }

{ #category : #'*Material-Design-Lite-Widgets' }
Collection >> selectMatchingFromMDLFilter: mdlFilter format: aFormatBlock with: aPattern [
^ self
select: [ :each |
mdlFilter
formatedElement: (aFormatBlock value: each)
matches: aPattern ]
]
10 changes: 9 additions & 1 deletion src/Material-Design-Lite-Widgets/MDLAbstractFilter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,13 @@ MDLAbstractFilter class >> isAbstract [
MDLAbstractFilter class >> selectMatchingFrom: aCollection format: aFormatBlock with: aPattern [
"I take as parameter a collection of elements to match, a block to get the readable format of the element and a pattern and I should return a collection of elements matching the pattern in their readable format."

^ aCollection select: [ :each | self formatedElement: (aFormatBlock value: each) matches: aPattern ]
^ aCollection selectMatchingFromMDLFilter: self format: aFormatBlock with: aPattern
]

{ #category : #accessing }
MDLAbstractFilter class >> selectMatchingOnQueryCollection: aQueryCollection with: aFormatBlock like: aPattern [
|newQuery|
newQuery := aQueryCollection copy.
self applySelectMatchingOnQueryCollection: newQuery with: aFormatBlock like: aPattern.
^ newQuery
]
10 changes: 9 additions & 1 deletion src/Material-Design-Lite-Widgets/MDLBeginsWithFilter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@ I am a nested list filter keeping only elements whose name begins with the patte
Class {
#name : #MDLBeginsWithFilter,
#superclass : #MDLAbstractFilter,
#category : 'Material-Design-Lite-Widgets-List'
#category : #'Material-Design-Lite-Widgets-List'
}

{ #category : #accessing }
MDLBeginsWithFilter class >> applySelectMatchingOnQueryCollection: aQueryCollection with: aFormatBlock like: aPattern [

^ aQueryCollection wrappedQuery
with: aFormatBlock
like: aPattern , '%'
]

{ #category : #accessing }
MDLBeginsWithFilter class >> formatedElement: aString matches: aPattern [
^ aString beginsWith: aPattern
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@ I am a nested list filter keeping only elements whose name begins with the patte
Class {
#name : #MDLInsensitiveBeginsWithFilter,
#superclass : #MDLAbstractFilter,
#category : 'Material-Design-Lite-Widgets-List'
#category : #'Material-Design-Lite-Widgets-List'
}

{ #category : #accessing }
MDLInsensitiveBeginsWithFilter class >> applySelectMatchingOnQueryCollection: aQueryCollection with: aFormatBlock like: aPattern [
^ aQueryCollection wrappedQuery
with: aFormatBlock
ilike: aPattern , '%'
]

{ #category : #accessing }
MDLInsensitiveBeginsWithFilter class >> formatedElement: aString matches: aPattern [
^ aString asLowercase beginsWith: aPattern asLowercase
Expand Down
Loading

0 comments on commit 3453c13

Please sign in to comment.