Merge pull request #1223 from ing-bank/fix/data-tag-name
fix: add data-tag-name attribute on scoped slottables
This commit is contained in:
commit
8a8c96eacc
7 changed files with 35 additions and 7 deletions
8
.changeset/rich-masks-shout.md
Normal file
8
.changeset/rich-masks-shout.md
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
---
|
||||||
|
'@lion/form-core': patch
|
||||||
|
'@lion/listbox': patch
|
||||||
|
'@lion/select-rich': patch
|
||||||
|
'@lion/switch': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Add data-tag-name manually to scoped child slottables as the ScopedElementsMixin only does this transform for elements inside render templates.
|
||||||
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
|
|
@ -36,8 +36,10 @@ jobs:
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-yarn-
|
${{ runner.os }}-yarn-
|
||||||
|
|
||||||
|
# at the moment postinstall transforms package.jsons and removes newline at the bottom, so we do a git restore after installing
|
||||||
|
# that way we don't publish package.jsons without a newline at the bottom.
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: yarn --frozen-lockfile
|
run: yarn --frozen-lockfile && git restore .
|
||||||
|
|
||||||
- name: Create Release Pull Request or Publish to npm
|
- name: Create Release Pull Request or Publish to npm
|
||||||
id: changesets
|
id: changesets
|
||||||
|
|
|
||||||
4
.github/workflows/verify.yml
vendored
4
.github/workflows/verify.yml
vendored
|
|
@ -26,8 +26,10 @@ jobs:
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-yarn-
|
${{ runner.os }}-yarn-
|
||||||
|
|
||||||
|
# at the moment postinstall transforms package.jsons and removes newline at the bottom, so we do a git restore after installing
|
||||||
|
# that way we don't get linting errors from eclint for missing newlines in package.jsons.
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: yarn --frozen-lockfile
|
run: yarn --frozen-lockfile && git restore .
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: npm run lint
|
run: npm run lint
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,13 @@ export const ValidateMixinImplementation = superclass =>
|
||||||
const ctor = /** @type {typeof ValidateMixin & ScopedElementsObj} */ (this.constructor);
|
const ctor = /** @type {typeof ValidateMixin & ScopedElementsObj} */ (this.constructor);
|
||||||
return {
|
return {
|
||||||
...super.slots,
|
...super.slots,
|
||||||
feedback: () => document.createElement(ctor.getScopedTagName('lion-validation-feedback')),
|
feedback: () => {
|
||||||
|
const feedbackEl = document.createElement(
|
||||||
|
ctor.getScopedTagName('lion-validation-feedback'),
|
||||||
|
);
|
||||||
|
feedbackEl.setAttribute('data-tag-name', 'lion-validation-feedback');
|
||||||
|
return feedbackEl;
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -126,6 +126,7 @@ const ListboxMixinImplementation = superclass =>
|
||||||
const lionOptions = /** @type {HTMLElement & FormRegistrarPortalHost} */ (document.createElement(
|
const lionOptions = /** @type {HTMLElement & FormRegistrarPortalHost} */ (document.createElement(
|
||||||
ListboxMixin.getScopedTagName('lion-options'),
|
ListboxMixin.getScopedTagName('lion-options'),
|
||||||
));
|
));
|
||||||
|
lionOptions.setAttribute('data-tag-name', 'lion-options');
|
||||||
lionOptions.registrationTarget = this;
|
lionOptions.registrationTarget = this;
|
||||||
return lionOptions;
|
return lionOptions;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,13 @@ export class LionSelectRich extends SlotMixin(ScopedElementsMixin(OverlayMixin(L
|
||||||
get slots() {
|
get slots() {
|
||||||
return {
|
return {
|
||||||
...super.slots,
|
...super.slots,
|
||||||
invoker: () => document.createElement(LionSelectRich.getScopedTagName('lion-select-invoker')),
|
invoker: () => {
|
||||||
|
const invokerEl = document.createElement(
|
||||||
|
LionSelectRich.getScopedTagName('lion-select-invoker'),
|
||||||
|
);
|
||||||
|
invokerEl.setAttribute('data-tag-name', 'lion-select-invoker');
|
||||||
|
return invokerEl;
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,12 +39,15 @@ export class LionSwitch extends ScopedElementsMixin(ChoiceInputMixin(LionField))
|
||||||
get slots() {
|
get slots() {
|
||||||
return {
|
return {
|
||||||
...super.slots,
|
...super.slots,
|
||||||
input: () =>
|
input: () => {
|
||||||
document.createElement(
|
const btnEl = document.createElement(
|
||||||
/** @type {typeof LionSwitch} */ (this.constructor).getScopedTagName(
|
/** @type {typeof LionSwitch} */ (this.constructor).getScopedTagName(
|
||||||
'lion-switch-button',
|
'lion-switch-button',
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
|
btnEl.setAttribute('data-tag-name', 'lion-switch-button');
|
||||||
|
return btnEl;
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue