This commit is contained in:
Arseny Sazhin (via WeWeb) 2025-06-26 16:33:06 +07:00
parent 859d718891
commit 3b0e717ef1
37 changed files with 97 additions and 67 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"cacheVersion":60,"page":{"id":"cf9f551f-e733-4934-a682-535575cb7c70","paths":{"en":"promo","default":"promo"},"cmsDataSetPath":null,"workflows":[]},"sections":{"4a2188f6-d98c-4150-9ba7-5918c72f3421":{"uid":"4a2188f6-d98c-4150-9ba7-5918c72f3421","linkId":"416695e7-e54e-4897-9f9a-befeb223f1b0","_state":{"style":{"default":{}}},"content":{"default":{"wwObjects":[],"_ww-layout_alignItems":"flex-start","_ww-layout_flexDirection":"column"}},"sectionBaseId":"99586bd3-2b15-4d6b-a025-6a50d07ca845","sectionTitle":"Section"}},"wwObjects":{},"collections":[],"variables":[],"workflows":[],"formulas":[],"libraryComponents":[]}
{"cacheVersion":63,"page":{"id":"cf9f551f-e733-4934-a682-535575cb7c70","paths":{"en":"promo","default":"promo"},"cmsDataSetPath":null,"workflows":[]},"sections":{"4a2188f6-d98c-4150-9ba7-5918c72f3421":{"uid":"4a2188f6-d98c-4150-9ba7-5918c72f3421","linkId":"416695e7-e54e-4897-9f9a-befeb223f1b0","_state":{"style":{"default":{}}},"content":{"default":{"wwObjects":[],"_ww-layout_alignItems":"flex-start","_ww-layout_flexDirection":"column"}},"sectionBaseId":"99586bd3-2b15-4d6b-a025-6a50d07ca845","sectionTitle":"Section"}},"wwObjects":{},"collections":[],"variables":[],"workflows":[],"formulas":[],"libraryComponents":[]}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
const version = 60;
const version = 63;
self.addEventListener('install', event => {
// eslint-disable-next-line no-console
console.log(`Service worker v${version} installed`);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -40,12 +40,6 @@ Features:
Events:
- focus: Triggered when button receives focus. No payload.
- blur: Triggered when button loses focus. No payload.
- mousedown: Triggered when mouse button is pressed on the button. No payload.
- mouseup: Triggered when mouse button is released on the button. No payload.
- mouseleave: Triggered when mouse leaves the button area. No payload.
- touchstart: Triggered when touch begins on the button (mobile). No payload.
- touchend: Triggered when touch ends on the button (mobile). No payload.
- touchcancel: Triggered when touch is cancelled (mobile). No payload.
- keydown: Triggered when a key is pressed while button has focus. No payload.
- keyup: Triggered when a key is released while button has focus. No payload.

View File

@ -10,16 +10,18 @@
v-bind="properties"
@focus="isReallyFocused = true"
@blur="onBlur($event)"
@mousedown="onActivate"
@mouseup="onDeactivate"
@mouseleave="onDeactivate"
@touchstart="onActivate"
@touchend="onDeactivate"
@touchcancel="onDeactivate"
@keydown.enter="onActivate"
@keydown.space="onActivate"
@keyup.enter="onDeactivate"
@keyup.space="onDeactivate"
@mousedown="onMouseActivate"
@mouseup="onMouseDeactivate"
@mouseleave="onMouseDeactivate"
@touchstart="onTouchActivate"
@touchend="onTouchDeactivate"
@touchcancel="onTouchDeactivate"
@keydown.enter="onKeyActivate"
@keydown.space="onKeyActivate"
@keyup.enter="onKeyDeactivate"
@keyup.space="onKeyDeactivate"
@keydown="onKeyDown"
@keyup="onKeyUp"
>
<wwElement v-if="content.hasLeftIcon && content.leftIcon" v-bind="content.leftIcon"></wwElement>
<wwText tag="span" :text="text"></wwText>
@ -161,13 +163,37 @@ export default {
this.isReallyActive = true;
// Emit the original event name
const eventName = event.type;
this.$emit('trigger-event', { name: eventName });
this.$emit('trigger-event', { name: eventName, event });
},
onDeactivate(event) {
this.isReallyActive = false;
// Emit the original event name
const eventName = event.type;
this.$emit('trigger-event', { name: eventName });
this.$emit('trigger-event', { name: eventName, event });
},
onTouchActivate() {
this.isReallyActive = true;
},
onTouchDeactivate() {
this.isReallyActive = false;
},
onMouseActivate() {
this.isReallyActive = true;
},
onMouseDeactivate() {
this.isReallyActive = false;
},
onKeyActivate() {
this.isReallyActive = true;
},
onKeyDeactivate() {
this.isReallyActive = false;
},
onKeyDown(event) {
this.$emit('trigger-event', { name: 'keydown', event });
},
onKeyUp(event) {
this.$emit('trigger-event', { name: 'keyup', event });
},
},
};

