Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/4.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasOsti committed Jan 24, 2025
2 parents 36e5670 + c513b2c commit a272c46
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 12 deletions.
4 changes: 3 additions & 1 deletion src/bundle/Resources/public/js/scripts/core/taggify.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
return this.acceptKeys.includes(key);
}

addTag(name, value) {
addTag(name, value, dataset = {}) {
const tagTemplate = this.listNode.dataset.template;
const renderedTemplate = tagTemplate.replace('{{ name }}', name).replace('{{ value }}', value);
const div = doc.createElement('div');
Expand All @@ -27,6 +27,8 @@

const tag = div.querySelector('.ibexa-taggify__list-tag');

Object.entries(dataset).forEach(([datasetKey, datasetValue]) => (tag.dataset[datasetKey] = datasetValue));

this.attachEventsToTag(tag, value);
this.listNode.insertBefore(tag, this.inputNode);
this.tags.add(value);
Expand Down
10 changes: 10 additions & 0 deletions src/bundle/Resources/public/scss/_taggify.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@
opacity: 0;
}
}

&--danger {
background: $ibexa-color-danger-100;
border-color: $ibexa-color-danger-100;
color: $ibexa-color-danger-600;

.ibexa-icon {
fill: $ibexa-color-danger-600;
}
}
}

&__input {
Expand Down
23 changes: 17 additions & 6 deletions src/bundle/Resources/public/scss/ui/modules/common/_spinner.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
@use 'sass:list';

.c-spinner {
@include spinner(calculateRem(26px), calculateRem(3px), $ibexa-color-primary);
$color-variants: (
'--primary': $ibexa-color-primary,
'--light': $ibexa-color-white,
);

&--small {
@include spinner(calculateRem(16px), calculateRem(2px), $ibexa-color-primary);
}
$size-variants: (
'--small': calculateRem(16px) calculateRem(2px),
'--medium': calculateRem(26px) calculateRem(3px),
'--large': calculateRem(86px) calculateRem(6px),
);

&--large {
@include spinner(calculateRem(86px), calculateRem(6px), $ibexa-color-primary);
@each $size-modifier, $sizes in $size-variants {
@each $color-modifier, $color in $color-variants {
&#{$size-modifier}.c-spinner#{$color-modifier} {
@include spinner(list.nth($sizes, 1), list.nth($sizes, 2), $color);
}
}
}
}
10 changes: 9 additions & 1 deletion src/bundle/ui-dev/src/modules/common/spinner/spinner.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,29 @@ export const SIZES = {
LARGE: 'large',
};

const Spinner = ({ size }) => {
export const COLOR_VARIANTS = {
PRIMARY: 'primary',
LIGHT: 'light',
};

const Spinner = ({ size, colorVariant }) => {
const className = createCssClassNames({
'c-spinner': true,
[`c-spinner--${size}`]: true,
[`c-spinner--${colorVariant}`]: true,
});

return <div className={className} />;
};

Spinner.propTypes = {
size: PropTypes.oneOf(Object.values(SIZES)),
colorVariant: PropTypes.oneOf(Object.values(COLOR_VARIANTS)),
};

Spinner.defaultProps = {
size: SIZES.MEDIUM,
colorVariant: COLOR_VARIANTS.PRIMARY,
};

export default Spinner;
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,18 @@ final class LocationListDataVisitor extends AbstractLocationDataVisitor
public function visit(Visitor $visitor, Generator $generator, $data): void
{
$generator->startObjectElement('LocationList');
$generator->startList('locations');

foreach ($data->getLocationList() as $locationList) {
$generator->startList('locations');

$generator->startHashElement('locationWithPermissions');

$this->buildLocationNode($locationList['location'], $generator, $visitor);
$this->buildPermissionNode($locationList['permissions'], $generator);

$generator->endHashElement('locationWithPermissions');

$generator->endList('locations');
}

$generator->endList('locations');
$generator->endObjectElement('LocationList');
}
}

0 comments on commit a272c46

Please sign in to comment.