@umbraco-ui/uui-color-swatches 1.2.1 → 1.3.0-rc.1

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,8 +9,8 @@
9
9
  {
10
10
  "name": "value",
11
11
  "description": "Value of selected option.",
12
- "type": " string ",
13
- "default": "\"\\\"\\\"\""
12
+ "type": "string",
13
+ "default": "\"\""
14
14
  },
15
15
  {
16
16
  "name": "label",
@@ -28,8 +28,8 @@
28
28
  "name": "value",
29
29
  "attribute": "value",
30
30
  "description": "Value of selected option.",
31
- "type": " string ",
32
- "default": "\"\\\"\\\"\""
31
+ "type": "string",
32
+ "default": "\"\""
33
33
  },
34
34
  {
35
35
  "name": "swatches",
@@ -2,4 +2,5 @@ import { UUIEvent } from '@umbraco-ui/uui-base/lib/events';
2
2
  import { UUIColorSwatchElement } from '@umbraco-ui/uui-color-swatch/lib/uui-color-swatch.element';
3
3
  export declare class UUIColorSwatchesEvent extends UUIEvent<{}, UUIColorSwatchElement> {
4
4
  static readonly CHANGE = "change";
5
+ constructor(evName: string, eventInit?: any | null);
5
6
  }
package/lib/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export * from './uui-color-swatches.element';
2
- export * from './UUIColorSwatchesEvents';
2
+ export * from './UUIColorSwatchesEvent';
package/lib/index.js CHANGED
@@ -4,7 +4,26 @@ import { LitElement, html, css } from 'lit';
4
4
  import { property, queryAssignedElements } from 'lit/decorators.js';
5
5
  import { LabelMixin } from '@umbraco-ui/uui-base/lib/mixins';
6
6
 
7
+ var __defProp$1 = Object.defineProperty;
8
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
+ var __spreadValues = (a, b) => {
13
+ for (var prop in b || (b = {}))
14
+ if (__hasOwnProp.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ if (__getOwnPropSymbols)
17
+ for (var prop of __getOwnPropSymbols(b)) {
18
+ if (__propIsEnum.call(b, prop))
19
+ __defNormalProp(a, prop, b[prop]);
20
+ }
21
+ return a;
22
+ };
7
23
  class UUIColorSwatchesEvent extends UUIEvent {
24
+ constructor(evName, eventInit = {}) {
25
+ super(evName, __spreadValues(__spreadValues({}, { bubbles: true }), eventInit));
26
+ }
8
27
  }
9
28
  UUIColorSwatchesEvent.CHANGE = "change";
10
29
 
@@ -37,7 +56,7 @@ let UUIColorSwatchesElement = class extends LabelMixin("label", LitElement) {
37
56
  this.value = this._selectedElement.value || "";
38
57
  this.dispatchEvent(new UUIColorSwatchesEvent(UUIColorSwatchesEvent.CHANGE));
39
58
  };
40
- this._onUnselected = (event) => {
59
+ this._onDeselected = (event) => {
41
60
  const target = event.target;
42
61
  if (!this.swatches.includes(target))
43
62
  return;
@@ -55,7 +74,7 @@ let UUIColorSwatchesElement = class extends LabelMixin("label", LitElement) {
55
74
  }
56
75
  };
57
76
  this.addEventListener(UUISelectableEvent.SELECTED, this._onSelected);
58
- this.addEventListener(UUISelectableEvent.UNSELECTED, this._onUnselected);
77
+ this.addEventListener(UUISelectableEvent.DESELECTED, this._onDeselected);
59
78
  }
60
79
  get _activeElement() {
61
80
  return this.__activeElement;
@@ -95,6 +114,11 @@ let UUIColorSwatchesElement = class extends LabelMixin("label", LitElement) {
95
114
  }
96
115
  });
97
116
  }
117
+ /**
118
+ * Deselects all swatches.
119
+ *
120
+ * @memberof UUIColorSwatchesElement
121
+ */
98
122
  resetSelection() {
99
123
  this.swatches.forEach((swatch) => {
100
124
  swatch.selected = false;
@@ -11,9 +11,8 @@ export declare class UUIColorSwatchesElement extends UUIColorSwatchesElement_bas
11
11
  static styles: import("lit").CSSResult[];
12
12
  /**
13
13
  * Value of selected option.
14
- * @type { string }
14
+ *
15
15
  * @attr
16
- * @default ""
17
16
  */
18
17
  value: string;
19
18
  swatches: Array<UUIColorSwatchElement>;
@@ -26,7 +25,7 @@ export declare class UUIColorSwatchesElement extends UUIColorSwatchesElement_bas
26
25
  protected willUpdate(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
27
26
  private _handleSlotChange;
28
27
  private _onSelected;
29
- private _onUnselected;
28
+ private _onDeselected;
30
29
  /**
31
30
  * Deselects all swatches.
32
31
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umbraco-ui/uui-color-swatches",
3
- "version": "1.2.1",
3
+ "version": "1.3.0-rc.1",
4
4
  "license": "MIT",
5
5
  "keywords": [
6
6
  "Umbraco",
@@ -30,17 +30,17 @@
30
30
  "custom-elements.json"
31
31
  ],
32
32
  "dependencies": {
33
- "@umbraco-ui/uui-base": "1.2.1",
34
- "@umbraco-ui/uui-color-swatch": "1.2.1"
33
+ "@umbraco-ui/uui-base": "1.3.0-rc.1",
34
+ "@umbraco-ui/uui-color-swatch": "1.3.0-rc.1"
35
35
  },
36
36
  "scripts": {
37
37
  "build": "npm run analyze && tsc --build --force && rollup -c rollup.config.js",
38
- "clean": "tsc --build --clean && rimraf dist lib/*.js lib/**/*.js custom-elements.json",
38
+ "clean": "tsc --build --clean && rimraf -g dist lib/*.js lib/**/*.js *.tgz lib/**/*.d.ts custom-elements.json",
39
39
  "analyze": "web-component-analyzer **/*.element.ts --outFile custom-elements.json"
40
40
  },
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
44
  "homepage": "https://uui.umbraco.com/?path=/story/uui-color-swatches",
45
- "gitHead": "94eb22bee5ff21bac6fadbd78653671279bebe36"
45
+ "gitHead": "0c517175884931aa0bc0d8f05974852a7704626e"
46
46
  }