View File

@ -59,12 +59,6 @@ export default {
triggerEvents: [
{ name: 'focus', label: { en: 'On focus' }, event: null },
{ name: 'blur', label: { en: 'On blur' }, event: null },
{ name: 'mousedown', label: { en: 'On mouse down' }, event: null },
{ name: 'mouseup', label: { en: 'On mouse up' }, event: null },
{ name: 'mouseleave', label: { en: 'On mouse leave' }, event: null },
{ name: 'touchstart', label: { en: 'On touch start' }, event: null },
{ name: 'touchend', label: { en: 'On touch end' }, event: null },
{ name: 'touchcancel', label: { en: 'On touch cancel' }, event: null },
{ name: 'keydown', label: { en: 'On key down' }, event: null },
{ name: 'keyup', label: { en: 'On key up' }, event: null },
],

View File

@ -138,15 +138,30 @@ export default {
// Initialize currency display value from initial value
watch(
[() => props.content.type, () => props.content.value, variableValue],
([contentType, propsValue, variableValue]) => {
([contentType, propsValue, variableValue], [oldContentType, oldPropsValue, oldVariableValue]) => {
// Use props.content.value if it exists (binding case), otherwise use variableValue
const value = propsValue !== undefined && propsValue !== null ? propsValue : variableValue;
if (contentType === 'currency' && value !== undefined && value !== null && value !== '' && !isTyping) {
// Only auto-format if not currently typing
// For input field, use formatCurrency with zero padding and without symbol
const inputFormattedValue = formatCurrency(value, { padZeros: true, includeSymbol: false });
if (currencyDisplayValue.value !== inputFormattedValue) {
currencyDisplayValue.value = inputFormattedValue;
// Check if props.content.value (init value) has changed
const isInitValueChange = propsValue !== oldPropsValue && propsValue !== undefined && propsValue !== null;
if (contentType === 'currency' && (!isTyping || isInitValueChange)) {
if (value !== undefined && value !== null && value !== '') {
// Format when not typing OR when init value changes (override typing)
// For input field, use formatCurrency with zero padding and without symbol
const inputFormattedValue = formatCurrency(value, { padZeros: true, includeSymbol: false });
if (currencyDisplayValue.value !== inputFormattedValue) {
currencyDisplayValue.value = inputFormattedValue;
}
// Reset isTyping when init value changes
if (isInitValueChange) {
isTyping = false;
}
} else {
// Clear the display value when the actual value is empty/null/undefined
if (currencyDisplayValue.value !== '') {
currencyDisplayValue.value = '';
}
}
}
},
@ -351,7 +366,8 @@ export default {
const limitedCleanValue = integerPart + (decimalPart ? '.' + decimalPart : '');
// Extract numeric value from the limited clean value
const actualValue = parseFloat(limitedCleanValue) || 0;
// If the clean value is empty, keep it as empty string instead of defaulting to 0
const actualValue = limitedCleanValue === '' ? '' : (parseFloat(limitedCleanValue) || 0);
// Add thousands separators to integer part
if (integerPart && thousandsSep) {

View File

@ -31,9 +31,9 @@ import wwobject1be951afde7143e6ad1ee9b36de15529 from '@/components/elements/elem
import wwobject547a655e37cd49ff9c4fc6b917a0b680 from '@/components/elements/element-547a655e-37cd-49ff-9c4f-c6b917a0b680/ww-config.js';
import wwobject6d692ca26cdc4805aa0c211102f335d0 from '@/components/elements/element-6d692ca2-6cdc-4805-aa0c-211102f335d0/ww-config.js';
import wwobject1b1e21739b7842cca8eea6167caea340 from '@/components/elements/element-1b1e2173-9b78-42cc-a8ee-a6167caea340/ww-config.js';
import wwobject59dca300db7842e4a7a60cbf22d3cc82 from '@/components/elements/element-59dca300-db78-42e4-a7a6-0cbf22d3cc82/ww-config.js';
import wwobject6dcad2080a6743a2bd1d3b13ff5819cf from '@/components/elements/element-6dcad208-0a67-43a2-bd1d-3b13ff5819cf/ww-config.js';
import wwobjectdeb10a015eef4aa190171b51c2ad6fd0 from '@/components/elements/element-deb10a01-5eef-4aa1-9017-1b51c2ad6fd0/ww-config.js';
import wwobject59dca300db7842e4a7a60cbf22d3cc82 from '@/components/elements/element-59dca300-db78-42e4-a7a6-0cbf22d3cc82/ww-config.js';
import wwobject9ae1fce82e314bfda4d20450235bdfd5 from '@/components/elements/element-9ae1fce8-2e31-4bfd-a4d2-0450235bdfd5/ww-config.js';
/* wwFront:end */
@ -70,9 +70,9 @@ export const useComponentBasesStore = defineStore('componentBases', () => {
'wwobject-547a655e-37cd-49ff-9c4f-c6b917a0b680': getInheritedConfiguration({ ...wwobject547a655e37cd49ff9c4fc6b917a0b680, name: 'wwobject-547a655e-37cd-49ff-9c4f-c6b917a0b680' }),
'wwobject-6d692ca2-6cdc-4805-aa0c-211102f335d0': getInheritedConfiguration({ ...wwobject6d692ca26cdc4805aa0c211102f335d0, name: 'wwobject-6d692ca2-6cdc-4805-aa0c-211102f335d0' }),
'wwobject-1b1e2173-9b78-42cc-a8ee-a6167caea340': getInheritedConfiguration({ ...wwobject1b1e21739b7842cca8eea6167caea340, name: 'wwobject-1b1e2173-9b78-42cc-a8ee-a6167caea340' }),
'wwobject-59dca300-db78-42e4-a7a6-0cbf22d3cc82': getInheritedConfiguration({ ...wwobject59dca300db7842e4a7a60cbf22d3cc82, name: 'wwobject-59dca300-db78-42e4-a7a6-0cbf22d3cc82' }),
'wwobject-6dcad208-0a67-43a2-bd1d-3b13ff5819cf': getInheritedConfiguration({ ...wwobject6dcad2080a6743a2bd1d3b13ff5819cf, name: 'wwobject-6dcad208-0a67-43a2-bd1d-3b13ff5819cf' }),
'wwobject-deb10a01-5eef-4aa1-9017-1b51c2ad6fd0': getInheritedConfiguration({ ...wwobjectdeb10a015eef4aa190171b51c2ad6fd0, name: 'wwobject-deb10a01-5eef-4aa1-9017-1b51c2ad6fd0' }),
'wwobject-59dca300-db78-42e4-a7a6-0cbf22d3cc82': getInheritedConfiguration({ ...wwobject59dca300db7842e4a7a60cbf22d3cc82, name: 'wwobject-59dca300-db78-42e4-a7a6-0cbf22d3cc82' }),
'wwobject-9ae1fce8-2e31-4bfd-a4d2-0450235bdfd5': getInheritedConfiguration({ ...wwobject9ae1fce82e314bfda4d20450235bdfd5, name: 'wwobject-9ae1fce8-2e31-4bfd-a4d2-0450235bdfd5' })};
/* wwFront:end */

View File

@ -12,11 +12,11 @@
<link rel="icon" type="image/x-icon" href="favicon.ico?_wwcv={{cacheVersion}}" />
<link rel="manifest" href="manifest.json?_wwcv=60" />
<link rel="manifest" href="manifest.json?_wwcv=63" />
<meta name="theme-color" content="" />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap" rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'">
<link href="/fonts/Phosphor/font.css?_wwcv=60" rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'">
<link href="/fonts/Phosphor/font.css?_wwcv=63" rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'">
<link href="https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'">
<style>:root{ --ww-default-font-family: 'Raleway', sans-serif }</style>
<style>

File diff suppressed because one or more lines are too long