Socket
Socket
Sign inDemoInstall

@lion/field

Package Overview
Dependencies
Maintainers
1
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lion/field - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

## [0.4.1](https://github.com/ing-bank/lion/compare/@lion/field@0.4.0...@lion/field@0.4.1) (2019-11-15)
### Bug Fixes
* refactor slot selection ([5999ea9](https://github.com/ing-bank/lion/commit/5999ea956967b449f3f04935c7facb19e2889dc9))
# [0.4.0](https://github.com/ing-bank/lion/compare/@lion/field@0.3.7...@lion/field@0.4.0) (2019-11-13)

@@ -8,0 +19,0 @@

4

docs/CustomFieldsTutorial.md

@@ -71,7 +71,7 @@ # Creating a custom field

get value() {
   return this.querySelector('[slot=input]').mySliderValue;
   return Array.from(this.children).find(child => child.slot === 'input').mySliderValue;
}
set value(newV) {
   this.querySelector('[slot=input]').mySliderValue = newV;
   Array.from(this.children).find(child => child.slot === 'input').mySliderValue = newV;
}

@@ -78,0 +78,0 @@ }

{
"name": "@lion/field",
"version": "0.4.0",
"version": "0.4.1",
"description": "Fields are the most fundamental building block of the Form System",

@@ -37,3 +37,3 @@ "author": "ing-bank",

"@lion/core": "^0.3.0",
"@lion/validate": "^0.3.0"
"@lion/validate": "^0.3.1"
},

@@ -46,3 +46,3 @@ "devDependencies": {

},
"gitHead": "90e6b4ef36bb5c49cfe7e4b2b8a00128334c84ab"
"gitHead": "e1485188a03c063819623288f3231cfecca023ec"
}

@@ -298,3 +298,3 @@ import { html, css, nothing, dedupeMixin, SlotMixin } from '@lion/core';

inputGroupPrefixTemplate() {
return !this.querySelector('[slot=prefix]')
return !Array.from(this.children).find(child => child.slot === 'prefix')
? nothing

@@ -318,3 +318,3 @@ : html`

inputGroupSuffixTemplate() {
return !this.querySelector('[slot=suffix]')
return !Array.from(this.children).find(child => child.slot === 'suffix')
? nothing

@@ -321,0 +321,0 @@ : html`

@@ -27,4 +27,6 @@ import { expect, fixture, defineCE } from '@open-wc/testing';

`);
expect(lionField.querySelector('[slot=help-text]')).to.equal(null);
expect(Array.from(lionField.children).find(child => child.slot === 'help-text')).to.equal(
undefined,
);
});
});

@@ -30,5 +30,5 @@ import { expect, fixture, html, defineCE, unsafeStatic } from '@open-wc/testing';

`);
expect(lionFieldAttr.querySelector('[slot=help-text]').textContent).to.contain(
'This email address is already taken',
);
expect(
Array.from(lionFieldAttr.children).find(child => child.slot === 'help-text').textContent,
).to.contain('This email address is already taken');
const lionFieldProp = await fixture(html`

@@ -40,5 +40,5 @@ <${tag}

expect(lionFieldProp.querySelector('[slot=help-text]').textContent).to.contain(
'This email address is already taken',
);
expect(
Array.from(lionFieldProp.children).find(child => child.slot === 'help-text').textContent,
).to.contain('This email address is already taken');
});

@@ -57,4 +57,4 @@

['aria-describedby', 'aria-labelledby'].forEach(ariaAttributeName => {
const ariaAttribute = lionField
.querySelector('[slot=input]')
const ariaAttribute = Array.from(lionField.children)
.find(child => child.slot === 'input')
.getAttribute(ariaAttributeName)

@@ -76,4 +76,8 @@ .trim()

expect(lionField.querySelector('[slot=feedback]').getAttribute('aria-live')).to.equal('polite');
expect(
Array.from(lionField.children)
.find(child => child.slot === 'feedback')
.getAttribute('aria-live'),
).to.equal('polite');
});
});

@@ -35,3 +35,3 @@ import {

const el = await fixture(html`<${tag}>${inputSlot}</${tag}>`);
expect(el.querySelector('[slot=input]').id).to.equal(el._inputId);
expect(Array.from(el.children).find(child => child.slot === 'input').id).to.equal(el._inputId);
});

@@ -117,3 +117,3 @@

const el = await fixture(html`<${tag} value="one">${inputSlot}</${tag}>`);
expect(el.querySelector('[slot=input]').value).to.equal('one');
expect(Array.from(el.children).find(child => child.slot === 'input').value).to.equal('one');
});

@@ -123,6 +123,6 @@

const el = await fixture(html`<${tag}>${inputSlot}</${tag}>`);
expect(el.querySelector('[slot=input]').value).to.equal('');
expect(Array.from(el.children).find(child => child.slot === 'input').value).to.equal('');
el.value = 'one';
expect(el.value).to.equal('one');
expect(el.querySelector('[slot=input]').value).to.equal('one');
expect(Array.from(el.children).find(child => child.slot === 'input').value).to.equal('one');
});

@@ -206,3 +206,3 @@

`);
const nativeInput = el.querySelector('[slot=input]');
const nativeInput = Array.from(el.children).find(child => child.slot === 'input');

@@ -225,3 +225,3 @@ expect(nativeInput.getAttribute('aria-labelledby')).to.equal(` label-${el._inputId}`);

const nativeInput = el.querySelector('[slot=input]');
const nativeInput = Array.from(el.children).find(child => child.slot === 'input');
expect(nativeInput.getAttribute('aria-labelledby')).to.contain(

@@ -228,0 +228,0 @@ ` before-${el._inputId} after-${el._inputId}`,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc