@spectric/ui 0.0.17 → 0.0.19

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.
Files changed (49) hide show
  1. package/dist/components/Button.d.ts +2 -1
  2. package/dist/components/Panel.d.ts +6 -3
  3. package/dist/components/ThemeProvider.d.ts +1 -0
  4. package/dist/components/calendar/calendar.d.ts +58 -0
  5. package/dist/components/calendar/index.d.ts +1 -0
  6. package/dist/components/color_picker/ColorPicker.d.ts +7 -6
  7. package/dist/components/index.d.ts +1 -0
  8. package/dist/components/input.d.ts +24 -20
  9. package/dist/components/pagination/pagination.d.ts +1 -1
  10. package/dist/components/query_bar/QueryBar.d.ts +2 -1
  11. package/dist/components/table/table.d.ts +3 -0
  12. package/dist/components/table/virtualBody.d.ts +2 -1
  13. package/dist/components/tooltip/popover.d.ts +32 -2
  14. package/dist/components/tooltip/tooltip.d.ts +1 -32
  15. package/dist/custom-elements.json +60 -15
  16. package/dist/index.d.ts +3 -0
  17. package/dist/index.es.js +2895 -2573
  18. package/dist/index.es.js.map +1 -1
  19. package/dist/index.umd.js +305 -182
  20. package/dist/index.umd.js.map +1 -1
  21. package/dist/style.css +1 -1
  22. package/package.json +1 -1
  23. package/src/components/Button.ts +14 -13
  24. package/src/components/Panel.ts +25 -18
  25. package/src/components/ThemeProvider.ts +34 -1
  26. package/src/components/button.css.ts +15 -2
  27. package/src/components/calendar/calendar.css +50 -0
  28. package/src/components/calendar/calendar.ts +281 -0
  29. package/src/components/calendar/index.ts +1 -0
  30. package/src/components/color_picker/ColorPicker.css +69 -0
  31. package/src/components/color_picker/ColorPicker.ts +72 -17
  32. package/src/components/index.ts +2 -1
  33. package/src/components/input.css +5 -34
  34. package/src/components/input.ts +207 -144
  35. package/src/components/pagination/pagination.ts +2 -2
  36. package/src/components/panel.css.ts +7 -5
  37. package/src/components/query_bar/QueryBar.css +6 -2
  38. package/src/components/query_bar/QueryBar.ts +25 -13
  39. package/src/components/table/__tests__/table.spec.ts +1 -1
  40. package/src/components/table/header.ts +0 -3
  41. package/src/components/table/table.ts +43 -35
  42. package/src/components/table/virtualBody.ts +18 -6
  43. package/src/components/tooltip/popover.ts +73 -33
  44. package/src/components/tooltip/tooltip.css +7 -2
  45. package/src/components/tooltip/tooltip.ts +4 -37
  46. package/src/stories/Calendar.stories.ts +70 -0
  47. package/src/stories/fixtures/ExampleContent.ts +2 -1
  48. package/src/stories/table.stories.ts +1 -2
  49. package/src/stories/tooltip.stories.ts +9 -2
@@ -1,69 +1,75 @@
1
- import { html, LitElement, PropertyValues, TemplateResult } from 'lit';
2
- import "./input.css"
3
- import { customElement, eventOptions, property, query } from 'lit/decorators.js';
4
- import { ifDefined } from 'lit/directives/if-defined.js';
5
- import { ReactElementWithPropsAndEvents } from './types';
6
- import { ButtonSizesTypes } from './Button';
7
- import { DomEvent } from './table';
8
- import { SpectricColorPicker } from './color_picker/ColorPicker';
1
+ import { html, LitElement, PropertyValues, TemplateResult } from "lit";
2
+ import "./input.css";
3
+ import {
4
+ customElement,
5
+ eventOptions,
6
+ property,
7
+ query,
8
+ } from "lit/decorators.js";
9
+ import { ifDefined } from "lit/directives/if-defined.js";
10
+ import { ReactElementWithPropsAndEvents } from "./types";
11
+ import { ButtonSizesTypes } from "./Button";
12
+ import { DomEvent } from "./table";
13
+ import { SpectricColorPicker } from "./color_picker/ColorPicker";
14
+ import { PopoverElement } from "./tooltip/popover";
9
15
 
