@atlassian/aui 9.3.4 → 9.3.5

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.
@@ -9,7 +9,7 @@ export * from './aui.batch.components';
9
9
  import './aui.component.form-notification';
10
10
  import './aui.component.form-validation';
11
11
  import { Header } from './aui.component.async-header';
12
- import { DatePicker } from './aui.component.form.date-select';
12
+ import { DatePicker, CalendarWidget } from './aui.component.form.date-select';
13
13
  import { RestfulTable } from './aui.component.restful-table';
14
14
  import { sidebar } from './aui.component.sidebar';
15
15
  import { whenIType } from './behaviours/aui.behaviour.keyboard-shortcuts';
@@ -18,6 +18,7 @@ export {
18
18
  I18n,
19
19
  Header,
20
20
  DatePicker,
21
+ CalendarWidget,
21
22
  RestfulTable,
22
23
  sidebar,
23
24
  whenIType,
@@ -1,4 +1,4 @@
1
1
  import './styles/aui.pattern.forms';
2
2
  import './aui.component.inline-dialog2'; // so that the inline dialog styles get placed before date picker.
3
3
  import '@atlassian/aui/src/less/aui-date-picker.less';
4
- export { default as DatePicker } from '@atlassian/aui/src/js/aui/date-picker';
4
+ export { default as DatePicker, CalendarWidget } from '@atlassian/aui/src/js/aui/date-picker';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@atlassian/aui",
3
3
  "description": "Atlassian User Interface library",
4
- "version": "9.3.4",
4
+ "version": "9.3.5",
5
5
  "author": "Atlassian Pty Ltd.",
6
6
  "homepage": "https://aui.atlassian.com",
7
7
  "license": "Apache-2.0",
@@ -21,13 +21,13 @@ const makePopup = ({horizontalAlignment, datePickerUUID}) => {
21
21
  return popup;
22
22
  };
23
23
 
24
- const makeConfig = ({dateFormat, $field, onSelect, hide, onChangeMonthYear}) => ({
25
- 'dateFormat': dateFormat,
26
- 'defaultDate': $field.val(),
27
- 'maxDate': $field.attr('max'),
28
- 'minDate': $field.attr('min'),
29
- 'nextText': '>',
30
- 'onSelect': function (dateText) {
24
+ const makeConfig = ({ minDate, maxDate, dateFormat, $field, onSelect, hide, onChangeMonthYear}) => ({
25
+ dateFormat,
26
+ defaultDate: $field.val(),
27
+ maxDate: maxDate || $field.attr('max'),
28
+ minDate: minDate || $field.attr('min'),
29
+ nextText: '>',
30
+ onSelect: function (dateText) {
31
31
  $field.val(dateText);
32
32
  $field.trigger('change');
33
33
  hide();
@@ -35,7 +35,7 @@ const makeConfig = ({dateFormat, $field, onSelect, hide, onChangeMonthYear}) =>
35
35
  onSelect && onSelect.call(this, dateText);
36
36
  },
37
37
  onChangeMonthYear,
38
- 'prevText': '<'
38
+ prevText: '<'
39
39
  });
40
40
 
41
41
  const initCalendar = ({config, popupContents, getCalendarNode, hint}) => {
@@ -287,6 +287,8 @@ const initPolyfill = function (datePicker) {
287
287
  }
288
288
  const baseConfig = makeConfig({
289
289
  dateFormat: options.dateFormat,
290
+ minDate: options.minDate,
291
+ maxDate: options.maxDate,
290
292
  $field,
291
293
  onSelect: options.onSelect,
292
294
  hide: datePicker.hide,
@@ -337,6 +339,11 @@ const initPolyfill = function (datePicker) {
337
339
  // shows that changing the `type` of input does not erase its value.
338
340
  // see https://codepen.io/chrisdarroch/pen/YzwgjyJ
339
341
  $field.prop('type', 'text');
342
+ // Set default value on initialization to handle all date formats.
343
+ // It is possible, because of changing type to text on the line above.
344
+ $field.val($field.attr('value'));
345
+ // Trigger change to update calendar popup value.
346
+ $field.trigger('propertychange');
340
347
 
341
348
  // demonstrate the polyfill is initialised
342
349
  $field.attr('data-aui-dp-uuid', datePickerUUID);
@@ -1,5 +1,18 @@
1
1
  const NAMESPACE = 'AJS';
2
2
 
3
+ /**
4
+ * Makes given value available globally under window[name] attribute.
5
+ * Keep in mind that this is needed for p2-plugin where chunks of AUI
6
+ * can be loaded separately.
7
+ *
8
+ * In order for global namespace to work in `aui.prototyping.js` and
9
+ * `aui.prototyping.nodeps.js` the proper exports need to be added to:
10
+ * `packages/core/entry/aui.batch.prototyping.js`
11
+ *
12
+ * @param {string} name Name of the attribute
13
+ * @param {any} value Value to expose globally
14
+ * @returns exposed value
15
+ */
3
16
  export default function globalize (name, value) {
4
17
  if (typeof window[NAMESPACE] !== 'object') {
5
18
  window[NAMESPACE] = {};
@@ -31,6 +31,7 @@ const defaultOptions = {
31
31
  gravity: 'n',
32
32
  html: false,
33
33
  live: false,
34
+ enabled: true,
34
35
  suppress: () => false
35
36
  }
36
37
 
@@ -41,6 +42,7 @@ class Tooltip {
41
42
  this.triggerElement = triggerElement;
42
43
  this.$triggerElement = $(this.triggerElement);
43
44
  this.options = { ...defaultOptions, ...options };
45
+ this.enabled = this.options.enabled
44
46
  this.moveTitleToTooltip()
45
47
  }
46
48
 
@@ -102,12 +104,13 @@ class Tooltip {
102
104
  return $sharedTip;
103
105
  }
104
106
 
105
-
106
107
  show() {
108
+ if (this.enabled === false) {
109
+ return;
110
+ }
111
+ this.hide();
107
112
  const triggerElement = this.triggerElement;
108
113
 
109
- const $tip = this.getFloatingTip();
110
-
111
114
  const placement = GRAVITY_MAP[this.options.gravity];
112
115
 
113
116
  clearTimeout(this.popperTimeout);
@@ -119,8 +122,7 @@ class Tooltip {
119
122
  }
120
123
 
121
124
  this.popperTimeout = setTimeout(() => {
122
- const tipNode = $tip.get(0);
123
- // tipNode.setAttribute('data-show', '');
125
+ const tipNode = this.getFloatingTip().get(0);
124
126
  tipNode.classList.remove('assistive');
125
127
 
126
128
  this.popperInstance = createPopper(triggerElement, tipNode, {
@@ -141,7 +143,6 @@ class Tooltip {
141
143
 
142
144
  hide() {
143
145
  const tipNode = this.getFloatingTip().get(0);
144
- // tipNode.removeAttribute('data-show');
145
146
  tipNode.classList.add('assistive');
146
147
 
147
148
  clearTimeout(this.popperTimeout);
@@ -152,6 +153,15 @@ class Tooltip {
152
153
  }
153
154
  $(window).off(`scroll.${pluginKey}`);
154
155
  }
156
+
157
+ enable() {
158
+ this.enabled = true;
159
+ }
160
+
161
+ disable() {
162
+ this.hide();
163
+ this.enabled = false;
164
+ }
155
165
  }
156
166
 
157
167
  const tooltipsByDomNode = new WeakMap();
@@ -163,7 +173,9 @@ const getTooltipInstance = (domNode, options) => {
163
173
  let tooltip = tooltipsByDomNode.get(domNode);
164
174
  if (tooltip === undefined) {
165
175
  tooltip = new Tooltip(domNode, options);
166
- tooltipsByDomNode.set(domNode, tooltip);
176
+ if (typeof domNode === 'object') {
177
+ tooltipsByDomNode.set(domNode, tooltip);
178
+ }
167
179
  }
168
180
  return tooltip;
169
181
  }
@@ -116,10 +116,18 @@ Use CSS flexbox or grid to vertically align it.
116
116
  See https://css-tricks.com/centering-css-complete-guide/ for techniques.`
117
117
  });
118
118
 
119
- //8.4.0
119
+ // 8.4.0
120
120
 
121
121
  css('.aui-button-light', {
122
122
  sinceVersion: '8.4.0',
123
123
  removeInVersion: '10.0.0',
124
124
  extraInfo: 'ADGS allows only for normal and subtle buttons.'
125
125
  });
126
+
127
+ // 9.3.5
128
+
129
+ css('.aui-dropdown2-tailed', {
130
+ sinceVersion: '9.3.5',
131
+ removeInVersion: '10.0.0',
132
+ extraInfo: 'ADGS does not include tails on layered components'
133
+ })
@@ -233,14 +233,16 @@
233
233
  .aui-select2-container.select2-container .select2-choice:after {
234
234
  #aui.icon-pseudoelement();
235
235
  content: @aui-glyph-chevron-down;
236
- left: 100%; /* "left" + "margin-left" required because of webkit not working properly with "right" */
237
236
  height: 0;
238
237
  margin-left: -18px;
239
238
  margin-top: -2px;
240
239
  opacity: 1;
241
240
  position: absolute;
242
- top: 7px;
241
+ top: calc(50% - 10px);
243
242
  width: 0;
243
+ font-size: 16px;
244
+ line-height: 24px;
245
+ right: 22px;
244
246
  }
245
247
 
246
248
  /* Set the default text color to inherit.
@@ -271,9 +273,12 @@
271
273
  .aui-select2-container.select2-container-multi .select2-choices {
272
274
  #aui-forms.aui-select2-input-field-style(normal);
273
275
  #aui.icon(@aui-glyph-chevron-down, {
274
- font-size: inherit;
276
+ font-size: 16.5px;
275
277
  left: inherit;
276
- right: 0;
278
+ color: var(--aui-button-default-text-color);
279
+ right: 3px;
280
+ top: 50%;
281
+ line-height: 16px;
277
282
  });
278
283
 
279
284
  min-height: 0;
@@ -243,13 +243,14 @@ form.aui:not(.aui-legacy-forms) {
243
243
  }
244
244
 
245
245
  // both are @ak-color-N600
246
- @chevron-dark: url('data:image/svg+xml,%3Csvg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath fill="%23A5ADBA" d="m6.744 8.744a1.053 1.053 0 0 0 0 1.49l4.547 4.557a1 1 0 0 0 1.416 0l4.55-4.558a1.051 1.051 0 1 0-1.488-1.488l-3.77 3.776-3.768-3.776a1.051 1.051 0 0 0-1.487 0z"/%3E%3C/svg%3E%0A');
247
- @chevron-light: url('data:image/svg+xml,%3Csvg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath fill="%23344563" d="m6.744 8.744a1.053 1.053 0 0 0 0 1.49l4.547 4.557a1 1 0 0 0 1.416 0l4.55-4.558a1.051 1.051 0 1 0-1.488-1.488l-3.77 3.776-3.768-3.776a1.051 1.051 0 0 0-1.487 0z"/%3E%3C/svg%3E%0A');
246
+ @chevron-dark: url('data:image/svg+xml,%3Csvg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath fill="%23A5ADBA" d="M8.292 10.293a1.009 1.009 0 000 1.419l2.939 2.965c.218.215.5.322.779.322s.556-.107.769-.322l2.93-2.955a1.01 1.01 0 000-1.419.987.987 0 00-1.406 0l-2.298 2.317-2.307-2.327a.99.99 0 00-1.406 0z"/%3E%3C/svg%3E%0A');
247
+ @chevron-light: url('data:image/svg+xml,%3Csvg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath fill="%23344563" d="M8.292 10.293a1.009 1.009 0 000 1.419l2.939 2.965c.218.215.5.322.779.322s.556-.107.769-.322l2.93-2.955a1.01 1.01 0 000-1.419.987.987 0 00-1.406 0l-2.298 2.317-2.307-2.327a.99.99 0 00-1.406 0z"/%3E%3C/svg%3E%0A');
248
248
 
249
249
  select[disabled]:not([size]),
250
250
  .select:not([size]) {
251
251
  background-repeat: no-repeat;
252
- background-position: 100% 50%;
252
+ background-position: calc(100% + 1.5px) 50%;
253
+ background-size: 25px;
253
254
  }
254
255
 
255
256
  select.select[disabled]:not([size]) {
@@ -259,7 +260,7 @@ form.aui:not(.aui-legacy-forms) {
259
260
  }
260
261
 
261
262
  select.select:not([size]) {
262
- padding-right: 22px;
263
+ padding-right: 20px;
263
264
  background-image: @chevron-light;
264
265
  }
265
266
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  #aui {
4
4
  .aui-dropdown2-trigger-chevron-icon(@glyphsize: @aui-icon-size-small; @canvassize: @aui-icon-size-small-canvas) {
5
- @canvas-padding: ((@canvassize - @glyphsize) / 2);
5
+
6
6
  #aui.icon-pseudoelement(@aui-icon-font-family);
7
7
  content: @aui-glyph-chevron-down;
8
8
  font-size: @glyphsize;
@@ -10,7 +10,7 @@
10
10
  line-height: 1;
11
11
  margin-top: -(@glyphsize / 2);
12
12
  position: absolute;
13
- right: @canvas-padding;
13
+ right: 3.5px;
14
14
  top: 50%;
15
15
  text-indent: 0; // Reset indentation set by split button
16
16
  width: @glyphsize;
@@ -136,8 +136,6 @@ aui-select {
136
136
 
137
137
  &:not([aria-busy])::before {
138
138
  #aui.aui-dropdown2-trigger-chevron-icon();
139
-
140
- right: ((@select-trigger-width - @aui-icon-size-small - (@aui-button-border-width *2)) / 2);
141
139
  }
142
140
  }
143
141
  }