-
Notifications
You must be signed in to change notification settings - Fork 827
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR: Library: V2: Icons: Issues: move out from core (#9047)
- Loading branch information
1 parent
2d6af45
commit da31fe8
Showing
31 changed files
with
276 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"paths": { | ||
"survey-core": [ | ||
"../../build/survey-core" | ||
] | ||
}, | ||
"declaration": true, | ||
"declarationDir": "../../build/survey-core/icons/" | ||
}, | ||
"include": [ | ||
"../../packages/survey-core/src/iconsV1.ts", | ||
"../../packages/survey-core/src/iconsV2.ts", | ||
], | ||
"exclude": [], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
"use strict"; | ||
|
||
const webpackCommonConfigCreator = require("../webpack.common"); | ||
const { merge } = require("webpack-merge"); | ||
var FixStyleOnlyEntriesPlugin = require("webpack-fix-style-only-entries"); | ||
var path = require("path"); | ||
|
||
const config = { | ||
entry: { | ||
"iconsV1": path.resolve(__dirname, "../../packages/survey-core/src/iconsV1.ts"), | ||
"iconsV2": path.resolve(__dirname, "../../packages/survey-core/src/iconsV2.ts"), | ||
}, | ||
plugins: [new FixStyleOnlyEntriesPlugin()], | ||
externals: { | ||
"survey-core": { | ||
root: "Survey", | ||
commonjs2: "survey-core", | ||
commonjs: "survey-core", | ||
amd: "survey-core" | ||
} | ||
} | ||
}; | ||
|
||
module.exports = function (options) { | ||
options.platform = ""; | ||
options.libraryName = "SurveyIcons"; | ||
options.tsConfigFile = path.resolve(__dirname, "./tsconfig.icons.json") | ||
|
||
return merge(webpackCommonConfigCreator(options, { "name": "survey-icons" }, "survey.icons", "survey-core/icons"), config); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,23 @@ | ||
import { SvgRegistry } from "survey-core"; | ||
import { Component, ElementRef, OnInit, ViewChild } from "@angular/core"; | ||
import { Component, ElementRef, OnDestroy, OnInit, ViewChild } from "@angular/core"; | ||
@Component({ | ||
selector: "sv-svg-bundle", | ||
template: "<svg id='sv-icon-holder-global-container' #svgContainer></svg>", | ||
styles: [":host { display: none; }"] | ||
}) | ||
export class SvgBundleComponent implements OnInit { | ||
export class SvgBundleComponent implements OnInit, OnDestroy { | ||
@ViewChild("svgContainer", { static: true }) svgContainer!: ElementRef<SVGElement>; | ||
private onIconsChanged = () => { | ||
if (!!this.svgContainer?.nativeElement) { | ||
this.svgContainer.nativeElement.innerHTML = SvgRegistry.iconsRenderedHtml(); | ||
} | ||
} | ||
ngOnInit(): void { | ||
this.svgContainer.nativeElement.innerHTML = SvgRegistry.iconsRenderedHtml(); | ||
this.onIconsChanged(); | ||
SvgRegistry.onIconsChanged.add(this.onIconsChanged); | ||
} | ||
ngOnDestroy(): void { | ||
SvgRegistry.onIconsChanged.remove(this.onIconsChanged); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const path = (require as any).context("./images-v1/", true, /\.svg$/); | ||
|
||
const icons: { [index: string]: string } = {}; | ||
path.keys().forEach((key: string) => { | ||
icons[key.substring(2, key.length - 4).toLowerCase()] = path(key); | ||
}); | ||
|
||
export { icons }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const path = (require as any).context("./images-v2/", true, /\.svg$/); | ||
|
||
const icons: { [index: string]: string } = {}; | ||
path.keys().forEach((key: string) => { | ||
icons[key.substring(2, key.length - 4).toLowerCase()] = path(key); | ||
}); | ||
|
||
export { icons }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.