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

Jstefaniuk/hybridize #30

Merged
merged 40 commits into from
May 23, 2018
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
0a27079
Standardize editorconfig, eslintrc and package.json
svanherk Feb 21, 2018
867a478
Setup Sauce
svanherk Feb 21, 2018
df75f4b
Remove window from behaviour and update gitignore
svanherk Feb 21, 2018
813a0a6
Add bower ignore, variants and codeowners
svanherk Feb 21, 2018
e12a899
update bower deps
May 9, 2018
244bea3
linting
May 9, 2018
d4b3257
fix problem where iron-a11y-keys crashes since the _target object isn…
May 9, 2018
a04e22b
initial whack at styling the polymer 2 date picker to look the same a…
May 10, 2018
25f1ff7
make the input binding actually work for polymer 2
May 10, 2018
42dfac4
add .input class so that the polymer 1 version of vaadin-date-picker-…
May 10, 2018
4ebe161
fix the date being formatted wrong in the iron input box (we were get…
May 11, 2018
e89989a
css tweaks for responsive behaviour
May 11, 2018
6b8627f
fork the polymer 1 date picker to fix it's iron-input 2 incompatibility
May 11, 2018
d0c97ce
for polymer 2, this test needs to run after a render
May 13, 2018
a2dabf9
Fix event handler changes for p2 vaadin-date-picker and remove unused…
May 13, 2018
12b7a29
don't use fire, also test that the event is putting out the right value
May 13, 2018
233f229
put the time picker back since apparently it gets used
May 13, 2018
419f88c
code review changes
May 14, 2018
21dca0a
use d2l-localize-behavior
May 14, 2018
4d7042a
don't create a localizer specifically for this
May 14, 2018
2791bde
undo change accidentally commited
jstefaniuk-d2l May 14, 2018
26f34eb
trigger the build again
jstefaniuk-d2l May 14, 2018
e5f49c6
break out polymer1 styles for reuse elsewhere
May 14, 2018
ecb2edd
Merge branch 'jstefaniuk/hybridize' of github.com:BrightspaceUI/date-…
May 14, 2018
fc8d527
remove custom-style tags
May 15, 2018
0c75c68
break the date picker js into it's own behavior for easier reuse
May 15, 2018
a2fd6e2
add a slot so that users can specify their own launcher, and add a de…
May 15, 2018
8b79ad7
allow for date picker 1 or 2
May 16, 2018
d423b9d
reduce the resolutions as much as possible
May 16, 2018
3a01b0a
all on the brightspace fork
May 16, 2018
1d34198
use brightspace released version
May 16, 2018
34ec7c6
add a way to inject css into the overlay
May 16, 2018
bd938f9
cleanup and code review
May 17, 2018
1f85e74
point to the right fastdom import location
May 17, 2018
37065d9
code review
May 18, 2018
0b775ef
remove comment
jstefaniuk-d2l May 18, 2018
7f8ad1c
fastdom for focus
May 18, 2018
84b8bea
Merge branch 'date-picker-slot' of github.com:BrightspaceUI/date-pick…
May 22, 2018
92dbb16
remove unused resolution
May 22, 2018
48a50dd
Merge pull request #31 from BrightspaceUI/date-picker-slot
jstefaniuk-d2l May 23, 2018
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
26 changes: 13 additions & 13 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
root = true
[*]
charset = utf8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab
indent_size = 4
[{package.json,.travis.yml}]
indent_style = space
indent_size = 2
root = true

[*]
charset = utf8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab
indent_size = 4

[{*.json,*.yml}]
indent_style = space
indent_size = 2
File renamed without changes.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
bower_components
bower_components-1.x
bower-1.x.json
node_modules
12 changes: 7 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
language: node_js
node_js: node
before_script:
- npm install -g polymer-cli
- polymer install --variants
node_js: 9
script:
- npm run test:lint
- npm run lint
- polymer test --skip-plugin local
env:
global:
- SAUCE_USERNAME: Desire2Learn
- secure: R9nrpeyuMcZTHnBcVAuMn+q/Fp9ti9K31tYlkBFhXtJc+rM/TYERiN195SRgbk2Gy6fK4exUXIWZtJW+cxuRwDoBIcSGWRwHWmkDc5k13kLaW/BcdWAfI/yFEkAwzrO1AfQOsB1qdbfYle9pP724BebfQHlqAxH9zNWlQdek+Gr02WKKXMWWhl2bH4P2QbNQItD5X6+xQTbnbmZnUECap9mQXbCzPVNU2MwvPRLuYuJmjcNBdC39iGfZNBY/+N1Ix3y6yFa41VD773KiqTZhVOM1TvVJz/lb+Dm25qSZdKixC0987eDY5zHiCigHIjJxo1bDwJz4xJ/DsnIo+hk0LvrOPvoxBp6tFNhGQgIUkwk0Lz6FsNQcH5l5QLh1ROq4isNx9BVEOHb+W1PdFzFlvoKf9+WS/ysSw19B/GFhtLJGTmGkaxnEBxhJ+DyiVnV5APV+cE4AEA4yB/Vz7cKOrBlLbZdZFb8x9DtHamKvyoZh7RVun6BHSmMNAlPD83oxF9HZ7GjhKeC1EpvIdSrZAh6NKgklt0slwSumWU6VfJeoT4STNfiP39DzHHtWqscwTTAG9Rp4UFxDRsz6jCWaPf7AfYe85fXp+EwBRC0RYikQz43IFnKoGpz69qNh4vap6HNPQmM2uctZeWbhtDSq2FzN5fbheSV5QlFeq88O4S8=
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @alogan519 @d2l-pbrown
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ The label for the input field
#### 'locale'
The locale for the picker, for example, 'en', 'fr'...

#### 'date-format'
The date format for the input field, for example, 'yyyy/mm/dd', 'dd/mm/yyyy', etc...

#### 'first-day-of-week'
The first day of the week for the date picker, (0 = Sunday, 1 = Monday, 2 = Tuesday, 3 = Wednesday, 4 = Thursday, 5 = Friday, 6 = Saturday)

## Overriding the date format
This repository uses https://github.com/BrightspaceUI/localize-behavior for formatting dates, if you need to override the date format, look there for instructions.
61 changes: 46 additions & 15 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,57 @@
"name": "d2l-date-picker",
"description": "A Date Picker for D2L Brightspace",
"main": "d2l-date-picker.html",
"license": "Apache-2.0",
"ignore": [
"demo",
"test",
".editorconfig",
".eslintrc.json",
".gitignore",
".travis.yml",
"package.json",
"polymer.json",
"wct.conf.json"
],
"dependencies": {
"polymer": "Polymer/polymer#^1.9.0",
"d2l-time-picker": "BrightspaceUI/time-picker#^0.3.0",
"vaadin-date-picker": "~1.2.3",
"d2l-colors": "^2.4.0",
"d2l-intl": "^0.4.1",
"iron-a11y-keys": "^1.0.9",
"app-localize-behavior": "~1.0.2",
"d2l-localize-behavior": "^1.1.0",
"d2l-colors": "^3.1.2",
"d2l-offscreen": "^3.0.1",
"d2l-polymer-behaviors": "^1.0.0"
"d2l-polymer-behaviors": "^1.0.0",
"d2l-time-picker": "BrightspaceUI/time-picker#^1.0.0",
"iron-a11y-keys": "^2.0.0",
"iron-input": "^2.0.0",
"polymer": "1.9 - 2",
"vaadin-date-picker": "^2.0.0"
},
"devDependencies": {
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.0.0",
"web-component-tester": "Polymer/web-component-tester#^6.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
"iron-test-helpers": "^1.0.0"
"iron-component-page": "PolymerElements/iron-component-page#^2.0.0",
"iron-demo-helpers": "PolymerElements/iron-demo-helpers#^2.0.0",
"iron-test-helpers": "^2.0.0",
"web-component-tester": "Polymer/web-component-tester#^6.0.0"
},
"variants": {
"1.x": {
"dependencies": {
"polymer": "^1.9.1",
"vaadin-date-picker": "Brightspace/vaadin-date-picker#^1.2.5"
},
"resolutions": {
"iron-a11y-announcer": "^2.0.0",
"iron-a11y-keys-behavior": "^2.0.0",
"iron-dropdown": "^2.0.0",
"iron-iconset-svg": "^2.0.0",
"iron-input": "^2.0.0",
"iron-media-query": "^2.0.0",
"iron-overlay-behavior": "^2.2.0",
"iron-resizable-behavior": "^2.0.0",
"iron-selector": "^2.0.0",
"webcomponentsjs": "^0.7.24"
}
}
},
"resolutions": {
"d2l-offscreen": "^3.0.1",
"d2l-polymer-behaviors": "^1.0.0"
"d2l-polymer-behaviors": "^1.0.0",
"vaadin-date-picker": "^2.0.0"
}
}
140 changes: 140 additions & 0 deletions d2l-date-picker-style-modules.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../d2l-colors/d2l-colors.html">
<link rel="import" href="../vaadin-date-picker/vaadin-date-picker-styles.html">

<dom-module id="d2l-vaadin-date-picker-polymer1-styles">
<template>
<style>
vaadin-date-picker-light {
--primary-color: var(--d2l-color-celestine);
--light-primary-color: var(--d2l-color-celestine-plus-1);
--dark-theme-background-color: var(--d2l-color-ferrite);
--dark-theme-secondary-color: #ffffff;
--primary-text-color: var(--d2l-color-ferrite);
--secondary-text-color: var(--d2l-color-tungsten);

--vaadin-date-picker-overlay: {
font-family: inherit;
max-height: 355px;
};
--vaadin-date-picker-yearscroller: {
font-family: inherit;
};
--vaadin-date-picker-header: {
font-family: inherit;
};
--vaadin-date-picker-calendar-title: {
font-family: inherit;
};
--vaadin-date-picker-calendar-cell: {
font-family: inherit;
};
--vaadin-date-picker-footer: {
font-family: inherit;
};
--vaadin-date-picker-calendar: {
font-family: inherit;
};
}
</style>
</template>
</dom-module>

<dom-module id="d2l-vaadin-overlay-styles" theme-for="vaadin-date-picker-overlay">
<template>
<style include="vaadin-date-picker-overlay-default-theme">
:host {
font-family: inherit;
max-height: 355px;
}

[part~="overlay-header"] {
background-color: var(--d2l-color-celestine);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're referencing the colors CSS variables, you should import d2l-colors.html explicitly -- just in case it gets removed from another import later.

color: white;
}

[part~="toolbar"] {
background: white;
box-shadow: 0 -1px 4px 0 rgba(0, 0, 0, 0.5);
}

[part~="years"] {
color: white;
background-color: var(--d2l-color-ferrite);
}

[part~="year-separator"] {
color: var(--d2l-color-tungsten);
}

[part~="year-separator"]::after {
font-size: 5px;
}

[part~="years-toggle-button"] {
background-color: var(--d2l-color-celestine);
cursor: pointer;
}
</style>
</template>
</dom-module>

<dom-module id="d2l-vaadin-month-calendar-styles" theme-for="vaadin-month-calendar">
<template>
<style include="vaadin-month-calendar-default-theme">
:host {
font-family: inherit;
color: var(--d2l-color-tungsten);
}

[part~="date"][today] {
background-color: transparent;
color: var(--d2l-color-celestine-plus-1);
}

:host([focused]) [part~="date"][focused],
[part~="date"][focused] {
background: var(--d2l-color-celestine);
color: white;
font-weight: 700;
}

[part~="month-header"] {
color: var(--d2l-color-ferrite);
font-size: 16px;
font-weight: 400;
line-height: 24px;
font-family: inherit;
}

[part~="weekday"] {
opacity: 1;
color: var(--d2l-color-ferrite);
font-size: 12px;
text-transform: uppercase;
opacity: 0.8;
}
</style>
</template>
</dom-module>

<dom-module id="d2l-vaadin-button-styles" theme-for="vaadin-button">
<template>
<style>
:host {
font-family: inherit;
}

[part~="button"] {
background: none;
font-family: inherit;
color: var(--d2l-color-celestine);
font-size: 14px;
text-transform: uppercase;
border: none;
cursor: pointer;
font-weight: 500;
}
</style>
</template>
</dom-module>
Loading