Skip to content

Commit 13df2fb

Browse files
authored
Merge pull request #215 from Foxy/release/1.45.0
chore: release 1.45.0
2 parents d6f452e + 1936a8d commit 13df2fb

29 files changed

Lines changed: 1073 additions & 362 deletions

File tree

custom-elements.json

Lines changed: 13 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -13808,6 +13808,12 @@
1380813808
"path": "./src/elements/public/FormDialog/index.ts",
1380913809
"description": "Dialog wrapper for the forms made with NucleonElement.",
1381013810
"attributes": [
13811+
{
13812+
"name": "no-confirm-when-dirty",
13813+
"description": "If true, FormDialog won't show the confirmation dialog when the form is dirty.",
13814+
"type": "boolean",
13815+
"default": "false"
13816+
},
1381113817
{
1381213818
"name": "close-on-patch",
1381313819
"description": "If true, FormDialog will automatically close after the associated form updates the resource.",
@@ -13954,6 +13960,13 @@
1395413960
}
1395513961
],
1395613962
"properties": [
13963+
{
13964+
"name": "noConfirmWhenDirty",
13965+
"attribute": "no-confirm-when-dirty",
13966+
"description": "If true, FormDialog won't show the confirmation dialog when the form is dirty.",
13967+
"type": "boolean",
13968+
"default": "false"
13969+
},
1395713970
{
1395813971
"name": "closeOnPatch",
1395913972
"attribute": "close-on-patch",
@@ -21852,38 +21865,6 @@
2185221865
"type": "string",
2185321866
"default": "\"defaultNS\""
2185421867
},
21855-
{
21856-
"name": "mode",
21857-
"type": "string",
21858-
"default": "\"production\""
21859-
},
21860-
{
21861-
"name": "readonly",
21862-
"type": "boolean",
21863-
"default": "false"
21864-
},
21865-
{
21866-
"name": "readonlycontrols",
21867-
"default": "\"False\""
21868-
},
21869-
{
21870-
"name": "disabled",
21871-
"type": "boolean",
21872-
"default": "false"
21873-
},
21874-
{
21875-
"name": "disabledcontrols",
21876-
"default": "\"False\""
21877-
},
21878-
{
21879-
"name": "hidden",
21880-
"type": "boolean",
21881-
"default": "false"
21882-
},
21883-
{
21884-
"name": "hiddencontrols",
21885-
"default": "\"False\""
21886-
},
2188721868
{
2188821869
"name": "lang",
2188921870
"description": "Optional ISO 639-1 code describing the language element content is written in.\nChanging the `lang` attribute will update the value of this property.",
@@ -21945,61 +21926,6 @@
2194521926
"type": "Translator",
2194621927
"default": "\"(key, options) => {\\n const I18nElement = customElements.get('foxy-i18n') as typeof I18n | undefined;\\n\\n if (!I18nElement) return key;\\n\\n let keys: string[];\\n\\n if (this.simplifyNsLoading) {\\n const namespaces = this.ns.split(' ').filter(v => v.length > 0);\\n const path = [...namespaces.slice(1), key].join('.');\\n keys = namespaces[0] ? [`${namespaces[0]}:${path}`] : [path];\\n } else {\\n keys = this.ns\\n .split(' ')\\n .reverse()\\n .map(v => v.trim())\\n .filter(v => v.length > 0)\\n .reverse()\\n .map((v, i, a) => `${v}:${[...a.slice(i + 1), key].join('.')}`);\\n }\\n\\n keys.push(key);\\n\\n return I18nElement.i18next.t(keys, { lng: this.lang, ...options }).toString();\\n }\""
2194721928
},
21948-
{
21949-
"name": "templates",
21950-
"default": "{}"
21951-
},
21952-
{
21953-
"name": "mode",
21954-
"attribute": "mode",
21955-
"type": "string",
21956-
"default": "\"production\""
21957-
},
21958-
{
21959-
"name": "readonly",
21960-
"attribute": "readonly",
21961-
"type": "boolean",
21962-
"default": "false"
21963-
},
21964-
{
21965-
"name": "readonlyControls",
21966-
"attribute": "readonlycontrols",
21967-
"default": "\"False\""
21968-
},
21969-
{
21970-
"name": "disabled",
21971-
"attribute": "disabled",
21972-
"type": "boolean",
21973-
"default": "false"
21974-
},
21975-
{
21976-
"name": "disabledControls",
21977-
"attribute": "disabledcontrols",
21978-
"default": "\"False\""
21979-
},
21980-
{
21981-
"name": "hidden",
21982-
"attribute": "hidden",
21983-
"type": "boolean",
21984-
"default": "false"
21985-
},
21986-
{
21987-
"name": "hiddenControls",
21988-
"attribute": "hiddencontrols",
21989-
"default": "\"False\""
21990-
},
21991-
{
21992-
"name": "readonlySelector",
21993-
"type": "BooleanSelector"
21994-
},
21995-
{
21996-
"name": "disabledSelector",
21997-
"type": "BooleanSelector"
21998-
},
21999-
{
22000-
"name": "hiddenSelector",
22001-
"type": "BooleanSelector"
22002-
},
2200321929
{
2200421930
"name": "isBodyReady",
2200521931
"type": "boolean"

src/elements/public/DiscountBuilder/DiscountBuilder.test.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ describe('DiscountBuilder', () => {
205205
expect(price?.control).to.not.have.attribute('checked');
206206
expect(quantity?.control).to.have.attribute('checked');
207207

208-
const amount = labels.find(v => !!v.querySelector('[key="¤"]'));
209-
const percentage = labels.find(v => !!v.querySelector('[key="%"]'));
208+
const amount = labels.find(v => !!v.querySelector('[key="units_amount"]'));
209+
const percentage = labels.find(v => !!v.querySelector('[key="units_percentage"]'));
210210

211211
expect(amount?.control).to.not.have.attribute('checked');
212212
expect(percentage?.control).to.have.attribute('checked');
@@ -232,8 +232,8 @@ describe('DiscountBuilder', () => {
232232
expect(price?.control).to.not.have.attribute('checked');
233233
expect(quantity?.control).to.have.attribute('checked');
234234

235-
const amount = labels.find(v => !!v.querySelector('[key="¤"]'));
236-
const percentage = labels.find(v => !!v.querySelector('[key="%"]'));
235+
const amount = labels.find(v => !!v.querySelector('[key="units_amount"]'));
236+
const percentage = labels.find(v => !!v.querySelector('[key="units_percentage"]'));
237237

238238
expect(amount?.control).to.have.attribute('checked');
239239
expect(percentage?.control).to.not.have.attribute('checked');
@@ -259,8 +259,8 @@ describe('DiscountBuilder', () => {
259259
expect(price?.control).to.have.attribute('checked');
260260
expect(quantity?.control).to.not.have.attribute('checked');
261261

262-
const amount = labels.find(v => !!v.querySelector('[key="¤"]'));
263-
const percentage = labels.find(v => !!v.querySelector('[key="%"]'));
262+
const amount = labels.find(v => !!v.querySelector('[key="units_amount"]'));
263+
const percentage = labels.find(v => !!v.querySelector('[key="units_percentage"]'));
264264

265265
expect(amount?.control).to.not.have.attribute('checked');
266266
expect(percentage?.control).to.have.attribute('checked');
@@ -286,8 +286,8 @@ describe('DiscountBuilder', () => {
286286
expect(price?.control).to.have.attribute('checked');
287287
expect(quantity?.control).to.not.have.attribute('checked');
288288

289-
const amount = labels.find(v => !!v.querySelector('[key="¤"]'));
290-
const percentage = labels.find(v => !!v.querySelector('[key="%"]'));
289+
const amount = labels.find(v => !!v.querySelector('[key="units_amount"]'));
290+
const percentage = labels.find(v => !!v.querySelector('[key="units_percentage"]'));
291291

292292
expect(amount?.control).to.have.attribute('checked');
293293
expect(percentage?.control).to.not.have.attribute('checked');
@@ -337,10 +337,10 @@ describe('DiscountBuilder', () => {
337337
const quantity = labels.find(v => !!v.querySelector('[key="quantity"]'));
338338
const quantityControl = quantity?.control as HTMLInputElement;
339339

340-
const amount = labels.find(v => !!v.querySelector('[key="¤"]'));
340+
const amount = labels.find(v => !!v.querySelector('[key="units_amount"]'));
341341
const amountControl = amount?.control as HTMLInputElement;
342342

343-
const percentage = labels.find(v => !!v.querySelector('[key="%"]'));
343+
const percentage = labels.find(v => !!v.querySelector('[key="units_percentage"]'));
344344
const percentageControl = percentage?.control as HTMLInputElement;
345345

346346
priceControl.checked = true;

src/elements/public/DiscountBuilder/DiscountBuilder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ export class DiscountBuilder extends Base {
341341
342342
${this.__renderSwitch({
343343
value: params.units === 'percentage' ? 0 : 1,
344-
options: ['%', '¤'],
344+
options: ['units_percentage', 'units_amount'],
345345
onChange: i => params.onChange({ units: i ? 'amount' : 'percentage' }),
346346
})}
347347
</div>

0 commit comments

Comments
 (0)