10
16
  export enum InputVariants {
11
- Text = 'text',
12
- TextArea = 'text-area',
13
- number = 'number',
17
+ Text = "text",
18
+ TextArea = "text-area",
19
+ number = "number",
14
20
  //checkbox = "checkbox",
15
21
  color = "color",
16
- date = "date",//replace default eventually with custom
17
- datetime = "datetime-local",//replace default eventually with custom
22
+ date = "date", //replace default eventually with custom
23
+ datePopup = "popup-date",
24
+ datetime = "datetime-local", //replace default eventually with custom
18
25
  email = "email",
19
- file = "file",//display drop area
20
- hidden = "hidden",//display drop area
26
+ file = "file", //display drop area
27
+ hidden = "hidden", //display drop area
21
28
  password = "password",
22
29
  checkbox = "checkbox",
23
- range = "range"
24
-
30
+ range = "range",
25
31
  }
26
- type InputVariantsTypes = `${InputVariants}`
32
+ type InputVariantsTypes = `${InputVariants}`;
27
33
  export interface InputProps {
28
34
  /** Input type */
29
35
  variant?: InputVariantsTypes;
30
36
  /**Label to display above the input */
31
- label?: string,
37
+ label?: string;
32
38
  /**placeholder text to display*/
33
- placeholder?: string,
39
+ placeholder?: string;
34
40
  /* should be disabled?*/
35
- disabled?: boolean,
41
+ disabled?: boolean;
36
42
  /* should be readonly*/
37
- readonly?: boolean,
43
+ readonly?: boolean;
38
44
  /**
39
- * The helper text.
40
- */
45
+ * The helper text.
46
+ */
41
47
 
42
- helperText?: string,
48
+ helperText?: string;
43
49
  /**
44
50
  * Specify if the currently value is invalid.
45
51
  */
46
- invalid?: boolean,
52
+ invalid?: boolean;
47
53
  /**
48
54
  * Message which is displayed if the value is invalid.
49
55
  */
50
- invalidText?: string | TemplateResult<1>,
56
+ invalidText?: string | TemplateResult<1>;
51
57
  /**
52
58
  * Max character count allowed for input. This is needed in order for enableCounter to display
53
59
  */
54
- maxCount?: number,
60
+ maxCount?: number;
55
61
  /**
56
- * Boolean property to set the required status
57
- */
58
- required?: boolean,
62
+ * Boolean property to set the required status
63
+ */
64
+ required?: boolean;
59
65
  /**
60
- * Shows a button to display the password
61
- */
66
+ * Shows a button to display the password
67
+ */
62
68
  showPasswordVisibilityToggle?: boolean;
63
69
 
64
70
  /**
65
- * Name for the input used for form data events //TODO make sure this works
66
- */
71
+ * Name for the input used for form data events //TODO make sure this works
72
+ */
67
73
  name?: string;
68
74
 
69
75
  /**
@@ -74,16 +80,17 @@ export interface InputProps {
74
80
  /**
75
81
  * The sets the autocomplete for the input.
76
82
  */
77
- autocomplete?: HTMLInputElement['autocomplete'];
83
+ autocomplete?: HTMLInputElement["autocomplete"];
78
84
  }
79
- @customElement('spectric-input')
85
+ @customElement("spectric-input")
80
86
  export class SpectricInput extends LitElement implements InputProps {
81
87
  @property({ type: Boolean, reflect: true })
82
88
  checked?: boolean;
83
89
  size?: ButtonSizesTypes;
90
+ files: FileList | null = null;
84
91
  //static styles?: CSSResultGroup | undefined = style;
85
92
  protected createRenderRoot(): HTMLElement | DocumentFragment {
86
- return this
93
+ return this;
87
94
  }
88
95
  @property({ type: String, reflect: true })
89
96
  placeholder: string = "";
@@ -97,16 +104,16 @@ export class SpectricInput extends LitElement implements InputProps {
97
104
  label: string = "";
98
105
 
99
106
  /**
100
- * "Hide password" tooltip text on password visibility toggle
101
- */
107
+ * "Hide password" tooltip text on password visibility toggle
108
+ */
102
109
  @property()
103
- hidePasswordLabel = 'Hide';
110
+ hidePasswordLabel = "Hide";
104
111
 
105
112
  /**
106
113
  * "Show password" tooltip text on password visibility toggle
107
114
  */
108
115
  @property()
109
- showPasswordLabel = 'Show';
116
+ showPasswordLabel = "Show";
110
117
 
111
118
  /**
112
119
  * Boolean property to render password visibility toggle
@@ -121,7 +128,7 @@ export class SpectricInput extends LitElement implements InputProps {
121
128
  * The helper text.
122
129
  */
123
130
  @property({ type: String, reflect: true })
124
- helperText = '';
131
+ helperText = "";
125
132
 
126
133
  /**
127
134
  * Specify if the currently value is invalid.
@@ -138,35 +145,35 @@ export class SpectricInput extends LitElement implements InputProps {
138
145
  * Message which is displayed if the value is invalid.
139
146
  */
140
147
  @property({ type: String, reflect: true })
141
- invalidText: InputProps["invalidText"] = '';
148
+ invalidText: InputProps["invalidText"] = "";
142
149
  /**
143
150
  * Name for the input used for form data events //TODO make sure this works
144
151
  */
145
152
  @property()
146
- name = '';
153
+ name = "";
147
154
 
148
155
  /**
149
156
  * Pattern to validate the input against for HTML validity checking
150
157
  */
151
158
  @property()
152
- pattern = '';
159
+ pattern = "";
153
160
  @property({ type: Number, reflect: true })
154
161
  maxCount: number = 0;
155
162
  /**
156
- * The internal value.
157
- */
158
- protected _value: string | boolean | number = '';
163
+ * The internal value.
164
+ */
165
+ protected _value: string | boolean | number = "";
159
166
  private _showPassword: boolean = false;
160
167
  /**
161
168
  * The sets the autocomplete for the input.
162
169
  */
163
170
  @property({ reflect: true })
164
- autocomplete: HTMLInputElement['autocomplete'] = "off";
171
+ autocomplete: HTMLInputElement["autocomplete"] = "off";
165
172
  get selectionStart() {
166
173
  if (!this._input) {
167
- return null
174
+ return null;
168
175
  }
169
- return this._input.selectionStart
176
+ return this._input.selectionStart;
170
177
  }
171
178
  /**
172
179
  * The value of the input.
@@ -176,7 +183,7 @@ export class SpectricInput extends LitElement implements InputProps {
176
183
  //pull directly from the input
177
184
  if (this._input) {
178
185
  if (this.variant == InputVariants.number) {
179
- return parseFloat(this._input.value)
186
+ return parseFloat(this._input.value);
180
187
  }
181
188
  return this._input.value;
182
189
  }
@@ -187,7 +194,7 @@ export class SpectricInput extends LitElement implements InputProps {
187
194
  set value(value) {
188
195
  const oldValue = this._value;
189
196
  this._value = value;
190
- this.requestUpdate('value', oldValue);
197
+ this.requestUpdate("value", oldValue);
191
198
  // we set the value directly on the input (when available)
192
199
  // so that programatic manipulation updates the UI correctly
193
200
  if (this._input) {
@@ -196,51 +203,72 @@ export class SpectricInput extends LitElement implements InputProps {
196
203
  }
197
204
  blur(): void {
198
205
  if (this._input) {
199
- this._input.blur()
206
+ this._input.blur();
200
207
  }
201
208
  }
202
209
  focus(options?: FocusOptions): void {
203
210
  if (this._input) {
204
211
  //Sometimes the input will get auto focused after a modal closes but the cursor isn't set. we need to blur then refocus to get the cursor
205
- this._input.blur()
206
- this._input.focus(options)
212
+ this._input.blur();
213
+ this._input.focus(options);
207
214
  }
208
215
  }
209
- setSelectionRange(start: number, end: number, direction: "forward" | "backward" | "none" = "none") {
216
+ setSelectionRange(
217
+ start: number,
218
+ end: number,
219
+ direction: "forward" | "backward" | "none" = "none"
220
+ ) {
210
221
  if (!this._input) {
211
- return
222
+ return;
212
223
  }
213
- this._input.setSelectionRange(start, end, direction)
224
+ this._input.setSelectionRange(start, end, direction);
214
225
  }
215
226
  /**
216
- * Handles `oninput` event on the `<input>`.
217
- */
218
- protected _handleInput = ({ target }: Event) => {
219
- const input = (target as HTMLInputElement)
220
- this.value = input.value;
221
- this.invalid = !input.validity.valid
222
- }
227
+ * Handles `oninput` event on the `<input>`.
228
+ */
229
+ protected _handleInput = ({ target }: DomEvent<HTMLInputElement>) => {
230
+ const input = target;
231
+ if (this.variant == InputVariants.file) {
232
+ this.files = input.files;
233
+ } else {
234
+ this.value = input.value;
235
+ }
236
+ this.invalid = !input.validity.valid;
237
+ };
223
238
  /**
224
- * The underlying input element
225
- */
226
- @query('input')
239
+ * The underlying input element
240
+ */
241
+ @query("input")
227
242
  protected _input?: HTMLInputElement;
228
243
 
229
244
  private handleTogglePasswordVisibility = () => {
230
245
  this._showPassword = !this._showPassword;
231
- this.requestUpdate()
232
- }
246
+ this.requestUpdate();
247
+ };
233
248
  protected updated(changedProperties: PropertyValues): void {
234
249
  if (changedProperties.has("checked")) {
235
- this.dispatchEvent(new Event("change", { bubbles: true }))
250
+ this.dispatchEvent(new Event("change", { bubbles: true }));
236
251
  }
237
252
  }
238
253
  @eventOptions({ capture: true })
239
- _handleChange(e: Event) {
240
- e.stopPropagation()
241
- this.dispatchEvent(new Event("change", { bubbles: true }))
254
+ _handleChange(e: DomEvent<HTMLInputElement | SpectricColorPicker>) {
255
+ e.stopPropagation();
256
+ if (this.variant === InputVariants.file) {
257
+ this.files = (e.target as HTMLInputElement).files;
258
+ } else {
259
+ this.value = e.target.value;
260
+ }
261
+ this.dispatchEvent(new Event("change", { bubbles: true }));
242
262
  }
243
263
  protected render(): unknown {
264
+ const calendar = html`<spectric-calendar
265
+ .popup=${this.variant === InputVariants.datePopup}
266
+ @select=${(e: CustomEvent<Date>) => {
267
+ this.value = e.detail.toISOString();
268
+ this.querySelector<PopoverElement>("spectric-popover")?.hidePopover()
269
+ }
270
+ }>
271
+ </spectric-calendar>`
244
272
  switch (this.variant) {
245
273
  case InputVariants.Text:
246
274
  case InputVariants.password:
@@ -248,119 +276,152 @@ export class SpectricInput extends LitElement implements InputProps {
248
276
  //case InputVariants.checkbox:
249
277
  case InputVariants.email:
250
278
  //cases below should be replaces with a custom input for uniformity across browsers
251
- case InputVariants.date://replace with custom date picker
252
- case InputVariants.datetime://replace with custom date picker
253
- case InputVariants.file://replace with drag and drop location and custom select file button
279
+ case InputVariants.date: //replace with custom date picker
280
+ case InputVariants.datePopup: //replace with custom date picker
281
+ case InputVariants.datetime: //replace with custom date picker
282
+ case InputVariants.file: //replace with drag and drop location and custom select file button
254
283
  case InputVariants.range:
255
284
  return html`
256
- <div class="inputWrapper">
257
- <div class="text-input__label-helper-wrapper">
258
- <div class="--text-input__label-wrapper">
259
- ${this.label} ${this.maxCount > 0 && this._value ? `${(this._value as String).length}/${this.maxCount}` : null}
260
- </div>
261
- </div>
262
- <div class="fieldwrapper">
263
- <div ?data-invalid="${this.invalid}" class="inputContainer">
264
- <input
265
- ?data-invalid="${this.invalid}"
266
- ?disabled="${this.disabled}"
267
- aria-describedby="helper-text"
268
- id="input"
269
- name="${ifNonEmpty(this.name)}"
270
- pattern="${ifNonEmpty(this.pattern)}"
271
- placeholder="${ifNonEmpty(this.placeholder)}"
272
- autocomplete="${ifNonEmpty(this.autocomplete)}"
273
- ?readonly="${this.readonly}"
274
- ?required="${this.required}"
275
- type="${ifNonEmpty(
276
- this.variant !== InputVariants.password ?
277
- this.variant :
278
- this._showPassword ? InputVariants.Text : InputVariants.password)}"
279
- .value="${this._value as string}"
280
- maxlength="${ifNonEmpty(this.maxCount > 0 ? this.maxCount : undefined)}"
281
- @input="${this._handleInput}"
282
- @change=${this._handleChange}
283
- />
284
-
285
- ${this.variant === String(InputVariants.password) && this.showPasswordVisibilityToggle
285
+ <div class="inputWrapper">
286
+ <div class="text-input__label-helper-wrapper">
287
+ <div class="--text-input__label-wrapper">
288
+ ${this.label}
289
+ ${this.maxCount > 0 && this._value
290
+ ? `${(this._value as String).length}/${this.maxCount}`
291
+ : null}
292
+ </div>
293
+ </div>
294
+ <div class="fieldwrapper">
295
+ <div ?data-invalid="${this.invalid}" class="inputContainer">
296
+ ${this.variant === "date" ? calendar : null}
297
+ <input
298
+ ?data-invalid="${this.invalid}"
299
+ ?disabled="${this.disabled}"
300
+ aria-describedby="helper-text"
301
+ id="input"
302
+ name="${ifNonEmpty(this.name)}"
303
+ pattern="${ifNonEmpty(this.pattern)}"
304
+ placeholder="${ifNonEmpty(this.placeholder)}"
305
+ autocomplete="${ifNonEmpty(this.autocomplete)}"
306
+ ?readonly="${this.readonly}"
307
+ ?required="${this.required}"
308
+ type="${ifNonEmpty(
309
+ this.variant !== InputVariants.password
310
+ ? this.variant !== InputVariants.date ? this.variant : InputVariants.Text
311
+ : this._showPassword
312
+ ? InputVariants.Text
313
+ : InputVariants.password
314
+ )}"
315
+ .value="${this._value as string}"
316
+ maxlength="${ifNonEmpty(
317
+ this.maxCount > 0 ? this.maxCount : undefined
318
+ )}"
319
+ @input="${this._handleInput}"
320
+ @change=${this._handleChange}
321
+ />
322
+
323
+ ${this.variant === String(InputVariants.datePopup) ? calendar : null}
324
+ ${this.variant === String(InputVariants.password) &&
325
+ this.showPasswordVisibilityToggle
286
326
  ? html`
287
- <spectric-button
327
+ <spectric-button
328
+ icon
329
+ class="input-button-right"
288
330
  size="small"
289
- type="button"
290
- ?disabled="${this.disabled}"
291
- @click=${this.handleTogglePasswordVisibility}>
292
- ${this._showPassword ? this.hidePasswordLabel : this.showPasswordLabel}
293
- </spectric-button>
294
- `
331
+ type="button"
332
+ ?disabled="${this.disabled}"
333
+ @click=${this.handleTogglePasswordVisibility}
334
+ >
335
+ ${this._showPassword
336
+ ? this.hidePasswordLabel
337
+ : this.showPasswordLabel}
338
+ </spectric-button>
339
+ `
295
340
  : null}
296
- </div>
297
- <div
298
- id="helper-text"
299
- class="${this.helperText || this.invalid ? "" : "hidden"}"
300
- >
301
- <slot name="helper-text"> ${this.invalid ? this.invalidText : this.helperText} </slot>
302
- </div>
303
-
341
+ </div>
342
+ <div
343
+ id="helper-text"
344
+ class="${this.helperText || this.invalid ? "" : "hidden"}"
345
+ >
346
+ <slot name="helper-text">
347
+ ${this.invalid ? this.invalidText : this.helperText}
348
+ </slot>
304
349
  </div>
305
350
  </div>
306
- `;
351
+ </div>
352
+ `;
307
353
 
308
354
  case InputVariants.color: //replace with custom color picker
309
355
  return html`<div class="inputWrapper">
310
356
  <div class="text-input__label-helper-wrapper">
311
357
  <div class="--text-input__label-wrapper">
312
- ${this.label} ${this.maxCount > 0 && this._value ? `${(this._value as String).length}/${this.maxCount}` : null}
358
+ ${this.label} ${this.maxCount > 0 && this._value
359
+ ? `${(this._value as String).length}/${this.maxCount}`
360
+ : null
361
+ }
313
362
  </div>
314
363
  </div>
315
364
  <div class="fieldwrapper">
316
365
  <div ?data-invalid="${this.invalid}" class="inputContainer">
317
- <spectric-colorpicker @change=${(e: DomEvent<SpectricColorPicker>) => { this.value = e.target.value; this._handleChange(e) }}></spectric-colorpicker>
366
+ <input type="hidden" .value=${String(this.value)} > </input>
367
+ <spectric-colorpicker
368
+ @cancel=${(e: DomEvent<SpectricColorPicker>) => {
369
+ this.value = e.target.value;
370
+ }}
371
+ @change=${(e: DomEvent<SpectricColorPicker>) => {
372
+ e.stopPropagation();
373
+ this.value = e.target.value;
374
+ this._handleChange(e);
375
+ }} .value=${String(this.value)}></spectric-colorpicker>
318
376
  </div>
319
377
  <div
320
378
  id="helper-text"
321
379
  class="${this.helperText || this.invalid ? "" : "hidden"}"
322
380
  >
323
- <slot name="helper-text"> ${this.invalid ? this.invalidText : this.helperText} </slot>
381
+ <slot name="helper-text"> ${this.invalid ? this.invalidText : this.helperText
382
+ } </slot>
324
383
  </div>
325
384
 
326
385
  </div>
327
- </div>`
386
+ </div>`;
328
387
  case InputVariants.hidden:
329
- return html`<input type="hidden"/>`
388
+ return html`<input type="hidden" />`;
330
389
 
331
390
  case InputVariants.checkbox:
332
-
333
391
  return html`
334
392
  <div class="checkbox">
335
- <spectric-button @click=${() => {
393
+ <spectric-button
394
+ .tooltip=${this.helperText}
395
+ @click=${() => {
336
396
  this.checked = !this.checked;
337
397
  this.value = Boolean(this.checked);
338
- }} icon size=${this.size || "xxsmall"} variant=${this.checked ? "primary" : "secondary"}>${this.checked ? '✓' : "\u00A0"}</spectric-button>
339
- ${this.invalid || this.helperText ? html`<spectric-tooltip text=${this.invalid || this.helperText}></spectric-tooltip>` : null}
398
+ }} icon size=${this.size || "xxsmall"} variant=${this.checked ? "primary" : "secondary"
399
+ }>${this.checked ? "✓" : "\u00A0"}</spectric-button>
400
+
340
401
  ${this.label}
341
402
  </div>
342
403
  </label>
343
- `
404
+ `;
344
405
  default:
345
406
  break;
346
407
  }
347
- return `Not yet implemented ${this.variant}`
408
+ return `Not yet implemented ${this.variant}`;
348
409
  }
349
410
  }
350
411
 
351
-
352
-
353
-
354
412
  declare global {
355
413
  interface HTMLElementTagNameMap {
356
- "spectric-input": SpectricInput
414
+ "spectric-input": SpectricInput;
357
415
  }
358
416
  namespace JSX {
359
417
  interface IntrinsicElements {
360
418
  /**
361
419
  * {@link SpectricInput}
362
420
  */
363
- "spectric-input": ReactElementWithPropsAndEvents<SpectricInput, InputProps>
421
+ "spectric-input": ReactElementWithPropsAndEvents<
422
+ SpectricInput,
423
+ InputProps
424
+ >;
364
425
  }
365
426
  }
366
427
  namespace React {
@@ -369,12 +430,14 @@ declare global {
369
430
  /**
370
431
  * {@link SpectricInput}
371
432
  */
372
- "spectric-input": ReactElementWithPropsAndEvents<SpectricInput, InputProps>;
433
+ "spectric-input": ReactElementWithPropsAndEvents<
434
+ SpectricInput,
435
+ InputProps
436
+ >;
373
437
  }
374
438
  }
375
439
  }
376
440
  }
