@milaboratories/uikit 2.2.87 → 2.2.88

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@milaboratories/uikit",
3
- "version": "2.2.87",
3
+ "version": "2.2.88",
4
4
  "type": "module",
5
5
  "main": "dist/pl-uikit.js",
6
6
  "module": "dist/pl-uikit.js",
@@ -33,9 +33,9 @@
33
33
  "yarpm": "^1.2.0",
34
34
  "svgo": "^3.3.2",
35
35
  "@types/d3": "^7.4.3",
36
+ "@platforma-sdk/model": "^1.34.10",
36
37
  "@milaboratories/eslint-config": "^1.0.4",
37
- "@milaboratories/helpers": "^1.6.13",
38
- "@platforma-sdk/model": "^1.34.10"
38
+ "@milaboratories/helpers": "^1.6.14"
39
39
  },
40
40
  "scripts": {
41
41
  "dev": "vite",
@@ -363,7 +363,7 @@ watch(() => optionsRequest.loading || modelOptionRequest.loading, (loading) => {
363
363
 
364
364
  <div class="pl-autocomplete__controls">
365
365
  <PlMaskIcon24 v-if="isLoadingOptions" name="loading" />
366
- <PlIcon16 v-if="clearable && hasValue" name="delete-clear" @click.stop="clear" />
366
+ <PlIcon16 v-if="clearable && hasValue" class="clear" name="delete-clear" @click.stop="clear" />
367
367
  <slot name="append" />
368
368
  <div class="pl-autocomplete__arrow-wrapper" @click.stop="toggleOpen">
369
369
  <div v-if="arrowIconLarge" class="arrow-icon" :class="[`icon-24 ${arrowIconLarge}`]" />
@@ -185,16 +185,16 @@
185
185
 
186
186
  margin-left: auto;
187
187
 
188
- .icon-delete-clear {
189
- cursor: pointer;
190
- }
191
-
192
188
  .mask-16,
193
189
  .mask-24 {
194
190
  --icon-color: var(--control-mask-fill);
195
191
  cursor: pointer;
196
192
  }
197
193
 
194
+ .clear {
195
+ --icon-color: var(--ic-02);
196
+ }
197
+
198
198
  .mask-loading {
199
199
  --icon-color: var(#07AD3E);
200
200
  animation: spin 2.5s linear infinite;
@@ -334,7 +334,7 @@ watchPostEffect(() => {
334
334
 
335
335
  <div class="pl-dropdown__controls">
336
336
  <PlMaskIcon24 v-if="isLoadingOptions" name="loading" />
337
- <PlIcon16 v-if="clearable && hasValue" name="delete-clear" @click.stop="clear" />
337
+ <PlIcon16 v-if="clearable && hasValue" class="clear" name="delete-clear" @click.stop="clear" />
338
338
  <slot name="append" />
339
339
  <div class="pl-dropdown__arrow-wrapper" @click.stop="toggleOpen">
340
340
  <div v-if="arrowIconLarge" class="arrow-icon" :class="[`icon-24 ${arrowIconLarge}`]" />
@@ -183,16 +183,17 @@
183
183
  gap: 6px;
184
184
  margin-left: auto;
185
185
 
186
- .icon-delete-clear {
187
- cursor: pointer;
188
- }
189
-
186
+
190
187
  .mask-16,
191
188
  .mask-24 {
192
189
  --icon-color: var(--control-mask-fill);
193
190
  cursor: pointer;
194
191
  }
195
192
 
193
+ .clear {
194
+ --icon-color: var(--ic-02);
195
+ }
196
+
196
197
  .mask-loading {
197
198
  --icon-color: var(--ic-accent);
198
199
  animation: spin 2.5s linear infinite;
@@ -337,7 +337,7 @@ watchPostEffect(() => {
337
337
 
338
338
  <div class="ui-dropdown__controls">
339
339
  <PlMaskIcon24 v-if="isLoadingOptions" name="loading" />
340
- <PlIcon16 v-if="clearable && hasValue" name="delete-clear" @click.stop="clear" />
340
+ <PlIcon16 v-if="clearable && hasValue" class="clear" name="delete-clear" @click.stop="clear" />
341
341
  <slot name="append" />
342
342
  <div v-if="arrowIconLarge" class="arrow-icon" :class="[`icon-24 ${arrowIconLarge}`]" @click.stop="toggleOpen" />
343
343
  <div v-else-if="arrowIcon" class="arrow-icon" :class="[`icon-16 ${arrowIcon}`]" @click.stop="toggleOpen" />
@@ -181,16 +181,16 @@
181
181
  gap: 6px;
182
182
  margin-left: auto;
183
183
 
184
- .icon-delete-clear {
185
- cursor: pointer;
186
- }
187
-
188
184
  .mask-16,
189
185
  .mask-24 {
190
186
  --icon-color: var(--control-mask-fill);
191
187
  cursor: pointer;
192
188
  }
193
189
 
190
+ .clear {
191
+ --icon-color: var(--ic-02);
192
+ }
193
+
194
194
  .mask-loading {
195
195
  --icon-color: var(#07AD3E);
196
196
  animation: spin 2.5s linear infinite;
@@ -193,7 +193,7 @@ if (!props.cellStyle) {
193
193
  {{ fileName }}
194
194
  </div>
195
195
  <div v-if="uploadStats" class="pl-file-input__stats">{{ uploadStats }}</div>
196
- <PlMaskIcon24 v-if="modelValue" name="close" @click.stop="clear" />
196
+ <PlMaskIcon24 v-if="modelValue" class="pl-file-input__clear" name="close" @click.stop="clear" />
197
197
  <DoubleContour class="pl-file-input__contour" />
198
198
  </div>
199
199
  <div v-if="hasErrors" class="pl-file-input__error">
@@ -54,6 +54,10 @@
54
54
  width: 0;
55
55
  }
56
56
 
57
+ &__clear {
58
+ --icon-color: var(--ic-02);
59
+ }
60
+
57
61
  &__filename {
58
62
  width: 100%;
59
63
  border: none;
@@ -77,6 +77,7 @@ const clear = () => emit('update:modelValue', '');
77
77
  }
78
78
 
79
79
  .clear {
80
+ --icon-color: var(--ic-02);
80
81
  cursor: pointer;
81
82
  margin-left: auto;
82
83
  display: var(--pl-search-field-clear-display);
@@ -1,28 +1,36 @@
1
1
  import { uniqueId } from '@milaboratories/helpers';
2
2
 
3
- let defs: SVGDefsElement | null = null;
3
+ declare global {
4
+ interface Window {
5
+ SvgRegistryRawSvgMap: Map<string, SvgMeta>;
6
+ SvgRegistryDefsElement: SVGDefsElement;
7
+ }
8
+ }
9
+
10
+ function createSpriteContainer() {
11
+ const defsElement = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
12
+ defsElement.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
13
+ defsElement.style.display = 'none';
14
+ document.body.prepend(defsElement);
15
+ return defsElement;
16
+ }
17
+
18
+ // prevent multiple definitions of the same SVG registry in different builds
19
+ window.SvgRegistryRawSvgMap = window.SvgRegistryRawSvgMap ?? new Map<string, SvgMeta>();
20
+ window.SvgRegistryDefsElement = window.SvgRegistryDefsElement ?? createSpriteContainer();
21
+
4
22
  export type SvgMeta = {
5
23
  spriteId: string;
6
24
  defaultWidth: number;
7
25
  defaultHeight: number;
8
26
  };
9
- const registeredRaw = new Map<string, SvgMeta>();
10
-
11
- function ensureSpriteContainer() {
12
- if (defs) return;
13
27
 
14
- defs = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
15
- defs.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
16
- defs.style.display = 'none';
17
-
18
- document.body.prepend(defs);
19
- }
28
+ const registeredRaw = window.SvgRegistryRawSvgMap;
29
+ const defsElement = window.SvgRegistryDefsElement;
20
30
 
21
31
  export function registerSvg(raw: string, name?: string): SvgMeta {
22
32
  if (!registeredRaw.has(raw)) {
23
- const id = `svg-${name ? `${name}-` : ''}${uniqueId()}`;
24
-
25
- ensureSpriteContainer();
33
+ const id = `svg-${name ? `${name}-` : ''}${uniqueId(16)}`;
26
34
 
27
35
  const widthMatch = raw.match(/width="(\d+)(px)?"/)?.[1];
28
36
  const heightMatch = raw.match(/height="(\d+)(px)?"/)?.[1];
@@ -47,8 +55,8 @@ export function registerSvg(raw: string, name?: string): SvgMeta {
47
55
  template.innerHTML = preparedSvg;
48
56
 
49
57
  const symbol = template.content.firstElementChild;
50
- if (symbol && defs) {
51
- defs.appendChild(symbol);
58
+ if (symbol && defsElement) {
59
+ defsElement.appendChild(symbol);
52
60
  }
53
61
 
54
62
  registeredRaw.set(raw, {
@@ -94,6 +94,7 @@
94
94
 
95
95
  &__clearable {
96
96
  display: var(--show-clearable) !important;
97
+ --icon-color: var(--ic-02) !important;
97
98
  }
98
99
 
99
100
  &__helper {