@cdc/core 4.23.6 → 4.23.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ <?xml version="1.0" encoding="UTF-8"?><svg id="a" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96.31 82.55"><path d="M87.87,5.89H11.35c-1.56,0-2.84,1.28-2.84,2.84v14.78c0,1.56,1.28,2.84,2.84,2.84l76.52-.19c1.56,0,2.84-1.28,2.84-2.84V8.73c0-1.56-1.28-2.84-2.84-2.84ZM25.95,14.33l-5.19,5.19c-.29,.29-.77,.29-1.06,0l-5.19-5.19c-.29-.29-.29-.77,0-1.06h11.43c.29,.29,.29,.77,0,1.06Zm60.97,10.22H32.18V7.7h54.73V24.55Z"/><path transform="translate(0, 30)" d="M87.87,5.89H11.35c-1.56,0-2.84,1.28-2.84,2.84v14.78c0,1.56,1.28,2.84,2.84,2.84l76.52-.19c1.56,0,2.84-1.28,2.84-2.84V8.73c0-1.56-1.28-2.84-2.84-2.84ZM25.95,14.33l-5.19,5.19c-.29,.29-.77,.29-1.06,0l-5.19-5.19c-.29-.29-.29-.77,0-1.06h11.43c.29,.29,.29,.77,0,1.06Zm60.97,10.22H32.18V7.7h54.73V24.55Z"/></svg>
@@ -13,14 +13,6 @@ import { formatNumber } from '@cdc/core/helpers/cove/number'
13
13
 
14
14
  import Loading from '@cdc/core/components/Loading'
15
15
 
16
- // FILE REVIEW
17
- // TODO: Remove eslint-disable jsx/a11y/non-interactive-tabindex and handle appropriately
18
- // TODO: Move ExternalIcon to core Icon component
19
- // TODO: use destructuring
20
- // TODO: @tturnerswdev33 - It looks like there's an unused variable setFilteredCountryCode that was added
21
- // TODO: @tturnerswdev33 - change function declarations to arrow functions
22
- // TODO: @tturnerswdev33 - move caption so that useMemo is not rendered conditionally
23
-
24
16
  /* eslint-disable jsx-a11y/no-noninteractive-tabindex, jsx-a11y/no-static-element-interactions */
