terrier-engine 4.0.14 → 4.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fragments.ts +9 -22
- package/glyps.ts +11 -0
- package/package.json +7 -3
- package/schema.ts +67 -0
- package/theme.ts +3 -3
- package/toasts.ts +1 -1
package/fragments.ts
CHANGED
|
@@ -170,7 +170,7 @@ class LabeledValueFragment<TT extends ThemeType> extends ContentFragment<TT> {
|
|
|
170
170
|
|
|
171
171
|
private _value?: string
|
|
172
172
|
private _valueIcon?: TT['icons']
|
|
173
|
-
private _valueIconColor?: TT['colors']
|
|
173
|
+
private _valueIconColor?: TT['colors'] | null
|
|
174
174
|
private _valueClass?: string[]
|
|
175
175
|
|
|
176
176
|
private _href?: string
|
|
@@ -180,7 +180,7 @@ class LabeledValueFragment<TT extends ThemeType> extends ContentFragment<TT> {
|
|
|
180
180
|
|
|
181
181
|
private _tooltip?: string
|
|
182
182
|
|
|
183
|
-
value(value: string, icon?: TT['icons'], iconColor?: TT['colors']) {
|
|
183
|
+
value(value: string, icon?: TT['icons'], iconColor?: TT['colors'] | null) {
|
|
184
184
|
this._value = value
|
|
185
185
|
this._valueIcon = icon
|
|
186
186
|
this._valueIconColor = iconColor
|
|
@@ -236,7 +236,8 @@ class LabeledValueFragment<TT extends ThemeType> extends ContentFragment<TT> {
|
|
|
236
236
|
if (this._tooltip) valueBox.dataAttr("tooltip", this._tooltip)
|
|
237
237
|
if (this._value) {
|
|
238
238
|
if (this._valueIcon) {
|
|
239
|
-
|
|
239
|
+
const color = (this._valueIconColor === undefined) ? 'link' : this._valueIconColor
|
|
240
|
+
this.theme.renderIcon(valueBox, this._valueIcon, color)
|
|
240
241
|
}
|
|
241
242
|
valueBox.div('.value-text', {text: this._value})
|
|
242
243
|
}
|
|
@@ -331,41 +332,27 @@ function labeledList<TT extends ThemeType>(theme: Theme<TT>) {
|
|
|
331
332
|
|
|
332
333
|
/**
|
|
333
334
|
* Create a new button in the parent.
|
|
334
|
-
* @param parent
|
|
335
|
-
* @param title
|
|
336
|
-
* @param icon
|
|
337
335
|
*/
|
|
338
|
-
function button<TT extends ThemeType>(parent: PartTag, theme: Theme<TT>, title
|
|
336
|
+
function button<TT extends ThemeType>(parent: PartTag, theme: Theme<TT>, title?: string, icon?: TT['icons'], iconColor: TT['colors'] | null = null) {
|
|
339
337
|
return parent.a('.tt-button', button => {
|
|
340
|
-
if (icon)
|
|
341
|
-
|
|
342
|
-
}
|
|
343
|
-
button.div('.title', {text: title})
|
|
338
|
+
if (icon) theme.renderIcon(button, icon, iconColor)
|
|
339
|
+
if (title?.length) button.div('.title', {text: title})
|
|
344
340
|
})
|
|
345
341
|
}
|
|
346
342
|
|
|
347
343
|
/**
|
|
348
344
|
* Create a new simple value display in the parent.
|
|
349
345
|
* This is just some text with an optional icon that doesn't have a separate label.
|
|
350
|
-
* @param parent
|
|
351
|
-
* @param title
|
|
352
|
-
* @param icon
|
|
353
|
-
* @param iconColor
|
|
354
346
|
*/
|
|
355
|
-
function simpleValue<TT extends ThemeType>(parent: PartTag, theme: Theme<TT>, title: string, icon?: TT['icons'], iconColor
|
|
347
|
+
function simpleValue<TT extends ThemeType>(parent: PartTag, theme: Theme<TT>, title: string, icon?: TT['icons'], iconColor: TT['colors'] | null = 'link') {
|
|
356
348
|
return parent.div('.tt-simple-value.shrink', button => {
|
|
357
|
-
if (icon)
|
|
358
|
-
theme.renderIcon(button, icon, iconColor || 'link')
|
|
359
|
-
}
|
|
349
|
+
if (icon) theme.renderIcon(button, icon, iconColor)
|
|
360
350
|
button.div('.title', {text: title})
|
|
361
351
|
})
|
|
362
352
|
}
|
|
363
353
|
|
|
364
354
|
/**
|
|
365
355
|
* Helper to create a heading with an optional icon.
|
|
366
|
-
* @param parent
|
|
367
|
-
* @param title
|
|
368
|
-
* @param icon
|
|
369
356
|
*/
|
|
370
357
|
function simpleHeading<TT extends ThemeType>(parent: PartTag, theme: Theme<TT>, title: string, icon?: TT['icons']) {
|
|
371
358
|
return parent.h3('.shrink', heading => {
|
package/glyps.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file was automatically generated by glyps:compile on 05/15/23 7:41 PM, DO NOT MANUALLY EDIT!
|
|
2
|
+
|
|
3
|
+
const names = ['glyp-abacus', 'glyp-account', 'glyp-accounts_payable', 'glyp-accounts_receivable', 'glyp-action_log', 'glyp-activate', 'glyp-active', 'glyp-activity_high', 'glyp-activity_low', 'glyp-activity_medium', 'glyp-activity_none', 'glyp-address1', 'glyp-adjustment', 'glyp-admin', 'glyp-administration', 'glyp-air_freshener', 'glyp-alert', 'glyp-align_horizontal', 'glyp-align_vertical', 'glyp-anchor', 'glyp-announcement', 'glyp-app_update', 'glyp-append_selection', 'glyp-appointment', 'glyp-appointment_setup', 'glyp-archive', 'glyp-arrow_down', 'glyp-arrow_left', 'glyp-arrow_right', 'glyp-arrow_transfer', 'glyp-arrow_up', 'glyp-ascending', 'glyp-attachment', 'glyp-audit_analyzer', 'glyp-autopay', 'glyp-availability', 'glyp-background_batch', 'glyp-background_job', 'glyp-bait_for_demolition', 'glyp-bar_chart', 'glyp-barcode', 'glyp-bat_exclusion', 'glyp-bed_bug_fumigation', 'glyp-begin_service', 'glyp-belongs_to', 'glyp-billing', 'glyp-billing_office', 'glyp-billing_terms', 'glyp-billto', 'glyp-bioremediation', 'glyp-bird_exclusion', 'glyp-black_light', 'glyp-branch', 'glyp-branch_bats', 'glyp-branch_birds', 'glyp-branch_general', 'glyp-branch_irrigation', 'glyp-branch_landscape', 'glyp-branch_multi_housing', 'glyp-branch_office', 'glyp-branch_orders', 'glyp-branch_residential', 'glyp-branch_sales', 'glyp-branch_termites', 'glyp-branch_weeds', 'glyp-branch_wildlife', 'glyp-build', 'glyp-calculate', 'glyp-calendar', 'glyp-calendar_branch', 'glyp-calendar_map', 'glyp-calendar_rolling', 'glyp-calendar_share', 'glyp-calendar_snap', 'glyp-california', 'glyp-call', 'glyp-callback', 'glyp-camera', 'glyp-cancellation', 'glyp-cancelled', 'glyp-card_american_express', 'glyp-card_discover', 'glyp-card_mastercard', 'glyp-card_visa', 'glyp-catalog', 'glyp-caught', 'glyp-cert', 'glyp-check_all', 'glyp-check_in', 'glyp-check_in_service', 'glyp-checked', 'glyp-checked_empty', 'glyp-checkmark', 'glyp-checkmark_filled', 'glyp-checkout', 'glyp-chemical', 'glyp-chemical_authorization', 'glyp-chemical_backpack_sprayer', 'glyp-chemical_biological_controls', 'glyp-chemical_disinfectant', 'glyp-chemical_fertilizer', 'glyp-chemical_flying_insect_bait', 'glyp-chemical_fumigants', 'glyp-chemical_insect_aerosol', 'glyp-chemical_insect_bait', 'glyp-chemical_insect_dust', 'glyp-chemical_insect_granules', 'glyp-chemical_insect_spray', 'glyp-chemical_label', 'glyp-chemical_mole_bait', 'glyp-chemical_pest_bird_control', 'glyp-chemical_pheromone_products', 'glyp-chemical_power_sprayer', 'glyp-chemical_rodenticide_block', 'glyp-chemical_rodenticide_non_block', 'glyp-chemical_sds', 'glyp-chemical_tree_products', 'glyp-chemical_weed_control', 'glyp-chemical_wildlife_repellents', 'glyp-chemical_wildlife_toxicants', 'glyp-chevron_down', 'glyp-chevron_left', 'glyp-chevron_right', 'glyp-chevron_up', 'glyp-city', 'glyp-click', 'glyp-client_actions', 'glyp-client_pest_sightings', 'glyp-client_required', 'glyp-close', 'glyp-cloud', 'glyp-clypboard', 'glyp-clypedia', 'glyp-clypmart', 'glyp-code', 'glyp-code_details', 'glyp-collections', 'glyp-columns', 'glyp-comment', 'glyp-comment_filled', 'glyp-commission_origin', 'glyp-commissions', 'glyp-company_setup', 'glyp-compass', 'glyp-complete', 'glyp-complete_certificate', 'glyp-complete_enrollment', 'glyp-condition_appliance_machinery', 'glyp-condition_customer', 'glyp-condition_device', 'glyp-condition_door_window', 'glyp-condition_dumpster', 'glyp-condition_entry_point', 'glyp-condition_evidence', 'glyp-condition_exclusion', 'glyp-condition_exterior', 'glyp-condition_interior', 'glyp-condition_plumbing', 'glyp-condition_prep_storage', 'glyp-condition_rodent_evidence', 'glyp-condition_rodent_exclusion', 'glyp-condition_roof_ceiling', 'glyp-condition_structure', 'glyp-condition_supplies', 'glyp-condition_termites', 'glyp-condition_ventilation', 'glyp-condition_wall_floor', 'glyp-condition_wildlife', 'glyp-conditions', 'glyp-consolidate', 'glyp-construction', 'glyp-contract', 'glyp-contract_cancellation', 'glyp-contract_overview', 'glyp-conversation', 'glyp-copesan', 'glyp-copy', 'glyp-credit_memo', 'glyp-credit_non_revenue', 'glyp-credit_production', 'glyp-credit_prospect', 'glyp-credit_sales_bonus', 'glyp-crew', 'glyp-cumulative', 'glyp-cursor', 'glyp-custom_form', 'glyp-customer', 'glyp-customer_service', 'glyp-dashboard', 'glyp-database', 'glyp-dead_animal_removal', 'glyp-default', 'glyp-delete', 'glyp-demo_mode', 'glyp-descending', 'glyp-design', 'glyp-desktop', 'glyp-detail_report', 'glyp-developer', 'glyp-device', 'glyp-device_sync', 'glyp-differential', 'glyp-disable', 'glyp-disabled_filled', 'glyp-distribute_horizontal', 'glyp-distribute_vertical', 'glyp-division', 'glyp-document', 'glyp-documentation', 'glyp-documents', 'glyp-download', 'glyp-driving', 'glyp-duplicate', 'glyp-duplicate_location', 'glyp-duration', 'glyp-edit', 'glyp-email', 'glyp-employment', 'glyp-entertainment_public_venues', 'glyp-equipment_bear_trap', 'glyp-equipment_flying_insect_bait_station', 'glyp-equipment_flying_insect_light_trap', 'glyp-equipment_insect_monitor', 'glyp-equipment_lethal_animal_trap', 'glyp-equipment_live_animal_trap', 'glyp-equipment_live_rodent_trap', 'glyp-equipment_maintenance', 'glyp-equipment_map_viewer', 'glyp-equipment_maps', 'glyp-equipment_mosquito_trap', 'glyp-equipment_other', 'glyp-equipment_pheromone_trap', 'glyp-equipment_pick_up', 'glyp-equipment_rodent_bait', 'glyp-equipment_rodent_trap', 'glyp-equipment_termite_bait_station', 'glyp-equipment_termite_monitor', 'glyp-exclusion', 'glyp-expand', 'glyp-expiring', 'glyp-exterior', 'glyp-extras', 'glyp-facebook', 'glyp-farm', 'glyp-farm_grain_seed', 'glyp-fast_and_frequent', 'glyp-favorite', 'glyp-feedback', 'glyp-field_guide', 'glyp-field_training', 'glyp-file_blank', 'glyp-file_html', 'glyp-file_image', 'glyp-file_pdf', 'glyp-file_printable', 'glyp-file_spreadsheet', 'glyp-file_text', 'glyp-filter', 'glyp-finance', 'glyp-finding', 'glyp-folder', 'glyp-followup', 'glyp-food_bev_pharma', 'glyp-formula', 'glyp-fuel', 'glyp-fumigation', 'glyp-gain_loss', 'glyp-generate_invoices', 'glyp-generate_orders', 'glyp-geo', 'glyp-geo_heat_map', 'glyp-google', 'glyp-google_calendar', 'glyp-government', 'glyp-grain_seed', 'glyp-grid', 'glyp-grouping_combine', 'glyp-grouping_separate', 'glyp-has_many', 'glyp-health_care', 'glyp-heat_map', 'glyp-heat_treatment', 'glyp-help', 'glyp-hidden', 'glyp-honeybee_removal', 'glyp-housing', 'glyp-in_progress', 'glyp-incomplete_certificate', 'glyp-industrial', 'glyp-info', 'glyp-information_technology', 'glyp-inspect_map', 'glyp-inspections', 'glyp-insulation', 'glyp-interior', 'glyp-invoice', 'glyp-invoice_review', 'glyp-irrigation_install', 'glyp-irrigation_maintenance', 'glyp-items', 'glyp-job', 'glyp-justice', 'glyp-k9_inspection', 'glyp-key', 'glyp-label_bottom', 'glyp-label_left', 'glyp-label_right', 'glyp-label_top', 'glyp-labor', 'glyp-landscape', 'glyp-landscape_maintenance', 'glyp-laptop', 'glyp-lead', 'glyp-lead_listing', 'glyp-lead_source', 'glyp-leads_report', 'glyp-learning_hub', 'glyp-ledger', 'glyp-legal', 'glyp-license', 'glyp-lifetime', 'glyp-line_cap_arrow', 'glyp-line_cap_bar', 'glyp-line_cap_circle', 'glyp-line_cap_none', 'glyp-line_caps', 'glyp-line_style', 'glyp-link', 'glyp-location', 'glyp-location_charge', 'glyp-location_credit', 'glyp-location_kind', 'glyp-location_message', 'glyp-location_origin', 'glyp-location_tags', 'glyp-locations', 'glyp-locked', 'glyp-lodging', 'glyp-log_in', 'glyp-log_out', 'glyp-log_report', 'glyp-logbook', 'glyp-logbook_documents', 'glyp-lot_number', 'glyp-manager', 'glyp-map', 'glyp-markdown', 'glyp-market', 'glyp-materials', 'glyp-mattress_encasement', 'glyp-merge', 'glyp-message_billing', 'glyp-message_collections', 'glyp-message_complaint', 'glyp-message_misc', 'glyp-message_technician', 'glyp-messages', 'glyp-misc', 'glyp-miscellaneous', 'glyp-move_order', 'glyp-mowing', 'glyp-multi_housing', 'glyp-mute', 'glyp-navicon', 'glyp-new_location', 'glyp-no_charge', 'glyp-no_service', 'glyp-note', 'glyp-note_access', 'glyp-note_billing', 'glyp-note_collection', 'glyp-note_complaint', 'glyp-note_directions', 'glyp-note_focused', 'glyp-note_office', 'glyp-note_preservice', 'glyp-note_sales', 'glyp-note_service', 'glyp-notification', 'glyp-number', 'glyp-office', 'glyp-office_government', 'glyp-office_training', 'glyp-on_demand', 'glyp-on_demand_order', 'glyp-open', 'glyp-open_invoice', 'glyp-operations', 'glyp-options', 'glyp-order_actions', 'glyp-order_approved', 'glyp-order_batch', 'glyp-order_editor', 'glyp-order_pending', 'glyp-order_series', 'glyp-order_unapproved', 'glyp-org_structure', 'glyp-org_unit', 'glyp-org_unit_settings', 'glyp-origin', 'glyp-origin_client', 'glyp-origin_tech', 'glyp-outlook', 'glyp-overlap', 'glyp-password', 'glyp-past_due', 'glyp-paused', 'glyp-pay_brackets', 'glyp-payment', 'glyp-payment_ach', 'glyp-payment_application_apply', 'glyp-payment_application_correction', 'glyp-payment_application_initial', 'glyp-payment_application_refund', 'glyp-payment_application_transfer', 'glyp-payment_application_unapply', 'glyp-payment_application_unapply_all', 'glyp-payment_applications', 'glyp-payment_batch', 'glyp-payment_cash', 'glyp-payment_check', 'glyp-payment_coupon', 'glyp-payment_credit', 'glyp-payment_discount', 'glyp-payment_eft', 'glyp-payment_finance_charge', 'glyp-payments', 'glyp-payroll', 'glyp-pdf', 'glyp-pending', 'glyp-periodic', 'glyp-periodic_assessment', 'glyp-permission', 'glyp-pest', 'glyp-pest_ants', 'glyp-pest_bats', 'glyp-pest_bed_bugs', 'glyp-pest_birds', 'glyp-pest_crawling_insects', 'glyp-pest_dermestids', 'glyp-pest_fall_invaders', 'glyp-pest_flying_insects', 'glyp-pest_moles', 'glyp-pest_mosquitoes', 'glyp-pest_nuisance_animals', 'glyp-pest_ornamental', 'glyp-pest_ornamental_diseases', 'glyp-pest_roaches', 'glyp-pest_rodents', 'glyp-pest_scorpions', 'glyp-pest_snakes', 'glyp-pest_spiders', 'glyp-pest_stinging_insects', 'glyp-pest_stored_product_pests', 'glyp-pest_ticks_and_fleas', 'glyp-pest_viruses_and_bacteria', 'glyp-pest_weeds', 'glyp-pest_wood_destroyers', 'glyp-phone', 'glyp-pick_date', 'glyp-pick_list', 'glyp-platform_android', 'glyp-platform_ios', 'glyp-platform_macos', 'glyp-platform_windows', 'glyp-play', 'glyp-plus', 'glyp-plus_filled', 'glyp-portal', 'glyp-price_increase', 'glyp-price_increase_alt', 'glyp-pricing_table', 'glyp-print', 'glyp-privacy', 'glyp-product_sale', 'glyp-production', 'glyp-professional_consultation', 'glyp-program', 'glyp-program_elements', 'glyp-program_initiation', 'glyp-program_order', 'glyp-program_review', 'glyp-promo', 'glyp-proposal', 'glyp-protection', 'glyp-purchase_order', 'glyp-quality', 'glyp-radio_checked', 'glyp-radio_empty', 'glyp-reassign', 'glyp-receipt', 'glyp-recent', 'glyp-recommendation', 'glyp-record_details', 'glyp-recurring_revenue', 'glyp-redo', 'glyp-refresh', 'glyp-refund', 'glyp-region', 'glyp-released', 'glyp-remove', 'glyp-renewal', 'glyp-report', 'glyp-required_input', 'glyp-reschedule', 'glyp-restaurant_bar', 'glyp-revenue', 'glyp-review', 'glyp-rfid', 'glyp-ride_along', 'glyp-rodent_exclusion', 'glyp-route_change', 'glyp-route_optimization', 'glyp-rows', 'glyp-ruler', 'glyp-sales', 'glyp-sales_contest', 'glyp-sales_pipeline', 'glyp-sales_tax', 'glyp-sales_tax_exemption', 'glyp-schedule_lock', 'glyp-schedule_lock_afternoon', 'glyp-schedule_lock_day', 'glyp-schedule_lock_exact', 'glyp-schedule_lock_four_hour', 'glyp-schedule_lock_morning', 'glyp-schedule_lock_none', 'glyp-schedule_lock_two_day', 'glyp-schedule_lock_two_hour', 'glyp-schedule_lock_week', 'glyp-schedule_tyoe_every', 'glyp-schedule_type_every', 'glyp-schedule_type_none', 'glyp-schedule_type_on_demand', 'glyp-schedule_type_schedule', 'glyp-scheduled', 'glyp-scheduling', 'glyp-school_church', 'glyp-script', 'glyp-search', 'glyp-seeding', 'glyp-segment', 'glyp-sent', 'glyp-sentricon', 'glyp-service_agreement', 'glyp-service_form', 'glyp-service_miscellaneous', 'glyp-service_reminder', 'glyp-service_report', 'glyp-service_request', 'glyp-services', 'glyp-settings', 'glyp-setup', 'glyp-signature', 'glyp-simulator', 'glyp-site_map', 'glyp-site_map_annotation', 'glyp-site_map_chemical', 'glyp-site_map_edit_details', 'glyp-site_map_edit_geo', 'glyp-site_map_equipment', 'glyp-site_map_exterior', 'glyp-site_map_foundation', 'glyp-site_map_icon', 'glyp-site_map_interior', 'glyp-site_map_label', 'glyp-site_map_perimeter', 'glyp-site_map_settings_left', 'glyp-site_map_settings_right', 'glyp-site_map_template', 'glyp-skip', 'glyp-smart_traps', 'glyp-sms', 'glyp-snow_removal', 'glyp-sort', 'glyp-special', 'glyp-split', 'glyp-spp_scorecard', 'glyp-square_edge', 'glyp-start_sheet', 'glyp-start_time', 'glyp-statement', 'glyp-states', 'glyp-sticky', 'glyp-stop_time', 'glyp-store_material', 'glyp-store_order', 'glyp-store_order_back_order', 'glyp-store_order_cancelled', 'glyp-store_order_complete', 'glyp-store_order_pending', 'glyp-store_order_pending_return', 'glyp-store_order_pre_order', 'glyp-store_order_returned', 'glyp-stores', 'glyp-styling', 'glyp-subscribe', 'glyp-supplemental', 'glyp-support', 'glyp-sync', 'glyp-table', 'glyp-tablet', 'glyp-tablets', 'glyp-tag_manager', 'glyp-tags', 'glyp-task_runs', 'glyp-tech_pest_sightings', 'glyp-technician', 'glyp-technician_approach', 'glyp-template', 'glyp-termite_fumigation', 'glyp-terrier', 'glyp-territory', 'glyp-text', 'glyp-thermometer', 'glyp-third_party_billing', 'glyp-ticket_type', 'glyp-tickets', 'glyp-tidy', 'glyp-time', 'glyp-time_entry', 'glyp-timeline', 'glyp-toolbox', 'glyp-tqi', 'glyp-tracker', 'glyp-tracking', 'glyp-training_course', 'glyp-treatment_split', 'glyp-trends', 'glyp-trip_charge', 'glyp-ui_type', 'glyp-unchecked', 'glyp-undo', 'glyp-unit_sweep', 'glyp-unit_tag', 'glyp-university', 'glyp-unlocked', 'glyp-unscheduled', 'glyp-update_check_positions', 'glyp-upload', 'glyp-user', 'glyp-user_credit', 'glyp-user_tags', 'glyp-users', 'glyp-utility', 'glyp-vacation', 'glyp-vacuum', 'glyp-variant', 'glyp-vendor', 'glyp-versions', 'glyp-video', 'glyp-visible', 'glyp-warehouse', 'glyp-wdo', 'glyp-web_dusting', 'glyp-website', 'glyp-wildlife', 'glyp-wildlife_exclusion', 'glyp-winter_check', 'glyp-wizard', 'glyp-work', 'glyp-work_class', 'glyp-work_code', 'glyp-work_order', 'glyp-work_production', 'glyp-work_progress', 'glyp-work_yield', 'glyp-year', 'glyp-yield', 'glyp-zip_code', 'glyp-zone_adjacent', 'glyp-zone_check', 'glyp-zone_production', 'glyp-zone_remote', 'glyp-zoom_fit'] as const
|
|
4
|
+
|
|
5
|
+
const Glyps = {
|
|
6
|
+
names
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export type GlypName = typeof names[number]
|
|
10
|
+
|
|
11
|
+
export default Glyps
|
package/package.json
CHANGED
|
@@ -4,22 +4,26 @@
|
|
|
4
4
|
"files": [
|
|
5
5
|
"*"
|
|
6
6
|
],
|
|
7
|
-
"version": "4.0.
|
|
7
|
+
"version": "4.0.16",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "https://github.com/Terrier-Tech/terrier-engine"
|
|
11
11
|
},
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"scripts": {
|
|
14
|
-
"check": "tsc -p app/frontend -noEmit"
|
|
14
|
+
"check": "tsc -p app/frontend -noEmit",
|
|
15
|
+
"test": "vitest"
|
|
15
16
|
},
|
|
16
17
|
"dependencies": {
|
|
18
|
+
"dayjs": "^1.11.7",
|
|
19
|
+
"inflection": "^2.0.1",
|
|
17
20
|
"tuff-core": "^0.25.0"
|
|
18
21
|
},
|
|
19
22
|
"devDependencies": {
|
|
20
23
|
"@types/node": "^18.16.3",
|
|
21
24
|
"glyphs2font": "^1.2.4",
|
|
22
25
|
"prettier": "^2.8.8",
|
|
23
|
-
"svgo": "^3.0.2"
|
|
26
|
+
"svgo": "^3.0.2",
|
|
27
|
+
"vitest": "^0.31.1"
|
|
24
28
|
}
|
|
25
29
|
}
|
package/schema.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import Api from "./api"
|
|
2
|
+
|
|
3
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
4
|
+
// Schema Definitions
|
|
5
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Definition for a single column in the schema.
|
|
9
|
+
*/
|
|
10
|
+
export type ColumnDef = {
|
|
11
|
+
name: string
|
|
12
|
+
nullable: boolean
|
|
13
|
+
array: boolean
|
|
14
|
+
type: string
|
|
15
|
+
possible_values?: string[]
|
|
16
|
+
default?: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Definition for a single belongs_to relationship.
|
|
21
|
+
*/
|
|
22
|
+
export type BelongsToDef = {
|
|
23
|
+
name: string
|
|
24
|
+
model: string
|
|
25
|
+
optional: boolean
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Definition for a single has_many relationship.
|
|
30
|
+
*/
|
|
31
|
+
export type HasManyDef = {
|
|
32
|
+
name: string
|
|
33
|
+
model: string
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Definition for a single model in the schema.
|
|
38
|
+
*/
|
|
39
|
+
export type ModelDef = {
|
|
40
|
+
table_name: string
|
|
41
|
+
columns: Record<string, ColumnDef>
|
|
42
|
+
belongs_to: Record<string, BelongsToDef>
|
|
43
|
+
has_many: Record<string, HasManyDef>
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Definition for an entire schema.
|
|
48
|
+
*/
|
|
49
|
+
export type SchemaDef = {
|
|
50
|
+
models: ModelDef
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
55
|
+
// Get Schema
|
|
56
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
57
|
+
|
|
58
|
+
async function get(): Promise<SchemaDef> {
|
|
59
|
+
const res = await Api.safeGet<{schema: SchemaDef}>("/db/schema.json", {})
|
|
60
|
+
return res.schema
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const Schema = {
|
|
64
|
+
get
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export default Schema
|
package/theme.ts
CHANGED
|
@@ -32,15 +32,15 @@ export type Action<TT extends ThemeType> = {
|
|
|
32
32
|
* Options to pass to `render` that control how the actions are displayed.
|
|
33
33
|
*/
|
|
34
34
|
export type RenderActionOptions<TT extends ThemeType> = {
|
|
35
|
-
iconColor?: TT['colors']
|
|
35
|
+
iconColor?: TT['colors'] | null
|
|
36
36
|
badgeColor?: TT['colors']
|
|
37
37
|
defaultClass?: string
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export default abstract class Theme<TT extends ThemeType> {
|
|
41
|
-
abstract renderIcon(parent: PartTag, icon: TT['icons'], color?: TT['colors']): void
|
|
41
|
+
abstract renderIcon(parent: PartTag, icon: TT['icons'], color?: TT['colors'] | null): void
|
|
42
42
|
|
|
43
|
-
abstract renderCloseIcon(parent: PartTag, color?: TT['colors']): void
|
|
43
|
+
abstract renderCloseIcon(parent: PartTag, color?: TT['colors'] | null): void
|
|
44
44
|
|
|
45
45
|
abstract colorValue(name: TT['colors']): string
|
|
46
46
|
|
package/toasts.ts
CHANGED
|
@@ -33,7 +33,7 @@ function show<TT extends ThemeType>(message: string, options: ToastOptions<TT>,
|
|
|
33
33
|
parent.class('tt-toast')
|
|
34
34
|
parent.class(options.color)
|
|
35
35
|
if (options?.icon) {
|
|
36
|
-
theme.renderIcon(parent, options.icon,
|
|
36
|
+
theme.renderIcon(parent, options.icon, null)
|
|
37
37
|
}
|
|
38
38
|
parent.span('.text', {text: message})
|
|
39
39
|
})
|