Skip to content

Commit

Permalink
Update 20240521 (#330)
Browse files Browse the repository at this point in the history
* CSS gen adjustments

* adjusted package log

* Fix issue with focustrap os filegen

* a few date addition leading to custom NSW Date input

* formatting

* NSW configurable omni hide in theme

* NSW scss path change

* UK showcase scss load path

* UkGov scss load path

* FrGov scss load path

* Vic2 showcase adjustments

* NSW scss load path

* NSW configurable omnistudio hide

* VIC combobox method typo

* New package version and omnistudio release

* Varied node package lock

* coping with changes in Exp Cloud cust service template
  • Loading branch information
eschweitzer78 authored May 21, 2024
1 parent 377d622 commit 1e7c056
Show file tree
Hide file tree
Showing 112 changed files with 440 additions and 301 deletions.
13 changes: 6 additions & 7 deletions cssgen.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const fileRegEx = /!/;
function genFile(filename) {
return sass.compile(filename, {
style: "compressed",
loadPaths: ["./", "node_modules/@gouvfr/dsfr", "node_modules"]
loadPaths: ["./", "node_modules", "node_modules/@gouvfr/dsfr"]
});
}

Expand All @@ -25,7 +25,7 @@ async function main() {
console.log(`handling ${p}`);

fs.readFile(p)
.then((data) => {
.then(async (data) => {
let dot = path.dirname(p);
let config = JSON.parse(data);

Expand All @@ -37,11 +37,10 @@ async function main() {
let file = hasStar ? directory.slice(0, -1) : directory; // scss and css file will be name just like their containing folder
let fileInDirectory = directory.indexOf("/") >= 0;

let content = genFile(
fileInDirectory
? `${dot}/${file}.scss`
: `${dot}/${directory}/${file}.scss`
).css;
const targetDir = fileInDirectory ? dot : dot + "/" + directory;
const targetFile = `${targetDir}/${file}.scss`;

let content = genFile(targetFile).css;

/* go through configured content replacements */

Expand Down
15 changes: 12 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions sfGpsDs/main/default/lwc/.osfilegen.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
},
"sfGpsDsFocusTrap": {
"target": "!Os",
"!.html": { "target": "!Os.html" },
"!.js": {
"target": "!Os.js",
"sfGpsDsHelpers": "sfGpsDsHelpersOs"
Expand Down
37 changes: 31 additions & 6 deletions sfGpsDs/main/default/lwc/sfGpsDsHelpers/datetimeutil_v6.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
const numericKeys = [1, 4, 5, 6, 7, 10, 11];
export const ISO8601_PATTERN =
/^(\d{4}|[+-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+-])(\d{2})(?::(\d{2}))?)?)?$/;

export function isDate(value) {
return (
value instanceof Date ||
((typeof value === "undefined" ? "undefined" : typeof value) === "object" &&
Object.prototype.toString.call(value) === "[object Date]")
);
}

export function isValidDate(obj) {
return isDate(obj) && !isNaN(obj.getTime());
}

export function parseIso8601(date) {
/*
Expand All @@ -20,12 +34,7 @@ export function parseIso8601(date) {
// before falling back to any implementation-specific date parsing, so that’s what we do, even if native
// implementations could be faster
// 1 YYYY 2 MM 3 DD 4 HH 5 mm 6 ss 7 msec 8 Z 9 ± 10 tzHH 11 tzmm
if (
(struct =
/^(\d{4}|[+-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+-])(\d{2})(?::(\d{2}))?)?)?$/.exec(
date
))
) {
if ((struct = ISO8601_PATTERN.exec(date))) {
// avoid NaN timestamps caused by “undefined” values being passed to Date.UTC
for (let i = 0, k; (k = numericKeys[i]); ++i) {
struct[k] = +struct[k] || 0;
Expand Down Expand Up @@ -76,6 +85,7 @@ const MONTH_NAMES_LONG = [
"November",
"December"
];

const MONTH_NAMES_SHORT = [
"Jan",
"Feb",
Expand All @@ -90,6 +100,7 @@ const MONTH_NAMES_SHORT = [
"Nov",
"Dec"
];

const WEEKDAY_NAMES = [
"Sunday",
"Monday",
Expand Down Expand Up @@ -166,6 +177,20 @@ const fdrOptions = {
}
};

export function getMonthNames(userLocale = "en-AU", format = "long") {
let date = new Date();
let months = [];

date.setDate(1);

for (let month = 0; month < 12; month++) {
date.setMonth(month);
months.push(date.toLocaleDateString(userLocale, { month: format }));
}

return months;
}

export function formatDateRange(
dateStart,
dateEnd,
Expand Down
4 changes: 4 additions & 0 deletions sfGpsDs/main/default/lwc/sfGpsDsHelpers/sfGpsDsHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@
export { uniqueId, isIPadPro, isMacPlatform } from "./utilities_v6";

export {
ISO8601_PATTERN,
isDate,
isValidDate,
parseIso8601,
formatDate,
formatDateRange,
getMonthNames,
getUserLocale,
getUserLocales
} from "./datetimeutil_v6";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ let SfGpsDsOmniInputMixin = (Base) =>
const hcv = this.sfGpsDsHasCustomValidation();
const srv = super.validity;
const rv = {
/* spread operator isn't working */ badInput: srv.badInput,
/* spread operator isn't working */
badInput: srv.badInput,
customError: hcv || srv.customError,
patternMismatch: srv.patternMismatch,
rangeOverflow: srv.rangeOverflow,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@
access="global"
description="NSW DS Theme Layout"
>
<ltng:require
styles="{! join(',', $Resource.sfGpsDsAuNsw + '/sfGpsDsAuNsw-min.css', $Resource.sfGpsDsAuNsw + '/byo_aura-min.css')}"
/>
<aura:if isTrue="{! v.hideOmniSteps }">
<ltng:require
styles="{! join(',', $Resource.sfGpsDsAuNsw + '/sfGpsDsAuNsw-min.css', $Resource.sfGpsDsAuNsw + '/byo_aura-min.css')}"
/>
<aura:set attribute="else">
<ltng:require
styles="{! join(',', $Resource.sfGpsDsAuNsw + '/sfGpsDsAuNsw-min.css', $Resource.sfGpsDsAuNsw + '/byo_aura-min-show-omni.css')}"
/>
</aura:set>
</aura:if>

<aura:attribute name="masthead" type="Aura.Component[]" required="false" />
<aura:attribute name="header" type="Aura.Component[]" required="false" />
Expand All @@ -17,6 +24,12 @@
required="false"
default="false"
/>
<aura:attribute
name="hideOmniSteps"
type="Boolean"
required="false"
default="true"
/>
<aura:attribute name="navId" type="String" required="false" default="nav" />
<aura:attribute
name="contentId"
Expand All @@ -31,26 +44,28 @@
default="false"
/>

<div class="{! v.noWidgetMargin ? 'sfgpsds-widget--no-margin' : '' }">
<div
class="{! 'sfgpsds-nsw' + (v.noWidgetMargin ? ' sfgpsds-widget--no-margin' : '') }"
>
<div class="sfgpsds-masthead-and-header">
{!v.masthead}

<div id="{!v.navId}" class="sfgpsds-header">{!v.header}</div>
<div id="{! v.navId }" class="sfgpsds-header">{! v.header }</div>
</div>

<div
id="{!v.contentId}"
id="{! v.contentId }"
role="main"
aria-label="Content"
class="sfgpsds-content"
>
{!v.body}
{! v.body }
</div>

<aura:if isTrue="{! v.backToTopShow }">
<c:sfGpsDsAuNswBackToTop />
</aura:if>

<footer class="sfgpsds-footer" aria-label="Footer">{!v.footer}</footer>
<footer class="sfgpsds-footer" aria-label="Footer">{! v.footer }</footer>
</div>
</aura:component>
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<design:component label="NSW Design System Theme Layout">
<design:attribute name="noWidgetMargin" label="No widget margin" description="Removes the standard widget margin.">
</design:attribute>
<design:attribute name="hideOmniSteps" label="Hide OmniStudio steps" description="Hides the original OmniStudio step features when you use overrides.">
</design:attribute>
<design:attribute name="navId" label="navId" description="Id to set on nav region.">
</design:attribute>
<design:attribute name="contentId" label="contentId" description="Id to set on content region.">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@import "node_modules/nsw-design-system/src/global/scss/settings/settings";
@import "node_modules/nsw-design-system/src/global/scss/base/functions";
@import "node_modules/nsw-design-system/src/global/scss/base/mixins";
@import "nsw-design-system/src/global/scss/settings/settings";
@import "nsw-design-system/src/global/scss/base/functions";
@import "nsw-design-system/src/global/scss/base/mixins";

/* TODO: separate variables from classes in iconography */
/*@import "node_modules/nsw-design-system/src/core/iconography/icon";*/
/*@import "nsw-design-system/src/core/iconography/icon";*/
$nsw-icon-sizes: (
20: 20px,
24: 24px,
Expand All @@ -23,7 +23,7 @@ $nsw-icon-colors: (
$nsw-icon-angles: (90, 180, 270);

.THIS {
@import "node_modules/nsw-design-system/src/components/header/header";
@import "nsw-design-system/src/components/header/header";
@import "./fixes";
@import "./profile";
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import "node_modules/nsw-design-system/src/global/scss/settings/settings";
@import "node_modules/nsw-design-system/src/global/scss/base/functions";
@import "node_modules/nsw-design-system/src/global/scss/base/mixins";
@import "nsw-design-system/src/global/scss/settings/settings";
@import "nsw-design-system/src/global/scss/base/functions";
@import "nsw-design-system/src/global/scss/base/mixins";

@import "../../scss/iconography-icon-vars";

@import "node_modules/nsw-design-system/src/components/accordion/accordion";
@import "nsw-design-system/src/components/accordion/accordion";
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import "node_modules/nsw-design-system/src/global/scss/settings/settings";
@import "node_modules/nsw-design-system/src/global/scss/base/functions";
@import "node_modules/nsw-design-system/src/global/scss/base/mixins";
@import "nsw-design-system/src/global/scss/settings/settings";
@import "nsw-design-system/src/global/scss/base/functions";
@import "nsw-design-system/src/global/scss/base/mixins";

@import "../../scss/iconography-icon-vars";

@import "node_modules/nsw-design-system/src/components/in-page-alert/in-page-alert";
@import "nsw-design-system/src/components/in-page-alert/in-page-alert";
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import "node_modules/nsw-design-system/src/global/scss/settings/settings";
@import "node_modules/nsw-design-system/src/global/scss/base/functions";
@import "node_modules/nsw-design-system/src/global/scss/base/mixins";
@import "nsw-design-system/src/global/scss/settings/settings";
@import "nsw-design-system/src/global/scss/base/functions";
@import "nsw-design-system/src/global/scss/base/mixins";

@import "../../scss/iconography-icon-vars";

@import "node_modules/nsw-design-system/src/components/back-to-top/back-to-top";
@import "nsw-design-system/src/components/back-to-top/back-to-top";
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import "node_modules/nsw-design-system/src/global/scss/settings/settings";
@import "node_modules/nsw-design-system/src/global/scss/base/functions";
@import "node_modules/nsw-design-system/src/global/scss/base/mixins";
@import "nsw-design-system/src/global/scss/settings/settings";
@import "nsw-design-system/src/global/scss/base/functions";
@import "nsw-design-system/src/global/scss/base/mixins";

@import "../../scss/iconography-icon-vars";

@import "node_modules/nsw-design-system/src/components/breadcrumbs/breadcrumbs";
@import "nsw-design-system/src/components/breadcrumbs/breadcrumbs";
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@import "node_modules/nsw-design-system/src/global/scss/settings/settings";
@import "node_modules/nsw-design-system/src/global/scss/base/functions";
@import "node_modules/nsw-design-system/src/global/scss/base/mixins";
@import "nsw-design-system/src/global/scss/settings/settings";
@import "nsw-design-system/src/global/scss/base/functions";
@import "nsw-design-system/src/global/scss/base/mixins";

@import "../../scss/iconography-icon-vars";

@import "node_modules/nsw-design-system/src/components/button/button";
@import "nsw-design-system/src/components/button/button";
@import "./fixes";
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import "node_modules/nsw-design-system/src/global/scss/settings/settings";
@import "node_modules/nsw-design-system/src/global/scss/base/functions";
@import "node_modules/nsw-design-system/src/global/scss/base/mixins";
@import "nsw-design-system/src/global/scss/settings/settings";
@import "nsw-design-system/src/global/scss/base/functions";
@import "nsw-design-system/src/global/scss/base/mixins";

@import "node_modules/nsw-design-system/src/components/callout/callout";
@import "nsw-design-system/src/components/callout/callout";
8 changes: 4 additions & 4 deletions sfGpsDsAuNsw/main/default/lwc/sfGpsDsAuNswCard/card.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@import "node_modules/nsw-design-system/src/global/scss/settings/settings";
@import "node_modules/nsw-design-system/src/global/scss/base/functions";
@import "node_modules/nsw-design-system/src/global/scss/base/mixins";
@import "nsw-design-system/src/global/scss/settings/settings";
@import "nsw-design-system/src/global/scss/base/functions";
@import "nsw-design-system/src/global/scss/base/mixins";

@import "../../scss/iconography-icon-vars";

@import "node_modules/nsw-design-system/src/components/card/card";
@import "nsw-design-system/src/components/card/card";
@import "./fixes";
8 changes: 4 additions & 4 deletions sfGpsDsAuNsw/main/default/lwc/sfGpsDsAuNswCardV2/card.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@import "node_modules/nsw-design-system/src/global/scss/settings/settings";
@import "node_modules/nsw-design-system/src/global/scss/base/functions";
@import "node_modules/nsw-design-system/src/global/scss/base/mixins";
@import "nsw-design-system/src/global/scss/settings/settings";
@import "nsw-design-system/src/global/scss/base/functions";
@import "nsw-design-system/src/global/scss/base/mixins";

@import "../../scss/iconography-icon-vars";

@import "node_modules/nsw-design-system/src/components/card/card";
@import "nsw-design-system/src/components/card/card";
@import "./fixes";
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import "node_modules/nsw-design-system/src/global/scss/settings/settings";
@import "node_modules/nsw-design-system/src/global/scss/base/functions";
@import "node_modules/nsw-design-system/src/global/scss/base/mixins";
@import "nsw-design-system/src/global/scss/settings/settings";
@import "nsw-design-system/src/global/scss/base/functions";
@import "nsw-design-system/src/global/scss/base/mixins";

@import "node_modules/nsw-design-system/src/components/content-block/content-block";
@import "nsw-design-system/src/components/content-block/content-block";
@import "./fixes";
2 changes: 1 addition & 1 deletion sfGpsDsAuNsw/main/default/lwc/sfGpsDsAuNswCore/core.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@import "./global.scss";
@import "node_modules/nsw-design-system/src/core/all";
@import "nsw-design-system/src/core/all";
@import "./fixes"
Loading

0 comments on commit 1e7c056

Please sign in to comment.