@lblod/ember-rdfa-editor-lblod-plugins 31.0.2 → 31.0.3-dev.1d1f3816089d2b570218c8365d8d3d688ecf2790

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,5 @@
1
+ ---
2
+ '@lblod/ember-rdfa-editor-lblod-plugins': patch
3
+ ---
4
+
5
+ Use `absolute` positioning for ember-velcro pop-ups/tooltips
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @lblod/ember-rdfa-editor-lblod-plugins
2
2
 
3
+ ## 31.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#569](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/pull/569) [`7ddd1fa`](https://github.com/lblod/ember-rdfa-editor-lblod-plugins/commit/7ddd1fa67e75cb5952929d7569cfae3c71d52c8a) Thanks [@elpoelma](https://github.com/elpoelma)! - `date` variable: fix date-picker styling when having `@appuniversum/ember-appuniversum` version 3.6.0 or up installed
8
+
3
9
  ## 31.0.2
4
10
 
5
11
  ### Patch Changes
@@ -0,0 +1,300 @@
1
+ import AuButton from '@appuniversum/ember-appuniversum/components/au-button';
2
+ import AuIcon, {
3
+ AuIconSignature,
4
+ } from '@appuniversum/ember-appuniversum/components/au-icon';
5
+ import AuBadge from '@appuniversum/ember-appuniversum/components/au-badge';
6
+ import { AddIcon } from '@appuniversum/ember-appuniversum/components/icons/add';
7
+ import { RemoveIcon } from '@appuniversum/ember-appuniversum/components/icons/remove';
8
+ import { NavDownIcon } from '@appuniversum/ember-appuniversum/components/icons/nav-down';
9
+ import { NavUpIcon } from '@appuniversum/ember-appuniversum/components/icons/nav-up';
10
+ import { hash } from '@ember/helper';
11
+ import { on } from '@ember/modifier';
12
+ import { action } from '@ember/object';
13
+ import Component from '@glimmer/component';
14
+ import { tracked } from '@glimmer/tracking';
15
+
16
+ export interface AuCardSignature {
17
+ Args: {
18
+ divided?: boolean;
19
+ expandable?: boolean;
20
+ flex?: boolean;
21
+ isExpanded?: boolean;
22
+ isOpenInitially?: boolean;
23
+ manualControl?: boolean;
24
+ openSection?: () => void;
25
+ size?: 'small' | 'tiny' | 'flush';
26
+ shadow?: boolean;
27
+ standOut?: boolean;
28
+ textCenter?: boolean;
29
+ };
30
+ Blocks: {
31
+ default: [
32
+ {
33
+ header?: typeof Header;
34
+ content?: typeof Content;
35
+ footer?: typeof Footer;
36
+ },
37
+ ];
38
+ };
39
+ Element: HTMLElement;
40
+ }
41
+
42
+ /**
43
+ Custom (temporary) `AuCard` component which removes usage of `AuContent` component.
44
+ Can be removed once https://github.com/appuniversum/ember-appuniversum/issues/534 is fixed
45
+ */
46
+ export default class AuCard extends Component<AuCardSignature> {
47
+ @tracked isExpanded = false;
48
+
49
+ constructor(owner: unknown, args: AuCardSignature['Args']) {
50
+ super(owner, args);
51
+
52
+ if (this.args.isOpenInitially) {
53
+ this.isExpanded = true;
54
+ }
55
+ }
56
+
57
+ get sectionOpen() {
58
+ if (this.args.manualControl) {
59
+ return this.args.isExpanded;
60
+ } else {
61
+ return this.isExpanded;
62
+ }
63
+ }
64
+
65
+ get size() {
66
+ if (this.args.size == 'small') return 'au-c-card--padding-small';
67
+ if (this.args.size == 'tiny') return 'au-c-card--padding-tiny';
68
+ if (this.args.size == 'flush') return '';
69
+ else return 'au-c-card--padding';
70
+ }
71
+
72
+ get flex() {
73
+ if (this.args.flex) return 'au-c-card--flex';
74
+ return '';
75
+ }
76
+
77
+ get expandable() {
78
+ if (this.args.expandable) return 'au-c-card--expandable';
79
+ return '';
80
+ }
81
+
82
+ get shadow() {
83
+ if (this.args.shadow) return 'au-c-card--shadow';
84
+ return '';
85
+ }
86
+
87
+ get divided() {
88
+ if (this.args.divided) return 'au-c-card--divided';
89
+ return '';
90
+ }
91
+
92
+ get textCenter() {
93
+ if (this.args.textCenter) return 'au-c-card--text-center';
94
+ return '';
95
+ }
96
+
97
+ get standOut() {
98
+ if (this.args.standOut) return 'au-c-card--standout';
99
+ return '';
100
+ }
101
+
102
+ @action
103
+ openSection() {
104
+ if (this.args.manualControl) {
105
+ this.args.openSection?.();
106
+ } else {
107
+ this.isExpanded = !this.isExpanded;
108
+ }
109
+ }
110
+
111
+ <template>
112
+ <article
113
+ class='au-c-card au-c-card--fill
114
+ {{this.size}}
115
+ {{this.flex}}
116
+ {{this.expandable}}
117
+ {{this.shadow}}
118
+ {{this.divided}}
119
+ {{this.textCenter}}
120
+ {{this.standOut}}'
121
+ ...attributes
122
+ >
123
+ {{#if this.expandable}}
124
+ {{#if this.shadow}}
125
+ <div
126
+ class='au-c-card__clickable'
127
+ role='button'
128
+ {{on 'click' this.openSection}}
129
+ {{! template-lint-disable require-presentational-children}}
130
+ {{! this triggers a false positive for components: https://github.com/ember-template-lint/ember-template-lint/issues/2334}}
131
+ >
132
+ <AuButton
133
+ @skin='link'
134
+ class='au-c-card__toggle'
135
+ aria-hidden='true'
136
+ focusable='false'
137
+ aria-expanded={{if this.sectionOpen 'true' 'false'}}
138
+ >
139
+ {{#if this.sectionOpen}}
140
+ <AuIcon
141
+ @icon={{RemoveIcon}}
142
+ @size='large'
143
+ @ariaHidden={{true}}
144
+ />
145
+ {{! template-lint-disable no-bare-strings }}
146
+ <span class='au-u-hidden-visually au-c-card__toggle-false'>
147
+ Verberg
148
+ </span>
149
+ {{else}}
150
+ <AuIcon @icon={{AddIcon}} @size='large' @ariaHidden={{true}} />
151
+ {{! template-lint-disable no-bare-strings }}
152
+ <span class='au-u-hidden-visually au-c-card__toggle-true'>
153
+ Toon
154
+ </span>
155
+ {{/if}}
156
+ </AuButton>
157
+ {{yield (hash header=Header)}}
158
+ </div>
159
+ {{else}}
160
+ <div
161
+ class='au-c-card__clickable'
162
+ role='button'
163
+ {{on 'click' this.openSection}}
164
+ {{! template-lint-disable require-presentational-children}}
165
+ {{! this triggers a false positive for components: https://github.com/ember-template-lint/ember-template-lint/issues/2334}}
166
+ >
167
+ {{yield (hash header=Header)}}
168
+ <AuButton
169
+ @skin='link'
170
+ class='au-c-card__toggle'
171
+ aria-hidden='true'
172
+ focusable='false'
173
+ aria-expanded={{if this.sectionOpen 'true' 'false'}}
174
+ >
175
+ {{#if this.sectionOpen}}
176
+ <AuIcon
177
+ @icon={{NavUpIcon}}
178
+ @size='large'
179
+ @ariaHidden={{true}}
180
+ />
181
+ <span class='au-u-hidden-visually au-c-card__toggle-false'>
182
+ Verberg
183
+ </span>
184
+ {{else}}
185
+ <AuIcon
186
+ @icon={{NavDownIcon}}
187
+ @size='large'
188
+ @ariaHidden={{true}}
189
+ />
190
+ <span class='au-u-hidden-visually au-c-card__toggle-true'>
191
+ Toon
192
+ </span>
193
+ {{/if}}
194
+ </AuButton>
195
+ </div>
196
+ {{/if}}
197
+ {{#if this.sectionOpen}}
198
+ <div tabindex='0'>
199
+ {{yield (hash content=Content)}}
200
+ </div>
201
+ {{/if}}
202
+ {{else}}
203
+ {{yield (hash header=Header)}}
204
+ {{yield (hash content=Content)}}
205
+ {{/if}}
206
+
207
+ {{yield (hash footer=Footer)}}
208
+ </article>
209
+ </template>
210
+ }
211
+
212
+ interface HeaderSignature {
213
+ Args: {
214
+ badgeIcon?: AuIconSignature['Args']['icon'];
215
+ badgeNumber?: number;
216
+ badgeSize?: 'small';
217
+ badgeSkin?: 'border' | 'action' | 'brand' | 'success' | 'warning' | 'error';
218
+ };
219
+ Blocks: {
220
+ default: [];
221
+ };
222
+ Element: HTMLDivElement;
223
+ }
224
+
225
+ class Header extends Component<HeaderSignature> {
226
+ get badgeSkin() {
227
+ if (this.args.badgeSkin == 'border') return 'au-c-badge--border';
228
+ if (this.args.badgeSkin == 'action') return 'au-c-badge--action';
229
+ if (this.args.badgeSkin == 'brand') return 'au-c-badge--brand';
230
+ if (this.args.badgeSkin == 'success') return 'au-c-badge--success';
231
+ if (this.args.badgeSkin == 'warning') return 'au-c-badge--warning';
232
+ if (this.args.badgeSkin == 'error') return 'au-c-badge--error';
233
+ return 'au-c-badge--default';
234
+ }
235
+
236
+ get badgeSize() {
237
+ if (this.args.badgeSize == 'small') return 'au-c-badge--small';
238
+ return '';
239
+ }
240
+
241
+ <template>
242
+ <div class='au-c-card__header' ...attributes>
243
+ {{#if @badgeIcon}}
244
+ <AuBadge
245
+ @size={{@badgeSize}}
246
+ @skin={{@badgeSkin}}
247
+ @icon={{@badgeIcon}}
248
+ />
249
+ {{else if @badgeNumber}}
250
+ <AuBadge
251
+ @size={{@badgeSize}}
252
+ @skin={{@badgeSkin}}
253
+ @number={{@badgeNumber}}
254
+ />
255
+ {{/if}}
256
+
257
+ {{#if (has-block)}}
258
+ <div>
259
+ {{yield}}
260
+ </div>
261
+ {{/if}}
262
+ </div>
263
+ </template>
264
+ }
265
+
266
+ interface ContentSignature {
267
+ Blocks: {
268
+ default: [];
269
+ };
270
+ Element: HTMLDivElement;
271
+ }
272
+
273
+ // eslint-disable-next-line ember/no-empty-glimmer-component-classes
274
+ class Content extends Component<ContentSignature> {
275
+ <template>
276
+ {{#if (has-block)}}
277
+ <div class='au-c-card__content' ...attributes>
278
+ {{yield}}
279
+ </div>
280
+ {{/if}}
281
+ </template>
282
+ }
283
+
284
+ interface FooterSignature {
285
+ Blocks: {
286
+ default: [];
287
+ };
288
+ Element: HTMLDivElement;
289
+ }
290
+
291
+ // eslint-disable-next-line ember/no-empty-glimmer-component-classes
292
+ class Footer extends Component<FooterSignature> {
293
+ <template>
294
+ {{#if (has-block)}}
295
+ <div class='au-c-card__footer' ...attributes>
296
+ {{yield}}
297
+ </div>
298
+ {{/if}}
299
+ </template>
300
+ }
@@ -50,7 +50,7 @@ export default class HoverTooltip extends Component<Sig> {
50
50
  this.tooltipOpen = false;
51
51
  };
52
52
  <template>
53
- <Velcro @placement={{this.placement}} as |velcro|>
53
+ <Velcro @placement={{this.placement}} @strategy='absolute' as |velcro|>
54
54
  {{#let velcro.loop as |loop|}}
55
55
  {{yield
56
56
  (hash velcroHook=velcro.hook handleHover=this.hover)
@@ -1,7 +1,7 @@
1
1
  {{! @glint-nocheck: not typesafe yet }}
2
2
  <div>
3
3
  {{#if this.showCard}}
4
- <AuCard @shadow={{true}} @size='flush' as |c|>
4
+ <this.AuCard @shadow={{true}} @size='flush' as |c|>
5
5
  <c.header class='au-u-hidden-visually'>
6
6
  <AuHeading @level='3' @skin='6'>{{t
7
7
  'date-plugin.card.title'
@@ -28,6 +28,7 @@
28
28
  {{#if this.isCustom}}
29
29
  <this.Velcro
30
30
  @placement='top'
31
+ @strategy='absolute'
31
32
  @offsetOptions={{hash mainAxis=10}}
32
33
  as |velcro|
33
34
  >
@@ -97,7 +98,7 @@
97
98
  {{/if}}
98
99
  </div>
99
100
  </c.content>
100
- </AuCard>
101
+ </this.AuCard>
101
102
  {{/if}}
102
103
  </div>
103
104
  <VariablePlugin::Date::HelpModal
@@ -31,6 +31,7 @@ import { Velcro } from 'ember-velcro';
31
31
  import { InfoCircleIcon } from '@appuniversum/ember-appuniversum/components/icons/info-circle';
32
32
  import { CrossIcon } from '@appuniversum/ember-appuniversum/components/icons/cross';
33
33
  import { XSD } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/constants';
34
+ import AuCard from '../../_private/appuniversum-overrides/au-card';
34
35
 
35
36
  type Args = {
36
37
  controller: SayController;
@@ -41,6 +42,7 @@ export default class DateEditComponent extends Component<Args> {
41
42
  CrossIcon = CrossIcon;
42
43
  InfoCircleIcon = InfoCircleIcon;
43
44
  Velcro = Velcro;
45
+ AuCard = AuCard;
44
46
 
45
47
  @service
46
48
  declare intl: IntlService;
@@ -1,6 +1,7 @@
1
1
  {{! @glint-nocheck: not typesafe yet }}
2
2
  <this.Velcro
3
3
  @placement='bottom-start'
4
+ @strategy='absolute'
4
5
  @offsetOptions={{hash mainAxis=3}}
5
6
  as |velcro|
6
7
  >
@@ -0,0 +1,77 @@
1
+ import { AuIconSignature } from '@appuniversum/ember-appuniversum/components/au-icon';
2
+ import Component from '@glimmer/component';
3
+ export interface AuCardSignature {
4
+ Args: {
5
+ divided?: boolean;
6
+ expandable?: boolean;
7
+ flex?: boolean;
8
+ isExpanded?: boolean;
9
+ isOpenInitially?: boolean;
10
+ manualControl?: boolean;
11
+ openSection?: () => void;
12
+ size?: 'small' | 'tiny' | 'flush';
13
+ shadow?: boolean;
14
+ standOut?: boolean;
15
+ textCenter?: boolean;
16
+ };
17
+ Blocks: {
18
+ default: [
19
+ {
20
+ header?: typeof Header;
21
+ content?: typeof Content;
22
+ footer?: typeof Footer;
23
+ }
24
+ ];
25
+ };
26
+ Element: HTMLElement;
27
+ }
28
+ /**
29
+ Custom (temporary) `AuCard` component which removes usage of `AuContent` component.
30
+ Can be removed once https://github.com/appuniversum/ember-appuniversum/issues/534 is fixed
31
+ */
32
+ export default class AuCard extends Component<AuCardSignature> {
33
+ isExpanded: boolean;
34
+ constructor(owner: unknown, args: AuCardSignature['Args']);
35
+ get sectionOpen(): boolean | undefined;
36
+ get size(): "" | "au-c-card--padding-small" | "au-c-card--padding-tiny" | "au-c-card--padding";
37
+ get flex(): "" | "au-c-card--flex";
38
+ get expandable(): "" | "au-c-card--expandable";
39
+ get shadow(): "" | "au-c-card--shadow";
40
+ get divided(): "" | "au-c-card--divided";
41
+ get textCenter(): "" | "au-c-card--text-center";
42
+ get standOut(): "" | "au-c-card--standout";
43
+ openSection(): void;
44
+ }
45
+ interface HeaderSignature {
46
+ Args: {
47
+ badgeIcon?: AuIconSignature['Args']['icon'];
48
+ badgeNumber?: number;
49
+ badgeSize?: 'small';
50
+ badgeSkin?: 'border' | 'action' | 'brand' | 'success' | 'warning' | 'error';
51
+ };
52
+ Blocks: {
53
+ default: [];
54
+ };
55
+ Element: HTMLDivElement;
56
+ }
57
+ declare class Header extends Component<HeaderSignature> {
58
+ get badgeSkin(): "au-c-badge--border" | "au-c-badge--action" | "au-c-badge--brand" | "au-c-badge--success" | "au-c-badge--warning" | "au-c-badge--error" | "au-c-badge--default";
59
+ get badgeSize(): "" | "au-c-badge--small";
60
+ }
61
+ interface ContentSignature {
62
+ Blocks: {
63
+ default: [];
64
+ };
65
+ Element: HTMLDivElement;
66
+ }
67
+ declare class Content extends Component<ContentSignature> {
68
+ }
69
+ interface FooterSignature {
70
+ Blocks: {
71
+ default: [];
72
+ };
73
+ Element: HTMLDivElement;
74
+ }
75
+ declare class Footer extends Component<FooterSignature> {
76
+ }
77
+ export {};
@@ -6,6 +6,7 @@ import { Option } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
6
6
  import { DateFormat, DateOptions } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/variable-plugin/variables/date';
7
7
  import { ValidationError } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/variable-plugin/utils/date-helpers';
8
8
  import { Velcro } from 'ember-velcro';
9
+ import AuCard from '../../_private/appuniversum-overrides/au-card';
9
10
  type Args = {
10
11
  controller: SayController;
11
12
  options: DateOptions;
@@ -14,6 +15,7 @@ export default class DateEditComponent extends Component<Args> {
14
15
  CrossIcon: import("@ember/component/template-only").TOC<import("@appuniversum/ember-appuniversum/components/icons/cross").CrossIconSignature>;
15
16
  InfoCircleIcon: import("@ember/component/template-only").TOC<import("@appuniversum/ember-appuniversum/components/icons/info-circle").InfoCircleIconSignature>;
16
17
  Velcro: typeof Velcro;
18
+ AuCard: typeof AuCard;
17
19
  intl: IntlService;
18
20
  helpModalOpen: boolean;
19
21
  tooltipOpen: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lblod/ember-rdfa-editor-lblod-plugins",
3
- "version": "31.0.2",
3
+ "version": "31.0.3-dev.1d1f3816089d2b570218c8365d8d3d688ecf2790",
4
4
  "description": "Ember addon providing lblod specific plugins for the ember-rdfa-editor",
5
5
  "keywords": [
6
6
  "ember-addon",