@omegagrid/form 0.6.29 → 0.6.30

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.
@@ -1,8 +1,9 @@
1
1
  import { BaseControl } from "./baseControl";
2
- import { ColorPickerEvent } from "@omegagrid/core";
2
+ import { Dropdown, events } from "@omegagrid/core";
3
3
  export declare class FormColorInput extends BaseControl<string> {
4
4
  static styles: import("lit").CSSResult[];
5
- _onSelect: (e: ColorPickerEvent) => void;
5
+ dropdown: Dropdown;
6
+ _onChange: (e: events.ChangeEvent<string>) => void;
6
7
  render: () => import("lit-html").TemplateResult<1>;
7
8
  }
8
9
  //# sourceMappingURL=colorInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"colorInput.d.ts","sourceRoot":"","sources":["../../../src/ui/controls/colorInput.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAS,MAAM,iBAAiB,CAAC;AAE1D,qBACa,cAAe,SAAQ,WAAW,CAAC,MAAM,CAAC;IAEtD,MAAM,CAAC,MAAM,4BAA2B;IAExC,SAAS,MAAO,gBAAgB,UAE/B;IAED,MAAM,6CAaJ;CAEF"}
1
+ {"version":3,"file":"colorInput.d.ts","sourceRoot":"","sources":["../../../src/ui/controls/colorInput.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAS,MAAM,iBAAiB,CAAC;AAE1D,qBACa,cAAe,SAAQ,WAAW,CAAC,MAAM,CAAC;IAEtD,MAAM,CAAC,MAAM,4BAA2B;IAGxC,QAAQ,EAAE,QAAQ,CAAC;IAEnB,SAAS,MAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,UAGzC;IAED,MAAM,6CAaJ;CAEF"}
@@ -5,15 +5,16 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { html } from "lit";
8
- import { customElement } from "lit/decorators.js";
8
+ import { customElement, query } from "lit/decorators.js";
9
9
  import { BaseControl } from "./baseControl";
10
10
  import { styleMap } from "lit/directives/style-map.js";
11
11
  import { utils } from "@omegagrid/core";
12
12
  let FormColorInput = class FormColorInput extends BaseControl {
13
13
  constructor() {
14
14
  super(...arguments);
15
- this._onSelect = (e) => {
16
- this.updateValue(utils.trim(e.color, '#'));
15
+ this._onChange = (e) => {
16
+ this.dropdown.close();
17
+ this.updateValue(e.value == null ? null : utils.trim(e.value, '#'));
17
18
  };
18
19
  this.render = () => html `
19
20
  <og-dropdown>
@@ -24,7 +25,7 @@ let FormColorInput = class FormColorInput extends BaseControl {
24
25
  <og-colorpicker
25
26
  slot="content"
26
27
  .color="${this.value}"
27
- @select="${this._onSelect}"
28
+ @change="${this._onChange}"
28
29
  @mousedown="${(e) => e.stopPropagation()}">
29
30
  </og-colorpicker>
30
31
  </og-dropdown>
@@ -32,6 +33,9 @@ let FormColorInput = class FormColorInput extends BaseControl {
32
33
  }
33
34
  };
34
35
  FormColorInput.styles = [...BaseControl.styles];
36
+ __decorate([
37
+ query('og-dropdown')
38
+ ], FormColorInput.prototype, "dropdown", void 0);
35
39
  FormColorInput = __decorate([
36
40
  customElement('og-form-colorinput')
37
41
  ], FormColorInput);
@@ -1 +1 @@
1
- {"version":3,"file":"colorInput.js","sourceRoot":"","sources":["../../../src/ui/controls/colorInput.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAoB,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAGnD,IAAM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W,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;QACrE,CAAC,CAAA;QAED,WAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAA;;8BAEU,QAAQ,CAAC,EAAC,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,aAAa,EAAE,WAAW,EAAE,KAAK,EAAC,CAAC;;;;;;cAM9G,IAAI,CAAC,KAAK;eACT,IAAI,CAAC,SAAS;kBACX,CAAC,CAAa,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE;;;EAGtD,CAAC;IAEH,CAAC;;AAzBO,qBAAM,GAAG,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,AAA1B,CAA2B;AAGxC;IADC,KAAK,CAAC,aAAa,CAAC;gDACF;AALP,cAAc;IAD1B,aAAa,CAAC,oBAAoB,CAAC;GACvB,cAAc,CA2B1B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omegagrid/form",
3
- "version": "0.6.29",
3
+ "version": "0.6.30",
4
4
  "license": "UNLICENSED",
5
5
  "description": "Universal form component",
6
6
  "main": "./dist/index.js",
@@ -27,10 +27,10 @@
27
27
  "_prepublish": "yarn test && yarn lint"
28
28
  },
29
29
  "dependencies": {
30
- "@omegagrid/calendar": "^0.6.29",
31
- "@omegagrid/core": "^0.6.29",
32
- "@omegagrid/localize": "^0.6.29",
33
- "@omegagrid/tree": "^0.6.29",
30
+ "@omegagrid/calendar": "^0.6.30",
31
+ "@omegagrid/core": "^0.6.30",
32
+ "@omegagrid/localize": "^0.6.30",
33
+ "@omegagrid/tree": "^0.6.30",
34
34
  "lit": "^3.1.1",
35
35
  "lit-html": "^3.1.1",
36
36
  "ts-debounce": "^4.0.0"