@omegagrid/form 0.7.13 → 0.8.0

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.
@@ -40,6 +40,7 @@ declare const _default: {
40
40
  MENU_ITEM_HEIGHT: number;
41
41
  COLORPICKER_COLOR_SIZE: number;
42
42
  DEFAULT_NUMBER_FORMAT: string;
43
+ BUTTON_HEIGHT: number;
43
44
  FONT_SIZE: number;
44
45
  FORM_CONTROL_HEIGHT: number;
45
46
  BUTTON_CONFIG: Map<FormButtonType, FormButtonConfig>;
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,wBAUC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,wBAUC"}
@@ -1 +1 @@
1
- {"version":3,"file":"baseControl.d.ts","sourceRoot":"","sources":["../../../src/ui/controls/baseControl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,UAAU,EAAE,MAAM,KAAK,CAAC;AAEtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE1D,qBAAa,YAAY,CAAC,MAAM,CAAE,SAAQ,KAAK;aAG7B,KAAK,EAAE,gBAAgB;aACvB,KAAK,EAAE,MAAM;gBAF7B,IAAI,EAAE,MAAM,EACI,KAAK,EAAE,gBAAgB,EACvB,KAAK,EAAE,MAAM;CAI9B;AAED,MAAM,WAAW,QA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AAK,EAAE,MAAM;gBAF7B,IAAI,EAAE,MAAM,EACI,KAAK,EAAE,gBAAgB,EACvB,KAAK,EAAE,MAAM;CAI9B;AAED,MAAM,WAAW,QAAQ,CAAC,MAAM,GAAG,OAAO,EAAE,QAAQ,SAAS,gBAAgB,GAAG,IAAI,CAAE,SAAQ,WAAW;IACxG,KAAK,EAAE,gBAAgB,CAAC;IACxB,OAAO,EAAE,QAAQ,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,IAAI,IAAI,CAAC;IACd,QAAQ,IAAK,IAAI,CAAC;IAClB,IAAI,OAAO,IAAK,OAAO,CAAC;CACxB;AAED,8BAAsB,WAAW,CAAC,MAAM,GAAG,OAAO,EAAE,QAAQ,SAAS,gBAAgB,GAAG,IAAI,CAC3F,SAAQ,UAAW,YAAW,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;IAExD,MAAM,CAAC,MAAM,4BAcV;IAGH,KAAK,EAAE,gBAAgB,CAAC;IAGxB,SAAS,EAAE,SAAS,CAAC;IAGrB,OAAO,EAAE,QAAQ,CAAC;IAElB,OAAO,CAAC,MAAM,CAAgB;IAC9B,IACI,KAAK,IACQ,MAAM,CADY;IACnC,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,EAMtB;IAGD,QAAQ,UAAS;IAEjB,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,UAAO;IAQzD,UAAU,CAAC,YAAY,EAAE,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,GAAG,IAAI;IASzD,KAAK;IAIL,QAAQ;IASR,IAAI,OAAO,YAA2C;CAEtD"}
@@ -60,6 +60,7 @@ export class BaseControl extends LitElement {
60
60
  BaseControl.styles = [css `
61
61
  :host {
62
62
  display: block;
63
+ box-sizing: border-box;
63
64
  }
64
65
 
65
66
  * {
@@ -68,6 +69,7 @@ BaseControl.styles = [css `
68
69
 
69
70
  :host([required]) {
70
71
  border: 2px solid var(--og-accent-color);
72
+ border-radius: var(--og-base-radius);
71
73
  }
72
74
  `];
73
75
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"baseControl.js","sourceRoot":"","sources":["../../../src/ui/controls/baseControl.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAI7C,MAAM,OAAO,YAAqB,SAAQ,KAAK;IAC9C,YACC,IAAY,EACI,KAAuB,EACvB,KAAa;QAE7B,KAAK,CAAC,IAAI,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;QAH/C,UAAK,GAAL,KAAK,CAAkB;QACvB,UAAK,GAAL,KAAK,CAAQ;IAG9B,CAAC;CACD;AAWD,MAAM,OAAgB,WACrB,SAAQ,UAAU;IADnB;;QA0BS,WAAM,GAAW,IAAI,CAAC;QAY9B,aAAQ,GAAG,KAAK,CAAC;IAkClB,CAAC;IA5CA,IAAI,KAAK,KAAK,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACnC,IAAI,KAAK,CAAC,KAAa;QACtB,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,QAAQ,KAAK,KAAK,EAAE,CAAC;YACxB,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACvC,CAAC;IACF,CAAC;IAKS,WAAW,CAAC,KAAa,EAAE,aAAa,GAAG,IAAI;QACxD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,QAAQ,EAAE,CAAC;QAChB,IAAI,aAAa,EAAE,CAAC;YACnB,IAAI,CAAC,aAAa,CAAC,IAAI,YAAY,CAAS,QAAQ,EAAE,IAAI,CAAC,KAAK,EAAE,K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B;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;wCACU;AAUnC;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;6CACxB","sourcesContent":["import { css, LitElement } from 'lit';\nimport { property } from \"lit/decorators.js\";\nimport { ComponentAdapter } from '@omegagrid/core';\nimport { FormControlModel, FormModel } from '../../model';\n\nexport class ControlEvent<TValue> extends Event {\n\tconstructor(\n\t\ttype: string,\n\t\tpublic readonly model: FormControlModel,\n\t\tpublic readonly value: TValue\n\t) {\n\t\tsuper(type, {bubbles: true, cancelable: true, composed: true});\n\t}\n}\n\nexport interface IControl<TValue = unknown, TAdapter extends ComponentAdapter = null> extends HTMLElement {\n\tmodel: FormControlModel;\n\tadapter: TAdapter;\n\tvalue: TValue;\n\treset(): void;\n\tvalidate() : void;\n\tget isValid() : boolean;\n}\n\nexport abstract class BaseControl<TValue = unknown, TAdapter extends ComponentAdapter = null> \n\textends LitElement implements IControl<TValue, TAdapter> {\n\n\tstatic styles = [css`\n\t\t:host {\n\t\t\tdisplay: block;\n\t\t}\n\n\t\t* {\n\t\t\tbox-sizing: border-box;\n\t\t}\n\n\t\t:host([required]) {\n\t\t\tborder: 2px solid var(--og-accent-color);\n\t\t}\n\t`];\n\n\t@property({type: Object})\n\tmodel: FormControlModel;\n\n\t@property({type: Object})\n\tformModel: FormModel;\n\n\t@property({type: Object})\n\tadapter: TAdapter;\n\n\tprivate _value: TValue = null;\n\t@property({type: Object})\n\tget value() { return this._value; }\n\tset value(value: TValue) {\n\t\tconst oldValue = this._value;\n\t\tthis._value = value;\n\t\tif (oldValue !== value) {\n\t\t\tthis.requestUpdate('value', oldValue);\n\t\t}\n\t}\n\t\n\t@property({type: Boolean, reflect: true})\n\trequired = false;\n\n\tprotected updateValue(value: TValue, dispatchEvent = true) {\n\t\tthis._value = value;\n\t\tthis.validate();\n\t\tif (dispatchEvent) {\n\t\t\tthis.dispatchEvent(new ControlEvent<TValue>('change', this.model, value));\n\t\t}\n\t}\n\n\twillUpdate(changedProps: Map<PropertyKey, unknown>): void {\n\t\tif (changedProps.has('model')) {\n\t\t\tif (this.value === null) {\n\t\t\t\tthis.value = this.model.props.value as TValue;\n\t\t\t}\n\t\t\tthis.required = this.model.props.required;\n\t\t}\n\t}\n\n\treset() {\n\t\tthis.updateValue(this.model.props.value as TValue);\n\t}\n\n\tvalidate() {\n\t\tif (!this.model) return;\n\t\tif (this.required && (this.value == null || this.value === '')) {\n\t\t\tthis.model.errors = ['this field is required'];\n\t\t} else {\n\t\t\tthis.model.errors = [];\n\t\t}\n\t}\n\n\tget isValid() { return this.model.errors.length == 0 }\n\t\n}"]}
1
+ {"version":3,"file":"baseControl.js","sourceRoot":"","sources":["../../../src/ui/controls/baseControl.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAI7C,MAAM,OAAO,YAAqB,SAAQ,KAAK;IAC9C,YACC,IAAY,EACI,KAAuB,EACvB,KAAa;QAE7B,KAAK,CAAC,IAAI,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;QAH/C,UAAK,GAAL,KAAK,CAAkB;QACvB,UAAK,GAAL,KAAK,CAAQ;IAG9B,CAAC;CACD;AAWD,MAAM,OAAgB,WACrB,SAAQ,UAAU;IADnB;;QA4BS,WAAM,GAAW,IAAI,CAAC;QAY9B,aAAQ,GAAG,KAAK,CAAC;IAkClB,CAAC;IA5CA,IAAI,KAAK,KAAK,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACnC,IAAI,KAAK,CAAC,KAAa;QACtB,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,KAA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AI,OAAO,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,CAAA,CAAC,CAAC;;AArE/C,kBAAM,GAAG,CAAC,GAAG,CAAA;;;;;;;;;;;;;;EAcnB,CAAC,AAdW,CAcV;AAGH;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;0CACD;AAGxB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;8CACJ;AAGrB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;4CACP;AAIlB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;wCACU;AAUnC;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;6CACxB","sourcesContent":["import { css, LitElement } from 'lit';\nimport { property } from \"lit/decorators.js\";\nimport { ComponentAdapter } from '@omegagrid/core';\nimport { FormControlModel, FormModel } from '../../model';\n\nexport class ControlEvent<TValue> extends Event {\n\tconstructor(\n\t\ttype: string,\n\t\tpublic readonly model: FormControlModel,\n\t\tpublic readonly value: TValue\n\t) {\n\t\tsuper(type, {bubbles: true, cancelable: true, composed: true});\n\t}\n}\n\nexport interface IControl<TValue = unknown, TAdapter extends ComponentAdapter = null> extends HTMLElement {\n\tmodel: FormControlModel;\n\tadapter: TAdapter;\n\tvalue: TValue;\n\treset(): void;\n\tvalidate() : void;\n\tget isValid() : boolean;\n}\n\nexport abstract class BaseControl<TValue = unknown, TAdapter extends ComponentAdapter = null> \n\textends LitElement implements IControl<TValue, TAdapter> {\n\n\tstatic styles = [css`\n\t\t:host {\n\t\t\tdisplay: block;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\n\t\t* {\n\t\t\tbox-sizing: border-box;\n\t\t}\n\n\t\t:host([required]) {\n\t\t\tborder: 2px solid var(--og-accent-color);\n\t\t\tborder-radius: var(--og-base-radius);\n\t\t}\n\t`];\n\n\t@property({type: Object})\n\tmodel: FormControlModel;\n\n\t@property({type: Object})\n\tformModel: FormModel;\n\n\t@property({type: Object})\n\tadapter: TAdapter;\n\n\tprivate _value: TValue = null;\n\t@property({type: Object})\n\tget value() { return this._value; }\n\tset value(value: TValue) {\n\t\tconst oldValue = this._value;\n\t\tthis._value = value;\n\t\tif (oldValue !== value) {\n\t\t\tthis.requestUpdate('value', oldValue);\n\t\t}\n\t}\n\t\n\t@property({type: Boolean, reflect: true})\n\trequired = false;\n\n\tprotected updateValue(value: TValue, dispatchEvent = true) {\n\t\tthis._value = value;\n\t\tthis.validate();\n\t\tif (dispatchEvent) {\n\t\t\tthis.dispatchEvent(new ControlEvent<TValue>('change', this.model, value));\n\t\t}\n\t}\n\n\twillUpdate(changedProps: Map<PropertyKey, unknown>): void {\n\t\tif (changedProps.has('model')) {\n\t\t\tif (this.value === null) {\n\t\t\t\tthis.value = this.model.props.value as TValue;\n\t\t\t}\n\t\t\tthis.required = this.model.props.required;\n\t\t}\n\t}\n\n\treset() {\n\t\tthis.updateValue(this.model.props.value as TValue);\n\t}\n\n\tvalidate() {\n\t\tif (!this.model) return;\n\t\tif (this.required && (this.value == null || this.value === '')) {\n\t\t\tthis.model.errors = ['this field is required'];\n\t\t} else {\n\t\t\tthis.model.errors = [];\n\t\t}\n\t}\n\n\tget isValid() { return this.model.errors.length == 0 }\n\t\n}"]}
@@ -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,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,GAAI,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,UAGzC;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,GAAI,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,UAIzC;IAED,MAAM,6CAiBJ;CAEF"}
@@ -15,11 +15,16 @@ let FormColorInput = class FormColorInput extends BaseControl {
15
15
  this._onChange = (e) => {
16
16
  this.dropdown.close();
17
17
  this.updateValue(e.value == null ? null : utils.trim(e.value, '#'));
18
+ this.requestUpdate();
18
19
  };
19
20
  this.render = () => html `
20
- <og-dropdown>
21
- <div slot="label" style="${styleMap({ backgroundColor: this.value ? `#${this.value}` : 'transparent', marginRight: '4px' })}">
22
- <og-icon icon="fill"></og-icon>
21
+ <og-dropdown style="${styleMap({ backgroundColor: this.value ? `#${this.value}` : null })}">
22
+ <div
23
+ slot="label"
24
+ style="${styleMap({
25
+ backgroundColor: this.value ? `#${this.value}` : 'transparent',
26
+ padding: '2px'
27
+ })}">&nbsp;
23
28
  </div>
24
29
 
25
30
  <og-colorpicker
@@ -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,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACzD,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,cAAc,GAApB,MAAM,cAAe,SAAQ,WAAmB;IAAhD;;QAON,cAAS,GAAG,CAAC,CAA6B,EAAE,EAAE;YAC7C,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;YACtB,IAAI,CAAC,WAAW,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","sourcesContent":["import { html } from \"lit\";\nimport { customElement, query } from \"lit/decorators.js\";\nimport { BaseControl } from \"./baseControl\";\nimport { styleMap } from \"lit/directives/style-map.js\";\nimport { Dropdown, events, utils } from \"@omegagrid/core\";\n\n@customElement('og-form-colorinput')\nexport class FormColorInput extends BaseControl<string> {\n\n\tstatic styles = [...BaseControl.styles];\n\n\t@query('og-dropdown')\n\tdropdown: Dropdown;\n\n\t_onChange = (e: events.ChangeEvent<string>) => {\n\t\tthis.dropdown.close();\n\t\tthis.updateValue(e.value == null ? null : utils.trim(e.value, '#'));\n\t}\n\n\trender = () => html`\n\t\t<og-dropdown>\n\t\t\t<div slot=\"label\" style=\"${styleMap({backgroundColor: this.value ? `#${this.value}` : 'transparent', marginRight: '4px'})}\">\n\t\t\t\t<og-icon icon=\"fill\"></og-icon>\n\t\t\t</div>\n\n\t\t\t<og-colorpicker\n\t\t\t\tslot=\"content\"\n\t\t\t\t.color=\"${this.value}\"\n\t\t\t\t@change=\"${this._onChange}\"\n\t\t\t\t@mousedown=\"${(e: MouseEvent) => e.stopPropagation()}\">\n\t\t\t</og-colorpicker>\n\t\t</og-dropdown>\n\t`;\n\t\n}"]}
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,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACzD,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,cAAc,GAApB,MAAM,cAAe,SAAQ,WAAmB;IAAhD;;QAON,cAAS,GAAG,CAAC,CAA6B,EAAE,EAAE;YAC7C,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;YACtB,IAAI,CAAC,WAAW,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;YACpE,IAAI,CAAC,aAAa,EAAE,CAAC;QACtB,CAAC,CAAA;QAED,WAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAA;wBACI,QAAQ,CAAC,EAAC,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,EAAC,CAAC;;;aAG5E,QAAQ,CAAC;YACjB,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,aAAa;YAC9D,OAAO,EAAE,KAAK;SACd,CAAC;;;;;cAKQ,IAAI,CAAC,KAAK;eACT,IAAI,CAAC,SAAS;kBACX,CAAC,CAAa,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE;;;EAGtD,CAAC;IAEH,CAAC;;AA9BO,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,CAgC1B","sourcesContent":["import { html } from \"lit\";\nimport { customElement, query } from \"lit/decorators.js\";\nimport { BaseControl } from \"./baseControl\";\nimport { styleMap } from \"lit/directives/style-map.js\";\nimport { Dropdown, events, utils } from \"@omegagrid/core\";\n\n@customElement('og-form-colorinput')\nexport class FormColorInput extends BaseControl<string> {\n\n\tstatic styles = [...BaseControl.styles];\n\n\t@query('og-dropdown')\n\tdropdown: Dropdown;\n\n\t_onChange = (e: events.ChangeEvent<string>) => {\n\t\tthis.dropdown.close();\n\t\tthis.updateValue(e.value == null ? null : utils.trim(e.value, '#'));\n\t\tthis.requestUpdate();\n\t}\n\n\trender = () => html`\n\t\t<og-dropdown style=\"${styleMap({backgroundColor: this.value ? `#${this.value}` : null})}\">\n\t\t\t<div\n\t\t\t\tslot=\"label\" \n\t\t\t\tstyle=\"${styleMap({\n\t\t\t\t\tbackgroundColor: this.value ? `#${this.value}` : 'transparent', \n\t\t\t\t\tpadding: '2px'\n\t\t\t\t})}\">&nbsp;\n\t\t\t</div>\n\n\t\t\t<og-colorpicker\n\t\t\t\tslot=\"content\"\n\t\t\t\t.color=\"${this.value}\"\n\t\t\t\t@change=\"${this._onChange}\"\n\t\t\t\t@mousedown=\"${(e: MouseEvent) => e.stopPropagation()}\">\n\t\t\t</og-colorpicker>\n\t\t</og-dropdown>\n\t`;\n\t\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"formContainer.style.d.ts","sourceRoot":"","sources":["../../src/ui/formContainer.style.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,yBA2CjB,CAAC"}
1
+ {"version":3,"file":"formContainer.style.d.ts","sourceRoot":"","sources":["../../src/ui/formContainer.style.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,yBAyCjB,CAAC"}
@@ -32,10 +32,8 @@ export const style = css `
32
32
  flex-direction: row;
33
33
  gap: 4px;
34
34
  justify-content: flex-end;
35
- padding: 4px;
36
35
  border-top: 1px solid var(--og-border-color);
37
- height: 30px;
38
- line-height: 30px;
36
+ padding: 4px;
39
37
  }
40
38
 
41
39
  .buttons og-button {
@@ -1 +1 @@
1
- {"version":3,"file":"formContainer.style.js","sourceRoot":"","sources":["../../src/ui/formContainer.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CvB,CAAC","sourcesContent":["import { css } from \"lit\";\n\nexport const style = css`\n\t* {\n\t\tbox-sizing: border-box;\n\t}\n\n\t:host {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tposition: relative;\n\t\tborder-radius: var(--og-base-radius);\n\t}\n\n\t.title {\n\t\tbackground-color: var(--og-accent-color);\n\t\tline-height: 40px;\n\t\tpadding: 0 10px;\n\t\tcolor: var(--og-text-color-reversed);\n\t\tflex: 0;\n\t}\n\n\tog-container {\n\t\tflex: 1;\n\t}\n\n\t.form-title {\n\t\tpadding: 5px;\n\t}\n\n\t.buttons {\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\tgap: 4px;\n\t\tjustify-content: flex-end;\n\t\tpadding: 4px;\n\t\tborder-top: 1px solid var(--og-border-color);\n\t\theight: 30px;\n\t\tline-height: 30px;\n\t}\n\n\t.buttons og-button {\n\t\tmin-width: 80px;\n\t\ttext-align: center;\n\t}\n`;"]}
1
+ {"version":3,"file":"formContainer.style.js","sourceRoot":"","sources":["../../src/ui/formContainer.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCvB,CAAC","sourcesContent":["import { css } from \"lit\";\n\nexport const style = css`\n\t* {\n\t\tbox-sizing: border-box;\n\t}\n\n\t:host {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tposition: relative;\n\t\tborder-radius: var(--og-base-radius);\n\t}\n\n\t.title {\n\t\tbackground-color: var(--og-accent-color);\n\t\tline-height: 40px;\n\t\tpadding: 0 10px;\n\t\tcolor: var(--og-text-color-reversed);\n\t\tflex: 0;\n\t}\n\n\tog-container {\n\t\tflex: 1;\n\t}\n\n\t.form-title {\n\t\tpadding: 5px;\n\t}\n\n\t.buttons {\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\tgap: 4px;\n\t\tjustify-content: flex-end;\n\t\tborder-top: 1px solid var(--og-border-color);\n\t\tpadding: 4px;\n\t}\n\n\t.buttons og-button {\n\t\tmin-width: 80px;\n\t\ttext-align: center;\n\t}\n`;"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omegagrid/form",
3
- "version": "0.7.13",
3
+ "version": "0.8.0",
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.7.13",
31
- "@omegagrid/core": "^0.7.13",
32
- "@omegagrid/localize": "^0.7.13",
33
- "@omegagrid/tree": "^0.7.13",
30
+ "@omegagrid/calendar": "^0.8.0",
31
+ "@omegagrid/core": "^0.8.0",
32
+ "@omegagrid/localize": "^0.8.0",
33
+ "@omegagrid/tree": "^0.8.0",
34
34
  "lit": "^3.1.1",
35
35
  "lit-html": "^3.1.1",
36
36
  "ts-debounce": "^4.0.0"