25
17
  const DataTable = props => {
26
18
  const { config, tableTitle, indexTitle, vizTitle, rawData, runtimeData, headerColor, expandDataTable, columns, displayDataAsText, applyLegendToRow, displayGeoName, navigationHandler, viewport, formatLegendLocation, tabbingId, isDebug } = props
@@ -213,16 +205,19 @@ const DataTable = props => {
213
205
 
214
206
  const rows = Object.keys(runtimeData).sort((a, b) => {
215
207
  let sortVal
216
- if (config.columns.length > 0) {
208
+ if (config.type === 'map' && config.columns) {
217
209
  sortVal = customSort(runtimeData[a][config.columns[sortBy.column].name], runtimeData[b][config.columns[sortBy.column].name])
218
210
  }
211
+ if (config.type === 'chart') {
212
+ sortVal = customSort(runtimeData[a][sortBy.column], runtimeData[b][sortBy.column])
213
+ }
219
214
  if (!sortBy.asc) return sortVal
220
215
  if (sortVal === 0) return 0
221
216
  if (sortVal < 0) return 1
222
217
  return -1
223
218
  })
224
219
 
225
- function genMapRows(rows) {
220
+ const genMapRows = rows => {
226
221
  const allrows = rows.map(row => {
227
222
  return (
228
223
  <tr role='row'>
@@ -316,6 +311,7 @@ const DataTable = props => {
316
311
  }
317
312
 
318
313
  const genChartHeader = (columns, data) => {
314
+ if (!data) return
319
315
  return (
320
316
  <tr>
321
317
  {dataSeriesColumns().map(column => {
@@ -355,6 +351,24 @@ const DataTable = props => {
355
351
  )
356
352
  }
357
353
 
354
+ // if its additional column, return formatting params
355
+ const isAdditionalColumn = column => {
356
+ let inthere = false
357
+ let formattingParams = {}
358
+ Object.keys(config.columns).forEach(keycol => {
359
+ if (config.columns[keycol].name === column) {
360
+ inthere = true
361
+ formattingParams = {
362
+ addColPrefix: config.columns[keycol].prefix,
363
+ addColSuffix: config.columns[keycol].suffix,
364
+ addColRoundTo: config.columns[keycol].roundToPlace ? config.columns[keycol].roundToPlace : '',
365
+ addColCommas: config.columns[keycol].commas
366
+ }
367
+ }
368
+ })
369
+ return formattingParams
370
+ }
371
+
358
372
  const genChartRows = rows => {
359
373
  const allRows = rows.map(row => {
360
374
  return (
@@ -367,10 +381,9 @@ const DataTable = props => {
367
381
  // not the prettiest, but helper functions work nicely here.
368
382
  cellValue = <>{config.xAxis.type === 'date' ? formatDate(config.xAxis.dateDisplayFormat, parseDate(config.xAxis.dateParseFormat, labelValue)) : labelValue}</>
369
383
  } else {
370
- let resolvedAxis = ''
384
+ let resolvedAxis = 'left'
371
385
  let leftAxisItems = config.series.filter(item => item?.axis === 'Left')
372
386
  let rightAxisItems = config.series.filter(item => item?.axis === 'Right')
373
- console.log('column', column)
374
387
 
375
388
  leftAxisItems.map(leftSeriesItem => {
376
389
  if (leftSeriesItem.dataKey === column) resolvedAxis = 'left'
@@ -380,7 +393,12 @@ const DataTable = props => {
380
393
  if (rightSeriesItem.dataKey === column) resolvedAxis = 'right'
381
394
  })
382
395
 
383
- cellValue = formatNumber(runtimeData[row][column], resolvedAxis, true, config)
396
+ let addColParams = isAdditionalColumn(column)
397
+ if (addColParams) {
398
+ cellValue = formatNumber(runtimeData[row][column], resolvedAxis, true, config, addColParams)
399
+ } else {
400
+ cellValue = formatNumber(runtimeData[row][column], resolvedAxis, true, config)
401
+ }
384
402
  }
385
403
 
386
404
  return (
@@ -418,7 +436,7 @@ const DataTable = props => {
418
436
  [config.runtime.seriesKeys]) // eslint-disable-line
419
437
 
420
438
  if (config.visualizationType !== 'Box Plot') {
421
- function genMapHeader(columns) {
439
+ const genMapHeader = columns => {
422
440
  return (
423
441
  <tr>
424
442
  {Object.keys(columns)
@@ -433,9 +451,11 @@ const DataTable = props => {
433
451
  if (config.type === 'map' && (text === undefined || text === '')) {
434
452
  text = 'Location'
435
453
  }
454
+
436
455
  return (
437
456
  <th
438
457
  key={`col-header-${column}`}
458
+ id={column}
439
459
  tabIndex='0'
440
460
  title={text}
441
461
  role='columnheader'
@@ -530,7 +550,7 @@ const DataTable = props => {
530
550
  )
531
551
  } else {
532
552
  // Render Data Table for Box Plots
533
- function genBoxplotHeader(categories) {
553
+ const genBoxplotHeader = categories => {
534
554
  let columns = ['Measures', ...categories]
535
555
  return (
536
556
  <tr>
@@ -584,7 +604,7 @@ const DataTable = props => {
584
604
  if (Number(rowid) === 10) return plot.values.length > 0 ? plot.values.toString() : '-'
585
605
  return <p>-</p>
586
606
  }
587
- function genBoxplotRows(rows) {
607
+ const genBoxplotRows = rows => {
588
608
  // get list of data keys for each row
589
609
  let dataKeys = rows.map(row => {
590
610
  return row[0]
@@ -27,7 +27,8 @@ import iconWarningCircle from '../../assets/icon-warning-circle.svg'
27
27
  import iconWarningTriangle from '../../assets/icon-warning-triangle.svg'
28
28
  import iconGear from '../../assets/icon-gear.svg'
29
29
  import iconTools from '../../assets/icon-tools.svg'
30
- import iconText from '../../assets/filtered-text.svg'
30
+ import iconText from '../../assets/icon-filtered-text.svg'
31
+ import iconDropdowns from '../../assets/icon-filter-dropdowns.svg'
31
32
  import iconPlus from '../../assets/icon-plus.svg'
32
33
  import iconMinus from '../../assets/icon-minus.svg'
33
34
 
@@ -62,7 +63,8 @@ const iconHash = {
62
63
  tools: iconTools,
63
64
  plus: iconPlus,
64
65
  minus: iconMinus,
65
- 'filtered-text': iconText
66
+ 'filtered-text': iconText,
67
+ 'filter-dropdowns': iconDropdowns
66
68
  }
67
69
 
68
70
  const Icon = ({ display = null, base, alt = '', size, color, style, ...attributes }) => {
@@ -9,42 +9,30 @@ import '../../styles/v2/components/ui/tooltip.scss'
9
9
  const TooltipTarget = () => null
10
10
  const TooltipContent = () => null
11
11
 
12
- const Tooltip = ({
13
- place = 'top',
14
- trigger = 'hover',
15
- float = false,
16
- shadow = true,
17
- border = false,
18
- children,
19
- style,
20
- ...attributes
21
- }) => {
22
-
12
+ const Tooltip = ({ place = 'top', trigger = 'hover', float = false, shadow = true, border = false, children, style, ...attributes }) => {
23
13
  const tooltipTargetChildren = children.find(el => el.type === TooltipTarget)
24
14
  const tooltipContentChildren = children.find(el => el.type === TooltipContent)
25
15
 
26
16
  const uid = 'tooltip-' + useId()
27
17
 
28
- const generateTriggerEvent = (trigger) => {
18
+ const generateTriggerEvent = trigger => {
29
19
  const eventList = {
30
- 'hover': null,
31
- 'focus': 'focus',
32
- 'click': 'click focus'
20
+ hover: null,
21
+ focus: 'focus',
22
+ click: 'click focus'
33
23
  }
34
24
  return eventList[trigger]
35
25
  }
36
26
 
37
27
  return (
38
- <span className="cove-tooltip" style={style} {...attributes}>
39
- <a id={uid} className="cove-tooltip--target"
40
- data-tooltip-float={float}
41
- data-tooltip-place={place}
42
- data-tooltip-events={generateTriggerEvent()}
43
- >
28
+ <span className='cove-tooltip' style={style} {...attributes}>
29
+ <a id={uid} className='cove-tooltip--target' data-tooltip-float={float} data-tooltip-place={place} data-tooltip-events={generateTriggerEvent()}>
44
30
  {tooltipTargetChildren ? tooltipTargetChildren.props.children : null}
45
31
  </a>
32
+ {/* prettier-ignore */}
46
33
  <ReactTooltip
47
- id={uid} anchorId={uid}
34
+ id={uid}
35
+ anchorId={uid}
48
36
  className={'cove-tooltip__content' + (' place-' + place) + (!float ? ' cove-tooltip__content--animated' : '') + (trigger === 'click' ? ' interactive' : '') + (border ? (' cove-tooltip--border') : '') + (shadow ? ' has-shadow' : '')}
49
37
  globalEventOff="click"
50
38
  >
@@ -19,7 +19,7 @@ const abbreviateNumber = num => {
19
19
  }
20
20
 
21
21
  // Format numeric data based on settings in config
22
- const formatNumber = (num, axis, shouldAbbreviate = false, config = null) => {
22
+ const formatNumber = (num, axis, shouldAbbreviate = false, config = null, addColParams = null) => {
23
23
  if (!config) console.error('no config found in formatNumber')
24
24
  // if num is NaN return num
25
25
  if (isNaN(num) || !num) return num
@@ -36,17 +36,36 @@ const formatNumber = (num, axis, shouldAbbreviate = false, config = null) => {
36
36
  dataFormat: { commas, abbreviated, roundTo, prefix, suffix, rightRoundTo, bottomRoundTo, rightPrefix, rightSuffix, bottomPrefix, bottomSuffix, bottomAbbreviated }
37
37
  } = config
38
38
 
39
+ // destructure Additional Col dataformat values
40
+ const { addColCommas, addColRoundTo, addColPrefix, addColSuffix } = addColParams
41
+
39
42
  // check if value contains comma and remove it. later will add comma below.
40
43
  if (String(num).indexOf(',') !== -1) num = num.replaceAll(',', '')
41
44
 
42
45
  let original = num
43
46
  let stringFormattingOptions
44
47
  if (axis === 'left') {
45
- stringFormattingOptions = {
46
- useGrouping: config.dataFormat.commas ? true : false,
47
- minimumFractionDigits: roundTo ? Number(roundTo) : 0,
48
- maximumFractionDigits: roundTo ? Number(roundTo) : 0
49
- }
48
+ let roundToPlace
49
+ if (addColRoundTo !== undefined) {
50
+ // if its an Additional Column
51
+ roundToPlace = addColRoundTo ? Number(addColRoundTo) : 0
52
+ } else {
53
+ roundToPlace = roundTo ? Number(roundTo) : 0
54
+ }
55
+ // Need to prevent negative values in rounding
56
+ if (roundToPlace < 0) roundToPlace = 0
57
+ let useCommas
58
+ if (addColCommas !== undefined) {
59
+ // if its an Additional Column
60
+ useCommas = addColCommas ? true : false
61
+ } else {
62
+ useCommas = config.dataFormat.commas ? true : false
63
+ }
64
+ stringFormattingOptions = {
65
+ useGrouping: useCommas,
66
+ minimumFractionDigits: roundToPlace,
67
+ maximumFractionDigits: roundToPlace
68
+ }
50
69
  }
51
70
 
52
71
  if (axis === 'right') {
@@ -104,8 +123,12 @@ const formatNumber = (num, axis, shouldAbbreviate = false, config = null) => {
104
123
  num = abbreviateNumber(parseFloat(num))
105
124
  }
106
125
 
107
- if (prefix && axis === 'left') {
108
- result += prefix
126
+ if (addColPrefix !== undefined && axis === 'left') {
127
+ result = addColPrefix + result
128
+ } else {
129
+ if (prefix && axis === 'left') {
130
+ result = prefix + result
131
+ }
109
132
  }
110
133
 
111
134
  if (rightPrefix && axis === 'right') {
@@ -118,8 +141,12 @@ const formatNumber = (num, axis, shouldAbbreviate = false, config = null) => {
118
141
 
119
142
  result += num
120
143
 
121
- if (suffix && axis === 'left') {
122
- result += suffix
144
+ if (addColSuffix !== undefined && axis === 'left') {
145
+ result += addColSuffix
146
+ } else {
147
+ if (suffix && axis === 'left') {
148
+ result += suffix
149
+ }
123
150
  }
124
151
 
125
152
  if (rightSuffix && axis === 'right') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdc/core",
3
- "version": "4.23.6",
3
+ "version": "4.23.7",
4
4
  "description": "Core components, styles, hooks, and helpers, for the CDC Open Visualization project",
5
5
  "moduleName": "CdcCore",
6
6
  "main": "dist/cdccore",
@@ -30,5 +30,5 @@
30
30
  "react": "^18.2.0",
31
31
  "react-dom": "^18.2.0"
32
32
  },
33
- "gitHead": "aaed0388b487adfeb3e7e278b4ce74df09cbaade"
33
+ "gitHead": "6c7ac5215dcf3bc1cc7d199089c8c2e75f53a93e"
34
34
  }
@@ -1,17 +1,34 @@
1
- $cove-tooltip-bg: #fff;
2
- $cove-tooltip-color: #333;
3
- $cove-tooltip-animation: 500ms cubic-bezier(0.16, 1, 0.3, 1) 50ms 1 forwards;
4
-
5
- .cove-tooltip {
6
- display: inline-block;
7
- position: relative;
8
- line-height: 1em;
1
+ // Reusable variables, nice for JS manipulations
2
+ :root {
3
+ --cove-tooltip-bg: #fff;
4
+ --cove-tooltip-color: black;
5
+ --cove-tooltip-font-size: 14px;
6
+ --cove-tooltip-border-color: #bdbdbd;
7
+ --cove-tooltip-heading-fontWeight: bold;
8
+ --cove-tooltip-animation: 500ms cubic-bezier(0.16, 1, 0.3, 1) 50ms 1 forwards;
9
+ --cove-tooltip-maxWidth: 280px;
10
+ }
9
11
 
10
- &.cove-tooltip--border {
11
- border: 1px solid #bdbdbd;
12
+ // Namespace to cove project, inconveniently using two different classes.
13
+ .cove,
14
+ .cdc-open-viz-module {
15
+ // todo: move to a utils folder.
16
+ .capitalize {
17
+ text-transform: capitalize;
18
+ }
19
+
20
+ // react-tooltip library
21
+ .react-tooltip {
22
+ .styles-module_arrow,
23
+ .react-tooltip-arrow {
24
+ border-bottom: var(--cove-tooltip-border-color) 1px solid;
25
+ border-right: var(--cove-tooltip-border-color) 1px solid;
26
+ backface-visibility: hidden;
27
+ }
12
28
  }
13
29
 
14
- @at-root {
30
+ // editor-panel
31
+ .editor-panel {
15
32
  .cove-label + .cove-tooltip {
16
33
  top: 1px;
17
34
  margin-left: 0.5rem;
@@ -30,6 +47,61 @@ $cove-tooltip-animation: 500ms cubic-bezier(0.16, 1, 0.3, 1) 50ms 1 forwards;
30
47
  line-height: inherit;
31
48
  }
32
49
  }
50
+
51
+ // begin actual tooltip styles
52
+ .react-tooltip,
53
+ .tooltip {
54
+ color: var(--cove-tooltip-color);
55
+ border: 1px solid var(--cove-tooltip-border-color);
56
+ padding: 0.3rem 0.5rem;
57
+ z-index: 1000;
58
+ opacity: 1;
59
+
60
+ .interactive {
61
+ a {
62
+ pointer-events: all;
63
+ }
64
+ }
65
+
66
+ ul {
67
+ list-style: none;
68
+
69
+ li {
70
+ font-size: var(--cove-tooltip-font-size) !important;
71
+ }
72
+
73
+ // under the heading
74
+ > li.tooltip-body {
75
+ border-top: 1px solid black;
76
+ padding-top: 5px;
77
+ }
78
+
79
+ li.tooltip-body:first-of-type {
80
+ padding-top: 5px;
81
+ border-top: 1px solid black;
82
+ }
83
+
84
+ // undo previous except first class
85
+ > li.tooltip-body ~ li.tooltip-body {
86
+ border-top: initial;
87
+ padding-top: initial;
88
+ }
89
+ }
90
+
91
+ .tooltip-heading {
92
+ display: block;
93
+ font-weight: var(--cove-tooltip-heading-fontWeight) !important;
94
+ padding-bottom: 3px;
95
+ padding-top: 3px;
96
+ font-size: var(--cove-tooltip-font-size) !important;
97
+ }
98
+ }
99
+ }
100
+
101
+ .cove-tooltip {
102
+ display: inline-block;
103
+ position: relative;
104
+ line-height: 1em;
33
105
  }
34
106
 
35
107
  .cove-tooltip--target {
@@ -45,16 +117,15 @@ $cove-tooltip-animation: 500ms cubic-bezier(0.16, 1, 0.3, 1) 50ms 1 forwards;
45
117
  }
46
118
 
47
119
  .cove-tooltip__content {
48
- max-width: 280px;
120
+ max-width: var(--cove-tooltip-maxWidth);
49
121
  padding: 10px 8px;
50
122
  font-size: 0.875rem;
51
123
  line-height: 1.125rem;
52
124
  text-align: left;
53
- color: $cove-tooltip-color;
54
- background-color: $cove-tooltip-bg;
125
+ color: var(--cove-tooltip-color);
126
+ background-color: var(--cove-tooltip-bg);
55
127
  border-radius: 5px;
56
128
  user-select: none;
57
- opacity: 0;
58
129
  cursor: default;
59
130
  z-index: 1;
60
131
 
@@ -64,7 +135,7 @@ $cove-tooltip-animation: 500ms cubic-bezier(0.16, 1, 0.3, 1) 50ms 1 forwards;
64
135
  }
65
136
 
66
137
  &.cove-tooltip__content--animated[class*='styles-module_show__'] {
67
- animation: tooltip-btt $cove-tooltip-animation;
138
+ animation: tooltip-btt var(--cove-tooltip-animation);
68
139
  }
69
140
  }
70
141
 
@@ -74,7 +145,7 @@ $cove-tooltip-animation: 500ms cubic-bezier(0.16, 1, 0.3, 1) 50ms 1 forwards;
74
145
  }
75
146
 
76
147
  &.cove-tooltip__content--animated[class*='styles-module_show__'] {
77
- animation: tooltip-ltr $cove-tooltip-animation;
148
+ animation: tooltip-ltr var(--cove-tooltip-animation);
78
149
  }
79
150
  }
80
151
 
@@ -84,7 +155,7 @@ $cove-tooltip-animation: 500ms cubic-bezier(0.16, 1, 0.3, 1) 50ms 1 forwards;
84
155
  }
85
156
 
86
157
  &.cove-tooltip__content--animated[class*='styles-module_show__'] {
87
- animation: tooltip-ttb $cove-tooltip-animation;
158
+ animation: tooltip-ttb var(--cove-tooltip-animation);
88
159
  }
89
160
  }
90
161
 
@@ -94,61 +165,7 @@ $cove-tooltip-animation: 500ms cubic-bezier(0.16, 1, 0.3, 1) 50ms 1 forwards;
94
165
  }
95
166
 
96
167
  &.cove-tooltip__content--animated[class*='styles-module_show__'] {
97
- animation: tooltip-rtl $cove-tooltip-animation;
168
+ animation: tooltip-rtl var(--cove-tooltip-animation);
98
169
  }
99
170
  }
100
171
  }
101
-
102
- .interactive {
103
- a {
104
- pointer-events: all;
105
- }
106
- }
107
-
108
- @keyframes tooltip-ltr {
109
- 0% {
110
- opacity: 0;
111
- transform: translateX(-8px);
112
- }
113
-
114
- 100% {
115
- opacity: 1;
116
- transform: translateX(0);
117
- }
118
- }
119
-
120
- @keyframes tooltip-rtl {
121
- 0% {
122
- opacity: 0;
123
- transform: translateX(8px);
124
- }
125
-
126
- 100% {
127
- opacity: 1;
128
- transform: translateX(0);
129
- }
130
- }
131
-
132
- @keyframes tooltip-ttb {
133
- 0% {
134
- opacity: 0;
135
- transform: translateY(-8px);
136
- }
137
-
138
- 100% {
139
- opacity: 1;
140
- transform: translateY(0);
141
- }
142
- }
143
-
144
- @keyframes tooltip-btt {
145
- 0% {
146
- opacity: 0;
147
- transform: translateY(8px);
148
- }
149
-
150
- 100% {
151
- opacity: 1;
152
- transform: translateY(0);
153
- }
154
- }
package/LICENSE DELETED
@@ -1,201 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright [yyyy] [name of copyright owner]
190
-
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
194
-
195
- http://www.apache.org/licenses/LICENSE-2.0
196
-
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.