377
441
 
378
-
379
442
  const ifNonEmpty = (value: any) =>
380
- ifDefined(value === '' ? undefined : (value ?? undefined));
443
+ ifDefined(value === "" ? undefined : value ?? undefined);
@@ -18,7 +18,6 @@ interface PaginationProps extends PaginationChangeProps {
18
18
  pageSizeOptions?: number[]
19
19
  }
20
20
 
21
- console.log("Pagination")
22
21
 
23
22
  /**
24
23
  * Pagination Element
@@ -47,7 +46,7 @@ export class PaginationElement extends LitElement implements PaginationProps {
47
46
  protected createRenderRoot(): HTMLElement | DocumentFragment {
48
47
  return this
49
48
  }
50
- protected updated(_changedProperties: PropertyValues): void {
49
+ protected update(_changedProperties: PropertyValues): void {
51
50
  if (_changedProperties.has("pageSize") && !this.pageSizeOptions.includes(this.pageSize)) {
52
51
  this.pageSizeOptions = [...this.pageSizeOptions, this.pageSize].sort((a, b) => a - b)
53
52
  /**
@@ -60,6 +59,7 @@ export class PaginationElement extends LitElement implements PaginationProps {
60
59
  }
61
60
  })
62
61
  }
62
+ super.update(_changedProperties)
63
63
  }
64
64
  private _handlePageUp = () => {
65
65
  this.page += 1
@@ -1,12 +1,14 @@
1
1
  import { css } from "lit";
2
2
 
3
3
  const even = css`
4
+ --panel-color: var(--spectric-background,#f4f4f4);
5
+ --panel-color-inverse: var(--spectric-background-inverse,#ffffff);
4
6
  border-color: color-mix(in hsl, var(--panel-color, #0b0b0b), var(--spectric-input-color, #000000) 3%);
5
7
  background-color: var(--panel-color,#0b0b0b);
6
- --spectric-input-color: var(--spectric-background);
8
+ --spectric-input-color: var(--panel-color-inverse);
7
9
  color:var(--text-secondary,#3c4c5b);
8
- --spectric-text-primary:var(--text-primary);
9
- --spectric-text-secondary:var(--text-secondary);
10
+ --spectric-text-primary:var(--text-primary,#161616);
11
+ --spectric-text-secondary:var(--text-secondary,#525252);
10
12
  filter: drop-shadow(0px 1px 3px color-mix(in srgb, var(--text-secondary, #3c4c5b), transparent 50%));
11
13
  `
12
14
  const odd = css`
@@ -14,8 +16,8 @@ const odd = css`
14
16
  background-color: var(--panel-color-inverse,#0b0b0b);
15
17
  color:var(--text-primary,#3c4c5b);
16
18
  --spectric-input-color: var(--panel-color);
17
- --spectric-text-primary:var(--text-secondary);
18
- --spectric-text-secondary:var(--text-primary);
19
+ --spectric-text-primary:var(--text-secondary,#525252);
20
+ --spectric-text-secondary:var(--text-primary,#161616);
19
21
  filter: drop-shadow(0px 1px 3px color-mix(in srgb, var(--text-primary, #3c4c5b), transparent 70%));
20
22
  `
21
23
  export default css`
@@ -12,14 +12,18 @@ spectric-query .autocomplete {
12
12
  max-height: 300px;
13
13
  border-top: 0px;
14
14
  margin: 0px;
15
- margin-top: -18px;
16
15
  /*Input helper text is 18px we can cover that with the popover*/
17
16
  position: fixed;
18
17
  top: anchor(bottom);
19
18
  justify-self: anchor-center;
20
19
  text-align: center;
21
20
  }
22
-
21
+ spectric-query .autocomplete [popover]{
22
+ overflow: visible;
23
+ }
24
+ spectric-query .autocomplete .tooltip-content{
25
+ width: 100%;
26
+ }
23
27
  spectric-query .autocomplete .optiontype {
24
28
  float: left;
25
29
  max-width: 10px;